aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless
AgeCommit message (Collapse)AuthorFilesLines
2020-05-12mt76: mt7615: move core shared code in mt7615-common moduleLorenzo Bianconi14-431/+503
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 <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: fix possible deadlock in mt7615_stopLorenzo Bianconi4-39/+45
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 <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: remove unnecessary annotationsJules Irenge1-3/+1
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 <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: enable MSI by defaultLorenzo Bianconi1-0/+5
Enable MSI/MSI-X PCI interrupts by default. This patch has been tested using Banana Pi r64 board Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: rework IRQ handling to prepare for MSI supportFelix Fietkau4-14/+29
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 <[email protected]> Acked-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Soul Huang <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7663: fix DMA unmap lengthLorenzo Bianconi2-6/+16
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 <[email protected]> Signed-off-by: Sean Wang <[email protected]> Co-developed-by: Soul Huang <[email protected]> Signed-off-by: Soul Huang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]>
2020-05-12mt76: mt7622: fix DMA unmap lengthLorenzo Bianconi2-3/+4
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 <[email protected]>
2020-05-12mt76: mt7615: set hw scan limits only for firmware with offload supportFelix Fietkau1-0/+9
They do not apply to software scan Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: disable hw/sched scan ops for non-offload firmwareFelix Fietkau3-1/+15
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 <[email protected]>
2020-05-12mt76: mt7663: fix aggr range entry in debugfsLorenzo Bianconi3-2/+10
Fix register definitions for aggr range counter registers for mt7663 chipset Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: fix possible division by 0 in mt7615_mac_update_mib_statsLorenzo Bianconi1-3/+5
Check that val is not zero before aggr_per estimation in order to avoid a possible division by 0 Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt76x2: disable merge of OTP ROM data by defaultFelix Fietkau1-0/+5
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 <[email protected]>
2020-05-12mt76: mt7603: disable merge of OTP ROM data by defaultFelix Fietkau1-0/+5
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 <[email protected]>
2020-05-12mt76: mt7615: add support for applying tx DPD calibration from EEPROMFelix Fietkau4-1/+126
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 <[email protected]>
2020-05-12mt76: mt7615: add support for applying DC offset calibration from EEPROMFelix Fietkau6-29/+200
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 <[email protected]>
2020-05-12mt76: mt7615: disable merge of OTP ROM data by defaultFelix Fietkau1-0/+6
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 <[email protected]>
2020-05-12mt76: mt7615: Delete an error message in mt7622_wmac_probe()Markus Elfring1-3/+1
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 <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: do not always reset the dfs state setting the channelLorenzo Bianconi1-1/+20
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 <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7663: correct the name of the rom patchSean Wang1-1/+1
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 <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: add address parameter to mt7615_eeprom_initLorenzo Bianconi3-8/+9
Introduce address parameter to mt7615_eeprom_init routine in order to be reused adding usb support to mt7615 driver Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: introduce mt7615_wtbl_desc data structureLorenzo Bianconi2-5/+25
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 <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: rework wtbl key configurationLorenzo Bianconi3-46/+64
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 <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt76u: rely on mt7622 queue scheme for mt7663uLorenzo Bianconi1-2/+13
Rely on the mt7622 endpoint definitions for mt7663u Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: move mt7615_mac_wtbl_addr in mac.hLorenzo Bianconi2-5/+5
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 <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: introduce __mt7663_load_firmware routineLorenzo Bianconi2-5/+18
Introduce __mt7663_load_firmware routine to load firmware for usb devices. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: introduce mt7615_mac_update_rate_desc routineLorenzo Bianconi2-43/+71
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 <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: introduce mt7663u support to mt7615_write_txwiLorenzo Bianconi2-4/+9
Extend mt7615_write_txwi routine to support usb txwi configuration Co-developed-by: Sean Wang <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: add headroom and tailroom to mt76_mcu_ops data structureLorenzo Bianconi9-57/+51
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 <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: remove unnecessary register operationsSean Wang1-2/+0
Remove mt76_wr(dev, MT_CSR(0x010), 0x8208) that would cause MT_PCIE_IRQ_ENABLE to be disabled; MT_PCIE_IRQ_ENABLE should always keep on enabled when the driver is running. 0x44064 is a not existing address Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: introduce rlm tlv in bss_info mcu commandLorenzo Bianconi4-18/+104
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 <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: introduce BSS absence eventSean Wang2-0/+32
Introduce BSS absence event that is reported when the fw is leaving or entering current operational channel. Signed-off-by: Sean Wang <[email protected]> Co-developed-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: introduce scheduled scan supportLorenzo Bianconi7-14/+207
Introduce scheduled scan support for mt7663e devices Co-developed-by: Sean Wang <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: introduce hw scan supportLorenzo Bianconi7-3/+285
Introduce hw scan support to mt7663e driver Co-developed-by: Sean Wang <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7663: keep Rx filters as the defaultSean Wang1-10/+14
Keep Rx filters default value if the firmware supports offload and low power features. Signed-off-by: Sean Wang <[email protected]> Co-developed-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: introduce mt7615_mcu_set_channel_domain mcu commandLorenzo Bianconi4-3/+85
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 <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: add ethool support to mt7663 driverLorenzo Bianconi1-1/+7
Report n9 firmware version using ethtool Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7663: disable RDD commandsLorenzo Bianconi1-0/+3
Disable dfs RDD mcu commands for mt7663 driver since they are not currently supported by the 7663 firmware Co-developed-by: Sean Wang <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: make scs configurable per phyLorenzo Bianconi4-23/+23
Make scs configurable per phy since most of the chipsets do not support dbdc Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7663: enable nf estimationLorenzo Bianconi2-5/+13
Enable Noise floor estimation for mt7663 driver Co-developed-by: Sean Wang <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7663: fix mt7615_mac_cca_stats_reset routineLorenzo Bianconi2-1/+8
Fix PHYMUX_5 register definition for mt7663 in mt7615_mac_cca_stats_reset routine Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: add more useful Tx mib countersRyder Lee4-5/+28
Add ba_miss_cnt and ampdu_per in mib_stats. Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: cleanup mib related defines and structsRyder Lee3-25/+22
Simplify mib macros and use proper type for related counters. Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: enable aggr_stats for both phyRyder Lee3-12/+16
Use bottom half of aggr_stats for second phy. Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt7615: modify mt7615_ampdu_stat_read for each phyRyder Lee1-2/+18
This is a preliminary patch to add more Tx counters. Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt76x0: pci: add mt7610 PCI IDPawel Dembicki1-0/+1
Add mt7610 PCI id found on D-Link DWR-960 to pci_device_id table. Run-tested on D-Link DWR-960 with no-name half-size mPCIE card with mt7610e. Signed-off-by: Pawel Dembicki <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt76x2u: introduce Mercury UD13 supportLorenzo Bianconi1-0/+1
Introduce Mercury UD13 dual-band dongle support to mt76x2u driver Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt76x02u: Add support for newer versions of the XBox One wifi adapterMatthew Garrett2-0/+2
The current version has a new USB ID and reports as an 0x7632 device. Adding the IDs results in it working out of the box. Signed-off-by: Matthew Garrett <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12mt76: mt76x02: fix handling MCU timeouts during hw restartFelix Fietkau7-13/+31
If a MCU timeout occurs before a hw restart completes, another hw restart is scheduled, and the station state gets corrupted. To speed up dealing with that, do not issue any MCU commands after the first timeout, and defer handling timeouts until the reset has completed. Also ignore errors in MCU commands during start/config to avoid making user space fail on this condition. If it happens, another restart is scheduled quickly, and that usually recovers the hardware properly. Signed-off-by: Felix Fietkau <[email protected]>
2020-05-12ipw2x00: Fix comment for CLOCK_BOOTTIME constantPali Rohár1-1/+1
Correct name of constant is CLOCK_BOOTTIME and not CLOCK_BOOTIME. Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-05-12rndis_wlan: Replace zero-length array with flexible-arrayGustavo A. R. Silva1-4/+4
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/20200507192647.GA16710@embeddedor