aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt7603 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-05-21treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner2-0/+2
Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-01mt76: mt7603: dynamically alloc mcu req in mt7603_mcu_set_eepromLorenzo Bianconi1-10/+20
Do not allocate mcu requests on the stack in mt7603_mcu_set_eeprom in order to avoid the following warning: Warning: the frame size of 1032 bytes is larger than 1024 bytes Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: mt7603: enable/disable pre_tbtt_tasklet in mt7603_set_channelLorenzo Bianconi2-2/+9
Disable pre_tbtt_tasklet tasklet before setting the operating channel. Enable/disable beacon_timer in mt7603_set_channel Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: move pre_tbtt_tasklet in mt76_devLorenzo Bianconi5-9/+7
Move pre_tbtt_tasklet tasklet in mt76_dev data structure since it is used by all drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: move beacon_mask in mt76_devLorenzo Bianconi2-10/+9
Move beacon_mask in mt76_dev data structure since it is used by all drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: move beacon_int in mt76_devLorenzo Bianconi4-4/+3
Move beacon_int in mt76_dev data structure since it is used by all drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: mt7603: report firmware version using ethtoolLorenzo Bianconi1-0/+3
Print fw_ver and build_date members of struct mt7603_fw_trailer similarly to what appears in the output of 'dmesg' when the MCU firmware is loaded. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: fix endianness sparse warningsRyder Lee1-1/+1
Fix many warnings with incorrect endian assumptions. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: mt7603: run __mt76_mcu_send_msg in mt7603_mcu_send_firmwareLorenzo Bianconi1-10/+5
Run __mt76_mcu_send_msg instead of __mt7603_mcu_msg_send and remove duplicated code. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: mt7603: init mcu_restart function pointerLorenzo Bianconi1-3/+4
Use common function wrapper in mt7603_mcu_exit since the code is shared with mt7615 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: mt7603: initialize mt76_mcu_ops data structureLorenzo Bianconi3-11/+21
Use __mt76_mcu_send_msg wrapper instead of mt7603_mcu_msg_send. This is a preliminary patch for mt7615-mt7603 mcu code unification Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: mt7603: use standard signature for mt7603_mcu_msg_sendLorenzo Bianconi1-34/+27
Use mt76 common signature for mt7603_mcu_msg_send. Move skb allocation in mt7603_mcu_msg_send and remove duplicated code. This is a preliminary patch for mt7615-mt7603 mcu code unification Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: mt7603: remove query from mt7603_mcu_msg_send signatureLorenzo Bianconi1-22/+14
Remove query parameter from mt7603_mcu_msg_send/__mt7603_mcu_msg_send routine signature since it can be obtained from cmd value. This is a preliminary patch for mcu code unification between mt7615 and mt7603 drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: mt7603: fix initialization of max rx lengthFelix Fietkau2-1/+6
The previous version only accidentally disabled A-MSDU deaggregation by using the wrong mask for rx length configuration, which left previous length value in place. Fix the length and initialize the register completely to keep A-MSDU de-aggregation remaining disabled Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: use macro for sn and seq_ctrl conversionRyder Lee2-2/+2
Use macro to convert sn and seq_ctrl for better readability. Signed-off-by: Roy Luo <royluo@google.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: add skb pointer to mt76_tx_infoLorenzo Bianconi2-7/+8
Pass skb pointer to tx_prepare_skb through mt76_tx_info data structure. This is a preliminary patch to properly support dma error path for new chipsets (e.g. 7615) Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: move mac_work in mt76_devLorenzo Bianconi4-9/+8
Move mac_work delayed work in mt76_dev data structure since it is used by all drivers and it will be reused adding mac work to mt7615 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: only schedule txqs from the tx taskletFelix Fietkau1-0/+2
Reduces lock contention from the tx path and improves performance Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: move tx tasklet to struct mt76_devFelix Fietkau4-7/+6
Allows it to be scheduled from core code Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: store wcid tx rate info in one u32 reduce lockingFelix Fietkau1-2/+2
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: use readl/writel instead of ioread32/iowrite32Felix Fietkau1-2/+2
Switching to readl/writel is faster because it gets rid of an unnecessary wrapper with extra checks. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: fix tx power issuesFelix Fietkau1-0/+1
- tx power is stored in the channels after ieee80211_register_hw, so chan->orig_mpwr needs to be updated as well - for non-TSSI devices, mt76x2e needs to use a different target power value from the EEPROM - fix a rounding error in a few places (need to round up, not down) Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: introduce mt76_free_device routineLorenzo Bianconi1-1/+1
Move mt76_tx_free in mt76_free_device routine in order to unmap all txwi descriptors at module unload Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: unify set_timStanislaw Gruszka1-7/+1
All mt76 drivers (now also USB drivers) require empty .set_tim callback. Add it to common mt76 module and use on all drivers. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt7603: core: do not use magic numbers in mt7603_reg_mapLorenzo Bianconi1-2/+2
Use register definitions instead of magic numbers in mt7603_reg_map Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt7603: remove mt7603_mcu_init routineLorenzo Bianconi3-11/+3
Remove mt7603_mcu_init since mcu.mutex has been already initialized in mt76_mmio_init. Run mt7603_load_firmware directly in mt7603_init_hardware Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: dma: add static qualifier to mt76_dma_tx_queue_skbLorenzo Bianconi1-4/+2
As already done for mt76_dma_tx_queue_skb_raw, add static qualifier to mt76_dma_tx_queue_skb and introduce mt76_tx_queue_skb in order to run mt76_dma_tx_queue_skb in driver code Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: introduce mt76_tx_info data structureLorenzo Bianconi2-2/+2
Add mt76_tx_info as auxiliary data structure to pass values to tx_prepare_skb pointer. This is a preliminary patch to add support for new chipsets (e.g. mt7615) Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: introduce mt76_sw_queue data structureLorenzo Bianconi4-10/+18
Introduce mt76_sw_queue data structure in order to support new chipsets (e.g. mt7615) that have a shared hardware queue for all traffic identifiers. mt76_sw_queue will be used to track outstanding packets Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: remove mt76_queue dependency from tx_complete_skb function pointerLorenzo Bianconi2-5/+5
Remove mt76_queue dependency from tx_complete_skb function pointer and rely on mt76_tx_qid instead. Remove flush from tx_complete_skb signature. This is a preliminary patch to introduce mt76_sw_queue support Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: remove mt76_queue dependency from tx_prepare_skb function pointerLorenzo Bianconi2-6/+7
Remove mt76_queue dependency from tx_prepare_skb function pointer and rely on mt76_tx_qid instead. This is a preliminary patch to introduce mt76_sw_queue support Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: remove mt76_queue dependency from tx_queue_skb function pointerLorenzo Bianconi1-3/+3
Remove mt76_queue dependency from tx_queue_skb function pointer and rely on mt76_tx_qid instead. This is a preliminary patch to introduce mt76_sw_queue support Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: dma: move mt76x02_init_{tx,rx}_queue in mt76 moduleLorenzo Bianconi1-16/+10
Move mt76x02_init_tx_queue and mt76x02_init_rx_queue in mt76 module in order to be reused adding support for mt7603 driver and remove duplicated code. Squash mt76x02_init_tx_queue and mt76x02_init_rx_queue in mt76_dma_alloc_queue Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: mmio: move mt76x02_set_irq_mask in mt76 moduleLorenzo Bianconi2-15/+2
Move mt76x02_set_irq_mask in mt76 module in order to be reused adding support for mt7603 driver and remove duplicated code Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-04-12mt76: mt7603: send BAR after powersave wakeupFelix Fietkau1-1/+1
Now that the sequence number allocation is fixed, we can finally send a BAR at powersave wakeup time to refresh the receiver side reorder window Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-12mt76: mt7603: fix sequence number assignmentFelix Fietkau3-43/+18
If the MT_TXD3_SN_VALID flag is not set in the tx descriptor, the hardware assigns the sequence number. However, the rest of the code assumes that the sequence number specified in the 802.11 header gets transmitted. This was causing issues with the aggregation setup, which worked for the initial one (where the sequence numbers were still close), but not for further teardown/re-establishing of sessions. Additionally, the overwrite of the TID sequence number in WTBL2 was resetting the hardware assigned sequence numbers, causing them to drift further apart. Fix this by using the software assigned sequence numbers Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-12mt76: mt7603: add missing initialization for dev->ps_lockFelix Fietkau1-0/+2
Fixes lockdep complaint and a potential race condition Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-03-19mt76: mt7603: use the correct hweight8() functionFelix Fietkau3-4/+3
__sw_hweight8() is only defined if CONFIG_GENERIC_HWEIGHT is enabled. The function that works on all architectures is hweight8(). Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-03-07mt76: fix return value check in mt76_wmac_probe()Wei Yongjun1-2/+2
In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: c8846e101502 ("mt76: add driver for MT7603E and MT7628/7688") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-03-07mt76: mt7603: set moredata flag when queueing ps-filtered packetsFelix Fietkau1-0/+11
Clients should poll for more packets afterwards Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-03-07mt76: mt7603: clear the service period on releasing PS filtered packetsFelix Fietkau1-0/+3
These packets have no txwi entry in the ring, so tracking via tx status does not work. To prevent PS poll requests from being unanswered, end the service period right away Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-03-07mt76: mt7603: notify mac80211 about buffered frames in ps queueFelix Fietkau1-2/+11
Also fix the size check for filtered powersave frames Fixes a corner case with waking up clients Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-03-07mt76: mt7603: fix up hardware queue index for PS filtered packetsFelix Fietkau1-0/+4
Make the queue index match the hardware queue on which they get sent out Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-03-07mt76: mt7603: clear ps filtering mode before releasing buffered framesFelix Fietkau1-0/+2
Fixes sending them, otherwise they loop back right into the buffer Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-03-07mt76: mt7603: fix tx status HT rate validationFelix Fietkau1-1/+1
Use the correct variable in the check. Fixes an uninitialized variable warning Reported-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Fixes: c8846e1015022 ("mt76: add driver for MT7603E and MT7628/7688") Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-02-26mt76: add driver for MT7603E and MT7628/7688Felix Fietkau18-0/+5862
This driver is for a newer generation of 2x2 MediaTek 802.11n chipsets. MT7603E is a PCIe chip. MT7628 and MT7688 are MIPS SoC devices with built-in WLAN. MT7688 is limited to 1x1 This driver fully supports AP, station, mesh, ad-hoc and monitor mode. Signed-off-by: Felix Fietkau <nbd@nbd.name>