Lines Matching refs:vcrypto_dev
24 * virtcrypto_devmgr_add_dev() - Add vcrypto_dev to the acceleration
26 * @vcrypto_dev: Pointer to virtio crypto device.
33 int virtcrypto_devmgr_add_dev(struct virtio_crypto *vcrypto_dev)
49 if (ptr == vcrypto_dev) {
54 atomic_set(&vcrypto_dev->ref_count, 0);
55 list_add_tail(&vcrypto_dev->list, &virtio_crypto_table);
56 vcrypto_dev->dev_id = num_devices++;
67 * virtcrypto_devmgr_rm_dev() - Remove vcrypto_dev from the acceleration
69 * @vcrypto_dev: Pointer to virtio crypto device.
76 void virtcrypto_devmgr_rm_dev(struct virtio_crypto *vcrypto_dev)
79 list_del(&vcrypto_dev->list);
85 * virtcrypto_dev_get() - Increment vcrypto_dev reference count
86 * @vcrypto_dev: Pointer to virtio crypto device.
88 * Increment the vcrypto_dev refcount and if this is the first time
89 * incrementing it during this period the vcrypto_dev is in use,
95 int virtcrypto_dev_get(struct virtio_crypto *vcrypto_dev)
97 if (atomic_add_return(1, &vcrypto_dev->ref_count) == 1)
98 if (!try_module_get(vcrypto_dev->owner))
104 * virtcrypto_dev_put() - Decrement vcrypto_dev reference count
105 * @vcrypto_dev: Pointer to virtio crypto device.
107 * Decrement the vcrypto_dev refcount and if this is the last time
108 * decrementing it during this period the vcrypto_dev is in use,
114 void virtcrypto_dev_put(struct virtio_crypto *vcrypto_dev)
116 if (atomic_sub_return(1, &vcrypto_dev->ref_count) == 0)
117 module_put(vcrypto_dev->owner);
122 * @vcrypto_dev: Pointer to virtio crypto device.
128 int virtcrypto_dev_started(struct virtio_crypto *vcrypto_dev)
130 return (vcrypto_dev->status & VIRTIO_CRYPTO_S_HW_READY);
134 * virtcrypto_get_dev_node() - Get vcrypto_dev on the node.
146 * Return: pointer to vcrypto_dev or NULL if not found.
151 struct virtio_crypto *vcrypto_dev = NULL, *tmp_dev;
164 vcrypto_dev = tmp_dev;
170 if (!vcrypto_dev) {
179 vcrypto_dev = tmp_dev;
185 if (!vcrypto_dev)
188 virtcrypto_dev_get(vcrypto_dev);
189 return vcrypto_dev;