Page MenuHomeFreeBSD

rtwn: announce VHT support for RTL8812AU/RTL8821AU.
Needs ReviewPublic

Authored by adrian on Mon, Dec 16, 4:17 AM.
Referenced Files
Unknown Object (File)
Thu, Dec 26, 12:07 PM
Unknown Object (File)
Thu, Dec 26, 10:49 AM
Unknown Object (File)
Thu, Dec 26, 7:30 AM
Unknown Object (File)
Tue, Dec 24, 12:58 AM
Unknown Object (File)
Sun, Dec 22, 6:58 PM
Unknown Object (File)
Thu, Dec 19, 6:23 PM
Subscribers

Details

Reviewers
bz
Group Reviewers
wireless
Summary

Although the transmit path doesn't yet support VHT rates (because
the rate control and rate representation in net80211 doesn't yet
know about VHT rates) the NIC will receive VHT frames but only
transmit HT frames.

Locally tested:

  • RTL8812AU, STA mode

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 61374
Build 58258: arc lint + arc unit

Event Timeline

bz added inline comments.
sys/dev/rtwn/rtl8812a/usb/r12au_attach.c
186

While here; the | goes at the end of the line; also other file

Can this code be deduplicated and shared between the two driver instances?
The loop feels like it could be eliminated, e.g. with code like

uint32_t supported;

supported = 0xaaaa & ((1 << sc->ntxchains) - 1);
tx_mcs |= IEEE80211_VHT_MCS_SUPPORT_0_9 * supported;
tx_mcs |= IEEE80211_VHT_MCS_NOT_SUPPORTED * (0xaaaa - supported);

supported = 0xaaaa & ((1 << sc->nrxchains) - 1);
rx_mcs |= IEEE80211_VHT_MCS_SUPPORT_0_9 * supported;
rx_mcs |= IEEE80211_VHT_MCS_NOT_SUPPORTED * (0xaaaa - supported);

Though it seems that would be a lot less clean than what you currently have.

bz requested changes to this revision.Fri, Dec 27, 7:09 AM

bz and fuz

This revision now requires changes to proceed.Fri, Dec 27, 7:09 AM
In D48103#1099187, @fuz wrote:

Can this code be deduplicated and shared between the two driver instances?
The loop feels like it could be eliminated, e.g. with code like

uint32_t supported;

supported = 0xaaaa & ((1 << sc->ntxchains) - 1);
tx_mcs |= IEEE80211_VHT_MCS_SUPPORT_0_9 * supported;
tx_mcs |= IEEE80211_VHT_MCS_NOT_SUPPORTED * (0xaaaa - supported);

supported = 0xaaaa & ((1 << sc->nrxchains) - 1);
rx_mcs |= IEEE80211_VHT_MCS_SUPPORT_0_9 * supported;
rx_mcs |= IEEE80211_VHT_MCS_NOT_SUPPORTED * (0xaaaa - supported);

Though it seems that would be a lot less clean than what you currently have.

oh god binary arithmetic funsies. ;-)

Honestly this is something that's going to show up in all of the 11ac drivers in some way, so I should probably write a net80211 vht function to populate it in this common case.

For now I think I'll refactor it out and put it in if_rtwn.c to be called by both paths, and any other 11ac chipset support that gets added here.

updates from fuz / bz review

Ok except for this one nit pick.

sys/dev/rtwn/if_rtwnvar.h
449

For consistency.