mt76x2u: introduce mac workqueue support
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Mon, 15 Oct 2018 09:33:16 +0000 (11:33 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 30 Nov 2018 11:21:40 +0000 (12:21 +0100)
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>
drivers/net/wireless/mediatek/mt76/mt76x2/init.c
drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
drivers/net/wireless/mediatek/mt76/mt76x2/usb_main.c

index 3c73fdeaf30f5870e575f9782db35f8510393f18..04790f84d7d4ade02feaa74299a4c2bf849a9299 100644 (file)
@@ -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;
index 5b167aaaf7f7aadaa6369d61a6bea5f6fca97344..b15c97e1dfb3d7a27e6b5180f4cff99dd9736a80 100644 (file)
@@ -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);
 
index dfc80ecfde922121f9bf107cc66ab61c448a79ef..b2388f506505b5bcd816fa937c2d4cd8e9fd7de8 100644 (file)
@@ -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);
 }
 
index 1971a1b0003849e1f6510761ef7d4e15b0f9c3fd..25c43175e6e5575955da4aa48dfdf3f4a660959e 100644 (file)
@@ -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: