Commit Graph
2427 Commits
Author SHA1 Message Date
Lorenzo BianconiandFelix Fietkau ee6dbcc64f mt76: connac: fix kernel warning adding monitor interface
Fix the following kernel warning adding a monitor interface in
mt76_connac_mcu_uni_add_dev routine.

[  507.984882] ------------[ cut here ]------------
[  507.989515] WARNING: CPU: 1 PID: 3017 at mt76_connac_mcu_uni_add_dev+0x178/0x190 [mt76_connac_lib]
[  508.059379] CPU: 1 PID: 3017 Comm: ifconfig Not tainted 5.4.98 #0
[  508.065461] Hardware name: MT7622_MT7531 RFB (DT)
[  508.070156] pstate: 80000005 (Nzcv daif -PAN -UAO)
[  508.074939] pc : mt76_connac_mcu_uni_add_dev+0x178/0x190 [mt76_connac_lib]
[  508.081806] lr : mt7921_eeprom_init+0x1288/0x1cb8 [mt7921e]
[  508.087367] sp : ffffffc013a33930
[  508.090671] x29: ffffffc013a33930 x28: ffffff801e628ac0
[  508.095973] x27: ffffff801c7f1200 x26: ffffff801c7eb008
[  508.101275] x25: ffffff801c7eaef0 x24: ffffff801d025610
[  508.106577] x23: ffffff801d022990 x22: ffffff801d024de8
[  508.111879] x21: ffffff801d0226a0 x20: ffffff801c7eaee8
[  508.117181] x19: ffffff801d0226a0 x18: 000000005d00b000
[  508.122482] x17: 00000000ffffffff x16: 0000000000000000
[  508.127785] x15: 0000000000000080 x14: ffffff801d704000
[  508.133087] x13: 0000000000000040 x12: 0000000000000002
[  508.138389] x11: 000000000000000c x10: 0000000000000000
[  508.143691] x9 : 0000000000000020 x8 : 0000000000000001
[  508.148992] x7 : 0000000000000000 x6 : 0000000000000000
[  508.154294] x5 : ffffff801c7eaee8 x4 : 0000000000000006
[  508.159596] x3 : 0000000000000001 x2 : 0000000000000000
[  508.164898] x1 : ffffff801c7eac08 x0 : ffffff801d0226a0
[  508.170200] Call trace:
[  508.172640]  mt76_connac_mcu_uni_add_dev+0x178/0x190 [mt76_connac_lib]
[  508.179159]  mt7921_eeprom_init+0x1288/0x1cb8 [mt7921e]
[  508.184394]  drv_add_interface+0x34/0x88 [mac80211]
[  508.189271]  ieee80211_add_virtual_monitor+0xe0/0xb48 [mac80211]
[  508.195277]  ieee80211_do_open+0x86c/0x918 [mac80211]
[  508.200328]  ieee80211_do_open+0x900/0x918 [mac80211]
[  508.205372]  __dev_open+0xcc/0x150
[  508.208763]  __dev_change_flags+0x134/0x198
[  508.212937]  dev_change_flags+0x20/0x60
[  508.216764]  devinet_ioctl+0x3e8/0x748
[  508.220503]  inet_ioctl+0x1e4/0x350
[  508.223983]  sock_do_ioctl+0x48/0x2a0
[  508.227635]  sock_ioctl+0x310/0x4f8
[  508.231116]  do_vfs_ioctl+0xa4/0xac0
[  508.234681]  ksys_ioctl+0x44/0x90
[  508.237985]  __arm64_sys_ioctl+0x1c/0x48
[  508.241901]  el0_svc_common.constprop.1+0x7c/0x100
[  508.246681]  el0_svc_handler+0x18/0x20
[  508.250421]  el0_svc+0x8/0x1c8
[  508.253465] ---[ end trace c7b90fee13d72c39 ]---
[  508.261278] ------------[ cut here ]------------

Fixes: d0e274af2f2e4 ("mt76: mt76_connac: create mcu library")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Ryder LeeandFelix Fietkau 8a5b036af4 mt76: mt7915: fix mib stats counter reporting to mac80211
In order to properly report MIB counters to mac80211, resets stats in
mt7915_get_stats routine() and hold mt76 mutex accessing MIB counters.
Sum up MIB counters in mt7915_mac_update_mib_stats routine.

Fixes: c6b002bcdf ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Lorenzo BianconiandFelix Fietkau f60ec1b947 mt76: mt7615: fix mib stats counter reporting to mac80211
In order to properly report MIB counters to mac80211, resets stats in
mt7615_get_stats routine and hold mt76 mutex accessing MIB counters.
Sum up MIB counters in mt7615_mac_update_mib_stats routine.

Fixes: c388d8584bc83 ("mt76: mt7615: add a get_stats() callback")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Ryder LeeandFelix Fietkau 1a2e2965b6 mt76: mt7615: remove hdr->fw_ver check
Only mt7615 uses v1 version. Also, some of released firmware doesn't
have hdr->fw_ver.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Ryder LeeandFelix Fietkau 1b245e5754 mt76: mt7615: fix TSF configuration
The index of TSF counters should follow HWBSSID.

Fixes: cd79526761 ("mt76: mt7615: support 16 interfaces")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Lorenzo BianconiandFelix Fietkau 2856dc8fb5 mt76: mt7921: fix stats register definitions
Fix register definitions for mac80211 stats reporting.
Move mib counter reset to mt7921_get_stats routine.

Fixes: 163f4d22c118d ("mt76: mt7921: add MAC support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Jiapeng ChongandFelix Fietkau 10a95da23c mt76: mt7921: remove unneeded semicolon
Fix the following coccicheck warnings:

./drivers/net/wireless/mediatek/mt76/mt7921/mac.c:1402:2-3: Unneeded
semicolon.

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Jiapeng Chong <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Lorenzo BianconiandFelix Fietkau 84229a5184 mt76: mt7915: fix aggr len debugfs node
Similar to mt7921, fix 802.11 aggr len debugfs reporting for mt7915 driver.

Fixes: e57b7901469fc ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Lorenzo BianconiandFelix Fietkau 760adce291 mt76: mt7921: fix aggr length histogram
Fix register definitions for 802.11 aggr length histogram estimation.

Fixes: 474a9f21e2e2 ("mt76: mt7921: add debugfs support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Lorenzo BianconiandFelix Fietkau 8e3bba8bd3 mt76: mt7615: fix memory leak in mt7615_coredump_work
Similar to the issue fixed in mt7921_coredump_work, fix a possible memory
leak in mt7615_coredump_work routine.

Fixes: d2bf7959d9c0f ("mt76: mt7663: introduce coredump support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Ryder LeeandFelix Fietkau 8e3f5bfe74 mt76: mt7615: add support for rx decapsulation offload
For AP and Client mode, the hardware can pass received packets
as 802.3 frames that can be passed to the network stack as-is.

Tested-by: Frank Wunderlich <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Ryder LeeandFelix Fietkau 9002b0b30a mt76: mt7615: add rx checksum offload support
Set skb->ip_summed to CHECKSUM_UNNECESSARY if the hardware has validated
the IP and TCP/UDP checksum

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Ryder LeeandFelix Fietkau c5aca6692c mt76: mt7615: enable hw rx-amsdu de-aggregation
Enable hw rx-amsdu de-aggregation support.
This is a preliminary patch to enable rx checksum offload.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Lorenzo BianconiandFelix Fietkau 1706fb6c48 mt76: mt7663s: fix rx buffer refcounting
Similar to mt7601u driver, fix erroneous rx page refcounting

Fixes: a66cbdd6573d ("mt76: mt7615: introduce mt7663s support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/dca19c9d445156201bc41f7cbb6e894bbc9a678c.1610644945.git.lorenzo@kernel.org
2021-03-14 21:11:30 +01:00
Felix Fietkau bfa8d5a6a9 mt76: adjust to upstream API for enabling threaded NAPI
Create a second dummy device for tx napi to avoid making it threaded

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 17:36:54 +01:00
Sean WangandFelix Fietkau fd2c59d9ba mt76: mt7921: fixup rx bitrate statistics [v2 update]
Since the related rx bitrate fields have been moved to group3 in Rxv,
fix rx bitrate statistics in mt7921_mac_fill_rx routine.

Fixes: 163f4d22c118d ("mt76: mt7921: add MAC support")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-12 13:27:33 +01:00
Sean WangandFelix Fietkau c267322f0b mt76: mt7921: switch to new api for hardware beacon filter [v2 update]
Current firmware only supports new api for enabling hardware beacon filter.

Fixes: 1d8efc741df80 ("mt76: mt7921: introduce Runtime PM support")
Beacon filter cmd have to rely on the associatied access point's beacon
interval and DTIM information.

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-12 13:27:33 +01:00
Sean WangandFelix Fietkau 27a54e8b68 mt76: mt7921: fix memory leak in mt7921_coredump_work
Fix possible memory leak in mt7921_coredump_work.

Fixes: 1c099ab44727c ("mt76: mt7921: add MCU support")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-12 13:27:33 +01:00
Sean WangandFelix Fietkau 8a2e22fcbf mt76: mt7921: fix suspend/resume sequence
Any pcie access should happen in pci D0 state and we should give ownership
back to the device at the end of the suspend procedure.

Fixes: 1d8efc741df80 ("mt76: mt7921: introduce Runtime PM support")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-12 13:27:33 +01:00
Arnd BergmannandFelix Fietkau 7e1eff6762 mt76: mt7915: fix unused 'mode' variable
clang points out a possible corner case in the mt7915_tm_set_tx_cont()
function if called with invalid arguments:

drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:593:2: warning: variable 'mode' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
        default:
        ^~~~~~~
drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:597:13: note: uninitialized use occurs here
        rateval =  mode << 6 | rate_idx;
                   ^~~~
drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:506:37: note: initialize the variable 'mode' to silence this warning
        u8 rate_idx = td->tx_rate_idx, mode;
                                           ^

Change it to return an error instead of continuing with invalid data
here.

Fixes: 3f0caa3cbf94 ("mt76: mt7915: add support for continuous tx in testmode")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2021-03-12 13:27:28 +01:00
Felix Fietkau ab90451533 mt76: mt7915: only modify tx buffer list after allocating tx token id
Modifying the tx buffer list too early can leak DMA mappings

Signed-off-by: Felix Fietkau <[email protected]>
2021-02-16 14:49:09 +01:00
Felix Fietkau 6a3cf95733 mt76: fix tx skb error handling in mt76_dma_tx_queue_skb
When running out of room in the tx queue after calling drv->tx_prepare_skb,
the buffer list will already have been modified on MT7615 and newer drivers.
This can leak a DMA mapping and will show up as swiotlb allocation failures
on x86.

Fix this by moving the queue length check further up. This is less accurate,
since it can overestimate the needed room in the queue on MT7615 and newer,
but the difference is small enough to not matter in practice.

Signed-off-by: Felix Fietkau <[email protected]>
2021-02-16 14:46:04 +01:00
Felix Fietkau 289cd78045 mt76: mt7915: add support for rx decapsulation offload
For AP and Client mode, the hardware can pass received packets as 802.3 frames
that can be passed to the network stack as-is.

Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 12:26:01 +01:00
Felix Fietkau 4b7a68634f mt76: mt7915: add rx checksum offload support
Set skb->ip_summed to CHECKSUM_UNNECESSARY if the hardware has validated
the IP and TCP/UDP checksum

Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 12:26:01 +01:00
Lorenzo BianconiandFelix Fietkau 4c0811c647 mt76: mt7915: enable hw rx-amsdu de-aggregation
Enable hw rx-amsdu de-aggregation support available in 7915 devices.
This is a preliminary patch to enable rx checksum offload

Signed-off-by: Lorenzo Bianconi <[email protected]>
2021-02-14 12:26:01 +01:00
Felix Fietkau 0d7564d0d8 mt76: add support for 802.3 rx frames
Do not try to access the header when receiving them

Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 12:26:01 +01:00
John CrispinandFelix Fietkau 200c1b1c23 mac80211: rename csa counters to countdown counters
We want to reuse the functions and structs for other counters such as BSS
color change. Rename them to more generic names.

Signed-off-by: John Crispin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
2021-02-14 12:26:01 +01:00
Sean WangandFelix Fietkau 4492d801cb mt76: connac: update sched_scan cmd usage
Update sched_scan command usage according to the current firmware
submitted into linux-firmware.git.

Fixes: 80fc1e37c0eb ("mt76: mt7921: rely on mt76_connac_mcu module for sched_scan and hw_scan")
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 12:25:14 +01:00
Sean WangandFelix Fietkau 96b4c9874e mt76: mt7921: fix uninitialized pointer access in mt7921_get_wtbl_info
fix possible uninitialized pointer access in mt7921_get_wtbl_info
routine

[  270.073205] wlp1s0: deauthenticating from 9c:5c:8e:c9:93:14 by local choice (Reason: 3=DEAUTH_LEAVING)
[  270.094918] 8<--- cut here ---
[  270.097988] Unable to handle kernel NULL pointer dereference at virtual address 0000000a
[  270.106120] pgd = 7ac68838
[  270.108842] [0000000a] *pgd=00000000
[  270.112426] Internal error: Oops: 805 [#1] SMP ARM
[  270.117216] Modules linked in: mt7921e mt76_connac_lib mt76
[  270.122803] CPU: 0 PID: 7 Comm: kworker/u8:0 Tainted: G        W         5.11.0-rc2+ #67
[  270.130891] Hardware name: Mediatek Cortex-A7 (Device Tree)
[  270.136459] Workqueue: phy0 mt7921_mac_work [mt7921e]
[  270.141557] PC is at mt7921_get_wtbl_info+0x224/0x2d8 [mt7921e]
[  270.147498] LR is at 0x0
[  270.150026] pc : [<bf030398>]    lr : [<00000000>]    psr: 60000013

...

[  270.317696] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  270.325869] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[  270.334043] [<bf030398>] (mt7921_get_wtbl_info [mt7921e]) from [<bf02ea9c>] (mt7921_mac_work+0x298/0x2c0 [mt7921e])
[  270.344529] [<bf02ea9c>] (mt7921_mac_work [mt7921e]) from [<c013cde8>] (process_one_work+0x1f0/0x538)
[  270.353780] [<c013cde8>] (process_one_work) from [<c013d17c>] (worker_thread+0x4c/0x55c)
[  270.361874] [<c013d17c>] (worker_thread) from [<c01447a8>] (kthread+0x124/0x150)
[  270.369275] [<c01447a8>] (kthread) from [<c0100150>] (ret_from_fork+0x14/0x24)
[  270.376501] Exception stack(0xc19c7fb0 to 0xc19c7ff8)
[  270.381550] 7fa0:                                     00000000 00000000 00000000 00000000
[  270.389724] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  270.397896] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[  270.404509] Code: e59de012 e1cdc1b6 e1cdc1b8 e59dc016 (e582e00a)

Fixes: 1c099ab44727c ("mt76: mt7921: add MCU support")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 12:25:14 +01:00
Sean WangandFelix Fietkau 2d7b1d72b4 mt76: mt7921: add flush operation
add flush operation to make sure cfg80211_mlme_deauth is able to flush
the deauthtication frame into air immediately.

Co-developed-by: YN Chen <[email protected]>
Signed-off-by: YN Chen <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 12:25:14 +01:00
Sean WangandFelix Fietkau 2e2cb71901 mt76: mt7921: fixup rx bitrate statistics
Since the related rx bitrate fields have been moved to group3 in Rxv,
fix rx bitrate statistics in mt7921_mac_fill_rx routine.

Fixes: 163f4d22c118d ("mt76: mt7921: add MAC support")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 12:25:14 +01:00
Sean WangandFelix Fietkau 73fce2cbfa mt76: connac: fix up the setting for ht40 mode in mt76_connac_mcu_uni_add_bss
Use proper value for ht40 mode configuration in mt76_connac_mcu_uni_add_bss
routine and not ht20 one

Fixes: d0e274af2f2e4 ("mt76: mt76_connac: create mcu library")
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 12:25:14 +01:00
Sean WangandFelix Fietkau b5228e75e4 mt76: mt7921: switch to new api for hardware beacon filter
Current firmware only supports new api for enabling hardware beacon filter.

Fixes: 1d8efc741df80 ("mt76: mt7921: introduce Runtime PM support")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 12:25:14 +01:00
Ryder LeeandFelix Fietkau c7d98fc358 mt76: use PCI_VENDOR_ID_MEDIATEK to avoid open coded
Use PCI standard defines.

Signed-off-by: Ryder Lee <[email protected]>
Acked-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:34:10 +01:00
Lorenzo BianconiandFelix Fietkau 80a87412e9 mt76: mt7915: fix uninitialized variable in mt7915_tm_set_tx_cont()
Set MT_PHY_TYPE_OFDM as default value for mode variable in
mt7915_tm_set_tx_cont routine in order to proper initialize it even
for default case.

Fixes: 3f0caa3cbf94: "mt76: mt7915: add support for continuous tx in testmode"
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:30:00 +01:00
Lorenzo BianconiandFelix Fietkau 8da10d6f92 mt76: mt7915: always check return value from mt7915_mcu_alloc_wtbl_req
As done for mt76_connac_mcu_alloc_wtbl_req, even if this is not a real
bug since mt7915_mcu_alloc_wtbl_req routine can fails just if nskb is NULL,
always check return value from mt7915_mcu_alloc_wtbl_req in order to avoid
possible future mistake.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:30:00 +01:00
Lorenzo BianconiandFelix Fietkau a75302bcbf mt76: connac: always check return value from mt76_connac_mcu_alloc_wtbl_req
Even if this is not a real bug since mt76_connac_mcu_alloc_wtbl_req routine
can fails just if nskb is NULL , always check return value from
mt76_connac_mcu_alloc_wtbl_req in order to avoid possible future
mistake.

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:30:00 +01:00
David BauerandFelix Fietkau e6c0948ada mt76: mt76x0: disable GTK offloading
When operating two VAP on a MT7610 with encryption (PSK2, SAE, OWE),
only the first one to be created will transmit properly encrypteded
frames.

All subsequently created VAPs will sent out frames with the payload left
unencrypted, breaking multicast traffic (ICMP6 NDP) and potentially
disclosing information to a third party.

Disable GTK offloading and encrypt these frames in software to
circumvent this issue. THis only seems to be necessary on MT7610 chips,
as MT7612 is not affected from our testing.

Signed-off-by: David Bauer <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:30:00 +01:00
Ryder LeeandFelix Fietkau 994893d38d mt76: always use WTBL_MAX_SIZE for tlv allocation
Simplify WTBL defines.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:30:00 +01:00
Lorenzo BianconiandFelix Fietkau 781911f167 mt76: mt7921: removed unused definitions in mcu.h
Get rid of the following definitions in mt7921/mcu.h since they are not
actually used:
- MT7921_WTBL_UPDATE_MAX_SIZE
- MT7921_STA_UPDATE_MAX_SIZE
- MT7921_WTBL_UPDATE_BA_SIZE

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:30:00 +01:00
Nigel ChristianandFelix Fietkau b59e367747 mt76: mt7921: remove unnecessary variable
In mt7921_pm_set() the variable "ret" is initialized to zero
and then returned. Remove it and return zero.

Signed-off-by: Nigel Christian <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:30:00 +01:00
Lorenzo BianconiandFelix Fietkau ae6473f1d2 mt76: mt7921: enable random mac addr during scanning
Notify mac80211 mt7921 devices support random mac address during hw
frequency scanning

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:30:00 +01:00
Lorenzo BianconiandFelix Fietkau b09cc86445 mt76: dma: do not report truncated frames to mac80211
If the fragment is discarded in mt76_add_fragment() since shared_info
frag array is full, discard truncated frames and do not forward them to
mac80211.

Signed-off-by: Lorenzo Bianconi <[email protected]>
2021-02-14 11:27:25 +01:00
Sander VanheuleandFelix Fietkau 2659f6c6ea mt76: mt7615: support loading EEPROM for MT7613BE
EEPROM blobs for MT7613BE radios start with (little endian) 0x7663,
which is also the PCI device ID for this device. The EEPROM is required
for the radio to work at useful power levels, otherwise only the lowest
power level is available.

Suggested-by: Georgi Vlaev <[email protected]>
Tested-by: Stijn Segers <[email protected]>
Signed-off-by: Sander Vanheule <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:23:30 +01:00
Felix Fietkau 892f74d37e mt76: mt7915: fix tx skb dma unmap
The first pointer in the txp needs to be unmapped as well, otherwise it will
leak DMA mapping entries

Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:21:51 +01:00
Felix Fietkau b0ba039bc2 mt76: mt7615: fix tx skb dma unmap
The first pointer in the txp needs to be unmapped as well, otherwise it will
leak DMA mapping entries

Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:21:51 +01:00
Felix Fietkau 26658849a4 mt76: mt7615: fix key set/delete issues
There were multiple issues in the current key set/remove code:
- deleting a key with the previous key index deletes the current key
- BIP key would only be uploaded correctly initially and corrupted on rekey

Rework the code to better keep track of multiple keys and check for the
key index before deleting the current key

Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:21:34 +01:00
Lorenzo BianconiandFelix Fietkau 47eb00e134 mt76: mt7663: introduce coredump support
Similar to mt7921 devices, introduce coredump support for mt7663 chipset

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau 5f4f6792fb mt76: mt7921: add coredump support
Introduce coredump support to mt7921 driver.

The coredump would be produced when MCU met the fatal error or driver
sent out the specific cmd to force trigger it.

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Lorenzo BianconiandFelix Fietkau 0d95c6ad17 mt76: mt7921: enable MSI interrupts
Enable MSI interrupts for mt7921 driver

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00