Skip to content

Commit

Permalink
mt76x2u: introduce mac workqueue support
Browse files Browse the repository at this point in the history
Add mac workqueue support to mt76x2u driver in order
to compute device statistics and add mac stuck routine

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
Lorenzo Bianconi authored and Felix Fietkau committed Nov 30, 2018
1 parent 7355656 commit 70289ad
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions drivers/net/wireless/mediatek/mt76/mt76x2/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ void mt76x2_init_device(struct mt76x02_dev *dev)
{
struct ieee80211_hw *hw = mt76_hw(dev);

INIT_DELAYED_WORK(&dev->mac_work, mt76x02_mac_work);

hw->queues = 4;
hw->max_rates = 1;
hw->max_report_rates = 7;
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ int mt76x2_register_device(struct mt76x02_dev *dev)
int i, ret;

INIT_DELAYED_WORK(&dev->cal_work, mt76x2_phy_calibrate);
INIT_DELAYED_WORK(&dev->mac_work, mt76x02_mac_work);

mt76x2_init_device(dev);

Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ void mt76x2u_stop_hw(struct mt76x02_dev *dev)
{
mt76u_stop_stat_wk(&dev->mt76);
cancel_delayed_work_sync(&dev->cal_work);
cancel_delayed_work_sync(&dev->mac_work);
mt76x2u_mac_stop(dev);
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/mediatek/mt76/mt76x2/usb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ static int mt76x2u_start(struct ieee80211_hw *hw)
if (ret)
goto out;

ieee80211_queue_delayed_work(mt76_hw(dev), &dev->mac_work,
MT_CALIBRATE_INTERVAL);
set_bit(MT76_STATE_RUNNING, &dev->mt76.state);

out:
Expand Down

0 comments on commit 70289ad

Please sign in to comment.