Some library instance's PCD is missing in FPD file for a module, it break single...
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / IdeBus / Dxe / idebus.h
1 /** @file
2 Header file for IDE Bus Driver.
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _IDE_BUS_H
16 #define _IDE_BUS_H
17
18
19 #include <IndustryStandard/pci22.h>
20 #include "idedata.h"
21
22 //
23 // Extra Definition to porting
24 //
25 #define EFI_MIN(a, b) (((a) < (b)) ? (a) : (b))
26
27 #define MAX_IDE_DEVICE 4
28 #define MAX_IDE_CHANNELS 2
29 #define MAX_IDE_DRIVES 2
30
31 typedef struct {
32 BOOLEAN HaveScannedDevice[MAX_IDE_DEVICE];
33 BOOLEAN DeviceFound[MAX_IDE_DEVICE];
34 BOOLEAN DeviceProcessed[MAX_IDE_DEVICE];
35 } IDE_BUS_DRIVER_PRIVATE_DATA;
36
37 #define IDE_BLK_IO_DEV_SIGNATURE EFI_SIGNATURE_32 ('i', 'b', 'i', 'd')
38
39 typedef struct {
40 UINT32 Signature;
41
42 EFI_HANDLE Handle;
43 EFI_BLOCK_IO_PROTOCOL BlkIo;
44 EFI_BLOCK_IO_MEDIA BlkMedia;
45 EFI_DISK_INFO_PROTOCOL DiskInfo;
46 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
47 EFI_PCI_IO_PROTOCOL *PciIo;
48 IDE_BUS_DRIVER_PRIVATE_DATA *IdeBusDriverPrivateData;
49
50 //
51 // Local Data for IDE interface goes here
52 //
53 EFI_IDE_CHANNEL Channel;
54 EFI_IDE_DEVICE Device;
55 UINT16 Lun;
56 IDE_DEVICE_TYPE Type;
57
58 IDE_BASE_REGISTERS *IoPort;
59 UINT16 AtapiError;
60
61 INQUIRY_DATA *pInquiryData;
62 EFI_IDENTIFY_DATA *pIdData;
63 ATA_PIO_MODE PioMode;
64 ATA_UDMA_MODE UDma_Mode;
65 CHAR8 ModelName[41];
66 REQUEST_SENSE_DATA *SenseData;
67 UINT8 SenseDataNumber;
68 UINT8 *Cache;
69
70 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
71 } IDE_BLK_IO_DEV;
72
73 #include "ComponentName.h"
74
75 #define IDE_BLOCK_IO_DEV_FROM_THIS(a) CR (a, IDE_BLK_IO_DEV, BlkIo, IDE_BLK_IO_DEV_SIGNATURE)
76 #define IDE_BLOCK_IO_DEV_FROM_DISK_INFO_THIS(a) CR (a, IDE_BLK_IO_DEV, DiskInfo, IDE_BLK_IO_DEV_SIGNATURE)
77
78 //
79 // Global Variables
80 //
81 extern EFI_DRIVER_BINDING_PROTOCOL gIDEBusDriverBinding;
82
83 #include "ide.h"
84
85 //
86 // Prototypes
87 // Driver model protocol interface
88 //
89 /**
90 TODO: Add function description
91
92 @param ImageHandle TODO: add argument description
93 @param SystemTable TODO: add argument description
94
95 TODO: add return values
96
97 **/
98 EFI_STATUS
99 EFIAPI
100 IDEBusControllerDriverEntryPoint (
101 IN EFI_HANDLE ImageHandle,
102 IN EFI_SYSTEM_TABLE *SystemTable
103 )
104 ;
105
106 /**
107 TODO: Add function description
108
109 @param This TODO: add argument description
110 @param Controller TODO: add argument description
111 @param RemainingDevicePath TODO: add argument description
112
113 TODO: add return values
114
115 **/
116 EFI_STATUS
117 EFIAPI
118 IDEBusDriverBindingSupported (
119 IN EFI_DRIVER_BINDING_PROTOCOL *This,
120 IN EFI_HANDLE Controller,
121 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
122 )
123 ;
124
125 /**
126 TODO: Add function description
127
128 @param This TODO: add argument description
129 @param Controller TODO: add argument description
130 @param RemainingDevicePath TODO: add argument description
131
132 TODO: add return values
133
134 **/
135 EFI_STATUS
136 EFIAPI
137 IDEBusDriverBindingStart (
138 IN EFI_DRIVER_BINDING_PROTOCOL *This,
139 IN EFI_HANDLE Controller,
140 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
141 )
142 ;
143
144 /**
145 TODO: Add function description
146
147 @param This TODO: add argument description
148 @param Controller TODO: add argument description
149 @param NumberOfChildren TODO: add argument description
150 @param ChildHandleBuffer TODO: add argument description
151
152 TODO: add return values
153
154 **/
155 EFI_STATUS
156 EFIAPI
157 IDEBusDriverBindingStop (
158 IN EFI_DRIVER_BINDING_PROTOCOL *This,
159 IN EFI_HANDLE Controller,
160 IN UINTN NumberOfChildren,
161 IN EFI_HANDLE *ChildHandleBuffer
162 )
163 ;
164
165 //
166 // Block I/O Protocol Interface
167 //
168 /**
169 TODO: Add function description
170
171 @param This TODO: add argument description
172 @param ExtendedVerification TODO: add argument description
173
174 TODO: add return values
175
176 **/
177 EFI_STATUS
178 EFIAPI
179 IDEBlkIoReset (
180 IN EFI_BLOCK_IO_PROTOCOL *This,
181 IN BOOLEAN ExtendedVerification
182 )
183 ;
184
185 /**
186 TODO: Add function description
187
188 @param This TODO: add argument description
189 @param MediaId TODO: add argument description
190 @param LBA TODO: add argument description
191 @param BufferSize TODO: add argument description
192 @param Buffer TODO: add argument description
193
194 TODO: add return values
195
196 **/
197 EFI_STATUS
198 EFIAPI
199 IDEBlkIoReadBlocks (
200 IN EFI_BLOCK_IO_PROTOCOL *This,
201 IN UINT32 MediaId,
202 IN EFI_LBA LBA,
203 IN UINTN BufferSize,
204 OUT VOID *Buffer
205 )
206 ;
207
208 /**
209 TODO: Add function description
210
211 @param This TODO: add argument description
212 @param MediaId TODO: add argument description
213 @param LBA TODO: add argument description
214 @param BufferSize TODO: add argument description
215 @param Buffer TODO: add argument description
216
217 TODO: add return values
218
219 **/
220 EFI_STATUS
221 EFIAPI
222 IDEBlkIoWriteBlocks (
223 IN EFI_BLOCK_IO_PROTOCOL *This,
224 IN UINT32 MediaId,
225 IN EFI_LBA LBA,
226 IN UINTN BufferSize,
227 IN VOID *Buffer
228 )
229 ;
230
231 /**
232 TODO: Add function description
233
234 @param This TODO: add argument description
235
236 TODO: add return values
237
238 **/
239 EFI_STATUS
240 EFIAPI
241 IDEBlkIoFlushBlocks (
242 IN EFI_BLOCK_IO_PROTOCOL *This
243 )
244 ;
245
246 /**
247 TODO: Add function description
248
249 @param PciIo TODO: add argument description
250 @param Enable TODO: add argument description
251
252 TODO: add return values
253
254 **/
255 EFI_STATUS
256 IDERegisterDecodeEnableorDisable (
257 IN EFI_PCI_IO_PROTOCOL *PciIo,
258 IN BOOLEAN Enable
259 )
260 ;
261
262 /**
263 TODO: Add function description
264
265 @param This TODO: add argument description
266 @param InquiryData TODO: add argument description
267 @param IntquiryDataSize TODO: add argument description
268
269 TODO: add return values
270
271 **/
272 EFI_STATUS
273 EFIAPI
274 IDEDiskInfoInquiry (
275 IN EFI_DISK_INFO_PROTOCOL *This,
276 IN OUT VOID *InquiryData,
277 IN OUT UINT32 *IntquiryDataSize
278 )
279 ;
280
281 /**
282 TODO: Add function description
283
284 @param This TODO: add argument description
285 @param IdentifyData TODO: add argument description
286 @param IdentifyDataSize TODO: add argument description
287
288 TODO: add return values
289
290 **/
291 EFI_STATUS
292 EFIAPI
293 IDEDiskInfoIdentify (
294 IN EFI_DISK_INFO_PROTOCOL *This,
295 IN OUT VOID *IdentifyData,
296 IN OUT UINT32 *IdentifyDataSize
297 )
298 ;
299
300 /**
301 TODO: Add function description
302
303 @param This TODO: add argument description
304 @param SenseData TODO: add argument description
305 @param SenseDataSize TODO: add argument description
306 @param SenseDataNumber TODO: add argument description
307
308 TODO: add return values
309
310 **/
311 EFI_STATUS
312 EFIAPI
313 IDEDiskInfoSenseData (
314 IN EFI_DISK_INFO_PROTOCOL *This,
315 IN OUT VOID *SenseData,
316 IN OUT UINT32 *SenseDataSize,
317 OUT UINT8 *SenseDataNumber
318 )
319 ;
320
321 /**
322 TODO: Add function description
323
324 @param This TODO: add argument description
325 @param IdeChannel TODO: add argument description
326 @param IdeDevice TODO: add argument description
327
328 TODO: add return values
329
330 **/
331 EFI_STATUS
332 EFIAPI
333 IDEDiskInfoWhichIde (
334 IN EFI_DISK_INFO_PROTOCOL *This,
335 OUT UINT32 *IdeChannel,
336 OUT UINT32 *IdeDevice
337 )
338 ;
339
340 #endif