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 07/12] mac80211: S1G capabilities information element in probe request
Date: Tue, 30 Aug 2022 02:20:12 +0000 [thread overview]
Message-ID: <20220830022017.51017-8-kieran.frewen@morsemicro.com> (raw)
In-Reply-To: <20220830022017.51017-1-kieran.frewen@morsemicro.com>
Add the missing S1G capabilities information element to probe requests.
Signed-off-by: Kieran Frewen <kieran.frewen@morsemicro.com>
---
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/util.c | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index cd8879998739..e8ff4af9fc03 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2400,6 +2400,7 @@ void ieee80211_add_s1g_capab_ie(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb);
void ieee80211_add_aid_request_ie(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb);
+u8 *ieee80211_ie_build_s1g_cap(u8 *pos, struct ieee80211_sta_s1g_cap *s1g_cap);
/* channel management */
bool ieee80211_chandef_ht_oper(const struct ieee80211_ht_operation *ht_oper,
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 53826c663723..78e8c286011e 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1857,6 +1857,12 @@ static int ieee80211_build_preq_ies_band(struct ieee80211_sub_if_data *sdata,
rate_flags = ieee80211_chandef_rate_flags(chandef);
shift = ieee80211_chandef_get_shift(chandef);
+ /* For direct mac80211 scan (probe request), add S1G IE and consider its override bits */
+ if (band == NL80211_BAND_S1GHZ) {
+ pos = ieee80211_ie_build_s1g_cap(pos, &sband->s1g_cap);
+ goto done;
+ }
+
num_rates = 0;
for (i = 0; i < sband->n_bitrates; i++) {
if ((BIT(i) & rate_mask) == 0)
@@ -2919,6 +2925,21 @@ size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset)
return pos;
}
+u8 *ieee80211_ie_build_s1g_cap(u8 *pos, struct ieee80211_sta_s1g_cap *s1g_cap)
+{
+ *pos++ = WLAN_EID_S1G_CAPABILITIES;
+ *pos++ = sizeof(struct ieee80211_s1g_cap);
+ memset(pos, 0, sizeof(struct ieee80211_s1g_cap));
+
+ memcpy(pos, &s1g_cap->cap, sizeof(s1g_cap->cap));
+ pos += sizeof(s1g_cap->cap);
+
+ memcpy(pos, &s1g_cap->nss_mcs, sizeof(s1g_cap->nss_mcs));
+ pos += sizeof(s1g_cap->nss_mcs);
+
+ return pos;
+}
+
u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
u16 cap)
{
--
2.25.1
next prev parent reply other threads:[~2022-08-30 2:21 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 ` [PATCH v2 03/12] mac80211: S1G beacon/short beacon support Kieran Frewen
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 ` Kieran Frewen [this message]
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-8-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