Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Thomas Pedersen and committed by
Johannes Berg
12bf8fad 8b783d10

+25 -1
+1
net/mac80211/Makefile
··· 13 13 ht.o agg-tx.o agg-rx.o \ 14 14 vht.o \ 15 15 he.o \ 16 + s1g.o \ 16 17 ibss.o \ 17 18 iface.o \ 18 19 rate.o \
+3
net/mac80211/ieee80211_i.h
··· 1928 1928 ieee80211_he_op_ie_to_bss_conf(struct ieee80211_vif *vif, 1929 1929 const struct ieee80211_he_operation *he_op_ie_elem); 1930 1930 1931 + /* S1G */ 1932 + void ieee80211_s1g_sta_rate_init(struct sta_info *sta); 1933 + 1931 1934 /* Spectrum management */ 1932 1935 void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, 1933 1936 struct ieee80211_mgmt *mgmt,
+3 -1
net/mac80211/mlme.c
··· 5190 5190 int shift = ieee80211_vif_get_shift(&sdata->vif); 5191 5191 5192 5192 /* TODO: S1G Basic Rate Set is expressed elsewhere */ 5193 - if (cbss->channel->band == NL80211_BAND_S1GHZ) 5193 + if (cbss->channel->band == NL80211_BAND_S1GHZ) { 5194 + ieee80211_s1g_sta_rate_init(new_sta); 5194 5195 goto skip_rates; 5196 + } 5195 5197 5196 5198 ieee80211_get_rates(sband, bss->supp_rates, 5197 5199 bss->supp_rates_len,
+1
net/mac80211/rate.c
··· 53 53 54 54 /* TODO: check for minstrel_s1g ? */ 55 55 if (sband->band == NL80211_BAND_S1GHZ) { 56 + ieee80211_s1g_sta_rate_init(sta); 56 57 rcu_read_unlock(); 57 58 return; 58 59 }
+16
net/mac80211/s1g.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * S1G handling 4 + * Copyright(c) 2020 Adapt-IP 5 + */ 6 + #include <linux/ieee80211.h> 7 + #include <net/mac80211.h> 8 + #include "ieee80211_i.h" 9 + 10 + void ieee80211_s1g_sta_rate_init(struct sta_info *sta) 11 + { 12 + /* avoid indicating legacy bitrates for S1G STAs */ 13 + sta->tx_stats.last_rate.flags |= IEEE80211_TX_RC_S1G_MCS; 14 + sta->rx_stats.last_rate = 15 + STA_STATS_FIELD(TYPE, STA_STATS_RATE_TYPE_S1G); 16 + }
+1
net/mac80211/sta_info.h
··· 823 823 STA_STATS_RATE_TYPE_HT, 824 824 STA_STATS_RATE_TYPE_VHT, 825 825 STA_STATS_RATE_TYPE_HE, 826 + STA_STATS_RATE_TYPE_S1G, 826 827 }; 827 828 828 829 #define STA_STATS_FIELD_HT_MCS GENMASK( 7, 0)