mt76_for_each_q_rx(dev, i) {
struct mt76_queue *q = &dev->q_rx[i];
- if (!q->ndesc)
- continue;
-
queued = mt76_is_usb(dev) ? q->ndesc - q->queued : q->queued;
seq_printf(s, "%d: queued=%d head=%d tail=%d\n",
i, queued, q->head, q->tail);
static void mt76u_rx_tasklet(unsigned long data)
{
struct mt76_dev *dev = (struct mt76_dev *)data;
- struct mt76_queue *q;
int i;
rcu_read_lock();
- for (i = 0; i < __MT_RXQ_MAX; i++) {
- q = &dev->q_rx[i];
- if (!q->ndesc)
- continue;
-
- mt76u_process_rx_queue(dev, q);
- }
+ mt76_for_each_q_rx(dev, i)
+ mt76u_process_rx_queue(dev, &dev->q_rx[i]);
rcu_read_unlock();
}
static void mt76u_free_rx(struct mt76_dev *dev)
{
- struct mt76_queue *q;
int i;
- for (i = 0; i < __MT_RXQ_MAX; i++) {
- q = &dev->q_rx[i];
- if (!q->ndesc)
- continue;
-
- mt76u_free_rx_queue(dev, q);
- }
+ mt76_for_each_q_rx(dev, i)
+ mt76u_free_rx_queue(dev, &dev->q_rx[i]);
}
void mt76u_stop_rx(struct mt76_dev *dev)
{
- struct mt76_queue *q;
- int i, j;
+ int i;
- for (i = 0; i < __MT_RXQ_MAX; i++) {
- q = &dev->q_rx[i];
- if (!q->ndesc)
- continue;
+ mt76_for_each_q_rx(dev, i) {
+ struct mt76_queue *q = &dev->q_rx[i];
+ int j;
for (j = 0; j < q->ndesc; j++)
usb_poison_urb(q->entry[j].urb);
int mt76u_resume_rx(struct mt76_dev *dev)
{
- struct mt76_queue *q;
- int i, j, err;
-
- for (i = 0; i < __MT_RXQ_MAX; i++) {
- q = &dev->q_rx[i];
+ int i;
- if (!q->ndesc)
- continue;
+ mt76_for_each_q_rx(dev, i) {
+ struct mt76_queue *q = &dev->q_rx[i];
+ int err, j;
for (j = 0; j < q->ndesc; j++)
usb_unpoison_urb(q->entry[j].urb);