summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-05-12mt76: mt7615: do not adjust MAC timings if the device is not runningFelix Fietkau
Avoids register writes and MAC start/stop when the hardware isn't ready for it Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: adjust timing in mt7615_mac_set_timing to match fw/hw valuesFelix Fietkau
Slightly improves performance Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7603: never use an 802.11b CF-End rate on 5GHzFelix Fietkau
Sometimes mt7615_mac_set_timing gets called while the slot time is still configured to 20. Ensure that in this case it always uses the OFDM CFend rate. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: never use an 802.11b CF-End rate on 5GHzFelix Fietkau
Sometimes mt7615_mac_set_timing gets called while the slot time is still configured to 20. Ensure that in this case it always uses the OFDM CFend rate. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: use larger rx buffers if VHT is supportedFelix Fietkau
In VHT mode we can receive larger MPDUs. Increasing the buffer size reduces fragmentation here, which should improve performance. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: fix A-MPDU density handlingFelix Fietkau
The hardware requirements for A-MPDU density are entirely on the tx side, not the rx side. Because of that, the IE value should stay at 0 and the minimum value should instead be enforced in WTBL/TXWI MT7615 has no restrictions here Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: fix sta ampdu factor for VHTFelix Fietkau
If VHT has a larger A-MPDU size limit, pass it to the MCU via the wtbl_ht TLV element. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7663u: enable AirTimeFairnessLorenzo Bianconi
Initialize tx_status_data pointer in order to enable Air Time Fairness for mt7663u chipset Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: rework mt7615_mac_sta_poll for usb codeLorenzo Bianconi
Since usb code can't access device registers in interrupt context, move rcu_read_lock/rcu_read_unlock in mt7615_poll_tx routine. Moreover loop over a local msta list in mt7615_mac_sta_poll since mt7663u driver will not be able to complete the inner while loop before sta_poll_list list is refilled by mt7615_mac_add_txs/mt7615_mac_fill_rx Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: fix aid configuration in mt7615_mcu_wtbl_generic_tlvLorenzo Bianconi
If the vif is running in station mode the aid will be passed by mac80211 using bss_conf.aid. Fix aid configuration in mt7615_mcu_wtbl_generic_tlv Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: fix mt7615_driver_own routineLorenzo Bianconi
Introduce MT_PCIE_DOORBELL_PUSH register to fix mt7615_driver_own routine for mt7663e Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: fix max wtbl size for 7663Lorenzo Bianconi
Current mt7663 offload firmware can support up to 32 wtbl entries Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") 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: fix mt7615_firmware_own for mt7663eLorenzo Bianconi
Check the firmware-own configuration has been applied polling MT_CONN_HIF_ON_LPCTL register Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") 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 Bianconi
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: add rx queues info to mt76 debugfsLorenzo Bianconi
Introduce rx-queues debugfs node in order to dump rx queues status. This would be useful for mcu fw debugging Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: make Kconfig entry obvious for MT7663ESean Wang
Make Kconfig entry obvious for MT7663E 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: mt7663: introduce 802.11 PS support in sta modeLorenzo Bianconi
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: remove PS_NULLFUNC_STACK capabilityLorenzo Bianconi
remove IEEE80211_HW_PS_NULLFUNC_STACK capability from mt76_phy_init routine since 802.11 ps is not currently supported by any devices and it will conflict with mt7663 ps fw support Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: provide aid info to the mcuLorenzo Bianconi
For sta mode mac80211 provides aid in vif->bss_conf.aid. In order to properly support 802.11 power-save, configure correct aid to mcu during sta association 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: disable aspm by defaultLorenzo Bianconi
The vendor SDK also disables ASPM by default Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: enable scs for mt7663 driverLorenzo Bianconi
Add missing register definitions in order to enable sensitivity tuning for mt7663 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: introduce mt7663u supportLorenzo Bianconi
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: move core shared code in mt7615-common moduleLorenzo Bianconi
Create mt7615-common module in order to collect shared code between usb and mmio code. Move the following source files in mt7615-common module: - main.c - init.c - mcu.c - mac.c - debugfs.c - eeprom.c - trace.c Create the following source files for mmio only source code and move them in mt7615e module: - pci_init.c - dma.c - pci_mac.c Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: fix possible deadlock in mt7615_stopLorenzo Bianconi
make mac_work per phy instead of per device and fix a possible deadlock in mt7615_stop since mt7615_mac_work runs holding mt76 mutex Fixes: fdd2e570764c2 ("mt76: mt7615: add dual-phy support for mac80211 ops") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: remove unnecessary annotationsJules Irenge
Sparse report warnings at mt76_tx_status_unlock() and mt76_tx_status_lock() warning: context imbalance in mt76_tx_status_lock() - wrong count at exit warning: context imbalance in mt76_tx_status_unlock() - unexpected unlock The root cause is the additional __acquire(&dev->status_list.lock) and __release(&dev->status_list.unlock) called from inside mt76_tx_status_lock() and mt76_tx_status_unlock(). Remove __acquire(&dev->status_list.lock) annotation Remove __releases(&dev->status_list.unlock) Correct &dev->status_list.unlock to &dev->status_list.lock -unlock not defined in the sk_buff_head struct Signed-off-by: Jules Irenge <jbi.octave@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: enable MSI by defaultLorenzo Bianconi
Enable MSI/MSI-X PCI interrupts by default. This patch has been tested using Banana Pi r64 board Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: rework IRQ handling to prepare for MSI supportFelix Fietkau
With MSI interrupts, IRQs must not be enabled from within the IRQ handler, because that can lead to lost events. Defer IRQ processing to a tasklet, which is also responsible for enabling IRQs (to avoid race conditions against the handler) Co-developed-by: Soul Huang <Soul.Huang@mediatek.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Soul Huang <soul.huang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7663: fix DMA unmap lengthLorenzo Bianconi
Fix DMA unmap length for mt7663e devices in mt7615_txp_skb_unmap_hw Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@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>
2020-05-12mt76: mt7622: fix DMA unmap lengthLorenzo Bianconi
Fix DMA unmap length estimation in mt7615_txp_skb_unmap_hw for mt7622 chipset Fixes: 6aa4ed7927f1 ("mt76: mt7615: implement DMA support for MT7622") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
2020-05-12mt76: mt7615: set hw scan limits only for firmware with offload supportFelix Fietkau
They do not apply to software scan Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: disable hw/sched scan ops for non-offload firmwareFelix Fietkau
Avoid having to attempt hw scan and fall back to software for every scan on devices/firmware without hw scan support Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7663: fix aggr range entry in debugfsLorenzo Bianconi
Fix register definitions for aggr range counter registers for mt7663 chipset Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: fix possible division by 0 in mt7615_mac_update_mib_statsLorenzo Bianconi
Check that val is not zero before aggr_per estimation in order to avoid a possible division by 0 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt76x2: disable merge of OTP ROM data by defaultFelix Fietkau
The reference driver does not seem to enable it by default, only under certain conditions, e.g. when a .bin file is loaded. Make it opt-in via a device tree property for now, in case it is needed on some boards. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7603: disable merge of OTP ROM data by defaultFelix Fietkau
The reference driver does not seem to enable it by default, only under certain conditions, e.g. when a .bin file is loaded. Make it opt-in via a device tree property for now, in case it is needed on some boards. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: add support for applying tx DPD calibration from EEPROMFelix Fietkau
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 Fietkau
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: mt7615: disable merge of OTP ROM data by defaultFelix Fietkau
The reference driver does not seem to enable it by default, only under certain conditions, e.g. when a .bin file is loaded. Make it opt-in via a device tree property for now, in case it is needed on some boards. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12dt-bindings: net: wireless: mt76: document mediatek,eeprom-merge-otp propertyFelix Fietkau
It is used to enable merging of Flash EEPROM data with OTP ROM calibration. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: Delete an error message in mt7622_wmac_probe()Markus Elfring
The function “platform_get_irq” can log an error already. Thus omit a redundant message for the exception handling in the calling function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: do not always reset the dfs state setting the channelLorenzo Bianconi
mac80211/hostapd runs mt7615_set_channel with the same channel parameters sending multiple rdd commands overwriting the previous ones. This behaviour is causing tpt issues on dfs channels. Fix the issue checking new channel freq/width with the running one. Fixes: 5dabdf71e94e ("mt76: mt7615: add multiple wiphy support to the dfs support code") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7663: correct the name of the rom patchSean Wang
Rom patch is shared between Bluetooth and Wifi devices, so correct the naming to allow two drivers to share the same file. Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: add address parameter to mt7615_eeprom_initLorenzo Bianconi
Introduce address parameter to mt7615_eeprom_init routine in order to be reused adding usb support to mt7615 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: introduce mt7615_wtbl_desc data structureLorenzo Bianconi
Generalize mt7615_rate_desc introducing mt7615_wtbl_desc and mt7615_key_desc data structures in order to configure the hw wtbl in a non-atomic context for usb devices Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: rework wtbl key configurationLorenzo Bianconi
Remove key dependency from mt7615_mac_wtbl_update_key and export mt7615_mac_wtbl_update_key, mt7615_mac_wtbl_update_pk and mt7615_mac_wtbl_update_cipher in order to reuse them in usb code. Move mt7615_mac_get_cipher in mac.h Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt76u: rely on mt7622 queue scheme for mt7663uLorenzo Bianconi
Rely on the mt7622 endpoint definitions for mt7663u Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: move mt7615_mac_wtbl_addr in mac.hLorenzo Bianconi
Move mt7615_mac_wtbl_addr in mac.h and add inline qualifier in order to be reused adding usb support to mt7615 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: introduce __mt7663_load_firmware routineLorenzo Bianconi
Introduce __mt7663_load_firmware routine to load firmware for usb devices. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: mt7615: introduce mt7615_mac_update_rate_desc routineLorenzo Bianconi
Move register configuration out of mt7615_mac_set_rates since usb driver can't access device register in interrupt context. Introduce mt7615_mac_update_rate_desc routine to report rate info to mt7615_mac_set_rates 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 support to mt7615_write_txwiLorenzo Bianconi
Extend mt7615_write_txwi routine to support usb txwi configuration 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>