Lines Matching refs:zq

43 	struct zcrypt_queue *zq = dev_get_drvdata(dev);  in online_show()  local
45 int online = aq->config && !aq->chkstop && 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()
67 zq->online = online; in online_store()
70 __func__, AP_QID_CARD(zq->queue->qid), in online_store()
71 AP_QID_QUEUE(zq->queue->qid), online); in online_store()
76 ap_flush_queue(zq->queue); in online_store()
86 struct zcrypt_queue *zq = dev_get_drvdata(dev); in load_show() local
88 return sysfs_emit(buf, "%d\n", atomic_read(&zq->load)); in load_show()
103 bool zcrypt_queue_force_online(struct zcrypt_queue *zq, int online) in zcrypt_queue_force_online() argument
105 if (!!zq->online != !!online) { in zcrypt_queue_force_online()
106 zq->online = online; in zcrypt_queue_force_online()
108 ap_flush_queue(zq->queue); in zcrypt_queue_force_online()
116 struct zcrypt_queue *zq; in zcrypt_queue_alloc() local
118 zq = kzalloc(sizeof(*zq), GFP_KERNEL); in zcrypt_queue_alloc()
119 if (!zq) in zcrypt_queue_alloc()
121 zq->reply.msg = kmalloc(reply_buf_size, GFP_KERNEL); in zcrypt_queue_alloc()
122 if (!zq->reply.msg) in zcrypt_queue_alloc()
124 zq->reply.bufsize = reply_buf_size; in zcrypt_queue_alloc()
125 INIT_LIST_HEAD(&zq->list); in zcrypt_queue_alloc()
126 kref_init(&zq->refcount); in zcrypt_queue_alloc()
127 return zq; in zcrypt_queue_alloc()
130 kfree(zq); in zcrypt_queue_alloc()
135 void zcrypt_queue_free(struct zcrypt_queue *zq) in zcrypt_queue_free() argument
137 kfree(zq->reply.msg); in zcrypt_queue_free()
138 kfree(zq); in zcrypt_queue_free()
144 struct zcrypt_queue *zq = in zcrypt_queue_release() local
146 zcrypt_queue_free(zq); in zcrypt_queue_release()
149 void zcrypt_queue_get(struct zcrypt_queue *zq) in zcrypt_queue_get() argument
151 kref_get(&zq->refcount); in zcrypt_queue_get()
155 int zcrypt_queue_put(struct zcrypt_queue *zq) in zcrypt_queue_put() argument
157 return kref_put(&zq->refcount, zcrypt_queue_release); in zcrypt_queue_put()
167 int zcrypt_queue_register(struct zcrypt_queue *zq) in zcrypt_queue_register() argument
173 zc = dev_get_drvdata(&zq->queue->card->ap_dev.device); in zcrypt_queue_register()
175 zq->zcard = zc; in zcrypt_queue_register()
176 zq->online = 1; /* New devices are online by default. */ in zcrypt_queue_register()
179 __func__, AP_QID_CARD(zq->queue->qid), in zcrypt_queue_register()
180 AP_QID_QUEUE(zq->queue->qid)); in zcrypt_queue_register()
182 list_add_tail(&zq->list, &zc->zqueues); in zcrypt_queue_register()
185 rc = sysfs_create_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_register()
190 if (zq->ops->rng) { in zcrypt_queue_register()
198 sysfs_remove_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_register()
202 list_del_init(&zq->list); in zcrypt_queue_register()
215 void zcrypt_queue_unregister(struct zcrypt_queue *zq) in zcrypt_queue_unregister() argument
220 __func__, AP_QID_CARD(zq->queue->qid), in zcrypt_queue_unregister()
221 AP_QID_QUEUE(zq->queue->qid)); in zcrypt_queue_unregister()
223 zc = zq->zcard; in zcrypt_queue_unregister()
225 list_del_init(&zq->list); in zcrypt_queue_unregister()
227 if (zq->ops->rng) in zcrypt_queue_unregister()
229 sysfs_remove_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_unregister()
232 zcrypt_queue_put(zq); in zcrypt_queue_unregister()