From d416dbd274eccec004a41702d0328ccf7b2a94a0 Mon Sep 17 00:00:00 2001 From: Yuanyuan Liu Date: Wed, 11 May 2016 15:08:38 -0700 Subject: [PATCH] qcacld-3.0: Remove platform dependency for crypto Use OS standard crypto APIs instead of platform wrapper APIs. CRs-Fixed: 1014363 Change-Id: I359b50890ec757c294cac405b46881b44881e8c8 --- core/cds/inc/cds_crypto.h | 79 --------------------------------------- core/cds/src/cds_utils.c | 2 - 2 files changed, 81 deletions(-) diff --git a/core/cds/inc/cds_crypto.h b/core/cds/inc/cds_crypto.h index 4355ce2b0afa..0f6ff79468fd 100644 --- a/core/cds/inc/cds_crypto.h +++ b/core/cds/inc/cds_crypto.h @@ -50,133 +50,54 @@ #include #include #include -#ifdef CONFIG_CNSS -#include -#include -#endif -#ifdef CONFIG_CNSS -static inline struct crypto_ahash *cds_crypto_alloc_ahash(const char *alg_name, - u32 type, u32 mask) -{ - return wcnss_wlan_crypto_alloc_ahash(alg_name, type, mask); -} -#else static inline struct crypto_ahash *cds_crypto_alloc_ahash(const char *alg_name, u32 type, u32 mask) { return crypto_alloc_ahash(alg_name, type, mask); } -#endif -#ifdef CONFIG_CNSS -static inline struct crypto_cipher * -cds_crypto_alloc_cipher(const char *alg_name, u32 type, u32 mask) -{ - return wcnss_wlan_crypto_alloc_cipher(alg_name, type, mask); -} -#else static inline struct crypto_cipher * cds_crypto_alloc_cipher(const char *alg_name, u32 type, u32 mask) { return crypto_alloc_cipher(alg_name, type, mask); } -#endif -#ifdef CONFIG_CNSS -static inline void cds_cmac_calc_mic(struct crypto_cipher *tfm, u8 *m, - u16 length, u8 *mac) -{ - wcnss_wlan_cmac_calc_mic(tfm, m, length, mac); -} -#endif - -#ifdef CONFIG_CNSS -static inline void cds_crypto_free_cipher(struct crypto_cipher *tfm) -{ - wcnss_wlan_crypto_free_cipher(tfm); -} -#else static inline void cds_crypto_free_cipher(struct crypto_cipher *tfm) { crypto_free_cipher(tfm); } -#endif -#ifdef CONFIG_CNSS -static inline void cds_crypto_free_ahash(struct crypto_ahash *tfm) -{ - wcnss_wlan_crypto_free_ahash(tfm); -} -#else static inline void cds_crypto_free_ahash(struct crypto_ahash *tfm) { crypto_free_ahash(tfm); } -#endif -#ifdef CONFIG_CNSS -static inline int cds_crypto_ahash_setkey(struct crypto_ahash *tfm, - const u8 *key, unsigned int keylen) -{ - return wcnss_wlan_crypto_ahash_setkey(tfm, key, keylen); -} -#else static inline int cds_crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key, unsigned int keylen) { return crypto_ahash_setkey(tfm, key, keylen); } -#endif -#ifdef CONFIG_CNSS -static inline int cds_crypto_ahash_digest(struct ahash_request *req) -{ - return wcnss_wlan_crypto_ahash_digest(req); -} -#else static inline int cds_crypto_ahash_digest(struct ahash_request *req) { return crypto_ahash_digest(req); } -#endif -#ifdef CONFIG_CNSS -static inline struct crypto_ablkcipher * -cds_crypto_alloc_ablkcipher(const char *alg_name, u32 type, u32 mask) -{ - return wcnss_wlan_crypto_alloc_ablkcipher(alg_name, type, mask); -} -#else static inline struct crypto_ablkcipher * cds_crypto_alloc_ablkcipher(const char *alg_name, u32 type, u32 mask) { return crypto_alloc_ablkcipher(alg_name, type, mask); } -#endif -#ifdef CONFIG_CNSS -static inline void cds_ablkcipher_request_free(struct ablkcipher_request *req) -{ - wcnss_wlan_ablkcipher_request_free(req); -} -#else static inline void cds_ablkcipher_request_free(struct ablkcipher_request *req) { ablkcipher_request_free(req); } -#endif -#ifdef CONFIG_CNSS -static inline void cds_crypto_free_ablkcipher(struct crypto_ablkcipher *tfm) -{ - wcnss_wlan_crypto_free_ablkcipher(tfm); -} -#else static inline void cds_crypto_free_ablkcipher(struct crypto_ablkcipher *tfm) { crypto_free_ablkcipher(tfm); } -#endif #endif /* if !defined __CDS_CRYPTO_H */ diff --git a/core/cds/src/cds_utils.c b/core/cds/src/cds_utils.c index 180993759ece..c818f4980a2c 100644 --- a/core/cds/src/cds_utils.c +++ b/core/cds/src/cds_utils.c @@ -85,7 +85,6 @@ /*---------------------------------------------------------------------------- Function Definitions and Documentation * -------------------------------------------------------------------------*/ -#ifdef CONFIG_ICNSS #ifdef WLAN_FEATURE_11W static inline void xor_128(const u8 *a, const u8 *b, u8 *out) { @@ -191,7 +190,6 @@ static void cds_cmac_calc_mic(struct crypto_cipher *tfm, memcpy(mac, x, CMAC_TLEN); } #endif -#endif /*--------------------------------------------------------------------------