summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/realtek
AgeCommit message (Collapse)AuthorFilesLines
2022-09-28wifi: rtw89: mac: define DMA channel mask to avoid unsupported channelsPing-Ke Shih5-0/+27
Six channels are unsupported by 8852b, so mask them out to prevent to access undefined registers in this chip. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220927062611.30484-3-pkshih@realtek.com
2022-09-28wifi: rtw89: pci: mask out unsupported TX channelsPing-Ke Shih5-0/+38
8852BE doesn't support some TX channels, so mask them out, or it access undefined registers. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220927062611.30484-2-pkshih@realtek.com
2022-09-24wifi: rtw89: support for enable/disable MSDU aggregationKuan-Chung Chen1-0/+9
To enable/disable amsdu in set_tid_config, and currently only support to configure all tids (==0xff) for AMSDU, not individual tid. The command example is: iw wlan0 set tidconf tids 0xff amsdu off iw wlan0 set tidconf peer xx:xx:xx:xx:xx:xx tids 0xff amsdu on Signed-off-by: Kuan-Chung Chen <damon.chen@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/20220922012737.15091-1-pkshih@realtek.com
2022-09-24wifi: rtw89: disable 26-tone RU HE TB PPDU transmissionsKuan-Chung Chen3-0/+47
Align with the spec of 802.11ax, follow the conditions for not responding with an HE TB PPDU. When there are OBSS that cannot interpret 26-tone RU transmissions, we should disable such transmissions. Signed-off-by: Kuan-Chung Chen <damon.chen@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/20220922012719.15037-1-pkshih@realtek.com
2022-09-24wifi: rtw89: support for processing P2P power savingDian-Syuan Yang8-0/+262
Support P2P client to process Notice of Absence (NoA) mechanism when it connects with P2P GO applying an NoA schedule. We define some action types including init, update, remove and terminate in h2c function to enable/disable NoA schedule. Signed-off-by: Dian-Syuan Yang <dian_syuan0116@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/20220922010435.12167-6-pkshih@realtek.com
2022-09-24wifi: rtw89: support WMM-PS in P2P GO modeDian-Syuan Yang1-1/+3
To handle a connected client using WMM-PS, the P2P GO also need to enable this power save mechanism. We add WIPHY_FLAG_AP_UAPSD flag to support it and define maximum number of buffered frames the WMM GO may deliver to the WMM client. Signed-off-by: Dian-Syuan Yang <dian_syuan0116@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/20220922010435.12167-5-pkshih@realtek.com
2022-09-24wifi: rtw89: set wifi_role of P2PPing-Ke Shih3-10/+25
Consider vif->p2p to set wifi_role to let firmware know current vif is running as GC or GO. And, allow GC to enter PS mode, but disallow to enter deep PS for now. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220922010435.12167-4-pkshih@realtek.com
2022-09-24wifi: rtw89: send OFDM rate only in P2P modeDian-Syuan Yang4-14/+35
Check IEEE80211_TX_CTL_NO_CCK_RATE flag to avoid sending frames with CCK rates in 2GHz band. In TX flow, add IEEE80211_TX_CTL_NO_CCK_RATE flag to check and get its lowest rate without CCK rates if the TX type is mgmt frames or data frames. Besides, the decision of phy rate and retry rate in P2P mode are also be handled. In P2P GO mode, it should send beacon of no CCK rates in its frame rate. Therefore, We add a condition to decide which rate is added to beacon content. Moreover, we avoid setting a mask of rates to be used for rate control selection before and after connection in P2P mode. Signed-off-by: Dian-Syuan Yang <dian_syuan0116@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/20220922010435.12167-3-pkshih@realtek.com
2022-09-24wifi: rtw89: support P2PPo Hao Huang3-1/+29
To support P2P in driver, we set P2P interface mode to the wiphy allocated for 802.11 PHY and add a change interface function to switch the interface type to P2P. Signed-off-by: Po Hao Huang <phhuang@realtek.com> Signed-off-by: Dian-Syuan Yang <dian_syuan0116@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/20220922010435.12167-2-pkshih@realtek.com
2022-09-22wifi: rtw89: coex: update coexistence to 6.3.0Ching-Te Ku3-10/+11
Since we maintain coexistence as shared code, so move coexistence version from chip specific attribute to a definition. Signed-off-by: Ching-Te Ku <ku920601@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/20220920010939.12173-10-pkshih@realtek.com
2022-09-22wifi: rtw89: coex: add logic to control BT scan priorityChing-Te Ku2-32/+85
Add control logic to operate Wi-Fi to BT scoreboard to control BT scan priority. And patch mechanism parameter to enhance Wi-Fi throughput while coexisting with BT profile & BT scan. Set PTA priority let Wi-Fi BT can RX at the same time. Signed-off-by: Ching-Te Ku <ku920601@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/20220920010939.12173-9-pkshih@realtek.com
2022-09-22wifi: rtw89: coex: summarize Wi-Fi to BT scoreboard and inform BT one time a ↵Ching-Te Ku2-7/+19
cycle If Wi-Fi driver send Wi-Fi status to BT via scoreboard too frequent in a short moment, BT will loss some of them because of hardware response time. To avoid this issue, change the code flow. Summarize the scoreboard changes and if the value have changed, send the scoreboard to BT only once in a coexistence processing cycle. It also can help to reduce driver I/O. Signed-off-by: Ching-Te Ku <ku920601@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/20220920010939.12173-8-pkshih@realtek.com
2022-09-22wifi: rtw89: coex: modify LNA2 setting to avoid BT destroyed Wi-Fi aggregationChing-Te Ku4-0/+104
To prevent LNA2 change its gain during a Wi-Fi aggregation packet while GNT_BT pull high. Otherwise, changes of this gain will destroy the whole aggregation when Wi-Fi RX. Signed-off-by: Ching-Te Ku <ku920601@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/20220920010939.12173-7-pkshih@realtek.com
2022-09-22wifi: rtw89: coex: add WL_S0 hardware TX/RX mask to allow WL_S0 TX/RX during ↵Ching-Te Ku1-0/+3
GNT_BT WiFi/BT combo module could only have two antenna, namely WL_S0 and WL_S1. WiFi can use two antenna to TX/RX 2SS data, and BT can share one of the antenna. This patch is to allow WiFi to TX/RX 1SS data like ACK/RTS/CTS to improve Wi-Fi performance while coexisting with Bluetooth. Signed-off-by: Ching-Te Ku <ku920601@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/20220920010939.12173-6-pkshih@realtek.com
2022-09-22wifi: rtw89: coex: add v1 Wi-Fi firmware steps reportChing-Te Ku2-4/+23
This report is to record firmware call flow like notify events, and take actions. This can help to address if firmware flow is in expectation. Implement v1 parser to support 8852CE firmware report. Signed-off-by: Ching-Te Ku <ku920601@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/20220920010939.12173-5-pkshih@realtek.com
2022-09-22wifi: rtw89: coex: add v1 summary info to parse the traffic status from firmwareChing-Te Ku1-1/+117
This debug entry is to summarize important messages to quickly address problem types, such as firmware hang, C2H/H2C stuck, or too much occupation of BT A2DP. If unexpected something is addressed, we can dig the problem via other debug messages that provide more detail information. Signed-off-by: Ching-Te Ku <ku920601@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/20220920010939.12173-4-pkshih@realtek.com
2022-09-22wifi: rtw89: coex: translate slot ID to readable nameChing-Te Ku1-1/+29
To analyze debug log quickly, use readable name in string format instead. Signed-off-by: Ching-Te Ku <ku920601@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/20220920010939.12173-3-pkshih@realtek.com
2022-09-22wifi: rtw89: coex: add v1 cycle report to parsing Bluetooth A2DP statusChing-Te Ku1-1/+137
'cysta' is short for statistics for cycles. That is a circular buffer to record snapshot status including beacon count, RX count, TX count etc. Since 8852CE Wi-Fi firmware report this statistics in different format, add v1 parser by this patch. Signed-off-by: Ching-Te Ku <ku920601@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/20220920010939.12173-2-pkshih@realtek.com
2022-09-19wifi: rtw89: uninitialized variable on error in ↵Dan Carpenter1-1/+1
rtw89_early_fw_feature_recognize() If request_partial_firmware_into_buf() fails then "firmware" is not initialized and the release_firmware(firmware) will crash. Fixes: deebea35d699 ("wifi: rtw89: early recognize FW feature to decide if chanctx") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/YyMzDtX/3fUBnonC@kili
2022-09-19wifi: rtw89: 8852c: add multi-port ID to TX descriptorPo-Hao Huang1-1/+2
Update tx descriptor settings so broadcast packets on other ports can be issued properly when DTIM count is 0. Before this, all broadcast packets are sent via port 0 and won't be transmitted correctly. 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/20220916033811.13862-8-pkshih@realtek.com
2022-09-19wifi: rtw89: fix rx filter after scanPo-Hao Huang1-7/+5
In monitor mode we should be able to received all packets even if it's not destined to us. But after scan, the configuration was wrongly set, so we fix it. 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/20220916033811.13862-7-pkshih@realtek.com
2022-09-19wifi: rtw89: free unused skb to prevent memory leakPo-Hao Huang1-0/+1
This avoid potential memory leak under power saving mode. 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/20220916033811.13862-6-pkshih@realtek.com
2022-09-19wifi: rtw89: reset halt registers before turn on wifi CPUPing-Ke Shih1-0/+2
Reset these registers to prevent firmware get false alarm after wifi CPU is running. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220916033811.13862-5-pkshih@realtek.com
2022-09-19wifi: rtw89: pci: update LTR settingsPing-Ke Shih2-4/+5
Modify PCI LTR control flow and LTR idle latency to improve power save efficiency. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220916033811.13862-4-pkshih@realtek.com
2022-09-19wifi: rtw89: mac: set NAV upper to 25msPing-Ke Shih2-1/+2
NAV upper register is to limit the maximum NAV value to prevent unexpected NAV, but the old setting is too small to reflect NAV from AP transmiting big MPDU at once. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220916033811.13862-3-pkshih@realtek.com
2022-09-19wifi: rtw89: initialize DMA of CMACPing-Ke Shih2-0/+47
8852C needs this to change CMAC dma to full mode to keep receiving packets after RX full event being resolved. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220916033811.13862-2-pkshih@realtek.com
2022-09-19wifi: rtw89: support SER L1 simulationZong-Zhe Yang5-16/+61
SER (system error recovery) can deal with different crash types by different levels of processes. Previous FW crash simulation triggers a CPU exception which is one kind of SER L2 type. It can verify SER L2 flow which includes HW/FW restart. Now, we want to increase crash simulation types. A debug function is added to trigger control error in purpose for SER L1 simulation/verification. And, debugfs fw_crash is extended to accept different parameters. echo 1 > fw_crash: simulate CPU exception as before (keep 1 for compatibility with previous) It will be catched and handled by SER L2. (this requires HW/FW restart) echo 2 > fw_crash: simulate control error It will be catched and handled by SER L1. (driver and FW cooperate to recover this) Besides, in order to apply to the above two cases, rename RTW89_FLAG_RESTART_TRIGGER to RTW89_FLAG_CRASH_SIMULATING and adjust where SER flow clears this bit for both L1 and L2. 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/20220914035034.14521-5-pkshih@realtek.com
2022-09-19wifi: rtw89: 8852c: support fw crash simulationZong-Zhe Yang3-2/+3
With FW >= v0.27.40.0, 8852C FW has feature to handle crash simulation. Besides, use RTW89_WCPU_BASE_MASK to replace use of RTW89_WCPU_BASE_ADDR and work for both 8852A and 8852C. 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/20220914035034.14521-4-pkshih@realtek.com
2022-09-19wifi: rtw89: introudce functions to drop packetsZong-Zhe Yang6-1/+183
Introudce a H2C feature to drop packets according to given parameters. And, we implement instances to drop packets from BE, BK, VI, VO queues by vif or sta. Then, we refine our callback of ieee80211_ops::flush to deal with the case of drop=true via this feature. 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/20220914035034.14521-3-pkshih@realtek.com
2022-09-19wifi: rtw89: unify use of rtw89_h2c_tx()Ping-Ke Shih1-62/+123
Seaprate calling of rtw89_h2c_tx() out of if-expression, and bypass the return value to upper caller. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220914035034.14521-2-pkshih@realtek.com
2022-09-19wifi: rtw89: pci: concentrate control function of TX DMA channelChin-Yen Lee4-14/+39
Different chips use different register and mask for tx dma channels, so concentrate them. 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/20220912071706.13619-4-pkshih@realtek.com
2022-09-19wifi: rtw89: correct enable functions of HCI/PCI DMAChin-Yen Lee4-79/+79
Some PCI and MAC registers are changed for different chips and correct them accordingly. And HCI MAD functions belongs to MAC core, so move it to mac.h/.c. 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/20220912071706.13619-3-pkshih@realtek.com
2022-09-19wifi: rtw89: 8852c: L1 DMA reset has offloaded to FWZong-Zhe Yang1-0/+6
For 8852C, rtw89_pci_lv1rst_stop_dma() and rtw89_pci_lv1rst_start_dma() are offloaded to FW L1 reset flow. So, driver no longer needs to do them. 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/20220912071706.13619-2-pkshih@realtek.com
2022-09-19wifi: rtw89: support for setting TID specific configurationKuan-Chung Chen3-13/+88
Add ops set_tid_config to support TID specific configuration. We currently only support ampdu setting. The command example is: iw wlan0 set tidconf tids 0x3 ampdu off iw wlan0 set tidconf peer xx:xx:xx:xx:xx:xx tids 0x2 ampdu on Signed-off-by: Kuan-Chung Chen <damon.chen@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/20220912070014.10018-3-pkshih@realtek.com
2022-09-19wifi: rtw89: support for setting HE GI and LTFKuan-Chung Chen4-1/+54
Support setting HE GI and LTF values to the kernel via nl80211. We currently only support some GI and LTF values settings. The command example is: iw wlan0 set bitrates he-gi-2.4 0.8 he-ltf-2.4 2 Signed-off-by: Kuan-Chung Chen <damon.chen@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/20220912070014.10018-2-pkshih@realtek.com
2022-09-19wifi: rtw89: coex: show connecting state in debug messagePing-Ke Shih1-2/+2
The variable cnt_connecting is to indicate if we are connecting to an AP. This is an important clue for coexistence to assign more time slot to WiFi side in this situation to ensure WiFi can establish connection. Without this patch, compiler warns: drivers/net/wireless/realtek/rtw89/coex.c:3244:25: warning: variable 'cnt_connecting' set but not used [-Wunused-but-set-variable] Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220912021009.6011-1-pkshih@realtek.com
2022-09-19wifi: rtw89: coex: Combine set grant WL/BT and correct the debug logChing-Te Ku3-105/+118
To reduce register IO, combine set_gnt_wl/set_gnt_bt to set the same register one time. Because RTL8852C use different register to control antenna path, so make correction of path control related debug logs. Signed-off-by: Ching-Te Ku <ku920601@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/20220913092546.43722-8-pkshih@realtek.com
2022-09-19wifi: rtw89: coex: Remove trace_step at COEX-MECH control structure for RTL8852CChing-Te Ku1-1/+3
RTL8852C don't need to send the data trace_step which used to tell firmware how many TDMA steps should record. Remove the member. Signed-off-by: Ching-Te Ku <ku920601@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/20220913092546.43722-7-pkshih@realtek.com
2022-09-19wifi: rtw89: coex: Parsing Wi-Fi firmware TDMA info from reportsChing-Te Ku1-1/+5
Show TDMA information containing TDMA policy and time slot of Wi-Fi/BT in debug message to check things are in expected. The v1 format contains additional header, and remaining part is the same as original. So 8852CE selects v1 version, and then everything like original. Signed-off-by: Ching-Te Ku <ku920601@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/20220913092546.43722-6-pkshih@realtek.com
2022-09-19wifi: rtw89: coex: Parsing Wi-Fi firmware error message from reportsChing-Te Ku1-6/+16
Parsing firmware error message from original version and v1 reports to show up exception counter of commands from firmware in debug message. Then, we can make sure exchange commands are correct totally. In the later version Wi-Fi firmware(v1), the report format was changed. With this update, we can yield correct report from proper struct. Signed-off-by: Ching-Te Ku <ku920601@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/20220913092546.43722-5-pkshih@realtek.com
2022-09-19wifi: rtw89: coex: Move coexistence firmware buffer size parameter to chip infoChing-Te Ku4-3/+5
Because RTL8852A/RTL8852C use different firmware buffer size to send C2H packet, it's necessary to use different size to parse C2H report. Signed-off-by: Ching-Te Ku <ku920601@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/20220913092546.43722-4-pkshih@realtek.com
2022-09-19wifi: rtw89: coex: Add v1 Wi-Fi firmware power-saving null data reportChing-Te Ku2-22/+74
The later version Wi-Fi firmware will report null data TX times, so the structure is different from before. Signed-off-by: Ching-Te Ku <ku920601@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/20220913092546.43722-3-pkshih@realtek.com
2022-09-19wifi: rtw89: coex: use void pointer as temporal type to copy reportPing-Ke Shih1-16/+17
With void pointer, we don't need to cast to 'u8 *' by one by. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220913092546.43722-2-pkshih@realtek.com
2022-09-12wifi: rtl8xxxu: Remove copy-paste leftover in gen2_update_rate_maskBitterblue Smith1-3/+2
It looks like a leftover from copying rtl8xxxu_update_rate_mask, which is used with the gen1 chips. It wasn't causing any problems for my RTL8188FU test device, but it's clearly a mistake, so remove it. Fixes: f653e69009c6 ("rtl8xxxu: Implement basic 8723b specific update_rate_mask() function") Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/d5544fe8-9798-28f1-54bd-6839a1974b10@gmail.com
2022-09-12wifi: rtl8xxxu: gen2: Fix mistake in path B IQ calibrationBitterblue Smith1-2/+2
Found by comparing with the vendor driver. Currently this affects only the RTL8192EU, which is the only gen2 chip with 2 TX paths supported by this driver. It's unclear what kind of effect the mistake had in practice, since I don't have any RTL8192EU devices to test it. Fixes: e1547c535ede ("rtl8xxxu: First stab at adding IQK calibration for 8723bu parts") Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/30a59f3a-cfa9-8379-7af0-78a8f4c77cfd@gmail.com
2022-09-12wifi: rtw89: split scan including lots of channelsPo-Hao Huang4-5/+38
The size limit of H2C commands is 2048. With regulatory that enables U-NII-6 ~ UNII-8 channels, channel list length combining with channel info length will exceed that. Split the channel list to parts and do scan multiple times to workaround that. 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/20220908051257.25353-10-pkshih@realtek.com
2022-09-12wifi: rtw89: 8852c: support hw_scanPo-Hao Huang4-7/+27
This enables hw_scan function for 52c. The mechanism is similar to 52a except that it adds modifications required for 6G channels and extends the command length to make driver compatible to both newer and existing firmware. 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/20220908051257.25353-9-pkshih@realtek.com
2022-09-12wifi: rtw89: call tx_wake notify for 8852c in deep ps modeChin-Yen Lee2-1/+5
8852c transmits packets with slow response in deep ps mode, and lead to low throughput. We need to call tx_wake for each pakcet to trigger firmware wake earlier to avoid it. 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/20220908051257.25353-8-pkshih@realtek.com
2022-09-12wifi: rtw89: support deep ps mode for rtw8852cChin-Yen Lee4-2/+7
rtw8852c could support deep ps mode if the firmware version is greater than 0.17.34. 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/20220908051257.25353-7-pkshih@realtek.com
2022-09-12wifi: rtw89: set response rate selectionChia-Yuan Li5-2/+54
With suitable response rate, it can acknowledge peer packets are received. Otherwise, peer could re-transmit again due to missing of ACK frames. To achieve this, refer to RX rate and CMAC table to choose the smaller as initial response rate. 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/20220908051257.25353-6-pkshih@realtek.com