summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgaurank kathpalia <gkathpal@codeaurora.org>2019-12-05 14:36:13 +0530
committerIsaac Chiou <isaacchiou@google.com>2020-03-16 16:24:11 +0800
commit04a46e1524efb2a4cdef943ddd8c7b652b7247b8 (patch)
tree027577501ae7ee96942707e4553d84cce06e72b1
parentefbcdd22e1139b6782ff121cf28d601384f78cdc (diff)
downloadqcacld-04a46e1524efb2a4cdef943ddd8c7b652b7247b8.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 Bug: 150182909 Change-Id: I1730d6c65d3dd305dcf2ebe340c3d5ad950761d7 CRs-Fixed: 2504900
-rw-r--r--core/wma/src/wma_scan_roam.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index daf0bc2847..2a3bf4b0a9 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -715,6 +715,27 @@ error:
return qdf_status;
}
+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
@@ -732,6 +753,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_s ch_params = {0};
scan_ch_param.chan_info = qdf_mem_malloc(sizeof(wmi_channel) *
chan_list->numChan);
@@ -744,6 +766,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);
@@ -798,6 +821,14 @@ 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;
+ cds_set_channel_params(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++;
}