From patchwork Thu Sep 8 12:36:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivo van Doorn X-Patchwork-Id: 1129512 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p88CdUIm026435 for ; Thu, 8 Sep 2011 12:39:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932645Ab1IHMjb (ORCPT ); Thu, 8 Sep 2011 08:39:31 -0400 Received: from mail-ew0-f46.google.com ([209.85.215.46]:38572 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932607Ab1IHMja (ORCPT ); Thu, 8 Sep 2011 08:39:30 -0400 Received: by mail-ew0-f46.google.com with SMTP id 4so268175ewy.19 for ; Thu, 08 Sep 2011 05:39:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=Q8rCuIj+FmdfxJordi7h/h26f6i8FbZT4ATRrBc8AVM=; b=rykGGt2mz6aDUzz2vzWKwc8YaqaApZ51x7btWXCRypupRnz/XawG2argossofEoBpL D1AmI8tQZi39uhqW+W+Y4t96txW12vkoCM/3q+mBtXcA8XZ5BsO1/x1647P1F44BY6jz 3faLSCBhkRNrZImy9n3KJR96kErokTJNJaD6A= Received: by 10.14.14.209 with SMTP id d57mr209082eed.76.1315485569532; Thu, 08 Sep 2011 05:39:29 -0700 (PDT) Received: from localhost.localdomain (g121037.upc-g.chello.nl [80.57.121.37]) by mx.google.com with ESMTPS id d12sm6401406eeb.8.2011.09.08.05.39.28 (version=SSLv3 cipher=OTHER); Thu, 08 Sep 2011 05:39:28 -0700 (PDT) From: Ivo van Doorn To: "John W. Linville" Subject: [PATCH 3/7] rt2x00: Add WCID to crypto struct Date: Thu, 8 Sep 2011 14:36:45 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.x86_64; KDE/4.4.5; x86_64; ; ) Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com References: <201109081434.23635.IvDoorn@gmail.com> <201109081436.05113.IvDoorn@gmail.com> In-Reply-To: <201109081436.05113.IvDoorn@gmail.com> MIME-Version: 1.0 Message-Id: <201109081436.46401.IvDoorn@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 08 Sep 2011 12:39:42 +0000 (UTC) From: Helmut Schaa When a WCID was already assigned to a STA the key configuration functions need to use the same WCID for configuring the keys. Hence, add the WCID to the crypo configuration structure. Signed-off-by: Helmut Schaa Signed-off-by: Ivo van Doorn --- drivers/net/wireless/rt2x00/rt2x00.h | 2 ++ drivers/net/wireless/rt2x00/rt2x00mac.c | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 2093a55..c360ab3 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h @@ -478,6 +478,8 @@ struct rt2x00lib_crypto { u8 key[16]; u8 tx_mic[8]; u8 rx_mic[8]; + + int wcid; }; /* diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index 3cd70ff..4d82d53 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c @@ -494,6 +494,7 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, struct rt2x00lib_crypto crypto; static const u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; + struct rt2x00_sta *sta_priv = NULL; if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) return 0; @@ -511,9 +512,11 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, crypto.cmd = cmd; - if (sta) + if (sta) { crypto.address = sta->addr; - else + sta_priv = sta_to_rt2x00_sta(sta); + crypto.wcid = sta_priv->wcid; + } else crypto.address = bcast_addr; if (crypto.cipher == CIPHER_TKIP)