Commit Graph
80 Commits
Author SHA1 Message Date
Ming Yen HsiehandFelix Fietkau 5776b32929 wifi: mt76: mt7925: refine the txpower initialization flow
Refactor the initialization and reset flow for tx power setting to
eliminate redundant configurations

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 15:11:50 +02:00
Ming Yen HsiehandFelix Fietkau 015349622b wifi: mt76: mt7925: fix incorrect length field in txpower command
Set `tx_power_tlv->len` to `msg_len` instead of `sizeof(*tx_power_tlv)`
to ensure the correct message length is sent to firmware.

Cc: [email protected]
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 15:11:01 +02:00
Ming Yen HsiehandFelix Fietkau 719cda7c9f wifi: mt76: mt7925: prevent NULL pointer dereference in mt7925_tx_check_aggr()
Move the NULL check for 'sta' before dereferencing it to prevent a
possible crash.

Fixes: 44eb173bdd4f ("wifi: mt76: mt7925: add link handling in mt7925_txwi_free")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 07:19:41 +02:00
Ming Yen HsiehandFelix Fietkau d48b221e39 wifi: mt76: mt7925: prevent NULL vif dereference in mt7925_mac_write_txwi
Check for a NULL `vif` before accessing `ieee80211_vif_is_mld(vif)` to
avoid a potential kernel panic in scenarios where `vif` might not be
initialized.

Fixes: ebb1406813c6 ("wifi: mt76: mt7925: add link handling to txwi")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 07:19:41 +02:00
Ming Yen HsiehandFelix Fietkau a35af27787 wifi: mt76: mt7925: skip EHT MLD TLV on non-MLD and pass conn_state for sta_cmd
Return early in mt7925_mcu_sta_eht_mld_tlv() for non-MLD vifs to avoid bogus
MLD TLVs, and pass the proper connection state to sta_basic TLV.

Cc: [email protected]
Fixes: cb1353ef3473 ("wifi: mt76: mt7925: integrate *mlo_sta_cmd and *sta_cmd")
Reported-by: Tal Inbar <[email protected]>
Tested-by: Tal Inbar <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-08-27 11:12:50 +02:00
Ming Yen HsiehandFelix Fietkau 3ed2c4030d wifi: mt76: mt7925u: use connac3 tx aggr check in tx complete
MT7925 is a connac3 device; using the connac2 helper mis-parses
TXWI and breaks AMPDU/BA accounting. Use the connac3-specific
helper mt7925_tx_check_aggr() instead,

Cc: [email protected]
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Reported-by: Nick Morrow <[email protected]>
Tested-by: Nick Morrow <[email protected]>
Tested-on: Netgear A9000 USB WiFi adapter
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-08-27 11:12:50 +02:00
Ming Yen HsiehandFelix Fietkau 903a7e0ace wifi: mt76: mt7921: add MBSSID support
Enable MBSSID support for MT7921 by setting the
appropriate capability to the firmware.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-08-13 14:15:39 +02:00
Ming Yen HsiehandFelix Fietkau e796542a05 wifi: mt76: mt7925: add MBSSID support
Enable MBSSID support for MT7925 by setting the
appropriate capability to the firmware.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-08-04 18:50:59 +02:00
Ming Yen HsiehandFelix Fietkau 11f721bce2 wifi: mt76: mt7925: fix the wrong bss cleanup for SAP
When in SAP mode, if a STA disconnect, the SAP's BSS
should not be cleared.

Fixes: 0ebb60da8416 ("wifi: mt76: mt7925: adjust rm BSS flow to prevent next connection failure")
Cc: [email protected]
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-08-04 18:19:26 +02:00
Ming Yen HsiehandFelix Fietkau b9f4e0df31 wifi: mt76: mt792x: improve monitor interface handling
Enable IEEE80211_HW_NO_VIRTUAL_MONITOR to ensure the driver is notified of
all monitor interfaces and their channels.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-07-07 18:09:36 +02:00
Ming Yen HsiehandFelix Fietkau 4bdc4c5f26 wifi: mt76: mt7925: fix incorrect scan probe IE handling for hw_scan
The IEs should be processed and filled into the command tlv separately
according to each band.

Cc: [email protected]
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-06-18 16:47:24 +02:00
Ming Yen HsiehandFelix Fietkau ca24f0794e wifi: mt76: mt7925: fix the wrong config for tx interrupt
MT_INT_TX_DONE_MCU_WM may cause tx interrupt to be mishandled
during a reset failure, leading to the reset process failing.
By using MT_INT_TX_DONE_MCU instead of MT_INT_TX_DONE_MCU_WM,
the handling of tx interrupt is improved.

Cc: [email protected]
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-06-18 16:46:10 +02:00
Ming Yen HsiehandFelix Fietkau 832387a1f8 wifi: mt76: mt7925: refine the sniffer commnad
Remove a duplicate call to `mt76_mcu_send_msg` to fix redundant operations
in the sniffer command handling.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-05-21 14:36:53 +02:00
Ming Yen HsiehandFelix Fietkau c20015bdc8 wifi: mt76: mt7925: prevent multiple scan commands
Add a check to ensure only one scan command is active at a time
by testing the MT76_HW_SCANNING state.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-05-21 14:36:53 +02:00
Ming Yen HsiehandFelix Fietkau 460aa7da0e wifi: mt76: mt7925: add RNR scan support for 6GHz
Enhance the mt7925 to include RNR scan support. It adds
the necessary RNR information to the scan command.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-05-21 14:31:27 +02:00
Ming Yen HsiehandFelix Fietkau 2247afffc7 wifi: mt76: add mt76_connac_mcu_build_rnr_scan_param routine
Introduce mt76_connac_mcu_build_rnr_scan_param routine for handling
RNR scan. This is a preliminary patch to enable RNR scan in mt7921 and
mt7925 driver.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-05-21 14:31:27 +02:00
Ming Yen HsiehandFelix Fietkau d7a070e11d wifi: mt76: mt7925: fix missing hdr_trans_tlv command for broadcast wtbl
Ensure that the hdr_trans_tlv command is included in the broadcast wtbl to
prevent the IPv6 and multicast packet from being dropped by the chip.

Cc: [email protected]
Fixes: cb1353ef3473 ("wifi: mt76: mt7925: integrate *mlo_sta_cmd and *sta_cmd")
Reported-by: Benjamin Xiao <[email protected]>
Tested-by: Niklas Schnelle <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://lore.kernel.org/lkml/EmWnO5b-acRH1TXbGnkx41eJw654vmCR-8_xMBaPMwexCnfkvKCdlU5u19CGbaapJ3KRu-l3B-tSUhf8CCQwL0odjo6Cd5YG5lvNeB-vfdg=@pm.me/
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-05-15 11:56:11 +02:00
Ming Yen HsiehandFelix Fietkau 0994f0af63 wifi: mt76: mt7925: fix the incomplete revert of [tx,rx]_ba for MLO
Since the `Revert wifi: mt76: mt7925: Update mt7925_mcu_uni_[tx,rx]_ba for MLO`
was not completely clean, submit this patch to fully clean it up.

Cc: [email protected]
Fixes: 73915469c55a ("Revert "wifi: mt76: mt7925: Update mt7925_mcu_uni_[tx,rx]_ba for MLO"")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-19 14:10:34 +01:00
Ming Yen HsiehandFelix Fietkau a826fc2874 wifi: mt76: mt7925: update MLO cleanup flow during disconnection
Refine the disconnection cleanup process for MLO. It introduces a dedicated
function to handle device removal, ensuring proper resource cleanup for both
BSS and device information.

Fixes: 21e40c17361e ("wifi: mt76: mt7925: adjust rm BSS flow to prevent next connection failure")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-19 14:09:49 +01:00
Ming Yen HsiehandFelix Fietkau a1ed21a669 wifi: mt76: mt792x: re-register CHANCTX_STA_CSA only for the mt7921 series
CSA is currently not supported on mt7925, so CSA is only registered for
the mt7921 series

Cc: [email protected]
Fixes: 8aa2f59260eb ("wifi: mt76: mt7921: introduce CSA support")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-19 14:09:49 +01:00
Ming Yen HsiehandFelix Fietkau 9ff2afce5f wifi: mt76: mt7925: add MTCL support to enhance the regulatory compliance
Apply the MTCL configuration to improving channel availability and
regulatory compliance if MTCL table is supported.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:18:36 +01:00
Ming Yen HsiehandFelix Fietkau b94b025490 wifi: mt76: mt792x: extend MTCL of APCI to version3 for EHT control
This patch introduces version 3 of the MTCL table, which provides
regulatory information for WiFi 7. It also configured by the platform
vender like the version 1 and 2.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:18:36 +01:00
Ming Yen HsiehandFelix Fietkau 772dcb4b4e wifi: mt76: mt7925: remove unused acpi function for clc
The code for handling ACPI configuration in CLC was copied from the mt7921
driver but is not utilized in the mt7925 implementation. So removes the
unused functionality to clean up the codebase.

Cc: [email protected]
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:18:36 +01:00
Ming Yen HsiehandFelix Fietkau bdc09b8f23 wifi: mt76: mt7925: update the channel usage when the regd domain changed
The 5.9/6GHz channel license of a certain platform device has been
regulated in various countries. That may be difference with standard Liunx
regulatory domain settings. In this case, when .reg_notifier() called for
regulatory change, mt7925 chipset should update the channel usage based on
CLC data.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:18:36 +01:00
Ming Yen HsiehandFelix Fietkau 454a69cbb7 wifi: mt76: mt7925: add EHT control support based on the CLC data
Some countries do not support EHT modulation for now. To prevent violating
regulations, the MT7925 chipset should control the EHT capabilities.
Therefore, when a regulatory domain change is detected during scanning,
the `mt7925_regd_be_ctrl` will process the CLC data to update the EHT
capabilities.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:18:36 +01:00
Ming Yen HsiehandFelix Fietkau 5910f0806c wifi: mt76: mt7925: load the appropriate CLC data based on hardware type
Read the EEPROM to determine the hardware type and uses this to load the
correct CLC data.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:18:36 +01:00
Ming Yen HsiehandFelix Fietkau 25a0285d8e wifi: mt76: mt7925: update the power-saving flow
After joining MLO, ensure that all links are setup before
enabling power-saving.

Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Cc: [email protected]
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Tested-by: Caleb Jorden <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:07:19 +01:00
Ming Yen HsiehandFelix Fietkau d25359e8bb wifi: mt76: mt7925: integrate *mlo_sta_cmd and *sta_cmd
Integrate *mlo_sta_cmd and *sta_cmd for the MLO firmware.

Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Cc: [email protected]
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Tested-by: Caleb Jorden <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:07:19 +01:00
Ming Yen HsiehandFelix Fietkau aa7d366ccf wifi: mt76: mt7925: adjust rm BSS flow to prevent next connection failure
Removing BSS without removing STAREC first will cause firmware
abnormal and next connection fail.

Fixes: f8797298565e ("wifi: mt76: mt7925: Cleanup MLO settings post-disconnection")
Cc: [email protected]
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Tested-by: Caleb Jorden <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:07:19 +01:00
Ming Yen HsiehandFelix Fietkau f54ff3caba wifi: mt76: mt7925: fix the wrong simultaneous cap for MLO
The mt7925 chip is only support a single radio, so the maximum
number of simultaneous should be 0.

Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Cc: [email protected]
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Tested-by: Caleb Jorden <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:07:19 +01:00
Ming Yen HsiehandFelix Fietkau 2823c50b1c wifi: mt76: mt7925: fix the wrong link_idx when has p2p_device
When the p2p device and MLO station concurrent, the p2p device
will occupy the wrong link_idx when the MLO secondary link is added.

Fixes: e38a82d25b08 ("wifi: mt76: connac: Extend mt76_connac_mcu_uni_add_dev for MLO")
Cc: [email protected]
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Tested-by: Caleb Jorden <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:07:19 +01:00
Ming Yen HsiehandFelix Fietkau 56c0beddbe wifi: mt76: mt7921: fix kernel panic due to null pointer dereference
Address a kernel panic caused by a null pointer dereference in the
`mt792x_rx_get_wcid` function. The issue arises because the `deflink` structure
is not properly initialized with the `sta` context. This patch ensures that the
`deflink` structure is correctly linked to the `sta` context, preventing the
null pointer dereference.

 BUG: kernel NULL pointer dereference, address: 0000000000000400
 #PF: supervisor read access in kernel mode
 #PF: error_code(0x0000) - not-present page
 PGD 0 P4D 0
 Oops: Oops: 0000 [#1] PREEMPT SMP NOPTI
 CPU: 0 UID: 0 PID: 470 Comm: mt76-usb-rx phy Not tainted 6.12.13-gentoo-dist #1
 Hardware name:  /AMD HUDSON-M1, BIOS 4.6.4 11/15/2011
 RIP: 0010:mt792x_rx_get_wcid+0x48/0x140 [mt792x_lib]
 RSP: 0018:ffffa147c055fd98 EFLAGS: 00010202
 RAX: 0000000000000000 RBX: ffff8e9ecb652000 RCX: 0000000000000000
 RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff8e9ecb652000
 RBP: 0000000000000685 R08: ffff8e9ec6570000 R09: 0000000000000000
 R10: ffff8e9ecd2ca000 R11: ffff8e9f22a217c0 R12: 0000000038010119
 R13: 0000000080843801 R14: ffff8e9ec6570000 R15: ffff8e9ecb652000
 FS:  0000000000000000(0000) GS:ffff8e9f22a00000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 0000000000000400 CR3: 000000000d2ea000 CR4: 00000000000006f0
 Call Trace:
  <TASK>
  ? __die_body.cold+0x19/0x27
  ? page_fault_oops+0x15a/0x2f0
  ? search_module_extables+0x19/0x60
  ? search_bpf_extables+0x5f/0x80
  ? exc_page_fault+0x7e/0x180
  ? asm_exc_page_fault+0x26/0x30
  ? mt792x_rx_get_wcid+0x48/0x140 [mt792x_lib]
  mt7921_queue_rx_skb+0x1c6/0xaa0 [mt7921_common]
  mt76u_alloc_queues+0x784/0x810 [mt76_usb]
  ? __pfx___mt76_worker_fn+0x10/0x10 [mt76]
  __mt76_worker_fn+0x4f/0x80 [mt76]
  kthread+0xd2/0x100
  ? __pfx_kthread+0x10/0x10
  ret_from_fork+0x34/0x50
  ? __pfx_kthread+0x10/0x10
  ret_from_fork_asm+0x1a/0x30
  </TASK>
 ---[ end trace 0000000000000000 ]---

Reported-by: Nick Morrow <[email protected]>
Closes: https://github.com/morrownr/USB-WiFi/issues/577
Cc: [email protected]
Fixes: 90c10286b176 ("wifi: mt76: mt7925: Update mt792x_rx_get_wcid for per-link STA")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Tested-by: Salah Coronya <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:07:19 +01:00
Ming Yen HsiehandFelix Fietkau 5eab65bb54 wifi: mt76: mt7925: fix country count limitation for CLC
Due to the increase in the number of power tables for 6Ghz on CLC,
the variable nr_country is no longer sufficient to represent the
total quantity. Therefore, we have switched to calculating the
length of clc buf to obtain the correct power table.

Cc: [email protected]
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:01:25 +01:00
Ming Yen HsiehandFelix Fietkau 29f0ad5a43 wifi: mt76: mt7925: ensure wow pattern command align fw format
Align the format of "struct mt7925_wow_pattern_tlv" with
firmware to ensure proper functionality.

Cc: [email protected]
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:01:25 +01:00
Ming Yen HsiehandFelix Fietkau 3e25f2bc33 wifi: mt76: mt7925: introduce MLO capability control
This patch introduces MLO capability control for the MT792x Wi-Fi driver.
It removes the unused `MT792x_CHIP_CAP_MLO_EVT_EN` flag and introduces new
capability flags `MT792x_CHIP_CAP_MLO_EN` and `MT792x_CHIP_CAP_MLO_EML_EN`
to enable MLO and EML features based on firmware capabilities.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Reviewed-by: Sabeeh Khan <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-10 13:01:25 +01:00
Ming Yen HsiehandFelix Fietkau 0aab0c61ce 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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:45:36 +01:00
Ming Yen HsiehandFelix Fietkau 3acc6cbb95 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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:45:36 +01:00
Ming Yen HsiehandFelix Fietkau 6d972b5b9d 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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:45:36 +01:00
Ming Yen HsiehandFelix Fietkau fd4d6f8707 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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:44:39 +01:00
Ming Yen HsiehandFelix Fietkau 67dcd5c888 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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:44:39 +01:00
Ming Yen HsiehandFelix Fietkau e5c0d1289e 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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:44:39 +01:00
Ming Yen HsiehandFelix Fietkau 285efc6afa 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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:44:39 +01:00
Ming Yen HsiehandFelix Fietkau 3c99ef40e0 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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:44:39 +01:00
Ming Yen HsiehandFelix Fietkau 53ec7a551f 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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:44:39 +01:00
Ming Yen HsiehandFelix Fietkau b90b1a1dc7 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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:44:39 +01:00
Ming Yen HsiehandFelix Fietkau 1c04e96934 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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:44:39 +01:00
Ming Yen HsiehandFelix Fietkau 72b4688b39 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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:43:32 +01:00
Ming Yen HsiehandFelix Fietkau 1b5e6abc2e 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 <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:41:28 +01:00
Ming Yen HsiehandFelix Fietkau eede99f524 wifi: mt76: mt7925: fix the invalid ip address for arp offload
The wrong ieee80211_vif will lead to get invalid ip address and
the correct ieee80211_vif can be obtained from ieee80211_bss_conf.

Fixes: 147324292979 ("wifi: mt76: mt7925: add link handling in the BSS_CHANGED_ARP_FILTER handler")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:36:08 +01:00
Ming Yen HsiehandFelix Fietkau 3f1401a0f0 wifi: mt76: mt7925: fix get wrong chip cap from incorrect pointer
Use tlv instead of skb, because using skb will get valid data
with wrong offset.

Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:36:08 +01:00
Ming Yen HsiehandFelix Fietkau bec8cb851d wifi: mt76: mt7925: replace chan config with extend txpower config for clc
Since MT792x_CLC_CHAN is currently not in use, we have added an
extension for setting txpower to replace it.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-09-06 11:05:39 +02:00
Ming Yen HsiehandFelix Fietkau 922e515bd8 wifi: mt76: mt7925: fix a potential array-index-out-of-bounds issue for clc
Due to the lack of checks on the clc array, if the firmware supports
more clc configuration, it will cause illegal memory access.

Cc: [email protected]
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-09-06 11:05:39 +02:00
Ming Yen HsiehandFelix Fietkau ddeb304aae wifi: mt76: mt7921: fix wrong UNII-4 freq range check for the channel usage
The check should start from 5845 to 5925, which includes
channels 169, 173, and 177.

Fixes: 09382d8f8641 ("wifi: mt76: mt7921: update the channel usage when the regd domain changed")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-25 21:05:41 +02:00
Ming Yen HsiehandFelix Fietkau 75759dca73 wifi: mt76: mt7925: ensure 4-byte alignment for suspend & wow command
Before sending suspend & wow command to FW, its length should be
4-bytes alignd.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-04-03 12:39:12 +02:00
Ming Yen HsiehandFelix Fietkau 841bf82e99 wifi: mt76: fix the issue of missing txpwr settings from ch153 to ch177
Because the number of channels to be configured is calculated using the %,
and it results in 0 when there's an exact division, this leads to some
channels not having their tx power configured.

Fixes: 7801da338856 ("wifi: mt76: mt7921: enable set txpower for UNII-4")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-21 21:14:17 +01:00
Ming Yen HsiehandFelix Fietkau 6124ea9135 wifi: mt76: mt7921: 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: Ming Yen Hsieh <[email protected]>
Signed-off-by: Leon Yen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 15:04:47 +01:00
Ming Yen HsiehandFelix Fietkau ea55196bc4 wifi: mt76: mt792x: update the country list of EU for ACPI SAR
This patch updates the EU country list to ensure the MTCL table
works correctly.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Leon Yen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 15:04:47 +01:00
Ming Yen HsiehandFelix Fietkau 7bd5401f5b wifi: mt76: mt792x: fix a potential loading failure of the 6Ghz channel config from ACPI
In some case, the MTCL table will exist, but MTDS table will not.
So the SAR will init fail. This patch make MTCL and MTDS can exist
with no dependence.

Fixes: f965333e491e ("mt76: mt7921: introduce ACPI SAR support")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Leon Yen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 15:04:47 +01:00
Ming Yen HsiehandFelix Fietkau d75eac9f55 wifi: mt76: mt7921: fix incorrect type conversion for CLC command
clc->len is defined as 32 bits in length, so it must also be
operated on with 32 bits, not 16 bits.

Fixes: fa6ad88e023d ("wifi: mt76: mt7921: fix country count limitation for CLC")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 15:04:47 +01:00
Ming Yen HsiehandFelix Fietkau 9907f4f202 wifi: mt76: mt792x: add the illegal value check for mtcl table of acpi
The mtcl table provided regulatory information for 5.9/6Ghz channels and
configured by platform venders. So, sometimes vendors may write illegal
values, and therefore it is necessary to check and add corresponding
handling for such cases.

Signed-off-by: Leon Yen <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 15:04:47 +01:00
Ming Yen HsiehandFelix Fietkau dccbd25985 wifi: mt76: mt7925: fix the wrong data type for scan command
For the member of 'struct scan_req_tlv', replace data type of
func_mask_ext from 'u8' to '__le32'.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 15:04:47 +01:00
Ming Yen HsiehandFelix Fietkau 762ab4530e wifi: mt76: mt7925: add support to set ifs time by mcu command
There's a race between driver and fw on some tx/rx control registers
when setting ifs, which will cause accidental hw queue pause problems.
Avoid this by setting ifs time with bss_info mcu command.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Co-developed-by: Deren Wu <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 15:04:42 +01:00
Ming Yen HsiehandFelix Fietkau 6a72716ec2 wifi: mt76: mt7925: fix the wrong header translation config
The header translation config should set to broadcast and unicast
cases correctly, not only unicast case. And also remove the cmds
of wtbl (wlan table) series, because these MCU commands have
already been replaced by other commands in mt7925.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 15:04:42 +01:00
Ming Yen HsiehandFelix Fietkau f982c3d67a wifi: mt76: mt7925: fix WoW failed in encrypted mode
When in suspend mode, WoW (Wake-on-WLAN) fails to wake the system remotely
due to incorrect encryption mode settings. For the new mt7925 chipset, the
old STA_REC_KEY_V2 command will send incorrect parameters to the firmware.
Therefore, STA_REC_KEY_V3 has been introduced as a replacement for it.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 15:04:42 +01:00
Ming Yen HsiehandFelix Fietkau bcfe2ad966 wifi: mt76: mt7925: fix fw download fail
Add an address of fw region for fw download.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 15:04:42 +01:00
Ming Yen HsiehandFelix Fietkau 1f0f71ed81 wifi: mt76: mt7925: fix wmm queue mapping
Firmware uses access class index (ACI) for wmm parameters update,
so convert mac80211 queue to ACI in mt7925_conf_tx().

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 15:04:42 +01:00
Ming Yen HsiehandFelix Fietkau 27c81f7c14 wifi: mt76: mt7925: fix connect to 80211b mode fail in 2Ghz band
Driver should setting correct phy mode to firmware when in legacy mode.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 15:04:42 +01:00
Ming Yen HsiehandFelix Fietkau bebd9cffc2 wifi: mt76: mt7921: fix 6GHz disabled by the missing default CLC config
No matter CLC is enabled or disabled, the driver should initialize
the default value 0xff for channel configuration of CLC. Otherwise,
the zero value would disable channels.

Reported-and-tested-by: Ben Greear <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Fixes: 09382d8f8641 ("wifi: mt76: mt7921: update the channel usage when the regd domain changed")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/5a976ddf1f636b5cb809373501d3cfdc6d8de3e4.1698648737.git.deren.wu@mediatek.com
2023-12-18 18:53:21 +01:00
Ming Yen HsiehandFelix Fietkau 3098d968ab wifi: mt76: mt7921: fix wrong 6Ghz power type
To avoid using incorrect 6g power settings after disconnection,
it should to update back to the default state when disconnected.

Fixes: 51ba0e3a15eb ("wifi: mt76: mt7921: add 6GHz power type support for clc")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-12-06 12:21:19 +01:00
Ming Yen HsiehandFelix Fietkau c498f27ad0 wifi: mt76: mt7921: 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.

Fixes: 4fc8df50fd41 ("wifi: mt76: mt7921: get regulatory information from the clc event")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-12-06 12:21:19 +01:00
Ming Yen HsiehandFelix Fietkau a84a355d2e wifi: mt76: mt7921: fix country count limitation for CLC
Due to the increase in the number of power tables for 6Ghz on CLC,
the variable nr_country is no longer sufficient to represent the
total quantity. Therefore, we have switched to calculating the
length of clc buf to obtain the correct power table. Additionally,
the version number has been incremented to 1.

Fixes: 23bdc5d8cadf ("wifi: mt76: mt7921: introduce Country Location Control support")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-12-06 12:21:19 +01:00
Ming Yen HsiehandFelix Fietkau b97d899a79 wifi: mt76: mt7921: fix kernel panic by accessing invalid 6GHz channel info
When the chip not support 6GHz capability, the channels of 6GHz information
should not be updated. This caused a crash:

[   19.442078] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000014
[   19.457535] Mem abort info:
[   19.465329]   ESR = 0x0000000096000004
[   19.473295]   EC = 0x25: DABT (current EL), IL = 32 bits
[   19.482354]   SET = 0, FnV = 0
[   19.489143]   EA = 0, S1PTW = 0
[   19.495991]   FSC = 0x04: level 0 translation fault
[   19.504554] Data abort info:
[   19.511111]   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
[   19.520269]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[   19.528988]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[   19.537960] user pgtable: 4k pages, 48-bit VAs, pgdp=00000001027a9000
[   19.548014] [0000000000000014] pgd=0000000000000000, p4d=000000000000
[   19.558429] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
[   19.568270] Modules linked in: mt7921e mt7921_common mt792x_lib
mt76_connac_lib mt76 mac80211 btusb btintel cfg80211 btmtk snd_sof_ipc_msg_
btrtl snd_sof_ipc_flood_test btbcm bluetooth snd_sof_mt8195 uvcvideo
mtk_adsp_common snd_sof_xtensa_dsp uvc snd_sof_of snd_sof videobuf2_vmalloc
ecdh_generic ecc snd_sof_utils cros_ec_lid_angle cros_ec_sensors crct10dif_
cros_ec_sensors_core cros_usbpd_logger crypto_user fuse ip_tables ipv6
[   19.614237] CPU: 1 PID: 105 Comm: kworker/1:1 Not tainted 6.6.0-rc6-next-20231017+ #324
[   19.625957] Hardware name: Acer Tomato (rev2) board (DT)
[   19.634970] Workqueue: events mt7921_init_work [mt7921_common]
[   19.644522] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTY
[   19.655182] pc : mt7921_regd_notifier+0x180/0x290 [mt7921_common]
[   19.664983] lr : mt7921_regd_notifier+0xd4/0x290 [mt7921_common]
[   19.674679] sp : ffff800080acba80
[   19.681649] x29: ffff800080acba80 x28: 0000000000000000 x27: ffff4faf
[   19.692483] x26: 0000000000000000 x25: 0000000000000000 x24: ffff4faf
[   19.703294] x23: 00000000ffffe926 x22: ffff4faf16031fa0 x21: 00000000
[   19.714108] x20: 000000000000001c x19: ffff4faf16ba6f40 x18: 00000000
[   19.724928] x17: 0000000000000000 x16: ffffac6b891c2750 x15: ffff8000
[   19.735722] x14: 0000000000000180 x13: 0000000000000000 x12: 00000000
[   19.746478] x11: 0000000000000002 x10: ffff4faf01c21780 x9 : ffffac6b
[   19.757214] x8 : 00000000006c0000 x7 : ffffac6b6b020cf0 x6 : ffffac6b
[   19.767945] x5 : ffffac6b6b020d00 x4 : ffffac6b6b020cf8 x3 : ffff4faf
[   19.778648] x2 : 0000000000000000 x1 : 000000000000001c x0 : 00000000
[   19.789366] Call trace:
[   19.795381]  mt7921_regd_notifier+0x180/0x290 [mt7921_common]
[   19.804675]  wiphy_update_regulatory+0x2bc/0xa08 [cfg80211]
[   19.813864]  wiphy_regulatory_register+0x4c/0x88 [cfg80211]
[   19.823029]  wiphy_register+0x75c/0x8d0 [cfg80211]
[   19.831446]  ieee80211_register_hw+0x70c/0xc10 [mac80211]
[   19.840479]  mt76_register_device+0x168/0x2e8 [mt76]
[   19.849008]  mt7921_init_work+0xdc/0x250 [mt7921_common]
[   19.857817]  process_one_work+0x148/0x3c0
[   19.865292]  worker_thread+0x32c/0x450
[   19.872489]  kthread+0x11c/0x128
[   19.879173]  ret_from_fork+0x10/0x20
[   19.886153] Code: f0000041 9100a021 94000aef aa0003f9 (b9401780)
[   19.895634] ---[ end trace 0000000000000000 ]---

Reported-by: AngeloGioacchino Del Regno <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Fixes: 09382d8f8641 ("wifi: mt76: mt7921: update the channel usage when the regd domain changed")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Tested-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/cf77a58a60d81c77a28388bc8d312b87ffb48434.1697603002.git.deren.wu@mediatek.com
2023-12-06 10:39:28 +01:00
Ming Yen HsiehandFelix Fietkau 4a0f839da0 wifi: mt76: mt7921: update the channel usage when the regd domain changed
The 5.9/6GHz channel license of a certain platform device has been
regulated in various countries. That may be difference with standard
Liunx regulatory domain settings. In this case, when .reg_notifier()
called for regulatory change, mt792x chipset should update the channel
usage based on clc or dts configurations.

Channel would be disabled by following cases.
* clc report the particular UNII-x is disabled.
* dts enabled and the channel is not configured.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Co-developed-by: Deren Wu <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-09-30 20:17:46 +02:00
Ming Yen HsiehandFelix Fietkau 9bfd669e94 wifi: mt76: mt7921: get regulatory information from the clc event
The clc event can report the radio configuration for the corresponding
country and the driver would take it as regulatory information of a
certain platform device.

This patch would change the clc commnad from no-waiting to waiting for
event. For backward compatible, we also add a new nic capability tag
to indicate the firmware did support this new clc event from now on.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Co-developed-by: Deren Wu <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-09-30 20:17:46 +02:00
Ming Yen HsiehandFelix Fietkau 581449ac52 wifi: mt76: mt7921: add 6GHz power type support for clc
There are several power type should be supported in 6GHz band. mt7921
apply 6GHz power type from AP settings and clc will setup the
corresponding regulatory power.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Co-developed-by: Deren Wu <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-09-30 20:17:46 +02:00
Ming Yen HsiehandFelix Fietkau 266341b501 wifi: mt76: mt7921: enable set txpower for UNII-4
support power config for channel 165/173/177

Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-09-30 20:17:46 +02:00
Ming Yen HsiehandFelix Fietkau a729242363 wifi: mt76: mt7921: fix non-PSC channel scan fail
Due to the scan command may only request legacy bands and PSC channel
in 6GHz band, we are unable to scan the APs on non-PSC channel in this
case. Enable WIPHY_FLAG_SPLIT_SCAN_6GHZ to support non-PSC channel
(obtained during scan on legacy bands) in 6GHz scan request.

Fixes: 50ac15a511e3 ("mt76: mt7921: add 6GHz support")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 17:52:14 +02:00
Ming Yen HsiehandFelix Fietkau b490c6c7bc wifi: mt76: fix 6GHz high channel not be scanned
mt76 scan command only support 64 channels currently. If the
channel count is larger than 64(for 2+5+6GHz), some channels will
not be scanned. Hence change the scan type to full channel scan
in case of the command cannot include proper list for chip.

Fixes: 399090ef9605 ("mt76: mt76_connac: move hw_scan and sched_scan routine in mt76_connac_mcu module")
Reported-by: Ben Greear <[email protected]>
Tested-by: Isaac Konikoff <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-18 11:45:28 +02:00
Ming Yen HsiehandFelix Fietkau 473cebb3c3 wifi: mt76: fix bandwidth 80MHz link fail in 6GHz band
Due to information missing, the firmware may be fail on bandwidth
related settings in mt7921/mt7922. Add new cmd STA_REC_HE_V2 to apply
additional capabilities in 6GHz band.

Tested-by: Ben Greear <[email protected]>
Co-developed-by: Deren Wu <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-12-10 13:11:04 +01:00
Ming Yen HsiehandFelix Fietkau ebbd68842e wifi: mt76: mt7921: introduce Country Location Control support
Country Location Control (CLC) is an additional control for country rules
in firmware. We introduce this new feature to make sure mt7921 series
working properly in all region.

The addtional policies would be put into firmware based on differnt
regions. mt76 driver should be in charge of submitting per region policy.

Reviewed-by: Sean Wang <[email protected]>
Tested-by: YN Chen <[email protected]>
Co-developed-by: Deren Wu <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:15:49 +02:00