All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 01/10] cfg80211: add a helper to identify 6 GHz PSCs
@ 2020-05-28  9:44 Johannes Berg
  2020-05-28  9:44 ` [RFC 02/10] ieee80211: definitions for reduced neighbor reports Johannes Berg
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Johannes Berg @ 2020-05-28  9:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This allows identifying whether or not a channel is a PSC
(preferred scanning channel).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/net/cfg80211.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e2dbc9c02ef3..a38653358885 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -5277,6 +5277,21 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq)
 	return ieee80211_get_channel_khz(wiphy, MHZ_TO_KHZ(freq));
 }
 
+/**
+ * cfg80211_channel_is_psc - Check if the channel is a 6 GHz PSC
+ * @chan: control channel to check
+ *
+ * The Preferred Scanning Channels (PSC) are defined in
+ * Draft IEEE P802.11ax/D5.0, 26.17.2.3.3
+ */
+static inline bool cfg80211_channel_is_psc(struct ieee80211_channel *chan)
+{
+	if (chan->band != NL80211_BAND_6GHZ)
+		return false;
+
+	return ieee80211_frequency_to_channel(chan->center_freq) % 16 == 5;
+}
+
 /**
  * ieee80211_get_response_rate - get basic rate for a given rate
  *
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [RFC 02/10] ieee80211: definitions for reduced neighbor reports
  2020-05-28  9:44 [RFC 01/10] cfg80211: add a helper to identify 6 GHz PSCs Johannes Berg
@ 2020-05-28  9:44 ` Johannes Berg
  2020-05-28  9:44 ` [RFC 03/10] ieee80211: add code to obtain and parse 6 GHz operation field Johannes Berg
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Johannes Berg @ 2020-05-28  9:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: Tova Mussai

From: Tova Mussai <tova.mussai@intel.com>

Add the necessary definitions to parse reduced neighbor
report elements.

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
[change struct name, remove IEEE80211_MIN_AP_NEIGHBOR_INFO_SIZE]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/linux/ieee80211.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 0320ca4c7d28..c29184bf9416 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -2754,6 +2754,8 @@ enum ieee80211_eid {
 	WLAN_EID_QUIET_CHANNEL = 198,
 	WLAN_EID_OPMODE_NOTIF = 199,
 
+	WLAN_EID_REDUCED_NEIGHBOR_REPORT = 201,
+
 	WLAN_EID_S1G_BCN_COMPAT = 213,
 	WLAN_EID_S1G_SHORT_BCN_INTERVAL = 214,
 	WLAN_EID_S1G_CAPABILITIES = 217,
@@ -3675,4 +3677,30 @@ static inline bool for_each_element_completed(const struct element *element,
 #define WLAN_RSNX_CAPA_PROTECTED_TWT BIT(4)
 #define WLAN_RSNX_CAPA_SAE_H2E BIT(5)
 
+/*
+ * reduced neighbor report, based on Draft P802.11ax_D5.0,
+ * section 9.4.2.170
+ */
+#define IEEE80211_AP_INFO_TBTT_HDR_TYPE				0x03
+#define IEEE80211_AP_INFO_TBTT_HDR_FILTERED			0x04
+#define IEEE80211_AP_INFO_TBTT_HDR_COLOC			0x08
+#define IEEE80211_AP_INFO_TBTT_HDR_COUNT			0xF0
+#define IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM		8
+#define IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID_BSS_PARAM	12
+
+#define IEEE80211_RNR_TBTT_PARAMS_OCT_RECOMMENDED		0x01
+#define IEEE80211_RNR_TBTT_PARAMS_SAME_SSID			0x02
+#define IEEE80211_RNR_TBTT_PARAMS_MULTI_BSSID			0x04
+#define IEEE80211_RNR_TBTT_PARAMS_TRANSMITTED_BSSID		0x08
+#define IEEE80211_RNR_TBTT_PARAMS_COLOC_ESS			0x10
+#define IEEE80211_RNR_TBTT_PARAMS_PROBE_ACTIVE			0x20
+#define IEEE80211_RNR_TBTT_PARAMS_COLOC_AP			0x40
+
+struct ieee80211_neighbor_ap_info {
+       u8 tbtt_info_hdr;
+       u8 tbtt_info_len;
+       u8 op_class;
+       u8 channel;
+} __packed;
+
 #endif /* LINUX_IEEE80211_H */
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [RFC 03/10] ieee80211: add code to obtain and parse 6 GHz operation field
  2020-05-28  9:44 [RFC 01/10] cfg80211: add a helper to identify 6 GHz PSCs Johannes Berg
  2020-05-28  9:44 ` [RFC 02/10] ieee80211: definitions for reduced neighbor reports Johannes Berg
@ 2020-05-28  9:44 ` Johannes Berg
  2020-05-28  9:44 ` [RFC 04/10] ieee80211: add HE ext EIDs and 6 GHz capability defines Johannes Berg
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Johannes Berg @ 2020-05-28  9:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Add some code to obtain and parse the 6 GHz operation field
inside the HE operation element.

While at it, fix the required length using sizeof() the new
struct, which is 5 instead of 4 now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/linux/ieee80211.h | 52 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 51 insertions(+), 1 deletion(-)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index c29184bf9416..d9616e03672a 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -2209,6 +2209,28 @@ ieee80211_he_ppe_size(u8 ppe_thres_hdr, const u8 *phy_cap_info)
 #define IEEE80211_HE_OPERATION_PARTIAL_BSS_COLOR		0x40000000
 #define IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED		0x80000000
 
+/**
+ * ieee80211_he_6ghz_oper - HE 6 GHz operation Information field
+ * @primary: primary channel
+ * @control: control flags
+ * @ccfs0: channel center frequency segment 0
+ * @ccfs1: channel center frequency segment 1
+ * @minrate: minimum rate (in 1 Mbps units)
+ */
+struct ieee80211_he_6ghz_oper {
+	u8 primary;
+#define IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH	0x3
+#define		IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_20MHZ	0
+#define		IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_40MHZ	1
+#define		IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_80MHZ	2
+#define		IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_160MHZ	3
+#define IEEE80211_HE_6GHZ_OPER_CTRL_DUP_BEACON	0x4
+	u8 control;
+	u8 ccfs0;
+	u8 ccfs1;
+	u8 minrate;
+} __packed;
+
 /*
  * ieee80211_he_oper_size - calculate 802.11ax HE Operations IE size
  * @he_oper_ie: byte data of the He Operations IE, stating from the byte
@@ -2235,7 +2257,7 @@ ieee80211_he_oper_size(const u8 *he_oper_ie)
 	if (he_oper_params & IEEE80211_HE_OPERATION_CO_HOSTED_BSS)
 		oper_len++;
 	if (he_oper_params & IEEE80211_HE_OPERATION_6GHZ_OP_INFO)
-		oper_len += 4;
+		oper_len += sizeof(struct ieee80211_he_6ghz_oper);
 
 	/* Add the first byte (extension ID) to the total length */
 	oper_len++;
@@ -2359,6 +2381,34 @@ ieee80211_he_spr_size(const u8 *he_spr_ie)
 
 #define S1G_CAPAB_B9_LINK_ADAPT_PER_CONTROL_RESPONSE BIT(0)
 
+/**
+ * ieee80211_he_6ghz_oper - obtain 6 GHz operation field
+ * @he_oper: HE operation element (must be pre-validated for size)
+ *	but may be %NULL
+ *
+ * Return: a pointer to the 6 GHz operation field, or %NULL
+ */
+static inline const struct ieee80211_he_6ghz_oper *
+ieee80211_he_6ghz_oper(const struct ieee80211_he_operation *he_oper)
+{
+	const u8 *ret = (void *)&he_oper->optional;
+	u32 he_oper_params;
+
+	if (!he_oper)
+		return NULL;
+
+	he_oper_params = le32_to_cpu(he_oper->he_oper_params);
+
+	if (!(he_oper_params & IEEE80211_HE_OPERATION_6GHZ_OP_INFO))
+		return NULL;
+	if (he_oper_params & IEEE80211_HE_OPERATION_VHT_OPER_INFO)
+		ret += 3;
+	if (he_oper_params & IEEE80211_HE_OPERATION_CO_HOSTED_BSS)
+		ret++;
+
+	return (void *)ret;
+}
+
 /* Authentication algorithms */
 #define WLAN_AUTH_OPEN 0
 #define WLAN_AUTH_SHARED_KEY 1
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [RFC 04/10] ieee80211: add HE ext EIDs and 6 GHz capability defines
  2020-05-28  9:44 [RFC 01/10] cfg80211: add a helper to identify 6 GHz PSCs Johannes Berg
  2020-05-28  9:44 ` [RFC 02/10] ieee80211: definitions for reduced neighbor reports Johannes Berg
  2020-05-28  9:44 ` [RFC 03/10] ieee80211: add code to obtain and parse 6 GHz operation field Johannes Berg
@ 2020-05-28  9:44 ` Johannes Berg
  2020-05-28  9:44 ` [RFC 05/10] cfg80211: handle 6 GHz capability of new station Johannes Berg
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Johannes Berg @ 2020-05-28  9:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Add the HE extended element IDs and the definitions for the
HE 6 GHz band capabilities element, from Draft 5.0.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/linux/ieee80211.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index d9616e03672a..aff664bf00f7 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -2839,9 +2839,19 @@ enum ieee80211_eid_ext {
 	WLAN_EID_EXT_UORA = 37,
 	WLAN_EID_EXT_HE_MU_EDCA = 38,
 	WLAN_EID_EXT_HE_SPR = 39,
+	WLAN_EID_EXT_NDP_FEEDBACK_REPORT_PARAMSET = 41,
+	WLAN_EID_EXT_BSS_COLOR_CHG_ANN = 42,
+	WLAN_EID_EXT_QUIET_TIME_PERIOD_SETUP = 43,
+	WLAN_EID_EXT_ESS_REPORT = 45,
+	WLAN_EID_EXT_OPS = 46,
+	WLAN_EID_EXT_HE_BSS_LOAD = 47,
 	WLAN_EID_EXT_MAX_CHANNEL_SWITCH_TIME = 52,
 	WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION = 55,
 	WLAN_EID_EXT_NON_INHERITANCE = 56,
+	WLAN_EID_EXT_KNOWN_BSSID = 57,
+	WLAN_EID_EXT_SHORT_SSID_LIST = 58,
+	WLAN_EID_EXT_HE_6GHZ_CAPA = 59,
+	WLAN_EID_EXT_UL_MU_POWER_CAPA = 60,
 };
 
 /* Action category code */
@@ -3384,6 +3394,24 @@ struct ieee80211_tspec_ie {
 	__le16 medium_time;
 } __packed;
 
+struct ieee80211_he_6ghz_capa {
+	/* uses IEEE80211_HE_6GHZ_CAP_* below */
+	__le16 capa;
+} __packed;
+
+/* HE 6 GHz band capabilities */
+/* uses enum ieee80211_min_mpdu_spacing values */
+#define IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START	0x0007
+/* uses enum ieee80211_vht_max_ampdu_length_exp values */
+#define IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP	0x0038
+/* uses IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_* values */
+#define IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN	0x00c0
+/* WLAN_HT_CAP_SM_PS_* values */
+#define IEEE80211_HE_6GHZ_CAP_SM_PS		0x0600
+#define IEEE80211_HE_6GHZ_CAP_RD_RESPONDER	0x0800
+#define IEEE80211_HE_6GHZ_CAP_RX_ANTPAT_CONS	0x1000
+#define IEEE80211_HE_6GHZ_CAP_TX_ANTPAT_CONS	0x2000
+
 /**
  * ieee80211_get_qos_ctl - get pointer to qos control bytes
  * @hdr: the frame
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [RFC 05/10] cfg80211: handle 6 GHz capability of new station
  2020-05-28  9:44 [RFC 01/10] cfg80211: add a helper to identify 6 GHz PSCs Johannes Berg
                   ` (2 preceding siblings ...)
  2020-05-28  9:44 ` [RFC 04/10] ieee80211: add HE ext EIDs and 6 GHz capability defines Johannes Berg
@ 2020-05-28  9:44 ` Johannes Berg
  2020-05-28  9:44 ` [RFC 06/10] mac80211: add HE 6 GHz Band Capabilities into parse extension Johannes Berg
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Johannes Berg @ 2020-05-28  9:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: Rajkumar Manoharan

From: Rajkumar Manoharan <rmanohar@codeaurora.org>

Handle 6 GHz HE capability while adding new station. It will be used
later in mac80211 station processing.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
Link: https://lore.kernel.org/r/1589399105-25472-2-git-send-email-rmanohar@codeaurora.org
[handle nl80211_set_station, require WME,
 remove NL80211_HE_6GHZ_CAPABILITY_LEN]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/net/cfg80211.h       |  2 ++
 include/uapi/linux/nl80211.h |  5 +++++
 net/wireless/nl80211.c       | 18 +++++++++++++++++-
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index a38653358885..da734ea71b5a 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1238,6 +1238,7 @@ struct sta_txpwr {
  * @he_capa_len: the length of the HE capabilities
  * @airtime_weight: airtime scheduler weight for this station
  * @txpwr: transmit power for an associated station
+ * @he_6ghz_capa: HE 6 GHz Band capabilities of station
  */
 struct station_parameters {
 	const u8 *supported_rates;
@@ -1270,6 +1271,7 @@ struct station_parameters {
 	u8 he_capa_len;
 	u16 airtime_weight;
 	struct sta_txpwr txpwr;
+	const struct ieee80211_he_6ghz_capa *he_6ghz_capa;
 };
 
 /**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index c14666b75e57..e42ae429383e 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2502,6 +2502,9 @@ enum nl80211_commands {
  *	first channel segment specified in %NL80211_ATTR_CENTER_FREQ1.
  * @NL80211_ATTR_SCAN_FREQ_KHZ: nested attribute with KHz frequencies
  *
+ * @NL80211_ATTR_HE_6GHZ_CAPABILITY: HE 6 GHz Band Capability element (from
+ *	association request when used with NL80211_CMD_NEW_STATION).
+ *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2982,6 +2985,8 @@ enum nl80211_attrs {
 	NL80211_ATTR_CENTER_FREQ1_OFFSET,
 	NL80211_ATTR_SCAN_FREQ_KHZ,
 
+	NL80211_ATTR_HE_6GHZ_CAPABILITY,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 22c4d13e28cb..bf8bd8268cb7 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -654,6 +654,10 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
 	[NL80211_ATTR_RECEIVE_MULTICAST] = { .type = NLA_FLAG },
 	[NL80211_ATTR_WIPHY_FREQ_OFFSET] = NLA_POLICY_RANGE(NLA_U32, 0, 999),
 	[NL80211_ATTR_SCAN_FREQ_KHZ] = { .type = NLA_NESTED },
+	[NL80211_ATTR_HE_6GHZ_CAPABILITY] = {
+		.type = NLA_EXACT_LEN,
+		.len = sizeof(struct ieee80211_he_6ghz_capa),
+	},
 };
 
 /* policy for the key attributes */
@@ -5989,6 +5993,10 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
 			nla_get_u8(info->attrs[NL80211_ATTR_OPMODE_NOTIF]);
 	}
 
+	if (info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY])
+		params.he_6ghz_capa =
+			nla_data(info->attrs[NL80211_ATTR_HE_CAPABILITY]);
+
 	if (info->attrs[NL80211_ATTR_AIRTIME_WEIGHT])
 		params.airtime_weight =
 			nla_get_u16(info->attrs[NL80211_ATTR_AIRTIME_WEIGHT]);
@@ -6123,6 +6131,10 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
 			return -EINVAL;
 	}
 
+	if (info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY])
+		params.he_6ghz_capa =
+			nla_data(info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]);
+
 	if (info->attrs[NL80211_ATTR_OPMODE_NOTIF]) {
 		params.opmode_notif_used = true;
 		params.opmode_notif =
@@ -6167,10 +6179,14 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
 		params.vht_capa = NULL;
 
 		/* HE requires WME */
-		if (params.he_capa_len)
+		if (params.he_capa_len || params.he_6ghz_capa)
 			return -EINVAL;
 	}
 
+	/* Ensure that HT/VHT capabilities are not set for 6 GHz HE STA */
+	if (params.he_6ghz_capa && (params.ht_capa || params.vht_capa))
+		return -EINVAL;
+
 	/* When you run into this, adjust the code below for the new flag */
 	BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 7);
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [RFC 06/10] mac80211: add HE 6 GHz Band Capabilities into parse extension
  2020-05-28  9:44 [RFC 01/10] cfg80211: add a helper to identify 6 GHz PSCs Johannes Berg
                   ` (3 preceding siblings ...)
  2020-05-28  9:44 ` [RFC 05/10] cfg80211: handle 6 GHz capability of new station Johannes Berg
@ 2020-05-28  9:44 ` Johannes Berg
  2020-05-28  9:44 ` [RFC 07/10] cfg80211: add and expose HE 6 GHz band capabilities Johannes Berg
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Johannes Berg @ 2020-05-28  9:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: Rajkumar Manoharan

From: Rajkumar Manoharan <rmanohar@codeaurora.org>

Handle 6 GHz band capability element parsing for association.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
Link: https://lore.kernel.org/r/1589399105-25472-4-git-send-email-rmanohar@codeaurora.org
[some renaming to be in line with previous patches]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/ieee80211_i.h | 1 +
 net/mac80211/util.c        | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index b7935f3d000d..dac016636d12 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1494,6 +1494,7 @@ struct ieee802_11_elems {
 	const struct ieee80211_he_operation *he_operation;
 	const struct ieee80211_he_spr *he_spr;
 	const struct ieee80211_mu_edca_param_set *mu_edca_param_set;
+	const struct ieee80211_he_6ghz_capa *he_6ghz_capa;
 	const u8 *uora_element;
 	const u8 *mesh_id;
 	const u8 *peering;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 20436c86b9bf..5d2c5ae8aadb 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -936,6 +936,10 @@ static void ieee80211_parse_extension_element(u32 *crc,
 		    len >= ieee80211_he_spr_size(data))
 			elems->he_spr = data;
 		break;
+	case WLAN_EID_EXT_HE_6GHZ_CAPA:
+		if (len == sizeof(*elems->he_6ghz_capa))
+			elems->he_6ghz_capa = data;
+		break;
 	}
 }
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [RFC 07/10] cfg80211: add and expose HE 6 GHz band capabilities
  2020-05-28  9:44 [RFC 01/10] cfg80211: add a helper to identify 6 GHz PSCs Johannes Berg
                   ` (4 preceding siblings ...)
  2020-05-28  9:44 ` [RFC 06/10] mac80211: add HE 6 GHz Band Capabilities into parse extension Johannes Berg
@ 2020-05-28  9:44 ` Johannes Berg
  2020-05-28  9:44 ` [RFC 08/10] mac80211: add HE 6 GHz Band Capability element Johannes Berg
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Johannes Berg @ 2020-05-28  9:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

These capabilities cover what would otherwise be transported
in HT/VHT capabilities, but only a subset thereof that is
actually needed on 6 GHz with HE already present. Expose the
capabilities to userspace, drivers are expected to set them
as using the 6 GHz band (currently) requires HE capability.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/net/cfg80211.h       | 3 +++
 include/uapi/linux/nl80211.h | 3 +++
 net/wireless/nl80211.c       | 9 ++++++++-
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index da734ea71b5a..9b76be3d561a 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -354,10 +354,13 @@ struct ieee80211_sta_he_cap {
  *
  * @types_mask: interface types mask
  * @he_cap: holds the HE capabilities
+ * @he_6ghz_capa: HE 6 GHz capabilities, must be filled in for a
+ *	6 GHz band channel (and 0 may be valid value).
  */
 struct ieee80211_sband_iftype_data {
 	u16 types_mask;
 	struct ieee80211_sta_he_cap he_cap;
+	struct ieee80211_he_6ghz_capa he_6ghz_capa;
 };
 
 /**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index e42ae429383e..d9bfcb2a3d35 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -3565,6 +3565,8 @@ enum nl80211_mpath_info {
  *     defined in HE capabilities IE
  * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band HE capability attribute currently
  *     defined
+ * @NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA: HE 6GHz band capabilities (u16),
+ *	given for all 6 GHz band channels
  * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use
  */
 enum nl80211_band_iftype_attr {
@@ -3575,6 +3577,7 @@ enum nl80211_band_iftype_attr {
 	NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY,
 	NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET,
 	NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE,
+	NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA,
 
 	/* keep last */
 	__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index bf8bd8268cb7..3a24e6add13e 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1562,6 +1562,7 @@ static int nl80211_send_coalesce(struct sk_buff *msg,
 
 static int
 nl80211_send_iftype_data(struct sk_buff *msg,
+			 const struct ieee80211_supported_band *sband,
 			 const struct ieee80211_sband_iftype_data *iftdata)
 {
 	const struct ieee80211_sta_he_cap *he_cap = &iftdata->he_cap;
@@ -1585,6 +1586,12 @@ nl80211_send_iftype_data(struct sk_buff *msg,
 			return -ENOBUFS;
 	}
 
+	if (sband->band == NL80211_BAND_6GHZ &&
+	    nla_put(msg, NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA,
+		    sizeof(iftdata->he_6ghz_capa),
+		    &iftdata->he_6ghz_capa))
+		return -ENOBUFS;
+
 	return 0;
 }
 
@@ -1633,7 +1640,7 @@ static int nl80211_send_band_rateinfo(struct sk_buff *msg,
 			if (!iftdata)
 				return -ENOBUFS;
 
-			err = nl80211_send_iftype_data(msg,
+			err = nl80211_send_iftype_data(msg, sband,
 						       &sband->iftype_data[i]);
 			if (err)
 				return err;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [RFC 08/10] mac80211: add HE 6 GHz Band Capability element
  2020-05-28  9:44 [RFC 01/10] cfg80211: add a helper to identify 6 GHz PSCs Johannes Berg
                   ` (5 preceding siblings ...)
  2020-05-28  9:44 ` [RFC 07/10] cfg80211: add and expose HE 6 GHz band capabilities Johannes Berg
@ 2020-05-28  9:44 ` Johannes Berg
  2020-05-28 12:33   ` Johannes Berg
  2020-05-28  9:44 ` [RFC 09/10] mac80211: build HE operation with 6 GHz oper information Johannes Berg
  2020-05-28  9:44 ` [RFC 10/10] mac80211: do not allow HT/VHT IEs in 6 GHz mesh mode Johannes Berg
  8 siblings, 1 reply; 15+ messages in thread
From: Johannes Berg @ 2020-05-28  9:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: Rajkumar Manoharan

From: Rajkumar Manoharan <rmanohar@codeaurora.org>

Construct HE 6 GHz band capability element (IEEE 802.11ax/D6.0,
9.4.2.261) for association request and mesh beacon. The 6 GHz
capability information is passed by driver through iftypes caps.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
Link: https://lore.kernel.org/r/1589399105-25472-7-git-send-email-rmanohar@codeaurora.org
[handle SMPS, adjust for previous patches, reserve SKB space properly,
 change to handle SKB directly]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/ieee80211_i.h |  2 ++
 net/mac80211/mesh.c        |  9 +++++++
 net/mac80211/mesh.h        |  2 ++
 net/mac80211/mesh_plink.c  |  4 +++-
 net/mac80211/mlme.c        |  3 +++
 net/mac80211/util.c        | 48 ++++++++++++++++++++++++++++++++++++++
 6 files changed, 67 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index dac016636d12..344ea828e806 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2177,6 +2177,8 @@ u8 ieee80211_ie_len_he_cap(struct ieee80211_sub_if_data *sdata, u8 iftype);
 u8 *ieee80211_ie_build_he_cap(u8 *pos,
 			      const struct ieee80211_sta_he_cap *he_cap,
 			      u8 *end);
+void ieee80211_ie_build_he_6ghz_cap(struct ieee80211_sub_if_data *sdata,
+				    struct sk_buff *skb);
 u8 *ieee80211_ie_build_he_oper(u8 *pos);
 int ieee80211_parse_bitrates(struct cfg80211_chan_def *chandef,
 			     const struct ieee80211_supported_band *sband,
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 5930d07b1e43..5e8d72bdbb98 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -587,6 +587,13 @@ int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata,
 	return 0;
 }
 
+int mesh_add_he_6ghz_cap_ie(struct ieee80211_sub_if_data *sdata,
+			    struct sk_buff *skb)
+{
+	ieee80211_ie_build_he_6ghz_cap(sdata, skb);
+	return 0;
+}
+
 static void ieee80211_mesh_path_timer(struct timer_list *t)
 {
 	struct ieee80211_sub_if_data *sdata =
@@ -766,6 +773,7 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh)
 		   2 + sizeof(struct ieee80211_vht_operation) +
 		   ie_len_he_cap +
 		   2 + 1 + sizeof(struct ieee80211_he_operation) +
+		   2 + 1 + sizeof(struct ieee80211_he_6ghz_capa) +
 		   ifmsh->ie_len;
 
 	bcn = kzalloc(sizeof(*bcn) + head_len + tail_len, GFP_KERNEL);
@@ -885,6 +893,7 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh)
 	    mesh_add_vht_oper_ie(sdata, skb) ||
 	    mesh_add_he_cap_ie(sdata, skb, ie_len_he_cap) ||
 	    mesh_add_he_oper_ie(sdata, skb) ||
+	    mesh_add_he_6ghz_cap_ie(sdata, skb) ||
 	    mesh_add_vendor_ies(sdata, skb))
 		goto out_free;
 
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 953f720754e8..40492d1bd8fd 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -222,6 +222,8 @@ int mesh_add_he_cap_ie(struct ieee80211_sub_if_data *sdata,
 		       struct sk_buff *skb, u8 ie_len);
 int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata,
 			struct sk_buff *skb);
+int mesh_add_he_6ghz_cap_ie(struct ieee80211_sub_if_data *sdata,
+			    struct sk_buff *skb);
 void mesh_rmc_free(struct ieee80211_sub_if_data *sdata);
 int mesh_rmc_init(struct ieee80211_sub_if_data *sdata);
 void ieee80211s_init(void);
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 737c5f4dbf52..3aca89c97f36 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -238,6 +238,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
 			    2 + sizeof(struct ieee80211_vht_operation) +
 			    ie_len_he_cap +
 			    2 + 1 + sizeof(struct ieee80211_he_operation) +
+			    2 + 1 + sizeof(struct ieee80211_he_6ghz_capa) +
 			    2 + 8 + /* peering IE */
 			    sdata->u.mesh.ie_len);
 	if (!skb)
@@ -328,7 +329,8 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
 		    mesh_add_vht_cap_ie(sdata, skb) ||
 		    mesh_add_vht_oper_ie(sdata, skb) ||
 		    mesh_add_he_cap_ie(sdata, skb, ie_len_he_cap) ||
-		    mesh_add_he_oper_ie(sdata, skb))
+		    mesh_add_he_oper_ie(sdata, skb) ||
+		    mesh_add_he_6ghz_cap_ie(sdata, skb))
 			goto free;
 	}
 
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index a259b4487b60..f6ddce646f18 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -658,6 +658,8 @@ static void ieee80211_add_he_ie(struct ieee80211_sub_if_data *sdata,
 				      he_cap->he_cap_elem.phy_cap_info);
 	pos = skb_put(skb, he_cap_size);
 	ieee80211_ie_build_he_cap(pos, he_cap, pos + he_cap_size);
+
+	ieee80211_ie_build_he_6ghz_cap(sdata, skb);
 }
 
 static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
@@ -731,6 +733,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
 			2 + 1 + sizeof(struct ieee80211_he_cap_elem) + /* HE */
 				sizeof(struct ieee80211_he_mcs_nss_supp) +
 				IEEE80211_HE_PPE_THRES_MAX_LEN +
+			2 + 1 + sizeof(struct ieee80211_he_6ghz_capa) +
 			assoc_data->ie_len + /* extra IEs */
 			(assoc_data->fils_kek_len ? 16 /* AES-SIV */ : 0) +
 			9, /* WMM */
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 5d2c5ae8aadb..40c82951d801 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2839,6 +2839,54 @@ u8 *ieee80211_ie_build_he_cap(u8 *pos,
 	return pos;
 }
 
+void ieee80211_ie_build_he_6ghz_cap(struct ieee80211_sub_if_data *sdata,
+				    struct sk_buff *skb)
+{
+	struct ieee80211_local *local = sdata->local;
+	struct ieee80211_supported_band *sband;
+	const struct ieee80211_sband_iftype_data *iftd;
+	enum nl80211_iftype iftype = ieee80211_vif_type_p2p(&sdata->vif);
+	u8 *pos;
+	u16 cap;
+
+	sband = local->hw.wiphy->bands[NL80211_BAND_6GHZ];
+
+	if (!sband)
+		return;
+
+	iftd = ieee80211_get_sband_iftype_data(sband, iftype);
+	if (WARN_ON(!iftd))
+		return;
+
+	cap = le16_to_cpu(iftd->he_6ghz_capa.capa);
+	cap &= ~IEEE80211_HE_6GHZ_CAP_SM_PS;
+
+	switch (sdata->smps_mode) {
+	case IEEE80211_SMPS_AUTOMATIC:
+	case IEEE80211_SMPS_NUM_MODES:
+		WARN_ON(1);
+		/* fall through */
+	case IEEE80211_SMPS_OFF:
+		cap |= u16_encode_bits(WLAN_HT_CAP_SM_PS_DISABLED,
+				       IEEE80211_HE_6GHZ_CAP_SM_PS);
+		break;
+	case IEEE80211_SMPS_STATIC:
+		cap |= u16_encode_bits(WLAN_HT_CAP_SM_PS_STATIC,
+				       IEEE80211_HE_6GHZ_CAP_SM_PS);
+		break;
+	case IEEE80211_SMPS_DYNAMIC:
+		cap |= u16_encode_bits(WLAN_HT_CAP_SM_PS_DYNAMIC,
+				       IEEE80211_HE_6GHZ_CAP_SM_PS);
+		break;
+	}
+
+	pos = skb_put(skb, 2 + 1 + sizeof(cap));
+	*pos++ = WLAN_EID_EXTENSION;
+	*pos++ = 1 + sizeof(cap);
+	*pos++ = WLAN_EID_EXT_HE_6GHZ_CAPA;
+	put_unaligned_le16(cap, pos);
+}
+
 u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
 			       const struct cfg80211_chan_def *chandef,
 			       u16 prot_mode, bool rifs_mode)
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [RFC 09/10] mac80211: build HE operation with 6 GHz oper information
  2020-05-28  9:44 [RFC 01/10] cfg80211: add a helper to identify 6 GHz PSCs Johannes Berg
                   ` (6 preceding siblings ...)
  2020-05-28  9:44 ` [RFC 08/10] mac80211: add HE 6 GHz Band Capability element Johannes Berg
@ 2020-05-28  9:44 ` Johannes Berg
  2020-05-28  9:50   ` [RFC PATCH v2] " Johannes Berg
                     ` (3 more replies)
  2020-05-28  9:44 ` [RFC 10/10] mac80211: do not allow HT/VHT IEs in 6 GHz mesh mode Johannes Berg
  8 siblings, 4 replies; 15+ messages in thread
From: Johannes Berg @ 2020-05-28  9:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: Rajkumar Manoharan

From: Rajkumar Manoharan <rmanohar@codeaurora.org>

Add 6 GHz operation information (IEEE 802.11ax/D6.0, Figure 9-787k)
while building HE operation element for non-HE AP. This field is used to
determine channel information in the absence of HT/VHT IEs.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
Link: https://lore.kernel.org/r/1589399105-25472-8-git-send-email-rmanohar@codeaurora.org
[fix skb allocation size]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/ieee80211_i.h |  2 +-
 net/mac80211/mesh.c        | 12 ++++++--
 net/mac80211/mesh_plink.c  |  1 +
 net/mac80211/util.c        | 63 +++++++++++++++++++++++++++++++++++---
 4 files changed, 70 insertions(+), 8 deletions(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 344ea828e806..9f874ce500f6 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2179,7 +2179,7 @@ u8 *ieee80211_ie_build_he_cap(u8 *pos,
 			      u8 *end);
 void ieee80211_ie_build_he_6ghz_cap(struct ieee80211_sub_if_data *sdata,
 				    struct sk_buff *skb);
-u8 *ieee80211_ie_build_he_oper(u8 *pos);
+u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef);
 int ieee80211_parse_bitrates(struct cfg80211_chan_def *chandef,
 			     const struct ieee80211_supported_band *sband,
 			     const u8 *srates, int srates_len, u32 *rates);
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 5e8d72bdbb98..6378d9cb70d3 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -565,6 +565,7 @@ int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata,
 {
 	const struct ieee80211_sta_he_cap *he_cap;
 	struct ieee80211_supported_band *sband;
+	u32 len;
 	u8 *pos;
 
 	sband = ieee80211_get_sband(sdata);
@@ -578,11 +579,15 @@ int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata,
 	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
 		return 0;
 
-	if (skb_tailroom(skb) < 2 + 1 + sizeof(struct ieee80211_he_operation))
+	len = 2 + 1 + sizeof(struct ieee80211_he_operation);
+	if (sdata->vif.bss_conf.chandef.chan->band == NL80211_BAND_6GHZ)
+		len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
+
+	if (skb_tailroom(skb) < len)
 		return -ENOMEM;
 
-	pos = skb_put(skb, 2 + 1 + sizeof(struct ieee80211_he_operation));
-	ieee80211_ie_build_he_oper(pos);
+	pos = skb_put(skb, len);
+	ieee80211_ie_build_he_oper(pos, &sdata->vif.bss_conf.chandef);
 
 	return 0;
 }
@@ -773,6 +778,7 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh)
 		   2 + sizeof(struct ieee80211_vht_operation) +
 		   ie_len_he_cap +
 		   2 + 1 + sizeof(struct ieee80211_he_operation) +
+			   sizeof(struct ieee80211_he_oper_6ghz_op_info) +
 		   2 + 1 + sizeof(struct ieee80211_he_6ghz_capa) +
 		   ifmsh->ie_len;
 
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 3aca89c97f36..b555fafd53c1 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -238,6 +238,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
 			    2 + sizeof(struct ieee80211_vht_operation) +
 			    ie_len_he_cap +
 			    2 + 1 + sizeof(struct ieee80211_he_operation) +
+				    sizeof(struct ieee80211_he_oper_6ghz_op_info) +
 			    2 + 1 + sizeof(struct ieee80211_he_6ghz_capa) +
 			    2 + 8 + /* peering IE */
 			    sdata->u.mesh.ie_len);
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 40c82951d801..c31114e2a9b1 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -3010,13 +3010,18 @@ u8 *ieee80211_ie_build_vht_oper(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
 	return pos + sizeof(struct ieee80211_vht_operation);
 }
 
-u8 *ieee80211_ie_build_he_oper(u8 *pos)
+u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef)
 {
 	struct ieee80211_he_operation *he_oper;
+	struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
 	u32 he_oper_params;
+	u8 ie_len = 1 + sizeof(struct ieee80211_he_operation);
+
+	if (chandef->chan->band == NL80211_BAND_6GHZ)
+		ie_len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
 
 	*pos++ = WLAN_EID_EXTENSION;
-	*pos++ = 1 + sizeof(struct ieee80211_he_operation);
+	*pos++ = ie_len;
 	*pos++ = WLAN_EID_EXT_HE_OPERATION;
 
 	he_oper_params = 0;
@@ -3026,16 +3031,66 @@ u8 *ieee80211_ie_build_he_oper(u8 *pos)
 				IEEE80211_HE_OPERATION_ER_SU_DISABLE);
 	he_oper_params |= u32_encode_bits(1,
 				IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED);
+	if (chandef->chan->band == NL80211_BAND_6GHZ)
+		he_oper_params |= u32_encode_bits(1,
+				IEEE80211_HE_OPERATION_6GHZ_OP_INFO);
 
 	he_oper = (struct ieee80211_he_operation *)pos;
 	he_oper->he_oper_params = cpu_to_le32(he_oper_params);
 
 	/* don't require special HE peer rates */
 	he_oper->he_mcs_nss_set = cpu_to_le16(0xffff);
+	pos += sizeof(struct ieee80211_he_operation);
 
-	/* TODO add VHT operational and 6GHz operational subelement? */
+	if (chandef->chan->band != NL80211_BAND_6GHZ)
+		goto out;
 
-	return pos + sizeof(struct ieee80211_vht_operation);
+	/* TODO add VHT operational */
+	he_6ghz_op = (struct ieee80211_he_oper_6ghz_op_info *)pos;
+	he_6ghz_op->min_rate = 6; /* 6 Mbps */
+	he_6ghz_op->primary_chan =
+		ieee80211_frequency_to_channel(chandef->chan->center_freq);
+	he_6ghz_op->center_freq_seg0_idx =
+		ieee80211_frequency_to_channel(chandef->center_freq1);
+	if (chandef->center_freq2)
+		he_6ghz_op->center_freq_seg1_idx =
+			ieee80211_frequency_to_channel(chandef->center_freq2);
+	else
+		he_6ghz_op->center_freq_seg1_idx = 0;
+
+	switch (chandef->width) {
+	case NL80211_CHAN_WIDTH_160:
+		/* Convert 160 MHz channel width to new style as interop
+		 * workaround.
+		 */
+		he_6ghz_op->control =
+			IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
+		he_6ghz_op->center_freq_seg1_idx =
+			he_6ghz_op->center_freq_seg0_idx;
+		if (chandef->chan->center_freq < chandef->center_freq1)
+			he_6ghz_op->center_freq_seg0_idx -= 8;
+		else
+			he_6ghz_op->center_freq_seg0_idx += 8;
+		fallthrough;
+	case NL80211_CHAN_WIDTH_80P80:
+		he_6ghz_op->control =
+			IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
+		break;
+	case NL80211_CHAN_WIDTH_80:
+		he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ;
+		break;
+	case NL80211_CHAN_WIDTH_40:
+		he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ;
+		break;
+	default:
+		he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_20MHZ;
+		break;
+	}
+
+	pos += sizeof(struct ieee80211_he_oper_6ghz_op_info);
+
+out:
+	return pos;
 }
 
 bool ieee80211_chandef_ht_oper(const struct ieee80211_ht_operation *ht_oper,
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [RFC 10/10] mac80211: do not allow HT/VHT IEs in 6 GHz mesh mode
  2020-05-28  9:44 [RFC 01/10] cfg80211: add a helper to identify 6 GHz PSCs Johannes Berg
                   ` (7 preceding siblings ...)
  2020-05-28  9:44 ` [RFC 09/10] mac80211: build HE operation with 6 GHz oper information Johannes Berg
@ 2020-05-28  9:44 ` Johannes Berg
  8 siblings, 0 replies; 15+ messages in thread
From: Johannes Berg @ 2020-05-28  9:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: Rajkumar Manoharan

From: Rajkumar Manoharan <rmanohar@codeaurora.org>

As HT/VHT elements are not allowed in 6 GHz band, do not include
them in mesh beacon template formation.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
Link: https://lore.kernel.org/r/1589399105-25472-9-git-send-email-rmanohar@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/mesh.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 6378d9cb70d3..afbb5d6df936 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -415,6 +415,10 @@ int mesh_add_ht_cap_ie(struct ieee80211_sub_if_data *sdata,
 	if (!sband)
 		return -EINVAL;
 
+	/* HT not allowed in 6 GHz */
+	if (sband->band == NL80211_BAND_6GHZ)
+		return 0;
+
 	if (!sband->ht_cap.ht_supported ||
 	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
 	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
@@ -452,6 +456,10 @@ int mesh_add_ht_oper_ie(struct ieee80211_sub_if_data *sdata,
 	sband = local->hw.wiphy->bands[channel->band];
 	ht_cap = &sband->ht_cap;
 
+	/* HT not allowed in 6 GHz */
+	if (sband->band == NL80211_BAND_6GHZ)
+		return 0;
+
 	if (!ht_cap->ht_supported ||
 	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
 	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
@@ -479,6 +487,10 @@ int mesh_add_vht_cap_ie(struct ieee80211_sub_if_data *sdata,
 	if (!sband)
 		return -EINVAL;
 
+	/* VHT not allowed in 6 GHz */
+	if (sband->band == NL80211_BAND_6GHZ)
+		return 0;
+
 	if (!sband->vht_cap.vht_supported ||
 	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
 	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
@@ -516,6 +528,10 @@ int mesh_add_vht_oper_ie(struct ieee80211_sub_if_data *sdata,
 	sband = local->hw.wiphy->bands[channel->band];
 	vht_cap = &sband->vht_cap;
 
+	/* VHT not allowed in 6 GHz */
+	if (sband->band == NL80211_BAND_6GHZ)
+		return 0;
+
 	if (!vht_cap->vht_supported ||
 	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
 	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [RFC PATCH v2] mac80211: build HE operation with 6 GHz oper information
  2020-05-28  9:44 ` [RFC 09/10] mac80211: build HE operation with 6 GHz oper information Johannes Berg
@ 2020-05-28  9:50   ` Johannes Berg
  2020-05-28 17:57   ` [RFC 09/10] " kbuild test robot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 15+ messages in thread
From: Johannes Berg @ 2020-05-28  9:50 UTC (permalink / raw)
  To: linux-wireless; +Cc: Rajkumar Manoharan

From: Rajkumar Manoharan <rmanohar@codeaurora.org>

Add 6 GHz operation information (IEEE 802.11ax/D6.0, Figure 9-787k)
while building HE operation element for non-HE AP. This field is used to
determine channel information in the absence of HT/VHT IEs.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
Link: https://lore.kernel.org/r/1589399105-25472-8-git-send-email-rmanohar@codeaurora.org
[fix skb allocation size]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/ieee80211_i.h |  2 +-
 net/mac80211/mesh.c        | 12 +++++--
 net/mac80211/mesh_plink.c  |  1 +
 net/mac80211/util.c        | 65 +++++++++++++++++++++++++++++++++++---
 4 files changed, 72 insertions(+), 8 deletions(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 344ea828e806..9f874ce500f6 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2179,7 +2179,7 @@ u8 *ieee80211_ie_build_he_cap(u8 *pos,
 			      u8 *end);
 void ieee80211_ie_build_he_6ghz_cap(struct ieee80211_sub_if_data *sdata,
 				    struct sk_buff *skb);
-u8 *ieee80211_ie_build_he_oper(u8 *pos);
+u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef);
 int ieee80211_parse_bitrates(struct cfg80211_chan_def *chandef,
 			     const struct ieee80211_supported_band *sband,
 			     const u8 *srates, int srates_len, u32 *rates);
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 5e8d72bdbb98..5f3d45474db6 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -565,6 +565,7 @@ int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata,
 {
 	const struct ieee80211_sta_he_cap *he_cap;
 	struct ieee80211_supported_band *sband;
+	u32 len;
 	u8 *pos;
 
 	sband = ieee80211_get_sband(sdata);
@@ -578,11 +579,15 @@ int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata,
 	    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
 		return 0;
 
-	if (skb_tailroom(skb) < 2 + 1 + sizeof(struct ieee80211_he_operation))
+	len = 2 + 1 + sizeof(struct ieee80211_he_operation);
+	if (sdata->vif.bss_conf.chandef.chan->band == NL80211_BAND_6GHZ)
+		len += sizeof(struct ieee80211_he_6ghz_oper);
+
+	if (skb_tailroom(skb) < len)
 		return -ENOMEM;
 
-	pos = skb_put(skb, 2 + 1 + sizeof(struct ieee80211_he_operation));
-	ieee80211_ie_build_he_oper(pos);
+	pos = skb_put(skb, len);
+	ieee80211_ie_build_he_oper(pos, &sdata->vif.bss_conf.chandef);
 
 	return 0;
 }
@@ -773,6 +778,7 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh)
 		   2 + sizeof(struct ieee80211_vht_operation) +
 		   ie_len_he_cap +
 		   2 + 1 + sizeof(struct ieee80211_he_operation) +
+			   sizeof(struct ieee80211_he_6ghz_oper) +
 		   2 + 1 + sizeof(struct ieee80211_he_6ghz_capa) +
 		   ifmsh->ie_len;
 
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 3aca89c97f36..fbbfc5d4a51c 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -238,6 +238,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
 			    2 + sizeof(struct ieee80211_vht_operation) +
 			    ie_len_he_cap +
 			    2 + 1 + sizeof(struct ieee80211_he_operation) +
+				    sizeof(struct ieee80211_he_6ghz_oper) +
 			    2 + 1 + sizeof(struct ieee80211_he_6ghz_capa) +
 			    2 + 8 + /* peering IE */
 			    sdata->u.mesh.ie_len);
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 40c82951d801..9d240c3cce5d 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -3010,13 +3010,18 @@ u8 *ieee80211_ie_build_vht_oper(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
 	return pos + sizeof(struct ieee80211_vht_operation);
 }
 
-u8 *ieee80211_ie_build_he_oper(u8 *pos)
+u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef)
 {
 	struct ieee80211_he_operation *he_oper;
+	struct ieee80211_he_6ghz_oper *he_6ghz_op;
 	u32 he_oper_params;
+	u8 ie_len = 1 + sizeof(struct ieee80211_he_operation);
+
+	if (chandef->chan->band == NL80211_BAND_6GHZ)
+		ie_len += sizeof(struct ieee80211_he_6ghz_oper);
 
 	*pos++ = WLAN_EID_EXTENSION;
-	*pos++ = 1 + sizeof(struct ieee80211_he_operation);
+	*pos++ = ie_len;
 	*pos++ = WLAN_EID_EXT_HE_OPERATION;
 
 	he_oper_params = 0;
@@ -3026,16 +3031,68 @@ u8 *ieee80211_ie_build_he_oper(u8 *pos)
 				IEEE80211_HE_OPERATION_ER_SU_DISABLE);
 	he_oper_params |= u32_encode_bits(1,
 				IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED);
+	if (chandef->chan->band == NL80211_BAND_6GHZ)
+		he_oper_params |= u32_encode_bits(1,
+				IEEE80211_HE_OPERATION_6GHZ_OP_INFO);
 
 	he_oper = (struct ieee80211_he_operation *)pos;
 	he_oper->he_oper_params = cpu_to_le32(he_oper_params);
 
 	/* don't require special HE peer rates */
 	he_oper->he_mcs_nss_set = cpu_to_le16(0xffff);
+	pos += sizeof(struct ieee80211_he_operation);
 
-	/* TODO add VHT operational and 6GHz operational subelement? */
+	if (chandef->chan->band != NL80211_BAND_6GHZ)
+		goto out;
 
-	return pos + sizeof(struct ieee80211_vht_operation);
+	/* TODO add VHT operational */
+	he_6ghz_op = (struct ieee80211_he_6ghz_oper *)pos;
+	he_6ghz_op->minrate = 6; /* 6 Mbps */
+	he_6ghz_op->primary =
+		ieee80211_frequency_to_channel(chandef->chan->center_freq);
+	he_6ghz_op->ccfs0 =
+		ieee80211_frequency_to_channel(chandef->center_freq1);
+	if (chandef->center_freq2)
+		he_6ghz_op->ccfs1 =
+			ieee80211_frequency_to_channel(chandef->center_freq2);
+	else
+		he_6ghz_op->ccfs1 = 0;
+
+	switch (chandef->width) {
+	case NL80211_CHAN_WIDTH_160:
+		/* Convert 160 MHz channel width to new style as interop
+		 * workaround.
+		 */
+		he_6ghz_op->control =
+			IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_160MHZ;
+		he_6ghz_op->ccfs1 = he_6ghz_op->ccfs0;
+		if (chandef->chan->center_freq < chandef->center_freq1)
+			he_6ghz_op->ccfs0 -= 8;
+		else
+			he_6ghz_op->ccfs0 += 8;
+		fallthrough;
+	case NL80211_CHAN_WIDTH_80P80:
+		he_6ghz_op->control =
+			IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_160MHZ;
+		break;
+	case NL80211_CHAN_WIDTH_80:
+		he_6ghz_op->control =
+			IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_80MHZ;
+		break;
+	case NL80211_CHAN_WIDTH_40:
+		he_6ghz_op->control =
+			IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_40MHZ;
+		break;
+	default:
+		he_6ghz_op->control =
+			IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_20MHZ;
+		break;
+	}
+
+	pos += sizeof(struct ieee80211_he_6ghz_oper);
+
+out:
+	return pos;
 }
 
 bool ieee80211_chandef_ht_oper(const struct ieee80211_ht_operation *ht_oper,
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [RFC 08/10] mac80211: add HE 6 GHz Band Capability element
  2020-05-28  9:44 ` [RFC 08/10] mac80211: add HE 6 GHz Band Capability element Johannes Berg
@ 2020-05-28 12:33   ` Johannes Berg
  0 siblings, 0 replies; 15+ messages in thread
From: Johannes Berg @ 2020-05-28 12:33 UTC (permalink / raw)
  To: linux-wireless; +Cc: Rajkumar Manoharan

On Thu, 2020-05-28 at 11:44 +0200, Johannes Berg wrote:
> 
> +void ieee80211_ie_build_he_6ghz_cap(struct ieee80211_sub_if_data *sdata,
> +				    struct sk_buff *skb)
> +{
> +	struct ieee80211_local *local = sdata->local;
> +	struct ieee80211_supported_band *sband;
> +	const struct ieee80211_sband_iftype_data *iftd;
> +	enum nl80211_iftype iftype = ieee80211_vif_type_p2p(&sdata->vif);
> +	u8 *pos;
> +	u16 cap;
> +
> +	sband = local->hw.wiphy->bands[NL80211_BAND_6GHZ];

Err, no. Of course I need to use ieee80211_get_sband() like you did.

johannes


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC 09/10] mac80211: build HE operation with 6 GHz oper information
  2020-05-28  9:44 ` [RFC 09/10] mac80211: build HE operation with 6 GHz oper information Johannes Berg
  2020-05-28  9:50   ` [RFC PATCH v2] " Johannes Berg
@ 2020-05-28 17:57   ` kbuild test robot
  2020-05-28 23:22   ` kbuild test robot
  2020-05-29  1:42   ` kbuild test robot
  3 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2020-05-28 17:57 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 12325 bytes --]

Hi Johannes,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on mac80211-next/master]
[also build test ERROR on next-20200528]
[cannot apply to mac80211/master v5.7-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Johannes-Berg/cfg80211-add-a-helper-to-identify-6-GHz-PSCs/20200528-174914
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 2d068e534f1671459e1b135852c1b3c10502e929)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> net/mac80211/util.c:3021:13: error: invalid application of 'sizeof' to an incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
ie_len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
>> net/mac80211/util.c:3050:12: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->min_rate = 6; /* 6 Mbps */
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
net/mac80211/util.c:3051:12: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->primary_chan =
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
net/mac80211/util.c:3053:12: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->center_freq_seg0_idx =
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
net/mac80211/util.c:3056:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->center_freq_seg1_idx =
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
net/mac80211/util.c:3059:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->center_freq_seg1_idx = 0;
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
net/mac80211/util.c:3066:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->control =
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
>> net/mac80211/util.c:3067:4: error: use of undeclared identifier 'IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ'; did you mean 'IEEE80211_VHT_CHANWIDTH_80P80MHZ'?
IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IEEE80211_VHT_CHANWIDTH_80P80MHZ
include/linux/ieee80211.h:1692:2: note: 'IEEE80211_VHT_CHANWIDTH_80P80MHZ' declared here
IEEE80211_VHT_CHANWIDTH_80P80MHZ        = 3,
^
net/mac80211/util.c:3068:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->center_freq_seg1_idx =
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
net/mac80211/util.c:3069:14: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->center_freq_seg0_idx;
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
net/mac80211/util.c:3071:14: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->center_freq_seg0_idx -= 8;
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
net/mac80211/util.c:3073:14: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->center_freq_seg0_idx += 8;
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
net/mac80211/util.c:3076:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->control =
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
net/mac80211/util.c:3077:4: error: use of undeclared identifier 'IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ'; did you mean 'IEEE80211_VHT_CHANWIDTH_80P80MHZ'?
IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IEEE80211_VHT_CHANWIDTH_80P80MHZ
include/linux/ieee80211.h:1692:2: note: 'IEEE80211_VHT_CHANWIDTH_80P80MHZ' declared here
IEEE80211_VHT_CHANWIDTH_80P80MHZ        = 3,
^
net/mac80211/util.c:3080:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ;
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
>> net/mac80211/util.c:3080:25: error: use of undeclared identifier 'IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ'; did you mean 'IEEE80211_VHT_CHANWIDTH_80MHZ'?
he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IEEE80211_VHT_CHANWIDTH_80MHZ
include/linux/ieee80211.h:1690:2: note: 'IEEE80211_VHT_CHANWIDTH_80MHZ' declared here
IEEE80211_VHT_CHANWIDTH_80MHZ           = 1,
^
net/mac80211/util.c:3083:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ;
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
>> net/mac80211/util.c:3083:25: error: use of undeclared identifier 'IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ'
he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ;
^
net/mac80211/util.c:3086:13: error: incomplete definition of type 'struct ieee80211_he_oper_6ghz_op_info'
he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_20MHZ;
~~~~~~~~~~^
net/mac80211/util.c:3016:9: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
--
>> net/mac80211/mesh.c:584:10: error: invalid application of 'sizeof' to an incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/mac80211/mesh.c:584:24: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
^
net/mac80211/mesh.c:781:7: error: invalid application of 'sizeof' to an incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
sizeof(struct ieee80211_he_oper_6ghz_op_info) +
^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/mac80211/mesh.c:781:21: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
sizeof(struct ieee80211_he_oper_6ghz_op_info) +
^
2 errors generated.
--
>> net/mac80211/mesh_plink.c:241:9: error: invalid application of 'sizeof' to an incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
sizeof(struct ieee80211_he_oper_6ghz_op_info) +
^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/mac80211/mesh_plink.c:241:23: note: forward declaration of 'struct ieee80211_he_oper_6ghz_op_info'
sizeof(struct ieee80211_he_oper_6ghz_op_info) +
^
1 error generated.

vim +3021 net/mac80211/util.c

  3012	
  3013	u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef)
  3014	{
  3015		struct ieee80211_he_operation *he_oper;
  3016		struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
  3017		u32 he_oper_params;
  3018		u8 ie_len = 1 + sizeof(struct ieee80211_he_operation);
  3019	
  3020		if (chandef->chan->band == NL80211_BAND_6GHZ)
> 3021			ie_len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
  3022	
  3023		*pos++ = WLAN_EID_EXTENSION;
  3024		*pos++ = ie_len;
  3025		*pos++ = WLAN_EID_EXT_HE_OPERATION;
  3026	
  3027		he_oper_params = 0;
  3028		he_oper_params |= u32_encode_bits(1023, /* disabled */
  3029					IEEE80211_HE_OPERATION_RTS_THRESHOLD_MASK);
  3030		he_oper_params |= u32_encode_bits(1,
  3031					IEEE80211_HE_OPERATION_ER_SU_DISABLE);
  3032		he_oper_params |= u32_encode_bits(1,
  3033					IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED);
  3034		if (chandef->chan->band == NL80211_BAND_6GHZ)
  3035			he_oper_params |= u32_encode_bits(1,
  3036					IEEE80211_HE_OPERATION_6GHZ_OP_INFO);
  3037	
  3038		he_oper = (struct ieee80211_he_operation *)pos;
  3039		he_oper->he_oper_params = cpu_to_le32(he_oper_params);
  3040	
  3041		/* don't require special HE peer rates */
  3042		he_oper->he_mcs_nss_set = cpu_to_le16(0xffff);
  3043		pos += sizeof(struct ieee80211_he_operation);
  3044	
  3045		if (chandef->chan->band != NL80211_BAND_6GHZ)
  3046			goto out;
  3047	
  3048		/* TODO add VHT operational */
  3049		he_6ghz_op = (struct ieee80211_he_oper_6ghz_op_info *)pos;
> 3050		he_6ghz_op->min_rate = 6; /* 6 Mbps */
  3051		he_6ghz_op->primary_chan =
  3052			ieee80211_frequency_to_channel(chandef->chan->center_freq);
  3053		he_6ghz_op->center_freq_seg0_idx =
  3054			ieee80211_frequency_to_channel(chandef->center_freq1);
  3055		if (chandef->center_freq2)
  3056			he_6ghz_op->center_freq_seg1_idx =
  3057				ieee80211_frequency_to_channel(chandef->center_freq2);
  3058		else
  3059			he_6ghz_op->center_freq_seg1_idx = 0;
  3060	
  3061		switch (chandef->width) {
  3062		case NL80211_CHAN_WIDTH_160:
  3063			/* Convert 160 MHz channel width to new style as interop
  3064			 * workaround.
  3065			 */
  3066			he_6ghz_op->control =
> 3067				IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
  3068			he_6ghz_op->center_freq_seg1_idx =
  3069				he_6ghz_op->center_freq_seg0_idx;
  3070			if (chandef->chan->center_freq < chandef->center_freq1)
  3071				he_6ghz_op->center_freq_seg0_idx -= 8;
  3072			else
  3073				he_6ghz_op->center_freq_seg0_idx += 8;
  3074			fallthrough;
  3075		case NL80211_CHAN_WIDTH_80P80:
  3076			he_6ghz_op->control =
  3077				IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
  3078			break;
  3079		case NL80211_CHAN_WIDTH_80:
> 3080			he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ;
  3081			break;
  3082		case NL80211_CHAN_WIDTH_40:
> 3083			he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ;
  3084			break;
  3085		default:
  3086			he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_20MHZ;
  3087			break;
  3088		}
  3089	
  3090		pos += sizeof(struct ieee80211_he_oper_6ghz_op_info);
  3091	
  3092	out:
  3093		return pos;
  3094	}
  3095	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 73564 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC 09/10] mac80211: build HE operation with 6 GHz oper information
  2020-05-28  9:44 ` [RFC 09/10] mac80211: build HE operation with 6 GHz oper information Johannes Berg
  2020-05-28  9:50   ` [RFC PATCH v2] " Johannes Berg
  2020-05-28 17:57   ` [RFC 09/10] " kbuild test robot
@ 2020-05-28 23:22   ` kbuild test robot
  2020-05-29  1:42   ` kbuild test robot
  3 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2020-05-28 23:22 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 7063 bytes --]

Hi Johannes,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on mac80211-next/master]
[also build test ERROR on next-20200528]
[cannot apply to mac80211/master v5.7-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Johannes-Berg/cfg80211-add-a-helper-to-identify-6-GHz-PSCs/20200528-174914
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: h8300-randconfig-r036-20200528 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=h8300 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

In file included from include/asm-generic/bug.h:5,
from arch/h8300/include/asm/bug.h:8,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from include/linux/slab.h:15,
from net/mac80211/mesh.c:9:
include/linux/scatterlist.h: In function 'sg_set_buf':
include/asm-generic/page.h:93:50: warning: ordered comparison of pointer with null pointer [-Wextra]
93 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) &&          |                                                  ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
|                                          ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 |  BUG_ON(!virt_addr_valid(buf));
|  ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 |  BUG_ON(!virt_addr_valid(buf));
|          ^~~~~~~~~~~~~~~
In file included from arch/h8300/include/asm/bug.h:8,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from include/linux/slab.h:15,
from net/mac80211/mesh.c:9:
include/linux/dma-mapping.h: In function 'dma_map_resource':
include/asm-generic/page.h:91:32: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
91 | #define pfn_valid(pfn)  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
|                                ^~
include/asm-generic/bug.h:139:27: note: in definition of macro 'WARN_ON_ONCE'
139 |  int __ret_warn_once = !!(condition);            |                           ^~~~~~~~~
include/linux/dma-mapping.h:352:19: note: in expansion of macro 'pfn_valid'
352 |  if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
|                   ^~~~~~~~~
net/mac80211/mesh.c: In function 'mesh_add_he_oper_ie':
>> net/mac80211/mesh.c:584:17: error: invalid application of 'sizeof' to incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
584 |   len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
|                 ^~~~~~
net/mac80211/mesh.c: In function 'ieee80211_mesh_build_beacon':
net/mac80211/mesh.c:781:14: error: invalid application of 'sizeof' to incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
781 |       sizeof(struct ieee80211_he_oper_6ghz_op_info) +
|              ^~~~~~
--
In file included from include/asm-generic/bug.h:5,
from arch/h8300/include/asm/bug.h:8,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from net/mac80211/mesh_plink.c:7:
include/linux/scatterlist.h: In function 'sg_set_buf':
include/asm-generic/page.h:93:50: warning: ordered comparison of pointer with null pointer [-Wextra]
93 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) &&          |                                                  ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
|                                          ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 |  BUG_ON(!virt_addr_valid(buf));
|  ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 |  BUG_ON(!virt_addr_valid(buf));
|          ^~~~~~~~~~~~~~~
In file included from arch/h8300/include/asm/bug.h:8,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from net/mac80211/mesh_plink.c:7:
include/linux/dma-mapping.h: In function 'dma_map_resource':
include/asm-generic/page.h:91:32: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
91 | #define pfn_valid(pfn)  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
|                                ^~
include/asm-generic/bug.h:139:27: note: in definition of macro 'WARN_ON_ONCE'
139 |  int __ret_warn_once = !!(condition);            |                           ^~~~~~~~~
include/linux/dma-mapping.h:352:19: note: in expansion of macro 'pfn_valid'
352 |  if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
|                   ^~~~~~~~~
net/mac80211/mesh_plink.c: In function 'mesh_plink_frame_tx':
>> net/mac80211/mesh_plink.c:241:16: error: invalid application of 'sizeof' to incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
241 |         sizeof(struct ieee80211_he_oper_6ghz_op_info) +
|                ^~~~~~

vim +584 net/mac80211/mesh.c

   562	
   563	int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata,
   564				struct sk_buff *skb)
   565	{
   566		const struct ieee80211_sta_he_cap *he_cap;
   567		struct ieee80211_supported_band *sband;
   568		u32 len;
   569		u8 *pos;
   570	
   571		sband = ieee80211_get_sband(sdata);
   572		if (!sband)
   573			return -EINVAL;
   574	
   575		he_cap = ieee80211_get_he_iftype_cap(sband, NL80211_IFTYPE_MESH_POINT);
   576		if (!he_cap ||
   577		    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
   578		    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
   579		    sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
   580			return 0;
   581	
   582		len = 2 + 1 + sizeof(struct ieee80211_he_operation);
   583		if (sdata->vif.bss_conf.chandef.chan->band == NL80211_BAND_6GHZ)
 > 584			len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
   585	
   586		if (skb_tailroom(skb) < len)
   587			return -ENOMEM;
   588	
   589		pos = skb_put(skb, len);
   590		ieee80211_ie_build_he_oper(pos, &sdata->vif.bss_conf.chandef);
   591	
   592		return 0;
   593	}
   594	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31111 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC 09/10] mac80211: build HE operation with 6 GHz oper information
  2020-05-28  9:44 ` [RFC 09/10] mac80211: build HE operation with 6 GHz oper information Johannes Berg
                     ` (2 preceding siblings ...)
  2020-05-28 23:22   ` kbuild test robot
@ 2020-05-29  1:42   ` kbuild test robot
  3 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2020-05-29  1:42 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 7368 bytes --]

Hi Johannes,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on mac80211-next/master]
[also build test ERROR on next-20200528]
[cannot apply to mac80211/master v5.7-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Johannes-Berg/cfg80211-add-a-helper-to-identify-6-GHz-PSCs/20200528-174914
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: ia64-randconfig-r035-20200528 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

In file included from arch/ia64/include/asm/pgtable.h:154,
from include/linux/mm.h:95,
from include/linux/bvec.h:13,
from include/linux/skbuff.h:17,
from include/linux/if_ether.h:19,
from include/net/mac80211.h:18,
from net/mac80211/util.c:14:
arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
arch/ia64/include/asm/mmu_context.h:137:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
137 |  unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
|                                         ^~~~~~~
net/mac80211/util.c: In function 'ieee80211_ie_build_he_oper':
>> net/mac80211/util.c:3021:20: error: invalid application of 'sizeof' to incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
3021 |   ie_len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
|                    ^~~~~~
>> net/mac80211/util.c:3050:12: error: dereferencing pointer to incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
3050 |  he_6ghz_op->min_rate = 6; /* 6 Mbps */
|            ^~
>> net/mac80211/util.c:3067:4: error: 'IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ' undeclared (first use in this function); did you mean 'IEEE80211_VHT_CHANWIDTH_80P80MHZ'?
3067 |    IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
|    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|    IEEE80211_VHT_CHANWIDTH_80P80MHZ
net/mac80211/util.c:3067:4: note: each undeclared identifier is reported only once for each function it appears in
>> net/mac80211/util.c:3080:25: error: 'IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ' undeclared (first use in this function); did you mean 'IEEE80211_VHT_CHANWIDTH_80MHZ'?
3080 |   he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ;
|                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|                         IEEE80211_VHT_CHANWIDTH_80MHZ
>> net/mac80211/util.c:3083:25: error: 'IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ' undeclared (first use in this function); did you mean 'IEEE80211_VHT_CHANWIDTH_80MHZ'?
3083 |   he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ;
|                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|                         IEEE80211_VHT_CHANWIDTH_80MHZ
>> net/mac80211/util.c:3086:25: error: 'IEEE80211_HE_6GHZ_CHANWIDTH_20MHZ' undeclared (first use in this function); did you mean 'IEEE80211_HT_CHANWIDTH_20MHZ'?
3086 |   he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_20MHZ;
|                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|                         IEEE80211_HT_CHANWIDTH_20MHZ
net/mac80211/util.c:3090:16: error: invalid application of 'sizeof' to incomplete type 'struct ieee80211_he_oper_6ghz_op_info'
3090 |  pos += sizeof(struct ieee80211_he_oper_6ghz_op_info);
|                ^~~~~~

vim +3021 net/mac80211/util.c

  3012	
  3013	u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef)
  3014	{
  3015		struct ieee80211_he_operation *he_oper;
  3016		struct ieee80211_he_oper_6ghz_op_info *he_6ghz_op;
  3017		u32 he_oper_params;
  3018		u8 ie_len = 1 + sizeof(struct ieee80211_he_operation);
  3019	
  3020		if (chandef->chan->band == NL80211_BAND_6GHZ)
> 3021			ie_len += sizeof(struct ieee80211_he_oper_6ghz_op_info);
  3022	
  3023		*pos++ = WLAN_EID_EXTENSION;
  3024		*pos++ = ie_len;
  3025		*pos++ = WLAN_EID_EXT_HE_OPERATION;
  3026	
  3027		he_oper_params = 0;
  3028		he_oper_params |= u32_encode_bits(1023, /* disabled */
  3029					IEEE80211_HE_OPERATION_RTS_THRESHOLD_MASK);
  3030		he_oper_params |= u32_encode_bits(1,
  3031					IEEE80211_HE_OPERATION_ER_SU_DISABLE);
  3032		he_oper_params |= u32_encode_bits(1,
  3033					IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED);
  3034		if (chandef->chan->band == NL80211_BAND_6GHZ)
  3035			he_oper_params |= u32_encode_bits(1,
  3036					IEEE80211_HE_OPERATION_6GHZ_OP_INFO);
  3037	
  3038		he_oper = (struct ieee80211_he_operation *)pos;
  3039		he_oper->he_oper_params = cpu_to_le32(he_oper_params);
  3040	
  3041		/* don't require special HE peer rates */
  3042		he_oper->he_mcs_nss_set = cpu_to_le16(0xffff);
  3043		pos += sizeof(struct ieee80211_he_operation);
  3044	
  3045		if (chandef->chan->band != NL80211_BAND_6GHZ)
  3046			goto out;
  3047	
  3048		/* TODO add VHT operational */
  3049		he_6ghz_op = (struct ieee80211_he_oper_6ghz_op_info *)pos;
> 3050		he_6ghz_op->min_rate = 6; /* 6 Mbps */
  3051		he_6ghz_op->primary_chan =
  3052			ieee80211_frequency_to_channel(chandef->chan->center_freq);
  3053		he_6ghz_op->center_freq_seg0_idx =
  3054			ieee80211_frequency_to_channel(chandef->center_freq1);
  3055		if (chandef->center_freq2)
  3056			he_6ghz_op->center_freq_seg1_idx =
  3057				ieee80211_frequency_to_channel(chandef->center_freq2);
  3058		else
  3059			he_6ghz_op->center_freq_seg1_idx = 0;
  3060	
  3061		switch (chandef->width) {
  3062		case NL80211_CHAN_WIDTH_160:
  3063			/* Convert 160 MHz channel width to new style as interop
  3064			 * workaround.
  3065			 */
  3066			he_6ghz_op->control =
> 3067				IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
  3068			he_6ghz_op->center_freq_seg1_idx =
  3069				he_6ghz_op->center_freq_seg0_idx;
  3070			if (chandef->chan->center_freq < chandef->center_freq1)
  3071				he_6ghz_op->center_freq_seg0_idx -= 8;
  3072			else
  3073				he_6ghz_op->center_freq_seg0_idx += 8;
  3074			fallthrough;
  3075		case NL80211_CHAN_WIDTH_80P80:
  3076			he_6ghz_op->control =
  3077				IEEE80211_HE_6GHZ_CHANWIDTH_160MHZ_80P80MHZ;
  3078			break;
  3079		case NL80211_CHAN_WIDTH_80:
> 3080			he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_80MHZ;
  3081			break;
  3082		case NL80211_CHAN_WIDTH_40:
> 3083			he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_40MHZ;
  3084			break;
  3085		default:
> 3086			he_6ghz_op->control = IEEE80211_HE_6GHZ_CHANWIDTH_20MHZ;
  3087			break;
  3088		}
  3089	
  3090		pos += sizeof(struct ieee80211_he_oper_6ghz_op_info);
  3091	
  3092	out:
  3093		return pos;
  3094	}
  3095	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31473 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-05-29  1:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28  9:44 [RFC 01/10] cfg80211: add a helper to identify 6 GHz PSCs Johannes Berg
2020-05-28  9:44 ` [RFC 02/10] ieee80211: definitions for reduced neighbor reports Johannes Berg
2020-05-28  9:44 ` [RFC 03/10] ieee80211: add code to obtain and parse 6 GHz operation field Johannes Berg
2020-05-28  9:44 ` [RFC 04/10] ieee80211: add HE ext EIDs and 6 GHz capability defines Johannes Berg
2020-05-28  9:44 ` [RFC 05/10] cfg80211: handle 6 GHz capability of new station Johannes Berg
2020-05-28  9:44 ` [RFC 06/10] mac80211: add HE 6 GHz Band Capabilities into parse extension Johannes Berg
2020-05-28  9:44 ` [RFC 07/10] cfg80211: add and expose HE 6 GHz band capabilities Johannes Berg
2020-05-28  9:44 ` [RFC 08/10] mac80211: add HE 6 GHz Band Capability element Johannes Berg
2020-05-28 12:33   ` Johannes Berg
2020-05-28  9:44 ` [RFC 09/10] mac80211: build HE operation with 6 GHz oper information Johannes Berg
2020-05-28  9:50   ` [RFC PATCH v2] " Johannes Berg
2020-05-28 17:57   ` [RFC 09/10] " kbuild test robot
2020-05-28 23:22   ` kbuild test robot
2020-05-29  1:42   ` kbuild test robot
2020-05-28  9:44 ` [RFC 10/10] mac80211: do not allow HT/VHT IEs in 6 GHz mesh mode Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.