qcacld-3.0: Define new_ch_width in csa_offload_params as phy_ch_width

Currently sme_switch_channel set new_ch_width as phy_ch_width, while
wma_csa_offload_handler set new_ch_width as raw bit in wide bandwidth
channel switch IE.
Clean up the code. Define new_ch_width in csa_offload_params as
phy_ch_width.

Change-Id: Iadecc7693bf4ffd9f9562405ef18ea9d25d45c9e
CRs-Fixed: 3324762
This commit is contained in:
Bing Sun
2022-10-31 17:02:07 +08:00
committed by Madan Koyyalamudi
parent 2079c4033e
commit 09b25d7556
5 changed files with 35 additions and 5 deletions

View File

@@ -1050,6 +1050,17 @@ QDF_STATUS mlme_update_tgt_he_caps_in_cfg(struct wlan_objmgr_psoc *psoc,
struct wma_tgt_cfg *cfg); struct wma_tgt_cfg *cfg);
#endif #endif
/**
* wlan_mlme_convert_vht_op_bw_to_phy_ch_width() - convert channel width in VHT
* operation IE to phy_ch_width
* @channel_width: channel width in VHT operation IE. If it is 0, please use HT
* information IE to check whether it is 20MHz or 40MHz.
*
* Return: phy_ch_width
*/
enum phy_ch_width wlan_mlme_convert_vht_op_bw_to_phy_ch_width(
uint8_t channel_width);
#ifdef WLAN_FEATURE_11BE #ifdef WLAN_FEATURE_11BE
/** /**
* mlme_update_tgt_eht_caps_in_cfg() - Update tgt eht cap in mlme component * mlme_update_tgt_eht_caps_in_cfg() - Update tgt eht cap in mlme component

View File

@@ -6359,3 +6359,18 @@ void wlan_mlme_get_feature_info(struct wlan_objmgr_psoc *psoc,
wlan_mlme_get_vht_enable2x2(psoc, &mlme_feature_set->enable2x2); wlan_mlme_get_vht_enable2x2(psoc, &mlme_feature_set->enable2x2);
} }
#endif #endif
enum phy_ch_width wlan_mlme_convert_vht_op_bw_to_phy_ch_width(
uint8_t channel_width)
{
enum phy_ch_width phy_bw = CH_WIDTH_40MHZ;
if (channel_width == WLAN_VHTOP_CHWIDTH_80)
phy_bw = CH_WIDTH_80MHZ;
else if (channel_width == WLAN_VHTOP_CHWIDTH_160)
phy_bw = CH_WIDTH_160MHZ;
else if (channel_width == WLAN_VHTOP_CHWIDTH_80_80)
phy_bw = CH_WIDTH_80P80MHZ;
return phy_bw;
}

View File

@@ -1544,13 +1544,13 @@ static QDF_STATUS lim_process_csa_wbw_ie(struct mac_context *mac_ctx,
struct pe_session *session_entry) struct pe_session *session_entry)
{ {
struct ch_params ch_params = {0}; struct ch_params ch_params = {0};
uint8_t ap_new_ch_width; enum phy_ch_width ap_new_ch_width;
uint8_t center_freq_diff; uint8_t center_freq_diff;
uint32_t fw_vht_ch_wd = wma_get_vht_ch_width() + 1; uint32_t fw_vht_ch_wd = wma_get_vht_ch_width() + 1;
uint32_t cent_freq1, cent_freq2; uint32_t cent_freq1, cent_freq2;
uint32_t csa_cent_freq, csa_cent_freq1 = 0, csa_cent_freq2 = 0; uint32_t csa_cent_freq, csa_cent_freq1 = 0, csa_cent_freq2 = 0;
ap_new_ch_width = csa_params->new_ch_width + 1; ap_new_ch_width = csa_params->new_ch_width;
if (!csa_params->new_ch_freq_seg1 && !csa_params->new_ch_freq_seg2) { if (!csa_params->new_ch_freq_seg1 && !csa_params->new_ch_freq_seg2) {
pe_err("CSA wide BW IE has invalid center freq"); pe_err("CSA wide BW IE has invalid center freq");

View File

@@ -16158,7 +16158,7 @@ QDF_STATUS sme_switch_channel(mac_handle_t mac_handle,
qdf_copy_macaddr(&csa_offload_event->bssid, bssid); qdf_copy_macaddr(&csa_offload_event->bssid, bssid);
csa_offload_event->csa_chan_freq = (uint32_t)chan_freq; csa_offload_event->csa_chan_freq = (uint32_t)chan_freq;
csa_offload_event->new_ch_width = (uint8_t)chan_width; csa_offload_event->new_ch_width = chan_width;
csa_offload_event->channel = csa_offload_event->channel =
wlan_reg_freq_to_chan(mac_ctx->pdev, wlan_reg_freq_to_chan(mac_ctx->pdev,
csa_offload_event->csa_chan_freq); csa_offload_event->csa_chan_freq);

View File

@@ -1455,7 +1455,9 @@ int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len)
if (csa_event->ies_present_flag & WMI_WBW_IE_PRESENT) { if (csa_event->ies_present_flag & WMI_WBW_IE_PRESENT) {
wb_ie = (struct ieee80211_ie_wide_bw_switch *) wb_ie = (struct ieee80211_ie_wide_bw_switch *)
(&csa_event->wb_ie[0]); (&csa_event->wb_ie[0]);
csa_offload_event->new_ch_width = wb_ie->new_ch_width; csa_offload_event->new_ch_width =
wlan_mlme_convert_vht_op_bw_to_phy_ch_width(
wb_ie->new_ch_width);
csa_offload_event->new_ch_freq_seg1 = wb_ie->new_ch_freq_seg1; csa_offload_event->new_ch_freq_seg1 = wb_ie->new_ch_freq_seg1;
csa_offload_event->new_ch_freq_seg2 = wb_ie->new_ch_freq_seg2; csa_offload_event->new_ch_freq_seg2 = wb_ie->new_ch_freq_seg2;
csa_offload_event->ies_present_flag |= MLME_WBW_IE_PRESENT; csa_offload_event->ies_present_flag |= MLME_WBW_IE_PRESENT;
@@ -1466,7 +1468,9 @@ int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len)
(uint8_t *)&csa_event->cswrap_ie_extended, (uint8_t *)&csa_event->cswrap_ie_extended,
WLAN_ELEMID_WIDE_BAND_CHAN_SWITCH); WLAN_ELEMID_WIDE_BAND_CHAN_SWITCH);
if (wb_ie) { if (wb_ie) {
csa_offload_event->new_ch_width = wb_ie->new_ch_width; csa_offload_event->new_ch_width =
wlan_mlme_convert_vht_op_bw_to_phy_ch_width(
wb_ie->new_ch_width);
csa_offload_event->new_ch_freq_seg1 = csa_offload_event->new_ch_freq_seg1 =
wb_ie->new_ch_freq_seg1; wb_ie->new_ch_freq_seg1;
csa_offload_event->new_ch_freq_seg2 = csa_offload_event->new_ch_freq_seg2 =