mt7601u: use sw encryption for hw unsupported ciphers
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Mon, 9 Jul 2018 10:20:26 +0000 (12:20 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 30 Jul 2018 14:30:35 +0000 (17:30 +0300)
Fall back to software encryption for hw unsupported ciphers in order
to enable 802.11w

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mediatek/mt7601u/main.c

index 7b21016..0f17890 100644 (file)
@@ -308,6 +308,17 @@ mt7601u_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
        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;
+       default:
+               return -EOPNOTSUPP;
+       }
+
        if (cmd == SET_KEY) {
                key->hw_key_idx = wcid->idx;
                wcid->hw_key_idx = idx;