Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150788
b: refs/heads/master
c: 542512e
h: refs/heads/master
v: v3
  • Loading branch information
Ron Mercer authored and David S. Miller committed Jun 10, 2009
1 parent 08823d0 commit c69c1fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 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: ec33a49135d96df56ef106a49c2434ca81f821f9
refs/heads/master: 542512e4824c1cecc05478f279dccbde1d8bf97a
17 changes: 15 additions & 2 deletions trunk/drivers/net/qlge/qlge_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ static int ql_get_8000_flash_params(struct ql_adapter *qdev)
int status;
__le32 *p = (__le32 *)&qdev->flash;
u32 offset;
u8 mac_addr[6];

/* Get flash offset for function and adjust
* for dword access.
Expand Down Expand Up @@ -705,14 +706,26 @@ static int ql_get_8000_flash_params(struct ql_adapter *qdev)
goto exit;
}

if (!is_valid_ether_addr(qdev->flash.flash_params_8000.mac_addr)) {
/* Extract either manufacturer or BOFM modified
* MAC address.
*/
if (qdev->flash.flash_params_8000.data_type1 == 2)
memcpy(mac_addr,
qdev->flash.flash_params_8000.mac_addr1,
qdev->ndev->addr_len);
else
memcpy(mac_addr,
qdev->flash.flash_params_8000.mac_addr,
qdev->ndev->addr_len);

if (!is_valid_ether_addr(mac_addr)) {
QPRINTK(qdev, IFUP, ERR, "Invalid MAC address.\n");
status = -EINVAL;
goto exit;
}

memcpy(qdev->ndev->dev_addr,
qdev->flash.flash_params_8000.mac_addr,
mac_addr,
qdev->ndev->addr_len);

exit:
Expand Down

0 comments on commit c69c1fa

Please sign in to comment.