From: Ivo van Doorn <ivdoorn@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
Subject: [PATCH 3/7] rt2x00: Add WCID to crypto struct
Date: Thu, 8 Sep 2011 14:36:45 +0200 [thread overview]
Message-ID: <201109081436.46401.IvDoorn@gmail.com> (raw)
In-Reply-To: <201109081436.05113.IvDoorn@gmail.com>
From: Helmut Schaa <helmut.schaa@googlemail.com>
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 <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
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)
--
1.7.3.4
next prev parent reply other threads:[~2011-09-08 12:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-08 12:34 [PATCH 1/7] rt2x00: Move bssidx calculation into its own function Ivo van Doorn
2011-09-08 12:36 ` [PATCH 2/7] rt2x00: Introduce sta_add/remove callbacks Ivo van Doorn
2011-09-08 12:36 ` Ivo van Doorn [this message]
2011-09-08 12:37 ` [PATCH 4/7] rt2x00: Add WCID to HT TX descriptor Ivo van Doorn
2011-09-08 12:38 ` [PATCH 5/7] rt2x00: Make use of sta_add/remove callbacks in rt2800 Ivo van Doorn
2011-09-08 12:38 ` [PATCH 6/7] rt2x00: Forbid aggregation for STAs not programmed into the hw Ivo van Doorn
2011-09-08 12:39 ` [PATCH 7/7] rt2x00: Use the available helper functions to initialize the WCID table Ivo van Doorn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201109081436.46401.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=users@rt2x00.serialmonkey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).