Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332267
b: refs/heads/master
c: d21a771
h: refs/heads/master
i:
  332265: 6caa43c
  332263: 5ce6b90
v: v3
  • Loading branch information
Jonas Gorski authored and Ralf Baechle committed Oct 1, 2012
1 parent 68a8e8e commit e85253a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b3e06fdc68a06e68687da4eb009ff484bfab449
refs/heads/master: d21a7713464c7d35b2cce1fe7f7d87928d6a047e
16 changes: 9 additions & 7 deletions trunk/arch/mips/bcm63xx/boards/board_bcm963xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ const char *board_get_name(void)
*/
static int board_get_mac_address(u8 *mac)
{
u8 *p;
u8 *oui;
int count;

if (mac_addr_used >= nvram.mac_addr_count) {
Expand All @@ -729,21 +729,23 @@ static int board_get_mac_address(u8 *mac)
}

memcpy(mac, nvram.mac_addr_base, ETH_ALEN);
p = mac + ETH_ALEN - 1;
oui = mac + ETH_ALEN/2 - 1;
count = mac_addr_used;

while (count--) {
u8 *p = mac + ETH_ALEN - 1;

do {
(*p)++;
if (*p != 0)
break;
p--;
} while (p != mac);
}
} while (p != oui);

if (p == mac) {
printk(KERN_ERR PFX "unable to fetch mac address\n");
return -ENODEV;
if (p == oui) {
printk(KERN_ERR PFX "unable to fetch mac address\n");
return -ENODEV;
}
}

mac_addr_used++;
Expand Down

0 comments on commit e85253a

Please sign in to comment.