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: 5977921 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 3DF0D9F440 for ; Tue, 10 Mar 2015 13:32:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B3AB200E0 for ; Tue, 10 Mar 2015 13:32:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D57E20221 for ; Tue, 10 Mar 2015 13:32:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752277AbbCJNc2 (ORCPT ); Tue, 10 Mar 2015 09:32:28 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:39579 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752746AbbCJNc1 (ORCPT ); Tue, 10 Mar 2015 09:32:27 -0400 Received: by lbiw7 with SMTP id w7so1705067lbi.6 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=Ms/ix3DZ5D/1gXpCXJoCxx9ZD4e9995I73OtOvHl2P2D0mtxd4gvIQSR3/S16hAGOr i+AkP5gcrbqmq53SzO421Slincyr1jU94TcoYXtTNqqgXwmY9d3oMt6pipFfDjJZLTnI tDFzAUaLfz6C9GLXJ73JoQueY9WOg9wKx0rjLb2kXP68V56FOz59taBbrhBRJkWH3/aE bGlb/waUPH0sFUHCMSA6/5z4sBH5OpF+rae5t9ErRMuC/ilx/hdO2bsbXUM6bhfsayCz pq+or+EPAOHR96k2xOk+BOlBmRnbgGHHDPYo/u5n3OPm7OdI+AtTbZ7zt+po16cLAA9X jdaw== X-Gm-Message-State: ALoCoQmEe8zhMiax3uFCtP6TgkU1K8Yd3YEy01aZMgfFjlk/OtDj8sOiTzxmH4KVFgSBG908Bmi29mZG9xxKOXIOyGYYh9XlN552ouD4hkrUJajTi77buklRuEb+hu6lLEpA7Y2YHb7b 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 Cc: linux-wireless@vger.kernel.org, Bartosz Markowski 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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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;