@@ -138,7 +138,7 @@ static int cc_aead_init(struct crypto_aead *tfm)
138138 ctx -> flow_mode = cc_alg -> flow_mode ;
139139 ctx -> auth_mode = cc_alg -> auth_mode ;
140140 ctx -> drvdata = cc_alg -> drvdata ;
141- crypto_aead_set_reqsize (tfm , sizeof (struct aead_req_ctx ));
141+ crypto_aead_set_reqsize_dma (tfm , sizeof (struct aead_req_ctx ));
142142
143143 /* Allocate key buffer, cache line aligned */
144144 ctx -> enckey = dma_alloc_coherent (dev , AES_MAX_KEY_SIZE ,
@@ -208,7 +208,7 @@ static int cc_aead_init(struct crypto_aead *tfm)
208208static void cc_aead_complete (struct device * dev , void * cc_req , int err )
209209{
210210 struct aead_request * areq = (struct aead_request * )cc_req ;
211- struct aead_req_ctx * areq_ctx = aead_request_ctx (areq );
211+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (areq );
212212 struct crypto_aead * tfm = crypto_aead_reqtfm (cc_req );
213213 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
214214
@@ -723,7 +723,7 @@ static void cc_set_assoc_desc(struct aead_request *areq, unsigned int flow_mode,
723723{
724724 struct crypto_aead * tfm = crypto_aead_reqtfm (areq );
725725 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
726- struct aead_req_ctx * areq_ctx = aead_request_ctx (areq );
726+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (areq );
727727 enum cc_req_dma_buf_type assoc_dma_type = areq_ctx -> assoc_buff_type ;
728728 unsigned int idx = * seq_size ;
729729 struct device * dev = drvdata_to_dev (ctx -> drvdata );
@@ -762,7 +762,7 @@ static void cc_proc_authen_desc(struct aead_request *areq,
762762 struct cc_hw_desc desc [],
763763 unsigned int * seq_size , int direct )
764764{
765- struct aead_req_ctx * areq_ctx = aead_request_ctx (areq );
765+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (areq );
766766 enum cc_req_dma_buf_type data_dma_type = areq_ctx -> data_buff_type ;
767767 unsigned int idx = * seq_size ;
768768 struct crypto_aead * tfm = crypto_aead_reqtfm (areq );
@@ -827,7 +827,7 @@ static void cc_proc_cipher_desc(struct aead_request *areq,
827827 unsigned int * seq_size )
828828{
829829 unsigned int idx = * seq_size ;
830- struct aead_req_ctx * areq_ctx = aead_request_ctx (areq );
830+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (areq );
831831 enum cc_req_dma_buf_type data_dma_type = areq_ctx -> data_buff_type ;
832832 struct crypto_aead * tfm = crypto_aead_reqtfm (areq );
833833 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
@@ -873,7 +873,7 @@ static void cc_proc_digest_desc(struct aead_request *req,
873873{
874874 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
875875 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
876- struct aead_req_ctx * req_ctx = aead_request_ctx (req );
876+ struct aead_req_ctx * req_ctx = aead_request_ctx_dma (req );
877877 unsigned int idx = * seq_size ;
878878 unsigned int hash_mode = (ctx -> auth_mode == DRV_HASH_SHA1 ) ?
879879 DRV_HASH_HW_SHA1 : DRV_HASH_HW_SHA256 ;
@@ -923,7 +923,7 @@ static void cc_set_cipher_desc(struct aead_request *req,
923923{
924924 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
925925 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
926- struct aead_req_ctx * req_ctx = aead_request_ctx (req );
926+ struct aead_req_ctx * req_ctx = aead_request_ctx_dma (req );
927927 unsigned int hw_iv_size = req_ctx -> hw_iv_size ;
928928 unsigned int idx = * seq_size ;
929929 int direct = req_ctx -> gen_ctx .op_type ;
@@ -965,7 +965,7 @@ static void cc_set_cipher_desc(struct aead_request *req,
965965static void cc_proc_cipher (struct aead_request * req , struct cc_hw_desc desc [],
966966 unsigned int * seq_size , unsigned int data_flow_mode )
967967{
968- struct aead_req_ctx * req_ctx = aead_request_ctx (req );
968+ struct aead_req_ctx * req_ctx = aead_request_ctx_dma (req );
969969 int direct = req_ctx -> gen_ctx .op_type ;
970970 unsigned int idx = * seq_size ;
971971
@@ -1082,7 +1082,7 @@ static void cc_proc_header_desc(struct aead_request *req,
10821082 struct cc_hw_desc desc [],
10831083 unsigned int * seq_size )
10841084{
1085- struct aead_req_ctx * areq_ctx = aead_request_ctx (req );
1085+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (req );
10861086 unsigned int idx = * seq_size ;
10871087
10881088 /* Hash associated data */
@@ -1158,7 +1158,7 @@ static void cc_proc_scheme_desc(struct aead_request *req,
11581158static void cc_mlli_to_sram (struct aead_request * req ,
11591159 struct cc_hw_desc desc [], unsigned int * seq_size )
11601160{
1161- struct aead_req_ctx * req_ctx = aead_request_ctx (req );
1161+ struct aead_req_ctx * req_ctx = aead_request_ctx_dma (req );
11621162 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
11631163 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
11641164 struct device * dev = drvdata_to_dev (ctx -> drvdata );
@@ -1212,7 +1212,7 @@ static void cc_hmac_authenc(struct aead_request *req, struct cc_hw_desc desc[],
12121212{
12131213 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
12141214 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
1215- struct aead_req_ctx * req_ctx = aead_request_ctx (req );
1215+ struct aead_req_ctx * req_ctx = aead_request_ctx_dma (req );
12161216 int direct = req_ctx -> gen_ctx .op_type ;
12171217 unsigned int data_flow_mode =
12181218 cc_get_data_flow (direct , ctx -> flow_mode ,
@@ -1265,7 +1265,7 @@ cc_xcbc_authenc(struct aead_request *req, struct cc_hw_desc desc[],
12651265{
12661266 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
12671267 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
1268- struct aead_req_ctx * req_ctx = aead_request_ctx (req );
1268+ struct aead_req_ctx * req_ctx = aead_request_ctx_dma (req );
12691269 int direct = req_ctx -> gen_ctx .op_type ;
12701270 unsigned int data_flow_mode =
12711271 cc_get_data_flow (direct , ctx -> flow_mode ,
@@ -1312,7 +1312,7 @@ static int validate_data_size(struct cc_aead_ctx *ctx,
13121312 enum drv_crypto_direction direct ,
13131313 struct aead_request * req )
13141314{
1315- struct aead_req_ctx * areq_ctx = aead_request_ctx (req );
1315+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (req );
13161316 struct device * dev = drvdata_to_dev (ctx -> drvdata );
13171317 unsigned int assoclen = areq_ctx -> assoclen ;
13181318 unsigned int cipherlen = (direct == DRV_CRYPTO_DIRECTION_DECRYPT ) ?
@@ -1411,7 +1411,7 @@ static int cc_ccm(struct aead_request *req, struct cc_hw_desc desc[],
14111411{
14121412 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
14131413 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
1414- struct aead_req_ctx * req_ctx = aead_request_ctx (req );
1414+ struct aead_req_ctx * req_ctx = aead_request_ctx_dma (req );
14151415 unsigned int idx = * seq_size ;
14161416 unsigned int cipher_flow_mode ;
14171417 dma_addr_t mac_result ;
@@ -1533,7 +1533,7 @@ static int config_ccm_adata(struct aead_request *req)
15331533 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
15341534 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
15351535 struct device * dev = drvdata_to_dev (ctx -> drvdata );
1536- struct aead_req_ctx * req_ctx = aead_request_ctx (req );
1536+ struct aead_req_ctx * req_ctx = aead_request_ctx_dma (req );
15371537 //unsigned int size_of_a = 0, rem_a_size = 0;
15381538 unsigned int lp = req -> iv [0 ];
15391539 /* Note: The code assume that req->iv[0] already contains the value
@@ -1591,7 +1591,7 @@ static void cc_proc_rfc4309_ccm(struct aead_request *req)
15911591{
15921592 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
15931593 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
1594- struct aead_req_ctx * areq_ctx = aead_request_ctx (req );
1594+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (req );
15951595
15961596 /* L' */
15971597 memset (areq_ctx -> ctr_iv , 0 , AES_BLOCK_SIZE );
@@ -1615,7 +1615,7 @@ static void cc_set_ghash_desc(struct aead_request *req,
16151615{
16161616 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
16171617 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
1618- struct aead_req_ctx * req_ctx = aead_request_ctx (req );
1618+ struct aead_req_ctx * req_ctx = aead_request_ctx_dma (req );
16191619 unsigned int idx = * seq_size ;
16201620
16211621 /* load key to AES*/
@@ -1693,7 +1693,7 @@ static void cc_set_gctr_desc(struct aead_request *req, struct cc_hw_desc desc[],
16931693{
16941694 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
16951695 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
1696- struct aead_req_ctx * req_ctx = aead_request_ctx (req );
1696+ struct aead_req_ctx * req_ctx = aead_request_ctx_dma (req );
16971697 unsigned int idx = * seq_size ;
16981698
16991699 /* load key to AES*/
@@ -1730,7 +1730,7 @@ static void cc_proc_gcm_result(struct aead_request *req,
17301730{
17311731 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
17321732 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
1733- struct aead_req_ctx * req_ctx = aead_request_ctx (req );
1733+ struct aead_req_ctx * req_ctx = aead_request_ctx_dma (req );
17341734 dma_addr_t mac_result ;
17351735 unsigned int idx = * seq_size ;
17361736
@@ -1792,7 +1792,7 @@ static void cc_proc_gcm_result(struct aead_request *req,
17921792static int cc_gcm (struct aead_request * req , struct cc_hw_desc desc [],
17931793 unsigned int * seq_size )
17941794{
1795- struct aead_req_ctx * req_ctx = aead_request_ctx (req );
1795+ struct aead_req_ctx * req_ctx = aead_request_ctx_dma (req );
17961796 unsigned int cipher_flow_mode ;
17971797
17981798 //in RFC4543 no data to encrypt. just copy data from src to dest.
@@ -1830,7 +1830,7 @@ static int config_gcm_context(struct aead_request *req)
18301830{
18311831 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
18321832 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
1833- struct aead_req_ctx * req_ctx = aead_request_ctx (req );
1833+ struct aead_req_ctx * req_ctx = aead_request_ctx_dma (req );
18341834 struct device * dev = drvdata_to_dev (ctx -> drvdata );
18351835
18361836 unsigned int cryptlen = (req_ctx -> gen_ctx .op_type ==
@@ -1879,7 +1879,7 @@ static void cc_proc_rfc4_gcm(struct aead_request *req)
18791879{
18801880 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
18811881 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
1882- struct aead_req_ctx * areq_ctx = aead_request_ctx (req );
1882+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (req );
18831883
18841884 memcpy (areq_ctx -> ctr_iv + GCM_BLOCK_RFC4_NONCE_OFFSET ,
18851885 ctx -> ctr_nonce , GCM_BLOCK_RFC4_NONCE_SIZE );
@@ -1896,7 +1896,7 @@ static int cc_proc_aead(struct aead_request *req,
18961896 struct cc_hw_desc desc [MAX_AEAD_PROCESS_SEQ ];
18971897 struct crypto_aead * tfm = crypto_aead_reqtfm (req );
18981898 struct cc_aead_ctx * ctx = crypto_aead_ctx (tfm );
1899- struct aead_req_ctx * areq_ctx = aead_request_ctx (req );
1899+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (req );
19001900 struct device * dev = drvdata_to_dev (ctx -> drvdata );
19011901 struct cc_crypto_req cc_req = {};
19021902
@@ -2019,7 +2019,7 @@ static int cc_proc_aead(struct aead_request *req,
20192019
20202020static int cc_aead_encrypt (struct aead_request * req )
20212021{
2022- struct aead_req_ctx * areq_ctx = aead_request_ctx (req );
2022+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (req );
20232023 int rc ;
20242024
20252025 memset (areq_ctx , 0 , sizeof (* areq_ctx ));
@@ -2039,7 +2039,7 @@ static int cc_rfc4309_ccm_encrypt(struct aead_request *req)
20392039{
20402040 /* Very similar to cc_aead_encrypt() above. */
20412041
2042- struct aead_req_ctx * areq_ctx = aead_request_ctx (req );
2042+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (req );
20432043 int rc ;
20442044
20452045 rc = crypto_ipsec_check_assoclen (req -> assoclen );
@@ -2063,7 +2063,7 @@ static int cc_rfc4309_ccm_encrypt(struct aead_request *req)
20632063
20642064static int cc_aead_decrypt (struct aead_request * req )
20652065{
2066- struct aead_req_ctx * areq_ctx = aead_request_ctx (req );
2066+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (req );
20672067 int rc ;
20682068
20692069 memset (areq_ctx , 0 , sizeof (* areq_ctx ));
@@ -2081,7 +2081,7 @@ static int cc_aead_decrypt(struct aead_request *req)
20812081
20822082static int cc_rfc4309_ccm_decrypt (struct aead_request * req )
20832083{
2084- struct aead_req_ctx * areq_ctx = aead_request_ctx (req );
2084+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (req );
20852085 int rc ;
20862086
20872087 rc = crypto_ipsec_check_assoclen (req -> assoclen );
@@ -2193,7 +2193,7 @@ static int cc_rfc4543_gcm_setauthsize(struct crypto_aead *authenc,
21932193
21942194static int cc_rfc4106_gcm_encrypt (struct aead_request * req )
21952195{
2196- struct aead_req_ctx * areq_ctx = aead_request_ctx (req );
2196+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (req );
21972197 int rc ;
21982198
21992199 rc = crypto_ipsec_check_assoclen (req -> assoclen );
@@ -2217,7 +2217,7 @@ static int cc_rfc4106_gcm_encrypt(struct aead_request *req)
22172217
22182218static int cc_rfc4543_gcm_encrypt (struct aead_request * req )
22192219{
2220- struct aead_req_ctx * areq_ctx = aead_request_ctx (req );
2220+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (req );
22212221 int rc ;
22222222
22232223 rc = crypto_ipsec_check_assoclen (req -> assoclen );
@@ -2244,7 +2244,7 @@ static int cc_rfc4543_gcm_encrypt(struct aead_request *req)
22442244
22452245static int cc_rfc4106_gcm_decrypt (struct aead_request * req )
22462246{
2247- struct aead_req_ctx * areq_ctx = aead_request_ctx (req );
2247+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (req );
22482248 int rc ;
22492249
22502250 rc = crypto_ipsec_check_assoclen (req -> assoclen );
@@ -2268,7 +2268,7 @@ static int cc_rfc4106_gcm_decrypt(struct aead_request *req)
22682268
22692269static int cc_rfc4543_gcm_decrypt (struct aead_request * req )
22702270{
2271- struct aead_req_ctx * areq_ctx = aead_request_ctx (req );
2271+ struct aead_req_ctx * areq_ctx = aead_request_ctx_dma (req );
22722272 int rc ;
22732273
22742274 rc = crypto_ipsec_check_assoclen (req -> assoclen );
0 commit comments