qcacld-3.0: Replace regulatory apis with reg component apis
Replace the legacy regulatory apis with regulatory component public service apis Change-Id: Ifd8c93fc8f57116cfc432b853248b35fd7ed1b94 CRs-Fixed: 2008013
Этот коммит содержится в:

коммит произвёл
Sandeep Puligilla

родитель
7ca90b7d9e
Коммит
a3de226328
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005-2016 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2005-2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
@@ -62,7 +62,8 @@
|
||||
/* From wlan_modules/include/ */
|
||||
#include "ath_dfs_structs.h"
|
||||
/*DFS - Newly added File to interface cld UMAC and dfs data structures*/
|
||||
#include <wma_dfs_interface.h>
|
||||
#include "wlan_reg_services_api.h"
|
||||
#include "wma_dfs_interface.h"
|
||||
/*
|
||||
*TO DO DFS- Need to include this file later on
|
||||
#include "ah.h"
|
||||
|
@@ -1001,9 +1001,8 @@ QDF_STATUS wlansap_update_sap_config_add_ie(tsap_Config_t *pConfig,
|
||||
eUpdateIEsType updateType);
|
||||
QDF_STATUS wlansap_reset_sap_config_add_ie(tsap_Config_t *pConfig,
|
||||
eUpdateIEsType updateType);
|
||||
void wlansap_extend_to_acs_range(uint8_t *startChannelNum,
|
||||
uint8_t *endChannelNum,
|
||||
uint8_t *bandStartChannel,
|
||||
void wlansap_extend_to_acs_range(tHalHandle hal, uint8_t *startChannelNum,
|
||||
uint8_t *endChannelNum, uint8_t *bandStartChannel,
|
||||
uint8_t *bandEndChannel);
|
||||
QDF_STATUS wlansap_get_dfs_nol(void *pSapCtx, uint8_t *nol, uint32_t *nol_len);
|
||||
QDF_STATUS wlansap_set_dfs_nol(void *pSapCtx, eSapDfsNolType conf);
|
||||
|
@@ -57,6 +57,8 @@
|
||||
#include "wma.h"
|
||||
#include <wlan_objmgr_vdev_obj.h>
|
||||
#include <wlan_objmgr_pdev_obj.h>
|
||||
#include "wlan_reg_services_api.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Preprocessor Definitions and Constants
|
||||
* -------------------------------------------------------------------------*/
|
||||
@@ -108,6 +110,7 @@ QDF_STATUS wlansap_scan_callback(tHalHandle hal_handle,
|
||||
uint8_t operChannel = 0;
|
||||
QDF_STATUS sap_sm_status;
|
||||
uint32_t event;
|
||||
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_handle);
|
||||
|
||||
|
||||
if (NULL == hal_handle) {
|
||||
@@ -197,7 +200,7 @@ QDF_STATUS wlansap_scan_callback(tHalHandle hal_handle,
|
||||
}
|
||||
|
||||
sap_ctx->ch_params.ch_width = sap_ctx->acs_cfg->ch_width;
|
||||
cds_set_channel_params(sap_ctx->channel,
|
||||
wlan_reg_set_channel_params(mac_ctx->pdev, sap_ctx->channel,
|
||||
sap_ctx->secondary_ch,
|
||||
&sap_ctx->ch_params);
|
||||
#ifdef SOFTAP_CHANNEL_RANGE
|
||||
@@ -246,9 +249,11 @@ void sap_config_acs_result(tHalHandle hal, ptSapContext sap_ctx,
|
||||
{
|
||||
uint32_t channel = sap_ctx->acs_cfg->pri_ch;
|
||||
struct ch_params ch_params = {0};
|
||||
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
|
||||
|
||||
ch_params.ch_width = sap_ctx->acs_cfg->ch_width;
|
||||
cds_set_channel_params(channel, sec_ch, &ch_params);
|
||||
wlan_reg_set_channel_params(mac_ctx->pdev, channel, sec_ch,
|
||||
&ch_params);
|
||||
sap_ctx->acs_cfg->ch_width = ch_params.ch_width;
|
||||
if (sap_ctx->acs_cfg->ch_width > CH_WIDTH_40MHZ)
|
||||
sap_ctx->acs_cfg->vht_seg0_center_ch =
|
||||
@@ -459,14 +464,17 @@ wlansap_roam_process_ch_change_success(tpAniSirGlobal mac_ctx,
|
||||
if (sap_ctx->ch_params.ch_width == CH_WIDTH_160MHZ) {
|
||||
is_ch_dfs = true;
|
||||
} else if (sap_ctx->ch_params.ch_width == CH_WIDTH_80P80MHZ) {
|
||||
if (cds_get_channel_state(sap_ctx->channel) ==
|
||||
if (wlan_reg_get_channel_state(mac_ctx->pdev,
|
||||
sap_ctx->channel) ==
|
||||
CHANNEL_STATE_DFS ||
|
||||
cds_get_channel_state(sap_ctx->ch_params.center_freq_seg1 -
|
||||
wlan_reg_get_channel_state(mac_ctx->pdev,
|
||||
sap_ctx->ch_params.center_freq_seg1 -
|
||||
SIR_80MHZ_START_CENTER_CH_DIFF) ==
|
||||
CHANNEL_STATE_DFS)
|
||||
is_ch_dfs = true;
|
||||
} else {
|
||||
if (cds_get_channel_state(sap_ctx->channel) ==
|
||||
if (wlan_reg_get_channel_state(mac_ctx->pdev,
|
||||
sap_ctx->channel) ==
|
||||
CHANNEL_STATE_DFS)
|
||||
is_ch_dfs = true;
|
||||
}
|
||||
@@ -596,8 +604,9 @@ wlansap_roam_process_dfs_chansw_update(tHalHandle hHal,
|
||||
* currently. For e.g. 20/40/80 MHz operation
|
||||
*/
|
||||
if (mac_ctx->sap.SapDfsInfo.target_channel)
|
||||
cds_set_channel_params(mac_ctx->sap.SapDfsInfo.target_channel,
|
||||
0, &sap_ctx->ch_params);
|
||||
wlan_reg_set_channel_params(mac_ctx->pdev,
|
||||
mac_ctx->sap.SapDfsInfo.target_channel,
|
||||
0, &sap_ctx->ch_params);
|
||||
|
||||
/*
|
||||
* Fetch the number of SAP interfaces. If the number of sap Interface
|
||||
|
@@ -55,6 +55,7 @@
|
||||
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
|
||||
#include "cds_utils.h"
|
||||
#include "pld_common.h"
|
||||
#include "wlan_reg_services_api.h"
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
Function definitions
|
||||
@@ -371,11 +372,13 @@ static void sap_process_avoid_ie(tHalHandle hal,
|
||||
RETURN VALUE
|
||||
NULL
|
||||
============================================================================*/
|
||||
void sap_update_unsafe_channel_list(ptSapContext pSapCtx)
|
||||
void sap_update_unsafe_channel_list(tHalHandle hal, ptSapContext pSapCtx)
|
||||
{
|
||||
uint16_t i, j;
|
||||
uint16_t unsafe_channel_list[NUM_CHANNELS];
|
||||
uint16_t unsafe_channel_count = 0;
|
||||
tpAniSirGlobal mac_ctx = NULL;
|
||||
|
||||
qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
|
||||
|
||||
if (!qdf_ctx) {
|
||||
@@ -383,6 +386,12 @@ void sap_update_unsafe_channel_list(ptSapContext pSapCtx)
|
||||
"qdf_ctx is NULL");
|
||||
return;
|
||||
}
|
||||
mac_ctx = PMAC_STRUCT(hal);
|
||||
if (!mac_ctx) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_FATAL,
|
||||
"mac_ctx is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Flush, default set all channel safe */
|
||||
for (i = 0; i < NUM_CHANNELS; i++) {
|
||||
@@ -393,7 +402,8 @@ void sap_update_unsafe_channel_list(ptSapContext pSapCtx)
|
||||
#if defined(FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE)
|
||||
for (i = 0; i < NUM_CHANNELS; i++) {
|
||||
if (pSapCtx->dfs_ch_disable == true) {
|
||||
if (CDS_IS_DFS_CH(safe_channels[i].channelNumber)) {
|
||||
if (wlan_reg_is_dfs_ch(mac_ctx->pdev,
|
||||
safe_channels[i].channelNumber)) {
|
||||
safe_channels[i].isSafe = false;
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP,
|
||||
QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
@@ -612,7 +622,7 @@ static bool sap_chan_sel_init(tHalHandle halHandle,
|
||||
}
|
||||
|
||||
if (include_dfs_ch == false) {
|
||||
if (CDS_IS_DFS_CH(*pChans)) {
|
||||
if (wlan_reg_is_dfs_ch(pMac->pdev, *pChans)) {
|
||||
chSafe = false;
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP,
|
||||
QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
@@ -643,7 +653,7 @@ static bool sap_chan_sel_init(tHalHandle halHandle,
|
||||
}
|
||||
|
||||
/* Skip DSRC channels */
|
||||
if (cds_is_dsrc_channel(cds_chan_to_freq(*pChans)))
|
||||
if (WLAN_REG_IS_11P_CH(*pChans))
|
||||
continue;
|
||||
|
||||
if (true == chSafe) {
|
||||
@@ -1740,7 +1750,8 @@ static void sap_sort_chl_weight_vht160(tSapChSelSpectInfo *pSpectInfoParams)
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
static void sap_sort_chl_weight_ht40_24_g(tSapChSelSpectInfo *pSpectInfoParams)
|
||||
static void sap_sort_chl_weight_ht40_24_g(tSapChSelSpectInfo *pSpectInfoParams,
|
||||
v_REGDOMAIN_t domain)
|
||||
{
|
||||
uint8_t i, j;
|
||||
tSapSpectChInfo *pSpectInfo;
|
||||
@@ -1834,7 +1845,7 @@ static void sap_sort_chl_weight_ht40_24_g(tSapChSelSpectInfo *pSpectInfoParams)
|
||||
* channel. Mark the channel whose combination can't satisfy 40MHZ
|
||||
* as max value, so that it will be sorted to the bottom.
|
||||
*/
|
||||
if (cds_is_fcc_regdomain())
|
||||
if (REGDOMAIN_FCC == domain)
|
||||
ht40plus2gendch = HT40PLUS_2G_FCC_CH_END;
|
||||
else
|
||||
ht40plus2gendch = HT40PLUS_2G_EURJAP_CH_END;
|
||||
@@ -1979,7 +1990,8 @@ static void sap_sort_chl_weight_ht40_5_g(tSapChSelSpectInfo *pSpectInfoParams)
|
||||
============================================================================*/
|
||||
static void sap_sort_chl_weight_all(ptSapContext pSapCtx,
|
||||
tSapChSelSpectInfo *pSpectInfoParams,
|
||||
uint32_t operatingBand)
|
||||
uint32_t operatingBand,
|
||||
v_REGDOMAIN_t domain)
|
||||
{
|
||||
tSapSpectChInfo *pSpectCh = NULL;
|
||||
uint32_t j = 0;
|
||||
@@ -1993,11 +2005,11 @@ static void sap_sort_chl_weight_all(ptSapContext pSapCtx,
|
||||
switch (pSapCtx->acs_cfg->ch_width) {
|
||||
case CH_WIDTH_40MHZ:
|
||||
if (eCSR_DOT11_MODE_11g == operatingBand)
|
||||
sap_sort_chl_weight_ht40_24_g(pSpectInfoParams);
|
||||
sap_sort_chl_weight_ht40_24_g(pSpectInfoParams, domain);
|
||||
else if (eCSR_DOT11_MODE_11a == operatingBand)
|
||||
sap_sort_chl_weight_ht40_5_g(pSpectInfoParams);
|
||||
else {
|
||||
sap_sort_chl_weight_ht40_24_g(pSpectInfoParams);
|
||||
sap_sort_chl_weight_ht40_24_g(pSpectInfoParams, domain);
|
||||
sap_sort_chl_weight_ht40_5_g(pSpectInfoParams);
|
||||
}
|
||||
break;
|
||||
@@ -2096,6 +2108,9 @@ static uint8_t sap_select_channel_no_scan_result(tHalHandle hal,
|
||||
uint32_t dfs_master_cap_enabled;
|
||||
uint32_t start_ch_num = sap_ctx->acs_cfg->start_ch;
|
||||
uint32_t end_ch_num = sap_ctx->acs_cfg->end_ch;
|
||||
tpAniSirGlobal mac_ctx = NULL;
|
||||
|
||||
mac_ctx = PMAC_STRUCT(hal);
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
FL("start - end: %d - %d"), start_ch_num, end_ch_num);
|
||||
@@ -2124,7 +2139,8 @@ static uint8_t sap_select_channel_no_scan_result(tHalHandle hal,
|
||||
(safe_channels[i].channelNumber > end_ch_num))
|
||||
continue;
|
||||
|
||||
ch_type = cds_get_channel_state(safe_channels[i].channelNumber);
|
||||
ch_type = wlan_reg_get_channel_state(mac_ctx->pdev,
|
||||
safe_channels[i].channelNumber);
|
||||
|
||||
if ((ch_type == CHANNEL_STATE_DISABLE) ||
|
||||
(ch_type == CHANNEL_STATE_INVALID))
|
||||
@@ -2194,15 +2210,20 @@ uint8_t sap_select_channel(tHalHandle hal, ptSapContext sap_ctx,
|
||||
tSapChSelSpectInfo *spect_info = &spect_info_obj;
|
||||
uint8_t best_ch_num = SAP_CHANNEL_NOT_SELECTED;
|
||||
uint32_t ht40plus2gendch = 0;
|
||||
v_REGDOMAIN_t domain;
|
||||
uint8_t country[CDS_COUNTRY_CODE_LEN];
|
||||
#ifdef SOFTAP_CHANNEL_RANGE
|
||||
uint8_t count;
|
||||
uint32_t start_ch_num, end_ch_num, tmp_ch_num, operating_band = 0;
|
||||
#endif
|
||||
tpAniSirGlobal mac_ctx;
|
||||
|
||||
mac_ctx = PMAC_STRUCT(hal);
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
"In %s, Running SAP Ch Select", __func__);
|
||||
|
||||
#ifdef FEATURE_WLAN_CH_AVOID
|
||||
sap_update_unsafe_channel_list(sap_ctx);
|
||||
sap_update_unsafe_channel_list(hal, sap_ctx);
|
||||
#endif
|
||||
|
||||
if (NULL == scan_result) {
|
||||
@@ -2230,6 +2251,8 @@ uint8_t sap_select_channel(tHalHandle hal, ptSapContext sap_ctx,
|
||||
sap_process_avoid_ie(hal, sap_ctx, scan_result, spect_info);
|
||||
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
|
||||
|
||||
wlan_reg_read_default_country(mac_ctx->psoc, country);
|
||||
wlan_reg_get_domain_from_country_code(&domain, country, SOURCE_DRIVER);
|
||||
#ifdef SOFTAP_CHANNEL_RANGE
|
||||
start_ch_num = sap_ctx->acs_cfg->start_ch;
|
||||
end_ch_num = sap_ctx->acs_cfg->end_ch;
|
||||
@@ -2239,7 +2262,7 @@ uint8_t sap_select_channel(tHalHandle hal, ptSapContext sap_ctx,
|
||||
sap_ctx->acsBestChannelInfo.weight = SAP_ACS_WEIGHT_MAX;
|
||||
|
||||
/* Sort the ch lst as per the computed weights, lesser weight first. */
|
||||
sap_sort_chl_weight_all(sap_ctx, spect_info, operating_band);
|
||||
sap_sort_chl_weight_all(sap_ctx, spect_info, operating_band, domain);
|
||||
|
||||
/*Loop till get the best channel in the given range */
|
||||
for (count = 0; count < spect_info->numSpectChans; count++) {
|
||||
@@ -2335,8 +2358,7 @@ uint8_t sap_select_channel(tHalHandle hal, ptSapContext sap_ctx,
|
||||
if ((operating_band != eCSR_DOT11_MODE_11g) ||
|
||||
(sap_ctx->acs_cfg->ch_width != CH_WIDTH_40MHZ))
|
||||
goto sap_ch_sel_end;
|
||||
|
||||
if (cds_is_fcc_regdomain())
|
||||
if (REGDOMAIN_FCC == domain)
|
||||
ht40plus2gendch = HT40PLUS_2G_FCC_CH_END;
|
||||
else
|
||||
ht40plus2gendch = HT40PLUS_2G_EURJAP_CH_END;
|
||||
|
@@ -58,6 +58,7 @@
|
||||
#include <net/cfg80211.h>
|
||||
#include <qca_vendor.h>
|
||||
#include <wlan_scan_ucfg_api.h>
|
||||
#include "wlan_reg_services_api.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Preprocessor Definitions and Constants
|
||||
@@ -804,7 +805,8 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sapContext,
|
||||
|
||||
SIDE EFFECTS
|
||||
============================================================================*/
|
||||
static QDF_STATUS sap_get_5ghz_channel_list(ptSapContext sapContext);
|
||||
static QDF_STATUS sap_get_5ghz_channel_list(tpAniSirGlobal mac_ctx,
|
||||
ptSapContext sapContext);
|
||||
|
||||
/*==========================================================================
|
||||
FUNCTION sapStopDfsCacTimer
|
||||
@@ -1479,7 +1481,8 @@ static uint8_t sap_apply_rules(ptSapContext sap_ctx)
|
||||
}
|
||||
}
|
||||
|
||||
if (cds_get_channel_state(ch_id) == CHANNEL_STATE_DFS) {
|
||||
if (wlan_reg_get_channel_state(mac_ctx->pdev, ch_id) ==
|
||||
CHANNEL_STATE_DFS) {
|
||||
is_ch_nol = sap_dfs_is_channel_in_nol_list(sap_ctx,
|
||||
ch_id, PHY_SINGLE_CHANNEL_CENTERED);
|
||||
if (true == is_ch_nol) {
|
||||
@@ -1547,7 +1550,7 @@ static uint8_t select_rand_from_lst(tpAniSirGlobal mac_ctx, uint8_t *ch_lst,
|
||||
uint8_t non_dfs_ch[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0};
|
||||
if (num_ch) {
|
||||
for (i = 0; i < num_ch; i++) {
|
||||
if (CDS_IS_DFS_CH(ch_lst[i]))
|
||||
if (wlan_reg_is_dfs_ch(mac_ctx->pdev, ch_lst[i]))
|
||||
dfs_ch[dfs_num_ch++] = ch_lst[i];
|
||||
else
|
||||
non_dfs_ch[non_dfs_num_ch++] = ch_lst[i];
|
||||
@@ -1784,7 +1787,7 @@ static uint8_t sap_random_channel_sel(ptSapContext sap_ctx)
|
||||
ch_wd = mac_ctx->sap.SapDfsInfo.orig_chanWidth;
|
||||
}
|
||||
|
||||
if (sap_get_5ghz_channel_list(sap_ctx)) {
|
||||
if (sap_get_5ghz_channel_list(mac_ctx, sap_ctx)) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_LOW,
|
||||
FL("Getting 5Ghz channel list failed"));
|
||||
return 0;
|
||||
@@ -2316,7 +2319,8 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context,
|
||||
if (con_ch && sap_context->channel == AUTO_CHANNEL_SELECT) {
|
||||
sap_context->dfs_ch_disable = true;
|
||||
} else if (con_ch && sap_context->channel != con_ch &&
|
||||
CDS_IS_DFS_CH(sap_context->channel)) {
|
||||
wlan_reg_is_dfs_ch(mac_ctx->pdev,
|
||||
sap_context->channel)) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_WARN,
|
||||
FL("MCC DFS not supported in AP_AP Mode"));
|
||||
return QDF_STATUS_E_ABORTED;
|
||||
@@ -2346,7 +2350,8 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context,
|
||||
"%s: Override ch %d to %d due to CC Intf",
|
||||
__func__, sap_context->channel, con_ch);
|
||||
sap_context->channel = con_ch;
|
||||
cds_set_channel_params(sap_context->channel, 0,
|
||||
wlan_reg_set_channel_params(mac_ctx->pdev,
|
||||
sap_context->channel, 0,
|
||||
&sap_context->ch_params);
|
||||
}
|
||||
}
|
||||
@@ -2358,7 +2363,8 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context,
|
||||
#ifdef FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE
|
||||
if (sap_context->channel == AUTO_CHANNEL_SELECT)
|
||||
sap_context->dfs_ch_disable = true;
|
||||
else if (CDS_IS_DFS_CH(sap_context->channel)) {
|
||||
else if (wlan_reg_is_dfs_ch(mac_ctx->pdev,
|
||||
sap_context->channel)) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_WARN,
|
||||
FL("DFS not supported in STA_AP Mode"));
|
||||
return QDF_STATUS_E_ABORTED;
|
||||
@@ -2376,13 +2382,15 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context,
|
||||
sap_context->channel,
|
||||
sap_context->csr_roamProfile.phyMode,
|
||||
sap_context->cc_switch_mode);
|
||||
if (con_ch && !CDS_IS_DFS_CH(con_ch)) {
|
||||
if (con_ch && !wlan_reg_is_dfs_ch(mac_ctx->pdev,
|
||||
con_ch)) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP,
|
||||
QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: Override ch %d to %d due to CC Intf",
|
||||
__func__, sap_context->channel, con_ch);
|
||||
sap_context->channel = con_ch;
|
||||
cds_set_channel_params(sap_context->channel, 0,
|
||||
wlan_reg_set_channel_params(mac_ctx->pdev,
|
||||
sap_context->channel, 0,
|
||||
&sap_context->ch_params);
|
||||
}
|
||||
}
|
||||
@@ -3758,8 +3766,10 @@ static QDF_STATUS sap_fsm_state_ch_select(ptSapContext sap_ctx,
|
||||
sap_ctx->channel, ch);
|
||||
|
||||
sap_ctx->channel = ch;
|
||||
cds_set_channel_params(sap_ctx->channel,
|
||||
sap_ctx->secondary_ch, &sap_ctx->ch_params);
|
||||
wlan_reg_set_channel_params(mac_ctx->pdev,
|
||||
sap_ctx->channel,
|
||||
sap_ctx->secondary_ch,
|
||||
&sap_ctx->ch_params);
|
||||
}
|
||||
if (sap_ctx->channel > 14 &&
|
||||
(sap_ctx->csr_roamProfile.phyMode == eCSR_DOT11_MODE_11g ||
|
||||
@@ -3778,7 +3788,7 @@ static QDF_STATUS sap_fsm_state_ch_select(ptSapContext sap_ctx,
|
||||
uint16_t con_ch;
|
||||
|
||||
con_ch = sme_get_concurrent_operation_channel(hal);
|
||||
if (con_ch && CDS_IS_DFS_CH(con_ch))
|
||||
if (con_ch && wlan_reg_is_dfs_ch(mac_ctx->pdev, con_ch))
|
||||
sap_ctx->channel = con_ch;
|
||||
}
|
||||
|
||||
@@ -3873,7 +3883,7 @@ static QDF_STATUS sap_fsm_state_dfs_cac_wait(ptSapContext sap_ctx,
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
|
||||
"ENTERTRED CAC WAIT STATE-->eSAP_DISCONNECTING\n");
|
||||
if (mac_ctx->sap.SapDfsInfo.target_channel) {
|
||||
cds_set_channel_params(
|
||||
wlan_reg_set_channel_params(mac_ctx->pdev,
|
||||
mac_ctx->sap.SapDfsInfo.target_channel, 0,
|
||||
&sap_ctx->ch_params);
|
||||
}
|
||||
@@ -3983,15 +3993,17 @@ static QDF_STATUS sap_fsm_state_starting(ptSapContext sap_ctx,
|
||||
if (sap_ctx->ch_params.ch_width == CH_WIDTH_160MHZ) {
|
||||
is_dfs = true;
|
||||
} else if (sap_ctx->ch_params.ch_width == CH_WIDTH_80P80MHZ) {
|
||||
if (cds_get_channel_state(sap_ctx->channel) ==
|
||||
if (wlan_reg_get_channel_state(mac_ctx->pdev,
|
||||
sap_ctx->channel) ==
|
||||
CHANNEL_STATE_DFS ||
|
||||
cds_get_channel_state(sap_ctx->
|
||||
ch_params.center_freq_seg1 -
|
||||
wlan_reg_get_channel_state(mac_ctx->pdev,
|
||||
sap_ctx->ch_params.center_freq_seg1 -
|
||||
SIR_80MHZ_START_CENTER_CH_DIFF) ==
|
||||
CHANNEL_STATE_DFS)
|
||||
is_dfs = true;
|
||||
} else {
|
||||
if (cds_get_channel_state(sap_ctx->channel) ==
|
||||
if (wlan_reg_get_channel_state(mac_ctx->pdev,
|
||||
sap_ctx->channel) ==
|
||||
CHANNEL_STATE_DFS)
|
||||
is_dfs = true;
|
||||
}
|
||||
@@ -4704,7 +4716,7 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx,
|
||||
start_ch_num, end_ch_num,
|
||||
sap_ctx->acs_cfg->hw_mode);
|
||||
|
||||
wlansap_extend_to_acs_range(&start_ch_num, &end_ch_num,
|
||||
wlansap_extend_to_acs_range(hal, &start_ch_num, &end_ch_num,
|
||||
&band_start_ch, &band_end_ch);
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
|
||||
@@ -4740,8 +4752,8 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx,
|
||||
for (loop_count = band_start_ch; loop_count <= band_end_ch;
|
||||
loop_count++) {
|
||||
/* go to next channel if rf_channel is out of range */
|
||||
if ((start_ch_num > CDS_CHANNEL_NUM(loop_count)) ||
|
||||
(end_ch_num < CDS_CHANNEL_NUM(loop_count)))
|
||||
if ((start_ch_num > WLAN_REG_CH_NUM(loop_count)) ||
|
||||
(end_ch_num < WLAN_REG_CH_NUM(loop_count)))
|
||||
continue;
|
||||
/*
|
||||
* go to next channel if none of these condition pass
|
||||
@@ -4749,22 +4761,22 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx,
|
||||
* - DFS scan disable but chan in CHANNEL_STATE_ENABLE
|
||||
*/
|
||||
if (!(((eSAP_TRUE == mac_ctx->scan.fEnableDFSChnlScan) &&
|
||||
CDS_CHANNEL_STATE(loop_count)) ||
|
||||
wlan_reg_get_channel_state(mac_ctx->pdev, loop_count)) ||
|
||||
((eSAP_FALSE == mac_ctx->scan.fEnableDFSChnlScan) &&
|
||||
(CHANNEL_STATE_ENABLE ==
|
||||
CDS_CHANNEL_STATE(loop_count)))))
|
||||
wlan_reg_get_channel_state(mac_ctx->pdev, loop_count)))))
|
||||
continue;
|
||||
|
||||
#ifdef FEATURE_WLAN_CH_AVOID
|
||||
for (i = 0; i < NUM_CHANNELS; i++) {
|
||||
if ((safe_channels[i].channelNumber ==
|
||||
CDS_CHANNEL_NUM(loop_count))) {
|
||||
WLAN_REG_CH_NUM(loop_count))) {
|
||||
/* Check if channel is safe */
|
||||
if (true == safe_channels[i].isSafe) {
|
||||
#endif
|
||||
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
|
||||
uint8_t ch;
|
||||
ch = CDS_CHANNEL_NUM(loop_count);
|
||||
ch = WLAN_REG_CH_NUM(loop_count);
|
||||
if ((sap_ctx->acs_cfg->skip_scan_status ==
|
||||
eSAP_DO_PAR_ACS_SCAN)) {
|
||||
if ((ch >= sap_ctx->acs_cfg->skip_scan_range1_stch &&
|
||||
@@ -4772,7 +4784,7 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx,
|
||||
(ch >= sap_ctx->acs_cfg->skip_scan_range2_stch &&
|
||||
ch <= sap_ctx->acs_cfg->skip_scan_range2_endch)) {
|
||||
list[ch_count] =
|
||||
CDS_CHANNEL_NUM(loop_count);
|
||||
WLAN_REG_CH_NUM(loop_count);
|
||||
ch_count++;
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP,
|
||||
QDF_TRACE_LEVEL_INFO,
|
||||
@@ -4786,7 +4798,7 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx,
|
||||
}
|
||||
} else {
|
||||
list[ch_count] =
|
||||
CDS_CHANNEL_NUM(loop_count);
|
||||
WLAN_REG_CH_NUM(loop_count);
|
||||
ch_count++;
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP,
|
||||
QDF_TRACE_LEVEL_INFO,
|
||||
@@ -4794,7 +4806,7 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx,
|
||||
ch_count, ch);
|
||||
}
|
||||
#else
|
||||
list[ch_count] = CDS_CHANNEL_NUM(loop_count);
|
||||
list[ch_count] = WLAN_REG_CH_NUM(loop_count);
|
||||
ch_count++;
|
||||
#endif
|
||||
#ifdef FEATURE_WLAN_CH_AVOID
|
||||
@@ -4837,14 +4849,14 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx,
|
||||
* Function for initializing list of 2.4/5 Ghz [NON-DFS/DFS]
|
||||
* available channels in the current regulatory domain.
|
||||
*/
|
||||
static QDF_STATUS sap_get_5ghz_channel_list(ptSapContext sapContext)
|
||||
static QDF_STATUS sap_get_5ghz_channel_list(tpAniSirGlobal mac_ctx,
|
||||
ptSapContext sapContext)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
int i;
|
||||
struct sir_pcl_list pcl;
|
||||
QDF_STATUS status;
|
||||
enum channel_state ch_state;
|
||||
tpAniSirGlobal mac_ctx;
|
||||
tHalHandle h_hal;
|
||||
|
||||
pcl.pcl_len = 0;
|
||||
@@ -4856,7 +4868,6 @@ static QDF_STATUS sap_get_5ghz_channel_list(ptSapContext sapContext)
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
|
||||
mac_ctx = PMAC_STRUCT(h_hal);
|
||||
if (NULL == mac_ctx) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("Invalid MAC context"));
|
||||
@@ -4899,8 +4910,9 @@ static QDF_STATUS sap_get_5ghz_channel_list(ptSapContext sapContext)
|
||||
return status;
|
||||
}
|
||||
for (i = 0; i <= pcl.pcl_len; i++) {
|
||||
if (CDS_IS_CHANNEL_5GHZ(pcl.pcl_list[i])) {
|
||||
ch_state = cds_get_channel_state(pcl.pcl_list[i]);
|
||||
if (WLAN_REG_IS_5GHZ_CH(pcl.pcl_list[i])) {
|
||||
ch_state = wlan_reg_get_channel_state(mac_ctx->pdev,
|
||||
pcl.pcl_list[i]);
|
||||
if (!(ch_state == CHANNEL_STATE_ENABLE ||
|
||||
ch_state == CHANNEL_STATE_DFS))
|
||||
continue;
|
||||
@@ -5206,12 +5218,13 @@ QDF_STATUS sap_init_dfs_channel_nol_list(ptSapContext sapContext)
|
||||
}
|
||||
|
||||
for (i = CHAN_ENUM_36; i <= CHAN_ENUM_165; i++) {
|
||||
if (CDS_CHANNEL_STATE(i) == CHANNEL_STATE_DFS) {
|
||||
if (wlan_reg_get_channel_state(pMac->pdev, i) ==
|
||||
CHANNEL_STATE_DFS) {
|
||||
/* if dfs nol is not found, initialize it */
|
||||
if (!bFound) {
|
||||
pMac->sap.SapDfsInfo.sapDfsChannelNolList[count]
|
||||
.dfs_channel_number =
|
||||
CDS_CHANNEL_NUM(i);
|
||||
WLAN_REG_CH_NUM(i);
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP,
|
||||
QDF_TRACE_LEVEL_INFO_LOW,
|
||||
|
@@ -377,7 +377,7 @@ QDF_STATUS sap_acquire_global_lock(ptSapContext pSapCtx);
|
||||
QDF_STATUS sap_release_global_lock(ptSapContext pSapCtx);
|
||||
|
||||
#ifdef FEATURE_WLAN_CH_AVOID
|
||||
void sap_update_unsafe_channel_list(ptSapContext pSapCtx);
|
||||
void sap_update_unsafe_channel_list(tHalHandle hal, ptSapContext pSapCtx);
|
||||
#endif /* FEATURE_WLAN_CH_AVOID */
|
||||
|
||||
uint8_t
|
||||
|
@@ -56,6 +56,7 @@
|
||||
#include "cds_regdomain.h"
|
||||
#include "wlan_policy_mgr_api.h"
|
||||
#include <wlan_scan_ucfg_api.h>
|
||||
#include "wlan_reg_services_api.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Preprocessor Definitions and Constants
|
||||
@@ -1653,7 +1654,7 @@ static QDF_STATUS wlansap_update_csa_channel_params(ptSapContext sap_context,
|
||||
for (; bw >= BW20; bw--) {
|
||||
uint16_t op_class;
|
||||
|
||||
op_class = cds_reg_dmn_get_opclass_from_channel(
|
||||
op_class = wlan_reg_dmn_get_opclass_from_channel(
|
||||
mac_ctx->scan.countryCodeCurrent,
|
||||
channel, bw);
|
||||
if (!op_class)
|
||||
@@ -1730,9 +1731,9 @@ wlansap_set_channel_change_with_csa(void *p_cds_gctx, uint32_t targetChannel,
|
||||
* current regulatory domain.
|
||||
*/
|
||||
if (sapContext->channel != targetChannel &&
|
||||
((cds_get_channel_state(targetChannel) ==
|
||||
((wlan_reg_get_channel_state(pMac->pdev, targetChannel) ==
|
||||
CHANNEL_STATE_ENABLE) ||
|
||||
(cds_get_channel_state(targetChannel) ==
|
||||
(wlan_reg_get_channel_state(pMac->pdev, targetChannel) ==
|
||||
CHANNEL_STATE_DFS &&
|
||||
!policy_mgr_is_any_mode_active_on_band_along_with_session(
|
||||
pMac->psoc, sapContext->sessionId,
|
||||
@@ -1796,7 +1797,7 @@ wlansap_set_channel_change_with_csa(void *p_cds_gctx, uint32_t targetChannel,
|
||||
new_ch_params.ch_width,
|
||||
target_bw);
|
||||
}
|
||||
cds_set_channel_params(targetChannel,
|
||||
wlan_reg_set_channel_params(pMac->pdev, targetChannel,
|
||||
0, &pMac->sap.SapDfsInfo.new_ch_params);
|
||||
/*
|
||||
* Set the CSA IE required flag.
|
||||
@@ -2693,7 +2694,8 @@ wlansap_channel_change_request(void *pSapCtx, uint8_t target_channel)
|
||||
* which will result in channel width changing dynamically.
|
||||
*/
|
||||
ch_params = &mac_ctx->sap.SapDfsInfo.new_ch_params;
|
||||
cds_set_channel_params(target_channel, 0, ch_params);
|
||||
wlan_reg_set_channel_params(mac_ctx->pdev, target_channel,
|
||||
0, ch_params);
|
||||
sapContext->ch_params.ch_width = ch_params->ch_width;
|
||||
/* Update the channel as this will be used to
|
||||
* send event to supplicant
|
||||
@@ -2838,8 +2840,9 @@ QDF_STATUS wlansap_dfs_send_csa_ie_request(void *pSapCtx)
|
||||
|
||||
pMac->sap.SapDfsInfo.new_ch_params.ch_width =
|
||||
pMac->sap.SapDfsInfo.new_chanWidth;
|
||||
cds_set_channel_params(pMac->sap.SapDfsInfo.target_channel,
|
||||
0, &pMac->sap.SapDfsInfo.new_ch_params);
|
||||
wlan_reg_set_channel_params(pMac->pdev,
|
||||
pMac->sap.SapDfsInfo.target_channel,
|
||||
0, &pMac->sap.SapDfsInfo.new_ch_params);
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
|
||||
"%s: chan:%d req:%d width:%d off:%d",
|
||||
@@ -3270,17 +3273,23 @@ wlansap_reset_sap_config_add_ie(tsap_Config_t *pConfig, eUpdateIEsType updateTyp
|
||||
|
||||
SIDE EFFECTS
|
||||
============================================================================*/
|
||||
void wlansap_extend_to_acs_range(uint8_t *startChannelNum,
|
||||
uint8_t *endChannelNum,
|
||||
uint8_t *bandStartChannel,
|
||||
uint8_t *bandEndChannel)
|
||||
void wlansap_extend_to_acs_range(tHalHandle hal, uint8_t *startChannelNum,
|
||||
uint8_t *endChannelNum, uint8_t *bandStartChannel,
|
||||
uint8_t *bandEndChannel)
|
||||
{
|
||||
#define ACS_WLAN_20M_CH_INC 4
|
||||
#define ACS_2G_EXTEND ACS_WLAN_20M_CH_INC
|
||||
#define ACS_5G_EXTEND (ACS_WLAN_20M_CH_INC * 3)
|
||||
|
||||
uint8_t tmp_startChannelNum = 0, tmp_endChannelNum = 0;
|
||||
tpAniSirGlobal mac_ctx;
|
||||
|
||||
mac_ctx = PMAC_STRUCT(hal);
|
||||
if (!mac_ctx) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: Invalid mac_ctx", __func__);
|
||||
return;
|
||||
}
|
||||
if (*startChannelNum <= 14 && *endChannelNum <= 14) {
|
||||
*bandStartChannel = CHAN_ENUM_1;
|
||||
*bandEndChannel = CHAN_ENUM_14;
|
||||
@@ -3309,15 +3318,17 @@ void wlansap_extend_to_acs_range(uint8_t *startChannelNum,
|
||||
* spikes in DFS specturm channels which is due to emission spill.
|
||||
* Remove the active channels from extend ACS range for DFS only range
|
||||
*/
|
||||
if (CDS_IS_DFS_CH(*startChannelNum)) {
|
||||
while (!CDS_IS_DFS_CH(tmp_startChannelNum) &&
|
||||
if (wlan_reg_is_dfs_ch(mac_ctx->pdev, *startChannelNum)) {
|
||||
while (!wlan_reg_is_dfs_ch(mac_ctx->pdev,
|
||||
tmp_startChannelNum) &&
|
||||
tmp_startChannelNum < *startChannelNum)
|
||||
tmp_startChannelNum += ACS_WLAN_20M_CH_INC;
|
||||
|
||||
*startChannelNum = tmp_startChannelNum;
|
||||
}
|
||||
if (CDS_IS_DFS_CH(*endChannelNum)) {
|
||||
while (!CDS_IS_DFS_CH(tmp_endChannelNum) &&
|
||||
if (wlan_reg_is_dfs_ch(mac_ctx->pdev, *endChannelNum)) {
|
||||
while (!wlan_reg_is_dfs_ch(mac_ctx->pdev,
|
||||
tmp_endChannelNum) &&
|
||||
tmp_endChannelNum > *endChannelNum)
|
||||
tmp_endChannelNum -= ACS_WLAN_20M_CH_INC;
|
||||
|
||||
|
Ссылка в новой задаче
Block a user