]> xenbits.xensource.com Git - people/pauldu/xenbus.git/commitdiff
Add missing parameterization of vendor device
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 22 Oct 2015 11:24:41 +0000 (12:24 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Thu, 22 Oct 2015 11:24:41 +0000 (12:24 +0100)
The vendor device check in XENFILT was incorrectly hard-coded to C000 rather
than the prevailing vendor device id set at build time.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenfilt/pvdevice.c

index 04d8193289c84ab42a51f0266ac377c7bfec1312..179dc3d78cbda52bfde100e70f4d3ab82228e7b8 100644 (file)
@@ -72,6 +72,7 @@ __PvdeviceFree(
 static const CHAR *PvdeviceLegacyPrefix[] = {
     "PCI\\VEN_5853&DEV_0001",
     "PCI\\VEN_5853&DEV_0002",
+    NULL
 };
 
 static BOOLEAN
@@ -84,7 +85,7 @@ PvdeviceIsLegacy(
 
     UNREFERENCED_PARAMETER(Context);
 
-    for (Index = 0; Index < ARRAYSIZE(PvdeviceLegacyPrefix); Index++) {
+    for (Index = 0; PvdeviceLegacyPrefix[Index] != NULL; Index++) {
         const CHAR  *Prefix = PvdeviceLegacyPrefix[Index];
 
         if (_strnicmp(DeviceID, Prefix, strlen(Prefix)) == 0)
@@ -95,7 +96,10 @@ PvdeviceIsLegacy(
 }
 
 static const CHAR *PvdeviceVendorDeviceID[] = {
-    "PCI\\VEN_5853&DEV_C000&SUBSYS_C0005853&REV_01", // XenServer
+#ifdef VENDOR_DEVICE_ID_STR
+    "PCI\\VEN_5853&DEV_" VENDOR_DEVICE_ID_STR "&SUBSYS_C0005853&REV_01",
+#endif
+    NULL
 };
 
 static BOOLEAN
@@ -105,7 +109,7 @@ PvdeviceIsVendorPresent(
 {
     ULONG                           Index;
 
-    for (Index = 0; Index < ARRAYSIZE(PvdeviceVendorDeviceID); Index++) {
+    for (Index = 0; PvdeviceVendorDeviceID[Index] != NULL; Index++) {
         const CHAR  *DeviceID = PvdeviceVendorDeviceID[Index];
 
         if (XENFILT_EMULATED(IsDevicePresent,