From patchwork Fri Mar 27 08:21:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 6104171 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 3902F9F350 for ; Fri, 27 Mar 2015 08:25:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6AE96203FB for ; Fri, 27 Mar 2015 08:25:24 +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 988F4203B8 for ; Fri, 27 Mar 2015 08:25:23 +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 1YbPZq-0006fN-5l; Fri, 27 Mar 2015 08:25:14 +0000 Received: from mail-la0-x236.google.com ([2a00:1450:4010:c03::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YbPZl-0005GL-6O for ath10k@lists.infradead.org; Fri, 27 Mar 2015 08:25:10 +0000 Received: by lagg8 with SMTP id g8so64690957lag.1 for ; Fri, 27 Mar 2015 01:24:42 -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=C3uFkJ2Wj9Zr8LyNN/LUXmCjj8QGsWoMIpYwk/OcEMw=; b=TXTf8FNgGteRYSYK2QQagSWdwrI0WlZyoqp43HlphYBUtkbHQVPEq625os1xCniMjw HfOI5mei08DrY+n+dR4vF+5Fj33Jjoc0IRaxLJung3M07+uUPyAo2vBOnAqGq/Yvq8BD dxKMhxBXc1YEYqsX8nXo9QN8JY4KYD4ePOsKg= 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=C3uFkJ2Wj9Zr8LyNN/LUXmCjj8QGsWoMIpYwk/OcEMw=; b=F8tI5xEY/HwYQMVHbPfD96jLXEdBoNT7raOZitm6EwQ8omO/UBwv8qHe6SFn39RWB5 DVZpgaM+sG2ZN5nU+HnXWEBVMp4F9ti9xjVhbgcnJG1rAje23E8mjlScUz7Q5P6V3MvR cG8aPt1JogkgnwIgt+I2fgcSw3cEYkHry/NgQiE46GbyN3SOB04WWywXnpQCjsacZX87 FN3aXUh4LF9dJiZ/igNjrQtJkc9ZcpvTmEwg6nQz9rO4WhD/0Gu+sqoatbluNiqigcOc PtIq6AvTj5s2Id4D1gbxlT/yizOlqpjxavpU7DP9J7zNPJU2HAOBiLyQjKbxtO81l/j4 t1pw== X-Gm-Message-State: ALoCoQmvxLL7R+IqNiP1RfA25v+9xRhqJSmhOxov4dmWhVtbpgBcBQ+AjLDOQyBY1PWUaoBi/N8blhZiT2Un1aMjh9vBaXltZFoXa4wCWwXdRz/iosl2heMD9qDOmH59mwVjviSBz0brxMOmsOOVIMg8UogmCG2fARRl0Hf78Y1u+SrcbTQy27Q= X-Received: by 10.112.64.2 with SMTP id k2mr17155839lbs.54.1427444681900; Fri, 27 Mar 2015 01:24:41 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id iy9sm218725lbc.8.2015.03.27.01.24.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Mar 2015 01:24:40 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH 1/2] ath10k: fix arvif->wep_keys clearing Date: Fri, 27 Mar 2015 08:21:55 +0000 Message-Id: <1427444516-974-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150327_012509_437757_5E032738 X-CRM114-Status: UNSURE ( 8.77 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior 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 The variable should be cleared regardless of whether there's a peer associated with the key or not. This fixes case when user first associates with 2 WEP keys and then disconnects and connects with 1 WEP key. This resulted in WEP key count being 2 in the driver leading to default keyidx fixup failure. Signed-off-by: Michal Kazior Tested-by: Bartosz Markowski --- drivers/net/wireless/ath/ath10k/mac.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 9b8313dcb888..9d873900257d 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4101,6 +4101,13 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, key->hw_key_idx = key->keyidx; + if (is_wep) { + if (cmd == SET_KEY) + arvif->wep_keys[key->keyidx] = key; + else + arvif->wep_keys[key->keyidx] = NULL; + } + /* the peer should not disappear in mid-way (unless FW goes awry) since * we already hold conf_mutex. we just make sure its there now. */ spin_lock_bh(&ar->data_lock); @@ -4126,11 +4133,6 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, flags |= WMI_KEY_GROUP; if (is_wep) { - if (cmd == SET_KEY) - arvif->wep_keys[key->keyidx] = key; - else - arvif->wep_keys[key->keyidx] = NULL; - if (cmd == DISABLE_KEY) ath10k_clear_vdev_key(arvif, key);