summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2019-07-01 15:04:39 +0200
committerFelix Fietkau <nbd@nbd.name>2019-09-05 17:42:28 +0200
commit4a926e302263946617a5dccdf065e872534b0b55 (patch)
tree3aa5a670a128b3aec28ca92f768804737d70be8c /drivers/net/wireless/mediatek/mt76
parent5abe8baf107eac8f1849408b353a792d5dd973ac (diff)
mt76: mt7615: fall back to sw encryption for unsupported ciphers
Fix following warning falling back to sw encryption for unsupported ciphers WARNING: CPU: 2 PID: 1495 at backports-4.19.32-1/net/mac80211/key.c:1023 mt76_wcid_key_setup+0x68/0xbc [mt76] CPU: 2 PID: 1495 Comm: hostapd Not tainted 4.14.131 #0 Stack : 00000000 8f0f8bc0 00000000 8007ccec 805f0000 8058ec18 00000000 00000000 80559788 8dca79bc 8fefb10c 805c89c7 805545c8 00000001 8dca7960 53261662 00000000 00000000 80640000 00004668 00000000 000000e9 00000007 00000000 00000000 805d0000 00072537 00000000 80000000 00000000 805f0000 8f1e70d0 8e8fa098 000003ff 805c0000 8f0f8bc0 00000001 802d4340 00000008 80630008 [<800108d0>] show_stack+0x58/0x100 [<8049214c>] dump_stack+0x9c/0xe0 [<80033998>] __warn+0xe0/0x138 [<80033a80>] warn_slowpath_null+0x1c/0x2c [<8e8fa098>] mt76_wcid_key_setup+0x68/0xbc [mt76] [<8e889930>] mt7615_eeprom_init+0x7c0/0xe14 [mt7615e] Suggested-by: Sebastian Gottschall <s.gottschall@newmedia-net.de> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7615/main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
index 1ee6dda579a8..8fefcfba83b1 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
@@ -178,6 +178,21 @@ static int mt7615_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE))
return -EOPNOTSUPP;
+ /* 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:
+ case WLAN_CIPHER_SUITE_CCMP_256:
+ case WLAN_CIPHER_SUITE_GCMP:
+ case WLAN_CIPHER_SUITE_GCMP_256:
+ case WLAN_CIPHER_SUITE_SMS4:
+ break;
+ default:
+ return -EOPNOTSUPP;
+ }
+
if (cmd == SET_KEY) {
key->hw_key_idx = wcid->idx;
wcid->hw_key_idx = idx;