summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/realtek/rtw89/ps.c
Commit message (Collapse)AuthorAgeFilesLines
* wifi: rtw89: fix power save function in WoWLAN modeChih-Kang Chang2023-04-171-2/+4
| | | | | | | | | | | | In WoWLAN Mode, it's expected that WiFi chip could enter power save mode only after all setting is finished, but current wow_enter_lps function break the rule and may lead to WoWLAN function fail in low probability, so fix 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/20230410053438.10682-2-pkshih@realtek.com
* wifi: rtw89: add flag check for power statePo-Hao Huang2023-04-141-0/+6
| | | | | | | | | | | | | Use POWER_ON flag to make sure power on/off is symmetric. Since both remain_on_channel and hw_scan both alter the power state, this makes sure that we don't enter/leave IPS mode twice. Also, replace IPS related functions with inline function that does similar logic so we can track it more easily. 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/20230411124832.14965-5-pkshih@realtek.com
* wifi: rtw89: add WoWLAN function supportChin-Yen Lee2022-11-011-1/+1
| | | | | | | | | | | | | | | | | | | 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
* wifi: rtw89: support for processing P2P power savingDian-Syuan Yang2022-09-241-0/+61
| | | | | | | | | | | | 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
* wifi: rtw89: set wifi_role of P2PPing-Ke Shih2022-09-241-5/+9
| | | | | | | | | | 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
* wifi: rtw89: refine leaving LPS functionZong-Zhe Yang2022-08-091-1/+2
| | | | | | | | | | It's unnecessary to iterate leaving PS mode. So, move it out of the iteration. 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/20220802123712.16577-1-pkshih@realtek.com
* rtw89: ps: access TX/RX rings via another registers in low power modePing-Ke Shih2022-04-241-2/+32
| | | | | | | | | | | | | | | | | | In low power mode, we need to pause PCI to configure IMR and PCI ring index registers accordingly, because the regular registers are power-off in this mode. In the transition moment named paused in code, we can't touch ring index, so don't kick off DMA immediately. Instead, queue them into pending queue, and kick off after the moment. There are three low power modes, which are RF off/clock gate/power gate, but PCI enter low power mode in later two modes only. So, add a mask to achieve this. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220421120903.73715-7-pkshih@realtek.com
* rtw89: add Realtek 802.11ax driverPing-Ke Shih2021-10-131-0/+150
This driver named rtw89, which is the next generation of rtw88, supports Realtek 8852AE 802.11ax 2x2 chip whose new features are OFDMA, DBCC, Spatial reuse, TWT and BSS coloring; now some of them aren't implemented though. The chip architecture is entirely different from the chips supported by rtw88 like RTL8822CE 802.11ac chip. First of all, register address ranges are totally redefined, so it's impossible to reuse register definition. To communicate with firmware, new H2C/C2H format is proposed. In order to have better utilization, TX DMA flow is changed to two stages DMA. To provide rich RX status information, additional RX PPDU packets are added. Since there are so many differences mentioned above, we decide to propose a new driver. It has many authors, they are listed in alphabetic order: Chin-Yen Lee <timlee@realtek.com> Ping-Ke Shih <pkshih@realtek.com> Po Hao Huang <phhuang@realtek.com> Tzu-En Huang <tehuang@realtek.com> Vincent Fann <vincent_fann@realtek.com> Yan-Hsuan Chuang <tony0620emma@gmail.com> Zong-Zhe Yang <kevin_yang@realtek.com> Tested-by: Aaron Ma <aaron.ma@canonical.com> Tested-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20211008035627.19463-1-pkshih@realtek.com