Commit Graph
100 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
Felix Fietkau b8874e8756 mt76: add back the SUPPORTS_REORDERING_BUFFER flag
It was accidentally dropped while adding multiple wiphy support
Fixes fast-rx support and avoids handling reordering in both mac80211
and the driver

Cc: [email protected]
Fixes: c89d36254155 ("mt76: add function for allocating an extra wiphy")
Signed-off-by: Felix Fietkau <[email protected]>
2020-10-11 18:26:49 +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 082b261810 mt76: implement functions to get the response skb for MCU calls
Can be used by the caller to get the response data directly instead of using the
hack of storing the result in internal data structures from .mcu_parse_response

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-30 05:35:49 +02:00
Felix Fietkau 80c310c59a mt76: mt7603: switch to .mcu_skb_send_msg
Reduces code duplication

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-30 05:35:49 +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
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
Felix Fietkau 1a2547b27d mt76: do not set NEEDS_UNIQUE_STA_ADDR for 7615 and 7915
The newer chipsets can deal with the same STA on multiple interfaces
Preparation for supporting more station interfaces

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-26 22:40:13 +02:00
Felix Fietkau 7f53d68b1a mt76: mt7615: add debugfs knob for setting extended local mac addresses
This is primarily for testing and can be used in combination with monitor
mode to make the card respond to packets sent to a specific MAC address.
For now this is only exposed as a debug/testing feature, later on the
approach might be used to support more concurrent station interfaces

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-25 15:58:32 +02:00
Felix Fietkau 73301065ac mt76: mt7615: reduce maximum VHT MPDU length to 7991
After fixing mac80211 to allow larger A-MSDUs in some cases, there have been
reports of performance regressions and packet loss with some clients.
It appears that the issue occurs when the hardware is transmitting A-MSDUs
bigger than 8k. Limit the local VHT MPDU size capability to 7991, matching
the value used for MT7915 as well.

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-23 07:24:47 +02:00
Felix Fietkau 17ba3432f5 Revert "mt76: mt7615: unlock dfs bands"
This reverts commit b647180c86.
Now enabled properly by a separate interface combination

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-09 11:31:27 +02:00
Felix Fietkau e2b8a4ec98 mt76: testmode: add a limit for queued tx_frames packets
This avoids running out of available tx tokens

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-08 19:12:53 +02:00
Felix Fietkau 130e5de093 Revert "mt76: dma: queue more rx frames internally before passing them to the stack"
This reverts commit 0fc3c5eb61.
2020-09-07 12:08:07 +02:00
Felix Fietkau 0fc3c5eb61 mt76: dma: queue more rx frames internally before passing them to the stack
On MT7615 and MT7915, packets received from DMA can include TX_FREE events,
which free up space for tx. In order to process those packets faster, keep
keep a longer internal queue of packets and pass as many packets to the
stack as the NAPI budget allows

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-04 19:34:57 +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 5f080033ec mt76: move txwi handling code to dma.c, since it is mmio specific
This way we can make some functions static

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 15391c1c94 mt76: fix tx hang on non-AQL frame limit
Signed-off-by: Felix Fietkau <[email protected]>
2020-08-27 15:16:25 +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 3b946a6dc5 mt76: dma: cache dma map address/len in struct mt76_queue_entry
Accessing them from uncached memory can be expensive, so it's cheaper to
cache them

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-27 07:58:36 +02:00
Felix Fietkau b36d7ae096 mt76: mt7603: move number of streams detection to eeprom init
Signed-off-by: Felix Fietkau <[email protected]>
2020-08-25 12:35:34 +02:00
Felix Fietkau 96a541eedd mt76: mt7615: fix antenna selection for testmode tx_frames
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-08-25 11:07:02 +02:00
Felix Fietkau 957b6c5ac2 mt76: mt7615: fix MT_ANT_SWITCH_CON register definition
This is used for testmode tx antenna selection

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-25 07:38:01 +02:00
Felix Fietkau 97e6513144 mt76: mt7603: check for single-stream EEPROM configuration
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-08-25 07:11:14 +02:00
Felix Fietkau f6ca436ebe mt76: mt76x02: tune tx ring size
Increase data queue size to improve performance.
Reduce PS/mgmt queue size

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-24 20:59:30 +02:00
Felix Fietkau 23529b5e93 mt76: mt7603: tune tx ring size
Stop relying on global tx ring size, reduce size for PS/mgmt queue

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-24 20:59:30 +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 3c2cd85803 mt76: unify queue tx cleanup code
Cleanup and preparation for changing tx scheduling behavior

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-24 20:59:30 +02:00
Felix Fietkau 8124daf531 mt76: sdio: fix use of q->head and q->tail
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-08-24 20:59:30 +02:00
Felix Fietkau e8d489647c mt76: usb: fix use of q->head and q->tail
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-08-24 20:59:30 +02:00
Felix Fietkau 519510277a mt76: initialize tx worker function earlier
Allows usb code to overwrite it

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-24 20:48:47 +02:00
Felix Fietkau 974486ec26 util: in worker setup, only overwrite function pointer if not NULL
Can be used to set up the worker function pointer earlier

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-24 20:46:05 +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 25dd8bdae3 mt76: mt7615: 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 17:18:37 +02:00
Felix Fietkau f9ce5c776c mt76: use ieee80211_rx_list to pass frames to the network stack as a batch
Improves icache footprint

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-22 16:00:28 +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 87a6942906 mt76: add utility functions for deferring work to a kernel thread
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.

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 55d79ab7fa mt76: dma: update q->queued immediately on cleanup
With threaded NAPI support it becomes more likely that tx cleanup and tx
enqueuing will run in parallel. In order to avoid queue starvation issues
under load, update q->queued immediately.

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 888990e159 mt76: use threaded NAPI
With threaded NAPI, the rx handler function is no longer bound to the CPU that
fired the interrupt, which significantly helps to spread the workload over
multiple CPUs, especially when multiple devices are using threaded NAPI at the
same time.

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-22 15:56:52 +02:00
Felix Fietkau b54157df7c mt7615: update firmware to version 20200814
Signed-off-by: Felix Fietkau <[email protected]>
2020-08-22 12:17:15 +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
Felix Fietkau 2767051432 mt76: mt7615: use v1 MCU API on MT7615 to fix issues with adding/removing stations
The implementation of embedding WTBL update inside the STA_REC update is buggy
on the MT7615 v2 firmware. This leads to connection issues after a station has
connected and disconnected again.

Switch to the v1 MCU API ops, since they have received much more testing and
should be more stable.

On MT7622 and later, the v2 API is more actively used, so we should keep using
it as well.

Fixes: 6849e29ed92e ("mt76: mt7615: add starec operating flow for firmware v2")
Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2020-08-12 12:19:40 +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
Felix Fietkau 335cd51be4 mt76: mt7915: simplify aggregation session check
Use the txwi data as primary source information to avoid touching skb data
Use bitfield instead of state variable + spinlock

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-11 12:13:34 +02:00
Felix Fietkau ad90170b0a mt76: mt7615: remove mtxq->agg_ssn assignment
It is not used anywhere for this driver

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-11 12:13:34 +02:00
Felix Fietkau 9816f9812a mt76: move mt76_check_agg_ssn to driver tx_prepare calls
mt7615 and newer drivers do not need this, since they use sequence number offload
Moving this code also reduces the number of callsites to make it easier to review

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-11 12:13:34 +02:00
Felix Fietkau fa69dd96f9 mt76: mt7915: enable offloading of sequence number assignment
Preparation for supporting more offload features

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-11 12:13:34 +02:00
Felix Fietkau 9ab20dfbf7 mt76: mt7915: increase tx retry count
Set it to 15 to match reference driver

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-11 12:13:34 +02:00
Felix Fietkau 5e0c587b9a mt76: mt7915: clean up station stats polling and rate control update
Queueing a per-sta work item from the tx free path can become very expensive
under load. This work is only supposed to pull rate control stats every
second and deal with rate control changes.

Additionally, the rate control update code was wrong, because it was
confusing bit masks and bit numbers in test_bit.

Fix this by introducing a dedicated device work item for rate control
updates, and by polling station stats from the phy mac work.
Stations requiring polling or rate control updates are added to lists
protected by dev->sta_poll_lock.

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-10 11:00:17 +02:00
Felix Fietkau 1eb94624bb mt76: mt7915: do not do any work in napi poll after calling napi_complete_done()
Fixes a race condition where multiple tx cleanup or sta poll tasks could run
in parallel.

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-08 09:32:03 +02:00
Felix Fietkau f2e71f0c1b mt76: mt7615: do not do any work in napi poll after calling napi_complete_done()
Fixes a race condition where multiple tx cleanup tasks could run in parallel

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-08 09:30:27 +02:00
Felix Fietkau 5ea8b6187d mt76: mt76x02: clean up and fix interrupt masking in the irq handler
Only clear unmasked interrupts. If an interrupt is temporarily masked,
its pending events need to be processed later, even if another interrupt
happened in the mean time.
Disable interrupts in one call before scheduling

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-07 22:10:43 +02:00
Felix Fietkau 2fbd6baac1 mt76: mt7615: only clear unmasked interrupts in irq tasklet
If an interrupt is temporarily masked, its pending events need to be processed
later, even if another interrupt happened in the mean time.

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-07 22:09:58 +02:00
Felix Fietkau 06f722d804 mt76: mt7915: clean up and fix interrupt masking in the irq handler
Only clear unmasked interrupts. If an interrupt is temporarily masked,
its pending events need to be processed later, even if another interrupt
happened in the mean time.

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-07 22:07:50 +02:00
Felix Fietkau 58774b605f mt76: set interrupt mask register to 0 before requesting irq
Avoids spurious interrupts in case the hardware was running already

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-07 21:56:37 +02:00
Felix Fietkau 825343467d mt76: fix double DMA unmap of the first buffer on 7615/7915
A small part of the first skb buffer is passed to the firmware for parsing
via DMA, while the full buffer is passed as part of the TXP.

Avoid calling DMA unmap on the first part (with a different length than map)

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-05 11:31:29 +02:00
Felix Fietkau 8d9a62e4de mt76: mt7915: fix crash on tx rate report for invalid stations
Check wcid RCU pointer before using it

Signed-off-by: Felix Fietkau <[email protected]>
2020-07-24 16:14:42 +02:00
Felix Fietkau b5df0fbb18 mt7615: update firmware to version 20200629
Signed-off-by: Felix Fietkau <[email protected]>
2020-07-22 11:15:14 +02:00
Felix Fietkau 632ce698e8 mt76: mt7615: fix antenna settings for test mode
Signed-off-by: Felix Fietkau <[email protected]>
2020-07-21 18:43:15 +02:00
Felix Fietkau 1eb8b7d689 mt76: testmode: fix tx_done accounting on enqueue failures
Signed-off-by: Felix Fietkau <[email protected]>
2020-07-21 13:21:04 +02:00
Felix Fietkau 6838d002f9 mt76: mt7615: fix tx_frames setup
Properly set up the state when entering the tx_frames state

Signed-off-by: Felix Fietkau <[email protected]>
2020-07-14 18:48:07 +02:00
Felix Fietkau 1641aa2016 mt76: mt7615: fix mt7615_mcu_set_test_param set non-bool parameters
Fixes testmode freq_offset

Signed-off-by: Felix Fietkau <[email protected]>
2020-07-14 18:17:34 +02:00
Felix Fietkau f9a7a2f7db testmode: fix setting tx_power
Signed-off-by: Felix Fietkau <[email protected]>
2020-07-14 18:09:31 +02:00
Felix Fietkau 750797b61b mt76: fix copy&paste error in mt76_testmode_cmd
Signed-off-by: Felix Fietkau <[email protected]>
2020-07-13 09:17:24 +02:00
Felix Fietkau 6789a2db72 mt7615: fix getting wideband RSSI in test mode
Signed-off-by: Felix Fietkau <[email protected]>
2020-07-09 22:06:43 +02:00
Felix Fietkau 3ea5da1639 add utility for using testmode support
Signed-off-by: Felix Fietkau <[email protected]>
2020-06-22 21:32:26 +02:00
Felix Fietkau d7467bc018 mt76: mt7615: implement testmode support
Supports sending a configurable number of packets with a specific rate
and configurable tx power levels / antenna settings, as well as displaying
rx statistics.

Signed-off-by: Felix Fietkau <[email protected]>
2020-06-22 21:32:02 +02:00
Felix Fietkau 3a1ea7287e mt76: add API for testmode support
This can be used for calibration in the manufacturing process.
It supports sending a configurable number of packets with a specific rate
and configurable tx power levels / antenna settings.
It also supports receiving packets and showing some statistics, including
packet counters and detailed RSSI information.
It will only be compiled in if CONFIG_NL80211_TESTMODE is enabled

Signed-off-by: Felix Fietkau <[email protected]>
2020-06-22 21:31:02 +02:00
Felix Fietkau b1ddb8e35c mt76: vif_mask to struct mt76_phy
All drivers use this in pretty much the same way. Moving it to core helps with
some checks for the upcoming testmode support

Signed-off-by: Felix Fietkau <[email protected]>
2020-06-22 21:28:35 +02:00
Felix Fietkau 882cec4206 mt76: mt7615: use full on-chip memory address for WF_PHY registers
Now that the bus access functions can use mapping for accessing full
register addresses, use it for WF_PHY registers to keep them constant.
Needed for follow-up work on testmode support

Signed-off-by: Felix Fietkau <[email protected]>
2020-06-22 21:28:35 +02:00
Felix Fietkau 46bc8a0b53 mt76: mt7615: add support for accessing RF registers via MCU
Includes debugfs files for testing it.
Will be used for testmode support.

Signed-off-by: Felix Fietkau <[email protected]>
2020-06-22 21:28:35 +02:00
Felix Fietkau 72f3410724 mt76: mt7615: add support for accessing mapped registers via bus ops
Makes it possible to read/write them via debugfs, similar to mt7603

Signed-off-by: Felix Fietkau <[email protected]>
2020-06-22 21:28:35 +02:00
Felix Fietkau b5eee1b522 mt76: mt7615: schedule tx tasklet and sta poll on mac tx free
Unlike on earlier chips, DMA completion on MT7615 does not imply actually
having sent out any packets.
Since AQL will prevent filling the hardware queues and will only allow more
packets to be passed to the driver after tx completion, it makes much more
sense to schedule the tx tasklet there.
This is also needed for scheduling tx in testmode support

Signed-off-by: Felix Fietkau <[email protected]>
2020-06-22 21:28:35 +02:00