summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek
Commit message (Collapse)AuthorAgeFilesLines
* mt76x0: phy: do not run calibration during channel switchLorenzo Bianconi2018-10-134-26/+23Star
| | | | | | | | | | Do not perform phy/vga calibration during channel switch. Moreover remove mt76x0_agc_save and mt76x0_agc_restore routines since they are no longer necessary. Furthermore run mt76_set_channel in order to check if there are pending frames during channel switch Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: phy: align channel gain logic to mt76x2 oneLorenzo Bianconi2018-10-131-17/+39
| | | | | | | Update vga tuning algorithm to the one used in mt76x2 driver Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: introduce mt76x02_init_agc_gain routineLorenzo Bianconi2018-10-133-11/+14
| | | | | | | | Add mt76x02_init_agc_gain routine in mt76x02-lib moudule in order to be reused by mt76x0 for vga initalization Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mt76x02_phy_adjust_vga_gain in mt76/mt76x02_phy.cLorenzo Bianconi2018-10-133-20/+24
| | | | | | | | Move mt76x02_phy_adjust_vga_gain routine in mt76x02-lib module in order to be reused by mt76x0 driver for vga calibration Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move rssi_gain_thresh routines in mt76x02-lib moduleLorenzo Bianconi2018-10-132-28/+28
| | | | | | | | | Move mt76x2_get_rssi_gain_thresh and mt76x2_get_low_rssi_gain_thresh routines in mt76x02-lib module in order to be reused by mt76x0 driver for dynamic vga calibration Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: phy: add phy/vco temperature compensationLorenzo Bianconi2018-10-132-26/+25Star
| | | | | | | | | | | | | | | Introduce phy/vco temperature calibration. Moreover fix configuration of register 67 on bank0 during temperature reading and use mt76_poll utility routine to poll core34 register. Furthermore temperature compensation needs to be disabled if the device supports tssi compensation. This issue has never been hit since temperature reading is not actually used by usb code. Fixes: 10de7a8b4ab9 ("mt76x0: phy files") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: eeprom: introduce mt76x0_tssi_enabled routineLorenzo Bianconi2018-10-137-27/+33
| | | | | | | | | | Add mt76x0_tssi_enabled in order to check if tssi compensation is enabled since mt76x0 condition differs from mt76x2 one. Moreover move back mt76x02_temp_tx_alc_enabled and mt76x02_tssi_enabled routines in mt76x2/eeprom.h since they are mt76x2 specific Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: phy: update set_channel for mt76x0e devicesLorenzo Bianconi2018-10-131-5/+13
| | | | | | | | | Do not run mt76x0_vco_cal and mt76x0_bbp_set_bw routines and configure MT_TX_SW_CFG0 register for pcie devices in mt76x0_phy_set_channel function. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: pci: introduce mt76x0_phy_calirate routineLorenzo Bianconi2018-10-134-3/+55
| | | | | | | | Add mt76x0_phy_calirate routine in order to perform phy calibration for mt76x0e devices. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: pci: rename mt76x0_phy_calibrateLorenzo Bianconi2018-10-131-2/+2
| | | | | | | | Rename mt76x0_phy_calibrate routine in mt76x0_phy_calibration_work in order to not collide with calibration routine for mt76x0e Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mt76x02_phy_set_band in mt76x02-lib moduleLorenzo Bianconi2018-10-137-35/+25Star
| | | | | | | | | Move mt76x02_phy_set_band routine in mt76x02_phy.c since it is shared between mt76x0 and mt76x2 drivers and remove duplicated code Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mt76x02_phy_set_bw in mt76x02-lib moduleLorenzo Bianconi2018-10-137-57/+30Star
| | | | | | | | | Move mt76x02_phy_set_bw routine in mt76x02_phy.c since it is shared between mt76x0 and mt76x2 drivers and remove duplicated code Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: phy: remove channel parameter from mt76x0_phy_set_chan_bbp_paramsLorenzo Bianconi2018-10-131-2/+2
| | | | | | | | Remove unused channel parameter from mt76x0_phy_set_chan_bbp_params routine signature Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: phy: fix restore phase in mt76x0_phy_recalibrate_after_assocLorenzo Bianconi2018-10-131-4/+3Star
| | | | | | | | | Fix restore value configured in MT_BBP(IBI, 9) register in mt76x0_phy_recalibrate_after_assoc routine. Fixes: 10de7a8b4ab9 ("mt76x0: phy files") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76x0e: another fix for the external PA current settingFelix Fietkau2018-10-131-10/+3Star
| | | | | | | | - Use the register number define instead of a magic value - Fix inverted bit test (override needs to be applied if the bit is not set) Fixes: 2b2cb40bcd7d ("mt76x0: pci: add hw initialization at bootstrap") Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: pci: fix set external PA I/O currentYueHaibing2018-10-131-3/+3
| | | | | | | | | | | | | | | Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/wireless/mediatek/mt76/mt76x0/pci.c: In function 'mt76x0e_register_device': drivers/net/wireless/mediatek/mt76/mt76x0/pci.c:107:8: warning: variable 'data' set but not used [-Wunused-but-set-variable] It seems correct value to write is 'data' Fixes: 2b2cb40bcd7d ("mt76x0: pci: add hw initialization at bootstrap") Acked-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: do not store aggregation sequence number for null-data framesFelix Fietkau2018-10-131-1/+2
| | | | | | | Fixes a rare corner case where a BlockAckReq might get the wrong sequence number. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: remove dma.hStanislaw Gruszka2018-10-131-126/+0Star
| | | | | | | dma.h is not used any longer. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: reserve enough room for USB tx skbsStanislaw Gruszka2018-10-133-17/+8Star
| | | | | | | | Reserve enough room for USB skb, so we don not need to check the room every time we send frame. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: pci: add mt76x0_register_device in mt76x0e_register_deviceLorenzo Bianconi2018-10-131-1/+19
| | | | | | | | | | Run mt76x0_register_device routine in mt76x0e_register_device in order to register the device to the mac80211 layer. Moreover init mt76_driver_ops data structure and register interrupt line Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: disable ldpc coding for mt76x0 devicesLorenzo Bianconi2018-10-132-43/+41Star
| | | | | | | | | Disable ldpc coding for mt76x0 devices. Morover remove mt76x02_mac_fill_txwi routine since it is used just in mt76x02_mac_write_txwi Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: pci: add missing mac80211 callbacksLorenzo Bianconi2018-10-131-1/+10
| | | | | | | Add missing mac80211 callbacks in mt76x0e_ops data structure Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: pci: report firmware version using ethtoolLorenzo Bianconi2018-10-131-0/+1
| | | | | | | | Report via ethtool fw_ver and build_ver members of mt76x02_fw_header data structure similarly to what is reported in the syslog Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: use mt76x02_dev instead of mt76_dev in mt76x02_eeprom.cLorenzo Bianconi2018-10-1315-124/+112Star
| | | | | | | | Use mt76x02_dev data structure as reference in mt76x02_eeprom.c instead of mt76_dev Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: use mt76x02_dev instead of mt76_dev in mt76x02_txrx.cLorenzo Bianconi2018-10-134-18/+16Star
| | | | | | | | Use mt76x02_dev data structure as reference in mt76x02_txrx.c instead of mt76_dev Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: use mt76x02_dev instead of mt76_dev in mt76x02_mac.cLorenzo Bianconi2018-10-1314-110/+111
| | | | | | | | Use mt76x02_dev data structure as reference in mt76x02_mac.c instead of mt76_dev Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: use mt76x02_dev instead of mt76_dev in mt76x02_usb_mcu.cLorenzo Bianconi2018-10-134-27/+24Star
| | | | | | | | Use mt76x02_dev data structure as reference in mt76x02_usb_mcu.c instead of mt76_dev Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: use mt76x02_dev instead of mt76_dev in mt76x02_util.cLorenzo Bianconi2018-10-135-73/+77
| | | | | | | | Use mt76x02_dev data structure as reference in mt76x02_util.c instead of mt76_dev Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: use mt76x02_dev instead of mt76_dev in mt76x02_phy.cLorenzo Bianconi2018-10-137-59/+56Star
| | | | | | | | Use mt76x02_dev data structure as reference in mt76x02_phy.c instead of mt76_dev Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: use mt76x02_dev instead of mt76_dev in mt76x02_mcu.cLorenzo Bianconi2018-10-1312-92/+86Star
| | | | | | | | Use mt76x02_dev data structure as reference in mt76x02_mcu.c instead of mt76_dev Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: phy: fix bank check in mt76x0_rf_csr_{wr,rr}Lorenzo Bianconi2018-10-131-2/+2
| | | | | | | | | | Fix typo in bank check in mt76x0_rf_csr_{wr,rr} routines. This issue has never been hit since mt76x0_rf_csr_{wr,rr} are actually used just by pci code Fixes: 10de7a8b4ab9 ("mt76x0: phy files") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: use bus helper to identify rf access methodStanislaw Gruszka2018-10-131-2/+6
| | | | | | | | | Use mt76_is_usb() to identify RF access method instead of MT76_STATE_MCU_RUNNING flag and add warning since MCU has to be initialized before we can access RF registers via MCU. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: correct RF reg pairs write for PCIeStanislaw Gruszka2018-10-131-3/+16
| | | | | | | We have to use RF CSR method for PCIe. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: allow to identify busStanislaw Gruszka2018-10-133-0/+11
| | | | | | | Add helpers to identify bus type. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: correct RF access via RF_CSR register.Stanislaw Gruszka2018-10-132-6/+4Star
| | | | | | | | PCIe version don't use MCU for RF registers access. We need to correct RF CSR method to support up to 127 RF registers. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: print BBP version only for debugStanislaw Gruszka2018-10-131-1/+1
| | | | | | | Use dev_dbg to print BBP version. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2018-10-131-5/+5
|\ | | | | | | | | | | | | | | Conflicts were easy to resolve using immediate context mostly, except the cls_u32.c one where I simply too the entire HEAD chunk. Signed-off-by: David S. Miller <davem@davemloft.net>
| * Merge tag 'alloc-args-v4.19-rc8' of ↵Greg Kroah-Hartman2018-10-111-5/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Kees writes: "Fix open-coded multiplication arguments to allocators - Fixes several new open-coded multiplications added in the 4.19 merge window." * tag 'alloc-args-v4.19-rc8' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: treewide: Replace more open-coded allocation size multiplications
| | * treewide: Replace more open-coded allocation size multiplicationsKees Cook2018-10-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As done treewide earlier, this catches several more open-coded allocation size calculations that were added to the kernel during the merge window. This performs the following mechanical transformations using Coccinelle: kvmalloc(a * b, ...) -> kvmalloc_array(a, b, ...) kvzalloc(a * b, ...) -> kvcalloc(a, b, ...) devm_kzalloc(..., a * b, ...) -> devm_kcalloc(..., a, b, ...) Signed-off-by: Kees Cook <keescook@chromium.org>
* | | mt76: move irq handler in mt76x02-lib moudleLorenzo Bianconi2018-10-0511-177/+90Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_irq_handler handler in mt76x02_mmio.c in order to be reused in mt76x0 driver. Move mt76x02_rx_poll_complete routine in mt76x02-lib module. Moreover remove pci_core.c and mt76x2/trace.{c,h} since are empty files Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* | | mt76: move tx_tasklet management in mt76x02-lib moudleLorenzo Bianconi2018-10-059-64/+45Star
| | | | | | | | | | | | | | | | | | | | | | | | Move tx_tasklet management in mt76x02_mmio.c in order to be reused by mt76x0 driver and remove duplicated code Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* | | mt76: use mt76x02_dev instead of mt76_dev in mt76x02_mmio.cLorenzo Bianconi2018-10-0510-62/+64
| | | | | | | | | | | | | | | | | | | | | | | | Use mt76x02_dev data structure as reference in mt76x02_mmio.c instead of mt76_dev Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* | | mt76: move mt76x02_tx_complete in mt76x02-lib moduleLorenzo Bianconi2018-10-058-70/+71
| | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_tx_complete mt76x02-lib module in order to be reused by mt76x0 drivers for irq unification. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* | | mt76: move mt76x02_mac_poll_tx_status in mt76x02-lib moudleLorenzo Bianconi2018-10-0510-91/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_mac_poll_tx_status in mt76x02_mac.c in order to be reused by mt76x0 drivers for irq unification. Moreover introduce mt76x02_trace source file to define mt76x02 trace points Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* | | mt76: usb: move mt76x02u_tx_complete_skb in mt76x02_usb_core.cLorenzo Bianconi2018-10-056-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02u_tx_complete_skb and mt76x02u_remove_dma_hdr since they are used just by usb code Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* | | mt76: move mt76x02_tx_prepare_skb in mt76x02_txrx.cLorenzo Bianconi2018-10-055-36/+37
| | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_tx_prepare_skb routine in mt76x02-lib module in order to be reused by mt76x0 driver in tx datapath Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* | | mt76: move tpc routines in mt76x02-lib moduleLorenzo Bianconi2018-10-059-63/+37Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_tx_get_txpwr_adj and mt76x02_tx_set_txpwr_auto routines in mt76x02-lib module since they are shared between mt76x0 and mt76x2 drivers. Moreover remove get_txpwr_adj function pointer Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* | | mt76x2: remove leftover function declatarionsLorenzo Bianconi2018-10-051-10/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove following function declarations since they have been moved to mt76x02-lib module: - mt76x2_sta_add - mt76x2_sta_remove - mt76x2_remove_interface - mt76x2_conf_tx - mt76x2_txq_init Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* | | mt76: rename mt76x02_util.h in mt76x02.hLorenzo Bianconi2018-10-0527-56/+15Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rename mt76x02_util.h header file in mt76x02.h since now contains all mt76x02 related definitions and not just utility routines declarations Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* | | mt76: move txrx shared routines in mt76x02_txrx.cLorenzo Bianconi2018-10-053-141/+164
| | | | | | | | | | | | | | | | | | | | | | | | Add mt76x02_txrx.c source file in order to contain tx/rx shared routines for mt76x0 and mt76x2 drivers Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>