diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index dd168f55af..e81c69f047 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -2357,9 +2357,6 @@ static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc, wlan_objmgr_pdev_release_ref(pdev, WLAN_MLME_NB_ID); - qdf_str_lcopy(reg->country_code, cfg_default(CFG_COUNTRY_CODE), - sizeof(reg->country_code)); - reg->country_code_len = (uint8_t)sizeof(reg->country_code); mlme_init_acs_avoid_freq_list(psoc, reg); } diff --git a/components/mlme/dispatcher/inc/cfg_mlme_reg.h b/components/mlme/dispatcher/inc/cfg_mlme_reg.h index 7f84b37e01..963b6f6ef5 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_reg.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_reg.h @@ -226,22 +226,6 @@ VALID_CHANNEL_LIST_DEFAULT, \ "valid channel list") - /* - * country_code - Set country code - * @Default: NA - * - * This ini is used to set country code - * - * Usage: Internal - * - */ -#define CFG_COUNTRY_CODE CFG_STRING( \ - "country_code", \ - 0, \ - CFG_COUNTRY_CODE_LEN, \ - "", \ - "country code") - /* * * ignore_fw_reg_offload_ind - If set, Ignore the FW offload indication @@ -297,7 +281,6 @@ CFG(CFG_INDOOR_CHANNEL_SUPPORT) \ CFG(CFG_SCAN_11D_INTERVAL) \ CFG(CFG_VALID_CHANNEL_LIST) \ - CFG(CFG_COUNTRY_CODE) \ CFG(CFG_IGNORE_FW_REG_OFFLOAD_IND) \ CFG_SAP_AVOID_ACS_FREQ_LIST_ALL diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 504b60b93d..29b79cc023 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -2203,8 +2203,6 @@ struct wlan_mlme_mwc { * @scan_11d_interval: scan 11d interval * @valid_channel_freq_list: array for valid channel list * @valid_channel_list_num: valid channel list number - * @country_code: country code - * @country_code_len: country code length * @enable_11d_in_world_mode: Whether to enable 11d scan in world mode or not * @avoid_acs_freq_list: List of the frequencies which need to be avoided * during acs @@ -2222,8 +2220,6 @@ struct wlan_mlme_reg { uint32_t scan_11d_interval; uint32_t valid_channel_freq_list[CFG_VALID_CHANNEL_LIST_LEN]; uint32_t valid_channel_list_num; - uint8_t country_code[CFG_COUNTRY_CODE_LEN + 1]; - uint8_t country_code_len; bool enable_11d_in_world_mode; #ifdef SAP_AVOID_ACS_FREQ_LIST uint16_t avoid_acs_freq_list[CFG_VALID_CHANNEL_LIST_LEN]; diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index e7020beb9f..d67185d67f 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1793,7 +1793,6 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event, eSapDfsCACState_t cac_state = eSAP_DFS_DO_NOT_SKIP_CAC; struct hdd_config *cfg = NULL; struct wlan_dfs_info dfs_info; - uint8_t cc_len = WLAN_SVC_COUNTRY_CODE_LEN; struct hdd_adapter *con_sap_adapter; QDF_STATUS status = QDF_STATUS_SUCCESS; tSap_StationAssocReassocCompleteEvent *event; @@ -1845,7 +1844,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event, mac_handle = hdd_ctx->mac_handle; dfs_info.channel = wlan_reg_freq_to_chan( hdd_ctx->pdev, ap_ctx->operating_chan_freq); - sme_get_country_code(mac_handle, dfs_info.country_code, &cc_len); + wlan_reg_get_cc_and_src(hdd_ctx->psoc, dfs_info.country_code); sta_id = sap_event->sapevt.sapStartBssCompleteEvent.staId; sap_config = &adapter->session.ap.sap_config; diff --git a/core/hdd/src/wlan_hdd_hostapd_wext.c b/core/hdd/src/wlan_hdd_hostapd_wext.c index af4c5cad01..ef410bfb83 100644 --- a/core/hdd/src/wlan_hdd_hostapd_wext.c +++ b/core/hdd/src/wlan_hdd_hostapd_wext.c @@ -1996,9 +1996,10 @@ int iw_get_channel_list_with_cc(struct net_device *dev, { uint8_t i, len; char *buf; - uint8_t ubuf[CFG_COUNTRY_CODE_LEN] = {0}; - uint8_t ubuf_len = CFG_COUNTRY_CODE_LEN; + uint8_t ubuf[REG_ALPHA2_LEN + 1] = {0}; + uint8_t ubuf_len = REG_ALPHA2_LEN + 1; struct channel_list_info channel_list; + struct mac_context *mac = MAC_CONTEXT(mac_handle); hdd_enter_dev(dev); @@ -2020,14 +2021,13 @@ int iw_get_channel_list_with_cc(struct net_device *dev, return -EINVAL; } len = scnprintf(buf, WE_MAX_STR_LEN, "%u ", channel_list.num_channels); - if (QDF_STATUS_SUCCESS == sme_get_country_code(mac_handle, ubuf, - &ubuf_len)) { - /* Printing Country code in getChannelList */ - for (i = 0; i < (ubuf_len - 1); i++) - len += scnprintf(buf + len, WE_MAX_STR_LEN - len, "%c", ubuf[i]); - } + wlan_reg_get_cc_and_src(mac->psoc, ubuf); + /* Printing Country code in getChannelList */ + for (i = 0; i < (ubuf_len - 1); i++) + len += scnprintf(buf + len, WE_MAX_STR_LEN - len, "%c", ubuf[i]); for (i = 0; i < channel_list.num_channels; i++) - len += scnprintf(buf + len, WE_MAX_STR_LEN - len, " %u", channel_list.channels[i]); + len += scnprintf(buf + len, WE_MAX_STR_LEN - len, " %u", + channel_list.channels[i]); wrqu->data.length = strlen(extra) + 1; diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 5bcc702c65..3423da75b4 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 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 @@ -84,7 +84,6 @@ static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data, uint8_t is_on, uint8_t is_connected) { struct hdd_context *hdd_ctx = NULL; - uint8_t buflen = WLAN_SVC_COUNTRY_CODE_LEN; int i; uint32_t chan_id; uint32_t *chan_freq_list, chan_freq_len; @@ -146,7 +145,7 @@ static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data, qdf_mem_free(chan_freq_list); - sme_get_country_code(hdd_ctx->mac_handle, data->country_code, &buflen); + wlan_reg_get_cc_and_src(hdd_ctx->psoc, data->country_code); data->is_on = is_on; data->vdev_id = adapter->vdev_id; data->vdev_mode = adapter->device_mode; diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index a51d9387ab..dd5aecd33e 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -435,10 +435,10 @@ static bool put_wifi_interface_info(struct wifi_interface_info *stats, QDF_MAC_ADDR_SIZE, stats->bssid.bytes) || nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_AP_COUNTRY_STR, - CFG_COUNTRY_CODE_LEN, stats->apCountryStr) || + REG_ALPHA2_LEN + 1, stats->apCountryStr) || nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_COUNTRY_STR, - CFG_COUNTRY_CODE_LEN, stats->countryStr)) { + REG_ALPHA2_LEN + 1, stats->countryStr)) { hdd_err("QCA_WLAN_VENDOR_ATTR put fail"); return false; } @@ -625,10 +625,10 @@ bool hdd_get_interface_info(struct hdd_adapter *adapter, } qdf_mem_copy(info->countryStr, - mac->scan.countryCodeCurrent, CFG_COUNTRY_CODE_LEN); + mac->scan.countryCodeCurrent, REG_ALPHA2_LEN + 1); qdf_mem_copy(info->apCountryStr, - mac->scan.countryCodeCurrent, CFG_COUNTRY_CODE_LEN); + mac->scan.countryCodeCurrent, REG_ALPHA2_LEN + 1); return true; } diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index daaa7f0b37..118fe869f9 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -55,7 +55,6 @@ 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_SIZE 3 /* MD ID(2 bytes), Capability(1 byte) */ @@ -1416,7 +1415,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[CFG_COUNTRY_CODE_LEN]; /* 3 char country code */ + uint8_t countryCode[REG_ALPHA2_LEN + 1]; /* 3 char country code */ } tAniGenericChangeCountryCodeReq, *tpAniGenericChangeCountryCodeReq; /** @@ -3539,9 +3538,9 @@ struct wifi_interface_info { /* bssid */ struct qdf_mac_addr bssid; /* country string advertised by AP */ - uint8_t apCountryStr[CFG_COUNTRY_CODE_LEN]; + uint8_t apCountryStr[REG_ALPHA2_LEN + 1]; /* country string for this association */ - uint8_t countryStr[CFG_COUNTRY_CODE_LEN]; + uint8_t countryStr[REG_ALPHA2_LEN + 1]; }; /** diff --git a/core/mac/src/pe/sch/sch_message.c b/core/mac/src/pe/sch/sch_message.c index 5582cd546f..98f8428dca 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-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 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 @@ -26,6 +26,7 @@ #include "sch_api.h" #include "wlan_mlme_api.h" +#include /* / Minimum beacon interval allowed (in Kus) */ #define SCH_BEACON_INTERVAL_MIN 10 @@ -103,8 +104,7 @@ 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[CFG_COUNTRY_CODE_LEN]; - uint32_t country_code_len = CFG_COUNTRY_CODE_LEN; + uint8_t country_code_str[REG_ALPHA2_LEN + 1]; uint32_t ani_l[] = {edca_ani_acbe_local, edca_ani_acbk_local, edca_ani_acvi_local, edca_ani_acvo_local}; @@ -124,9 +124,8 @@ sch_get_params(struct mac_context *mac, edca_etsi_acvi_bcast, edca_etsi_acvo_bcast}; edca_params = &mac->mlme_cfg->edca_params; - country_code_len = (uint32_t)mac->mlme_cfg->reg.country_code_len; - qdf_mem_copy(country_code_str, mac->mlme_cfg->reg.country_code, - country_code_len); + wlan_reg_get_cc_and_src(mac->psoc, country_code_str); + if (cds_is_etsi_europe_country(country_code_str)) { val = WNI_CFG_EDCA_PROFILE_ETSI_EUROPE; pe_debug("switch to ETSI EUROPE profile country code %c%c", diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 7b64b6b388..f5864e70ca 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -490,7 +490,7 @@ struct sap_config { /* Max ie length 255 * 2(WPA+RSN) + 2 bytes(vendor specific ID) * 2 */ 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 countryCode[REG_ALPHA2_LEN + 1]; uint8_t RSNEncryptType; uint8_t mcRSNEncryptType; eSapAuthType authType; diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index dc7cd2d5e2..336011d01b 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -2938,7 +2938,7 @@ sapconvert_to_csr_profile(struct sap_config *config, eCsrRoamBssType bssType, /* country code */ if (config->countryCode[0]) qdf_mem_copy(profile->countryCode, config->countryCode, - CFG_COUNTRY_CODE_LEN); + REG_ALPHA2_LEN + 1); profile->ieee80211d = config->ieee80211d; /* wps config info */ profile->wps_state = config->wps_state; diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 3f3d902154..72bdd650ca 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -277,7 +277,7 @@ typedef struct sCsrChnPower_ { typedef struct tagCsr11dinfo { sCsrChannel Channels; - uint8_t countryCode[CFG_COUNTRY_CODE_LEN + 1]; + uint8_t countryCode[REG_ALPHA2_LEN + 1]; /* max power channel list */ sCsrChnPower ChnPower[CFG_VALID_CHANNEL_LIST_LEN]; } tCsr11dinfo; @@ -743,7 +743,7 @@ struct csr_roam_profile { */ uint8_t *pAddIEAssoc; /* it is ignored if [0] is 0. */ - uint8_t countryCode[CFG_COUNTRY_CODE_LEN]; + uint8_t countryCode[REG_ALPHA2_LEN + 1]; /* 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 2575fbfe0a..bfc7b15581 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -400,9 +400,9 @@ struct csr_scanstruct { tDblLinkList channelPowerInfoList5G; uint32_t nLastAgeTimeOut; uint32_t nAgingCountDown; - uint8_t countryCodeDefault[CFG_COUNTRY_CODE_LEN]; - uint8_t countryCodeCurrent[CFG_COUNTRY_CODE_LEN]; - uint8_t countryCode11d[CFG_COUNTRY_CODE_LEN]; + uint8_t countryCodeDefault[REG_ALPHA2_LEN + 1]; + uint8_t countryCodeCurrent[REG_ALPHA2_LEN + 1]; + uint8_t countryCode11d[REG_ALPHA2_LEN + 1]; v_REGDOMAIN_t domainIdDefault; /* default regulatory domain */ v_REGDOMAIN_t domainIdCurrent; /* current regulatory domain */ @@ -410,7 +410,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[CFG_COUNTRY_CODE_LEN]; + uint8_t countryCodeElected[REG_ALPHA2_LEN + 1]; /* * 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/inc/sme_api.h b/core/sme/inc/sme_api.h index 64caa1e634..05c88dd5fd 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -739,9 +739,6 @@ void sme_deregister_oem_data_rsp_callback(mac_handle_t mac_handle) #endif -QDF_STATUS sme_get_country_code(mac_handle_t mac_handle, uint8_t *pBuf, - uint8_t *pbLen); - QDF_STATUS sme_generic_change_country_code(mac_handle_t mac_handle, uint8_t *pCountry); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index b86553591b..4c2b244c1b 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -3557,36 +3557,6 @@ QDF_STATUS sme_get_link_status(mac_handle_t mac_handle, return status; } -/* - * sme_get_country_code() - - * To return the current country code. If no country code is applied, - * default country code is used to fill the buffer. - * If 11d supported is turned off, an error is return and the last - * applied/default country code is used. - * This is a synchronous API. - * - * pBuf - pointer to a caller allocated buffer for returned country code. - * pbLen For input, this parameter indicates how big is the buffer. - * Upon return, this parameter has the number of bytes for - * country. If pBuf doesn't have enough space, this function - * returns fail status and this parameter contains the number - * that is needed. - * - * Return QDF_STATUS SUCCESS. - * - * FAILURE or RESOURCES The API finished and failed. - */ -QDF_STATUS sme_get_country_code(mac_handle_t mac_handle, uint8_t *pBuf, - uint8_t *pbLen) -{ - struct mac_context *mac = MAC_CONTEXT(mac_handle); - - MTRACE(qdf_trace(QDF_MODULE_ID_SME, - TRACE_CODE_SME_RX_HDD_GET_CNTRYCODE, NO_SESSION, 0)); - - return csr_get_country_code(mac, pBuf, pbLen); -} - /* * sme_generic_change_country_code() - * Change Country code from upperlayer during WLAN driver operation. @@ -5453,12 +5423,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, - CFG_COUNTRY_CODE_LEN); + REG_ALPHA2_LEN + 1); } qdf_mem_copy(mac_ctx->scan.countryCodeCurrent, msg->countryCode, - CFG_COUNTRY_CODE_LEN); + REG_ALPHA2_LEN + 1); /* 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 a174f6d056..eab6deeed3 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -1010,9 +1010,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, CFG_COUNTRY_CODE_LEN); + mac->scan.countryCodeDefault, REG_ALPHA2_LEN + 1); qdf_mem_copy(mac->scan.countryCodeElected, - mac->scan.countryCodeDefault, CFG_COUNTRY_CODE_LEN); + mac->scan.countryCodeDefault, REG_ALPHA2_LEN + 1); status = csr_get_channel_and_power_list(mac); return status; @@ -1025,7 +1025,7 @@ QDF_STATUS csr_set_channels(struct mac_context *mac, uint8_t index = 0; qdf_mem_copy(pParam->Csr11dinfo.countryCode, - mac->scan.countryCodeCurrent, CFG_COUNTRY_CODE_LEN); + mac->scan.countryCodeCurrent, REG_ALPHA2_LEN + 1); for (index = 0; index < mac->scan.base_channels.numChannels; index++) { pParam->Csr11dinfo.Channels.channel_freq_list[index] = @@ -3272,7 +3272,7 @@ static QDF_STATUS csr_init11d_info(struct mac_context *mac, tCsr11dinfo *ps11din /* legacy maintenance */ qdf_mem_copy(mac->scan.countryCodeDefault, ps11dinfo->countryCode, - CFG_COUNTRY_CODE_LEN); + REG_ALPHA2_LEN + 1); /* Tush: at csropen get this initialized with default, * during csr reset if this already set with some value @@ -3280,7 +3280,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, CFG_COUNTRY_CODE_LEN); + ps11dinfo->countryCode, REG_ALPHA2_LEN + 1); } /* need to add the max power channel list */ pChanInfo = @@ -11531,7 +11531,7 @@ csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx, * of the criteria. */ qdf_mem_copy(filter->country, profile->countryCode, - CFG_COUNTRY_CODE_LEN); + REG_ALPHA2_LEN + 1); filter->mobility_domain = profile->mdid.mobility_domain; qdf_mem_copy(filter->bssid_hint.bytes, profile->bssid_hint.bytes, diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 99c92cfec3..6b18a40030 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -52,6 +52,7 @@ #include "wlan_blm_api.h" #include "qdf_crypto.h" #include +#include "wlan_reg_ucfg_api.h" static void csr_set_cfg_valid_channel_list(struct mac_context *mac, uint32_t *pchan_freq_list, @@ -61,9 +62,6 @@ static void csr_save_tx_power_to_cfg(struct mac_context *mac, tDblLinkList *pList, uint32_t cfgId); -static void csr_set_cfg_country_code(struct mac_context *mac, - uint8_t *countryCode); - static void csr_purge_channel_power(struct mac_context *mac, tDblLinkList *pChannelList); @@ -609,7 +607,7 @@ void csr_apply_channel_power_info_to_fw(struct mac_context *mac_ctx, } else { sme_err("11D channel list is empty"); } - csr_set_cfg_country_code(mac_ctx, countryCode); + sch_edca_profile_update_all(mac_ctx); } #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR @@ -1589,58 +1587,6 @@ static void csr_save_tx_power_to_cfg(struct mac_context *mac, qdf_mem_free(p_buf); } -static void csr_set_cfg_country_code(struct mac_context *mac, - uint8_t *countryCode) -{ - uint8_t cc[CFG_COUNTRY_CODE_LEN]; - /* v_REGDOMAIN_t DomainId */ - - sme_debug("Set Country in Cfg %s", countryCode); - qdf_mem_copy(cc, countryCode, CFG_COUNTRY_CODE_LEN); - - /* - * Don't program the bogus country codes that we created for Korea in - * the MAC. if we see the bogus country codes, program the MAC with - * the right country code. - */ - if (('K' == countryCode[0] && '1' == countryCode[1]) || - ('K' == countryCode[0] && '2' == countryCode[1]) || - ('K' == countryCode[0] && '3' == countryCode[1]) || - ('K' == countryCode[0] && '4' == countryCode[1])) { - /* - * replace the alternate Korea country codes, 'K1', 'K2', .. - * with 'KR' for Korea - */ - cc[1] = 'R'; - } - - /* - * country code is moved to mlme component, and it is limited to call - * legacy api, so required to call sch_edca_profile_update_all if - * overwrite country code in mlme component - */ - qdf_mem_copy(mac->mlme_cfg->reg.country_code, cc, CFG_COUNTRY_CODE_LEN); - mac->mlme_cfg->reg.country_code_len = CFG_COUNTRY_CODE_LEN; - sch_edca_profile_update_all(mac); - /* - * Need to let HALPHY know about the current domain so it can apply some - * domain-specific settings (TX filter...) - */ -} - -QDF_STATUS csr_get_country_code(struct mac_context *mac, uint8_t *pBuf, - uint8_t *pbLen) -{ - if (pBuf && pbLen && (*pbLen >= CFG_COUNTRY_CODE_LEN)) { - *pbLen = mac->mlme_cfg->reg.country_code_len; - qdf_mem_copy(pBuf, mac->mlme_cfg->reg.country_code, - (uint32_t)*pbLen); - return QDF_STATUS_SUCCESS; - } - - return QDF_STATUS_E_INVAL; -} - QDF_STATUS csr_scan_abort_mac_scan(struct mac_context *mac_ctx, uint32_t vdev_id, uint32_t scan_id) diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index 42921e7ff7..f1434cc1c4 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/core/sme/src/csr/csr_inside_api.h @@ -512,18 +512,6 @@ tCsrScanResultInfo *csr_scan_result_get_first(struct mac_context *mac, tCsrScanResultInfo *csr_scan_result_get_next(struct mac_context *mac, tScanResultHandle hScanResult); -/* - * csr_get_country_code() - - * This function is to get the country code current being used - * pBuf - Caller allocated buffer with at least 3 bytes, upon success return, - * this has the country code - * pbLen - Caller allocated, as input, it indicates the length of pBuf. Upon - * success return, this contains the length of the data in pBuf - * Return QDF_STATUS - */ -QDF_STATUS csr_get_country_code(struct mac_context *mac, uint8_t *pBuf, - uint8_t *pbLen); - /* * csr_get_regulatory_domain_for_country() - * This function is to get the regulatory domain for a country.