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 03/12] nl80211: add attributes to set beacon transmit mode
Date: Thu, 4 Jun 2020 09:09:43 +0200 [thread overview]
Message-ID: <20200604070952.15481-4-john@phrozen.org> (raw)
In-Reply-To: <20200604070952.15481-1-john@phrozen.org>
Beacons on a radio can be sent out in burst (back to back) or staggered
(equally spread out over time) mode. This patch adds the required nl80211
attributes allowing us to configure this from userland.
Signed-off-by: John Crispin <john@phrozen.org>
---
include/net/cfg80211.h | 3 +++
include/uapi/linux/nl80211.h | 17 +++++++++++++++++
net/wireless/nl80211.c | 7 +++++++
3 files changed, 27 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 77cd2f780c6a..157d37f74efb 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1094,6 +1094,8 @@ enum cfg80211_ap_settings_flags {
* @he_obss_pd: OBSS Packet Detection settings
* @he_bss_color: BSS Color settings
* @he_oper: HE operation IE (or %NULL if HE isn't enabled)
+ * @beacon_tx_mode: can be set to tell the driver to sent the beacons in staggered
+ * or burst mode.
*/
struct cfg80211_ap_settings {
struct cfg80211_chan_def chandef;
@@ -1125,6 +1127,7 @@ struct cfg80211_ap_settings {
struct ieee80211_he_obss_pd he_obss_pd;
struct cfg80211_he_bss_color he_bss_color;
struct ieee80211_multi_bssid multi_bssid;
+ enum nl80211_beacon_tx_mode beacon_tx_mode;
};
/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index f18f681796ed..2c4950aeb474 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2481,6 +2481,8 @@ enum nl80211_commands {
*
* @NL80211_ATTR_MULTI_BSSID_COUNT: The number of BSSs inside the multi bssid IE.
*
+ * @NL80211_ATTR_BEACON_TX_MODE: Set the beacon tx mode to staggered or burst.
+ *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2961,6 +2963,8 @@ enum nl80211_attrs {
NL80211_ATTR_MULTI_BSSID_INDEX,
NL80211_ATTR_MULTI_BSSID_COUNT,
+ NL80211_ATTR_BEACON_TX_MODE,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -6732,6 +6736,19 @@ enum nl80211_multi_bssid_mode {
NL80211_MULTIPLE_BSSID_NON_TRANSMITTED,
};
+/**
+ * enum nl80211_beacon_tx_mode - Beacon tx mode settings
+ *
+ * @BEACON_TX_MODE_DEFAULT: The beacons shall be sent out in its default mode
+ * @BEACON_TX_MODE_STAGGERED: The beacons shall be sent out in staggered mode
+ * @BEACON_TX_MODE_BURST: The beacons shall be sent out in burst mode
+ * beacon
+ */
+enum nl80211_beacon_tx_mode {
+ NL80211_BEACON_TX_MODE_STAGGERED = 0,
+ NL80211_BEACON_TX_MODE_BURST,
+};
+
/**
* 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 58ce67bc31da..1f6f8ecbfb57 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -669,6 +669,9 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
[NL80211_ATTR_MULTI_BSSID_PARENT] = { .type = NLA_U32 },
[NL80211_ATTR_MULTI_BSSID_INDEX] = { .type = NLA_U32 },
[NL80211_ATTR_MULTI_BSSID_COUNT] = { .type = NLA_U32 },
+ [NL80211_ATTR_BEACON_TX_MODE] = NLA_POLICY_RANGE(NLA_U8,
+ NL80211_BEACON_TX_MODE_STAGGERED,
+ NL80211_BEACON_TX_MODE_BURST),
};
/* policy for the key attributes */
@@ -5165,6 +5168,10 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
params.multi_bssid.count = nla_get_u32(
info->attrs[NL80211_ATTR_MULTI_BSSID_COUNT]);
+ if (info->attrs[NL80211_ATTR_BEACON_TX_MODE])
+ params.beacon_tx_mode =
+ nla_get_u8(info->attrs[NL80211_ATTR_BEACON_TX_MODE]);
+
nl80211_calculate_ap_params(¶ms);
if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT])
--
2.20.1
next prev parent reply other threads:[~2020-06-04 7:10 UTC|newest]
Thread overview: 19+ 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 ` [PATCH 01/12] nl80211: add basic " John Crispin
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-11 4:24 ` Rajkumar Manoharan
2020-06-04 7:09 ` John Crispin [this message]
2020-06-04 7:09 ` [PATCH 04/12] mac80211: add multiple bssid support John Crispin
2020-06-04 7:09 ` [PATCH 05/12] mac80211: add multiple bssid IE parsing 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 ` [PATCH 07/12] mac80211: propagate beacon tx mode to the driver 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 ` [PATCH 09/12] ath11k: add a struct to pass parameters into ath11k_wmi_vdev_up 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 ` [PATCH 11/12] ath11k: set beacon tx mode John Crispin
2020-06-04 7:09 ` [PATCH 12/12] ath11k: set the multiple bssid hw cap John Crispin
2020-06-08 11:09 ` Kalle Valo
2020-06-08 11:29 ` John Crispin
2020-06-11 4:44 ` Rajkumar Manoharan
2020-06-09 3:35 ` [PATCH 00/12] mac80211: add multiple bssid support 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-4-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).