Commit Graph
105 Commits
Author SHA1 Message Date
Felix Fietkau 4d019c9672 sync with upstream changes
Signed-off-by: Felix Fietkau <[email protected]>
2020-10-23 11:38:05 +02:00
Taehee YooandFelix Fietkau 33b89f4a1b mt76: set fops_tx_stats.owner to THIS_MODULE
If THIS_MODULE is not set, the module would be removed while debugfs is
being used.
It eventually makes kernel panic.

Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: Taehee Yoo <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-10-11 21:50:08 +02:00
Ryder LeeandFelix Fietkau 8884a5def5 mt76: mt7915: rename mt7915_mcu_get_rate_info to mt7915_mcu_get_tx_rate
Avoid confusion with rx rate query function.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-10-11 21:48:37 +02:00
Ryder LeeandFelix Fietkau 594890b111 mt76: mt7915: update ppe threshold
Update ppe_thresh capability to sync SDK setting.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-10-11 21:48:37 +02:00
Taehee YooandFelix Fietkau eb4c099579 mt76: mt7915: set fops_sta_stats.owner to THIS_MODULE
If THIS_MODULE is not set, the module would be removed while debugfs is
being used.
It eventually makes kernel panic.

Fixes: ec9742a8f38e ("mt76: mt7915: add .sta_add_debugfs support")
Signed-off-by: Taehee Yoo <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-10-11 21:48:37 +02:00
Felix Fietkau d33943baac mt76: mt7915: query station rx rate from firmware
When per-packet rate reporting is enabled, the hardware can get stuck under
some conditions. It self-recovers quickly, but in practice this leads to
reduced performance.
In order to avoid running into this issue, disable per-packet rate reporting
by default and query the rx rate from firmware instead, unless monitor mode
is enabled.

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-30 11:39:05 +02:00
Felix Fietkau ee40800df2 mt76: mt7915: move eeprom parsing out of mt7915_mcu_parse_response
Use the new mt76_mcu_send_and_get_msg function

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-30 06:34:51 +02:00
Felix Fietkau a4d71501ba mt76: make mcu_ops->mcu_send_msg optional
Remove it from mt7615 and mt7915 and implement it in core code instead

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-30 05:35:49 +02:00
Felix Fietkau 477caa196f mt76: move waiting and locking out of mcu_ops->mcu_skb_send_msg
This removes some code duplication and prepares the code for making
the MCU API more flexible

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-30 05:35:49 +02:00
Felix Fietkau fcfbb046c2 mt76: move mcu timeout handling to .mcu_parse_response
Preparation for further cleanup

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-30 04:01:03 +02:00
Felix Fietkau 8c73f3b15a mt76: implement .mcu_parse_response in struct mt76_mcu_ops
Do not free skb inside that function
Preparation for further cleanup

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-30 03:54:03 +02:00
Felix Fietkau eb9afae96b mt76: rename __mt76_mcu_skb_send_msg to mt76_mcu_skb_send_msg
Preparation for further cleanup

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-30 03:11:06 +02:00
Felix Fietkau 6cdebe8058 mt76: rename __mt76_mcu_send_msg to mt76_mcu_send_msg
Preparation for further cleanup

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-30 03:09:22 +02:00
Felix Fietkau 75977a85e8 mt76: mt7915: disable OFDMA/MU-MIMO UL
The feature is not ready in firmware yet, and it leads to hangs

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-29 08:48:20 +02:00
Felix Fietkau 9cb12f7042 mt76: mt7915: fix DRR sta bss group index
The firmware/hardware supports only 16 entries. Trying to use more can lead
to timeouts on some firmware versions

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-28 15:15:20 +02:00
Ryder LeeandFelix Fietkau 434940e082 mt76: mt7915: measure channel noise and report it via survey
Read per-stream measurements every 100 ms and build a simple moving average.

Tested-by: Shayne Chen <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-09-27 19:13:26 +02:00
Felix Fietkau 709f2cd778 mt76: mt7915: fix processing txfree events
In the MT7915 info, the fields for the WLAN index / queue overlap with the
token id, and the MT_TX_FREE_PAIR bit indicates, which one is present.

If MT_TX_FREE_PAIR is set, skip processing the token index, since the data
will not be valid.

This fixes accidentally freeing tokens which are still in use by the
hardware with a wrong station pointer.

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-27 16:43:16 +02:00
Felix Fietkau 2741fd071b mt76: mt7915: support 32 station interfaces
When looking for a MAC address slot, start by using main BSSID slots 1-3,
afterwards use 16 repeater mode BSSID slots, then start using the slots
usually used for AP mode.
This search order should prevent unnecessary conflicts with AP mode interfaces
on the same PHY

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-27 15:26:48 +02:00
Shayne ChenandFelix Fietkau 8c47ed12c2 mt76: mt7915: add offchannel condition in switch channel command
Add a missing offchannel condition for channel switch reason, which
bypasses DPD calibration to reduce scanning time.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-09-23 08:16:55 +02:00
Liu ShixinandFelix Fietkau ec84891a4d mt76: mt7915: convert to use le16_add_cpu()
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-16 11:04:05 +02:00
Lorenzo BianconiandFelix Fietkau fee1f4a8e8 mt76: mt7915: fix possible memory leak in mt7915_mcu_add_beacon
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-16 11:04:05 +02:00
Gustavo A. R. SilvaandFelix Fietkau 1ccd31bbe1 mt76: Use fallthrough pseudo-keyword
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-08 23:44:29 +02:00
Chih-Min ChenandFelix Fietkau bab866a01e mt76: mt7915: fix unexpected firmware mode
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-04 19:31:36 +02:00
Felix Fietkau e22c65cdc5 mt76: mt7915: simplify checks for the 802.3 offload path
No multicast frames enter this path, so there is no need to check the
ethernet header

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-04 19:31:36 +02:00
Felix Fietkau 115b62efac mt76: remove retry_q from struct mt76_txq and related code
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-04 19:31:36 +02:00
Felix Fietkau cfaf408587 mt76: mt7915: fix queue/tid mapping for airtime reporting
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-04 19:31:36 +02:00
Felix Fietkau 8f48855f5d mt76: mt7915: simplify mt7915_lmac_mapping
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-04 19:31:36 +02:00
Felix Fietkau b1f4256861 mt76: mt7915: fix VHT LDPC capability
The MCU field should contain a boolean 0/1, not the flag itself

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-04 19:31:36 +02:00
Felix Fietkau 69b3f868d1 mt76: mt7915: use napi_consume_skb to bulk-free tx skbs
Slightly improves performance

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-01 17:57:43 +02:00
Felix Fietkau 72c8a81e64 mt76: mt7915: fix encap offload multicast traffic with 4-address mode
multicast packets need to be transmitted as 802.11 unicast packets

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-28 23:49:28 +02:00
Felix Fietkau c4c8b6a20d mt76: mt7915: fix HE BSS info
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-08-27 09:05:49 +02:00
Felix Fietkau 3218b914a2 mt76: remove struct mt76_sw_queue
All members except for the struct mt76_queue pointer have been removed

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-24 20:59:30 +02:00
Felix Fietkau e861cb0518 mt76: rely on AQL for burst size limits on tx queueing
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-08-24 20:59:30 +02:00
Felix Fietkau 05aa857861 mt76: remove swq from struct mt76_sw_queue
Since txq selection was moved to mac80211, it is no longer used

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-24 20:59:30 +02:00
Felix Fietkau 780cdabb86 mt76: remove qid argument to drv->tx_complete_skb
It is not needed

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-24 20:59:30 +02:00
Felix Fietkau 90c8422d3f mt76: mt7915: fix typo in function name
Signed-off-by: Felix Fietkau <[email protected]>
2020-08-24 06:49:14 +02:00
Felix Fietkau 72f0979566 mt76: mt7915: add support for accessing mapped registers via bus ops
Makes it possible to read/write them via debugfs, similar to mt7615/7603

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-22 16:00:17 +02:00
Felix Fietkau 2f1318a06d mt76: convert from tx tasklet to tx worker thread
This should improve performance by allowing the scheduler to move the tx
scheduling work to idle CPUs

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-22 15:56:57 +02:00
Felix Fietkau 5cf34cda70 mt76: mt7915: significantly reduce interrupt load
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-08-22 15:56:57 +02:00
Felix Fietkau 23dbd64d63 mt76: mt7915: schedule tx tasklet in mt7915_mac_tx_free
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-08-22 15:56:57 +02:00
Felix Fietkau 795b772cd3 mt76: mt7915: add encap offload for 4-address mode stations
Enable MWDS mode in firmware as well and fix txp->rept_wds_wcid for wcid >= 255

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-22 15:56:57 +02:00
Felix Fietkau 3a3306e408 mt76: mt7915: add 802.11 encap offload support
It is currently limited to 3-address mode AP and STA interfaces

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-22 15:56:57 +02:00
Felix Fietkau 692065b4c9 mt76: mt7915: only enable hw amsdu for AP and station
Signed-off-by: Felix Fietkau <[email protected]>
2020-08-22 12:17:15 +02:00
Felix Fietkau d2fe5e8330 mt76: mt7915: fix variable initialization in sta poll
Signed-off-by: Felix Fietkau <[email protected]>
2020-08-22 12:17:15 +02:00
Felix Fietkau 3743e7c904 mt76: mt7915: optimize mt7915_mac_sta_poll
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-08-20 13:02:58 +02:00
Felix Fietkau 8027c7d952 mt76: mt7615: fix reading airtime statistics
- 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-08-20 13:02:22 +02:00
Felix Fietkau efc8669db5 mt76: mt7615: fix max_mpdu_size field for A-MSDU
Signed-off-by: Felix Fietkau <[email protected]>
2020-08-13 09:52:37 +02:00
Felix Fietkau 34aed01ca8 mt76: mt7915: use ieee80211_free_txskb to free tx skbs
Using dev_kfree_skb for tx skbs breaks AQL. This worked until now only
by accident, because a mac80211 issue breaks AQL on drivers with firmware
rate control that report the rate via ieee80211_tx_status_ext as struct
rate_info.

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-12 16:46:34 +02:00
Ryder LeeandFelix Fietkau 21182f90d9 mt76: mt7915: add Tx A-MSDU offloading support
This disables the software A-MSDU aggregation in mac80211 and enables hardware
offloading

Suggested-by: Yiwei Chung <[email protected]>
Suggested-by: YF Luo <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Co-developed-by: Felix Fietkau <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-08-12 09:44:38 +02:00
Felix Fietkau 21f7734cbb mt76: mt7915: add missing flags in WMM parameter settings
Indicate the filled parameter to the firmware

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-11 12:13:34 +02:00