HomeFreeBSD

rtwn: add a default OFDM / CCK rate for self-generated frames

Description

rtwn: add a default OFDM / CCK rate for self-generated frames

I noticed during testing that the MAC was generating MCS7 ACKs and
MCS7 block-ACK frames in response to MCS frames from its peer.
This is very suboptimal - it means that unless you're very close
to your peer (in this case a 2GHz AP), you'll end up failing a lot
of ACKs.

Linux faced the opposite problem in rtl8xxxu - the rate set being
programmed in here included a lot MORE rates, including MCS 0->7
and OFDM 6M->54M. This meant that they were INTENTIONALLY telling
the hardware to transmit at higher rates, and their fix was to
mask out the higher rates so self-generated frames don't try the
high rates at all.

Now, I am not sure why I'm not seeing any OFDM or HT basic rates.
We don't mark any OFDM / HT rates as basic in net80211 (in
ieee80211_phy.c) so I'm going to need to go and do a review of the
standard to see what's up. Additionally, the HT rate set that we
populate isn't tagging any of the HT rates as IEEE80211_RATE_BASIC,
so the code I added for now is a no-op.

So:

  • Extend rtwn_get_rates() and its consumers to populate the HT rateset with basic rates if they're provided
  • Add a default 2GHz / 5GHz mask, inspired by linux, applied over the basic rates provided.
  • Make sure there's at least an OFDM rate (for 2G/5G) rate available if the peer node is HT, which avoids the MAC defaulting to MCS7 when generating ACK/block-ACK.
  • Add register definitions for INIDATA/INIRTS, which set the default data rate when the driver doesn't specify the initial data / RTS/CTS rates in the TX descriptor.
  • Leave a comment about why I've modified the mask from Linux.

Locally tested:

  • RTL8192CU, STA mode
  • RTL8188EU, STA mode
  • RTL8192EU, STA mode
  • RTL8812AU, STA mode

Differential Revision: https://reviews.freebsd.org/D48019
Reviewed by: bz

Details

Provenance
adrianAuthored on Dec 10 2024, 7:03 PM
Reviewer
bz
Differential Revision
D48019: rtwn: add a default OFDM and MCS0 rate for self-generated frames
Parents
rG4e2bd8cf08f4: rtwn: set the shortgi flag in the RTL8192C rate control setup message
Branches
Unknown
Tags
Unknown