From: Kieran Frewen <kieran.frewen@morsemicro.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, quic_jjohnson@quicinc.com,
Kieran Frewen <kieran.frewen@morsemicro.com>
Subject: [PATCH v2 03/12] mac80211: S1G beacon/short beacon support
Date: Tue, 30 Aug 2022 02:20:08 +0000 [thread overview]
Message-ID: <20220830022017.51017-4-kieran.frewen@morsemicro.com> (raw)
In-Reply-To: <20220830022017.51017-1-kieran.frewen@morsemicro.com>
If configured, use the S1G short beacon format. The S1G short beacon
format includes a limited set of information elements.
Signed-off-by: Kieran Frewen <kieran.frewen@morsemicro.com>
---
include/net/cfg80211.h | 2 +-
include/net/mac80211.h | 1 +
net/mac80211/cfg.c | 1 +
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/tx.c | 14 +++++++++++++-
5 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 908d58393484..f462dcdd023a 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1328,7 +1328,7 @@ struct cfg80211_ap_settings {
struct cfg80211_beacon_data beacon;
- int beacon_interval, dtim_period;
+ int beacon_interval, dtim_period, short_beacon_period;
const u8 *ssid;
size_t ssid_len;
enum nl80211_hidden_ssid hidden_ssid;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index f198af600b5e..359edfa9ec1c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -672,6 +672,7 @@ struct ieee80211_bss_conf {
bool enable_beacon;
u8 dtim_period;
u16 beacon_int;
+ u8 short_beacon_period;
u16 assoc_capability;
u64 sync_tsf;
u32 sync_device_ts;
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index a4f6971b7a19..03ed90ce9a84 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1236,6 +1236,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
}
link_conf->dtim_period = params->dtim_period;
+ link_conf->short_beacon_period = params->short_beacon_period;
link_conf->enable_beacon = true;
link_conf->allow_p2p_go_ps = sdata->vif.p2p;
link_conf->twt_responder = params->twt_responder;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index e192e1ec0261..cd8879998739 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -267,6 +267,7 @@ struct beacon_data {
struct ieee80211_meshconf_ie *meshconf;
u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM];
u8 cntdwn_current_counter;
+ u8 long_beacon_count;
struct cfg80211_mbssid_elems *mbssid_ies;
struct rcu_head rcu_head;
};
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index bf85a01fcf9d..48c737aeb3f7 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -5099,6 +5099,18 @@ ieee80211_beacon_get_ap(struct ieee80211_hw *hw,
struct sk_buff *skb = NULL;
u16 csa_off_base = 0;
int mbssid_len;
+ bool is_short = false;
+
+ if (vif->cfg.s1g) {
+ if (beacon->long_beacon_count == 0) {
+ is_short = false;
+ beacon->long_beacon_count =
+ vif->bss_conf.short_beacon_period - 1;
+ } else {
+ is_short = true;
+ beacon->long_beacon_count--;
+ }
+ }
if (beacon->cntdwn_counter_offsets[0]) {
if (!is_template)
@@ -5136,7 +5148,7 @@ ieee80211_beacon_get_ap(struct ieee80211_hw *hw,
csa_off_base = skb->len;
}
- if (beacon->tail)
+ if (beacon->tail && !is_short)
skb_put_data(skb, beacon->tail, beacon->tail_len);
if (ieee80211_beacon_protect(skb, local, sdata, link) < 0)
--
2.25.1
next prev parent reply other threads:[~2022-08-30 2:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 2:20 [PATCH v2 00/12] Additional Support for 802.11ah (S1G) Kieran Frewen
2022-08-30 2:20 ` [PATCH v2 01/12] cfg80211: regulatory: extend regulatory support for S1G Kieran Frewen
2022-08-30 4:52 ` kernel test robot
2022-08-30 9:31 ` kernel test robot
2022-09-02 8:44 ` Dan Carpenter
2022-08-30 2:20 ` [PATCH v2 02/12] mac80211: update TIM for S1G specification changes Kieran Frewen
2022-08-30 2:20 ` Kieran Frewen [this message]
2022-08-30 2:20 ` [PATCH v2 04/12] nl80211: support setting S1G short beacon period Kieran Frewen
2022-08-30 2:20 ` [PATCH v2 05/12] nl80211: support advertising S1G capabilities Kieran Frewen
2022-08-30 2:20 ` [PATCH v2 06/12] mac80211: support ieee80211_ext format Kieran Frewen
2022-08-30 2:20 ` [PATCH v2 07/12] mac80211: S1G capabilities information element in probe request Kieran Frewen
2022-08-30 2:20 ` [PATCH v2 08/12] cfg80211: S1G rate flags Kieran Frewen
2022-08-30 2:20 ` [PATCH v2 09/12] nl80211: support advertising S1G rate information Kieran Frewen
2022-08-30 2:20 ` [PATCH v2 10/12] mac80211: support S1G rate encoding Kieran Frewen
2022-08-30 2:20 ` [PATCH v2 11/12] cfg80211: support for calculating S1G bitrates Kieran Frewen
2022-08-30 2:20 ` [PATCH v2 12/12] mac80211_hwsim: support for S1G rate information Kieran Frewen
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=20220830022017.51017-4-kieran.frewen@morsemicro.com \
--to=kieran.frewen@morsemicro.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_jjohnson@quicinc.com \
/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