diff options
author | 2022-06-19 15:08:02 +0300 | |
---|---|---|
committer | 2022-07-15 11:43:13 +0200 | |
commit | f91cb507e671ad4d9f00327b01a4bbe21c41fd4a (patch) | |
tree | 778269e4a439c8dbc7d5841e08ac2be67d682527 /net/mac80211/ieee80211_i.h | |
parent | wifi: mac80211: Remove AP SMPS leftovers (diff) | |
download | linux-f91cb507e671ad4d9f00327b01a4bbe21c41fd4a.tar.gz linux-f91cb507e671ad4d9f00327b01a4bbe21c41fd4a.tar.bz2 linux-f91cb507e671ad4d9f00327b01a4bbe21c41fd4a.zip |
wifi: mac80211: add an ieee80211_get_link_sband
Similar to ieee80211_get_sband but get the sband of the link_conf.
Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 484ae6355cb8..604825dde4fd 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1543,6 +1543,28 @@ ieee80211_get_sband(struct ieee80211_sub_if_data *sdata) return local->hw.wiphy->bands[band]; } +static inline struct ieee80211_supported_band * +ieee80211_get_link_sband(struct ieee80211_sub_if_data *sdata, u32 link_id) +{ + struct ieee80211_local *local = sdata->local; + struct ieee80211_chanctx_conf *chanctx_conf; + enum nl80211_band band; + + rcu_read_lock(); + chanctx_conf = + rcu_dereference(sdata->vif.link_conf[link_id]->chanctx_conf); + + if (!chanctx_conf) { + rcu_read_unlock(); + return NULL; + } + + band = chanctx_conf->def.chan->band; + rcu_read_unlock(); + + return local->hw.wiphy->bands[band]; +} + /* this struct holds the value parsing from channel switch IE */ struct ieee80211_csa_ie { struct cfg80211_chan_def chandef; |