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.kernel.org/pub/scm/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.
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: 0044b2100044b2100044b24c000008000000000000000000
bfc0: 0044b2100044b2100000000000000081000000000044b2100000000000000000
bfe0: 00448e24b6af99c40043ea0daea2e12c
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().
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.
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.
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>
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'
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>
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
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>
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.
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>
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.
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.
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.
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.
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: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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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]
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.
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>
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>
Ming Yen Hsieh [Wed, 11 Dec 2024 01:19:17 +0000 (17:19 -0800)]
wifi: mt76: mt7925: Enhance mt7925_mac_link_bss_add to support MLO
In mt7925_mac_link_bss_add(), the mt76_connac_mcu_uni_add_dev() function
must be executed only after all parameters have been properly initialized.
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-8-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Leon Yen <leon.yen@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20241211011926.5002-7-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Ming Yen Hsieh [Wed, 11 Dec 2024 01:19:15 +0000 (17:19 -0800)]
wifi: mt76: mt7925: fix wrong parameter for related cmd of chan info
Fix incorrect parameters for the related channel information command.
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-6-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: allan.wang <allan.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20241211011926.5002-5-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Ming Yen Hsieh [Wed, 11 Dec 2024 01:19:12 +0000 (17:19 -0800)]
wifi: mt76: mt7925: Fix incorrect WCID assignment for MLO
For MLO, each link must have a corresponding WCID.
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-3-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Ming Yen Hsieh [Wed, 11 Dec 2024 01:19:11 +0000 (17:19 -0800)]
wifi: mt76: mt7925: Fix incorrect MLD address in bss_mld_tlv for MLO support
For this TLV, the address should be set to the MLD address rather than
the link address.
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-2-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sean Wang [Wed, 11 Dec 2024 01:19:10 +0000 (17:19 -0800)]
wifi: mt76: connac: Extend mt76_connac_mcu_uni_add_dev for MLO
This commit extends the `mt76_connac_mcu_uni_add_dev` function to include
support for Multi-Link Operation (MLO). Additionally, backward
compatibility for MT7921 is preserved, enabling seamless integration with
existing setups.
xueqin Luo [Mon, 2 Dec 2024 03:19:17 +0000 (11:19 +0800)]
wifi: mt76: mt7915: fix overflows seen when writing limit attributes
DIV_ROUND_CLOSEST() after kstrtoul() results in an overflow if a large
number such as 18446744073709551615 is provided by the user.
Fix it by reordering clamp_val() and DIV_ROUND_CLOSEST() operations.
This commit was inspired by commit: 57ee12b6c514.
xueqin Luo [Mon, 2 Dec 2024 03:19:16 +0000 (11:19 +0800)]
wifi: mt76: mt7996: fix overflows seen when writing limit attributes
DIV_ROUND_CLOSEST() after kstrtoul() results in an overflow if a large
number such as 18446744073709551615 is provided by the user.
Fix it by reordering clamp_val() and DIV_ROUND_CLOSEST() operations.
This commit was inspired by commit: 57ee12b6c514.
Add mt792x_config_mac_addr_list routine in order to set
the mac address list supported by the driver. Initialize
wiphy->addresses/n_addresses for mt792x driver
Shayne Chen [Thu, 10 Oct 2024 08:38:16 +0000 (10:38 +0200)]
wifi: mt76: mt7915: add module param to select 5 GHz or 6 GHz on MT7916
Due to a limitation in available memory, the MT7916 firmware can only
handle either 5 GHz or 6 GHz at a time. It does not support runtime
switching without a full restart.
On older firmware, this accidentally worked to some degree due to missing
checks, but couldn't be supported properly, because it left the 6 GHz
channels uncalibrated.
Newer firmware refuses to start on either band if the passed EEPROM
data indicates support for both.
Deal with this limitation by using a module parameter to specify the
preferred band in case both are supported.
Michael Lo [Thu, 1 Aug 2024 02:43:35 +0000 (10:43 +0800)]
wifi: mt76: mt7921: fix using incorrect group cipher after disconnection.
To avoid incorrect cipher after disconnection, we should
do the key deletion process in this case.
Fixes: e6db67fa871d ("wifi: mt76: ignore key disable commands") Signed-off-by: Michael Lo <michael.lo@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Tested-by: David Ruth <druth@chromium.org> Reviewed-by: David Ruth <druth@chromium.org> Link: https://patch.msgid.link/20240801024335.12981-1-mingyen.hsieh@mediatek.com Signed-off-by: Felix Fietkau <nbd@nbd.name>