Miaoqing Pan [Thu, 23 Jan 2025 08:02:26 +0000 (16:02 +0800)]
wifi: ath12k: fix memory leak in ath12k_pci_remove()
Kmemleak reported this error:
unreferenced object 0xffff1c165cec3060 (size 32):
comm "insmod", pid 560, jiffies
4296964570 (age 235.596s)
backtrace:
[<
000000005434db68>] __kmem_cache_alloc_node+0x1f4/0x2c0
[<
000000001203b155>] kmalloc_trace+0x40/0x88
[<
0000000028adc9c8>] _request_firmware+0xb8/0x608
[<
00000000cad1aef7>] firmware_request_nowarn+0x50/0x80
[<
000000005011a682>] local_pci_probe+0x48/0xd0
[<
00000000077cd295>] pci_device_probe+0xb4/0x200
[<
0000000087184c94>] really_probe+0x150/0x2c0
The firmware memory was allocated in ath12k_pci_probe(), but not
freed in ath12k_pci_remove() in case ATH12K_FLAG_QMI_FAIL bit is
set. So call ath12k_fw_unmap() to free the memory.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.2.0-02280-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1
Signed-off-by: Miaoqing Pan <quic_miaoqing@quicinc.com>
Reviewed-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Link: https://patch.msgid.link/20250123080226.1116479-1-quic_miaoqing@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Sathishkumar Muruganandam [Tue, 7 Jan 2025 04:01:39 +0000 (09:31 +0530)]
wifi: ath12k: encode max Tx power in scan channel list command
Currently, when sending the scan channel list command to the firmware, the
maximum Tx power is not encoded in the reg2 member. This omission causes
the firmware to be unaware of the host's maximum Tx power, leading to
incorrect Tx power derivation at firmware level.
To resolve this issue, encode the maximum Tx power in the scan channel list
command before sending it to firmware.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Fixes:
d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Sathishkumar Muruganandam <quic_murugana@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Tested-by: Nicolas Escande <nico.escande@gmail.com>
Link: https://patch.msgid.link/20250107-add_max_reg_pwr_in_scan_ch_list_cmd-v1-1-70d9963a21e4@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Miaoqing Pan [Thu, 23 Jan 2025 08:49:48 +0000 (16:49 +0800)]
wifi: ath11k: fix memory leak in ath11k_xxx_remove()
The firmware memory was allocated in ath11k_pci_probe() or
ath11k_ahb_probe(), but not freed in ath11k_xxx_remove() in case
ATH11K_FLAG_QMI_FAIL bit is set. So call ath11k_fw_destroy() to
free the memory.
Found while fixing the same problem in ath12k:
https://lore.kernel.org/linux-wireless/
20240314012746.
2729101-1-quic_miaoqing@quicinc.com
Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-04546-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1
Signed-off-by: Miaoqing Pan <quic_miaoqing@quicinc.com>
Reviewed-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Link: https://patch.msgid.link/20250123084948.1124357-1-quic_miaoqing@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Lingbo Kong [Wed, 15 Jan 2025 06:35:37 +0000 (14:35 +0800)]
wifi: ath12k: report station mode signal strength
Currently, the signal strength of "iw dev xxx station dump" always show an
invalid value.
This is because signal strength is only set in ath12k_mgmt_rx_event()
function, and not set for received data packet. So, change to get signal
from firmware and report to mac80211.
After that, "iw dev xxx station dump" show the correct signal strength.
Such as:
Station 00:03:7f:12:03:03 (on wlo1)
inactive time: 36 ms
rx bytes: 61571
rx packets: 336
tx bytes: 28204
tx packets: 205
tx retries: 49
tx failed: 0
beacon loss: 0
beacon rx: 83
rx drop misc: 66
signal: -24 dBm
beacon signal avg: -22 dBm
For WCN7850, the firmware supports db2dbm, so not need to add noise floor.
For QCN9274, the firmware not support db2dbm, so need to add noise floor.
This patch affects the station mode of WCN7850 and QCN9274.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1
Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
Link: https://patch.msgid.link/20250115063537.35797-4-quic_lingbok@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Lingbo Kong [Wed, 15 Jan 2025 06:35:36 +0000 (14:35 +0800)]
wifi: ath12k: report station mode receive rate for IEEE 802.11be
Currently, the receive rate of EHT of "iw dev xxx station dump" command
always show an invalid value.
This is because ath12k does not pass information about the rx_status of EHT
to mac80211. So, mac80211 not calculate the receive rate.
To address this issue, add logic for handling rx_status of EHT to the
ath12k_dp_rx_h_rate() function.
After that, "iw dev xxx station dump" show the correct receive rate.
Such as:
Station 00:03:7f:12:03:03 (on wlo1)
inactive time: 48 ms
rx bytes: 59226
rx packets: 320
tx bytes: 26556
tx packets: 191
tx retries: 99
tx failed: 0
beacon loss: 0
beacon rx: 79
rx drop misc: 68
signal: -95 dBm
beacon signal avg: -20 dBm
tx bitrate: 688.2 MBit/s 40MHz EHT-MCS 13 EHT-NSS 2 EHT-GI 0
tx duration: 0 us
rx bitrate: 619.5 MBit/s 40MHz EHT-MCS 8 EHT-NSS 3 EHT-GI 0
This patch affects the station mode of WCN7850 and QCN9274.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1
Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219715
Link: https://patch.msgid.link/20250115063537.35797-3-quic_lingbok@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Lingbo Kong [Wed, 15 Jan 2025 06:35:35 +0000 (14:35 +0800)]
wifi: ath12k: report station mode transmit rate
Currently, the transmit rate of "iw dev xxx station dump" command
always show an invalid value.
To address this issue, ath12k parse the info of transmit complete
report from firmware and indicate the transmit rate to mac80211.
This patch affects the station mode of WCN7850 and QCN9274.
After that, "iw dev xxx station dump" show the correct transmit rate.
Such as:
Station 00:03:7f:12:03:03 (on wlo1)
inactive time: 872 ms
rx bytes: 219111
rx packets: 1133
tx bytes: 53767
tx packets: 462
tx retries: 51
tx failed: 0
beacon loss: 0
beacon rx: 403
rx drop misc: 74
signal: -95 dBm
beacon signal avg: -18 dBm
tx bitrate: 1441.1 MBit/s 80MHz EHT-MCS 13 EHT-NSS 2 EHT-GI 0
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1
Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219715
Link: https://patch.msgid.link/20250115063537.35797-2-quic_lingbok@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Nicolas Escande [Wed, 22 Jan 2025 16:01:12 +0000 (17:01 +0100)]
wifi: ath12k: fix skb_ext_desc leak in ath12k_dp_tx() error path
When vlan support was added, we missed that when
ath12k_dp_prepare_htt_metadata() returns an error we also need to free
the skb holding the metadata before going on with the cleanup process.
Compile tested only.
Fixes:
26dd8ccdba4d ("wifi: ath12k: dynamic VLAN support")
Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
Reviewed-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Link: https://patch.msgid.link/20250122160112.3234558-1-nico.escande@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Aaradhana Sahu [Sun, 19 Jan 2025 08:36:57 +0000 (14:06 +0530)]
wifi: ath12k: Disable MLO in Factory Test Mode
Factory test mode(FTM) is supported only in non-MLO(multi-link operation)
mode. Therefore, disable MLO when driver boots in FTM mode.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Reviewed-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://patch.msgid.link/20250119083657.1937557-5-quic_aarasahu@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Aaradhana Sahu [Sun, 19 Jan 2025 08:36:56 +0000 (14:06 +0530)]
wifi: ath12k: add factory test mode support
Add support to process factory test mode commands(FTM) for calibration.
By default firmware start with MISSION mode and to process the FTM commands
firmware needs to be restarted in FTM mode using module parameter ftm_mode.
The pre-request is all the radios should be down before starting the test.
All ath12k test mode interface related commands specified in enum
ath_tm_cmd.
When start command ATH_TM_CMD_TESTMODE_START is received, ar state
is set to test Mode and FTM daemon sends test mode command to wifi
driver via cfg80211. Wifi driver sends these command to firmware as
wmi events. If it is segmented commands it will be broken down into
multiple segments and encoded with TLV header else it is sent to
firmware as it is.
Firmware response via UTF events, wifi driver creates skb and send
to cfg80211, cfg80211 sends firmware response to FTM daemon via
netlink message.
Command to boot in ftm mode
insmod ath12k ftm_mode=1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Reviewed-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://patch.msgid.link/20250119083657.1937557-4-quic_aarasahu@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Aaradhana Sahu [Sun, 19 Jan 2025 08:36:55 +0000 (14:06 +0530)]
wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
Export ath12k_wmi_tlv_hdr() to further use in the testmode command
processing.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Reviewed-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://patch.msgid.link/20250119083657.1937557-3-quic_aarasahu@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Aaradhana Sahu [Sun, 19 Jan 2025 08:36:54 +0000 (14:06 +0530)]
wifi: ath: create common testmode_i.h file for ath drivers
User space application requires that the testmode interface
is exactly same between ath drivers. Move testmode_i.h file
in ath directory to ensure that all ath driver uses same testmode
interface instead of duplicating testmode_i.h for each ath drivers.
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Reviewed-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://patch.msgid.link/20250119083657.1937557-2-quic_aarasahu@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
P Praneesh [Sun, 19 Jan 2025 16:42:19 +0000 (22:12 +0530)]
wifi: ath11k: Use dma_alloc_noncoherent for rx_tid buffer allocation
Currently, the driver allocates cacheable DMA buffers for the rx_tid
structure using kzalloc() and dma_map_single(). These buffers are
long-lived and can persist for the lifetime of the peer, which is not
advisable. Instead of using kzalloc() and dma_map_single() for allocating
cacheable DMA buffers, utilize the dma_alloc_noncoherent() helper for the
allocation of long-lived cacheable DMA buffers, such as the peer's rx_tid.
Since dma_alloc_noncoherent() returns unaligned physical and virtual
addresses, align them internally before use within the driver. This
ensures proper allocation of non-coherent memory through the kernel
helper.
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
Tested-by: Tim Harvey <tharvey@gateworks.com>
Link: https://patch.msgid.link/20250119164219.647059-3-quic_ppranees@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
P Praneesh [Sun, 19 Jan 2025 16:42:18 +0000 (22:12 +0530)]
wifi: ath11k: Fix DMA buffer allocation to resolve SWIOTLB issues
Currently, the driver allocates cacheable DMA buffers for rings like
HAL_REO_DST and HAL_WBM2SW_RELEASE. The buffers for HAL_WBM2SW_RELEASE
are large (1024 KiB), exceeding the SWIOTLB slot size of 256 KiB. This
leads to "swiotlb buffer is full" error messages on systems without an
IOMMU that use SWIOTLB, causing driver initialization failures. The driver
calls dma_map_single() with these large buffers obtained from kzalloc(),
resulting in ring initialization errors on systems without an IOMMU that
use SWIOTLB.
To address these issues, replace the flawed buffer allocation mechanism
with the appropriate DMA API. Specifically, use dma_alloc_noncoherent()
for cacheable DMA buffers, ensuring proper freeing of buffers with
dma_free_noncoherent().
Error log:
[ 10.194343] ath11k_pci 0000:04:00.0: swiotlb buffer is full (sz:
1048583 bytes), total 32768 (slots), used 2529 (slots)
[ 10.194406] ath11k_pci 0000:04:00.0: failed to set up tcl_comp ring (0) :-12
[ 10.194781] ath11k_pci 0000:04:00.0: failed to init DP: -12
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
Reported-by: Tim Harvey <tharvey@gateworks.com>
Closes: https://lore.kernel.org/all/
20241210041133.GA17116@lst.de/
Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
Tested-by: Tim Harvey <tharvey@gateworks.com>
Link: https://patch.msgid.link/20250119164219.647059-2-quic_ppranees@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Karthikeyan Periyasamy [Tue, 24 Dec 2024 14:36:13 +0000 (20:06 +0530)]
wifi: ath12k: Refactor Rx status TLV parsing procedure argument
Currently, ath12k_dp_mon_rx_parse_status_tlv() takes the TLV tag, TLV data
and TLV userid as separate arguments from the caller. In the future, the
TLV length will be needed for parsing the EHT TLV tag. Therefore, instead
of increasing the number of arguments, pass the TLV header and retrieve the
necessary fields from the TLV header itself.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20241224143613.164921-4-quic_periyasa@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Karthikeyan Periyasamy [Tue, 24 Dec 2024 14:36:12 +0000 (20:06 +0530)]
wifi: ath12k: Refactor the monitor Tx/RX handler procedure arguments
Currently, the pdev handle is given along with the mac id to all the
monitor Tx/Rx handler procedure arguments. The mac id information is
derived from the pdev handle itself. Therefore, remove the unnecessary
mac id argument from the handler.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20241224143613.164921-3-quic_periyasa@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Karthikeyan Periyasamy [Tue, 24 Dec 2024 14:36:11 +0000 (20:06 +0530)]
wifi: ath12k: Refactor the monitor Rx parser handler argument
Currently, the monitor Rx parser handlers
ath12k_dp_mon_rx_parse_status_tlv() and ath12k_dp_mon_parse_rx_dest()
take the device handle from the caller. However, these handlers
functionality is technically pdev specific. Additionally, the device handle
can be retrieved from the pdev handle. Therefore, for better code
understanding, change the monitor Rx parser handlers argument from the
device handle to the pdev handle.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20241224143613.164921-2-quic_periyasa@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Dmitry Antipov [Wed, 15 Jan 2025 17:17:50 +0000 (20:17 +0300)]
wifi: ath9k: use unsigned long for activity check timestamp
Since 'rx_active_check_time' of 'struct ath_softc' is in jiffies,
prefer 'unsigned long' over 'u32' to avoid possible truncation in
'ath_hw_rx_inactive_check()'. Found with clang's -Wshorten-64-to-32,
compile tested only.
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/20250115171750.259917-2-dmantipov@yandex.ru
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Dmitry Antipov [Wed, 15 Jan 2025 17:17:49 +0000 (20:17 +0300)]
wifi: ath9k: cleanup struct ath_tx_control and ath_tx_prepare()
After switching to mac80211 software queues, pointer to 'struct ath_node'
in 'struct ath_tx_control' is still assigned but not actually used. So drop
it and cleanup related things in 'ath_tx_prepare()'. Compile tested only.
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/20250115171750.259917-1-dmantipov@yandex.ru
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Marcel Hamer [Thu, 16 Jan 2025 13:22:40 +0000 (14:22 +0100)]
wifi: brcmfmac: fix NULL pointer dereference in brcmf_txfinalize()
On removal of the device or unloading of the kernel module a potential NULL
pointer dereference occurs.
The following sequence deletes the interface:
brcmf_detach()
brcmf_remove_interface()
brcmf_del_if()
Inside the brcmf_del_if() function the drvr->if2bss[ifidx] is updated to
BRCMF_BSSIDX_INVALID (-1) if the bsscfgidx matches.
After brcmf_remove_interface() call the brcmf_proto_detach() function is
called providing the following sequence:
brcmf_detach()
brcmf_proto_detach()
brcmf_proto_msgbuf_detach()
brcmf_flowring_detach()
brcmf_msgbuf_delete_flowring()
brcmf_msgbuf_remove_flowring()
brcmf_flowring_delete()
brcmf_get_ifp()
brcmf_txfinalize()
Since brcmf_get_ip() can and actually will return NULL in this case the
call to brcmf_txfinalize() will result in a NULL pointer dereference inside
brcmf_txfinalize() when trying to update ifp->ndev->stats.tx_errors.
This will only happen if a flowring still has an skb.
Although the NULL pointer dereference has only been seen when trying to
update the tx statistic, all other uses of the ifp pointer have been
guarded as well with an early return if ifp is NULL.
Cc: stable@vger.kernel.org
Signed-off-by: Marcel Hamer <marcel.hamer@windriver.com>
Link: https://lore.kernel.org/all/b519e746-ddfd-421f-d897-7620d229e4b2@gmail.com/
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20250116132240.731039-1-marcel.hamer@windriver.com
Ping-Ke Shih [Thu, 16 Jan 2025 12:04:24 +0000 (20:04 +0800)]
wifi: rtw88: add RTW88_LEDS depends on LEDS_CLASS to Kconfig
When using allmodconfig, .config has CONFIG_LEDS_CLASS=m but
autoconf.h has CONFIG_LEDS_CLASS_MODULE (additional suffix _MODULE)
instead of CONFIG_LEDS_CLASS, which condition CONFIG_LEDS_CLASS in
rtw88/led.h can't work properly.
Add RTW88_LEDS to Kconfig, and use it as condition to fix this problem.
drivers/net/wireless/realtek/rtw88/led.c:19:6: error: redefinition of 'rtw_led_init'
19 | void rtw_led_init(struct rtw_dev *rtwdev)
| ^~~~~~~~~~~~
In file included from drivers/net/wireless/realtek/rtw88/led.c:7:
drivers/net/wireless/realtek/rtw88/led.h:15:20: note: previous definition of 'rtw_led_init' with type 'void(struct rtw_dev *)'
15 | static inline void rtw_led_init(struct rtw_dev *rtwdev)
| ^~~~~~~~~~~~
drivers/net/wireless/realtek/rtw88/led.c:64:6: error: redefinition of 'rtw_led_deinit'
64 | void rtw_led_deinit(struct rtw_dev *rtwdev)
| ^~~~~~~~~~~~~~
drivers/net/wireless/realtek/rtw88/led.h:19:20: note: previous definition of 'rtw_led_deinit' with type 'void(struct rtw_dev *)'
19 | static inline void rtw_led_deinit(struct rtw_dev *rtwdev)
| ^~~~~~~~~~~~~~
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/linux-wireless/
e19a87ad9cd54bfa9907f3a043b25d30@realtek.com/T/#me407832de1040ce22e53517bcb18e322ad0e2260
Fixes:
4b6652bc6d8d ("wifi: rtw88: Add support for LED blinking")
Cc: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20250116120424.13174-1-pkshih@realtek.com
Kalle Valo [Wed, 15 Jan 2025 16:51:56 +0000 (18:51 +0200)]
Merge tag 'ath-next-
20250114' of git://git./linux/kernel/git/ath/ath
ath.git patches for v6.14
This development cycle again featured multiple patchsets to ath12k to
support the new 802.11be MLO feature, this time including the device
grouping infrastructure, and the advertisement of MLO support to the
wireless core. However the MLO feature is still considered to be
incomplete.
In addition, there was the usual set of bug fixes and cleanups, mostly
in ath12k, but also in ath9k.
Alexis Lothoré [Tue, 14 Jan 2025 10:45:34 +0000 (11:45 +0100)]
wifi: wilc1000: unregister wiphy only after netdev registration
wiphy_unregister()/wiphy_free() has been recently decoupled from
wilc_netdev_cleanup() to fix a faulty error path in sdio/spi probe
functions. However this change introduced a new failure when simply
loading then unloading the driver:
$ modprobe wilc1000-sdio; modprobe -r wilc1000-sdio
WARNING: CPU: 0 PID: 115 at net/wireless/core.c:1145 wiphy_unregister+0x904/0xc40 [cfg80211]
Modules linked in: wilc1000_sdio(-) wilc1000 cfg80211 bluetooth ecdh_generic ecc
CPU: 0 UID: 0 PID: 115 Comm: modprobe Not tainted 6.13.0-rc6+ #45
Hardware name: Atmel SAMA5
Call trace:
unwind_backtrace from show_stack+0x18/0x1c
show_stack from dump_stack_lvl+0x44/0x70
dump_stack_lvl from __warn+0x118/0x27c
__warn from warn_slowpath_fmt+0xcc/0x140
warn_slowpath_fmt from wiphy_unregister+0x904/0xc40 [cfg80211]
wiphy_unregister [cfg80211] from wilc_sdio_remove+0xb0/0x15c [wilc1000_sdio]
wilc_sdio_remove [wilc1000_sdio] from sdio_bus_remove+0x104/0x3f0
sdio_bus_remove from device_release_driver_internal+0x424/0x5dc
device_release_driver_internal from driver_detach+0x120/0x224
driver_detach from bus_remove_driver+0x17c/0x314
bus_remove_driver from sys_delete_module+0x310/0x46c
sys_delete_module from ret_fast_syscall+0x0/0x1c
Exception stack(0xd0acbfa8 to 0xd0acbff0)
bfa0:
0044b210 0044b210 0044b24c 00000800 00000000 00000000
bfc0:
0044b210 0044b210 00000000 00000081 00000000 0044b210 00000000 00000000
bfe0:
00448e24 b6af99c4 0043ea0d aea2e12c
irq event stamp: 0
hardirqs last enabled at (0): [<
00000000>] 0x0
hardirqs last disabled at (0): [<
c01588f0>] copy_process+0x1c4c/0x7bec
softirqs last enabled at (0): [<
c0158944>] copy_process+0x1ca0/0x7bec
softirqs last disabled at (0): [<
00000000>] 0x0
The warning is triggered by the fact that there is still a
wireless_device linked to the wiphy we are unregistering, due to
wiphy_unregister() now being called after net device unregister (performed
in wilc_netdev_cleanup()). Fix this warning by moving wiphy_unregister()
after wilc_netdev_cleanup() is nominal paths (ie: driver removal).
wilc_netdev_cleanup() ordering is left untouched in error paths in probe
function because net device is not registered in those paths (so the
warning can not trigger), yet the wiphy can still be registered, and we
still some cleanup steps from wilc_netdev_cleanup().
Fixes:
1be94490b6b8 ("wifi: wilc1000: unregister wiphy only if it has been registered")
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20250114-wilc1000_modprobe-v1-1-ad19d46f0c07@bootlin.com
Kalle Valo [Wed, 15 Jan 2025 15:21:32 +0000 (17:21 +0200)]
Merge tag 'mt76-for-kvalo-2025-01-14' of https://github.com/nbd168/wireless
mt76 patches for 6.14
- mlo fixes for mt792x
- single wiphy multiband support for mt7996
- mt7915 stability fixes
Kalle Valo [Wed, 15 Jan 2025 15:20:10 +0000 (17:20 +0200)]
Merge tag 'rtw-next-2025-01-12' of https://github.com/pkshih/rtw
rtw-next patches for v6.14
rtl8xxxu, rtlwifi and rtw88 fix field issues reported by users.
rtw89 is ongoing to implement MLO and fix issues during the development.
Major changes:
rtw88:
- support LED blinking
rtw89:
- support RTL8922AE-VS chip
Dmitry Antipov [Mon, 13 Jan 2025 15:54:17 +0000 (18:54 +0300)]
wifi: cfg80211: adjust allocation of colocated AP data
In 'cfg80211_scan_6ghz()', an instances of 'struct cfg80211_colocated_ap'
are allocated as if they would have 'ssid' as trailing VLA member. Since
this is not so, extra IEEE80211_MAX_SSID_LEN bytes are not needed.
Briefly tested with KUnit.
Fixes:
c8cb5b854b40 ("nl80211/cfg80211: support 6 GHz scanning")
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://patch.msgid.link/20250113155417.552587-1-dmantipov@yandex.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Dan Carpenter [Wed, 15 Jan 2025 06:54:52 +0000 (09:54 +0300)]
wifi: mac80211: fix memory leak in ieee80211_mgd_assoc_ml_reconf()
Free the "data" allocation before returning on this error path.
Fixes:
36e05b0b8390 ("wifi: mac80211: Support dynamic link addition and removal")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/7ad826a7-7651-48e7-9589-7d2dc17417c2@stanley.mountain
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Aditya Kumar Singh [Sun, 12 Jan 2025 05:53:00 +0000 (11:23 +0530)]
wifi: ath12k: fix key cache handling
Currently, an interface is created in the driver during channel assignment.
If mac80211 attempts to set a key for an interface before this assignment,
the driver caches the key. Once the interface is created, the driver
installs the cached key to the hardware. This sequence is exemplified in
mesh mode operation where the group key is set before channel assignment.
However, in ath12k_mac_update_key_cache(), after caching the key, due to
incorrect logic, it is deleted from the cache during the subsequent loop
iteration. As a result, after the interface is created, the driver does not
find any cached key, and the key is not installed to the hardware which is
wrong. This leads to issue in mesh, where broadcast traffic is not
encrypted over the air.
Fix this issue by adjusting the logic of ath12k_mac_update_key_cache()
properly.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3-03253.1-QCAHKSWPL_SILICONZ-29 # Nicolas Escande <nico.escande@gmail.com>
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 # Nicolas Escande <nico.escande@gmail.com>
Fixes:
25e18b9d6b4b ("wifi: ath12k: modify ath12k_mac_op_set_key() for MLO")
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
Tested-by: Nicolas Escande <nico.escande@gmail.com>
Link: https://patch.msgid.link/20250112-fix_key_cache_handling-v2-1-70e142c6153e@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Karthikeyan Periyasamy [Sun, 12 Jan 2025 07:16:30 +0000 (12:46 +0530)]
wifi: ath12k: Fix uninitialized variable access in ath12k_mac_allocate() function
Currently, the uninitialized variable 'ab' is accessed in the
ath12k_mac_allocate() function. Initialize 'ab' with the first radio device
present in the hardware abstraction handle (ah). Additionally, move the
default setting procedure from the pdev mapping iteration to the total
radio calculating iteration for better code readability. Perform the
maximum radio validation check for total_radio to ensure that both num_hw
and radio_per_hw are validated indirectly, as these variables are derived
from total_radio. This also fixes the below Smatch static checker warning.
Smatch warning:
ath12k_mac_allocate() error: uninitialized symbol 'ab'
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Fixes:
a343d97f27f5 ("wifi: ath12k: move struct ath12k_hw from per device to group")
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20250112071630.4059410-5-quic_periyasa@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Karthikeyan Periyasamy [Sun, 12 Jan 2025 07:16:29 +0000 (12:46 +0530)]
wifi: ath12k: Remove ath12k_get_num_hw() helper function
Currently, the ath12k_get_num_hw() helper function takes the device handle
as an argument. Here, the number of hardware is retrieved from the group
handle. Demanding the device handle from the caller is unnecessary since
in some cases the group handle is already available. Additionally, there
is no longer a need for multiple indirections to get the number of
hardware. Therefore, remove this helper function and directly use
ag->num_hw. This change also fixes the below Smatch static checker
warning.
Smatch warning:
ath12k_mac_destroy() error: we previously assumed 'ab' could be null
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/ath12k/
3e705de0-67d1-4437-97ff-
4828d83ae2af@stanley.mountain/
Closes: https://scan7.scan.coverity.com/#/project-view/52682/11354?selectedIssue=
1602340
Fixes:
a343d97f27f5 ("wifi: ath12k: move struct ath12k_hw from per device to group")
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
Acked-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Link: https://patch.msgid.link/20250112071630.4059410-4-quic_periyasa@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Karthikeyan Periyasamy [Sun, 12 Jan 2025 07:16:28 +0000 (12:46 +0530)]
wifi: ath12k: Refactor the ath12k_hw get helper function argument
Currently, ath12k_hw is placed inside the ath12k_hw_group. However, the
ath12k_hw get helper function takes the device handle and the index as
parameters. Here, the index parameter is specific to the group handle.
Therefore, change this helper function argument from the device handle
to the group handle.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20250112071630.4059410-3-quic_periyasa@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Karthikeyan Periyasamy [Sun, 12 Jan 2025 07:16:27 +0000 (12:46 +0530)]
wifi: ath12k: Refactor ath12k_hw set helper function argument
Currently, ath12k_hw is placed inside the ath12k_hw_group. However, the
ath12k_hw set helper function takes the device handle and the index as
parameters. Here, the index parameter is specific to the group handle.
Therefore, change this helper function argument from the device handle to
the group handle.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20250112071630.4059410-2-quic_periyasa@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Howard Hsu [Tue, 14 Jan 2025 10:10:26 +0000 (18:10 +0800)]
wifi: mt76: mt7996: add implicit beamforming support for mt7992
The configuration of mt7992 iBF has some differences to mt7996, rework
related code to make it work.
Also, most of our chipsets support iBF only on HT and VHT mode, except
mt7992 variant that has 5T on 5GHz band also supports iBF on HE and EHT
mode.
Co-developed-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Link: https://patch.msgid.link/20250114101026.3587702-9-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Michael-CY Lee [Tue, 14 Jan 2025 10:10:25 +0000 (18:10 +0800)]
wifi: mt76: mt7996: fix beacon command during disabling
When stopping AP, mac80211 frees beacon template before it calls
driver's stop_ap operation. In other words, on the path of stopping
AP, ieee80211_beacon_get_template() must returns NULL in
mt7996_mcu_add_beacon(). In such case mt7996 immediately returns
-EINVAL without telling FW to disable the beacon.
This commit refactors mt7996_mcu_add_beacon() so that FW can be
correctly informed when disabling AP interface.
Co-developed-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
Link: https://patch.msgid.link/20250114101026.3587702-8-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Peter Chiu [Tue, 14 Jan 2025 10:10:24 +0000 (18:10 +0800)]
wifi: mt76: mt7996: fix ldpc setting
The non-AP interfaces would not use conf->vht_ldpc so they never set
STA_CAP_VHT_LDPC even if peer-station support LDPC.
Check conf->vht_ldpc only for AP interface.
Without this patch, station only uses BCC to transmit packet in VHT mode.
Fixes:
dda423dd65c3 ("wifi: mt76: mt7996: remove mt7996_mcu_beacon_check_caps()")
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20250114101026.3587702-7-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Benjamin Lin [Tue, 14 Jan 2025 10:10:23 +0000 (18:10 +0800)]
wifi: mt76: mt7996: fix definition of tx descriptor
For mt7992 chipsets, the definition of TXD.DW6.BIT10~15 has different
interpretations on different frame types. Driver only needs to fill
MSDU_CNT for non-management frames.
Fixes:
408566db8cad ("wifi: mt76: connac: add new definition of tx descriptor")
Co-developed-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Link: https://patch.msgid.link/20250114101026.3587702-6-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Howard Hsu [Tue, 14 Jan 2025 10:10:22 +0000 (18:10 +0800)]
wifi: mt76: connac: adjust phy capabilities based on band constraints
Adjust HE and EHT phy capabilities based on the band constraints.
For 2g band, we shall not enable the capabilities above 40MHz.
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20250114101026.3587702-5-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Benjamin Lin [Tue, 14 Jan 2025 10:10:21 +0000 (18:10 +0800)]
wifi: mt76: mt7996: fix incorrect indexing of MIB FW event
Fix wrong calculation of the channel times due to incorrect
interpretation from the FW event.
Fixes:
98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20250114101026.3587702-4-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Howard Hsu [Tue, 14 Jan 2025 10:10:20 +0000 (18:10 +0800)]
wifi: mt76: mt7996: fix HE Phy capability
Set HE SU PPDU And HE MU PPDU With 4x HE-LTF And 0.8 us GI within HE PHY
Capabilities element as 1 since hardware can support.
Fixes:
98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20250114101026.3587702-3-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Howard Hsu [Tue, 14 Jan 2025 10:10:19 +0000 (18:10 +0800)]
wifi: mt76: mt7996: fix the capability of reception of EHT MU PPDU
This commit includes two changes. First, enable "EHT MU PPDU With 4x
EHT-LTF And 0.8us GI" in EHT Phy capabilities element since hardware
can support. Second, fix the value of "Maximum number of supported
EHT LTFs" in the same element, where the previous setting of 3 in
Bit 3-4 was incorrect.
Fixes:
348533eb968d ("wifi: mt76: mt7996: add EHT capability init")
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20250114101026.3587702-2-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Peter Chiu [Tue, 14 Jan 2025 10:10:18 +0000 (18:10 +0800)]
wifi: mt76: mt7996: add max mpdu len capability
Set max mpdu len to 11454 according to hardware capability.
Without this patch, the max ampdu length would be 3895 and count not get
expected performance.
Fixes:
348533eb968d ("wifi: mt76: mt7996: add EHT capability init")
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20250114101026.3587702-1-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Leon Yen [Fri, 12 Apr 2024 08:53:57 +0000 (16:53 +0800)]
wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain
Some countries have strict RF restrictions where changing the regulatory
domain dynamically based on the connected AP is not acceptable.
This patch disables Beacon country IE hinting when a valid country code
is set from usersland (e.g., by system using iw or CRDA).
Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Tested-by: David Ruth <druth@chromium.org>
Link: https://patch.msgid.link/20240412085357.13756-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Quan Zhou [Fri, 3 Jan 2025 13:53:50 +0000 (21:53 +0800)]
wifi: mt76: mt7925e: fix too long of wifi resume time
The mt7925e takes a long time to resume in platform resume
scenarios. This is due to the mt7925 reconfiguring the tx
power for each wifi channel during resume. By streamlining
the process and removing redundant power configurations,
the resume time for the mt7925 can be shortened.
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Link: https://patch.msgid.link/f075d43d87a5eefa5869baf755e9986edf735860.1735910836.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Quan Zhou [Fri, 3 Jan 2025 13:44:54 +0000 (21:44 +0800)]
wifi: mt76: mt7925: add handler to hif suspend/resume event
When the system suspend or resume, the WiFi driver sends
an hif_ctrl command to the firmware and waits for an event.
Due to changes in the event format reported by the chip, the
current mt7925's driver does not account for these changes,
resulting in command timeout. Add flow to handle hif_ctrl
event to avoid command timeout. We also exented API
mt76_connac_mcu_set_hif_suspend for connac3 this time.
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Link: https://patch.msgid.link/3a0844ff5162142c4a9f3cf7104f75076ddd3b87.1735910562.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Quan Zhou [Fri, 3 Jan 2025 13:39:43 +0000 (21:39 +0800)]
wifi: mt76: mt7925: fix CLC command timeout when suspend/resume
When enter suspend/resume while in a connected state, the upper layer
will trigger disconnection before entering suspend, and at the same time,
it will trigger regd_notifier() and update CLC, causing the CLC event to
not be received due to suspend, resulting in a command timeout.
Therefore, the update of CLC is postponed until resume, to ensure data
consistency and avoid the occurrence of command timeout.
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Link: https://patch.msgid.link/bab00a2805d0533fd8beaa059222659858a9dcb5.1735910455.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Quan Zhou [Fri, 3 Jan 2025 13:35:59 +0000 (21:35 +0800)]
wifi: mt76: mt7925: fix the unfinished command of regd_notifier before suspend
Before entering suspend, we need to ensure that all MCU command are
completed. In some cases, such as with regd_notifier, there is a
chance that CLC commands, will be executed before suspend.
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Link: https://patch.msgid.link/3af7b4e5bf7437832b016e32743657d1d55b1f9d.1735910288.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Peter Chiu [Thu, 9 Jan 2025 11:04:36 +0000 (19:04 +0800)]
wifi: mt76: mt7996: fix register mapping
Bypass the entry when ofs is equal to dev->reg.map[i].size.
Without this patch, it would get incorrect register mapping when the CR
address is located at the boundary of an entry.
Fixes:
98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
Link: https://patch.msgid.link/OSZPR01MB84344FEFF53004B5CF40BCC198132@OSZPR01MB8434.jpnprd01.prod.outlook.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Peter Chiu [Thu, 9 Jan 2025 11:04:35 +0000 (19:04 +0800)]
wifi: mt76: mt7915: fix register mapping
Bypass the entry when ofs is equal to dev->reg.map[i].size.
Without this patch, it would get incorrect register mapping when the CR
address is located at the boundary of an entry.
Fixes:
cd4c314a65d3 ("mt76: mt7915: refine register definition")
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
Link: https://patch.msgid.link/OSZPR01MB843401EAA1DA6BD7AEF356F298132@OSZPR01MB8434.jpnprd01.prod.outlook.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:35:08 +0000 (17:35 +0100)]
wifi: mt76: mt7996: fix monitor mode
Enable sniffer mode via MCU command in order to properly enable promiscuous
mode on the device.
Link: https://patch.msgid.link/20250102163508.52945-24-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:35:07 +0000 (17:35 +0100)]
wifi: mt76: mt7996: switch to single multi-radio wiphy
Use generic mt76 chanctx functions and look up phy from vif link.
The driver now uses only a single phy to handle multiple interfaces on
different channels. This is preparation for full MLO support.
Link: https://patch.msgid.link/20250102163508.52945-23-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:35:06 +0000 (17:35 +0100)]
wifi: mt76: mt7996: move all debugfs files to the primary phy
Preparation for single-wiphy support
Link: https://patch.msgid.link/20250102163508.52945-22-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Shayne Chen [Thu, 2 Jan 2025 16:35:05 +0000 (17:35 +0100)]
wifi: mt76: connac: rework connac helpers
Rework connac helpers related to rate and phymode.
This is a preliminary patch to add MLO support for mt7996 chipsets.
Co-developed-by: Bo Jiao <Bo.Jiao@mediatek.com>
Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20250102163508.52945-21-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:35:04 +0000 (17:35 +0100)]
wifi: mt76: mt7996: prepare mt7996_mcu_update_bss_color for MLO support
Pass in struct mt76_vif_link in order to update the correct link.
Link: https://patch.msgid.link/20250102163508.52945-20-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:35:03 +0000 (17:35 +0100)]
wifi: mt76: connac: prepare mt76_connac_mcu_sta_basic_tlv for MLO support
Pass in struct ieee80211_bss_conf in order to use link specific data.
Link: https://patch.msgid.link/20250102163508.52945-19-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:35:02 +0000 (17:35 +0100)]
wifi: mt76: mt7996: prepare mt7996_mcu_set_timing for MLO support
Pass in struct ieee80211_bss_conf in order to use link specific data.
Link: https://patch.msgid.link/20250102163508.52945-18-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:35:01 +0000 (17:35 +0100)]
wifi: mt76: mt7996: prepare mt7996_mcu_set_tx for MLO support
Pass in struct ieee80211_bss_conf in order to use link specific data.
Link: https://patch.msgid.link/20250102163508.52945-17-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:35:00 +0000 (17:35 +0100)]
wifi: mt76: mt7996: prepare mt7996_mcu_add_beacon for MLO support
Pass in struct ieee80211_bss_conf.
Link: https://patch.msgid.link/20250102163508.52945-16-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:59 +0000 (17:34 +0100)]
wifi: mt76: mt7996: prepare mt7996_mcu_add_dev/bss_info for MLO support
Add extra arguments for struct ieee80211_bss_conf and mt76_vif_link.
Link: https://patch.msgid.link/20250102163508.52945-15-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:58 +0000 (17:34 +0100)]
wifi: mt76: mt7996: pass wcid to mt7996_mcu_sta_hdr_trans_tlv
Preparation for MLO support.
Link: https://patch.msgid.link/20250102163508.52945-14-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:57 +0000 (17:34 +0100)]
wifi: mt76: mt7996: use emulated hardware scan support
Preparation for supporting multiple radios on a single wiphy
Link: https://patch.msgid.link/20250102163508.52945-13-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:56 +0000 (17:34 +0100)]
wifi: mt76: add multi-radio remain_on_channel functions
This allows a driver using the generic channel context functions to
temporarily switch to another channel for off-channel rx/tx.
Link: https://patch.msgid.link/20250102163508.52945-12-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:55 +0000 (17:34 +0100)]
wifi: mt76: add multi-radio support to scanning code
When scanning on a phy/vif combination that does not have an active link,
create a temporary link in order to ensure that we have a valid wcid.
Link: https://patch.msgid.link/20250102163508.52945-11-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:54 +0000 (17:34 +0100)]
wifi: mt76: add multi-radio support to tx scheduling
Look up the phy for each scheduled txq. Only run one scheduling loop per hw.
Link: https://patch.msgid.link/20250102163508.52945-10-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:53 +0000 (17:34 +0100)]
wifi: mt76: add multi-radio support to a few core hw ops
Iterate over all phys if multi-radio is supported by the driver
Link: https://patch.msgid.link/20250102163508.52945-9-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:52 +0000 (17:34 +0100)]
wifi: mt76: remove dev->wcid_phy_mask
Explicitly check wcid->phy_idx instead. Reduces allocated data size.
Link: https://patch.msgid.link/20250102163508.52945-8-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:51 +0000 (17:34 +0100)]
wifi: mt76: add chanctx functions for multi-channel phy support
This adds an implementation for the chanctx functions, which can be used
by multi-channel capable drivers. Preparation for adding MLO support.
Link: https://patch.msgid.link/20250102163508.52945-7-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:50 +0000 (17:34 +0100)]
wifi: mt76: initialize more wcid fields mt76_wcid_init
Reduces code duplication and ensures that the phy index is always set.
Link: https://patch.msgid.link/20250102163508.52945-6-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:49 +0000 (17:34 +0100)]
wifi: mt76: mt7996: split link specific data from struct mt7996_vif
Preparation for MLO support.
Link: https://patch.msgid.link/20250102163508.52945-5-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:48 +0000 (17:34 +0100)]
wifi: mt76: add vif link specific data structure
Preparation for splitting link data from vif data for MLO support.
Link: https://patch.msgid.link/20250102163508.52945-4-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:47 +0000 (17:34 +0100)]
wifi: mt76: rename struct mt76_vif to mt76_vif_link
Preparation to use it for private bss link data instead of the full vif
on MLO capable devices.
Link: https://patch.msgid.link/20250102163508.52945-3-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:46 +0000 (17:34 +0100)]
wifi: mt76: add support for allocating a phy without hw
Preparation for supporting a single hw with multiple radios
Link: https://patch.msgid.link/20250102163508.52945-2-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Thu, 2 Jan 2025 16:34:45 +0000 (17:34 +0100)]
wifi: mt76: add code for emulating hardware scanning
Preparation for supporting multiple radios on a single wiphy on devices
where firmware does not support actual hardware scanning.
This is also a prerequisite for full MLO support
Co-developed-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Co-developed-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
Co-developed-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20250102163508.52945-1-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:42:02 +0000 (20:42 +0100)]
wifi: mt76: do not add wcid entries to sta poll list during MCU reset
Fixes linked list management issues during restart, where sta entries
can be recreated and reinitialized while still in the poll list, triggering
kernel warnings.
Link: https://patch.msgid.link/20241230194202.95065-14-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:42:01 +0000 (20:42 +0100)]
wifi: mt76: mt7996: use mac80211 .sta_state op
Allows adding stations before assoc, though they are not passed to the
firmware yet at that point.
Link: https://patch.msgid.link/20241230194202.95065-13-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:42:00 +0000 (20:42 +0100)]
wifi: mt76: mt7915: fix omac index assignment after hardware reset
Reset per-phy mac address slot mask in order to avoid leaking entries.
Fixes:
8a55712d124f ("wifi: mt76: mt7915: enable full system reset support")
Link: https://patch.msgid.link/20241230194202.95065-12-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:41:59 +0000 (20:41 +0100)]
wifi: mt76: mt7915: firmware restart on devices with a second pcie link
It seems that the firmware checks the register used for detecting matching
PCIe links in order to figure out if a secondary PCIe link is enabled.
Write the register again just before starting the firmware on hw reset,
in order to fix an issue that left the second band unusable after restart.
Fixes:
9093cfff72e3 ("mt76: mt7915: add support for using a secondary PCIe link for gen1")
Link: https://patch.msgid.link/20241230194202.95065-11-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:41:58 +0000 (20:41 +0100)]
wifi: mt76: mt7915: hold dev->mutex while interacting with the thermal state
Avoid issuing MCU calls during a hardware restart
Link: https://patch.msgid.link/20241230194202.95065-10-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:41:57 +0000 (20:41 +0100)]
wifi: mt76: mt7915: ensure that only one sta entry is active per mac address
When a client is roaming to a different AP interface, a duplicate wtbl entry
can be created. This can lead to lost packets or aggregation issues until
the old entry expires.
In order to fix this issue, delete any conflicting entries from WTBL
whenever a station is authorized.
Link: https://patch.msgid.link/20241230194202.95065-9-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:41:56 +0000 (20:41 +0100)]
wifi: mt76: only enable tx worker after setting the channel
Avoids sending packets too early
Fixes:
0b3be9d1d34e ("wifi: mt76: add separate tx scheduling queue for off-channel tx")
Link: https://patch.msgid.link/20241230194202.95065-8-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:41:55 +0000 (20:41 +0100)]
wifi: mt76: mt7915: decrease timeout for commonly issued MCU commands
This allows faster recovery from firmware issues
Link: https://patch.msgid.link/20241230194202.95065-7-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:41:54 +0000 (20:41 +0100)]
wifi: mt76: mt7915: reduce the number of command retries
The need to retry a command is really uncommon. Reduce the retries to 1 to
speed up recovery from firmware issues.
Link: https://patch.msgid.link/20241230194202.95065-6-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:41:53 +0000 (20:41 +0100)]
wifi: mt76: mt7996: fix rx filter setting for bfee functionality
Fix rx filter setting to prevent dropping NDPA frames. Without this
change, bfee functionality may behave abnormally.
Fixes:
98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Link: https://patch.msgid.link/20241230194202.95065-5-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:41:52 +0000 (20:41 +0100)]
wifi: mt76: mt7915: fix eifs value on older chipsets
Use the default firmware values
Link: https://patch.msgid.link/20241230194202.95065-4-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:41:51 +0000 (20:41 +0100)]
wifi: mt76: mt7915: fix slot time for 5/6GHz
It should only be set to 20 for long slot time on 2.4 GHz
Link: https://patch.msgid.link/20241230194202.95065-3-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:41:50 +0000 (20:41 +0100)]
wifi: mt76: mt7996: remove phy->monitor_vif
It is unused
Link: https://patch.msgid.link/20241230194202.95065-2-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 30 Dec 2024 19:41:49 +0000 (20:41 +0100)]
wifi: mt76: remove mt76_calculate_default_rate()
It is only used in mt76_connac2_mac_tx_rate_val, inline it there.
Link: https://patch.msgid.link/20241230194202.95065-1-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Nick Morrow [Thu, 19 Dec 2024 14:12:14 +0000 (08:12 -0600)]
wifi: mt76: mt7921u: Add VID/PID for TP-Link TXE50UH
Add VID/PID 35bc/0107 for recently released TP-Link TXE50UH USB WiFi adapter.
Tested-by: Shang Chieh Tseng <shangchieh.tseng@tsengsy.com>
Signed-off-by: Nick Morrow <usbwifi2024@gmail.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/e797f105-9ca8-41e9-96de-7d25dec09943@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Zhang Kunbo [Wed, 18 Dec 2024 07:45:52 +0000 (07:45 +0000)]
wifi: mt76: mt7925: replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1],
introduced in C99:
struct foo {
int stuff;
struct boo array[];
};
By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last, which is beneficial
to cultivate a high-quality code.[2]
This issue was found with the help of Coccinelle.
[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] commit
76497732932f ("cxgb3/l2t: Fix undefined behaviour")
Signed-off-by: Zhang Kunbo <zhangkunbo@huawei.com>
Link: https://patch.msgid.link/20241218074552.3271542-1-zhangkunbo@huawei.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Allan Wang [Mon, 9 Dec 2024 07:09:22 +0000 (15:09 +0800)]
wifi: mt76: mt7921: add rfkill_poll for hardware rfkill
Add mac80211 rfkill_poll ops to monitor hardware rfkill state
and state change will be updated.
Signed-off-by: Allan Wang <allan.wang@mediatek.com>
Link: https://patch.msgid.link/20241209070922.28106-1-allan.wang@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Leon Yen [Thu, 7 Nov 2024 06:14:40 +0000 (14:14 +0800)]
wifi: mt76: mt7921: introduce CSA support
Add CSA (Channel Switch Announcement) related implementation
in collaboration with mac80211 to deal with dynamic channel
switching.
Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20241107061440.6545-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Michael Lo [Wed, 6 Nov 2024 01:32:21 +0000 (09:32 +0800)]
wifi: mt76: mt7925: config the dwell time by firmware
To optimize the scan time of mt7925, remove the dwell time
setting for the scan command and let it be controlled by
the firmware as mt7921.
Signed-off-by: Michael Lo <michael.lo@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20241106013221.18101-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Quan Zhou [Fri, 8 Nov 2024 12:59:40 +0000 (20:59 +0800)]
wifi: mt76: do not hold queue lock during initial rx buffer alloc
In dma init or reset scene, full buffer is needed for all rx rings. Since
this is very time consuming, split the function to perform initial
allocation without holding the spinlock. This avoids causing excessive
scheduler latency.
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Reviewed-by: Shayne Chen <shayne.chen@mediatek.com>
Reviewed-by: Deren Wu <deren.wu@mediatek.com>
Link: https://patch.msgid.link/57c68a7ce1dd9022fa5e06af2c53d6313f30ec83.1731069062.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Ming Yen Hsieh [Wed, 11 Dec 2024 01:19:26 +0000 (17:19 -0800)]
wifi: mt76: mt7925: Properly handle responses for commands with events
Properly retrieve the response for commands with events. Ensure accurate
handling of event-driven commands.
Fixes:
86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20241211011926.5002-17-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Ming Yen Hsieh [Wed, 11 Dec 2024 01:19:25 +0000 (17:19 -0800)]
wifi: mt76: mt7925: Cleanup MLO settings post-disconnection
Clean up MLO settings after disconnection.
Fixes:
86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20241211011926.5002-16-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Ming Yen Hsieh [Wed, 11 Dec 2024 01:19:24 +0000 (17:19 -0800)]
wifi: mt76: mt7925: Update mt7925_mcu_uni_[tx,rx]_ba for MLO
Update mt7925_mcu_uni_[tx,rx]_ba for MLO support in firmware.
Fixes:
86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20241211011926.5002-15-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Ming Yen Hsieh [Wed, 11 Dec 2024 01:19:23 +0000 (17:19 -0800)]
wifi: mt76: mt7925: Init secondary link PM state
Initialize secondary link PM state.
Fixes:
86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20241211011926.5002-14-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Ming Yen Hsieh [Wed, 11 Dec 2024 01:19:22 +0000 (17:19 -0800)]
wifi: mt76: mt7925: Update secondary link PS flow
Update the power-saving flow for secondary links.
Fixes:
86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20241211011926.5002-13-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Ming Yen Hsieh [Wed, 11 Dec 2024 01:19:21 +0000 (17:19 -0800)]
wifi: mt76: mt7925: Update mt7925_unassign_vif_chanctx for per-link BSS
Update mt7925_unassign_vif_chanctx to support per-link BSS.
Fixes:
86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20241211011926.5002-12-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Ming Yen Hsieh [Wed, 11 Dec 2024 01:19:20 +0000 (17:19 -0800)]
wifi: mt76: mt7925: Update mt792x_rx_get_wcid for per-link STA
Update mt792x_rx_get_wcid to support per-link STA.
Fixes:
86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20241211011926.5002-11-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Ming Yen Hsieh [Wed, 11 Dec 2024 01:19:19 +0000 (17:19 -0800)]
wifi: mt76: mt7925: Update mt7925_mcu_sta_update for BC in ASSOC state
Update mt7925_mcu_sta_update for broadcast (BC) in the ASSOC state.
Fixes:
86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20241211011926.5002-10-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Ming Yen Hsieh [Wed, 11 Dec 2024 01:19:18 +0000 (17:19 -0800)]
wifi: mt76: Enhance mt7925_mac_link_sta_add to support MLO
Enhance mt7925_mac_link_sta_add to support MLO.
Fixes:
86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20241211011926.5002-9-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>