Commit Graph
56 Commits
Author SHA1 Message Date
Felix Fietkau 9bce85f16b Revert "mt76: rely on mac80211 utility routines to compute airtime"
This reverts commit 29fec3a9b0.
2020-03-06 11:15:40 +01:00
Lorenzo BianconiandFelix Fietkau 29fec3a9b0 mt76: rely on mac80211 utility routines to compute airtime
Rely on mac80211 airitme utility routines and remove mt76 duplicated code
to estimate tx/rx airtime

Signed-off-by: Lorenzo Bianconi <[email protected]>
Acked-by: Toke Høiland-Jørgensen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-01-27 17:48:38 +01:00
Lorenzo BianconiandFelix Fietkau c14d6563c4 mt76: mt76x2e: disable pcie_aspm by default
On same device (e.g. U7612E-H1) PCIE_ASPM causes continuous mcu hangs and
instability. Since mt76x2 series does not manage PCIE PS states, first we
try to disable ASPM using pci_disable_link_state. If it fails, we will
disable PCIE PS configuring PCI registers.
This patch has been successfully tested on U7612E-H1 mini-pice card

Tested-by: Oleksandr Natalenko <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
2019-10-28 08:42:23 +01:00
Felix Fietkau f34b1ae42c mt76: track rx airtime for airtime fairness and survey
Report total rx airtime for valid stations as BSS rx time in survey

mt7615 is left out for now, it will be supported later by reading
hardware counters instead of calculating airtime in software

Signed-off-by: Felix Fietkau <[email protected]>
2019-09-26 12:42:08 +02:00
Ryder LeeandFelix Fietkau 334b4cedf2 mt76: add mac80211 driver for MT7615 PCIe-based chipsets
This driver is for a newer generation of MediaTek MT7615 4x4 802.11ac
PCIe-based chipsets, which support wave2 MU-MIMO up to 4 users/group
and also support up to 160MHz bandwidth.

The driver fully supports AP, station and monitor mode.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Roy Luo <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-04-25 12:04:34 +02:00
Stanislaw GruszkaandFelix Fietkau f2a18f5a7f mt76x02: introduce mt76x02_beacon.c
Move most of beaconing code into separate file and separate beacon
initialization for USB and MMIO as pre TBTT implementation for USB
will be different.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-03-24 08:20:43 +01:00
Stanislaw GruszkaandFelix Fietkau e4250c91f9 mt76usb: remove usb_mcu.c
Don't need separate file just for kmalloc/kfree.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-02-26 12:26:02 +01:00
Lorenzo BianconiandFelix Fietkau 6e33ce6d73 mt76: move mt76_mcu_msg_alloc in mt76-core
Move mt76_mcu_msg_alloc in mt76-core module and remove duplicated code.
mt76_mcu_msg_alloc will be reused adding support for mt7603 driver

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-02-07 14:48:34 +01:00
Arnd BergmannandFelix Fietkau d1bc504955 mt76: fix building without CONFIG_LEDS_CLASS
When CONFIG_LEDS_CLASS is disabled, or it is a loadable module while
mt76 is built-in, we run into a link error:

drivers/net/wireless/mediatek/mt76/mac80211.o: In function `mt76_register_device':
mac80211.c:(.text+0xb78): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `devm_of_led_classdev_register'

We don't really need a hard dependency here as the driver can presumably
work just fine without LEDs, so this follows the iwlwifi example and
adds a separate Kconfig option for the LED support, this will be available
whenever it will link, and otherwise the respective code gets left out from
the driver object.

Fixes: 17f1de56df05 ("mt76: add common code shared between multiple chipsets")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2019-01-11 15:24:32 +01:00
Lorenzo BianconiandFelix Fietkau d21a83574b mt76: move dfs support in mt76x02-lib module
Move mt76x2 DFS support in mt76x02-lib module in order to
be reused by mt76x0 driver and unlock DFS frequencies

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2018-10-23 11:14:20 +02:00
Lorenzo BianconiandFelix Fietkau ecec6ba54d mt76: move mt76x02_debugfs in mt76x02-lib module
Move mt76x02_debugfs in mt76x02-lib module in order to
be reused by mt76x0 driver and remove duplicated code

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2018-10-16 12:51:14 +02:00
Lorenzo BianconiandFelix Fietkau 3770c54128 mt76: move mt76x02_mac_poll_tx_status in mt76x02-lib moudle
Move mt76x02_mac_poll_tx_status in mt76x02_mac.c in order to
be reused by mt76x0 drivers for irq unification.
Moreover introduce mt76x02_trace source file to define mt76x02
trace points

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2018-10-05 20:00:30 +02:00
Lorenzo BianconiandFelix Fietkau 159f76741f mt76: move txrx shared routines in mt76x02_txrx.c
Add mt76x02_txrx.c source file in order to contain tx/rx shared
routines for mt76x0 and mt76x2 drivers

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2018-10-05 19:59:45 +02:00
Lorenzo BianconiandFelix Fietkau c6b192623f mt76x2: move mt76x2 source files to mt76x2 folder
Move mt76x2 and mt76x2u drivers to mt76x2 subfolder and
leave just shared code in mt76 root folder

Acked-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2018-10-01 13:54:56 +02:00
Felix Fietkau 62ce3245da move mt7603 source files to mt7603/
Signed-off-by: Felix Fietkau <[email protected]>
2018-09-28 18:02:01 +02:00
Lorenzo BianconiandFelix Fietkau 0527feb6f7 mt76: add mt76x02_dma_enable/mt76x02_dma_disable utility routines
Introduce mt76x02_dma_enable and mt76x02_dma_disable utility routines
in order to be reused in mt76x0 mac configuration and remove duplicated
code

Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-09-28 13:45:26 +02:00
Lorenzo BianconiandFelix Fietkau 2214aa5a24 mt76: add mt76x02_phy_set_txpower utility routine
Add mt76x02_phy_set_txpower utility routine in mt76x02_phy.c
in order to be reused in mt76x0 tx power management code.
Moreover move following routines in mt76x02-lib module:
- mt76x02_tx_power_mask
- mt76x02_get_max_rate_power
- mt76x02_limit_rate_power
- mt76x02_add_rate_power_offset

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2018-09-26 22:04:27 +02:00
Lorenzo BianconiandFelix Fietkau 844daebc0d mt76: move mt76x2_get_efuse_data in mt76x02-lib module
Move mt76x2_efuse_read and mt76x2_get_efuse_data in mt76x02_eeprom.c
in order to be reused in mt76x0 driver for eeprom parsing

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2018-09-21 18:05:35 +02:00
Felix Fietkau a6f80ef56b build: make building 76x2e and 7603e optional
Signed-off-by: Felix Fietkau <[email protected]>
2018-09-12 14:04:57 +02:00
Lorenzo BianconiandFelix Fietkau a633c611f6 mt76x2: move mt76x2 mcu shared code in mt76x2_mcu_common.c
Move shared mt76x2 {pcie/usb} mcu shared code in a common file
and remove duplicated code

Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-09-12 13:16:50 +02:00
Lorenzo BianconiandFelix Fietkau a0cbd4b677 mt76: move mt76{0,2} mcu shared code in mt76x02_mcu.c
Move shared mt76x2/mt76x0 mcu shared code in a common file
and remove duplicated code

Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-09-12 13:16:50 +02:00
Lorenzo BianconiandFelix Fietkau 6337ffbe07 mt76: usb: move mt76u_skb_dma_info in mt76x02_usb_core.c
Move mt76u_skb_dma_info routine in mt76x02-usb module and rename it in
mt76x02u_skb_dma_info. Moreover move mt76x02u_set_txinfo in
mt76x02_usb_core.c. This is a preliminary patch to move MT_TXD_INFO,
MT_MCU_MSG and MT_RX_FCE_INFO defs in mt76x02-lib module since other
chipsets (e.g. mt7603) use different dma definitions

Acked-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-09-12 13:16:49 +02:00
Lorenzo BianconiandFelix Fietkau d2773ceed2 mt76: usb: move mt76x02 mcu code in mt76x02-usb module
Introduce mt76x02_usb_mcu.c in order to contain mt76x02u mcu related
code. Add mt76x02-usb module as a container for mt76x02 usb code.
This is a preliminary patch to move MT_TXD_INFO, MT_MCU_MSG and
MT_RX_FCE_INFO defs in mt76x02-lib module since other chipsets (e.g.
mt7603) use different dma definitions

Acked-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-09-12 13:16:24 +02:00
Stanislaw GruszkaandFelix Fietkau bb57912be5 mt76x0: inital split between pci and usb
For now pci driver can read ASIC version from the device :-)

Signed-off-by: Stanislaw Gruszka <[email protected]>
2018-09-12 13:16:24 +02:00
Stanislaw GruszkaandFelix Fietkau 55bceeeda2 mt76: unify mac_get_key_info
Merge mt76x{0,2} mac_get_key_info into new mt76x02_mac.c file.

Signed-off-by: Stanislaw Gruszka <[email protected]>
2018-09-11 13:49:19 +02:00
Stanislaw GruszkaandFelix Fietkau a2380992d8 mt76: create new mt76x02-lib module for common mt76x{0,2} code
Move rxfilter and mutex to common structure. Create mt76x02-lib.ko
for mt76x0 and mt76x2 common functions and create new unified
mt76x02_configure_filter() function there.

Signed-off-by: Stanislaw Gruszka <[email protected]>
2018-09-11 13:49:19 +02:00
Stanislaw GruszkaandFelix Fietkau e176af8f13 mt76: Kconfig and Makefile for mt76x0 driver
Add Kconfig and Makefiles for mt76x0 driver. Now the driver
can be build.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 25b4598274 mt76: add driver code for MT76x2u based devices
MT76x2u is a 2x2 USB 802.11ac chipset by MediaTek. This driver currently
support station mode

Tested-by: <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 99a3afad76 mt76: add usb support to mt76 layer
This will be used by drivers for MT76x2u based devices

Tested-by: <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 7625508f42 mt76: move mt76x2_debugfs in mt76-common module
Move mt76x2_debugfs code in mt76-common module since it is shared
between mt76x2 and mt76x2u

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 264edbe6df mt76: add mt76x2_phy_common to mt76x2-common module
Move phy related code shared between mt76x2 and mt76x2u in
mt76x2-common module

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 61c4c614b0 mt76: add mt76x2_common to mt76x2-common module
Move core related code shared between mt76x2 and mt76x2u in
mt76x2-common module

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 8f568cebdb mt76: add mt76x2_init_common to mt76x2-common module
Move init related code shared between mt76x2 and mt76x2u in
mt76x2-common module

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 29f960aa27 mt76: add mt76x2_mac_common to mt76x2-common module
Move mac related code shared between mt76x2 and mt76x2u in
mt76x2-common module

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 9bf1aa1d8c mt76: add mt76x2_tx_common to mt76x2-common module
Move tx related code shared between mt76x2 and mt76x2u in mt76x2-common
module

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau d099694a3d mt76: introduce mt76x2-common module
In order to remove usb dependency from pcie code, add mt76x2-common as
a container of shared code between mt76x2 and mt76x2u. Add eeprom code
to mt76x2-common module

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Felix Fietkau b0508d3044 mt76: implement A-MPDU rx reordering in the driver code
This is required for performing CCMP PN validation in software

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-22 10:43:21 +01:00
Lorenzo BianconiandFelix Fietkau 6375fc1abe mt76x2: add hw radar detector
add hw DFS pattern detector support for mt76x2 based devices
DFS region supported:
 - FCC
 - ETSI
 - JAPAN_W53
 - JAPAN_W56

Signed-off-by: Lorenzo Bianconi <[email protected]>
2016-09-25 18:13:12 +02:00
Felix Fietkau f466a62489 mt7603: add debugfs file to show MAC reset causes
Signed-off-by: Felix Fietkau <[email protected]>
2016-03-04 15:41:05 +01:00
Felix Fietkau c190f15d6f mt7603: add basic mt7628 support
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-28 22:06:21 +01:00
Felix Fietkau e6bc17ac24 mt7603: add initial code to configure beacon timers
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-25 17:23:47 +01:00
Felix Fietkau 65c0e3dccf mt7603: add mt7603_eeprom.c
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-22 08:27:32 +01:00
Felix Fietkau 43d5b84989 move tx scheduling code to common
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-16 19:04:06 +01:00
Felix Fietkau 239b67204c move eeprom related code to common
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-16 02:09:26 +01:00
Felix Fietkau 19ad5451a6 mt7603: initialize wtbl entries
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-15 18:35:56 +01:00
Felix Fietkau 302db9bb94 move debugfs code to common code
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-08 15:34:24 +01:00
Felix Fietkau 89c32b4b58 move mac80211 device registration to common code
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-08 10:21:52 +01:00
Felix Fietkau d9fa49264e add a preliminary port of the dma code for mt7603
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-07 00:17:11 +01:00
Felix Fietkau 73b49b6c15 mt7603: add a stub for irq handling
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 22:21:02 +01:00
Felix Fietkau 66af6b3aad move low level DMA code to mt76.ko
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 21:32:43 +01:00