-
Notifications
You must be signed in to change notification settings - Fork 48
Description
The purpose of this issue is to discuss how we can implement the set_bitrate_mask
callback in vwifi
and simulate the corresponding behavior for each setting.
In set_bitrate_mask
, the most critical input is the cfg80211_bitrate_mask
structure. We should store the entire structure within our virtual interface, vwifi_vif
.
struct cfg80211_bitrate_mask {
struct {
u32 legacy;
u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN];
u16 vht_mcs[NL80211_VHT_NSS_MAX];
u16 he_mcs[NL80211_HE_NSS_MAX];
enum nl80211_txrate_gi gi;
enum nl80211_he_gi he_gi;
enum nl80211_he_ltf he_ltf;
} control[NUM_NL80211_BANDS];
};
Based on the structure of cfg80211_bitrate_mask
, its components can be categorized into legacy
, HT_MCS
, VHT_MCS
, HE_MCS
, GI
, HE_GI
, and HE_LTF
.
Users can manually set these components using the following commands.
# Set legacy bitrates (802.11a/b/g)
iw dev <iface> set bitrates legacy-2.4 <rate1> <rate2> ...
iw dev <iface> set bitrates legacy-5 <rate1> <rate2> ...
# Set HT (802.11n) MCS indexes
iw dev <iface> set bitrates ht-mcs-2.4 <idx1> <idx2> ...
iw dev <iface> set bitrates ht-mcs-5 <idx1> <idx2> ...
# Set VHT (802.11ac) MCS indexes
iw dev <iface> set bitrates vht-mcs-2.4 <NSS>:<bitmap> ...
iw dev <iface> set bitrates vht-mcs-5 <NSS>:<bitmap> ...
# Set HE (802.11ax) MCS indexes
iw dev <iface> set bitrates he-mcs-2.4 <NSS>:<bitmap> ...
iw dev <iface> set bitrates he-mcs-5 <NSS>:<bitmap> ...
iw dev <iface> set bitrates he-mcs-6 <NSS>:<bitmap> ...
# Set Guard Interval (GI)
iw dev <iface> set bitrates gi <sgi-2.4 | lgi-2.4 | sgi-5 | lgi-5>
# Set HE-specific GI
iw dev <iface> set bitrates he-gi-2.4 <0.8|1.6|3.2>
iw dev <iface> set bitrates he-gi-5 <0.8|1.6|3.2>
iw dev <iface> set bitrates he-gi-6 <0.8|1.6|3.2>
# Set HE LTF
iw dev <iface> set bitrates he-ltf-2.4 <1|2|4>
iw dev <iface> set bitrates he-ltf-5 <1|2|4>
iw dev <iface> set bitrates he-ltf-6 <1|2|4>
Alternatively, you can check the supported commands available in your iw
tool.
$ iw help | grep 'set bitrates'
dev <devname> set bitrates [legacy-<2.4|5> <legacy rate in Mbps>*] [ht-mcs-<2.4|5> <MCS index>*] [vht-mcs-<2.4|5> [he-mcs-<2.4|5|6> <NSS:MCSx,MCSy... | NSS:MCSx-MCSy>*] [sgi-2.4|lgi-2.4] [sgi-5|lgi-5] [he-gi-<2.4|5|6> <0.8|1.6|3.2>] [he-ltf-<2.4|5|6> <1|2|4>]
Since multiple MCS values can be specified at once, it is essential to design a selection algorithm that adapts to dynamic environments.
Our first goal is to enable vwifi
to fully support HT mode (802.11n), covering MCS indexes 0 to 31 on the 2.4 GHz band, along with GI (Guard Interval) selection of 0.8 µs or 0.4 µs in 20 MHz bandwidth.
Additionally, the MCS index setting of HT stored in vwifi_vif
should be reset every time when the iw dev <iface> set bitrates ht-mcs-2.4 <idx1> <idx2>......
is called, enabling us to test different configurations per command.
The dynamic selection algorithm should be applied not only in station_dump
, but also in the transmission time simulation
.
By default, the MCS setting should be initialized to HT mode on 2.4 GHz with MCS index 31 and a 0.8 µs GI in vwifi_vif
.
To support data rate lookup, we may consider maintaining the MCS table (the yellow-highlighted portion in 20 MHz bandwidth) in a global structure for efficient querying.