All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Crispin <john@phrozen.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org,
	John Crispin <john@phrozen.org>
Subject: [PATCH 01/12] nl80211: add basic multiple bssid support
Date: Thu,  4 Jun 2020 09:09:41 +0200	[thread overview]
Message-ID: <20200604070952.15481-2-john@phrozen.org> (raw)
In-Reply-To: <20200604070952.15481-1-john@phrozen.org>

This patch adds support for passing the multiple bssid config to the
kernel when adding an interface. A bss can be legacy, transmitting or
non-transmitting. A non-transmitting BSSID will have a parent interface,
which needs to be transmitting.

Signed-off-by: John Crispin <john@phrozen.org>
---
 include/net/cfg80211.h       |  8 ++++++++
 include/uapi/linux/nl80211.h | 25 +++++++++++++++++++++++++
 net/wireless/nl80211.c       | 14 ++++++++++++++
 3 files changed, 47 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index deaa3668d47a..f0fc65f900b4 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -601,6 +601,8 @@ struct vif_params {
 	u8 macaddr[ETH_ALEN];
 	const u8 *vht_mumimo_groups;
 	const u8 *vht_mumimo_follow_addr;
+	enum nl80211_multi_bssid_mode multi_bssid_mode;
+	u32 multi_bssid_parent;
 };
 
 /**
@@ -5060,6 +5062,9 @@ struct cfg80211_cqm_config;
  * @pmsr_list: (private) peer measurement requests
  * @pmsr_lock: (private) peer measurements requests/results lock
  * @pmsr_free_wk: (private) peer measurements cleanup work
+ * @multi_bssid_mode: Is this a legacy, transmitted or non-transmitted bssid
+ * @multi_bssid_parent: a non-transmitted bssid has a transmitted parent
+ * @multi_bssid_list: linked list for tracking parent - child relations.
  */
 struct wireless_dev {
 	struct wiphy *wiphy;
@@ -5136,6 +5141,9 @@ struct wireless_dev {
 	struct list_head pmsr_list;
 	spinlock_t pmsr_lock;
 	struct work_struct pmsr_free_wk;
+	enum nl80211_multi_bssid_mode multi_bssid_mode;
+	struct wireless_dev *multi_bssid_parent;
+	struct list_head multi_bssid_list;
 };
 
 static inline u8 *wdev_address(struct wireless_dev *wdev)
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 966887bd654c..a586567f18ea 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2470,6 +2470,12 @@ enum nl80211_commands {
  *	no roaming occurs between the reauth threshold and PMK expiration,
  *	disassociation is still forced.
  *
+ * @NL80211_ATTR_MULTI_BSSID_MODE: Set the (Non-)Transmitted flag for this
+ *	BSSIDs beacon.
+ *
+ * @NL80211_ATTR_MULTI_BSSID_PARENT: If this is a Non-Transmitted BSSID, define
+ *	the parent interface.
+ *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2945,6 +2951,9 @@ enum nl80211_attrs {
 	NL80211_ATTR_PMK_LIFETIME,
 	NL80211_ATTR_PMK_REAUTH_THRESHOLD,
 
+	NL80211_ATTR_MULTI_BSSID_MODE,
+	NL80211_ATTR_MULTI_BSSID_PARENT,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
@@ -6700,6 +6709,22 @@ enum nl80211_peer_measurement_ftm_failure_reasons {
 	NL80211_PMSR_FTM_FAILURE_BAD_CHANGED_PARAMS,
 };
 
+/**
+ * enum nl80211_multi_bssid_mode - Multiple BSSID beacon type
+ *
+ * Used by cfg80211_ap_settings
+ *
+ * @MULTIPLE_BSSID_LEGACY: This BSS is not part of a multiple BSSID group
+ * @MULTIPLE_BSSID_TRANSMITTED: This BSS is broadcasting a multiple BSSID
+ *                                    beacon
+ * @MULTIPLE_BSSID_NON_TRANSMITTED: This BSS is not broadcasting a beacon
+ */
+enum nl80211_multi_bssid_mode {
+	NL80211_MULTIPLE_BSSID_LEGACY = 0,
+	NL80211_MULTIPLE_BSSID_TRANSMITTED,
+	NL80211_MULTIPLE_BSSID_NON_TRANSMITTED,
+};
+
 /**
  * enum nl80211_peer_measurement_ftm_resp - FTM response attributes
  * @__NL80211_PMSR_FTM_RESP_ATTR_INVALID: invalid
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index ed545b2a958d..3b502514944c 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -663,6 +663,10 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
 	[NL80211_ATTR_CONTROL_PORT_NO_PREAUTH] = { .type = NLA_FLAG },
 	[NL80211_ATTR_PMK_LIFETIME] = NLA_POLICY_MIN(NLA_U32, 1),
 	[NL80211_ATTR_PMK_REAUTH_THRESHOLD] = NLA_POLICY_RANGE(NLA_U8, 1, 100),
+	[NL80211_ATTR_MULTI_BSSID_MODE] = NLA_POLICY_RANGE(NLA_U8,
+					NL80211_MULTIPLE_BSSID_LEGACY,
+					NL80211_MULTIPLE_BSSID_NON_TRANSMITTED),
+	[NL80211_ATTR_MULTI_BSSID_PARENT] = { .type = NLA_U32 },
 };
 
 /* policy for the key attributes */
@@ -3756,6 +3760,16 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
 	if (err < 0)
 		return err;
 
+	if (info->attrs[NL80211_ATTR_MULTI_BSSID_MODE])
+		params.multi_bssid_mode =
+			nla_get_u8(info->attrs[NL80211_ATTR_MULTI_BSSID_MODE]);
+	if (info->attrs[NL80211_ATTR_MULTI_BSSID_PARENT])
+		params.multi_bssid_parent =
+			nla_get_u8(info->attrs[NL80211_ATTR_MULTI_BSSID_PARENT]);
+	if (params.multi_bssid_mode == NL80211_MULTIPLE_BSSID_NON_TRANSMITTED &&
+	    !params.multi_bssid_parent)
+		return -EOPNOTSUPP;
+
 	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
 	if (!msg)
 		return -ENOMEM;
-- 
2.20.1


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

WARNING: multiple messages have this Message-ID (diff)
From: John Crispin <john@phrozen.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org,
	John Crispin <john@phrozen.org>
Subject: [PATCH 01/12] nl80211: add basic multiple bssid support
Date: Thu,  4 Jun 2020 09:09:41 +0200	[thread overview]
Message-ID: <20200604070952.15481-2-john@phrozen.org> (raw)
In-Reply-To: <20200604070952.15481-1-john@phrozen.org>

This patch adds support for passing the multiple bssid config to the
kernel when adding an interface. A bss can be legacy, transmitting or
non-transmitting. A non-transmitting BSSID will have a parent interface,
which needs to be transmitting.

Signed-off-by: John Crispin <john@phrozen.org>
---
 include/net/cfg80211.h       |  8 ++++++++
 include/uapi/linux/nl80211.h | 25 +++++++++++++++++++++++++
 net/wireless/nl80211.c       | 14 ++++++++++++++
 3 files changed, 47 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index deaa3668d47a..f0fc65f900b4 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -601,6 +601,8 @@ struct vif_params {
 	u8 macaddr[ETH_ALEN];
 	const u8 *vht_mumimo_groups;
 	const u8 *vht_mumimo_follow_addr;
+	enum nl80211_multi_bssid_mode multi_bssid_mode;
+	u32 multi_bssid_parent;
 };
 
 /**
@@ -5060,6 +5062,9 @@ struct cfg80211_cqm_config;
  * @pmsr_list: (private) peer measurement requests
  * @pmsr_lock: (private) peer measurements requests/results lock
  * @pmsr_free_wk: (private) peer measurements cleanup work
+ * @multi_bssid_mode: Is this a legacy, transmitted or non-transmitted bssid
+ * @multi_bssid_parent: a non-transmitted bssid has a transmitted parent
+ * @multi_bssid_list: linked list for tracking parent - child relations.
  */
 struct wireless_dev {
 	struct wiphy *wiphy;
@@ -5136,6 +5141,9 @@ struct wireless_dev {
 	struct list_head pmsr_list;
 	spinlock_t pmsr_lock;
 	struct work_struct pmsr_free_wk;
+	enum nl80211_multi_bssid_mode multi_bssid_mode;
+	struct wireless_dev *multi_bssid_parent;
+	struct list_head multi_bssid_list;
 };
 
 static inline u8 *wdev_address(struct wireless_dev *wdev)
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 966887bd654c..a586567f18ea 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2470,6 +2470,12 @@ enum nl80211_commands {
  *	no roaming occurs between the reauth threshold and PMK expiration,
  *	disassociation is still forced.
  *
+ * @NL80211_ATTR_MULTI_BSSID_MODE: Set the (Non-)Transmitted flag for this
+ *	BSSIDs beacon.
+ *
+ * @NL80211_ATTR_MULTI_BSSID_PARENT: If this is a Non-Transmitted BSSID, define
+ *	the parent interface.
+ *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2945,6 +2951,9 @@ enum nl80211_attrs {
 	NL80211_ATTR_PMK_LIFETIME,
 	NL80211_ATTR_PMK_REAUTH_THRESHOLD,
 
+	NL80211_ATTR_MULTI_BSSID_MODE,
+	NL80211_ATTR_MULTI_BSSID_PARENT,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
@@ -6700,6 +6709,22 @@ enum nl80211_peer_measurement_ftm_failure_reasons {
 	NL80211_PMSR_FTM_FAILURE_BAD_CHANGED_PARAMS,
 };
 
+/**
+ * enum nl80211_multi_bssid_mode - Multiple BSSID beacon type
+ *
+ * Used by cfg80211_ap_settings
+ *
+ * @MULTIPLE_BSSID_LEGACY: This BSS is not part of a multiple BSSID group
+ * @MULTIPLE_BSSID_TRANSMITTED: This BSS is broadcasting a multiple BSSID
+ *                                    beacon
+ * @MULTIPLE_BSSID_NON_TRANSMITTED: This BSS is not broadcasting a beacon
+ */
+enum nl80211_multi_bssid_mode {
+	NL80211_MULTIPLE_BSSID_LEGACY = 0,
+	NL80211_MULTIPLE_BSSID_TRANSMITTED,
+	NL80211_MULTIPLE_BSSID_NON_TRANSMITTED,
+};
+
 /**
  * enum nl80211_peer_measurement_ftm_resp - FTM response attributes
  * @__NL80211_PMSR_FTM_RESP_ATTR_INVALID: invalid
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index ed545b2a958d..3b502514944c 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -663,6 +663,10 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
 	[NL80211_ATTR_CONTROL_PORT_NO_PREAUTH] = { .type = NLA_FLAG },
 	[NL80211_ATTR_PMK_LIFETIME] = NLA_POLICY_MIN(NLA_U32, 1),
 	[NL80211_ATTR_PMK_REAUTH_THRESHOLD] = NLA_POLICY_RANGE(NLA_U8, 1, 100),
+	[NL80211_ATTR_MULTI_BSSID_MODE] = NLA_POLICY_RANGE(NLA_U8,
+					NL80211_MULTIPLE_BSSID_LEGACY,
+					NL80211_MULTIPLE_BSSID_NON_TRANSMITTED),
+	[NL80211_ATTR_MULTI_BSSID_PARENT] = { .type = NLA_U32 },
 };
 
 /* policy for the key attributes */
@@ -3756,6 +3760,16 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
 	if (err < 0)
 		return err;
 
+	if (info->attrs[NL80211_ATTR_MULTI_BSSID_MODE])
+		params.multi_bssid_mode =
+			nla_get_u8(info->attrs[NL80211_ATTR_MULTI_BSSID_MODE]);
+	if (info->attrs[NL80211_ATTR_MULTI_BSSID_PARENT])
+		params.multi_bssid_parent =
+			nla_get_u8(info->attrs[NL80211_ATTR_MULTI_BSSID_PARENT]);
+	if (params.multi_bssid_mode == NL80211_MULTIPLE_BSSID_NON_TRANSMITTED &&
+	    !params.multi_bssid_parent)
+		return -EOPNOTSUPP;
+
 	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
 	if (!msg)
 		return -ENOMEM;
-- 
2.20.1


  reply	other threads:[~2020-06-04  7:10 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04  7:09 [PATCH 00/12] mac80211: add multiple bssid support John Crispin
2020-06-04  7:09 ` John Crispin
2020-06-04  7:09 ` John Crispin [this message]
2020-06-04  7:09   ` [PATCH 01/12] nl80211: add basic " John Crispin
2020-06-10  0:25   ` Rajkumar Manoharan
2020-06-10  0:25     ` Rajkumar Manoharan
2020-06-04  7:09 ` [PATCH 02/12] nl80211: add attributes for multiple bssid related settings John Crispin
2020-06-04  7:09   ` John Crispin
2020-06-11  4:24   ` Rajkumar Manoharan
2020-06-11  4:24     ` Rajkumar Manoharan
2020-06-04  7:09 ` [PATCH 03/12] nl80211: add attributes to set beacon transmit mode John Crispin
2020-06-04  7:09   ` John Crispin
2020-06-04  7:09 ` [PATCH 04/12] mac80211: add multiple bssid support John Crispin
2020-06-04  7:09   ` John Crispin
2020-06-04  7:09 ` [PATCH 05/12] mac80211: add multiple bssid IE parsing John Crispin
2020-06-04  7:09   ` John Crispin
2020-06-04  7:09 ` [PATCH 06/12] mac80211: propagate multi bssid settings when starting an AP John Crispin
2020-06-04  7:09   ` John Crispin
2020-06-04  7:09 ` [PATCH 07/12] mac80211: propagate beacon tx mode to the driver John Crispin
2020-06-04  7:09   ` John Crispin
2020-06-04  7:09 ` [PATCH 08/12] ath11k: pass multiple bssid info to FW when a new vdev is created John Crispin
2020-06-04  7:09   ` John Crispin
2020-06-04  7:09 ` [PATCH 09/12] ath11k: add a struct to pass parameters into ath11k_wmi_vdev_up John Crispin
2020-06-04  7:09   ` John Crispin
2020-06-04  7:09 ` [PATCH 10/12] ath11k: add the multiple bssid IE offset to the beacon template John Crispin
2020-06-04  7:09   ` John Crispin
2020-06-04  7:09 ` [PATCH 11/12] ath11k: set beacon tx mode John Crispin
2020-06-04  7:09   ` John Crispin
2020-06-04  7:09 ` [PATCH 12/12] ath11k: set the multiple bssid hw cap John Crispin
2020-06-04  7:09   ` John Crispin
2020-06-08 11:09   ` Kalle Valo
2020-06-08 11:09     ` Kalle Valo
2020-06-08 11:29     ` John Crispin
2020-06-08 11:29       ` John Crispin
2020-06-11  4:44   ` Rajkumar Manoharan
2020-06-11  4:44     ` Rajkumar Manoharan
2020-06-09  3:35 ` [PATCH 00/12] mac80211: add multiple bssid support Rajkumar Manoharan
2020-06-09  3:35   ` Rajkumar Manoharan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200604070952.15481-2-john@phrozen.org \
    --to=john@phrozen.org \
    --cc=ath11k@lists.infradead.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.