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.
return -EOPNOTSUPP;
}
+ mt7615_mutex_acquire(dev);
+
if (cmd == SET_KEY) {
key->hw_key_idx = wcid->idx;
wcid->hw_key_idx = idx;
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)