qcacmn: Add feature flags to crypto component

Add below featurization flags to crypto component:
WLAN_CRYPTO_WEP_OS_DERIVATIVE
WLAN_CRYPTO_TKIP_OS_DERIVATIVE
WLAN_CRYPTO_CCMP_OS_DERIVATIVE
WLAN_CRYPTO_GCMP_OS_DERIVATIVE
WLAN_CRYPTO_WAPI_OS_DERIVATIVE
WLAN_CRYPTO_GCM_OS_DERIVATIVE
WLAN_CRYPTO_FILS_OS_DERIVATIVE

Remove the below unused functions:
wlan_crypto_psoc_obj_create_handler()
wlan_crypto_psoc_obj_destroy_handler()
wlan_crypto_pdev_obj_destroy_handler()

Change-Id: Ie2a9a4ca240773dc0d32aa6884b21ee08244829c
CRs-Fixed: 2269826
This commit is contained in:
Varun Reddy Yeturu
2018-06-28 11:55:15 -07:00
committed by nshrivas
父節點 126db5db3f
當前提交 7174208352
共有 6 個文件被更改,包括 105 次插入54 次删除

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -19,6 +19,12 @@
#ifndef _WLAN_CRYPTO_FILS_API_H_
#define _WLAN_CRYPTO_FILS_API_H_
#ifdef WLAN_CRYPTO_FILS_OS_DERIVATIVE
static inline const struct wlan_crypto_cipher *fils_register(void)
{
return NULL;
}
#else
/**
* fils_register() - Register all callback functions to Crypto manager
*
@@ -28,6 +34,7 @@
* Return: Pointer to wlan_crypto_cipher Object
*/
const struct wlan_crypto_cipher *fils_register(void);
#endif
#ifdef WLAN_SUPPORT_FILS
/**

查看文件

@@ -231,10 +231,19 @@ int wlan_crypto_aes_gcm_ad(const uint8_t *key, size_t key_len,
const uint8_t *aad, size_t aad_len,
const uint8_t *tag,
uint8_t *plain);
#ifdef WLAN_CRYPTO_GCM_OS_DERIVATIVE
static inline int wlan_crypto_aes_gmac(const uint8_t *key, size_t key_len,
const uint8_t *iv, size_t iv_len,
const uint8_t *aad, size_t aad_len,
uint8_t *tag)
{
return 0;
}
#else
int wlan_crypto_aes_gmac(const uint8_t *key, size_t key_len,
const uint8_t *iv, size_t iv_len,
const uint8_t *aad, size_t aad_len, uint8_t *tag);
const uint8_t *iv, size_t iv_len,
const uint8_t *aad, size_t aad_len, uint8_t *tag);
#endif
int wlan_crypto_aes_ccm_ae(const uint8_t *key, size_t key_len,
const uint8_t *nonce, size_t M, const uint8_t *plain,
size_t plain_len, const uint8_t *aad, size_t aad_len,
@@ -251,10 +260,24 @@ void wlan_crypto_aes_encrypt_deinit(void *ctx);
void *wlan_crypto_aes_decrypt_init(const uint8_t *key, size_t len);
void wlan_crypto_aes_decrypt(void *ctx, const uint8_t *crypt, uint8_t *plain);
void wlan_crypto_aes_decrypt_deinit(void *ctx);
#ifdef WLAN_CRYPTO_OMAC1_OS_DERIVATIVE
static inline int omac1_aes_128(const uint8_t *key, const uint8_t *data,
size_t data_len, uint8_t *mac)
{
return 0;
}
static inline int omac1_aes_256(const uint8_t *key, const uint8_t *data,
size_t data_len, uint8_t *mac)
{
return 0;
}
#else
int omac1_aes_128(const uint8_t *key, const uint8_t *data,
size_t data_len, uint8_t *mac);
size_t data_len, uint8_t *mac);
int omac1_aes_256(const uint8_t *key, const uint8_t *data,
size_t data_len, uint8_t *mac);
size_t data_len, uint8_t *mac);
#endif
int omac1_aes_vector(const uint8_t *key, size_t key_len, size_t num_elem,
const uint8_t *addr[], const size_t *len, uint8_t *mac);
#endif /* WLAN_CRYPTO_AES_I_H */

查看文件

@@ -93,6 +93,9 @@
#define WLAN_TID_SIZE 17
#define WLAN_NONQOS_SEQ 16
/* Number of bits per byte */
#define CRYPTO_NBBY 8
/* Macros for handling unaligned memory accesses */
static inline uint16_t wlan_crypto_get_be16(const uint8_t *a)

查看文件

@@ -386,7 +386,7 @@ QDF_STATUS wlan_crypto_setkey(struct wlan_objmgr_vdev *vdev,
if (cipher && (!IS_FILS_CIPHER(req_key->type)) &&
(!IS_MGMT_CIPHER(req_key->type)) &&
((req_key->keylen != (cipher->keylen / NBBY)) &&
((req_key->keylen != (cipher->keylen / CRYPTO_NBBY)) &&
(req_key->type != WLAN_CRYPTO_CIPHER_WEP))) {
qdf_print("%s[%d] cipher invalid\n", __func__, __LINE__);
return QDF_STATUS_E_INVAL;
@@ -466,8 +466,7 @@ QDF_STATUS wlan_crypto_setkey(struct wlan_objmgr_vdev *vdev,
crypto_priv->def_igtk_tx_keyid = igtk_idx;
} else {
if (IS_FILS_CIPHER(req_key->type)) {
qdf_print(FL(
"FILS key is not for BroadCast packet\n"));
qdf_print("FILS key is not for BroadCast pkt");
return QDF_STATUS_E_INVAL;
}
if (!HAS_MCAST_CIPHER(crypto_params, req_key->type)
@@ -3091,13 +3090,13 @@ uint8_t wlan_crypto_get_peer_fils_aead(struct wlan_objmgr_peer *peer)
struct wlan_crypto_comp_priv *crypto_priv = NULL;
if (!peer) {
qdf_print(FL("Invalid Input\n"));
qdf_print("Invalid Input");
return 0;
}
crypto_priv = wlan_get_peer_crypto_obj(peer);
if (!crypto_priv) {
qdf_print(FL("crypto_priv NULL\n"));
qdf_print("crypto_priv NULL");
return 0;
}
@@ -3110,13 +3109,13 @@ wlan_crypto_set_peer_fils_aead(struct wlan_objmgr_peer *peer, uint8_t value)
struct wlan_crypto_comp_priv *crypto_priv = NULL;
if (!peer) {
qdf_print(FL("Invalid Input\n"));
qdf_print("Invalid Input");
return;
}
crypto_priv = wlan_get_peer_crypto_obj(peer);
if (!crypto_priv) {
qdf_print(FL("crypto_priv NULL\n"));
qdf_print("crypto_priv NULL");
return;
}

查看文件

@@ -37,14 +37,6 @@
#include "wlan_crypto_fils_api.h"
extern const struct wlan_crypto_cipher *wep_register(void);
extern const struct wlan_crypto_cipher *tkip_register(void);
extern const struct wlan_crypto_cipher *ccmp_register(void);
extern const struct wlan_crypto_cipher *ccmp256_register(void);
extern const struct wlan_crypto_cipher *gcmp_register(void);
extern const struct wlan_crypto_cipher *gcmp256_register(void);
extern const struct wlan_crypto_cipher *wapi_register(void);
extern const struct wlan_crypto_cipher
*wlan_crypto_cipher_ops[WLAN_CRYPTO_CIPHER_MAX];
@@ -82,20 +74,6 @@ static QDF_STATUS wlan_crypto_register_all_ciphers(
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS wlan_crypto_psoc_obj_create_handler(
struct wlan_objmgr_psoc *psoc,
void *arg)
{
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS wlan_crypto_pdev_obj_create_handler(
struct wlan_objmgr_pdev *pdev,
void *arg)
{
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS wlan_crypto_vdev_obj_create_handler(
struct wlan_objmgr_vdev *vdev,
void *arg)
@@ -193,20 +171,6 @@ static QDF_STATUS wlan_crypto_peer_obj_create_handler(
return status;
}
static QDF_STATUS wlan_crypto_psoc_obj_destroy_handler(
struct wlan_objmgr_psoc *psoc,
void *arg){
return QDF_STATUS_COMP_DISABLED;
}
static QDF_STATUS wlan_crypto_pdev_obj_destroy_handler(
struct wlan_objmgr_pdev *pdev,
void *arg){
return QDF_STATUS_SUCCESS;
}
static void wlan_crypto_free_key(struct wlan_crypto_comp_priv *crypto_priv)
{
uint8_t i;
@@ -296,7 +260,7 @@ QDF_STATUS __wlan_crypto_init(void)
WLAN_UMAC_COMP_CRYPTO,
wlan_crypto_vdev_obj_create_handler, NULL);
if (status != QDF_STATUS_SUCCESS)
goto err_vdev_create;
return status;
status = wlan_objmgr_register_peer_create_handler(
WLAN_UMAC_COMP_CRYPTO,
@@ -326,9 +290,7 @@ err_vdev_delete:
err_peer_create:
wlan_objmgr_unregister_vdev_create_handler(WLAN_UMAC_COMP_CRYPTO,
wlan_crypto_vdev_obj_create_handler, NULL);
err_vdev_create:
wlan_objmgr_unregister_pdev_create_handler(WLAN_UMAC_COMP_CRYPTO,
wlan_crypto_pdev_obj_create_handler, NULL);
register_success:
return status;
}

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -23,6 +23,63 @@
#ifndef __WLAN_CRYPTO_OBJ_MGR_I_
#define __WLAN_CRYPTO_OBJ_MGR_I_
#ifdef WLAN_CRYPTO_WEP_OS_DERIVATIVE
static inline const struct wlan_crypto_cipher *wep_register(void)
{
return NULL;
}
#else
const struct wlan_crypto_cipher *wep_register(void);
#endif
#ifdef WLAN_CRYPTO_TKIP_OS_DERIVATIVE
static inline const struct wlan_crypto_cipher *tkip_register(void)
{
return NULL;
}
#else
const struct wlan_crypto_cipher *tkip_register(void);
#endif
#ifdef WLAN_CRYPTO_CCMP_OS_DERIVATIVE
static inline const struct wlan_crypto_cipher *ccmp_register(void)
{
return NULL;
}
static inline const struct wlan_crypto_cipher *ccmp256_register(void)
{
return NULL;
}
#else
const struct wlan_crypto_cipher *ccmp_register(void);
const struct wlan_crypto_cipher *ccmp256_register(void);
#endif
#ifdef WLAN_CRYPTO_GCMP_OS_DERIVATIVE
static inline const struct wlan_crypto_cipher *gcmp_register(void)
{
return NULL;
}
static inline const struct wlan_crypto_cipher *gcmp256_register(void)
{
return NULL;
}
#else
const struct wlan_crypto_cipher *gcmp_register(void);
const struct wlan_crypto_cipher *gcmp256_register(void);
#endif
#ifdef WLAN_CRYPTO_WAPI_OS_DERIVATIVE
static inline const struct wlan_crypto_cipher *wapi_register(void)
{
return NULL;
}
#else
const struct wlan_crypto_cipher *wapi_register(void);
#endif
static inline void *wlan_get_vdev_crypto_obj(struct wlan_objmgr_vdev *vdev)
{