Browse Source

qcacld-3.0: Consolidate multiple SIR/CSR PMKID_LEN to PMKID_LEN

1. Change MAX_PMKID_LEN to PMKID_LEN (present in qcacmn)
2. Change SIR_PMKID_LEN to PMKID_LEN
3. Change CSR_RSN_PMKID_SIZE to PMKID_LEN

Change-Id: I7a25d49ab2fc032338b2f88915852ae7f3a6271f
CRs-Fixed: 2423876
Srinivas Girigowda 6 years ago
parent
commit
ff8f5efad4

+ 1 - 2
core/cds/inc/cds_config.h

@@ -105,7 +105,6 @@ struct cds_config_info {
 
 #ifdef WLAN_FEATURE_FILS_SK
 #define MAX_PMK_LEN 48
-#define MAX_PMKID_LEN 16
 #define FILS_MAX_KEYNAME_NAI_LENGTH 253
 #define FILS_MAX_REALM_LEN 255
 #define FILS_MAX_RRK_LENGTH 64
@@ -124,7 +123,7 @@ struct cds_fils_connection_info {
 	uint8_t auth_type;
 	uint8_t pmk[MAX_PMK_LEN];
 	uint8_t pmk_len;
-	uint8_t pmkid[MAX_PMKID_LEN];
+	uint8_t pmkid[PMKID_LEN];
 };
 #endif
 #endif /* !defined( __CDS_CONFIG_H ) */

+ 5 - 5
core/hdd/src/wlan_hdd_cfg80211.c

@@ -5013,7 +5013,7 @@ wlan_hdd_add_fils_params_roam_auth_event(struct sk_buff *skb,
 	}
 
 	if (nla_put(skb, QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PMKID,
-		    SIR_PMKID_LEN, roam_info->pmkid)) {
+		    PMKID_LEN, roam_info->pmkid)) {
 		hdd_err("pmkid send fail");
 		return -EINVAL;
 	}
@@ -5094,7 +5094,7 @@ int wlan_hdd_send_roam_auth_event(struct hdd_adapter *adapter, uint8_t *bssid,
 	 * with 3 extra NL message headers for each of the
 	 * aforementioned params.
 	 */
-	fils_params_len = roam_info_ptr->pmk_len + SIR_PMKID_LEN +
+	fils_params_len = roam_info_ptr->pmk_len + PMKID_LEN +
 			  sizeof(uint16_t) + (3 * NLMSG_HDRLEN);
 
 	skb = cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
@@ -19778,7 +19778,7 @@ static void hdd_fill_pmksa_info(struct hdd_adapter *adapter,
 	if (is_delete)
 		return;
 
-	qdf_mem_copy(pmk_cache->PMKID, pmksa->pmkid, CSR_RSN_PMKID_SIZE);
+	qdf_mem_copy(pmk_cache->PMKID, pmksa->pmkid, PMKID_LEN);
 	if (pmksa->pmk_len && (pmksa->pmk_len <= CSR_RSN_MAX_PMK_LEN)) {
 		qdf_mem_copy(pmk_cache->pmk, pmksa->pmk, pmksa->pmk_len);
 		pmk_cache->pmk_len = pmksa->pmk_len;
@@ -19825,7 +19825,7 @@ static void hdd_fill_pmksa_info(struct hdd_adapter *adapter,
 		return;
 	mac_handle = hdd_adapter_get_mac_handle(adapter);
 	sme_get_pmk_info(mac_handle, adapter->vdev_id, pmk_cache);
-	qdf_mem_copy(pmk_cache->PMKID, pmksa->pmkid, CSR_RSN_PMKID_SIZE);
+	qdf_mem_copy(pmk_cache->PMKID, pmksa->pmkid, PMKID_LEN);
 }
 #endif
 
@@ -21337,7 +21337,7 @@ wlan_hdd_extauth_cache_pmkid(struct hdd_adapter *adapter,
 		qdf_mem_copy(pmk_cache.BSSID.bytes, params->bssid,
 			     QDF_MAC_ADDR_SIZE);
 		qdf_mem_copy(pmk_cache.PMKID, params->pmkid,
-			     CSR_RSN_PMKID_SIZE);
+			     PMKID_LEN);
 		result = sme_roam_set_pmkid_cache(mac_handle, adapter->vdev_id,
 						  &pmk_cache, 1, false);
 		if (!QDF_IS_STATUS_SUCCESS(result))

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

@@ -118,7 +118,6 @@ typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN];
 #define SIR_KEK_KEY_LEN_FILS 64
 #define SIR_REPLAY_CTR_LEN 8
 #define SIR_PMK_LEN  48
-#define SIR_PMKID_LEN 16
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 #define SIR_UAPSD_BITOFFSET_ACVO     0
 #define SIR_UAPSD_BITOFFSET_ACVI     1
@@ -2998,7 +2997,7 @@ struct roam_offload_synch_ind {
 	uint8_t kek[SIR_KEK_KEY_LEN_FILS];
 	uint32_t   pmk_len;
 	uint8_t    pmk[SIR_PMK_LEN];
-	uint8_t    pmkid[SIR_PMKID_LEN];
+	uint8_t    pmkid[PMKID_LEN];
 	bool update_erp_next_seq_num;
 	uint16_t next_erp_seq_num;
 	uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];

+ 2 - 3
core/sme/inc/csr_api.h

@@ -173,7 +173,6 @@ typedef enum {
 	eCSR_INI_CHANNEL_BONDING_STATE_MAX = 11
 } eIniChanBondState;
 
-#define CSR_RSN_PMKID_SIZE          16
 #define CSR_RSN_MAX_PMK_LEN         48
 #define CSR_MAX_PMKID_ALLOWED       32
 #define CSR_TKIP_KEY_LEN            32
@@ -696,7 +695,7 @@ typedef struct tagPmkidCandidateInfo {
 
 typedef struct tagPmkidCacheInfo {
 	struct qdf_mac_addr BSSID;
-	uint8_t PMKID[CSR_RSN_PMKID_SIZE];
+	uint8_t PMKID[PMKID_LEN];
 	uint8_t pmk[CSR_RSN_MAX_PMK_LEN];
 	uint8_t pmk_len;
 	uint8_t ssid_len;
@@ -1134,7 +1133,7 @@ struct csr_roam_info {
 	uint8_t kek_len;
 	uint32_t pmk_len;
 	uint8_t pmk[SIR_PMK_LEN];
-	uint8_t pmkid[SIR_PMKID_LEN];
+	uint8_t pmkid[PMKID_LEN];
 	bool update_erp_next_seq_num;
 	uint16_t next_erp_seq_num;
 	uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];

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

@@ -169,7 +169,7 @@ typedef struct tagCsrRSNAuthIe {
 typedef struct tagCsrRSNPMKIe {
 	uint16_t cPMKIDs;
 	struct {
-		uint8_t PMKID[CSR_RSN_PMKID_SIZE];
+		uint8_t PMKID[PMKID_LEN];
 	} qdf_packed PMKIDList[1];
 } qdf_packed tCsrRSNPMKIe;
 

+ 2 - 2
core/sme/src/common/sme_api.c

@@ -13819,9 +13819,9 @@ QDF_STATUS sme_set_del_pmkid_cache(mac_handle_t mac_handle, uint8_t session_id,
 	else
 		pmk_cache->action_flag = WMI_PMK_CACHE_ACTION_FLAG_DEL_ENTRY;
 
-	pmk_cache->pmkid_len = CSR_RSN_PMKID_SIZE;
+	pmk_cache->pmkid_len = PMKID_LEN;
 	qdf_mem_copy(pmk_cache->pmkid, pmk_cache_info->PMKID,
-		     CSR_RSN_PMKID_SIZE);
+		     PMKID_LEN);
 
 	pmk_cache->pmk_len = pmk_cache_info->pmk_len;
 	qdf_mem_copy(pmk_cache->pmk, pmk_cache_info->pmk,

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

@@ -14237,7 +14237,7 @@ static void csr_update_pmk_cache(struct csr_roam_session *session,
 	}
 	qdf_mem_copy(
 	    session->PmkidCacheInfo[cache_idx].PMKID,
-	    pmksa->PMKID, CSR_RSN_PMKID_SIZE);
+	    pmksa->PMKID, PMKID_LEN);
 
 	if (pmksa->pmk_len)
 		qdf_mem_copy(session->PmkidCacheInfo[cache_idx].pmk,
@@ -21499,7 +21499,7 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 		qdf_mem_copy(roam_info->pmk, roam_synch_data->pmk,
 			     roam_synch_data->pmk_len);
 
-	qdf_mem_copy(roam_info->pmkid, roam_synch_data->pmkid, SIR_PMKID_LEN);
+	qdf_mem_copy(roam_info->pmkid, roam_synch_data->pmkid, PMKID_LEN);
 	roam_info->update_erp_next_seq_num =
 			roam_synch_data->update_erp_next_seq_num;
 	roam_info->next_erp_seq_num = roam_synch_data->next_erp_seq_num;

+ 7 - 7
core/sme/src/csr/csr_util.c

@@ -3223,8 +3223,8 @@ bool csr_is_pmkid_found_for_peer(struct mac_context *mac,
 		return false;
 	session_pmkid = &session->PmkidCacheInfo[index].PMKID[0];
 	for (i = 0; i < pmkid_count; i++) {
-		if (!qdf_mem_cmp(pmkid + (i * CSR_RSN_PMKID_SIZE),
-				 session_pmkid, CSR_RSN_PMKID_SIZE))
+		if (!qdf_mem_cmp(pmkid + (i * PMKID_LEN),
+				 session_pmkid, PMKID_LEN))
 			return true;
 	}
 
@@ -3720,7 +3720,7 @@ static bool csr_lookup_pmkid(struct mac_context *mac, uint32_t sessionId,
 
 	qdf_mem_copy(pmk_cache->PMKID,
 		     pSession->PmkidCacheInfo[Index].PMKID,
-		     CSR_RSN_PMKID_SIZE);
+		     PMKID_LEN);
 
 	qdf_mem_copy(pmk_cache->pmk,
 		     pSession->PmkidCacheInfo[Index].pmk,
@@ -3786,7 +3786,7 @@ static inline void csr_update_pmksa_to_profile(struct csr_roam_profile *profile,
 	qdf_mem_copy(profile->fils_con_info->pmk,
 			pmkid_cache->pmk, pmkid_cache->pmk_len);
 	qdf_mem_copy(profile->fils_con_info->pmkid,
-		pmkid_cache->PMKID, CSR_RSN_PMKID_SIZE);
+		pmkid_cache->PMKID, PMKID_LEN);
 
 }
 #else
@@ -4004,7 +4004,7 @@ uint8_t csr_construct_rsn_ie(struct mac_context *mac, uint32_t sessionId,
 				   pmkid_cache.pmk, pmkid_cache.pmk_len);
 			qdf_mem_copy(pPMK->PMKIDList[0].PMKID,
 				     pmkid_cache.PMKID,
-				     CSR_RSN_PMKID_SIZE);
+				     PMKID_LEN);
 
 			/*
 			 * If a PMK cache is found for the BSSID, then
@@ -4029,7 +4029,7 @@ uint8_t csr_construct_rsn_ie(struct mac_context *mac, uint32_t sessionId,
 			(RSNCapabilities.MFPCapable && pProfile->MFPCapable)) {
 			pGroupMgmtCipherSuite =
 				(uint8_t *) pPMK + sizeof(uint16_t) +
-				(pPMK->cPMKIDs * CSR_RSN_PMKID_SIZE);
+				(pPMK->cPMKIDs * PMKID_LEN);
 			qdf_mem_copy(pGroupMgmtCipherSuite,
 				     gp_mgmt_cipher_suite, CSR_RSN_OUI_SIZE);
 		}
@@ -4050,7 +4050,7 @@ uint8_t csr_construct_rsn_ie(struct mac_context *mac, uint32_t sessionId,
 		if (pPMK->cPMKIDs)
 			pRSNIe->IeHeader.Length += (uint8_t) (sizeof(uint16_t) +
 							      (pPMK->cPMKIDs *
-							CSR_RSN_PMKID_SIZE));
+							PMKID_LEN));
 #ifdef WLAN_FEATURE_11W
 		if (pProfile->MFPEnabled &&
 			(RSNCapabilities.MFPCapable && pProfile->MFPCapable)) {

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

@@ -2288,7 +2288,7 @@ static int wma_fill_roam_synch_buffer(tp_wma_handle wma,
 			     fils_info->pmk_len);
 
 		qdf_mem_copy(roam_synch_ind_ptr->pmkid, fils_info->pmkid,
-			     SIR_PMKID_LEN);
+			     PMKID_LEN);
 
 		roam_synch_ind_ptr->update_erp_next_seq_num =
 				fils_info->update_erp_next_seq_num;