The check within mt76_txq_send_burst is not enough, as it happens after
a first frame has already been queued up
Signed-off-by: Felix Fietkau <[email protected]>
- discard packets that have no rx group 3 (signal/rate info missing)
- discard packets marked as VHT (no hardware support)
- discard packets with invalid HT rate values
Signed-off-by: Felix Fietkau <[email protected]>
When doing rate probing, multiple frames might end up getting sent with
the probe rate, because of the way that rate probing is set up.
This race window is most visible with MCS rates and aggregation.
To improve rate control stats accuracy, pull the final tx rate from the
descriptor
Signed-off-by: Felix Fietkau <[email protected]>
Tx status reporting cannot account for the tx attempt starting at a rate
further down the chain, so without this flag it leads to inaccurate
results.
Signed-off-by: Felix Fietkau <[email protected]>
In some boards mpcie leds have reversed polarity.
This patch allow change led polarity from userspace.
Signed-off-by: Pawel Dembicki <[email protected]>
Fix mt76x2_temp_tx_alc_enabled routine since in order to enable tx_alc
temperature compensation it necessary to take into account BIT(15) of
MT_EE_TX_POWER_EXT_PA_5G eeprom info
Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Initialize default values for temperature compensation in TX_ALC_CFG_{1,2}
if tssi has been enabled
Signed-off-by: Lorenzo Bianconi <[email protected]>
Remove unnecessary MT_TX_ALC_CFG_4 configuration since the register value
will be properly set according to the usage of an external power amplifier
Signed-off-by: Lorenzo Bianconi <[email protected]>
Add static qualifier to mt76x2_mac_reset routine and remove the
prototype from mt76x2_mac.h since it is used just in mt76x2_init.c
Signed-off-by: Lorenzo Bianconi <[email protected]>
Fix mcu initial configuration for tssi calibration on 5GHz band
Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Fall back to software encryption for hw unsupported ciphers in order
to fix the following warning in ieee80211_get_key_rx_seq routine:
WARNING: CPU: 0 PID: 1546 at backports-2017-11-01/net/mac80211/key.c:1010
mt76_wcid_key_setup+0x6c/0x210 [mt76]
CPU: 0 PID: 1546 Comm: hostapd Not tainted 4.9.87 #0
...
Call Trace:
[<8000e220>] show_stack+0x70/0x8c
[<80023a34>] __warn+0x110/0x118
[<80023ad0>] warn_slowpath_null+0x1c/0x2c
[<871515c0>] mt76_wcid_key_setup+0x6c/0x210 [mt76]
[<870a0c94>] 0x870a0c94
---[ end trace 1a391bb242f6a068 ]---
Signed-off-by: Lorenzo Bianconi <[email protected]>
Add capability to select tx/rx antennas. Possible values are:
- 1: to use only the first antenna
- 2: to use only the second antenna
- 3: to use both of them
Signed-off-by: Lorenzo Bianconi <[email protected]>
Add mt76_init_stream_cap utility routine to set ht/vht sta capabilities
related to number of streams currently used by the device
(it will be used by mac80211 set_antenna callback)
Signed-off-by: Lorenzo Bianconi <[email protected]>
Initialize available_antennas related info in wiphy data structure
according to antenna_mask field; antenna_mask info is initialized
in device specific code and will be used in mac80211 {set,get}_antenna
callbacks
Signed-off-by: Lorenzo Bianconi <[email protected]>
Substitute unnecessary len variable in mt76x2_eeprom_load() with
MT7662_EEPROM_SIZE macro since len is used just to store eeprom
default size.
Signed-off-by: Lorenzo Bianconi <[email protected]>
Use mt76_poll_msec() in mt76pci_load_firmware to check if the firmware
has been started instead of explicitly poll MCU running register
Signed-off-by: Lorenzo Bianconi <[email protected]>
Fix a theoretical NULL pointer dereferencing in mt76x2_tx routine that
can occurs for injected frames in a monitor vif since vif pointer could
be NULL for that interfaces
Fixes: 23405236460b ("mt76: fix transmission of encrypted mgmt frames")
Signed-off-by: Lorenzo Bianconi <[email protected]>
There were a number of issues in the existing tx power handling code:
1. The EEPROM target power for chain 0 refers to the actual output power
after the channel and bandwidth delta have been added to the initial
channel gain. This means the delta values should not be added/subtracted
for the rate power calculation
2. When power is reduced significantly, the initial channel gain
underflows very quickly, while the per-rate power offsets are high.
This miscalculation causes effective tx power to be increased when it
should actually be lowered.
Fix this by trying to adjust the channel gain to the lowest power from
the rate table. In case of under- or overflow, compensate by adding an
appropriate delta to the rate power values.
This makes power configuration more accurate on a wider range of
configurable values
Signed-off-by: Felix Fietkau <[email protected]>
Allows the driver to control whether to send a BlockAckReq after waking
up. MT76x2 needs this set to true, for MT7603 it needs to be false
Signed-off-by: Felix Fietkau <[email protected]>
With software A-MPDU reordering in place, frames that notify mac80211 of
powersave changes are reordered as well, which can cause connection
stalls. Fix this by implementing powersave state processing in the
driver.
Signed-off-by: Felix Fietkau <[email protected]>
There is a possible race in mt76x2_stop_hardware() since pre_tbtt and
dfs tasklets could run during driver cleanup. Fix it disabling all
pending tasklets during device removal
Signed-off-by: Lorenzo Bianconi <[email protected]>
Apparently hardware does not perform CCMP PN validation in hardware, so
we need to take care of this in the driver.
Signed-off-by: Felix Fietkau <[email protected]>
Like beacons, probe responses need a hardware-generated TSF value. Set
the flag that causes the hw to generate it
Signed-off-by: Felix Fietkau <[email protected]>
Sending frames to mac80211 needs time, which could allow for more rx
packets to end up in the DMA ring. Retry polling until there are no more
frames left. Improves rx latency under load.
Signed-off-by: Felix Fietkau <[email protected]>
Fix hw queue configuration since mt76x2 devices use a reverse queue
enumeration respect to mac80211 one:
- 0: AC_BE
- 1: AC_BK
- 2: AC_VI
- 3: AC_VO
The issue can be reproduced sending two concurrent flow using
two separate queues:
- VO: 20Mbps UDP traffic
- BE: TCP traffic
In this scenario the UDP traffic will be blocked by the TCP one.
Fix it configuring properly WMM hw queue parameters
Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Tested-by: Gaetano Catalli <[email protected]>
Signed-off-by: Gaetano Catalli <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>