00001 /*++ 00002 00003 Copyright (c) 1995 Microsoft Corporation 00004 00005 Module Name: 00006 00007 pnpsubs.c 00008 00009 Abstract: 00010 00011 This module contains the plug-and-play data 00012 00013 Author: 00014 00015 Shie-Lin Tzong (shielint) 30-Jan-1995 00016 00017 Environment: 00018 00019 Kernel mode 00020 00021 00022 Revision History: 00023 00024 00025 --*/ 00026 00027 #include "iop.h" 00028 #pragma hdrstop 00029 00030 // 00031 // INIT data segment 00032 // 00033 00034 #ifdef ALLOC_DATA_PRAGMA 00035 #pragma data_seg("INIT") 00036 #endif 00037 00038 PVOID IopPnpScratchBuffer1 = NULL; 00039 PVOID IopPnpScratchBuffer2 = NULL; 00040 PCM_RESOURCE_LIST IopInitHalResources; 00041 PDEVICE_NODE IopInitHalDeviceNode; 00042 PIOP_RESERVED_RESOURCES_RECORD IopInitReservedResourceList; 00043 00044 // 00045 // Regular data segment 00046 // 00047 00048 #ifdef ALLOC_DATA_PRAGMA 00049 #pragma data_seg() 00050 #endif 00051 00052 // 00053 // IopRootDeviceNode - the head of the PnP manager's device node tree. 00054 // 00055 00056 PDEVICE_NODE IopRootDeviceNode; 00057 00058 // 00059 // IoPnPDriverObject - the madeup driver object for pnp manager 00060 // 00061 00062 PDRIVER_OBJECT IoPnpDriverObject; 00063 00064 // 00065 // IopPnPSpinLock - spinlock for Pnp code. 00066 // 00067 00068 KSPIN_LOCK IopPnPSpinLock; 00069 00070 // 00071 // IopDeviceTreeLock - performs syncronization around the whole device node tree. 00072 // 00073 00074 ERESOURCE IopDeviceTreeLock; 00075 00076 // 00077 // PiEventQueueEmpty - Manual reset event which is set when the queue is empty 00078 // 00079 00080 KEVENT PiEventQueueEmpty; 00081 00082 // 00083 // PiEnumerationLock - to synchronize boot phase device enumeration 00084 // 00085 00086 KEVENT PiEnumerationLock; 00087 00088 // 00089 // iopEnumerationCount - indicates how many devices are being enumerated. 00090 // 00091 00092 LONG IopEnumerationCount; 00093 00094 // 00095 // IopNumberDeviceNodes - Number of outstanding device nodes in the system. 00096 // 00097 00098 ULONG IopNumberDeviceNodes; 00099 00100 // 00101 // IopPnpEnumerationRequestList - a link list of device enumeration requests to worker thread. 00102 // 00103 00104 LIST_ENTRY IopPnpEnumerationRequestList; 00105 00106 // 00107 // PnPInitComplete - A flag to indicate if PnP initialization is completed. 00108 // 00109 00110 BOOLEAN PnPInitialized; 00111 00112 // 00113 // PnPDetectionEnabled - A flag to indicate if detection code can be executed 00114 // 00115 00116 BOOLEAN PnPDetectionEnabled; 00117 00118 // 00119 // PnPBootDriverInitialied 00120 // 00121 00122 BOOLEAN PnPBootDriversInitialized; 00123 00124 // 00125 // PnPBootDriverLoaded 00126 // 00127 00128 BOOLEAN PnPBootDriversLoaded; 00129 00130 // 00131 // IopBootConfigsReserved - Indicates whether we have reserved BOOT configs or not. 00132 // 00133 00134 BOOLEAN IopBootConfigsReserved; 00135 00136 // 00137 // IopResourcesReleased - a flag to indicate if a device is removed and its resources 00138 // are freed. This is for reallocating resources for DNF_INSUFFICIENT_RESOURCES 00139 // devices. 00140 // 00141 00142 BOOLEAN IopResourcesReleased; 00143 00144 // 00145 // Variable to hold resources reservation routine. 00146 // 00147 00148 PIO_RESERVE_RESOURCES_ROUTINE IopReserveResourcesRoutine; 00149 00150 // 00151 // Device node tree sequence. Is bumped every time the tree is modified or a warm 00152 // eject is queued. 00153 // 00154 00155 ULONG IoDeviceNodeTreeSequence; 00156 00157 // 00158 // List of queried bus type guids 00159 // 00160 00161 PBUS_TYPE_GUID_LIST IopBusTypeGuidList; 00162 00163 // 00164 // PnpDefaultInterfaceTYpe - Use this if the interface type of resource list is unknown. 00165 // 00166 00167 INTERFACE_TYPE PnpDefaultInterfaceType; 00168 00169 // 00170 // PnpStartAsynOk - control how start irp should be handled. Synchronously or Asynchronously? 00171 // 00172 00173 BOOLEAN PnpAsyncOk; 00174 00175 // 00176 // IopMaxDeviceNodeLevel - Level number of the DeviceNode deepest in the tree 00177 // 00178 ULONG IopMaxDeviceNodeLevel; 00179 00180 // 00181 // IopPendingEjects - List of pending eject requests 00182 // 00183 LIST_ENTRY IopPendingEjects; 00184 00185 // 00186 // IopPendingSurpriseRemovals - List of pending surprise removal requests 00187 // 00188 LIST_ENTRY IopPendingSurpriseRemovals; 00189 00190 // 00191 // Warm eject lock - only one warm eject is allowed to occur at a time 00192 // 00193 KEVENT IopWarmEjectLock; 00194 00195 // 00196 // This field contains a devobj if a warm eject is in progress. 00197 // 00198 PDEVICE_OBJECT IopWarmEjectPdo; 00199 00200 // 00201 // Arbiter data 00202 // 00203 00204 ARBITER_INSTANCE IopRootPortArbiter; 00205 ARBITER_INSTANCE IopRootMemArbiter; 00206 ARBITER_INSTANCE IopRootDmaArbiter; 00207 ARBITER_INSTANCE IopRootIrqArbiter; 00208 ARBITER_INSTANCE IopRootBusNumberArbiter;