Commit Graph
3350 Commits
Author SHA1 Message Date
Felix Fietkau de38fe7d4c wifi: mt76: ignore key disable commands
This helps avoid cleartext leakage of already queued or powersave buffered
packets, when a reassoc triggers the key deletion.

Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
(cherry picked from commit efa44cb57f)
2023-08-26 15:36:02 +02:00
Felix Fietkau f27ff9a8fb mt76: adjust for ieee80211_is_bufferable_mmpdu API change
Signed-off-by: Felix Fietkau <[email protected]>
(cherry picked from commit 22f1b7776d)
2023-08-26 15:35:06 +02:00
Mordechay GoodsteinandFelix Fietkau b144bd2005 ieee80211: add EHT 1K aggregation definitions
We add the fields for parsing extended ADDBA request/respond,
and new max 1K aggregation for limit ADDBA request/respond.

Adjust drivers to use the proper macro, IEEE80211_MAX_AMPDU_BUF ->
IEEE80211_MAX_AMPDU_BUF_HE.

Signed-off-by: Mordechay Goodstein <[email protected]>
Link: https://lore.kernel.org/r/20220214173004.b8b447ce95b7.I0ee2554c94e89abc7a752b0f7cc7fd79c273efea@changeid
Signed-off-by: Johannes Berg <[email protected]>
(cherry picked from commit fa4ace8e3b)
2023-08-26 15:34:32 +02:00
Felix Fietkau 11f2efecb1 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]>
(cherry picked from commit b14c2351dd)
2023-08-26 15:05:59 +02:00
Felix Fietkau eb57b7e35f wifi: mt76: mt7603: add missing register initialization for MT7628
Ported from the vendor driver code

Signed-off-by: Felix Fietkau <[email protected]>
(cherry picked from commit 85cc58378d)
2023-08-26 15:05:59 +02:00
Felix Fietkau aa309b5c2a 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]>
(cherry picked from commit c03d84c0d0)
2023-08-26 15:05:59 +02:00
Felix Fietkau 283c46fd1d 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]>
(cherry picked from commit a8d9553d8f)
2023-08-26 15:05:59 +02:00
Felix Fietkau 780ea78ba0 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]>
(cherry picked from commit 80b8bcf0e3)
2023-08-26 15:05:59 +02:00
Felix Fietkau 2cbd5df8cf 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]>
(cherry picked from commit 7ef4dd12d9)
2023-08-26 15:05:17 +02:00
Felix Fietkau 9dda9f709c 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]>
(cherry picked from commit 53edfc7aaa)
2023-08-26 15:05:12 +02:00
Felix Fietkau 148b7fa232 wifi: mt76: fix rx checksum offload on mt7615/mt7915/mt7921
Checking the relevant rxd bits for the checksum information only indicates
if the checksum verification was performed by the hardware and doesn't show
actual checksum errors. Checksum errors are indicated in the info field of
the DMA descriptor. Fix packets erroneously marked as CHECKSUM_UNNECESSARY
by checking the extra bits as well.
Those bits are only passed to the driver for MMIO devices at the moment, so
limit checksum offload to those.

Fixes: 2122dfbfd0bd ("mt76: mt7615: add rx checksum offload support")
Fixes: 94244d2ea503 ("mt76: mt7915: add rx checksum offload support")
Fixes: 0e75732764e8 ("mt76: mt7921: enable rx csum offload")
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-10 12:19:20 +02:00
Felix Fietkau 843955920e wifi: mt76: fix receiving LLC packets on mt7615/mt7915
When 802.3 decap offload is enabled, the hardware indicates header translation
failure, whenever either the LLC-SNAP header was not found, or a VLAN header
with an unregcognized tag is present.
In that case, the hardware inserts a 2-byte length fields after the MAC
addresses. For VLAN packets, this tag needs to be removed. However,
for 802.3 LLC packets, the length bytes should be preserved, since there
is no separate ethertype field in the data.
This fixes an issue where the length field was omitted for LLC frames, causing
them to be malformed after hardware decap.

Fixes: 1eeff0b4c1a6 ("mt76: mt7915: fix decap offload corner case with 4-addr VLAN frames")
Reported-by: Chad Monroe <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-10 12:19:16 +02:00
Felix Fietkau 1b80532eb5 wifi: mt76: mt7921: set MT_DRV_AMSDU_OFFLOAD for USB/SDIO
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-10 12:19:11 +02:00
Ben GreearandFelix Fietkau 7df5b45147 Revert "mt76: use IEEE80211_OFFLOAD_ENCAP_ENABLED instead of MT_DRV_AMSDU_OFFLOAD"
This reverts commit f17f4864504d754bcbf31e4c89412cdf9946c409.

The reverted commit significantly decreases performance when running
a test where two MT7915 radios have 16 station vdevs each, configured
for AC mode, and transmitting UDP traffic to AP.

Reported-by: Carson Vandegriffe <[email protected]>
Signed-off-by: Ben Greear <[email protected]>
2022-10-01 17:15:16 +02:00
Felix Fietkau 676b10bb20 mt76: mt76x02: fix vht rate power array overrun
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 17:15:15 +02:00
Lorenzo BianconiandFelix Fietkau d554a02554 wifi: mt76: mt7915: move wed init routines in mmio.c
This is a preliminary patch to enable wed support for mt7986-wmac
chipset.

Tested-by: Daniel Golle <[email protected]>
Co-developed-by: Bo Jiao <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 14:59:42 +02:00
Ryder LeeandFelix Fietkau 2b8f56a72d wifi: mt76: mt7915: fix mt7915_mac_set_timing()
Correct mac timiing settings for different hardware generations.
This improves 40-60Mbps performance.

Fixes: 9aac2969fe5f ("mt76: mt7915: update mac timing settings")
Reported-By: Carson Vandegriffe <[email protected]>
Tested-by: Chad Monroe <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 14:38:20 +02:00
Shayne ChenandFelix Fietkau db6db4ded0 wifi: mt76: mt7915: set correct antenna for radar detection on MT7915D
For MT7915D, correct antenna index should be set to let DFS radar
detection work on the 5 GHz band.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 14:38:20 +02:00
Shayne ChenandFelix Fietkau 48c116d929 wifi: mt76: mt7915: add spatial extension index support
In previous, we only allow user to configure tx antenna mask
contiguously (e.g. 0x3, 0xf).
This patch allows user to configure tx antenna mask interleavingly
(e.g. 0x5, 0x8). By setting proper antenna mask and nss, user can
prioritized the signal of different antennas, which helps to test
their performance in normal mode.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 14:38:20 +02:00
Shayne ChenandFelix Fietkau 6dee964e1f wifi: mt76: connac: introduce mt76_connac_spe_idx()
Add mt76_connac_spe_idx() for antenna mask to spatial extension
index conversion. This is used to support flexible control of
tx antenna.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 14:38:05 +02:00
Shayne ChenandFelix Fietkau b0114a0abb wifi: mt76: mt7915: rework testmode tx antenna setting
Let the configuration of testmode antenna mask on both band0 and band1
become antenna_mask rather than chainmask. This could simplify the
settings for user and get rid of the conversion when sending fw command.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 14:38:05 +02:00
Peter ChiuandFelix Fietkau 6606507317 wifi: mt76: mt7915: deal with special variant of mt7916
A variant of mt7916 supports up to 3 tx/rx paths but with only
2 spatial streams. An example usage of the 3rd path is to server as
an auxiliary for beamforming.
In order to deal with this case, this patch reworks some parts to
correctly use paths or streams.

Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 14:38:05 +02:00
Shayne ChenandFelix Fietkau ad3d0f8db0 wifi: mt76: mt7915: rework eeprom tx paths and streams init
Rework tx paths and streams init part to improve readability, and make
sure that the available tx streams should be smaller than or equal to
the available tx paths.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 14:38:05 +02:00
Evelyn TsaiandFelix Fietkau 06df7e6892 wifi: mt76: mt7915: reserve 8 bits for the index of rf registers
The value of regidx of rf registers is combined with WF selection and
offset. Extend the WF selection field from 4 to 8 bits since the
adie index should also be specified.

Signed-off-by: Evelyn Tsai <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 14:38:05 +02:00
Ben GreearandFelix Fietkau d75f15ddeb wifi: mt76: mt7915: fix bounds checking for tx-free-done command
According to the tx-free-done documentation, the DW4 can be repeated,
so have to be more careful about how we test for walking off the
end of the array.

Signed-off-by: Ben Greear <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 14:38:05 +02:00
Gaosheng CuiandFelix Fietkau 9059a5de3b wifi: mt76: Remove unused inline function mt76_wcid_mask_test()
All uses of mt76_wcid_mask_test() have
been removed since commit 8950a62f19c9 ("mt76: get rid of
mt76_wcid_hw routine"), so remove it.

Signed-off-by: Gaosheng Cui <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 14:38:05 +02:00
Sean WangandFelix Fietkau c07f3d2d5e wifi: mt76: mt7921: fix antenna signal are way off in monitor mode
Group 3 in RxD is disabled in monitor mode. We should use the group 5 in
RxD instead to fix antenna signal way off issue, e.g we would see the
incorrect antenna signal value in wireshark. On the other hand, Group 5
wouldn't be used in STA or AP mode, so the patch shouldn't cause any
harm to those modes.

Fixes: cbaa0a404f8d ("mt76: mt7921: fix up the monitor mode")
Reported-by: Adrian Granados <[email protected]>
Co-developed-by: Deren Wu <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 14:38:05 +02:00
Felix Fietkau 3f27f6adb1 wifi: mt76: mt76x02: simplify struct mt76x02_rate_power
- remove stbc, because mt76x0 doesn't support it and mt76x2 uses the same
  values as HT/VHT
- reduce vht array to 2 elements, because VHT MCS0-7 are the same as HT

Signed-off-by: Felix Fietkau <[email protected]>
2022-09-28 11:29:46 +02:00
Felix Fietkau e49b6063fb wifi: mt76: move mt76_rate_power from core to mt76x02 driver code
Its layout and code is mt76x02 specific

Signed-off-by: Felix Fietkau <[email protected]>
2022-09-28 11:29:15 +02:00
Deren WuandFelix Fietkau 9d601f4eee linux-firmware: update firmware for MT7922 WiFi device
Update binary firmware for MT7922 WiFi devices

File: firmware/WIFI_MT7922_patch_mcu_1_1_hdr.bin
Version: 20220908203203a
File: firmware/WIFI_RAM_CODE_MT7922_1.bin
Version: 20220908203253

Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Josh Boyer <[email protected]>
2022-09-23 14:50:37 +02:00
Deren WuandFelix Fietkau 60fcf08fe6 linux-firmware: update firmware for MT7921 WiFi device
Update binary firmware for MT7921 WiFi devices

File: firmware/WIFI_MT7961_patch_mcu_1_2_hdr.bin
Version: 20220908210919a
File: firmware/WIFI_RAM_CODE_MT7961_1.bin
Version: 20220908211021

Signed-off-by: Deren Wu <[email protected]>
2022-09-23 14:46:01 +02:00
Deren WuandFelix Fietkau e4fa68a9b3 linux-firmware: update firmware for MT7921 WiFi device
Update binary firmware for MT7921 WiFi devices

File: firmware/WIFI_MT7961_patch_mcu_1_2_hdr.bin
Version: 20220608210839a
File: firmware/WIFI_RAM_CODE_MT7961_1.bin
Version: 20220608210922

Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Josh Boyer <[email protected]>
2022-09-23 14:45:58 +02:00
Deren WuandFelix Fietkau 763a1d9013 wifi: mt76: mt7921e: fix random fw download fail
In case of PCIe interoperability problem shows up, the firmware
payload may be corrupted in download stage. Turn off L0s to keep
fw download process accurately.

[ 1093.528363] mt7921e 0000:3b:00.0: Message 00000007 (seq 7) timeout
[ 1093.528414] mt7921e 0000:3b:00.0: Failed to start patch
[ 1096.600156] mt7921e 0000:3b:00.0: Message 00000010 (seq 8) timeout
[ 1096.600207] mt7921e 0000:3b:00.0: Failed to release patch semaphore
[ 1097.699031] mt7921e 0000:3b:00.0: Timeout for driver own
[ 1098.758427] mt7921e 0000:3b:00.0: Timeout for driver own
[ 1099.834408] mt7921e 0000:3b:00.0: Timeout for driver own
[ 1100.915264] mt7921e 0000:3b:00.0: Timeout for driver own
[ 1101.990625] mt7921e 0000:3b:00.0: Timeout for driver own
[ 1103.077587] mt7921e 0000:3b:00.0: Timeout for driver own
[ 1104.173258] mt7921e 0000:3b:00.0: Timeout for driver own
[ 1105.248466] mt7921e 0000:3b:00.0: Timeout for driver own
[ 1106.336969] mt7921e 0000:3b:00.0: Timeout for driver own
[ 1106.397542] mt7921e 0000:3b:00.0: hardware init failed

Cc: [email protected]
Fixes: bf3747ae2e25 ("mt76: mt7921: enable aspm by default")
Signed-off-by: Deren Wu <[email protected]>
Tested-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:15:49 +02: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
Deren WuandFelix Fietkau cddc4b43ea wifi: mt76: mt7921e: fix rmmod crash in driver reload test
In insmod/rmmod stress test, the following crash dump shows up immediately.
The problem is caused by missing mt76_dev in mt7921_pci_remove(). We
should make sure the drvdata is ready before probe() finished.

[168.862789] ==================================================================
[168.862797] BUG: KASAN: user-memory-access in try_to_grab_pending+0x59/0x480
[168.862805] Write of size 8 at addr 0000000000006df0 by task rmmod/5361
[168.862812] CPU: 7 PID: 5361 Comm: rmmod Tainted: G           OE     5.19.0-rc6 #1
[168.862816] Hardware name: Intel(R) Client Systems NUC8i7BEH/NUC8BEB, 05/04/2020
[168.862820] Call Trace:
[168.862822]  <TASK>
[168.862825]  dump_stack_lvl+0x49/0x63
[168.862832]  print_report.cold+0x493/0x6b7
[168.862845]  kasan_report+0xa7/0x120
[168.862857]  kasan_check_range+0x163/0x200
[168.862861]  __kasan_check_write+0x14/0x20
[168.862866]  try_to_grab_pending+0x59/0x480
[168.862870]  __cancel_work_timer+0xbb/0x340
[168.862898]  cancel_work_sync+0x10/0x20
[168.862902]  mt7921_pci_remove+0x61/0x1c0 [mt7921e]
[168.862909]  pci_device_remove+0xa3/0x1d0
[168.862914]  device_remove+0xc4/0x170
[168.862920]  device_release_driver_internal+0x163/0x300
[168.862925]  driver_detach+0xc7/0x1a0
[168.862930]  bus_remove_driver+0xeb/0x2d0
[168.862935]  driver_unregister+0x71/0xb0
[168.862939]  pci_unregister_driver+0x30/0x230
[168.862944]  mt7921_pci_driver_exit+0x10/0x1b [mt7921e]
[168.862949]  __x64_sys_delete_module+0x2f9/0x4b0
[168.862968]  do_syscall_64+0x38/0x90
[168.862973]  entry_SYSCALL_64_after_hwframe+0x63/0xcd

Test steps:
1. insmode
2. do not ifup
3. rmmod quickly (within 1 second)

Fixes: 1c71e03afe4b ("mt76: mt7921: move mt7921_init_hw in a dedicated work")
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:15:49 +02:00
Sean WangandFelix Fietkau 0c0bda4aea wifi: mt76: mt7921: reset msta->airtime_ac while clearing up hw value
We should reset mstat->airtime_ac along with clear up the entries in the
hardware WLAN table for the Rx and Rx accumulative airtime. Otherwsie, the
value msta->airtime_ac - [tx, rx]_last may be a negative and that is not
the actual airtime the device took in the last run.

Reported-by: YN Chen <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:15:49 +02:00
Howard HsuandFelix Fietkau e06376af21 wifi: mt76: mt7915: do not check state before configuring implicit beamform
Do not need to check running state before configuring implicit Tx
beamform. It is okay to configure implicit Tx beamform in run time.
Noted that the existing connected stations will be applied for new
configuration only if they reconnected to the interface.

Fixes: 6377b7f330 ("mt76: mt7915: add implicit Tx beamforming support")

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:15:49 +02:00
Lorenzo BianconiandFelix Fietkau 5e45533e4b wifi: mt76: fix uninitialized pointer in mt7921_mac_fill_rx
Initialize msta pointer to NULL in mt7921_mac_fill_rx() in order to not
dereference a uninitialized pointer.

Fixes: 0880d40871d1d ("mt76: connac: move mt76_connac2_reverse_frag0_hdr_trans in mt76-connac module")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:15:49 +02:00
Howard HsuandFelix Fietkau 2ac22300c7 wifi: mt76: mt7915: fix mcs value in ht mode
Fix the error that mcs will be reduced to a range of 0 to 7 in ht mode.

Fixes: 70fd1333cd32 ("mt76: mt7915: rework .set_bitrate_mask() to support more options")

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:15:49 +02:00
Sean WangandFelix Fietkau d11f971a45 wifi: mt76: mt7921: get rid of the false positive reset
False positive reset would be possibly triggered by those commands we
applied in suspend with HZ MCU timeout, especially it happened when we
enabled kernel log in pm core to diagnose how much time we spend in each
driver during suspend procedure. So we enlarge the value and align the MCU
timeout as other commands we did to reduce the false positive reset.

Signed-off-by: Sean Wang <[email protected]>
Acked-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:14:11 +02:00
Ruffalo LavoisierandFelix Fietkau 0c64a80a61 wifi: mt76: connac: fix in comment
Correct spelling on 'transmitted' in comment

Signed-off-by: Ruffalo Lavoisier <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:14:11 +02:00
Ryder LeeandFelix Fietkau 873365b06c wifi: mt76: add PPDU based TxS support for WED device
Given that there's no data coming from network stack for binding flows,
hence driver counts and reports station's statistics directly through
NL80211_STA_INFO_* based on active PPDU based TxS for offloading data.

Apart from that, WA firmware and its offloading engine (SDO) have hardcoded
"2" as PID, so we introduce MT_PACKET_ID_WED to differentiate WED reporting.

Note that PPDU format TxS is mutually exclusive with MT_TXD5_TX_STATUS_HOST.

Co-developed-by: Yi-Chia Hsieh <[email protected]>
Signed-off-by: Yi-Chia Hsieh <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:14:11 +02:00
Ryder LeeandFelix Fietkau 2d72c9a740 wifi: mt76: move move mt76_sta_stats to mt76_wcid
This is a preliminary patch for WED's TxS support.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:14:11 +02:00
Sean WangandFelix Fietkau b55a4eb2ee wifi: mt76: mt7921: fix the firmware version report
Fix the regression of the firmware version report since
'b9ec27102ac0 ('mt76: connac: move mt76_connac2_load_ram in connac
module')'.

Fixes: b9ec27102ac0 ("mt76: connac: move mt76_connac2_load_ram in connac module")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:14:11 +02:00
Sean WangandFelix Fietkau fbb3554b62 wifi: mt76: mt7921: add mt7921_mutex_acquire at mt7921_sta_set_decap_offload
Add mt7921_mutex_acquire at mt7921_[start, stop]_ap to fix the race
with the context holding dev->muxtex and the driver might access the
device in low power state.

Fixes: 24299fc869f7 ("mt76: mt7921: enable rx header traslation offload")
Tested-by: AngeloGioacchino Del Regno <[email protected]>
Acked-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:14:11 +02:00
Sean WangandFelix Fietkau 0a392ca03d wifi: mt76: mt7921: add mt7921_mutex_acquire at mt7921_[start, stop]_ap
Add mt7921_mutex_acquire at mt7921_[start, stop]_ap to fix the race
with the context holding dev->muxtex and the driver might access the
device in low power state.

Fixes: 9d958b60ebc2 ("mt76: mt7921: fix command timeout in AP stop period")
Tested-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Acked-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:14:11 +02:00
Gergo KotelesandFelix Fietkau 019ef069e7 wifi: mt76: mt76_usb.mt76u_mcu.burst is always false remove related code
Simplify mt76x02u_multiple_mcu_reads routine since burst is always
false.

Signed-off-by: Gergo Koteles <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:14:11 +02:00
Lorenzo BianconiandFelix Fietkau 52eec74986 wifi: mt76: mt7663s: add rx_check callback
Introduce rx_check callback support for mt7663s driver.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:14:11 +02:00
Lorenzo BianconiandFelix Fietkau c4132ab0be wifi: mt76: connac: fix possible unaligned access in mt76_connac_mcu_add_nested_tlv
Fix possible unaligned pointer in mt76_connac_mcu_add_nested_tlv
routine.

Reported-by: kernel test robot <[email protected]>
Fixes: 25702d9c55dc5 ("mt76: connac: rely on le16_add_cpu in mt76_connac_mcu_add_nested_tlv")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:14:11 +02:00
Lorenzo BianconiandFelix Fietkau bf79f5d73e wifi: mt76: mt7915: fix possible unaligned access in mt7915_mac_add_twt_setup
Fix possible unaligned pointer in mt7915_mac_add_twt_setup routine.

Reported-by: kernel test robot <[email protected]>
Fixes: 3782b69d03e71 ("mt76: mt7915: introduce mt7915_mac_add_twt_setup routine")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:14:11 +02:00