From patchwork Fri Nov 29 15:09:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Markowski X-Patchwork-Id: 3258791 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 82CE7BEEAD for ; Fri, 29 Nov 2013 15:09:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2CDF20686 for ; Fri, 29 Nov 2013 15:09:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F71920685 for ; Fri, 29 Nov 2013 15:09:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753191Ab3K2PJd (ORCPT ); Fri, 29 Nov 2013 10:09:33 -0500 Received: from ebb06.tieto.com ([131.207.168.38]:65274 "EHLO ebb06.tieto.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718Ab3K2PJc (ORCPT ); Fri, 29 Nov 2013 10:09:32 -0500 X-AuditID: 83cfa826-b7f8f8e000003892-fc-5298ae2a856d Received: from FIVLA-EXHUB02.eu.tieto.com ( [131.207.136.42]) by ebb06.tieto.com (SMTP Mailer) with SMTP id 7C.11.14482.A2EA8925; Fri, 29 Nov 2013 17:09:30 +0200 (EET) Received: from uw000975.eu.tieto.com (10.28.19.241) by inbound.tieto.com (131.207.136.49) with Microsoft SMTP Server id 8.3.298.1; Fri, 29 Nov 2013 17:09:29 +0200 From: Bartosz Markowski To: CC: , Michal Kazior Subject: [PATCH] ath10k: fix multi BSSID with WPA on FW 10.1 Date: Fri, 29 Nov 2013 16:09:23 +0100 Message-ID: <1385737763-10481-1-git-send-email-bartosz.markowski@tieto.com> X-Mailer: git-send-email 1.7.10 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEIsWRmVeSWpSXmKPExsXSfL5DS1dr3Ywgg+67ShaPLh1jtniz4g67 xbetD9gcmD0+z7zL5rF5Sb3H501yAcxRXDYpqTmZZalF+nYJXBlNjw+zF+wTqmhd/5OxgfEH XxcjJ4eEgInE03197BC2mMSFe+vZuhi5OIQEVjJKXPp4jAnCWcYo0bHkCSNIFZuAqcT9DStY QWwRAQWJX5M+soHYzAK+Es+eLGMCsYUFbCQ2NtwHq2cRUJW4tucG2AZeAW+JlpvfmCG2yUs8 vd/HBhEXlDg58wkLxBwJiYMvXoDVCAloSMzZ+ZJlAiPfLCRls5CULWBkWsXIn5qUZGCmV5KZ WpKvl5yfu4kRHFQr1HYwPnsgdYhRgINRiYd3Rff0ICHWxLLiytxDjJIcTEqivAJrZwQJ8SXl p1RmJBZnxBeV5qQWH2KU4GBWEuHd2wSU401JrKxKLcqHSUlzsCiJ86ZOBEoJpCeWpGanphak FsFkZTg4lCR4F68BygoWpaanVqRl5pQgpJk4OEGG8wANZwNZzFtckJhbnJkOkT/FqCglzjsP pFkAJJFRmgfXC4v6V4ziQK8I87qAtPMAEwZc9yugwUxAg999nQYyuCQRISXVwJiWb7DM7cCH 8ykb/d10rOP7N2/mCa2d17gkyu1BRVsu++ll5rYeS1/JizkET1zW5ewXPU2F58if+LlKto7f bmZEvKlOaw9ae6Pnc3zpnh+RZau3t8upLdnpti3utrhPX+iHNa7aZ8JMbuTU7txvHGX+jD/i Tl7TjFOuBbznZ8zx/19Z2qF2RYmlOCPRUIu5qDgRAI/RwJXVAgAA 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Michal Kazior FW 10.1 seems to require the default key index to be updated to point to group key after it is installed. Otherwise Txed frames are corrupted. Tested-by: Tomasz Skapski Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index b70a3b2..20821e0 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -2717,6 +2717,44 @@ static void ath10k_cancel_hw_scan(struct ieee80211_hw *hw, mutex_unlock(&ar->conf_mutex); } +static void ath10k_set_key_h_def_keyidx(struct ath10k *ar, + struct ath10k_vif *arvif, + enum set_key_cmd cmd, + struct ieee80211_key_conf *key) +{ + u32 vdev_param = arvif->ar->wmi.vdev_param->def_keyid; + int ret; + + /* 10.1 firmware branch requires default key index to be set to group + * key index after installing it. Otherwise FW/HW Txes corrupted + * frames with multi-vif APs. This is not required for main firmware + * branch (e.g. 636). + * + * FIXME: This has been tested only in AP. It remains unknown if this + * is required for multi-vif STA interfaces on 10.1 */ + + if (arvif->vdev_type != WMI_VDEV_TYPE_AP) + return; + + if (key->cipher == WLAN_CIPHER_SUITE_WEP40) + return; + + if (key->cipher == WLAN_CIPHER_SUITE_WEP104) + return; + + if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) + return; + + if (cmd != SET_KEY) + return; + + ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, + key->keyidx); + if (ret) + ath10k_warn("failed to set group key as default key: %d\n", + ret); +} + static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct ieee80211_key_conf *key) @@ -2778,6 +2816,8 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, goto exit; } + ath10k_set_key_h_def_keyidx(ar, arvif, cmd, key); + spin_lock_bh(&ar->data_lock); peer = ath10k_peer_find(ar, arvif->vdev_id, peer_addr); if (peer && cmd == SET_KEY)