From patchwork Mon Jul 9 10:20:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10514171 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 962E76032C for ; Mon, 9 Jul 2018 10:20:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8113128915 for ; Mon, 9 Jul 2018 10:20:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A04528A80; Mon, 9 Jul 2018 10:20:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BF3528915 for ; Mon, 9 Jul 2018 10:20:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932564AbeGIKUk (ORCPT ); Mon, 9 Jul 2018 06:20:40 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40777 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932415AbeGIKUj (ORCPT ); Mon, 9 Jul 2018 06:20:39 -0400 Received: by mail-wr1-f67.google.com with SMTP id t6-v6so10380484wrn.7 for ; Mon, 09 Jul 2018 03:20:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zj9S/nq7kiHXUOvZqSvLoBWc3igIBxL0fPsHFsLR6vE=; b=BHTMagWIuDAvqQLeVhKn8Wu3jxSw3tX9SpBN+JJmzWnaiq7yvHuVD8MsmKW7Z0F0fE p5TkqvCUdkzruEJViuPkonUrY5mV5I0K45TNVKPu5b39R1h6jalN/8hBsSjK468rcwIW b5euFNver9K2G5NtLaWtRVQix9fFZjJWTs0IE8mdarO2ELm/DYx5Dc2OqFDUDRoyoCNE /Wsibo3uBRyP/jjytGgbbuJdEMFHCQVh24L0unz2fOY6NpTnEkAYfB78Zi7bb/SzYf48 Kru60H4fBu959Af0NWI2AYEMVJ1k4/iRE5mQfDLlwOQ5GsyYM+NEFIATUua8OD2P+2UH 1iQA== X-Gm-Message-State: APt69E2k58G2okuTLgKM7fugVLzrz3LS/uiERCcz65fPw/Y6g5GzBTaL LCqmyWYJIYK/LcrCw3Ap9cW/pA== X-Google-Smtp-Source: AAOMgpfWgtOEePkN7VRCU6qyXL6WjmtMdtFN3vx15ZmprImjWYeaJD//nYtcLZ7aLQ9MkibrqD2o0Q== X-Received: by 2002:adf:8276:: with SMTP id 109-v6mr15016400wrb.127.1531131638755; Mon, 09 Jul 2018 03:20:38 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id k36-v6sm18764810wrk.93.2018.07.09.03.20.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jul 2018 03:20:38 -0700 (PDT) From: Lorenzo Bianconi To: kubakici@wp.pl Cc: linux-wireless@vger.kernel.org, dcaratti@redhat.com Subject: [PATCH 1/2] mt7601u: use sw encryption for hw unsupported ciphers Date: Mon, 9 Jul 2018 12:20:26 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fall back to software encryption for hw unsupported ciphers in order to enable 802.11w Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt7601u/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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;