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