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