From: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org,
Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Subject: [PATCH] mac80211: save he oper info in bss config for AP and mesh
Date: Tue, 14 Jul 2020 20:09:37 -0700 [thread overview]
Message-ID: <20200715030937.25290-1-pradeepc@codeaurora.org> (raw)
Currently he_support is set only for AP mode. Storing this
information for mesh bss as well helps driver to determine
he support. Also save he operation element params in bss
conf so that drivers can access this for any configurations
instead of having to parse the beacon to fetch that info.
Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
---
include/net/mac80211.h | 3 ++-
net/mac80211/cfg.c | 4 ++++
net/mac80211/ieee80211_i.h | 3 ++-
net/mac80211/mesh.c | 2 ++
net/mac80211/util.c | 4 +++-
5 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 11d5610d2ad5..ef8ec345a201 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -604,7 +604,8 @@ struct ieee80211_ftm_responder_params {
* nontransmitted BSSIDs
* @profile_periodicity: the least number of beacon frames need to be received
* in order to discover all the nontransmitted BSSIDs in the set.
- * @he_oper: HE operation information of the AP we are connected to
+ * @he_oper: HE operation information of the BSS (AP/Mesh) or of the AP we are
+ * connected to (STA)
* @he_obss_pd: OBSS Packet Detection parameters.
* @he_bss_color: BSS coloring settings, if BSS supports HE
*/
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 9b360544ad6f..c80eb5bac86b 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1019,6 +1019,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
sdata->vif.bss_conf.frame_time_rts_th =
le32_get_bits(params->he_oper->he_oper_params,
IEEE80211_HE_OPERATION_RTS_THRESHOLD_MASK);
+ sdata->vif.bss_conf.he_oper.params =
+ __le32_to_cpu(params->he_oper->he_oper_params);
+ sdata->vif.bss_conf.he_oper.nss_set =
+ __le16_to_cpu(params->he_oper->he_mcs_nss_set);
}
mutex_lock(&local->mtx);
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index ec1a71ac65f2..47d1fcf365cf 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2184,7 +2184,8 @@ u8 *ieee80211_ie_build_he_cap(u8 *pos,
u8 *end);
void ieee80211_ie_build_he_6ghz_cap(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb);
-u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef);
+u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef,
+ struct ieee80211_sub_if_data *sdata);
int ieee80211_parse_bitrates(struct cfg80211_chan_def *chandef,
const struct ieee80211_supported_band *sband,
const u8 *srates, int srates_len, u32 *rates);
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 5f1ca25b6c97..b84ddf6351db 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -601,6 +601,8 @@ int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata,
sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
return 0;
+ sdata->vif.bss_conf.he_support = true;
+
len = 2 + 1 + sizeof(struct ieee80211_he_operation);
if (sdata->vif.bss_conf.chandef.chan->band == NL80211_BAND_6GHZ)
len += sizeof(struct ieee80211_he_6ghz_oper);
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 21c94094a699..eb3be6b89b0b 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -3028,7 +3028,8 @@ u8 *ieee80211_ie_build_vht_oper(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
return pos + sizeof(struct ieee80211_vht_operation);
}
-u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef)
+u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef,
+ struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_he_operation *he_oper;
struct ieee80211_he_6ghz_oper *he_6ghz_op;
@@ -3056,6 +3057,7 @@ u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef)
he_oper = (struct ieee80211_he_operation *)pos;
he_oper->he_oper_params = cpu_to_le32(he_oper_params);
+ sdata->vif.bss_conf.he_oper.params = he_oper_params;
/* don't require special HE peer rates */
he_oper->he_mcs_nss_set = cpu_to_le16(0xffff);
pos += sizeof(struct ieee80211_he_operation);
--
2.17.1
next reply other threads:[~2020-07-15 3:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 3:09 Pradeep Kumar Chitrapu [this message]
2020-07-15 5:39 ` [PATCH] mac80211: save he oper info in bss config for AP and mesh kernel test robot
2020-07-15 5:39 ` kernel test robot
2020-07-30 11:24 ` Johannes Berg
2020-10-12 16:41 ` Pradeep Kumar Chitrapu
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=20200715030937.25290-1-pradeepc@codeaurora.org \
--to=pradeepc@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.