From aa155147063158b507c8f35eabd972668b1a3413 Mon Sep 17 00:00:00 2001 From: Wu Gao Date: Mon, 14 Jan 2019 15:09:26 +0800 Subject: [PATCH] qcacld-3.0: Change WNI_CFG_COUNTRY_CODE_LEN to CFG_COUNTRY_CODE_LEN All WNI configurations will be cleanup based on new cfg framework, so change Change WNI_CFG_COUNTRY_CODE_LEN to CFG_COUNTRY_CODE_LEN. Change-Id: I786b62e2c0aff08a89fc3c8a3359e2ffb4044269 CRs-Fixed: 2380488 --- core/hdd/src/wlan_hdd_stats.c | 8 ++++---- core/hdd/src/wlan_hdd_wext.c | 4 ++-- core/mac/inc/sir_api.h | 8 +++++--- core/mac/src/pe/sch/sch_message.c | 6 +++--- core/sap/inc/sap_api.h | 2 +- core/sap/src/sap_fsm.c | 2 +- core/sme/inc/csr_api.h | 6 +++--- core/sme/inc/csr_internal.h | 8 ++++---- core/sme/src/common/sme_api.c | 4 ++-- core/sme/src/csr/csr_api_roam.c | 12 ++++++------ core/sme/src/csr/csr_api_scan.c | 10 +++++----- 11 files changed, 36 insertions(+), 34 deletions(-) diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index b673066435ac5..0c74c461a5d0e 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -392,10 +392,10 @@ static bool put_wifi_interface_info(tpSirWifiInterfaceInfo stats, QDF_MAC_ADDR_SIZE, stats->bssid.bytes) || nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_AP_COUNTRY_STR, - WNI_CFG_COUNTRY_CODE_LEN, stats->apCountryStr) || + CFG_COUNTRY_CODE_LEN, stats->apCountryStr) || nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_COUNTRY_STR, - WNI_CFG_COUNTRY_CODE_LEN, stats->countryStr)) { + CFG_COUNTRY_CODE_LEN, stats->countryStr)) { hdd_err("QCA_WLAN_VENDOR_ATTR put fail"); return false; } @@ -588,10 +588,10 @@ bool hdd_get_interface_info(struct hdd_adapter *adapter, } qdf_mem_copy(pInfo->countryStr, - mac->scan.countryCodeCurrent, WNI_CFG_COUNTRY_CODE_LEN); + mac->scan.countryCodeCurrent, CFG_COUNTRY_CODE_LEN); qdf_mem_copy(pInfo->apCountryStr, - mac->scan.countryCodeCurrent, WNI_CFG_COUNTRY_CODE_LEN); + mac->scan.countryCodeCurrent, CFG_COUNTRY_CODE_LEN); return true; } diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 994780b1b326c..28e27100e4a7a 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -6651,8 +6651,8 @@ static int __iw_get_char_setnone(struct net_device *dev, QDF_STATUS status; uint8_t i, len; char *buf; - uint8_t ubuf[WNI_CFG_COUNTRY_CODE_LEN]; - uint8_t ubuf_len = WNI_CFG_COUNTRY_CODE_LEN; + uint8_t ubuf[CFG_COUNTRY_CODE_LEN]; + uint8_t ubuf_len = CFG_COUNTRY_CODE_LEN; struct channel_list_info channel_list; memset(&channel_list, 0, sizeof(channel_list)); diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 1bf1455fac681..e7d69897deb49 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -57,6 +57,8 @@ struct mac_context; /* / Max supported channel list */ #define SIR_MAX_SUPPORTED_CHANNEL_LIST 96 #define CFG_VALID_CHANNEL_LIST_LEN 100 +#define CFG_COUNTRY_CODE_LEN 3 + #define SIR_MDIE_ELEMENT_ID 54 #define SIR_MDIE_SIZE 3 /* MD ID(2 bytes), Capability(1 byte) */ @@ -1455,7 +1457,7 @@ typedef struct sAniGetSnrReq { typedef struct sAniGenericChangeCountryCodeReq { uint16_t msgType; /* message type is same as the request type */ uint16_t msgLen; /* length of the entire request */ - uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN]; /* 3 char country code */ + uint8_t countryCode[CFG_COUNTRY_CODE_LEN]; /* 3 char country code */ } tAniGenericChangeCountryCodeReq, *tpAniGenericChangeCountryCodeReq; /** @@ -3731,9 +3733,9 @@ typedef struct { /* bssid */ struct qdf_mac_addr bssid; /* country string advertised by AP */ - uint8_t apCountryStr[WNI_CFG_COUNTRY_CODE_LEN]; + uint8_t apCountryStr[CFG_COUNTRY_CODE_LEN]; /* country string for this association */ - uint8_t countryStr[WNI_CFG_COUNTRY_CODE_LEN]; + uint8_t countryStr[CFG_COUNTRY_CODE_LEN]; } tSirWifiInterfaceInfo, *tpSirWifiInterfaceInfo; /* channel information */ diff --git a/core/mac/src/pe/sch/sch_message.c b/core/mac/src/pe/sch/sch_message.c index adbba5895bd3d..245cdb27f0166 100644 --- a/core/mac/src/pe/sch/sch_message.c +++ b/core/mac/src/pe/sch/sch_message.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-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 @@ -141,8 +141,8 @@ sch_get_params(struct mac_context *mac, uint32_t *prf; struct wlan_mlme_edca_params *edca_params; QDF_STATUS status; - uint8_t country_code_str[WNI_CFG_COUNTRY_CODE_LEN]; - uint32_t country_code_len = WNI_CFG_COUNTRY_CODE_LEN; + uint8_t country_code_str[CFG_COUNTRY_CODE_LEN]; + uint32_t country_code_len = CFG_COUNTRY_CODE_LEN; uint32_t ani_l[] = {edca_ani_acbe_local, edca_ani_acbk_local, edca_ani_acvi_local, edca_ani_acvo_local}; diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index ca423dc72b55f..45d743841b960 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -518,7 +518,7 @@ typedef struct sap_config { /* Max ie length 255 * 2(WPA+RSN) + 2 bytes(vendor specific ID) * 2 */ uint8_t RSNWPAReqIE[(SIR_MAC_MAX_IE_LENGTH * 2) + 4]; /* it is ignored if [0] is 0. */ - uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN]; + uint8_t countryCode[CFG_COUNTRY_CODE_LEN]; uint8_t RSNAuthType; uint8_t RSNEncryptType; uint8_t mcRSNEncryptType; diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index b735dfec82710..6f1ffd728e5af 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -2919,7 +2919,7 @@ sapconvert_to_csr_profile(tsap_config_t *pconfig_params, eCsrRoamBssType bssType /* country code */ if (pconfig_params->countryCode[0]) qdf_mem_copy(profile->countryCode, pconfig_params->countryCode, - WNI_CFG_COUNTRY_CODE_LEN); + CFG_COUNTRY_CODE_LEN); profile->ieee80211d = pconfig_params->ieee80211d; /* wps config info */ profile->wps_state = pconfig_params->wps_state; diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 2310176f56f51..0f889fee8d498 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -302,7 +302,7 @@ typedef struct tagCsrScanResultFilter { * If countryCode[0] is not 0, countryCode is checked * independent of fCheckUnknownCountryCode */ - uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN]; + uint8_t countryCode[CFG_COUNTRY_CODE_LEN]; uint8_t uapsd_mask; /* For WPS filtering if true => auth and ecryption should be ignored */ bool bWPSAssociation; @@ -342,7 +342,7 @@ typedef struct sCsrChnPower_ { typedef struct tagCsr11dinfo { sCsrChannel Channels; - uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN + 1]; + uint8_t countryCode[CFG_COUNTRY_CODE_LEN + 1]; /* max power channel list */ sCsrChnPower ChnPower[CFG_VALID_CHANNEL_LIST_LEN]; } tCsr11dinfo; @@ -817,7 +817,7 @@ struct csr_roam_profile { */ uint8_t *pAddIEAssoc; /* it is ignored if [0] is 0. */ - uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN]; + uint8_t countryCode[CFG_COUNTRY_CODE_LEN]; /* WPS Association if true => auth and ecryption should be ignored */ bool bWPSAssociation; bool bOSENAssociation; diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 0914210d57474..71fc91666539b 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -461,9 +461,9 @@ struct csr_scanstruct { tDblLinkList channelPowerInfoList5G; uint32_t nLastAgeTimeOut; uint32_t nAgingCountDown; - uint8_t countryCodeDefault[WNI_CFG_COUNTRY_CODE_LEN]; - uint8_t countryCodeCurrent[WNI_CFG_COUNTRY_CODE_LEN]; - uint8_t countryCode11d[WNI_CFG_COUNTRY_CODE_LEN]; + uint8_t countryCodeDefault[CFG_COUNTRY_CODE_LEN]; + uint8_t countryCodeCurrent[CFG_COUNTRY_CODE_LEN]; + uint8_t countryCode11d[CFG_COUNTRY_CODE_LEN]; v_REGDOMAIN_t domainIdDefault; /* default regulatory domain */ v_REGDOMAIN_t domainIdCurrent; /* current regulatory domain */ @@ -471,7 +471,7 @@ struct csr_scanstruct { * in 11d IE from probe rsp or beacons of neighboring APs * will use the most popular one (max count) */ - uint8_t countryCodeElected[WNI_CFG_COUNTRY_CODE_LEN]; + uint8_t countryCodeElected[CFG_COUNTRY_CODE_LEN]; /* * Customer wants to optimize the scan time. Avoiding scans(passive) * on DFS channels while swipping through both bands can save some time diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 7cbdc75845970..e36061ee78a35 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -5262,12 +5262,12 @@ sme_handle_generic_change_country_code(struct mac_context *mac_ctx, ('0' != msg->countryCode[1])) qdf_mem_copy(mac_ctx->scan.countryCode11d, msg->countryCode, - WNI_CFG_COUNTRY_CODE_LEN); + CFG_COUNTRY_CODE_LEN); } qdf_mem_copy(mac_ctx->scan.countryCodeCurrent, msg->countryCode, - WNI_CFG_COUNTRY_CODE_LEN); + CFG_COUNTRY_CODE_LEN); /* get the channels based on new cc */ status = csr_get_channel_and_power_list(mac_ctx); diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index eb652787092db..68f4cd56d140d 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -646,9 +646,9 @@ QDF_STATUS csr_init_chan_list(struct mac_context *mac, uint8_t *alpha2) mac->scan.domainIdCurrent = 0; qdf_mem_copy(mac->scan.countryCodeCurrent, - mac->scan.countryCodeDefault, WNI_CFG_COUNTRY_CODE_LEN); + mac->scan.countryCodeDefault, CFG_COUNTRY_CODE_LEN); qdf_mem_copy(mac->scan.countryCodeElected, - mac->scan.countryCodeDefault, WNI_CFG_COUNTRY_CODE_LEN); + mac->scan.countryCodeDefault, CFG_COUNTRY_CODE_LEN); status = csr_get_channel_and_power_list(mac); return status; @@ -660,7 +660,7 @@ QDF_STATUS csr_set_channels(struct mac_context *mac, tCsrConfigParam *pParam) uint8_t index = 0; qdf_mem_copy(pParam->Csr11dinfo.countryCode, - mac->scan.countryCodeCurrent, WNI_CFG_COUNTRY_CODE_LEN); + mac->scan.countryCodeCurrent, CFG_COUNTRY_CODE_LEN); for (index = 0; index < mac->scan.base_channels.numChannels; index++) { pParam->Csr11dinfo.Channels.channelList[index] = @@ -2912,7 +2912,7 @@ static QDF_STATUS csr_init11d_info(struct mac_context *mac, tCsr11dinfo *ps11din /* legacy maintenance */ qdf_mem_copy(mac->scan.countryCodeDefault, ps11dinfo->countryCode, - WNI_CFG_COUNTRY_CODE_LEN); + CFG_COUNTRY_CODE_LEN); /* Tush: at csropen get this initialized with default, * during csr reset if this already set with some value @@ -2920,7 +2920,7 @@ static QDF_STATUS csr_init11d_info(struct mac_context *mac, tCsr11dinfo *ps11din */ if (0 == mac->scan.countryCodeCurrent[0]) { qdf_mem_copy(mac->scan.countryCodeCurrent, - ps11dinfo->countryCode, WNI_CFG_COUNTRY_CODE_LEN); + ps11dinfo->countryCode, CFG_COUNTRY_CODE_LEN); } /* need to add the max power channel list */ pChanInfo = @@ -10390,7 +10390,7 @@ csr_roam_prepare_filter_from_profile(struct mac_context *mac_ctx, * of the criteria. */ qdf_mem_copy(scan_fltr->countryCode, profile->countryCode, - WNI_CFG_COUNTRY_CODE_LEN); + CFG_COUNTRY_CODE_LEN); } scan_fltr->mdid = profile->mdid; qdf_mem_copy(scan_fltr->bssid_hint.bytes, diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 40ed8eecf797c..8a99e5875d583 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -1625,11 +1625,11 @@ static void csr_save_tx_power_to_cfg(struct mac_context *pMac, static void csr_set_cfg_country_code(struct mac_context *mac, uint8_t *countryCode) { - uint8_t cc[WNI_CFG_COUNTRY_CODE_LEN]; + uint8_t cc[CFG_COUNTRY_CODE_LEN]; /* v_REGDOMAIN_t DomainId */ sme_debug("Setting Country Code in Cfg %s", countryCode); - qdf_mem_copy(cc, countryCode, WNI_CFG_COUNTRY_CODE_LEN); + qdf_mem_copy(cc, countryCode, CFG_COUNTRY_CODE_LEN); /* * Don't program the bogus country codes that we created for Korea in @@ -1646,7 +1646,7 @@ static void csr_set_cfg_country_code(struct mac_context *mac, */ cc[1] = 'R'; } - cfg_set_str(mac, WNI_CFG_COUNTRY_CODE, cc, WNI_CFG_COUNTRY_CODE_LEN); + cfg_set_str(mac, WNI_CFG_COUNTRY_CODE, cc, CFG_COUNTRY_CODE_LEN); /* * Need to let HALPHY know about the current domain so it can apply some @@ -1660,7 +1660,7 @@ QDF_STATUS csr_get_country_code(struct mac_context *mac, uint8_t *pBuf, QDF_STATUS status; uint32_t len; - if (pBuf && pbLen && (*pbLen >= WNI_CFG_COUNTRY_CODE_LEN)) { + if (pBuf && pbLen && (*pbLen >= CFG_COUNTRY_CODE_LEN)) { len = *pbLen; status = wlan_cfg_get_str(mac, WNI_CFG_COUNTRY_CODE, pBuf, &len); @@ -2447,7 +2447,7 @@ static QDF_STATUS csr_prepare_scan_filter(struct mac_context *mac_ctx, pFilter->mcEncryptionType.encryptionType[i]); } qdf_mem_copy(filter->country, pFilter->countryCode, - WNI_CFG_COUNTRY_CODE_LEN); + CFG_COUNTRY_CODE_LEN); if (pFilter->bWPSAssociation || pFilter->bOSENAssociation) filter->ignore_auth_enc_type = true;