Lines Matching refs:zq

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