summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
AgeCommit message (Collapse)AuthorFilesLines
2024-09-06wifi: mt76: connac: move mt7615_mcu_del_wtbl_all to connacFelix Fietkau1-1/+0
Preparation for reusing it in mt7915 Link: https://patch.msgid.link/20240827093011.18621-18-nbd@nbd.name Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-09-06wifi: mt76: partially move channel change code to coreFelix Fietkau1-1/+1
This allows the core code to change the channel. Code deduplication and preparation for adding scanning code to the core. Link: https://patch.msgid.link/20240828063422.44813-1-nbd@nbd.name Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-07-25wifi: mt76: mt7615: rely on shared poll_list fieldLorenzo Bianconi1-1/+0
Rely on poll_list field in mt76_wcid structure and get rid of private copy. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-07-25wifi: mt76: mt7615: rely on shared sta_poll_list and sta_poll_lockLorenzo Bianconi1-3/+0
Rely on sta_poll_list and sta_poll_lock fields in mt76_dev structure and get rid of private copies. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-04-21Merge tag 'wireless-next-2023-04-21' of ↵Jakub Kicinski1-10/+1
git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Kalle Valo says: ==================== wireless-next patches for v6.4 Most likely the last -next pull request for v6.4. We have changes all over. rtw88 now supports SDIO bus and iwlwifi continues to work on Wi-Fi 7 support. Not much stack changes this time. Major changes: cfg80211/mac80211 - fix some Fine Time Measurement (FTM) frames not being bufferable - flush frames before key removal to avoid potential unencrypted transmission depending on the hardware design iwlwifi - preparation for Wi-Fi 7 EHT and multi-link support rtw88 - SDIO bus support - RTL8822BS, RTL8822CS and RTL8821CS SDIO chipset support rtw89 - framework firmware backwards compatibility brcmfmac - Cypress 43439 SDIO support mt76 - mt7921 P2P support - mt7996 mesh A-MSDU support - mt7996 EHT support - mt7996 coredump support wcn36xx - support for pronto v3 hardware ath11k - PCIe DeviceTree bindings - WCN6750: enable SAR support ath10k - convert DeviceTree bindings to YAML * tag 'wireless-next-2023-04-21' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (261 commits) wifi: rtw88: Update spelling in main.h wifi: airo: remove ISA_DMA_API dependency wifi: rtl8xxxu: Simplify setting the initial gain wifi: rtl8xxxu: Add rtl8xxxu_write{8,16,32}_{set,clear} wifi: rtl8xxxu: Don't print the vendor/product/serial wifi: rtw88: Fix memory leak in rtw88_usb wifi: rtw88: call rtw8821c_switch_rf_set() according to chip variant wifi: rtw88: set pkg_type correctly for specific rtw8821c variants wifi: rtw88: rtw8821c: Fix rfe_option field width wifi: rtw88: usb: fix priority queue to endpoint mapping wifi: rtw88: 8822c: add iface combination wifi: rtw88: handle station mode concurrent scan with AP mode wifi: rtw88: prevent scan abort with other VIFs wifi: rtw88: refine reserved page flow for AP mode wifi: rtw88: disallow PS during AP mode wifi: rtw88: 8822c: extend reserved page number wifi: rtw88: add port switch for AP mode wifi: rtw88: add bitmap for dynamic port settings wifi: rtw89: mac: use regular int as return type of DLE buffer request wifi: mac80211: remove return value check of debugfs_create_dir() ... ==================== Link: https://lore.kernel.org/r/20230421104726.800BCC433D2@smtp.kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-04-19wifi: mt76: mt7615: increase eeprom size for mt7663Felix Fietkau1-0/+1
mt7663 efuse has 0x600 bytes instead of 0x400. Increase the size in order to fix issues with incomplete calibration data Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-04-17wifi: mt76: get rid of unused sta_ps callbacksLorenzo Bianconi1-1/+0
sta_ps callback is just an empty stub for most of the drivers, so get rid of them. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-04-17wifi: mt76: add mt76_connac_irq_enable utility routineLorenzo Bianconi1-7/+0
Most of connac based drivers (mt7921, mt7615, mt7663) share the same code to enable interrupts. Move it in mt76_connac module. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-04-17wifi: mt76: move irq_tasklet in mt76_dev structLorenzo Bianconi1-3/+1
irq_tasklet struct is used by most of the drivers (e.g. mt7915, mt7921, mt7615, mt7663 and mt7996) so move it in common code. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-04-03wifi: mt76: ignore key disable commandsFelix Fietkau1-4/+2
This helps avoid cleartext leakage of already queued or powersave buffered packets, when a reassoc triggers the key deletion. Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20230330091259.61378-1-nbd@nbd.name
2022-12-09wifi: mt76: mt7615: enable per-phy led supportLorenzo Bianconi1-0/+6
Introduce the capability to support per-phy led blinking. This is needed for devices supporting dbdc. Co-developed-by: Ryder Lee <ryder.Lee@mediatek.com> Signed-off-by: Ryder Lee <ryder.Lee@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-01wifi: mt76: add info parameter to rx_skb signatureSujuan Chen1-1/+1
This is a preliminary patch to introduce WED RX support for mt7915. Tested-by: Daniel Golle <daniel@makrotopia.org> Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-01wifi: mt76: mt7615: rely on mt7615_phy in mt7615_mac_reset_countersLorenzo Bianconi1-1/+1
This is a preliminary patch to move aggr_stats array in mt76_phy structure. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-01wifi: mt76: mt7615: enable use_cts_prot supportRyder Lee1-0/+2
This adds selectable RTC/CTS enablement for each interface. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-07-11mt76: introduce phys array in mt76_dev structureLorenzo Bianconi1-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>
2022-07-11mt76: do not use skb_set_queue_mapping for internal purposesFelix Fietkau1-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>
2022-07-11mt76: mt7615: fix throughput regression on DFS channelsFelix Fietkau1-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>
2022-07-11mt76: mt7615: add sta_rec with EXTRA_INFO_NEW for the first time onlyFelix Fietkau1-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>
2022-07-11mt76: connac: move mt7615_txp_skb_unmap in common codeLorenzo Bianconi1-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>
2022-07-11mt76: connac: move mt76_connac_tx_complete_skb in shared codeLorenzo Bianconi1-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>
2022-03-16mt76: mt7663u: introduce mt7663u_mcu_power_on routineLorenzo Bianconi1-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>
2022-02-03mt76: mt7615e: process txfree and txstatus without allocating skbsLorenzo Bianconi1-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>
2022-02-03mt76: connac: move mt76_connac_mcu_rdd_cmd in mt76-connac moduleLorenzo Bianconi1-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>
2022-02-03mt76: connac: introduce is_connac_v1 utility routineLorenzo Bianconi1-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>
2021-10-20mt76: sdio: introduce parse_irq callbackLorenzo Bianconi1-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>
2021-10-20mt76: sdio: move common code in mt76_sdio moduleLorenzo Bianconi1-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>
2021-10-20mt76: mt7663s: rely on mcu reg access utilitySean Wang1-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>
2021-10-20mt76: mt7615: move mt7615_mcu_set_p2p_oppps in mt76_connac moduleLorenzo Bianconi1-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>
2021-06-19mt76: mt7615: set macwork timeout according to runtime-pmLorenzo Bianconi1-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>
2021-06-19mt76: make mt76_update_survey() per phyRyder Lee1-1/+1
Reduce duplicated survey for DBDC. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-06-19mt76: mt7615: add thermal sensor device supportRyder Lee1-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>
2021-06-19mt76: mt7663: enable hw rx header translationLorenzo Bianconi1-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>
2021-04-21mt76: move token_lock, token and token_count in mt76_devLorenzo Bianconi1-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>
2021-04-21mt76: mt7663: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx pathLorenzo Bianconi1-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>
2021-04-21mt76: connac: move mcu_update_arp_filter in mt76_connac moduleLorenzo Bianconi1-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>
2021-04-13mt76: report Rx timestampRyder Lee1-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>
2021-04-12mt76: mt7615: fix chip reset on MT7622 and MT7663eFelix Fietkau1-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>
2021-04-12mt76: mt7622: trigger hif interrupt for system resetRyder Lee1-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>
2021-04-12mt76: mt7615: fix mib stats counter reporting to mac80211Lorenzo Bianconi1-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>
2021-04-12mt76: mt7615: add support for rx decapsulation offloadRyder Lee1-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>
2021-04-12mt76: connac: update sched_scan cmd usageSean Wang1-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>
2021-01-29mt76: mt7663: introduce coredump supportLorenzo Bianconi1-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>
2021-01-29mt76: mt76_connac: move pm utility routines in mt76_connac_lib moduleLorenzo Bianconi1-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>
2021-01-29mt76: mt76_connac: move pm data struct in mt76_connac.hLorenzo Bianconi1-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>
2021-01-29mt76: mt76_connac: move WoW and suspend code in mt76_connac_mcu moduleLorenzo Bianconi1-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>
2021-01-29mt76: mt76_connac: move hw_scan and sched_scan routine in mt76_connac_mcu moduleLorenzo Bianconi1-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>
2021-01-29mt76: mt76_connac: create mcu libraryLorenzo Bianconi1-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>
2021-01-29mt76: introduce mt76_vif data structureLorenzo Bianconi1-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>
2021-01-27mt76: mt7615: unify init workFelix Fietkau1-3/+1
Reduce code duplication and remove unnecessary exports Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26mt76: move chainmask in mt76_phyLorenzo Bianconi1-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>