diff options
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_init.c')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_init.c | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c index 71a4e664ad76..635c99022f06 100644 --- a/drivers/net/qlcnic/qlcnic_init.c +++ b/drivers/net/qlcnic/qlcnic_init.c | |||
@@ -520,17 +520,16 @@ qlcnic_setup_idc_param(struct qlcnic_adapter *adapter) { | |||
520 | int timeo; | 520 | int timeo; |
521 | u32 val; | 521 | u32 val; |
522 | 522 | ||
523 | val = QLCRD32(adapter, QLCNIC_CRB_DEV_PARTITION_INFO); | 523 | if (adapter->fw_hal_version == QLCNIC_FW_BASE) { |
524 | val = (val >> (adapter->portnum * 4)) & 0xf; | 524 | val = QLCRD32(adapter, QLCNIC_CRB_DEV_PARTITION_INFO); |
525 | 525 | val = QLC_DEV_GET_DRV(val, adapter->portnum); | |
526 | if ((val & 0x3) != 1) { | 526 | if ((val & 0x3) != QLCNIC_TYPE_NIC) { |
527 | dev_err(&adapter->pdev->dev, "Not an Ethernet NIC func=%u\n", | 527 | dev_err(&adapter->pdev->dev, |
528 | val); | 528 | "Not an Ethernet NIC func=%u\n", val); |
529 | return -EIO; | 529 | return -EIO; |
530 | } | ||
531 | adapter->physical_port = (val >> 2); | ||
530 | } | 532 | } |
531 | |||
532 | adapter->physical_port = (val >> 2); | ||
533 | |||
534 | if (qlcnic_rom_fast_read(adapter, QLCNIC_ROM_DEV_INIT_TIMEOUT, &timeo)) | 533 | if (qlcnic_rom_fast_read(adapter, QLCNIC_ROM_DEV_INIT_TIMEOUT, &timeo)) |
535 | timeo = 30; | 534 | timeo = 30; |
536 | 535 | ||
@@ -1701,3 +1700,24 @@ qlcnic_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring) | |||
1701 | sds_ring->consumer = consumer; | 1700 | sds_ring->consumer = consumer; |
1702 | writel(consumer, sds_ring->crb_sts_consumer); | 1701 | writel(consumer, sds_ring->crb_sts_consumer); |
1703 | } | 1702 | } |
1703 | |||
1704 | void | ||
1705 | qlcnic_fetch_mac(struct qlcnic_adapter *adapter, u32 off1, u32 off2, | ||
1706 | u8 alt_mac, u8 *mac) | ||
1707 | { | ||
1708 | u32 mac_low, mac_high; | ||
1709 | int i; | ||
1710 | |||
1711 | mac_low = QLCRD32(adapter, off1); | ||
1712 | mac_high = QLCRD32(adapter, off2); | ||
1713 | |||
1714 | if (alt_mac) { | ||
1715 | mac_low |= (mac_low >> 16) | (mac_high << 16); | ||
1716 | mac_high >>= 16; | ||
1717 | } | ||
1718 | |||
1719 | for (i = 0; i < 2; i++) | ||
1720 | mac[i] = (u8)(mac_high >> ((1 - i) * 8)); | ||
1721 | for (i = 2; i < 6; i++) | ||
1722 | mac[i] = (u8)(mac_low >> ((5 - i) * 8)); | ||
1723 | } | ||