aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/rtwn/rtl8188e
Commit message (Collapse)AuthorAgeFilesLines
* rtwn: add rtwn_efuse_prereadAhmad Khalifa2026-08-232-0/+2
| | | | | | | This would be used to switch to the "WiFi bank" before reading the rom. The 8723bu will need this, currently a nop on all chips. Differential Revision: https://reviews.freebsd.org/D59106
* rtwn: fix builds on non-x86 platformsAdrian Chadd2024-12-311-0/+2
| | | | | The powerpcspe build is spitting out uint64_t != unsigned long, so this fails. Comment out the logging for now to unbreak the build.
* rtwn: enable periodic TX reporting support on RTL8188EU NICs.Adrian Chadd2024-12-315-2/+118
| | | | | | | | | | | | | | | | | | | | | | | | | The RTL8188E firmware doesn't have the "full" offload firmware rate control. Instead, the vendor driver has a bunch of logic in the driver for rate probing and selection. Part of this is the periodic TX report - which uploads a summary of multi-rate retries and drops per MAC. Using it drastically cuts down on the TX notifications - it's fired from a timer (defaulting to ~ 1.6 seconds) and is a single receive frame in the normal bulk RX path. I've not ported / reimplemented the whole vendor driver rate adaption code - instead, I'm just using the normal net80211 rate control APIs. It seems to behave OK - I get 25-30mbit down and 20mbit up using TCP/ speedtest. Locally tested: * RTL8188EU, STA mode Differential Revision: https://reviews.freebsd.org/D48088 Reviewed by: fuz, bz Obtained from: https://github.com/lwfinger/rtl8188eu/blob/master/hal/Hal8188ERateAdaptive.c
* rtwn: create a new HAL routine for enabling STA mode beacon processingAdrian Chadd2024-12-204-0/+15
| | | | | | | | | | | | | | | | | | | | | | For some NICs (notably the rtl8192cu that I'm working on) the firmware rate adaptation requires beacon processing to be enabled. Instead of making assumptions in the if_rtwn beacon routines (and honestly all of that should be in the HAL too), create a HAL method for enabling/disabling beacon processing specifically in STA mode. Since this isn't necessarily required for all NICs (notably the RTL8188E NICs, where some will do firmware rate control and some will require driver rate control), only enable it for the RTL8192CU and RT8192EU. The RTL8188E and RTL8812/RTL8821 just have no-op routines for now. Locally tested: * RTL8192CU, STA mode Differential Revision: https://reviews.freebsd.org/D48066 Reviewed by: bz
* rtwn: try enforcing net80211 regulatory / txpower limits for 11n chipsAdrian Chadd2024-12-183-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* rtwn: add APIs for setting transmit powerAdrian Chadd2024-12-182-0/+2
| | | | | | | | | | | | | | The RTL8188/RTL8192/RTL8821/RTL8812 NICs all seem happy to have their transmit power changed at runtime - and it does seem to do what's expected - the transmit power level does change. So, add the API call here, even though it's all currently no-ops. A follow-up commit will land changes for the chipsets to both limit transmit power to the configured / regulatory limit AND allow reconfiguration at runtime. Differential Revision: https://reviews.freebsd.org/D47979 Reviewed by: bz, imp
* rtwn: expand the ridx numbers to include VHT; add accessor macrosAdrian Chadd2024-12-072-4/+3
| | | | | | | | | | | | | | | | | | | * 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
* rtwn: add placeholder for the per-MACID rate reportAdrian Chadd2024-12-073-1/+4
| | | | | | | | | | | | | | Some chipsets (such as the RTL8188E) have firmware which supports a second kind of TX report - instead of a per-packet TX report, it can generate a per-MACID summary of packet success/failure counters. This would be helpful for those chips to cut back on the USB traffic to get rate control feedback for the driver based rate control we're currently using. This is a no-op; it just gets the pieces in place for future work. Differential Revision: https://reviews.freebsd.org/D47894
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1615-30/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-168-8/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-164-8/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* rtwm: purge EOL release compatibilityElliott Mitchell2023-02-041-13/+0
| | | | | | | | Remove FreeBSD 11 support Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/603 Differential Revision: https://reviews.freebsd.org/D35560
* rtwn: Fix mismatches in array bounds.John Baldwin2022-12-071-1/+3
| | | | | | Reported by: GCC -Warray-parameter Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37550
* net80211/drivers: improve ieee80211_rx_stats for bandBjoern A. Zeeb2021-10-221-0/+2
| | | | | | | | | | | | | While IEEE80211_R_BAND was defined, there was no place to store the band. Add a field for that, adjust ieee80211_lookup_channel_rxstatus() to require it, and update drivers passing "R_{FREQ|IEEE}" in already to provide the band as well. For the moment keep the fall-back code requiring all three fields. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D30662
* rtwn: clean up empty lines in .c and .h filesMateusz Guzik2020-09-0118-23/+0
| | | | Notes: svn path=/head/; revision=365097
* rtwn_pci(4): sync r88ee_power_on() with OpenBSDAndriy Voskoboinyk2019-01-042-5/+20
| | | | | | | | | | | Tested with RTL8188EE, STA mode Submitted by: Farhan Khan <khanzf@gmail.com> MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18727 Notes: svn path=/head/; revision=342759
* rtwn_pci(4): add support for RTL8188EE chipset.Andriy Voskoboinyk2019-01-028-14/+800
| | | | | | | | | | | | | Initially based on https://reviews.freebsd.org/D15692; later deduplicated and improved a bit (Tx reports, IQ calibration support). Submitted by: Farhan Khan <khanzf@gmail.com> MFC after: 4 days Relnotes: yes Differential Revision: https://reviews.freebsd.org/D15692 Notes: svn path=/head/; revision=342682
* rtwn(4): rename set_name -> set_rom_opts method and reuse it for RTL8188E*Andriy Voskoboinyk2019-01-022-2/+12
| | | | | | | MFC after: 4 days Notes: svn path=/head/; revision=342681
* rtwn(4): rename common RTL8188E* structures.Andriy Voskoboinyk2019-01-022-24/+24
| | | | | | | | | No functional change intended. MFC after: 4 days Notes: svn path=/head/; revision=342680
* rtwn(4): do not try to start RTL8188E* MCU during device shutdown.Andriy Voskoboinyk2019-01-021-1/+5
| | | | | | | MFC after: 4 days Notes: svn path=/head/; revision=342679
* Move USB-specific parts from rtwn(4) to rtwn_usb(4)Andriy Voskoboinyk2019-01-025-84/+96
| | | | | | | MFC after: 4 days Notes: svn path=/head/; revision=342678
* rtwn_pci(4): add support for event-based Tx reports.Andriy Voskoboinyk2019-01-025-78/+21
| | | | | | | | | It will be used for RTL8188EE (and, probably, others). MFC after: 4 days Notes: svn path=/head/; revision=342677
* rtwn(4): drop obsolete comment + use 'nop' function for 92eu calibrationAndriy Voskoboinyk2019-01-021-1/+1
| | | | | | | | | RTL8192EU was not tested with previously added code. MFC after: 4 days Notes: svn path=/head/; revision=342675
* rtwn(4): add IQ calibration support for RTL8188E*Andriy Voskoboinyk2019-01-022-2/+330
| | | | | | | | | | | Tested with: * RTL8188EE, STA mode. * RTL8188EU, STA mode. MFC after: 4 days Notes: svn path=/head/; revision=342674
* rtwn(4): de-hardcode ('h/w rate index' - 'corresponding MCS index') constantAndriy Voskoboinyk2018-03-161-1/+2
| | | | Notes: svn path=/head/; revision=331043
* rtwn(4): reset Tx power values before calling get_txpower()Andriy Voskoboinyk2018-03-101-2/+0
| | | | | | | for RTL8192C / RTL8188E (like it is done for other chipsets). Notes: svn path=/head/; revision=330750
* rtwn(4): some initial preparations for (basic) VHT support.Andriy Voskoboinyk2017-08-281-2/+2
| | | | | | | | | | Rename RTWN_RIDX_MCS to RTWN_RIDX_HT_MCS before adding 802.11ac MCS rate indexes (they have different offset). No functional change intended. Notes: svn path=/head/; revision=322988
* rtwn(4): change type for Tx power values (RTL8192C / RTL8188EU).Andriy Voskoboinyk2017-08-272-2/+2
| | | | | | | | | | | Tx power values can easily fit into uint8_t + only 8 bits are written to registers; values may overflow only in case if ROM contains malformed data (but limit is checked anyway). Tested with RTL8188CUS, dev.rtwn.1.debug=0x2000 (no changes). Notes: svn path=/head/; revision=322949
* rtwn: drop unnecessary / wrong conversion.Andriy Voskoboinyk2017-07-301-1/+1
| | | | | | | The 'chan' field occupies only one byte. Notes: svn path=/head/; revision=321729
* - Fix incorrect values in the computation of CCK and OFDM transmit powerKevin Lo2017-06-173-64/+9
| | | | | | | | | | for the rtl8188eu chipset - Rename struct r92c_rom member names: s/channel_plan/reserved5/, s/xtal_calib/channel_plan to be compliant with definitions of the efuse in vendor hal_pg.h Notes: svn path=/head/; revision=320055
* Change R88E_EFUSE_MAX_LEN to use the same value as the vendor's driverKevin Lo2017-06-071-1/+1
| | | | | | | | | that contains the length of the efuse content. Reviewed by: avos Notes: svn path=/head/; revision=319649
* rtwn: remove out-of-bounds access + fix debug output.Andriy Voskoboinyk2017-04-121-1/+1
| | | | | | | | | | | | | | | | Omit unused rates while initializing / dumping Tx power values. They were not accessed anywhere (except for debugging), so this is (mostly) no-op. Tested with * RTL8188EU, STA mode. * RTL8812AU, STA mode. Found by: PVS-Studio Notes: svn path=/head/; revision=316723
* Add support for the Realtek RTL8192EU chipset.Kevin Lo2017-01-241-0/+1
| | | | | | | | | Committed over the D-Link DWA-131 rev E1 on amd64 with WPA. Reviewed by: avos Notes: svn path=/head/; revision=312680
* rtwn: export more stats to net80211Andriy Voskoboinyk2017-01-173-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Setup more ieee80211_rx_stats fields for received frames: - pktflags: * IEEE80211_RX_F_FAIL_FCSCRC; * IEEE80211_RX_F_AMPDU; * IEEE80211_RX_F_AMPDU_MORE; * IEEE80211_RX_F_SHORTGI; - rate flags (CCK, OFDM, HT); - width; - phytype; - rate; - rx_tsf; - rssi; - nf; - ieee, freq (RTL8188EU only, when ht40 support is disabled). Tested with: - RTL8188CE, RTL8188EU, RTL8821AU (STA / AP modes, i386) - (by kevlo) RTL8188EU and RTL8812AU (amd64) Reviewed by: adrian (previous version), kevlo Differential Revision: https://reviews.freebsd.org/D9021 Notes: svn path=/head/; revision=312315
* Increase retry count to 100 in r88e_fw_cmd() and r92c_fw_cmd().Kevin Lo2017-01-131-1/+1
| | | | Notes: svn path=/head/; revision=312002
* Merge r92c_init_rf_common() into r92c_init_rf(). In r88eu_attach.c, we couldKevin Lo2016-12-202-4/+1
| | | | | | | | | | | | use r92c_init_rf() rather than r92c_init_rf_common() when sc_init_rf() callback is invoked. While here, constantly use RF chain instead of RF path in comment. Reviewed by: avos Notes: svn path=/head/; revision=310305
* rtwn(4), urtwn(4): merge common code, add support for 11ac devices.Andriy Voskoboinyk2016-10-1723-0/+2534
All devices: - add support for rate adaptation via ieee80211_amrr(9); - use short preamble for transmitted frames when needed; - multi-bss support: * for RTL8821AU: 2 VAPs at the same time; * other: 1 any VAP + 1 sta VAP. RTL8188CE: - fix IQ calibration bug (reason of significant speed degradation); - add h/w crypto acceleration support. USB: - A-MPDU Tx support; - short GI support; Other: - add support for RTL8812AU / RTL8821AU chipsets (a/b/g/n only; no ac yet); - split merged code into subparts: * bus glue (usb/*, pci/*, rtl*/usb/*, rtl*/pci/*) * common (if_rtwn*) * chip-specific (rtl*/*) - various other bugfixes. Due to code reorganization, module names / requirements were changed too: urtwn urtwnfw -> rtwn rtwn_usb rtwnfw rtwn rtwnfw -> rtwn rtwn_pci rtwnfw Tested with RTL8188CE, RTL8188CUS, RTL8188EU and RTL8821AU. Tested by: kevlo, garga, Peter Garshtja <peter.garshtja@ambient-md.com>, Kevin McAleavey <kevin.mcaleavey@knosproject.com>, Ilias-Dimitrios Vrachnis <id@vrachnis.com>, <otacilio.neto@bsd.com.br> Relnotes: yes Notes: svn path=/head/; revision=307529