Revert "wifi: mt76: mt76x02: remove WEP support

This reverts commit 40f6e433f7.

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2023-06-27 13:37:05 +02:00
parent 2f851902d6
commit f36b921692
+13
View File
@@ -413,9 +413,12 @@ int mt76x02_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
struct mt76x02_sta *msta;
struct mt76_wcid *wcid;
int idx = key->keyidx;
int ret;
/* fall back to sw encryption for unsupported ciphers */
switch (key->cipher) {
case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_WEP104:
case WLAN_CIPHER_SUITE_TKIP:
case WLAN_CIPHER_SUITE_CCMP:
break;
@@ -468,6 +471,16 @@ int mt76x02_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
}
mt76_wcid_key_setup(&dev->mt76, wcid, key);
if (!msta) {
if (key || wcid->hw_key_idx == idx) {
ret = mt76x02_mac_wcid_set_key(dev, wcid->idx, key);
if (ret)
return ret;
}
return mt76x02_mac_shared_key_setup(dev, mvif->idx, idx, key);
}
return mt76x02_mac_wcid_set_key(dev, msta->wcid.idx, key);
}
EXPORT_SYMBOL_GPL(mt76x02_set_key);