aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/wireless/mediatek/mt76/mt7615/mcu.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-04-17wifi: mt76: move mcu_uni_event and mcu_reg_event in common codeLorenzo Bianconi1-11/+0
mcu_uni_event and mcu_reg_event structs are shared between mt7921 and mt7615 drivers, so move them in connac lib. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-07-11mt76: move mt76_connac2_mcu_fill_message in mt76_connac moduleLorenzo Bianconi1-3/+0
Move mt76_connac2_mcu_fill_message routine in shared module in order to reuse it for mt7921 and mt7915e drivers. This is a preliminary patch to add mt7990 driver support. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19mt76: mt7915: rely on mt76_connac definitionsLorenzo Bianconi1-127/+0
Remove duplicated mcu definitions in mt7915 mcu.h and reused connac ones. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-04-12mt76: mt7615: fix CSA notification for DBDCRyder Lee1-1/+9
Add CSA notification for second phy. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-04-11mt76: always use WTBL_MAX_SIZE for tlv allocationRyder Lee1-24/+0
Simplify WTBL defines. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-29mt76: mt7663: introduce coredump supportLorenzo Bianconi1-0/+1
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 WoW and suspend code in mt76_connac_mcu moduleLorenzo Bianconi1-114/+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-122/+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-444/+2
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>
2020-12-04mt76: mt7615: support 16 interfacesRyder Lee1-0/+1
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>
2020-12-04mt76: mt7663s: introduce WoW support via GPIOSean Wang1-0/+16
SDIO-based WiFi would rely on an additional GPIO pin to wake up the host. Co-developed-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-07-21mt76: mt7615: introduce mt7663s supportSean Wang1-0/+10
Introduce support for mt7663s 802.11ac 2x2:2 chipset to mt7615 driver. 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-07-21mt76: mt7615: implement testmode supportFelix Fietkau1-0/+6
Supports sending a configurable number of packets with a specific rate and configurable tx power levels / antenna settings, as well as displaying rx statistics. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-07-21mt76: mt7615: add support for accessing RF registers via MCUFelix Fietkau1-1/+3
Includes debugfs files for testing it. Will be used for testmode support. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-07-21mt76: add U-APSD support on AP sideLorenzo Bianconi1-0/+21
Introduce U-APSD support in mt76 driver for AP interface Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-07-21mt76: mt7663: introduce ARP filter offloadSean Wang1-2/+11
Introduce ARP filter offload 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: 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-28mt76: mt7615: fix hw_scan with ssid_type for specified SSID onlySean Wang1-2/+4
Fix hw_scan with ssid_type for specified SSID only The definition for ssid_type in current firmware is that ssid_type BIT(2) set actually for specified SSID + wildcard SSID. ssid_type BIT(2) and ssid_type_ext BIT(0) both set actually for specified SSID only; 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-28mt76: mt7615: introduce remain_on_channel supportLorenzo Bianconi1-0/+19
Introduce remain_on_channel support to mt7615 driver if the device is running offload 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-13mt76: mt7615: configure bss info adding the interfaceSean Wang1-0/+26
Introduce essential bss information for multiple vifs hw_scan in mt7615_mcu_uni_add_dev adding the interface 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-13mt76: enable p2p supportLorenzo Bianconi1-0/+1
Introduce p2p-go/p2p-client suppor to mt76 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-12mt76: mt7663: add support to sched scan with randomise addrSean Wang1-2/+3
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-12mt76: mt7615: introduce beacon_loss mcu eventLorenzo Bianconi1-0/+7
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-12mt76: mt7615: add gtk rekey offload supportLorenzo Bianconi1-0/+29
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-12mt76: mt7615: add WoW supportLorenzo Bianconi1-0/+62
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-12mt76: mt7615: introduce mt7615_mcu_set_hif_suspend mcu commandSean Wang1-0/+1
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-12mt76: mt7615: introduce support for hardware beacon filterLorenzo Bianconi1-0/+2
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-12mt76: mt7615: parse mcu return code for unified commandsLorenzo Bianconi1-0/+6
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-12mt76: mt7663: introduce 802.11 PS support in sta modeLorenzo Bianconi1-0/+1
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-12mt76: mt7615: introduce mt7663u supportLorenzo Bianconi1-0/+5
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-12mt76: mt7615: add support for applying tx DPD calibration from EEPROMFelix Fietkau1-0/+1
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-12mt76: mt7615: add support for applying DC offset calibration from EEPROMFelix Fietkau1-0/+1
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-12mt76: add headroom and tailroom to mt76_mcu_ops data structureLorenzo Bianconi1-7/+0
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-12mt76: mt7615: introduce rlm tlv in bss_info mcu commandLorenzo Bianconi1-0/+1
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-12mt76: mt7615: introduce BSS absence eventSean Wang1-0/+8
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-12mt76: mt7615: introduce scheduled scan supportLorenzo Bianconi1-0/+35
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-12mt76: mt7615: introduce hw scan supportLorenzo Bianconi1-0/+90
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-12mt76: mt7615: introduce mt7615_mcu_set_channel_domain mcu commandLorenzo Bianconi1-1/+8
Introduce mt7615_mcu_set_channel_domain routines in order to instruct the mcu about supported band/channels. This is a preliminary patch to add 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-03-17mt76: mt7615: get rid of sta_rec_wtbl data structureLorenzo Bianconi1-6/+1
Sobstitute sta_rec_wtbl data structure with tlv one Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: add more uni mcu commandsSean Wang1-0/+7
Introduce mt7615_mcu_uni_set_bss, mt7615_mcu_uni_set_dev and mt7615_mcu_uni_set_beacon_offload uni mcu commands. This is a preliminary patch to add mt7663e support 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-03-17mt76: mt7615: introduce set_bmc and st_sta for uni commandsLorenzo Bianconi1-1/+14
Introduce mt7615_mcu_uni_set_bmc and mt7615_mcu_uni_set_sta routines for mt7663e commands. 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-03-17mt76: mt7615: introduce uni cmd command typesLorenzo Bianconi1-1/+59
Introduce mcu uni command type. Uni commands rely on a stripped verions of mt7615_mcu_txd data strutture. Split mt7615_mcu_txd_common and mt7615_mcu_txd. Uni commands will be use by 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-03-17mt76: mt7615: introduce MCU_FW_PREFIX for fw mcu commandsLorenzo Bianconi1-6/+9
Currently fw commands rely on negative cmds since they need different mcu msg metadata. Extend this approach introducing MCU_FW_PREFIX. This is a preliminary patch to support new mt7663e firmware commands Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: move mt7615_mcu_set_sta in mt7615_mcu_opsLorenzo Bianconi1-12/+12
Move mt7615_mcu_set_sta for fw version 1 and version 2 in mt7615_mcu_ops data structure. This is a preliminary patch to properly support mt7663e firmware. Rework utility routines to rely on skb APIs for msg parsing Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: add mt7615_mcu_ops data structureLorenzo Bianconi1-0/+20
Introduce mt7615_mcu_ops data structure in order to support multiple mcu ops API. Move mt7615_mcu_set_{tx,rx}_ba to mt7615_mcu_ops differentiating between fw v1 and v2. This is a preliminary patch to properly support mt7663e firmware. Rework utility routines to rely on skb APIs for msg parsing Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: mt7615: use new tag sta_rec_wtblRyder Lee1-3/+5
In order to reduce command/event times, newer firmware adds a tag sta_rec_wtbl to take care of WTBL operations. MCU_EXT_CMD_WTBL_UPDATE is deprecated. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Tested-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: mt7615: report firmware log event messagesFelix Fietkau1-0/+1
Useful for debugging firmware issues. Can be turned on via the "fw_debug" debugfs file Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: mt7615: fix and rework tx power handlingFelix Fietkau1-0/+57
Setting the tx power by manipulating EEPROM may in some cases not be enough, since it only covers the base target power and not per-rate offsets. In other cases, it could limit tx power of rates too much, possibly reducing throughput or range. Use firmware support for applying per-rate limit and power offsets for different values of Nss. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: mt7615: initialize radar specs from host driverLorenzo Bianconi1-0/+1
Introduce dfs radar pattern specs in mt7615 driver in order to make dfs debugging easier. Radar pulse/pattern thresholds are taken from vendor SDK. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: mt7615: initialize dbdc settings on interface addFelix Fietkau1-0/+13
Use the first two WMM slots for the primary phy and the second two for the secondary phy. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: mt7615: add multiple wiphy support to the dfs support codeFelix Fietkau1-0/+46
There are two DFS detectors on the chip. When using 160 MHz channel bandwidth (not supported in dual-wiphy mode), both are used. Otherwise, one detector is used per wiphy. Rework the code to start/stop them separately per phy and to indicate the radar event on the right phy based on the detector index Signed-off-by: Felix Fietkau <nbd@nbd.name>