From patchwork Mon Dec 2 08:06:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Markowski X-Patchwork-Id: 3264241 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4B57F9F373 for ; Mon, 2 Dec 2013 08:06:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C61D20295 for ; Mon, 2 Dec 2013 08:06:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E117020265 for ; Mon, 2 Dec 2013 08:06:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752199Ab3LBIGv (ORCPT ); Mon, 2 Dec 2013 03:06:51 -0500 Received: from mail-ea0-f177.google.com ([209.85.215.177]:59230 "EHLO mail-ea0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751049Ab3LBIGu (ORCPT ); Mon, 2 Dec 2013 03:06:50 -0500 Received: by mail-ea0-f177.google.com with SMTP id n15so8552339ead.36 for ; Mon, 02 Dec 2013 00:06:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=Uwx96TWdqVqHrtT0igAoBwEnvEjRfuTpBU+i9vAfKq0=; b=UcdugnJFbSJe1g7sXoPHyGViZzY2geAVTreHVWsg//MAWsaMHPJqG6x0XVe2puDcCb 23ZqHwbX04LpJmo+WHkqd1rKhXK2nWo84+Z9RUM7p5k7HSWQMQVKHuKUJZsl3XgH5IOW YKUW65/+gtMVsOHSE35mgmb5gTLFRJqjbhmbA= 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=Uwx96TWdqVqHrtT0igAoBwEnvEjRfuTpBU+i9vAfKq0=; b=jyhFk0dJR1/Lz7RER/L37XidfheL7mF1t3AkNYNtuyqgdXzQQIaT/nZmub91IB9IRa E1N09ehi3tSf2yUbvkbRfBeCE0O4+OBRYXjqTROEP43ZIMkaoVWGtWQdno7JXp9z0FgD jDr7+iz1JhpvZsC7i5CiobJl2OtQVMwWrDOyPuzyvrj+by7Br0VNhuTqv27CeJrZEC8U ShDqt2B4JG8soU2Ul9qV4jLfYIikrD5zt2Pf0DfmZvO0XQDeEeYdLnt7TUMSu5Y4KSlB lYKJzHn4ijjPLNs/XUTyMyW3W3D2EF8voAp9c1VOxW4CBmLRQrOsgVkgQPhXBUGFeDSm 0cZw== X-Gm-Message-State: ALoCoQmSTpzAhVLl0TByWSicADqGWn9FWbgjtElM23/ZX86EjFZvxvJmIHajLNy1UvEbLtCVvUJehpWk9zKn9U5pGsvVKiDgXKdktwtbQVnuQ6XE+2Ufn/c= X-Received: by 10.15.77.134 with SMTP id p6mr40559997eey.0.1385971609660; Mon, 02 Dec 2013 00:06:49 -0800 (PST) Received: from E4300.vivaldiego.wroclaw.pl (v22-98-181.vivaldiego.wroclaw.pl. [195.22.98.181]) by mx.google.com with ESMTPSA id 1sm68119155eeg.4.2013.12.02.00.06.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Dec 2013 00:06:49 -0800 (PST) From: Bartosz Markowski To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH v2] ath10k: fix multi BSSID with WPA on FW 10.1 Date: Mon, 2 Dec 2013 09:06:36 +0100 Message-Id: <1385971596-3575-1-git-send-email-bartosz.markowski@tieto.com> X-Mailer: git-send-email 1.7.9.5 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,RP_MATCHES_RCVD,T_DKIM_INVALID,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 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. 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..7d3d3ac 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)