The range should only be limited to 4 for really weak signals, for all
other gain settings the range is 16.
Signed-off-by: Felix Fietkau <[email protected]>
usleep_range can cause excessive latency on channel change if waiting
for the MAC to stop fails. It will be forced to stop by the code
following that loop anyway.
Signed-off-by: Felix Fietkau <[email protected]>
During scans, mac80211 frequently switches back to the home channel to
minimize interruption of ongoing traffic. Keep regular tx queues active
during that time.
Signed-off-by: Felix Fietkau <[email protected]>
The beacon timer drifts by 1 microsecond every TBTT. After 20 minutes
with a beacon interval of 100, the drift will be almost 12 ms, enough to
cause weird issues for devices in powersave mode.
Since the beacon timer is configured in units of 1/16 TU (64 us), we
need to adjust it once every 64 beacons and only for one beacon.
Signed-off-by: Felix Fietkau <[email protected]>
If the radio was previously in running state, it can receive some
packets before it is able to process them.
This can lead to a crash if the channel is not initialized yet.
Discard all rx packets until start() is called
Signed-off-by: Felix Fietkau <[email protected]>
According to 802.11-2007 17.3.8.6 (slot time), the slot time should
be increased by 3 us * coverage class. Taking into account coverage
class in slot time configuration allows to increase by an order of
magnitude the throughput on a 4Km link in a noisy environment
Tested-by: Luca Bisti <[email protected]>
Tested-by: Gaetano Catalli <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
For encryption to work properly, the BSS index needs to be initialized
for the WCID entry used for the interface.
Signed-off-by: Felix Fietkau <[email protected]>
Add a usleep_range in mt76x2_mac_stop routine in order to add
a polling delay checking values of MT_MAC_STATUS and IBI_R12 registers
Signed-off-by: Lorenzo Bianconi <[email protected]>
Fix is_mt7612 routine since asic version is set in mt76_dev revision
field and not in mt76x2_dev one.
Moreover remove mt76x2_dev rev field since it is never used in the
driver
Fixes: 7bc04215a66b ('mt76: add driver code for MT76x2e')
Signed-off-by: Lorenzo Bianconi <[email protected]>
Add a spinlock in mt76_rx_complete. Without this, multiple stats updates
could happen in parallel, which can lead to deadlocks. There are
probably more corner cases fixed by this change.
Signed-off-by: Felix Fietkau <[email protected]>
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]>