diff options
author | Thomas Pedersen <thomas@adapt-ip.com> | 2020-10-05 09:45:22 -0700 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2020-10-08 10:40:57 +0200 |
commit | 12bf8fad4ca3cf712f80766be017a521757e14c7 (patch) | |
tree | 0975183d552e2d67288c7b073036ebaac7cbbb62 /net/mac80211/s1g.c | |
parent | 8b783d104e7f40684333d2ec155fac39219beb2f (diff) | |
download | lwn-12bf8fad4ca3cf712f80766be017a521757e14c7.tar.gz lwn-12bf8fad4ca3cf712f80766be017a521757e14c7.zip |
mac80211: initialize last_rate for S1G STAs
last_rate is initialized to zero by sta_info_alloc(), but
this indicates legacy bitrate for the last TX rate (and
invalid for the last RX rate). To avoid a warning when
decoding the last rate as legacy (before a data frame
has been sent), initialize them as S1G MCS.
Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
Link: https://lore.kernel.org/r/20201005164522.18069-2-thomas@adapt-ip.com
[rename to ieee80211_s1g_sta_rate_init(), seems more appropriate]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/s1g.c')
-rw-r--r-- | net/mac80211/s1g.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/mac80211/s1g.c b/net/mac80211/s1g.c new file mode 100644 index 000000000000..c33f332b049a --- /dev/null +++ b/net/mac80211/s1g.c @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * S1G handling + * Copyright(c) 2020 Adapt-IP + */ +#include <linux/ieee80211.h> +#include <net/mac80211.h> +#include "ieee80211_i.h" + +void ieee80211_s1g_sta_rate_init(struct sta_info *sta) +{ + /* avoid indicating legacy bitrates for S1G STAs */ + sta->tx_stats.last_rate.flags |= IEEE80211_TX_RC_S1G_MCS; + sta->rx_stats.last_rate = + STA_STATS_FIELD(TYPE, STA_STATS_RATE_TYPE_S1G); +} |