qcacld-3.0: Refactor three WNI and one INI
Based on new cfg framework, refactor below WNI cfg:
- WNI_CFG_VALID_CHANNEL_LIST
- WNI_CFG_COUNTRY_CODE
- WNI_CFG_REMOVE_TIME_SYNC_CMD
- CFG_REMOVE_TIME_STAMP_SYNC_CMD_NAME
Change-Id: Ic612705ad6c36e055b50baf30ae3e76818f50eed
CRs-Fixed: 2381199
This commit is contained in:
parent
c8bbd264e1
commit
f3cbeaf9c6
@ -357,6 +357,8 @@ static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc,
|
||||
gen->enabled_11d = cfg_get(psoc, CFG_11D_SUPPORT_ENABLED);
|
||||
gen->enable_beacon_reception_stats =
|
||||
cfg_get(psoc, CFG_ENABLE_BEACON_RECEPTION_STATS);
|
||||
gen->enable_remove_time_stamp_sync_cmd =
|
||||
cfg_get(psoc, CFG_REMOVE_TIME_STAMP_SYNC_CMD);
|
||||
}
|
||||
|
||||
static void mlme_init_edca_ani_cfg(struct wlan_mlme_edca_params *edca_params)
|
||||
@ -2055,6 +2057,8 @@ static void mlme_init_mwc_cfg(struct wlan_objmgr_psoc *psoc,
|
||||
static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_mlme_reg *reg)
|
||||
{
|
||||
qdf_size_t valid_channel_list_num = 0;
|
||||
|
||||
reg->self_gen_frm_pwr = cfg_get(psoc, CFG_SELF_GEN_FRM_PWR);
|
||||
reg->etsi13_srd_chan_in_master_mode =
|
||||
cfg_get(psoc, CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE);
|
||||
@ -2062,6 +2066,14 @@ static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc,
|
||||
cfg_get(psoc, CFG_RESTART_BEACONING_ON_CH_AVOID);
|
||||
reg->indoor_channel_support = cfg_get(psoc, CFG_INDOOR_CHANNEL_SUPPORT);
|
||||
reg->scan_11d_interval = cfg_get(psoc, CFG_SCAN_11D_INTERVAL);
|
||||
qdf_uint8_array_parse(cfg_default(CFG_VALID_CHANNEL_LIST),
|
||||
reg->valid_channel_list,
|
||||
CFG_VALID_CHANNEL_LIST_LEN,
|
||||
&valid_channel_list_num);
|
||||
reg->valid_channel_list_num = (uint8_t)valid_channel_list_num;
|
||||
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);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -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
|
||||
@ -577,6 +577,24 @@
|
||||
0, \
|
||||
"Enable disable beacon reception stats")
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* gRemoveTimeStampSyncCmd - Enable/Disable to remove time stamp sync cmd
|
||||
* @Min: 0
|
||||
* @Max: 1
|
||||
* @Default: 0
|
||||
*
|
||||
* This ini is used to enable/disable the removal of time stamp sync cmd
|
||||
*
|
||||
* Usage: External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
#define CFG_REMOVE_TIME_STAMP_SYNC_CMD CFG_INI_BOOL( \
|
||||
"gRemoveTimeStampSyncCmd", \
|
||||
0, \
|
||||
"Enable to remove time stamp sync cmd")
|
||||
|
||||
#define CFG_GENERIC_ALL \
|
||||
CFG(CFG_ENABLE_DEBUG_PACKET_LOG) \
|
||||
CFG(CFG_PMF_SA_QUERY_MAX_RETRIES) \
|
||||
@ -601,6 +619,7 @@
|
||||
CFG(CFG_CRASH_FW_TIMEOUT) \
|
||||
CFG(CFG_DROPPED_PKT_DISCONNECT_THRESHOLD) \
|
||||
CFG(CFG_ITO_REPEAT_COUNT) \
|
||||
CFG(CFG_ENABLE_BEACON_RECEPTION_STATS)
|
||||
CFG(CFG_ENABLE_BEACON_RECEPTION_STATS) \
|
||||
CFG(CFG_REMOVE_TIME_STAMP_SYNC_CMD)
|
||||
|
||||
#endif /* __CFG_MLME_GENERIC_H */
|
||||
|
@ -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
|
||||
@ -23,6 +23,8 @@
|
||||
#ifndef CFG_MLME_REG_H__
|
||||
#define CFG_MLME_REG_H__
|
||||
|
||||
#define VALID_CHANNEL_LIST_DEFAULT "36, 40, 44, 48, 52, 56, 60, 64, 1, 6, 11, 34, 38, 42, 46, 2, 3, 4, 5, 7, 8, 9, 10, 12, 13, 14, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 151, 153, 155, 157, 159, 161, 50, 54, 58, 62, 240, 242, 244, 246, 248, 250, 252"
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* gSelfGenFrmPwr - self-generated frame power in tx chain mask
|
||||
@ -156,11 +158,49 @@
|
||||
CFG_VALUE_OR_DEFAULT, \
|
||||
"set the 11d scan interval in FW")
|
||||
|
||||
/*
|
||||
* valid_chan_list - Configure valid channel list
|
||||
* @Min: 0
|
||||
* @Max: 256
|
||||
* @Default: 64
|
||||
*
|
||||
* This ini is used to configure the data max number of pre-auth
|
||||
*
|
||||
* Usage: Internal
|
||||
*
|
||||
*/
|
||||
#define CFG_VALID_CHANNEL_LIST CFG_INI_STRING( \
|
||||
"valid_chan_list", \
|
||||
0, \
|
||||
CFG_VALID_CHANNEL_LIST_STRING_LEN, \
|
||||
VALID_CHANNEL_LIST_DEFAULT, \
|
||||
"valid channel list")
|
||||
|
||||
/*
|
||||
* max_num_pre_auth - Configure max number of pre-auth
|
||||
* @Min: 0
|
||||
* @Max: 256
|
||||
* @Default: 64
|
||||
*
|
||||
* This ini is used to configure the data max number of pre-auth
|
||||
*
|
||||
* Usage: Internal
|
||||
*
|
||||
*/
|
||||
#define CFG_COUNTRY_CODE CFG_INI_STRING( \
|
||||
"country_code", \
|
||||
0, \
|
||||
CFG_COUNTRY_CODE_LEN, \
|
||||
"", \
|
||||
"country code")
|
||||
|
||||
#define CFG_REG_ALL \
|
||||
CFG(CFG_SELF_GEN_FRM_PWR) \
|
||||
CFG(CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE) \
|
||||
CFG(CFG_RESTART_BEACONING_ON_CH_AVOID) \
|
||||
CFG(CFG_INDOOR_CHANNEL_SUPPORT) \
|
||||
CFG(CFG_SCAN_11D_INTERVAL)
|
||||
CFG(CFG_SCAN_11D_INTERVAL) \
|
||||
CFG(CFG_VALID_CHANNEL_LIST) \
|
||||
CFG(CFG_COUNTRY_CODE)
|
||||
|
||||
#endif /* CFG_MLME_REG_H__ */
|
||||
|
@ -989,6 +989,7 @@ struct wlan_mlme_chainmask {
|
||||
* @enabled_11h: enable 11h flag
|
||||
* @enabled_11d: enable 11d flag
|
||||
* @enable_beacon_reception_stats: enable beacon reception stats
|
||||
* @enable_remove_time_stamp_sync_cmd: Enable remove time stamp sync cmd
|
||||
*/
|
||||
struct wlan_mlme_generic {
|
||||
enum band_info band_capability;
|
||||
@ -1016,6 +1017,7 @@ struct wlan_mlme_generic {
|
||||
bool enabled_11d;
|
||||
bool enable_deauth_to_disassoc_map;
|
||||
bool enable_beacon_reception_stats;
|
||||
bool enable_remove_time_stamp_sync_cmd;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -1893,6 +1895,10 @@ struct wlan_mlme_mwc {
|
||||
* @restart_beaconing_on_ch_avoid: restart beaconing on ch avoid
|
||||
* @indoor_channel_support: indoor channel support
|
||||
* @scan_11d_interval: scan 11d interval
|
||||
* @valid_channel_list: array for valid channel list
|
||||
* @valid_channel_list_num: valid channel list number
|
||||
* @country_code: country code
|
||||
* @country_code_len: country code length
|
||||
*/
|
||||
struct wlan_mlme_reg {
|
||||
uint32_t self_gen_frm_pwr;
|
||||
@ -1901,6 +1907,10 @@ struct wlan_mlme_reg {
|
||||
restart_beaconing_on_ch_avoid;
|
||||
bool indoor_channel_support;
|
||||
uint32_t scan_11d_interval;
|
||||
uint8_t valid_channel_list[CFG_VALID_CHANNEL_LIST_LEN];
|
||||
uint8_t valid_channel_list_num;
|
||||
uint8_t country_code[CFG_COUNTRY_CODE_LEN + 1];
|
||||
uint8_t country_code_len;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -3498,6 +3498,19 @@ QDF_STATUS
|
||||
ucfg_mlme_get_scan_11d_interval(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t *value);
|
||||
|
||||
/**
|
||||
* ucfg_mlme_get_valid_channel_list() - get valid channel list
|
||||
* @psoc: pointer to psoc object
|
||||
* @channel_list: pointer to return channel list
|
||||
* @channel_list_num: pointer to return channel list number
|
||||
*
|
||||
* Return: QDF Status
|
||||
*/
|
||||
QDF_STATUS
|
||||
ucfg_mlme_get_valid_channel_list(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *channel_list,
|
||||
uint32_t *channel_list_num);
|
||||
|
||||
#ifdef FEATURE_LFR_SUBNET_DETECTION
|
||||
/**
|
||||
* ucfg_mlme_is_subnet_detection_enabled() - check if sub net detection is
|
||||
|
@ -1456,6 +1456,32 @@ ucfg_mlme_get_scan_11d_interval(struct wlan_objmgr_psoc *psoc,
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_mlme_get_valid_channel_list(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *channel_list,
|
||||
uint32_t *channel_list_num)
|
||||
{
|
||||
struct wlan_mlme_psoc_obj *mlme_obj;
|
||||
qdf_size_t valid_channel_list_num = 0;
|
||||
|
||||
mlme_obj = mlme_get_psoc_obj(psoc);
|
||||
if (!mlme_obj) {
|
||||
qdf_uint8_array_parse(cfg_default(CFG_VALID_CHANNEL_LIST),
|
||||
channel_list,
|
||||
CFG_VALID_CHANNEL_LIST_LEN,
|
||||
&valid_channel_list_num);
|
||||
*channel_list_num = (uint8_t)valid_channel_list_num;
|
||||
mlme_err("Failed to get MLME Obj");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
*channel_list_num = (uint32_t)mlme_obj->cfg.reg.valid_channel_list_num;
|
||||
qdf_mem_copy(channel_list, mlme_obj->cfg.reg.valid_channel_list,
|
||||
*channel_list_num);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef FEATURE_LFR_SUBNET_DETECTION
|
||||
QDF_STATUS
|
||||
ucfg_mlme_is_subnet_detection_enabled(struct wlan_objmgr_psoc *psoc, bool *val)
|
||||
|
@ -776,24 +776,6 @@ enum hdd_dot11_mode {
|
||||
#define CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* gRemoveTimeStampSyncCmd - Enable/Disable to remove time stamp sync cmd
|
||||
* @Min: 0
|
||||
* @Max: 1
|
||||
* @Default: 0
|
||||
*
|
||||
* This ini is used to enable/disable the removal of time stamp sync cmd
|
||||
*
|
||||
* Usage: External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
#define CFG_REMOVE_TIME_STAMP_SYNC_CMD_NAME "gRemoveTimeStampSyncCmd"
|
||||
#define CFG_REMOVE_TIME_STAMP_SYNC_CMD_MIN (0)
|
||||
#define CFG_REMOVE_TIME_STAMP_SYNC_CMD_MAX (1)
|
||||
#define CFG_REMOVE_TIME_STAMP_SYNC_CMD_DEFAULT (0)
|
||||
|
||||
/*
|
||||
* Type declarations
|
||||
*/
|
||||
@ -932,7 +914,6 @@ struct hdd_config {
|
||||
uint8_t num_vdevs;
|
||||
uint8_t enable_concurrent_sta[CFG_CONCURRENT_IFACE_MAX_LEN];
|
||||
uint8_t dbs_scan_selection[CFG_DBS_SCAN_PARAM_LENGTH];
|
||||
uint8_t remove_time_stamp_sync_cmd;
|
||||
#ifdef FEATURE_RUNTIME_PM
|
||||
bool runtime_pm;
|
||||
#endif
|
||||
|
@ -269,13 +269,6 @@ struct reg_table_entry g_registry_table[] = {
|
||||
CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT,
|
||||
CFG_CHANGE_CHANNEL_BANDWIDTH_MIN,
|
||||
CFG_CHANGE_CHANNEL_BANDWIDTH_MAX),
|
||||
|
||||
REG_VARIABLE(CFG_REMOVE_TIME_STAMP_SYNC_CMD_NAME, WLAN_PARAM_Integer,
|
||||
struct hdd_config, remove_time_stamp_sync_cmd,
|
||||
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
|
||||
CFG_REMOVE_TIME_STAMP_SYNC_CMD_DEFAULT,
|
||||
CFG_REMOVE_TIME_STAMP_SYNC_CMD_MIN,
|
||||
CFG_REMOVE_TIME_STAMP_SYNC_CMD_MAX),
|
||||
};
|
||||
|
||||
|
||||
@ -1503,8 +1496,6 @@ QDF_STATUS hdd_hex_string_to_u16_array(char *str,
|
||||
bool hdd_update_config_cfg(struct hdd_context *hdd_ctx)
|
||||
{
|
||||
bool status = true;
|
||||
struct hdd_config *config = hdd_ctx->config;
|
||||
mac_handle_t mac_handle;
|
||||
|
||||
/*
|
||||
* During the initialization both 2G and 5G capabilities should be same.
|
||||
@ -1516,16 +1507,6 @@ bool hdd_update_config_cfg(struct hdd_context *hdd_ctx)
|
||||
hdd_err("Couldn't set HE CAP in cfg");
|
||||
}
|
||||
|
||||
mac_handle = hdd_ctx->mac_handle;
|
||||
|
||||
if (sme_cfg_set_int(mac_handle,
|
||||
WNI_CFG_REMOVE_TIME_SYNC_CMD,
|
||||
config->remove_time_stamp_sync_cmd)
|
||||
== QDF_STATUS_E_FAILURE) {
|
||||
status = false;
|
||||
hdd_err("Couldn't pass on WNI_CFG_REMOVE_TIME_SYNC_CMD to CFG");
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -13463,7 +13463,6 @@ QDF_STATUS wlan_hdd_validate_operation_channel(struct hdd_adapter *adapter,
|
||||
uint32_t num_ch = 0;
|
||||
u8 valid_ch[CFG_VALID_CHANNEL_LIST_LEN];
|
||||
u32 indx = 0;
|
||||
mac_handle_t mac_handle = hdd_adapter_get_mac_handle(adapter);
|
||||
uint8_t fValidChannel = false, count = 0;
|
||||
QDF_STATUS status;
|
||||
bool value;
|
||||
@ -13487,11 +13486,8 @@ QDF_STATUS wlan_hdd_validate_operation_channel(struct hdd_adapter *adapter,
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
} else {
|
||||
if (0 != sme_cfg_get_str(mac_handle, WNI_CFG_VALID_CHANNEL_LIST,
|
||||
valid_ch, &num_ch)) {
|
||||
hdd_err("failed to get valid channel list");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
ucfg_mlme_get_valid_channel_list(hdd_ctx->psoc, valid_ch,
|
||||
&num_ch);
|
||||
for (indx = 0; indx < num_ch; indx++) {
|
||||
if (channel == valid_ch[indx])
|
||||
break;
|
||||
@ -18395,12 +18391,8 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
|
||||
chandef.
|
||||
chan->
|
||||
center_freq);
|
||||
|
||||
if (0 != sme_cfg_get_str(mac_handle, WNI_CFG_VALID_CHANNEL_LIST,
|
||||
validChan, &numChans)) {
|
||||
hdd_err("No valid channel list");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
ucfg_mlme_get_valid_channel_list(hdd_ctx->psoc, validChan,
|
||||
&numChans);
|
||||
|
||||
for (indx = 0; indx < numChans; indx++) {
|
||||
if (channelNum == validChan[indx])
|
||||
|
@ -139,4 +139,12 @@ void sch_beacon_process_for_ap(struct mac_context *mac_ctx,
|
||||
uint8_t *rx_pkt_info,
|
||||
tSchBeaconStruct *bcn);
|
||||
|
||||
/**
|
||||
* sch_edca_profile_update_all() - update edca profile for all sessions
|
||||
* @pmac: pointer to mac structure
|
||||
*
|
||||
* return: None
|
||||
*/
|
||||
void sch_edca_profile_update_all(struct mac_context *pmac);
|
||||
|
||||
#endif
|
||||
|
@ -211,15 +211,9 @@ static void populate_dot11f_tdls_offchannel_params(
|
||||
uint8_t nss_2g;
|
||||
uint8_t nss_5g;
|
||||
|
||||
if (wlan_cfg_get_str(mac, WNI_CFG_VALID_CHANNEL_LIST,
|
||||
validChan, &numChans) != QDF_STATUS_SUCCESS) {
|
||||
/**
|
||||
* Could not get Valid channel list from CFG.
|
||||
* Log error.
|
||||
*/
|
||||
pe_err("could not retrieve Valid channel list");
|
||||
return;
|
||||
}
|
||||
numChans = mac->mlme_cfg->reg.valid_channel_list_num;
|
||||
qdf_mem_copy(validChan, mac->mlme_cfg->reg.valid_channel_list,
|
||||
mac->mlme_cfg->reg.valid_channel_list_num);
|
||||
|
||||
if (IS_5G_CH(pe_session->currentOperChannel))
|
||||
band = BAND_5G;
|
||||
|
@ -628,13 +628,9 @@ QDF_STATUS lim_send_ht40_obss_scanind(struct mac_context *mac_ctx,
|
||||
mac_ctx->scan.countryCodeCurrent,
|
||||
session->currentOperChannel,
|
||||
session->ch_width);
|
||||
channelnum = CFG_VALID_CHANNEL_LIST_LEN;
|
||||
if (wlan_cfg_get_str(mac_ctx, WNI_CFG_VALID_CHANNEL_LIST,
|
||||
chan_list, &channelnum) != QDF_STATUS_SUCCESS) {
|
||||
pe_err("could not retrieve Valid channel list");
|
||||
qdf_mem_free(ht40_obss_scanind);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
channelnum = mac_ctx->mlme_cfg->reg.valid_channel_list_num;
|
||||
qdf_mem_copy(chan_list, mac_ctx->mlme_cfg->reg.valid_channel_list,
|
||||
channelnum);
|
||||
/* Extract 24G channel list */
|
||||
channel24gnum = 0;
|
||||
for (count = 0; count < channelnum &&
|
||||
|
@ -4601,14 +4601,9 @@ bool lim_is_channel_valid_for_channel_switch(struct mac_context *mac, uint8_t ch
|
||||
return false;
|
||||
}
|
||||
|
||||
if (wlan_cfg_get_str(mac, WNI_CFG_VALID_CHANNEL_LIST,
|
||||
(uint8_t *) validChannelList,
|
||||
(uint32_t *) &validChannelListLen) !=
|
||||
QDF_STATUS_SUCCESS) {
|
||||
pe_err("could not retrieve valid channel list");
|
||||
return false;
|
||||
}
|
||||
|
||||
validChannelListLen = mac->mlme_cfg->reg.valid_channel_list_num;
|
||||
qdf_mem_copy(validChannelList, mac->mlme_cfg->reg.valid_channel_list,
|
||||
mac->mlme_cfg->reg.valid_channel_list_num);
|
||||
for (index = 0; index < validChannelListLen; index++) {
|
||||
if (validChannelList[index] != channel)
|
||||
continue;
|
||||
|
@ -78,7 +78,7 @@ void sch_set_beacon_interval(struct mac_context *mac,
|
||||
mac->sch.beacon_interval = (uint16_t) bi;
|
||||
}
|
||||
|
||||
static void sch_edca_profile_update_all(struct mac_context *pmac)
|
||||
void sch_edca_profile_update_all(struct mac_context *pmac)
|
||||
{
|
||||
uint32_t i;
|
||||
struct pe_session *psession_entry;
|
||||
@ -111,11 +111,6 @@ void sch_process_message(struct mac_context *mac, struct scheduler_msg *pSchMsg)
|
||||
switch (pSchMsg->type) {
|
||||
case SIR_CFG_PARAM_UPDATE_IND:
|
||||
switch (pSchMsg->bodyval) {
|
||||
case WNI_CFG_COUNTRY_CODE:
|
||||
pe_debug("sch: WNI_CFG_COUNTRY_CODE changed");
|
||||
sch_edca_profile_update_all(mac);
|
||||
break;
|
||||
|
||||
default:
|
||||
pe_err("Cfg param %d indication not handled",
|
||||
pSchMsg->bodyval);
|
||||
@ -163,9 +158,10 @@ sch_get_params(struct mac_context *mac,
|
||||
edca_etsi_acvi_bcast, edca_etsi_acvo_bcast};
|
||||
edca_params = &mac->mlme_cfg->edca_params;
|
||||
|
||||
if (wlan_cfg_get_str(mac, WNI_CFG_COUNTRY_CODE, country_code_str,
|
||||
&country_code_len) == QDF_STATUS_SUCCESS &&
|
||||
cds_is_etsi_europe_country(country_code_str)) {
|
||||
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);
|
||||
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",
|
||||
country_code_str[0], country_code_str[1]);
|
||||
|
@ -593,7 +593,7 @@ struct csr_roam_session {
|
||||
uint8_t cJoinAttemps;
|
||||
/*
|
||||
* This may or may not have the up-to-date valid channel list. It is
|
||||
* used to get WNI_CFG_VALID_CHANNEL_LIST and not alloc memory all time
|
||||
* used to get CFG_VALID_CHANNEL_LIST and not alloc memory all time
|
||||
*/
|
||||
tSirMacChanNum validChannelList[CFG_VALID_CHANNEL_LIST_LEN];
|
||||
int32_t sPendingCommands; /* 0 means CSR is ok to low power */
|
||||
@ -701,7 +701,7 @@ struct csr_roamstruct {
|
||||
enum csr_roam_substate curSubState[CSR_ROAM_SESSION_MAX];
|
||||
/*
|
||||
* This may or may not have the up-to-date valid channel list. It is
|
||||
* used to get WNI_CFG_VALID_CHANNEL_LIST and not alloc mem all time
|
||||
* used to get CFG_VALID_CHANNEL_LIST and not alloc mem all time
|
||||
*/
|
||||
tSirMacChanNum validChannelList[CFG_VALID_CHANNEL_LIST_LEN];
|
||||
uint32_t numValidChannels; /* total number of channels in CFG */
|
||||
|
@ -1161,8 +1161,11 @@ QDF_STATUS sme_get_valid_channels(uint8_t *chan_list, uint32_t *list_len)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return wlan_cfg_get_str(mac_ctx, WNI_CFG_VALID_CHANNEL_LIST,
|
||||
chan_list, list_len);
|
||||
*list_len = (uint32_t)mac_ctx->mlme_cfg->reg.valid_channel_list_num;
|
||||
qdf_mem_copy(chan_list, mac_ctx->mlme_cfg->reg.valid_channel_list,
|
||||
*list_len);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef WLAN_CONV_SPECTRAL_ENABLE
|
||||
|
@ -12564,10 +12564,9 @@ QDF_STATUS csr_get_cfg_valid_channels(struct mac_context *mac, uint8_t *pChannel
|
||||
uint8_t num_chan_temp = 0;
|
||||
int i;
|
||||
|
||||
if (!QDF_IS_STATUS_SUCCESS(wlan_cfg_get_str(mac,
|
||||
WNI_CFG_VALID_CHANNEL_LIST,
|
||||
(uint8_t *) pChannels, pNumChan)))
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
*pNumChan = (uint32_t)mac->mlme_cfg->reg.valid_channel_list_num;
|
||||
qdf_mem_copy(pChannels, mac->mlme_cfg->reg.valid_channel_list,
|
||||
*pNumChan);
|
||||
|
||||
for (i = 0; i < *pNumChan; i++) {
|
||||
if (!wlan_reg_is_dsrc_chan(mac->pdev, pChannels[i])) {
|
||||
|
@ -49,6 +49,7 @@
|
||||
#include <wlan_objmgr_pdev_obj.h>
|
||||
#include <wlan_utility.h>
|
||||
#include "wlan_reg_services_api.h"
|
||||
#include "sch_api.h"
|
||||
|
||||
static void csr_set_cfg_valid_channel_list(struct mac_context *mac,
|
||||
uint8_t *pChannelList,
|
||||
@ -1493,7 +1494,6 @@ static void csr_set_cfg_valid_channel_list(struct mac_context *mac,
|
||||
uint8_t *pChannelList,
|
||||
uint8_t NumChannels)
|
||||
{
|
||||
uint32_t dataLen = sizeof(uint8_t) * NumChannels;
|
||||
QDF_STATUS status;
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
||||
@ -1501,8 +1501,9 @@ static void csr_set_cfg_valid_channel_list(struct mac_context *mac,
|
||||
__func__, NumChannels);
|
||||
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
||||
pChannelList, NumChannels);
|
||||
cfg_set_str(mac, WNI_CFG_VALID_CHANNEL_LIST, pChannelList,
|
||||
dataLen);
|
||||
qdf_mem_copy(mac->mlme_cfg->reg.valid_channel_list, pChannelList,
|
||||
NumChannels);
|
||||
mac->mlme_cfg->reg.valid_channel_list_num = NumChannels;
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
||||
"Scan offload is enabled, update default chan list");
|
||||
@ -1646,8 +1647,16 @@ static void csr_set_cfg_country_code(struct mac_context *mac,
|
||||
*/
|
||||
cc[1] = 'R';
|
||||
}
|
||||
cfg_set_str(mac, WNI_CFG_COUNTRY_CODE, cc, CFG_COUNTRY_CODE_LEN);
|
||||
|
||||
/*
|
||||
* 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;
|
||||
sme_debug("CFG_COUNTRY_CODE changed");
|
||||
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...)
|
||||
@ -1657,17 +1666,11 @@ static void csr_set_cfg_country_code(struct mac_context *mac,
|
||||
QDF_STATUS csr_get_country_code(struct mac_context *mac, uint8_t *pBuf,
|
||||
uint8_t *pbLen)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
uint32_t len;
|
||||
|
||||
if (pBuf && pbLen && (*pbLen >= CFG_COUNTRY_CODE_LEN)) {
|
||||
len = *pbLen;
|
||||
status = wlan_cfg_get_str(mac, WNI_CFG_COUNTRY_CODE, pBuf,
|
||||
&len);
|
||||
if (status == QDF_STATUS_SUCCESS) {
|
||||
*pbLen = (uint8_t) len;
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
*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;
|
||||
|
@ -753,7 +753,7 @@ void csr_roam_free_connect_profile(tCsrRoamConnectedProfile *profile);
|
||||
|
||||
/*
|
||||
* csr_apply_channel_and_power_list() -
|
||||
* HDD calls this function to set the WNI_CFG_VALID_CHANNEL_LIST base on the
|
||||
* HDD calls this function to set the CFG_VALID_CHANNEL_LIST base on the
|
||||
* band/mode settings. This function must be called after CFG is downloaded
|
||||
* and all the band/mode setting already passed into CSR.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2011-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
|
||||
@ -938,7 +938,7 @@ QDF_STATUS sme_rrm_process_beacon_report_req_ind(struct mac_context *mac,
|
||||
((pBeaconReq->channelInfo.channelNum == 255)
|
||||
&& (pBeaconReq->channelList.numChannels == 0))) {
|
||||
/* Add all the channel in the regulatory domain. */
|
||||
wlan_cfg_get_str_len(mac, WNI_CFG_VALID_CHANNEL_LIST, &len);
|
||||
len = mac->mlme_cfg->reg.valid_channel_list_num;
|
||||
pSmeRrmContext->channelList.ChannelList = qdf_mem_malloc(len);
|
||||
if (!pSmeRrmContext->channelList.ChannelList)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
@ -4300,7 +4300,6 @@ QDF_STATUS wma_start(void)
|
||||
int status;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct mac_context *mac = NULL;
|
||||
uint32_t cfg_val;
|
||||
|
||||
WMA_LOGD("%s: Enter", __func__);
|
||||
|
||||
@ -4464,24 +4463,21 @@ QDF_STATUS wma_start(void)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (wlan_cfg_get_int(mac, WNI_CFG_REMOVE_TIME_SYNC_CMD,
|
||||
&cfg_val) == QDF_STATUS_SUCCESS) {
|
||||
if (cfg_val == 0 && cds_get_conparam() != QDF_GLOBAL_FTM_MODE) {
|
||||
/* Initialize firmware time stamp sync timer */
|
||||
qdf_status =
|
||||
qdf_mc_timer_init(
|
||||
if (!mac->mlme_cfg->gen.enable_remove_time_stamp_sync_cmd &&
|
||||
cds_get_conparam() != QDF_GLOBAL_FTM_MODE) {
|
||||
/* Initialize firmware time stamp sync timer */
|
||||
qdf_status = qdf_mc_timer_init(
|
||||
&wma_handle->wma_fw_time_sync_timer,
|
||||
QDF_TIMER_TYPE_SW,
|
||||
wma_send_time_stamp_sync_cmd,
|
||||
wma_handle);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
WMA_LOGE("Failed to init fw time sync timer");
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Start firmware time stamp sync timer */
|
||||
wma_send_time_stamp_sync_cmd(wma_handle);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
WMA_LOGE("Failed to init fw time sync timer");
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Start firmware time stamp sync timer */
|
||||
wma_send_time_stamp_sync_cmd(wma_handle);
|
||||
}
|
||||
/* Initialize log completion timeout */
|
||||
qdf_status = qdf_mc_timer_init(&wma_handle->log_completion_timer,
|
||||
@ -4583,7 +4579,6 @@ QDF_STATUS wma_stop(void)
|
||||
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
|
||||
int i;
|
||||
struct mac_context *mac = NULL;
|
||||
uint32_t cfg_val;
|
||||
|
||||
wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
|
||||
WMA_LOGD("%s: Enter", __func__);
|
||||
@ -4630,15 +4625,13 @@ QDF_STATUS wma_stop(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (wlan_cfg_get_int(mac, WNI_CFG_REMOVE_TIME_SYNC_CMD,
|
||||
&cfg_val) == QDF_STATUS_SUCCESS) {
|
||||
if (cfg_val == 0 && cds_get_conparam() != QDF_GLOBAL_FTM_MODE) {
|
||||
/* Destroy firmware time stamp sync timer */
|
||||
qdf_status = qdf_mc_timer_destroy(
|
||||
&wma_handle->wma_fw_time_sync_timer);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status))
|
||||
WMA_LOGE("Failed to destory fw sync timer");
|
||||
}
|
||||
if (!mac->mlme_cfg->gen.enable_remove_time_stamp_sync_cmd &&
|
||||
cds_get_conparam() != QDF_GLOBAL_FTM_MODE) {
|
||||
/* Destroy firmware time stamp sync timer */
|
||||
qdf_status = qdf_mc_timer_destroy(
|
||||
&wma_handle->wma_fw_time_sync_timer);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status))
|
||||
WMA_LOGE("Failed to destroy fw sync timer");
|
||||
}
|
||||
|
||||
qdf_status = wma_tx_detach(wma_handle);
|
||||
|
Loading…
Reference in New Issue
Block a user