cryptodev: introduce an unified wrapper for crypto operation

We use an opaque point to the VirtIOCryptoReq which
can support different packets based on different
algorithms.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Gonglei 2016-10-28 16:33:29 +08:00 committed by Michael S. Tsirkin
parent 04b9b37edd
commit d6634ac09a
3 changed files with 38 additions and 13 deletions

View file

@ -278,20 +278,21 @@ int cryptodev_backend_sym_close_session(
uint32_t queue_index, Error **errp);
/**
* cryptodev_backend_sym_operation:
* cryptodev_backend_crypto_operation:
* @backend: the cryptodev backend object
* @op_info: parameters needed by symmetric crypto operation
* @opaque: pointer to a VirtIOCryptoReq object
* @queue_index: queue index of cryptodev backend client
* @errp: pointer to a NULL-initialized error object
*
* Do symmetric crypto operation, such as encryption and
* Do crypto operation, such as encryption and
* decryption
*
* Returns: 0 on success, or Negative on error
* Returns: VIRTIO_CRYPTO_OK on success,
* or -VIRTIO_CRYPTO_* on error
*/
int cryptodev_backend_sym_operation(
int cryptodev_backend_crypto_operation(
CryptoDevBackend *backend,
CryptoDevBackendSymOpInfo *op_info,
void *opaque,
uint32_t queue_index, Error **errp);
#endif /* CRYPTODEV_H */