[SCSIPORT]

- Don't stop enumerating functions of a PCI device if current function returned invalid vendor id. Also add a check for returned data size. This fixes detection of some storage controllers, e.g. Intel ICH8, ICH9, ICH10 chipsets.
Thanks to Alter (UniATA author) for finding the problem and providing solution.
See issue #7147 for more details.

svn path=/trunk/; revision=56863
This commit is contained in:
Aleksey Bragin 2012-07-10 20:58:34 +00:00
parent 20d01189db
commit 35b6dde84e

View file

@ -2350,10 +2350,13 @@ SpiGetPciConfigData(IN PDRIVER_OBJECT DriverObject,
if (DataSize == 0)
return FALSE;
/* If result is PCI_INVALID_VENDORID, then this device has no more
"Functions" */
if (PciConfig.VendorID == PCI_INVALID_VENDORID)
break;
/* Check if result is PCI_INVALID_VENDORID or too small */
if ((DataSize < (ULONG)PCI_COMMON_HDR_LENGTH) ||
(PciConfig.VendorID == PCI_INVALID_VENDORID))
{
/* Continue to try the next function */
continue;
}
sprintf (VendorIdString, "%04hx", PciConfig.VendorID);
sprintf (DeviceIdString, "%04hx", PciConfig.DeviceID);