| 0ea7f8ca | 08-Dec-2024 |
Adrian Chadd <adrian@FreeBSD.org> |
rtwn: try enforcing net80211 regulatory / txpower limits for 11n chips
This is an attempt to reverse engineer what the actual transmit power calculations are doing and apply net80211 limits on them.
rtwn: try enforcing net80211 regulatory / txpower limits for 11n chips
This is an attempt to reverse engineer what the actual transmit power calculations are doing and apply net80211 limits on them. It doesn't look as simple as just applying the check at the end - there are plenty of places where offsets are calculated between different PHY modes and 1 / 2 antenna MCS transmit rates.
There are also some places where the offset being added is negative, so handle the potential underflow so when things hit 0, they don't just wrap and cause the maximum transmit power into the registers.
This is being done to aide in power/performance debugging - if there are issues with the transmit power being wrongly calculated and are too high, the output waveform will be distorted and it will effect performance. Being able to drop the transmit power by a few dB here and there can quickly identify if this is happening (because suddenly higher MCS rates / OFDM rates suddenly work better!)
I've tested each NIC through the transmit power values from 0 dBm to 30dBm via ifconfig (and they're all capped far before that, normally around 20-25dBm) and they're not underflowing.
Locally tested:
* RTL8192CU, STA * RTL8192EU, STA * RTL8188EU, STA
Differential Revision: https://reviews.freebsd.org/D47987 Reviewed by: bz, imp
show more ...
|
| 3d699261 | 04-Dec-2024 |
Adrian Chadd <adrian@FreeBSD.org> |
rtwn: expand the ridx numbers to include VHT; add accessor macros
* expand the ridx field all the way through 4x4 11n (MCS0..MCS31) * and then expand it through VHT 4x4 (MCS0..9 for each stream) * a
rtwn: expand the ridx numbers to include VHT; add accessor macros
* expand the ridx field all the way through 4x4 11n (MCS0..MCS31) * and then expand it through VHT 4x4 (MCS0..9 for each stream) * add accessor macros to check if the rate is HT, VHT * use accessor macros to check if the rate is HT rather than comparing it against OFDM54 or RIDX_HT_MCS(0); the values aobve HT MCS will be VHT, and we don't want to trigger on those! * add a couple of appropriate TODO VHT bits in the TX path
Locally tested:
* RTL8192CU, STA mode * RTL8188EU, STA mode * RTL8821AU, STA mode * RTL8192EU, STA mode
Differential Revision: https://reviews.freebsd.org/D47896
show more ...
|