From 880611b041a16686cd016de450478ee02f0dc37b Mon Sep 17 00:00:00 2001 From: Lorenzo Bianconi Date: Wed, 28 Mar 2018 14:46:08 +0200 Subject: [PATCH] mt7603: main: fix warning in ieee80211_get_key_rx_seq() Fall back to software encryption for hw unsupported ciphers in order to fix the following warning in ieee80211_get_key_rx_seq routine: WARNING: CPU: 0 PID: 1546 at backports-2017-11-01/net/mac80211/key.c:1010 mt76_wcid_key_setup+0x6c/0x210 [mt76] CPU: 0 PID: 1546 Comm: hostapd Not tainted 4.9.87 #0 ... Call Trace: [<8000e220>] show_stack+0x70/0x8c [<80023a34>] __warn+0x110/0x118 [<80023ad0>] warn_slowpath_null+0x1c/0x2c [<871515c0>] mt76_wcid_key_setup+0x6c/0x210 [mt76] [<870a0c94>] 0x870a0c94 ---[ end trace 1a391bb242f6a068 ]--- Signed-off-by: Lorenzo Bianconi --- mt7603_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mt7603_main.c b/mt7603_main.c index 5af07e9ec..fe43c85fe 100644 --- a/mt7603_main.c +++ b/mt7603_main.c @@ -343,6 +343,17 @@ mt7603_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, struct mt76_wcid *wcid = msta ? &msta->wcid : &mvif->wcid; int idx = key->keyidx; + /* 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; + } + /* * The hardware does not support per-STA RX GTK, fall back * to software mode for these.