diff options
author | Johannes Berg <johannes.berg@intel.com> | 2022-07-01 14:01:59 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2022-07-15 11:43:18 +0200 |
commit | 3dc05935ead81ffafa6d937552cfae1f1463b4a8 (patch) | |
tree | 7948dace4c28fd57158bd7ce22e566b50648cb18 /net/mac80211/ieee80211_i.h | |
parent | 19654a61bfd66539087119fbceed46e48f084d89 (diff) | |
download | linux-3dc05935ead81ffafa6d937552cfae1f1463b4a8.tar.gz linux-3dc05935ead81ffafa6d937552cfae1f1463b4a8.tar.bz2 linux-3dc05935ead81ffafa6d937552cfae1f1463b4a8.zip |
wifi: mac80211: use only channel width in ieee80211_parse_bitrates()
For MLO, we may not have a full chandef here later, so change
the API to pass only the width.
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 | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index dc38f57fcdc9..74d5fc5889bb 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1102,9 +1102,9 @@ sdata_assert_lock(struct ieee80211_sub_if_data *sdata) } static inline int -ieee80211_chandef_get_shift(struct cfg80211_chan_def *chandef) +ieee80211_chanwidth_get_shift(enum nl80211_chan_width width) { - switch (chandef->width) { + switch (width) { case NL80211_CHAN_WIDTH_5: return 2; case NL80211_CHAN_WIDTH_10: @@ -1115,6 +1115,12 @@ ieee80211_chandef_get_shift(struct cfg80211_chan_def *chandef) } static inline int +ieee80211_chandef_get_shift(struct cfg80211_chan_def *chandef) +{ + return ieee80211_chanwidth_get_shift(chandef->width); +} + +static inline int ieee80211_vif_get_shift(struct ieee80211_vif *vif) { struct ieee80211_chanctx_conf *chanctx_conf; @@ -2346,7 +2352,7 @@ u8 *ieee80211_ie_build_he_cap(ieee80211_conn_flags_t disable_flags, u8 *pos, 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); -int ieee80211_parse_bitrates(struct cfg80211_chan_def *chandef, +int ieee80211_parse_bitrates(enum nl80211_chan_width width, const struct ieee80211_supported_band *sband, const u8 *srates, int srates_len, u32 *rates); int ieee80211_add_srates_ie(struct ieee80211_sub_if_data *sdata, |