#ifndef CAAM_JR_PVT_H
#define CAAM_JR_PVT_H
+#include <desc/ipsec.h>
+#include <dpaax_iova_table.h>
+
/* NXP CAAM JR PMD device name */
#define CAAM_JR_ALG_UNSUPPORT (-1)
enum rte_crypto_cipher_algorithm cipher_alg; /* Cipher Algorithm*/
enum rte_crypto_auth_algorithm auth_alg; /* Authentication Algorithm*/
enum rte_crypto_aead_algorithm aead_alg; /* AEAD Algorithm*/
+ enum rte_security_session_protocol proto_alg; /* Security Algorithm*/
union {
struct {
uint8_t *data; /* pointer to key data */
} iv; /* Initialisation vector parameters */
uint16_t auth_only_len; /* Length of data for Auth only */
uint32_t digest_length;
+ struct ipsec_encap_pdb encap_pdb;
struct ip ip4_hdr;
+ struct ipsec_decap_pdb decap_pdb;
struct caam_jr_qp *qp;
struct sec_cdb *cdb; /* cmd block associated with qp */
struct rte_mempool *ctx_pool; /* session mempool for caam_jr_op_ctx */
/* Structure encompassing a job descriptor which is to be processed
* by SEC. User should also initialise this structure with the callback
- * function pointer which will be called by driver after recieving proccessed
+ * function pointer which will be called by driver after receiving processed
* descriptor from SEC. User data is also passed in this data structure which
* will be sent as an argument to the user callback function.
*/
}
struct uio_job_ring {
uint32_t jr_id;
- uint32_t uio_fd;
+ int uio_fd;
void *register_base_addr;
int map_size;
int uio_minor_number;
int sec_cleanup(void);
int sec_configure(void);
+void sec_uio_job_rings_init(void);
struct uio_job_ring *config_job_ring(void);
-void free_job_ring(uint32_t uio_fd);
+void free_job_ring(int uio_fd);
/* For Dma memory allocation of specified length and alignment */
static inline void *
static inline void *
caam_jr_dma_ptov(rte_iova_t paddr)
{
+ void *va;
+ va = dpaax_iova_table_get_va(paddr);
+ if (likely(va != NULL))
+ return va;
+
return rte_mem_iova2virt(paddr);
}
* @retval 0 for success
* @retval -1 value for error
*/
-uint32_t caam_jr_enable_irqs(uint32_t uio_fd);
+int caam_jr_enable_irqs(int uio_fd);
/** @brief Request to SEC kernel driver to disable interrupts for descriptor
* finished processing
* value that indicates an IRQ disable action into UIO file descriptor
* of this job ring.
*
- * @param [in] uio_fd UIO File descripto
+ * @param [in] uio_fd UIO File descriptor
* @retval 0 for success
* @retval -1 value for error
*
*/
-uint32_t caam_jr_disable_irqs(uint32_t uio_fd);
+int caam_jr_disable_irqs(int uio_fd);
#endif