Skip to content

Commit

Permalink
mt76: mt76u: rename stat_wq in wq
Browse files Browse the repository at this point in the history
Rename usb stat_wq in wq in order to be reused not just for gathering hw
tx statistics

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed Feb 14, 2020
1 parent c6a0253 commit dfc24bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mt76.h
Expand Up @@ -400,7 +400,7 @@ struct mt76_usb {
u16 data_len;

struct tasklet_struct rx_tasklet;
struct workqueue_struct *stat_wq;
struct workqueue_struct *wq;
struct work_struct stat_work;

u8 out_ep[__MT_EP_OUT_MAX];
Expand Down
14 changes: 7 additions & 7 deletions usb.c
Expand Up @@ -852,7 +852,7 @@ static void mt76u_tx_tasklet(unsigned long data)

if (dev->drv->tx_status_data &&
!test_and_set_bit(MT76_READING_STATS, &dev->phy.state))
queue_work(dev->usb.stat_wq, &dev->usb.stat_work);
queue_work(dev->usb.wq, &dev->usb.stat_work);
if (wake)
ieee80211_wake_queue(dev->hw, i);
}
Expand All @@ -878,7 +878,7 @@ static void mt76u_tx_status_data(struct work_struct *work)
}

if (count && test_bit(MT76_STATE_RUNNING, &dev->phy.state))
queue_work(usb->stat_wq, &usb->stat_work);
queue_work(usb->wq, &usb->stat_work);
else
clear_bit(MT76_READING_STATS, &dev->phy.state);
}
Expand Down Expand Up @@ -1132,9 +1132,9 @@ static const struct mt76_queue_ops usb_queue_ops = {

void mt76u_deinit(struct mt76_dev *dev)
{
if (dev->usb.stat_wq) {
destroy_workqueue(dev->usb.stat_wq);
dev->usb.stat_wq = NULL;
if (dev->usb.wq) {
destroy_workqueue(dev->usb.wq);
dev->usb.wq = NULL;
}
}
EXPORT_SYMBOL_GPL(mt76u_deinit);
Expand All @@ -1160,8 +1160,8 @@ int mt76u_init(struct mt76_dev *dev,
tasklet_init(&dev->tx_tasklet, mt76u_tx_tasklet, (unsigned long)dev);
INIT_WORK(&usb->stat_work, mt76u_tx_status_data);

usb->stat_wq = alloc_workqueue("mt76u", WQ_UNBOUND, 0);
if (!usb->stat_wq)
usb->wq = alloc_workqueue("mt76u", WQ_UNBOUND, 0);
if (!usb->wq)
return -ENOMEM;

usb->data_len = usb_maxpacket(udev, usb_sndctrlpipe(udev, 0), 1);
Expand Down

0 comments on commit dfc24bc

Please sign in to comment.