ReactOS  0.4.15-dev-439-g292f67a
ar_busno.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS PCI Bus Driver
3  * LICENSE: BSD - See COPYING.ARM in the top level directory
4  * FILE: drivers/bus/pci/arb/ar_busno.c
5  * PURPOSE: Bus Number Arbitration
6  * PROGRAMMERS: ReactOS Portable Systems Group
7  */
8 
9 /* INCLUDES *******************************************************************/
10 
11 #include <pci.h>
12 
13 #define NDEBUG
14 #include <debug.h>
15 
16 /* GLOBALS ********************************************************************/
17 
19 {
20  &GUID_ARBITER_INTERFACE_STANDARD,
21  sizeof(ARBITER_INTERFACE),
22  0,
23  0,
25  0,
29 };
30 
31 /* FUNCTIONS ******************************************************************/
32 
34 NTAPI
36 {
40 
41  PAGED_CODE();
42 
43  RtlZeroMemory(&Arbiter->CommonInstance, sizeof(Arbiter->CommonInstance));
44 
45  FdoExtension = Arbiter->BusFdoExtension;
46 
47  /* Not yet implemented */
49 
50 #if 0
51  Arbiter->CommonInstance.UnpackRequirement = arbusno_UnpackRequirement;
52  Arbiter->CommonInstance.PackResource = arbusno_PackResource;
53  Arbiter->CommonInstance.UnpackResource = arbusno_UnpackResource;
54  Arbiter->CommonInstance.ScoreRequirement = arbusno_ScoreRequirement;
55 #endif
56 
58  FdoExtension->FunctionalDeviceObject,
60  Arbiter->InstanceName,
61  L"Pci",
62  NULL);
63  if (!NT_SUCCESS(Status))
64  {
65  DPRINT1("arbusno_Initializer: init arbiter return %X", Status);
66  }
67 
68  return Status;
69 }
70 
72 NTAPI
73 arbusno_Constructor(IN PVOID DeviceExtension,
74  IN PVOID PciInterface,
77  IN USHORT Size,
79 {
82  PAGED_CODE();
83 
84  UNREFERENCED_PARAMETER(PciInterface);
88 
89  /* Make sure it's the expected interface */
91  {
92  /* Arbiter support must have been initialized first */
93  if (FdoExtension->ArbitersInitialized)
94  {
95  /* Not yet implemented */
97  while (TRUE);
98  }
99  else
100  {
101  /* No arbiters for this FDO */
103  }
104  }
105  else
106  {
107  /* Not the right interface */
109  }
110 
111  /* Return the status */
112  return Status;
113 }
114 
115 /* EOF */
#define IN
Definition: typedefs.h:39
#define TRUE
Definition: types.h:120
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:361
NTSTATUS NTAPI ArbInitializeArbiterInstance(_Inout_ PARBITER_INSTANCE Arbiter, _In_ PDEVICE_OBJECT BusDeviceObject, _In_ CM_RESOURCE_TYPE ResourceType, _In_ PCWSTR ArbiterName, _In_ PCWSTR OrderName, _In_ PARB_TRANSLATE_ORDERING TranslateOrderingFunction)
Definition: arbiter.c:27
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
PCI_INTERFACE ArbiterInterfaceBusNumber
Definition: ar_busno.c:18
LONG NTSTATUS
Definition: precomp.h:26
#define PCI_INTERFACE_FDO
Definition: pci.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:64
struct _PCI_FDO_EXTENSION * PPCI_FDO_EXTENSION
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
PARB_SCORE_REQUIREMENT ScoreRequirement
Definition: arbiter.h:194
smooth NULL
Definition: ftsmooth.c:416
#define STATUS_INVALID_PARAMETER_5
Definition: ntstatus.h:465
PPCI_FDO_EXTENSION BusFdoExtension
Definition: pci.h:405
PARB_UNPACK_REQUIREMENT UnpackRequirement
Definition: arbiter.h:191
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:361
WCHAR InstanceName[24]
Definition: pci.h:406
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static const WCHAR L[]
Definition: oid.c:1250
PARB_PACK_RESOURCE PackResource
Definition: arbiter.h:192
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
struct _ARBITER_INTERFACE ARBITER_INTERFACE
Status
Definition: gdiplustypes.h:24
ARBITER_INSTANCE CommonInstance
Definition: pci.h:407
unsigned short USHORT
Definition: pedump.c:61
IN PVOID Instance
Definition: pci.h:361
#define DPRINT1
Definition: precomp.h:8
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
#define UNIMPLEMENTED
Definition: debug.h:115
IN PVOID IN PVOID InterfaceData
Definition: pci.h:361
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define CmResourceTypeBusNumber
Definition: hwresource.cpp:128
NTSTATUS NTAPI arbusno_Constructor(IN PVOID DeviceExtension, IN PVOID PciInterface, IN PVOID InterfaceData, IN USHORT Version, IN USHORT Size, IN PINTERFACE Interface)
Definition: ar_busno.c:73
PARB_UNPACK_RESOURCE UnpackResource
Definition: arbiter.h:193
#define PAGED_CODE()
NTSTATUS NTAPI arbusno_Initializer(IN PVOID Instance)
Definition: ar_busno.c:35