From patchwork Tue Mar 10 13:29:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Markowski X-Patchwork-Id: 5977901 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 8E2DF9F440 for ; Tue, 10 Mar 2015 13:29:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B2A5C2020F for ; Tue, 10 Mar 2015 13:29:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80A3520221 for ; Tue, 10 Mar 2015 13:29:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752900AbbCJN3V (ORCPT ); Tue, 10 Mar 2015 09:29:21 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:38528 "EHLO mail-lb0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752967AbbCJN3Q (ORCPT ); Tue, 10 Mar 2015 09:29:16 -0400 Received: by lbiz12 with SMTP id z12so1688623lbi.5 for ; Tue, 10 Mar 2015 06:29:14 -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=U5ObBrhuUynyc+tI6GEdP+06l8KlksZgkf169GrFicw=; b=s+l1+elcK8XvVycOOjXa11SJ1nIAQjNftk4wBxGy8h3A0OHv1NYMUi04ZjkSZx/Xgx ZJ0ESXgS1wc7Icsfo/Obxat1Q5/rSXO0Xy2O2AjYaThYMmk+S0r/g1UfJcpANtqH64f8 cefPgshIQ+oYZeLhASGVgVXuuebOeUeC8W8eg= 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=U5ObBrhuUynyc+tI6GEdP+06l8KlksZgkf169GrFicw=; b=bka578X+zn/o+X4ukZce6SOepOKqUj5E0nrBbRJYwGZvLisowuCxSipxOWzN0yp1Dr JtVoGwsG1p5/EsdFubGl55cnyncACNk2Ezf3VpnSFvnTkNjzdsdNsQNwSq2i8oBVOd1O gk5zgom6FIL68q4kIVB8YeK4fW3Sa/VzWLYx7uh/iS0ZA2CsfP9/TQbv64zJx5Hf8i8I py4/uvR7JeDibmnQReD+j54El3seqkq8s2+VWsALXCY5KL2FId2Pe4jGsCo8ymlcYi1f hMD4PvRAUJFJt1mwtGTKUSPt+v39IndE6ms+PjqmOnP7zssVQlkSrGsRf6bk3nAbycGQ iPEg== X-Gm-Message-State: ALoCoQkYwmoWdGMtcICKOv3KNvxeC4+lsdlbIroqDoqRZaTK9DM9NukjCvYeTWn1UpzrtLssF29wfI783q5dm8YIuCcRLF+Vp5YRke7nzqtONmmCwHNKdj07ZyZP7v4e/BCcUvm4zS7F X-Received: by 10.112.223.7 with SMTP id qq7mr30468168lbc.81.1425994154122; Tue, 10 Mar 2015 06:29:14 -0700 (PDT) Received: from uw000975.eu.tieto.com ([91.198.246.10]) by mx.google.com with ESMTPSA id w9sm121454laj.24.2015.03.10.06.29.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Mar 2015 06:29:13 -0700 (PDT) From: Bartosz Markowski To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Bartosz Markowski Subject: [PATCH] ath10k: fix PMG by using AES-CMAC/IGTK software crypto Date: Tue, 10 Mar 2015 14:29:05 +0100 Message-Id: <1425994145-15574-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..2264c06361b1 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;