From edef44619bb11e682a4bfc8a1829cfc9f777321a Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Mon, 21 Sep 2020 23:48:51 +0530 Subject: [PATCH] qcacld-3.0: Do not fill 6GHz channels for legacy command Currently when driver receives the legacy get channel command, it fills all the channels which includes 6GHz channels also. This may lead to unexpected behaviour for the applications which does not have support for the 6GHz channels. To address above issue, do not add 6Ghz channels in the output of the get channels command. Change-Id: I87beea4e80906846fa5d1d1076792385d4424297 CRs-Fixed: 2782638 --- core/hdd/src/wlan_hdd_hostapd_wext.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd_wext.c b/core/hdd/src/wlan_hdd_hostapd_wext.c index fe05232d3f16..cb4ea279c89b 100644 --- a/core/hdd/src/wlan_hdd_hostapd_wext.c +++ b/core/hdd/src/wlan_hdd_hostapd_wext.c @@ -1951,11 +1951,25 @@ static int iw_get_channel_list(struct net_device *dev, } for (i = 0; i < NUM_CHANNELS; i++) { - if (!(cur_chan_list[i].chan_flags & REGULATORY_CHAN_DISABLED)) { - channel_list->channels[num_channels] = - cur_chan_list[i].chan_num; - num_channels++; - } + /* + * current channel list includes all channels. do not report + * disabled channels + */ + if (cur_chan_list[i].chan_flags & REGULATORY_CHAN_DISABLED) + continue; + + /* + * do not include 6 GHz channels since they are ambiguous with + * 2.4 GHz and 5 GHz channels. 6 GHz-aware applications should + * not be using this interface, but instead should be using the + * frequency-based interface + */ + if (wlan_reg_is_6ghz_chan_freq(cur_chan_list[i].center_freq)) + continue; + channel_list->channels[num_channels] = + cur_chan_list[i].chan_num; + num_channels++; + } qdf_mem_free(cur_chan_list);