Lines Matching refs:zq

44 	struct zcrypt_queue *zq = dev_get_drvdata(dev);  in online_show()  local
46 int online = aq->config && !aq->chkstop && zq->online ? 1 : 0; in online_show()
55 struct zcrypt_queue *zq = dev_get_drvdata(dev); in online_store() local
57 struct zcrypt_card *zc = zq->zcard; in online_store()
68 zq->online = online; in online_store()
71 __func__, AP_QID_CARD(zq->queue->qid), in online_store()
72 AP_QID_QUEUE(zq->queue->qid), online); in online_store()
77 ap_flush_queue(zq->queue); in online_store()
87 struct zcrypt_queue *zq = dev_get_drvdata(dev); in load_show() local
89 return sysfs_emit(buf, "%d\n", atomic_read(&zq->load)); in load_show()
104 bool zcrypt_queue_force_online(struct zcrypt_queue *zq, int online) in zcrypt_queue_force_online() argument
106 if (!!zq->online != !!online) { in zcrypt_queue_force_online()
107 zq->online = online; in zcrypt_queue_force_online()
109 ap_flush_queue(zq->queue); in zcrypt_queue_force_online()
117 struct zcrypt_queue *zq; in zcrypt_queue_alloc() local
119 zq = kzalloc(sizeof(*zq), GFP_KERNEL); in zcrypt_queue_alloc()
120 if (!zq) in zcrypt_queue_alloc()
122 zq->reply.msg = kmalloc(reply_buf_size, GFP_KERNEL); in zcrypt_queue_alloc()
123 if (!zq->reply.msg) in zcrypt_queue_alloc()
125 zq->reply.bufsize = reply_buf_size; in zcrypt_queue_alloc()
126 INIT_LIST_HEAD(&zq->list); in zcrypt_queue_alloc()
127 kref_init(&zq->refcount); in zcrypt_queue_alloc()
128 return zq; in zcrypt_queue_alloc()
131 kfree(zq); in zcrypt_queue_alloc()
136 void zcrypt_queue_free(struct zcrypt_queue *zq) in zcrypt_queue_free() argument
138 kfree(zq->reply.msg); in zcrypt_queue_free()
139 kfree(zq); in zcrypt_queue_free()
145 struct zcrypt_queue *zq = in zcrypt_queue_release() local
147 zcrypt_queue_free(zq); in zcrypt_queue_release()
150 void zcrypt_queue_get(struct zcrypt_queue *zq) in zcrypt_queue_get() argument
152 kref_get(&zq->refcount); in zcrypt_queue_get()
156 int zcrypt_queue_put(struct zcrypt_queue *zq) in zcrypt_queue_put() argument
158 return kref_put(&zq->refcount, zcrypt_queue_release); in zcrypt_queue_put()
168 int zcrypt_queue_register(struct zcrypt_queue *zq) in zcrypt_queue_register() argument
174 zc = dev_get_drvdata(&zq->queue->card->ap_dev.device); in zcrypt_queue_register()
176 zq->zcard = zc; in zcrypt_queue_register()
177 zq->online = 1; /* New devices are online by default. */ in zcrypt_queue_register()
180 __func__, AP_QID_CARD(zq->queue->qid), in zcrypt_queue_register()
181 AP_QID_QUEUE(zq->queue->qid)); in zcrypt_queue_register()
183 list_add_tail(&zq->list, &zc->zqueues); in zcrypt_queue_register()
186 rc = sysfs_create_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_register()
191 if (zq->ops->rng) { in zcrypt_queue_register()
199 sysfs_remove_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_register()
203 list_del_init(&zq->list); in zcrypt_queue_register()
216 void zcrypt_queue_unregister(struct zcrypt_queue *zq) in zcrypt_queue_unregister() argument
221 __func__, AP_QID_CARD(zq->queue->qid), in zcrypt_queue_unregister()
222 AP_QID_QUEUE(zq->queue->qid)); in zcrypt_queue_unregister()
224 zc = zq->zcard; in zcrypt_queue_unregister()
226 list_del_init(&zq->list); in zcrypt_queue_unregister()
228 if (zq->ops->rng) in zcrypt_queue_unregister()
230 sysfs_remove_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_unregister()
233 zcrypt_queue_put(zq); in zcrypt_queue_unregister()