Commit Graph
3274 Commits
Author SHA1 Message Date
MeiChia ChiuandFelix Fietkau a2d61f4f40 mt76: mt7915 add ht mpdu density
set ht mpdu density to 4 usec.

Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: MeiChia Chiu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-07-11 13:38:17 +02:00
Sean WangandFelix Fietkau cb80da974f mt76: mt7921: reduce the mutex lock scope during reset
Reduce the mutex lock scope for reset to get rid of possible task hung
e.g wpa_supplicant and to allow the user-space process to keep running
during we need more retries to complete the reset.

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Suggested-by: YN Chen <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-07-11 13:38:17 +02:00
Sean WangandFelix Fietkau 6e0d707748 mt76: mt7921: reduce log severity levels for informative messages
Use dev_dbg instead for the diagnostic messages.

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-07-11 13:38:17 +02:00
Lorenzo BianconiandFelix Fietkau b8304b456e mt76: connac: move tx initialization/cleanup in mt76_connac module
Move mt76_connac_init_tx_queues and mt76_connac_tx_cleanup routines
in mt76_connac module. This is a preliminary patch to add mt7990
chipset support.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-07-11 13:38:17 +02:00
Lorenzo BianconiandFelix Fietkau d5459efaaf mt76: mt7921: make mt7921_pci_driver static
mt7921_pci_driver struct is only referenced in mt7921/pci.c so make it
static.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-07-11 13:38:17 +02:00
Sean WangandFelix Fietkau 7fd299e3c9 mt76: mt7921: enable HW beacon filter in the initialization stage
The current driver has worked with HW beacon filter and connection
monitor all the way, here we move the enablement into the initialization
stage like other HW features being done to get rid of others are
confused why these configurations would be changed at runtime.

We still leave a way to turn off these offload features in debugfs knobs
but that is just for debugging purposes.

Tested-by: Deren Wu <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-07-11 13:38:17 +02:00
Sean WangandFelix Fietkau e5674c4aa4 mt76: mt7921: enable HW beacon filter not depending on PM flag
The hardware beacon filter works whether or not the PM flag is set, so we
drop redundant dependency checks on PM flags.

Additionally, the patch implicitly allow the MT7921[E, S, U] to have a
consistent configuration of the hardware beacon filter.

Tested-by: Deren Wu <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-07-11 13:38:17 +02:00
Felix Fietkau 9485e3b470 mt76: remove q->qid
It is no longer used

Signed-off-by: Felix Fietkau <[email protected]>
2022-07-03 20:59:06 +02:00
Felix Fietkau 93e3fce916 mt76: pass original queue id from __mt76_tx_queue_skb to the driver
MT7615 and newer map multiple software tx queues to the hardware id

Signed-off-by: Felix Fietkau <[email protected]>
2022-07-03 17:52:25 +02:00
Felix Fietkau af406a2d1c mt76: do not use skb_set_queue_mapping for internal purposes
Previously the code used skb_set_queue_mapping for management or non-bufferable
powersave frames that need to be sent to a different hardware queue.
This can confuse AQL, which expects the value to remain the same until the tx
status report.
The only place that currently uses the altered skb queue mapping is the txwi
write function. Change the code to pass the hardware queue id as a function
parameter instead.

Signed-off-by: Felix Fietkau <[email protected]>
2022-07-02 15:57:02 +02:00
Felix Fietkau c07f459278 firmware: update mt7622 firmware to version 20220630
Signed-off-by: Felix Fietkau <[email protected]>
2022-07-01 18:42:47 +02:00
Felix Fietkau b6e865e2cc mt76: mt7615: fix throughput regression on DFS channels
For some reason, mt7615 reacts badly to repeatedly enabling/disabling the radar
detector without also switching the channel.
This results in very bad throughput on DFS channels, because
hw->conf.radar_enabled can get toggled a few times after CAC ends.
Fix this by always leaving the DFS detector enabled on DFS channels and instead
suppress unwanted detection events.

Fixes: 2c86f6752046 ("mt76: mt7615: fix/rewrite the dfs state handling logic")
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-24 21:08:25 +02:00
Felix Fietkau f2edd340dd mt76: allow receiving frames with invalid CCMP PN via monitor interfaces
This can be useful for debugging

Signed-off-by: Felix Fietkau <[email protected]>
2022-06-23 14:21:20 +02:00
Felix Fietkau fd8211cf7c mt76: mt7921: sync with updated patch
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-23 14:14:52 +02:00
Felix Fietkau ba39ed3b44 mt76: mt76x02: improve reliability of the beacon hang check
Increment the counter only when writing beacons to the hardware in order
to avoid triggering restarts if beacons are disabled.
Additionally, avoid resetting the MAC if stopping it failed

Signed-off-by: Felix Fietkau <[email protected]>
2022-06-23 14:10:22 +02:00
Felix Fietkau 4fb991f2c9 mt76: mt7615: add sta_rec with EXTRA_INFO_NEW for the first time only
Set EXTRA_INFO_NEW for the first time only to prevent adding the same
starec entry, otherwise the entry might be removed in fw.

Signed-off-by: Felix Fietkau <[email protected]>
2022-06-22 14:11:23 +02:00
MeiChia ChiuandFelix Fietkau dd682eead0 mt76: mt7915: update the maximum size of beacon offload
Since an in-band discovery frame is offloaded by MCU,
here we enlarge the command size to accommodate the additional content.

Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Money Wang <[email protected]>
Signed-off-by: MeiChia Chiu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-22 13:19:55 +02:00
MeiChia ChiuandFelix Fietkau 3ef66fc7c7 mt76: do not check the ccmp pn for ONLY_MONITOR frame
if the received frame enables RX_FLAG_ONLY_MONITOR,
driver doesn't need to check the ccmp pn of this frame.

Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: MeiChia Chiu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-22 13:19:55 +02:00
Shayne ChenandFelix Fietkau 500c18014d mt76: mt7915: add sta_rec with EXTRA_INFO_NEW for the first time only
Set EXTRA_INFO_NEW for the first time only to prevent adding the same
starec entry, otherwise the entry might be removed in fw.

Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-22 13:19:55 +02:00
Peter ChiuandFelix Fietkau a4db5869d6 mt76: mt7915: update mpdu density in 6g capability
Set mpdu density to 2 usec in 6g capability.

Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-22 13:19:55 +02:00
Lorenzo BianconiandFelix Fietkau 1696f9eb8b mt76: mt7915: do not copy ieee80211_ops pointer in mt7915_mmio_probe
We do not modify ieee80211_ops pointers so we do not need to copy them.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-22 13:19:55 +02:00
Shayne ChenandFelix Fietkau 7275f77580 mt76: mt7915: fix incorrect testmode ipg on band 1 caused by wmm_idx
Fix the issue that the measured inter packet gap didn't fit its
setting value.

Fixes: c2d3b1926f30 ("mt76: mt7915: add support for ipg in testmode")
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-21 20:51:37 +02:00
Lorenzo BianconiandFelix Fietkau 576c1b7c47 mt76: move mt76_connac2_mcu_fill_message in mt76_connac module
Move mt76_connac2_mcu_fill_message routine in shared module in order to
reuse it for mt7921 and mt7915e drivers. This is a preliminary patch to
add mt7990 driver support.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-21 20:51:30 +02:00
Lorenzo BianconiandFelix Fietkau 2065a79016 mt76: move mcu_txd/mcu_rxd structures in shared code
This is a preliminary patch to add mt7990 chipset support.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-21 20:51:30 +02:00
Lorenzo BianconiandFelix Fietkau 2e758064b0 mt76: mt7915: rely on mt76_connac_tx_free
As for mt7921 and mt7615 drivers, rely on mt76_connac_tx_free data
structure in mt7915e driver.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-21 20:51:30 +02:00
Lorenzo BianconiandFelix Fietkau 467960fab7 mt76: connac: move mt7615_txp_skb_unmap in common code
Move mt7615_txp_skb_unmap in shared code and reuse it in mt7915e and
mt7921e driver.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-21 20:47:36 +02:00
Lorenzo BianconiandFelix Fietkau 0993f4ef96 mt76: connac: move mt76_connac_write_hw_txp in shared code
Now we can move mt76_connac_write_hw_txp routine in mt76-connac module
and reuse it in mt7921e and mt7615e driver.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-21 20:47:36 +02:00
Lorenzo BianconiandFelix Fietkau c42d45278f mt76: connac: move mt76_connac_tx_complete_skb in shared code
Since now txp structures are in common code we can reuse
mt76_connac_tx_complete_skb routine in mt7921e, mt7915e and mt7615e
drivers.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-21 20:47:36 +02:00
Lorenzo BianconiandFelix Fietkau 7184f0a6f6 mt76: connac: move mt76_connac_tx_free in shared code
Move mt76_connac_tx_free structure in mt76_connac module since it is
shared by mt7615 and mt7921 drivers.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-21 20:47:36 +02:00
Lorenzo BianconiandFelix Fietkau 899d192e8a mt76: move mt7615_txp_ptr in mt76_connac module
Since mt7615_txp_ptr is shared between mt7615 and mt7921 move it in
mt76_connac module.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-21 20:47:36 +02:00
Lorenzo BianconiandFelix Fietkau 149e95f5d7 mt76: connac: move mt76_connac_fw_txp in common module
Since mt76_connac_fw_txp struct is shared between mt7615e, mt7915e and
mt7921e, move it in mt76_connac module.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-21 20:47:36 +02:00
Lorenzo BianconiandFelix Fietkau 18df38fe77 mt76: mt7915: get rid of unnecessary new line in mt7915_mac_write_txwi
Remove unnecessary new line in mt7915_mac_write_txwi routine.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-21 20:47:36 +02:00
Deren WuandFelix Fietkau fd3958970e mt76: mt7921: enlarge maximum VHT MPDU length to 11454
Enlarge maximum MPDU length to 11454 that both mt7921/mt7922 can support.
After this fixing, we can get better performance.

Fixes: 5c14a5f944b9 ("mt76: mt7921: introduce mt7921e support")
Tested-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-21 20:47:36 +02:00
Felix Fietkau e522834390 mt76: mt7915: disable UL MU-MIMO for mt7915
After initially establishing a connection, it can produce multi-second latency
spikes and tx hangs when pushing traffic.
It should work better for MT7916 and MT7986, so leave it enabled there

Signed-off-by: Felix Fietkau <[email protected]>
2022-06-21 20:35:36 +02:00
Deren WuandFelix Fietkau 8a04f1b046 mt76: mt7921: fix aggregation subframes setting to HE max
mt7921/mt7922 support HE max aggregation subframes 256 for both tx/rx.
Get better throughput then before.

Fixes: 94bb18b03d43 ("mt76: mt7921: fix max aggregation subframes setting")
Tested-by: Ming Yen Hsieh <[email protected]>
Reviewed-by: Sean Wang <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:16:03 +02:00
Deren WuandFelix Fietkau 6329a83490 mt76: mt7921s: fix possible sdio deadlock in command fail
Move sdio_release_host() to final resource handing

Fixes: b12deb5e86fa ("mt76: mt7921s: fix mt7921s_mcu_[fw|drv]_pmctrl")
Reported-by: YN Chen <[email protected]>
Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Lorenzo BianconiandFelix Fietkau f8d125b4ea mt76: mt7921: do not update pm states in case of error
Do not update pm stats if mt7921e_mcu_fw_pmctrl routine returns an
error.

Fixes: 36873246f78a2 ("mt76: mt7921: add awake and doze time accounting")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Lorenzo BianconiandFelix Fietkau e0eaf66eae mt76: mt7615: do not update pm stats in case of error
Do not update pm stats if mt7615_mcu_fw_pmctrl returns an error.

Fixes: abe912ae3cd42 ("mt76: mt7663: add awake and doze time accounting")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Lorenzo BianconiandFelix Fietkau cb75aaa392 mt76: mt7921s: remove unnecessary goto in mt7921s_mcu_drv_pmctrl
Get rid of unnecessary goto in mt7921s_mcu_drv_pmctrl routine.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Lorenzo BianconiandFelix Fietkau 649bdc4983 mt76: connac: move mt76_connac2_mac_fill_rx_rate in connac module
Rely on mt76_connac2_mac_fill_rx_rate routine in mt7921 driver.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Lorenzo BianconiandFelix Fietkau 4876740626 mt76: connac: move mt76_connac2_reverse_frag0_hdr_trans in mt76-connac module
mt76_connac2_reverse_frag0_hdr_trans routine is shared between mt7921
and mt7915e drivers.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Lorenzo BianconiandFelix Fietkau cae61112ef mt76: connac: move HE radiotap parsing in connac module
HE radiotap parsing code is shared between connac2 devices.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Deren WuandFelix Fietkau f1f46d3b4b mt76: mt7921: fix command timeout in AP stop period
Due to AP stop improperly, mt7921 driver would face random command timeout
by chip fw problem. Migrate AP start/stop process to .start_ap/.stop_ap and
congiure BSS network settings in both hooks.

The new flow is shown below.
* AP start
    .start_ap()
      configure BSS network resource
      set BSS to connected state
    .bss_info_changed()
      enable fw beacon offload

* AP stop
    .bss_info_changed()
      disable fw beacon offload (skip this command)
    .stop_ap()
      set BSS to disconnected state (beacon offload disabled automatically)
      destroy BSS network resource

Fixes: 116c69603b01 ("mt76: mt7921: Add AP mode support")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Deren WuandFelix Fietkau 1b492be795 mt76: mt7921: not support beacon offload disable command
Beacon disable flow would be handled in bss stop handler automatically.
Force return -EOPNOTSUPP in disable case.

Fixes: 116c69603b01 ("mt76: mt7921: Add AP mode support")
Reviewed-by: Sean Wang <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Lorenzo BianconiandFelix Fietkau 012e619a07 mt76: connac: move mt76_connac2_mac_add_txs_skb in connac module
Move mt76_connac2_mac_add_txs_skb in mt76-connac module since it is
shared between connac2 devices (mt7921 and mt7915)

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Lorenzo BianconiandFelix Fietkau b5eecc841d mt76: connac: move connac2_mac_write_txwi in mt76_connac module
mac_write_txwi code is shared between connac2 devices (mt7915 and
mt7921). Move it in connac module.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Lorenzo BianconiandFelix Fietkau ecefae4c7d mt76: connac: move mac connac2 defs in mt76_connac2_mac.h
This is a preliminary patch to share connac2 mac txwi code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Lorenzo BianconiandFelix Fietkau 934029bb93 mt76: mt7915: rely on mt76_dev in mt7915_mac_write_txwi signature
This is a preliminary patch to share txwi configuration code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Lorenzo BianconiandFelix Fietkau 488a5ccc97 mt76: mt7921: rely on mt76_dev in mt7921_mac_write_txwi signature
This is a preliminary patch to share txwi configuration code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00
Deren WuandFelix Fietkau d6ae3505ac mt76: enable the VHT extended NSS BW feature
According IEEE Std 802.11-2020, its definition is:
Indicates whether the STA is capable of interpreting the Extended NSS BW
Support subfield of the VHT Capabilities Information field.

Some APs, such as Xiaomi AX6000, would check this one for BW settings.
mt76 driver can get max BW capability only if the this field is confgured
properly.

Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-17 12:14:22 +02:00