diff options
author | Rajesh Borundia <rajesh.borundia@qlogic.com> | 2010-08-31 13:17:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-01 13:41:54 -0400 |
commit | da48e6c362d24d324f36a780d8566109e5f5a1d7 (patch) | |
tree | e135b5667ae6765abb3b6e4daaa06b0972a98b62 /drivers/net/qlcnic/qlcnic_main.c | |
parent | 2cffcdbf7670980d4d74e2daea8a6cc0729902b8 (diff) |
qlcnic: fix mac addr read
o Mac addr was read from flash for every fw reset
for Non-priviledge function.It should be read only once.
o Remove unnecessary get_mac_addr callback
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_main.c')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 771a160b88c..3f2f93b1a9f 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -322,7 +322,7 @@ qlcnic_read_mac_addr(struct qlcnic_adapter *adapter) | |||
322 | struct net_device *netdev = adapter->netdev; | 322 | struct net_device *netdev = adapter->netdev; |
323 | struct pci_dev *pdev = adapter->pdev; | 323 | struct pci_dev *pdev = adapter->pdev; |
324 | 324 | ||
325 | if (adapter->nic_ops->get_mac_addr(adapter, mac_addr) != 0) | 325 | if (qlcnic_get_mac_address(adapter, mac_addr) != 0) |
326 | return -EIO; | 326 | return -EIO; |
327 | 327 | ||
328 | memcpy(netdev->dev_addr, mac_addr, ETH_ALEN); | 328 | memcpy(netdev->dev_addr, mac_addr, ETH_ALEN); |
@@ -378,14 +378,12 @@ static const struct net_device_ops qlcnic_netdev_ops = { | |||
378 | }; | 378 | }; |
379 | 379 | ||
380 | static struct qlcnic_nic_template qlcnic_ops = { | 380 | static struct qlcnic_nic_template qlcnic_ops = { |
381 | .get_mac_addr = qlcnic_get_mac_address, | ||
382 | .config_bridged_mode = qlcnic_config_bridged_mode, | 381 | .config_bridged_mode = qlcnic_config_bridged_mode, |
383 | .config_led = qlcnic_config_led, | 382 | .config_led = qlcnic_config_led, |
384 | .start_firmware = qlcnic_start_firmware | 383 | .start_firmware = qlcnic_start_firmware |
385 | }; | 384 | }; |
386 | 385 | ||
387 | static struct qlcnic_nic_template qlcnic_vf_ops = { | 386 | static struct qlcnic_nic_template qlcnic_vf_ops = { |
388 | .get_mac_addr = qlcnic_get_mac_address, | ||
389 | .config_bridged_mode = qlcnicvf_config_bridged_mode, | 387 | .config_bridged_mode = qlcnicvf_config_bridged_mode, |
390 | .config_led = qlcnicvf_config_led, | 388 | .config_led = qlcnicvf_config_led, |
391 | .start_firmware = qlcnicvf_start_firmware | 389 | .start_firmware = qlcnicvf_start_firmware |
@@ -668,7 +666,6 @@ static void | |||
668 | qlcnic_check_options(struct qlcnic_adapter *adapter) | 666 | qlcnic_check_options(struct qlcnic_adapter *adapter) |
669 | { | 667 | { |
670 | u32 fw_major, fw_minor, fw_build; | 668 | u32 fw_major, fw_minor, fw_build; |
671 | char brd_name[QLCNIC_MAX_BOARD_NAME_LEN]; | ||
672 | struct pci_dev *pdev = adapter->pdev; | 669 | struct pci_dev *pdev = adapter->pdev; |
673 | struct qlcnic_info nic_info; | 670 | struct qlcnic_info nic_info; |
674 | 671 | ||
@@ -678,17 +675,6 @@ qlcnic_check_options(struct qlcnic_adapter *adapter) | |||
678 | 675 | ||
679 | adapter->fw_version = QLCNIC_VERSION_CODE(fw_major, fw_minor, fw_build); | 676 | adapter->fw_version = QLCNIC_VERSION_CODE(fw_major, fw_minor, fw_build); |
680 | 677 | ||
681 | if (!(adapter->flags & QLCNIC_ADAPTER_INITIALIZED)) | ||
682 | if (qlcnic_read_mac_addr(adapter)) | ||
683 | dev_warn(&pdev->dev, "failed to read mac addr\n"); | ||
684 | if (adapter->portnum == 0) { | ||
685 | get_brd_name(adapter, brd_name); | ||
686 | |||
687 | pr_info("%s: %s Board Chip rev 0x%x\n", | ||
688 | module_name(THIS_MODULE), | ||
689 | brd_name, adapter->ahw.revision_id); | ||
690 | } | ||
691 | |||
692 | dev_info(&pdev->dev, "firmware v%d.%d.%d\n", | 678 | dev_info(&pdev->dev, "firmware v%d.%d.%d\n", |
693 | fw_major, fw_minor, fw_build); | 679 | fw_major, fw_minor, fw_build); |
694 | 680 | ||
@@ -1468,6 +1454,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1468 | int err; | 1454 | int err; |
1469 | uint8_t revision_id; | 1455 | uint8_t revision_id; |
1470 | uint8_t pci_using_dac; | 1456 | uint8_t pci_using_dac; |
1457 | char brd_name[QLCNIC_MAX_BOARD_NAME_LEN]; | ||
1471 | 1458 | ||
1472 | err = pci_enable_device(pdev); | 1459 | err = pci_enable_device(pdev); |
1473 | if (err) | 1460 | if (err) |
@@ -1535,6 +1522,17 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1535 | goto err_out_decr_ref; | 1522 | goto err_out_decr_ref; |
1536 | } | 1523 | } |
1537 | 1524 | ||
1525 | if (qlcnic_read_mac_addr(adapter)) | ||
1526 | dev_warn(&pdev->dev, "failed to read mac addr\n"); | ||
1527 | |||
1528 | if (adapter->portnum == 0) { | ||
1529 | get_brd_name(adapter, brd_name); | ||
1530 | |||
1531 | pr_info("%s: %s Board Chip rev 0x%x\n", | ||
1532 | module_name(THIS_MODULE), | ||
1533 | brd_name, adapter->ahw.revision_id); | ||
1534 | } | ||
1535 | |||
1538 | qlcnic_clear_stats(adapter); | 1536 | qlcnic_clear_stats(adapter); |
1539 | 1537 | ||
1540 | qlcnic_setup_intr(adapter); | 1538 | qlcnic_setup_intr(adapter); |