Routine keymac_write in bcm43xx has two TODO statements that generate lots of
useless log output for early chip versions. This patch replaces them with code
to store the keys.

Signed-off-by: Larry Finger <[EMAIL PROTECTED]>
---

Michael,

Is this correct? The whole business of words versus bytes in shared memory
is very confusing.

Larry

---------

 bcm43xx.h      |    1 +
 bcm43xx_main.c |   21 +++++++++++++++++----
 2 files changed, 18 insertions(+), 4 deletions(-)

Index: wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx.h
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx.h
+++ wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx.h
@@ -156,6 +156,7 @@
 /* MacFilter offsets. */
 #define BCM43xx_MACFILTER_SELF         0x0000
 #define BCM43xx_MACFILTER_ASSOC                0x0003
+#define BCM43xx_MACFILTER_MAC          0x0010
 
 /* Chipcommon registers. */
 #define BCM43xx_CHIPCOMMON_CAPABILITIES        0x04
Index: wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -378,6 +378,7 @@ static void bcm43xx_macfilter_clear(stru
        const u8 zero_addr[ETH_ALEN] = { 0 };
 
        bcm43xx_macfilter_set(bcm, offset, zero_addr);
+       bcm43xx_shm_write32(bcm, BCM43xx_SHM_SHARED, 0x003E, 0);
 }
 
 static void bcm43xx_write_mac_bssid_templates(struct bcm43xx_private *bcm)
@@ -1108,12 +1109,24 @@ static void keymac_write(struct bcm43xx_
                                    (index * 2) + 1,
                                    cpu_to_be16(*((u16 *)(addr + 1))));
        } else {
-               if (index < 8) {
-                       TODO(); /* Put them in the macaddress filter */
+               if (index < 4) {
+                       bcm43xx_macfilter_set(bcm, BCM43xx_MACFILTER_MAC +
+                                             index * 6, (const u8 *)addr);
                } else {
-                       TODO();
                        /* Put them BCM43xx_SHM_SHARED, stating index 0x0120.
-                          Keep in mind to update the count of keymacs in 
0x003E as well! */
+                          Update the count of keymacs in 0x003E as well */
+                       bcm43xx_shm_write32(bcm,
+                                           BCM43xx_SHM_SHARED,
+                                           (index - 4) * 6 + 0x120,
+                                           cpu_to_be32(*addr));
+                       bcm43xx_shm_write16(bcm,
+                                           BCM43xx_SHM_SHARED,
+                                           (index - 4) * 6 + 0x124,
+                                           cpu_to_be16(*((u16 *)(addr + 1))));
+                       bcm43xx_shm_write32(bcm,        /* update count */
+                                           BCM43xx_SHM_SHARED, 0x003E,
+                                           bcm43xx_shm_read32(bcm,
+                                           BCM43xx_SHM_SHARED, 0x003E) + 1);
                }
        }
 }
_______________________________________________
Bcm43xx-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev

Reply via email to