aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-04-21mt76: mt7615: rely on pm refcounting in mt7615_led_set_configLorenzo Bianconi1-1/+3
Rely on mt76_connac_pm_ref/mt76_connac_pm_unref utility routines in mt7615_led_set_config Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: connac: alaways wake the device before scanningLorenzo Bianconi3-8/+8
move scanning check from mt76_connac_power_save_sched routine to mt7921_pm_power_save_work/mt7615_pm_power_save_work ones Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: get rid of useless MT76_STATE_PM in mt7921_mac_workLorenzo Bianconi1-5/+0
Remove useless MT76_STATE_PM check in mt7921_mac_work since mt7921_mutex_acquire will wake up the device if necessary Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: connac: remove MT76_STATE_PM in mac_tx_freeLorenzo Bianconi2-10/+0
Get rid of MT76_STATE_PM chec in mt7615_mac_tx_free and mt7921_mac_tx_free since we already rely on mt76_connac_pm_unref in the NAPI callback. Remove mt76_connac_power_save_sched calls in mt7615_mac_tx_free and mt7921_mac_tx_free Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: connac: check wake refcount in mcu_fw_pmctrlLorenzo Bianconi3-2/+14
In order to avoid synchronization races between tx and rx path, rely on mt76_connac_skip_fw_pmctrl putting the chip in sleep mode for mt7921 and mt7663 devices Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: connac: unschedule ps_work in mt76_connac_pm_wakeLorenzo Bianconi3-2/+1
In order to avoid synchronization issues between wake and ps works, cancel ps_work in mt76_connac_pm_wake routine Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7663: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx/rx napiLorenzo Bianconi2-6/+34
Introduce mt7615_poll_rx rx napi callback for mt7663. Do not access device registers in tx/rx napi if the device is not awake. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx/rx napiLorenzo Bianconi3-8/+37
Introduce mt7921_poll_rx rx napi callback for mt7921. Do not access device registers in tx/rx napi if the device is not awake. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: dma: add the capability to define a custom rx napi poll routineLorenzo Bianconi8-12/+14
Add the capability to define a custom rx napi callback for each driver. This is a preliminary patch to properly support runtime-pm on rx side Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7663: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx pathLorenzo Bianconi5-18/+25
Introduce mt7615_tx_worker routine as mt76 tx worker callback for mt7663. Rely on mt76_connac_pm_ref/mt76_connac_pm_unref to check PM state and increment/decrement wake counter Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx pathLorenzo Bianconi3-14/+13
Introduce mt7921_tx_worker routine as mt76 tx worker callback for mt7921. Rely on mt76_connac_pm_ref/mt76_connac_pm_unref to check PM state and increment/decrement wake counter Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: connac: introduce wake counter for fw_pmctrl synchronizationLorenzo Bianconi1-0/+31
Introduce wake counter and related spinlock in order to synchronize tx/rx path and fw_pmctrl request. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7663: fix a race between mt7615_mcu_drv_pmctrl and mt7615_mcu_fw_pmctrlLorenzo Bianconi2-6/+15
Introduce a mutex in order to avoid a race between mt7615_mcu_lp_drv_pmctrl and mt7615_mcu_fw_pmctrl routines since they are run two independent works Fixes: 1f549009b5b2 ("mt76: mt7615: do not request {driver,fw}_own if already granted") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: fix a race between mt7921_mcu_drv_pmctrl and mt7921_mcu_fw_pmctrlLorenzo Bianconi3-10/+26
Introduce a mutex in order to avoid a race between mt7921_mcu_drv_pmctrl and mt7921_mcu_fw_pmctrl routines since they are run two independent works Fixes: 1d8efc741df8 ("mt76: mt7921: introduce Runtime PM support") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: remove leftover function declarationLorenzo Bianconi1-2/+0
Get rid of leftover mt7921_mcu_add_bss_info routine declaration Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: connac: move mcu_update_arp_filter in mt76_connac moduleLorenzo Bianconi8-104/+58
Move mt76_connac_mcu_update_arp_filter in mt76_connac module since the code is shared between mt7615 and mt7921 Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: do not use 0 as NULL pointerLorenzo Bianconi1-1/+1
Fix the following sparse warning: drivers/net/wireless/mediatek/mt76/mt7921/mac.c:1425:70: warning: Using plain integer as NULL pointer Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: directly read per-rate tx power from registersShayne Chen2-22/+51
Since driver no longer handler per-rate tx power setting, we need to read the power values directly from registers. Tested-by: Evelyn Tsai <[email protected]> Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: rework the flow of txpower settingShayne Chen8-251/+99
Clean up the flow of per-rate txpower limit setting to get rid of duplicate work since it has already been handled by firmware, and set proper max_power based on different channels and regdomains. Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: add support for DT rate power limitsShayne Chen1-6/+38
Enable to limit per-rate max txpower from DT. Tested-by: Evelyn Tsai <[email protected]> Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: abort uncompleted scan by wifi resetSean Wang1-0/+8
Scan abort should be required for the uncompleted hardware scan interrupted by wifi reset. Otherwise, it is possible that the scan request after wifi reset gets error code -EBUSY from mac80211 and then blocks the reconnectting to the access point. Fixes: 0c1ce9884607 ("mt76: mt7921: add wifi reset support") Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: add wifisys reset support in debugfsSean Wang1-8/+17
Introduce chip_reset knob in mt7921 debugfs to export a way to users able to trigger wifi reset, and group the similar operations previously defined in chip_config in the same knob. Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: run mt7921_mcu_fw_log_2_host holding mt76 mutexLorenzo Bianconi1-1/+4
Wake the chip before configuring the mcu log level Fixes: 1d8efc741df8 ("mt76: mt7921: introduce Runtime PM support") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: improve mcu error loggingLorenzo Bianconi5-10/+8
Dump mcu command code in hex and related prefix to help debugging Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: move hw configuration in mt7921_register_deviceLorenzo Bianconi2-13/+6
Get rid of init work since firmware loading is already performed in mt7921_init_hardware Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: add support for applying pre-calibration dataRyder Lee9-10/+199
When the EEPROM data is read from flash, it can contain pre-calibration data, which can save calibration time. Note that group_cal can save 30% bootup calibration time, and dpd_cal can save 75% channel switching time. Tested-by: Bo Jiao <[email protected]> Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: load ROM patch before checking patch semaphore statusFelix Fietkau1-14/+16
For MT7663, the availability of the patch files is used to detect, which corresponding firmware is going to be used (AP firmware or STA offload firmware). If the ROM patch was already applied, it could attempt to load the wrong firmware (without considering the alternative). Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: fix entering driver-own state on mt7663Felix Fietkau1-2/+10
Fixes hardware wakeup issues Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: fix hardware error recovery for mt7663Felix Fietkau5-11/+53
MT7663 uses different bits for communicating reset commands/status between MCU and host. Also add an extra initial reset command. Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: add dumping Tx power tableSean Wang5-0/+151
Dump the tx power table saved in offload firmware. Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: introduce single-sku support for mt7663/mt7921Lorenzo Bianconi6-1/+170
Introduce support for rate-txpower compensation for mt7663/mt7921 chipsets. Rate-txpower limit is specified through dts Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: do not use mt7615 single-sku values for mt7663Lorenzo Bianconi1-0/+5
mt7663 mcu relies on different APIs to configure APIs per-rate power limit respect to mt7615 driver. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: implement support for using DT rate power limitsFelix Fietkau2-2/+69
Limits are used to update the channel max_power settings and also passed to the firmware on channel changes Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: extend DT rate power limits to support 11ax devicesShayne Chen2-23/+40
Enable parsing per-rate txpower limits from DT for 11ax chipsets. Co-developed-by: Felix Fietkau <[email protected]> Signed-off-by: Felix Fietkau <[email protected]> Tested-by: Evelyn Tsai <[email protected]> Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: add functions for parsing rate power limits from DTFelix Fietkau2-0/+216
This subnode can be used to set per-rate tx power limits either per country code / regdomain or globally. These limits are typically provided by the device manufacturers and are used to limit sideband emissions and stay within regulatory limits Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21dt-bindings:net:wireless:mediatek,mt76: introduce power-limits nodeLorenzo Bianconi1-0/+107
Introduce power-limits node in mt76 binding in order to specify per-rate power limit values for each 802.11n/802.11ac rate Signed-off-by: Lorenzo Bianconi <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: flush tx status queue on DMA resetFelix Fietkau5-0/+10
After DMA reset, tx status information for queued frames will never arrive. Flush the queue to free skbs immediately instead of waiting for a timeout Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: add mt7921_dma_cleanup in mt7921_unregister_deviceLorenzo Bianconi1-1/+2
In order to avoid memory leaks, clean the dma engine unloading the module Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: use ieee80211_free_txskb() in mt7615_tx_token_put()Ryder Lee1-2/+6
We should use ieee80211_free_txskb() to report skb status avoid wrong aql accounting after reset. Cc: [email protected] Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: only free skbs after mt7615_dma_reset() when reset happensRyder Lee1-3/+3
In mt7615_mac_reset_work(), make sure freeing skbs after mt7615_dma_reset(). Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: only free skbs after mt7915_dma_reset() when reset happensRyder Lee1-3/+3
In mt7915_mac_reset_work(), make sure freeing skbs after mt7915_dma_reset(). Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: fix memleak when mt7915_unregister_device()Ryder Lee1-2/+1
mt7915_tx_token_put() should get call before mt76_free_pending_txwi(). Fixes: f285dfb98562 ("mt76: mt7915: reset token when mac_reset happens") Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: fix memleak when mt7615_unregister_device()Ryder Lee1-2/+1
mt7615_tx_token_put() should get call before mt76_free_pending_txwi(). Fixes: a6275e934605 ("mt76: mt7615: reset token when mac_reset happens") Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: fix rate setting of tx descriptor in testmodeShayne Chen1-6/+19
Fix ofdm rate index and ldpc setting in rate setting field of tx descriptor. Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: rework mt7915_tm_set_tx_len()Shayne Chen1-17/+5
Rework mt7915_tm_set_tx_len() with mt76_testmode_alloc_skb() to support larger packet based on a longer tx_time. Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: testmode: add support to send larger packetShayne Chen4-35/+131
Add support to send larger packet in testmode to meet requirements of some test cases. The limit of max packet size is determined based on tx rate mode setting. Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21rtlwifi: implement set_tim by update beacon contentPing-Ke Shih4-0/+37
Once beacon content is changed, we update the content to wifi card by send_beacon_frame(). Then, STA with PS can wake up properly to receive its packets. Since we update beacon content to PCI wifi devices every beacon interval, the only one usb device, 8192CU, needs to update beacon content when mac80211 calling set_tim. Reported-by: Maciej S. Szmigiero <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Tested-by: Maciej S. Szmigiero <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-21libertas_tf: Remove duplicate struct declarationWan Jiabing1-1/+0
struct lbtf_private is declared twice. One has been declared at 157th line. Remove the duplicate. Signed-off-by: Wan Jiabing <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-21rtw88: refine napi deinit flowPo-Hao Huang2-5/+15
We used to stop napi before disabling irqs. And it turns out to cause some problem when we try to stop device while interrupt arrives. To safely stop pci, we do three steps: 1. disable interrupt 2. synchronize_irq 3. stop_napi Since step 2 and 3 may not finish as expected when interrupt is enabled, use rtwpci->running to decide whether interrupt should be re-enabled at the time. Fixes: 9e2fd29864c5 ("rtw88: add napi support") Signed-off-by: Po-Hao Huang <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-21rtw88: Fix potential unrecoverable tx queue stopYu-Yen Ting1-2/+8
If there are lots of packets to be transmitted, the driver would check whether the available descriptors are sufficient according the read/write point of tx queue. Once the available descriptor is not enough, ieee80211_stop_queue is called. TX ISR, meanwhile, is releasing the tx resources after the packets are transmitted. This routine may call ieee80211_wake_queue by checking the available descriptor. The potential queue stop problem would occur when the tx queue is stopped due to the heavy traffic. Then thare is no chance to wake the queue up because the read point is not updated immediately, as a result, no more packets coulde be transmitted in this queue. This patch makes sure the ieee80211_wake_queue could be called properly and avoids the race condition when ring->r.rp, ring->queue_stopped are updated. Signed-off-by: Yu-Yen Ting <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]