rt2x00: Add WCID to crypto struct
authorHelmut Schaa <helmut.schaa@googlemail.com>
Thu, 8 Sep 2011 12:36:45 +0000 (14:36 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 14 Sep 2011 17:56:55 +0000 (13:56 -0400)
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00mac.c

index 3b71d792bbf597ad144e29050acc063765258ff1..cbf8eb334e96126fa0ec591a7ab8f0a95a33bcdb 100644 (file)
@@ -478,6 +478,8 @@ struct rt2x00lib_crypto {
        u8 key[16];
        u8 tx_mic[8];
        u8 rx_mic[8];
+
+       int wcid;
 };
 
 /*
index 6a03f93e92ac94299120d1c7e0cdb4fe221b8f17..cef1c878c37ede1775f00278cc0cc58b0bb68bdc 100644 (file)
@@ -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)