qcacld-3.0: Cleanup instances of CFG_COUNTRY_CODE

Remove instances of CFG_COUNTRY_CODE and country_code from
wlan_mlme_reg struct.
Remove redundant country code APIs.

This change is needed because the country code is no longer
stored in CFG file, and subsequently, there is no need for
CFG_COUNTRY_CODE.

Change-Id: Ia4b3b40d0dccfde696352967f2902dfba344a445
CRs-Fixed: 2634079
This commit is contained in:
Lincoln Tran
2020-02-21 12:02:39 -08:00
committed by nshrivas
parent 08c5502552
commit 9faaae1bb7
18 changed files with 42 additions and 169 deletions

View File

@@ -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); 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); mlme_init_acs_avoid_freq_list(psoc, reg);
} }

View File

@@ -226,22 +226,6 @@
VALID_CHANNEL_LIST_DEFAULT, \ VALID_CHANNEL_LIST_DEFAULT, \
"valid channel list") "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")
/* /*
* <ini> * <ini>
* ignore_fw_reg_offload_ind - If set, Ignore the FW offload indication * ignore_fw_reg_offload_ind - If set, Ignore the FW offload indication
@@ -297,7 +281,6 @@
CFG(CFG_INDOOR_CHANNEL_SUPPORT) \ CFG(CFG_INDOOR_CHANNEL_SUPPORT) \
CFG(CFG_SCAN_11D_INTERVAL) \ CFG(CFG_SCAN_11D_INTERVAL) \
CFG(CFG_VALID_CHANNEL_LIST) \ CFG(CFG_VALID_CHANNEL_LIST) \
CFG(CFG_COUNTRY_CODE) \
CFG(CFG_IGNORE_FW_REG_OFFLOAD_IND) \ CFG(CFG_IGNORE_FW_REG_OFFLOAD_IND) \
CFG_SAP_AVOID_ACS_FREQ_LIST_ALL CFG_SAP_AVOID_ACS_FREQ_LIST_ALL

View File

@@ -2203,8 +2203,6 @@ struct wlan_mlme_mwc {
* @scan_11d_interval: scan 11d interval * @scan_11d_interval: scan 11d interval
* @valid_channel_freq_list: array for valid channel list * @valid_channel_freq_list: array for valid channel list
* @valid_channel_list_num: valid channel list number * @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 * @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 * @avoid_acs_freq_list: List of the frequencies which need to be avoided
* during acs * during acs
@@ -2222,8 +2220,6 @@ struct wlan_mlme_reg {
uint32_t scan_11d_interval; uint32_t scan_11d_interval;
uint32_t valid_channel_freq_list[CFG_VALID_CHANNEL_LIST_LEN]; uint32_t valid_channel_freq_list[CFG_VALID_CHANNEL_LIST_LEN];
uint32_t valid_channel_list_num; 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; bool enable_11d_in_world_mode;
#ifdef SAP_AVOID_ACS_FREQ_LIST #ifdef SAP_AVOID_ACS_FREQ_LIST
uint16_t avoid_acs_freq_list[CFG_VALID_CHANNEL_LIST_LEN]; uint16_t avoid_acs_freq_list[CFG_VALID_CHANNEL_LIST_LEN];

View File

@@ -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; eSapDfsCACState_t cac_state = eSAP_DFS_DO_NOT_SKIP_CAC;
struct hdd_config *cfg = NULL; struct hdd_config *cfg = NULL;
struct wlan_dfs_info dfs_info; struct wlan_dfs_info dfs_info;
uint8_t cc_len = WLAN_SVC_COUNTRY_CODE_LEN;
struct hdd_adapter *con_sap_adapter; struct hdd_adapter *con_sap_adapter;
QDF_STATUS status = QDF_STATUS_SUCCESS; QDF_STATUS status = QDF_STATUS_SUCCESS;
tSap_StationAssocReassocCompleteEvent *event; 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; mac_handle = hdd_ctx->mac_handle;
dfs_info.channel = wlan_reg_freq_to_chan( dfs_info.channel = wlan_reg_freq_to_chan(
hdd_ctx->pdev, ap_ctx->operating_chan_freq); 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; sta_id = sap_event->sapevt.sapStartBssCompleteEvent.staId;
sap_config = &adapter->session.ap.sap_config; sap_config = &adapter->session.ap.sap_config;

View File

@@ -1996,9 +1996,10 @@ int iw_get_channel_list_with_cc(struct net_device *dev,
{ {
uint8_t i, len; uint8_t i, len;
char *buf; char *buf;
uint8_t ubuf[CFG_COUNTRY_CODE_LEN] = {0}; uint8_t ubuf[REG_ALPHA2_LEN + 1] = {0};
uint8_t ubuf_len = CFG_COUNTRY_CODE_LEN; uint8_t ubuf_len = REG_ALPHA2_LEN + 1;
struct channel_list_info channel_list; struct channel_list_info channel_list;
struct mac_context *mac = MAC_CONTEXT(mac_handle);
hdd_enter_dev(dev); hdd_enter_dev(dev);
@@ -2020,14 +2021,13 @@ int iw_get_channel_list_with_cc(struct net_device *dev,
return -EINVAL; return -EINVAL;
} }
len = scnprintf(buf, WE_MAX_STR_LEN, "%u ", channel_list.num_channels); len = scnprintf(buf, WE_MAX_STR_LEN, "%u ", channel_list.num_channels);
if (QDF_STATUS_SUCCESS == sme_get_country_code(mac_handle, ubuf, wlan_reg_get_cc_and_src(mac->psoc, ubuf);
&ubuf_len)) { /* Printing Country code in getChannelList */
/* Printing Country code in getChannelList */ for (i = 0; i < (ubuf_len - 1); i++)
for (i = 0; i < (ubuf_len - 1); i++) len += scnprintf(buf + len, WE_MAX_STR_LEN - len, "%c", ubuf[i]);
len += scnprintf(buf + len, WE_MAX_STR_LEN - len, "%c", ubuf[i]);
}
for (i = 0; i < channel_list.num_channels; 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; wrqu->data.length = strlen(extra) + 1;

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * 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) uint8_t is_on, uint8_t is_connected)
{ {
struct hdd_context *hdd_ctx = NULL; struct hdd_context *hdd_ctx = NULL;
uint8_t buflen = WLAN_SVC_COUNTRY_CODE_LEN;
int i; int i;
uint32_t chan_id; uint32_t chan_id;
uint32_t *chan_freq_list, chan_freq_len; 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); 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->is_on = is_on;
data->vdev_id = adapter->vdev_id; data->vdev_id = adapter->vdev_id;
data->vdev_mode = adapter->device_mode; data->vdev_mode = adapter->device_mode;

View File

@@ -435,10 +435,10 @@ static bool put_wifi_interface_info(struct wifi_interface_info *stats,
QDF_MAC_ADDR_SIZE, stats->bssid.bytes) || QDF_MAC_ADDR_SIZE, stats->bssid.bytes) ||
nla_put(vendor_event, nla_put(vendor_event,
QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_AP_COUNTRY_STR, 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, nla_put(vendor_event,
QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_COUNTRY_STR, 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"); hdd_err("QCA_WLAN_VENDOR_ATTR put fail");
return false; return false;
} }
@@ -625,10 +625,10 @@ bool hdd_get_interface_info(struct hdd_adapter *adapter,
} }
qdf_mem_copy(info->countryStr, qdf_mem_copy(info->countryStr,
mac->scan.countryCodeCurrent, CFG_COUNTRY_CODE_LEN); mac->scan.countryCodeCurrent, REG_ALPHA2_LEN + 1);
qdf_mem_copy(info->apCountryStr, qdf_mem_copy(info->apCountryStr,
mac->scan.countryCodeCurrent, CFG_COUNTRY_CODE_LEN); mac->scan.countryCodeCurrent, REG_ALPHA2_LEN + 1);
return true; return true;
} }

View File

@@ -55,7 +55,6 @@ struct mac_context;
/* / Max supported channel list */ /* / Max supported channel list */
#define SIR_MAX_SUPPORTED_CHANNEL_LIST 96 #define SIR_MAX_SUPPORTED_CHANNEL_LIST 96
#define CFG_VALID_CHANNEL_LIST_LEN 100 #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) */ #define SIR_MDIE_SIZE 3 /* MD ID(2 bytes), Capability(1 byte) */
@@ -1416,7 +1415,7 @@ typedef struct sAniGetSnrReq {
typedef struct sAniGenericChangeCountryCodeReq { typedef struct sAniGenericChangeCountryCodeReq {
uint16_t msgType; /* message type is same as the request type */ uint16_t msgType; /* message type is same as the request type */
uint16_t msgLen; /* length of the entire request */ 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; } tAniGenericChangeCountryCodeReq, *tpAniGenericChangeCountryCodeReq;
/** /**
@@ -3539,9 +3538,9 @@ struct wifi_interface_info {
/* bssid */ /* bssid */
struct qdf_mac_addr bssid; struct qdf_mac_addr bssid;
/* country string advertised by AP */ /* country string advertised by AP */
uint8_t apCountryStr[CFG_COUNTRY_CODE_LEN]; uint8_t apCountryStr[REG_ALPHA2_LEN + 1];
/* country string for this association */ /* country string for this association */
uint8_t countryStr[CFG_COUNTRY_CODE_LEN]; uint8_t countryStr[REG_ALPHA2_LEN + 1];
}; };
/** /**

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -26,6 +26,7 @@
#include "sch_api.h" #include "sch_api.h"
#include "wlan_mlme_api.h" #include "wlan_mlme_api.h"
#include <wlan_reg_services_api.h>
/* / Minimum beacon interval allowed (in Kus) */ /* / Minimum beacon interval allowed (in Kus) */
#define SCH_BEACON_INTERVAL_MIN 10 #define SCH_BEACON_INTERVAL_MIN 10
@@ -103,8 +104,7 @@ sch_get_params(struct mac_context *mac,
uint32_t *prf; uint32_t *prf;
struct wlan_mlme_edca_params *edca_params; struct wlan_mlme_edca_params *edca_params;
QDF_STATUS status; QDF_STATUS status;
uint8_t country_code_str[CFG_COUNTRY_CODE_LEN]; uint8_t country_code_str[REG_ALPHA2_LEN + 1];
uint32_t country_code_len = CFG_COUNTRY_CODE_LEN;
uint32_t ani_l[] = {edca_ani_acbe_local, edca_ani_acbk_local, uint32_t ani_l[] = {edca_ani_acbe_local, edca_ani_acbk_local,
edca_ani_acvi_local, edca_ani_acvo_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_etsi_acvi_bcast, edca_etsi_acvo_bcast};
edca_params = &mac->mlme_cfg->edca_params; edca_params = &mac->mlme_cfg->edca_params;
country_code_len = (uint32_t)mac->mlme_cfg->reg.country_code_len; wlan_reg_get_cc_and_src(mac->psoc, country_code_str);
qdf_mem_copy(country_code_str, mac->mlme_cfg->reg.country_code,
country_code_len);
if (cds_is_etsi_europe_country(country_code_str)) { if (cds_is_etsi_europe_country(country_code_str)) {
val = WNI_CFG_EDCA_PROFILE_ETSI_EUROPE; val = WNI_CFG_EDCA_PROFILE_ETSI_EUROPE;
pe_debug("switch to ETSI EUROPE profile country code %c%c", pe_debug("switch to ETSI EUROPE profile country code %c%c",

View File

@@ -490,7 +490,7 @@ struct sap_config {
/* Max ie length 255 * 2(WPA+RSN) + 2 bytes(vendor specific ID) * 2 */ /* Max ie length 255 * 2(WPA+RSN) + 2 bytes(vendor specific ID) * 2 */
uint8_t RSNWPAReqIE[(WLAN_MAX_IE_LEN * 2) + 4]; uint8_t RSNWPAReqIE[(WLAN_MAX_IE_LEN * 2) + 4];
/* it is ignored if [0] is 0. */ /* 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 RSNEncryptType;
uint8_t mcRSNEncryptType; uint8_t mcRSNEncryptType;
eSapAuthType authType; eSapAuthType authType;

View File

@@ -2938,7 +2938,7 @@ sapconvert_to_csr_profile(struct sap_config *config, eCsrRoamBssType bssType,
/* country code */ /* country code */
if (config->countryCode[0]) if (config->countryCode[0])
qdf_mem_copy(profile->countryCode, config->countryCode, qdf_mem_copy(profile->countryCode, config->countryCode,
CFG_COUNTRY_CODE_LEN); REG_ALPHA2_LEN + 1);
profile->ieee80211d = config->ieee80211d; profile->ieee80211d = config->ieee80211d;
/* wps config info */ /* wps config info */
profile->wps_state = config->wps_state; profile->wps_state = config->wps_state;

View File

@@ -277,7 +277,7 @@ typedef struct sCsrChnPower_ {
typedef struct tagCsr11dinfo { typedef struct tagCsr11dinfo {
sCsrChannel Channels; sCsrChannel Channels;
uint8_t countryCode[CFG_COUNTRY_CODE_LEN + 1]; uint8_t countryCode[REG_ALPHA2_LEN + 1];
/* max power channel list */ /* max power channel list */
sCsrChnPower ChnPower[CFG_VALID_CHANNEL_LIST_LEN]; sCsrChnPower ChnPower[CFG_VALID_CHANNEL_LIST_LEN];
} tCsr11dinfo; } tCsr11dinfo;
@@ -743,7 +743,7 @@ struct csr_roam_profile {
*/ */
uint8_t *pAddIEAssoc; uint8_t *pAddIEAssoc;
/* it is ignored if [0] is 0. */ /* 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 */ /* WPS Association if true => auth and ecryption should be ignored */
bool bWPSAssociation; bool bWPSAssociation;
bool bOSENAssociation; bool bOSENAssociation;

View File

@@ -400,9 +400,9 @@ struct csr_scanstruct {
tDblLinkList channelPowerInfoList5G; tDblLinkList channelPowerInfoList5G;
uint32_t nLastAgeTimeOut; uint32_t nLastAgeTimeOut;
uint32_t nAgingCountDown; uint32_t nAgingCountDown;
uint8_t countryCodeDefault[CFG_COUNTRY_CODE_LEN]; uint8_t countryCodeDefault[REG_ALPHA2_LEN + 1];
uint8_t countryCodeCurrent[CFG_COUNTRY_CODE_LEN]; uint8_t countryCodeCurrent[REG_ALPHA2_LEN + 1];
uint8_t countryCode11d[CFG_COUNTRY_CODE_LEN]; uint8_t countryCode11d[REG_ALPHA2_LEN + 1];
v_REGDOMAIN_t domainIdDefault; /* default regulatory domain */ v_REGDOMAIN_t domainIdDefault; /* default regulatory domain */
v_REGDOMAIN_t domainIdCurrent; /* current 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 * in 11d IE from probe rsp or beacons of neighboring APs
* will use the most popular one (max count) * 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) * Customer wants to optimize the scan time. Avoiding scans(passive)
* on DFS channels while swipping through both bands can save some time * on DFS channels while swipping through both bands can save some time

View File

@@ -739,9 +739,6 @@ void sme_deregister_oem_data_rsp_callback(mac_handle_t mac_handle)
#endif #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, QDF_STATUS sme_generic_change_country_code(mac_handle_t mac_handle,
uint8_t *pCountry); uint8_t *pCountry);

View File

@@ -3557,36 +3557,6 @@ QDF_STATUS sme_get_link_status(mac_handle_t mac_handle,
return status; 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() - * sme_generic_change_country_code() -
* Change Country code from upperlayer during WLAN driver operation. * 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])) ('0' != msg->countryCode[1]))
qdf_mem_copy(mac_ctx->scan.countryCode11d, qdf_mem_copy(mac_ctx->scan.countryCode11d,
msg->countryCode, msg->countryCode,
CFG_COUNTRY_CODE_LEN); REG_ALPHA2_LEN + 1);
} }
qdf_mem_copy(mac_ctx->scan.countryCodeCurrent, qdf_mem_copy(mac_ctx->scan.countryCodeCurrent,
msg->countryCode, msg->countryCode,
CFG_COUNTRY_CODE_LEN); REG_ALPHA2_LEN + 1);
/* get the channels based on new cc */ /* get the channels based on new cc */
status = csr_get_channel_and_power_list(mac_ctx); status = csr_get_channel_and_power_list(mac_ctx);

View File

@@ -1010,9 +1010,9 @@ QDF_STATUS csr_init_chan_list(struct mac_context *mac, uint8_t *alpha2)
mac->scan.domainIdCurrent = 0; mac->scan.domainIdCurrent = 0;
qdf_mem_copy(mac->scan.countryCodeCurrent, 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, 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); status = csr_get_channel_and_power_list(mac);
return status; return status;
@@ -1025,7 +1025,7 @@ QDF_STATUS csr_set_channels(struct mac_context *mac,
uint8_t index = 0; uint8_t index = 0;
qdf_mem_copy(pParam->Csr11dinfo.countryCode, 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; for (index = 0; index < mac->scan.base_channels.numChannels;
index++) { index++) {
pParam->Csr11dinfo.Channels.channel_freq_list[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 */ /* legacy maintenance */
qdf_mem_copy(mac->scan.countryCodeDefault, ps11dinfo->countryCode, qdf_mem_copy(mac->scan.countryCodeDefault, ps11dinfo->countryCode,
CFG_COUNTRY_CODE_LEN); REG_ALPHA2_LEN + 1);
/* Tush: at csropen get this initialized with default, /* Tush: at csropen get this initialized with default,
* during csr reset if this already set with some value * 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]) { if (0 == mac->scan.countryCodeCurrent[0]) {
qdf_mem_copy(mac->scan.countryCodeCurrent, 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 */ /* need to add the max power channel list */
pChanInfo = pChanInfo =
@@ -11531,7 +11531,7 @@ csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx,
* of the criteria. * of the criteria.
*/ */
qdf_mem_copy(filter->country, profile->countryCode, qdf_mem_copy(filter->country, profile->countryCode,
CFG_COUNTRY_CODE_LEN); REG_ALPHA2_LEN + 1);
filter->mobility_domain = profile->mdid.mobility_domain; filter->mobility_domain = profile->mdid.mobility_domain;
qdf_mem_copy(filter->bssid_hint.bytes, profile->bssid_hint.bytes, qdf_mem_copy(filter->bssid_hint.bytes, profile->bssid_hint.bytes,

View File

@@ -52,6 +52,7 @@
#include "wlan_blm_api.h" #include "wlan_blm_api.h"
#include "qdf_crypto.h" #include "qdf_crypto.h"
#include <wlan_crypto_global_api.h> #include <wlan_crypto_global_api.h>
#include "wlan_reg_ucfg_api.h"
static void csr_set_cfg_valid_channel_list(struct mac_context *mac, static void csr_set_cfg_valid_channel_list(struct mac_context *mac,
uint32_t *pchan_freq_list, uint32_t *pchan_freq_list,
@@ -61,9 +62,6 @@ static void csr_save_tx_power_to_cfg(struct mac_context *mac,
tDblLinkList *pList, tDblLinkList *pList,
uint32_t cfgId); 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, static void csr_purge_channel_power(struct mac_context *mac,
tDblLinkList *pChannelList); tDblLinkList *pChannelList);
@@ -609,7 +607,7 @@ void csr_apply_channel_power_info_to_fw(struct mac_context *mac_ctx,
} else { } else {
sme_err("11D channel list is empty"); 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 #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); 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, QDF_STATUS csr_scan_abort_mac_scan(struct mac_context *mac_ctx,
uint32_t vdev_id, uint32_t vdev_id,
uint32_t scan_id) uint32_t scan_id)

View File

@@ -512,18 +512,6 @@ tCsrScanResultInfo *csr_scan_result_get_first(struct mac_context *mac,
tCsrScanResultInfo *csr_scan_result_get_next(struct mac_context *mac, tCsrScanResultInfo *csr_scan_result_get_next(struct mac_context *mac,
tScanResultHandle hScanResult); 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() - * csr_get_regulatory_domain_for_country() -
* This function is to get the regulatory domain for a country. * This function is to get the regulatory domain for a country.