Lines Matching refs:zq

45 	struct zcrypt_queue *zq = to_ap_queue(dev)->private;  in online_show()  local
47 return snprintf(buf, PAGE_SIZE, "%d\n", zq->online); in online_show()
54 struct zcrypt_queue *zq = to_ap_queue(dev)->private; in online_store() local
55 struct zcrypt_card *zc = zq->zcard; in online_store()
63 zq->online = online; in online_store()
66 AP_QID_CARD(zq->queue->qid), in online_store()
67 AP_QID_QUEUE(zq->queue->qid), in online_store()
71 ap_flush_queue(zq->queue); in online_store()
81 struct zcrypt_queue *zq = to_ap_queue(dev)->private; in load_show() local
83 return snprintf(buf, PAGE_SIZE, "%d\n", atomic_read(&zq->load)); in load_show()
98 void zcrypt_queue_force_online(struct zcrypt_queue *zq, int online) in zcrypt_queue_force_online() argument
100 zq->online = online; in zcrypt_queue_force_online()
102 ap_flush_queue(zq->queue); in zcrypt_queue_force_online()
107 struct zcrypt_queue *zq; in zcrypt_queue_alloc() local
109 zq = kzalloc(sizeof(struct zcrypt_queue), GFP_KERNEL); in zcrypt_queue_alloc()
110 if (!zq) in zcrypt_queue_alloc()
112 zq->reply.message = kmalloc(max_response_size, GFP_KERNEL); in zcrypt_queue_alloc()
113 if (!zq->reply.message) in zcrypt_queue_alloc()
115 zq->reply.length = max_response_size; in zcrypt_queue_alloc()
116 INIT_LIST_HEAD(&zq->list); in zcrypt_queue_alloc()
117 kref_init(&zq->refcount); in zcrypt_queue_alloc()
118 return zq; in zcrypt_queue_alloc()
121 kfree(zq); in zcrypt_queue_alloc()
126 void zcrypt_queue_free(struct zcrypt_queue *zq) in zcrypt_queue_free() argument
128 kfree(zq->reply.message); in zcrypt_queue_free()
129 kfree(zq); in zcrypt_queue_free()
135 struct zcrypt_queue *zq = in zcrypt_queue_release() local
137 zcrypt_queue_free(zq); in zcrypt_queue_release()
140 void zcrypt_queue_get(struct zcrypt_queue *zq) in zcrypt_queue_get() argument
142 kref_get(&zq->refcount); in zcrypt_queue_get()
146 int zcrypt_queue_put(struct zcrypt_queue *zq) in zcrypt_queue_put() argument
148 return kref_put(&zq->refcount, zcrypt_queue_release); in zcrypt_queue_put()
158 int zcrypt_queue_register(struct zcrypt_queue *zq) in zcrypt_queue_register() argument
164 zc = zq->queue->card->private; in zcrypt_queue_register()
166 zq->zcard = zc; in zcrypt_queue_register()
167 zq->online = 1; /* New devices are online by default. */ in zcrypt_queue_register()
170 AP_QID_CARD(zq->queue->qid), AP_QID_QUEUE(zq->queue->qid)); in zcrypt_queue_register()
172 list_add_tail(&zq->list, &zc->zqueues); in zcrypt_queue_register()
176 rc = sysfs_create_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_register()
180 get_device(&zq->queue->ap_dev.device); in zcrypt_queue_register()
182 if (zq->ops->rng) { in zcrypt_queue_register()
190 sysfs_remove_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_register()
192 put_device(&zq->queue->ap_dev.device); in zcrypt_queue_register()
195 list_del_init(&zq->list); in zcrypt_queue_register()
208 void zcrypt_queue_unregister(struct zcrypt_queue *zq) in zcrypt_queue_unregister() argument
213 AP_QID_CARD(zq->queue->qid), AP_QID_QUEUE(zq->queue->qid)); in zcrypt_queue_unregister()
215 zc = zq->zcard; in zcrypt_queue_unregister()
217 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()
225 put_device(&zq->queue->ap_dev.device); in zcrypt_queue_unregister()
226 zcrypt_queue_put(zq); in zcrypt_queue_unregister()