diff mbox series

mac80211_hwsim: indicate support for 60GHz channels

Message ID 20210413010613.50128-1-ramonreisfontes@gmail.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series mac80211_hwsim: indicate support for 60GHz channels | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Ramon Fontes April 13, 2021, 1:06 a.m. UTC
Advertise 60GHz channels to mac80211.
---
 drivers/net/wireless/mac80211_hwsim.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

Comments

Kalle Valo April 14, 2021, 6:54 a.m. UTC | #1
Ramon Fontes <ramonreisfontes@gmail.com> writes:

> Advertise 60GHz channels to mac80211.

SoB missing:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#signed-off-by_missing
Johannes Berg April 14, 2021, 7:20 a.m. UTC | #2
On Mon, 2021-04-12 at 22:06 -0300, Ramon Fontes wrote:
> Advertise 60GHz channels to mac80211.

This is wrong. mac80211 doesn't support 60 GHz operation.

johannes
Ramon Fontes April 14, 2021, 3:06 p.m. UTC | #3
> 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?
Johannes Berg April 14, 2021, 3:09 p.m. UTC | #4
On Wed, 2021-04-14 at 12:06 -0300, Ramon Fontes wrote:
> > 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
diff mbox series

Patch

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index fa7d4c20d..70d0af475 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -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));