summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireguard/device.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-10-29wifi: rtw88: Allow rtw_chip_info.ltecoex_addr to be NULLBitterblue Smith1-3/+11
RTL8821A doesn't have this. Trying to use it results in error messages, so don't try if ltecoex_addr is NULL. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/d1004817-1760-41d1-9136-3d799757c444@gmail.com
2024-10-29wifi: rtw88: Extend the init table parsing for RTL8812AUBitterblue Smith2-8/+69
The chips supported so far only use the first condition, and so the parsing code ignores the second condition. RTL8812AU's init tables use the second condition also. Make the parsing code check it. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/1bee6b74-6eab-44a3-9f40-794ca006c72d@gmail.com
2024-10-29wifi: rtw88: Allow different C2H RA report sizesBitterblue Smith8-10/+34
The RTL8821AU and RTL8812AU have smaller RA report size, only 4 bytes. Avoid the "invalid ra report c2h length" error. Also, use a struct and u8_get_bits() to access the RA report C2H. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/c3e73c3a-fb2f-4013-9f06-d5274211e282@gmail.com
2024-10-29wifi: rtw88: Dump the HW features only for some chipsBitterblue Smith7-0/+9
RTL8821AU and RTL8812AU don't support this. They hit the "failed to read hw feature report" error. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/8becd851-8760-4480-8e8c-c4869ce72507@gmail.com
2024-10-29wifi: rtw88: Add some definitions for RTL8821AU/RTL8812AUBitterblue Smith4-36/+177
Add 8821A and 8812A chip type enums. Add cck_high_power member to struct rtw_hal. This will be used to calculate the RX signal strength of RTL8812AU. Add various register definitions which will be used by the new drivers. Move some existing register definitions from rtw8821c.h and rtw8822b.h. They were duplicated in those headers and will also be used by the new drivers. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/9279a9cd-6f86-4dc3-a095-7c36cb9b9d06@gmail.com
2024-10-29wifi: rtw88: Report the signal strength only if it's knownBitterblue Smith1-4/+8
RTL8811CU doesn't report the signal strength for many (any?) data frames. When the signal strength is not known, set RX_FLAG_NO_SIGNAL_VAL in order to avoid reporting a signal strength of 0. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Acked-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/f7e1e448-2c9b-498f-b8b1-a14dd967d7d3@gmail.com
2024-10-29wifi: rtw89: 8922a: extend RFK handling and consider MLOZong-Zhe Yang5-44/+70
Extend FW and driver handling on RFK to support it on both HW bands. Then, according to MLO cases, do the corresponding RF settings. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241022083106.149252-6-pkshih@realtek.com
2024-10-29wifi: rtw89: tweak setting of channel and TX power for MLOZong-Zhe Yang4-65/+149
Setting of channel and TX power depend on channel contexts, but original code cannot handle combination of MCC (multi-channel concurrency) and MLO well. So according to active interfaces, we generate a table for current channel contexts. And then based on entity mode, we get the corresponding channel context to apply during channel or TX power setting. When MLO is supported, there will be dual-PHY and we will apply the channel context of the 2nd link to the 2nd PHY. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241022083106.149252-5-pkshih@realtek.com
2024-10-29wifi: rtw89: chan: manage active interfacesZong-Zhe Yang4-13/+108
To set channel well for combination of MCC (multi-channel concurrency) and impending MLO support, we need a method to manage relation between active interfaces and channel contexts. If an interface owns at least one active link, we call it an active interface. We add a list to manage active ones. Basically, the list follows the active order except for the below case. To be compatible with legacy behavior, the first interface that owns the first channel context will put at the first entry in the list when recalculating. Besides, MCC can also select and fill roles based on the above active list. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241022083106.149252-4-pkshih@realtek.com
2024-10-29wifi: rtw89: Add encryption support for MLO connectionsPo-Hao Huang2-6/+69
In order to make encryption/decryption work properly with MLO connections, MLD address needs to be filled in so circuits can operate with the correct information. Signed-off-by: Po-Hao Huang <phhuang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241022083106.149252-3-pkshih@realtek.com
2024-10-29wifi: rtw89: Add header conversion for MLO connectionsPo-Hao Huang2-0/+17
For MLO connections, this setting replaces 802.11 header addresses to according link addresses based on each packet's destination. The fields most likely to be replaced would be both A1 and A2. For legacy connections, it's the same with or without the conversion. Signed-off-by: Po-Hao Huang <phhuang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241022083106.149252-2-pkshih@realtek.com
2024-10-25wifi: rtw89: unlock on error path in rtw89_ops_unassign_vif_chanctx()Dan Carpenter1-0/+1
We need to call mutex_unlock() on this error path. Fixes: aad0394e7a02 ("wifi: rtw89: tweak driver architecture for impending MLO support") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/8683a712-ffc2-466b-8382-0b264719f8ef@stanley.mountain
2024-10-25wifi: rtw89: Fix TX fail with A2DP after scanningPo-Hao Huang1-2/+2
There might be some racing between BT and WiFi after scan. Since one of the TX related register will be modified by both FW and rtw89_set_channel() in driver, which could cause Tx fail. Reorder the calling sequence to only notify coexistence mechanism after rtw89_set_channel() is called, so that there are no concurrent operations. Fixes: 5f499ce69b8d ("wifi: rtw89: pause/proceed MCC for ROC and HW scan") Signed-off-by: Po-Hao Huang <phhuang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241021063219.22613-1-pkshih@realtek.com
2024-10-25wifi: rtw89: coex: Set Wi-Fi/Bluetooth priority for Wi-Fi scan caseChing-Te Ku1-1/+1
The priority table should be changed according to what the in using Bluetooth application is. To avoid Bluetooth audio + HID (mouse) will trigger the lag experience, update the priority table. Signed-off-by: Ching-Te Ku <ku920601@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241019063131.9462-1-pkshih@realtek.com
2024-10-25wifi: rtw89: fix -Wenum-compare-conditional warningsArnd Bergmann1-11/+37
This is one of three drivers that trigger -Wenum-compare-conditional warnings with clang: drivers/net/wireless/realtek/rtw89/core.c:1806:14: error: conditional expression between different enumeration types ('enum nl80211_eht_gi' and 'enum nl80211_he_gi') [-Werror,-Wenum-compare-conditional] 1806 | return eht ? NL80211_RATE_INFO_EHT_GI_0_8 : | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1807 | NL80211_RATE_INFO_HE_GI_0_8; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/wireless/realtek/rtw89/core.c:1810:14: error: conditional expression between different enumeration types ('enum nl80211_eht_gi' and 'enum nl80211_he_gi') [-Werror,-Wenum-compare-conditional] 1810 | return eht ? NL80211_RATE_INFO_EHT_GI_1_6 : | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1811 | NL80211_RATE_INFO_HE_GI_1_6; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/wireless/realtek/rtw89/core.c:1813:14: error: conditional expression between different enumeration types ('enum nl80211_eht_gi' and 'enum nl80211_he_gi') [-Werror,-Wenum-compare-conditional] 1813 | return eht ? NL80211_RATE_INFO_EHT_GI_3_2 : | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1814 | NL80211_RATE_INFO_HE_GI_3_2; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/wireless/realtek/rtw89/core.c:1818:15: error: conditional expression between different enumeration types ('enum nl80211_eht_gi' and 'enum nl80211_he_gi') [-Werror,-Wenum-compare-conditional] 1818 | return eht ? NL80211_RATE_INFO_EHT_GI_3_2 : | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1819 | NL80211_RATE_INFO_HE_GI_3_2; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ In this case, all four warnings can be easily avoided by splitting the function into two separate ones, in a way that helps readability as well, at the expense of a few extra source lines. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241018152311.4023979-1-arnd@kernel.org
2024-10-25wifi: rtlwifi: use MODULE_FIRMWARE() to declare used firmwarePing-Ke Shih2-1/+5
Some used firmware are missing to be added to MODULE_FIRMWARE(). Add them accordingly. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241018055651.21166-1-pkshih@realtek.com
2024-10-25wifi: rtw88: Refactor looping in rtw_phy_store_tx_power_by_rateMohammed Anees1-3/+1
The previous implementation included an unnecessary else condition paired with a continue statement. Since a check is already performed to determine if the band is either 2G or 5G, the else condition will never be triggered. We can remove this check. Signed-off-by: Mohammed Anees <pvmohammedanees2003@gmail.com> Acked-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241017080638.13074-1-pvmohammedanees2003@gmail.com
2024-10-25wifi: rtw89: regd: block 6 GHz if marked as N/A in regd mapZong-Zhe Yang1-5/+27
If 6 GHz of a country is marked as N/A in our regd map, we block 6 GHz channels now. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241016134457.9375-1-pkshih@realtek.com
2024-10-25wifi: rtw89: pci: add quirks by PCI subsystem ID for thermal protectionPing-Ke Shih10-0/+86
Specific PCI subsystem ID (SSID) of WiFi cards is used by specific customer who want to enable various features with different arguments. Define PCI SSID quirks tables to enable thermal protection with two kinds of thermal values for 110 and 120 degree Celsius. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241016133735.7571-3-pkshih@realtek.com
2024-10-25wifi: rtw89: add thermal protectionPing-Ke Shih13-5/+138
To prevent chip overheating, reduce TX duty as the mechanism of thermal protection. When temperature is raising over a threshold, send a firmware command to reduce TX duty. If temperature is still raising, higher level is adopted to have lower active duration. The equation and unit of thermal values are different from chip to chip, so define constant thresholds of thermal value to corresponding absolute temperature of 110 and 120 degree Celsius. Latter patch will decide which thermal threshold is adopted, and current is still not enable thermal protection. For debugging, add a flag to disable_dm that thermal protection can be disabled to clarify low throughput in field. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241016133735.7571-2-pkshih@realtek.com
2024-10-20wifi: rtw89: sar: add supported UNII-4 frequency range along with UNII-3 of ↵Ping-Ke Shih2-4/+4
SAR subband The UNII-4 uses the same SAR value of UNII-3, so add UNII-4 frequency range and change the enum name to represent UNII-3 and UNII-4. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241009071619.16841-1-pkshih@realtek.com
2024-10-20wifi: rtw89: 8852c: use 'int' as return type of error code pwr_{on,off}_func()Ping-Ke Shih1-2/+2
The return type of error code of rtw8852c_pwr_{on,off}_func() and its callee is 'int'. Correct it. Addresses-Coverity-ID: 1626056 ("Overflowed constant") Addresses-Coverity-ID: 1627945 ("Overflowed constant") Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241009004300.8144-7-pkshih@realtek.com
2024-10-20wifi: rtw89: 8852bt: use 'int' as return type of error code pwr_{on,off}_func()Ping-Ke Shih1-2/+2
The return type of error code of rtw8852bt_pwr_{on,off}_func() and its callee is 'int'. Correct it. Addresses-Coverity-ID: 1630962 ("Overflowed constant") Addresses-Coverity-ID: 1632126 ("Overflowed constant") Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241009004300.8144-6-pkshih@realtek.com
2024-10-20wifi: rtw89: 8852b: use 'int' as return type of error code pwr_{on,off}_func()Ping-Ke Shih1-2/+2
The return type of error code of rtw8852b_pwr_{on,off}_func() and its callee is 'int'. Correct it. Addresses-Coverity-ID: 1622433 ("Overflowed constant") Addresses-Coverity-ID: 1630710 ("Overflowed constant") Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241009004300.8144-5-pkshih@realtek.com
2024-10-20wifi: rtw89: 8851b: use 'int' as return type of error code pwr_{on,off}_func()Ping-Ke Shih1-2/+2
The return type of error code of rtw8851b_pwr_{on,off}_func() and its callee is 'int'. Correct it. Addresses-Coverity-ID: 1624679 ("Overflowed constant") Addresses-Coverity-ID: 1630970 ("Overflowed constant") Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241009004300.8144-4-pkshih@realtek.com
2024-10-20wifi: rtw89: pci: use 'int' as return type of error code in ↵Ping-Ke Shih1-2/+4
poll_{tx,rx}dma_ch_idle() The return type of error code of read_poll_timeout() and rtw89_pci_poll_{tx,rx}dma_ch_idle_ax() and must be 'int'. Correct them accordingly. Addresses-Coverity-ID: 1622341 ("Overflowed constant") Addresses-Coverity-ID: 1627296 ("Overflowed constant") Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241009004300.8144-3-pkshih@realtek.com
2024-10-20wifi: rtw89: wow: cast nd_config->delay to u64 in tsf arithmeticPing-Ke Shih1-1/+1
The type of tsf arithmetic is u64 += u16 * int; When (u16 * int) is larger than 0x7FFFFFFF, the value casting to u64 with sign-extension will become all 1 in upper 32 bits part. To meet the case, u16 value should be larger than 20491 (0x7FFFFFFF / 104800). Fortunately the meaning of 20491 is delay time of WoWLAN net detection in unit of second, so 20491 seconds (5.7 hours) might not a real case we can meet. Addresses-Coverity-ID: 1620910 ("Unintended sign extension") Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241009004300.8144-2-pkshih@realtek.com
2024-10-17wifi: cw1200: Remove unused cw1200_queue_requeue_all()Dr. David Alan Gilbert2-28/+0
cw1200_queue_requeue_all() has been unused since it was added in 2013 by commit a910e4a94f69 ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets") Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241012203852.229151-1-linux@treblig.org
2024-10-17wifi: mwifiex: Fix memcpy() field-spanning write warning in ↵Alper Nebi Yasak1-1/+1
mwifiex_config_scan() Replace one-element array with a flexible-array member in `struct mwifiex_ie_types_wildcard_ssid_params` to fix the following warning on a MT8173 Chromebook (mt8173-elm-hana): [ 356.775250] ------------[ cut here ]------------ [ 356.784543] memcpy: detected field-spanning write (size 6) of single field "wildcard_ssid_tlv->ssid" at drivers/net/wireless/marvell/mwifiex/scan.c:904 (size 1) [ 356.813403] WARNING: CPU: 3 PID: 742 at drivers/net/wireless/marvell/mwifiex/scan.c:904 mwifiex_scan_networks+0x4fc/0xf28 [mwifiex] The "(size 6)" above is exactly the length of the SSID of the network this device was connected to. The source of the warning looks like: ssid_len = user_scan_in->ssid_list[i].ssid_len; [...] memcpy(wildcard_ssid_tlv->ssid, user_scan_in->ssid_list[i].ssid, ssid_len); There is a #define WILDCARD_SSID_TLV_MAX_SIZE that uses sizeof() on this struct, but it already didn't account for the size of the one-element array, so it doesn't need to be changed. Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver") Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Acked-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241007222301.24154-1-alpernebiyasak@gmail.com
2024-10-17wifi: brcmfmac: of: use devm_clk_get_optional_enabled_with_rate()Bartosz Golaszewski1-2/+1
Fold the separate clk_set_rate() call into the clock getter. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241007131639.98358-1-brgl@bgdev.pl
2024-10-17wifi: brcmsmac: Remove unused brcms_debugfs_get_devdir()Dr. David Alan Gilbert2-6/+0
brcms_debugfs_get_devdir() has been unused since it was added by commit 8e21df23894e ("brcmsmac: hardware info in debugfs") Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241004004259.470853-1-linux@treblig.org
2024-10-17wifi: brcmfmac: Remove unused brcmf_cfg80211_get_iftype()Dr. David Alan Gilbert2-8/+0
brcmf_cfg80211_get_iftype() has been unused since 2013's commit 5cd51c2bad56 ("brcmfmac: Find correct MAC descriptor in case of TDLS.") Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241004004252.470836-1-linux@treblig.org
2024-10-17wifi: wilc1000: Set MAC after operation modeMarek Vasut1-3/+3
It seems it is necessary to set WILC MAC address after operation mode, otherwise the MAC address of the WILC MAC is reset back to what is in nvmem. This causes a failure to associate with AP after the WILC MAC address was overridden by userspace. Test case: " ap$ cat << EOF > hostap.conf interface=wlan0 ssid=ssid hw_mode=g channel=6 wpa=2 wpa_passphrase=pass wpa_key_mgmt=WPA-PSK EOF ap$ hostapd -d hostap.conf ap$ ifconfig wlan0 10.0.0.1 " " sta$ ifconfig wlan0 hw ether 00:11:22:33:44:55 sta$ wpa_supplicant -i wlan0 -c <(wpa_passphrase ssid pass) sta$ ifconfig wlan0 10.0.0.2 sta$ ping 10.0.0.1 # fails without this patch " AP still indicates SA with original MAC address from nvmem without this patch: " nl80211: RX frame da=ff:ff:ff:ff:ff:ff sa=60:01:23:45:67:89 bssid=ff:ff:ff:ff:ff:ff ... ^^^^^^^^^^^^^^^^^ " Fixes: 83d9b54ee5d4 ("wifi: wilc1000: read MAC address from fuse at probe") Tested-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241003132504.52233-1-marex@denx.de
2024-10-17wifi: mwifiex: cleanup struct mwifiex_privateDmitry Antipov4-18/+3
Remove set but otherwise unused 'adhoc_is_link_sensed' and 'assoc_resp_ht_param' members of 'struct mwifiex_private' and simplify related code in 'mwifiex_ret_802_11_associate()'. Compile tested only. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20240927084317.96687-2-dmantipov@yandex.ru
2024-10-17wifi: mwifiex: cleanup struct mwifiex_auto_tdls_peerDmitry Antipov2-3/+0
Remove set but otherwise unused 'do_setup' member of 'struct mwifiex_auto_tdls_peer'. Compile tested only. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20240927084317.96687-1-dmantipov@yandex.ru
2024-10-17wifi: wilc1000: Add WILC3000 supportAjay Singh6-63/+299
Add support for the WILC3000 chip. The chip is similar to WILC1000, except that the register layout is slightly different and it does not support WPA3/SAE. Reviewed-by: Alexis Lothoré <alexis.lothore@bootlin.com> Tested-by: Alexis Lothoré <alexis.lothore@bootlin.com> Tested-on: WILC1000SD 07 SDIO WILC_WIFI_FW_REL_16_1_2 Tested-on: WILC1000SD 07 SPI WILC_WIFI_FW_REL_16_1_2 Tested-on: WILC3000 A SDIO WILC_WIFI_FW_REL_16_1_1 Tested-on: WILC3000 A SPI WILC_WIFI_FW_REL_16_1_1 Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241004114551.40236-7-marex@denx.de
2024-10-17wifi: wilc1000: Register wiphy after reading out chipidMarek Vasut4-8/+17
Register wiphy after reading out chipid, so the chipid can be used to determine chip features and not advertise WPA3/SAE support to userspace on WILC3000. Note that wilc_netdev_cleanup() will deregister the wiphy in fail path. Tested-by: Alexis Lothoré <alexis.lothore@bootlin.com> Tested-on: WILC1000SD 07 SDIO WILC_WIFI_FW_REL_16_1_2 Tested-on: WILC3000 A SDIO WILC_WIFI_FW_REL_16_1_1 Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241004114551.40236-6-marex@denx.de
2024-10-17wifi: wilc1000: Fold wilc_create_wiphy() into cfg80211.cMarek Vasut2-48/+47
The wilc_create_wiphy() is not used outside of cfg80211.c . Make the function static and remove its entry from cfg80211.h Reviewed-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241004114551.40236-5-marex@denx.de
2024-10-17wifi: wilc1000: Fill in missing error handlingMarek Vasut3-51/+118
Add error handling to chip_wakeup() and propagate the errors throughout the entire driver. Add error handling to acquire_bus()/release_bus() and host_sleep_notify()/host_wakeup_notify() functions as a result as well. Fill the error handling to all call sites. Reviewed-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241004114551.40236-4-marex@denx.de
2024-10-17wifi: wilc1000: Fold chip_allow_sleep()/chip_wakeup() into wlan.cMarek Vasut2-26/+23
Neither chip_allow_sleep()/chip_wakeup() is used outside of wlan.c . Make both functions static and remove both the exported symbol and entries from wlan.h . Make chip_allow_sleep() return error code in preparation for the follow up patches. Move acquire_bus() and release_bus() to avoid forward declaration of chip_allow_sleep()/chip_wakeup(). Reviewed-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241004114551.40236-3-marex@denx.de
2024-10-17wifi: wilc1000: Clean up usage of wilc_get_chipid()Marek Vasut5-49/+53
Reduce the use of wilc_get_chipid(), use cached chip ID wherever possible. Remove duplicated partial chip ID read implementations from the driver. Update wilc_get_chipid() to always read the chip ID out of the hardware and update the cached chip ID, and make it return a proper return value instead of a chipid. Call wilc_get_chipid() early to make the cached chip ID available to various sites using is_wilc1000() to access the cached chip ID. Reviewed-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241004114551.40236-2-marex@denx.de
2024-10-17dt-bindings: wireless: wilc1000: Document WILC3000 compatible stringMarek Vasut1-1/+5
Document compatible string for the WILC3000 chip. The chip is similar to WILC1000, except that the register layout is slightly different and it does not support WPA3/SAE. Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241004114551.40236-1-marex@denx.de
2024-10-17wifi: wilc1000: Keep slot powered on during suspend/resumeMarek Vasut1-8/+1
The WILC3000 can suspend and enter low power state. According to local measurements, the WILC3000 consumes the same amount of power if the slot is powered up and WILC3000 is suspended, and if the WILC3000 is powered off. Use the former option, keep the WILC3000 powered up as that allows for things like WoWlan to work. Note that this is tested on WILC3000 only, not on WILC1000 . Signed-off-by: Marek Vasut <marex@denx.de> Tested-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20240926195113.2823392-1-marex@denx.de
2024-10-17wifi: rt2x00: convert comma to semicolonYan Zhen1-1/+1
To ensure code clarity and prevent potential errors, it's advisable to employ the ';' as a statement separator, except when ',' are intentionally used for specific purposes. Signed-off-by: Yan Zhen <yanzhen@vivo.com> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20240920025917.1959932-1-yanzhen@vivo.com
2024-10-17wifi: mwifiex: add missing locking for cfg80211 callsSascha Hauer2-0/+4
cfg80211_rx_assoc_resp() and cfg80211_rx_mlme_mgmt() need to be called with the wiphy locked, so lock it before calling these functions. Fixes: 36995892c271 ("wifi: mwifiex: add host mlme for client mode") Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20240918-mwifiex-cleanup-1-v2-1-2d0597187d3c@pengutronix.de
2024-10-17wifi: ipw: select CRYPTO_LIB_ARC4Johannes Berg1-0/+1
With the WEP/TKIP code having moved to libipw, it now needs to select CRYPTO_LIB_ARC4 to have the dependency, and I forgot to move that. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202410111727.FxATs8Yj-lkp@intel.com/ Fixes: 02f220b52670 ("wifi: ipw2x00/lib80211: move remaining lib80211 into libipw") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241011115820.070c468b271d.Iac76e81b5cd9a5b949b8c154381128e8131d581d@changeid
2024-10-10wifi: rtw89: wow: do not configure CPU IO to receive packets for old firmwareChin-Yen Lee3-0/+9
The older firmware of 8852A and 8852B can't receive packets via CPU IO function and will lead to WoWLAN fail if calling it. So use firmware feature to distinguish. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241004065408.10261-1-pkshih@realtek.com
2024-10-10wifi: rtw89: coex: Add function to reorder Wi-Fi firmware report indexChing-Te Ku2-13/+76
To parsing firmware report correctly, driver need to re-order the report index to match with different chips and different Wi-Fi firmware version. Use wrong index to parse the report will lead the coexistence run into wrong mechanism. Signed-off-by: Ching-Te Ku <ku920601@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241003105140.10867-5-pkshih@realtek.com
2024-10-10wifi: rtw89: coex: Solved BT PAN profile idle decrease Wi-Fi throughputChing-Te Ku1-1/+10
Some Bluetooth device will make up connection as PAN link, though the connection is idle, it will still report the PAN link is active. The coexistence mechanism will enable TDMA to protect the PAN, it makes Wi-Fi throughput degrade at least 50%. But the link is idle, don't need so much bandwidth. Add TDMA case to let Wi-Fi can do traffic 80% bandwidth. Signed-off-by: Ching-Te Ku <ku920601@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241003105140.10867-4-pkshih@realtek.com
2024-10-10wifi: rtw89: coex: Reorder Bluetooth info related logicChing-Te Ku2-33/+43
Reorder Bluetooth firmware related event index, it should be the same with Wi-Fi firmware definition. To fix coexistence can not recognize Bluetooth PAN(Personal area network) profile correctly, modified the related logic. Signed-off-by: Ching-Te Ku <ku920601@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241003105140.10867-3-pkshih@realtek.com