Skip to contentSkip to conversation

mac80211_hwsim: indicate support for 60GHz channels

PATCH In review Ramon Fontes 3 participants 5 messages Apr 13, 2021 – Apr 14, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211_hwsim: indicate support for 60GHz channels

Advertise 60GHz channels to mac80211.

---
 drivers/net/wireless/mac80211_hwsim.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
drivers/net/wireless/mac80211_hwsim.c +20 -1
index fa7d4c20d..70d0af475 100644
@@ -159,6 +159,8 @@ static const struct ieee80211_regdomain hwsim_world_regdom_custom_01 = {
 		REG_RULE(5150-10, 5240+10, 40, 0, 30, 0),
 		REG_RULE(5745-10, 5825+10, 40, 0, 30, 0),
 		REG_RULE(5855-10, 5925+10, 40, 0, 33, 0),
+		/* IEEE 802.11ad (60GHz), channels 1..3 */
+		REG_RULE(56160+2160*1-1080, 56160+2160*3+1080, 2160, 0, 0, 0),
 	}
 };
 
@@ -317,6 +319,12 @@ static struct net_device *hwsim_mon; /* global monitor netdev */
 	.hw_value = (_freq), \
 }
 
+#define CHAN60G(_freq) { \
+        .band = NL80211_BAND_60GHZ, \
+        .center_freq = (_freq), \
+        .hw_value = (_freq), \
+}
+
 static const struct ieee80211_channel hwsim_channels_2ghz[] = {
 	CHAN2G(2412), /* Channel 1 */
 	CHAN2G(2417), /* Channel 2 */
@@ -445,6 +453,13 @@ static const struct ieee80211_channel hwsim_channels_6ghz[] = {
 	CHAN6G(7115), /* Channel 233 */
 };
 
+static const struct ieee80211_channel hwsim_channels_60ghz[] = {
+	CHAN60G(58320), /* Channel 1 */
+	CHAN60G(60480), /* Channel 2 */
+	CHAN60G(62640), /* Channel 3 */
+	CHAN60G(64800), /* Channel 4 */
+};
+
 #define NUM_S1G_CHANS_US 51
 static struct ieee80211_channel hwsim_channels_s1g[NUM_S1G_CHANS_US];
 
@@ -617,6 +632,7 @@ struct mac80211_hwsim_data {
 	struct ieee80211_channel channels_2ghz[ARRAY_SIZE(hwsim_channels_2ghz)];
 	struct ieee80211_channel channels_5ghz[ARRAY_SIZE(hwsim_channels_5ghz)];
 	struct ieee80211_channel channels_6ghz[ARRAY_SIZE(hwsim_channels_6ghz)];
+	struct ieee80211_channel channels_60ghz[ARRAY_SIZE(hwsim_channels_60ghz)];
 	struct ieee80211_channel channels_s1g[ARRAY_SIZE(hwsim_channels_s1g)];
 	struct ieee80211_rate rates[ARRAY_SIZE(hwsim_rates)];
 	struct ieee80211_iface_combination if_combination;
@@ -648,7 +664,8 @@ struct mac80211_hwsim_data {
 		unsigned long next_start, start, end;
 	} survey_data[ARRAY_SIZE(hwsim_channels_2ghz) +
 		      ARRAY_SIZE(hwsim_channels_5ghz) +
-		      ARRAY_SIZE(hwsim_channels_6ghz)];
+		      ARRAY_SIZE(hwsim_channels_6ghz) +
+		      ARRAY_SIZE(hwsim_channels_60ghz)];
 
 	struct ieee80211_channel *channel;
 	u64 beacon_int	/* beacon interval in us */;
@@ -3221,6 +3238,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
 		sizeof(hwsim_channels_5ghz));
 	memcpy(data->channels_6ghz, hwsim_channels_6ghz,
 		sizeof(hwsim_channels_6ghz));
+	memcpy(data->channels_60ghz, hwsim_channels_60ghz,
+		sizeof(hwsim_channels_60ghz));
 	memcpy(data->channels_s1g, hwsim_channels_s1g,
 	       sizeof(hwsim_channels_s1g));
 	memcpy(data->rates, hwsim_rates, sizeof(hwsim_rates));
Signature · 1 line
2.25.1
#3 lore raw
Quoted 1 line

Advertise 60GHz channels to mac80211.

Oh.. That was a mistake. Sorry for that.

Anyway, can we indicate 60GHz support even though it is not being supported by mac80211 yet?

maintainer
#4 lore raw
Quoted 6 lines · Ramon Fontes
Quoted 1 line

Advertise 60GHz channels to mac80211.

Oh.. That was a mistake. Sorry for that.

Anyway, can we indicate 60GHz support even though it is not being supported by mac80211 yet?

No, that makes no sense. DMG operation is significantly different from non-DMG operation, even the A-MSDU format for example (an abbreviated format called "short A-MSDU" is used in DMG). Similarly beacons, etc., all kinds of operations are significantly different.

Adding 60 GHz channels to hwsim would be essentially operating as non- DMG yet on a DMG channel, which makes no sense.

I don't think anyone's planning to add DMG support to mac80211, and in the absence of a real driver requiring that it wouldn't make sense anyway. Quite possibly, it simply doesn't make sense period, because DMG operation is sufficiently different.

johannes