Commit Graph
1999 Commits
Author SHA1 Message Date
Lorenzo BianconiandFelix Fietkau 4058595e14 mt76: overwrite qid for non-bufferable mgmt frames
Overwrite hw queue id for non-bufferable management frames if the hw
support always txq (altxq) in order to be in sync with mac txwi code

Fixes: cdad4874057d ("mt76: mt7615: add dma and tx queue initialization for MT7622")
Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support")
Suggested-by: Felix Fietkau <[email protected]>
Tested-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-06-07 17:01:19 +02:00
Lorenzo BianconiandFelix Fietkau 0b99752546 mt76: mt7615: fix hw queue mapping
mt7622/mt7663 chipsets rely on a fixed reverse queue map order respect
to mac80211 one:
- q(0): IEEE80211_AC_BK
- q(1): IEEE80211_AC_BE
- q(2): IEEE80211_AC_VI
- q(3): IEEE80211_AC_VO

Fixes: cdad4874057d ("mt76: mt7615: add dma and tx queue initialization for MT7622")
Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support")
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-06-07 17:01:19 +02:00
Lorenzo BianconiandFelix Fietkau 43febd4521 mt76: mt7615: fix lmac queue debugsfs entry
acs and wmm index are swapped in mt7615_queues_acq respect to the hw
design

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-06-07 17:01:19 +02:00
Lorenzo BianconiandFelix Fietkau 7bc58ca2b3 mt76: add missing lock configuring coverage class
Coverage class callback can potentially run in parallel with other
routines (e.g. mt7615_set_channel) that configures timing registers.
Run coverage class callback holding mt76 mutex

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-06-07 17:01:19 +02:00
YueHaibingandFelix Fietkau 85c5160813 mt76: mt7915: remove set but not used variable 'msta'
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/wireless/mediatek/mt76/mt7915/mcu.c: In function 'mt7915_mcu_sta_txbf_type':
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1805:21: warning:
 variable 'msta' set but not used [-Wunused-but-set-variable]

It is never used, so can be removed.

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: YueHaibing <[email protected]>
2020-05-29 18:23:59 +02:00
YueHaibingandFelix Fietkau 9ad940fee5 mt76: mt7615: Use kmemdup in mt7615_queue_key_update()
Use kmemdup rather than duplicating its implementation

Signed-off-by: YueHaibing <[email protected]>
2020-05-28 17:53:19 +02:00
Felix Fietkau 4e6f4e432d mt76: only iterate over initialized rx queues
Fixes the following reported crash:

[    2.361127] BUG: spinlock bad magic on CPU#0, modprobe/456
[    2.361583]  lock: 0xffffa1287525b3b8, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
[    2.362250] CPU: 0 PID: 456 Comm: modprobe Not tainted 4.14.177 #5
[    2.362751] Hardware name: HP Meep/Meep, BIOS Google_Meep.11297.75.0 06/17/2019
[    2.363343] Call Trace:
[    2.363552]  dump_stack+0x97/0xdb
[    2.363826]  ? spin_bug+0xa6/0xb3
[    2.364096]  do_raw_spin_lock+0x6a/0x9a
[    2.364417]  mt76_dma_rx_fill+0x44/0x1de [mt76]
[    2.364787]  ? mt76_dma_kick_queue+0x18/0x18 [mt76]
[    2.365184]  mt76_dma_init+0x53/0x85 [mt76]
[    2.365532]  mt7615_dma_init+0x3d7/0x546 [mt7615e]
[    2.365928]  mt7615_register_device+0xe6/0x1a0 [mt7615e]
[    2.366364]  mt7615_mmio_probe+0x14b/0x171 [mt7615e]
[    2.366771]  mt7615_pci_probe+0x118/0x13b [mt7615e]
[    2.367169]  pci_device_probe+0xaf/0x13d
[    2.367491]  driver_probe_device+0x284/0x2ca
[    2.367840]  __driver_attach+0x7a/0x9e
[    2.368146]  ? driver_attach+0x1f/0x1f
[    2.368451]  bus_for_each_dev+0xa0/0xdb
[    2.368765]  bus_add_driver+0x132/0x204
[    2.369078]  driver_register+0x8e/0xcd
[    2.369384]  do_one_initcall+0x160/0x257
[    2.369706]  ? 0xffffffffc0240000
[    2.369980]  do_init_module+0x60/0x1bb
[    2.370286]  load_module+0x18c2/0x1a2b
[    2.370596]  ? kernel_read_file+0x141/0x1b9
[    2.370937]  ? kernel_read_file_from_fd+0x46/0x71
[    2.371320]  SyS_finit_module+0xcc/0xf0
[    2.371636]  do_syscall_64+0x6b/0xf7
[    2.371930]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[    2.372344] RIP: 0033:0x7da218ae4199
[    2.372637] RSP: 002b:00007fffd0608398 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[    2.373252] RAX: ffffffffffffffda RBX: 00005a705449df90 RCX: 00007da218ae4199
[    2.373833] RDX: 0000000000000000 RSI: 00005a7052e73bd8 RDI: 0000000000000006
[    2.374411] RBP: 00007fffd06083e0 R08: 0000000000000000 R09: 00005a705449d540
[    2.374989] R10: 0000000000000006 R11: 0000000000000246 R12: 0000000000000000
[    2.375569] R13: 00005a705449def0 R14: 00005a7052e73bd8 R15: 0000000000000000

Reported-by: Sean Wang <[email protected]>
Fixes: d3377b78cec6 ("mt76: add HE phy modes and hardware queue")
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-24 19:11:50 +02:00
DENG QingfangandFelix Fietkau 6e02acddcb mt76: mt7615: add support for MT7611N
MT7611N is basically the same as MT7615N, except it only supports 5GHz
It is used by some TP-Link and Mercury wireless routers

Signed-off-by: DENG Qingfang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-24 14:27:50 +02:00
Felix Fietkau 984a172609 mt76: fix wcid allocation issues
mt76 core uses ffs() to find the next free bit. This works well for 32 bit
architectures where BITS_PER_LONG is 32. ffs only checks 32 bit values, so
allocation fails on 64 bit architectures.
Additionally, the wcid mask array was too small in cases where the array
was not a multiple of BITS_PER_LONG.
Fix this by making the wcid mask array u32 instead and use DIV_ROUND_UP
for the size, just in case we ever bump it to a value that's not a multiple
of 32.

Signed-off-by: Felix Fietkau <[email protected]>
2020-05-23 14:42:49 +02:00
Lorenzo BianconiandFelix Fietkau 466a5b4d04 mt76: mt7915: fix possible NULL pointer dereference in mt7915_register_ext_phy
Fix a NULL pointer dereference in mt7915_register_ext_phy since phy
data structure is allocated by mt76_alloc_phy routine

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-22 14:42:27 +02:00
Sean WangandFelix Fietkau 5396a61cec mt76: mt7615: fix hw_scan with ssid_type for specified SSID only
Fix hw_scan with ssid_type for specified SSID only

The definition for ssid_type in current firmware is that
ssid_type BIT(2) set actually for specified SSID + wildcard SSID.
ssid_type BIT(2) and ssid_type_ext BIT(0) both set actually for
specified SSID only;

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-22 14:42:27 +02:00
YueHaibingandFelix Fietkau ed3a244fb6 mt76: mt7915: Fix build error
In file included from ./include/linux/firmware.h:6:0,
                 from drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:4:
In function ‘__mt7915_mcu_msg_send’,
    inlined from ‘mt7915_mcu_send_message’ at drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:370:6:
./include/linux/compiler.h:396:38: error: call to ‘__compiletime_assert_545’ declared with attribute error: BUILD_BUG_ON failed: cmd == MCU_EXT_CMD_EFUSE_ACCESS && mcu_txd->set_query != MCU_Q_QUERY
  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
                                      ^
./include/linux/compiler.h:377:4: note: in definition of macro ‘__compiletime_assert’
    prefix ## suffix();    \
    ^~~~~~
./include/linux/compiler.h:396:2: note: in expansion of macro ‘_compiletime_assert’
  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
  ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:2: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
  BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
  ^~~~~~~~~~~~~~~~
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:280:2: note: in expansion of macro ‘BUILD_BUG_ON’
  BUILD_BUG_ON(cmd == MCU_EXT_CMD_EFUSE_ACCESS &&
  ^~~~~~~~~~~~

BUILD_BUG_ON is meaningless here, chang it to WARN_ON.

Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: YueHaibing <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-22 14:42:27 +02:00
Sean WangandFelix Fietkau 7b2d166559 mt76: mt7663: fix the usage WoW with net detect support
mt7615_mcu_sched_scan_enable should be taken along with
mt7615_mcu_sched_scan_req to have proper scan plans initialization.

Fixes: bd39bd2f00c3 ("mt76: mt7663: introduce WoW with net detect support")
Co-developed-by: Wan-Feng Jiang <[email protected]>
Signed-off-by: Wan-Feng Jiang <[email protected]>
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]>
2020-05-20 10:43:10 +02:00
Colin Ian KingandFelix Fietkau 01e870b447 mt76: mt7915: fix a handful of spelling mistakes
There are some spelling mistakes in some literal strings. Fix these.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:34 +02:00
Lorenzo BianconiandFelix Fietkau 6679d35be5 mt76: mt7615: switch to per-vif power_save support
switch to per-vif ps support since mt7615 offload firmware can handle it
properly. This patch allows enabling/disabling power-save support on p2p
interface

Tested-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:34 +02:00
Ryder LeeandFelix Fietkau b74d5b1c14 mt76: mt7915: fix some sparse warnings
drivers/net/wireless/mediatek/mt76/mt7915/main.c:694:1: sparse:
sparse: context imbalance in 'mt7915_sta_rc_update' - wrong count at exit
drivers/net/wireless/mediatek/mt76/mt7915/mac.c:303:43: sparse: sparse: cast to restricted __le32
drivers/net/wireless/mediatek/mt76/mt7915/mac.c:304:43: sparse: sparse: cast to restricted __le32
drivers/net/wireless/mediatek/mt76/mt7915/mac.c:305:43: sparse: sparse: cast to restricted __le32
drivers/net/wireless/mediatek/mt76/mt7915/mac.c:319:35: sparse: sparse: cast to restricted __le32
drivers/net/wireless/mediatek/mt76/mt7915/mac.c:327:35: sparse: sparse: cast to restricted __le32
drivers/net/wireless/mediatek/mt76/mt7915/mac.c:345:41: sparse: sparse: cast to restricted __le32
drivers/net/wireless/mediatek/mt76/mt7915/mac.c:355:33: sparse: sparse: cast to restricted __le32
drivers/net/wireless/mediatek/mt76/mt7915/mac.c:451:21: sparse: sparse: invalid assignment: |=
drivers/net/wireless/mediatek/mt76/mt7915/mac.c:451:21: sparse:    left side has type unsigned int
drivers/net/wireless/mediatek/mt76/mt7915/mac.c:451:21: sparse:    right side has type restricted __le32

Fixes: e57b790 ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Reported-by: kbuild test robot <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:34 +02:00
Ryder LeeandFelix Fietkau 6d731d188d mt76: mt7915: fix decoded radiotap HE flags
Move assignment of .data1 and .data2 to a single place and fix overwriting
of values from the template

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:17 +02:00
Lorenzo BianconiandFelix Fietkau 40b7b5354a mt76: mt7615: fix NULL pointer deref in mt7615_register_ext_phy
Fix following NULL pointer dereference in mt7615_register_ext_phy routine

[   27.648860] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000060
[   27.657697] Mem abort info:
[   27.660495]   ESR = 0x96000046
[   27.663549]   EC = 0x25: DABT (current EL), IL = 32 bits
[   27.668857]   SET = 0, FnV = 0
[   27.671910]   EA = 0, S1PTW = 0
[   27.675040] Data abort info:
[   27.677918]   ISV = 0, ISS = 0x00000046
[   27.681751]   CM = 0, WnR = 1
[   27.684717] user pgtable: 4k pages, 39-bit VAs, pgdp=000000007d8cc000
[   27.691156] [0000000000000060] pgd=000000007d281003, pud=000000007d281003, pmd=0000000000000000
[   27.699857] Internal error: Oops: 96000046 [#1] SMP
[   27.774939] CPU: 1 PID: 701 Comm: ash Not tainted 5.4.41 #0
[   27.780500] Hardware name: Bananapi BPI-R64 (DT)
[   27.785108] pstate: 60000005 (nZCv daif -PAN -UAO)
[   27.789897] pc : mt7615_register_ext_phy+0x60/0x2c8 [mt7615_common]
[   27.796156] lr : mt7615_init_debugfs+0x99c/0x18e0 [mt7615_common]
[   27.802237] sp : ffffffc0115dbcb0
[   27.805541] x29: ffffffc0115dbcb0 x28: ffffff803e309600
[   27.810843] x27: 0000000000000000 x26: 0000000000000000
[   27.816144] x25: ffffff803d936928 x24: ffffff803d936950
[   27.821447] x23: 0000000000000000 x22: 0000000fffffffe0
[   27.826749] x21: 0000000000000002 x20: ffffff8001e82620
[   27.832050] x19: 0000000000000000 x18: 0000000000000000
[   27.837352] x17: 0000000000000000 x16: 0000000000000000
[   27.842653] x15: 0000000000000000 x14: 0000000000000000
[   27.847955] x13: 0000000000000000 x12: 0000000000000000
[   27.853256] x11: 0000000000000000 x10: 0000000000000040
[   27.858558] x9 : ffffffc0112b3eb0 x8 : ffffffc0112b3ea8
[   27.863859] x7 : ffffff803e400048 x6 : 0000000000000000
[   27.869161] x5 : ffffff803e400000 x4 : 0000000000000000
[   27.874462] x3 : 0000000000000001 x2 : 0000000000007615
[   27.879764] x1 : 0000000000000068 x0 : ffffffc0088ccc58
[   27.885066] Call trace:
[   27.887505]  mt7615_register_ext_phy+0x60/0x2c8 [mt7615_common]
[   27.893416]  mt7615_init_debugfs+0x99c/0x18e0 [mt7615_common]
[   27.899156]  simple_attr_write+0xf0/0x178
[   27.903158]  debugfs_attr_write+0x4c/0x70
[   27.907159]  full_proxy_write+0x60/0x90
[   27.910987]  __vfs_write+0x18/0x40
[   27.914379]  vfs_write+0xb0/0x1b8
[   27.917685]  ksys_write+0x4c/0xc8
[   27.920989]  __arm64_sys_write+0x18/0x20

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:17 +02:00
Ryder LeeandFelix Fietkau 01b784174c mt76: mt7915: fix sparse warnings: incorrect type initializer
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2317:31: sparse: sparse:
incorrect type in initializer (different base types)

Fixes: 5517f78b0063 ("mt76: mt7915: enable firmware module debug support")
Reported-by: kbuild test robot <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:17 +02:00
Ryder LeeandFelix Fietkau 1e3dc5b766 mt76: mt7915: fix some sparse warnings
This fixes the following sparse warning:

drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:253:16: sparse: sparse: mixing different enum types:
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:253:16: sparse:    unsigned int enum mt7915_txq_id
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:253:16: sparse:    unsigned int enum mt76_txq_id
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:758:63: sparse: sparse: incorrect type in argument 2 (different address spaces)
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:758:63: sparse:    expected unsigned char const [usertype] *ies
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:758:63: sparse:    got unsigned char const [noderef] <asn:4> *
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1390:23: sparse: sparse: incorrect type in argument 1 (different base types)
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1390:23: sparse:    expected unsigned int w
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1390:23: sparse:    got restricted __le32 [usertype] supp_ht_mcs
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1390:23: sparse: sparse: restricted __le32 degrades to integer
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1429:60: sparse: sparse: bad assignment (>>=) to restricted __le16
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1773:16: sparse: sparse: restricted __le32 degrades to integer

Fixes: 6094f86fb371 ("mt76: mt7915: add HE bss_conf support for interfaces")
Reported-by: kbuild test robot <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:17 +02:00
Ryder LeeandFelix Fietkau 7005aa8914 mt76: mt7915: add spatial reuse support
Enable or disable OBSS PD when the bss config changes or we
assoc to an AP that broadcasts the IE.

With this patch, we can get ~20% gain in OBSS OTA environment.

Tested-by: Evelyn Tsai <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:17 +02:00
Lorenzo BianconiandFelix Fietkau 44f2262c02 mt76: mt76x02: remove check in mt76x02_mcu_msg_send
mt76x02_mcu_msg_send is run just by mmio code so get rid of
mt76_is_mmio() check

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:17 +02:00
Lorenzo BianconiandFelix Fietkau fa81da5bb4 mt76: mt7615: introduce remain_on_channel support
Introduce remain_on_channel support to mt7615 driver if the device is
running offload firmware

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]>
2020-05-20 10:37:17 +02:00
Sean WangandFelix Fietkau 1ea444d0e8 mt76: mt7615: configure bss info adding the interface
Introduce essential bss information for multiple vifs hw_scan in
mt7615_mcu_uni_add_dev adding the interface

Signed-off-by: Sean Wang <[email protected]>
Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:11 +02:00
Lorenzo BianconiandFelix Fietkau 8bd88a1b18 mt76: enable p2p support
Introduce p2p-go/p2p-client suppor to mt76 driver

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]>
2020-05-20 10:37:11 +02:00
Lorenzo BianconiandFelix Fietkau 8c9e4847d0 mt76: mt7615: reduce hw scan timeout
Differentiate hw scan channel time between passive and active scan

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:11 +02:00
Lorenzo BianconiandFelix Fietkau 7270b56389 mt76: mt7615: do not report scan_complete twice to mac80211
Fix the following kernel warning that occurs if scan work is scheduled
and the hw scan has been cancelled by mac80211

WARNING: CPU: 1 PID: 502 at net/mac80211/scan.c:391 __ieee80211_scan_completed+0x299/0x690
Modules linked in:
CPU: 1 PID: 502 Comm: kworker/u4:4 Not tainted 5.7.0-rc1+ #2882
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
Workqueue: phy0 ieee80211_scan_work
RIP: 0010:__ieee80211_scan_completed+0x299/0x690
RSP: 0018:ffffc9000036fda8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 8c6318c6318c6320
RDX: 0000000000000000 RSI: 00000000ffffffff RDI: ffff88803bb129b8
RBP: ffff88803bb10d80 R08: 0000000000000001 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: ffff88803bb12ae8
FS:  0000000000000000(0000) GS:ffff88803ec00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f13ee5c1470 CR3: 000000003c790000 CR4: 00000000000006a0
Call Trace:
 ieee80211_scan_work+0x170/0x850
 ? sched_clock_cpu+0x11/0xb0
 process_one_work+0x24f/0x580
 ? worker_thread+0xcc/0x3e0
 worker_thread+0x4f/0x3e0
 ? process_one_work+0x580/0x580
 kthread+0x11b/0x140
 ? __kthread_bind_mask+0x60/0x60
 ret_from_fork+0x3a/0x50
irq event stamp: 9255532
hardirqs last  enabled at (9255531): [<ffffffff81a504e4>] _raw_spin_unlock_irq+0x24/0x30
hardirqs last disabled at (9255532): [<ffffffff81001b3f>] trace_hardirqs_off_thunk+0x1a/0x1c
softirqs last  enabled at (9255526): [<ffffffff8107c9ef>] process_one_work+0x24f/0x580
softirqs last disabled at (9255524): [<ffffffff815f2f41>] mt7615_scan_work+0x91/0xc0

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:11 +02:00
Felix Fietkau 060e375a92 mt76: fix per-driver wcid range checks after wcid array size bump
All drivers before MT7915 have a limit of 128 WCID entries. Stop relying
on ARRAY_SIZE(dev->mt76.wcid), since it no longer reflects that limit.

Fixes: 49e649c3e0a6 ("mt76: adjust wcid size to support new 802.11ax generation")
Reported-by: kbuild test robot <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 08:11:08 +02:00
Lorenzo BianconiandFelix Fietkau 9b07251b00 mt76: mt7615: fix typo defining ps work
Fix typo defining ps_work in mt7615_register_ext_phy(). This is not a
real issue since 802.11 power save is not yet support by the external phy

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-14 11:08:57 +02:00
Felix Fietkau f85c1f3fc1 firmware: add mt7915 firmware
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12 19:22:30 +02:00
Ryder LeeandFelix Fietkau 26eb1ed659 mt76: mt7915: fix possible deadlock in mt7915_stop
make mac_work per phy instead of per device and fix a possible deadlock
in mt7915_stop since mt7915_mac_work runs holding mt76 mutex

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12 19:19:02 +02:00
Ryder LeeandFelix Fietkau 9590db0254 mt76: mt7915: allocate proper size for tlv tags
Allocating proper memory size according to tlv usage.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12 19:19:02 +02:00
Ryder LeeandFelix Fietkau 6656bebd39 mt76: mt7915: add debugfs to track TxBF status
Add debug counters to track status of beamformer and beamformee.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12 19:19:02 +02:00
Ryder LeeandFelix Fietkau ac505404c3 mt76: mt7915: add TxBF capabilities
This allows to set HE TxBF runtime stream capabilities

Signed-off-by: Ryder Lee <[email protected]>
Tested-by: Evelyn Tsai <[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12 19:19:02 +02:00
Ryder LeeandFelix Fietkau 5f9e7664cd mt76: mt7915: add Tx beamformee support
Enable beamformee support.

Signed-off-by: Ryder Lee <[email protected]>
Tested-by: Evelyn Tsai <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12 19:19:02 +02:00
Ryder LeeandFelix Fietkau 095c72c81c mt76: mt7915: add Tx beamformer support
Enable TxBF modules and trigger sounding process to support Tx beamformer.

Signed-off-by: Ryder Lee <[email protected]>
Tested-by: Evelyn Tsai <[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12 19:19:02 +02:00
Ryder LeeandFelix Fietkau 1d0903de21 mt76: mt7915: introduce mt7915_get_he_phy_cap
Add a helper to reduce duplicate codes.
This is a preliminary patch to add Tx beamforming support.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12 19:19:02 +02:00
Lorenzo BianconiandFelix Fietkau e236ea5be3 mt76: mt7615: usb: cancel ps work stopping the vif
Cancel possible power_save work before stopping the mt7663u interface

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12 19:19:02 +02:00
Lorenzo BianconiandFelix Fietkau 3aa810bde8 mt76: mt7663u: add missing register definitions
Add missing PLE/PSE base register definitions for mt7663u

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12 19:19:02 +02:00
Lorenzo BianconiandFelix Fietkau 9200732e85 mt76: mt7663u: copy key pointer in mt7663u_mac_write_txwi
Copy key pointer value before running mt76_tx_status_skb_add() in
mt7663u_mac_write_txwi since it will be overwritten setting
mt76_tx_cb for probing frames

Co-developed-by: Johannes Berg <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12 19:19:02 +02:00
Felix Fietkau d7a10094c4 mt7663: add client offload firmware
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12 19:12:52 +02:00
Lorenzo BianconiandFelix Fietkau 6bbf1a35c0 linux-firmware: add rebb firmware for mt7663
Add binary rebb rom patch and n9 firmware for mt7663 based devices

Signed-off-by: Lorenzo Bianconi <[email protected]>
2020-05-09 10:28:04 +02:00
Ryder LeeandFelix Fietkau 56405976fc mt76: set runtime stream caps by mt76_phy
This patch can support concurrent dual-band operation.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-09 10:24:04 +02:00
Ryder LeeandFelix Fietkau 509fceb432 mt76: mt7915: enable firmware module debug support
This allows host driver to get useful information of some important modules.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Chih-Min Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-09 10:24:04 +02:00
Ryder LeeandFelix Fietkau 4f79c516be mt76: mt7915: add tsf related callbacks
It is useful for IBSS Mesh to adjust t_clockdrift.

Signed-off-by: Ryder Lee <[email protected]>
Reported-by: Shayne Chen <[email protected]>
Tested-by: Evelyn Tsai <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-09 10:24:04 +02:00
Ryder LeeandFelix Fietkau a5368e5cad mt76: mt7915: set peer Tx fixed rate through debugfs
Driver can manually set fixed rate for each peer through debugfs.

May use .set_bitrate_mask callback and iterate stations under the
current vif to achieve the aim once it supports HE rate.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-09 10:24:04 +02:00
Ryder LeeandFelix Fietkau 7f40e8c2b9 mt76: mt7915: add .sta_statistics support
Add useful debug counters since this generation uses struct rate_info
to report HE tx rate.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-09 10:24:04 +02:00
Ryder LeeandFelix Fietkau 158253e2c1 mt76: mt7915: add .sta_add_debugfs support
This generation supports much more per-peer statistics than legacy ones,
so add .sta_add_debugfs accordingly.

This is convenient to set/get more settings/counters in the long run.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-09 10:24:04 +02:00
Ryder LeeandFelix Fietkau 3b5d908dae mt76: mt7915: add Rx radiotap header support
mac80211 expects the definition of what HE rate info is available
inside astruct prepended to the skb.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-09 10:24:04 +02:00
Ryder LeeandFelix Fietkau 135a508593 mt76: mt7915: add HE capabilities support for peers
Set peer's bsic HE capabilities through starec.

Signed-off-by: Ryder Lee <[email protected]>
Suggested-by: Shihwei Lin <[email protected]>
Tested-by: Shayne Chen <[email protected]>
Tested-by: Chih-Min Chen <[email protected]>
Tested-by: Evelyn Tsai <[email protected]>
Acked-by: Yiwei Chung <[email protected]>
Acked-by: YF Luo <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-09 10:24:04 +02:00