Browse Source

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
Ashish Kumar Dhanotiya 4 years ago
parent
commit
edef44619b
1 changed files with 19 additions and 5 deletions
  1. 19 5
      core/hdd/src/wlan_hdd_hostapd_wext.c

+ 19 - 5
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);