Lines Matching refs:zq
43 struct zcrypt_queue *zq = to_ap_queue(dev)->private; in online_show() local
45 return snprintf(buf, PAGE_SIZE, "%d\n", zq->online); in online_show()
52 struct zcrypt_queue *zq = to_ap_queue(dev)->private; in online_store() local
53 struct zcrypt_card *zc = zq->zcard; in online_store()
61 zq->online = online; in online_store()
64 AP_QID_CARD(zq->queue->qid), in online_store()
65 AP_QID_QUEUE(zq->queue->qid), in online_store()
69 ap_flush_queue(zq->queue); in online_store()
79 struct zcrypt_queue *zq = to_ap_queue(dev)->private; in load_show() local
81 return snprintf(buf, PAGE_SIZE, "%d\n", atomic_read(&zq->load)); in load_show()
96 void zcrypt_queue_force_online(struct zcrypt_queue *zq, int online) in zcrypt_queue_force_online() argument
98 zq->online = online; in zcrypt_queue_force_online()
100 ap_flush_queue(zq->queue); in zcrypt_queue_force_online()
105 struct zcrypt_queue *zq; in zcrypt_queue_alloc() local
107 zq = kzalloc(sizeof(struct zcrypt_queue), GFP_KERNEL); in zcrypt_queue_alloc()
108 if (!zq) in zcrypt_queue_alloc()
110 zq->reply.message = kmalloc(max_response_size, GFP_KERNEL); in zcrypt_queue_alloc()
111 if (!zq->reply.message) in zcrypt_queue_alloc()
113 zq->reply.length = max_response_size; in zcrypt_queue_alloc()
114 INIT_LIST_HEAD(&zq->list); in zcrypt_queue_alloc()
115 kref_init(&zq->refcount); in zcrypt_queue_alloc()
116 return zq; in zcrypt_queue_alloc()
119 kfree(zq); in zcrypt_queue_alloc()
124 void zcrypt_queue_free(struct zcrypt_queue *zq) in zcrypt_queue_free() argument
126 kfree(zq->reply.message); in zcrypt_queue_free()
127 kfree(zq); in zcrypt_queue_free()
133 struct zcrypt_queue *zq = in zcrypt_queue_release() local
135 zcrypt_queue_free(zq); in zcrypt_queue_release()
138 void zcrypt_queue_get(struct zcrypt_queue *zq) in zcrypt_queue_get() argument
140 kref_get(&zq->refcount); in zcrypt_queue_get()
144 int zcrypt_queue_put(struct zcrypt_queue *zq) in zcrypt_queue_put() argument
146 return kref_put(&zq->refcount, zcrypt_queue_release); in zcrypt_queue_put()
156 int zcrypt_queue_register(struct zcrypt_queue *zq) in zcrypt_queue_register() argument
162 zc = zq->queue->card->private; in zcrypt_queue_register()
164 zq->zcard = zc; in zcrypt_queue_register()
165 zq->online = 1; /* New devices are online by default. */ in zcrypt_queue_register()
168 AP_QID_CARD(zq->queue->qid), AP_QID_QUEUE(zq->queue->qid)); in zcrypt_queue_register()
170 list_add_tail(&zq->list, &zc->zqueues); in zcrypt_queue_register()
174 rc = sysfs_create_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_register()
178 get_device(&zq->queue->ap_dev.device); in zcrypt_queue_register()
180 if (zq->ops->rng) { in zcrypt_queue_register()
188 sysfs_remove_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_register()
190 put_device(&zq->queue->ap_dev.device); in zcrypt_queue_register()
193 list_del_init(&zq->list); in zcrypt_queue_register()
206 void zcrypt_queue_unregister(struct zcrypt_queue *zq) in zcrypt_queue_unregister() argument
211 AP_QID_CARD(zq->queue->qid), AP_QID_QUEUE(zq->queue->qid)); in zcrypt_queue_unregister()
213 zc = zq->zcard; in zcrypt_queue_unregister()
215 list_del_init(&zq->list); in zcrypt_queue_unregister()
219 if (zq->ops->rng) in zcrypt_queue_unregister()
221 sysfs_remove_group(&zq->queue->ap_dev.device.kobj, in zcrypt_queue_unregister()
223 put_device(&zq->queue->ap_dev.device); in zcrypt_queue_unregister()
224 zcrypt_queue_put(zq); in zcrypt_queue_unregister()