Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
[reactos.git] / reactos / drivers / bus / pcix / arb / ar_memio.c
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_memiono.c
5 * PURPOSE: Memory and I/O Port Resource Arbitration
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9 /* INCLUDES *******************************************************************/
10
11 #include <pci.h>
12 #define NDEBUG
13 #include <debug.h>
14
15 /* GLOBALS ********************************************************************/
16
17 PCI_INTERFACE ArbiterInterfaceMemory =
18 {
19 &GUID_ARBITER_INTERFACE_STANDARD,
20 sizeof(ARBITER_INTERFACE),
21 0,
22 0,
23 PCI_INTERFACE_FDO,
24 0,
25 PciArb_Memory,
26 armem_Constructor,
27 armem_Initializer
28 };
29
30 PCI_INTERFACE ArbiterInterfaceIo =
31 {
32 &GUID_ARBITER_INTERFACE_STANDARD,
33 sizeof(ARBITER_INTERFACE),
34 0,
35 0,
36 PCI_INTERFACE_FDO,
37 0,
38 PciArb_Io,
39 ario_Constructor,
40 ario_Initializer
41 };
42
43 /* FUNCTIONS ******************************************************************/
44
45 NTSTATUS
46 NTAPI
47 ario_Initializer(IN PVOID Instance)
48 {
49 /* Not yet implemented */
50 UNIMPLEMENTED;
51 //while (TRUE);
52 return STATUS_SUCCESS;
53 }
54
55 NTSTATUS
56 NTAPI
57 ario_Constructor(IN PVOID DeviceExtension,
58 IN PVOID PciInterface,
59 IN PVOID InterfaceData,
60 IN USHORT Version,
61 IN USHORT Size,
62 IN PINTERFACE Interface)
63 {
64 PPCI_FDO_EXTENSION FdoExtension = (PPCI_FDO_EXTENSION)DeviceExtension;
65 NTSTATUS Status;
66 PAGED_CODE();
67
68 /* Make sure it's the expected interface */
69 if ((ULONG)InterfaceData != CmResourceTypePort)
70 {
71 /* Arbiter support must have been initialized first */
72 if (FdoExtension->ArbitersInitialized)
73 {
74 /* Not yet implemented */
75 UNIMPLEMENTED;
76 while (TRUE);
77 }
78 else
79 {
80 /* No arbiters for this FDO */
81 Status = STATUS_NOT_SUPPORTED;
82 }
83 }
84 else
85 {
86 /* Not the right interface */
87 Status = STATUS_INVALID_PARAMETER_5;
88 }
89
90 /* Return the status */
91 return Status;
92 }
93
94 NTSTATUS
95 NTAPI
96 armem_Initializer(IN PVOID Instance)
97 {
98 /* Not yet implemented */
99 UNIMPLEMENTED;
100 //while (TRUE);
101 return STATUS_SUCCESS;
102 }
103
104 NTSTATUS
105 NTAPI
106 armem_Constructor(IN PVOID DeviceExtension,
107 IN PVOID PciInterface,
108 IN PVOID InterfaceData,
109 IN USHORT Version,
110 IN USHORT Size,
111 IN PINTERFACE Interface)
112 {
113 PPCI_FDO_EXTENSION FdoExtension = (PPCI_FDO_EXTENSION)DeviceExtension;
114 NTSTATUS Status;
115 PAGED_CODE();
116
117 /* Make sure it's the expected interface */
118 if ((ULONG)InterfaceData != CmResourceTypeMemory)
119 {
120 /* Arbiter support must have been initialized first */
121 if (FdoExtension->ArbitersInitialized)
122 {
123 /* Not yet implemented */
124 UNIMPLEMENTED;
125 while (TRUE);
126 }
127 else
128 {
129 /* No arbiters for this FDO */
130 Status = STATUS_NOT_SUPPORTED;
131 }
132 }
133 else
134 {
135 /* Not the right interface */
136 Status = STATUS_INVALID_PARAMETER_5;
137 }
138
139 /* Return the status */
140 return Status;
141 }
142
143 /* EOF */