diff mbox

[1/2] mt7601u: use sw encryption for hw unsupported ciphers

Message ID ad9cbcd50cdde4ff997a5ce69265f741114e9af0.1531130155.git.lorenzo.bianconi@redhat.com (mailing list archive)
State Accepted
Commit 03d677c50ad7da146571504f25260da61f4158ad
Delegated to: Kalle Valo
Headers show

Commit Message

Lorenzo Bianconi July 9, 2018, 10:20 a.m. UTC
Fall back to software encryption for hw unsupported ciphers in order
to enable 802.11w

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
---
 drivers/net/wireless/mediatek/mt7601u/main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Kalle Valo July 30, 2018, 2:31 p.m. UTC | #1
Lorenzo Bianconi <lorenzo.bianconi@redhat.com> wrote:

> Fall back to software encryption for hw unsupported ciphers in order
> to enable 802.11w
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

2 patches applied to wireless-drivers-next.git, thanks.

03d677c50ad7 mt7601u: use sw encryption for hw unsupported ciphers
53c2cb8df327 mt7601u: expose 802.11w support
diff mbox

Patch

diff --git a/drivers/net/wireless/mediatek/mt7601u/main.c b/drivers/net/wireless/mediatek/mt7601u/main.c
index 7b21016012c3..0f1789020960 100644
--- a/drivers/net/wireless/mediatek/mt7601u/main.c
+++ b/drivers/net/wireless/mediatek/mt7601u/main.c
@@ -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;