瀏覽代碼

qcacld-3.0: Consolidate multiple MAX_SSID_LEN to WLAN_SSID_MAX_LEN

Consolidate multiple MAX_SSID_LEN to WLAN_SSID_MAX_LEN.

Change-Id: I1764b891501c4e3371cf478c324ebcdcab319f5f
CRs-Fixed: 2419367
Srinivas Girigowda 6 年之前
父節點
當前提交
b8fdc643d2

+ 1 - 1
components/mlme/core/src/wlan_mlme_main.c

@@ -1148,7 +1148,7 @@ static void mlme_init_sap_cfg(struct wlan_objmgr_psoc *psoc,
 	uint8_t *ssid;
 
 	ssid = cfg_default(CFG_SSID);
-	qdf_mem_zero(sap_cfg->cfg_ssid, MLME_CFG_SSID_LEN);
+	qdf_mem_zero(sap_cfg->cfg_ssid, WLAN_SSID_MAX_LEN);
 	sap_cfg->cfg_ssid_len = STR_SSID_DEFAULT_LEN;
 	qdf_mem_copy(sap_cfg->cfg_ssid, ssid, STR_SSID_DEFAULT_LEN);
 	sap_cfg->beacon_interval = cfg_get(psoc, CFG_BEACON_INTERVAL);

+ 1 - 2
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -549,7 +549,6 @@ struct wlan_mlme_wps_params {
 #define MLME_CFG_TX_MGMT_RATE_DEF       0xFF
 #define MLME_CFG_TX_MGMT_2G_RATE_DEF    0xFF
 #define MLME_CFG_TX_MGMT_5G_RATE_DEF    0xFF
-#define MLME_CFG_SSID_LEN               32
 
 /**
  * struct wlan_mlme_cfg_sap - SAP related config items
@@ -584,7 +583,7 @@ struct wlan_mlme_wps_params {
  * @go_11ac_override: Override GO bandwidth to 11ac
  */
 struct wlan_mlme_cfg_sap {
-	uint8_t cfg_ssid[MLME_CFG_SSID_LEN];
+	uint8_t cfg_ssid[WLAN_SSID_MAX_LEN];
 	uint8_t cfg_ssid_len;
 	uint16_t beacon_interval;
 	uint16_t dtim_interval;

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

@@ -2289,7 +2289,7 @@ static void hdd_send_re_assoc_event(struct net_device *dev,
 	uint8_t *assoc_req_ies = qdf_mem_malloc(IW_GENERIC_IE_MAX);
 	uint32_t rsp_rsn_lemgth = 0;
 	struct ieee80211_channel *chan;
-	uint8_t buf_ssid_ie[2 + SIR_MAC_SSID_EID_MAX]; /* 2 bytes-EID and len */
+	uint8_t buf_ssid_ie[2 + WLAN_SSID_MAX_LEN]; /* 2 bytes-EID and len */
 	uint8_t *buf_ptr, ssid_ie_len;
 	struct cfg80211_bss *bss = NULL;
 	uint8_t *final_req_ie = NULL;

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

@@ -3704,7 +3704,7 @@ static int hdd_set_white_list(struct hdd_context *hdd_ctx,
 			 * buffer.
 			 */
 			if (buf_len && (i < MAX_SSID_ALLOWED_LIST) &&
-			    ((buf_len - 1) <= SIR_MAC_MAX_SSID_LENGTH)) {
+			    ((buf_len - 1) <= WLAN_SSID_MAX_LEN)) {
 				nla_memcpy(roam_params->ssid_allowed_list[i].ssId,
 					tb2[PARAM_LIST_SSID], buf_len - 1);
 				roam_params->ssid_allowed_list[i].length = buf_len - 1;
@@ -16236,7 +16236,7 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter,
 	if (status)
 		goto ret_status;
 
-	if (SIR_MAC_MAX_SSID_LENGTH < ssid_len) {
+	if (WLAN_SSID_MAX_LEN < ssid_len) {
 		hdd_err("wrong SSID len");
 		status = -EINVAL;
 		goto ret_status;

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

@@ -1054,7 +1054,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
 		nla_for_each_nested(attr, tb[QCA_WLAN_VENDOR_ATTR_SCAN_SSIDS],
 				tmp) {
 			ssid_length = nla_len(attr);
-			if ((ssid_length > SIR_MAC_MAX_SSID_LENGTH) ||
+			if ((ssid_length > WLAN_SSID_MAX_LEN) ||
 			    (ssid_length < 0)) {
 				hdd_err("SSID Len %d is not correct for network %d",
 					 ssid_length, count);

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

@@ -130,7 +130,7 @@ typedef enum eAniKeyDirection {
 
 typedef struct sAniSSID {
 	uint8_t length;
-	uint8_t ssId[SIR_MAC_MAX_SSID_LENGTH];
+	uint8_t ssId[WLAN_SSID_MAX_LEN];
 } tAniSSID, *tpAniSSID;
 
 /* / RSN IE information */

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

@@ -3219,7 +3219,7 @@ typedef struct {
 	uint64_t ts;
 
 	/* Null terminated SSID */
-	uint8_t ssid[SIR_MAC_MAX_SSID_LENGTH + 1];
+	uint8_t ssid[WLAN_SSID_MAX_LEN + 1];
 
 	struct qdf_mac_addr bssid;
 

+ 1 - 3
core/mac/inc/sir_mac_prot_def.h

@@ -268,7 +268,6 @@
 
 #define SIR_MAC_SSID_EID               0
 #define SIR_MAC_SSID_EID_MIN               0
-#define SIR_MAC_SSID_EID_MAX               32
 #define SIR_MAC_RATESET_EID            1
 #define SIR_MAC_RATESET_EID_MIN            1
 #define SIR_MAC_RATESET_EID_MAX            12
@@ -556,7 +555,6 @@
 #define    SIR_MAC_AUTH_FRAME_4        4
 
 /* / Protocol defined MAX definitions */
-#define SIR_MAC_MAX_SSID_LENGTH              32
 #define SIR_MAC_MAX_NUMBER_OF_RATES          12
 #define SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS      4
 #define SIR_MAC_KEY_LENGTH                   13 /* WEP Maximum key length size */
@@ -987,7 +985,7 @@ struct merged_mac_rate_set {
 /* Reserve 1 byte for NULL character in the SSID name field to print in %s */
 typedef struct sSirMacSSid {
 	uint8_t length;
-	uint8_t ssId[SIR_MAC_MAX_SSID_LENGTH +1];
+	uint8_t ssId[WLAN_SSID_MAX_LEN +1];
 } qdf_packed tSirMacSSid;
 
 typedef struct sSirMacWpaInfo {

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

@@ -374,10 +374,10 @@ lim_mlm_add_bss(struct mac_context *mac_ctx,
 
 	/* Send the SSID to HAL to enable SSID matching for IBSS */
 	addbss_param->ssId.length = mlm_start_req->ssId.length;
-	if (addbss_param->ssId.length > SIR_MAC_MAX_SSID_LENGTH) {
+	if (addbss_param->ssId.length > WLAN_SSID_MAX_LEN) {
 		pe_err("Invalid ssid length %d, max length allowed %d",
 		       addbss_param->ssId.length,
-		       SIR_MAC_MAX_SSID_LENGTH);
+		       WLAN_SSID_MAX_LEN);
 		qdf_mem_free(addbss_param);
 		return eSIR_SME_INVALID_PARAMETERS;
 	}

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

@@ -507,7 +507,7 @@ void lim_reset_bcn_probe_filter(struct mac_context *mac_ctx,
 			filter->num_ibss_sessions--;
 		filter->ibss_ssid[session_id].length = 0;
 		qdf_mem_zero(&filter->ibss_ssid[session_id].ssId,
-			    SIR_MAC_MAX_SSID_LENGTH);
+			    WLAN_SSID_MAX_LEN);
 		pe_debug("Cleared IBSS Filter for session %d", session_id);
 	} else if (eSIR_INFRA_AP_MODE == bss_type) {
 		if (filter->num_sap_sessions)

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

@@ -395,7 +395,7 @@ bool lim_is_sme_start_bss_req_valid(struct mac_context *mac_ctx,
 
 	if (start_bss_req->bssType == eSIR_IBSS_MODE
 	    && (!start_bss_req->ssId.length
-		|| start_bss_req->ssId.length > SIR_MAC_MAX_SSID_LENGTH)) {
+		|| start_bss_req->ssId.length > WLAN_SSID_MAX_LEN)) {
 		pe_warn("Invalid SSID length in eWNI_SME_START_BSS_REQ");
 		return false;
 	}

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

@@ -4982,8 +4982,8 @@ static void lim_diag_fill_mgmt_event_report(struct mac_context *mac_ctx,
 	qdf_mem_copy(mgmt_event->bssid, session->bssId,
 		     QDF_MAC_ADDR_SIZE);
 	length = session->ssId.length;
-	if (length > SIR_MAC_MAX_SSID_LENGTH)
-		length = SIR_MAC_MAX_SSID_LENGTH;
+	if (length > WLAN_SSID_MAX_LEN)
+		length = WLAN_SSID_MAX_LEN;
 	qdf_mem_copy(mgmt_event->ssid, session->ssId.ssId, length);
 	mgmt_event->ssid_len = length;
 	mgmt_event->operating_channel = session->currentOperChannel;

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

@@ -46,7 +46,6 @@ extern "C" {
 /*---------------------------------------------------------------------------
  * defines and enum
  *--------------------------------------------------------------------------*/
-#define       MAX_SSID_LEN                 32
 #define       MAX_ACL_MAC_ADDRESS          32
 #define       AUTO_CHANNEL_SELECT          0
 #define       MAX_ASSOC_IND_IE_LEN         255
@@ -412,7 +411,7 @@ struct sap_event {
 
 typedef struct sap_SSID {
 	uint8_t length;
-	uint8_t ssId[MAX_SSID_LEN];
+	uint8_t ssId[WLAN_SSID_MAX_LEN];
 } qdf_packed tSap_SSID_t;
 
 typedef struct sap_SSIDInfo {

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

@@ -700,7 +700,7 @@ typedef struct tagPmkidCacheInfo {
 	uint8_t pmk[CSR_RSN_MAX_PMK_LEN];
 	uint8_t pmk_len;
 	uint8_t ssid_len;
-	uint8_t ssid[SIR_MAC_MAX_SSID_LENGTH];
+	uint8_t ssid[WLAN_SSID_MAX_LEN];
 	uint8_t cache_id[CACHE_ID_LEN];
 } tPmkidCacheInfo;
 

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

@@ -3261,8 +3261,8 @@ static void csr_dump_connection_stats(struct mac_context *mac_ctx,
 	qdf_mem_copy(conn_stats.bssid, conn_profile->bssid.bytes,
 		     QDF_MAC_ADDR_SIZE);
 	conn_stats.ssid_len = conn_profile->SSID.length;
-	if (conn_stats.ssid_len > SIR_MAC_MAX_SSID_LENGTH)
-		conn_stats.ssid_len = SIR_MAC_MAX_SSID_LENGTH;
+	if (conn_stats.ssid_len > WLAN_SSID_MAX_LEN)
+		conn_stats.ssid_len = WLAN_SSID_MAX_LEN;
 	qdf_mem_copy(conn_stats.ssid, conn_profile->SSID.ssId,
 		     conn_stats.ssid_len);
 	sme_get_rssi_snr_by_bssid(MAC_HANDLE(mac_ctx),
@@ -4308,10 +4308,10 @@ static void csr_set_cfg_ssid(struct mac_context *mac, tSirMacSSid *pSSID)
 {
 	uint32_t len = 0;
 
-	if (pSSID->length <= MLME_CFG_SSID_LEN)
+	if (pSSID->length <= WLAN_SSID_MAX_LEN)
 		len = pSSID->length;
 	else
-		len = MLME_CFG_SSID_LEN;
+		len = WLAN_SSID_MAX_LEN;
 
 	qdf_mem_copy(mac->mlme_cfg->sap_cfg.cfg_ssid,
 		     (uint8_t *)pSSID->ssId, len);

+ 1 - 1
core/sme/src/csr/csr_api_scan.c

@@ -1449,7 +1449,7 @@ QDF_STATUS csr_scan_for_ssid(struct mac_context *mac_ctx, uint32_t session_id,
 
 	/* Extend it for multiple SSID */
 	if (profile->SSIDs.numOfSSIDs) {
-		if (profile->SSIDs.SSIDList[0].SSID.length > MAX_SSID_LEN) {
+		if (profile->SSIDs.SSIDList[0].SSID.length > WLAN_SSID_MAX_LEN) {
 			sme_debug("wrong ssid length = %d",
 					profile->SSIDs.SSIDList[0].SSID.length);
 			status = QDF_STATUS_E_INVAL;

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

@@ -3961,10 +3961,10 @@ int wma_extscan_hotlist_match_event_handler(void *handle,
 		dest_ap->ieLength = src_hotlist->ie_length;
 		WMI_MAC_ADDR_TO_CHAR_ARRAY(&src_hotlist->bssid,
 					   dest_ap->bssid.bytes);
-		if (src_hotlist->ssid.ssid_len > SIR_MAC_MAX_SSID_LENGTH) {
+		if (src_hotlist->ssid.ssid_len > WLAN_SSID_MAX_LEN) {
 			WMA_LOGE("%s Invalid SSID len %d, truncating",
 				 __func__, src_hotlist->ssid.ssid_len);
-			src_hotlist->ssid.ssid_len = SIR_MAC_MAX_SSID_LENGTH;
+			src_hotlist->ssid.ssid_len = WLAN_SSID_MAX_LEN;
 		}
 		qdf_mem_copy(dest_ap->ssid, src_hotlist->ssid.ssid,
 			     src_hotlist->ssid.ssid_len);
@@ -4151,11 +4151,11 @@ static int wma_group_num_bss_to_scan_id(const u_int8_t *cmd_param_info,
 						   ap->bssid.bytes);
 
 			if (src_hotlist->ssid.ssid_len >
-			    SIR_MAC_MAX_SSID_LENGTH) {
+			    WLAN_SSID_MAX_LEN) {
 				WMA_LOGD("%s Invalid SSID len %d, truncating",
 					 __func__, src_hotlist->ssid.ssid_len);
 				src_hotlist->ssid.ssid_len =
-						SIR_MAC_MAX_SSID_LENGTH;
+						WLAN_SSID_MAX_LEN;
 			}
 			qdf_mem_copy(ap->ssid, src_hotlist->ssid.ssid,
 					src_hotlist->ssid.ssid_len);
@@ -4528,10 +4528,10 @@ int wma_passpoint_match_event_handler(void *handle,
 		return -EINVAL;
 	}
 
-	if (event->ssid.ssid_len > SIR_MAC_MAX_SSID_LENGTH) {
+	if (event->ssid.ssid_len > WLAN_SSID_MAX_LEN) {
 		WMA_LOGD("%s: Invalid ssid len %d, truncating",
 			 __func__, event->ssid.ssid_len);
-		event->ssid.ssid_len = SIR_MAC_MAX_SSID_LENGTH;
+		event->ssid.ssid_len = WLAN_SSID_MAX_LEN;
 	}
 
 	dest_match = qdf_mem_malloc(sizeof(*dest_match) + buf_len);