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 04/10] mac80211: add multiple bssid IE parsing
Date: Mon, 6 Jul 2020 13:52:13 +0200 [thread overview]
Message-ID: <20200706115219.663650-4-john@phrozen.org> (raw)
In-Reply-To: <20200706115219.663650-1-john@phrozen.org>
Drivers might need to know the offset and length of the IE. Add parsing
code and propagate the values to the driver using the mutable struct.
Signed-off-by: John Crispin <john@phrozen.org>
---
include/net/mac80211.h | 5 +++++
net/mac80211/ieee80211_i.h | 2 ++
net/mac80211/tx.c | 10 ++++++++++
net/mac80211/util.c | 4 ++++
4 files changed, 21 insertions(+)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 3617a2742c4d..67729b8fcdb2 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -4744,12 +4744,17 @@ void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets);
* @csa_counter_offs: array of IEEE80211_MAX_CSA_COUNTERS_NUM offsets
* to CSA counters. This array can contain zero values which
* should be ignored.
+ * @mbssid_offset: position of mbssid_offset
+ * @mbssid_length: position of mbssid_offset
*/
struct ieee80211_mutable_offsets {
u16 tim_offset;
u16 tim_length;
u16 csa_counter_offs[IEEE80211_MAX_CSA_COUNTERS_NUM];
+
+ u16 multiple_bssid_offset;
+ u16 multiple_bssid_length;
};
/**
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index ec1a71ac65f2..e1cae41a2ea4 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1523,6 +1523,7 @@ struct ieee802_11_elems {
u8 dtim_count;
u8 dtim_period;
const struct ieee80211_addba_ext_ie *addba_ext_ie;
+ u16 multiple_bssid_offset;
/* length of them, respectively */
u8 ext_capab_len;
@@ -1543,6 +1544,7 @@ struct ieee802_11_elems {
u8 perr_len;
u8 country_elem_len;
u8 bssid_index_len;
+ u8 multiple_bssid_len;
/* whether a parse error occurred while retrieving these elements */
bool parse_error;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index e9ce658141f5..1e7a71d6853d 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4785,11 +4785,21 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw,
is_template);
if (offs) {
+ struct ieee802_11_elems elems;
+
offs->tim_offset = beacon->head_len;
offs->tim_length = skb->len - beacon->head_len;
/* for AP the csa offsets are from tail */
csa_off_base = skb->len;
+
+ ieee802_11_parse_elems(skb->head, skb->len, true, &elems,
+ sdata->wdev.address, NULL);
+ if (!elems.parse_error)
+ goto out;
+
+ offs->multiple_bssid_offset = elems.multiple_bssid_offset;
+ offs->multiple_bssid_length = elems.multiple_bssid_len;
}
if (beacon->tail)
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 3e4308c8f690..af6d685cea63 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1315,6 +1315,10 @@ _ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
&crc : NULL,
elem, elems);
break;
+ case WLAN_EID_MULTIPLE_BSSID:
+ elems->multiple_bssid_offset = pos - start;
+ elems->multiple_bssid_len = elen;
+ break;
default:
break;
}
--
2.25.1
--
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
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 ` [PATCH V2 02/10] nl80211: add attributes for multiple bssid related settings John Crispin
2020-07-30 12:57 ` 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 ` John Crispin [this message]
2020-07-30 13:05 ` [PATCH V2 04/10] mac80211: add multiple bssid IE parsing 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-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