rt2x00: Fix for rt2800usb for SHARED_KEY_TABLE initializations
authorIvo van Doorn <ivdoorn@gmail.com>
Mon, 17 Aug 2009 16:53:57 +0000 (18:53 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 20 Aug 2009 15:36:00 +0000 (11:36 -0400)
Fixed comments about SHARED_KEY_TABLE_BASE and SHARED_KEY_MODE_BASE.
Fixed initialization loop for SHARED_KEY_MODE_ENTRY.

Based on a patch for rt2800pci from Benoit.

Signed-off-by: Benoit PAPILLAULT <benoit.papillault@free.fr>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2800usb.c
drivers/net/wireless/rt2x00/rt2800usb.h

index 3856f06fdca7a610b163ffe9d5da1307f7f2744e..c82474ebba3145a412a4b8afcca460b37182dc2f 100644 (file)
@@ -1463,6 +1463,10 @@ static int rt2800usb_init_registers(struct rt2x00_dev *rt2x00dev)
        /*
         * ASIC will keep garbage value after boot, clear encryption keys.
         */
+       for (i = 0; i < 4; i++)
+               rt2x00usb_register_write(rt2x00dev,
+                                        SHARED_KEY_MODE_ENTRY(i), 0);
+
        for (i = 0; i < 256; i++) {
                u32 wcid[2] = { 0xffffffff, 0x00ffffff };
                rt2x00usb_register_multiwrite(rt2x00dev, MAC_WCID_ENTRY(i),
@@ -1472,10 +1476,6 @@ static int rt2800usb_init_registers(struct rt2x00_dev *rt2x00dev)
                rt2x00usb_register_write(rt2x00dev, MAC_IVEIV_ENTRY(i), 0);
        }
 
-       for (i = 0; i < 16; i++)
-               rt2x00usb_register_write(rt2x00dev,
-                                        SHARED_KEY_MODE_ENTRY(i), 0);
-
        /*
         * Clear all beacons
         * For the Beacon base registers we only need to clear
index 2d9dc3783361af740164ef23a793ae2d3e7050de..a79a6d90eeac09901a577a07e6b2cc332c60524a 100644 (file)
  * PAIRWISE_KEY_TABLE_BASE: 32-byte * 256 entry
  * MAC_IVEIV_TABLE_BASE: 8-byte * 256-entry
  * MAC_WCID_ATTRIBUTE_BASE: 4-byte * 256-entry
- * SHARED_KEY_TABLE_BASE: 32-byte * 16-entry
- * SHARED_KEY_MODE_BASE: 4-byte * 16-entry
+ * SHARED_KEY_TABLE_BASE: 32 bytes * 32-entry
+ * SHARED_KEY_MODE_BASE: 4 bits * 32-entry
  */
 #define MAC_WCID_BASE                  0x1800
 #define PAIRWISE_KEY_TABLE_BASE                0x4000