summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManikandan Mohan <manikand@qca.qualcomm.com>2015-04-05 20:15:03 -0700
committerAkash Patel <c_akashp@qca.qualcomm.com>2015-04-29 14:28:43 -0700
commit32488a60e214caa5fb01246190fd6dd4853a02b4 (patch)
treef78b032f9f0d4cbffda77e0cc014addd82449746
parentc57125e34fcfb99a04870b332d743dad506e7252 (diff)
qcacld: Get ACS channel list from hostapd.conf
Updated CLD to get ACS channel list using standard nl80211 vendor commands from hostapd and remove redundant driver ini parameters to configure the acs range. Change-Id: Ifb4f16c9445fcd8ef098f6aaf84a4c703164f40d CRs-fixed: 805118
-rw-r--r--CORE/HDD/inc/qc_sap_ioctl.h2
-rw-r--r--CORE/HDD/inc/wlan_hdd_cfg.h26
-rw-r--r--CORE/HDD/inc/wlan_hdd_cfg80211.h3
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h6
-rw-r--r--CORE/HDD/src/wlan_hdd_assoc.c7
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg.c74
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c650
-rw-r--r--CORE/HDD/src/wlan_hdd_hostapd.c102
-rwxr-xr-xCORE/HDD/src/wlan_hdd_main.c82
-rw-r--r--CORE/HDD/src/wlan_hdd_scan.c4
-rw-r--r--CORE/HDD/src/wlan_hdd_wext.c35
-rw-r--r--CORE/SAP/inc/sapApi.h103
-rw-r--r--CORE/SAP/src/sapApiLinkCntl.c127
-rw-r--r--CORE/SAP/src/sapChSelect.c351
-rw-r--r--CORE/SAP/src/sapFsm.c151
-rw-r--r--CORE/SAP/src/sapInternal.h21
-rw-r--r--CORE/SAP/src/sapModule.c319
-rw-r--r--CORE/SME/inc/sme_Api.h6
-rw-r--r--CORE/SME/src/sme_common/sme_Api.c219
-rwxr-xr-xfirmware_bin/WCNSS_qcom_cfg.ini23
20 files changed, 653 insertions, 1658 deletions
diff --git a/CORE/HDD/inc/qc_sap_ioctl.h b/CORE/HDD/inc/qc_sap_ioctl.h
index c690e263d139..715f16d3b4c2 100644
--- a/CORE/HDD/inc/qc_sap_ioctl.h
+++ b/CORE/HDD/inc/qc_sap_ioctl.h
@@ -157,8 +157,8 @@ typedef struct
#define QCSAP_IOCTL_PRIV_SET_THREE_INT_GET_NONE (SIOCIWFIRSTPRIV+15)
#define WE_SET_WLAN_DBG 1
#define QCSAP_IOCTL_PRIV_SET_VAR_INT_GET_NONE (SIOCIWFIRSTPRIV+16)
+/* (SIOCIWFIRSTPRIV+17) is unused */
#define WE_LOG_DUMP_CMD 1
-#define QCSAP_IOCTL_SET_CHANNEL_RANGE (SIOCIWFIRSTPRIV+17)
#define WE_P2P_NOA_CMD 2
//IOCTL to configure MCC params
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h
index d781f537b07e..5968e95c4485 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg.h
@@ -426,21 +426,6 @@ typedef enum
#define CFG_FRAMES_PROCESSING_TH_MAX ( 39 )
#define CFG_FRAMES_PROCESSING_TH_DEFAULT ( 0 )
-#define CFG_SAP_CHANNEL_SELECT_START_CHANNEL "gAPChannelSelectStartChannel"
-#define CFG_SAP_CHANNEL_SELECT_START_CHANNEL_MIN (0)
-#define CFG_SAP_CHANNEL_SELECT_START_CHANNEL_MAX (0xFF)
-#define CFG_SAP_CHANNEL_SELECT_START_CHANNEL_DEFAULT (0)
-
-#define CFG_SAP_CHANNEL_SELECT_END_CHANNEL "gAPChannelSelectEndChannel"
-#define CFG_SAP_CHANNEL_SELECT_END_CHANNEL_MIN (0)
-#define CFG_SAP_CHANNEL_SELECT_END_CHANNEL_MAX (0xFF)
-#define CFG_SAP_CHANNEL_SELECT_END_CHANNEL_DEFAULT (11)
-
-#define CFG_SAP_CHANNEL_SELECT_OPERATING_BAND "gAPChannelSelectOperatingBand"
-#define CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_MIN (0)
-#define CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_MAX (0x5)
-#define CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_DEFAULT (0)
-
#define CFG_DISABLE_PACKET_FILTER "gDisablePacketFilter"
#define CFG_DISABLE_PACKET_FILTER_MIN (0)
#define CFG_DISABLE_PACKET_FILTER_MAX (0x1)
@@ -1455,9 +1440,6 @@ typedef enum
#define HDD_MULTICAST_FILTER_LIST 0x04
#define HDD_MULTICAST_FILTER_LIST_CLEAR 0x05
-#define CFG_ONLY_ALLOWED_CHANNELS "gACSAllowedChannels"
-#define CFG_ONLY_ALLOWED_CHANNELS_DEFAULT ""
-
/* ACS Scan band preference
* 0 -- No preference
* 1 -- Scan 2.4G first
@@ -2865,9 +2847,6 @@ typedef struct
v_BOOL_t apDisableIntraBssFwd;
v_U8_t nEnableListenMode;
v_U32_t nAPAutoShutOff;
- v_U8_t apStartChannelNum;
- v_U8_t apEndChannelNum;
- v_U8_t apOperatingBand;
v_U8_t enableLTECoex;
v_U32_t apKeepAlivePeriod;
v_U32_t goKeepAlivePeriod;
@@ -3246,7 +3225,6 @@ typedef struct
v_U8_t gSapPreferredChanLocation;
v_U8_t gDisableDfsJapanW53;
v_BOOL_t gEnableOverLapCh;
- char acsAllowedChnls[CFG_MAX_STR_LEN];
v_BOOL_t fRegChangeDefCountry;
v_U8_t acsScanBandPreference;
#ifdef QCA_LL_TX_FLOW_CT
@@ -3408,10 +3386,6 @@ typedef struct
#ifdef WLAN_FEATURE_MBSSID
typedef struct mbssid_sap_dyn_ini_config {
/* ACS Parameters */
- v_U8_t apStartChannelNum;
- v_U8_t apEndChannelNum;
- v_U8_t apOperatingBand;
- char acsAllowedChnls[CFG_MAX_STR_LEN];
v_U8_t acsScanBandPreference;
v_U16_t acsBandSwitchThreshold;
} mbssid_sap_dyn_ini_config_t;
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h
index 021ee68cffef..097539cde034 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg80211.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h
@@ -1521,8 +1521,7 @@ struct cfg80211_bss* wlan_hdd_cfg80211_update_bss_list(
int wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
struct cfg80211_wowlan *wow);
-void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter,
- uint8_t priChannel, uint8_t secChannel);
+void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter);
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
int wlan_hdd_send_roam_auth_event(hdd_context_t *hdd_ctx_ptr, uint8_t *bssid,
uint8_t *req_rsn_ie, uint32_t req_rsn_length,
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 01a01a6b4d82..8055d1fb07b5 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -755,8 +755,6 @@ struct hdd_ap_ctx_s
v_U8_t operatingChannel;
- v_U8_t secondaryChannel;
-
v_BOOL_t uIsAuthenticated;
eCsrEncryptionType ucEncryptType;
@@ -1343,10 +1341,6 @@ struct hdd_context_s
atomic_t isRestartInProgress;
u_int8_t hdd_restart_retries;
- /*is_dyanmic_channel_range_set is set to 1 when Softap_set_channel_range
- is invoked*/
- v_BOOL_t is_dynamic_channel_range_set;
-
vos_wake_lock_t sap_wake_lock;
#ifdef FEATURE_WLAN_TDLS
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index c85838323b20..317844d5f164 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -2035,13 +2035,12 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
default_sap_channel);
}
hdd_ap_ctx->sapConfig.vht_channel_width =
- pHddCtx->cfg_ini->vhtChannelWidth;
- hdd_ap_ctx->sapConfig.vht_ch_width_orig =
- pHddCtx->cfg_ini->vhtChannelWidth;
+ hdd_ap_ctx->sapConfig.ch_width_orig;
sme_SelectCBMode(WLAN_HDD_GET_HAL_CTX(sap_adapter),
hdd_ap_ctx->sapConfig.SapHw_mode,
hdd_ap_ctx->operatingChannel,
- &hdd_ap_ctx->sapConfig.vht_channel_width);
+ &hdd_ap_ctx->sapConfig.vht_channel_width,
+ hdd_ap_ctx->sapConfig.ch_width_orig);
/*
* Create a workqueue and let the workqueue handle the restarting
* sap task. if we directly call sap restart function without
diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c
index 746751c4e00d..9564fa809231 100644
--- a/CORE/HDD/src/wlan_hdd_cfg.c
+++ b/CORE/HDD/src/wlan_hdd_cfg.c
@@ -738,36 +738,6 @@ REG_TABLE_ENTRY g_registry_table[] =
CFG_FRAMES_PROCESSING_TH_MIN,
CFG_FRAMES_PROCESSING_TH_MAX ),
- REG_VARIABLE( CFG_SAP_CHANNEL_SELECT_START_CHANNEL , WLAN_PARAM_Integer,
- hdd_config_t, apStartChannelNum,
-#ifndef WLAN_FEATURE_MBSSID
- VAR_FLAGS_DYNAMIC_CFG |
-#endif
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_SAP_CHANNEL_SELECT_START_CHANNEL_DEFAULT,
- CFG_SAP_CHANNEL_SELECT_START_CHANNEL_MIN,
- CFG_SAP_CHANNEL_SELECT_START_CHANNEL_MAX ),
-
- REG_VARIABLE( CFG_SAP_CHANNEL_SELECT_END_CHANNEL , WLAN_PARAM_Integer,
- hdd_config_t, apEndChannelNum,
-#ifndef WLAN_FEATURE_MBSSID
- VAR_FLAGS_DYNAMIC_CFG |
-#endif
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_SAP_CHANNEL_SELECT_END_CHANNEL_DEFAULT,
- CFG_SAP_CHANNEL_SELECT_END_CHANNEL_MIN,
- CFG_SAP_CHANNEL_SELECT_END_CHANNEL_MAX ),
-
- REG_VARIABLE( CFG_SAP_CHANNEL_SELECT_OPERATING_BAND , WLAN_PARAM_Integer,
- hdd_config_t, apOperatingBand,
-#ifndef WLAN_FEATURE_MBSSID
- VAR_FLAGS_DYNAMIC_CFG |
-#endif
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_DEFAULT,
- CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_MIN,
- CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_MAX ),
-
REG_VARIABLE( CFG_ENABLE_LTE_COEX , WLAN_PARAM_Integer,
hdd_config_t, enableLTECoex,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -2955,14 +2925,6 @@ REG_TABLE_ENTRY g_registry_table[] =
CFG_ENABLE_OVERLAP_CH_MIN,
CFG_ENABLE_OVERLAP_CH_MAX ),
- REG_VARIABLE_STRING( CFG_ONLY_ALLOWED_CHANNELS, WLAN_PARAM_String,
- hdd_config_t, acsAllowedChnls,
-#ifndef WLAN_FEATURE_MBSSID
- VAR_FLAGS_DYNAMIC_CFG |
-#endif
- VAR_FLAGS_OPTIONAL,
- (void *)CFG_ONLY_ALLOWED_CHANNELS_DEFAULT),
-
REG_VARIABLE( CFG_REG_CHANGE_DEF_COUNTRY_NAME, WLAN_PARAM_Integer,
hdd_config_t, fRegChangeDefCountry,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -3680,35 +3642,6 @@ REG_TABLE_ENTRY g_registry_table[] =
#ifdef WLAN_FEATURE_MBSSID
REG_TABLE_ENTRY mbssid_sap_dyn_ini_reg_table[] =
{
- REG_VARIABLE( CFG_SAP_CHANNEL_SELECT_START_CHANNEL , WLAN_PARAM_Integer,
- mbssid_sap_dyn_ini_config_t, apStartChannelNum,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT
- | VAR_FLAGS_DYNAMIC_CFG,
- CFG_SAP_CHANNEL_SELECT_START_CHANNEL_DEFAULT,
- CFG_SAP_CHANNEL_SELECT_START_CHANNEL_MIN,
- CFG_SAP_CHANNEL_SELECT_START_CHANNEL_MAX ),
-
- REG_VARIABLE( CFG_SAP_CHANNEL_SELECT_END_CHANNEL , WLAN_PARAM_Integer,
- mbssid_sap_dyn_ini_config_t, apEndChannelNum,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT
- | VAR_FLAGS_DYNAMIC_CFG,
- CFG_SAP_CHANNEL_SELECT_END_CHANNEL_DEFAULT,
- CFG_SAP_CHANNEL_SELECT_END_CHANNEL_MIN,
- CFG_SAP_CHANNEL_SELECT_END_CHANNEL_MAX ),
-
- REG_VARIABLE( CFG_SAP_CHANNEL_SELECT_OPERATING_BAND , WLAN_PARAM_Integer,
- mbssid_sap_dyn_ini_config_t, apOperatingBand,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT
- | VAR_FLAGS_DYNAMIC_CFG,
- CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_DEFAULT,
- CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_MIN,
- CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_MAX ),
-
- REG_VARIABLE_STRING( CFG_ONLY_ALLOWED_CHANNELS, WLAN_PARAM_String,
- mbssid_sap_dyn_ini_config_t, acsAllowedChnls,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_DYNAMIC_CFG,
- (void *)CFG_ONLY_ALLOWED_CHANNELS_DEFAULT),
-
REG_VARIABLE( CFG_SAP_SCAN_BAND_PREFERENCE, WLAN_PARAM_Integer,
mbssid_sap_dyn_ini_config_t, acsScanBandPreference,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK
@@ -3973,7 +3906,6 @@ void print_hdd_cfg(hdd_context_t *pHddCtx)
"Name = [sap_channel_avoidance] value = [%u]",
pHddCtx->cfg_ini->sap_channel_avoidance);
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
- VOS_TRACE (VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gACSAllowedChannels] value = [%s]", pHddCtx->cfg_ini->acsAllowedChnls);
VOS_TRACE (VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gACSBandSwitchThreshold] value = [%u]", pHddCtx->cfg_ini->acsBandSwitchThreshold);
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [ChannelBondingMode] Value = [%u]",pHddCtx->cfg_ini->nChannelBondingMode24GHz);
@@ -4880,13 +4812,9 @@ v_VOID_t hdd_mbssid_apply_def_cfg_ini(hdd_adapter_t *pAdapter)
hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
hdd_config_t *iniConfig = pHddCtx->cfg_ini;
mbssid_sap_dyn_ini_config_t *sap_ini_cfg = &pAdapter->sap_dyn_ini_cfg;
- sap_ini_cfg->apStartChannelNum = iniConfig->apStartChannelNum;
- sap_ini_cfg->apEndChannelNum = iniConfig->apEndChannelNum;
- sap_ini_cfg->apOperatingBand = iniConfig->apOperatingBand;
+
sap_ini_cfg->acsScanBandPreference = iniConfig->acsScanBandPreference;
sap_ini_cfg->acsBandSwitchThreshold = iniConfig->acsBandSwitchThreshold;
- vos_mem_copy(sap_ini_cfg->acsAllowedChnls, iniConfig->acsAllowedChnls,
- CFG_MAX_STR_LEN);
}
#endif
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 167167744394..bf2e0e51a6fe 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -6198,124 +6198,17 @@ static int wlan_hdd_cfg80211_disable_dfs_chan_scan(struct wiphy *wiphy,
return ret_val;
}
-
-/*
- * FUNCTION: wlan_hdd_set_acs_allowed_channels
- * set only allowed channel for ACS
- * input channel list is a string with comma separated
- * channel number, the first number is the total number
- * of channels specified. e.g. 4,1,6,9,36
- */
-static void wlan_hdd_set_acs_allowed_channels(
- char *acs_allowed_chnls,
- char *acs_sap_chnl_list,
- int length)
-{
- char *p;
-
- /*
- * a white space is required at the beginning of the
- * string to be properly parsed by function
- * sapSetPreferredChannel later
- */
- strlcpy(acs_sap_chnl_list, " ", length);
- strlcat(acs_sap_chnl_list, acs_allowed_chnls, length);
- p = acs_sap_chnl_list;
- while (*p) {
- /* looking for comma, replace it with white space */
- if (*p == ',')
- *p = ' ';
-
- p++;
- }
-
- return;
-}
-
static int wlan_hdd_config_acs(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
{
tsap_Config_t *sap_config;
hdd_config_t *ini_config;
tHalHandle hal;
- tSmeConfigParams *sme_config;
hal = WLAN_HDD_GET_HAL_CTX(adapter);
sap_config = &adapter->sessionCtx.ap.sapConfig;
ini_config = hdd_ctx->cfg_ini;
sap_config->enOverLapCh = !!hdd_ctx->cfg_ini->gEnableOverLapCh;
-#ifdef WLAN_FEATURE_MBSSID
- if (strlen(adapter->sap_dyn_ini_cfg.acsAllowedChnls) > 0 )
-#else
- if (strlen(ini_config->acsAllowedChnls) > 0)
-#endif
- {
- wlan_hdd_set_acs_allowed_channels(
-#ifdef WLAN_FEATURE_MBSSID
- adapter->sap_dyn_ini_cfg.acsAllowedChnls,
-#else
- ini_config->acsAllowedChnls,
-#endif
- sap_config->acsAllowedChnls,
- sizeof(sap_config->acsAllowedChnls));
- }
-
- if(!hdd_ctx->is_dynamic_channel_range_set) {
-#ifdef WLAN_FEATURE_MBSSID
- WLANSAP_SetChannelRange(hal,
- adapter->sap_dyn_ini_cfg.apStartChannelNum,
- adapter->sap_dyn_ini_cfg.apEndChannelNum,
- adapter->sap_dyn_ini_cfg.apOperatingBand);
-#else
- hdd_config_t *hdd_pConfig=
- (WLAN_HDD_GET_CTX(adapter))->cfg_ini;
- WLANSAP_SetChannelRange(hal,
- hdd_pConfig->apStartChannelNum,
- hdd_pConfig->apEndChannelNum,
- hdd_pConfig->apOperatingBand);
-#endif
- }
- hdd_ctx->is_dynamic_channel_range_set = 0;
-
- sme_config = (tSmeConfigParams*) vos_mem_malloc(sizeof(tSmeConfigParams));
- if ( NULL != sme_config) {
-#ifdef WLAN_FEATURE_MBSSID
- eHalStatus halStatus = eHAL_STATUS_FAILURE;
- sme_GetConfigParam(hal, sme_config);
- sme_config->csrConfig.scanBandPreference =
- adapter->sap_dyn_ini_cfg.acsScanBandPreference;
- halStatus = sme_UpdateConfig(hal, sme_config);
- if ( !HAL_STATUS_SUCCESS( halStatus )
- && sap_config->channel == AUTO_CHANNEL_SELECT ) {
- hddLog(LOGE, "sme_UpdateConfig() for ACS Scan band pref Fail: %d",
- halStatus);
- return -1;
- }
- sap_config->scanBandPreference =
- sme_config->csrConfig.scanBandPreference;
-#else
- sme_GetConfigParam(hal, sme_config);
- sap_config->scanBandPreference =
- sme_config->csrConfig.scanBandPreference;
-#endif
- vos_mem_free(sme_config);
- }
-
-#ifdef WLAN_FEATURE_MBSSID
- sap_config->apOperatingBand = adapter->sap_dyn_ini_cfg.apOperatingBand;
- sap_config->acsBandSwitchThreshold =
- adapter->sap_dyn_ini_cfg.acsBandSwitchThreshold;
- sap_config->apStartChannelNum =
- adapter->sap_dyn_ini_cfg.apStartChannelNum;
- sap_config->apEndChannelNum =
- adapter->sap_dyn_ini_cfg.apEndChannelNum;
-#else
- sap_config->apOperatingBand = ini_config->apOperatingBand;
- sap_config->acsBandSwitchThreshold = ini_config->acsBandSwitchThreshold;
- sap_config->apStartChannelNum = ini_config->apStartChannelNum;
- sap_config->apEndChannelNum = ini_config->apEndChannelNum;
-#endif
- sap_config->vht_channel_width = ini_config->vhtChannelWidth;
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
hddLog(LOG1, FL("HDD_ACS_SKIP_STATUS = %d"), hdd_ctx->skip_acs_scan_status);
@@ -6328,80 +6221,76 @@ static int wlan_hdd_config_acs(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
if (con_sap_adapter)
con_sap_config = &con_sap_adapter->sessionCtx.ap.sapConfig;
- sap_config->skip_acs_scan_status = eSAP_DO_NEW_ACS_SCAN;
+ sap_config->acs_cfg.skip_scan_status = eSAP_DO_NEW_ACS_SCAN;
- if (con_sap_config && con_sap_config->acs_case == true &&
+ if (con_sap_config && con_sap_config->acs_cfg.acs_mode == true &&
hdd_ctx->skip_acs_scan_status == eSAP_SKIP_ACS_SCAN) {
- hddLog(LOG1, FL("Operating Band: PriAP: %d SecAP: %d"),
- con_sap_config->apOperatingBand, sap_config->apOperatingBand);
-
- if ((con_sap_config->apOperatingBand == 5 &&
- sap_config->apOperatingBand > 0) ||
- con_sap_config->apOperatingBand
- == sap_config->apOperatingBand) {
+ if (con_sap_config->acs_cfg.hw_mode == sap_config->acs_cfg.hw_mode) {
v_U8_t con_sap_st_ch, con_sap_end_ch;
v_U8_t cur_sap_st_ch, cur_sap_end_ch;
v_U8_t bandStartChannel, bandEndChannel;
- con_sap_st_ch = con_sap_config->apStartChannelNum;
- con_sap_end_ch = con_sap_config->apEndChannelNum;
- cur_sap_st_ch = sap_config->apStartChannelNum;
- cur_sap_end_ch = sap_config->apEndChannelNum;
+ con_sap_st_ch = con_sap_config->acs_cfg.start_ch;
+ con_sap_end_ch = con_sap_config->acs_cfg.end_ch;
+ cur_sap_st_ch = sap_config->acs_cfg.start_ch;
+ cur_sap_end_ch = sap_config->acs_cfg.end_ch;
- WLANSAP_extend_to_acs_range(sap_config->apOperatingBand,
- &cur_sap_st_ch, &cur_sap_end_ch,
+ WLANSAP_extend_to_acs_range(&cur_sap_st_ch, &cur_sap_end_ch,
&bandStartChannel, &bandEndChannel);
- WLANSAP_extend_to_acs_range(con_sap_config->apOperatingBand,
- &con_sap_st_ch, &con_sap_end_ch,
+ WLANSAP_extend_to_acs_range(&con_sap_st_ch, &con_sap_end_ch,
&bandStartChannel, &bandEndChannel);
if (con_sap_st_ch <= cur_sap_st_ch &&
con_sap_end_ch >= cur_sap_end_ch) {
- sap_config->skip_acs_scan_status = eSAP_SKIP_ACS_SCAN;
+ sap_config->acs_cfg.skip_scan_status = eSAP_SKIP_ACS_SCAN;
} else if (con_sap_st_ch >= cur_sap_st_ch &&
con_sap_end_ch >= cur_sap_end_ch) {
- sap_config->skip_acs_scan_status = eSAP_DO_PAR_ACS_SCAN;
+ sap_config->acs_cfg.skip_scan_status = eSAP_DO_PAR_ACS_SCAN;
- sap_config->skip_acs_scan_range1_stch = cur_sap_st_ch;
- sap_config->skip_acs_scan_range1_endch = con_sap_st_ch - 1;
- sap_config->skip_acs_scan_range2_stch = 0;
- sap_config->skip_acs_scan_range2_endch = 0;
+ sap_config->acs_cfg.skip_scan_range1_stch = cur_sap_st_ch;
+ sap_config->acs_cfg.skip_scan_range1_endch =
+ con_sap_st_ch - 1;
+ sap_config->acs_cfg.skip_scan_range2_stch = 0;
+ sap_config->acs_cfg.skip_scan_range2_endch = 0;
} else if (con_sap_st_ch <= cur_sap_st_ch &&
con_sap_end_ch <= cur_sap_end_ch) {
- sap_config->skip_acs_scan_status = eSAP_DO_PAR_ACS_SCAN;
+ sap_config->acs_cfg.skip_scan_status = eSAP_DO_PAR_ACS_SCAN;
- sap_config->skip_acs_scan_range1_stch = con_sap_end_ch + 1;
- sap_config->skip_acs_scan_range1_endch = cur_sap_end_ch;
- sap_config->skip_acs_scan_range2_stch = 0;
- sap_config->skip_acs_scan_range2_endch = 0;
+ sap_config->acs_cfg.skip_scan_range1_stch =
+ con_sap_end_ch + 1;
+ sap_config->acs_cfg.skip_scan_range1_endch = cur_sap_end_ch;
+ sap_config->acs_cfg.skip_scan_range2_stch = 0;
+ sap_config->acs_cfg.skip_scan_range2_endch = 0;
} else if (con_sap_st_ch >= cur_sap_st_ch &&
con_sap_end_ch <= cur_sap_end_ch) {
- sap_config->skip_acs_scan_status = eSAP_DO_PAR_ACS_SCAN;
+ sap_config->acs_cfg.skip_scan_status = eSAP_DO_PAR_ACS_SCAN;
- sap_config->skip_acs_scan_range1_stch = cur_sap_st_ch;
- sap_config->skip_acs_scan_range1_endch = con_sap_st_ch - 1;
- sap_config->skip_acs_scan_range2_stch = con_sap_end_ch;
- sap_config->skip_acs_scan_range2_endch = cur_sap_end_ch + 1;
+ sap_config->acs_cfg.skip_scan_range1_stch = cur_sap_st_ch;
+ sap_config->acs_cfg.skip_scan_range1_endch =
+ con_sap_st_ch - 1;
+ sap_config->acs_cfg.skip_scan_range2_stch = con_sap_end_ch;
+ sap_config->acs_cfg.skip_scan_range2_endch =
+ cur_sap_end_ch + 1;
} else
- sap_config->skip_acs_scan_status = eSAP_DO_NEW_ACS_SCAN;
+ sap_config->acs_cfg.skip_scan_status = eSAP_DO_NEW_ACS_SCAN;
}
hddLog(LOG1,
FL("SecAP ACS Skip = %d, ACS CH RANGE = %d-%d, %d-%d"),
- sap_config->skip_acs_scan_status,
- sap_config->skip_acs_scan_range1_stch,
- sap_config->skip_acs_scan_range1_endch,
- sap_config->skip_acs_scan_range2_stch,
- sap_config->skip_acs_scan_range2_endch);
+ sap_config->acs_cfg.skip_scan_status,
+ sap_config->acs_cfg.skip_scan_range1_stch,
+ sap_config->acs_cfg.skip_scan_range1_endch,
+ sap_config->acs_cfg.skip_scan_range2_stch,
+ sap_config->acs_cfg.skip_scan_range2_endch);
}
}
#endif
@@ -6409,30 +6298,57 @@ static int wlan_hdd_config_acs(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
return 0;
}
+/**
+ * wlan_hdd_set_acs_ch_range : Start ACS channel range values
+ * @sap_cfg: pointer to SAP config struct
+ *
+ * This function sets the default ACS start and end channel for the given band
+ * and also parses the given ACS channel list.
+ *
+ * Return: None
+ */
-const struct
-nla_policy qca_wlan_acs_vendor_attr[QCA_WLAN_VENDOR_ATTR_ACS_MAX + 1] =
+static void wlan_hdd_set_acs_ch_range(tsap_Config_t *sap_cfg, bool ht_enabled,
+ bool vht_enabled)
{
- [QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE] = { .type = NLA_U8 },
- [QCA_WLAN_VENDOR_ATTR_ACS_HT_ENABLED] = { .type = NLA_FLAG },
- [QCA_WLAN_VENDOR_ATTR_ACS_HT40_ENABLED] = { .type = NLA_FLAG },
-};
+ int i;
+ if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211B) {
+ sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11b;
+ sap_cfg->acs_cfg.start_ch = rfChannels[RF_CHAN_1].channelNum;
+ sap_cfg->acs_cfg.end_ch = rfChannels[RF_CHAN_14].channelNum;
+ } else if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211G) {
+ sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11g;
+ sap_cfg->acs_cfg.start_ch = rfChannels[RF_CHAN_1].channelNum;
+ sap_cfg->acs_cfg.end_ch = rfChannels[RF_CHAN_13].channelNum;
+ } else if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211A) {
+ sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11a;
+ sap_cfg->acs_cfg.start_ch = rfChannels[RF_CHAN_36].channelNum;
+ sap_cfg->acs_cfg.end_ch = rfChannels[RF_CHAN_165].channelNum;
+ }
+ if (ht_enabled)
+ sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11n;
+
+ if (vht_enabled)
+ sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11ac;
+
+
+ /* Parse ACS Chan list from hostapd */
+ if (!sap_cfg->acs_cfg.ch_list)
+ return;
+
+ sap_cfg->acs_cfg.start_ch = sap_cfg->acs_cfg.ch_list[0];
+ sap_cfg->acs_cfg.end_ch =
+ sap_cfg->acs_cfg.ch_list[sap_cfg->acs_cfg.ch_list_count - 1];
+ for (i = 0; i < sap_cfg->acs_cfg.ch_list_count; i++) {
+ if (sap_cfg->acs_cfg.start_ch > sap_cfg->acs_cfg.ch_list[i])
+ sap_cfg->acs_cfg.start_ch = sap_cfg->acs_cfg.ch_list[i];
+ if (sap_cfg->acs_cfg.end_ch < sap_cfg->acs_cfg.ch_list[i])
+ sap_cfg->acs_cfg.end_ch = sap_cfg->acs_cfg.ch_list[i];
+ }
-static int band_to_hw_mode(eSapOperatingBand band)
-{
- switch (band) {
- case eSAP_RF_SUBBAND_2_4_GHZ:
- return QCA_ACS_MODE_IEEE80211G;
- case eSAP_RF_SUBBAND_5_LOW_GHZ:
- case eSAP_RF_SUBBAND_5_MID_GHZ:
- case eSAP_RF_SUBBAND_5_HIGH_GHZ:
- case eSAP_RF_SUBBAND_5_ALL_GHZ:
- return QCA_ACS_MODE_IEEE80211A;
- default:
- return -1;
- }
}
+
static void wlan_hdd_cfg80211_start_pending_acs(struct work_struct *work);
/**
@@ -6455,7 +6371,6 @@ static int wlan_hdd_cfg80211_start_acs(hdd_adapter_t *adapter)
sap_config = &adapter->sessionCtx.ap.sapConfig;
sap_config->channel = AUTO_CHANNEL_SELECT;
- sap_config->apAutoChannelSelection = VOS_TRUE;
#ifdef WLAN_FEATURE_MBSSID
/*
* Check if AP+AP case, once primary AP chooses a DFS
@@ -6463,39 +6378,31 @@ static int wlan_hdd_cfg80211_start_acs(hdd_adapter_t *adapter)
*/
if (vos_concurrent_beaconing_sessions_running()) {
hdd_adapter_t *con_sap_adapter;
- v_U16_t con_ch;
con_sap_adapter = hdd_get_con_sap_adapter(adapter, true);
if (con_sap_adapter) {
- /* we have active SAP running, check if user
- * configured channel is ACS or DFS
- */
- con_ch =
- con_sap_adapter->sessionCtx.ap.sapConfig.channel;
- if (con_ch == AUTO_CHANNEL_SELECT)
- con_ch =
+ tsap_Config_t *con_sap_config =
+ &con_sap_adapter->sessionCtx.ap.sapConfig;
+ uint16_t con_ch =
con_sap_adapter->sessionCtx.ap.operatingChannel;
-
+ if (con_ch != con_sap_config->acs_cfg.pri_ch &&
+ con_ch != con_sap_config->acs_cfg.ht_sec_ch) {
+ hddLog(LOGE, FL(
+ "ERROR: Primary AP channel info wrong"));
+ return -EINVAL;
+ }
if (VOS_IS_DFS_CH(con_ch)) {
- con_ch =
- con_sap_adapter->sessionCtx.ap.operatingChannel;
hddLog(LOGE,
FL("Only SCC AP-AP DFS Permitted (ch=%d, con_ch=%d)"),
sap_config->channel,
con_ch);
hddLog(LOG1,
FL("Overriding guest AP's channel"));
- sap_config->channel = con_ch;
- sap_config->apStartChannelNum =
- con_sap_adapter->sessionCtx.ap.sapConfig.apStartChannelNum;
- sap_config->apEndChannelNum =
- con_sap_adapter->sessionCtx.ap.sapConfig.apEndChannelNum;
- sap_config->apAutoChannelSelection =
- con_sap_adapter->sessionCtx.ap.sapConfig.apAutoChannelSelection;
+ vos_mem_copy(&sap_config->acs_cfg,
+ &con_sap_config->acs_cfg,
+ sizeof(struct sap_acs_cfg));
/* notify hostapd about channel */
- wlan_hdd_cfg80211_acs_ch_select_evt(adapter,
- con_sap_adapter->sessionCtx.ap.operatingChannel,
- con_sap_adapter->sessionCtx.ap.secondaryChannel);
+ wlan_hdd_cfg80211_acs_ch_select_evt(adapter);
clear_bit(ACS_IN_PROGRESS,
&hdd_ctx->g_event_flags);
return 0;
@@ -6503,8 +6410,6 @@ static int wlan_hdd_cfg80211_start_acs(hdd_adapter_t *adapter)
}
}
#endif
- hddLog(LOG1, FL("ACS CFG: HW_MODE: %d ACS_BW: %d"),
- sap_config->acs_hw_mode, sap_config->acs_ch_width);
status = wlan_hdd_config_acs(hdd_ctx, adapter);
if (status) {
@@ -6530,7 +6435,7 @@ static int wlan_hdd_cfg80211_start_acs(hdd_adapter_t *adapter)
hddLog(LOGE, FL("ACS channel select failed"));
return -EINVAL;
}
- sap_config->acs_case = true;
+ sap_config->acs_cfg.acs_mode = true;
set_bit(ACS_IN_PROGRESS, &hdd_ctx->g_event_flags);
return 0;
@@ -6558,13 +6463,29 @@ static int wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
tsap_Config_t *sap_config;
struct sk_buff *temp_skbuff;
- int status;
+ int status = -EINVAL, i = 0;
struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_ACS_MAX + 1];
- u8 hw_mode;
-#ifndef WLAN_FEATURE_MBSSID
- hdd_config_t *hdd_config = (WLAN_HDD_GET_CTX(adapter))->cfg_ini;
-#endif
bool ht_enabled, ht40_enabled, vht_enabled;
+ uint8_t ch_width;
+ /* ***Note*** Donot set SME config related to ACS operation here because
+ * ACS operation is not synchronouse and ACS for Second AP may come when
+ * ACS operation for first AP is going on. So only do_acs is split to
+ * seperate start_acs routine. Also SME-PMAC struct that is used to
+ * pass paremeters from HDD to SAP is global. Thus All ACS related SME
+ * config shall be set only from start_acs.
+ */
+
+ /* nla_policy Policy template. Policy not applied as some attributes are
+ * optional and QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST has variable length
+ *
+ * [QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE] = { .type = NLA_U8 },
+ * [QCA_WLAN_VENDOR_ATTR_ACS_HT_ENABLED] = { .type = NLA_FLAG },
+ * [QCA_WLAN_VENDOR_ATTR_ACS_HT40_ENABLED] = { .type = NLA_FLAG },
+ * [QCA_WLAN_VENDOR_ATTR_ACS_VHT_ENABLED] = { .type = NLA_FLAG },
+ * [QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH] = { .type = NLA_U16 },
+ * [QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST] = { .type = NLA_NESTED },
+ */
+
status = wlan_hdd_validate_context(hdd_ctx);
if (0 != status) {
@@ -6572,9 +6493,10 @@ static int wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
goto out;
}
sap_config = &adapter->sessionCtx.ap.sapConfig;
+ vos_mem_zero(&sap_config->acs_cfg, sizeof(struct sap_acs_cfg));
status = nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ACS_MAX, data, data_len,
- qca_wlan_acs_vendor_attr);
+ NULL);
if (status) {
hddLog(VOS_TRACE_LEVEL_ERROR, FL("Invalid ATTR"));
goto out;
@@ -6584,7 +6506,8 @@ static int wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
hddLog(VOS_TRACE_LEVEL_ERROR, FL("Attr hw_mode failed"));
goto out;
}
- hw_mode = nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE]);
+ sap_config->acs_cfg.hw_mode = nla_get_u8(
+ tb[QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE]);
if (tb[QCA_WLAN_VENDOR_ATTR_ACS_HT_ENABLED])
ht_enabled =
@@ -6592,7 +6515,6 @@ static int wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
else
ht_enabled = 0;
-
if (tb[QCA_WLAN_VENDOR_ATTR_ACS_HT40_ENABLED])
ht40_enabled =
nla_get_flag(tb[QCA_WLAN_VENDOR_ATTR_ACS_HT40_ENABLED]);
@@ -6606,90 +6528,49 @@ static int wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
vht_enabled = 0;
if (tb[QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH]) {
- sap_config->acs_ch_width =
- nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH]);
+ ch_width = nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH]);
} else {
if (ht_enabled && ht40_enabled)
- sap_config->acs_ch_width = 40;
+ ch_width = 40;
else
- sap_config->acs_ch_width = 20;
+ ch_width = 20;
}
-
- /* ***Note*** Donot set SME config related to ACS operation here because
- * ACS operation is not synchronouse and ACS for Second AP may come when
- * ACS operation for first AP is going on. So only do_acs is split to
- * seperate start_acs routine. Also SME-PMAC struct that is used to
- * pass paremeters from HDD to SAP is global. Thus All ACS related SME
- * config shall be set only from start_acs.
- */
- sap_config->channel = AUTO_CHANNEL_SELECT;
- if (hw_mode == QCA_ACS_MODE_IEEE80211G)
- sap_config->acs_hw_mode = eCSR_DOT11_MODE_11g;
- else if (hw_mode == QCA_ACS_MODE_IEEE80211B)
- sap_config->acs_hw_mode = eCSR_DOT11_MODE_11b;
- else if (hw_mode == QCA_ACS_MODE_IEEE80211A)
- sap_config->acs_hw_mode = eCSR_DOT11_MODE_11a;
-
- if (ht_enabled)
- sap_config->acs_hw_mode = eCSR_DOT11_MODE_11n;
- if (vht_enabled)
- sap_config->acs_hw_mode = eCSR_DOT11_MODE_11ac;
-
- if (1 != hdd_ctx->is_dynamic_channel_range_set) {
- if (hw_mode !=
-#ifdef WLAN_FEATURE_MBSSID
- band_to_hw_mode(
- adapter->sap_dyn_ini_cfg.apOperatingBand)) {
-#else
- band_to_hw_mode(hdd_config->apOperatingBand)) {
-#endif
- hddLog(LOGW,
- FL("Conflict band setting between hostapd and driver"));
- switch (hw_mode) {
- case QCA_ACS_MODE_IEEE80211B:
- case QCA_ACS_MODE_IEEE80211G:
-#ifdef WLAN_FEATURE_MBSSID
- adapter->sap_dyn_ini_cfg.apOperatingBand =
- eSAP_RF_SUBBAND_2_4_GHZ;
- adapter->sap_dyn_ini_cfg.apStartChannelNum =
- rfChannels[RF_CHAN_1].channelNum;
- adapter->sap_dyn_ini_cfg.apEndChannelNum =
- rfChannels[RF_CHAN_14].channelNum;
-#else
- hdd_config->apOperatingBand =
- eSAP_RF_SUBBAND_2_4_GHZ;
- hdd_config->apStartChannelNum =
- rfChannels[RF_CHAN_1].channelNum;
- hdd_config->apEndChannelNum =
- rfChannels[RF_CHAN_14].channelNum;
-#endif
- break;
- case QCA_ACS_MODE_IEEE80211A:
-#ifdef WLAN_FEATURE_MBSSID
- adapter->sap_dyn_ini_cfg.apOperatingBand =
- eSAP_RF_SUBBAND_5_ALL_GHZ;
- adapter->sap_dyn_ini_cfg.apStartChannelNum =
- rfChannels[RF_CHAN_36].channelNum;
- adapter->sap_dyn_ini_cfg.apEndChannelNum =
- rfChannels[RF_CHAN_165].channelNum;
-#else
- hdd_config->apOperatingBand =
- eSAP_RF_SUBBAND_5_ALL_GHZ;
- hdd_config->apStartChannelNum =
- rfChannels[RF_CHAN_36].channelNum;
- hdd_config->apEndChannelNum =
- rfChannels[RF_CHAN_165].channelNum;
-#endif
- break;
- default:
- hddLog(LOGE,
- FL("Unsupported hw_mode!"));
- status = -EINVAL;
+ if (ch_width == 80)
+ sap_config->acs_cfg.ch_width = eHT_CHANNEL_WIDTH_80MHZ;
+ else if (ch_width == 40)
+ sap_config->acs_cfg.ch_width = eHT_CHANNEL_WIDTH_40MHZ;
+ else
+ sap_config->acs_cfg.ch_width = eHT_CHANNEL_WIDTH_20MHZ;
+
+ if (tb[QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST]) {
+ char *tmp = nla_data(tb[QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST]);
+ sap_config->acs_cfg.ch_list_count = nla_len(
+ tb[QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST]);
+ if (sap_config->acs_cfg.ch_list_count) {
+ sap_config->acs_cfg.ch_list = vos_mem_malloc(
+ sizeof(uint8_t) *
+ sap_config->acs_cfg.ch_list_count);
+ if (sap_config->acs_cfg.ch_list == NULL)
goto out;
- }
+
+ vos_mem_copy(sap_config->acs_cfg.ch_list, tmp,
+ sap_config->acs_cfg.ch_list_count);
}
}
-
+ wlan_hdd_set_acs_ch_range(sap_config, ht_enabled, vht_enabled);
+
+ hddLog(LOG1, FL("ACS Config for wlan%d: HW_MODE: %d ACS_BW: %d HT: %d VHT: %d START_CH: %d END_CH: %d"),
+ adapter->dev->ifindex, sap_config->acs_cfg.hw_mode,
+ ch_width, ht_enabled, vht_enabled,
+ sap_config->acs_cfg.start_ch, sap_config->acs_cfg.end_ch);
+
+ if (sap_config->acs_cfg.ch_list_count) {
+ hddLog(LOG1, FL("ACS channel list: len: %d"),
+ sap_config->acs_cfg.ch_list_count);
+ for (i = 0; i < sap_config->acs_cfg.ch_list_count; i++)
+ hddLog(LOG1, "%d ", sap_config->acs_cfg.ch_list[i]);
+ }
+ sap_config->acs_cfg.acs_mode = true;
if (test_bit(ACS_IN_PROGRESS, &hdd_ctx->g_event_flags)) {
/* ***Note*** Completion variable usage is not allowed here since
* ACS scan operation may take max 2.2 sec for 5G band.
@@ -6748,18 +6629,19 @@ static void wlan_hdd_cfg80211_start_pending_acs(struct work_struct *work)
* Return: None
*/
-void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter,
- uint8_t pri_channel, uint8_t sec_channel)
+void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter)
{
hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ tsap_Config_t *sap_cfg = &(WLAN_HDD_GET_AP_CTX_PTR(adapter))->sapConfig;
struct sk_buff *vendor_event;
int ret_val;
struct nlattr *nla;
hdd_adapter_t *con_sap_adapter;
+ uint16_t ch_width;
vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
NULL,
- 3 * sizeof(u8) + 4 + NLMSG_HDRLEN,
+ 4 * sizeof(u8) + 1 * sizeof(u16) + 4 + NLMSG_HDRLEN,
QCA_NL80211_VENDOR_SUBCMD_DO_ACS_INDEX,
GFP_KERNEL);
@@ -6786,7 +6668,7 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter,
ret_val = nla_put_u8(vendor_event,
QCA_WLAN_VENDOR_ATTR_ACS_PRIMARY_CHANNEL,
- pri_channel);
+ sap_cfg->acs_cfg.pri_ch);
if (ret_val) {
hddLog(LOGE,
FL("QCA_WLAN_VENDOR_ATTR_ACS_PRIMARY_CHANNEL put fail"));
@@ -6796,7 +6678,7 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter,
ret_val = nla_put_u8(vendor_event,
QCA_WLAN_VENDOR_ATTR_ACS_SECONDARY_CHANNEL,
- sec_channel);
+ sap_cfg->acs_cfg.ht_sec_ch);
if (ret_val) {
hddLog(LOGE,
FL(
@@ -6805,16 +6687,52 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter,
return;
}
- ret_val = nla_put_u8(vendor_event, QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH,
- adapter->sessionCtx.ap.sapConfig.acs_ch_width);
+ ret_val = nla_put_u8(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG0_CENTER_CHANNEL,
+ sap_cfg->acs_cfg.vht_seg0_center_ch);
if (ret_val) {
hddLog(LOGE,
FL(
- "QCA_WLAN_VENDOR_ATTR_ACS_SECONDARY_CHANNEL put fail"));
+ "QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG0_CENTER_CHANNEL put fail"));
kfree_skb(vendor_event);
return;
}
+ ret_val = nla_put_u8(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG1_CENTER_CHANNEL,
+ sap_cfg->acs_cfg.vht_seg1_center_ch);
+ if (ret_val) {
+ hddLog(LOGE,
+ FL(
+ "QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG1_CENTER_CHANNEL put fail"));
+ kfree_skb(vendor_event);
+ return;
+ }
+
+ if (sap_cfg->acs_cfg.ch_width == eHT_CHANNEL_WIDTH_80MHZ)
+ ch_width = 80;
+ else if (sap_cfg->acs_cfg.ch_width == eHT_CHANNEL_WIDTH_40MHZ)
+ ch_width = 40;
+ else
+ ch_width = 20;
+
+ ret_val = nla_put_u16(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH,
+ ch_width);
+ if (ret_val) {
+ hddLog(LOGE,
+ FL(
+ "QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH put fail"));
+ kfree_skb(vendor_event);
+ return;
+ }
+
+ hddLog(LOG1,
+ FL("ACS result for wlan%d: PRI_CH: %d SEC_CH: %d VHT_SEG0: %d VHT_SEG1: %d ACS_BW: %d"),
+ adapter->dev->ifindex, sap_cfg->acs_cfg.pri_ch,
+ sap_cfg->acs_cfg.ht_sec_ch,sap_cfg->acs_cfg.vht_seg0_center_ch,
+ sap_cfg->acs_cfg.vht_seg1_center_ch, ch_width);
+
cfg80211_vendor_event(vendor_event, GFP_KERNEL);
/* ***Note*** As already mentioned Completion variable usage is not
* allowed here since ACS scan operation may take max 2.2 sec.
@@ -8529,9 +8447,8 @@ static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device
int freq = chan->center_freq; /* freq is in MHZ */
hdd_context_t *pHddCtx;
int status;
-#ifdef QCA_HT_2040_COEX
tSmeConfigParams smeConfig;
-#endif
+
ENTER();
if( NULL == dev )
@@ -8637,32 +8554,6 @@ static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device
else if ( WLAN_HDD_SOFTAP == pAdapter->device_mode )
{
- /* If auto channel selection is configured as enable/ 1 then ignore
- channel set by supplicant
- */
-#ifndef QCA_HT_2040_COEX
- if ((WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->
- sapConfig.apAutoChannelSelection)
- {
- (WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->sapConfig.channel =
- AUTO_CHANNEL_SELECT;
- hddLog(LOG2,
- FL("set channel to auto channel (0) for device mode %s(%d)"),
- hdd_device_mode_to_string(pAdapter->device_mode),
- pAdapter->device_mode);
- }
- else
- {
- if(VOS_STATUS_SUCCESS !=
- wlan_hdd_validate_operation_channel(pAdapter,channel))
- {
- hddLog(VOS_TRACE_LEVEL_ERROR,
- "%s: Invalid Channel [%d]", __func__, channel);
- return -EINVAL;
- }
- (WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->sapConfig.channel = channel;
- }
-#else
/* set channel to what hostapd configured */
if (VOS_STATUS_SUCCESS !=
wlan_hdd_validate_operation_channel(pAdapter,channel)) {
@@ -8678,19 +8569,16 @@ static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device
switch (channel_type) {
case NL80211_CHAN_HT20:
case NL80211_CHAN_NO_HT:
- sme_SetPhyCBMode24G(pHddCtx->hHal,
- PHY_SINGLE_CHANNEL_CENTERED);
if (channel <= 14)
- smeConfig.csrConfig.channelBondingMode24GHz = 0;
+ smeConfig.csrConfig.channelBondingMode24GHz =
+ eCSR_INI_SINGLE_CHANNEL_CENTERED;
else
- smeConfig.csrConfig.channelBondingMode5GHz = 0;
+ smeConfig.csrConfig.channelBondingMode5GHz =
+ eCSR_INI_SINGLE_CHANNEL_CENTERED;
- (WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->secondaryChannel = 0;
break;
case NL80211_CHAN_HT40MINUS:
- sme_SetPhyCBMode24G(pHddCtx->hHal,
- PHY_DOUBLE_CHANNEL_HIGH_PRIMARY);
smeConfig.csrConfig.obssEnabled = VOS_TRUE;
if (channel <= 14)
smeConfig.csrConfig.channelBondingMode24GHz =
@@ -8699,12 +8587,8 @@ static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device
smeConfig.csrConfig.channelBondingMode5GHz =
eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
- (WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->secondaryChannel =
- channel - 4;
break;
case NL80211_CHAN_HT40PLUS:
- sme_SetPhyCBMode24G(pHddCtx->hHal,
- PHY_DOUBLE_CHANNEL_LOW_PRIMARY);
smeConfig.csrConfig.obssEnabled = VOS_TRUE;
if (channel <= 14)
smeConfig.csrConfig.channelBondingMode24GHz =
@@ -8713,8 +8597,6 @@ static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device
smeConfig.csrConfig.channelBondingMode5GHz =
eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
- (WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->secondaryChannel =
- channel + 4;
break;
default:
hddLog(VOS_TRACE_LEVEL_ERROR,
@@ -8723,7 +8605,6 @@ static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device
return -EINVAL;
}
sme_UpdateConfig (pHddCtx->hHal, &smeConfig);
-#endif
}
}
else
@@ -8930,16 +8811,7 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
con_sap_adapter = hdd_get_con_sap_adapter(pHostapdAdapter, true);
if (con_sap_adapter) {
/* we have active SAP running */
- /* Check if user configured channel is ACS or DFS */
- con_ch = con_sap_adapter->sessionCtx.ap.sapConfig.channel;
- /* For fixed channel or ACS, once primary AP chooses a DFS
- * channel secondary AP should alway follow primary APs channel
- * This is applicable for cases even when primary AP moves to
- * non DFS channel after RADAR detection.
- */
- if (con_ch == AUTO_CHANNEL_SELECT) {
- con_ch = con_sap_adapter->sessionCtx.ap.operatingChannel;
- }
+ con_ch = con_sap_adapter->sessionCtx.ap.operatingChannel;
if (VOS_IS_DFS_CH(con_ch)) {
/* AP-AP DFS: secondary AP has to follow primary AP's
@@ -8958,12 +8830,9 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
hddLog(VOS_TRACE_LEVEL_ERROR,
"Overriding guest AP's channel !!");
pConfig->channel = con_ch;
- pConfig->apStartChannelNum =
- con_sap_adapter->sessionCtx.ap.sapConfig.apStartChannelNum;
- pConfig->apEndChannelNum =
- con_sap_adapter->sessionCtx.ap.sapConfig.apEndChannelNum;
- pConfig->apAutoChannelSelection =
- con_sap_adapter->sessionCtx.ap.sapConfig.apAutoChannelSelection;
+ vos_mem_copy(&pConfig->acs_cfg,
+ &con_sap_adapter->sessionCtx.ap.sapConfig.acs_cfg,
+ sizeof(struct sap_acs_cfg));
}
} else {
/* We have idle AP interface (no active SAP running on it
@@ -8973,53 +8842,19 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
}
}
#endif
- /*
- * If auto channel is configured i.e. channel is 0,
- * so skip channel validation.
- */
- if( AUTO_CHANNEL_SELECT != pConfig->channel )
+ if(VOS_STATUS_SUCCESS != wlan_hdd_validate_operation_channel(pHostapdAdapter,pConfig->channel))
{
- if(VOS_STATUS_SUCCESS != wlan_hdd_validate_operation_channel(pHostapdAdapter,pConfig->channel))
- {
- hddLog(VOS_TRACE_LEVEL_ERROR,
- "%s: Invalid Channel [%d]", __func__, pConfig->channel);
- return -EINVAL;
- }
-
- /* reject SAP if DFS channel scan is not allowed */
- if ((VOS_FALSE == pHddCtx->cfg_ini->enableDFSChnlScan) &&
- (NV_CHANNEL_DFS ==
- vos_nv_getChannelEnabledState(pConfig->channel))) {
- hddLog(VOS_TRACE_LEVEL_ERROR,
- FL("not allowed to start SAP on DFS channel"));
- return -EOPNOTSUPP;
- }
+ hddLog(VOS_TRACE_LEVEL_ERROR,
+ "%s: Invalid Channel [%d]", __func__, pConfig->channel);
+ return -EINVAL;
}
- else
- {
- status = wlan_hdd_config_acs(pHddCtx, pHostapdAdapter);
- if (status) {
- hddLog(LOGE, FL("ACS config failed"));
- return -EINVAL;
- }
- if(1 != pHddCtx->is_dynamic_channel_range_set)
- {
-#ifdef WLAN_FEATURE_MBSSID
- WLANSAP_SetChannelRange(hHal,
- pHostapdAdapter->sap_dyn_ini_cfg.apStartChannelNum,
- pHostapdAdapter->sap_dyn_ini_cfg.apEndChannelNum,
- pHostapdAdapter->sap_dyn_ini_cfg.apOperatingBand);
-#else
- hdd_config_t *hdd_pConfig=
- (WLAN_HDD_GET_CTX(pHostapdAdapter))->cfg_ini;
- WLANSAP_SetChannelRange(hHal,
- hdd_pConfig->apStartChannelNum,
- hdd_pConfig->apEndChannelNum,
- hdd_pConfig->apOperatingBand);
-#endif
- }
- pHddCtx->is_dynamic_channel_range_set = 0;
+ /* reject SAP if DFS channel scan is not allowed */
+ if ((pHddCtx->cfg_ini->enableDFSChnlScan == false) &&
+ (NV_CHANNEL_DFS ==
+ vos_nv_getChannelEnabledState(pConfig->channel))) {
+ hddLog(LOGE, FL("not allowed to start SAP on DFS channel"));
+ return -EOPNOTSUPP;
}
WLANSAP_Set_Dfs_Ignore_CAC(hHal, iniConfig->ignoreCAC);
@@ -9343,27 +9178,21 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
sme_UpdateConfig(pHddCtx->hHal, &sme_config);
-#ifdef WLAN_FEATURE_11AC
- if (pConfig->vht_channel_width == NL80211_CHAN_WIDTH_80) {
+ if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_80) {
if (pHddCtx->isVHT80Allowed == false)
- pConfig->vht_channel_width = eHT_CHANNEL_WIDTH_40MHZ;
+ pConfig->ch_width_orig = eHT_CHANNEL_WIDTH_40MHZ;
else
- pConfig->vht_channel_width = eHT_CHANNEL_WIDTH_80MHZ;
- } else if (pConfig->vht_channel_width == NL80211_CHAN_WIDTH_40)
- pConfig->vht_channel_width = eHT_CHANNEL_WIDTH_40MHZ;
+ pConfig->ch_width_orig = eHT_CHANNEL_WIDTH_80MHZ;
+ } else if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_40)
+ pConfig->ch_width_orig = eHT_CHANNEL_WIDTH_40MHZ;
else
- pConfig->vht_channel_width = eHT_CHANNEL_WIDTH_20MHZ;
+ pConfig->ch_width_orig = eHT_CHANNEL_WIDTH_20MHZ;
-#endif
- pConfig->vht_ch_width_orig = pConfig->vht_channel_width;
- if ( AUTO_CHANNEL_SELECT != pConfig->channel )
- {
- sme_SelectCBMode(hHal,
- pConfig->SapHw_mode,
- pConfig->channel,
- &pConfig->vht_channel_width);
- }
+ pConfig->vht_channel_width = pConfig->ch_width_orig;
+
+ sme_SelectCBMode(hHal, pConfig->SapHw_mode, pConfig->channel,
+ &pConfig->vht_channel_width, pConfig->ch_width_orig);
// ht_capab is not what the name conveys,this is used for protection bitmap
pConfig->ht_capab = iniConfig->apProtection;
@@ -9717,7 +9546,12 @@ static int wlan_hdd_cfg80211_stop_ap (struct wiphy *wiphy,
hdd_change_sap_restart_required_status(pHddCtx, false);
}
- pAdapter->sessionCtx.ap.sapConfig.acs_case = false;
+ pAdapter->sessionCtx.ap.sapConfig.acs_cfg.acs_mode = false;
+ if (pAdapter->sessionCtx.ap.sapConfig.acs_cfg.ch_list)
+ vos_mem_free(pAdapter->sessionCtx.ap.sapConfig.acs_cfg.ch_list);
+ vos_mem_zero(&pAdapter->sessionCtx.ap.sapConfig.acs_cfg,
+ sizeof(struct sap_acs_cfg));
+
hdd_hostapd_stop(dev);
old = pAdapter->sessionCtx.ap.beacon;
@@ -9894,8 +9728,9 @@ static int wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
default:
pAdapter->sessionCtx.ap.sapConfig.authType = eSAP_AUTO_SWITCH;
}
- pAdapter->sessionCtx.ap.sapConfig.vht_channel_width =
+ pAdapter->sessionCtx.ap.sapConfig.ch_width_orig =
params->chandef.width;
+
status = wlan_hdd_cfg80211_start_bss(pAdapter, &params->beacon, params->ssid,
params->ssid_len, params->hidden_ssid);
}
@@ -12375,9 +12210,7 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy,
/* Block All Scan during DFS operation and send null scan result */
con_sap_adapter = hdd_get_con_sap_adapter(pAdapter, true);
if (con_sap_adapter) {
- con_dfs_ch = con_sap_adapter->sessionCtx.ap.sapConfig.channel;
- if (con_dfs_ch == AUTO_CHANNEL_SELECT)
- con_dfs_ch = con_sap_adapter->sessionCtx.ap.operatingChannel;
+ con_dfs_ch = con_sap_adapter->sessionCtx.ap.operatingChannel;
if (VOS_IS_DFS_CH(con_dfs_ch)) {
/* Provide empty scan result during DFS operation since scanning
@@ -12768,7 +12601,7 @@ void hdd_select_cbmode(hdd_adapter_t *pAdapter, v_U8_t operationChannel)
{
v_U8_t iniDot11Mode =
(WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->dot11Mode;
- v_U32_t vht_channel_width =
+ uint16_t vht_channel_width =
(WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->vhtChannelWidth;
eHddDot11Mode hddDot11Mode = iniDot11Mode;
hddLog(LOG1, FL("Channel Bonding Mode Selected is %u"),
@@ -12796,7 +12629,8 @@ void hdd_select_cbmode(hdd_adapter_t *pAdapter, v_U8_t operationChannel)
sme_SelectCBMode((WLAN_HDD_GET_CTX(pAdapter)->hHal),
hdd_cfg_xlate_to_csr_phy_mode(hddDot11Mode),
operationChannel,
- &vht_channel_width);
+ &vht_channel_width,
+ vht_channel_width);
}
/**
diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c
index 78f8431300dc..6171a793b8b0 100644
--- a/CORE/HDD/src/wlan_hdd_hostapd.c
+++ b/CORE/HDD/src/wlan_hdd_hostapd.c
@@ -385,23 +385,6 @@ static int hdd_hostapd_driver_command(hdd_adapter_t *pAdapter,
{
hdd_setP2pOpps(pAdapter->dev, command);
}
- else if (strncmp(command, "SET_SAP_CHANNEL_LIST", 20) == 0)
- {
- /*
- * command should be a string having format
- * SET_SAP_CHANNEL_LIST <num channels> <channels separated by spaces>
- */
- hddLog(VOS_TRACE_LEVEL_INFO,
- "%s: Received Command to Set Preferred Channels for SAP",
- __func__);
-
-#ifdef WLAN_FEATURE_MBSSID
- ret = sapSetPreferredChannel(WLAN_HDD_GET_SAP_CTX_PTR(pAdapter),
- command);
-#else
- ret = sapSetPreferredChannel(command);
-#endif
- }
else if (strncmp(command, "MIRACAST", 8) == 0)
{
hddLog(VOS_TRACE_LEVEL_INFO, "%s: Received MIRACAST command", __func__);
@@ -1729,7 +1712,7 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa
hddLog(LOG1, FL("Received eSAP_CHANNEL_CHANGE_EVENT event"));
/* Prevent suspend for new channel */
hdd_hostapd_channel_prevent_suspend(pHostapdAdapter,
- pSapEvent->sapevt.sapChannelChange.operatingChannel);
+ pSapEvent->sapevt.sapChSelected.pri_ch);
/* Allow suspend for old channel */
hdd_hostapd_channel_allow_suspend(pHostapdAdapter,
pHddApCtx->operatingChannel);
@@ -1741,9 +1724,21 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa
* restiction
*/
pHddApCtx->operatingChannel =
- pSapEvent->sapevt.sapChannelChange.operatingChannel;
+ pSapEvent->sapevt.sapChSelected.pri_ch;
+ pHddApCtx->sapConfig.acs_cfg.pri_ch =
+ pSapEvent->sapevt.sapChSelected.pri_ch;
+ pHddApCtx->sapConfig.acs_cfg.ht_sec_ch =
+ pSapEvent->sapevt.sapChSelected.ht_sec_ch;
+ pHddApCtx->sapConfig.acs_cfg.vht_seg0_center_ch =
+ pSapEvent->sapevt.sapChSelected.vht_seg0_center_ch;
+ pHddApCtx->sapConfig.acs_cfg.vht_seg1_center_ch =
+ pSapEvent->sapevt.sapChSelected.vht_seg1_center_ch;
+ pHddApCtx->sapConfig.acs_cfg.ch_width =
+ pSapEvent->sapevt.sapChSelected.ch_width;
+
+ /* TODO Need to indicate operating channel change to hostapd */
return hdd_chan_change_notify(pHostapdAdapter, dev,
- pSapEvent->sapevt.sapChannelChange.operatingChannel);
+ pSapEvent->sapevt.sapChSelected.pri_ch);
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
case eSAP_ACS_SCAN_SUCCESS_EVENT:
pHddCtx->skip_acs_scan_status = eSAP_SKIP_ACS_SCAN;
@@ -1802,22 +1797,24 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa
return VOS_STATUS_E_FAILURE;
#endif
return VOS_STATUS_SUCCESS;
-#ifdef QCA_HT_2040_COEX
case eSAP_ACS_CHANNEL_SELECTED:
hddLog(LOG1, FL("ACS Completed for wlan%d"),
pHostapdAdapter->dev->ifindex);
clear_bit(ACS_PENDING, &pHostapdAdapter->event_flags);
clear_bit(ACS_IN_PROGRESS, &pHddCtx->g_event_flags);
- pHddApCtx->operatingChannel =
- pSapEvent->sapevt.sapAcsChSelected.pri_channel;
- pHddApCtx->secondaryChannel =
- pSapEvent->sapevt.sapAcsChSelected.sec_channel;
+ pHddApCtx->sapConfig.acs_cfg.pri_ch =
+ pSapEvent->sapevt.sapChSelected.pri_ch;
+ pHddApCtx->sapConfig.acs_cfg.ht_sec_ch =
+ pSapEvent->sapevt.sapChSelected.ht_sec_ch;
+ pHddApCtx->sapConfig.acs_cfg.vht_seg0_center_ch =
+ pSapEvent->sapevt.sapChSelected.vht_seg0_center_ch;
+ pHddApCtx->sapConfig.acs_cfg.vht_seg1_center_ch =
+ pSapEvent->sapevt.sapChSelected.vht_seg1_center_ch;
+ pHddApCtx->sapConfig.acs_cfg.ch_width =
+ pSapEvent->sapevt.sapChSelected.ch_width;
/* send vendor event to hostapd */
- wlan_hdd_cfg80211_acs_ch_select_evt(pHostapdAdapter,
- pSapEvent->sapevt.sapAcsChSelected.pri_channel,
- pSapEvent->sapevt.sapAcsChSelected.sec_channel);
+ wlan_hdd_cfg80211_acs_ch_select_evt(pHostapdAdapter);
return VOS_STATUS_SUCCESS;
-#endif
default:
hddLog(LOG1,"SAP message is not handled");
goto stopbss;
@@ -3827,47 +3824,6 @@ static iw_softap_get_stats(struct net_device *dev,
return ret;
}
-static int __iw_softap_set_channel_range(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
- tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter);
- hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-
- int *value = (int *)extra;
- int startChannel = value[0];
- int endChannel = value[1];
- int band = value[2];
- VOS_STATUS status;
- int ret = 0; /* success */
-
- status = WLANSAP_SetChannelRange(hHal,startChannel,endChannel,band);
- if(status != VOS_STATUS_SUCCESS)
- {
- hddLog( LOGE, FL("iw_softap_set_channel_range: startChannel = %d, endChannel = %d band = %d"),
- startChannel,endChannel, band);
- ret = -EINVAL;
- }
-
- pHddCtx->is_dynamic_channel_range_set = 1;
-
- return ret;
-}
-
-static int iw_softap_set_channel_range(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- int ret;
-
- vos_ssr_protect(__func__);
- ret = __iw_softap_set_channel_range(dev, info, wrqu, extra);
- vos_ssr_unprotect(__func__);
-
- return ret;
-}
-
static int __iw_softap_get_channel_list(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
@@ -5855,7 +5811,6 @@ static const iw_handler hostapd_private[] = {
[QCSAP_IOCTL_GET_STATS - SIOCIWFIRSTPRIV] = iw_softap_get_stats,
[QCSAP_IOCTL_PRIV_SET_THREE_INT_GET_NONE - SIOCIWFIRSTPRIV] = iw_set_three_ints_getnone,
[QCSAP_IOCTL_PRIV_SET_VAR_INT_GET_NONE - SIOCIWFIRSTPRIV] = iw_set_var_ints_getnone,
- [QCSAP_IOCTL_SET_CHANNEL_RANGE - SIOCIWFIRSTPRIV] = iw_softap_set_channel_range,
[QCSAP_IOCTL_MODIFY_ACL - SIOCIWFIRSTPRIV] = iw_softap_modify_acl,
[QCSAP_IOCTL_GET_CHANNEL_LIST - SIOCIWFIRSTPRIV] = iw_softap_get_channel_list,
[QCSAP_IOCTL_GET_STA_INFO - SIOCIWFIRSTPRIV] = iw_softap_get_sta_info,
@@ -6016,7 +5971,10 @@ VOS_STATUS hdd_init_ap_mode( hdd_adapter_t *pAdapter )
}
wlan_hdd_set_monitor_tx_adapter( WLAN_HDD_GET_CTX(pAdapter), pAdapter );
- pAdapter->sessionCtx.ap.sapConfig.acs_case = false;
+ pAdapter->sessionCtx.ap.sapConfig.acs_cfg.acs_mode = false;
+ vos_mem_free(pAdapter->sessionCtx.ap.sapConfig.acs_cfg.ch_list);
+ vos_mem_zero(&pAdapter->sessionCtx.ap.sapConfig.acs_cfg,
+ sizeof(struct sap_acs_cfg));
return status;
error_wmm_init:
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 7e8481de59ee..9aeb4715aa72 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -4319,23 +4319,6 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter,
}
}
- /*
- * Command should be a string having format
- * SET_SAP_CHANNEL_LIST <num of channels> <channels separated by spaces>
- */
- else if (strncmp(command, "SET_SAP_CHANNEL_LIST", 20) == 0)
- {
- tANI_U8 *ptr = command;
-
- VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
- " Received Command to Set Preferred Channels for SAP in %s", __func__);
-
-#ifdef WLAN_FEATURE_MBSSID
- ret = sapSetPreferredChannel(WLAN_HDD_GET_SAP_CTX_PTR(pAdapter), ptr);
-#else
- ret = sapSetPreferredChannel(ptr);
-#endif
- }
else if (strncmp(command, "SETSUSPENDMODE", 14) == 0)
{
}
@@ -8802,7 +8785,7 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type,
"STA-AP Mode DFS not supported. Restart SAP with Non DFS ACS"
);
ap_adapter->sessionCtx.ap.sapConfig.channel = AUTO_CHANNEL_SELECT;
- ap_adapter->sessionCtx.ap.sapConfig.acs_case = true;
+ ap_adapter->sessionCtx.ap.sapConfig.acs_cfg.acs_mode = true;
wlan_hdd_restart_sap(ap_adapter);
}
}
@@ -12965,28 +12948,28 @@ VOS_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *pHddCtx)
}
#ifdef FEATURE_WLAN_CH_AVOID
-/**---------------------------------------------------------------------------
-
- \brief hdd_find_prefd_safe_chnl() -
-
- Try to find safe channel within preferred channel
- In case auto channel selection enabled
- - Preferred and safe channel should be used
- - If no overlapping, preferred channel should be used
-
- \param - hdd_ctxt hdd context pointer
-
- \return - 1: found preferred safe channel
- 0: could not found preferred safe channel
+/**
+ * hdd_find_prefd_safe_chnl : Finds safe channel within preferred channel
+ * @hdd_ctxt: hdd context pointer
+ * @ap_adapter: hdd hostapd adapter pointer
+ *
+ * If auto channel selection enabled:
+ * Preferred and safe channel should be used
+ * If no overlapping, preferred channel should be used
+ *
+ * Return:
+ * 1: found preferred safe channel
+ * 0: could not found preferred safe channel
+ */
- --------------------------------------------------------------------------*/
-static v_U8_t hdd_find_prefd_safe_chnl(hdd_context_t *hdd_ctxt)
+static uint8_t hdd_find_prefd_safe_chnl(hdd_context_t *hdd_ctxt,
+ hdd_adapter_t *ap_adapter)
{
- v_U16_t safe_channels[NUM_20MHZ_RF_CHANNELS];
- v_U16_t safe_channel_count;
- v_U8_t is_unsafe = 1;
- v_U16_t i;
- v_U16_t channel_loop;
+ uint16_t safe_channels[NUM_20MHZ_RF_CHANNELS];
+ uint16_t safe_channel_count;
+ uint8_t is_unsafe = 1;
+ uint16_t i;
+ uint16_t channel_loop;
safe_channel_count = 0;
for (i = 0; i < NUM_20MHZ_RF_CHANNELS; i++) {
@@ -13010,11 +12993,13 @@ static v_U8_t hdd_find_prefd_safe_chnl(hdd_context_t *hdd_ctxt)
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH,
"perferred range %d - %d",
- hdd_ctxt->cfg_ini->apStartChannelNum,
- hdd_ctxt->cfg_ini->apEndChannelNum);
+ ap_adapter->sessionCtx.ap.sapConfig.acs_cfg.start_ch,
+ ap_adapter->sessionCtx.ap.sapConfig.acs_cfg.end_ch);
for (i = 0; i < safe_channel_count; i++) {
- if ((safe_channels[i] >= hdd_ctxt->cfg_ini->apStartChannelNum) &&
- (safe_channels[i] <= hdd_ctxt->cfg_ini->apEndChannelNum)) {
+ if ((safe_channels[i] >=
+ ap_adapter->sessionCtx.ap.sapConfig.acs_cfg.start_ch) &&
+ (safe_channels[i] <=
+ ap_adapter->sessionCtx.ap.sapConfig.acs_cfg.end_ch)) {
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH,
"safe channel %d is in perferred range", safe_channels[i]);
return 1;
@@ -13186,9 +13171,8 @@ void hdd_ch_avoid_cb
* do not re-start softap interface
* stay current operating channel.
*/
- if ((hostapd_adapter->sessionCtx.ap.sapConfig.
- apAutoChannelSelection) &&
- (!hdd_find_prefd_safe_chnl(hdd_ctxt)))
+ if ((hostapd_adapter->sessionCtx.ap.sapConfig.acs_cfg.acs_mode) &&
+ (!hdd_find_prefd_safe_chnl(hdd_ctxt, hostapd_adapter)))
return;
hddLog(LOG1, FL("Current operation channel %d"),
@@ -13202,7 +13186,8 @@ void hdd_ch_avoid_cb
channel_loop++) {
if (((hdd_ctxt->unsafe_channel_list[channel_loop] ==
hostapd_adapter->sessionCtx.ap.operatingChannel)) &&
- (hostapd_adapter->sessionCtx.ap.sapConfig.acs_case == true)
+ (hostapd_adapter->sessionCtx.ap.sapConfig.acs_cfg.acs_mode
+ == true)
&& !restart_sap_in_progress) {
hddLog(LOG1, FL("Restarting SAP"));
@@ -13713,8 +13698,7 @@ void wlan_hdd_check_sta_ap_concurrent_ch_intf(void *data)
hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(sta_adapter);
tHalHandle hHal;
hdd_ap_ctx_t *pHddApCtx;
- v_U16_t intf_ch = 0;
- v_U32_t vht_channel_width = 0;
+ uint16_t intf_ch = 0, vht_channel_width = 0;
if ((pHddCtx->cfg_ini->WlanMccToSccSwitchMode == VOS_MCC_TO_SCC_SWITCH_DISABLE)
|| !(vos_concurrent_open_sessions_running()
@@ -13748,7 +13732,7 @@ void wlan_hdd_check_sta_ap_concurrent_ch_intf(void *data)
sme_SelectCBMode(hHal,
pHddApCtx->sapConfig.SapHw_mode,
pHddApCtx->sapConfig.channel,
- &vht_channel_width);
+ &vht_channel_width, pHddApCtx->sapConfig.ch_width_orig);
#ifdef WLAN_FEATURE_MBSSID
wlan_sap_set_vht_ch_width(pHddApCtx->sapContext, vht_channel_width);
#else
diff --git a/CORE/HDD/src/wlan_hdd_scan.c b/CORE/HDD/src/wlan_hdd_scan.c
index 5b13cfa83298..9f6a6603bb4e 100644
--- a/CORE/HDD/src/wlan_hdd_scan.c
+++ b/CORE/HDD/src/wlan_hdd_scan.c
@@ -615,9 +615,7 @@ int iw_set_scan(struct net_device *dev, struct iw_request_info *info,
/* Block All Scan during DFS operation and send null scan result */
con_sap_adapter = hdd_get_con_sap_adapter(pAdapter, true);
if (con_sap_adapter) {
- con_dfs_ch = con_sap_adapter->sessionCtx.ap.sapConfig.channel;
- if (con_dfs_ch == AUTO_CHANNEL_SELECT)
- con_dfs_ch = con_sap_adapter->sessionCtx.ap.operatingChannel;
+ con_dfs_ch = con_sap_adapter->sessionCtx.ap.operatingChannel;
if (VOS_IS_DFS_CH(con_dfs_ch)) {
hddLog(LOGW, "%s:##In DFS Master mode. Scan aborted", __func__);
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index 741e70a2c529..ffffe1d90a4c 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -323,8 +323,7 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2},
/* Private ioctls and their sub-ioctls */
#define WLAN_PRIV_SET_THREE_INT_GET_NONE (SIOCIWFIRSTPRIV + 4)
#define WE_SET_WLAN_DBG 1
-/* 2 is unused */
-#define WE_SET_SAP_CHANNELS 3
+/* 2,3 is unused */
/* Private ioctls and their sub-ioctls */
#define WLAN_PRIV_GET_CHAR_SET_NONE (SIOCIWFIRSTPRIV + 5)
@@ -2989,30 +2988,6 @@ static int iw_get_rssi(struct net_device *dev,
return rc;
}
-/*
- * Support for SoftAP channel range private command
- */
-static int iw_softap_set_channel_range( struct net_device *dev,
- int startChannel,
- int endChannel,
- int band)
-{
- VOS_STATUS status;
- int ret = 0;
- hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
- tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter);
- hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-
- status = WLANSAP_SetChannelRange(hHal, startChannel, endChannel, band);
-
- if (VOS_STATUS_SUCCESS != status)
- {
- ret = -EINVAL;
- }
- pHddCtx->is_dynamic_channel_range_set = 1;
- return ret;
-}
-
VOS_STATUS wlan_hdd_enter_bmps(hdd_adapter_t *pAdapter, int mode)
{
struct statsContext context;
@@ -6794,10 +6769,6 @@ static int __iw_set_three_ints_getnone(struct net_device *dev,
vos_trace_setValue( value[1], value[2], value[3]);
break;
- case WE_SET_SAP_CHANNELS:
- ret = iw_softap_set_channel_range( dev, value[1], value[2], value[3]);
- break;
-
default:
hddLog(LOGE, "%s: Invalid IOCTL command %d", __func__, sub_cmd );
break;
@@ -10686,10 +10657,6 @@ static const struct iw_priv_args we_private_args[] = {
0,
"setwlandbg" },
- { WE_SET_SAP_CHANNELS,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3,
- 0,
- "setsapchannels" },
/* handlers for main ioctl */
{ WLAN_PRIV_SET_NONE_GET_THREE_INT,
0,
diff --git a/CORE/SAP/inc/sapApi.h b/CORE/SAP/inc/sapApi.h
index 4dab41b452d2..4e26ed2e7ba9 100644
--- a/CORE/SAP/inc/sapApi.h
+++ b/CORE/SAP/inc/sapApi.h
@@ -239,15 +239,6 @@ typedef enum {
eSAP_WPSPBC_ONE_WPSPBC_PROBE_REQ_IN120S, /* One WPS probe request in 120 second */
}eWPSPBCOverlap;
-typedef enum {
- eSAP_RF_SUBBAND_2_4_GHZ = 0,
- eSAP_RF_SUBBAND_5_LOW_GHZ = 1, //Low & Mid U-NII
- eSAP_RF_SUBBAND_5_MID_GHZ = 2, //ETSI
- eSAP_RF_SUBBAND_5_HIGH_GHZ = 3, //High U-NII
- eSAP_RF_SUBBAND_4_9_GHZ = 4,
- eSAP_RF_SUBBAND_5_ALL_GHZ = 5, //All 5 GHZ,
-}eSapOperatingBand;
-
/*----------------------------------------------------------------------------
* Typedefs
* -------------------------------------------------------------------------*/
@@ -384,19 +375,18 @@ typedef struct sap_MaxAssocExceededEvent_s {
v_MACADDR_t macaddr;
} tSap_MaxAssocExceededEvent;
-typedef struct sap_OperatingChannelChangeEvent_s {
- tANI_U8 operatingChannel;
-} tSap_OperatingChannelChangeEvent;
-
typedef struct sap_DfsNolInfo_s {
v_U16_t sDfsList; /* size of pDfsList in byte */
v_PVOID_t pDfsList; /* pointer to pDfsList buffer */
} tSap_DfsNolInfo;
-typedef struct sap_AcsChSelected_s {
- v_U8_t pri_channel;
- v_U8_t sec_channel;
-} tSap_AcsChSelectedEvent;
+typedef struct sap_ChSelected_s {
+ uint16_t pri_ch;
+ uint16_t ht_sec_ch;
+ uint16_t vht_seg0_center_ch;
+ uint16_t vht_seg1_center_ch;
+ uint16_t ch_width;
+} tSap_ChSelectedEvent;
/*
This struct will be filled in and passed to tpWLAN_SAPEventCB that is provided during WLANSAP_StartBss call
@@ -421,10 +411,9 @@ typedef struct sap_Event_s {
tSap_SendActionCnf sapActionCnf; /* eSAP_SEND_ACTION_CNF */
tSap_UnknownSTAJoinEvent sapUnknownSTAJoin; /* eSAP_UNKNOWN_STA_JOIN */
tSap_MaxAssocExceededEvent sapMaxAssocExceeded; /* eSAP_MAX_ASSOC_EXCEEDED */
- tSap_OperatingChannelChangeEvent sapChannelChange; /* eSAP_CHANNEL_CHANGE_EVENT */
tSap_DfsNolInfo sapDfsNolInfo; /*eSAP_DFS_NOL_XXX */
/*eSAP_ACS_CHANNEL_SELECTED */
- tSap_AcsChSelectedEvent sapAcsChSelected;
+ tSap_ChSelectedEvent sapChSelected;
} sapevt;
} tSap_Event, *tpSap_Event;
@@ -439,6 +428,31 @@ typedef __ani_attr_pre_packed struct sap_SSIDInfo {
v_U8_t ssidHidden; /*SSID shouldn't/should be broadcast in probe RSP and beacon*/
} __ani_attr_packed tSap_SSIDInfo_t;
+struct sap_acs_cfg {
+ /* ACS Algo Input */
+ uint8_t acs_mode;
+ uint32_t hw_mode;
+ uint8_t start_ch;
+ uint8_t end_ch;
+ uint8_t *ch_list;
+ uint8_t ch_list_count;
+#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
+ uint8_t skip_scan_status;
+ uint8_t skip_scan_range1_stch;
+ uint8_t skip_scan_range1_endch;
+ uint8_t skip_scan_range2_stch;
+ uint8_t skip_scan_range2_endch;
+#endif
+
+ uint16_t ch_width;
+ /* ACS Algo Output */
+ uint8_t pri_ch;
+ uint8_t ht_sec_ch;
+ uint8_t vht_seg0_center_ch;
+ uint8_t vht_seg1_center_ch;
+};
+
+
typedef struct sap_Config {
tSap_SSIDInfo_t SSIDinfo;
eCsrPhyMode SapHw_mode; /* Wireless Mode */
@@ -451,8 +465,8 @@ typedef struct sap_Config {
v_MACADDR_t self_macaddr; //self macaddress or BSSID
v_U8_t channel; /* Operation channel */
- v_U32_t vht_channel_width;
- v_U32_t vht_ch_width_orig;
+ uint16_t vht_channel_width;
+ uint16_t ch_width_orig;
v_U8_t max_num_sta; /* maximum number of STAs in station table */
v_U8_t dtim_period; /* dtim interval */
v_U8_t num_accept_mac;
@@ -480,23 +494,8 @@ typedef struct sap_Config {
v_U8_t disableDFSChSwitch;
eCsrBand scanBandPreference;
v_BOOL_t enOverLapCh;
- char acsAllowedChnls[MAX_CHANNEL_LIST_LEN];
v_U16_t acsBandSwitchThreshold;
- v_BOOL_t apAutoChannelSelection;
- v_U8_t apStartChannelNum;
- v_U8_t apEndChannelNum;
- v_U8_t apOperatingBand;
- v_U8_t acs_case;
- v_U8_t acs_ch_width;
- v_U32_t acs_hw_mode;
-#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
- v_U8_t skip_acs_scan_status;
- v_U8_t skip_acs_scan_range1_stch;
- v_U8_t skip_acs_scan_range1_endch;
- v_U8_t skip_acs_scan_range2_stch;
- v_U8_t skip_acs_scan_range2_endch;
-#endif
-
+ struct sap_acs_cfg acs_cfg;
#ifdef WLAN_FEATURE_11W
v_BOOL_t mfpRequired;
v_BOOL_t mfpCapable;
@@ -1278,33 +1277,6 @@ VOS_STATUS
WLANSAP_SetChannelChangeWithCsa(v_PVOID_t pvosGCtx, v_U32_t targetChannel);
/*==========================================================================
- FUNCTION WLANSAP_SetChannelRange
-
- DESCRIPTION
- This api function sets the range of channels for SoftAP.
-
- DEPENDENCIES
- NA.
-
- PARAMETERS
-
- IN
- startChannel : start channel
- endChannel : End channel
- operatingBand : Operating band (2.4GHz/5GHz)
-
- RETURN VALUE
- The VOS_STATUS code associated with performing the operation
-
- VOS_STATUS_SUCCESS: Success
-
- SIDE EFFECTS
-============================================================================*/
-VOS_STATUS
-WLANSAP_SetChannelRange(tHalHandle hHal,v_U8_t startChannel, v_U8_t endChannel,
- eSapOperatingBand operatingBand);
-
-/*==========================================================================
FUNCTION WLANSAP_SetKeySta
DESCRIPTION
@@ -2287,8 +2259,7 @@ RETURN VALUE NONE
SIDE EFFECTS
============================================================================*/
-v_VOID_t WLANSAP_extend_to_acs_range(v_U8_t operatingBand,
- v_U8_t *startChannelNum,
+v_VOID_t WLANSAP_extend_to_acs_range(v_U8_t *startChannelNum,
v_U8_t *endChannelNum,
v_U8_t *bandStartChannel,
v_U8_t *bandEndChannel);
diff --git a/CORE/SAP/src/sapApiLinkCntl.c b/CORE/SAP/src/sapApiLinkCntl.c
index c6317d8a6783..1a7f66a7dbd9 100644
--- a/CORE/SAP/src/sapApiLinkCntl.c
+++ b/CORE/SAP/src/sapApiLinkCntl.c
@@ -236,7 +236,8 @@ WLANSAP_ScanCallback
sme_SelectCBMode(halHandle,
psapContext->csrRoamProfile.phyMode,
- psapContext->channel, &psapContext->vht_channel_width);
+ psapContext->channel, &psapContext->vht_channel_width,
+ psapContext->ch_width_orig);
#ifdef SOFTAP_CHANNEL_RANGE
if(psapContext->channelList != NULL)
{
@@ -261,6 +262,63 @@ WLANSAP_ScanCallback
return sapstatus;
}// WLANSAP_ScanCallback
+/**
+ * sap_config_acs_result : Generate ACS result params based on ch constraints
+ * @sap_ctx: pointer to SAP context data struct
+ * @hal: HAL Handle pointer
+ *
+ * This function calculates the ACS result params: ht sec channel, vht channel
+ * information and channel bonding based on selected ACS channel.
+ *
+ * Return: None
+ */
+
+void sap_config_acs_result(tHalHandle hal, ptSapContext sap_ctx, uint32_t sec_ch)
+{
+ uint32_t channel = sap_ctx->acs_cfg->pri_ch;
+ uint8_t cb_mode = eCSR_INI_SINGLE_CHANNEL_CENTERED;
+
+ sap_ctx->acs_cfg->vht_seg0_center_ch = 0;
+ sap_ctx->acs_cfg->vht_seg1_center_ch = 0;
+ sap_ctx->acs_cfg->ht_sec_ch = 0;
+
+ cb_mode = sme_SelectCBMode(hal, sap_ctx->csrRoamProfile.phyMode,
+ channel, &sap_ctx->acs_cfg->ch_width,
+ sap_ctx->acs_cfg->ch_width);
+
+ if (sec_ch >= 5 && sec_ch <= 7) {
+ if (sec_ch > sap_ctx->acs_cfg->pri_ch)
+ cb_mode = eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
+ else
+ cb_mode = eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
+ }
+
+ if (cb_mode == eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY) {
+ sap_ctx->acs_cfg->ht_sec_ch = sap_ctx->acs_cfg->pri_ch + 4;
+ } else if (cb_mode == eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY) {
+ sap_ctx->acs_cfg->ht_sec_ch = sap_ctx->acs_cfg->pri_ch - 4;
+ } else if (cb_mode == eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW) {
+ sap_ctx->acs_cfg->ht_sec_ch = sap_ctx->acs_cfg->pri_ch + 4;
+ sap_ctx->acs_cfg->vht_seg0_center_ch = sap_ctx->acs_cfg->pri_ch
+ + 6;
+ } else if (cb_mode == eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW) {
+ sap_ctx->acs_cfg->ht_sec_ch = sap_ctx->acs_cfg->pri_ch - 4;
+ sap_ctx->acs_cfg->vht_seg0_center_ch = sap_ctx->acs_cfg->pri_ch
+ + 2;
+ } else if (cb_mode == eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH) {
+ sap_ctx->acs_cfg->ht_sec_ch = sap_ctx->acs_cfg->pri_ch + 4;
+ sap_ctx->acs_cfg->vht_seg0_center_ch = sap_ctx->acs_cfg->pri_ch
+ - 2;
+ } else if (cb_mode == eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH) {
+ sap_ctx->acs_cfg->ht_sec_ch = sap_ctx->acs_cfg->pri_ch - 4;
+ sap_ctx->acs_cfg->vht_seg0_center_ch = sap_ctx->acs_cfg->pri_ch
+ - 6;
+ }
+
+}
+
+
+
/*==========================================================================
FUNCTION WLANSAP_PreStartBssAcsScanCallback()
@@ -304,10 +362,6 @@ WLANSAP_PreStartBssAcsScanCallback
v_U8_t operChannel = 0;
VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE;
eHalStatus halStatus = eHAL_STATUS_FAILURE;
-#ifdef SOFTAP_CHANNEL_RANGE
- v_U32_t operatingBand;
-#endif
- tpAniSirGlobal pMac = PMAC_STRUCT(halHandle);
if ( eCSR_SCAN_SUCCESS == scanStatus)
{
@@ -413,52 +467,8 @@ WLANSAP_PreStartBssAcsScanCallback
* Valid Channel Found from scan results.
*/
psapContext->channel = operChannel;
- }
-
- sme_SelectCBMode(halHandle,
- psapContext->csrRoamProfile.phyMode,
- psapContext->channel,
- &psapContext->vht_channel_width);
-
- /* determine secondary channel for 11n / 11ac mode */
- if ((eCSR_DOT11_MODE_11n == psapContext->csrRoamProfile.phyMode) ||
- (eCSR_DOT11_MODE_11n_ONLY == psapContext->csrRoamProfile.phyMode)
-#ifdef WLAN_FEATURE_11AC
- || (eCSR_DOT11_MODE_11ac == psapContext->csrRoamProfile.phyMode) ||
- (eCSR_DOT11_MODE_11ac_ONLY == psapContext->csrRoamProfile.phyMode)
-#endif
- ) {
- ePhyChanBondState cbMode;
-
- if (psapContext->channel > 14)
- cbMode = pMac->roam.configParam.channelBondingMode5GHz;
- else
- cbMode = pMac->roam.configParam.channelBondingMode24GHz;
-
- switch (cbMode) {
- case PHY_DOUBLE_CHANNEL_LOW_PRIMARY:
-#ifdef WLAN_FEATURE_11AC
- case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW:
- case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
-#endif
- psapContext->secondary_ch = psapContext->channel + 4;
- break;
- case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY:
-#ifdef WLAN_FEATURE_11AC
- case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
- case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
-#endif
- psapContext->secondary_ch = psapContext->channel - 4;
- break;
- case PHY_SINGLE_CHANNEL_CENTERED:
- default:
- psapContext->secondary_ch = 0;
- break;
- }
-
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
- FL("psapContext->secondary_ch=%d"),
- psapContext->secondary_ch);
+ sap_config_acs_result(halHandle, psapContext,
+ psapContext->acs_cfg->ht_sec_ch);
}
#ifdef SOFTAP_CHANNEL_RANGE
@@ -492,16 +502,10 @@ WLANSAP_PreStartBssAcsScanCallback
FL("CSR scanStatus = %s (%d), choose default channel"),
"eCSR_SCAN_ABORT/FAILURE", scanStatus );
#ifdef SOFTAP_CHANNEL_RANGE
- /*
- * if scan failed, select default channel in the
- * BAND(2.4GHz/5GHZ)
- */
- ccmCfgGetInt( halHandle, WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND,
- &operatingBand);
- if(eSAP_RF_SUBBAND_2_4_GHZ == operatingBand )
- psapContext->channel = SAP_DEFAULT_24GHZ_CHANNEL;
- else
+ if(psapContext->acs_cfg->hw_mode == eCSR_DOT11_MODE_11a)
psapContext->channel = SAP_DEFAULT_5GHZ_CHANNEL;
+ else
+ psapContext->channel = SAP_DEFAULT_24GHZ_CHANNEL;
#else
psapContext->channel = SAP_DEFAULT_24GHZ_CHANNEL;
#endif
@@ -1113,7 +1117,8 @@ WLANSAP_RoamCallback
{
sme_SelectCBMode(hHal, phyMode,
pMac->sap.SapDfsInfo.target_channel,
- &sapContext->vht_channel_width);
+ &sapContext->vht_channel_width,
+ sapContext->ch_width_orig);
}
/*
diff --git a/CORE/SAP/src/sapChSelect.c b/CORE/SAP/src/sapChSelect.c
index 31721ec79869..e6273fa5a86f 100644
--- a/CORE/SAP/src/sapChSelect.c
+++ b/CORE/SAP/src/sapChSelect.c
@@ -87,6 +87,18 @@
((extRssi < rssi)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
)
+#define SET_ACS_BAND(acs_band, pSapCtx) \
+{ \
+ if (pSapCtx->acs_cfg->hw_mode == eCSR_DOT11_MODE_11n || \
+ pSapCtx->acs_cfg->hw_mode == eCSR_DOT11_MODE_11ac) { \
+ if (pSapCtx->acs_cfg->start_ch <= 14 && \
+ pSapCtx->acs_cfg->end_ch <= 14) \
+ acs_band = eCSR_DOT11_MODE_11g; \
+ else \
+ acs_band = eCSR_DOT11_MODE_11a;\
+ } \
+}
+
#ifdef FEATURE_WLAN_CH_AVOID
sapSafeChannelType safeChannels[NUM_20MHZ_RF_CHANNELS] =
{
@@ -179,12 +191,6 @@ sapAcsChannelInfo acsHT40Channels24G[ ] = {
{9, ACS_WEIGHT_MAX},
};
-typedef enum {
- CHWIDTH_HT20,
- CHWIDTH_HT40,
- CHWIDTH_HT80,
-} eChannelWidthInfo;
-
#define CHANNEL_165 165
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
@@ -514,207 +520,6 @@ void sapCleanupChannelList
}
/*==========================================================================
- FUNCTION sapSetPreferredChannel
-
- DESCRIPTION
- Function sapSetPreferredChannel sets the channel list which has been configured
- into sap context (pSapCtx) which will be used at the time of best channel selection.
-
- DEPENDENCIES
- NA.
-
- PARAMETERS
-
- IN
- *ptr: pointer having the command followed by the arguments in string format
-
- RETURN VALUE
- int: return 0 when success else returns error code.
-============================================================================*/
-
-int sapSetPreferredChannel
-(
-#ifdef WLAN_FEATURE_MBSSID
- v_PVOID_t pvosGCtx,
-#endif
- tANI_U8* ptr
-)
-{
-#ifndef WLAN_FEATURE_MBSSID
- v_PVOID_t pvosGCtx = vos_get_global_context(VOS_MODULE_ID_SAP, NULL);
-#endif
- ptSapContext pSapCtx;
- tANI_U8* param;
- int tempInt;
- int j;
-
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
- "Enter: %s", __func__);
-
- if (NULL == pvosGCtx)
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_FATAL,
- "SAP Global Context is NULL");
- return -EINVAL;
- }
-
- pSapCtx = VOS_GET_SAP_CB(pvosGCtx);
- if (NULL == pSapCtx)
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_FATAL,
- "SAP Context is NULL");
- return -EINVAL;
- }
-
- if (NULL != pSapCtx->SapChnlList.channelList)
- {
-#ifdef WLAN_FEATURE_MBSSID
- sapCleanupChannelList(pSapCtx);
-#else
- sapCleanupChannelList();
-#endif
- }
-
- param = strchr(ptr, ' ');
- /*no argument after the command*/
- if (NULL == param)
- {
- return -EINVAL;
- }
-
- /*no space after the command*/
- else if (SPACE_ASCII_VALUE != *param)
- {
- return -EINVAL;
- }
-
- param++;
-
- /*removing empty spaces*/
- while((SPACE_ASCII_VALUE == *param)&& ('\0' != *param) ) param++;
-
- /*no argument followed by spaces*/
- if('\0' == *param)
- {
- return -EINVAL;
- }
-
- /*getting the first argument ie the number of channels*/
- if (sscanf(param, "%d ", &tempInt) != 1)
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "%s: Cannot get number of channels from input", __func__);
- return -EINVAL;
- }
-
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
- "%s: Number of channel added are: %d", __func__, tempInt);
-
- if (tempInt <= 0 || tempInt > 255)
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "%s: Invalid Number of channel received", __func__);
- return -EINVAL;
- }
-
- /*allocating space for the desired number of channels*/
- pSapCtx->SapChnlList.channelList = (v_U8_t *)vos_mem_malloc(tempInt);
-
- if (NULL == pSapCtx->SapChnlList.channelList)
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "In %s, VOS_MALLOC_ERR", __func__);
- return -EINVAL;
- }
-
- pSapCtx->SapChnlList.numChannel = tempInt;
- for(j=0;j<pSapCtx->SapChnlList.numChannel;j++)
- {
-
- /*param pointing to the beginning of first space after number of channels*/
- param = strpbrk( param, " " );
- /*no channel list after the number of channels argument*/
- if (NULL == param)
- {
-#ifdef WLAN_FEATURE_MBSSID
- sapCleanupChannelList(pSapCtx);
-#else
- sapCleanupChannelList();
-#endif
- return -EINVAL;
- }
-
- param++;
-
- /*removing empty space*/
- while((SPACE_ASCII_VALUE == *param) && ('\0' != *param) ) param++;
-
- /*no channel list after the number of channels argument and spaces*/
- if( '\0' == *param )
- {
-#ifdef WLAN_FEATURE_MBSSID
- sapCleanupChannelList(pSapCtx);
-#else
- sapCleanupChannelList();
-#endif
- return -EINVAL;
- }
-
- if (sscanf(param, "%d ", &tempInt) != 1)
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "%s: Cannot read channel number", __func__);
-#ifdef WLAN_FEATURE_MBSSID
- sapCleanupChannelList(pSapCtx);
-#else
- sapCleanupChannelList();
-#endif
- return -EINVAL;
- }
- if (tempInt < 0 || tempInt > 255)
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "%s: Invalid channel number received", __func__);
-#ifdef WLAN_FEATURE_MBSSID
- sapCleanupChannelList(pSapCtx);
-#else
- sapCleanupChannelList();
-#endif
- return -EINVAL;
- }
-
- pSapCtx->SapChnlList.channelList[j] = tempInt;
-
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
- "%s: Channel %d added to preferred channel list",
- __func__, pSapCtx->SapChnlList.channelList[j] );
-
- }
-
- /*extra arguments check*/
- param = strpbrk( param, " " );
- if (NULL != param)
- {
- while((SPACE_ASCII_VALUE == *param) && ('\0' != *param) ) param++;
-
- if('\0' != *param)
- {
-#ifdef WLAN_FEATURE_MBSSID
- sapCleanupChannelList(pSapCtx);
-#else
- sapCleanupChannelList();
-#endif
- return -EINVAL;
- }
- }
-
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
- "Exit: %s", __func__);
-
- return 0;
-}
-
-/*==========================================================================
FUNCTION sapSelectPreferredChannelFromChannelList
DESCRIPTION
@@ -744,9 +549,8 @@ v_U8_t sapSelectPreferredChannelFromChannelList(v_U8_t bestChNum,
//If Channel List is not Configured don't do anything
//Else return the Best Channel from the Channel List
- if((NULL == pSapCtx->SapChnlList.channelList) ||
- (NULL == pSpectInfoParams) ||
- (0 == pSapCtx->SapChnlList.numChannel))
+ if((NULL == pSapCtx->acs_cfg->ch_list) ||
+ (NULL == pSpectInfoParams))
{
return bestChNum;
}
@@ -757,9 +561,9 @@ v_U8_t sapSelectPreferredChannelFromChannelList(v_U8_t bestChNum,
{
bestChNum = (v_U8_t)pSpectInfoParams->pSpectCh[count].chNum;
// Select the best channel from allowed list
- for(j=0;j< pSapCtx->SapChnlList.numChannel;j++)
+ for(j=0;j < pSapCtx->acs_cfg->ch_list_count;j++)
{
- if( (pSapCtx->SapChnlList.channelList[j]) == bestChNum)
+ if( (pSapCtx->acs_cfg->ch_list[j]) == bestChNum)
{
VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
"Best channel computed from Channel List is: %d",
@@ -1718,14 +1522,15 @@ void sapInterferenceRssiCount(tSapSpectChInfo *pSpectCh)
pSpectInfoParams : Pointer to the tSpectInfoParams structure
halHandle : Pointer to HAL handle
pResult : Pointer to tScanResultHandle
-
+ sap_ctx : Pointer to Sap context
RETURN VALUE
void : NULL
SIDE EFFECTS
============================================================================*/
void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams,
- tHalHandle halHandle, tScanResultHandle pResult)
+ tHalHandle halHandle, tScanResultHandle pResult,
+ ptSapContext sap_ctx)
{
v_S7_t rssi = 0;
v_U8_t chn_num = 0;
@@ -1754,7 +1559,7 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams,
/**
* Soft AP specific channel weight calculation using DFS formula
*/
- ccmCfgGetInt( halHandle, WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND, &operatingBand);
+ SET_ACS_BAND(operatingBand, sap_ctx);
pScanResult = sme_ScanResultGetFirst(halHandle, pResult);
@@ -2018,7 +1823,7 @@ void sapComputeSpectWeight( tSapChSelSpectInfo* pSpectInfoParams,
break;
}
}
- else if(operatingBand == eSAP_RF_SUBBAND_2_4_GHZ)
+ else if(operatingBand == eCSR_DOT11_MODE_11g)
{
sapInterferenceRssiCount(pSpectCh);
}
@@ -2453,7 +2258,6 @@ void sapSortChlWeightHT40_5G(tSapChSelSpectInfo *pSpectInfoParams)
============================================================================*/
void sapSortChlWeightAll(ptSapContext pSapCtx,
tSapChSelSpectInfo *pSpectInfoParams,
- eChannelWidthInfo chWidth,
v_U32_t operatingBand)
{
tSapSpectChInfo *pSpectCh = NULL;
@@ -2465,20 +2269,20 @@ void sapSortChlWeightAll(ptSapContext pSapCtx,
pSpectCh = pSpectInfoParams->pSpectCh;
#ifdef SOFTAP_CHANNEL_RANGE
- switch (chWidth)
+ switch (pSapCtx->acs_cfg->ch_width)
{
- case CHWIDTH_HT40:
- if (eSAP_RF_SUBBAND_2_4_GHZ == operatingBand)
- sapSortChlWeightHT40_24G(pSpectInfoParams);
- else
+ case eHT_CHANNEL_WIDTH_40MHZ:
+ if (eCSR_DOT11_MODE_11a == operatingBand)
sapSortChlWeightHT40_5G(pSpectInfoParams);
+ else
+ sapSortChlWeightHT40_24G(pSpectInfoParams);
break;
- case CHWIDTH_HT80:
+ case eHT_CHANNEL_WIDTH_80MHZ:
sapSortChlWeightHT80(pSpectInfoParams);
break;
- case CHWIDTH_HT20:
+ case eHT_CHANNEL_WIDTH_20MHZ:
default:
/* Sorting the channels as per weights as 20MHz channels */
sapSortChlWeight(pSpectInfoParams);
@@ -2586,7 +2390,6 @@ v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResult
v_U32_t operatingBand = 0;
v_U32_t tmpChNum;
v_U8_t count;
- eChannelWidthInfo chWidth;
#endif
VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, Running SAP Ch Select", __func__);
@@ -2603,25 +2406,10 @@ v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResult
return bestChNum;
#else
//scan is successfull, but no AP is present
- switch (pSapCtx->scanBandPreference)
- {
- case eCSR_BAND_24:
- startChannelNum = 1;
- endChannelNum = 11;
- break;
-
- case eCSR_BAND_5G:
- startChannelNum = 36;
- endChannelNum = 165;
- break;
-
- case eCSR_BAND_ALL:
- default:
- ccmCfgGetInt( halHandle, WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL, &startChannelNum);
- ccmCfgGetInt( halHandle, WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL, &endChannelNum);
- }
+ startChannelNum = pSapCtx->acs_cfg->start_ch;
+ endChannelNum = pSapCtx->acs_cfg->end_ch;
- VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
+ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
"%s: start - end: %d - %d\n", __func__,
startChannelNum, endChannelNum);
@@ -2665,7 +2453,7 @@ v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResult
}
// Compute the weight of the entire spectrum in the operating band
- sapComputeSpectWeight( pSpectInfoParams, halHandle, pScanResult);
+ sapComputeSpectWeight( pSpectInfoParams, halHandle, pScanResult, pSapCtx);
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
/* process avoid channel IE to collect all channels to avoid */
@@ -2675,12 +2463,9 @@ v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResult
#ifdef SOFTAP_CHANNEL_RANGE
if (eCSR_BAND_ALL == pSapCtx->scanBandPreference)
{
- ccmCfgGetInt( halHandle, WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL,
- &startChannelNum);
- ccmCfgGetInt( halHandle, WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL,
- &endChannelNum);
- ccmCfgGetInt( halHandle, WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND,
- &operatingBand);
+ startChannelNum = pSapCtx->acs_cfg->start_ch;
+ endChannelNum = pSapCtx->acs_cfg->end_ch;
+ SET_ACS_BAND(operatingBand, pSapCtx);
}
else
{
@@ -2688,31 +2473,21 @@ v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResult
{
startChannelNum = rfChannels[RF_CHAN_1].channelNum;
endChannelNum = rfChannels[RF_CHAN_14].channelNum;
- operatingBand = eSAP_RF_SUBBAND_2_4_GHZ;
+ operatingBand = eCSR_DOT11_MODE_11g;
}
else
{
startChannelNum = rfChannels[RF_CHAN_36].channelNum;
endChannelNum = rfChannels[RF_CHAN_165].channelNum;
- operatingBand = eSAP_RF_SUBBAND_5_ALL_GHZ;
+ operatingBand = eCSR_DOT11_MODE_11a;
}
}
pSapCtx->acsBestChannelInfo.channelNum = 0;
pSapCtx->acsBestChannelInfo.weight = CFG_ACS_BAND_SWITCH_THRESHOLD_MAX;
- /* find the channel width info */
- if (pSapCtx->acs_ch_width == 80)
- chWidth = CHWIDTH_HT80;
- else if (pSapCtx->acs_ch_width == 40)
- chWidth = CHWIDTH_HT40;
- else
- chWidth = CHWIDTH_HT20;
-
- VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
- "In %s, chWidth=%u", __func__, chWidth);
/* Sort the channel list as per the computed weights, lesser weight first.*/
- sapSortChlWeightAll(pSapCtx, pSpectInfoParams, chWidth, operatingBand);
+ sapSortChlWeightAll(pSapCtx, pSpectInfoParams, operatingBand);
/*Loop till get the best channel in the given range */
for (count=0; count < pSpectInfoParams->numSpectChans ; count++)
@@ -2775,7 +2550,7 @@ v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResult
if (bestChNum != SAP_CHANNEL_NOT_SELECTED)
{
- if (operatingBand == RF_SUBBAND_2_4_GHZ)
+ if (operatingBand == eCSR_DOT11_MODE_11g)
{
/* Give preference to Non-overlap channels */
if (sapFilterOverLapCh(pSapCtx,
@@ -2806,47 +2581,37 @@ v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResult
pSapCtx, pSpectInfoParams);
#endif
+ pSapCtx->acs_cfg->pri_ch = bestChNum;
/* determine secondary channel for 2.4G channel 5, 6, 7 in HT40 */
- if ((operatingBand == RF_SUBBAND_2_4_GHZ) && (chWidth == CHWIDTH_HT40)) {
- tSmeConfigParams *pSmeConfig;
- pSmeConfig = vos_mem_malloc(sizeof(*pSmeConfig));
- if (NULL != pSmeConfig) {
- sme_GetConfigParam(halHandle, pSmeConfig);
+ if ((operatingBand == eCSR_DOT11_MODE_11g) && (pSapCtx->acs_cfg->ch_width ==
+ eHT_CHANNEL_WIDTH_40MHZ)) {
if ((bestChNum >= 5) && (bestChNum <= 7)) {
int weight_below, weight_above, i;
tSapSpectChInfo *pSpectInfo;
- weight_below = weight_above = ACS_WEIGHT_MAX;
+ weight_below = weight_above = ACS_WEIGHT_MAX;
pSpectInfo = pSpectInfoParams->pSpectCh;
for (i = 0; i < pSpectInfoParams->numSpectChans ; i++) {
- if (pSpectInfo[i].chNum == (bestChNum - 4))
+ if (pSpectInfo[i].chNum == (bestChNum - 4))
weight_below = pSpectInfo[i].weight;
- if (pSpectInfo[i].chNum == (bestChNum + 4))
- weight_above = pSpectInfo[i].weight;
- }
+ if (pSpectInfo[i].chNum == (bestChNum + 4))
+ weight_above = pSpectInfo[i].weight;
+ }
- if (weight_below < weight_above)
- pSmeConfig->csrConfig.channelBondingMode24GHz =
- eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
- else
- pSmeConfig->csrConfig.channelBondingMode24GHz =
- eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
- } else {
- if (bestChNum >= 1 && bestChNum <= 5)
- pSmeConfig->csrConfig.channelBondingMode24GHz =
- eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
- else if (bestChNum >= 6 && bestChNum <= 13)
- pSmeConfig->csrConfig.channelBondingMode24GHz =
- eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
- else if (bestChNum ==14)
- pSmeConfig->csrConfig.channelBondingMode24GHz =
- eCSR_INI_SINGLE_CHANNEL_CENTERED;
- }
- sme_UpdateConfig(halHandle, pSmeConfig);
- vos_mem_free(pSmeConfig);
+ if (weight_below < weight_above)
+ pSapCtx->acs_cfg->ht_sec_ch = pSapCtx->acs_cfg->pri_ch - 4;
+ else
+ pSapCtx->acs_cfg->ht_sec_ch = pSapCtx->acs_cfg->pri_ch + 4;
+ } else {
+ if (bestChNum >= 1 && bestChNum <= 4)
+ pSapCtx->acs_cfg->ht_sec_ch = pSapCtx->acs_cfg->pri_ch + 4;
+ else if (bestChNum >= 8 && bestChNum <= 13)
+ pSapCtx->acs_cfg->ht_sec_ch = pSapCtx->acs_cfg->pri_ch - 4;
+ else if (bestChNum ==14)
+ pSapCtx->acs_cfg->ht_sec_ch = 0;
}
}
diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c
index e7fff13a4b85..979bca4b8337 100644
--- a/CORE/SAP/src/sapFsm.c
+++ b/CORE/SAP/src/sapFsm.c
@@ -1369,10 +1369,14 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
* use the stored original value when you call this function next time
* so fall back mechanism always starts with original ini value.
*/
+
if (pMac->sap.SapDfsInfo.orig_cbMode == 0)
{
- pMac->sap.SapDfsInfo.orig_cbMode =
- pMac->roam.configParam.channelBondingMode5GHz;
+ pMac->sap.SapDfsInfo.orig_cbMode = sme_SelectCBMode(hHal,
+ sapContext->csrRoamProfile.phyMode,
+ sapContext->channel,
+ &sapContext->vht_channel_width,
+ sapContext->ch_width_orig);
cbModeCurrent = pMac->sap.SapDfsInfo.orig_cbMode;
}
else
@@ -1388,7 +1392,7 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
if (pMac->sap.SapDfsInfo.orig_chanWidth == 0)
{
pMac->sap.SapDfsInfo.orig_chanWidth =
- sapContext->vht_ch_width_orig;
+ sapContext->ch_width_orig;
chanWidth = pMac->sap.SapDfsInfo.orig_chanWidth;
}
else
@@ -1700,14 +1704,21 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
v_BOOL_t
sapAcsChannelCheck(ptSapContext sapContext, v_U8_t channelNumber)
{
- if (!sapContext->apAutoChannelSelection)
+ int i = 0;
+ if (!sapContext->acs_cfg->acs_mode)
return VOS_FALSE;
- if ((channelNumber < sapContext->apStartChannelNum) ||
- (channelNumber > sapContext->apEndChannelNum))
- return VOS_TRUE;
-
- return VOS_FALSE;
+ if ((channelNumber >= sapContext->acs_cfg->start_ch) ||
+ (channelNumber <= sapContext->acs_cfg->end_ch)) {
+ if (!sapContext->acs_cfg->ch_list) {
+ return VOS_FALSE;
+ } else {
+ for (i = 0; i < sapContext->acs_cfg->ch_list_count; i++)
+ if (channelNumber == sapContext->acs_cfg->ch_list[i])
+ return VOS_FALSE;
+ }
+ }
+ return VOS_TRUE;
}
/*
@@ -2102,7 +2113,8 @@ sapGotoChannelSel
Else take whatever comes from configuartion*/
sapContext->channel = channel;
sme_SelectCBMode(hHal, sapContext->csrRoamProfile.phyMode,
- channel, &sapContext->vht_channel_width);
+ channel, &sapContext->vht_channel_width,
+ sapContext->ch_width_orig);
}
#endif
}
@@ -2111,9 +2123,9 @@ sapGotoChannelSel
{
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
- "%s skip_acs_status = %d ", __func__,
- sapContext->skip_acs_scan_status);
- if (sapContext->skip_acs_scan_status != eSAP_SKIP_ACS_SCAN) {
+ "%s acs_cfg->skip_status = %d ", __func__,
+ sapContext->acs_cfg->skip_scan_status);
+ if (sapContext->acs_cfg->skip_scan_status != eSAP_SKIP_ACS_SCAN) {
#endif
vos_mem_zero(&scanRequest, sizeof(scanRequest));
@@ -2159,7 +2171,7 @@ sapGotoChannelSel
VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
"In %s, calling sme_ScanRequest", __func__);
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
- if (sapContext->skip_acs_scan_status == eSAP_DO_NEW_ACS_SCAN) {
+ if (sapContext->acs_cfg->skip_scan_status == eSAP_DO_NEW_ACS_SCAN) {
#endif
sme_ScanFlushResult(hHal, sapContext->sessionId);
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
@@ -2240,10 +2252,10 @@ sapGotoChannelSel
}
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
} else
- sapContext->skip_acs_scan_status = eSAP_SKIP_ACS_SCAN;
+ sapContext->acs_cfg->skip_scan_status = eSAP_SKIP_ACS_SCAN;
}
- if (sapContext->skip_acs_scan_status == eSAP_SKIP_ACS_SCAN) {
+ if (sapContext->acs_cfg->skip_scan_status == eSAP_SKIP_ACS_SCAN) {
VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
"## %s SKIPPED ACS SCAN", __func__);
if (VOS_TRUE == sapDoAcsPreStartBss)
@@ -2652,15 +2664,20 @@ sapSignalHDDevent
sapApAppEvent.sapHddEventCode = sapHddevent;
if ( eSAP_STATUS_SUCCESS == (eSapStatus )context)
{
- sapApAppEvent.sapevt.sapAcsChSelected.pri_channel =
- sapContext->channel;
- sapApAppEvent.sapevt.sapAcsChSelected.sec_channel =
- sapContext->secondary_ch;
+ sapApAppEvent.sapevt.sapChSelected.pri_ch =
+ sapContext->acs_cfg->pri_ch;
+ sapApAppEvent.sapevt.sapChSelected.ht_sec_ch =
+ sapContext->acs_cfg->ht_sec_ch;
+ sapApAppEvent.sapevt.sapChSelected.ch_width =
+ sapContext->acs_cfg->ch_width;
+ sapApAppEvent.sapevt.sapChSelected.vht_seg0_center_ch =
+ sapContext->acs_cfg->vht_seg0_center_ch;
+ sapApAppEvent.sapevt.sapChSelected.vht_seg1_center_ch =
+ sapContext->acs_cfg->vht_seg1_center_ch;
}
else if (eSAP_STATUS_FAILURE == (eSapStatus )context)
{
- sapApAppEvent.sapevt.sapAcsChSelected.pri_channel = 0;
- sapApAppEvent.sapevt.sapAcsChSelected.sec_channel = 0;
+ sapApAppEvent.sapevt.sapChSelected.pri_ch = 0;
}
break;
@@ -2869,9 +2886,24 @@ sapSignalHDDevent
VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
"In %s, SAP event callback event = %s",
__func__, "eSAP_CHANNEL_CHANGE_EVENT");
+ /* Reconfig ACS result info. For DFS AP-AP Mode Sec AP ACS
+ * follows pri AP
+ */
+ sapContext->acs_cfg->pri_ch = sapContext->channel;
+ sapContext->acs_cfg->ch_width = sapContext->vht_channel_width;
+ sap_config_acs_result(hHal, sapContext, 0);
+
sapApAppEvent.sapHddEventCode = eSAP_CHANNEL_CHANGE_EVENT;
- sapApAppEvent.sapevt.sapChannelChange.operatingChannel =
- pMac->sap.SapDfsInfo.target_channel;
+ sapApAppEvent.sapevt.sapChSelected.pri_ch =
+ sapContext->acs_cfg->pri_ch;
+ sapApAppEvent.sapevt.sapChSelected.ht_sec_ch =
+ sapContext->acs_cfg->ht_sec_ch;
+ sapApAppEvent.sapevt.sapChSelected.ch_width =
+ sapContext->acs_cfg->ch_width;
+ sapApAppEvent.sapevt.sapChSelected.vht_seg0_center_ch =
+ sapContext->acs_cfg->vht_seg0_center_ch;
+ sapApAppEvent.sapevt.sapChSelected.vht_seg1_center_ch =
+ sapContext->acs_cfg->vht_seg1_center_ch;
break;
case eSAP_DFS_NOL_GET:
@@ -3395,21 +3427,15 @@ sapFsm
"%s: Override Chosen Ch:%d to %d due to CC Intf!!",
__func__,sapContext->channel, con_ch);
sapContext->channel = con_ch;
- sme_SelectCBMode(hHal,
- sapContext->csrRoamProfile.phyMode,
- sapContext->channel,
- &sapContext->vht_channel_width);
- }
+ }
}
#endif
- /* get the bonding mode */
- if (sapContext->channel <= 14)
- cbMode = sme_GetCBPhyStateFromCBIniValue(
- sme_GetChannelBondingMode24G(hHal));
- else
- cbMode = sme_GetCBPhyStateFromCBIniValue(
- sme_GetChannelBondingMode5G(hHal));
+ cbMode = sme_SelectCBMode(hHal,
+ sapContext->csrRoamProfile.phyMode,
+ sapContext->channel,
+ &sapContext->vht_channel_width,
+ sapContext->ch_width_orig);
#ifdef WLAN_ENABLE_CHNL_MATRIX_RESTRICTION
temp_chan = sapContext->channel;
@@ -3448,7 +3474,8 @@ sapFsm
sapContext->channel = ch;
sme_SelectCBMode(hHal, sapContext->csrRoamProfile.phyMode,
sapContext->channel,
- &sapContext->vht_channel_width);
+ &sapContext->vht_channel_width,
+ sapContext->ch_width_orig);
}
if (sapContext->channel > 14 &&
(sapContext->csrRoamProfile.phyMode ==
@@ -3485,17 +3512,13 @@ sapFsm
VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
"%s: notify hostapd about channel selection: %d",
__func__, sapContext->channel);
- if (sapContext->apAutoChannelSelection &&
+ if (sapContext->acs_cfg->acs_mode &&
(sapContext->csrRoamProfile.phyMode ==
eCSR_DOT11_MODE_11n ||
sapContext->csrRoamProfile.phyMode ==
eCSR_DOT11_MODE_11n_ONLY)) {
- tSap_Event sapApAppEvent;
- sapApAppEvent.sapHddEventCode = eSAP_CHANNEL_CHANGE_EVENT;
- sapApAppEvent.sapevt.sapChannelChange.operatingChannel =
- sapContext->channel;
- (*sapContext->pfnSapEventCallback) (&sapApAppEvent,
- sapContext->pUsrContext);
+ sapSignalHDDevent(sapContext, NULL, eSAP_CHANNEL_CHANGE_EVENT,
+ (v_PVOID_t) eSAP_STATUS_SUCCESS);
}
vosStatus = sapGotoStarting( sapContext, sapEvent, eCSR_BSS_TYPE_INFRA_AP);
}
@@ -3546,7 +3569,8 @@ sapFsm
{
sme_SelectCBMode(hHal, phyMode,
pMac->sap.SapDfsInfo.target_channel,
- &sapContext->vht_channel_width);
+ &sapContext->vht_channel_width,
+ sapContext->ch_width_orig);
}
for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++)
@@ -3708,8 +3732,7 @@ sapFsm
/* The operating channel has changed, update hostapd */
sapContext->channel =
(tANI_U8)pMac->sap.SapDfsInfo.target_channel;
-
- sapContext->sapsMachine = eSAP_STARTED;
+ sapContext->sapsMachine = eSAP_STARTED;
VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
"In %s, from state %s => %s",
@@ -4219,9 +4242,6 @@ sapIsPeerMacAllowed(ptSapContext sapContext, v_U8_t *peerMac)
static VOS_STATUS sapGetChannelList(ptSapContext sapContext,
v_U8_t **channelList, v_U8_t *numberOfChannels)
{
- v_U32_t cfg_startChannelNum;
- v_U32_t cfg_endChannelNum;
- v_U32_t operatingBand;
v_U8_t loopCount;
v_U8_t *list;
v_U8_t channelCount;
@@ -4245,22 +4265,19 @@ static VOS_STATUS sapGetChannelList(ptSapContext sapContext,
if ( eCSR_BAND_ALL == sapContext->scanBandPreference)
{
- ccmCfgGetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL, &cfg_startChannelNum);
- ccmCfgGetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL, &cfg_endChannelNum);
- ccmCfgGetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND, &operatingBand);
-
+ startChannelNum = sapContext->acs_cfg->start_ch;
+ endChannelNum = sapContext->acs_cfg->end_ch;
VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
- "%s: startChannel %d,EndChannel %d,Operatingband:%d",
- __func__,startChannelNum,endChannelNum,operatingBand);
+ "%s: startChannel %d, EndChannel %d, HW:%d",
+ __func__, startChannelNum, endChannelNum,
+ sapContext->acs_cfg->hw_mode);
- startChannelNum = cfg_startChannelNum;
- endChannelNum = cfg_endChannelNum;
- WLANSAP_extend_to_acs_range(operatingBand, &startChannelNum, &endChannelNum,
- &bandStartChannel, &bandEndChannel);
+ WLANSAP_extend_to_acs_range(&startChannelNum, &endChannelNum,
+ &bandStartChannel, &bandEndChannel);
VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
- "%s: expanded startChannel %d,EndChannel %d,Operatingband:%d",
- __func__,startChannelNum,endChannelNum,operatingBand);
+ "%s: expanded startChannel %d,EndChannel %d",
+ __func__,startChannelNum,endChannelNum);
}
else
{
@@ -4350,12 +4367,12 @@ static VOS_STATUS sapGetChannelList(ptSapContext sapContext,
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
v_U8_t ch;
ch = rfChannels[loopCount].channelNum;
- if ((sapContext->skip_acs_scan_status
+ if ((sapContext->acs_cfg->skip_scan_status
== eSAP_DO_PAR_ACS_SCAN)) {
- if ((ch >= sapContext->skip_acs_scan_range1_stch &&
- ch <= sapContext->skip_acs_scan_range1_endch) ||
- (ch >= sapContext->skip_acs_scan_range2_stch &&
- ch <= sapContext->skip_acs_scan_range2_endch)) {
+ if ((ch >= sapContext->acs_cfg->skip_scan_range1_stch &&
+ ch <= sapContext->acs_cfg->skip_scan_range1_endch) ||
+ (ch >= sapContext->acs_cfg->skip_scan_range2_stch &&
+ ch <= sapContext->acs_cfg->skip_scan_range2_endch)) {
list[channelCount] =
rfChannels[loopCount].channelNum;
diff --git a/CORE/SAP/src/sapInternal.h b/CORE/SAP/src/sapInternal.h
index 7e8a4035b589..8c63c97517d8 100644
--- a/CORE/SAP/src/sapInternal.h
+++ b/CORE/SAP/src/sapInternal.h
@@ -252,8 +252,8 @@ typedef struct sSapContext {
v_U8_t pStaAddIE[MAX_ASSOC_IND_IE_LEN];
v_U8_t *channelList;
tSapChannelListInfo SapChnlList;
- v_U32_t vht_channel_width;
- v_U32_t vht_ch_width_orig;
+ uint16_t vht_channel_width;
+ uint16_t ch_width_orig;
// session to scan
tANI_BOOLEAN isScanSessionOpen;
@@ -273,21 +273,11 @@ typedef struct sSapContext {
v_U16_t acsBandSwitchThreshold;
tSapAcsChannelInfo acsBestChannelInfo;
tANI_BOOLEAN enableOverLapCh;
- v_BOOL_t apAutoChannelSelection;
- v_U8_t apStartChannelNum;
- v_U8_t apEndChannelNum;
- v_U8_t acs_case;
- uint8_t acs_ch_width;
+
+ struct sap_acs_cfg *acs_cfg;
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
v_U8_t cc_switch_mode;
#endif
-#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
- v_U8_t skip_acs_scan_status;
- v_U8_t skip_acs_scan_range1_stch;
- v_U8_t skip_acs_scan_range1_endch;
- v_U8_t skip_acs_scan_range2_stch;
- v_U8_t skip_acs_scan_range2_endch;
-#endif
#if defined(FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE) ||\
defined(WLAN_FEATURE_MBSSID)
@@ -1080,6 +1070,9 @@ SIDE EFFECTS
---------------------------------------------------------------------------*/
v_BOOL_t sapDfsIsChannelInPreferredLocation(tHalHandle hHal, v_U8_t channelID);
+void sap_config_acs_result(tHalHandle hal, ptSapContext sap_ctx,
+ uint32_t sec_ch);
+
#ifdef __cplusplus
}
#endif
diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c
index a0da29585e71..617e771570a2 100644
--- a/CORE/SAP/src/sapModule.c
+++ b/CORE/SAP/src/sapModule.c
@@ -680,7 +680,6 @@ WLANSAP_SetScanAcsChannelParams(tsap_Config_t *pConfig,
{
tHalHandle hHal = NULL;
tANI_BOOLEAN restartNeeded;
- int ret;
if (NULL == pConfig)
{
@@ -704,33 +703,7 @@ WLANSAP_SetScanAcsChannelParams(tsap_Config_t *pConfig,
pSapCtx->scanBandPreference = pConfig->scanBandPreference;
pSapCtx->acsBandSwitchThreshold = pConfig->acsBandSwitchThreshold;
pSapCtx->pUsrContext = pUsrContext;
- pSapCtx->apAutoChannelSelection = VOS_TRUE;
- pSapCtx->apStartChannelNum = pConfig->apStartChannelNum;
- pSapCtx->apEndChannelNum = pConfig->apEndChannelNum;
- pSapCtx->vht_channel_width = pConfig->vht_channel_width;
- pSapCtx->acs_ch_width = pConfig->acs_ch_width;
-#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
- pSapCtx->skip_acs_scan_status = pConfig->skip_acs_scan_status;
- pSapCtx->skip_acs_scan_range1_endch = pConfig->skip_acs_scan_range1_endch;
- pSapCtx->skip_acs_scan_range1_stch = pConfig->skip_acs_scan_range1_stch;
- pSapCtx->skip_acs_scan_range2_endch = pConfig->skip_acs_scan_range2_endch;
- pSapCtx->skip_acs_scan_range2_stch = pConfig->skip_acs_scan_range2_stch;
-#endif
pSapCtx->enableOverLapCh = pConfig->enOverLapCh;
- if (strlen(pConfig->acsAllowedChnls) > 0)
- {
-#ifdef WLAN_FEATURE_MBSSID
- ret = sapSetPreferredChannel(pSapCtx, pConfig->acsAllowedChnls);
-#else
- ret = sapSetPreferredChannel(pConfig->acsAllowedChnls);
-#endif
- if (0 != ret)
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
- "%s: ACS set preferred channel failed!", __func__);
- return VOS_STATUS_E_FAULT;
- }
- }
/*
* Set the BSSID to your "self MAC Addr" read
* the mac address from Configuation ITEM received
@@ -817,7 +790,6 @@ WLANSAP_StartBss
tANI_BOOLEAN restartNeeded;
tHalHandle hHal;
tpAniSirGlobal pmac = NULL;
- int ret;
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
@@ -843,39 +815,15 @@ WLANSAP_StartBss
/* Channel selection is auto or configured */
pSapCtx->channel = pConfig->channel;
pSapCtx->vht_channel_width = pConfig->vht_channel_width;
- pSapCtx->vht_ch_width_orig = pConfig->vht_ch_width_orig;
+ pSapCtx->ch_width_orig = pConfig->ch_width_orig;
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
pSapCtx->cc_switch_mode = pConfig->cc_switch_mode;
#endif
pSapCtx->scanBandPreference = pConfig->scanBandPreference;
pSapCtx->acsBandSwitchThreshold = pConfig->acsBandSwitchThreshold;
pSapCtx->pUsrContext = pUsrContext;
- pSapCtx->apAutoChannelSelection = pConfig->apAutoChannelSelection;
- pSapCtx->apStartChannelNum = pConfig->apStartChannelNum;
- pSapCtx->apEndChannelNum = pConfig->apEndChannelNum;
- pSapCtx->acs_case = pConfig->acs_case;
- pSapCtx->acs_ch_width = pConfig->acs_ch_width;
-#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
- pSapCtx->skip_acs_scan_status = pConfig->skip_acs_scan_status;
- pSapCtx->skip_acs_scan_range1_endch = pConfig->skip_acs_scan_range1_endch;
- pSapCtx->skip_acs_scan_range1_stch = pConfig->skip_acs_scan_range1_stch;
- pSapCtx->skip_acs_scan_range2_endch = pConfig->skip_acs_scan_range2_endch;
- pSapCtx->skip_acs_scan_range2_stch = pConfig->skip_acs_scan_range2_stch;
-#endif
pSapCtx->enableOverLapCh = pConfig->enOverLapCh;
- if (strlen(pConfig->acsAllowedChnls) > 0)
- {
-#ifdef WLAN_FEATURE_MBSSID
- ret = sapSetPreferredChannel(pSapCtx, pConfig->acsAllowedChnls);
-#else
- ret = sapSetPreferredChannel(pConfig->acsAllowedChnls);
-#endif
- if (0 != ret)
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
- "%s: ACS set preferred channel failed!", __func__);
- }
- }
+ pSapCtx->acs_cfg = &pConfig->acs_cfg;
//Set the BSSID to your "self MAC Addr" read the mac address from Configuation ITEM received from HDD
pSapCtx->csrRoamProfile.BSSIDs.numOfBSSIDs = 1;
@@ -1802,7 +1750,7 @@ WLANSAP_SetChannelChangeWithCsa(v_PVOID_t pvosGCtx, v_U32_t targetChannel)
*/
pMac->sap.SapDfsInfo.target_channel = targetChannel;
pMac->sap.SapDfsInfo.new_chanWidth =
- sapContext->vht_ch_width_orig;
+ sapContext->ch_width_orig;
/*
* Set the CSA IE required flag.
@@ -1862,187 +1810,6 @@ WLANSAP_SetChannelChangeWithCsa(v_PVOID_t pvosGCtx, v_U32_t targetChannel)
}
/*==========================================================================
- FUNCTION WLANSAP_SetChannelRange
-
- DESCRIPTION
- This api function sets the range of channels for AP.
-
- DEPENDENCIES
- NA.
-
- PARAMETERS
-
- IN
- startChannel : start channel
- endChannel : End channel
- operatingBand : Operating band (2.4GHz/5GHz)
-
- RETURN VALUE
- The VOS_STATUS code associated with performing the operation
-
- VOS_STATUS_SUCCESS: Success
-
- SIDE EFFECTS
-============================================================================*/
-VOS_STATUS
-WLANSAP_SetChannelRange(tHalHandle hHal,v_U8_t startChannel, v_U8_t endChannel,
- eSapOperatingBand operatingBand)
-{
-
- v_U8_t validChannelFlag =0;
- v_U8_t loopStartCount =0;
- v_U8_t loopEndCount =0;
- v_U8_t bandStartChannel =0;
- v_U8_t bandEndChannel =0;
-
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
- "WLANSAP_SetChannelRange:startChannel %d,EndChannel %d,Operatingband:%d",
- startChannel,endChannel,operatingBand);
-
- /*------------------------------------------------------------------------
- Sanity check
- ------------------------------------------------------------------------*/
- if (( WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_STAMIN > operatingBand) ||
- (WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND_STAMAX < operatingBand))
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "Invalid operatingBand on WLANSAP_SetChannelRange");
- return VOS_STATUS_E_FAULT;
- }
- if (( WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_STAMIN > startChannel) ||
- (WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL_STAMAX < startChannel))
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "Invalid startChannel value on WLANSAP_SetChannelRange");
- return VOS_STATUS_E_FAULT;
- }
- if (( WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_STAMIN > endChannel) ||
- (WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL_STAMAX < endChannel))
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "Invalid endChannel value on WLANSAP_SetChannelRange");
- return VOS_STATUS_E_FAULT;
- }
- switch(operatingBand)
- {
- case eSAP_RF_SUBBAND_2_4_GHZ:
- bandStartChannel = RF_CHAN_1;
- bandEndChannel = RF_CHAN_14;
- break;
-
- case eSAP_RF_SUBBAND_5_LOW_GHZ:
- bandStartChannel = RF_CHAN_36;
- bandEndChannel = RF_CHAN_64;
- break;
-
- case eSAP_RF_SUBBAND_5_MID_GHZ:
- bandStartChannel = RF_CHAN_100;
-#ifndef FEATURE_WLAN_CH144
- bandEndChannel = RF_CHAN_140;
-#else
- bandEndChannel = RF_CHAN_144;
-#endif /* FEATURE_WLAN_CH144 */
- break;
-
- case eSAP_RF_SUBBAND_5_HIGH_GHZ:
- bandStartChannel = RF_CHAN_149;
- bandEndChannel = RF_CHAN_165;
- break;
-
- case eSAP_RF_SUBBAND_5_ALL_GHZ:
- bandStartChannel = RF_CHAN_36;
- bandEndChannel = RF_CHAN_165;
- break;
-
- default:
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "Invalid operatingBand value on WLANSAP_SetChannelRange");
- break;
- }
-
- /* Validating the start channel is in range or not*/
- for(loopStartCount = bandStartChannel ; loopStartCount <= bandEndChannel ;
- loopStartCount++)
- {
- if(rfChannels[loopStartCount].channelNum == startChannel )
- {
- /* start channel is in the range */
- break;
- }
- }
- /* Validating the End channel is in range or not*/
- for(loopEndCount = bandStartChannel ; loopEndCount <= bandEndChannel ;
- loopEndCount++)
- {
- if(rfChannels[loopEndCount].channelNum == endChannel )
- {
- /* End channel is in the range */
- break;
- }
- }
- if((loopStartCount > bandEndChannel)||(loopEndCount > bandEndChannel))
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "%s: Invalid startChannel-%d or EndChannel-%d for band -%d",
- __func__,startChannel,endChannel,operatingBand);
- /* Supplied channels are nt in the operating band so set the default
- channels for the given operating band */
- startChannel = rfChannels[bandStartChannel].channelNum;
- endChannel = rfChannels[bandEndChannel].channelNum;
- }
-
- /*Search for the Active channels in the given range */
- for( loopStartCount = bandStartChannel; loopStartCount <= bandEndChannel; loopStartCount++ )
- {
- if((startChannel <= rfChannels[loopStartCount].channelNum)&&
- (endChannel >= rfChannels[loopStartCount].channelNum ))
- {
- if( regChannels[loopStartCount].enabled )
- {
- validChannelFlag = 1;
- break;
- }
- }
- }
- if(0 == validChannelFlag)
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "%s-No active channels present in the given range for the current region",
- __func__);
- /* There is no active channel in the supplied range.Updating the config
- with the default channels in the given band so that we can select the best channel in the sub-band*/
- startChannel = rfChannels[bandStartChannel].channelNum;
- endChannel = rfChannels[bandEndChannel].channelNum;
- }
-
- if (ccmCfgSetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND,
- operatingBand, NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE)
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "Could not pass on WNI_CFG_SAP_CHANNEL_SELECT_OPERATING_BAND to CCn");
- return VOS_STATUS_E_FAULT;
- }
- if (ccmCfgSetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL,
- startChannel, NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE)
- {
-
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "Could not pass on WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL to CCM");
- return VOS_STATUS_E_FAULT;
-
- }
- if (ccmCfgSetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL,
- endChannel, NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE)
- {
-
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "Could not pass on WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL to CCM");
- return VOS_STATUS_E_FAULT;
- }
- return VOS_STATUS_SUCCESS;
-}
-
-/*==========================================================================
FUNCTION WLANSAP_SetCounterMeasure
DESCRIPTION
@@ -3038,7 +2805,7 @@ WLANSAP_ChannelChangeRequest(v_PVOID_t pSapCtx, tANI_U8 tArgetChannel)
tpAniSirGlobal pMac = NULL;
eCsrPhyMode phyMode;
tANI_U32 cbMode;
- tANI_U32 vhtChannelWidth;
+ uint16_t vhtChannelWidth;
sapContext = (ptSapContext)pSapCtx;
if ( NULL == sapContext )
@@ -3065,7 +2832,8 @@ WLANSAP_ChannelChangeRequest(v_PVOID_t pSapCtx, tANI_U8 tArgetChannel)
*/
cbMode = pMac->sap.SapDfsInfo.new_cbMode;
vhtChannelWidth = pMac->sap.SapDfsInfo.new_chanWidth;
- sme_SelectCBMode(hHal, phyMode, tArgetChannel, &vhtChannelWidth);
+ sme_SelectCBMode(hHal, phyMode, tArgetChannel, &vhtChannelWidth,
+ sapContext->ch_width_orig);
sapContext->csrRoamProfile.vht_channel_width = vhtChannelWidth;
sapContext->vht_channel_width = vhtChannelWidth;
halStatus = sme_RoamChannelChangeReq(hHal, sapContext->bssid,
@@ -3177,8 +2945,8 @@ WLANSAP_DfsSendCSAIeRequest(v_PVOID_t pSapCtx)
eHalStatus halStatus = eHAL_STATUS_FAILURE;
v_PVOID_t hHal = NULL;
tpAniSirGlobal pMac = NULL;
- u_int32_t cbmode, vht_ch_width;
- u_int8_t ch_bandwidth;
+ uint16_t cbmode, vht_ch_width;
+ uint8_t ch_bandwidth;
sapContext = (ptSapContext)pSapCtx;
@@ -3200,14 +2968,11 @@ WLANSAP_DfsSendCSAIeRequest(v_PVOID_t pSapCtx)
pMac = PMAC_STRUCT( hHal );
vht_ch_width = pMac->sap.SapDfsInfo.new_chanWidth;
- sme_SelectCBMode(hHal,
+ cbmode = sme_SelectCBMode(hHal,
sapContext->csrRoamProfile.phyMode,
pMac->sap.SapDfsInfo.target_channel,
- &vht_ch_width);
+ &vht_ch_width, sapContext->ch_width_orig);
- cbmode = (pMac->sap.SapDfsInfo.target_channel <= 14) ?
- pMac->roam.configParam.channelBondingMode24GHz :
- pMac->roam.configParam.channelBondingMode5GHz;
if (pMac->sap.SapDfsInfo.target_channel <= 14 ||
vht_ch_width == eHT_CHANNEL_WIDTH_40MHZ ||
vht_ch_width == eHT_CHANNEL_WIDTH_20MHZ)
@@ -3690,8 +3455,7 @@ RETURN VALUE NONE
SIDE EFFECTS
============================================================================*/
-v_VOID_t WLANSAP_extend_to_acs_range(v_U8_t operatingBand,
- v_U8_t *startChannelNum,
+v_VOID_t WLANSAP_extend_to_acs_range(v_U8_t *startChannelNum,
v_U8_t *endChannelNum,
v_U8_t *bandStartChannel,
v_U8_t *bandEndChannel)
@@ -3702,70 +3466,20 @@ v_VOID_t WLANSAP_extend_to_acs_range(v_U8_t operatingBand,
v_U8_t tmp_startChannelNum = 0, tmp_endChannelNum = 0;
- switch(operatingBand)
- {
- case eSAP_RF_SUBBAND_2_4_GHZ:
+ if (*startChannelNum <= 14) {
*bandStartChannel = RF_CHAN_1;
*bandEndChannel = RF_CHAN_14;
tmp_startChannelNum = *startChannelNum > 5 ?
(*startChannelNum - ACS_2G_EXTEND): 1;
tmp_endChannelNum = (*endChannelNum + ACS_2G_EXTEND) <= 14 ?
(*endChannelNum + ACS_2G_EXTEND):14;
- break;
-
- case eSAP_RF_SUBBAND_5_LOW_GHZ:
- *bandStartChannel = RF_CHAN_36;
- *bandEndChannel = RF_CHAN_64;
- tmp_startChannelNum = (*startChannelNum - ACS_5G_EXTEND) > 36 ?
- (*startChannelNum - ACS_5G_EXTEND):36;
- tmp_endChannelNum = (*endChannelNum + ACS_5G_EXTEND) <= 64?
- (*endChannelNum + ACS_5G_EXTEND):64;
- break;
-
- case eSAP_RF_SUBBAND_5_MID_GHZ:
- *bandStartChannel = RF_CHAN_100;
- tmp_startChannelNum = (*startChannelNum - ACS_5G_EXTEND) > 100 ?
- (*startChannelNum - ACS_5G_EXTEND):100;
-#ifndef FEATURE_WLAN_CH144
- *bandEndChannel = RF_CHAN_140;
- tmp_endChannelNum = (*endChannelNum + ACS_5G_EXTEND) <= 140 ?
- (*endChannelNum + ACS_5G_EXTEND):140;
-#else
- *bandEndChannel = RF_CHAN_144;
- tmp_endChannelNum = (*endChannelNum + ACS_5G_EXTEND) <= 144 ?
- (*endChannelNum + ACS_5G_EXTEND):144;
-#endif /* FEATURE_WLAN_CH144 */
- break;
-
- case eSAP_RF_SUBBAND_5_HIGH_GHZ:
- *bandStartChannel = RF_CHAN_149;
- *bandEndChannel = RF_CHAN_165;
- tmp_startChannelNum = (*startChannelNum - ACS_5G_EXTEND) > 149 ?
- (*startChannelNum - ACS_5G_EXTEND):149;
- tmp_endChannelNum = (*endChannelNum + ACS_5G_EXTEND) <= 165 ?
- (*endChannelNum + ACS_5G_EXTEND):165;
- break;
-
- case eSAP_RF_SUBBAND_5_ALL_GHZ:
+ } else {
*bandStartChannel = RF_CHAN_36;
*bandEndChannel = RF_CHAN_165;
tmp_startChannelNum = (*startChannelNum - ACS_5G_EXTEND) > 36 ?
(*startChannelNum - ACS_5G_EXTEND):36;
tmp_endChannelNum = (*endChannelNum + ACS_5G_EXTEND) <= 165 ?
(*endChannelNum + ACS_5G_EXTEND):165;
- break;
-
- default:
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "sapGetChannelList:OperatingBand not valid ");
- /* assume 2.4 GHz */
- *bandStartChannel = RF_CHAN_1;
- *bandEndChannel = RF_CHAN_14;
- tmp_startChannelNum = *startChannelNum > 5 ?
- (*startChannelNum - ACS_2G_EXTEND): 1;
- tmp_endChannelNum = (*endChannelNum + ACS_2G_EXTEND) <= 14 ?
- (*endChannelNum + ACS_2G_EXTEND):14;
- break;
}
/* Note if the ACS range include only DFS channels, do not cross the range.
@@ -4123,11 +3837,10 @@ WLANSAP_ACS_CHSelect(v_PVOID_t pvosGCtx,
sapContext->sessionId = 0xff;
pMac = PMAC_STRUCT( hHal );
+ sapContext->acs_cfg = &pConfig->acs_cfg;
+ sapContext->csrRoamProfile.phyMode = sapContext->acs_cfg->hw_mode;
- sapContext->csrRoamProfile.phyMode = pConfig->acs_hw_mode;
-
- if ((pConfig->channel == AUTO_CHANNEL_SELECT) &&
- (sapContext->isScanSessionOpen == eSAP_FALSE)) {
+ if (sapContext->isScanSessionOpen == eSAP_FALSE) {
tANI_U32 type, subType;
if(VOS_STATUS_SUCCESS ==
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index 0e7dc9c9359e..5235b53bcb30 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -3473,8 +3473,9 @@ eCsrPhyMode sme_GetPhyMode(tHalHandle hHal);
/*
* SME API to determine the channel bonding mode
*/
-VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode,
- tANI_U8 channel, tANI_U32 *vht_channel_width);
+eIniChanBondState sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode,
+ uint8_t channel, uint16_t *vht_channel_width,
+ uint16_t ch_width_orig);
#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
/*--------------------------------------------------------------------------
@@ -3605,7 +3606,6 @@ VOS_STATUS sme_notify_ht2040_mode(tHalHandle hHal, tANI_U16 staId,
v_MACADDR_t macAddrSTA, v_U8_t sessionId, tANI_U8 channel_type);
eHalStatus sme_SetHT2040Mode(tHalHandle hHal, tANI_U8 sessionId,
tANI_U8 channel_type, tANI_BOOLEAN obssEnabled);
-eHalStatus sme_SetPhyCBMode24G(tHalHandle hHal, ePhyChanBondState phyCBMode);
#endif
eHalStatus sme_getRegInfo(tHalHandle hHal, tANI_U8 chanId,
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index e3d4daa3ae81..fd4a973f4607 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -11854,7 +11854,7 @@ static const char* sme_CBMode2String( tANI_U32 mode)
*/
static VOS_STATUS sme_AdjustCBMode(tAniSirGlobal* pMac,
tSmeConfigParams *smeConfig,
- tANI_U8 channel, tANI_U32 *vht_channel_width)
+ uint8_t channel, uint16_t *vht_channel_width)
{
const tANI_U8 step = 4;
@@ -12004,154 +12004,102 @@ static VOS_STATUS sme_AdjustCBMode(tAniSirGlobal* pMac,
/*
* SME API to determine the channel bonding mode
*/
-VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode,
- tANI_U8 channel, tANI_U32 *vht_channel_width)
+eIniChanBondState sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode,
+ uint8_t channel, uint16_t *vht_channel_width,
+ uint16_t ch_width_orig)
{
tSmeConfigParams smeConfig;
tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
-
- if (
-#ifdef WLAN_FEATURE_11AC
- eCSR_DOT11_MODE_11ac != eCsrPhyMode &&
- eCSR_DOT11_MODE_11ac_ONLY != eCsrPhyMode &&
-#endif
- eCSR_DOT11_MODE_11n != eCsrPhyMode &&
- eCSR_DOT11_MODE_11n_ONLY != eCsrPhyMode &&
-
- eCSR_DOT11_MODE_11a != eCsrPhyMode &&
- eCSR_DOT11_MODE_11b != eCsrPhyMode &&
- eCSR_DOT11_MODE_11g != eCsrPhyMode &&
-
- eCSR_DOT11_MODE_abg != eCsrPhyMode
- )
- {
- VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
- "%s: Incorrect PhyMode, CB mode is not selected", __func__);
- *vht_channel_width = eHT_CHANNEL_WIDTH_20MHZ;
- return VOS_STATUS_SUCCESS;
- }
-
- /* If channel bonding mode is not required */
- if ( !pMac->roam.configParam.channelBondingMode5GHz
- && !pMac->roam.configParam.channelBondingMode24GHz) {
- *vht_channel_width = eHT_CHANNEL_WIDTH_20MHZ;
- return VOS_STATUS_SUCCESS;
- }
-
+ eIniChanBondState cb_mode = eCSR_INI_SINGLE_CHANNEL_CENTERED;
+ /* Donot check pMac->roam.configParam.channelBondingMode5GHz / 24GHz
+ * Doing so results in circular reference
+ */
VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
- "%s: channel - %d, channel_width - %d\n", __func__, channel,
- *vht_channel_width);
+ "%s: HW: %d CH: %d ORIG_BW: %d\n", __func__, eCsrPhyMode,
+ channel, ch_width_orig);
+
+ *vht_channel_width = ch_width_orig;
vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams));
sme_GetConfigParam(pMac, &smeConfig);
if ((eCSR_DOT11_MODE_11ac == eCsrPhyMode ||
eCSR_DOT11_MODE_11ac_ONLY == eCsrPhyMode) &&
- (eHT_CHANNEL_WIDTH_80MHZ == *vht_channel_width)) {
- if (pMac->roam.configParam.channelBondingMode5GHz) {
- if (channel== 36 || channel == 52 || channel == 100 ||
+ (eHT_CHANNEL_WIDTH_80MHZ == ch_width_orig)) {
+ if (channel== 36 || channel == 52 || channel == 100 ||
channel == 116 || channel == 149) {
- smeConfig.csrConfig.channelBondingMode5GHz =
+ smeConfig.csrConfig.channelBondingMode5GHz =
eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
- } else if (channel == 40 || channel == 56 || channel == 104 ||
+ } else if (channel == 40 || channel == 56 || channel == 104 ||
channel == 120 || channel == 153) {
- smeConfig.csrConfig.channelBondingMode5GHz =
+ smeConfig.csrConfig.channelBondingMode5GHz =
eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW;
- } else if (channel == 44 || channel == 60 || channel == 108 ||
+ } else if (channel == 44 || channel == 60 || channel == 108 ||
channel == 124 || channel == 157) {
- smeConfig.csrConfig.channelBondingMode5GHz =
+ smeConfig.csrConfig.channelBondingMode5GHz =
eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH;
- } else if (channel == 48 || channel == 64 || channel == 112 ||
+ } else if (channel == 48 || channel == 64 || channel == 112 ||
channel == 128 || channel == 144 || channel == 161) {
- smeConfig.csrConfig.channelBondingMode5GHz =
+ smeConfig.csrConfig.channelBondingMode5GHz =
eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH;
- } else if (channel == 165 || channel == 140) {
- smeConfig.csrConfig.channelBondingMode5GHz =
- eCSR_INI_SINGLE_CHANNEL_CENTERED;
- *vht_channel_width = eHT_CHANNEL_WIDTH_20MHZ;
- } else if (channel == 132) {
- smeConfig.csrConfig.channelBondingMode5GHz =
+ } else if (channel == 165 || channel == 140) {
+ smeConfig.csrConfig.channelBondingMode5GHz =
+ eCSR_INI_SINGLE_CHANNEL_CENTERED;
+ *vht_channel_width = eHT_CHANNEL_WIDTH_20MHZ;
+ } else if (channel == 132) {
+ smeConfig.csrConfig.channelBondingMode5GHz =
eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
- *vht_channel_width = eHT_CHANNEL_WIDTH_40MHZ;
- } else if (channel == 136) {
- smeConfig.csrConfig.channelBondingMode5GHz =
+ *vht_channel_width = eHT_CHANNEL_WIDTH_40MHZ;
+ } else if (channel == 136) {
+ smeConfig.csrConfig.channelBondingMode5GHz =
eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
- *vht_channel_width = eHT_CHANNEL_WIDTH_40MHZ;
- }
- } else {
- *vht_channel_width = eHT_CHANNEL_WIDTH_20MHZ;
- }
-
- /*TODO: Set HT40+ / HT40- for channel 5-7 based on ACS */
- if (pMac->roam.configParam.channelBondingMode24GHz) {
- if (channel >= 1 && channel <= 5)
- smeConfig.csrConfig.channelBondingMode24GHz =
+ *vht_channel_width = eHT_CHANNEL_WIDTH_40MHZ;
+ } else if (channel >= 1 && channel <= 5) {
+ smeConfig.csrConfig.channelBondingMode24GHz =
eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
- else if (channel >= 6 && channel <= 13)
- smeConfig.csrConfig.channelBondingMode24GHz =
+ *vht_channel_width = eHT_CHANNEL_WIDTH_40MHZ;
+ } else if (channel >= 6 && channel <= 13) {
+ smeConfig.csrConfig.channelBondingMode24GHz =
eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
- else if (channel ==14)
- smeConfig.csrConfig.channelBondingMode24GHz =
+ *vht_channel_width = eHT_CHANNEL_WIDTH_40MHZ;
+ } else if (channel ==14) {
+ smeConfig.csrConfig.channelBondingMode24GHz =
eCSR_INI_SINGLE_CHANNEL_CENTERED;
+ *vht_channel_width = eHT_CHANNEL_WIDTH_20MHZ;
}
} else if ((eCSR_DOT11_MODE_11n == eCsrPhyMode ||
- eCSR_DOT11_MODE_11n_ONLY == eCsrPhyMode) ||
- ((eCSR_DOT11_MODE_11ac == eCsrPhyMode ||
+ eCSR_DOT11_MODE_11n_ONLY == eCsrPhyMode ||
+ eCSR_DOT11_MODE_11ac == eCsrPhyMode ||
eCSR_DOT11_MODE_11ac_ONLY == eCsrPhyMode) &&
- (eHT_CHANNEL_WIDTH_40MHZ == *vht_channel_width))) {
- if (pMac->roam.configParam.channelBondingMode5GHz) {
- if (channel== 40 || channel == 48 || channel == 56 ||
+ (eHT_CHANNEL_WIDTH_40MHZ == ch_width_orig)) {
+ if (channel== 40 || channel == 48 || channel == 56 ||
channel == 64 || channel == 104 || channel == 112 ||
channel == 120 || channel == 128 || channel == 136 ||
channel == 153 || channel == 161) {
- smeConfig.csrConfig.channelBondingMode5GHz =
+ smeConfig.csrConfig.channelBondingMode5GHz =
eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
- } else if (channel== 36 || channel == 44 || channel == 52 ||
+ } else if (channel== 36 || channel == 44 || channel == 52 ||
channel == 60 || channel == 100 || channel == 108 ||
channel == 116 || channel == 124 || channel == 132 ||
channel == 149 || channel == 157) {
- smeConfig.csrConfig.channelBondingMode5GHz =
+ smeConfig.csrConfig.channelBondingMode5GHz =
eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
- } else if (channel == 165 || channel == 140) {
- smeConfig.csrConfig.channelBondingMode5GHz =
+ } else if (channel == 165 || channel == 140) {
+ smeConfig.csrConfig.channelBondingMode5GHz =
eCSR_INI_SINGLE_CHANNEL_CENTERED;
- *vht_channel_width = eHT_CHANNEL_WIDTH_20MHZ;
- }
- } else {
- *vht_channel_width = eHT_CHANNEL_WIDTH_20MHZ;
- }
-
- if (pMac->roam.configParam.channelBondingMode24GHz)
- {
- if (channel >= 1 && channel <= 5)
- smeConfig.csrConfig.channelBondingMode24GHz =
- eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
- else if (channel >= 6 && channel <= 13)
- smeConfig.csrConfig.channelBondingMode24GHz =
- eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
- else if (channel ==14)
- smeConfig.csrConfig.channelBondingMode24GHz =
+ *vht_channel_width = eHT_CHANNEL_WIDTH_20MHZ;
+ } else if (channel >= 1 && channel <= 5) {
+ smeConfig.csrConfig.channelBondingMode24GHz =
+ eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
+ } else if (channel >= 6 && channel <= 13) {
+ smeConfig.csrConfig.channelBondingMode24GHz =
+ eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
+ } else if (channel ==14) {
+ smeConfig.csrConfig.channelBondingMode24GHz =
eCSR_INI_SINGLE_CHANNEL_CENTERED;
- }
- }
-
- /*
- for 802.11a phy mode, channel bonding should be zero.
- From default config, it is set as PHY_DOUBLE_CHANNEL_HIGH_PRIMARY = 3
- through csrChangeDefaultConfigParam function. We will override this
- value here.
- for 802.11g only phy mode also channel bonding should be zero.
- */
- if (eCSR_DOT11_MODE_11a == eCsrPhyMode ||
- eCSR_DOT11_MODE_abg == eCsrPhyMode) {
- smeConfig.csrConfig.channelBondingMode5GHz =
- eCSR_INI_SINGLE_CHANNEL_CENTERED;
- } else if (eCSR_DOT11_MODE_11g_ONLY == eCsrPhyMode)
- smeConfig.csrConfig.channelBondingMode24GHz =
- eCSR_INI_SINGLE_CHANNEL_CENTERED;
-
- if ((eHT_CHANNEL_WIDTH_20MHZ == *vht_channel_width) &&
- (eCSR_DOT11_MODE_11ac == eCsrPhyMode ||
- eCSR_DOT11_MODE_11ac_ONLY == eCsrPhyMode)) {
+ *vht_channel_width = eHT_CHANNEL_WIDTH_20MHZ;
+ }
+ } else {
+ *vht_channel_width = eHT_CHANNEL_WIDTH_20MHZ;
if (channel <= 14) {
smeConfig.csrConfig.channelBondingMode24GHz =
eCSR_INI_SINGLE_CHANNEL_CENTERED;
@@ -12162,14 +12110,14 @@ VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode,
}
sme_AdjustCBMode(pMac, &smeConfig, channel, vht_channel_width);
-
- VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
- "%s cbmode selected=%d", (channel <= 14) ? "2G" : "5G",
- (channel <= 14) ? smeConfig.csrConfig.channelBondingMode24GHz :
- smeConfig.csrConfig.channelBondingMode5GHz);
-
sme_UpdateConfig (pMac, &smeConfig);
- return VOS_STATUS_SUCCESS;
+ cb_mode = (channel <= 14) ? smeConfig.csrConfig.channelBondingMode24GHz :
+ smeConfig.csrConfig.channelBondingMode5GHz;
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ "%s: CH: %d NEW_BW: %d %s-CB_Mode:%d", __func__, channel,
+ *vht_channel_width, (channel <=14) ? "2G" : "5G", cb_mode);
+
+ return cb_mode;
}
/*convert the ini value to the ENUM used in csr and MAC for CB state*/
@@ -13214,35 +13162,6 @@ eHalStatus sme_SetHT2040Mode(tHalHandle hHal, tANI_U8 sessionId,
}
return (status);
}
-
-/* ---------------------------------------------------------------------------
-
- \fn sme_SetPhyCBMode24G
-
- \brief Changes PHY channel bonding mode
-
- \param hHal - The handle returned by macOpen.
-
- \param cbMode new channel bonding mode which is to set
-
- \return eHalStatus SUCCESS.
-
- -------------------------------------------------------------------------------*/
-eHalStatus sme_SetPhyCBMode24G(tHalHandle hHal, ePhyChanBondState phyCBMode)
-{
- tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
-
- if (NULL == pMac)
- {
- VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
- "%s: invalid context", __func__);
- return eHAL_STATUS_FAILURE;
- }
-
- pMac->roam.configParam.channelBondingMode24GHz = phyCBMode;
-
- return eHAL_STATUS_SUCCESS;
-}
#endif
/*
diff --git a/firmware_bin/WCNSS_qcom_cfg.ini b/firmware_bin/WCNSS_qcom_cfg.ini
index 91a8534cab90..2e44ebdf4954 100755
--- a/firmware_bin/WCNSS_qcom_cfg.ini
+++ b/firmware_bin/WCNSS_qcom_cfg.ini
@@ -230,15 +230,6 @@ gAPAutoShutOff=0
gWlanAutoShutdown = 0
-# SAP auto channel selection configuration
-
-# 0 = disable auto channel selection
-
-# 1 = enable auto channel selection, channel provided by supplicant will be ignored
-
-gApAutoChannelSelection=0
-
-
# Listen Energy Detect Mode Configuration
# Valid values 0-128
@@ -288,20 +279,6 @@ enableBeaconEarlyTermination=0
beaconEarlyTerminationWakeInterval=3
-#SOFTAP Channel Range selection
-
-gAPChannelSelectStartChannel=1
-
-gAPChannelSelectEndChannel=11
-
-
-#SOFTAP Channel Range selection Operating band
-
-# 0:2.4GHZ 1: LOW-5GHZ 2:MID-5GHZ 3:HIGH-5GHZ 4: 4.9HZ BAND
-
-gAPChannelSelectOperatingBand=0
-
-
#Channel Bonding
gChannelBondingMode5GHz=1