Commit Graph
100 Commits
Author SHA1 Message Date
Felix Fietkau 243e572d89 wifi: mt76: add a wrapper for wcid access with validation
Several places use rcu_dereference to get a wcid entry without validating
if the index exceeds the array boundary. Fix this by using a helper function,
which handles validation.

Signed-off-by: Felix Fietkau <[email protected]>
2025-07-04 20:46:06 +02:00
Felix Fietkau c4a114e2b8 wifi: mt76: fix queue assignment for deauth packets
When running in AP mode and deauthenticating a client that's in powersave
mode, the disassoc/deauth packet can get stuck in a tx queue along with
other buffered frames. This can fill up hardware queues with frames
that are only released after the WTBL slot is reused for another client.

Fix this by moving deauth packets to the ALTX queue.

Signed-off-by: Felix Fietkau <[email protected]>
2025-07-04 20:43:51 +02:00
Felix Fietkau 6df761e0e6 mt76: fix signature of platform_driver remove funtions for newer kernels
Signed-off-by: Felix Fietkau <[email protected]>
2025-06-25 14:33:41 +02:00
Felix Fietkau 46f3a10a9f mt76: mt7925: sync with upstream cleanups
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-19 14:21:34 +01:00
Felix Fietkau 67c724cc60 Revert "wifi: mt76: mt7921: fix returned txpower"
This reverts commit ffd1cbfc48.
2025-03-12 10:34:21 +01:00
Felix Fietkau 539e7e711a Revert "wifi: mt76: mt7925: fix returned txpower"
This reverts commit 687e2fdfbf.
2025-03-12 10:34:17 +01:00
Felix Fietkau e931cecc45 mt76: mt792x: fix unused variable warning
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-11 14:34:37 +01:00
Felix Fietkau e5fef13852 mt76: only mark tx-status-failed frames as ACKed on mt76x0/2
The interrupt status polling is unreliable, which can cause status events
to get lost. On all newer chips, txs-timeout is an indication that the
packet was either never sent, or never acked.
Fixes issues with inactivity polling.

Signed-off-by: Felix Fietkau <[email protected]>
2025-02-14 11:13:33 +01:00
Felix Fietkau 2c068c9638 wifi: mt76: fix crash in mt76_switch_vif_chanctx
If the mode is CHANCTX_SWMODE_SWAP_CONTEXTS, the new chanctx is not
initialized yet.

Signed-off-by: Felix Fietkau <[email protected]>
2025-01-14 13:31:15 +01:00
Felix Fietkau 49c0bd66da wifi: mt76: mt7996: fix unused-but-set variable
Signed-off-by: Felix Fietkau <[email protected]>
2025-01-13 19:22:02 +01:00
Felix Fietkau 7279e3f3c3 wifi: mt76: mt7925: fix unused-but-set warning
Signed-off-by: Felix Fietkau <[email protected]>
2025-01-13 19:22:02 +01:00
Felix Fietkau 02f453d8df wifi: mt76: fix survey regression
Signed-off-by: Felix Fietkau <[email protected]>
2025-01-13 19:22:02 +01:00
Felix Fietkau e43df6bf48 wifi: mt76: mt7996: fix thermal sparse warning
Signed-off-by: Felix Fietkau <[email protected]>
2025-01-13 19:05:54 +01:00
Felix Fietkau cf4e709e49 wifi: mt76: mt7996: fix crash in mt7996_set_radar_background
When disabling background radar detection, chandef is NULL

Signed-off-by: Felix Fietkau <[email protected]>
2025-01-09 14:21:21 +01:00
Felix Fietkau e354436db4 wifi: mt76: mt7996: use the correct vif link for scanning/roc
Use the newly added offchannel_link pointer in vif data

Signed-off-by: Felix Fietkau <[email protected]>
2025-01-04 08:12:09 +01:00
Felix Fietkau 4d8d6e2e77 wifi: mt76: scan: set vif offchannel link for scanning/roc
The driver needs to know what vif link to use

Signed-off-by: Felix Fietkau <[email protected]>
2025-01-04 08:11:30 +01:00
Felix Fietkau 35bcf68a62 wifi: mt76: scan: fix setting tx_info fields
ieee80211_tx_prepare_skb initializes the skb cb, so fields need to be set
afterwards.

Signed-off-by: Felix Fietkau <[email protected]>
2025-01-04 07:46:21 +01:00
Felix Fietkau 959a2d4000 wifi: mt76: mt7996: initialize phy txpower
Fixes phy tx power during scan/offchannel if no chanctx was assigned yet.

Signed-off-by: Felix Fietkau <[email protected]>
2025-01-03 11:00:16 +01:00
Felix Fietkau 46715044ec wifi: mt76: mt7996: implement driver specific get_txpower function
Fixes reporting tx power for vifs that don't have a channel context
assigned. Report the tx power of a phy that is covered by the vif's
radio mask.

Signed-off-by: Felix Fietkau <[email protected]>
2025-01-03 10:35:08 +01:00
Felix Fietkau eb85bb3fd5 wifi: mt76: mt7915: fix eifs value on older chipsets
Use the default firmware values

Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 19:19:53 +01:00
Felix Fietkau 1884f568ba 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.

Signed-off-by: Felix Fietkau <[email protected]>
2024-12-30 18:40:23 +01:00
Felix Fietkau 5fe42ec88f 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.

Signed-off-by: Felix Fietkau <[email protected]>
2024-12-05 20:33:55 +01:00
Felix Fietkau 109114146f 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")
Signed-off-by: Felix Fietkau <[email protected]>
2024-12-05 13:06:27 +01:00
Felix Fietkau c246fa5451 wifi: mt76: mt7996: fix monitor mode
Enable sniffer mode via MCU command in order to properly enable promiscuous
mode on the device.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-28 10:07:24 +01:00
Felix Fietkau d258f4e3e1 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.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-28 10:07:23 +01:00
Felix Fietkau 484e3f289a wifi: mt76: mt7996: move all debugfs files to the primary phy
Preparation for single-wiphy support

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-28 10:04:14 +01:00
Felix Fietkau 1289737e12 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.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-28 10:04:13 +01:00
Felix Fietkau 60bf2bef95 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.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-28 10:04:13 +01:00
Felix Fietkau bf12cc4043 wifi: mt76: mt7996: prepare mt7996_mcu_set_timing for MLO support
Pass in struct ieee80211_bss_conf in order to use link specific data.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-28 10:04:13 +01:00
Felix Fietkau 9ee9900503 wifi: mt76: mt7996: prepare mt7996_mcu_set_tx for MLO support
Pass in struct ieee80211_bss_conf in order to use link specific data.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-28 10:04:13 +01:00
Felix Fietkau 252baa7bf4 wifi: mt76: mt7996: prepare mt7996_mcu_add_beacon for MLO support
Pass in struct ieee80211_bss_conf.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-28 10:04:13 +01:00
Felix Fietkau 807090b286 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.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-28 10:03:59 +01:00
Felix Fietkau f9d593d4a6 wifi: mt76: mt7996: pass wcid to mt7996_mcu_sta_hdr_trans_tlv
Preparation for MLO support.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-27 08:52:59 +01:00
Felix Fietkau 42429ae0ea wifi: mt76: mt7996: use emulated hardware scan support
Preparation for supporting multiple radios on a single wiphy

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-27 08:52:59 +01:00
Felix Fietkau f19cbcf834 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.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-27 08:52:59 +01:00
Felix Fietkau fc0ff17b53 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.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-27 08:52:59 +01:00
Felix Fietkau aeedee5c0a wifi: mt76: add multi-radio support to tx scheduling
Look up the phy for each scheduled txq. Only run one scheduling loop per hw.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-22 10:18:59 +02:00
Felix Fietkau 0b526090de wifi: mt76: add multi-radio support to a few core hw ops
Iterate over all phys if multi-radio is supported by the driver

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-22 10:18:59 +02:00
Felix Fietkau 0b05795ca8 wifi: mt76: remove dev->wcid_phy_mask
Explicitly check wcid->phy_idx instead. Reduces allocated data size.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-22 10:18:59 +02:00
Felix Fietkau d026be405c 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.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-22 10:18:59 +02:00
Felix Fietkau d388deab9e wifi: mt76: initialize more wcid fields mt76_wcid_init
Reduces code duplication and ensures that the phy index is always set.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-22 10:18:59 +02:00
Felix Fietkau dcc6f158d7 wifi: mt76: mt7996: split link specific data from struct mt7996_vif
Preparation for MLO support.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-22 10:18:59 +02:00
Felix Fietkau 99df84d628 wifi: mt76: add vif link specific data structure
Preparation for splitting link data from vif data for MLO support.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-22 10:18:59 +02:00
Felix Fietkau 8cd0263f92 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.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-22 10:18:59 +02:00
Felix Fietkau dc4c2bdf7c wifi: mt76: add support for allocating a phy without hw
Preparation for supporting a single hw with multiple radios

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-22 10:18:59 +02:00
Felix Fietkau 57019e663f 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 <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Co-developed-by: Michael-CY Lee <[email protected]>
Signed-off-by: Michael-CY Lee <[email protected]>
Co-developed-by: Shayne Chen <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-10-22 10:18:59 +02:00
Felix Fietkau d508a6eb93 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.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-22 10:18:59 +02:00
Felix Fietkau 8dfead68c2 wifi: mt76: mt7915: hold dev->mutex while interacting with the thermal state
Avoid issuing MCU calls during a hardware restart

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-14 19:11:12 +02:00
Felix Fietkau ecca0e77b4 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")
Signed-off-by: Felix Fietkau <[email protected]>
2024-10-11 20:01:19 +02:00
Felix Fietkau 703c6b78c1 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")
Signed-off-by: Felix Fietkau <[email protected]>
2024-10-11 18:49:00 +02:00
Felix Fietkau 513bd76837 Revert "wifi: mt76: mt7915: disable the second PCIe link for MT7915"
This reverts commit a902bfa6db.
Will be replaced with a proper fix

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-11 18:46:01 +02:00
Felix Fietkau 0d8474602a wifi: mt76: mt7915: decrease timeout for commonly issued MCU commands
This allows faster recovery from firmware issues

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-08 21:55:01 +02:00
Felix Fietkau a7d48cd3ed 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.

Signed-off-by: Felix Fietkau <[email protected]>
2024-10-08 21:55:01 +02:00
Felix Fietkau a902bfa6db wifi: mt76: mt7915: disable the second PCIe link for MT7915
The second PCIe link is only used to improve performance on older generation
PCIe devices (e.g. MT7621) where the bus speed of one link is not enough to
saturate both wifi bands under really good conditions.
Unfortunately it seems that resetting the hardware after a firmware error
causes the second band to stop working if the second link is in use.
Disable the link until the issue is properly fixed.

For testing, the link can still be enabled via module parameter.

Fixes: 9093cfff72e3 ("mt76: mt7915: add support for using a secondary PCIe link for gen1")
Signed-off-by: Felix Fietkau <[email protected]>
2024-10-08 21:15:32 +02:00
Felix Fietkau 02c07fe539 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")
Signed-off-by: Felix Fietkau <[email protected]>
2024-10-07 17:37:02 +02:00
Felix Fietkau ee693260c5 firmware: move mt7996 firmware to the right place
It was accidentally placed in the source code folder

Signed-off-by: Felix Fietkau <[email protected]>
2024-09-29 17:49:27 +02:00
Felix Fietkau 7aca94abac wifi: mt76: mt7915: fix slot time for 5/6GHz
It should only be set to 20 for long slot time on 2.4 GHz

Signed-off-by: Felix Fietkau <[email protected]>
2024-09-27 19:31:09 +02:00
Felix Fietkau addfbd1418 firmware: add latest mt7996 + mt7992 firmware
Signed-off-by: Felix Fietkau <[email protected]>
2024-09-27 07:49:18 +02:00
Felix Fietkau 059342ca6a wifi: mt76: move mt76_tm_policy to from testmode.h to mt76.h
This fixes using testmode.h from user space code

Signed-off-by: Felix Fietkau <[email protected]>
2024-09-24 12:34:25 +02:00
Felix Fietkau a2a9d98262 wifi: mt76: do not increase mcu skb refcount if retry is not supported
If mcu_skb_prepare_msg is not implemented, incrementing skb refcount does not
work for mcu message retry. In some cases (e.g. on SDIO), shared skbs can trigger
a BUG_ON, crashing the system.
Fix this by only incrementing refcount if retry is actually supported.

Fixes: 3688c18b65ae ("wifi: mt76: mt7915: retry mcu messages")
Reported-by: Nícolas F. R. A. Prado <[email protected]> #KernelCI
Tested-by: Alper Nebi Yasak <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-09-17 12:58:21 +02:00
Felix Fietkau 6685a2f4c2 wifi: mt76: mt7996: remove phy->monitor_vif
It is unused

Signed-off-by: Felix Fietkau <[email protected]>
2024-09-13 14:18:26 +02:00
Felix Fietkau d10ce9d65d wifi: mt76: remove mt76_calculate_default_rate()
It is only used in mt76_connac2_mac_tx_rate_val, inline it there.

Signed-off-by: Felix Fietkau <[email protected]>
2024-09-13 14:16:30 +02:00
Felix Fietkau a897606f7c wifi: mt76: mt76x0: fix locking regression
mt76_update_channel already takes dev->mt76.mutex

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-28 08:15:30 +02:00
Felix Fietkau 5c5e685eb0 wifi: mt76: mt7915: improve hardware recovery
Do not trigger full restarts when running into timeouts during SER.
Immediately abort MCU commands when firmware requests DMA restart.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-25 22:48:38 +02:00
Felix Fietkau 904ef52a8d wifi: mt76: mt7996: fix uninitialized TLV data
Use skb_put_zero instead of skb_put

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-25 21:08:59 +02:00
Felix Fietkau d6611d015e firmware: update mt7916/mt7981/mt7986 firmware to version 20240823
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-25 19:30:48 +02:00
Felix Fietkau e6afe9218a wifi: mt76: mt7915: fix unused variable error
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-23 00:48:02 +02:00
Felix Fietkau b76f16ea65 wifi: mt76: mt7915: improve hardware restart reliability
- use reconfig_complete to restart mac_work / queues
- reset full wtbl after firmware init
- clear wcid and vif mask to avoid leak

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-22 23:00:16 +02:00
Felix Fietkau 1f4ac8faa5 wifi: mt76: connac: move mt7615_mcu_del_wtbl_all to connac
Preparation for reusing it in mt7915

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-22 22:43:43 +02:00
Felix Fietkau 65bbd4c394 firmware: update MT7986 firmware to version 20240507160203
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-22 20:52:11 +02:00
Felix Fietkau aea16bfe8d firmware: update MT7981 firmware to version 20240507201102
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-22 20:51:36 +02:00
Felix Fietkau 084eaaf479 wifi: mt76: mt7915: fix sta poll list corruption on hw restart
When ieee80211_restart_hw is called, all interfaces and stations are
recreated. This can lead to corruption in the sta poll list, since
existing entries were not removed before their private data is reset.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-22 19:31:39 +02:00
Felix Fietkau dbc9b0df7c linux-firmware: update firmware for MT7996
This commit updates firmware files to 20240809 for MT7996 WiFi devices.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Josh Boyer <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-21 17:10:59 +02:00
Felix Fietkau a5e630ef45 wifi: mt76: mt7916: fix regression in .sta_state migration
- initialize and use per-sta wcid entry instead of vif wcid
- set wcid flags for 4addr/offload
- fix 'newly' argument for vif sta entry update

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-21 16:51:03 +02:00
Felix Fietkau 3cd1c17402 wifi: mt76: mt7915: hold dev->mt76.mutex while disabling tx worker
Prevent racing against other functions disabling the same worker

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-19 20:21:05 +02:00
Felix Fietkau caed4843c5 wifi: mt76: fix station muar index
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-19 20:05:30 +02:00
Felix Fietkau d547c25cab wifi: mt76: mt7915: fix last argument to mt7915_mcu_add_sta
Purely cosmetic

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-19 20:05:30 +02:00
Felix Fietkau 5c9fbdd643 wifi: mt7915: fix wcid allocation leak
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-19 20:05:11 +02:00
Felix Fietkau 0ac3041a9a wifi: mt76: fix off-channel wcid pending queue handling
- migrate offchannel to on-channel on switch
- fix scheduling during offchannel

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-18 09:54:11 +02:00
Felix Fietkau 362fec004c wifi: mt76: mt7915: reset the device after MCU timeout
On MT7915, MCU hangs do not trigger watchdog interrupts, so they can only
be detected through MCU message timeouts. Ensure that the hardware gets
restarted when that happens in order to prevent a permanent stuck state.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-13 20:48:53 +02:00
Felix Fietkau a1a65d8608 wifi: mt76: mt7915: retry mcu messages
In some cases MCU messages can get lost. Instead of failing completely,
attempt to recover by re-sending them.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-13 20:22:43 +02:00
Felix Fietkau 863b3a5f52 wifi: mt76: mt7915: set MT76_MCU_RESET early in mt7915_mac_full_reset
This avoids running into unnecessary timeouts waiting for MCU responses

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-13 19:53:35 +02:00
Felix Fietkau 5af2f7c8e8 wifi: mt76: mt7915: use mac80211 .sta_state op
Allows adding stations before assoc, though they are not passed to the
firmware yet at that point.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:09:09 +02:00
Felix Fietkau ea8c3eac12 wifi: mt76: change .sta_assoc callback to .sta_event
Also report auth/disassoc events, in order to give the driver more control over
handling the station state.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:09:03 +02:00
Felix Fietkau 1305484d04 wifi: mt76: connac: add support for passing connection state directly
Preparation for improvements to sta handling. No functional changes.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:08:54 +02:00
Felix Fietkau e0a409af55 wifi: mt76: mt7915: allocate vif wcid in the same range as stations
Reduces the amount of unnecessary WTBL bank switching, while still reserving
WTBL entries for vifs.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:08:34 +02:00
Felix Fietkau 4eea0786d8 wifi: mt76: mt7915: disable tx worker during tx BA session enable/disable
Avoids firmware race condition.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:08:34 +02:00
Felix Fietkau 891031ee05 wifi: mt76: add separate tx scheduling queue for off-channel tx
Ensure that packets are not sent out to the wrong channel

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:08:34 +02:00
Felix Fietkau b80c997b3f wifi: mt76: partially move channel change code to core
This allows the core code to change the channel. Code deduplication and
preparation for adding scanning code to the core.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:08:33 +02:00
Felix Fietkau 6ccafa50c6 firmware: update firmware for MT7915 to 20240429200502
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:08:33 +02:00
Felix Fietkau c13032ba47 wifi: mt76: mt7915: always query station rx rate from firmware
When offloading is enabled, the software rx path may not have the latest
rate information.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 17:56:37 +02:00
Felix Fietkau fdba7f4088 wifi: mt76: fix mt76_get_rate
Do not assume that the first phy has 2 GHz support.
Check sband->band instead of accessing dev->phy.sband_2g.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-09 10:32:37 +02:00
Felix Fietkau 6585a4353a wifi: mt76: mt7921: fix crash on ipv6 addr notification during vif bringup
mvif->phy is NULL when the interface is not properly initialized yet

Signed-off-by: Felix Fietkau <[email protected]>
2024-07-17 17:26:53 +02:00
Felix Fietkau e25fb9a010 wifi: mt76: mt7921: add missing bss_conf vif init
Signed-off-by: Felix Fietkau <[email protected]>
2024-07-16 14:33:33 +02:00
Felix Fietkau 564cd93961 mt76: sync with upstream changes
Signed-off-by: Felix Fietkau <[email protected]>
2024-07-12 17:15:04 +02:00
Felix Fietkau 513c131c63 mt76: mt7603: fix mixed declarations and code
Move the qid variable declaration further up

Fixes: b473c0e47f04 ("wifi: mt76: mt7603: fix tx queue of loopback packets")
Signed-off-by: Felix Fietkau <[email protected]>
2024-05-17 13:53:55 +02:00
Felix Fietkau 14d5ee9f33 mt76: shrink mt76_queue_buf
Reuse one bit from the length field for skip_unmap

Signed-off-by: Felix Fietkau <[email protected]>
2024-05-03 22:42:40 +02:00
Felix Fietkau c40e648b89 wifi: mt76: enable spectrum management
It is supported by all drivers

Signed-off-by: Felix Fietkau <[email protected]>
2024-04-19 13:35:28 +02:00
Felix Fietkau d9c62742be wifi: mt76: make const arrays in functions static
Reduces size by avoiding duplicates

Signed-off-by: Felix Fietkau <[email protected]>
2024-04-19 10:02:17 +02:00
Felix Fietkau 2d264aecbf mt76: mt7915: make pre-cal freq lists static const
Signed-off-by: Felix Fietkau <[email protected]>
2024-04-19 09:54:41 +02:00