qcacld-3.0: Fix 6G Channel DFS issue

1. Convert channel to frequency and use frequency
Regulatory API to check DFS status.
2. Skip dfs check for 6G channels.

Change-Id: I54b6d6a3ad25c192af4eec4e7f43932bada728b5
CRs-Fixed: 2580568
This commit is contained in:
Liangwei Dong 2019-12-05 16:46:13 +08:00 • committed by nshrivas
commit c2a9453efa
2 changed files with 44 additions and 22 deletions

View file

@ -153,8 +153,9 @@ void lim_process_mlm_start_cnf(struct mac_context *mac, uint32_t *msg_buf)
struct pe_session *pe_session = NULL;
tLimMlmStartCnf *pLimMlmStartCnf;
uint8_t smesessionId;
uint8_t channelId;
uint32_t chan_freq, ch_cfreq1 = 0;
uint8_t send_bcon_ind = false;
enum reg_wifi_band band;
if (!msg_buf) {
pe_err("Buffer is Pointing to NULL");
@ -207,8 +208,6 @@ void lim_process_mlm_start_cnf(struct mac_context *mac, uint32_t *msg_buf)
pe_session, smesessionId);
if (pe_session &&
(((tLimMlmStartCnf *)msg_buf)->resultCode == eSIR_SME_SUCCESS)) {
channelId = wlan_reg_freq_to_chan(mac->pdev,
pe_session->pLimStartBssReq->oper_ch_freq);
lim_ndi_mlme_vdev_up_transition(pe_session);
/* We should start beacon transmission only if the channel
@ -216,24 +215,36 @@ void lim_process_mlm_start_cnf(struct mac_context *mac, uint32_t *msg_buf)
* availability check is done. The PE will receive an explicit
* request from upper layers to start the beacon transmission
*/
chan_freq = pe_session->curr_op_freq;
band = wlan_reg_freq_to_band(pe_session->curr_op_freq);
if (pe_session->ch_center_freq_seg1)
ch_cfreq1 = wlan_reg_chan_band_to_freq(
mac->pdev,
pe_session->ch_center_freq_seg1,
BIT(band));
if (!(LIM_IS_IBSS_ROLE(pe_session) ||
(LIM_IS_AP_ROLE(pe_session))))
return;
if (pe_session->ch_width == CH_WIDTH_160MHZ) {
send_bcon_ind = false;
} else if (pe_session->ch_width == CH_WIDTH_80P80MHZ) {
if ((wlan_reg_get_channel_state(mac->pdev, channelId)
!= CHANNEL_STATE_DFS) &&
(wlan_reg_get_channel_state(mac->pdev,
pe_session->ch_center_freq_seg1 -
SIR_80MHZ_START_CENTER_CH_DIFF) !=
CHANNEL_STATE_DFS))
if ((wlan_reg_get_channel_state_for_freq(
mac->pdev, chan_freq) !=
CHANNEL_STATE_DFS) &&
(wlan_reg_get_channel_state_for_freq(
mac->pdev, ch_cfreq1) !=
CHANNEL_STATE_DFS))
send_bcon_ind = true;
} else {
if (wlan_reg_get_channel_state(mac->pdev, channelId)
if (wlan_reg_get_channel_state_for_freq(mac->pdev,
chan_freq)
!= CHANNEL_STATE_DFS)
send_bcon_ind = true;
}
if (WLAN_REG_IS_6GHZ_CHAN_FREQ(pe_session->curr_op_freq))
send_bcon_ind = true;
if (send_bcon_ind) {
/* Configure beacon and send beacons to HAL */
QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,

View file

@ -2497,7 +2497,9 @@ static QDF_STATUS sap_fsm_state_starting(struct sap_context *sap_ctx,
tSapDfsInfo *sap_dfs_info;
QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
uint8_t is_dfs = false;
uint8_t sap_chan;
uint32_t sap_chan_freq;
uint32_t ch_cfreq1 = 0;
enum reg_wifi_band band;
if (msg == eSAP_MAC_START_BSS_SUCCESS) {
/*
@ -2514,13 +2516,18 @@ static QDF_STATUS sap_fsm_state_starting(struct sap_context *sap_ctx,
qdf_status = sap_signal_hdd_event(sap_ctx, roam_info,
eSAP_START_BSS_EVENT,
(void *) eSAP_STATUS_SUCCESS);
sap_chan = wlan_reg_freq_to_chan(mac_ctx->pdev,
sap_ctx->chan_freq);
sap_chan_freq = sap_ctx->chan_freq;
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
FL("ap_ctx->ch_params.ch_width %d, channel %d"),
sap_ctx->ch_params.ch_width,
wlan_reg_get_channel_state(mac_ctx->pdev,
sap_chan));
wlan_reg_get_channel_state_for_freq(
mac_ctx->pdev, sap_chan_freq));
band = wlan_reg_freq_to_band(sap_ctx->chan_freq);
if (sap_ctx->ch_params.center_freq_seg1)
ch_cfreq1 = wlan_reg_chan_band_to_freq(
mac_ctx->pdev,
sap_ctx->ch_params.center_freq_seg1,
BIT(band));
/*
* The upper layers have been informed that AP is up and
@ -2530,20 +2537,24 @@ static QDF_STATUS sap_fsm_state_starting(struct sap_context *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 (wlan_reg_get_channel_state(mac_ctx->pdev,
sap_chan) ==
if (wlan_reg_get_channel_state_for_freq(
mac_ctx->pdev,
sap_chan_freq) ==
CHANNEL_STATE_DFS ||
wlan_reg_get_channel_state(mac_ctx->pdev,
sap_ctx->ch_params.center_freq_seg1 -
SIR_80MHZ_START_CENTER_CH_DIFF) ==
wlan_reg_get_channel_state_for_freq(
mac_ctx->pdev,
ch_cfreq1) ==
CHANNEL_STATE_DFS)
is_dfs = true;
} else {
if (wlan_reg_get_channel_state(mac_ctx->pdev,
sap_chan) ==
if (wlan_reg_get_channel_state_for_freq(
mac_ctx->pdev,
sap_chan_freq) ==
CHANNEL_STATE_DFS)
is_dfs = true;
}
if (WLAN_REG_IS_6GHZ_CHAN_FREQ(sap_ctx->chan_freq))
is_dfs = false;
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
FL("is_dfs %d"), is_dfs);