Prechádzať zdrojové kódy

qcacld-3.0: Use converged qcacmn macros (part 1)

Replace the existing qcacld-3.0 macros with qcacmn converged
macros.

Change-Id: Ie05f396fcd2e01cf86256f25dbc171bbdf763da9
CRs-Fixed: 2416429
Srinivas Girigowda 6 rokov pred
rodič
commit
cf161406dd

+ 19 - 15
components/mlme/core/src/wlan_mlme_main.c

@@ -1833,21 +1833,25 @@ static void mlme_init_nss_chains(struct wlan_objmgr_psoc *psoc,
 static void mlme_init_wep_keys(struct wlan_mlme_wep_cfg *wep_params)
 {
 	/* initialize the default key values to zero */
-	wep_params->wep_default_key_1.len = MLME_WEP_KEY_LEN_13;
-	wep_params->wep_default_key_1.max_len = MLME_WEP_KEY_LEN_13;
-	qdf_mem_zero(wep_params->wep_default_key_1.data, MLME_WEP_KEY_LEN_13);
-
-	wep_params->wep_default_key_2.len = MLME_WEP_KEY_LEN_13;
-	wep_params->wep_default_key_2.max_len = MLME_WEP_KEY_LEN_13;
-	qdf_mem_zero(wep_params->wep_default_key_2.data, MLME_WEP_KEY_LEN_13);
-
-	wep_params->wep_default_key_3.len = MLME_WEP_KEY_LEN_13;
-	wep_params->wep_default_key_3.max_len = MLME_WEP_KEY_LEN_13;
-	qdf_mem_zero(wep_params->wep_default_key_3.data, MLME_WEP_KEY_LEN_13);
-
-	wep_params->wep_default_key_4.len = MLME_WEP_KEY_LEN_13;
-	wep_params->wep_default_key_4.max_len = MLME_WEP_KEY_LEN_13;
-	qdf_mem_zero(wep_params->wep_default_key_4.data, MLME_WEP_KEY_LEN_13);
+	wep_params->wep_default_key_1.len = WLAN_CRYPTO_KEY_WEP104_LEN;
+	wep_params->wep_default_key_1.max_len = WLAN_CRYPTO_KEY_WEP104_LEN;
+	qdf_mem_zero(wep_params->wep_default_key_1.data,
+		     WLAN_CRYPTO_KEY_WEP104_LEN);
+
+	wep_params->wep_default_key_2.len = WLAN_CRYPTO_KEY_WEP104_LEN;
+	wep_params->wep_default_key_2.max_len = WLAN_CRYPTO_KEY_WEP104_LEN;
+	qdf_mem_zero(wep_params->wep_default_key_2.data,
+		     WLAN_CRYPTO_KEY_WEP104_LEN);
+
+	wep_params->wep_default_key_3.len = WLAN_CRYPTO_KEY_WEP104_LEN;
+	wep_params->wep_default_key_3.max_len = WLAN_CRYPTO_KEY_WEP104_LEN;
+	qdf_mem_zero(wep_params->wep_default_key_3.data,
+		     WLAN_CRYPTO_KEY_WEP104_LEN);
+
+	wep_params->wep_default_key_4.len = WLAN_CRYPTO_KEY_WEP104_LEN;
+	wep_params->wep_default_key_4.max_len = WLAN_CRYPTO_KEY_WEP104_LEN;
+	qdf_mem_zero(wep_params->wep_default_key_4.data,
+		     WLAN_CRYPTO_KEY_WEP104_LEN);
 }
 
 static void mlme_init_wep_cfg(struct wlan_mlme_wep_cfg *wep_params)

+ 0 - 3
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1785,9 +1785,6 @@ struct wlan_mlme_oce {
 	uint8_t feature_bitmap;
 };
 
-#define MLME_WEP_KEY_LEN_13 (13)
-#define MLME_WEP_KEY_LENGTH_5 (5)
-
 /**
  * enum wep_key_id  - values passed to get/set wep default keys
  * @MLME_WEP_DEFAULT_KEY_1: wep default key 1

+ 5 - 5
components/p2p/core/src/wlan_p2p_off_chan_tx.c

@@ -206,10 +206,10 @@ static const uint8_t *p2p_get_p2pie_from_probe_rsp(
 	ie_len = tx_ctx->buf_len - PROBE_RSP_IE_OFFSET;
 	p2p_ie = p2p_get_p2pie_ptr(ie, ie_len);
 	while ((p2p_ie) &&
-		(P2P_MAX_IE_LENGTH == p2p_ie[1])) {
+		(WLAN_MAX_IE_LEN == p2p_ie[1])) {
 		ie_len = tx_ctx->buf_len - (p2p_ie - tx_ctx->buf);
 		if (ie_len > 2) {
-			ie = p2p_ie + P2P_MAX_IE_LENGTH + 2;
+			ie = p2p_ie + WLAN_MAX_IE_LEN + 2;
 			tmp_p2p_ie = p2p_get_p2pie_ptr(ie, ie_len);
 		}
 
@@ -467,12 +467,12 @@ static uint16_t p2p_update_noa_stream(struct tx_action_context *tx_ctx,
 		p2p_ie[1] = orig_len;
 	}
 
-	if ((p2p_ie[1] + noa_len) > P2P_MAX_IE_LENGTH) {
+	if ((p2p_ie[1] + noa_len) > WLAN_MAX_IE_LEN) {
 		overflow_len = p2p_ie[1] + noa_len -
-				P2P_MAX_IE_LENGTH;
+				WLAN_MAX_IE_LEN;
 		noa_len = p2p_get_noa_attr_stream_in_mult_p2p_ies(
 				noa_stream, noa_len, overflow_len);
-		p2p_ie[1] = P2P_MAX_IE_LENGTH;
+		p2p_ie[1] = WLAN_MAX_IE_LEN;
 	} else {
 		/* increment the length of P2P IE */
 		p2p_ie[1] += noa_len;

+ 1 - 2
components/p2p/core/src/wlan_p2p_off_chan_tx.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019 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
@@ -36,7 +36,6 @@
 
 #define P2P_MAX_NOA_ATTR_LEN                    31
 #define P2P_IE_HEADER_LEN                       6
-#define P2P_MAX_IE_LENGTH                       255
 #define P2P_ACTION_OFFSET                       24
 #define P2P_PUBLIC_ACTION_FRAME_TYPE_OFFSET     30
 #define P2P_ACTION_FRAME_TYPE_OFFSET            29

+ 1 - 4
core/hdd/inc/wlan_hdd_main.h

@@ -245,9 +245,6 @@ enum hdd_driver_flags {
 #define MAX_GENIE_LEN (512)
 #define MIN_GENIE_LEN (2)
 
-/** Maximum Length of WPA/RSN IE */
-#define MAX_WPA_RSN_IE_LEN 255
-
 #define WPS_OUI_TYPE   "\x00\x50\xf2\x04"
 #define WPS_OUI_TYPE_SIZE  4
 
@@ -706,7 +703,7 @@ struct hdd_mon_set_ch_info {
  */
 struct hdd_station_ctx {
 	struct csr_roam_profile roam_profile;
-	uint8_t security_ie[MAX_WPA_RSN_IE_LEN];
+	uint8_t security_ie[WLAN_MAX_IE_LEN];
 	tSirAddie assoc_additional_ie;
 	enum nl80211_wpa_versions wpa_versions;
 	enum hdd_auth_key_mgmt auth_key_mgmt;

+ 1 - 1
core/hdd/src/wlan_hdd_assoc.c

@@ -5758,7 +5758,7 @@ void hdd_roam_profile_init(struct hdd_adapter *adapter)
 	qdf_mem_zero(roam_profile, sizeof(*roam_profile));
 
 	security_ie = hdd_security_ie(adapter);
-	qdf_mem_zero(security_ie, MAX_WPA_RSN_IE_LEN);
+	qdf_mem_zero(security_ie, WLAN_MAX_IE_LEN);
 
 	assoc_additional_ie = hdd_assoc_additional_ie(adapter);
 	qdf_mem_zero(assoc_additional_ie, sizeof(*assoc_additional_ie));

+ 9 - 8
core/hdd/src/wlan_hdd_cfg80211.c

@@ -5294,7 +5294,7 @@ wlan_hdd_wifi_config_policy[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + 1] = {
 	[QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY] = {.type = NLA_U32 },
 	[QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY_IE_LIST] = {
 		.type = NLA_BINARY,
-		.len = SIR_MAC_MAX_IE_LENGTH + 2},
+		.len = WLAN_MAX_IE_LEN + 2},
 
 };
 
@@ -5649,7 +5649,7 @@ static int hdd_config_access_policy(struct hdd_adapter *adapter,
 	struct nlattr *ielist_attr =
 		tb[QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY_IE_LIST];
 	uint32_t access_policy;
-	uint8_t ie[SIR_MAC_MAX_IE_LENGTH + 2];
+	uint8_t ie[WLAN_MAX_IE_LEN + 2];
 	QDF_STATUS status;
 
 	/* nothing to do if neither attribute is present */
@@ -5678,7 +5678,7 @@ static int hdd_config_access_policy(struct hdd_adapter *adapter,
 
 	/*
 	 * ie length is validated by the nla_policy.  need to make a
-	 * copy since SME will always read SIR_MAC_MAX_IE_LENGTH+2 bytes
+	 * copy since SME will always read WLAN_MAX_IE_LEN+2 bytes
 	 */
 	nla_memcpy(ie, ielist_attr, sizeof(ie));
 
@@ -14591,7 +14591,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (CSR_MAX_RSC_LEN < params->seq_len) {
+	if (WLAN_CRYPTO_RSC_SIZE < params->seq_len) {
 		hdd_err("Invalid seq length %d", params->seq_len);
 
 		return -EINVAL;
@@ -15246,7 +15246,8 @@ static int __wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy,
 			qdf_copy_macaddr(&setKey.peerMac,
 					 &sta_ctx->conn_info.bssid);
 
-			if (Keys->KeyLength[key_index] == CSR_WEP40_KEY_LEN &&
+			if (Keys->KeyLength[key_index] ==
+					WLAN_CRYPTO_KEY_WEP40_LEN &&
 			    roam_profile->EncryptionType.
 			    encryptionType[0] == eCSR_ENCRYPT_TYPE_WEP104) {
 				/* In the case of dynamic wep
@@ -17232,14 +17233,14 @@ static int wlan_hdd_cfg80211_set_ie(struct hdd_adapter *adapter,
 				roam_profile->nAddIEAssocLength =
 					assoc_add_ie->length;
 			} else if (0 == memcmp(&genie[0], "\x00\x50\xf2", 3)) {
-				if (eLen > (MAX_WPA_RSN_IE_LEN - 2)) {
+				if (eLen > (WLAN_MAX_IE_LEN - 2)) {
 					hdd_err("%s: Invalid WPA IE length[%d]",
 						__func__, eLen);
 					QDF_ASSERT(0);
 					return -EINVAL;
 				}
 				hdd_debug("Set WPA IE (len %d)", eLen + 2);
-				memset(security_ie, 0, MAX_WPA_RSN_IE_LEN);
+				memset(security_ie, 0, WLAN_MAX_IE_LEN);
 				memcpy(security_ie, genie - 2, (eLen + 2));
 				roam_profile->pWPAReqIE = security_ie;
 				roam_profile->nWPAReqIELength = eLen + 2;     /* ie_len; */
@@ -17375,7 +17376,7 @@ static int wlan_hdd_cfg80211_set_ie(struct hdd_adapter *adapter,
 						__func__, eLen);
 				return -EINVAL;
 			}
-			memset(security_ie, 0, MAX_WPA_RSN_IE_LEN);
+			memset(security_ie, 0, WLAN_MAX_IE_LEN);
 			memcpy(security_ie, genie - 2, (eLen + 2));
 			roam_profile->pRSNReqIE = security_ie;
 			roam_profile->nRSNReqIELength = eLen + 2;     /* ie_len; */

+ 5 - 7
core/mac/inc/ani_system_defs.h

@@ -32,15 +32,13 @@
 
 #include "sir_types.h"
 #include "sir_mac_prot_def.h"
+#include "wlan_crypto_global_def.h"
 
 #define ANI_OUI  0x000AF5
 
 /* This is to force compiler to use the maximum of an int for enum */
 #define SIR_MAX_ENUM_SIZE    0x7FFFFFFF
 
-/* Max key size  including the WAPI and TKIP */
-#define WLAN_MAX_KEY_RSC_LEN         16
-
 #ifndef false
 #undef false
 #define false   0
@@ -138,12 +136,12 @@ typedef struct sAniSSID {
 /* / RSN IE information */
 typedef struct sSirRSNie {
 	uint16_t length;
-	uint8_t rsnIEdata[SIR_MAC_MAX_IE_LENGTH + 2];
+	uint8_t rsnIEdata[WLAN_MAX_IE_LEN + 2];
 } tSirRSNie, *tpSirRSNie;
 
 typedef struct sSirWAPIie {
 	uint16_t length;
-	uint8_t wapiIEdata[SIR_MAC_MAX_IE_LENGTH + 2];
+	uint8_t wapiIEdata[WLAN_MAX_IE_LEN + 2];
 } tSirWAPIie, *tpSirWAPIie;
 /* / Additional IE information : */
 /* / This can include WSC IE, P2P IE, and/or FTIE from upper layer. */
@@ -160,7 +158,7 @@ typedef struct sSirAddie {
 /* Join and Reassoc Req. */
 typedef struct sSirCCKMie {
 	uint16_t length;
-	uint8_t cckmIEdata[SIR_MAC_MAX_IE_LENGTH + 2];
+	uint8_t cckmIEdata[WLAN_MAX_IE_LEN + 2];
 } tSirCCKMie, *tpSirCCKMie;
 
 #endif
@@ -170,7 +168,7 @@ typedef struct sSirKeys {
 	uint8_t keyId;
 	uint8_t unicast;        /* 0 for multicast */
 	tAniKeyDirection keyDirection;
-	uint8_t keyRsc[WLAN_MAX_KEY_RSC_LEN];   /* Usage is unknown */
+	uint8_t keyRsc[WLAN_CRYPTO_RSC_SIZE];   /* Usage is unknown */
 	uint8_t paeRole;        /* =1 for authenticator, */
 	/* =0 for supplicant */
 	uint16_t keyLength;

+ 1 - 1
core/mac/inc/sir_api.h

@@ -5382,7 +5382,7 @@ struct sme_update_access_policy_vendor_ie {
 	uint16_t msg_type;
 	uint16_t length;
 	uint32_t sme_session_id;
-	uint8_t ie[SIR_MAC_MAX_IE_LENGTH + 2];
+	uint8_t ie[WLAN_MAX_IE_LEN + 2];
 	uint8_t access_policy;
 };
 

+ 2 - 10
core/mac/inc/sir_mac_prot_def.h

@@ -430,11 +430,6 @@
 
 #define SIR_MAC_MAX_ADD_IE_LENGTH       2048
 
-/* / Maximum length of each IE */
-#define SIR_MAC_MAX_IE_LENGTH       255
-
-/* / Maximum length of each IE */
-#define SIR_MAC_RSN_IE_MAX_LENGTH   255
 /* / Minimum length of each IE */
 #define SIR_MAC_RSN_IE_MIN_LENGTH   2
 #define SIR_MAC_WPA_IE_MIN_LENGTH   6
@@ -456,8 +451,6 @@
 
 /* OUI and type definition for WPA IE in network byte order */
 #define SIR_MAC_WPA_OUI             0x01F25000
-#define SIR_MAC_WME_OUI             0x02F25000
-#define SIR_MAC_WSM_OUI             SIR_MAC_WME_OUI
 #define SIR_MAC_WSC_OUI             "\x00\x50\xf2\x04"
 #define SIR_MAC_WSC_OUI_SIZE        4
 #define SIR_MAC_P2P_OUI             "\x50\x6f\x9a\x09"
@@ -581,7 +574,6 @@
 
 /* / MAX key length when ULA is used */
 #define SIR_MAC_MAX_KEY_LENGTH               32
-#define SIR_MAC_MAX_KEY_RSC_LEN              16
 
 /* / Macro definitions for get/set on FC fields */
 #define SIR_MAC_GET_PROT_VERSION(x)      ((((uint16_t) x) & 0x0300) >> 8)
@@ -1000,13 +992,13 @@ typedef struct sSirMacSSid {
 
 typedef struct sSirMacWpaInfo {
 	uint8_t length;
-	uint8_t info[SIR_MAC_MAX_IE_LENGTH];
+	uint8_t info[WLAN_MAX_IE_LEN];
 } qdf_packed tSirMacWpaInfo, *tpSirMacWpaInfo,
 tSirMacRsnInfo, *tpSirMacRsnInfo;
 
 typedef struct sSirMacWapiInfo {
 	uint8_t length;
-	uint8_t info[SIR_MAC_MAX_IE_LENGTH];
+	uint8_t info[WLAN_MAX_IE_LEN];
 } qdf_packed tSirMacWapiInfo, *tpSirMacWapiInfo;
 
 typedef struct sSirMacFHParamSet {

+ 1 - 6
core/mac/src/pe/include/lim_fils_defs.h

@@ -20,9 +20,6 @@
 #define FILS_SHA256_128_AUTH_TAG 16
 #define FILS_SHA256_256_AUTH_TAG 32
 
-#define FILS_SHA256_CRYPTO_TYPE "hmac(sha256)"
-#define FILS_SHA384_CRYPTO_TYPE "hmac(sha384)"
-
 /* RFC 6696 */
 #define RMSK_LABEL "Re-authentication Master Session [email protected]"
 
@@ -75,8 +72,6 @@
 #define SIR_FILS_WRAPPED_DATA_MAX_SIZE 255
 #define SIR_FILS_WRAPPED_DATA_EXT_EID   8
 
-#define MAX_IE_LENGTH 255
-
 /* RFC 6696 5.3.1: EAP-Initiate/Re-auth-Start Packet */
 #define SIR_FILS_EAP_REAUTH_PACKET_TYPE 1
 #define SIR_FILS_EAP_INIT_PACKET_TYPE 2
@@ -238,7 +233,7 @@ struct pe_fils_session {
 	uint16_t sequence_number;
 	uint8_t fils_session[SIR_FILS_SESSION_LENGTH];
 	uint8_t fils_nonce[SIR_FILS_NONCE_LENGTH];
-	uint8_t rsn_ie[MAX_IE_LENGTH];
+	uint8_t rsn_ie[WLAN_MAX_IE_LEN];
 	uint8_t rsn_ie_len;
 	uint8_t *fils_eap_finish_pkt;
 	uint8_t fils_eap_finish_pkt_len;

+ 6 - 6
core/mac/src/pe/lim/lim_process_assoc_req_frame.c

@@ -831,8 +831,8 @@ static tSirMacStatusCodes lim_check_rsn_ie(struct pe_session *session,
 {
 	struct wlan_objmgr_vdev *vdev;
 
-	uint8_t buffer[SIR_MAC_MAX_IE_LENGTH];
-	uint32_t dot11f_status, written = 0, nbuffer = SIR_MAC_MAX_IE_LENGTH;
+	uint8_t buffer[WLAN_MAX_IE_LEN];
+	uint32_t dot11f_status, written = 0, nbuffer = WLAN_MAX_IE_LEN;
 	tSirMacRsnInfo rsn_ie;
 
 	dot11f_status = dot11f_pack_ie_rsn(mac_ctx, rsn, buffer,
@@ -868,8 +868,8 @@ static tSirMacStatusCodes lim_check_wpa_ie(struct pe_session *session,
 					   tpSirAssocReq assoc_req,
 					   tDot11fIEWPA *wpa)
 {
-	uint8_t buffer[SIR_MAC_MAX_IE_LENGTH];
-	uint32_t dot11f_status, written = 0, nbuffer = SIR_MAC_MAX_IE_LENGTH;
+	uint8_t buffer[WLAN_MAX_IE_LEN];
+	uint32_t dot11f_status, written = 0, nbuffer = WLAN_MAX_IE_LEN;
 	tSirMacRsnInfo wpa_ie = {0};
 
 	dot11f_status = dot11f_pack_ie_wpa(mac_ctx, wpa, buffer,
@@ -2593,7 +2593,7 @@ void lim_send_mlm_assoc_ind(struct mac_context *mac_ctx,
 		if (assoc_req->wpaPresent && (NULL == wpsie)) {
 			rsn_len = assoc_ind->rsnIE.length;
 			if ((rsn_len + assoc_req->wpa.length)
-				>= SIR_MAC_MAX_IE_LENGTH) {
+				>= WLAN_MAX_IE_LEN) {
 				pe_err("rsnIEdata index out of bounds: %d",
 					rsn_len);
 				qdf_mem_free(assoc_ind);
@@ -2630,7 +2630,7 @@ void lim_send_mlm_assoc_ind(struct mac_context *mac_ctx,
 
 			rsn_len = assoc_ind->addIE.length;
 			if (assoc_ind->addIE.length + DOT11F_IE_HTCAPS_MIN_LEN
-				+ 2 < SIR_MAC_MAX_IE_LENGTH) {
+				+ 2 < WLAN_MAX_IE_LEN) {
 				assoc_ind->addIE.addIEdata[rsn_len] =
 					SIR_MAC_HT_CAPABILITIES_EID;
 				assoc_ind->addIE.addIEdata[rsn_len + 1] =

+ 6 - 6
core/mac/src/pe/lim/lim_process_fils.c

@@ -97,11 +97,11 @@ static uint8_t *lim_get_crypto_type(uint8_t akm)
 	switch (akm) {
 	case eCSR_AUTH_TYPE_FILS_SHA384:
 	case eCSR_AUTH_TYPE_FT_FILS_SHA384:
-		return FILS_SHA384_CRYPTO_TYPE;
+		return HMAC_SHA386_CRYPTO_TYPE;
 	case eCSR_AUTH_TYPE_FILS_SHA256:
 	case eCSR_AUTH_TYPE_FT_FILS_SHA256:
 	default:
-		return FILS_SHA256_CRYPTO_TYPE;
+		return HMAC_SHA256_CRYPTO_TYPE;
 	}
 }
 
@@ -292,7 +292,7 @@ lim_default_hmac_sha256_kdf(uint8_t *secret, uint32_t secret_len,
 	}
 
 	/* Create T1 */
-	if (qdf_get_hmac_hash(FILS_SHA256_CRYPTO_TYPE, secret, secret_len, 3,
+	if (qdf_get_hmac_hash(HMAC_SHA256_CRYPTO_TYPE, secret, secret_len, 3,
 			&addr[1], &len[1], tmp_hash) < 0) {
 		pe_err("failed to get hmac hash");
 		return QDF_STATUS_E_FAILURE;
@@ -308,7 +308,7 @@ lim_default_hmac_sha256_kdf(uint8_t *secret, uint32_t secret_len,
 			remaining_data = SHA256_DIGEST_SIZE;
 
 		/* Create T-n */
-		if (qdf_get_hmac_hash(FILS_SHA256_CRYPTO_TYPE, secret,
+		if (qdf_get_hmac_hash(HMAC_SHA256_CRYPTO_TYPE, secret,
 				secret_len, 4, addr, len, tmp_hash) < 0) {
 			pe_err("failed to get hmac hash");
 			return QDF_STATUS_E_FAILURE;
@@ -761,7 +761,7 @@ static QDF_STATUS lim_process_auth_wrapped_data(struct pe_session *pe_session,
 	input_len[0] -= auth_tag_len;
 	/* if we have auth tag remaining */
 	if (remaining_len == auth_tag_len) {
-		qdf_get_hmac_hash(FILS_SHA256_CRYPTO_TYPE,
+		qdf_get_hmac_hash(HMAC_SHA256_CRYPTO_TYPE,
 				fils_info->fils_rik,
 				fils_info->fils_rik_len,
 				SINGLE_ELEMENT_HASH_CNT,
@@ -953,7 +953,7 @@ static int lim_create_fils_wrapper_data(struct pe_fils_session *fils_info)
 	fils_info->fils_erp_reauth_pkt_len = buf_len;
 	length = fils_info->fils_erp_reauth_pkt_len -
 			lim_get_auth_tag_len(HMAC_SHA256_128);
-	qdf_get_hmac_hash(FILS_SHA256_CRYPTO_TYPE,
+	qdf_get_hmac_hash(HMAC_SHA256_CRYPTO_TYPE,
 			fils_info->fils_rik, fils_info->fils_rik_len, 1,
 			&fils_info->fils_erp_reauth_pkt, &length, auth_tag);
 

+ 2 - 2
core/mac/src/pe/lim/lim_send_frames_host_roam.c

@@ -188,7 +188,7 @@ void lim_send_reassoc_req_with_ft_ies_mgmt_frame(struct mac_context *mac_ctx,
 	 *     typedef struct sSirRSNie
 	 *     {
 	 *         uint16_t       length;
-	 *         uint8_t        rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2];
+	 *         uint8_t        rsnIEdata[WLAN_MAX_IE_LEN+2];
 	 *     } tSirRSNie, *tpSirRSNie;
 	 *
 	 * So, we should be able to make the following two calls harmlessly,
@@ -641,7 +641,7 @@ void lim_send_reassoc_req_mgmt_frame(struct mac_context *mac,
 	/*     typedef struct sSirRSNie */
 	/*     { */
 	/*         uint16_t       length; */
-	/*         uint8_t        rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2]; */
+	/*         uint8_t        rsnIEdata[WLAN_MAX_IE_LEN+2]; */
 	/*     } tSirRSNie, *tpSirRSNie; */
 
 	/* So, we should be able to make the following two calls harmlessly, */

+ 1 - 1
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -1717,7 +1717,7 @@ lim_send_assoc_req_mgmt_frame(struct mac_context *mac_ctx,
 	 *     typedef struct sSirRSNie
 	 *     {
 	 *         uint16_t       length;
-	 *         uint8_t        rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2];
+	 *         uint8_t        rsnIEdata[WLAN_MAX_IE_LEN+2];
 	 *     } tSirRSNie, *tpSirRSNie;
 	 * So, we should be able to make the following two calls harmlessly,
 	 * since they do nothing if they don't find the given IE in the

+ 5 - 5
core/mac/src/pe/lim/lim_sme_req_utils.c

@@ -107,10 +107,10 @@ lim_is_rsn_ie_valid_in_sme_req_message(struct mac_context *mac_ctx,
 			break;
 		case DOT11F_EID_WPA:
 			/* Check validity of WPA IE */
-			if (SIR_MAC_MAX_IE_LENGTH <= start)
+			if (WLAN_MAX_IE_LEN <= start)
 				break;
 
-			if (start <= (SIR_MAC_MAX_IE_LENGTH - sizeof(uint32_t)))
+			if (start <= (WLAN_MAX_IE_LEN - sizeof(uint32_t)))
 				val = sir_read_u32((uint8_t *) &
 					rsn_ie->rsnIEdata[start + 2]);
 
@@ -251,7 +251,7 @@ lim_set_rs_nie_wp_aiefrom_sme_start_bss_req_message(struct mac_context *mac_ctx,
 	    (rsn_ie->rsnIEdata[1] < SIR_MAC_RSN_IE_MIN_LENGTH)) {
 		pe_err("RSN IE len: %d not [%d,%d]",
 			rsn_ie->rsnIEdata[1], SIR_MAC_RSN_IE_MIN_LENGTH,
-			SIR_MAC_RSN_IE_MAX_LENGTH);
+			WLAN_MAX_IE_LEN);
 		return false;
 	}
 
@@ -287,7 +287,7 @@ lim_set_rs_nie_wp_aiefrom_sme_start_bss_req_message(struct mac_context *mac_ctx,
 		return true;
 	}
 	/* Check validity of WPA IE */
-	if (wpa_idx + 6 >= SIR_MAC_MAX_IE_LENGTH)
+	if (wpa_idx + 6 >= WLAN_MAX_IE_LEN)
 		return false;
 
 	val = sir_read_u32((uint8_t *)&rsn_ie->rsnIEdata[wpa_idx + 2]);
@@ -297,7 +297,7 @@ lim_set_rs_nie_wp_aiefrom_sme_start_bss_req_message(struct mac_context *mac_ctx,
 		pe_err("WPA IE len: %d not [%d,%d] OR data 0x%x not 0x%x",
 			rsn_ie->rsnIEdata[1],
 			SIR_MAC_RSN_IE_MIN_LENGTH,
-			SIR_MAC_RSN_IE_MAX_LENGTH, val,
+			WLAN_MAX_IE_LEN, val,
 			SIR_MAC_WPA_OUI);
 		return false;
 	} else {

+ 1 - 1
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -109,7 +109,7 @@ int find_ie_location(struct mac_context *mac, tpSirRSNie pRsnIe, uint8_t EID)
 	/*     typedef struct sSirRSNie */
 	/*     { */
 	/*         uint16_t       length; */
-	/*         uint8_t        rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2]; */
+	/*         uint8_t        rsnIEdata[WLAN_MAX_IE_LEN+2]; */
 	/*     } tSirRSNie, *tpSirRSNie; */
 
 	/* other code records both the WPA & RSN IEs (including their EIDs & */

+ 1 - 1
core/sap/inc/sap_api.h

@@ -485,7 +485,7 @@ typedef struct sap_config {
 	uint8_t num_accept_mac;
 	uint8_t num_deny_mac;
 	/* Max ie length 255 * 2(WPA+RSN) + 2 bytes(vendor specific ID) * 2 */
-	uint8_t RSNWPAReqIE[(SIR_MAC_MAX_IE_LENGTH * 2) + 4];
+	uint8_t RSNWPAReqIE[(WLAN_MAX_IE_LEN * 2) + 4];
 	/* it is ignored if [0] is 0. */
 	uint8_t countryCode[CFG_COUNTRY_CODE_LEN];
 	uint8_t RSNEncryptType;

+ 1 - 4
core/sme/inc/csr_api.h

@@ -176,8 +176,6 @@ typedef enum {
 #define CSR_RSN_PMKID_SIZE          16
 #define CSR_RSN_MAX_PMK_LEN         48
 #define CSR_MAX_PMKID_ALLOWED       32
-#define CSR_WEP40_KEY_LEN           5
-#define CSR_WEP104_KEY_LEN          13
 #define CSR_TKIP_KEY_LEN            32
 #define CSR_AES_KEY_LEN             16
 #define CSR_AES_GCMP_KEY_LEN        16
@@ -185,7 +183,6 @@ typedef enum {
 #define CSR_AES_GMAC_128_KEY_LEN    16
 #define CSR_AES_GMAC_256_KEY_LEN    32
 #define CSR_MAX_TX_POWER        (WNI_CFG_CURRENT_TX_POWER_LEVEL_STAMAX)
-#define CSR_MAX_RSC_LEN             16
 #ifdef FEATURE_WLAN_WAPI
 #define CSR_WAPI_BKID_SIZE          16
 #define CSR_MAX_BKID_ALLOWED        16
@@ -1297,7 +1294,7 @@ typedef struct tagCsrRoamSetKey {
 	uint8_t keyId;          /* Key index */
 	uint16_t keyLength;     /* Number of bytes containing the key in pKey */
 	uint8_t Key[CSR_MAX_KEY_LEN];
-	uint8_t keyRsc[CSR_MAX_RSC_LEN];
+	uint8_t keyRsc[WLAN_CRYPTO_RSC_SIZE];
 } tCsrRoamSetKey;
 
 typedef void *tScanResultHandle;

+ 1 - 1
core/sme/inc/csr_internal.h

@@ -306,7 +306,7 @@ struct setkey_cmd {
 	uint8_t keyId;          /* Kye index */
 	uint8_t keyLength;      /* Number of bytes containing the key in pKey */
 	uint8_t Key[CSR_MAX_KEY_LEN];
-	uint8_t keyRsc[CSR_MAX_RSC_LEN];
+	uint8_t keyRsc[WLAN_CRYPTO_RSC_SIZE];
 };
 
 struct wmstatus_changecmd {

+ 1 - 1
core/sme/src/common/sme_ft_api.c

@@ -266,7 +266,7 @@ QDF_STATUS sme_ft_send_update_key_ind(struct mac_context *mac, uint32_t session_
 	keymaterial->key[0].keyDirection = ftkey_info->keyDirection;
 
 	qdf_mem_copy(&keymaterial->key[0].keyRsc,
-			ftkey_info->keyRsc, CSR_MAX_RSC_LEN);
+			ftkey_info->keyRsc, WLAN_CRYPTO_RSC_SIZE);
 	keymaterial->key[0].paeRole = ftkey_info->paeRole;
 	keymaterial->key[0].keyLength = ftkey_info->keyLength;
 

+ 39 - 39
core/sme/src/csr/csr_api_roam.c

@@ -4115,20 +4115,20 @@ static QDF_STATUS csr_roam_get_qos_info_from_bss(struct mac_context *mac,
 
 static void csr_reset_cfg_privacy(struct mac_context *mac)
 {
-	uint8_t Key0[MLME_WEP_KEY_LEN_13] = {0};
-	uint8_t Key1[MLME_WEP_KEY_LEN_13] = {0};
-	uint8_t Key2[MLME_WEP_KEY_LEN_13] = {0};
-	uint8_t Key3[MLME_WEP_KEY_LEN_13] = {0};
+	uint8_t Key0[WLAN_CRYPTO_KEY_WEP104_LEN] = {0};
+	uint8_t Key1[WLAN_CRYPTO_KEY_WEP104_LEN] = {0};
+	uint8_t Key2[WLAN_CRYPTO_KEY_WEP104_LEN] = {0};
+	uint8_t Key3[WLAN_CRYPTO_KEY_WEP104_LEN] = {0};
 	struct wlan_mlme_wep_cfg *wep_params = &mac->mlme_cfg->wep_params;
 
 	mlme_set_wep_key(wep_params, MLME_WEP_DEFAULT_KEY_1, Key0,
-			 MLME_WEP_KEY_LEN_13);
+			 WLAN_CRYPTO_KEY_WEP104_LEN);
 	mlme_set_wep_key(wep_params, MLME_WEP_DEFAULT_KEY_2, Key1,
-			 MLME_WEP_KEY_LEN_13);
+			 WLAN_CRYPTO_KEY_WEP104_LEN);
 	mlme_set_wep_key(wep_params, MLME_WEP_DEFAULT_KEY_3, Key2,
-			 MLME_WEP_KEY_LEN_13);
+			 WLAN_CRYPTO_KEY_WEP104_LEN);
 	mlme_set_wep_key(wep_params, MLME_WEP_DEFAULT_KEY_4, Key3,
-			 MLME_WEP_KEY_LEN_13);
+			 WLAN_CRYPTO_KEY_WEP104_LEN);
 }
 
 void csr_set_cfg_privacy(struct mac_context *mac, struct csr_roam_profile *pProfile,
@@ -4141,14 +4141,14 @@ void csr_set_cfg_privacy(struct mac_context *mac, struct csr_roam_profile *pProf
 	 * associations. See note below in this function...
 	 */
 	uint32_t privacy_enabled = 0, rsn_enabled = 0, wep_default_key_id = 0;
-	uint32_t WepKeyLength = MLME_WEP_KEY_LENGTH_5;
+	uint32_t WepKeyLength = WLAN_CRYPTO_KEY_WEP40_LEN;
 	uint32_t Key0Length = 0, Key1Length = 0, Key2Length = 0, Key3Length = 0;
 
 	/* Reserve for the biggest key */
-	uint8_t Key0[MLME_WEP_KEY_LEN_13];
-	uint8_t Key1[MLME_WEP_KEY_LEN_13];
-	uint8_t Key2[MLME_WEP_KEY_LEN_13];
-	uint8_t Key3[MLME_WEP_KEY_LEN_13];
+	uint8_t Key0[WLAN_CRYPTO_KEY_WEP104_LEN];
+	uint8_t Key1[WLAN_CRYPTO_KEY_WEP104_LEN];
+	uint8_t Key2[WLAN_CRYPTO_KEY_WEP104_LEN];
+	uint8_t Key3[WLAN_CRYPTO_KEY_WEP104_LEN];
 
 	struct wlan_mlme_wep_cfg *wep_params = &mac->mlme_cfg->wep_params;
 
@@ -4173,7 +4173,7 @@ void csr_set_cfg_privacy(struct mac_context *mac, struct csr_roam_profile *pProf
 		/* Set the Wep default key ID. */
 		wep_default_key_id = pProfile->Keys.defaultIndex;
 		/* Wep key size if 5 bytes (40 bits). */
-		WepKeyLength = MLME_WEP_KEY_LENGTH_5;
+		WepKeyLength = WLAN_CRYPTO_KEY_WEP40_LEN;
 		/*
 		 * set encryption keys in the CFG database or
 		 * clear those that are not present in this profile.
@@ -4181,8 +4181,8 @@ void csr_set_cfg_privacy(struct mac_context *mac, struct csr_roam_profile *pProf
 		if (pProfile->Keys.KeyLength[0]) {
 			qdf_mem_copy(Key0,
 				pProfile->Keys.KeyMaterial[0],
-				MLME_WEP_KEY_LENGTH_5);
-			Key0Length = MLME_WEP_KEY_LENGTH_5;
+				WLAN_CRYPTO_KEY_WEP40_LEN);
+			Key0Length = WLAN_CRYPTO_KEY_WEP40_LEN;
 		} else {
 			Key0Length = 0;
 		}
@@ -4190,8 +4190,8 @@ void csr_set_cfg_privacy(struct mac_context *mac, struct csr_roam_profile *pProf
 		if (pProfile->Keys.KeyLength[1]) {
 			qdf_mem_copy(Key1,
 				pProfile->Keys.KeyMaterial[1],
-				MLME_WEP_KEY_LENGTH_5);
-			Key1Length = MLME_WEP_KEY_LENGTH_5;
+				WLAN_CRYPTO_KEY_WEP40_LEN);
+			Key1Length = WLAN_CRYPTO_KEY_WEP40_LEN;
 		} else {
 			Key1Length = 0;
 		}
@@ -4199,8 +4199,8 @@ void csr_set_cfg_privacy(struct mac_context *mac, struct csr_roam_profile *pProf
 		if (pProfile->Keys.KeyLength[2]) {
 			qdf_mem_copy(Key2,
 				pProfile->Keys.KeyMaterial[2],
-				MLME_WEP_KEY_LENGTH_5);
-			Key2Length = MLME_WEP_KEY_LENGTH_5;
+				WLAN_CRYPTO_KEY_WEP40_LEN);
+			Key2Length = WLAN_CRYPTO_KEY_WEP40_LEN;
 		} else {
 			Key2Length = 0;
 		}
@@ -4208,8 +4208,8 @@ void csr_set_cfg_privacy(struct mac_context *mac, struct csr_roam_profile *pProf
 		if (pProfile->Keys.KeyLength[3]) {
 			qdf_mem_copy(Key3,
 				pProfile->Keys.KeyMaterial[3],
-				MLME_WEP_KEY_LENGTH_5);
-			Key3Length = MLME_WEP_KEY_LENGTH_5;
+				WLAN_CRYPTO_KEY_WEP40_LEN);
+			Key3Length = WLAN_CRYPTO_KEY_WEP40_LEN;
 		} else {
 			Key3Length = 0;
 		}
@@ -4224,7 +4224,7 @@ void csr_set_cfg_privacy(struct mac_context *mac, struct csr_roam_profile *pProf
 		/* Set the Wep default key ID. */
 		wep_default_key_id = pProfile->Keys.defaultIndex;
 		/* Wep key size if 13 bytes (104 bits). */
-		WepKeyLength = MLME_WEP_KEY_LEN_13;
+		WepKeyLength = WLAN_CRYPTO_KEY_WEP104_LEN;
 		/*
 		 * set encryption keys in the CFG database or clear
 		 * those that are not present in this profile.
@@ -4232,8 +4232,8 @@ void csr_set_cfg_privacy(struct mac_context *mac, struct csr_roam_profile *pProf
 		if (pProfile->Keys.KeyLength[0]) {
 			qdf_mem_copy(Key0,
 				pProfile->Keys.KeyMaterial[0],
-				MLME_WEP_KEY_LEN_13);
-			Key0Length = MLME_WEP_KEY_LEN_13;
+				WLAN_CRYPTO_KEY_WEP104_LEN);
+			Key0Length = WLAN_CRYPTO_KEY_WEP104_LEN;
 		} else {
 			Key0Length = 0;
 		}
@@ -4241,8 +4241,8 @@ void csr_set_cfg_privacy(struct mac_context *mac, struct csr_roam_profile *pProf
 		if (pProfile->Keys.KeyLength[1]) {
 			qdf_mem_copy(Key1,
 				pProfile->Keys.KeyMaterial[1],
-				MLME_WEP_KEY_LEN_13);
-			Key1Length = MLME_WEP_KEY_LEN_13;
+				WLAN_CRYPTO_KEY_WEP104_LEN);
+			Key1Length = WLAN_CRYPTO_KEY_WEP104_LEN;
 		} else {
 			Key1Length = 0;
 		}
@@ -4250,8 +4250,8 @@ void csr_set_cfg_privacy(struct mac_context *mac, struct csr_roam_profile *pProf
 		if (pProfile->Keys.KeyLength[2]) {
 			qdf_mem_copy(Key2,
 				pProfile->Keys.KeyMaterial[2],
-				MLME_WEP_KEY_LEN_13);
-			Key2Length = MLME_WEP_KEY_LEN_13;
+				WLAN_CRYPTO_KEY_WEP104_LEN);
+			Key2Length = WLAN_CRYPTO_KEY_WEP104_LEN;
 		} else {
 			Key2Length = 0;
 		}
@@ -4259,8 +4259,8 @@ void csr_set_cfg_privacy(struct mac_context *mac, struct csr_roam_profile *pProf
 		if (pProfile->Keys.KeyLength[3]) {
 			qdf_mem_copy(Key3,
 				pProfile->Keys.KeyMaterial[3],
-				MLME_WEP_KEY_LEN_13);
-			Key3Length = MLME_WEP_KEY_LEN_13;
+				WLAN_CRYPTO_KEY_WEP104_LEN);
+			Key3Length = WLAN_CRYPTO_KEY_WEP104_LEN;
 		} else {
 			Key3Length = 0;
 		}
@@ -9962,16 +9962,16 @@ csr_update_key_cmd(struct mac_context *mac_ctx, struct csr_roam_session *session
 	case eCSR_ENCRYPT_TYPE_WEP40_STATICKEY:
 		/* KeyLength maybe 0 for static WEP */
 		if (set_key->keyLength) {
-			if (set_key->keyLength < CSR_WEP40_KEY_LEN) {
+			if (set_key->keyLength < WLAN_CRYPTO_KEY_WEP40_LEN) {
 				sme_warn("Invalid WEP40 keylength [= %d]",
 					set_key->keyLength);
 				*is_key_valid = false;
 				return QDF_STATUS_E_INVAL;
 			}
 
-			set_key_cmd->keyLength = CSR_WEP40_KEY_LEN;
+			set_key_cmd->keyLength = WLAN_CRYPTO_KEY_WEP40_LEN;
 			qdf_mem_copy(set_key_cmd->Key, set_key->Key,
-				     CSR_WEP40_KEY_LEN);
+				     WLAN_CRYPTO_KEY_WEP40_LEN);
 		}
 		*is_key_valid = true;
 		break;
@@ -9979,16 +9979,16 @@ csr_update_key_cmd(struct mac_context *mac_ctx, struct csr_roam_session *session
 	case eCSR_ENCRYPT_TYPE_WEP104_STATICKEY:
 		/* KeyLength maybe 0 for static WEP */
 		if (set_key->keyLength) {
-			if (set_key->keyLength < CSR_WEP104_KEY_LEN) {
+			if (set_key->keyLength < WLAN_CRYPTO_KEY_WEP104_LEN) {
 				sme_warn("Invalid WEP104 keylength [= %d]",
 					set_key->keyLength);
 				*is_key_valid = false;
 				return QDF_STATUS_E_INVAL;
 			}
 
-			set_key_cmd->keyLength = CSR_WEP104_KEY_LEN;
+			set_key_cmd->keyLength = WLAN_CRYPTO_KEY_WEP104_LEN;
 			qdf_mem_copy(set_key_cmd->Key, set_key->Key,
-				     CSR_WEP104_KEY_LEN);
+				     WLAN_CRYPTO_KEY_WEP104_LEN);
 		}
 		*is_key_valid = true;
 		break;
@@ -10191,7 +10191,7 @@ struct mac_context *mac_ctx, uint32_t session_id,
 		set_key_cmd.paeRole = set_key->paeRole;
 		set_key_cmd.keyId = set_key->keyId;
 		qdf_mem_copy(set_key_cmd.keyRsc, set_key->keyRsc,
-			     CSR_MAX_RSC_LEN);
+			     WLAN_CRYPTO_RSC_SIZE);
 		/*
 		 * Always put set key to the head of the Q because it is the
 		 * only thing to get executed in case of WT_KEY state
@@ -16056,7 +16056,7 @@ QDF_STATUS csr_send_mb_set_context_req_msg(struct mac_context *mac,
 		pMsg->keyMaterial.key[0].unicast = fUnicast;
 		pMsg->keyMaterial.key[0].keyDirection = aniKeyDirection;
 		qdf_mem_copy(pMsg->keyMaterial.key[0].keyRsc,
-				pKeyRsc, CSR_MAX_RSC_LEN);
+				pKeyRsc, WLAN_CRYPTO_RSC_SIZE);
 		/* 0 is Supplicant */
 		pMsg->keyMaterial.key[0].paeRole = paeRole;
 		pMsg->keyMaterial.key[0].keyLength = keyLength;

+ 1 - 2
core/wma/inc/wma.h

@@ -274,7 +274,6 @@
 #define WMA_P2P_IE_ID 0xdd
 #define WMA_P2P_WFA_OUI { 0x50, 0x6f, 0x9a }
 #define WMA_P2P_WFA_VER 0x09    /* ver 1.0 */
-#define WMA_WSC_OUI { 0x00, 0x50, 0xF2 } /* Microsoft WSC OUI byte */
 
 /* P2P Sub element definitions (according to table 5 of Wifi's P2P spec) */
 #define WMA_P2P_SUB_ELEMENT_STATUS                    0
@@ -1389,7 +1388,7 @@ struct wma_set_key_params {
 	uint32_t key_idx;
 	bool unicast;
 	uint8_t key_data[SIR_MAC_MAX_KEY_LENGTH];
-	uint8_t key_rsc[SIR_MAC_MAX_KEY_RSC_LEN];
+	uint8_t key_rsc[WLAN_CRYPTO_RSC_SIZE];
 };
 
 /**

+ 1 - 1
core/wma/src/wma_mgmt.c

@@ -2345,7 +2345,7 @@ void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info)
 		key_params.key_len = key_info->key[i].keyLength;
 		qdf_mem_copy(key_params.key_rsc,
 				key_info->key[i].keyRsc,
-				SIR_MAC_MAX_KEY_RSC_LEN);
+				WLAN_CRYPTO_RSC_SIZE);
 		if (key_info->encType == eSIR_ED_TKIP) {
 			qdf_mem_copy(key_params.key_data,
 				     key_info->key[i].key, 16);