Skip to content

Commit

Permalink
cfg80211: remove 80+80 MHz rate reporting
Browse files Browse the repository at this point in the history
These rates are treated the same as 160 MHz in the spec, so
it makes no sense to distinguish them. As no driver uses them
yet, this is also not a problem, just remove them.

In the userspace API the field remains reserved to preserve
API and ABI.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Jan 15, 2015
1 parent f89903d commit 97d910d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
8 changes: 3 additions & 5 deletions include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,6 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
* @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS
* @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 MHz width transmission
* @RATE_INFO_FLAGS_80_MHZ_WIDTH: 80 MHz width transmission
* @RATE_INFO_FLAGS_80P80_MHZ_WIDTH: 80+80 MHz width transmission
* @RATE_INFO_FLAGS_160_MHZ_WIDTH: 160 MHz width transmission
* @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval
* @RATE_INFO_FLAGS_60G: 60GHz MCS
Expand All @@ -885,10 +884,9 @@ enum rate_info_flags {
RATE_INFO_FLAGS_VHT_MCS = BIT(1),
RATE_INFO_FLAGS_40_MHZ_WIDTH = BIT(2),
RATE_INFO_FLAGS_80_MHZ_WIDTH = BIT(3),
RATE_INFO_FLAGS_80P80_MHZ_WIDTH = BIT(4),
RATE_INFO_FLAGS_160_MHZ_WIDTH = BIT(5),
RATE_INFO_FLAGS_SHORT_GI = BIT(6),
RATE_INFO_FLAGS_60G = BIT(7),
RATE_INFO_FLAGS_160_MHZ_WIDTH = BIT(4),
RATE_INFO_FLAGS_SHORT_GI = BIT(5),
RATE_INFO_FLAGS_60G = BIT(6),
};

/**
Expand Down
3 changes: 2 additions & 1 deletion include/uapi/linux/nl80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2278,7 +2278,8 @@ struct nl80211_sta_flag_update {
* @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8)
* @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8)
* @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate
* @NL80211_RATE_INFO_80P80_MHZ_WIDTH: 80+80 MHz VHT rate
* @NL80211_RATE_INFO_80P80_MHZ_WIDTH: unused - 80+80 is treated the
* same as 160 for purposes of the bitrates
* @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate
* @__NL80211_RATE_INFO_AFTER_LAST: internal use
*/
Expand Down
3 changes: 0 additions & 3 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -3614,9 +3614,6 @@ static bool nl80211_put_sta_rate(struct sk_buff *msg, struct rate_info *info,
if (info->flags & RATE_INFO_FLAGS_80_MHZ_WIDTH &&
nla_put_flag(msg, NL80211_RATE_INFO_80_MHZ_WIDTH))
return false;
if (info->flags & RATE_INFO_FLAGS_80P80_MHZ_WIDTH &&
nla_put_flag(msg, NL80211_RATE_INFO_80P80_MHZ_WIDTH))
return false;
if (info->flags & RATE_INFO_FLAGS_160_MHZ_WIDTH &&
nla_put_flag(msg, NL80211_RATE_INFO_160_MHZ_WIDTH))
return false;
Expand Down
3 changes: 1 addition & 2 deletions net/wireless/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,8 +1073,7 @@ static u32 cfg80211_calculate_bitrate_vht(struct rate_info *rate)
if (WARN_ON_ONCE(rate->mcs > 9))
return 0;

idx = rate->flags & (RATE_INFO_FLAGS_160_MHZ_WIDTH |
RATE_INFO_FLAGS_80P80_MHZ_WIDTH) ? 3 :
idx = rate->flags & RATE_INFO_FLAGS_160_MHZ_WIDTH ? 3 :
rate->flags & RATE_INFO_FLAGS_80_MHZ_WIDTH ? 2 :
rate->flags & RATE_INFO_FLAGS_40_MHZ_WIDTH ? 1 : 0;

Expand Down

0 comments on commit 97d910d

Please sign in to comment.