Commit Graph
343 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 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
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
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
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
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
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
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
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
Lorenzo BianconiandFelix Fietkau 82e4d3ebe9 mt76: mt7615: scan all channels if not specified
Configure the mcu to scan all available channels if mac80211 does not
provide any frequency list

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-07 16:17:16 +02:00
Sean WangandFelix Fietkau 891136ab99 mt76: mt7663: add support to sched scan with randomise addr
Add support to sched scan with randomise addr

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]>
Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-07 16:17:16 +02:00
Sean WangandFelix Fietkau c1d3ad194a mt76: mt7663: introduce WoW with net detect support
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]>
Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-07 16:17:16 +02:00
Lorenzo BianconiandFelix Fietkau 3e6968593b mt76: mt7615: fix delta tx power for mt7663
Fix mt7663 eeprom definitions for delta tx power parsing

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:09 +02:00
Lorenzo BianconiandFelix Fietkau 83f2ba3101 mt76: mt7663: fix target power parsing
Fix target parsing from eeprom/efuse partition for 7663 chipsets

Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:09 +02:00
Lorenzo BianconiandFelix Fietkau 0a9f716529 mt76: mt7615: fix ibss mode for mt7663
Fix the following kernel warning adding an adhoc interface to a
mt7663e device

[  233.363394] WARNING: CPU: 0 PID: 2345 at drivers/net/wireless/mt76/mt7615/mcu.c:1449 mt7615_mcu_uni_add_bss+0x15f/0x24e [mt7615_common]
[  233.363432] CPU: 0 PID: 2345 Comm: iw Tainted: G        W       4.14.171 #12
[  233.363434] Hardware name: HP Meep/Meep, BIOS Google_Meep.11297.75.0 06/17/2019
[  233.363436] task: ffff9a1a4020e3c0 task.stack: ffffb9124113c000
[  233.363441] RIP: 0010:mt7615_mcu_uni_add_bss+0x15f/0x24e [mt7615_common]
[  233.363443] RSP: 0018:ffffb9124113f730 EFLAGS: 00010246
[  233.363446] RAX: 0000000000000024 RBX: ffff9a1a788c74e8 RCX: 41826d413aea9200
[  233.363448] RDX: 0000000000000007 RSI: 0000000000000006 RDI: ffff9a1a7fc15418
[  233.363450] RBP: ffffb9124113f7c0 R08: 0000000000000356 R09: 00000000ffff0a10
[  233.363452] R10: 0000001000000000 R11: ffffffff93f2a4be R12: 0000000000000000
[  233.363454] R13: ffff9a1a7383bd48 R14: ffffb9124113f77a R15: 0000000000000000
[  233.363456] FS:  00007f203314ab80(0000) GS:ffff9a1a7fc00000(0000) knlGS:0000000000000000
[  233.363458] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  233.363460] CR2: 00005a13d647c950 CR3: 0000000171238000 CR4: 00000000003406f0
[  233.363462] Call Trace:
[  233.363470]  mt7615_bss_info_changed+0x98/0xf4 [mt7615_common]
[  233.363484]  ieee80211_bss_info_change_notify+0x139/0x1d4 [mt76_mac80211]
[  233.363496]  ieee80211_ibss_disconnect+0x183/0x1bb [mt76_mac80211]
[  233.363507]  ieee80211_ibss_leave+0x14/0xa0 [mt76_mac80211]
[  233.363519]  __cfg80211_leave_ibss+0xa6/0x13a [cfg80211]
[  233.363528]  cfg80211_netdev_notifier_call+0x8b/0x631 [cfg80211]
[  233.363535]  ? packet_notifier+0x196/0x1a3
[  233.363540]  raw_notifier_call_chain+0x39/0x58
[  233.363544]  __dev_close_many+0x6b/0xf0
[  233.363548]  dev_close_many+0x62/0xe8
[  233.363552]  ? _raw_spin_unlock_irq+0xe/0x21
[  233.363555]  rollback_registered_many+0xf6/0x35c
[  233.363560]  ? __rcu_read_unlock+0x4a/0x4a
[  233.363563]  unregister_netdevice_queue+0x7f/0x105
[  233.363573]  ieee80211_del_iface+0x12/0x16 [mt76_mac80211]
[  233.363582]  nl80211_del_interface+0xa8/0x124 [cfg80211]
[  233.363588]  genl_rcv_msg+0x40b/0x481
[  233.363592]  ? genl_unbind+0xb8/0xb8
[  233.363595]  netlink_rcv_skb+0x85/0xf8
[  233.363598]  genl_rcv+0x28/0x36
[  233.363601]  netlink_unicast+0x165/0x1f8
[  233.363604]  netlink_sendmsg+0x35f/0x3a6
[  233.363608]  sock_sendmsg+0x38/0x48
[  233.363611]  ___sys_sendmsg+0x1bf/0x267
[  233.363615]  ? __inode_wait_for_writeback+0x72/0xd7
[  233.363619]  ? dentry_kill+0x69/0x76
[  233.363622]  ? dput+0xd1/0x170
[  233.363624]  __sys_sendmsg+0x52/0x8f
[  233.363628]  do_syscall_64+0x6b/0xf7
[  233.363632]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[  233.363635] RIP: 0033:0x7f2032ca1264
[  233.363637] RSP: 002b:00007ffec3668e38 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
[  233.363639] RAX: ffffffffffffffda RBX: 000058f7175e7880 RCX: 00007f2032ca1264
[  233.363641] RDX: 0000000000000000 RSI: 00007ffec3668e98 RDI: 0000000000000003
[  233.363643] RBP: 00007ffec3668e70 R08: 0000000000000001 R09: 00007f2032ce1fd0
[  233.363645] R10: 000058f7175e2010 R11: 0000000000000246 R12: 000058f7175e7740
[  233.363646] R13: 00007ffec3668ff0 R14: 000058f7175e2350 R15: 00007ffec3668e98

Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau f25a43cc53 mt76: mt7615: check return value of mt7615_eeprom_get_power_index
mt7615_eeprom_get_power_index can return negative error value.
Check mt7615_eeprom_get_power_index return value before using it

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau 4ef1957cea mt76: mt7663: read tx streams from eeprom
Read tx stream configuration from eeprom/efuse

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau 50d377a825 mt76: mt7615: introduce beacon_loss mcu event
If device has enabled beacon hw filter rx beacons are not reported to
the host. Introduce beacon_loss mcu event to trigger mac80211 mlme
connection state machine in this configuration.
IEEE80211_VIF_BEACON_FILTER has not set in vif flags since hw beacon
filter is not enabled yet

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-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau 523716bba5 mt76: mt7615: add gtk rekey offload support
Add KCK and KEK offload support to mt7615 driver in order to
support GTK rekeying during PM suspend

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
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: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau 20db7e73c5 mt76: mt7615: introduce PM support
Introduce suspend/resume to mt7615e driver

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]>
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-05 17:54:06 +02:00
Sean WangandFelix Fietkau 20b87321c3 mt76: mt7663u: introduce suspend/resume to mt7663u
Tested on Chromebok by "echo mem to /sys/power/state" to suspend and
then waked up by keyboard keystrokes to resume system.

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-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau db45460510 mt76: mt7615: add WoW support
Introduce WoW support to mt7615 driver.
Current supported trigger are:
- magic-packet
- disconnect
- user-pattern

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]>
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-05 17:54:06 +02:00
Sean WangandFelix Fietkau f2c760177b mt76: mt7615: introduce mt7615_mcu_set_hif_suspend mcu command
Introduce the mt7615_mcu_set_hif_suspend mcu command, which is usually
used to configure the interface including PCIe, USB or SDIO to the right
state during operation suspend / resume.

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-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau 8fddbf6390 mt76: mt7615: introduce support for hardware beacon filter
Introduce support for hw beacon filter if available in the 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-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau 96e429e181 mt76: mt7615: free pci_vector if mt7615_pci_probe fails
Always free pci irq vector if mt7615_pci_probe routine fails
Moreover free irq in mt7615_pci_remove routine

Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau 5b73be9623 mt76: mt7615: add passive mode for hw scan
Introduce support for passive frequency scanning to mt7615_mcu_hw_scan

Tested-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau 2cc0d54b65 mt76: mt7615: do not mark sched_scan disabled in mt7615_scan_work
For the moment offload firmware supports just one entry in the scheduled
scan plan and so it runs till it is disabled by the userspace.
Do not mark the hw scheduled scan as disabled in mt7615_scan_work
after receiving a scan result

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau d4ba139d8b mt76: mt7615: introduce mt7615_check_offload_capability routine
Introduce mt7615_check_offload_capability routine to set hw/wiphy
offload capabilities according to the running firmware

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau 9636177117 mt76: mt7615: fix ssid configuration in mt7615_mcu_hw_scan
Fix SSID configuration performing hw frequency scanning

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Felix Fietkau 8688ed70c9 mt76: mt7615: use module parameter option for offload firmware preference
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Felix Fietkau 10a5b7630a mt76: mt7615: fix getting maximum tx power from eeprom
On top of the EEPROM target power, each rate can also has a power offset.
On many devices, this power offset is used to boost the tx power of lower
rates. Take this into account when parsing rate power.
The assumption here is, that the first rate (OFDM 6M or CCK 1M) has the
highest tx power

Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Felix Fietkau 7aabfd0c92 mt7615: add CONFIG_MT76_LEDS to cflags
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau 5f3ccc7226 mt76: mt7663: remove check in mt7663_load_n9
Get rid of useless check in mt7663_load_n9 since it is used only for
mt7663 devices

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-27 19:55:00 +02:00
Lorenzo BianconiandFelix Fietkau 1afabe78cf mt76: mt7663: add the possibility to load firmware v2
mt7663 firmware v2 is used for embedded devices since it has more completed
features in AP mode.
Add the capability to specify in mt7615 Kconfig which firmware load first
(v3 or v2) and fallback to the other one if the selected firmware fails
to load

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-27 19:55:00 +02:00
Lorenzo BianconiandFelix Fietkau 1f2f3dda76 mt76: mt7615: fix event report in mt7615_mcu_bss_event
Currently mt7663 devices do not support DBDC so fw events have no info
about it. Fix mt7615_mcu_bss_event that wrongly use bss_idx as DBDC
band_idx while it is vif index.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-27 19:54:42 +02:00
Lorenzo BianconiandFelix Fietkau a5f394c5ca mt76: mt7615: add sta pointer to mt7615_mcu_add_bss_info signature
Introduce sta pointer to mt7615_mcu_add_bss_info signature in order to
avoid sta lookup in mt7615_mcu_bss_basic_tlv routine

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-27 19:54:42 +02:00
Sean WangandFelix Fietkau 5de75b745c mt76: mt7663: fix up BMC entry indicated to unicmd firmware
BMC entry for MT7663 unicmd firmware should be a broadcast/multicast entry,
not a unicast entry, that is GTK rekey offload would rely on.

Fixes: 138860679b2a ("mt76: mt7615: add more uni mcu commands")
Cc: Soul Huang <[email protected]>
Suggested-by: YF Luo <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
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]>
2020-04-27 19:54:42 +02:00