aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/subsys/321-mac80211_hwsim-make-6-GHz-channels-usable.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2021-05-24 11:52:40 +0200
committerFelix Fietkau <nbd@nbd.name>2021-05-26 11:48:14 +0200
commitdb072fdc9e1a93eacfc5402fed6ab796fdf205ed (patch)
tree1a782f76f7620873527653e4ff491d3f6aad5453 /package/kernel/mac80211/patches/subsys/321-mac80211_hwsim-make-6-GHz-channels-usable.patch
parentd76535c45e6e970b212744781431e152e90c1ce6 (diff)
downloadupstream-db072fdc9e1a93eacfc5402fed6ab796fdf205ed.tar.gz
upstream-db072fdc9e1a93eacfc5402fed6ab796fdf205ed.tar.bz2
upstream-db072fdc9e1a93eacfc5402fed6ab796fdf205ed.zip
mac80211: add 6 GHz support to mac80211_hwsim
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/kernel/mac80211/patches/subsys/321-mac80211_hwsim-make-6-GHz-channels-usable.patch')
-rw-r--r--package/kernel/mac80211/patches/subsys/321-mac80211_hwsim-make-6-GHz-channels-usable.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/subsys/321-mac80211_hwsim-make-6-GHz-channels-usable.patch b/package/kernel/mac80211/patches/subsys/321-mac80211_hwsim-make-6-GHz-channels-usable.patch
new file mode 100644
index 0000000000..4bac10eefe
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/321-mac80211_hwsim-make-6-GHz-channels-usable.patch
@@ -0,0 +1,74 @@
+From: Felix Fietkau <nbd@nbd.name>
+Date: Mon, 24 May 2021 11:46:09 +0200
+Subject: [PATCH] mac80211_hwsim: make 6 GHz channels usable
+
+The previous commit that claimed to add 6 GHz channels didn't actually make
+them usable, since the 6 GHz band was not registered with mac80211.
+
+Fixes: 28881922abd7 ("mac80211_hwsim: add 6GHz channels")
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+
+--- a/drivers/net/wireless/mac80211_hwsim.c
++++ b/drivers/net/wireless/mac80211_hwsim.c
+@@ -2968,15 +2968,19 @@ static void mac80211_hwsim_he_capab(stru
+ {
+ u16 n_iftype_data;
+
+- if (sband->band == NL80211_BAND_2GHZ) {
++ switch (sband->band) {
++ case NL80211_BAND_2GHZ:
+ n_iftype_data = ARRAY_SIZE(he_capa_2ghz);
+ sband->iftype_data =
+ (struct ieee80211_sband_iftype_data *)he_capa_2ghz;
+- } else if (sband->band == NL80211_BAND_5GHZ) {
++ break;
++ case NL80211_BAND_5GHZ:
++ case NL80211_BAND_6GHZ:
+ n_iftype_data = ARRAY_SIZE(he_capa_5ghz);
+ sband->iftype_data =
+ (struct ieee80211_sband_iftype_data *)he_capa_5ghz;
+- } else {
++ break;
++ default:
+ return;
+ }
+
+@@ -3265,6 +3269,12 @@ static int mac80211_hwsim_new_radio(stru
+ sband->vht_cap.vht_mcs.tx_mcs_map =
+ sband->vht_cap.vht_mcs.rx_mcs_map;
+ break;
++ case NL80211_BAND_6GHZ:
++ sband->channels = data->channels_6ghz;
++ sband->n_channels = ARRAY_SIZE(hwsim_channels_6ghz);
++ sband->bitrates = data->rates + 4;
++ sband->n_bitrates = ARRAY_SIZE(hwsim_rates) - 4;
++ break;
+ case NL80211_BAND_S1GHZ:
+ memcpy(&sband->s1g_cap, &hwsim_s1g_cap,
+ sizeof(sband->s1g_cap));
+@@ -3275,6 +3285,13 @@ static int mac80211_hwsim_new_radio(stru
+ continue;
+ }
+
++ mac80211_hwsim_he_capab(sband);
++
++ hw->wiphy->bands[band] = sband;
++
++ if (band == NL80211_BAND_6GHZ)
++ continue;
++
+ sband->ht_cap.ht_supported = true;
+ sband->ht_cap.cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
+ IEEE80211_HT_CAP_GRN_FLD |
+@@ -3288,10 +3305,6 @@ static int mac80211_hwsim_new_radio(stru
+ sband->ht_cap.mcs.rx_mask[0] = 0xff;
+ sband->ht_cap.mcs.rx_mask[1] = 0xff;
+ sband->ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED;
+-
+- mac80211_hwsim_he_capab(sband);
+-
+- hw->wiphy->bands[band] = sband;
+ }
+
+ /* By default all radios belong to the first group */