diff options
author | Johannes Berg <johannes.berg@intel.com> | 2018-04-20 06:49:21 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-05-07 14:49:52 -0400 |
commit | 35f4962c01757db6cc1dcdf5526ec6e5afcb6245 (patch) | |
tree | d581370b9600fe96268a06b622e45e4357563c5a /net/mac80211/util.c | |
parent | c096b92aa79e603995982c4d324a52ee02775b85 (diff) |
mac80211: clean up rate info bandwidth setting
There's no need to do the same thing three times in
the different switch cases, pull that out to a single
place.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r-- | net/mac80211/util.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 11f9cfc016d9..2d82c88efd0b 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -2793,12 +2793,13 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local, | |||
2793 | 2793 | ||
2794 | memset(&ri, 0, sizeof(ri)); | 2794 | memset(&ri, 0, sizeof(ri)); |
2795 | 2795 | ||
2796 | ri.bw = status->bw; | ||
2797 | |||
2796 | /* Fill cfg80211 rate info */ | 2798 | /* Fill cfg80211 rate info */ |
2797 | switch (status->encoding) { | 2799 | switch (status->encoding) { |
2798 | case RX_ENC_HT: | 2800 | case RX_ENC_HT: |
2799 | ri.mcs = status->rate_idx; | 2801 | ri.mcs = status->rate_idx; |
2800 | ri.flags |= RATE_INFO_FLAGS_MCS; | 2802 | ri.flags |= RATE_INFO_FLAGS_MCS; |
2801 | ri.bw = status->bw; | ||
2802 | if (status->enc_flags & RX_ENC_FLAG_SHORT_GI) | 2803 | if (status->enc_flags & RX_ENC_FLAG_SHORT_GI) |
2803 | ri.flags |= RATE_INFO_FLAGS_SHORT_GI; | 2804 | ri.flags |= RATE_INFO_FLAGS_SHORT_GI; |
2804 | break; | 2805 | break; |
@@ -2806,7 +2807,6 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local, | |||
2806 | ri.flags |= RATE_INFO_FLAGS_VHT_MCS; | 2807 | ri.flags |= RATE_INFO_FLAGS_VHT_MCS; |
2807 | ri.mcs = status->rate_idx; | 2808 | ri.mcs = status->rate_idx; |
2808 | ri.nss = status->nss; | 2809 | ri.nss = status->nss; |
2809 | ri.bw = status->bw; | ||
2810 | if (status->enc_flags & RX_ENC_FLAG_SHORT_GI) | 2810 | if (status->enc_flags & RX_ENC_FLAG_SHORT_GI) |
2811 | ri.flags |= RATE_INFO_FLAGS_SHORT_GI; | 2811 | ri.flags |= RATE_INFO_FLAGS_SHORT_GI; |
2812 | break; | 2812 | break; |
@@ -2818,8 +2818,6 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local, | |||
2818 | int shift = 0; | 2818 | int shift = 0; |
2819 | int bitrate; | 2819 | int bitrate; |
2820 | 2820 | ||
2821 | ri.bw = status->bw; | ||
2822 | |||
2823 | switch (status->bw) { | 2821 | switch (status->bw) { |
2824 | case RATE_INFO_BW_10: | 2822 | case RATE_INFO_BW_10: |
2825 | shift = 1; | 2823 | shift = 1; |