As already done for pcie code in commit 79d1c94c9c78 ("mt76: avoid
queue/status spinlocks while passing tx status to mac80211") make sure
that no tx related spinlocks are taken during the ieee80211_tx_status call
Signed-off-by: Lorenzo Bianconi <[email protected]>
Grab mt76_dev mutex in mt76x02_mac_work handler since it runs
concurrently with mt76x{0,2}_set_channel routines
Signed-off-by: Lorenzo Bianconi <[email protected]>
Reconfigure properly MT_MAC_SYS_CTRL register after mac sw-reset
in mt76x02_check_mac_err routine
Fixes: 73556561ab9f ("mt76x0: use mt76x02_mac_work as stats handler")
Signed-off-by: Lorenzo Bianconi <[email protected]>
MODULE_FIRMWARE() is used in usb_mcu.c and provided by linux/module.h,
but this header file is not directly included. This causes problems in
backports with some kernel versions.
Add the missing include.
Signed-off-by: Hauke Mehrtens <[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]>
Remove napi from mt76_dma_rx_fill routine signature since
it is a leftover of a previous implementation and it is no
longer used
Signed-off-by: Lorenzo Bianconi <[email protected]>
Some mt7603e chip has empty efuse data.
In this case driver will crash due to dereferencing NULL pointer.
The mt7603_eeprom_load will return success directly if the chip has no efuse
data and dev->mt76.otp.data is left empty, i.e. NULL pointer.
The mt7603_eeprom_init will then try to dereference dev->mt76.otp.data
without checking its value.
This patch adds a check around these codes to prevent kernel panic.
Signed-off-by: Weijie Gao <[email protected]>
Sometimes during startup, the MCU response time can be quite long,
especially in newer versions. This change prevents false timeout errors
Signed-off-by: Felix Fietkau <[email protected]>
Ported from the reference driver.
Should fix compliance with ETSI rules on preventing transmission while
energy detect values are above the threshold.
Relax rules for non-ETSI regdomains
Signed-off-by: Felix Fietkau <[email protected]>
It is not necessary to time the start of the queue in software, the hardware
already does that for us.
Move all processing into the pre-tbtt tasklet to get rid of a race condition
that could happen when the pre-tbtt tasklet takes too long
Signed-off-by: Felix Fietkau <[email protected]>
Use PSE registers to loop back any pending tx packets for a client that
just went to sleep back into the MCU rx queue.
Re-queue those packets to the tx queue immediately after a client wakes up.
Signed-off-by: Felix Fietkau <[email protected]>
This makes it easier to loop powersave-filtered packets through the MCU queue
without involving the firmware
Signed-off-by: Felix Fietkau <[email protected]>
Starting from mac80211 commit adf8ed01e4fd ("mac80211: add an optional
TXQ for other PS-buffered frames") and commit 0eeb2b674f05 ("mac80211:
add an option for station management TXQ") a new per-sta queue has been
introduced for bufferable management frames.
sta->txq[IEEE80211_NUM_TIDS] is initialized just if the driver reports
the following hw flags:
- IEEE80211_HW_STA_MMPDU_TXQ
- IEEE80211_HW_BUFF_MMPDU_TXQ
This can produce a NULL pointer dereference in mt76_stop_tx_queues
since mt76 iterates on all available sta tx queues assuming they are
initialized by mac80211. This issue has been spotted analyzing the code
(it has not triggered any crash yet)
Signed-off-by: Lorenzo Bianconi <[email protected]>