aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge/qlge_main.c
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2009-06-09 01:39:33 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-10 04:04:13 -0400
commit542512e4824c1cecc05478f279dccbde1d8bf97a (patch)
tree09731618c827d4d07414fcbb2cacb92caf7a7880 /drivers/net/qlge/qlge_main.c
parentec33a49135d96df56ef106a49c2434ca81f821f9 (diff)
qlge: Add support for using alternate MAC address.
Extract either manufacturer or Bladecenter Open Fabric Manager (BOFM) MAC address. BOFM may indicate an alternate MAC address. This patch honors that request by extracting the MAC address from a different flash location if a flag is set. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge/qlge_main.c')
-rw-r--r--drivers/net/qlge/qlge_main.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 738691ddcc04..d6517eb5bc1d 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -675,6 +675,7 @@ static int ql_get_8000_flash_params(struct ql_adapter *qdev)
675 int status; 675 int status;
676 __le32 *p = (__le32 *)&qdev->flash; 676 __le32 *p = (__le32 *)&qdev->flash;
677 u32 offset; 677 u32 offset;
678 u8 mac_addr[6];
678 679
679 /* Get flash offset for function and adjust 680 /* Get flash offset for function and adjust
680 * for dword access. 681 * for dword access.
@@ -705,14 +706,26 @@ static int ql_get_8000_flash_params(struct ql_adapter *qdev)
705 goto exit; 706 goto exit;
706 } 707 }
707 708
708 if (!is_valid_ether_addr(qdev->flash.flash_params_8000.mac_addr)) { 709 /* Extract either manufacturer or BOFM modified
710 * MAC address.
711 */
712 if (qdev->flash.flash_params_8000.data_type1 == 2)
713 memcpy(mac_addr,
714 qdev->flash.flash_params_8000.mac_addr1,
715 qdev->ndev->addr_len);
716 else
717 memcpy(mac_addr,
718 qdev->flash.flash_params_8000.mac_addr,
719 qdev->ndev->addr_len);
720
721 if (!is_valid_ether_addr(mac_addr)) {
709 QPRINTK(qdev, IFUP, ERR, "Invalid MAC address.\n"); 722 QPRINTK(qdev, IFUP, ERR, "Invalid MAC address.\n");
710 status = -EINVAL; 723 status = -EINVAL;
711 goto exit; 724 goto exit;
712 } 725 }
713 726
714 memcpy(qdev->ndev->dev_addr, 727 memcpy(qdev->ndev->dev_addr,
715 qdev->flash.flash_params_8000.mac_addr, 728 mac_addr,
716 qdev->ndev->addr_len); 729 qdev->ndev->addr_len);
717 730
718exit: 731exit: