2022-11-16 02:11:36

by Gilad Itzkovitch

[permalink] [raw]
Subject: [PATCH v3 1/4] wifi: cfg80211: Add short_beacon_tail/head/period

From: Kieran Frewen <[email protected]>

Support variables to handle short beacon period and adding a
separate tail/head for them.

Signed-off-by: Kieran Frewen <[email protected]>
Co-developed-by: Gilad Itzkovitch <[email protected]>
Signed-off-by: Gilad Itzkovitch <[email protected]>
---
include/net/cfg80211.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 11a370e64143..99f28ef2323f 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1179,8 +1179,13 @@ struct cfg80211_mbssid_elems {
* or %NULL if not changed
* @tail: tail portion of beacon (after TIM IE)
* or %NULL if not changed
+ * @short_head: head portion of short beacon or %NULL if not changed
+ * @short_tail: short tail portion of beacon (after TIM IE)
+ or %NULL if not changed
* @head_len: length of @head
* @tail_len: length of @tail
+ * @short_head_len: length of @short_head
+ * @short_tail_len: length of @short_tail
* @beacon_ies: extra information element(s) to add into Beacon frames or %NULL
* @beacon_ies_len: length of beacon_ies in octets
* @proberesp_ies: extra information element(s) to add into Probe Response
@@ -1208,6 +1213,7 @@ struct cfg80211_beacon_data {
unsigned int link_id;

const u8 *head, *tail;
+ const u8 *short_head, *short_tail;
const u8 *beacon_ies;
const u8 *proberesp_ies;
const u8 *assocresp_ies;
@@ -1218,6 +1224,7 @@ struct cfg80211_beacon_data {
s8 ftm_responder;

size_t head_len, tail_len;
+ size_t short_head_len, short_tail_len;
size_t beacon_ies_len;
size_t proberesp_ies_len;
size_t assocresp_ies_len;
@@ -1328,7 +1335,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;

base-commit: 5c111ec204d15d1c7d00428b0afdda62ff118565
--
2.34.1



2022-11-16 02:13:57

by Gilad Itzkovitch

[permalink] [raw]
Subject: [PATCH v3 2/4] wifi: mac80211: S1G beacon/short beacon support

From: Kieran Frewen <[email protected]>

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 <[email protected]>
Co-developed-by: Gilad Itzkovitch <[email protected]>
Signed-off-by: Gilad Itzkovitch <[email protected]>
---
include/net/mac80211.h | 1 +
net/mac80211/cfg.c | 1 +
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/tx.c | 14 +++++++++++++-
4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 721c450a9ccd..39faafde109a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -674,6 +674,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 c848fe04dd44..a42abaa25273 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1308,6 +1308,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 63ff0d2524b6..2e1d829c548a 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -268,6 +268,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 bb2e54610101..a12b32544a3a 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -5116,6 +5116,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)
@@ -5153,7 +5165,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.34.1


2023-01-25 21:13:51

by Kieran Frewen

[permalink] [raw]
Subject: Re: [PATCH v3 1/4] wifi: cfg80211: Add short_beacon_tail/head/period

On Wed, Nov 16, 2022 at 3:08 PM Gilad Itzkovitch
<[email protected]> wrote:
>
> From: Kieran Frewen <[email protected]>
>
> Support variables to handle short beacon period and adding a
> separate tail/head for them.
>
> Signed-off-by: Kieran Frewen <[email protected]>
> Co-developed-by: Gilad Itzkovitch <[email protected]>
> Signed-off-by: Gilad Itzkovitch <[email protected]>
> ---
> include/net/cfg80211.h | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index 11a370e64143..99f28ef2323f 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -1179,8 +1179,13 @@ struct cfg80211_mbssid_elems {
> * or %NULL if not changed
> * @tail: tail portion of beacon (after TIM IE)
> * or %NULL if not changed
> + * @short_head: head portion of short beacon or %NULL if not changed
> + * @short_tail: short tail portion of beacon (after TIM IE)
> + or %NULL if not changed
> * @head_len: length of @head
> * @tail_len: length of @tail
> + * @short_head_len: length of @short_head
> + * @short_tail_len: length of @short_tail
> * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL
> * @beacon_ies_len: length of beacon_ies in octets
> * @proberesp_ies: extra information element(s) to add into Probe Response
> @@ -1208,6 +1213,7 @@ struct cfg80211_beacon_data {
> unsigned int link_id;
>
> const u8 *head, *tail;
> + const u8 *short_head, *short_tail;
> const u8 *beacon_ies;
> const u8 *proberesp_ies;
> const u8 *assocresp_ies;
> @@ -1218,6 +1224,7 @@ struct cfg80211_beacon_data {
> s8 ftm_responder;
>
> size_t head_len, tail_len;
> + size_t short_head_len, short_tail_len;
> size_t beacon_ies_len;
> size_t proberesp_ies_len;
> size_t assocresp_ies_len;
> @@ -1328,7 +1335,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;
>
> base-commit: 5c111ec204d15d1c7d00428b0afdda62ff118565
> --
> 2.34.1
>

Hi Johannes,

Just following up from our end to see what the status of this patchset
is? We were wondering if there was anything we can add in terms of
comments or further clarifications to help progress this.

Thanks and kind regards,
Kieran

2023-03-30 09:59:36

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH v3 1/4] wifi: cfg80211: Add short_beacon_tail/head/period

Hi,

Hmm. This was on my list forever, and somehow I always went past it.
Sorry.

> Support variables to handle short beacon period and adding a
> separate tail/head for them.
>

I don't think this really needs to be a separate patch? Should be
squashed with the nl80211 one.

johannes

2023-03-30 09:59:57

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH v3 2/4] wifi: mac80211: S1G beacon/short beacon support

On Wed, 2022-11-16 at 15:06 +1300, Gilad Itzkovitch wrote:
> From: Kieran Frewen <[email protected]>
>
> If configured, use the S1G short beacon format. The S1G short beacon
> format includes a limited set of information elements.

I think you can squash this with the fourth patch so you just have two
overall.

johannes