summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
Commit message (Collapse)AuthorAgeFilesLines
* mt76: introduce phys array in mt76_dev structureLorenzo Bianconi2022-07-111-1/+1
| | | | | | | | | Introduce phys array in mt76_dev structure to reference mt76_phy supported by the chipset. This is a preliminary patch to introduce newer chipset support. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: do not use skb_set_queue_mapping for internal purposesFelix Fietkau2022-07-111-1/+2
| | | | | | | | | | | | Previously the code used skb_set_queue_mapping for management or non-bufferable powersave frames that need to be sent to a different hardware queue. This can confuse AQL, which expects the value to remain the same until the tx status report. The only place that currently uses the altered skb queue mapping is the txwi write function. Change the code to pass the hardware queue id as a function parameter instead. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: fix throughput regression on DFS channelsFelix Fietkau2022-07-111-1/+0
| | | | | | | | | | | | For some reason, mt7615 reacts badly to repeatedly enabling/disabling the radar detector without also switching the channel. This results in very bad throughput on DFS channels, because hw->conf.radar_enabled can get toggled a few times after CAC ends. Fix this by always leaving the DFS detector enabled on DFS channels and instead suppress unwanted detection events. Fixes: 2c86f6752046 ("mt76: mt7615: fix/rewrite the dfs state handling logic") Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: add sta_rec with EXTRA_INFO_NEW for the first time onlyFelix Fietkau2022-07-111-0/+1
| | | | | | | Set EXTRA_INFO_NEW for the first time only to prevent adding the same starec entry, otherwise the entry might be removed in fw. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mt7615_txp_skb_unmap in common codeLorenzo Bianconi2022-07-111-2/+0
| | | | | | | | Move mt7615_txp_skb_unmap in shared code and reuse it in mt7915e and mt7921e driver. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mt76_connac_tx_complete_skb in shared codeLorenzo Bianconi2022-07-111-1/+0
| | | | | | | | | Since now txp structures are in common code we can reuse mt76_connac_tx_complete_skb routine in mt7921e, mt7915e and mt7615e drivers. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7663u: introduce mt7663u_mcu_power_on routineLorenzo Bianconi2022-03-161-0/+1
| | | | | | | | Introduce mt7663u_mcu_power_on utility routine since the code is shared between mt7663u_mcu_init() and mt7663u_probe(). Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615e: process txfree and txstatus without allocating skbsLorenzo Bianconi2022-02-031-0/+1
| | | | | | | | Similar to mt7915 driver, process txfree and txstatus without allocating skbs in order to reduce pressure on the memory allocator Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mt76_connac_mcu_rdd_cmd in mt76-connac moduleLorenzo Bianconi2022-02-031-3/+0
| | | | | | | | Move mt76_connac_mcu_rdd_cmd routine in mt76-connac module and remove duplicated code. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: introduce is_connac_v1 utility routineLorenzo Bianconi2022-02-031-18/+0
| | | | | | | | Introduce is_connac_v1 inline utility routine to check if the device is generation v1. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: sdio: introduce parse_irq callbackLorenzo Bianconi2021-10-201-0/+12
| | | | | | | | | | | Add parse_irq to handle that interrupt status structure is different between mt7663s and mt7921s. This is a preliminary patch to introduce mt7921s driver Tested-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: sdio: move common code in mt76_sdio moduleLorenzo Bianconi2021-10-201-4/+0
| | | | | | | | | | Move sdio common code in mt76_sdio module. This is a preliminary patch to support mt7921s 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>
* mt76: mt7663s: rely on mcu reg access utilitySean Wang2021-10-201-2/+0
| | | | | | | | rely on mcu reg access utility and drop the duplicated code. Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: move mt7615_mcu_set_p2p_oppps in mt76_connac moduleLorenzo Bianconi2021-10-201-2/+0
| | | | | | | | Move mt7615_mcu_set_p2p_oppps routine in mt76_connac_lib module in order to be reused in mt7921 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: set macwork timeout according to runtime-pmLorenzo Bianconi2021-06-191-1/+6
| | | | | | | | Set macwork timeout value according to runtime-pm in order to reduce power consumption Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: make mt76_update_survey() per phyRyder Lee2021-06-191-1/+1
| | | | | | | Reduce duplicated survey for DBDC. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: add thermal sensor device supportRyder Lee2021-06-191-1/+2
| | | | | | | | Similar to mt7915, switching to use standard hwmon sysfs. For reading temperature, cat /sys/class/ieee80211/phy*/hwmon*/temp1_input Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7663: enable hw rx header translationLorenzo Bianconi2021-06-191-3/+4
| | | | | | | | As already done for mt7615 and mt7915, enable rx header translation offload for mt7663 in order to reduce cpu load in the rx path. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move token_lock, token and token_count in mt76_devLorenzo Bianconi2021-04-211-3/+0
| | | | | | | | | Move token_lock, token and token_count data structures in mt76_dev. This is a preliminary patch to move token management in mt76 common module since it is shared by mt7615, mt7915 and mt7921 drivers. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7663: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx pathLorenzo Bianconi2021-04-211-0/+1
| | | | | | | | | | Introduce mt7615_tx_worker routine as mt76 tx worker callback for mt7663. Rely on mt76_connac_pm_ref/mt76_connac_pm_unref to check PM state and increment/decrement wake counter Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: move mcu_update_arp_filter in mt76_connac moduleLorenzo Bianconi2021-04-211-3/+0
| | | | | | | | Move mt76_connac_mcu_update_arp_filter in mt76_connac module since the code is shared between mt7615 and mt7921 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: report Rx timestampRyder Lee2021-04-121-1/+1
| | | | | | | | | Frame reception timestamp (low 32-bits) that indicates the value of the local TSF timer value at the time the first bit of the MAC header in the received frame (PPDU unit) arriving at the MAC. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: fix chip reset on MT7622 and MT7663eFelix Fietkau2021-04-121-0/+1
| | | | | | | | After chip reset, the DMA scheduler needs to be initialized as well. Since the code is PCI/SoC specific, move it to pci_mac.c, so that it can depend on a function in dma.c Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7622: trigger hif interrupt for system resetRyder Lee2021-04-121-0/+2
| | | | | | | hif interrupt needs to be triggered after MT_MCU_INT_EVENT. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: fix mib stats counter reporting to mac80211Lorenzo Bianconi2021-04-121-5/+5
| | | | | | | | | | In order to properly report MIB counters to mac80211, resets stats in mt7615_get_stats routine and hold mt76 mutex accessing MIB counters. Sum up MIB counters in mt7615_mac_update_mib_stats routine. Fixes: c388d8584bc83 ("mt76: mt7615: add a get_stats() callback") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: add support for rx decapsulation offloadRyder Lee2021-04-121-0/+4
| | | | | | | | | For AP and Client mode, the hardware can pass received packets as 802.3 frames that can be passed to the network stack as-is. Tested-by: Frank Wunderlich <frank-w@public-files.de> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: connac: update sched_scan cmd usageSean Wang2021-04-121-5/+0
| | | | | | | | | | | | Update sched_scan command usage according to the current firmware submitted into linux-firmware.git. Fixes: 80fc1e37c0eb ("mt76: mt7921: rely on mt76_connac_mcu module for sched_scan and hw_scan") 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> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7663: introduce coredump supportLorenzo Bianconi2021-01-291-1/+3
| | | | | | | | | Similar to mt7921 devices, introduce coredump support for mt7663 chipset 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>
* mt76: mt76_connac: move pm utility routines in mt76_connac_lib moduleLorenzo Bianconi2021-01-291-15/+4
| | | | | | | | Move power_save common code shared between mt7663 and mt7921 in mt76_connac module Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76_connac: move pm data struct in mt76_connac.hLorenzo Bianconi2021-01-291-17/+2
| | | | | | | | | Move pm mt7663 data structure in mt76_connac.h introducing mt76_connac_pm data struct. This is a preliminary patch to share pm code between mt7663 and mt7921 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76_connac: move WoW and suspend code in mt76_connac_mcu moduleLorenzo Bianconi2021-01-291-6/+0
| | | | | | | | Move WoW and suspend code in mt76_connac_mcu module in order to be reused in mt7615 and mt7921 drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76_connac: move hw_scan and sched_scan routine in mt76_connac_mcu moduleLorenzo Bianconi2021-01-291-15/+0
| | | | | | | | Move hw_scan/sched_scan in mt76_connac_mcu module in order to be reused in mt7615 and mt7921 drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76_connac: create mcu libraryLorenzo Bianconi2021-01-291-25/+6
| | | | | | | | Introduce mt76_connac common mcu library for code sharing between mt7615 and mt7921 devices Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: introduce mt76_vif data structureLorenzo Bianconi2021-01-291-6/+1
| | | | | | | | Introduce mt76_vif data structure to share common fields between mt7615_vif and mt7921_vif and create a mcu common library Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: unify init workFelix Fietkau2021-01-271-3/+1
| | | | | | Reduce code duplication and remove unnecessary exports Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move chainmask in mt76_phyLorenzo Bianconi2021-01-261-2/+0
| | | | | | | | | | | Move chainmask from driver phy to mt76_phy since it is used by all drivers. This is a preliminary patch to create a common mcu library used by mt7615 and mt7921 drivers 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>
* mt76: move mac_work in mt76_core moduleLorenzo Bianconi2021-01-261-3/+0
| | | | | | | | | | | Move mac_work delayed_work and mac_work_count in mt76_phy since it is used by all drivers. This is a preliminary patch to create a common mcu library used by mt7615 and mt7921 drivers 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>
* mt76: mt7615: move testmode data from dev to phyShayne Chen2021-01-261-11/+11
| | | | | | | | | Move per-chip testmode data to mt7615_phy, to properly support reg_backup and rx status of each band in testmode. Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Acked-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: reset token when mac_reset happensRyder Lee2021-01-261-1/+1
| | | | | | | Reset token in mt7615_mac_reset_work() to avoid possible leakege. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mcu queues to mt76_dev q_mcu arrayLorenzo Bianconi2020-12-041-1/+1
| | | | | | | | | Move mcu queue to a dedicated array q_mcu in mt76_dev structure. This is a preliminary patch to move data queues in mt76_phy and properly support dbdc Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: refactor usb/sdio rate codeLorenzo Bianconi2020-12-041-13/+4
| | | | | | | | Since wtbl workqueue is used only for rate handling, refactor code to make it more clear Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: support 16 interfacesRyder Lee2020-12-041-19/+8
| | | | | | | | | | | | | | When looking for a MAC address slot, start by using main BSSID slots 1-3, afterwards use 16 repeater mode BSSID slots, then start using the slots usually used for AP mode. This search order should prevent unnecessary conflicts with AP mode interfaces on the same PHY. Note that two PHYs share global 32 omac slots with each other. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: testmode: switch ib and wb rssi to array type for per-antenna reportShayne Chen2020-12-041-2/+2
| | | | | | | | | Change ib_rssi and wb_rssi into array type, since they could be reported by per-antenna. Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: run key configuration in mt7615_set_key for usb/sdio devicesLorenzo Bianconi2020-12-041-23/+4
| | | | | | | | | | Since rate configuration is run holding dev mutex, we can run key configuration in mt7615_set_key for usb/sdio devices avoiding to schedule the workqueue Tested-by: Tested-by: YN Chen <yn.chen@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: enable beacon filtering by default for offload fwLorenzo Bianconi2020-12-041-1/+5
| | | | | | | | | In order to reduce cpu cycles, enable hw beacon filter by default if the device is running offload fw with sta only interfaces. Disable runtime pm for multi-vif scenario. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: make mcu_ops->mcu_send_msg optionalFelix Fietkau2020-12-041-2/+0
| | | | | | Remove it from mt7615 and mt7915 and implement it in core code instead Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move waiting and locking out of mcu_ops->mcu_skb_send_msgFelix Fietkau2020-12-041-1/+0
| | | | | | | This removes some code duplication and prepares the code for making the MCU API more flexible Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: implement .mcu_parse_response in struct mt76_mcu_opsFelix Fietkau2020-12-041-0/+2
| | | | | | | Do not free skb inside that function Preparation for further cleanup Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7615: add debugfs knob for setting extended local mac addressesFelix Fietkau2020-12-041-0/+2
| | | | | | | | | This is primarily for testing and can be used in combination with monitor mode to make the card respond to packets sent to a specific MAC address. For now this is only exposed as a debug/testing feature, later on the approach might be used to support more concurrent station interfaces Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt7663s: convert txrx_work to mt76_workerLorenzo Bianconi2020-12-041-1/+1
| | | | | | | | In order to improve driver throughput, convert txrx_work to mt76 worker threads APIs. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>