qcacld-3.0: Remove platform dependency for crypto

Use OS standard crypto APIs instead of platform wrapper APIs.

CRs-Fixed: 1014363
Change-Id: I359b50890ec757c294cac405b46881b44881e8c8
This commit is contained in:
Yuanyuan Liu 2016-05-11 15:08:38 -07:00 • committed by Gerrit - the friendly Code Review server
commit d416dbd274
2 changed files with 0 additions and 81 deletions

View file

@ -50,133 +50,54 @@
#include <cds_pack_align.h>
#include <crypto/aes.h>
#include <crypto/hash.h>
#ifdef CONFIG_CNSS
#include <net/cnss.h>
#include <linux/qcomwlan_secif.h>
#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 */

View file

@ -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
/*--------------------------------------------------------------------------