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 V2 02/10] nl80211: add attributes for multiple bssid related settings
Date: Mon, 6 Jul 2020 13:52:11 +0200 [thread overview]
Message-ID: <20200706115219.663650-2-john@phrozen.org> (raw)
In-Reply-To: <20200706115219.663650-1-john@phrozen.org>
When we start a multiple bssid AP we need to pass the index and number of
peers to the kernel. This info needs to be propagated to the driver.
Signed-off-by: John Crispin <john@phrozen.org>
---
include/net/cfg80211.h | 12 ++++++++++++
include/uapi/linux/nl80211.h | 7 +++++++
net/wireless/nl80211.c | 15 +++++++++++++++
3 files changed, 34 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index ba8f3c8df0ca..ba0d25f95cf9 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -453,6 +453,17 @@ struct ieee80211_supported_band {
const struct ieee80211_sband_iftype_data *iftype_data;
};
+/**
+ * struct ieee80211_multi_bssid - AP settings for multi bssid
+ *
+ * @index: the index of this AP in the multi bssid group.
+ * @count: the total number of multi bssid peer APs.
+ */
+struct ieee80211_multi_bssid {
+ u32 index;
+ u32 count;
+};
+
/**
* ieee80211_get_sband_iftype_data - return sband data for a given iftype
* @sband: the sband to search for the STA on
@@ -1126,6 +1137,7 @@ struct cfg80211_ap_settings {
u32 flags;
struct ieee80211_he_obss_pd he_obss_pd;
struct cfg80211_he_bss_color he_bss_color;
+ struct ieee80211_multi_bssid multi_bssid;
};
/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index b7a5d1de7aff..45b88f1221b0 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2511,6 +2511,11 @@ enum nl80211_commands {
* @NL80211_ATTR_MULTI_BSSID_PARENT: If this is a Non-Transmitted BSSID, define
* the parent interface.
*
+ * @NL80211_ATTR_MULTI_BSSID_INDEX: The index of this BSS inside the multi bssid
+ * IE.
+ *
+ * @NL80211_ATTR_MULTI_BSSID_COUNT: The number of BSSs inside the multi bssid IE.
+ *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2995,6 +3000,8 @@ enum nl80211_attrs {
NL80211_ATTR_MULTI_BSSID_MODE,
NL80211_ATTR_MULTI_BSSID_PARENT,
+ NL80211_ATTR_MULTI_BSSID_INDEX,
+ NL80211_ATTR_MULTI_BSSID_COUNT,
/* add attributes here, update the policy in nl80211.c */
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index e29f834f8d12..e1696a4c965b 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -662,6 +662,8 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
NL80211_MULTIPLE_BSSID_LEGACY,
NL80211_MULTIPLE_BSSID_NON_TRANSMITTED),
[NL80211_ATTR_MULTI_BSSID_PARENT] = { .type = NLA_U32 },
+ [NL80211_ATTR_MULTI_BSSID_INDEX] = { .type = NLA_U32 },
+ [NL80211_ATTR_MULTI_BSSID_COUNT] = { .type = NLA_U32 },
};
/* policy for the key attributes */
@@ -4885,6 +4887,11 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
!info->attrs[NL80211_ATTR_BEACON_HEAD])
return -EINVAL;
+ if (wdev->multi_bssid_mode == NL80211_MULTIPLE_BSSID_NON_TRANSMITTED &&
+ (!info->attrs[NL80211_ATTR_MULTI_BSSID_INDEX] ||
+ !info->attrs[NL80211_ATTR_MULTI_BSSID_COUNT]))
+ return -EINVAL;
+
err = nl80211_parse_beacon(rdev, info->attrs, ¶ms.beacon);
if (err)
return err;
@@ -5041,6 +5048,14 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
return err;
}
+ if (info->attrs[NL80211_ATTR_MULTI_BSSID_INDEX])
+ params.multi_bssid.index = nla_get_u32(
+ info->attrs[NL80211_ATTR_MULTI_BSSID_INDEX]);
+
+ if (info->attrs[NL80211_ATTR_MULTI_BSSID_COUNT])
+ params.multi_bssid.count = nla_get_u32(
+ info->attrs[NL80211_ATTR_MULTI_BSSID_COUNT]);
+
nl80211_calculate_ap_params(¶ms);
if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT])
--
2.25.1
next prev parent reply other threads:[~2020-07-06 11:52 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-06 11:52 [PATCH V2 01/10] nl80211: add basic multiple bssid support John Crispin
2020-07-06 11:52 ` John Crispin [this message]
2020-07-30 12:57 ` [PATCH V2 02/10] nl80211: add attributes for multiple bssid related settings Johannes Berg
2020-07-06 11:52 ` [PATCH V2 03/10] mac80211: add multiple bssid support John Crispin
2020-07-30 13:03 ` Johannes Berg
2020-07-06 11:52 ` [PATCH V2 04/10] mac80211: add multiple bssid IE parsing John Crispin
2020-07-30 13:05 ` Johannes Berg
2020-07-06 11:52 ` [PATCH V2 05/10] mac80211: propagate multi bssid settings when starting John Crispin
2020-07-30 13:06 ` Johannes Berg
2020-07-06 11:52 ` [PATCH V2 06/10] ath11k: pass multiple bssid info to FW when a new vdev is created John Crispin
2020-08-02 15:02 ` Shay Bar
2020-08-02 15:40 ` John Crispin
2020-07-06 11:52 ` [PATCH V2 07/10] ath11k: add a struct to pass parameters into ath11k_wmi_vdev_up John Crispin
2020-07-06 11:52 ` [PATCH V2 08/10] ath11k: add the multiple bssid IE offset to the beacon template John Crispin
2020-07-06 11:52 ` [PATCH V2 09/10] ath11k: set beacon tx mode John Crispin
2020-07-06 11:52 ` [PATCH V2 10/10] ath11k: set the multiple bssid hw cap John Crispin
2020-07-30 12:55 ` [PATCH V2 01/10] nl80211: add basic multiple bssid support Johannes Berg
2020-07-30 12:57 ` Johannes Berg
2020-07-30 14:37 ` Johannes Berg
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=20200706115219.663650-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).