qcacld-3.0: Cleanup for function wlan_reg_is_dfs_ch()
Replace wlan_reg_is_dfs_ch() with wlan_reg_is_dfs_for_freq() Change-Id: Ifa62248169ad7b8ff1c62cab44c92d99a8db0e45 CRs-Fixed: 2609311
This commit is contained in:

committed by
nshrivas

parent
db47e1d060
commit
fc875ea635
@@ -1710,6 +1710,7 @@ static QDF_STATUS tdls_config_force_peer(
|
|||||||
const uint8_t *macaddr;
|
const uint8_t *macaddr;
|
||||||
uint32_t feature;
|
uint32_t feature;
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
|
uint32_t chan_freq;
|
||||||
struct tdls_peer_update_state *peer_update_param;
|
struct tdls_peer_update_state *peer_update_param;
|
||||||
|
|
||||||
macaddr = req->peer_addr;
|
macaddr = req->peer_addr;
|
||||||
@@ -1767,9 +1768,10 @@ static QDF_STATUS tdls_config_force_peer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
soc_obj->tdls_external_peer_count++;
|
soc_obj->tdls_external_peer_count++;
|
||||||
|
chan_freq = wlan_reg_legacy_chan_to_freq(pdev, req->chan);
|
||||||
|
|
||||||
/* Validate if off channel is DFS channel */
|
/* Validate if off channel is DFS channel */
|
||||||
if (wlan_reg_is_dfs_ch(pdev, req->chan)) {
|
if (wlan_reg_is_dfs_for_freq(pdev, chan_freq)) {
|
||||||
tdls_err("Resetting TDLS off-channel from %d to %d",
|
tdls_err("Resetting TDLS off-channel from %d to %d",
|
||||||
req->chan, WLAN_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEF);
|
req->chan, WLAN_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEF);
|
||||||
req->chan = WLAN_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEF;
|
req->chan = WLAN_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEF;
|
||||||
|
@@ -477,6 +477,7 @@ void tdls_extract_peer_state_param(struct tdls_peer_update_state *peer_param,
|
|||||||
struct wlan_objmgr_pdev *pdev;
|
struct wlan_objmgr_pdev *pdev;
|
||||||
uint8_t chan_id;
|
uint8_t chan_id;
|
||||||
enum band_info cur_band = BAND_ALL;
|
enum band_info cur_band = BAND_ALL;
|
||||||
|
qdf_freq_t ch_freq;
|
||||||
|
|
||||||
vdev_obj = peer->vdev_priv;
|
vdev_obj = peer->vdev_priv;
|
||||||
soc_obj = wlan_vdev_get_tdls_soc_obj(vdev_obj->vdev);
|
soc_obj = wlan_vdev_get_tdls_soc_obj(vdev_obj->vdev);
|
||||||
@@ -516,7 +517,10 @@ void tdls_extract_peer_state_param(struct tdls_peer_update_state *peer_param,
|
|||||||
peer_param->peer_cap.pref_off_channum = 0;
|
peer_param->peer_cap.pref_off_channum = 0;
|
||||||
peer_param->peer_cap.opclass_for_prefoffchan = 0;
|
peer_param->peer_cap.opclass_for_prefoffchan = 0;
|
||||||
}
|
}
|
||||||
if (wlan_reg_is_dfs_ch(pdev, peer_param->peer_cap.pref_off_channum)) {
|
|
||||||
|
ch_freq = wlan_reg_legacy_chan_to_freq(pdev,
|
||||||
|
peer_param->peer_cap.pref_off_channum);
|
||||||
|
if (wlan_reg_is_dfs_for_freq(pdev, ch_freq)) {
|
||||||
tdls_err("Resetting TDLS off-channel from %d to %d",
|
tdls_err("Resetting TDLS off-channel from %d to %d",
|
||||||
peer_param->peer_cap.pref_off_channum,
|
peer_param->peer_cap.pref_off_channum,
|
||||||
WLAN_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEF);
|
WLAN_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEF);
|
||||||
|
@@ -16205,7 +16205,7 @@ void hdd_check_and_restart_sap_with_non_dfs_acs(void)
|
|||||||
restart_chan = wlan_reg_freq_to_chan(hdd_ctx->pdev,
|
restart_chan = wlan_reg_freq_to_chan(hdd_ctx->pdev,
|
||||||
restart_freq);
|
restart_freq);
|
||||||
if (!restart_chan ||
|
if (!restart_chan ||
|
||||||
wlan_reg_is_dfs_ch(hdd_ctx->pdev, restart_chan))
|
wlan_reg_is_dfs_for_freq(hdd_ctx->pdev, restart_freq))
|
||||||
restart_chan = SAP_DEFAULT_5GHZ_CHANNEL;
|
restart_chan = SAP_DEFAULT_5GHZ_CHANNEL;
|
||||||
wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc, ap_adapter->vdev_id,
|
wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc, ap_adapter->vdev_id,
|
||||||
CSA_REASON_STA_CONNECT_DFS_TO_NON_DFS);
|
CSA_REASON_STA_CONNECT_DFS_TO_NON_DFS);
|
||||||
|
@@ -202,6 +202,7 @@ static void populate_dot11f_tdls_offchannel_params(
|
|||||||
uint32_t band;
|
uint32_t band;
|
||||||
uint8_t nss_2g;
|
uint8_t nss_2g;
|
||||||
uint8_t nss_5g;
|
uint8_t nss_5g;
|
||||||
|
qdf_freq_t ch_freq;
|
||||||
|
|
||||||
numChans = mac->mlme_cfg->reg.valid_channel_list_num;
|
numChans = mac->mlme_cfg->reg.valid_channel_list_num;
|
||||||
|
|
||||||
@@ -222,10 +223,11 @@ static void populate_dot11f_tdls_offchannel_params(
|
|||||||
|
|
||||||
/* validating the channel list for DFS and 2G channels */
|
/* validating the channel list for DFS and 2G channels */
|
||||||
for (i = 0U; i < numChans; i++) {
|
for (i = 0U; i < numChans; i++) {
|
||||||
|
ch_freq = wlan_reg_legacy_chan_to_freq(mac->pdev, validChan[i]);
|
||||||
if ((band == BAND_5G) &&
|
if ((band == BAND_5G) &&
|
||||||
(NSS_2x2_MODE == nss_5g) &&
|
(NSS_2x2_MODE == nss_5g) &&
|
||||||
(NSS_1x1_MODE == nss_2g) &&
|
(NSS_1x1_MODE == nss_2g) &&
|
||||||
(wlan_reg_is_dfs_ch(mac->pdev, validChan[i]))) {
|
(wlan_reg_is_dfs_for_freq(mac->pdev, ch_freq))) {
|
||||||
pe_debug("skipping channel: %d, nss_5g: %d, nss_2g: %d",
|
pe_debug("skipping channel: %d, nss_5g: %d, nss_2g: %d",
|
||||||
validChan[i], nss_5g, nss_2g);
|
validChan[i], nss_5g, nss_2g);
|
||||||
continue;
|
continue;
|
||||||
|
@@ -463,7 +463,8 @@ static bool sap_chan_sel_init(mac_handle_t mac_handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!include_dfs_ch || sta_sap_scc_on_dfs_chan) {
|
if (!include_dfs_ch || sta_sap_scc_on_dfs_chan) {
|
||||||
if (wlan_reg_is_dfs_ch(mac->pdev, channel)) {
|
if (wlan_reg_is_dfs_for_freq(mac->pdev,
|
||||||
|
pSpectCh->chan_freq)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_SAP,
|
QDF_TRACE(QDF_MODULE_ID_SAP,
|
||||||
QDF_TRACE_LEVEL_INFO_HIGH,
|
QDF_TRACE_LEVEL_INFO_HIGH,
|
||||||
"In %s, DFS Ch %d not considered for ACS. include_dfs_ch %u, sta_sap_scc_on_dfs_chan %d",
|
"In %s, DFS Ch %d not considered for ACS. include_dfs_ch %u, sta_sap_scc_on_dfs_chan %d",
|
||||||
|
@@ -515,9 +515,8 @@ void sap_dfs_set_current_channel(void *ctx)
|
|||||||
sme_get_beaconing_concurrent_operation_channel(
|
sme_get_beaconing_concurrent_operation_channel(
|
||||||
handle, sap_ctx->sessionId);
|
handle, sap_ctx->sessionId);
|
||||||
if (!con_ch_freq ||
|
if (!con_ch_freq ||
|
||||||
!wlan_reg_is_dfs_ch(pdev,
|
!wlan_reg_is_dfs_for_freq(pdev,
|
||||||
wlan_reg_freq_to_chan(pdev,
|
con_ch_freq))
|
||||||
con_ch_freq)))
|
|
||||||
tgt_dfs_get_radars(pdev);
|
tgt_dfs_get_radars(pdev);
|
||||||
} else {
|
} else {
|
||||||
tgt_dfs_get_radars(pdev);
|
tgt_dfs_get_radars(pdev);
|
||||||
@@ -1884,6 +1883,7 @@ static QDF_STATUS sap_cac_start_notify(mac_handle_t mac_handle)
|
|||||||
uint8_t intf = 0;
|
uint8_t intf = 0;
|
||||||
struct mac_context *mac = MAC_CONTEXT(mac_handle);
|
struct mac_context *mac = MAC_CONTEXT(mac_handle);
|
||||||
QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
|
QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
|
||||||
|
qdf_freq_t ch_freq;
|
||||||
|
|
||||||
for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
|
for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
|
||||||
struct sap_context *sap_context =
|
struct sap_context *sap_context =
|
||||||
@@ -1897,9 +1897,10 @@ static QDF_STATUS sap_cac_start_notify(mac_handle_t mac_handle)
|
|||||||
(false == sap_context->isCacStartNotified)) {
|
(false == sap_context->isCacStartNotified)) {
|
||||||
/* Don't start CAC for non-dfs channel, its violation */
|
/* Don't start CAC for non-dfs channel, its violation */
|
||||||
profile = &sap_context->csr_roamProfile;
|
profile = &sap_context->csr_roamProfile;
|
||||||
if (!wlan_reg_is_dfs_ch(mac->pdev,
|
ch_freq = wlan_reg_legacy_chan_to_freq(mac->pdev,
|
||||||
wlan_reg_freq_to_chan(mac->pdev,
|
profile->op_freq);
|
||||||
profile->op_freq)))
|
if (!wlan_reg_is_dfs_for_freq(mac->pdev,
|
||||||
|
ch_freq))
|
||||||
continue;
|
continue;
|
||||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED,
|
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED,
|
||||||
"sapdfs: Signaling eSAP_DFS_CAC_START to HDD for sapctx[%pK]",
|
"sapdfs: Signaling eSAP_DFS_CAC_START to HDD for sapctx[%pK]",
|
||||||
@@ -2184,7 +2185,9 @@ static QDF_STATUS sap_goto_starting(struct sap_context *sap_ctx,
|
|||||||
*/
|
*/
|
||||||
if ((!policy_mgr_is_hw_dbs_capable(mac_ctx->psoc) ||
|
if ((!policy_mgr_is_hw_dbs_capable(mac_ctx->psoc) ||
|
||||||
WLAN_REG_IS_5GHZ_CH_FREQ(sap_ctx->chan_freq)) &&
|
WLAN_REG_IS_5GHZ_CH_FREQ(sap_ctx->chan_freq)) &&
|
||||||
con_ch && wlan_reg_is_dfs_ch(mac_ctx->pdev, con_ch)) {
|
con_ch &&
|
||||||
|
wlan_reg_is_dfs_for_freq(mac_ctx->pdev,
|
||||||
|
con_ch_freq)) {
|
||||||
sap_ctx->chan_freq = con_ch_freq;
|
sap_ctx->chan_freq = con_ch_freq;
|
||||||
wlan_reg_set_channel_params_for_freq(
|
wlan_reg_set_channel_params_for_freq(
|
||||||
mac_ctx->pdev,
|
mac_ctx->pdev,
|
||||||
@@ -3775,14 +3778,16 @@ bool sap_is_conc_sap_doing_scc_dfs(mac_handle_t mac_handle,
|
|||||||
struct mac_context *mac = MAC_CONTEXT(mac_handle);
|
struct mac_context *mac = MAC_CONTEXT(mac_handle);
|
||||||
struct sap_context *sap_ctx;
|
struct sap_context *sap_ctx;
|
||||||
uint8_t intf = 0, scc_dfs_counter = 0;
|
uint8_t intf = 0, scc_dfs_counter = 0;
|
||||||
|
qdf_freq_t ch_freq;
|
||||||
|
|
||||||
|
ch_freq = wlan_reg_legacy_chan_to_freq(mac->pdev,
|
||||||
|
given_sapctx->csr_roamProfile.op_freq);
|
||||||
/*
|
/*
|
||||||
* current SAP persona's channel itself is not DFS, so no need to check
|
* current SAP persona's channel itself is not DFS, so no need to check
|
||||||
* what other persona's channel is
|
* what other persona's channel is
|
||||||
*/
|
*/
|
||||||
if (!wlan_reg_is_dfs_ch(mac->pdev,
|
if (!wlan_reg_is_dfs_for_freq(mac->pdev,
|
||||||
wlan_reg_freq_to_chan(mac->pdev,
|
ch_freq)) {
|
||||||
given_sapctx->csr_roamProfile.op_freq))) {
|
|
||||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG,
|
||||||
FL("skip this loop as provided channel is non-dfs"));
|
FL("skip this loop as provided channel is non-dfs"));
|
||||||
return false;
|
return false;
|
||||||
|
@@ -1097,9 +1097,8 @@ static void csr_roam_arrange_ch_list(struct mac_context *mac_ctx,
|
|||||||
/* Fist copy Non-DFS 5g channels */
|
/* Fist copy Non-DFS 5g channels */
|
||||||
for (i = 0; i < num_channel; i++) {
|
for (i = 0; i < num_channel; i++) {
|
||||||
if (WLAN_REG_IS_5GHZ_CH_FREQ(chan_list[i].freq) &&
|
if (WLAN_REG_IS_5GHZ_CH_FREQ(chan_list[i].freq) &&
|
||||||
!wlan_reg_is_dfs_ch(mac_ctx->pdev,
|
!wlan_reg_is_dfs_for_freq(mac_ctx->pdev,
|
||||||
wlan_reg_freq_to_chan
|
chan_list[i].freq)) {
|
||||||
(mac_ctx->pdev, chan_list[i].freq))) {
|
|
||||||
qdf_mem_copy(&tmp_list[j++],
|
qdf_mem_copy(&tmp_list[j++],
|
||||||
&chan_list[i], sizeof(tSirUpdateChanParam));
|
&chan_list[i], sizeof(tSirUpdateChanParam));
|
||||||
chan_list[i].freq = 0;
|
chan_list[i].freq = 0;
|
||||||
|
@@ -2829,7 +2829,9 @@ QDF_STATUS wma_vdev_pre_start(uint8_t vdev_id, bool restart)
|
|||||||
* enable the firmware flag here.
|
* enable the firmware flag here.
|
||||||
*/
|
*/
|
||||||
if (QDF_GLOBAL_MONITOR_MODE != cds_get_conparam() &&
|
if (QDF_GLOBAL_MONITOR_MODE != cds_get_conparam() &&
|
||||||
utils_is_dfs_ch(wma->pdev, des_chan->ch_ieee))
|
utils_is_dfs_chan_for_freq(wma->pdev,
|
||||||
|
wlan_reg_legacy_chan_to_freq(wma->pdev,
|
||||||
|
des_chan->ch_ieee)))
|
||||||
mlme_obj->mgmt.generic.disable_hw_ack = true;
|
mlme_obj->mgmt.generic.disable_hw_ack = true;
|
||||||
|
|
||||||
if (mlme_obj->mgmt.rate_info.bcn_tx_rate) {
|
if (mlme_obj->mgmt.rate_info.bcn_tx_rate) {
|
||||||
|
Reference in New Issue
Block a user