diff mbox series

[12/42] mt76x0: mark device as running in mt76x0_start

Message ID 1536225538-16454-13-git-send-email-sgruszka@redhat.com (mailing list archive)
State New, archived
Headers show
Series mt76 patches 2018-09-06 | expand

Commit Message

Stanislaw Gruszka Sept. 6, 2018, 9:18 a.m. UTC
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

Set MT76_STATE_RUNNING flag in mt76x0_start routine and
clear it in mt76x0_stop one

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/mediatek/mt76/mt76x0/main.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/main.c b/drivers/net/wireless/mediatek/mt76/mt76x0/main.c
index a14f03b1ac54..3ac8e36d1c24 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/main.c
@@ -33,6 +33,9 @@  static int mt76x0_start(struct ieee80211_hw *hw)
 				     MT_CALIBRATE_INTERVAL);
 	ieee80211_queue_delayed_work(dev->mt76.hw, &dev->cal_work,
 				     MT_CALIBRATE_INTERVAL);
+
+	set_bit(MT76_STATE_RUNNING, &dev->mt76.state);
+
 out:
 	mutex_unlock(&dev->mt76.mutex);
 	return ret;
@@ -44,6 +47,8 @@  static void mt76x0_stop(struct ieee80211_hw *hw)
 
 	mutex_lock(&dev->mt76.mutex);
 
+	clear_bit(MT76_STATE_RUNNING, &dev->mt76.state);
+
 	cancel_delayed_work_sync(&dev->cal_work);
 	cancel_delayed_work_sync(&dev->mac_work);
 	mt76x0_mac_stop(dev);