Author: fireball
Date: Tue Jul 10 20:58:34 2012
New Revision: 56863
URL:
http://svn.reactos.org/svn/reactos?rev=56863&view=rev
Log:
[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.
Modified:
trunk/reactos/drivers/storage/scsiport/scsiport.c
Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport/s…
==============================================================================
--- trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] Tue Jul 10 20:58:34
2012
@@ -2350,10 +2350,13 @@
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);