aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
AgeCommit message (Collapse)AuthorFilesLines
2020-09-24mt76: mt7915: convert to use le16_add_cpu()Liu Shixin1-2/+2
Convert cpu_to_le16(le16_to_cpu(E1) + E2) to use le16_add_cpu(). Signed-off-by: Liu Shixin <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: Fix unsigned expressions compared with zeroYe Bin1-3/+3
Fixes variable types in mt76x02_dfs_create_sequence and mt76x02_dfs_add_event_to_sequence Signed-off-by: Ye Bin <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7915: fix possible memory leak in mt7915_mcu_add_beaconLorenzo Bianconi1-8/+10
Release mcu message memory in case of failure in mt7915_mcu_add_beacon routine Fixes: e57b7901469fc ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt76x0: Move tables used only by init.c to their own header fileLee Jones3-145/+160
Taking the same approach as initvals_phy.h. Fixes the following W=1 kernel build warning(s): drivers/net/wireless/mediatek/mt76/mt76x0/initvals.h:218:35: warning: ‘mt76x0_dcoc_tab’ defined but not used [-Wunused-const-variable=] 218 | static const struct mt76_reg_pair mt76x0_dcoc_tab[] = { | ^~~~~~~~~~~~~~~ drivers/net/wireless/mediatek/mt76/mt76x0/initvals.h:86:35: warning: ‘mt76x0_bbp_init_tab’ defined but not used [-Wunused-const-variable=] 86 | static const struct mt76_reg_pair mt76x0_bbp_init_tab[] = { | ^~~~~~~~~~~~~~~~~~~ drivers/net/wireless/mediatek/mt76/mt76x0/initvals.h:48:35: warning: ‘mt76x0_mac_reg_table’ defined but not used [-Wunused-const-variable=] 48 | static const struct mt76_reg_pair mt76x0_mac_reg_table[] = { | ^~~~~~~~~~~~~~~~~~~~ drivers/net/wireless/mediatek/mt76/mt76x0/initvals.h:14:35: warning: ‘common_mac_reg_table’ defined but not used [-Wunused-const-variable=] 14 | static const struct mt76_reg_pair common_mac_reg_table[] = { | ^~~~~~~~~~~~~~~~~~~~ Cc: Felix Fietkau <[email protected]> Cc: Lorenzo Bianconi <[email protected]> Cc: Ryder Lee <[email protected]> Cc: Kalle Valo <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Stanislaw Gruszka <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: Use fallthrough pseudo-keywordGustavo A. R. Silva11-17/+16
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7615: unlock dfs bandsLorenzo Bianconi1-2/+23
Unlock dfs channels for mt7615 devices since the driver supports radar detection. Dfs pattern detector has been tested successfully by mt7615 users. Do not unlock DFS frequencies for mt7663 devices since it has not been tested yet. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7663: check isr read return value in mt7663s_rx_workLorenzo Bianconi1-2/+5
In order to avoid using stale isr values, check return value from sdio_readsb() in mt7663s_rx_work() Tested-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7663s: introduce sdio tx aggregationLorenzo Bianconi4-19/+50
Introduce sdio tx aggregation to reduce bus transaction ands improve tx throughput. For the moment the skb are copied in a dedicated buffer since mmc APIs do not support sg table for zero-copy. Since skb data are already copied in xmit_buff[], avoid linearization in ma80211 layer. Relying on tx aggregation, we improve tx tpt of ~65%. Tested-by: Sean Wang <[email protected]> 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-09-24mt76: mt7663s: fix possible quota leak in mt7663s_refill_sched_quotaLorenzo Bianconi1-13/+30
Look just at reported quota since the hw sporadically reports mcu tx quota without setting WHIER_TX_DONE_INT_EN bit Tested-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: move pad estimation out of mt76_skb_adjust_padLorenzo Bianconi7-14/+18
Move frame pad computation out of mt76_skb_adjust_pad routine. This is a preliminary patch to introduce sdio tx aggregation. Tested-by: Sean Wang <[email protected]> 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-09-24mt76: mt7663s: introduce __mt7663s_xmit_queue routineLorenzo Bianconi1-13/+22
This is a preliminary patch to introduce sdio tx aggregation Tested-by: Sean Wang <[email protected]> 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-09-24mt76: mt7663s: split mt7663s_tx_update_sched in mt7663s_tx_{pick,update}_quotaLorenzo Bianconi1-25/+31
In order to not update the available quota in case of a tx error, split mt7663s_tx_update_sched in mt7663s_tx_{pick,update}_quota routines Tested-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7663s: do not use altx for ctl/mgmt trafficLorenzo Bianconi2-10/+4
Since the sdio engine does not report quota for altx queue, move ctl/mgmt traffic to standard data queues Tested-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7622: fix fw hang on mt7622Lorenzo Bianconi1-14/+32
Set poll timeout to 3s for mt7622 devices in order to avoid fw hangs. Swap mt7622_trigger_hif_int and doorbell configuration order in mt7615_mcu_drv_pmctrl routine. Introduce mt7615_mcu_lp_drv_pmctrl routine to take care of drv_own configuration for runtime-pm. Fixes: 08523a2a1db5 ("mt76: mt7615: add mt7615_pm_wake utility routine") Fixes: 894b7767ec2f ("mt76: mt7615: improve mt7615_driver_own reliability") Fixes: 757b0e7fd6f4 ("mt76: mt7615: avoid polling in fw_own for mt7663") Co-developed-by: Shayne Chen <[email protected]> Signed-off-by: Shayne Chen <[email protected]> Co-developed-by: Ryder Lee <[email protected]> Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7615: fix VHT LDPC capabilityRyder Lee1-2/+2
The MCU field should contain a boolean 0/1, not the flag itself. Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7615: Remove set but unused variable 'index'Wang Hai1-3/+0
Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/wireless/mediatek/mt76/mt7615/testmode.c: In function mt7615_tm_set_tx_power drivers/net/wireless/mediatek/mt76/mt7615/testmode.c:83:7: warning: variable ‘index’ set but not used [-Wunused-but-set-variable]= commit 4f0bce1c8888 ("mt76: mt7615: implement testmode support") involved this unused variable, remove it. Signed-off-by: Wang Hai <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: remove retry_q from struct mt76_txq and related codeFelix Fietkau7-80/+6
Since the switch to using AQL by default, mtxq->retry_q is never filled anymore Remove it to get rid of a few more unnecessary cycles in the tx path Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: move txwi handling code to dma.c, since it is mmio specificFelix Fietkau4-73/+72
This way we can make some functions static Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7915: fix queue/tid mapping for airtime reportingFelix Fietkau1-8/+3
Unlike 7615, 7915 uses the same AC index for rx and tx, which matches the LMAC queue mapping Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7915: simplify mt7915_lmac_mappingFelix Fietkau1-11/+2
Compared to mac80211 ACs, MT7915 queue numbers are in reverse order There is no need for the defensive WARN_ON_ONCE, so we can simplify the function to avoid the array lookup Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: dma: cache dma map address/len in struct mt76_queue_entryFelix Fietkau2-23/+22
Accessing them from uncached memory can be expensive, so it's cheaper to cache them Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7915: fix HE BSS infoFelix Fietkau1-2/+2
he_pe_duration and he_rts_thres have the same unit as the fields in the HE operation IE Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: convert from tx tasklet to tx worker threadFelix Fietkau20-52/+53
This improves performance by allowing the scheduler to move the tx scheduling work to idle CPUs. Since tx scheduling work is very latency sensitive and kept short via AQL, sched_set_fifo_low is used to keep worker priority above normal tasks Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: add utility functions for deferring work to a kernel threadFelix Fietkau2-0/+104
In order to avoid keeping work like tx scheduling pinned to the CPU it was scheduled from, it makes sense to switch from tasklets to kernel threads. Unlike a workqueue, this one only allows one fixed worker function to be executed by the worker thread. Because of that, there is less locking and less code for scheduling involved. This is important because the tx worker is scheduled often in a hot path Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: testmode: add a limit for queued tx_frames packetsFelix Fietkau1-1/+2
This avoids running out of available tx tokens Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7615: fix antenna selection for testmode tx_framesFelix Fietkau2-9/+1
Do not alter the tx/rx chain settings during channel setup, antennas are remapped by the testmode specific register writes already Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7615: fix MT_ANT_SWITCH_CON register definitionFelix Fietkau1-1/+1
This is used for testmode tx antenna selection Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7915: fix unexpected firmware modeChih-Min Chen2-0/+13
Avoid firmware falling into spectrum mode since that will set unexpected PSE/PLE thresholds which lead to Tx hang. This mode should be cleaned before firmware download stage. Signed-off-by: Chih-Min Chen <[email protected]> Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt76x02: tune tx ring sizeFelix Fietkau3-3/+4
Increase data queue size to improve performance. Reduce PS/mgmt queue size Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7603: tune tx ring sizeFelix Fietkau2-2/+4
Stop relying on global tx ring size, reduce size for PS/mgmt queue Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: remove struct mt76_sw_queueFelix Fietkau22-114/+86
All members except for the struct mt76_queue pointer have been removed Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: rely on AQL for burst size limits on tx queueingFelix Fietkau12-74/+111
Now that AQL works well on all mt76 drivers, completely replace the arbitrary burst sizing and number of bursts logic for tx scheduling. For the short period of time in which AQL does not work well yet, limit each stations to 16 in-flight packets that have no estimated tx time. This should avoid filling the queue if a station connects and queues up a large number of packets before rate control information is available, especially with hardware rate control Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: remove swq from struct mt76_sw_queueFelix Fietkau7-11/+0
Since txq selection was moved to mac80211, it is no longer used Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: remove qid argument to drv->tx_complete_skbFelix Fietkau14-28/+14
It is not needed Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: unify queue tx cleanup codeFelix Fietkau5-67/+41
Cleanup and preparation for changing tx scheduling behavior Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: sdio: fix use of q->head and q->tailFelix Fietkau2-18/+18
Their use is reversed compared to DMA. The order for DMA makes more sense, so let's use that Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: usb: fix use of q->head and q->tailFelix Fietkau1-15/+15
Their use is reversed compared to DMA. The order for DMA makes more sense, so let's use that Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7603: check for single-stream EEPROM configurationFelix Fietkau3-7/+18
Some devices using MT7628 or MT7603 have only one antenna chain connected. Detect these using the EEPROM rx/tx path settings Reported-by: Qin Wei <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: add memory barrier to DMA queue kickFelix Fietkau1-0/+1
Ensure that descriptor memory has been fully written before letting the hardware read it Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7915: add support for accessing mapped registers via bus opsFelix Fietkau2-0/+109
Makes it possible to read/write them via debugfs, similar to mt7615/7603 Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7615: significantly reduce interrupt loadFelix Fietkau4-25/+20
On 7615 and newer, DMA completion only triggers unmap, but not free of queued skbs, since pointers to packets are queued internally. Because of that, there is no need to process the main data queue immediately on DMA completion. To improve performance, mask out the DMA data queue completion interrupt and process the queue only when we receive a txfree event. This brings the number of interrupts under load down to a small fraction. Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7915: significantly reduce interrupt loadFelix Fietkau4-8/+18
On 7615 and newer, DMA completion only triggers unmap, but not free of queued skbs, since pointers to packets are queued internally. Because of that, there is no need to process the main data queue immediately on DMA completion. To improve performance, mask out the DMA data queue completion interrupt and process the queue only when we receive a txfree event. This brings the number of interrupts under load down to a small fraction. Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7915: schedule tx tasklet in mt7915_mac_tx_freeFelix Fietkau2-2/+1
The previous scheduling round may have been limited by AQL. More frames might be available after the tx free run. Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: dma: update q->queued immediately on cleanupFelix Fietkau1-25/+14
Tx cleanup and tx enqueuing can run in parallel. In order to avoid queue starvation issues under load, update q->queued immediately. Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7915: optimize mt7915_mac_sta_pollFelix Fietkau3-5/+10
Since DMA completion does not imply tx completion, it makes more sense to poll for airtime from mt7915_mac_tx_free. Reduce the runtime of the function by moving all items from dev->sta_poll_list to a local list once and process any stations that were added afterwards on the next run Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7615: fix reading airtime statisticsFelix Fietkau1-11/+14
- change the WTBL LMAC access function to set the mapping window only once - use ac * 2 as offset, since each AC has separate words for rx and tx Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7663u: fix dma header initializationLorenzo Bianconi2-3/+8
Fix length field corruption in usb dma header introduced adding sdio support Fixes: 75b10f0cbd0b ("mt76: mt76u: add mt76_skb_adjust_pad utility routine") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: fix a possible NULL pointer dereference in mt76_testmode_dumpLorenzo Bianconi1-2/+6
Fix a possible NULL pointer dereference in mt76_testmode_dump() since nla_nest_start returns NULL in case of error Fixes: f0efa8621550e ("mt76: add API for testmode support") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7615: fix a possible NULL pointer dereference in mt7615_pm_wake_workLorenzo Bianconi1-1/+2
Initialize wcid to global_wcid if msta is NULL in mt7615_pm_wake_work routine since wcid will be dereferenced running mt76_tx() Fixes: 2b8cdfb28d340 ("mt76: mt7615: wake device before pushing frames in mt7615_tx") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2020-09-24mt76: mt7615: fix possible memory leak in mt7615_tm_set_tx_powerLorenzo Bianconi1-2/+4
Fix a memory leak in mt7615_tm_set_tx_power routine if mt7615_eeprom_get_target_power_index fails. Moreover do not account req_header twice in mcu skb allocation. Fixes: 4f0bce1c88882 ("mt76: mt7615: implement testmode support") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>