Lines Matching refs:sa_entry

144 				struct ipsec_sa_entry *sa_entry)  in ch_ipsec_setauthsize()  argument
149 sa_entry->authsize = authsize; in ch_ipsec_setauthsize()
168 struct ipsec_sa_entry *sa_entry) in ch_ipsec_setkey() argument
179 memcpy(sa_entry->salt, key + keylen, 4); in ch_ipsec_setkey()
194 memcpy(sa_entry->key, key, keylen); in ch_ipsec_setkey()
195 sa_entry->enckey_len = keylen; in ch_ipsec_setkey()
200 sa_entry->key_ctx_hdr = FILL_KEY_CTX_HDR(ck_size, in ch_ipsec_setkey()
210 sa_entry->enckey_len = 0; in ch_ipsec_setkey()
217 memcpy(sa_entry->key + (DIV_ROUND_UP(sa_entry->enckey_len, 16) * in ch_ipsec_setkey()
219 sa_entry->kctx_len = ((DIV_ROUND_UP(sa_entry->enckey_len, 16)) << 4) + in ch_ipsec_setkey()
233 struct ipsec_sa_entry *sa_entry; in ch_ipsec_xfrm_add_state() local
293 sa_entry = kzalloc(sizeof(*sa_entry), GFP_KERNEL); in ch_ipsec_xfrm_add_state()
294 if (!sa_entry) { in ch_ipsec_xfrm_add_state()
299 sa_entry->hmac_ctrl = ch_ipsec_setauthsize(x, sa_entry); in ch_ipsec_xfrm_add_state()
301 sa_entry->esn = 1; in ch_ipsec_xfrm_add_state()
302 ch_ipsec_setkey(x, sa_entry); in ch_ipsec_xfrm_add_state()
303 x->xso.offload_handle = (unsigned long)sa_entry; in ch_ipsec_xfrm_add_state()
318 struct ipsec_sa_entry *sa_entry; in ch_ipsec_xfrm_free_state() local
323 sa_entry = (struct ipsec_sa_entry *)x->xso.offload_handle; in ch_ipsec_xfrm_free_state()
324 kfree(sa_entry); in ch_ipsec_xfrm_free_state()
350 struct ipsec_sa_entry *sa_entry) in is_eth_imm() argument
355 kctx_len = sa_entry->kctx_len; in is_eth_imm()
360 if (sa_entry->esn) in is_eth_imm()
369 struct ipsec_sa_entry *sa_entry, in calc_tx_sec_flits() argument
377 kctx_len = sa_entry->kctx_len; in calc_tx_sec_flits()
378 hdrlen = is_eth_imm(skb, sa_entry); in calc_tx_sec_flits()
379 aadivlen = sa_entry->esn ? DIV_ROUND_UP(sizeof(struct chcr_ipsec_aadiv), in calc_tx_sec_flits()
414 struct ipsec_sa_entry *sa_entry) in copy_esn_pktxt() argument
454 if (is_eth_imm(skb, sa_entry) && !skb_is_nonlinear(skb)) { in copy_esn_pktxt()
468 struct ipsec_sa_entry *sa_entry) in copy_cpltx_pktxt() argument
504 if (sa_entry->esn) in copy_cpltx_pktxt()
505 pos = copy_esn_pktxt(skb, dev, pos, sa_entry); in copy_cpltx_pktxt()
512 struct ipsec_sa_entry *sa_entry) in copy_key_cpltx_pktxt() argument
525 key_len = sa_entry->kctx_len; in copy_key_cpltx_pktxt()
537 key_ctx->ctx_hdr = sa_entry->key_ctx_hdr; in copy_key_cpltx_pktxt()
538 memcpy(key_ctx->salt, sa_entry->salt, MAX_SALT); in copy_key_cpltx_pktxt()
543 memcpy(key_ctx->key, sa_entry->key, key_len); in copy_key_cpltx_pktxt()
546 memcpy(pos, sa_entry->key, left); in copy_key_cpltx_pktxt()
547 memcpy(q->q.desc, sa_entry->key + left, in copy_key_cpltx_pktxt()
552 pos = copy_cpltx_pktxt(skb, dev, pos, sa_entry); in copy_key_cpltx_pktxt()
561 struct ipsec_sa_entry *sa_entry) in ch_ipsec_crypto_wreq() argument
581 unsigned int kctx_len = sa_entry->kctx_len; in ch_ipsec_crypto_wreq()
586 flits = calc_tx_sec_flits(skb, sa_entry, &immediate); in ch_ipsec_crypto_wreq()
588 if (sa_entry->esn) in ch_ipsec_crypto_wreq()
594 if (sa_entry->esn) { in ch_ipsec_crypto_wreq()
628 ivinoffset = sa_entry->esn ? (ESN_IV_INSERT_OFFSET + 1) : in ch_ipsec_crypto_wreq()
639 aadstart = sa_entry->esn ? 1 : (skb_transport_offset(skb) + 1); in ch_ipsec_crypto_wreq()
640 aadstop = sa_entry->esn ? ESN_IV_INSERT_OFFSET : in ch_ipsec_crypto_wreq()
645 ciphstart += sa_entry->esn ? esnlen : 0; in ch_ipsec_crypto_wreq()
654 sa_entry->authsize, in ch_ipsec_crypto_wreq()
655 sa_entry->authsize); in ch_ipsec_crypto_wreq()
660 sa_entry->hmac_ctrl, in ch_ipsec_crypto_wreq()
670 pos = copy_key_cpltx_pktxt(skb, dev, pos, sa_entry); in ch_ipsec_crypto_wreq()
714 struct ipsec_sa_entry *sa_entry; in ch_ipsec_xmit() local
727 sa_entry = (struct ipsec_sa_entry *)x->xso.offload_handle; in ch_ipsec_xmit()
742 flits = calc_tx_sec_flits(skb, sa_entry, &immediate); in ch_ipsec_xmit()
772 credits, sa_entry); in ch_ipsec_xmit()