diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index f8a0665f2f62..734da57983ed 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -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, diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index f22ae640f27c..c41316abdd53 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -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);