From patchwork Tue Mar 10 13:32:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Markowski X-Patchwork-Id: 5977931 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F0C699F399 for ; Tue, 10 Mar 2015 13:32:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D7BF201D3 for ; Tue, 10 Mar 2015 13:32:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 544A6200E0 for ; Tue, 10 Mar 2015 13:32:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YVKHB-0000E9-PP; Tue, 10 Mar 2015 13:32:49 +0000 Received: from mail-la0-x22c.google.com ([2a00:1450:4010:c03::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YVKHA-0000Cj-8I for ath10k@lists.infradead.org; Tue, 10 Mar 2015 13:32:48 +0000 Received: by labmn12 with SMTP id mn12so1664862lab.8 for ; Tue, 10 Mar 2015 06:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=AwzSWdxlUUKXd2o1CHDk4gNBmbGgael9ecIrtBZcK6g=; b=qjmskLBSRzp+BXpe2D4mj/s8Qh855I/faH0gOChOC1NcDGrJ2XIUif4iPFMF8TsHFv umkCK8MGuUXUfcmdp05BfW2psqvDkDQGSoqSCuOqqN+Olj6+cwedPda61tfZK4av/LFd j19hATwKPGv2dlUA8FBdPyaASj1/07zIBwYl4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AwzSWdxlUUKXd2o1CHDk4gNBmbGgael9ecIrtBZcK6g=; b=bamLKn8eLZ5tPyMOXXNO4wqJR+KGWsdID6o2GUtRW9otMfyh0F6sFDFcxONx6n1M8M BWWeV0S8prI+XBEQZF1SF0XRxvhkkQVeLrmIPoXXLXNqxwr8f1Woyx+/98cfhtwncXhq CmG+i9kByx6ijhf66+cl+XHUCyja+aXDP2Wpv30t+vHZKSoqvUq/4kEydXKGrG0d9vde lP0wgfhXGF4XysQJ9KE1Sdeqi8ZOWCF3oUe5v1W1so10y2I4+cabvZip8SDtp8crlHzl 8tcDZH8cQcFKsIIhIDBZk6wtwQVDAI/lSU/NmWVfjnGb700oDiAvLzofp4SMorMK2TrI LDhw== X-Gm-Message-State: ALoCoQnrfz5gXHhEkt8po2u1Pohl7sJvogDdgos1/xMo4+e3cZ63mI/3y7FV1mS4vlrqrR782d5if1jJMC7FJkslCenmhNpvslzcONbVgv5rWTD5s421ZbMW/NqNQw+le5ztDexGxTdr15BoMd+fdvpk2/KjrKOc6ciJ4Gogo9B8K+dF/RQD5uaX7jA9w1C4X6cW1ErKH2pD X-Received: by 10.152.163.67 with SMTP id yg3mr20582110lab.42.1425994345787; Tue, 10 Mar 2015 06:32:25 -0700 (PDT) Received: from uw000975.eu.tieto.com ([91.198.246.10]) by mx.google.com with ESMTPSA id rv1sm122578lbb.25.2015.03.10.06.32.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Mar 2015 06:32:24 -0700 (PDT) From: Bartosz Markowski To: ath10k@lists.infradead.org Subject: [PATCH v2] ath10k: fix PMG by using AES-CMAC/IGTK software crypto Date: Tue, 10 Mar 2015 14:32:19 +0100 Message-Id: <1425994339-15864-1-git-send-email-bartosz.markowski@tieto.com> X-Mailer: git-send-email 2.1.2 X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150310_063248_476216_8F84F437 X-CRM114-Status: GOOD ( 10.70 ) X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Bartosz Markowski X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP While testing with older supplicant, .drv_set_key() was failing due to higher than ath10k firmware could handle key_index (WMI_MAX_KEY_INDEX == 3). --- wpa_driver_nl80211_set_key: ifindex=15 alg=4 addr=0x7f02b129fbe3 key_idx=4 set_tx=0 seq_len=6 key_len=16 broadcast key nl80211: set_key failed; err=-22 Invalid argument) wlan0: WPA: Failed to configure IGTK to the driver wlan0: RSN: Failed to configure IGTK -- In order to fix this case (PMF: AES-CMAC/IGTK) force the AES_CMAC cipher to be handled by software. Signed-off-by: Bartosz Markowski --- drivers/net/wireless/ath/ath10k/mac.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 1138f4f8923f..5a3129010951 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -66,8 +66,8 @@ static int ath10k_send_key(struct ath10k_vif *arvif, arg.key_cipher = WMI_CIPHER_WEP; break; case WLAN_CIPHER_SUITE_AES_CMAC: - /* this one needs to be done in software */ - return 1; + WARN_ON(1); + return -EINVAL; default: ath10k_warn(ar, "cipher %d is not supported\n", key->cipher); return -EOPNOTSUPP; @@ -3995,6 +3995,10 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, int ret = 0; u32 flags = 0; + /* this one needs to be done in software */ + if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC) + return 1; + if (key->keyidx > WMI_MAX_KEY_INDEX) return -ENOSPC;