Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/qoriq/caam/caam_crypto.h
- This file was added.
/* | |||||
* Copyright 2024 Alstom Group | |||||
* Copyright 2024 Sii Poland | |||||
* | |||||
* SPDX-License-Identifier: BSD-3-Clause | |||||
* | |||||
*/ | |||||
#ifndef CAAM_CRYPTO_H | |||||
#define CAAM_CRYPTO_H | |||||
#include <sys/cdefs.h> | |||||
#include <sys/param.h> | |||||
#include <sys/bus.h> | |||||
#include <sys/endian.h> | |||||
#include <sys/kernel.h> | |||||
#include <sys/module.h> | |||||
#include <sys/mutex.h> | |||||
#include <sys/rman.h> | |||||
#include <sys/rwlock.h> | |||||
#include <sys/smp.h> | |||||
#include <machine/bus.h> | |||||
#include <machine/vfp.h> | |||||
#include <opencrypto/cryptodev.h> | |||||
#include <opencrypto/xform.h> | |||||
/* | |||||
* @brief Register with crypto framework and get assigned crypto id. | |||||
* | |||||
* @param [in] dev caam device handle | |||||
* | |||||
* @retval :: 0 is returned on success | |||||
* @retval :: errno is returned on internal error | |||||
*/ | |||||
int caam_crypto_attach(device_t dev); | |||||
/* | |||||
* @brief Unregister assigned crypto id from crypto framework. | |||||
* | |||||
* @param [in] dev caam device handle | |||||
*/ | |||||
void caam_crypto_detach(device_t dev); | |||||
/* | |||||
* @brief CAAM cryptodev_probesession devmethod. | |||||
* | |||||
* Informs crypto framework about CAAM crypto supported operations. | |||||
* | |||||
* @param [in] dev caam device handle | |||||
* | |||||
* @retval :: int acceleration type CAAM provides for probed algorithm | |||||
* @retval :: errno EINVAL on unsuppored operations | |||||
*/ | |||||
int caam_crypto_probesession(device_t dev, | |||||
const struct crypto_session_params *csp); | |||||
/* | |||||
* @brief CAAM cryptodev_freesession devmethod. | |||||
* | |||||
* Free a crypto session. | |||||
* | |||||
* @param [in] dev caam device handle | |||||
* @param [in] cses crypto session id | |||||
*/ | |||||
void caam_crypto_freesession(device_t dev, crypto_session_t cses); | |||||
/* | |||||
* @brief CAAM cryptodev_newsession devmethod. | |||||
* | |||||
* Initialize a new crypto session. | |||||
* | |||||
* @param [in] dev caam device handle | |||||
* @param [in] cses crypto session id | |||||
* @param [in] csp crypto session parameters | |||||
* | |||||
* @retval :: 0 is returned on success | |||||
* @retval :: errno is returned on internal error | |||||
*/ | |||||
int caam_crypto_newsession(device_t dev, crypto_session_t cses, | |||||
const struct crypto_session_params *csp); | |||||
/* | |||||
* @brief CAAM cryptodev_process devmethod. | |||||
* | |||||
* Start processing a crypto request. | |||||
* | |||||
* @param [in] dev caam device handle | |||||
* @param [in] crp Structure describing complete operation | |||||
* @param [in] hint processing hint | |||||
* | |||||
* @retval :: 0 is returned on success | |||||
* @retval :: errno is returned on internal error | |||||
*/ | |||||
int caam_crypto_process(device_t dev, struct cryptop *crp, int hint); | |||||
#endif /* CAAM_CRYPTO_H */ |