Commit b3a24649 authored by Sucheta Chakraborty's avatar Sucheta Chakraborty Committed by David S. Miller

qlcnic: check device class

pci-func class can be other than ethernet in Qlogic CNA device.
Signed-off-by: default avatarSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: default avatarAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 96f8118c
...@@ -1037,7 +1037,7 @@ int qlcnic_need_fw_reset(struct qlcnic_adapter *adapter); ...@@ -1037,7 +1037,7 @@ int qlcnic_need_fw_reset(struct qlcnic_adapter *adapter);
void qlcnic_request_firmware(struct qlcnic_adapter *adapter); void qlcnic_request_firmware(struct qlcnic_adapter *adapter);
void qlcnic_release_firmware(struct qlcnic_adapter *adapter); void qlcnic_release_firmware(struct qlcnic_adapter *adapter);
int qlcnic_pinit_from_rom(struct qlcnic_adapter *adapter); int qlcnic_pinit_from_rom(struct qlcnic_adapter *adapter);
void qlcnic_setup_idc_param(struct qlcnic_adapter *adapter); int qlcnic_setup_idc_param(struct qlcnic_adapter *adapter);
int qlcnic_rom_fast_read(struct qlcnic_adapter *adapter, int addr, int *valp); int qlcnic_rom_fast_read(struct qlcnic_adapter *adapter, int addr, int *valp);
int qlcnic_rom_fast_read_words(struct qlcnic_adapter *adapter, int addr, int qlcnic_rom_fast_read_words(struct qlcnic_adapter *adapter, int addr,
......
...@@ -514,10 +514,22 @@ int qlcnic_pinit_from_rom(struct qlcnic_adapter *adapter) ...@@ -514,10 +514,22 @@ int qlcnic_pinit_from_rom(struct qlcnic_adapter *adapter)
return 0; return 0;
} }
void int
qlcnic_setup_idc_param(struct qlcnic_adapter *adapter) { qlcnic_setup_idc_param(struct qlcnic_adapter *adapter) {
int timeo; int timeo;
u32 val;
val = QLCRD32(adapter, QLCNIC_CRB_DEV_PARTITION_INFO);
val = (val >> (adapter->portnum * 4)) & 0xf;
if ((val & 0x3) != 1) {
dev_err(&adapter->pdev->dev, "Not an Ethernet NIC func=%u\n",
val);
return -EIO;
}
adapter->physical_port = (val >> 2);
if (qlcnic_rom_fast_read(adapter, QLCNIC_ROM_DEV_INIT_TIMEOUT, &timeo)) if (qlcnic_rom_fast_read(adapter, QLCNIC_ROM_DEV_INIT_TIMEOUT, &timeo))
timeo = 30; timeo = 30;
...@@ -528,6 +540,8 @@ qlcnic_setup_idc_param(struct qlcnic_adapter *adapter) { ...@@ -528,6 +540,8 @@ qlcnic_setup_idc_param(struct qlcnic_adapter *adapter) {
timeo = 10; timeo = 10;
adapter->reset_ack_timeo = timeo; adapter->reset_ack_timeo = timeo;
return 0;
} }
static int static int
......
...@@ -1080,17 +1080,13 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1080,17 +1080,13 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_iounmap; goto err_out_iounmap;
} }
qlcnic_setup_idc_param(adapter); if (qlcnic_setup_idc_param(adapter))
goto err_out_iounmap;
err = qlcnic_start_firmware(adapter); err = qlcnic_start_firmware(adapter);
if (err) if (err)
goto err_out_decr_ref; goto err_out_decr_ref;
/*
* See if the firmware gave us a virtual-physical port mapping.
*/
adapter->physical_port = adapter->portnum;
qlcnic_clear_stats(adapter); qlcnic_clear_stats(adapter);
qlcnic_setup_intr(adapter); qlcnic_setup_intr(adapter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment