summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
AgeCommit message (Collapse)AuthorFilesLines
2023-05-15wifi: rtl8xxxu: Rename some registersBitterblue Smith1-4/+4
Give proper names: RF6052_REG_UNKNOWN_56 -> RF6052_REG_PAD_TXG RF6052_REG_UNKNOWN_DF -> RF6052_REG_GAIN_CCA And fix typos: REG_OFDM0_AGCR_SSI_TABLE -> REG_OFDM0_AGC_RSSI_TABLE REG_BB_ACCEESS_CTRL -> REG_BB_ACCESS_CTRL Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/40157253-76bd-8b23-06e0-3365139b5395@gmail.com
2023-05-15wifi: rtl8xxxu: Support new chip RTL8192FUBitterblue Smith1-0/+39
This is a newer chip, similar to the RTL8710BU in that it uses the same PHY status structs. Features: 2.4 GHz, b/g/n mode, 2T2R, 300 Mbps. It can allegedly have Bluetooth, but that's not implemented here. This chip can have many RFE (RF front end) types, of which types 1 and 5 are the only ones tested. Many of the other types need different initialisation tables. They can be added if someone wants them. The vendor driver v5.8.6.2_35538.20191028_COEX20190910-0d02 from https://github.com/BrightX/rtl8192fu was used as reference, with additional device IDs taken from https://github.com/kelebek333/rtl8192fu-dkms. The vendor driver also claims to support devices with ID 0bda:a725, but that is found in some bluetooth-only devices, so it's not supported here. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/7dcf9fb9-1c97-ac28-5286-2236e287a18c@gmail.com
2023-05-05wifi: rtl8xxxu: Allow creating interface in AP modeMartin Kaistra1-0/+2
Use the sequence from the vendor driver for setting up the beacon related registers. Also set the MAC address register here, in case the MAC address for the new interface should be different from what was set in rtl8xxxu_init_device(). This happens for example with the hostapd config option "bssid". Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20230428150833.218605-7-martin.kaistra@linutronix.de
2023-05-05wifi: rtl8xxxu: Add beacon functionsMartin Kaistra1-0/+3
Add a workqueue to update the beacon contents asynchronously and implement downloading the beacon to the HW and starting beacon tx like the vendor driver. Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20230428150833.218605-4-martin.kaistra@linutronix.de
2023-03-20wifi: rtl8xxxu: Support new chip RTL8710BU aka RTL8188GUBitterblue Smith1-0/+44
This chip is found in cheap "free driver" USB adapters from Aliexpress. Initially they pretend to be a CD-ROM containing the driver for Windows. "Ejecting" switches the device to wifi mode. Features: 2.4 GHz, b/g/n mode, 1T1R, 150 Mbps. This chip is more unique than other Realtek chips: * The registers at addresses 0x0-0xff, which all the other chips use, can't be used here. New registers at 0x8000-0x80ff must be used instead. And it's not a simple matter of adding 0x8000: 0x2 (REG_SYS_FUNC) became 0x8004, 0x80 (REG_MCU_FW_DL) became 0x8090, etc. * Also there are a few new registers which must be accessed indirectly because their addresses don't fit in 16 bits. No other chips seem to have these. * The vendor driver compiles to 8188gu.ko, but the code calls the chip RTL8710B(U) pretty much everywhere, including messages visible to the user. Another difference compared to the other chips supported by rtl8xxxu is that it has a new PHY status struct, or three of them actually, from which we extract the RSSI, among other things. This is not unique, though, just new. The chips supported by rtw88 also use it. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/4edbe29f-00b9-8eef-9789-20bed0b141e2@gmail.com
2023-02-13wifi: rtl8xxxu: Add LED control code for RTL8192EUBitterblue Smith1-0/+2
By default the LED will blink when there is some activity. This was tested with a cheap "HT-WR813" from Aliexpress. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/8f7fd5d7-5baa-b38b-ad2a-977dcd9edd81@gmail.com
2023-02-13wifi: rtl8xxxu: Add LED control code for RTL8188EUBitterblue Smith1-0/+4
By default the LED will blink when there is some activity. This was tested with a TP-Link TL-WN725N. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/34d62bf5-3595-0c77-2ca7-be78555f765d@gmail.com
2022-12-21wifi: rtl8xxxu: Support new chip RTL8188EUJes Sorensen1-2/+38
This chip is found in cheap USB devices from TP-Link, D-Link, etc. Features: 2.4 GHz, b/g/n mode, 1T1R, 150 Mbps. Chip versions older than "I cut" need software rate control. That will be in the next commit. Until then MCS7 is used for all data frames. The "I cut" chips are not supported. They require different firmware and initialisation tables. Support can be added if someone has the hardware to test it. Co-developed-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Co-developed-by: Taehee Yoo <ap420073@gmail.com> Signed-off-by: Taehee Yoo <ap420073@gmail.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com> Co-developed-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/3aad60f6-23f9-81e8-c741-4bd51e99f423@gmail.com
2022-11-16wifi: rtl8xxxu: Use u32_get_bits in *_identify_chipBitterblue Smith1-1/+0
It simplifies the code a bit. Suggested-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/68f94284-3728-7b75-2b7b-64fae8af6bc5@gmail.com
2022-11-16wifi: rtl8xxxu: Name some bits used in burst initBitterblue Smith1-0/+6
Use descriptive names instead of magic numbers. Suggested-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/e7d05bd9-e096-8361-f1b4-3c8b8599a7eb@gmail.com
2022-11-04wifi: rtl8xxxu: Fix the CCK RSSI calculationBitterblue Smith1-0/+3
The CCK RSSI calculation is incorrect for the RTL8723BU, RTL8192EU, and RTL8188FU. Add new functions for these chips with code copied from their vendor drivers. Use the old code only for the RTL8723AU and RTL8192CU. I didn't notice any difference in the reported signal strength with my RTL8188FU, but I didn't look very hard either. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/926c838f-4997-698b-4da9-44582e2af99a@gmail.com
2022-11-04wifi: rtl8xxxu: Add central frequency offset trackingBitterblue Smith1-0/+1
According to Realtek programmers, "to adjust oscillator to align central frequency of connected AP. Then, it can yield better performance." From commit fb8517f4fade ("rtw88: 8822c: add CFO tracking"). The RTL8192CU and a version of RTL8723AU apparently don't have the ability to adjust the oscillator, so this doesn't apply to them. This also doesn't apply to the wifi + bluetooth combo chips (RTL8723AU and RTL8723BU) because the CFO tracking should only be done when bluetooth is disabled, and determining that looked complicated. That leaves only the RTL8192EU and RTL8188FU chips. I tested this with the latter. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/80aba428-0aff-f4b2-dea5-35d1425982b6@gmail.com
2022-10-04wifi: rtl8xxxu: Support new chip RTL8188FUBitterblue Smith1-0/+19
This chip is found in the cheapest USB adapters, e.g. 1.17 USD with VAT and shipping from China included. It's a gen 2 chip, similar to the RTL8723BU, but without Bluetooth. Features: 2.4 GHz, b/g/n mode, 1T1R, 150 Mbps. The vendor driver rtl8188fu version 4.3.23.6_20964.20170110 [0] was used as reference. The CD shipped with the device includes a newer driver, version 5.11.5-1-g12f7cde4b.20201102, but that one couldn't complete the WPA2 key exchange thing for whatever reason. [0] https://github.com/kelebek333/rtl8188fu Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/b14f299d-3248-98fe-eee1-ba50d2e76c74@gmail.com
2021-10-05rtl8xxxu: Use lower tx rates for the ack packetChris Chiu1-0/+2
According to the Realtek propritary driver and the rtw88 driver, the tx rates of the ack (includes block ack) are initialized with lower tx rates (no HT rates) which is set by the RRSR register value. In real cases, ack rate higher than current tx rate could lead to difficulty for the receiving end to receive management/control frames. The retransmission rate would be higher then expected when the driver is acting as receiver and the RSSI is not good. Cross out higer rates for ack packet before implementing dynamic rrsr configuration like the commit 4830872685f8 ("rtw88: add dynamic rrsr configuration"). Signed-off-by: Chris Chiu <chris.chiu@canonical.com> Acked-by: Jes Sorensen <Jes.Sorensen@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20211001040044.1028708-1-chris.chiu@canonical.com
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 295Thomas Gleixner1-9/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of version 2 of the gnu general public license as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 64 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141901.894819585@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-20rtl8xxxu: Update author/maintainer contact infoJes Sorensen1-1/+1
Update copyright year and email address. Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-17rtl8xxxu: Implement 8192e specific power down sequenceJes Sorensen1-0/+1
This powers down the 8192e correctly, or at least to the point where the firmware will load again, when reloading the driver module. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-03rtl8xxxu: Add interrupt bit definitions for gen2 partsJes Sorensen1-0/+56
These are primarily needed for SDIO/PCI parts, but the vendor driver still sets them for some USB devices. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-03rtl8xxxu: Add bit definitions for REG_FPGA0_TX_INFOJes Sorensen1-0/+4
This adds TX antenna selection bit defines for OFDM mode. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-06-29rtl8xxxu: Add additional documentation for RX DMA registersJes Sorensen1-3/+7
This also renames REG_USB_AGG_{TO,TH} to REG_USB_AGG_{TIMEOUT,THRESH} Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-06-29rtl8xxxu: Add bit definitions for REG_USB_SPECIAL_OPTIONJes Sorensen1-0/+4
Documentation for enabling USB aggregation and whether to select interrupt or bulk delivery of interrupt events. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15rtl8xxxu: Update copyright statement to include 2016Jes Sorensen1-1/+1
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15rtl8xxxu: Use descriptive bits for setting RX paths for 1T2R partsJes Sorensen1-0/+4
This reduce the use of magic values a little. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15rtl8xxxu: Implement generic init_queue_reserved_page() functionJes Sorensen1-1/+1
Longer term we should switch all the chips over to use this function instead of the random chip specific ifdef hacks. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14rtl8xxxu: Adjust AFE crystal value on 8192euJes Sorensen1-0/+4
Adjust AFE before enabling PLL on 8192eu, probably also needed for 8723bu. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14rtl8xxxu: Implement IQK calibration for 8192euJes Sorensen1-0/+1
8192eu has it's own IQK calibration procedure, and notably uses undocumented RF register 0x56 in the process. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14rtl8xxxu: Implement 8192eu device specific quirksJes Sorensen1-0/+1
Set REG_QUEUE_CTRL and REG_ACLK_MON for 8192eu. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14rtl8xxxu: Set REG_USB_HRPWM for 8192euJes Sorensen1-0/+1
The vendor driver set register 0xfe58 REG_USB_HWPWM in it's init sequence for 8192eu. Do the same here. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07rtl8xxxu: Update some register definitionsJes Sorensen1-7/+24
Improve descriptive names of some registers and add some additional registers only found on nextgen chips. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Flush FIFO before powering down devicesJes Sorensen1-0/+2
This should help when reloading the driver for 8723bu devices Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Implement device specific power_off functionJes Sorensen1-0/+2
Implment 8723bu specific device power down, and make power_off() a fileops function. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Use define for REG_PWR_DATA bitsJes Sorensen1-1/+1
Use the bit define rather than hard code the value for REG_PWR_DATA bits. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: RF_T_METER is different on the newer chipsJes Sorensen1-6/+7
Provide RF_T_METER register location for nextgen chips. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Implement init_statistics for 8723buJes Sorensen1-0/+7
Vendor driver implements this for 8723b and 8821 series Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Setup RX aggregationJes Sorensen1-0/+1
This initializes RX DMA aggregation on 8723bu. We should do this for all parts eventually, and also init TX aggregation. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Add REG_DWBCN1_CTRL_8723B defineJes Sorensen1-0/+2
List yet another new register found on the 8723b. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Initialize burst parameters for 8723buJes Sorensen1-1/+4
Implement burst parameter sequence for 8723bu parts. Eventually this should be moved into device specific sections. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Implement 8723bu power on sequenceJes Sorensen1-0/+11
This implements the 8723bu specific power on sequence as it is different from that of the 8723au chips. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Improve 8723bu init codeJes Sorensen1-1/+4
Implement additional init sequence code for the 8723bu. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Initial rtl8723bu_init_bt() codeJes Sorensen1-0/+2
This should initialize the antennas on the 8723bu, but so far I am still not receiving anything :( More work is needed. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Initial implementation of rtl8723bu_config_channel()Jes Sorensen1-0/+14
This is a first stab of implementing rtl8723bu_config_channel(). For now this will only do 20MHz channels. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: First stab at adding IQK calibration for 8723bu partsJes Sorensen1-0/+17
The 8723bu also has it's own IQK calibration process. This is similar in flow, but still different enough to warrent it's own implementation, at least for now. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Add a couple of new register definitionsJes Sorensen1-0/+6
This adds some additional register definitions for 8723bu, as well as a bit define for USB RXDMA aggregation in REG_RXDMA_AGG_PG_TH. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Add some missing register definitions for 8723buJes Sorensen1-1/+7
This introduces additional register definitions for newer generation chips. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Init REG_HIMR[01] for 8192eu partsJes Sorensen1-0/+4
The newer generation chips have different interrupt registers. Initialize this correct registers on 8192eu. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Kludge to drop incorrect USB OUT EP for 8192EUJes Sorensen1-0/+1
The 8192eu (and some other parts) will report an incorrect USB OUT EP. This tells the chip to drop it - as per the vendor driver. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Add rtl8xxxu_auto_llt_table()Jes Sorensen1-0/+3
Newer chips can auto load the LLT table, it is no longer necessary to build it manually in the driver. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Implment rtl8192eu_power_on()Jes Sorensen1-0/+6
This implements the rtl8192eu power on sequence, and splits it off from the rtl8192cu/rtl8723au power on sequence. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Identify chip vendors correctlyJes Sorensen1-0/+4
This identifies the chip vendors correctly and also picks the correct firmware for rtl8192eu. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25rtl8xxxu: Add missing bit define for REG_APS_FSMCOJes Sorensen1-0/+1
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>