libxl: fix wrong mask of function number
authorYang Zhang <yang.z.zhang@intel.com>
Thu, 2 Jun 2011 16:42:03 +0000 (17:42 +0100)
committerYang Zhang <yang.z.zhang@intel.com>
Thu, 2 Jun 2011 16:42:03 +0000 (17:42 +0100)
Function number is 3 bits. So the mask should be 0x7 instead 0x3.

Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_pci.c

index 55f199cc49bd77fba152f123889fcab9be429960..5b01b7696ee746581bf86223d8ae8e6f07edf33b 100644 (file)
@@ -48,7 +48,7 @@ static unsigned int pcidev_encode_bdf(libxl_device_pci *pcidev)
     value = 0;
     value |= (pcidev->bus & 0xff) << 16;
     value |= (pcidev->dev & 0x1f) << (8+3);
-    value |= (pcidev->func & 0x3) << (8+0);
+    value |= (pcidev->func & 0x7) << (8+0);
 
     return value;
 }