Lines Matching refs:zq
44 struct zcrypt_queue *zq = aq->private; in online_show() local
45 int online = aq->config && zq->online ? 1 : 0; in online_show()
55 struct zcrypt_queue *zq = aq->private; in online_store() local
56 struct zcrypt_card *zc = zq->zcard; in online_store()
66 zq->online = online; in online_store()
69 AP_QID_CARD(zq->queue->qid), in online_store()
70 AP_QID_QUEUE(zq->queue->qid), in online_store()
74 ap_flush_queue(zq->queue); in online_store()
84 struct zcrypt_queue *zq = to_ap_queue(dev)->private; in load_show() local
86 return scnprintf(buf, PAGE_SIZE, "%d\n", atomic_read(&zq->load)); in load_show()
101 void zcrypt_queue_force_online(struct zcrypt_queue *zq, int online) in zcrypt_queue_force_online() argument
103 zq->online = online; in zcrypt_queue_force_online()
105 ap_flush_queue(zq->queue); in zcrypt_queue_force_online()
110 struct zcrypt_queue *zq; in zcrypt_queue_alloc() local
112 zq = kzalloc(sizeof(struct zcrypt_queue), GFP_KERNEL); in zcrypt_queue_alloc()
113 if (!zq) in zcrypt_queue_alloc()
115 zq->reply.msg = kmalloc(max_response_size, GFP_KERNEL); in zcrypt_queue_alloc()
116 if (!zq->reply.msg) in zcrypt_queue_alloc()
118 zq->reply.len = max_response_size; in zcrypt_queue_alloc()
119 INIT_LIST_HEAD(&zq->list); in zcrypt_queue_alloc()
120 kref_init(&zq->refcount); in zcrypt_queue_alloc()
121 return zq; in zcrypt_queue_alloc()
124 kfree(zq); in zcrypt_queue_alloc()
129 void zcrypt_queue_free(struct zcrypt_queue *zq) in zcrypt_queue_free() argument
131 kfree(zq->reply.msg); in zcrypt_queue_free()
132 kfree(zq); in zcrypt_queue_free()
138 struct zcrypt_queue *zq = in zcrypt_queue_release() local
140 zcrypt_queue_free(zq); in zcrypt_queue_release()
143 void zcrypt_queue_get(struct zcrypt_queue *zq) in zcrypt_queue_get() argument
145 kref_get(&zq->refcount); in zcrypt_queue_get()
149 int zcrypt_queue_put(struct zcrypt_queue *zq) in zcrypt_queue_put() argument
151 return kref_put(&zq->refcount, zcrypt_queue_release); in zcrypt_queue_put()
161 int zcrypt_queue_register(struct zcrypt_queue *zq) in zcrypt_queue_register() argument
167 zc = zq->queue->card->private; in zcrypt_queue_register()
169 zq->zcard = zc; in zcrypt_queue_register()
170 zq->online = 1; /* New devices are online by default. */ in zcrypt_queue_register()
173 AP_QID_CARD(zq->queue->qid), AP_QID_QUEUE(zq->queue->qid)); in zcrypt_queue_register()
175 list_add_tail(&zq->list, &zc->zqueues); in zcrypt_queue_register()
179 rc = sysfs_create_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_register()
184 if (zq->ops->rng) { in zcrypt_queue_register()
192 sysfs_remove_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_register()
196 list_del_init(&zq->list); in zcrypt_queue_register()
209 void zcrypt_queue_unregister(struct zcrypt_queue *zq) in zcrypt_queue_unregister() argument
214 AP_QID_CARD(zq->queue->qid), AP_QID_QUEUE(zq->queue->qid)); in zcrypt_queue_unregister()
216 zc = zq->zcard; in zcrypt_queue_unregister()
218 list_del_init(&zq->list); in zcrypt_queue_unregister()
221 if (zq->ops->rng) in zcrypt_queue_unregister()
223 sysfs_remove_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_unregister()