aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-11-20mt76: store current channel survey_state in struct mt76_devFelix Fietkau5-23/+23
Move mt76_channel_state() from mt76.h to mac80211.c Preparation for updating channel state from more places in the drivers/core Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: rename mt76_driver_ops txwi_flags to drv_flags and include tx aligned4Felix Fietkau5-8/+8
This reduces the struct size and is useful for adding more flags later Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: report rx a-mpdu subframe statusFelix Fietkau7-0/+50
This can be used in monitor mode to figure out which subframes were sent as part of which A-MPDU Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7603: remove q_rx field from struct mt7603_devFelix Fietkau1-2/+0
It is no longer used Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7603: collect aggregation statsLorenzo Bianconi5-0/+61
Introduce ampdu_stat entry in mt7603 debugfs in order to dump 802.11 aggr cumulative statistics Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7615: collect aggregation statsLorenzo Bianconi5-0/+66
Introduce ampdu_stat entry in mt7615 debugfs in order to dump 802.11 aggr cumulative statistics Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: move aggr_stats array in mt76_devLorenzo Bianconi4-6/+7
Move aggr_stats array from mt76x02_dev to mt76_dev in order to be reused adding aggregation stats for mt7603/mt7615 drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7615: add queue entry in debugfsLorenzo Bianconi2-0/+72
Introduce mt7615_queues_read routine to dump hw queue related info. Add hw ac queues statistics in mt7615 debugfs Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: move queue debugfs entry to driver specific codeLorenzo Bianconi4-3/+7
Move queue debugfs entry to driver specific code since mt7615 devices rely on a different queue layout Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt76x02u: move mt76x02u_mac_start in mt76x02-usb moduleLorenzo Bianconi8-37/+25
Unify mt76x02u_mac_start between mt76x2u and mt76x0u since the code is shared between both drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt76x0u: reset counter starting the deviceLorenzo Bianconi1-2/+1
Remove mt76x02_mac_reset_counters from mt76x0_init_hardware since it will be run starting the device Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt76x2: move mt76x02_mac_reset_counters in mt76x02_mac_startLorenzo Bianconi4-16/+5
Move mt76x02_mac_reset_counters in mt76x02_mac_start and get rid of mt76x2_mac_start since it is just a wrapper for mt76x02_mac_start Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt76x02: move mac_reset_counter in mt76x02_lib moduleLorenzo Bianconi5-31/+25
Unify mac_reset_counter routine and move it in mt76x02_lib module since it is shared by all mt76x02 drivers (pci/usb) Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7615: enable SCS by defaultLorenzo Bianconi1-1/+1
Enable Smart Carrier Sense algorithm by default in order to improve performances in a noisy environment Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt76x0e: make array mt76x0_chan_map static const, makes object smallerColin Ian King1-1/+1
Don't populate the array mt76x0_chan_map on the stack but instead make it static const. Makes the object code smaller by 80 bytes. Before: text data bss dec hex filename 7685 1192 0 8877 22ad mediatek/mt76/mt76x0/eeprom.o After: text data bss dec hex filename 7541 1256 0 8797 225d mediatek/mt76/mt76x0/eeprom.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: usb: add lockdep_assert_held in __mt76u_vendor_requestLorenzo Bianconi1-3/+2
Introduce lockdep_assert_held macro in __mt76u_vendor_request routine and remove comments regarding usb_ctrl_mtx lock Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: remove empty flag in mt76_txq_schedule_listLorenzo Bianconi1-16/+7
Remove empty flag in mt76_txq_schedule_list and mt76_txq_send_burst since we just need retry_q length to notify mac80211 to reschedule the current tx queue Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: use cancel_delayed_work_sync in mt76_rx_aggr_shutdownFelix Fietkau1-1/+1
The workqueue item needs to be fully shut down before the struct can be freed. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: remove aggr_work field from struct mt76_wcidFelix Fietkau1-2/+0
It is unused Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7615: fix control frame rx in monitor modeFelix Fietkau3-1/+38
Adjust filters and ensure frames don't get sent to MCU instead of host Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-05Merge tag 'wireless-drivers-next-2019-11-05' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-nextDavid S. Miller3-6/+3
Kalle Valo says: ==================== wireless-drivers-next patches for 5.5 First set of patches for 5.5. The most active driver here clearly is rtw88, lots of patches for it. More quiet on other drivers, smaller fixes and cleanups all over. This pull request also has a trivial conflict, the report and example resolution here: https://lkml.kernel.org/r/20191031111242.50ab1eca@canb.auug.org.au Major changes: rtw88 * add deep power save support * add mac80211 software tx queue (wake_tx_queue) support * enable hardware rate control * add TX-AMSDU support * add NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 support * add power tracking support * add 802.11ac beamformee support * add set_bitrate_mask support * add phy_info debugfs to show Tx/Rx physical status * add RFE type 3 support for 8822b ath10k * add support for hardware rfkill on devices where firmware supports it rtl8xxxu * add bluetooth co-existence support for single antenna iwlwifi * Revamp the debugging infrastructure ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-11-02Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netDavid S. Miller5-4/+58
The only slightly tricky merge conflict was the netdevsim because the mutex locking fix overlapped a lot of driver reload reorganization. The rest were (relatively) trivial in nature. Signed-off-by: David S. Miller <davem@davemloft.net>
2019-10-31mt7601u: use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs fopszhong jiang1-1/+1
It is more clear to use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs file operation rather than DEFINE_SIMPLE_ATTRIBUTE. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Acked-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-30mt76: dma: fix buffer unmap with non-linear skbsLorenzo Bianconi2-4/+7
mt76 dma layer is supposed to unmap skb data buffers while keep txwi mapped on hw dma ring. At the moment mt76 wrongly unmap txwi or does not unmap data fragments in even positions for non-linear skbs. This issue may result in hw hangs with A-MSDU if the system relies on IOMMU or SWIOTLB. Fix this behaviour properly unmapping data fragments on non-linear skbs. Fixes: 17f1de56df05 ("mt76: add common code shared between multiple chipsets") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-30mt76: mt76x2e: disable pcie_aspm by defaultLorenzo Bianconi4-0/+51
On same device (e.g. U7612E-H1) PCIE_ASPM causes continuous mcu hangs and instability. Since mt76x2 series does not manage PCIE PS states, first we try to disable ASPM using pci_disable_link_state. If it fails, we will disable PCIE PS configuring PCI registers. This patch has been successfully tested on U7612E-H1 mini-pice card Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-15net/wireless: Delete unnecessary checks before the macro call “dev_kfree_skb”Markus Elfring1-4/+1
The dev_kfree_skb() function performs also input parameter validation. Thus the test around the shown calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-10-04mac80211: simplify TX aggregation startJohannes Berg4-8/+4
There really is no need to make drivers call the ieee80211_start_tx_ba_cb_irqsafe() function and then schedule the worker if all we want is to set a bit. Add a new return value (that was previously considered invalid) to indicate that the driver is immediately ready for the session, and make drivers use it. The only drivers that remain different are the Intel ones as they need to negotiate more with the firmware. Link: https://lore.kernel.org/r/1570007543-I152912660131cbab2e5d80b4218238c20f8a06e5@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-10-01mt7601u: fix bbp version check in mt7601u_wait_bbp_readyLorenzo Bianconi1-1/+1
Fix bbp ready check in mt7601u_wait_bbp_ready. The issue is reported by coverity with the following error: Logical vs. bitwise operator The expression's value does not depend on the operands; inadvertent use of the wrong operator is a likely logic error. Addresses-Coverity-ID: 1309441 ("Logical vs. bitwise operator") Fixes: c869f77d6abb ("add mt7601u driver") Acked-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-24mt76: mt7615: fix mt7615 firmware path definitionsLorenzo Bianconi2-10/+7
mt7615 patch/n9/cr4 firmwares are available in mediatek folder in linux-firmware repository. Because of this mt7615 won't work on regular distributions like Ubuntu. Fix path definitions. Moreover remove useless firmware name pointers and use definitions directly Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets") Cc: stable@vger.kernel.org Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-15Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netDavid S. Miller2-1/+19
Minor overlapping changes in the btusb and ixgbe drivers. Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-05mt76: mt7615: add support to read temperature from mcuLorenzo Bianconi4-11/+59
Introduce debugfs entry to read device temperature and related cmu command. Introduce mt7615_mcu_parse_response to parse mcu response messages and refactor mt7615_mcu_msg_send routine Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: introduce mt7615_txwi_to_txp utility routineLorenzo Bianconi2-6/+15
Introduce mt7615_txwi_to_txp utility routine to convert mt76_txwi_cache into mt7615_txp and remove duplicated code Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7603: use devm_platform_ioremap_resource() to simplify codeYueHaibing1-2/+1
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt76x0: remove unneeded return value on set channelStanislaw Gruszka3-16/+9
We allways return 0 from mt76x0_phy_set_channel(), no need to pass return value upward. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt76x0: remove redundant chandef copyStanislaw Gruszka1-1/+0
We set dev->mt76.chandef in mt76_set_channel() already. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: make mt76_rx_convert staticStanislaw Gruszka2-4/+1
mt76_rx_convert() not need to be exported any longer. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: remove offchannel check in tx schedulingFelix Fietkau3-10/+2
tx queues are already disabled by mac80211 during scanning or other off-channel activity. There is no need to repeat the check in mt76, since scheduled queues are selected by mac80211 as well. Signed-off-by: Balakrishna Bandi <b.balakrishna@globaledgesoft.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: do not send BAR frame on tx aggregation flush stopFelix Fietkau3-3/+0
There is no need to send a BAR frame after stopping aggregation, and doing so could lead to sending class 3 frames after deauthentication from an AP Signed-off-by: Balakrishna Bandi <b.balakrishna@globaledgesoft.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: stop rx aggregation on station removalFelix Fietkau1-0/+3
Fixes use-after-free issues on forced station removal during hardware restart on MT76x02 Fixes: aee5b8cf2477 ("mt76: implement A-MPDU rx reordering in the driver code") Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: dma: reset q->rx_head on rx resetFelix Fietkau1-0/+6
Fixes rx of the first frame if a fragmented rx was interrupted by the reset Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: apply calibration-free data from OTPFelix Fietkau1-0/+38
MT7615 chips usually come pre-calibrated, even when used on embedded boards. In that case, the on-flash EEPROM data needs to be merged with some data from OTP ROM. Run this merge if the external EEPROM data is valid and OTP has valid fields. Tested-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: add default implementation for mt76_sw_scan/mt76_sw_scan_completeLorenzo Bianconi10-53/+29
Introduce a default implementation for mt76_sw_scan and mt76_sw_scan_complete in mt76 module and remove duplicated code since most of the drivers share the same implementation Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: fix some checkpatch warningsRyder Lee10-63/+70
This fixes the following checkpatch warnings: CHECK: Alignment should match open parenthesis CHECK: No space is necessary after a cast Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: add BIP_CMAC_128 cipher supportLorenzo Bianconi4-47/+135
Refactor mt7615_mac_wtbl_set_key and introduce the following routines in order to configure wtbl entries and properly add hw support to BIP_CMAC_128 cipher: - mt7615_mac_wtbl_update_cipher - mt7615_mac_wtbl_update_pk - mt7615_mac_wtbl_update_key Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7603: remove unnecessary mcu queue initializationLorenzo Bianconi1-3/+0
Remove unnecessary mcu queue initialization in mt7603_dma_init since it has been already done in mt76_mmio_init Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: move mt76_tx_tasklet in mt76 moduleLorenzo Bianconi5-21/+10
Move mt76{15,03}_tx_tasklet in mt76_alloc_device in order to be used as default tx_tasklet initialization. Remove duplicated code in mt7603/mt7615 drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: enable survey supportLorenzo Bianconi5-0/+34
Introduce channel survey support for mt7615 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7603: move survey_time in mt76_devLorenzo Bianconi4-5/+7
Move survey_time field in mt76_dev in order to be reused adding survey support to mt7615 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt76x02u: enable survey supportLorenzo Bianconi4-0/+22
Introduce channel survey support for mt76x2u and mt76x0u drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt76x02u: enable multi-vif supportLorenzo Bianconi1-0/+26
Enable multi-interface support for mt76x02u driver. For the moment allow max two concurrent interfaces in order to preserve enough room for ps traffic since we are using beacon slots for it. I have successfully tested the following configuration: - AP + STA - AP0 + AP1 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Tested-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>