Skip to content

Commit

Permalink
[NIU]: More BMAC alt MAC address fixes.
Browse files Browse the repository at this point in the history
From: Matheos Worku <Matheos.Worku@Sun.COM>

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 <davem@davemloft.net>
  • Loading branch information
Matheos Worku authored and David S. Miller committed Feb 20, 2008
1 parent 7b33ed2 commit fa90789
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions drivers/net/niu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/niu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fa90789

Please sign in to comment.