@@ -771,8 +771,10 @@ COMMAND(switch, freq,
"<control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]] [beacons <count>] [block-tx]",
NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_freq,
"Switch the operating channel by sending a channel switch announcement (CSA).");
-COMMAND(switch, channel, "<channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons <count>] [block-tx]",
- NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_chan, NULL);
+COMMAND(switch, channel, "<channel> [6GHz] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons <count>] [block-tx]",
+ NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_chan,
+ "Switch the operating channel by sending a channel switch announcement (CSA)."
+ "6 GHz channels expects '6GHz' in argument. Defaults to 5 GHz or 2 GHz channels");
static int toggle_tid_param(const char *argv0, const char *argv1,
@@ -229,7 +229,7 @@ int parse_keys(struct nl_msg *msg, char **argv[], int *argc);
pfx _PARSE_FREQ_KHZ_ARGS_OPT1 sfx "\n" \
pfx _PARSE_FREQ_KHZ_ARGS_OPT2 sfx
#define PARSE_CHAN_ARGS(pfx) \
- pfx "<channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz] [punct <bitmap>]"
+ pfx "<channel> [6GHz] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz] [punct <bitmap>]"
int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
int *parsed, bool freq_in_khz);
enum nl80211_chan_width str_to_bw(const char *str);
@@ -593,7 +593,8 @@ static int parse_freqs(struct chandef *chandef, int argc, char **argv,
* user by giving "NOHT" instead.
*
* The working specifier if chan is set are:
- * <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]
+ * <channel> [6GHz] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]
+ * channel number defaults to 5 GHz or 2 GHz band unless 6GHz is specified.
*
* And if frequency is set:
* <freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]
@@ -697,7 +698,12 @@ int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
if (chan) {
enum nl80211_band band;
- band = freq <= 14 ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
+ if (argc > 1 && strcasecmp(argv[1], "6GHz") == 0) {
+ band = NL80211_BAND_6GHZ;
+ _parsed += 1;
+ } else {
+ band = freq <= 14 ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
+ }
freq = ieee80211_channel_to_frequency(freq, band);
}
chandef->control_freq = freq;
@@ -707,9 +713,9 @@ int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
chandef->center_freq1_offset = freq_offset;
/* Try to parse HT mode definitions */
- if (argc > 1) {
+ if ((argc - _parsed) > 0) {
for (i = 0; i < ARRAY_SIZE(chanmode); i++) {
- if (strcasecmp(chanmode[i].name, argv[1]) == 0) {
+ if (strcasecmp(chanmode[i].name, argv[_parsed]) == 0) {
chanmode_selected = &chanmode[i];
_parsed += 1;
break;