Skip to content

Commit

Permalink
wifi: mac80211: add an ieee80211_get_link_sband
Browse files Browse the repository at this point in the history
Similar to ieee80211_get_sband but get the sband of the link_conf.

Signed-off-by: Shaul Triebitz <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
striebit authored and jmberg-intel committed Jul 15, 2022
1 parent 0866f8e commit f91cb50
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f91cb50

Please sign in to comment.