sh: convert /proc/cpu/aligmnent, /proc/cpu/kernel_alignment to seq_file
[safe/jmp/linux-2.6] / net / mac80211 / tkip.c
index 6998078..964b7fa 100644 (file)
@@ -13,6 +13,7 @@
 #include <asm/unaligned.h>
 
 #include <net/mac80211.h>
+#include "driver-ops.h"
 #include "key.h"
 #include "tkip.h"
 #include "wep.h"
@@ -164,7 +165,7 @@ void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf,
        iv16 = data[2] | (data[0] << 8);
        iv32 = get_unaligned_le32(&data[4]);
 
-       tk = &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY];
+       tk = &key->conf.key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY];
        ctx = &key->u.tkip.tx;
 
 #ifdef CONFIG_MAC80211_TKIP_DEBUG
@@ -205,7 +206,7 @@ void ieee80211_tkip_encrypt_data(struct crypto_blkcipher *tfm,
 {
        u8 rc4key[16];
        struct tkip_ctx *ctx = &key->u.tkip.tx;
-       const u8 *tk = &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY];
+       const u8 *tk = &key->conf.key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY];
 
        /* Calculate per-packet key */
        if (ctx->iv16 == 0 || !ctx->initialized)
@@ -231,7 +232,7 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
        u32 iv16;
        u8 rc4key[16], keyid, *pos = payload;
        int res;
-       const u8 *tk = &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY];
+       const u8 *tk = &key->conf.key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY];
 
        if (payload_len < 12)
                return -1;
@@ -263,10 +264,9 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
             (iv32 == key->u.tkip.rx[queue].iv32 &&
              iv16 <= key->u.tkip.rx[queue].iv16))) {
 #ifdef CONFIG_MAC80211_TKIP_DEBUG
-               DECLARE_MAC_BUF(mac);
                printk(KERN_DEBUG "TKIP replay detected for RX frame from "
-                      "%s (RX IV (%04x,%02x) <= prev. IV (%04x,%02x)\n",
-                      print_mac(mac, ta),
+                      "%pM (RX IV (%04x,%02x) <= prev. IV (%04x,%02x)\n",
+                      ta,
                       iv32, iv16, key->u.tkip.rx[queue].iv32,
                       key->u.tkip.rx[queue].iv16);
 #endif
@@ -286,13 +286,12 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
 #ifdef CONFIG_MAC80211_TKIP_DEBUG
                {
                        int i;
-                       DECLARE_MAC_BUF(mac);
-                       printk(KERN_DEBUG "TKIP decrypt: Phase1 TA=%s"
-                              " TK=", print_mac(mac, ta));
+                       u8 key_offset = NL80211_TKIP_DATA_OFFSET_ENCR_KEY;
+                       printk(KERN_DEBUG "TKIP decrypt: Phase1 TA=%pM"
+                              " TK=", ta);
                        for (i = 0; i < 16; i++)
                                printk("%02x ",
-                                      key->conf.key[
-                                               ALG_TKIP_TEMP_ENCR_KEY + i]);
+                                      key->conf.key[key_offset + i]);
                        printk("\n");
                        printk(KERN_DEBUG "TKIP decrypt: P1K=");
                        for (i = 0; i < 5; i++)
@@ -304,14 +303,13 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
                        key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
                        u8 bcast[ETH_ALEN] =
                                {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-                       u8 *sta_addr = key->sta->addr;
+                       u8 *sta_addr = key->sta->sta.addr;
 
                        if (is_multicast_ether_addr(ra))
                                sta_addr = bcast;
 
-                       key->local->ops->update_tkip_key(
-                               local_to_hw(key->local), &key->conf,
-                               sta_addr, iv32, key->u.tkip.rx[queue].p1k);
+                       drv_update_tkip_key(key->local, &key->conf, sta_addr,
+                                           iv32, key->u.tkip.rx[queue].p1k);
                }
        }