Commit Graph
100 Commits
Author SHA1 Message Date
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
Felix Fietkau 8f301a5c5f firmware: add mt7981 default eeprom
Signed-off-by: Felix Fietkau <[email protected]>
2024-04-04 17:28:55 +02:00
Felix Fietkau 1e336a8582 wifi: mt76: connac: use muar idx 0xe for non-mt799x as well
This is expected by the firmware of older chipsets as well, though it may
not have been as strongly required as on mt799x

Fixes: 098428c400ff ("wifi: mt76: connac: set correct muar_idx for mt799x chipsets")
Signed-off-by: Felix Fietkau <[email protected]>
2024-04-03 13:05:12 +02:00
Felix Fietkau 669aba47a1 wifi: mt76: mt7915: fix HE PHY capability regression
Fix a logic error that was dropping required capabilities

Signed-off-by: Felix Fietkau <[email protected]>
2024-04-03 11:34:14 +02:00
Felix Fietkau 446f652c96 wifi: mt76: mt7603: add wpdma tx eof flag for PSE client reset
This flag is needed for the PSE client reset. Fixes watchdog reset issues.

Fixes: c677dda16523 ("wifi: mt76: mt7603: improve watchdog reset reliablity")
Signed-off-by: Felix Fietkau <[email protected]>
2024-04-03 11:13:34 +02:00
Felix Fietkau e4de3592c4 wifi: mt76: mt7603: fix tx queue of loopback packets
Use the correct WMM AC queue instead of the MGMT one to fix potential issues
with aggregation sequence number tracking. Drop non-bufferable packets.

Fixes: fca9615f1a43 ("mt76: mt7603: fix up hardware queue index for PS filtered packets")
Signed-off-by: Felix Fietkau <[email protected]>
2024-04-03 11:12:55 +02:00
Felix Fietkau 605624a4e1 mt76: fix path to page_pool helper include
Signed-off-by: Felix Fietkau <[email protected]>
2024-03-24 15:51:52 +01:00
Felix Fietkau 2135e201e7 mt76: mt7915: add fallback in case of missing precal data
When pre-calibration data is missing, do not fail the driver probe.
Instead, just print a warning and fall back to regular calibration.

Signed-off-by: Felix Fietkau <[email protected]>
2024-03-18 10:33:01 +01:00
Felix Fietkau 2330781b8c wifi: mt76: mt7996: only set MT76_MCU_RESET for the main phy
The MT76_MCU_RESET flag is only read on the main phy.

Signed-off-by: Felix Fietkau <[email protected]>
2024-03-15 17:07:47 +01:00
Felix Fietkau b5640b3153 wifi: mt76: fix tx packet loss when scanning on DBDC
When queueing packets, only the MT76_RESET flag of the primary PHY
is checked. If the primary PHY is scanning or changing channels, this can
lead to packet loss for tx on the second PHY.
Fix this by passing the phy to the .tx_queue_skb op and using it to check
the correct flag.

Signed-off-by: Felix Fietkau <[email protected]>
2024-03-15 17:07:47 +01:00
Felix Fietkau 46c7d1849d wifi: mt76: replace skb_put with skb_put_zero
Avoid potentially reusing uninitialized data

Signed-off-by: Felix Fietkau <[email protected]>
2024-03-15 17:07:47 +01:00
Felix Fietkau a238df940d wifi: mt76: mt7915: initialize rssi on adding stations
Improves initial rate selection after connecting

Signed-off-by: Felix Fietkau <[email protected]>
2024-03-15 17:07:31 +01:00
Felix Fietkau 786a339bac wifi: mt76: mt7996: fix fortify warning
Copy cck and ofdm separately in order to avoid __read_overflow2_field
warning.

Fixes: f75e4779d215 ("wifi: mt76: mt7996: add txpower setting support")
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 14:22:05 +01:00
Felix Fietkau 3e81173d9e wifi: mt76: mt7603: initialize chainmask
Fixes reported tx power by accounting for the combined output

Signed-off-by: Felix Fietkau <[email protected]>
2024-01-29 11:09:31 +01:00
Felix Fietkau 0258dc90e3 wifi: mt76: mt7603: fix reading target power from eeprom
If the ext-PA target power is unset, fall back to the standard EEPROM value.

Signed-off-by: Felix Fietkau <[email protected]>
2024-01-29 11:00:08 +01:00
Felix Fietkau 3d5890e2ca wifi: mt76: mt7915: fix error recovery with WED enabled
Do not clear the interrupt mask register on MT7915, since that prevents
MCU_CMD interrupts from being reported, thus causing timeouts during the
reset sequence. Defer stopping WED until tx/rx processing activity has
stopped.

Signed-off-by: Felix Fietkau <[email protected]>
2024-01-18 15:51:57 +01:00
Felix Fietkau f559adf184 wifi: mt76: fix crash with WED rx support enabled
If WED rx is enabled, rx buffers are added to a buffer pool that can be
filled from multiple page pools. Because buffers freed from rx poll are
not guaranteed to belong to the processed queue's page pool, lockless
caching must not be used in this case.

Cc: [email protected]
Fixes: 2f5c3c77fc9b ("wifi: mt76: switch to page_pool allocator")
Signed-off-by: Felix Fietkau <[email protected]>
2023-12-08 08:43:42 +01:00
Felix Fietkau 7730fc91dd wifi: mt76: fix shift overflow warnings on 32 bit systems
Signed-off-by: Felix Fietkau <[email protected]>
2023-12-07 18:49:45 +01:00
Felix Fietkau 890ae4d717 wifi: mt76: mt76x02: fix MT76x0 external LNA gain handling
On MT76x0, LNA gain should be applied for both external and internal LNA.
On MT76x2, LNA gain should be treated as 0 for external LNA.
Move the LNA type based logic to mt76x2 in order to fix mt76x0.

Fixes: 2daa67588f34 ("mt76x0: unify lna_gain parsing")
Reported-by: Shiji Yang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-09-19 21:48:01 +02:00
Felix Fietkau 8d5ea32d48 wifi: mt76: remove unused error path in mt76_connac_tx_complete_skb
The error handling code was added in order to allow tx enqueue to fail after
calling .tx_prepare_skb. Since this can no longer happen, the error handling
code is unused.

Signed-off-by: Felix Fietkau <[email protected]>
2023-09-11 15:15:19 +02:00
Felix Fietkau cd371fcc98 mt76: mt7996: sync with upstream
Signed-off-by: Felix Fietkau <[email protected]>
2023-09-11 13:10:51 +02:00
Felix Fietkau f1e1e67d97 wifi: mt76: fix race condition related to checking tx queue fill status
When drv_tx calls race against local tx scheduling, the queue fill status checks
can potentially race, leading to dma queue entries being overwritten.
Fix this by deferring packets from drv_tx calls to the tx worker, in order to
ensure that all regular queue tx comes from the same context.

Signed-off-by: Felix Fietkau <[email protected]>
2023-09-11 13:10:34 +02:00
Felix Fietkau bbbac7deee wifi: mt76: rename mt76_packet_id_init/flush to mt76_wcid_init/cleanup
Also un-inline the functions. Will be used for further wcid init/cleanup

Signed-off-by: Felix Fietkau <[email protected]>
2023-09-11 13:10:34 +02:00
Felix Fietkau b5d13611d3 mt76: mt7915: fix monitor mode issues
Enable receiving other-unicast packets
Disable RX header translation in order to proprerly receive data packets

Signed-off-by: Felix Fietkau <[email protected]>
2023-09-11 13:10:34 +02:00
Felix Fietkau b14c2351dd wifi: mt76: mt7603: disable A-MSDU tx support on MT7628
It was reported that this can cause the PSE hang issues, even with a low
number of fragments.

Link: https://github.com/openwrt/mt76/issues/793#issuecomment-1676529138
Signed-off-by: Felix Fietkau <[email protected]>
2023-08-14 21:33:36 +02:00
Felix Fietkau 85cc58378d wifi: mt76: mt7603: add missing register initialization for MT7628
Ported from the vendor driver code

Signed-off-by: Felix Fietkau <[email protected]>
2023-08-14 14:08:13 +02:00
Felix Fietkau c03d84c0d0 wifi: mt76: mt7603: improve stuck beacon handling
Before preparing the new beacon, check the queue status, flush out all
previous beacons and buffered multicast packets, then (if necessary)
try to recover more gracefully from a stuck beacon condition by making a
less invasive attempt at getting the MAC un-stuck.

Fixes: c8846e101502 ("mt76: add driver for MT7603E and MT7628/7688")
Signed-off-by: Felix Fietkau <[email protected]>
2023-08-14 14:08:13 +02:00
Felix Fietkau a8d9553d8f wifi: mt76: mt7603: improve watchdog reset reliablity
Only trigger PSE reset if PSE was stuck, otherwise it can cause DMA issues.
Trigger the PSE reset while DMA is fully stopped in order to improve
reliabilty.

Fixes: c8846e101502 ("mt76: add driver for MT7603E and MT7628/7688")
Signed-off-by: Felix Fietkau <[email protected]>
2023-08-14 14:08:13 +02:00
Felix Fietkau 80b8bcf0e3 wifi: mt76: mt7603: rework/fix rx pse hang check
It turns out that the code in mt7603_rx_pse_busy() does not detect actual
hardware hangs, it only checks for busy conditions in PSE.
A reset should only be performed if these conditions are true and if there
is no rx activity as well.
Reset the counter whenever a rx interrupt occurs. In order to also deal with
a fully loaded CPU that leaves interrupts disabled with continuous NAPI
polling, also check for pending rx interrupts in the function itself.

Fixes: c8846e101502 ("mt76: add driver for MT7603E and MT7628/7688")
Signed-off-by: Felix Fietkau <[email protected]>
2023-08-14 14:08:13 +02:00
Felix Fietkau 7ef4dd12d9 wifi: mt76: mt7603: fix tx filter/flush function
Setting MT_TX_ABORT does not abort any transmission for a wtbl index on its
own. Instead, it modifies the behavior of a queue flush to make it selectively
flush packets for a particular wtbl index.
Adjust powersave filtering to make use of this in order to avoid running into
unnecessary timeouts while flushing

Signed-off-by: Felix Fietkau <[email protected]>
2023-07-25 21:06:12 +02:00
Felix Fietkau 53edfc7aaa wifi: mt76: mt7603: fix beacon interval after disabling a single vif
When disabling beacons on a vif, intval is 0. Ensure that dev->mt76.beacon_int
is not overwritten in this case, so that beacons continue to work for other
interfaces.

Signed-off-by: Felix Fietkau <[email protected]>
2023-07-25 12:38:02 +02:00
Felix Fietkau bb3937d5c3 wifi: mt76: mt7915: remove VHT160 capability on MT7915
The IEEE80211_VHT_CAP_EXT_NSS_BW value already indicates support for half-NSS
160 MHz support, so it is wrong to also advertise full 160 MHz support.

Fixes: c2f73eacee3b ("wifi: mt76: mt7915: add back 160MHz channel width support for MT7915")
Signed-off-by: Felix Fietkau <[email protected]>
2023-07-14 10:59:20 +02:00
Felix Fietkau f704e4f83c mt76: mt7915: fix copy&paste issue on capability check rework
Fixes disabling capabilities in AP mode via config

Reported-by: Money Wang (王信安) <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-07-04 06:04:08 +02:00
Felix Fietkau 1377f586c6 wifi: mt7915: move capability check to start_ap
Avoid using it for non-AP modes

Signed-off-by: Felix Fietkau <[email protected]>
2023-06-30 11:01:52 +02:00
Felix Fietkau d7d7479b00 wifi: mt7915: fix beaconing in mesh mode
The bringup sequence was fixed for AP mode, but not mesh

Signed-off-by: Felix Fietkau <[email protected]>
2023-06-30 11:01:20 +02:00
Felix Fietkau c50be0b54c wifi: mt76: mt7915: fix capabilities in non-AP mode
Capabilities in vif->bss_conf are only initialized in AP mode.
For other modes, they should be enabled by default, in order to avoid a
mismatch.

Fixes: 885f7af7e544 ("wifi: mt76: mt7915: remove mt7915_mcu_beacon_check_caps()")
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-29 22:40:04 +02:00
Felix Fietkau f36b921692 Revert "wifi: mt76: mt76x02: remove WEP support
This reverts commit 40f6e433f7.

Signed-off-by: Felix Fietkau <[email protected]>
2023-06-27 13:37:05 +02:00
Felix Fietkau c85a0f2f09 mt7921: remove duplicated line
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-18 11:47:29 +02:00
Felix Fietkau d63cb85c12 wifi: mt76: add missing locking to protect against concurrent rx/status calls
According to the documentation, ieee80211_rx_list must not run concurrently
with ieee80211_tx_status (or its variants).

Cc: [email protected]
Fixes: 88046b2c9f6d ("mt76: add support for reporting tx status with skb")
Reported-by: Brian Coverstone <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 15:46:10 +02:00