summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/realtek
AgeCommit message (Collapse)AuthorFilesLines
2022-11-08wifi: rtw89: update D-MAC and C-MAC dump to diagnose SERChia-Yuan Li5-197/+845
To detect TX or RX stuck, we implement SER (system error recovery) in firmware to recover abnormal states of hardware, and report events to driver. This kind of events could happen rarely per day. SER might be true-positive or false-negative cases, and it could be failed to recover true-positive case. We dump related registers to kernel message at that moment and collect them from users, because they occur rarely, randomly and hard to make sure we reproduce the same symptom. To address problems accurately, add more registers by this patch. It also might be false-positive cases that looks like TX or RX get stuck, we need to dump registers from debugfs manually, so also add similar things to debugfs as well. Signed-off-by: Chia-Yuan Li <leo.li@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221102014300.14091-3-pkshih@realtek.com
2022-11-08wifi: rtw89: dump dispatch status via debug portChia-Yuan Li3-0/+625
Dispatch is a component to decide packets forward to host, DMAC or HAXIDMA. It contains CDT standing for CPU dispatcher, HDT standing for host dispatcher, WDE standing for descriptor engine and PLE standing for payload engine. STF is one kind of modes, it can be used if packet send to hardware and doesn't need release report. These debug port information can help to clarify the reason if packets stuck in dispatch. Signed-off-by: Chia-Yuan Li <leo.li@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221102014300.14091-2-pkshih@realtek.com
2022-11-04wifi: rtl8xxxu: Use dev_* instead of pr_infoBitterblue Smith1-2/+4
Replace two instances of bare pr_info with dev_info and dev_warn. Also make their messages a little more informative. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/c9f3ebb2-769b-7d80-cac2-5a9d1bcc010a@gmail.com
2022-11-04wifi: rtl8xxxu: Set IEEE80211_HW_SUPPORT_FAST_XMITBitterblue Smith1-0/+1
According to commit 60d7900dcb98 ("wlcore: enable IEEE80211_HW_SUPPORT_FAST_XMIT"), we can use this because all the chips have hardware rate control. This is one of the things mac80211 requires before it will handle MSDU aggregation for us. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/9b59e735-6b89-a557-fafc-2da87fdd5b48@gmail.com
2022-11-04wifi: rtl8xxxu: Recognise all possible chip cutsBitterblue Smith1-21/+5
The chip cut, also known as the chip version, is a letter from A (0) to P (15). Recognise them all instead of printing "unknown" when it's greater than E. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/1559c705-0b0b-8dcb-7596-fbb85844d3d9@gmail.com
2022-11-04wifi: rtl8xxxu: Fix the CCK RSSI calculationBitterblue Smith8-14/+138
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 Smith7-32/+212
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-11-04wifi: rtlwifi: rtl8192ee: remove static variable stop_report_cntColin Ian King1-8/+0
Variable stop_report_cnt is being set or incremented but is never being used for anything meaningful. The variable and code relating to it's use is redundant and can be removed. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Acked-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221031155637.871164-1-colin.i.king@gmail.com
2022-11-01wifi: rtw89: 8852b: Fix spelling mistake KIP_RESOTRE -> KIP_RESTOREColin Ian King1-1/+1
Ther is a spelling mistake in a rtw89_debug message. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Acked-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221020072646.1513307-1-colin.i.king@gmail.com
2022-11-01wifi: rtw89: add WoWLAN pattern match supportChin-Yen Lee7-1/+381
Pattern match is an option of WoWLAN to allow the device to be woken up from suspend mode when receiving packets matched user-designed patterns. The patterns are written into hardware via WoWLAN firmware in suspend flow if users have set up them. If packets matched designed pattern are received, WoWLAN firmware will send an interrupt and then wake up the device. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221027052707.14605-8-pkshih@realtek.com
2022-11-01wifi: rtw89: add WoWLAN function supportChin-Yen Lee15-7/+874
WoWLAN is a feature which allows devices to be woken up from suspend state through WLAN events. When user enables WoWLAN feature and then let the device enter suspend state, WoWLAN firmware will be loaded by the driver and periodically monitors WiFi packets. Power consumption of WiFi chip will be reduced in this state. We now implement WoWLAN function in rtw8852ae and rtw8852ce chip. Currently supported WLAN events include receiving magic packet, rekey packet and deauth packet, and disconnecting from AP. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221027052707.14605-7-pkshih@realtek.com
2022-11-01wifi: rtw89: add related H2C for WoWLAN modeChin-Yen Lee3-0/+419
In this patch we define some H2C, which will be called during suspend flow, to enable WoWLAN function provided by WoWLAN firmware. These H2C includes keep alive used to send null packet to AP periodically to avoid being disconnected by AP, disconnect detection used to configure how we check if AP is offline, wake up control used to decide which WiFi events could trigger resume flow, and global control used to enable WoWLAN function. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221027052707.14605-6-pkshih@realtek.com
2022-11-01wifi: rtw89: add drop tx packet functionChih-Kang Chang8-0/+137
When entering WoWLAN mode, we need to drop all transmit packets, including those in mac buffer, to avoid memory leakage, so implement the drop_tx function. Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com> Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221027052707.14605-5-pkshih@realtek.com
2022-11-01wifi: rtw89: add function to adjust and restore PLE quotaChih-Kang Chang4-0/+39
PLE RX quota, which is the setting of RX buffer, is needed to be adjusted dynamically for WoWLAN mode, and restored when back to normal mode. The action is not needed for rtw8852c chip. Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com> Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221027052707.14605-4-pkshih@realtek.com
2022-11-01wifi: rtw89: move enable_cpu/disable_cpu into fw_downloadChih-Kang Chang3-8/+9
For WoWLAN mode, we need to download WoWLAN firmware by calling fw_download(). Another, to disable/enable WiFi CPU is needed before calling fw_download. Since Firmware runs on WiFi CPU, it is intuitive to combine enable_cpu/disable_cpu functions into fw_download. Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221027052707.14605-3-pkshih@realtek.com
2022-11-01wifi: rtw89: collect and send RF parameters to firmware for WoWLANChih-Kang Chang3-4/+31
For WoWLAN mode, we only collect and send RF parameters to Firmware without writing RF registers. So we add one function to practice it. Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221027052707.14605-2-pkshih@realtek.com
2022-11-01wifi: rtw89: check if sta's mac_id is valid under AP/TDLSZong-Zhe Yang1-0/+2
Add boundary check of mac_id when adding sta under AP/TDLS. And, return -ENOSPC if the acquired mac_id is invalid. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221021091828.40157-1-pkshih@realtek.com
2022-11-01wifi: rtw89: add BW info for both TX and RX in phy_infoEric Huang1-0/+18
In order to debug performance issue intuitively, add bandwidth information into debugfs entry phy_info. After applying this patch, it looks like: TX rate [0]: HE 2SS MCS-11 GI:0.8 BW:80 (hw_rate=0x19b) ==> agg_wait=1 (3500) RX rate [0]: HE 2SS MCS-9 GI:0.8 BW:80 (hw_rate=0x199) Signed-off-by: Eric Huang <echuang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221021091601.39884-1-pkshih@realtek.com
2022-11-01wifi: rtw89: 8852c: make table of RU mask constantPing-Ke Shih1-2/+2
This table must be constant, so change it as expectation. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221020052702.33988-2-pkshih@realtek.com
2022-11-01wifi: rtw89: declare support bands with constZong-Zhe Yang1-3/+3
They are just default declarations and we won't modify them directly. Instead, we actually do moification on their memdup now. So, they should be declared with const. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221020052702.33988-1-pkshih@realtek.com
2022-11-01wifi: rtw89: fw: adapt to new firmware format of dynamic headerPing-Ke Shih2-3/+31
Since firmware size is limited, we create variant firmwares for variant application areas. To help driver to know firmware's capabilities, firmware dynamic header is introduced to have more information, such as firmware features and firmware compile flags. Since this driver rtw89 only uses single one specific firmware at runtime, this patch is just to ignore this dynamic header, not actually use the content. This patch can be backward compatible, and no this kind of firmware is added to linux-firmware yet, so I can prepare this in advance. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221020052549.33783-1-pkshih@realtek.com
2022-10-21wifi: rtl8xxxu: Fix reads of uninitialized variables hw_ctrl_s1, sw_ctrl_s1Colin Ian King1-1/+1
Variables hw_ctrl_s1 and sw_ctrl_s1 are not being initialized and potentially can contain any garbage value. Currently there is an if statement that sets one or the other of these variables, followed by an if statement that checks if any of these variables have been set to a non-zero value. In the case where they may contain uninitialized non-zero values, the latter if statement may be taken as true when it was not expected to. Fix this by ensuring hw_ctrl_s1 and sw_ctrl_s1 are initialized. Cleans up clang warning: drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c:432:7: warning: variable 'hw_ctrl_s1' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (hw_ctrl) { ^~~~~~~ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c:440:7: note: uninitialized use occurs here if (hw_ctrl_s1 || sw_ctrl_s1) { ^~~~~~~~~~ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c:432:3: note: remove the 'if' if its condition is always true if (hw_ctrl) { ^~~~~~~~~~~~~ Fixes: c888183b21f3 ("wifi: rtl8xxxu: Support new chip RTL8188FU") Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221020135709.1549086-1-colin.i.king@gmail.com
2022-10-19wifi: rtw89: 8852b: add 8852be to Makefile and KconfigPing-Ke Shih2-0/+23
Now, basic materials for 8852be are ready, so add 8852be to Kconfig and Makefile. Current version can support STA, AP and monitor modes. We still fine tune some features, such as BT coexistence, performance, and power consumption. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221014060237.29050-5-pkshih@realtek.com
2022-10-19wifi: rtw89: phy: add dummy C2H handler to avoid warning messagePing-Ke Shih2-0/+13
The C2H class 2 function 3 is to report retry count of low rate, but driver doesn't implement yet, so add a dummy case to avoid message: rtw89_8852be 0000:03:00.0: c2h class 2 not support Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221014060237.29050-4-pkshih@realtek.com
2022-10-19wifi: rtw89: 8852b: add chip_ops related to RF calibrationPing-Ke Shih1-0/+42
Since RF calibrations are added, add chip_ops to call them. These chip_ops include initial, full calibration, configuration when switching band and scanning, and track work in period of 2 seconds. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221014060237.29050-3-pkshih@realtek.com
2022-10-19wifi: rtw89: 8852b: rfk: add DPKPing-Ke Shih4-0/+1169
DPK is short for digital pre-distortion calibration. It can adjusts digital waveform according to PA linear characteristics dynamically to enhance TX EVM. Do this calibration when we are going to run on AP channel. To prevent power offset out of boundary, it monitors thermal and set proper boundary to register. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221014060237.29050-2-pkshih@realtek.com
2022-10-19wifi: rtw89: 8852b: rfk: add TSSIPing-Ke Shih4-0/+1236
TSSI is transmitter signal strength indication, which is a close-loop hardware circuit to feedback actual transmitting power as a reference for next transmission. When we setup channel to connect an AP, it does full calibration. When switching bands or channels, it needs to reset hardware status to prevent use wrong feedback of previous transmission. To do TX power compensation reflecting current temperature, it loads tables of compensation values into registers according to channel and band group. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221012083234.20224-6-pkshih@realtek.com
2022-10-19wifi: rtw89: 8852b: rfk: add IQKPing-Ke Shih3-0/+1066
IQ signal calibration is a very important calibration to yield good RF performance. We do this calibration only if we are going to run on AP channel. During scanning phase, without this calibration RF performance is still acceptable because it transmits with low data rate at this phase. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221012083234.20224-5-pkshih@realtek.com
2022-10-19wifi: rtw89: 8852b: rfk: add RX DCKPing-Ke Shih2-0/+76
RX DCK is receiver DC calibration. With this calibration, we have proper DC offset to reflect correct received signal strength indicator. Do this calibration when bringing up interface and going to run on AP channel. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221012083234.20224-4-pkshih@realtek.com
2022-10-19wifi: rtw89: 8852b: rfk: add RCKPing-Ke Shih2-0/+44
RCK is synchronize RC calibration. Driver triggers this calibration and sets the result to register. This calibration is needed once when interface is going to up. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221012083234.20224-3-pkshih@realtek.com
2022-10-19wifi: rtw89: 8852b: rfk: add DACKPing-Ke Shih3-0/+454
DACK (digital-to-analog converters calibration) is used to calibrate DAC to output good quality signals. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221012083234.20224-2-pkshih@realtek.com
2022-10-12wifi: rtw89: 8852b: add basic attributes of chip_infoPing-Ke Shih1-0/+235
Add 8852b specific constant tables and basic attributes containing common chip_ops, firmware name, supported TX/RX NSS, number of CAM, coexistence version, control register set, and so on. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221009125403.19662-10-pkshih@realtek.com
2022-10-12wifi: rtw89: 8852b: add functions to control BB to assist RF calibrationsPing-Ke Shih2-0/+332
When we are going to do RF calibrations, they need BB helpers to control TX PLCP, power, path and mode. Also, it they need helpers to backup and restore some registers before and after RF calibrations. Then, use flow of RF calibrations will be like backup registers, configure calibration, configure TX parameters, measure calibration result, and finally restore registers. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221009125403.19662-9-pkshih@realtek.com
2022-10-12wifi: rtw89: 8852b: add chip_ops to configure TX/RX pathPing-Ke Shih3-0/+119
To support variant models, such as 1x1 or 1T2R, we need this chip_ops to change the path accordingly. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221009125403.19662-8-pkshih@realtek.com
2022-10-12wifi: rtw89: 8852b: add chip_ops to query PPDUPing-Ke Shih1-0/+32
Add to parse PPDU to get frequency and RSSI of received packets. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221009125403.19662-7-pkshih@realtek.com
2022-10-12wifi: rtw89: 8852b: add chip_ops related to BT coexistencePing-Ke Shih2-0/+306
These chip_ops are used to assist BT coexistence module to control chip specific operations, such as initial, pre-AGC, BT grant, set wifi priority and tx power, RX gain, and get BT counter. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221009125403.19662-6-pkshih@realtek.com
2022-10-12wifi: rtw89: 8852b: add chip_ops to get thermalPing-Ke Shih1-0/+18
Thermal value reflects temperature that will affect RF performance, so we re-calibrate RF characteristics if delta of thermal over a threshold. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221009125403.19662-5-pkshih@realtek.com
2022-10-12wifi: rtw89: 8852b: add basic baseband chip_opsPing-Ke Shih1-0/+42
chip_ops::bb_reset is to reset baseband state after loading parameters, because its state could be unpredictable at that moment. The other is chip_ops::bb_sethw that is to set some baseband settings not including in parameter tables. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221009125403.19662-4-pkshih@realtek.com
2022-10-12wifi: rtw89: 8852b: add power on/off functionsPing-Ke Shih3-0/+211
We need power on function to enable hardware circuits of MAC/BB/RF, and then download firmware and load PHY parameters. After more settings, it starts to work. When it enters idle, use power off function to have the lowest power consumption. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221009125403.19662-3-pkshih@realtek.com
2022-10-12wifi: rtw89: 8852b: add chip_ops::set_channel_helpPing-Ke Shih1-0/+84
This chip_ops is to assist set_channel, because we need setup and restore hardware before and after set_channel. Before set_channel, we stop transmitting, reset PPDU status, disable TSSI, and disable ADC. After set_channel, do opposite things in reverse order. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221009125403.19662-2-pkshih@realtek.com
2022-10-12wifi: rtl8xxxu: Update module descriptionBitterblue Smith1-3/+4
Make the title more future-proof, using rtw88 as a model. Mention support for RTL8723BU, RTL8192EU, and RTL8188FU. Correct the module name. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/ecb7512a-07e8-112d-c815-1494582de5f8@gmail.com
2022-10-12wifi: rtl8xxxu: Fix reading the vendor of combo chipsBitterblue Smith1-8/+8
The wifi + bluetooth combo chips (RTL8723AU and RTL8723BU) read the chip vendor from the wrong register because the val32 variable gets overwritten. Add one more variable to avoid this. This had no real effect on RTL8723BU. It may have had an effect on RTL8723AU. Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)") Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/24af8024-2f07-552b-93d8-38823d8e3cb0@gmail.com
2022-10-12wifi: rtl8xxxu: Make some arrays constBitterblue Smith7-36/+36
All the initialisation tables, plus rtl8xxxu_rfregs. Most of them were already static. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/9407f219-a7ba-676e-3d99-154d67b312d2@gmail.com
2022-10-11wifi: rtw89: fix wrong bandwidth settings after scanPo-Hao Huang1-0/+1
Set channel in driver side to configure Tx power and channel index correctly after scan. Before this, beacons with bandwidth larger than 20M bandwidth will be dropped by mac80211 due to frequency mismatch. Signed-off-by: Po-Hao Huang <phhuang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221007045900.10823-2-pkshih@realtek.com
2022-10-11wifi: rtw89: correct 6 GHz scan behaviorPo-Hao Huang2-6/+23
Change active scan behavior to fit 6GHz requirements. There are many different rules on active scan between 6GHz and 2GHz/5GHz, so if the SSID is not specified, do fast passive scanning and limit number of probe requests we send for now until new firmware can support all rules. Signed-off-by: Po-Hao Huang <phhuang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221007045900.10823-1-pkshih@realtek.com
2022-10-11wifi: rtw89: 8852b: add chip_ops::set_channelPing-Ke Shih7-1/+903
set_channel is main function to configure channel and bandwidth for all layers, namely MAC, BB and RF. Additionally, MAC layer enables CCK rate checking to avoid wrong rate from driver. BB layer configures SCO (Sample Clock Offset) for CCK, TX gain error/offset, and reset baseband hardware circuit after all configurations done. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221005083212.45683-7-pkshih@realtek.com
2022-10-11wifi: rtw89: make generic functions to convert subband gain indexPing-Ke Shih2-44/+46
The gain tables use different domain index, so we need to convert the index from subband of chandef. Since these conversion functions can share with 8852b, make generic functions for further use. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221005083212.45683-6-pkshih@realtek.com
2022-10-11wifi: rtw89: 8852b: add HFC quota arraysPing-Ke Shih1-0/+32
HFC is short for HCI flow control. These arrays are used to set quota according to operating modes, which are SCC or download firmware. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221005083212.45683-5-pkshih@realtek.com
2022-10-11wifi: rtw89: 8852b: set proper configuration before loading NCTLPing-Ke Shih2-5/+9
Before loading RF NCTL table, we need to configure IQK/DPK clock and reset them, and then polling NCTL state ready. Since 8852BE needs additional one setting, add it by this patch. Also, give them proper names. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221005083212.45683-4-pkshih@realtek.com
2022-10-11wifi: rtw89: parse PHY status only when PPDU is to_selfEric Huang1-0/+3
Without this fix, some non-self packets are used to count CFO (center frequency offset), and average CFO has unstable variation. Then, it causes unexpected performance. Signed-off-by: Eric Huang <echuang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221005083212.45683-3-pkshih@realtek.com