Commit Graph

1302 Commits

Author SHA1 Message Date
Ryder Lee
a82dd24d12 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 <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:36 +02:00
Ryder Lee
c336318f57 mt76: mt7915: add HE capabilities support for peers
Set peer's bsic HE capabilities through starec.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Suggested-by: Shihwei Lin <shihwei.lin@mediatek.com>
Tested-by: Shayne Chen <shayne.chen@mediatek.com>
Tested-by: Chih-Min Chen <chih-min.chen@mediatek.com>
Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
Acked-by: Yiwei Chung <yiwei.chung@mediatek.com>
Acked-by: YF Luo <yf.luo@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:36 +02:00
Ryder Lee
6094f86fb3 mt76: mt7915: add HE bss_conf support for interfaces
Add basic HE BSS's info for interfaces. As for the advanced features
will be added gradually in the future patches.
(i.e. BSS color, TWT, spatial reuse and OFDMA)

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Tested-by: Shayne Chen <shayne.chen@mediatek.com>
Tested-by: Chih-Min Chen <chih-min.chen@mediatek.com>
Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
Acked-by: Yiwei Chung <yiwei.chung@mediatek.com>
Acked-by: YF Luo <yf.luo@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:35 +02:00
Ryder Lee
37f4ca907c mt76: mt7915: register per-phy HE capabilities for each interface
The capabilities for the HE interfaces are generated from the capabilities
reported by the firmware.

This should move to common file once we got other HE devices support.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:35 +02:00
Ryder Lee
f1d962369d mt76: mt7915: implement HE per-rate tx power support
Use firmware support for applying per-rate limit and power offsets.
This can support all HE RU types.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Tested-by: Chih-Min Chen <chih-min.chen@mediatek.com>
Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
Acked-by: Yiwei Chung <yiwei.chung@mediatek.com>
Acked-by: YF Luo <yf.luo@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:35 +02:00
Ryder Lee
5205071a51 mt76: mt7915: enable Rx HE rate reporting
Enable HE rate reporting in Rx path

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:35 +02:00
Ryder Lee
e57b790146 mt76: add mac80211 driver for MT7915 PCIe-based chipsets
Add support for the MediaTek latest generation IEEE 802.11ax 4x4
device MT7915E, which supports concurrent dual-band operation at
both 5GHz and 2.4GHz.

Note that this patch just add basic part and will add more HE
capabilities support in the further patches.

The driver supports AP, Station, Mesh and monitor mode.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Chih-Min Chen <chih-min.chen@mediatek.com>
Suggested-by: Shihwei Lin <shihwei.lin@mediatek.com>
Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
Acked-by: Yiwei Chung <yiwei.chung@mediatek.com>
Acked-by: YF Luo <yf.luo@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:35 +02:00
Ryder Lee
d3377b78ce mt76: add HE phy modes and hardware queue
This is a preliminary patch to support 11ax deivces.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:35 +02:00
Ryder Lee
49e649c3e0 mt76: adjust wcid size to support new 802.11ax generation
The newer 802.11ax devices (i.e. MT7915E) can connect to much more
peers than previous generations.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:35 +02:00
Ryder Lee
77ae1d5e13 mt76: add Rx stats support for radiotap
HE deivces need to add Rx radiotap header.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:35 +02:00
Ryder Lee
af4a2f2fdd mt76: add support for HE RX rate reporting
Add support for encoding and reporting HE RX rates.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:35 +02:00
Ryder Lee
7c4f744d67 mt76: avoid rx reorder buffer overflow
Enlarge slot to support 11ax 256 BA (256 MPDUs in an AMPDU)

Signed-off-by: Chih-Min Chen <chih-min.chen@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:35 +02:00
Lorenzo Bianconi
1245fe6a83 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 <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:35 +02:00
Sean Wang
5fdba8a77b mt76: mt7663: add support to sched scan with randomise addr
Add support to sched scan with randomise addr

Co-developed-by: Wan-Feng Jiang <Wan-Feng.Jiang@mediatek.com>
Signed-off-by: Wan-Feng Jiang <Wan-Feng.Jiang@mediatek.com>
Co-developed-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:35 +02:00
Sean Wang
a72ad451e7 mt76: mt7663: introduce WoW with net detect support
Introduce WoW with net detect support

Co-developed-by: Wan-Feng Jiang <Wan-Feng.Jiang@mediatek.com>
Signed-off-by: Wan-Feng Jiang <Wan-Feng.Jiang@mediatek.com>
Co-developed-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:35 +02:00
Lorenzo Bianconi
c88bf52b15 mt76: mt7615: fix delta tx power for mt7663
Fix mt7663 eeprom definitions for delta tx power parsing

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Lorenzo Bianconi
e0ec633d76 mt76: mt7663: fix target power parsing
Fix target parsing from eeprom/efuse partition for 7663 chipsets

Fixes: f40ac0f3d3 ("mt76: mt7615: introduce mt7663e support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Lorenzo Bianconi
9582d5bdef 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: f40ac0f3d3 ("mt76: mt7615: introduce mt7663e support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Lorenzo Bianconi
cc5f58aee1 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 <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Lorenzo Bianconi
eb7bd8d7fb mt76: mt7663: read tx streams from eeprom
Read tx stream configuration from eeprom/efuse

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Lorenzo Bianconi
86c60179e5 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 <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Lorenzo Bianconi
b47e21e75c 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 <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Wan-Feng Jiang <Wan-Feng.Jiang@mediatek.com>
Signed-off-by: Wan-Feng Jiang <Wan-Feng.Jiang@mediatek.com>
Co-developed-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Lorenzo Bianconi
6dd4072c1e mt76: mt7615: introduce PM support
Introduce suspend/resume to mt7615e driver

Co-developed-by: Wan-Feng Jiang <Wan-Feng.Jiang@mediatek.com>
Signed-off-by: Wan-Feng Jiang <Wan-Feng.Jiang@mediatek.com>
Co-developed-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Soul Huang <Soul.Huang@mediatek.com>
Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Sean Wang
d0846f0867 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 <sean.wang@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Lorenzo Bianconi
c6bf20109a 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 <Wan-Feng.Jiang@mediatek.com>
Signed-off-by: Wan-Feng Jiang <Wan-Feng.Jiang@mediatek.com>
Co-developed-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Soul Huang <Soul.Huang@mediatek.com>
Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Sean Wang
6f11785200 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 <sean.wang@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Lorenzo Bianconi
c8646872d6 mt76: mt7615: introduce support for hardware beacon filter
Introduce support for hw beacon filter if available in the firmware

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Lorenzo Bianconi
a69b0b30e6 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 <sean.wang@mediatek.com>
Signed-off-by: Soul Huang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Lorenzo Bianconi
4432119d17 mt76: mt7615: add passive mode for hw scan
Introduce support for passive frequency scanning to mt7615_mcu_hw_scan

Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:34 +02:00
Lorenzo Bianconi
6c5974c10c 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 <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Lorenzo Bianconi
53b42ae291 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 <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Lorenzo Bianconi
0fe96975d1 mt76: mt7615: fix ssid configuration in mt7615_mcu_hw_scan
Fix SSID configuration performing hw frequency scanning

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Dejin Zheng
fb602b303b mt76: mt7603: remove duplicate error message
it will print an error message by itself when
devm_platform_ioremap_resource() goes wrong. so remove the duplicate
error message.

Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Felix Fietkau
89f8bc6a34 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 <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Felix Fietkau
801f809aee mt76: mt7615: set spatial extension index
The vendor driver sets this in firmware rate control (which we don't use)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Lorenzo Bianconi
404d1cd401 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 <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Lorenzo Bianconi
f2dc8ea11f 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 which firmware load first (v3 or v2)
using prefer_offload_fw kernel parameter and fallback to the other one
if the selected firmware fails to load

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Lorenzo Bianconi
65ba7fa4b8 mt76: mt76x0: enable MCS 8 and MCS9
Enable MCS8 and MCS9 for mt76x0{u,e} devices

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Lorenzo Bianconi
ffc54ee2f0 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 <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Lorenzo Bianconi
f559685035 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 <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Sean Wang
5ac2e2a348 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: 138860679b ("mt76: mt7615: add more uni mcu commands")
Cc: Soul Huang <Soul.Huang@mediatek.com>
Suggested-by: YF Luo <Yf.Luo@mediatek.com>
Co-developed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Lorenzo Bianconi
dd89a0133c mt76: enable TDLS support
Enable mac80211 TDLS support by default. Disable TDLS hw filtering for
mt7615 devices

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Lorenzo Bianconi
dcc4c74f92 mt76: mt7615: move mcu bss upload before creating the sta
Run mt7615_mcu_add_bss_info routine before mt7615_mcu_sta_add since
the firmware requires the bss is created before the relative sta

Tested-by: Sean Wang <sean.wang@mediatek.com>
Suggested-by: YF Luo <yf.luo@mediatek.com>
Suggested-by: Lucy Hsu <lucy.hsu@mediatek.com>
Co-developed-by: Soul Huang <soul.huang@mediatek.com>
Signed-off-by: Soul Huang <soul.huang@mediatek.com>
Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Felix Fietkau
40a61c9b2c mt76: mt7603: fix tx status rate index calculation
A switch from one rate index to the next only happens when tx count from
the current slot is greater than MT7615_RATE_RETRY, which is 1 has to be
subtracted from count, instead of added to it.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:33 +02:00
Felix Fietkau
97507b38a4 mt76: mt7615: fix tx status rate index calculation
A switch from one rate index to the next only happens when tx count from
the current slot is greater than MT7615_RATE_RETRY, which is 1 has to be
subtracted from count, instead of added to it.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Felix Fietkau
ad333c2ad2 mt76: mt7615: do not adjust MAC timings if the device is not running
Avoids register writes and MAC start/stop when the hardware isn't ready for it

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Felix Fietkau
ed2bde56ab mt76: mt7615: adjust timing in mt7615_mac_set_timing to match fw/hw values
Slightly improves performance

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Felix Fietkau
e0b4fe832c mt76: mt7603: never use an 802.11b CF-End rate on 5GHz
Sometimes mt7615_mac_set_timing gets called while the slot time is still
configured to 20. Ensure that in this case it always uses the OFDM CFend
rate.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Felix Fietkau
ab9a1ed229 mt76: mt7615: never use an 802.11b CF-End rate on 5GHz
Sometimes mt7615_mac_set_timing gets called while the slot time is still
configured to 20. Ensure that in this case it always uses the OFDM CFend
rate.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Felix Fietkau
61cb60758a mt76: mt7615: use larger rx buffers if VHT is supported
In VHT mode we can receive larger MPDUs. Increasing the buffer size reduces
fragmentation here, which should improve performance.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Felix Fietkau
55961d8be3 mt76: fix A-MPDU density handling
The hardware requirements for A-MPDU density are entirely on the tx side,
not the rx side. Because of that, the IE value should stay at 0 and the
minimum value should instead be enforced in WTBL/TXWI

MT7615 has no restrictions here

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Felix Fietkau
d0116058c7 mt76: mt7615: fix sta ampdu factor for VHT
If VHT has a larger A-MPDU size limit, pass it to the MCU via the wtbl_ht
TLV element.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Lorenzo Bianconi
5416651c9e mt76: mt7663u: enable AirTimeFairness
Initialize tx_status_data pointer in order to enable Air Time Fairness
for mt7663u chipset

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Lorenzo Bianconi
a621372a04 mt76: mt7615: rework mt7615_mac_sta_poll for usb code
Since usb code can't access device registers in interrupt context, move
rcu_read_lock/rcu_read_unlock in mt7615_poll_tx routine. Moreover loop
over a local msta list in mt7615_mac_sta_poll since mt7663u driver will
not be able to complete the inner while loop before sta_poll_list list
is refilled by mt7615_mac_add_txs/mt7615_mac_fill_rx

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Lorenzo Bianconi
fdf433121f mt76: mt7615: fix aid configuration in mt7615_mcu_wtbl_generic_tlv
If the vif is running in station mode the aid will be passed by mac80211
using bss_conf.aid. Fix aid configuration in mt7615_mcu_wtbl_generic_tlv

Fixes: 04b8e65922 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Lorenzo Bianconi
3380616191 mt76: mt7615: fix mt7615_driver_own routine
Introduce MT_PCIE_DOORBELL_PUSH register to fix mt7615_driver_own
routine for mt7663e

Fixes: f40ac0f3d3 ("mt76: mt7615: introduce mt7663e support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Lorenzo Bianconi
8f997dddc0 mt76: mt7615: fix max wtbl size for 7663
Current mt7663 offload firmware can support up to 32 wtbl entries

Fixes: f40ac0f3d3 ("mt76: mt7615: introduce mt7663e support")
Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Lorenzo Bianconi
becdf0d5d7 mt76: mt7615: fix mt7615_firmware_own for mt7663e
Check the firmware-own configuration has been applied polling
MT_CONN_HIF_ON_LPCTL register

Fixes: f40ac0f3d3 ("mt76: mt7615: introduce mt7663e support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:32 +02:00
Lorenzo Bianconi
df5ab0d58b mt76: mt7615: parse mcu return code for unified commands
Add return code parsing for the following unified commands:
- MCU_UNI_CMD_DEV_INFO_UPDATE
- MCU_UNI_CMD_BSS_INFO_UPDATE
- MCU_UNI_CMD_STA_REC_UPDATE

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Lorenzo Bianconi
6ea62c5079 mt76: add rx queues info to mt76 debugfs
Introduce rx-queues debugfs node in order to dump rx queues status.
This would be useful for mcu fw debugging

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Sean Wang
18ab1d7a37 mt76: mt7615: make Kconfig entry obvious for MT7663E
Make Kconfig entry obvious for MT7663E

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Lorenzo Bianconi
7f8ebafebc mt76: mt7663: introduce 802.11 PS support in sta mode
Enable 802.11 power-save support available in mt7663 firmware

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Lorenzo Bianconi
a7df115209 mt76: remove PS_NULLFUNC_STACK capability
remove IEEE80211_HW_PS_NULLFUNC_STACK capability from mt76_phy_init
routine since 802.11 ps is not currently supported by any devices and it
will conflict with mt7663 ps fw support

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Lorenzo Bianconi
60cb9843f3 mt76: mt7615: provide aid info to the mcu
For sta mode mac80211 provides aid in vif->bss_conf.aid.
In order to properly support 802.11 power-save, configure correct aid
to mcu during sta association

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Lorenzo Bianconi
450affca7b mt76: mt7615: disable aspm by default
The vendor SDK also disables ASPM by default

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Lorenzo Bianconi
ad6b0be6f4 mt76: mt7615: enable scs for mt7663 driver
Add missing register definitions in order to enable sensitivity tuning
for mt7663 driver

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Lorenzo Bianconi
eb99cc95c3 mt76: mt7615: introduce mt7663u support
Introduce support for mt7663u 802.11ac 2x2:2 chipset to mt7615 driver.
Main difference respect to pcie code base is the usb code needs to
configure wtbl from non-atomic context

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Lorenzo Bianconi
e90354e045 mt76: mt7615: move core shared code in mt7615-common module
Create mt7615-common module in order to collect shared code between usb
and mmio code. Move the following source files in mt7615-common module:
- main.c
- init.c
- mcu.c
- mac.c
- debugfs.c
- eeprom.c
- trace.c

Create the following source files for mmio only source code and move them
in mt7615e module:
- pci_init.c
- dma.c
- pci_mac.c

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Lorenzo Bianconi
4fcf6e770b mt76: mt7615: fix possible deadlock in mt7615_stop
make mac_work per phy instead of per device and fix a possible deadlock
in mt7615_stop since mt7615_mac_work runs holding mt76 mutex

Fixes: fdd2e57076 ("mt76: mt7615: add dual-phy support for mac80211 ops")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Jules Irenge
5da612090d mt76: remove unnecessary annotations
Sparse report warnings at mt76_tx_status_unlock() and mt76_tx_status_lock()

warning: context imbalance in mt76_tx_status_lock() - wrong count at exit
warning: context imbalance in mt76_tx_status_unlock() - unexpected unlock

The root cause is the additional __acquire(&dev->status_list.lock)
and __release(&dev->status_list.unlock) called
 from inside mt76_tx_status_lock() and mt76_tx_status_unlock().

Remove __acquire(&dev->status_list.lock) annotation
Remove __releases(&dev->status_list.unlock)
Correct &dev->status_list.unlock to &dev->status_list.lock
	-unlock not defined in the sk_buff_head struct

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Lorenzo Bianconi
9fbb4b8621 mt76: mt7615: enable MSI by default
Enable MSI/MSI-X PCI interrupts by default. This patch has been tested
using Banana Pi r64 board

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Felix Fietkau
9b90ab32f8 mt76: mt7615: rework IRQ handling to prepare for MSI support
With MSI interrupts, IRQs must not be enabled from within the IRQ handler,
because that can lead to lost events.
Defer IRQ processing to a tasklet, which is also responsible for enabling
IRQs (to avoid race conditions against the handler)

Co-developed-by: Soul Huang <Soul.Huang@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Soul Huang <soul.huang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:31 +02:00
Lorenzo Bianconi
89829c9e65 mt76: mt7663: fix DMA unmap length
Fix DMA unmap length for mt7663e devices in mt7615_txp_skb_unmap_hw

Fixes: f40ac0f3d3 ("mt76: mt7615: introduce mt7663e support")
Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Soul Huang <soul.huang@mediatek.com>
Signed-off-by: Soul Huang <soul.huang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
2020-05-12 19:52:30 +02:00
Lorenzo Bianconi
c0f8055b39 mt76: mt7622: fix DMA unmap length
Fix DMA unmap length estimation in mt7615_txp_skb_unmap_hw for mt7622
chipset

Fixes: 6aa4ed7927 ("mt76: mt7615: implement DMA support for MT7622")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
2020-05-12 19:52:30 +02:00
Felix Fietkau
639e25a125 mt76: mt7615: set hw scan limits only for firmware with offload support
They do not apply to software scan

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:30 +02:00
Felix Fietkau
635cb0105e mt76: mt7615: disable hw/sched scan ops for non-offload firmware
Avoid having to attempt hw scan and fall back to software for every scan
on devices/firmware without hw scan support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:30 +02:00
Lorenzo Bianconi
6bcfdabbad mt76: mt7663: fix aggr range entry in debugfs
Fix register definitions for aggr range counter registers for mt7663
chipset

Fixes: f40ac0f3d3 ("mt76: mt7615: introduce mt7663e support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:30 +02:00
Lorenzo Bianconi
1855ad5360 mt76: mt7615: fix possible division by 0 in mt7615_mac_update_mib_stats
Check that val is not zero before aggr_per estimation in order to avoid a
possible division by 0

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:30 +02:00
Felix Fietkau
9a865741d8 mt76: mt76x2: disable merge of OTP ROM data by default
The reference driver does not seem to enable it by default, only under certain
conditions, e.g. when a .bin file is loaded.
Make it opt-in via a device tree property for now, in case it is needed on some
boards.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:30 +02:00
Felix Fietkau
6d3390a664 mt76: mt7603: disable merge of OTP ROM data by default
The reference driver does not seem to enable it by default, only under certain
conditions, e.g. when a .bin file is loaded.
Make it opt-in via a device tree property for now, in case it is needed on some
boards.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:30 +02:00
Felix Fietkau
371a59d151 mt76: mt7615: add support for applying tx DPD calibration from EEPROM
When the EEPROM data is read from flash, it can contain tx DPD calibration
data. Add support for sending the data to the firmware.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:30 +02:00
Felix Fietkau
ad380ad1eb mt76: mt7615: add support for applying DC offset calibration from EEPROM
When the EEPROM data is read from flash, it can contain DC offset calibration
data. Add support for sending the data to the firmware.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:30 +02:00
Felix Fietkau
b90728f82b mt76: mt7615: disable merge of OTP ROM data by default
The reference driver does not seem to enable it by default, only under certain
conditions, e.g. when a .bin file is loaded.
Make it opt-in via a device tree property for now, in case it is needed on some
boards.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:30 +02:00
Markus Elfring
373ab33422 mt76: mt7615: Delete an error message in mt7622_wmac_probe()
The function “platform_get_irq” can log an error already.
Thus omit a redundant message for the exception handling in the
calling function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:30 +02:00
Lorenzo Bianconi
fdb786cce0 mt76: mt7615: do not always reset the dfs state setting the channel
mac80211/hostapd runs mt7615_set_channel with the same channel
parameters sending multiple rdd commands overwriting the previous ones.
This behaviour is causing tpt issues on dfs channels.
Fix the issue checking new channel freq/width with the running one.

Fixes: 5dabdf71e9 ("mt76: mt7615: add multiple wiphy support to the dfs support code")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:30 +02:00
Sean Wang
044883e37d mt76: mt7663: correct the name of the rom patch
Rom patch is shared between Bluetooth and Wifi devices, so correct the
naming to allow two drivers to share the same file.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:30 +02:00
Lorenzo Bianconi
6e5d2099a4 mt76: mt7615: add address parameter to mt7615_eeprom_init
Introduce address parameter to mt7615_eeprom_init routine in order to be
reused adding usb support to mt7615 driver

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:29 +02:00
Lorenzo Bianconi
7d9f1d108c mt76: mt7615: introduce mt7615_wtbl_desc data structure
Generalize mt7615_rate_desc introducing mt7615_wtbl_desc and
mt7615_key_desc data structures in order to configure the hw wtbl
in a non-atomic context for usb devices

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:29 +02:00
Lorenzo Bianconi
294f17aea2 mt76: mt7615: rework wtbl key configuration
Remove key dependency from mt7615_mac_wtbl_update_key and export
mt7615_mac_wtbl_update_key, mt7615_mac_wtbl_update_pk and
mt7615_mac_wtbl_update_cipher in order to reuse them in usb code.
Move mt7615_mac_get_cipher in mac.h

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:29 +02:00
Lorenzo Bianconi
3a1880565a mt76: mt76u: rely on mt7622 queue scheme for mt7663u
Rely on the mt7622 endpoint definitions for mt7663u

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:29 +02:00
Lorenzo Bianconi
d506017ed4 mt76: mt7615: move mt7615_mac_wtbl_addr in mac.h
Move mt7615_mac_wtbl_addr in mac.h and add inline qualifier in order to
be reused adding usb support to mt7615 driver

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:29 +02:00
Lorenzo Bianconi
8915c3ceb9 mt76: mt7615: introduce __mt7663_load_firmware routine
Introduce __mt7663_load_firmware routine to load firmware for usb
devices.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:29 +02:00
Lorenzo Bianconi
8f93af9cac mt76: mt7615: introduce mt7615_mac_update_rate_desc routine
Move register configuration out of mt7615_mac_set_rates since usb
driver can't access device register in interrupt context. Introduce
mt7615_mac_update_rate_desc routine to report rate info to
mt7615_mac_set_rates

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:29 +02:00
Lorenzo Bianconi
d4bf77bd74 mt76: mt7615: introduce mt7663u support to mt7615_write_txwi
Extend mt7615_write_txwi routine to support usb txwi configuration

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:29 +02:00
Lorenzo Bianconi
bb31a80eb2 mt76: add headroom and tailroom to mt76_mcu_ops data structure
Introduce headroom and tailroom to mt76_mcu_ops data structure in order
to unify the routine used for mcu message allocation. This is a
preliminary patch to add mt7663u support

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:29 +02:00
Sean Wang
34cdf1a618 mt76: mt7615: remove unnecessary register operations
Remove mt76_wr(dev, MT_CSR(0x010), 0x8208) that would cause
MT_PCIE_IRQ_ENABLE to be disabled; MT_PCIE_IRQ_ENABLE should always keep
on enabled when the driver is running.

0x44064 is a not existing address

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:29 +02:00
Lorenzo Bianconi
5d3a4a4b57 mt76: mt7615: introduce rlm tlv in bss_info mcu command
Introduce rlm tlv header in bss_info mcu command in order to
inform the mcu about operating channel. Rlm header is necessary only if
the mcu is running low power functionalities (e.g offloaded scan)

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:29 +02:00
Sean Wang
bb366c5b88 mt76: mt7615: introduce BSS absence event
Introduce BSS absence event that is reported when the fw
is leaving or entering current operational channel.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:29 +02:00
Lorenzo Bianconi
20305f9817 mt76: mt7615: introduce scheduled scan support
Introduce scheduled scan support for mt7663e devices

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:28 +02:00
Lorenzo Bianconi
fcdfc29e58 mt76: mt7615: introduce hw scan support
Introduce hw scan support to mt7663e driver

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12 19:52:28 +02:00