When low level drivers fail on startup, which usually happens upon an incorrect FW, they report to all the above stack a dev_id of the burning device ("livefish") and imitate such a device thereafter. It was done in order to allow to all the upper level drivers to start their work.
VSTAT shows in this case the dev_id of a "livefish", which is a bit misleading.
This patch fixes this behavior. VSTAT will now show the real dev_id. The drivers still imitate the "livefish" device. The detailed message about the startup failure can be found in System Event Log (as it always was).
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1424
ad392aa1-c5ef-ae45-8dd8-
e69d62a5ef86
\r
INCLUDES=..;..\inc;..\..\inc;..\core\$O;..\..\..\..\..\inc;..\..\..\..\..\inc\kernel;\r
\r
-C_DEFINES=$(C_DEFINES) -DDRIVER -DDEPRECATE_DDK_FUNCTIONS -D__LITTLE_ENDIAN -DUSE_WDM_INTERRUPTS\r
+C_DEFINES=$(C_DEFINES) -DDRIVER -DDEPRECATE_DDK_FUNCTIONS -D__LITTLE_ENDIAN -DUSE_WDM_INTERRUPTS \r
#-DFORCE_LIVEFISH\r
\r
TARGETLIBS= \\r
err:
/* we failed device initialization - try to simulate "livefish" device to facilitate using FW burning tools */
- pdev->dev_id = DEVID_HERMON_BD;
- id = mlx4_find_pci_dev(pdev->ven_id, pdev->dev_id);
+ id = mlx4_find_pci_dev(pdev->ven_id, DEVID_HERMON_BD);
if (id == NULL) {
err = -ENOSYS;
goto end;
}\r
goto err_insuff_mem;\r
}\r
+ RtlZeroMemory(p_ca_attr, required_size);\r
\r
// Space is sufficient - setup table pointers\r
last_p = (uint8_t*)p_ca_attr;\r
}\r
goto err_insuff_mem;\r
}\r
+ RtlZeroMemory(p_ca_attr, required_size);\r
\r
// Space is sufficient - setup table pointers\r
last_p = (uint8_t*)p_ca_attr;\r
}
/* find the type of device */
-find_pci_dev:
p_id = mthca_find_pci_dev(
(unsigned)ext->hcaConfig.VendorID,
(unsigned)ext->hcaConfig.DeviceID);
goto end;
}
+run_as_livefish:
/* allocate mdev structure */
mdev = kzalloc(sizeof *mdev, GFP_KERNEL);
if (!mdev) {
kfree(mdev);
/* we failed device initialization - try to simulate "livefish" device to facilitate using FW burning tools */
- if (ext->hcaConfig.DeviceID == PCI_DEVICE_ID_MELLANOX_ARBEL)
- ext->hcaConfig.DeviceID = PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT;
- ext->hcaConfig.DeviceID += 1; /* generate appropriate "livefish" DevId */
- goto find_pci_dev;
+ {
+ USHORT dev_id = ext->hcaConfig.DeviceID;
+
+ if (dev_id == PCI_DEVICE_ID_MELLANOX_ARBEL)
+ dev_id = PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT;
+ p_id = mthca_find_pci_dev( (unsigned)ext->hcaConfig.VendorID, dev_id + 1 );
+ if (p_id == NULL) {
+ status = STATUS_NO_SUCH_DEVICE;
+ goto end;
+ }
+ goto run_as_livefish;
+ }
end:
return status;
int i;\r
\r
printf("\n\thca_idx=%d\n", idx);\r
- if (ca_attr->dev_id & 1)\r
- printf("\tATTENTION! \n\t The device is in 'Flash Recovery' mode, probably due to an incorrect firmware."\r
- "\n\t Use firmware tools to solve the problem.\n",idx);\r
- /*printf("\tpci_location={BUS=NA,DEV/FUNC=NA}\n");*/\r
print_uplink_info(ca_attr);\r
printf("\tvendor_id=0x%04x\n", ca_attr->vend_id);\r
printf("\tvendor_part_id=0x%04x\n", ca_attr->dev_id);\r
+\r
+ if (!ca_attr->num_ports) {\r
+ printf("\n\tATTENTION! \n\t The driver has reported zero physical ports. "\r
+ "\n\t It can be a result of incompatibility of user and kernel components."\r
+ "\n\t It can be also caused by a driver failure on startup. "\r
+ "\n\t Look into System Event Log for driver reports. "\r
+ "\n\t Use firmware tools to solve the problem (in second case)."\r
+ "\n\t The work with IB stack is impossible. \n");\r
+ return;\r
+ }\r
+ \r
printf("\thw_ver=0x%x\n", ca_attr->revision); //TODO: ???\r
if(ca_attr->vend_id == VEND_ID_MELLNOX || ca_attr->vend_id == VEND_ID_VOLTAIRE) {\r
printf("\tfw_ver=%d.%.2d.%.4d\n",\r