Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fa907895b7b776208a1406efe5ba7ffe0f49f507
Commit:     fa907895b7b776208a1406efe5ba7ffe0f49f507
Parent:     7b33ed22194d8f0dbcf682f5cdf5b9c2ef551e7c
Author:     Matheos Worku <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 20 00:18:09 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Feb 20 00:18:09 2008 -0800

    [NIU]: More BMAC alt MAC address fixes.
    
    From: Matheos Worku <[EMAIL PROTECTED]>
    
    1) niu_enable_alt_mac() needs to be adjusted so that the mask
       is computed properly for the BMAC case.
    
    2) BMAC has 6 alt MAC addresses available, not 7.
    
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/niu.c |    9 +++++----
 drivers/net/niu.h |    2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index e98ce1e..d11ba61 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -1616,12 +1616,13 @@ static int niu_enable_alt_mac(struct niu *np, int 
index, int on)
        if (index >= niu_num_alt_addr(np))
                return -EINVAL;
 
-       if (np->flags & NIU_FLAGS_XMAC)
+       if (np->flags & NIU_FLAGS_XMAC) {
                reg = XMAC_ADDR_CMPEN;
-       else
+               mask = 1 << index;
+       } else {
                reg = BMAC_ADDR_CMPEN;
-
-       mask = 1 << index;
+               mask = 1 << (index + 1);
+       }
 
        val = nr64_mac(reg);
        if (on)
diff --git a/drivers/net/niu.h b/drivers/net/niu.h
index 0e8626a..59dc05f 100644
--- a/drivers/net/niu.h
+++ b/drivers/net/niu.h
@@ -499,7 +499,7 @@
 #define BMAC_ADDR2                     0x00110UL
 #define  BMAC_ADDR2_ADDR2              0x000000000000ffffULL
 
-#define BMAC_NUM_ALT_ADDR              7
+#define BMAC_NUM_ALT_ADDR              6
 
 #define BMAC_ALT_ADDR0(NUM)            (0x00118UL + (NUM)*0x18UL)
 #define  BMAC_ALT_ADDR0_ADDR0          0x000000000000ffffULL
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to