If there are still pending packets in the tx queue when removing a station,
it could possibly lead to a call to further attempts to pull packets from
the mac80211 tx queue after it has already been removed from the scheduling
list.
Prevent this from happening by calling synchronize_rcu after deleting the
wcid pointer before further cleaning up the tx queues.
To be extra careful, ensure that mtxq->list is always initialized properly.
Also drop the useless call to mt76x02_mac_wcid_setup, which only re-assigns
the bss index of the wcid entry, but does not help with the cleanup in any
way.
Signed-off-by: Felix Fietkau <[email protected]>
There is some code in the mac80211 tx status processing code that could
potentially call back into the tx codepath.
To avoid deadlocks, make sure that no tx related spinlocks are taken
during the ieee80211_tx_status call.
Signed-off-by: Felix Fietkau <[email protected]>
MT76x2/MT76x0 has somewhat unreliable tx status reporting, and for that
reason the driver currently does not report per-skb tx ack status at all.
This breaks things like client idle polling, which relies on the tx ack
status of a transmitted nullfunc frame.
This patch adds code to report skb-attached tx status if requested by
mac80211 or the rate control module. Since tx status is polled from a
simple FIFO register, the code needs to account for the possibility of
tx status events getting lost.
The code keeps a list of skbs for which tx status is required and passes
them to mac80211 once tx status has been filled in and the DMA queue is
done with it.
If a tx status event is not received after one second, the status rates
are cleared, and a succesful ACK is indicated to avoid spurious disassoc
during assoc or client polling.
Signed-off-by: Felix Fietkau <[email protected]>
ps-poll response frames can be sent via drv_tx. Store the frame sequence number
for such frames, in case a BlockAckReq needs to be sent
Signed-off-by: Felix Fietkau <[email protected]>
Use the same AC to hardware queue mappings for all subdrivers.
Note: this change BK and BE mappings for USB drivers.
Signed-off-by: Stanislaw Gruszka <[email protected]>
Add tx_queue_skb function pointer in mt76_bus_ops since mt76x2u based
devices do not map mt76x2_txwi on dma buffers and it is not possible
to reuse mt76_dma_tx_queue_skb() routine to enqueue tx frames to
hw buffers
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Move mt76_dma_tx_queue_skb routine in dma.c.
Remove static qualifier from mt76_get_txwi definition
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[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 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]>
Move device state check in mt76_txq_send_burst() in order to be more
reactive in stopping tx process during hw reset
Signed-off-by: Lorenzo Bianconi <[email protected]>
Use tx_info reference of last dequeued frame instead of the previous one
to compute 802.11 aggregate burst length
Signed-off-by: Lorenzo Bianconi <[email protected]>
Remove spurious semicolon resulting in ieee80211_sta_set_buffered()
being always called independent from the result of the expression
evaluated by the preceding if-clause.
Spotted by gcc-6 while attempting to build the driver outside of the
buildroot.
Signed-off-by: Daniel Golle <[email protected]>
Avoid to unnecessary call mt76_txq_schedule_list() if 4 (or more)
AGGR frames have been queued to the corresponding hw queue or
if the given hw queue is empty.
This patch let burst length to be more concentrated to max value
(i.e. 16) instead of 0
Signed-off-by: Lorenzo Bianconi <[email protected]>