Commit 358961d1 authored by Harsh Jain's avatar Harsh Jain Committed by Herbert Xu

crypto: chcr - Added new structure chcr_wr

Added new structure chcr_wr to populate Work Request Header.
Signed-off-by: default avatarJitendra Lulla <JLULLA@chelsio.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 39f91a34
This diff is collapsed.
...@@ -108,30 +108,24 @@ ...@@ -108,30 +108,24 @@
#define IPAD_DATA 0x36363636 #define IPAD_DATA 0x36363636
#define OPAD_DATA 0x5c5c5c5c #define OPAD_DATA 0x5c5c5c5c
#define TRANSHDR_SIZE(alignedkctx_len)\ #define TRANSHDR_SIZE(kctx_len)\
(sizeof(struct ulptx_idata) +\ (sizeof(struct chcr_wr) +\
sizeof(struct ulp_txpkt) +\ kctx_len)
sizeof(struct fw_crypto_lookaside_wr) +\ #define CIPHER_TRANSHDR_SIZE(kctx_len, sge_pairs) \
sizeof(struct cpl_tx_sec_pdu) +\ (TRANSHDR_SIZE((kctx_len)) + (sge_pairs) +\
(alignedkctx_len))
#define CIPHER_TRANSHDR_SIZE(alignedkctx_len, sge_pairs) \
(TRANSHDR_SIZE(alignedkctx_len) + sge_pairs +\
sizeof(struct cpl_rx_phys_dsgl)) sizeof(struct cpl_rx_phys_dsgl))
#define HASH_TRANSHDR_SIZE(alignedkctx_len)\ #define HASH_TRANSHDR_SIZE(kctx_len)\
(TRANSHDR_SIZE(alignedkctx_len) + DUMMY_BYTES) (TRANSHDR_SIZE(kctx_len) + DUMMY_BYTES)
#define SEC_CPL_OFFSET (sizeof(struct fw_crypto_lookaside_wr) + \
sizeof(struct ulp_txpkt) + \
sizeof(struct ulptx_idata))
#define FILL_SEC_CPL_OP_IVINSR(id, len, hldr, ofst) \ #define FILL_SEC_CPL_OP_IVINSR(id, len, ofst) \
htonl( \ htonl( \
CPL_TX_SEC_PDU_OPCODE_V(CPL_TX_SEC_PDU) | \ CPL_TX_SEC_PDU_OPCODE_V(CPL_TX_SEC_PDU) | \
CPL_TX_SEC_PDU_RXCHID_V((id)) | \ CPL_TX_SEC_PDU_RXCHID_V((id)) | \
CPL_TX_SEC_PDU_ACKFOLLOWS_V(0) | \ CPL_TX_SEC_PDU_ACKFOLLOWS_V(0) | \
CPL_TX_SEC_PDU_ULPTXLPBK_V(1) | \ CPL_TX_SEC_PDU_ULPTXLPBK_V(1) | \
CPL_TX_SEC_PDU_CPLLEN_V((len)) | \ CPL_TX_SEC_PDU_CPLLEN_V((len)) | \
CPL_TX_SEC_PDU_PLACEHOLDER_V((hldr)) | \ CPL_TX_SEC_PDU_PLACEHOLDER_V(0) | \
CPL_TX_SEC_PDU_IVINSRTOFST_V((ofst))) CPL_TX_SEC_PDU_IVINSRTOFST_V((ofst)))
#define FILL_SEC_CPL_CIPHERSTOP_HI(a_start, a_stop, c_start, c_stop_hi) \ #define FILL_SEC_CPL_CIPHERSTOP_HI(a_start, a_stop, c_start, c_stop_hi) \
...@@ -148,7 +142,7 @@ ...@@ -148,7 +142,7 @@
CPL_TX_SEC_PDU_AUTHSTOP_V((a_stop)) | \ CPL_TX_SEC_PDU_AUTHSTOP_V((a_stop)) | \
CPL_TX_SEC_PDU_AUTHINSERT_V((a_inst))) CPL_TX_SEC_PDU_AUTHINSERT_V((a_inst)))
#define FILL_SEC_CPL_SCMD0_SEQNO(ctrl, seq, cmode, amode, opad, size, nivs) \ #define FILL_SEC_CPL_SCMD0_SEQNO(ctrl, seq, cmode, amode, opad, size) \
htonl( \ htonl( \
SCMD_SEQ_NO_CTRL_V(0) | \ SCMD_SEQ_NO_CTRL_V(0) | \
SCMD_STATUS_PRESENT_V(0) | \ SCMD_STATUS_PRESENT_V(0) | \
...@@ -159,7 +153,7 @@ ...@@ -159,7 +153,7 @@
SCMD_AUTH_MODE_V((amode)) | \ SCMD_AUTH_MODE_V((amode)) | \
SCMD_HMAC_CTRL_V((opad)) | \ SCMD_HMAC_CTRL_V((opad)) | \
SCMD_IV_SIZE_V((size)) | \ SCMD_IV_SIZE_V((size)) | \
SCMD_NUM_IVS_V((nivs))) SCMD_NUM_IVS_V(0))
#define FILL_SEC_CPL_IVGEN_HDRLEN(last, more, ctx_in, mac, ivdrop, len) htonl( \ #define FILL_SEC_CPL_IVGEN_HDRLEN(last, more, ctx_in, mac, ivdrop, len) htonl( \
SCMD_ENB_DBGID_V(0) | \ SCMD_ENB_DBGID_V(0) | \
......
...@@ -52,9 +52,25 @@ ...@@ -52,9 +52,25 @@
#define MAC_ERROR_BIT 0 #define MAC_ERROR_BIT 0
#define CHK_MAC_ERR_BIT(x) (((x) >> MAC_ERROR_BIT) & 1) #define CHK_MAC_ERR_BIT(x) (((x) >> MAC_ERROR_BIT) & 1)
#define MAX_SALT 4
struct uld_ctx; struct uld_ctx;
struct _key_ctx {
__be32 ctx_hdr;
u8 salt[MAX_SALT];
__be64 reserverd;
unsigned char key[0];
};
struct chcr_wr {
struct fw_crypto_lookaside_wr wreq;
struct ulp_txpkt ulptx;
struct ulptx_idata sc_imm;
struct cpl_tx_sec_pdu sec_cpl;
struct _key_ctx key_ctx;
};
struct chcr_dev { struct chcr_dev {
/* Request submited to h/w and waiting for response. */ /* Request submited to h/w and waiting for response. */
spinlock_t lock_chcr_dev; spinlock_t lock_chcr_dev;
......
...@@ -118,12 +118,6 @@ ...@@ -118,12 +118,6 @@
#define CHCR_HASH_MAX_BLOCK_SIZE_128 128 #define CHCR_HASH_MAX_BLOCK_SIZE_128 128
/* Aligned to 128 bit boundary */ /* Aligned to 128 bit boundary */
struct _key_ctx {
__be32 ctx_hdr;
u8 salt[MAX_SALT];
__be64 reserverd;
unsigned char key[0];
};
struct ablk_ctx { struct ablk_ctx {
u8 enc; u8 enc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment