]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.h
remove some comments introduced by tools.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / IdeBusDxe / idebus.h
1 /** @file
2 Header file for IDE Bus Driver.
3
4 Copyright (c) 2006 - 2007 Intel Corporation. <BR>
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
20 #include <FrameworkDxe.h>
21
22 #include <Protocol/IdeControllerInit.h>
23 #include <Protocol/BlockIo.h>
24 #include <Protocol/PciIo.h>
25 #include <Protocol/DiskInfo.h>
26 #include <Protocol/DevicePath.h>
27
28 #include <Library/DebugLib.h>
29 #include <Library/UefiDriverEntryPoint.h>
30 #include <Library/BaseLib.h>
31 #include <Library/UefiLib.h>
32 #include <Library/BaseMemoryLib.h>
33 #include <Library/ReportStatusCodeLib.h>
34 #include <Library/MemoryAllocationLib.h>
35 #include <Library/PerformanceLib.h>
36 #include <Library/UefiBootServicesTableLib.h>
37 #include <Library/UefiRuntimeServicesTableLib.h>
38 #include <Library/DevicePathLib.h>
39
40 #include <IndustryStandard/pci22.h>
41 #include "idedata.h"
42
43 //
44 // Extra Definition to porting
45 //
46 #define EFI_MIN(a, b) (((a) < (b)) ? (a) : (b))
47
48 #define MAX_IDE_DEVICE 4
49 #define MAX_IDE_CHANNELS 2
50 #define MAX_IDE_DRIVES 2
51
52 #define INVALID_DEVICE_TYPE 0xff
53 #define ATA_DEVICE_TYPE 0x00
54 #define ATAPI_DEVICE_TYPE 0x01
55
56 typedef struct {
57 BOOLEAN HaveScannedDevice[MAX_IDE_DEVICE];
58 BOOLEAN DeviceFound[MAX_IDE_DEVICE];
59 BOOLEAN DeviceProcessed[MAX_IDE_DEVICE];
60 } IDE_BUS_DRIVER_PRIVATE_DATA;
61
62 #define IDE_BLK_IO_DEV_SIGNATURE EFI_SIGNATURE_32 ('i', 'b', 'i', 'd')
63
64 typedef struct {
65 UINT32 Signature;
66
67 EFI_HANDLE Handle;
68 EFI_BLOCK_IO_PROTOCOL BlkIo;
69 EFI_BLOCK_IO_MEDIA BlkMedia;
70 EFI_DISK_INFO_PROTOCOL DiskInfo;
71 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
72 EFI_PCI_IO_PROTOCOL *PciIo;
73 IDE_BUS_DRIVER_PRIVATE_DATA *IdeBusDriverPrivateData;
74
75 //
76 // Local Data for IDE interface goes here
77 //
78 EFI_IDE_CHANNEL Channel;
79 EFI_IDE_DEVICE Device;
80 UINT16 Lun;
81 IDE_DEVICE_TYPE Type;
82
83 IDE_BASE_REGISTERS *IoPort;
84 UINT16 AtapiError;
85
86 ATAPI_INQUIRY_DATA *pInquiryData;
87 EFI_IDENTIFY_DATA *pIdData;
88 ATA_PIO_MODE PioMode;
89 EFI_ATA_MODE UdmaMode;
90 CHAR8 ModelName[41];
91 ATAPI_REQUEST_SENSE_DATA *SenseData;
92 UINT8 SenseDataNumber;
93 UINT8 *Cache;
94
95 //
96 // ExitBootService Event, it is used to clear pending IDE interrupt
97 //
98 EFI_EVENT ExitBootServiceEvent;
99
100 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
101 } IDE_BLK_IO_DEV;
102
103 #include "ComponentName.h"
104
105 #define IDE_BLOCK_IO_DEV_FROM_THIS(a) CR (a, IDE_BLK_IO_DEV, BlkIo, IDE_BLK_IO_DEV_SIGNATURE)
106 #define IDE_BLOCK_IO_DEV_FROM_DISK_INFO_THIS(a) CR (a, IDE_BLK_IO_DEV, DiskInfo, IDE_BLK_IO_DEV_SIGNATURE)
107
108 //
109 // Global Variables
110 //
111 extern EFI_DRIVER_BINDING_PROTOCOL gIDEBusDriverBinding;
112
113 #include "ide.h"
114
115 //
116 // Prototypes
117 // Driver model protocol interface
118 //
119 /**
120 TODO: Add function description
121
122 @param ImageHandle TODO: add argument description
123 @param SystemTable TODO: add argument description
124
125 TODO: add return values
126
127 **/
128 EFI_STATUS
129 EFIAPI
130 IDEBusControllerDriverEntryPoint (
131 IN EFI_HANDLE ImageHandle,
132 IN EFI_SYSTEM_TABLE *SystemTable
133 )
134 ;
135
136 /**
137 TODO: Add function description
138
139 @param This TODO: add argument description
140 @param Controller TODO: add argument description
141 @param RemainingDevicePath TODO: add argument description
142
143 TODO: add return values
144
145 **/
146 EFI_STATUS
147 EFIAPI
148 IDEBusDriverBindingSupported (
149 IN EFI_DRIVER_BINDING_PROTOCOL *This,
150 IN EFI_HANDLE Controller,
151 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
152 )
153 ;
154
155 /**
156 TODO: Add function description
157
158 @param This TODO: add argument description
159 @param Controller TODO: add argument description
160 @param RemainingDevicePath TODO: add argument description
161
162 TODO: add return values
163
164 **/
165 EFI_STATUS
166 EFIAPI
167 IDEBusDriverBindingStart (
168 IN EFI_DRIVER_BINDING_PROTOCOL *This,
169 IN EFI_HANDLE Controller,
170 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
171 )
172 ;
173
174 /**
175 TODO: Add function description
176
177 @param This TODO: add argument description
178 @param Controller TODO: add argument description
179 @param NumberOfChildren TODO: add argument description
180 @param ChildHandleBuffer TODO: add argument description
181
182 TODO: add return values
183
184 **/
185 EFI_STATUS
186 EFIAPI
187 IDEBusDriverBindingStop (
188 IN EFI_DRIVER_BINDING_PROTOCOL *This,
189 IN EFI_HANDLE Controller,
190 IN UINTN NumberOfChildren,
191 IN EFI_HANDLE *ChildHandleBuffer
192 )
193 ;
194
195 //
196 // EFI Driver Configuration Functions
197 //
198 EFI_STATUS
199 IDEBusDriverConfigurationSetOptions (
200 IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
201 IN EFI_HANDLE ControllerHandle,
202 IN EFI_HANDLE ChildHandle OPTIONAL,
203 IN CHAR8 *Language,
204 OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
205 );
206
207 EFI_STATUS
208 IDEBusDriverConfigurationOptionsValid (
209 IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
210 IN EFI_HANDLE ControllerHandle,
211 IN EFI_HANDLE ChildHandle OPTIONAL
212 );
213
214 EFI_STATUS
215 IDEBusDriverConfigurationForceDefaults (
216 IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
217 IN EFI_HANDLE ControllerHandle,
218 IN EFI_HANDLE ChildHandle OPTIONAL,
219 IN UINT32 DefaultType,
220 OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
221 );
222
223 //
224 // EFI Driver Diagnostics Functions
225 //
226 EFI_STATUS
227 IDEBusDriverDiagnosticsRunDiagnostics (
228 IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *This,
229 IN EFI_HANDLE ControllerHandle,
230 IN EFI_HANDLE ChildHandle OPTIONAL,
231 IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,
232 IN CHAR8 *Language,
233 OUT EFI_GUID **ErrorType,
234 OUT UINTN *BufferSize,
235 OUT CHAR16 **Buffer
236 );
237
238 //
239 // Block I/O Protocol Interface
240 //
241 /**
242 TODO: Add function description
243
244 @param This TODO: add argument description
245 @param ExtendedVerification TODO: add argument description
246
247 TODO: add return values
248
249 **/
250 EFI_STATUS
251 EFIAPI
252 IDEBlkIoReset (
253 IN EFI_BLOCK_IO_PROTOCOL *This,
254 IN BOOLEAN ExtendedVerification
255 )
256 ;
257
258 /**
259 TODO: Add function description
260
261 @param This TODO: add argument description
262 @param MediaId TODO: add argument description
263 @param LBA TODO: add argument description
264 @param BufferSize TODO: add argument description
265 @param Buffer TODO: add argument description
266
267 TODO: add return values
268
269 **/
270 EFI_STATUS
271 EFIAPI
272 IDEBlkIoReadBlocks (
273 IN EFI_BLOCK_IO_PROTOCOL *This,
274 IN UINT32 MediaId,
275 IN EFI_LBA LBA,
276 IN UINTN BufferSize,
277 OUT VOID *Buffer
278 )
279 ;
280
281 /**
282 TODO: Add function description
283
284 @param This TODO: add argument description
285 @param MediaId TODO: add argument description
286 @param LBA TODO: add argument description
287 @param BufferSize TODO: add argument description
288 @param Buffer TODO: add argument description
289
290 TODO: add return values
291
292 **/
293 EFI_STATUS
294 EFIAPI
295 IDEBlkIoWriteBlocks (
296 IN EFI_BLOCK_IO_PROTOCOL *This,
297 IN UINT32 MediaId,
298 IN EFI_LBA LBA,
299 IN UINTN BufferSize,
300 IN VOID *Buffer
301 )
302 ;
303
304 /**
305 TODO: Add function description
306
307 @param This TODO: add argument description
308
309 TODO: add return values
310
311 **/
312 EFI_STATUS
313 EFIAPI
314 IDEBlkIoFlushBlocks (
315 IN EFI_BLOCK_IO_PROTOCOL *This
316 )
317 ;
318
319 /**
320 TODO: Add function description
321
322 @param PciIo TODO: add argument description
323 @param Enable TODO: add argument description
324
325 TODO: add return values
326
327 **/
328 EFI_STATUS
329 IDERegisterDecodeEnableorDisable (
330 IN EFI_PCI_IO_PROTOCOL *PciIo,
331 IN BOOLEAN Enable
332 )
333 ;
334
335 /**
336 TODO: Add function description
337
338 @param This TODO: add argument description
339 @param InquiryData TODO: add argument description
340 @param IntquiryDataSize TODO: add argument description
341
342 TODO: add return values
343
344 **/
345 EFI_STATUS
346 EFIAPI
347 IDEDiskInfoInquiry (
348 IN EFI_DISK_INFO_PROTOCOL *This,
349 IN OUT VOID *InquiryData,
350 IN OUT UINT32 *IntquiryDataSize
351 )
352 ;
353
354 /**
355 TODO: Add function description
356
357 @param This TODO: add argument description
358 @param IdentifyData TODO: add argument description
359 @param IdentifyDataSize TODO: add argument description
360
361 TODO: add return values
362
363 **/
364 EFI_STATUS
365 EFIAPI
366 IDEDiskInfoIdentify (
367 IN EFI_DISK_INFO_PROTOCOL *This,
368 IN OUT VOID *IdentifyData,
369 IN OUT UINT32 *IdentifyDataSize
370 )
371 ;
372
373 /**
374 TODO: Add function description
375
376 @param This TODO: add argument description
377 @param SenseData TODO: add argument description
378 @param SenseDataSize TODO: add argument description
379 @param SenseDataNumber TODO: add argument description
380
381 TODO: add return values
382
383 **/
384 EFI_STATUS
385 EFIAPI
386 IDEDiskInfoSenseData (
387 IN EFI_DISK_INFO_PROTOCOL *This,
388 IN OUT VOID *SenseData,
389 IN OUT UINT32 *SenseDataSize,
390 OUT UINT8 *SenseDataNumber
391 )
392 ;
393
394 /**
395 TODO: Add function description
396
397 @param This TODO: add argument description
398 @param IdeChannel TODO: add argument description
399 @param IdeDevice TODO: add argument description
400
401 TODO: add return values
402
403 **/
404 EFI_STATUS
405 EFIAPI
406 IDEDiskInfoWhichIde (
407 IN EFI_DISK_INFO_PROTOCOL *This,
408 OUT UINT32 *IdeChannel,
409 OUT UINT32 *IdeDevice
410 )
411 ;
412
413 #endif