It needs to be unset instead of set
Fixes: 23405236460b9 ("mt76: fix transmission of encrypted management frames")
Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
Since ccmp_pn is u8 *, the second half needs to start at array index 4
instead of 0. Fixes a connection stall after a certain amount of traffic
Fixes: 23405236460b9 ("mt76: fix transmission of encrypted management frames")
Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
Set the per-chain signal value for chain 0 and simplify the code
(no need for a loop for just one extra chain)
Signed-off-by: Felix Fietkau <[email protected]>
Remove bogus check for MT_PACKET_ID_NO_ACK in mt76_tx_status_skb_get, which
is already handled in callers and turns timeout calls into no-ops
Do not clean up pending status items on reordering of tx status information
if the timeout is not reached yet
Signed-off-by: Felix Fietkau <[email protected]>
For some reason the BMC queue flush does not work properly if packets were
queued for a BSS0_n interface (secondary vif).
Work around this issue by using the DMA scheduler to filter the queue before
issueing the BMC queue flush.
Signed-off-by: Felix Fietkau <[email protected]>
Take into account device rx stream in mt76x02_mac_process_rate
in order to not report wrong number of rx spatial stream to mac80211.
The issue has been reported on mt76x0 device which is 1x1:1 however
the hw sometimes reports rx nss equal to 2
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Sync CCK values with reference driver.
Use OFDM values obtained from the hardware reset value
Stop tx/rx on change only using the ARB_SCR register
Signed-off-by: Felix Fietkau <[email protected]>
The hardware needs to be notified of peers using dynamic SMPS mode
Fixes using dual-stream rates on some clients (e.g. Intel)
Signed-off-by: Felix Fietkau <[email protected]>
Clear pending PSE request bit in order to avoid having it trigger by the
firmware at a bad point in time.
Only clear AC queue stuck bits if the PSE reset succeeded
Signed-off-by: Felix Fietkau <[email protected]>
The hardware cannot report accurate tx A-MPDU length information, so tell rate
control to ignore it. Improves tx rate selection
Signed-off-by: Felix Fietkau <[email protected]>
The hardware does not deal with multiple WCID entries for the same station
properly. Set IEEE80211_HW_NEEDS_UNIQUE_STA_ADDR to avoid those cases
Signed-off-by: Felix Fietkau <[email protected]>
Reporting A-MPDU length from txs does not work, because only completed
subframes are reported. Trying to aggregate tx status report for one
completed A-MPDU does not work, because individual subframe retries can
be different.
Do not report A-MPDU length > 1 and pass individual subframe tx status
information to mac80211 to fix rate control errors
Signed-off-by: Felix Fietkau <[email protected]>
Move mt76x02 led support in mt76x02-lib module in order to
add tpt led trigger to mt76x0e driver
Tested-by: LGA1150 <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
When CONFIG_LEDS_CLASS is disabled, or it is a loadable module while
mt76 is built-in, we run into a link error:
drivers/net/wireless/mediatek/mt76/mac80211.o: In function `mt76_register_device':
mac80211.c:(.text+0xb78): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `devm_of_led_classdev_register'
We don't really need a hard dependency here as the driver can presumably
work just fine without LEDs, so this follows the iwlwifi example and
adds a separate Kconfig option for the LED support, this will be available
whenever it will link, and otherwise the respective code gets left out from
the driver object.
Fixes: 17f1de56df05 ("mt76: add common code shared between multiple chipsets")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Use proper name for __MT76x02_H macro in mt76x02.h
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
The generic EWMA code cannot deal with negative numbers, so convert signal
to a positive number before adding it
Fixes mt76x2 AGC tuning
Signed-off-by: Felix Fietkau <[email protected]>
This reverts commit f2ba65f73f
This firmware update has been reported to cause regressions on some devices
Signed-off-by: Felix Fietkau <[email protected]>
On MT76x2, the hardware does not report tx status in the FIFO register,
if the packet id is 0.
Change the allocation of packet IDs to use 0 for no-ack packets, 1 for
non-probing packets and 2-255 for packets with tx status requested.
Fixes rate control issues
Signed-off-by: Felix Fietkau <[email protected]>
Call mt76_dma_add_buf routine directly in mt76_dma_tx_queue_skb
and avoid indirect call if not necessary
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Don't populate the const array 'data' on the stack but instead
make it static. Makes the object code smaller by 78 bytes:
Before:
text data bss dec hex filename
5438 1080 0 6518 1976 mediatek/mt76/mt76x2/usb_mcu.o
After:
text data bss dec hex filename
5296 1144 0 6440 1928 mediatek/mt76/mt76x2/usb_mcu.o
(gcc version 8.2.0 x86_64)
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Each rate retry slot takes up MT7603_RATE_RETRY tries, and cannot be altered
based on mac80211 provided rate retry counts.
Signed-off-by: Felix Fietkau <[email protected]>
The second chain value is 0 if the second chain is disabled, which
would make the reported signal strength 0 as well.
Signed-off-by: Felix Fietkau <[email protected]>
Port mt76x02_check_tx_hang watchdog from vendor driver in order to
perform a device reset when tx mac/dma logic hangs. Tx mac/dma stuck
has been observed when the device is heavy loaded or in a noisy
environment. Moreover introduce wdt delayed work in order to run
tx_hang watchdog. For the moment run mt76x02_check_tx_hang watchdog
just on mt76x2 devices since the issue has not been observed on mt76x0
driver yet
Signed-off-by: Lorenzo Bianconi <[email protected]>
Precompute data length in order to avoid to allocate the related
skb data structure if reported length does not fit in queue buf_size
Signed-off-by: Lorenzo Bianconi <[email protected]>