summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgaurank kathpalia <gkathpal@codeaurora.org>2019-12-11 22:24:25 +0530
committerchenpaul <chenpaul@google.com>2020-03-12 13:35:26 +0800
commit4f5090d6677e6bbdc1fc2a9ed6c37f429dbc8059 (patch)
tree3f9d363b839641dea9c7a1ab92eb02f1b70b7a65
parent923c79846a2c51f18e484e77787ddd6fd4297694 (diff)
downloadqcacld-4f5090d6677e6bbdc1fc2a9ed6c37f429dbc8059.tar.gz
qcacld-3.0: Set max BW for each valid channel and send to FW
Configuration for Issue:- DUT configuration:- 1. Configure DUT's country as US where channel 165 does not support channel bandwidth of 40 mhz. AP Configuration:- 1 Configure the AP in a country where channel 165 supports channel bandwidth 40MHZ. Scenario of the issue:- 1.Connect to a diff AP on some channel x with same SSID, and then roam to this AP. Observation:- The DUT would connect in 40 mhz to this AP instead of 20Mhz, which violates the DUT's country reg rules. Expectation:- The DUT should re-connect only in 20Mhz on channel 165, or only in max BW supported by reg in that country. Issue:- The DUT does not consider the max bandwidth allowed for the channel in the country configured, and allow the re-association only in the respective bandwidth. Fix:- Send the max BW supported by the channels in the current reg domain to the FW so that it considers the max BW of the channel and AP capability and then roam in the respective BW only. Bug: 144319790 Change-Id: I1730d6c65d3dd305dcf2ebe340c3d5ad950761d7 CRs-Fixed: 2504900
-rw-r--r--core/wma/src/wma_scan_roam.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index de91bd1b2a..cf0ebf3da1 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -105,6 +105,27 @@ enum extscan_report_events_type {
#define WMA_EXTSCAN_MAX_HOTLIST_ENTRIES 10
#endif
+static inline wmi_host_channel_width
+wma_map_phy_ch_bw_to_wmi_channel_width(enum phy_ch_width ch_width)
+{
+ switch (ch_width) {
+ case CH_WIDTH_20MHZ:
+ return WMI_HOST_CHAN_WIDTH_20;
+ case CH_WIDTH_40MHZ:
+ return WMI_HOST_CHAN_WIDTH_40;
+ case CH_WIDTH_80MHZ:
+ return WMI_HOST_CHAN_WIDTH_80;
+ case CH_WIDTH_160MHZ:
+ return WMI_HOST_CHAN_WIDTH_160;
+ case CH_WIDTH_5MHZ:
+ return WMI_HOST_CHAN_WIDTH_5;
+ case CH_WIDTH_10MHZ:
+ return WMI_HOST_CHAN_WIDTH_10;
+ default:
+ return WMI_HOST_CHAN_WIDTH_20;
+ }
+}
+
/**
* wma_update_channel_list() - update channel list
* @handle: wma handle
@@ -122,6 +143,7 @@ QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
int i;
struct scan_chan_list_params scan_ch_param = {0};
wmi_channel_param *tchan_info;
+ struct ch_params ch_params = {0};
scan_ch_param.chan_info = qdf_mem_malloc(sizeof(wmi_channel) *
chan_list->numChan);
@@ -134,6 +156,7 @@ QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
WMA_LOGD("no of channels = %d", chan_list->numChan);
tchan_info = scan_ch_param.chan_info;
scan_ch_param.num_scan_chans = chan_list->numChan;
+ scan_ch_param.max_bw_support_present = true;
wma_handle->saved_chan.num_channels = chan_list->numChan;
WMA_LOGD("ht %d, vht %d, vht_24 %d", chan_list->ht_en,
chan_list->vht_en, chan_list->vht_24_en);
@@ -188,6 +211,15 @@ QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
WMI_SET_CHANNEL_REG_POWER(tchan_info,
chan_list->chanParam[i].pwr);
+
+ ch_params.ch_width = CH_WIDTH_160MHZ;
+ wlan_reg_set_channel_params(wma_handle->pdev,
+ chan_list->chanParam[i].chanId, 0,
+ &ch_params);
+ WMI_SET_CHANNEL_MAX_BANDWIDTH(tchan_info,
+ wma_map_phy_ch_bw_to_wmi_channel_width(
+ ch_params.ch_width));
+
tchan_info++;
}