summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2020-07-03 10:15:45 +0200
committerFelix Fietkau <nbd@nbd.name>2020-07-21 19:01:16 +0200
commit940a0c63e0c3df5881ff4a034501638de01a63a9 (patch)
treee33d57dc661132e51843714c3222912e6bada725 /drivers/net/wireless/mediatek
parentea4906c4be4944f8341d500f83267d1ba3e8e838 (diff)
mt76: mt7615: wake device before configuring hw keys
Make sure the device is in full-power before uploading keys to the hw Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7615/main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
index 5f2c50a2449b..3c230479b36c 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
@@ -336,7 +336,7 @@ static int mt7615_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
struct mt7615_sta *msta = sta ? (struct mt7615_sta *)sta->drv_priv :
&mvif->sta;
struct mt76_wcid *wcid = &msta->wcid;
- int idx = key->keyidx;
+ int idx = key->keyidx, err;
/* The hardware does not support per-STA RX GTK, fallback
* to software mode for these.
@@ -366,6 +366,8 @@ static int mt7615_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
return -EOPNOTSUPP;
}
+ mt7615_mutex_acquire(dev);
+
if (cmd == SET_KEY) {
key->hw_key_idx = wcid->idx;
wcid->hw_key_idx = idx;
@@ -376,9 +378,13 @@ static int mt7615_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
cmd == SET_KEY ? key : NULL);
if (mt76_is_usb(&dev->mt76))
- return mt7615_queue_key_update(dev, cmd, msta, key);
+ err = mt7615_queue_key_update(dev, cmd, msta, key);
+ else
+ err = mt7615_mac_wtbl_set_key(dev, wcid, key, cmd);
- return mt7615_mac_wtbl_set_key(dev, wcid, key, cmd);
+ mt7615_mutex_release(dev);
+
+ return err;
}
static int mt7615_config(struct ieee80211_hw *hw, u32 changed)