Lines Matching refs:zq

43 	struct zcrypt_queue *zq = dev_get_drvdata(dev);
45 int online = aq->config && zq->online ? 1 : 0;
54 struct zcrypt_queue *zq = dev_get_drvdata(dev);
56 struct zcrypt_card *zc = zq->zcard;
66 zq->online = online;
69 __func__, AP_QID_CARD(zq->queue->qid),
70 AP_QID_QUEUE(zq->queue->qid), online);
75 ap_flush_queue(zq->queue);
85 struct zcrypt_queue *zq = dev_get_drvdata(dev);
87 return sysfs_emit(buf, "%d\n", atomic_read(&zq->load));
102 bool zcrypt_queue_force_online(struct zcrypt_queue *zq, int online)
104 if (!!zq->online != !!online) {
105 zq->online = online;
107 ap_flush_queue(zq->queue);
115 struct zcrypt_queue *zq;
117 zq = kzalloc(sizeof(*zq), GFP_KERNEL);
118 if (!zq)
120 zq->reply.msg = kmalloc(reply_buf_size, GFP_KERNEL);
121 if (!zq->reply.msg)
123 zq->reply.bufsize = reply_buf_size;
124 INIT_LIST_HEAD(&zq->list);
125 kref_init(&zq->refcount);
126 return zq;
129 kfree(zq);
134 void zcrypt_queue_free(struct zcrypt_queue *zq)
136 kfree(zq->reply.msg);
137 kfree(zq);
143 struct zcrypt_queue *zq =
145 zcrypt_queue_free(zq);
148 void zcrypt_queue_get(struct zcrypt_queue *zq)
150 kref_get(&zq->refcount);
154 int zcrypt_queue_put(struct zcrypt_queue *zq)
156 return kref_put(&zq->refcount, zcrypt_queue_release);
162 * @zq: Pointer to a crypto queue device
166 int zcrypt_queue_register(struct zcrypt_queue *zq)
172 zc = dev_get_drvdata(&zq->queue->card->ap_dev.device);
174 zq->zcard = zc;
175 zq->online = 1; /* New devices are online by default. */
178 __func__, AP_QID_CARD(zq->queue->qid),
179 AP_QID_QUEUE(zq->queue->qid));
181 list_add_tail(&zq->list, &zc->zqueues);
184 rc = sysfs_create_group(&zq->queue->ap_dev.device.kobj,
189 if (zq->ops->rng) {
197 sysfs_remove_group(&zq->queue->ap_dev.device.kobj,
201 list_del_init(&zq->list);
210 * @zq: Pointer to crypto queue device
214 void zcrypt_queue_unregister(struct zcrypt_queue *zq)
219 __func__, AP_QID_CARD(zq->queue->qid),
220 AP_QID_QUEUE(zq->queue->qid));
222 zc = zq->zcard;
224 list_del_init(&zq->list);
226 if (zq->ops->rng)
228 sysfs_remove_group(&zq->queue->ap_dev.device.kobj,
231 zcrypt_queue_put(zq);