Commit graph

1061160 commits

Author SHA1 Message Date
Chris Chiu
b250200e2e rtl8xxxu: Improve the A-MPDU retransmission rate with RTS/CTS protection
The A-MPDU TX retransmission rate is always high (> 20%) even in a very
clean environment. However, the vendor driver retransimission rate is
< 10% in the same test bed. The difference is the vendor driver starts
the A-MPDU TXOP with initial RTS/CTS handshake which is observed in the
air capture and the TX descriptor. Since the driver does not know how
many frames will be aggregated and the estimated duration, forcing the
RTS/CTS protection for A-MPDU helps to lower the retransmission rate
from > 20% to ~12% in the same test setup with the vendor driver.

Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211215085819.729345-1-chris.chiu@canonical.com
2021-12-20 21:04:03 +02:00
Po-Hao Huang
c1afb26727 rtw88: 8822c: update rx settings to prevent potential hw deadlock
These settings enables mac to detect and recover when rx fifo
circuit deadlock occurs. Previous version missed this, so we fix it.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211217012708.8623-1-pkshih@realtek.com
2021-12-20 20:50:13 +02:00
Chin-Yen Lee
a3fd1f9aa7 rtw88: don't check CRC of VHT-SIG-B in 802.11ac signal
Currently all realtek wifi chip is set to check CRC of VHT-SIG-B
in 802.11ac signal, but some AP don't calculate the CRC and packets
from these AP can't be received and lead to disconnection.
We disable the check defaultly to avoid this case.

Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211217012421.7859-1-pkshih@realtek.com
2021-12-20 20:49:02 +02:00
Kai-Heng Feng
24f5e38a13 rtw88: Disable PCIe ASPM while doing NAPI poll on 8821CE
Many Intel based platforms face system random freeze after commit
9e2fd29864 ("rtw88: add napi support").

The commit itself shouldn't be the culprit. My guess is that the 8821CE
only leaves ASPM L1 for a short period when IRQ is raised. Since IRQ is
masked during NAPI polling, the PCIe link stays at L1 and makes RX DMA
extremely slow. Eventually the RX ring becomes messed up:
[ 1133.194697] rtw_8821ce 0000:02:00.0: pci bus timeout, check dma status

Since the 8821CE hardware may fail to leave ASPM L1, manually do it in
the driver to resolve the issue.

Fixes: 9e2fd29864 ("rtw88: add napi support")
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215131
BugLink: https://bugs.launchpad.net/bugs/1927808
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Jian-Hong Pan <jhp@endlessos.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211215114635.333767-1-kai.heng.feng@canonical.com
2021-12-20 20:48:10 +02:00
Dan Carpenter
4894edacfa wilc1000: fix double free error in probe()
Smatch complains that there is a double free in probe:

drivers/net/wireless/microchip/wilc1000/spi.c:186 wilc_bus_probe() error: double free of 'spi_priv'
drivers/net/wireless/microchip/wilc1000/sdio.c:163 wilc_sdio_probe() error: double free of 'sdio_priv'

The problem is that wilc_netdev_cleanup() function frees "wilc->bus_data".
That's confusing and a layering violation.  Leave the frees in probe(),
delete the free in wilc_netdev_cleanup(), and add some new frees to the
remove() functions.

Fixes: dc8b338f3b ("wilc1000: use goto labels on error path")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211217150311.GC16611@kili
2021-12-20 20:44:03 +02:00
Luca Coelho
97c0979d0d iwlwifi: mvm: fix imbalanced locking in iwl_mvm_start_get_nvm()
If iwl_transt_start_hw() failed, we were returning without calling
wiphy_unlock() and rtnl_unlock(), causing a locking imbalance:

drivers/net/wireless/intel/iwlwifi/mvm/ops.c:686:12: warning: context imbalance in 'iwl_mvm_start_get_nvm' - wrong count at exit

Fix that by adding the unlock calls.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211219090128.42417-2-luca@coelho.fi
2021-12-20 20:41:30 +02:00
Johannes Berg
ab2c42618a iwlwifi: mvm: add dbg_time_point to debugfs
We forgot to link this to debugfs, so the code is all dead.
Add it for real.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/iwlwifi.20211219110000.d0f314101410.I7357c01179c35621686265d4da4a64d2333a5f1a@changeid
2021-12-20 20:41:30 +02:00
Johannes Berg
80cba44ff6 iwlwifi: mvm: add missing min_size to kernel-doc
On struct iwl_rx_handlers we should document the min_size
member, do that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/iwlwifi.20211219110000.0c42c428bc6b.I8bfa49d534acc5f513f2fb3dff2d6f22f6c45071@changeid
2021-12-20 20:41:29 +02:00
Johannes Berg
991bbbeccc iwlwifi: mei: fix W=1 warnings
There are a few warnings due to kernel-doc not understanding
the constructs the way they're done here, fix them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/iwlwifi.20211219110000.1ef2bb24771c.I6a59ad2d64f719d3e27398951c8f1b678b0b1092@changeid
2021-12-20 20:41:29 +02:00
Kalle Valo
d8f9bb98cb mt76 patches for 5.17
* decap offload fixes
 * mt7915 fixes
 * mt7921 fixes
 * eeprom fixes
 * powersave handling fixes
 * SAR support
 * code cleanups
 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - http://gpgtools.org
 
 iEYEABECAAYFAmG/QOQACgkQ130UHQKnbvVdrgCgxjh7lVj2xb7x8HmFrXinhEXg
 UPMAnRinUaMPKoSAGcDQYRvzk6BiaAKe
 =/D5w
 -----END PGP SIGNATURE-----

Merge tag 'mt76-for-kvalo-2021-12-18' of https://github.com/nbd168/wireless

mt76 patches for 5.17

* decap offload fixes
* mt7915 fixes
* mt7921 fixes
* eeprom fixes
* powersave handling fixes
* SAR support
* code cleanups
2021-12-20 20:38:06 +02:00
Deren Wu
b1460bb4ea mt76: mt7921s: fix cmd timeout in throughput test
During heavy loading throughtput test, the RX buffer (128)
would be exhausted and some RX pkts dropped randomly. Increase
buffer size from 128 to 512 (a safer length) to avoid tput degrade
or cmd-timeout problem.

Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:05 +01:00
Sean Wang
1bb42a354d mt76: mt7921s: fix suspend error with enlarging mcu timeout value
Fix the false positive suspend error that may occur on mt7921s
with enlarging mcu timeout value.

The reason why we have to enlarge mcu timeout from HZ / 3 to HZ is
we should consider the additional overhead caused by running
concurrently with btmtksdio (a MT7921 bluetooth SDIO driver) that
would compete for the same SDIO bus in process context to complete
the suspend procedure.

Fixes: 48fab5bbef ("mt76: mt7921: introduce mt7921s support")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:04 +01:00
Sean Wang
3fb47c8838 mt76: mt7921s: make pm->suspended usage consistent
Update pm->suspended usage to be consistent with mt7921e driver.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:04 +01:00
Sean Wang
5375001bb4 mt76: mt7921: fix possible resume failure
Fix the possible resume failure due to mt76_connac_mcu_set_hif_suspend
timeout.

That is because clearing the flag pm->suspended too early opened up a race
window, where mt7921_poll_tx/rx scheduled a ps_work to put the device in
doze mode, that is unexpected for the device is being resumed from the
suspend state and would make the remaining MCU comamnds in resume handler
failed to execute.

Fixes: ffa1bf9742 ("mt76: mt7921: introduce PM support")
Co-developed-by: YN Chen <YN.Chen@mediatek.com>
Signed-off-by: YN Chen <YN.Chen@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:04 +01:00
Sean Wang
f2cd4abca0 mt76: mt7921: clear pm->suspended in mt7921_mac_reset_work
clear pm->suspended in mt7921_mac_reset_work to allow pm runtime
can be enabled after wifi reset in any circumstance.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:04 +01:00
Lorenzo Bianconi
25702d9c55 mt76: connac: rely on le16_add_cpu in mt76_connac_mcu_add_nested_tlv
Rely on le16_add_cpu() in mt76_connac_mcu_add_nested_tlv routine.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:04 +01:00
Lorenzo Bianconi
3c312f4395 mt76: mt7921: remove dead definitions
to_wcid_lo and to_wcid_hi are no longer used in mt7921/mcu.c

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:04 +01:00
MeiChia Chiu
1966a5078f mt76: mt7915: add mu-mimo and ofdma debugfs knobs
Add mu-mimo and ofdma packet counters statistics.
The statistics are clear on read.

Reviewed-by: Money Wang <Money.Wang@mediatek.com>
Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:04 +01:00
Lorenzo Bianconi
6cf4392f24 mt76: mt7915: introduce mt76_vif in mt7915_vif
Align mt7915_vif layout to mt7921_vif and mt7615_vif

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:04 +01:00
Tzung-Bi Shih
81a88b1e75 mt76: mt7921: reduce log severity levels for informative messages
"ASIC revision" and "Firmware init done" shouldn't be error messages.
Reduces the severity levels.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:04 +01:00
Lorenzo Bianconi
5562d5f6c7 mt76: mt7915: rely on mt76_connac definitions
Remove duplicated mcu definitions in mt7915 mcu.h and reused connac
ones.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:03 +01:00
Lorenzo Bianconi
ffc2198d7b mt76: connac: rely on MCU_CMD macro
Similar to mt7915 driver, rely on MCU_CMD macro and do not command
definitions directly

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:03 +01:00
Lorenzo Bianconi
680a2ead74 mt76: connac: introduce MCU_CE_CMD macro
Similar to MCU_EXT_CMD, introduce MCU_CE_CMD for CE commands

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:03 +01:00
Lorenzo Bianconi
5472240245 mt76: connac: introduce MCU_UNI_CMD macro
Similar to MCU_EXT_CMD, introduce MCU_UNI_CMD for unified commands

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:03 +01:00
Lorenzo Bianconi
7159eb828d mt76: connac: remove MCU_FW_PREFIX bit
Get rid of MCU_FW_PREFIX bit since it is no longer used

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:03 +01:00
Lorenzo Bianconi
9d8d136cf0 mt76: connac: align MCU_EXT definitions with 7915 driver
Align MCU_EXT and MCU_FW definitions between mt76_connac and mt7915
driver. This is a preliminary patch to reuse mt76_connac in mt7915
driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:03 +01:00
Lorenzo Bianconi
e6d2070d9d mt76: connac: introduce MCU_EXT macros
Introduce MCU_EXT_CMD and MCU_EXT_QUERY macros in mt76_connac module.
This is a preliminary patch to reuse mt76_connac module in mt7915
driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:03 +01:00
Deren Wu
e0bf699ad8 mt76: mt7921: fix network buffer leak by txs missing
TXS in mt7921 may be forwared to tx_done event. Should try to catch
TXS information in tx_done event as well.

Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:03 +01:00
Felix Fietkau
b7263a2982 mt76: mt7615: in debugfs queue stats, skip wmm index 3 on mt7663
The hardware only supports WMM index 0-2 and registers for index 3 return
bogus data.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:03 +01:00
Felix Fietkau
e4232f0520 mt76: mt7915: process txfree and txstatus without allocating skbs
Reduces pressure on the memory allocator

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:02 +01:00
Felix Fietkau
fbe50d9aff mt76: allow drivers to drop rx packets early
This can be used to free received events without allocating an extra skb

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:02 +01:00
Lorenzo Bianconi
5360522a2c mt76: mt7663: disable 4addr capability
4addr is not supported by the offload firmware yet

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:02 +01:00
Felix Fietkau
2dc24ee641 mt76: mt7615: clear mcu error interrupt status on mt7663
Should fix issues with error recovery

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:02 +01:00
Ryder Lee
087baf9b6d mt76: only access ieee80211_hdr after mt76_insert_ccmp_hdr
Get rid of unsafe access since mt76_insert_ccmp_hdr moves the header.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:02 +01:00
Lorenzo Bianconi
d43de9cffb mt76: move sar_capa configuration in common code
Move wiphy SAR capability configuration in mt76 module and remove
duplicated code.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:02 +01:00
Lorenzo Bianconi
73c7c04436 mt76: connac: fix last_chan configuration in mt76_connac_mcu_rate_txpower_band
last_ch configuration must not be dependent on the current configured band
but it is defined by hw capabilities since the fw always expects the
following order:
- 2GHz
- 5GHz
- 6GHz

Fixes: 9b2ea8eee4 ("mt76: connac: set 6G phymode in single-sku support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:02 +01:00
Sean Wang
2b7f3574ca mt76: mt7921s: fix possible kernel crash due to invalid Rx count
Return the proper error code when out-of-range the Rx aggregation count
are reported from the hardware that would create the unreasonable extreme
large Rx buffer.

[  100.873810]  show_stack+0x20/0x2c
[  100.873823]  dump_stack+0xc4/0x140
[  100.873839]  bad_page+0x110/0x114
[  100.873854]  check_new_pages+0xf8/0xfc
[  100.873869]  rmqueue+0x5a0/0x640
[  100.873884]  get_page_from_freelist+0x124/0x20c
[  100.873898]  __alloc_pages_nodemask+0x114/0x2a4
[  100.873918]  mt76s_rx_run_queue+0xd4/0x2e4 [mt76_sdio 8280a88a0c8c9cf203f16e194f99ac293bdbb2f5]
[  100.873938]  mt76s_rx_handler+0xd4/0x2a0 [mt76_sdio 8280a88a0c8c9cf203f16e194f99ac293bdbb2f5]
[  100.873957]  mt76s_txrx_worker+0xac/0x17c [mt76_sdio 8280a88a0c8c9cf203f16e194f99ac293bdbb2f5]
[  100.873977]  mt7921s_txrx_worker+0x5c/0xd8 [mt7921s d0bdbc018082dbc8dc1407614be3c2e7bd64423b]
[  100.874003]  __mt76_worker_fn+0xe8/0x170 [mt76 b80af3483a8f9d48e916c12d8dbfaa0d3cd15337]
[  100.874018]  kthread+0x148/0x3ac
[  100.874032]  ret_from_fork+0x10/0x30
[  100.874067] Kernel Offset: 0x1fe2000000 from 0xffffffc010000000
[  100.874079] PHYS_OFFSET: 0xffffffe800000000
[  100.874090] CPU features: 0x0240002,2188200c

Fixes: 48fab5bbef ("mt76: mt7921: introduce mt7921s support")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:02 +01:00
Deren Wu
78b217580c mt76: mt7921s: fix bus hang with wrong privilege
Accroding to chip hw flow, mt7921s need to re-acquire privilege
again before normal running. Otherwise, the bus may be stuck in
an abnormal status.

Tested-by: Leon Yen <Leon.Yen@mediatek.com>
Co-developed-by: Eric-SY Chang <Eric-SY.Chang@mediatek.com>
Signed-off-by: Eric-SY Chang <Eric-SY.Chang@mediatek.com>
Co-developed-by: YN Chen <YN.Chen@mediatek.com>
Signed-off-by: YN Chen <YN.Chen@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:02 +01:00
Shayne Chen
00ff52346d mt76: mt7921: use correct iftype data on 6GHz cap init
Set 6GHz cap to iftype data which is matched to the type of
current interface.

Fixes: 50ac15a511 ("mt76: mt7921: add 6GHz support")
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:01 +01:00
Changcheng Deng
9b5271f3c3 mt76: mt7921: fix boolreturn.cocci warning
./drivers/net/wireless/mediatek/mt76/mt7921/sdio_mac.c: 223: 8-9: WARNING:
return of 0/1 in function 'mt7921s_tx_status_data' with return type bool

Return statements in functions returning bool should use true/false
instead of 1/0.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:01 +01:00
Daniel Golle
5b595b6639 mt76: eeprom: tolerate corrected bit-flips
mtd_read() returns -EUCLEAN in case of corrected bit-flips.
As data was read, don't error out in this case.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:01 +01:00
Felix Fietkau
15965d8c9c mt76: mt7603: improve reliability of tx powersave filtering
Leave more time to abort transmissions (which could happen at low CCK rates)
Only warn if the last filter command is stuck

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:01 +01:00
Felix Fietkau
608f7c47df mt76: clear sta powersave flag after notifying driver
If the driver has configured the hardware to drop packets for a sta that was
in powersave mode, then clearing the flag too early opens up a small race
window during which packets could be dropped on wakeup

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:01 +01:00
Lorenzo Bianconi
2c70627b09 mt76: mt7915: introduce SAR support
Add SAR spec support to mt7915 driver to allow configuring SAR power
limitations on the frequency ranges from the userland.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:01 +01:00
Lorenzo Bianconi
4bbd6d83af mt76: mt7603: introduce SAR support
Add SAR spec support to mt7603 driver to allow configuring SAR power
limitations on the frequency ranges from the userland.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:01 +01:00
Felix Fietkau
92610d6df8 mt76: mt7915: improve wmm index allocation
Typically all AP interfaces on a PHY will share the same WMM settings, while
sta/mesh interfaces will usually inherit the settings from a remote device.
In order minimize the likelihood of conflicting WMM settings, make all AP
interfaces share one slot, and all non-AP interfaces another one.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:01 +01:00
Felix Fietkau
70fb028707 mt76: mt7615: improve wmm index allocation
Typically all AP interfaces on a PHY will share the same WMM settings, while
sta/mesh interfaces will usually inherit the settings from a remote device.
In order minimize the likelihood of conflicting WMM settings, make all AP
interfaces share one slot, and all non-AP interfaces another one.

This also fixes running multiple AP interfaces on MT7613, which only has 3
WMM slots.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:01 +01:00
Shayne Chen
792e1d21aa mt76: mt7615: fix unused tx antenna mask in testmode
The mask variable is assigned but not used after testmode disabled:
if (!en)
	mask = phy->mt76->chainmask;

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:00 +01:00
Sean Wang
5ad4faca76 mt76: mt7921s: fix the device cannot sleep deeply in suspend
According to the MT7921S firmware, the cmd MCU_UNI_CMD_HIF_CTRL have to
be last MCU command to execute in suspend handler and all data traffic
have to be stopped before the cmd MCU_UNI_CMD_HIF_CTRL starts as well
in order that mt7921 can successfully fall into the deep sleep mode.

Where we reuse the flag MT76_STATE_SUSPEND and avoid creating
another global flag to stop all of the traffic onto the SDIO bus.

Fixes: 48fab5bbef ("mt76: mt7921: introduce mt7921s support")
Reported-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:00 +01:00
Sean Wang
6906aa93eb mt76: mt7921: move mt76_connac_mcu_set_hif_suspend to bus-related files
This is a preliminary patch for the following patch
("mt76: mt7921s: fix the device cannot sleep deeply in suspend).

mt76_connac_mcu_set_hif_suspend eventually would be handled in each
bus-level suspend/resume handler in either mt7921/sdio.c or mt7921/pci.c
depending on what type of the bus the device is running on. We can move
mt76_connac_mcu_set_hif_suspend to bus-related files to simplify the logic.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-19 15:24:00 +01:00