Loading drivers/crypto/bcm/cipher.c +0 −4 Original line number Diff line number Diff line Loading @@ -471,10 +471,8 @@ static int handle_skcipher_req(struct iproc_reqctx_s *rctx) static void handle_skcipher_resp(struct iproc_reqctx_s *rctx) { struct spu_hw *spu = &iproc_priv.spu; #ifdef DEBUG struct crypto_async_request *areq = rctx->parent; struct skcipher_request *req = skcipher_request_cast(areq); #endif struct iproc_ctx_s *ctx = rctx->ctx; u32 payload_len; Loading Loading @@ -996,13 +994,11 @@ static int ahash_req_done(struct iproc_reqctx_s *rctx) static void handle_ahash_resp(struct iproc_reqctx_s *rctx) { struct iproc_ctx_s *ctx = rctx->ctx; #ifdef DEBUG struct crypto_async_request *areq = rctx->parent; struct ahash_request *req = ahash_request_cast(areq); struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); unsigned int blocksize = crypto_tfm_alg_blocksize(crypto_ahash_tfm(ahash)); #endif /* * Save hash to use as input to next op if incremental. Might be copying * too much, but that's easier than figuring out actual digest size here Loading drivers/crypto/bcm/spu.c +9 −11 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ void spum_dump_msg_hdr(u8 *buf, unsigned int buf_len) packet_log("SPU Message header %p len: %u\n", buf, buf_len); /* ========== Decode MH ========== */ packet_log(" MH 0x%08x\n", be32_to_cpu(*((u32 *)ptr))); packet_log(" MH 0x%08x\n", be32_to_cpup((__be32 *)ptr)); if (spuh->mh.flags & MH_SCTX_PRES) packet_log(" SCTX present\n"); if (spuh->mh.flags & MH_BDESC_PRES) Loading Loading @@ -273,22 +273,21 @@ void spum_dump_msg_hdr(u8 *buf, unsigned int buf_len) /* ========== Decode BDESC ========== */ if (spuh->mh.flags & MH_BDESC_PRES) { #ifdef DEBUG struct BDESC_HEADER *bdesc = (struct BDESC_HEADER *)ptr; #endif packet_log(" BDESC[0] 0x%08x\n", be32_to_cpu(*((u32 *)ptr))); packet_log(" BDESC[0] 0x%08x\n", be32_to_cpup((__be32 *)ptr)); packet_log(" OffsetMAC:%u LengthMAC:%u\n", be16_to_cpu(bdesc->offset_mac), be16_to_cpu(bdesc->length_mac)); ptr += sizeof(u32); packet_log(" BDESC[1] 0x%08x\n", be32_to_cpu(*((u32 *)ptr))); packet_log(" BDESC[1] 0x%08x\n", be32_to_cpup((__be32 *)ptr)); packet_log(" OffsetCrypto:%u LengthCrypto:%u\n", be16_to_cpu(bdesc->offset_crypto), be16_to_cpu(bdesc->length_crypto)); ptr += sizeof(u32); packet_log(" BDESC[2] 0x%08x\n", be32_to_cpu(*((u32 *)ptr))); packet_log(" BDESC[2] 0x%08x\n", be32_to_cpup((__be32 *)ptr)); packet_log(" OffsetICV:%u OffsetIV:%u\n", be16_to_cpu(bdesc->offset_icv), be16_to_cpu(bdesc->offset_iv)); Loading @@ -297,10 +296,9 @@ void spum_dump_msg_hdr(u8 *buf, unsigned int buf_len) /* ========== Decode BD ========== */ if (spuh->mh.flags & MH_BD_PRES) { #ifdef DEBUG struct BD_HEADER *bd = (struct BD_HEADER *)ptr; #endif packet_log(" BD[0] 0x%08x\n", be32_to_cpu(*((u32 *)ptr))); packet_log(" BD[0] 0x%08x\n", be32_to_cpup((__be32 *)ptr)); packet_log(" Size:%ubytes PrevLength:%u\n", be16_to_cpu(bd->size), be16_to_cpu(bd->prev_length)); ptr += 4; Loading Loading @@ -1056,9 +1054,9 @@ void spum_request_pad(u8 *pad_start, /* add the size at the end as required per alg */ if (auth_alg == HASH_ALG_MD5) *(u64 *)ptr = cpu_to_le64((u64)total_sent * 8); *(__le64 *)ptr = cpu_to_le64(total_sent * 8ull); else /* SHA1, SHA2-224, SHA2-256 */ *(u64 *)ptr = cpu_to_be64((u64)total_sent * 8); *(__be64 *)ptr = cpu_to_be64(total_sent * 8ull); ptr += sizeof(u64); } } Loading drivers/crypto/bcm/spu2.c +2 −4 Original line number Diff line number Diff line Loading @@ -964,7 +964,6 @@ u32 spu2_create_request(u8 *spu_hdr, unsigned int cipher_offset = aead_parms->assoc_size + aead_parms->aad_pad_len + aead_parms->iv_len; #ifdef DEBUG /* total size of the data following OMD (without STAT word padding) */ unsigned int real_db_size = spu_real_db_size(aead_parms->assoc_size, aead_parms->iv_len, Loading @@ -973,7 +972,6 @@ u32 spu2_create_request(u8 *spu_hdr, aead_parms->aad_pad_len, aead_parms->data_pad_len, hash_parms->pad_len); #endif unsigned int assoc_size = aead_parms->assoc_size; if (req_opts->is_aead && Loading Loading @@ -1263,9 +1261,9 @@ void spu2_request_pad(u8 *pad_start, u32 gcm_padding, u32 hash_pad_len, /* add the size at the end as required per alg */ if (auth_alg == HASH_ALG_MD5) *(u64 *)ptr = cpu_to_le64((u64)total_sent * 8); *(__le64 *)ptr = cpu_to_le64(total_sent * 8ull); else /* SHA1, SHA2-224, SHA2-256 */ *(u64 *)ptr = cpu_to_be64((u64)total_sent * 8); *(__be64 *)ptr = cpu_to_be64(total_sent * 8ull); ptr += sizeof(u64); } Loading drivers/crypto/bcm/spu2.h +4 −4 Original line number Diff line number Diff line Loading @@ -73,10 +73,10 @@ enum spu2_ret_md_opts { /* Fixed Metadata format */ struct SPU2_FMD { u64 ctrl0; u64 ctrl1; u64 ctrl2; u64 ctrl3; __le64 ctrl0; __le64 ctrl1; __le64 ctrl2; __le64 ctrl3; }; #define FMD_SIZE sizeof(struct SPU2_FMD) Loading drivers/crypto/bcm/spum.h +11 −11 Original line number Diff line number Diff line Loading @@ -69,18 +69,18 @@ /* Buffer Descriptor Header [BDESC]. SPU in big-endian mode. */ struct BDESC_HEADER { u16 offset_mac; /* word 0 [31-16] */ u16 length_mac; /* word 0 [15-0] */ u16 offset_crypto; /* word 1 [31-16] */ u16 length_crypto; /* word 1 [15-0] */ u16 offset_icv; /* word 2 [31-16] */ u16 offset_iv; /* word 2 [15-0] */ __be16 offset_mac; /* word 0 [31-16] */ __be16 length_mac; /* word 0 [15-0] */ __be16 offset_crypto; /* word 1 [31-16] */ __be16 length_crypto; /* word 1 [15-0] */ __be16 offset_icv; /* word 2 [31-16] */ __be16 offset_iv; /* word 2 [15-0] */ }; /* Buffer Data Header [BD]. SPU in big-endian mode. */ struct BD_HEADER { u16 size; u16 prev_length; __be16 size; __be16 prev_length; }; /* Command Context Header. SPU-M in big endian mode. */ Loading Loading @@ -144,13 +144,13 @@ struct MHEADER { /* Generic Mode Security Context Structure [SCTX] */ struct SCTX { /* word 0: protocol flags */ u32 proto_flags; __be32 proto_flags; /* word 1: cipher flags */ u32 cipher_flags; __be32 cipher_flags; /* word 2: Extended cipher flags */ u32 ecf; __be32 ecf; }; Loading Loading
drivers/crypto/bcm/cipher.c +0 −4 Original line number Diff line number Diff line Loading @@ -471,10 +471,8 @@ static int handle_skcipher_req(struct iproc_reqctx_s *rctx) static void handle_skcipher_resp(struct iproc_reqctx_s *rctx) { struct spu_hw *spu = &iproc_priv.spu; #ifdef DEBUG struct crypto_async_request *areq = rctx->parent; struct skcipher_request *req = skcipher_request_cast(areq); #endif struct iproc_ctx_s *ctx = rctx->ctx; u32 payload_len; Loading Loading @@ -996,13 +994,11 @@ static int ahash_req_done(struct iproc_reqctx_s *rctx) static void handle_ahash_resp(struct iproc_reqctx_s *rctx) { struct iproc_ctx_s *ctx = rctx->ctx; #ifdef DEBUG struct crypto_async_request *areq = rctx->parent; struct ahash_request *req = ahash_request_cast(areq); struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); unsigned int blocksize = crypto_tfm_alg_blocksize(crypto_ahash_tfm(ahash)); #endif /* * Save hash to use as input to next op if incremental. Might be copying * too much, but that's easier than figuring out actual digest size here Loading
drivers/crypto/bcm/spu.c +9 −11 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ void spum_dump_msg_hdr(u8 *buf, unsigned int buf_len) packet_log("SPU Message header %p len: %u\n", buf, buf_len); /* ========== Decode MH ========== */ packet_log(" MH 0x%08x\n", be32_to_cpu(*((u32 *)ptr))); packet_log(" MH 0x%08x\n", be32_to_cpup((__be32 *)ptr)); if (spuh->mh.flags & MH_SCTX_PRES) packet_log(" SCTX present\n"); if (spuh->mh.flags & MH_BDESC_PRES) Loading Loading @@ -273,22 +273,21 @@ void spum_dump_msg_hdr(u8 *buf, unsigned int buf_len) /* ========== Decode BDESC ========== */ if (spuh->mh.flags & MH_BDESC_PRES) { #ifdef DEBUG struct BDESC_HEADER *bdesc = (struct BDESC_HEADER *)ptr; #endif packet_log(" BDESC[0] 0x%08x\n", be32_to_cpu(*((u32 *)ptr))); packet_log(" BDESC[0] 0x%08x\n", be32_to_cpup((__be32 *)ptr)); packet_log(" OffsetMAC:%u LengthMAC:%u\n", be16_to_cpu(bdesc->offset_mac), be16_to_cpu(bdesc->length_mac)); ptr += sizeof(u32); packet_log(" BDESC[1] 0x%08x\n", be32_to_cpu(*((u32 *)ptr))); packet_log(" BDESC[1] 0x%08x\n", be32_to_cpup((__be32 *)ptr)); packet_log(" OffsetCrypto:%u LengthCrypto:%u\n", be16_to_cpu(bdesc->offset_crypto), be16_to_cpu(bdesc->length_crypto)); ptr += sizeof(u32); packet_log(" BDESC[2] 0x%08x\n", be32_to_cpu(*((u32 *)ptr))); packet_log(" BDESC[2] 0x%08x\n", be32_to_cpup((__be32 *)ptr)); packet_log(" OffsetICV:%u OffsetIV:%u\n", be16_to_cpu(bdesc->offset_icv), be16_to_cpu(bdesc->offset_iv)); Loading @@ -297,10 +296,9 @@ void spum_dump_msg_hdr(u8 *buf, unsigned int buf_len) /* ========== Decode BD ========== */ if (spuh->mh.flags & MH_BD_PRES) { #ifdef DEBUG struct BD_HEADER *bd = (struct BD_HEADER *)ptr; #endif packet_log(" BD[0] 0x%08x\n", be32_to_cpu(*((u32 *)ptr))); packet_log(" BD[0] 0x%08x\n", be32_to_cpup((__be32 *)ptr)); packet_log(" Size:%ubytes PrevLength:%u\n", be16_to_cpu(bd->size), be16_to_cpu(bd->prev_length)); ptr += 4; Loading Loading @@ -1056,9 +1054,9 @@ void spum_request_pad(u8 *pad_start, /* add the size at the end as required per alg */ if (auth_alg == HASH_ALG_MD5) *(u64 *)ptr = cpu_to_le64((u64)total_sent * 8); *(__le64 *)ptr = cpu_to_le64(total_sent * 8ull); else /* SHA1, SHA2-224, SHA2-256 */ *(u64 *)ptr = cpu_to_be64((u64)total_sent * 8); *(__be64 *)ptr = cpu_to_be64(total_sent * 8ull); ptr += sizeof(u64); } } Loading
drivers/crypto/bcm/spu2.c +2 −4 Original line number Diff line number Diff line Loading @@ -964,7 +964,6 @@ u32 spu2_create_request(u8 *spu_hdr, unsigned int cipher_offset = aead_parms->assoc_size + aead_parms->aad_pad_len + aead_parms->iv_len; #ifdef DEBUG /* total size of the data following OMD (without STAT word padding) */ unsigned int real_db_size = spu_real_db_size(aead_parms->assoc_size, aead_parms->iv_len, Loading @@ -973,7 +972,6 @@ u32 spu2_create_request(u8 *spu_hdr, aead_parms->aad_pad_len, aead_parms->data_pad_len, hash_parms->pad_len); #endif unsigned int assoc_size = aead_parms->assoc_size; if (req_opts->is_aead && Loading Loading @@ -1263,9 +1261,9 @@ void spu2_request_pad(u8 *pad_start, u32 gcm_padding, u32 hash_pad_len, /* add the size at the end as required per alg */ if (auth_alg == HASH_ALG_MD5) *(u64 *)ptr = cpu_to_le64((u64)total_sent * 8); *(__le64 *)ptr = cpu_to_le64(total_sent * 8ull); else /* SHA1, SHA2-224, SHA2-256 */ *(u64 *)ptr = cpu_to_be64((u64)total_sent * 8); *(__be64 *)ptr = cpu_to_be64(total_sent * 8ull); ptr += sizeof(u64); } Loading
drivers/crypto/bcm/spu2.h +4 −4 Original line number Diff line number Diff line Loading @@ -73,10 +73,10 @@ enum spu2_ret_md_opts { /* Fixed Metadata format */ struct SPU2_FMD { u64 ctrl0; u64 ctrl1; u64 ctrl2; u64 ctrl3; __le64 ctrl0; __le64 ctrl1; __le64 ctrl2; __le64 ctrl3; }; #define FMD_SIZE sizeof(struct SPU2_FMD) Loading
drivers/crypto/bcm/spum.h +11 −11 Original line number Diff line number Diff line Loading @@ -69,18 +69,18 @@ /* Buffer Descriptor Header [BDESC]. SPU in big-endian mode. */ struct BDESC_HEADER { u16 offset_mac; /* word 0 [31-16] */ u16 length_mac; /* word 0 [15-0] */ u16 offset_crypto; /* word 1 [31-16] */ u16 length_crypto; /* word 1 [15-0] */ u16 offset_icv; /* word 2 [31-16] */ u16 offset_iv; /* word 2 [15-0] */ __be16 offset_mac; /* word 0 [31-16] */ __be16 length_mac; /* word 0 [15-0] */ __be16 offset_crypto; /* word 1 [31-16] */ __be16 length_crypto; /* word 1 [15-0] */ __be16 offset_icv; /* word 2 [31-16] */ __be16 offset_iv; /* word 2 [15-0] */ }; /* Buffer Data Header [BD]. SPU in big-endian mode. */ struct BD_HEADER { u16 size; u16 prev_length; __be16 size; __be16 prev_length; }; /* Command Context Header. SPU-M in big endian mode. */ Loading Loading @@ -144,13 +144,13 @@ struct MHEADER { /* Generic Mode Security Context Structure [SCTX] */ struct SCTX { /* word 0: protocol flags */ u32 proto_flags; __be32 proto_flags; /* word 1: cipher flags */ u32 cipher_flags; __be32 cipher_flags; /* word 2: Extended cipher flags */ u32 ecf; __be32 ecf; }; Loading