Commit in reactos/drivers/bus/pci on MAIN
fdo.c+7-21.6 -> 1.7
pci.h+3-31.5 -> 1.6
pdo.c+27-31.3 -> 1.4
+37-8
3 modified files
- Fixed handling of IRP_MN_QUERY_BUS_INFORMATION.
- Add basic handling of IRP_MN_QUERY_CAPABILITIES for getting device specific bus address.

reactos/drivers/bus/pci
fdo.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- fdo.c	12 Mar 2004 19:40:05 -0000	1.6
+++ fdo.c	14 Mar 2004 17:10:43 -0000	1.7
@@ -1,4 +1,4 @@
-/* $Id: fdo.c,v 1.6 2004/03/12 19:40:05 navaraf Exp $
+/* $Id: fdo.c,v 1.7 2004/03/14 17:10:43 navaraf Exp $
  *
  * PROJECT:         ReactOS PCI bus driver
  * FILE:            fdo.c
@@ -13,7 +13,7 @@
 #include "pcidef.h"
 #include "pci.h"
 
-//#define NDEBUG
+#define NDEBUG
 #include <debug.h>
 
 /*** PRIVATE *****************************************************************/
@@ -249,6 +249,11 @@
 
       PdoDeviceExtension->BusNumber = Device->BusNumber;
 
+      RtlCopyMemory(
+        &PdoDeviceExtension->SlotNumber,
+        &Device->SlotNumber,
+        sizeof(PCI_SLOT_NUMBER));
+
       /* FIXME: Get device properties (Hardware IDs, etc.) */
 
       swprintf(

reactos/drivers/bus/pci
pci.h 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- pci.h	12 Mar 2004 19:40:05 -0000	1.5
+++ pci.h	14 Mar 2004 17:10:43 -0000	1.6
@@ -1,4 +1,4 @@
-/* $Id: pci.h,v 1.5 2004/03/12 19:40:05 navaraf Exp $ */
+/* $Id: pci.h,v 1.6 2004/03/14 17:10:43 navaraf Exp $ */
 
 #ifndef __PCI_H
 #define __PCI_H
@@ -58,6 +58,8 @@
   PDEVICE_OBJECT Fdo;
   // PCI bus number
   ULONG BusNumber;
+  // PCI slot number
+  PCI_SLOT_NUMBER SlotNumber;
   // Device ID
   UNICODE_STRING DeviceID;
   // Instance ID
@@ -85,8 +87,6 @@
   ULONG DeviceListCount;
   // Lock for namespace device list
   KSPIN_LOCK DeviceListLock;
-  // PCI bus number
-/*  ULONG BusNumber;*/
   // Lower device object
   PDEVICE_OBJECT Ldo;
 } __attribute((packed)) FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION;

reactos/drivers/bus/pci
pdo.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- pdo.c	12 Mar 2004 19:40:05 -0000	1.3
+++ pdo.c	14 Mar 2004 17:10:43 -0000	1.4
@@ -1,4 +1,4 @@
-/* $Id: pdo.c,v 1.3 2004/03/12 19:40:05 navaraf Exp $
+/* $Id: pdo.c,v 1.4 2004/03/14 17:10:43 navaraf Exp $
  *
  * PROJECT:         ReactOS PCI bus driver
  * FILE:            pdo.c
@@ -99,9 +99,30 @@
     BusInformation->LegacyBusType = PCIBus;
     BusInformation->BusNumber = DeviceExtension->BusNumber;
 
-    return STATUS_INSUFFICIENT_RESOURCES;
+    return STATUS_SUCCESS;
   }
 
+  return STATUS_INSUFFICIENT_RESOURCES;
+}
+
+
+NTSTATUS
+PdoQueryCapabilities(
+  IN PDEVICE_OBJECT DeviceObject,
+  IN PIRP Irp,
+  PIO_STACK_LOCATION IrpSp)
+{
+  PPDO_DEVICE_EXTENSION DeviceExtension;
+  PDEVICE_CAPABILITIES DeviceCapabilities;
+
+  DPRINT("Called\n");
+
+  DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
+  DeviceCapabilities = IrpSp->Parameters.DeviceCapabilities.Capabilities;
+
+  DeviceCapabilities->Address =
+  DeviceCapabilities->UINumber = DeviceExtension->SlotNumber.u.AsULONG;
+
   return STATUS_SUCCESS;
 }
 
@@ -176,10 +197,11 @@
     Status = PdoQueryBusInformation(DeviceObject, Irp, IrpSp);
     break;
 
-#if 0
   case IRP_MN_QUERY_CAPABILITIES:
+    Status = PdoQueryCapabilities(DeviceObject, Irp, IrpSp);
     break;
 
+#if 0
   case IRP_MN_QUERY_DEVICE_RELATIONS:
     /* FIXME: Possibly handle for RemovalRelations */
     break;
@@ -187,9 +209,11 @@
   case IRP_MN_QUERY_DEVICE_TEXT:
     break;
 #endif
+
   case IRP_MN_QUERY_ID:
     Status = PdoQueryId(DeviceObject, Irp, IrpSp);
     break;
+
 #if 0
   case IRP_MN_QUERY_PNP_DEVICE_STATE:
     break;
CVSspam 0.2.8