1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Storage Stack
4 * FILE: drivers/storage/scsiport/stubs.c
5 * PURPOSE: SCSI port driver
6 * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org)
7 */
8
9 #include "scsiport.h"
10
11 #include <srb.h>
12
13 #define NDEBUG
14 #include <debug.h>
15
16 #undef ScsiPortReadPortBufferUchar
17 #undef ScsiPortReadPortBufferUshort
18 #undef ScsiPortReadPortBufferUlong
19 #undef ScsiPortReadPortUchar
20 #undef ScsiPortReadPortUshort
21 #undef ScsiPortReadPortUlong
22 #undef ScsiPortReadRegisterBufferUchar
23 #undef ScsiPortReadRegisterBufferUshort
24 #undef ScsiPortReadRegisterBufferUlong
25 #undef ScsiPortReadRegisterUchar
26 #undef ScsiPortReadRegisterUshort
27 #undef ScsiPortReadRegisterUlong
28 #undef ScsiPortWritePortBufferUchar
29 #undef ScsiPortWritePortBufferUshort
30 #undef ScsiPortWritePortBufferUlong
31 #undef ScsiPortWritePortUchar
32 #undef ScsiPortWritePortUshort
33 #undef ScsiPortWritePortUlong
34 #undef ScsiPortWriteRegisterBufferUchar
35 #undef ScsiPortWriteRegisterBufferUshort
36 #undef ScsiPortWriteRegisterBufferUlong
37 #undef ScsiPortWriteRegisterUchar
38 #undef ScsiPortWriteRegisterUshort
39 #undef ScsiPortWriteRegisterUlong
40
41 SCSI_PHYSICAL_ADDRESS
42 NTAPI
ScsiPortConvertUlongToPhysicalAddress(IN ULONG_PTR UlongAddress)43 ScsiPortConvertUlongToPhysicalAddress(
44 IN ULONG_PTR UlongAddress)
45 {
46 SCSI_PHYSICAL_ADDRESS Address;
47
48 Address.QuadPart = UlongAddress;
49 return Address;
50 }
51
52 VOID
53 NTAPI
ScsiPortReadPortBufferUchar(IN PUCHAR Port,IN PUCHAR Buffer,IN ULONG Count)54 ScsiPortReadPortBufferUchar(
55 IN PUCHAR Port,
56 IN PUCHAR Buffer,
57 IN ULONG Count)
58 {
59 READ_PORT_BUFFER_UCHAR(Port, Buffer, Count);
60 }
61
62 VOID
63 NTAPI
ScsiPortReadPortBufferUshort(IN PUSHORT Port,IN PUSHORT Buffer,IN ULONG Count)64 ScsiPortReadPortBufferUshort(
65 IN PUSHORT Port,
66 IN PUSHORT Buffer,
67 IN ULONG Count)
68 {
69 READ_PORT_BUFFER_USHORT(Port, Buffer, Count);
70 }
71
72 VOID
73 NTAPI
ScsiPortReadPortBufferUlong(IN PULONG Port,IN PULONG Buffer,IN ULONG Count)74 ScsiPortReadPortBufferUlong(
75 IN PULONG Port,
76 IN PULONG Buffer,
77 IN ULONG Count)
78 {
79 READ_PORT_BUFFER_ULONG(Port, Buffer, Count);
80 }
81
82 UCHAR
83 NTAPI
ScsiPortReadPortUchar(IN PUCHAR Port)84 ScsiPortReadPortUchar(
85 IN PUCHAR Port)
86 {
87 return READ_PORT_UCHAR(Port);
88 }
89
90 USHORT
91 NTAPI
ScsiPortReadPortUshort(IN PUSHORT Port)92 ScsiPortReadPortUshort(
93 IN PUSHORT Port)
94 {
95 return READ_PORT_USHORT(Port);
96 }
97
98 ULONG
99 NTAPI
ScsiPortReadPortUlong(IN PULONG Port)100 ScsiPortReadPortUlong(
101 IN PULONG Port)
102 {
103 return READ_PORT_ULONG(Port);
104 }
105
106 VOID
107 NTAPI
ScsiPortReadRegisterBufferUchar(IN PUCHAR Register,IN PUCHAR Buffer,IN ULONG Count)108 ScsiPortReadRegisterBufferUchar(
109 IN PUCHAR Register,
110 IN PUCHAR Buffer,
111 IN ULONG Count)
112 {
113 READ_REGISTER_BUFFER_UCHAR(Register, Buffer, Count);
114 }
115
116 VOID
117 NTAPI
ScsiPortReadRegisterBufferUshort(IN PUSHORT Register,IN PUSHORT Buffer,IN ULONG Count)118 ScsiPortReadRegisterBufferUshort(
119 IN PUSHORT Register,
120 IN PUSHORT Buffer,
121 IN ULONG Count)
122 {
123 READ_REGISTER_BUFFER_USHORT(Register, Buffer, Count);
124 }
125
126 VOID
127 NTAPI
ScsiPortReadRegisterBufferUlong(IN PULONG Register,IN PULONG Buffer,IN ULONG Count)128 ScsiPortReadRegisterBufferUlong(
129 IN PULONG Register,
130 IN PULONG Buffer,
131 IN ULONG Count)
132 {
133 READ_REGISTER_BUFFER_ULONG(Register, Buffer, Count);
134 }
135
136 UCHAR
137 NTAPI
ScsiPortReadRegisterUchar(IN PUCHAR Register)138 ScsiPortReadRegisterUchar(
139 IN PUCHAR Register)
140 {
141 return READ_REGISTER_UCHAR(Register);
142 }
143
144 USHORT
145 NTAPI
ScsiPortReadRegisterUshort(IN PUSHORT Register)146 ScsiPortReadRegisterUshort(
147 IN PUSHORT Register)
148 {
149 return READ_REGISTER_USHORT(Register);
150 }
151
152 ULONG
153 NTAPI
ScsiPortReadRegisterUlong(IN PULONG Register)154 ScsiPortReadRegisterUlong(
155 IN PULONG Register)
156 {
157 return READ_REGISTER_ULONG(Register);
158 }
159
160 VOID
161 NTAPI
ScsiPortWritePortBufferUchar(IN PUCHAR Port,IN PUCHAR Buffer,IN ULONG Count)162 ScsiPortWritePortBufferUchar(
163 IN PUCHAR Port,
164 IN PUCHAR Buffer,
165 IN ULONG Count)
166 {
167 WRITE_PORT_BUFFER_UCHAR(Port, Buffer, Count);
168 }
169
170 VOID
171 NTAPI
ScsiPortWritePortBufferUshort(IN PUSHORT Port,IN PUSHORT Buffer,IN ULONG Count)172 ScsiPortWritePortBufferUshort(
173 IN PUSHORT Port,
174 IN PUSHORT Buffer,
175 IN ULONG Count)
176 {
177 WRITE_PORT_BUFFER_USHORT(Port, Buffer, Count);
178 }
179
180 VOID
181 NTAPI
ScsiPortWritePortBufferUlong(IN PULONG Port,IN PULONG Buffer,IN ULONG Count)182 ScsiPortWritePortBufferUlong(
183 IN PULONG Port,
184 IN PULONG Buffer,
185 IN ULONG Count)
186 {
187 WRITE_PORT_BUFFER_ULONG(Port, Buffer, Count);
188 }
189
190 VOID
191 NTAPI
ScsiPortWritePortUchar(IN PUCHAR Port,IN UCHAR Value)192 ScsiPortWritePortUchar(
193 IN PUCHAR Port,
194 IN UCHAR Value)
195 {
196 WRITE_PORT_UCHAR(Port, Value);
197 }
198
199 VOID
200 NTAPI
ScsiPortWritePortUshort(IN PUSHORT Port,IN USHORT Value)201 ScsiPortWritePortUshort(
202 IN PUSHORT Port,
203 IN USHORT Value)
204 {
205 WRITE_PORT_USHORT(Port, Value);
206 }
207
208 VOID
209 NTAPI
ScsiPortWritePortUlong(IN PULONG Port,IN ULONG Value)210 ScsiPortWritePortUlong(
211 IN PULONG Port,
212 IN ULONG Value)
213 {
214 WRITE_PORT_ULONG(Port, Value);
215 }
216
217 VOID
218 NTAPI
ScsiPortWriteRegisterBufferUchar(IN PUCHAR Register,IN PUCHAR Buffer,IN ULONG Count)219 ScsiPortWriteRegisterBufferUchar(
220 IN PUCHAR Register,
221 IN PUCHAR Buffer,
222 IN ULONG Count)
223 {
224 WRITE_REGISTER_BUFFER_UCHAR(Register, Buffer, Count);
225 }
226
227 VOID
228 NTAPI
ScsiPortWriteRegisterBufferUshort(IN PUSHORT Register,IN PUSHORT Buffer,IN ULONG Count)229 ScsiPortWriteRegisterBufferUshort(
230 IN PUSHORT Register,
231 IN PUSHORT Buffer,
232 IN ULONG Count)
233 {
234 WRITE_REGISTER_BUFFER_USHORT(Register, Buffer, Count);
235 }
236
237 VOID
238 NTAPI
ScsiPortWriteRegisterBufferUlong(IN PULONG Register,IN PULONG Buffer,IN ULONG Count)239 ScsiPortWriteRegisterBufferUlong(
240 IN PULONG Register,
241 IN PULONG Buffer,
242 IN ULONG Count)
243 {
244 WRITE_REGISTER_BUFFER_ULONG(Register, Buffer, Count);
245 }
246
247 VOID
248 NTAPI
ScsiPortWriteRegisterUchar(IN PUCHAR Register,IN UCHAR Value)249 ScsiPortWriteRegisterUchar(
250 IN PUCHAR Register,
251 IN UCHAR Value)
252 {
253 WRITE_REGISTER_UCHAR(Register, Value);
254 }
255
256 VOID
257 NTAPI
ScsiPortWriteRegisterUshort(IN PUSHORT Register,IN USHORT Value)258 ScsiPortWriteRegisterUshort(
259 IN PUSHORT Register,
260 IN USHORT Value)
261 {
262 WRITE_REGISTER_USHORT(Register, Value);
263 }
264
265 VOID
266 NTAPI
ScsiPortWriteRegisterUlong(IN PULONG Register,IN ULONG Value)267 ScsiPortWriteRegisterUlong(
268 IN PULONG Register,
269 IN ULONG Value)
270 {
271 WRITE_REGISTER_ULONG(Register, Value);
272 }
273