In IdeBus driver block I/O read/write interface, it will always try to use UDMA mode...
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / IdeBus / Dxe / ide.h
CommitLineData
ed72955c 1/** @file\r
a98f11c5 2 Header file for IDE Bus Driver, containing the helper functions'\r
ed72955c 3 entire prototype.\r
878ddf1f 4\r
a98f11c5 5 Copyright (c) 2006, Intel Corporation\r
6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
878ddf1f 10\r
a98f11c5 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
878ddf1f 13\r
ed72955c 14 @par Revision Reference:\r
15 2002-6: Add Atapi6 enhancement, support >120GB hard disk, including\r
16 Add - IDEBlkIoReadBlocksExt() func definition\r
17 Add - IDEBlkIoWriteBlocksExt() func definition\r
878ddf1f 18\r
ed72955c 19**/\r
878ddf1f 20\r
878ddf1f 21#ifndef _IDE_H\r
22#define _IDE_H\r
23\r
24//\r
25// Helper functions Prototype\r
26//\r
ed72955c 27/**\r
28 TODO: Add function description\r
29\r
30 @param This TODO: add argument description\r
31 @param Controller TODO: add argument description\r
32 @param Handle TODO: add argument description\r
33\r
34 TODO: add return values\r
35\r
36**/\r
878ddf1f 37EFI_STATUS\r
38DeRegisterIdeDevice (\r
39 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
40 IN EFI_HANDLE Controller,\r
41 IN EFI_HANDLE Handle\r
42 )\r
ed72955c 43;\r
878ddf1f 44\r
ed72955c 45/**\r
878ddf1f 46 TODO: Add function description\r
47\r
ed72955c 48 @param Controller TODO: add argument description\r
49 @param PciIo TODO: add argument description\r
50 @param ParentDevicePath TODO: add argument description\r
51 @param RemainingDevicePath TODO: add argument description\r
878ddf1f 52\r
53 TODO: add return values\r
54\r
ed72955c 55**/\r
878ddf1f 56EFI_STATUS\r
57EnableIdeDevice (\r
58 IN EFI_HANDLE Controller,\r
59 IN EFI_PCI_IO_PROTOCOL *PciIo,\r
60 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,\r
61 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
62 )\r
ed72955c 63;\r
878ddf1f 64\r
ed72955c 65/**\r
878ddf1f 66 TODO: Add function description\r
67\r
ed72955c 68 @param PciIo TODO: add argument description\r
69 @param Port TODO: add argument description\r
878ddf1f 70\r
71 TODO: add return values\r
72\r
ed72955c 73**/\r
878ddf1f 74UINT8\r
75IDEReadPortB (\r
76 IN EFI_PCI_IO_PROTOCOL *PciIo,\r
77 IN UINT16 Port\r
78 )\r
ed72955c 79;\r
878ddf1f 80\r
ed72955c 81/**\r
878ddf1f 82 TODO: Add function description\r
83\r
ed72955c 84 @param PciIo TODO: add argument description\r
85 @param Port TODO: add argument description\r
86 @param Count TODO: add argument description\r
87 @param Buffer TODO: add argument description\r
878ddf1f 88\r
89 TODO: add return values\r
90\r
ed72955c 91**/\r
878ddf1f 92VOID\r
93IDEReadPortWMultiple (\r
94 IN EFI_PCI_IO_PROTOCOL *PciIo,\r
95 IN UINT16 Port,\r
96 IN UINTN Count,\r
97 OUT VOID *Buffer\r
98 )\r
ed72955c 99;\r
878ddf1f 100\r
ed72955c 101/**\r
878ddf1f 102 TODO: Add function description\r
103\r
ed72955c 104 @param PciIo TODO: add argument description\r
105 @param Port TODO: add argument description\r
106 @param Data TODO: add argument description\r
878ddf1f 107\r
108 TODO: add return values\r
109\r
ed72955c 110**/\r
878ddf1f 111VOID\r
112IDEWritePortB (\r
113 IN EFI_PCI_IO_PROTOCOL *PciIo,\r
114 IN UINT16 Port,\r
115 IN UINT8 Data\r
116 )\r
ed72955c 117;\r
878ddf1f 118\r
ed72955c 119/**\r
878ddf1f 120 TODO: Add function description\r
121\r
ed72955c 122 @param PciIo TODO: add argument description\r
123 @param Port TODO: add argument description\r
124 @param Data TODO: add argument description\r
878ddf1f 125\r
126 TODO: add return values\r
127\r
ed72955c 128**/\r
878ddf1f 129VOID\r
130IDEWritePortW (\r
131 IN EFI_PCI_IO_PROTOCOL *PciIo,\r
132 IN UINT16 Port,\r
133 IN UINT16 Data\r
134 )\r
ed72955c 135;\r
878ddf1f 136\r
ed72955c 137/**\r
878ddf1f 138 TODO: Add function description\r
139\r
ed72955c 140 @param PciIo TODO: add argument description\r
141 @param Port TODO: add argument description\r
142 @param Count TODO: add argument description\r
143 @param Buffer TODO: add argument description\r
878ddf1f 144\r
145 TODO: add return values\r
146\r
ed72955c 147**/\r
878ddf1f 148VOID\r
149IDEWritePortWMultiple (\r
150 IN EFI_PCI_IO_PROTOCOL *PciIo,\r
151 IN UINT16 Port,\r
152 IN UINTN Count,\r
153 IN VOID *Buffer\r
154 )\r
ed72955c 155;\r
878ddf1f 156\r
ed72955c 157/**\r
878ddf1f 158 TODO: Add function description\r
159\r
ed72955c 160 @param PciIo TODO: add argument description\r
161 @param IdeRegsBaseAddr TODO: add argument description\r
878ddf1f 162\r
163 TODO: add return values\r
164\r
ed72955c 165**/\r
878ddf1f 166EFI_STATUS\r
167GetIdeRegistersBaseAddr (\r
168 IN EFI_PCI_IO_PROTOCOL *PciIo,\r
169 OUT IDE_REGISTERS_BASE_ADDR *IdeRegsBaseAddr\r
170 )\r
ed72955c 171;\r
878ddf1f 172\r
ed72955c 173/**\r
878ddf1f 174 TODO: Add function description\r
175\r
ed72955c 176 @param IdeDev TODO: add argument description\r
878ddf1f 177\r
178 TODO: add return values\r
179\r
ed72955c 180**/\r
878ddf1f 181EFI_STATUS\r
182ReassignIdeResources (\r
183 IN IDE_BLK_IO_DEV *IdeDev\r
184 )\r
ed72955c 185;\r
878ddf1f 186\r
ed72955c 187/**\r
878ddf1f 188 TODO: Add function description\r
189\r
ed72955c 190 @param IdeDev TODO: add argument description\r
878ddf1f 191\r
192 TODO: add return values\r
193\r
ed72955c 194**/\r
878ddf1f 195EFI_STATUS\r
196DiscoverIdeDevice (\r
197 IN IDE_BLK_IO_DEV *IdeDev\r
198 )\r
ed72955c 199;\r
878ddf1f 200\r
a98f11c5 201/**\r
202 This interface is used to initialize all state data related to the\r
203 detection of one channel.\r
204\r
205 @retval EFI_SUCCESS Completed successfully.\r
206\r
207**/\r
208EFI_STATUS\r
209InitializeIDEChannelData (\r
210 VOID\r
211 )\r
212;\r
213\r
ed72955c 214/**\r
878ddf1f 215 TODO: Add function description\r
216\r
ed72955c 217 @param IdeDev TODO: add argument description\r
878ddf1f 218\r
219 TODO: add return values\r
220\r
ed72955c 221**/\r
878ddf1f 222EFI_STATUS\r
223DetectIDEController (\r
224 IN IDE_BLK_IO_DEV *IdeDev\r
225 )\r
ed72955c 226;\r
878ddf1f 227\r
ed72955c 228/**\r
878ddf1f 229 TODO: Add function description\r
230\r
ed72955c 231 @param IdeDev TODO: add argument description\r
232 @param TimeoutInMilliSeconds TODO: add argument description\r
878ddf1f 233\r
234 TODO: add return values\r
235\r
ed72955c 236**/\r
878ddf1f 237EFI_STATUS\r
238DRQClear (\r
239 IN IDE_BLK_IO_DEV *IdeDev,\r
240 IN UINTN TimeoutInMilliSeconds\r
241 )\r
ed72955c 242;\r
878ddf1f 243\r
ed72955c 244/**\r
878ddf1f 245 TODO: Add function description\r
246\r
ed72955c 247 @param IdeDev TODO: add argument description\r
248 @param TimeoutInMilliSeconds TODO: add argument description\r
878ddf1f 249\r
250 TODO: add return values\r
251\r
ed72955c 252**/\r
878ddf1f 253EFI_STATUS\r
254DRQClear2 (\r
255 IN IDE_BLK_IO_DEV *IdeDev,\r
256 IN UINTN TimeoutInMilliSeconds\r
257 )\r
ed72955c 258;\r
878ddf1f 259\r
ed72955c 260/**\r
878ddf1f 261 TODO: Add function description\r
262\r
ed72955c 263 @param IdeDev TODO: add argument description\r
264 @param TimeoutInMilliSeconds TODO: add argument description\r
878ddf1f 265\r
266 TODO: add return values\r
267\r
ed72955c 268**/\r
878ddf1f 269EFI_STATUS\r
270DRQReady (\r
271 IN IDE_BLK_IO_DEV *IdeDev,\r
272 IN UINTN TimeoutInMilliSeconds\r
273 )\r
ed72955c 274;\r
878ddf1f 275\r
ed72955c 276/**\r
878ddf1f 277 TODO: Add function description\r
278\r
ed72955c 279 @param IdeDev TODO: add argument description\r
280 @param TimeoutInMilliSeconds TODO: add argument description\r
878ddf1f 281\r
282 TODO: add return values\r
283\r
ed72955c 284**/\r
878ddf1f 285EFI_STATUS\r
286DRQReady2 (\r
287 IN IDE_BLK_IO_DEV *IdeDev,\r
288 IN UINTN TimeoutInMilliSeconds\r
289 )\r
ed72955c 290;\r
878ddf1f 291\r
ed72955c 292/**\r
878ddf1f 293 TODO: Add function description\r
294\r
ed72955c 295 @param IdeDev TODO: add argument description\r
296 @param TimeoutInMilliSeconds TODO: add argument description\r
878ddf1f 297\r
298 TODO: add return values\r
299\r
ed72955c 300**/\r
878ddf1f 301EFI_STATUS\r
302WaitForBSYClear (\r
303 IN IDE_BLK_IO_DEV *IdeDev,\r
304 IN UINTN TimeoutInMilliSeconds\r
305 )\r
ed72955c 306;\r
878ddf1f 307\r
ed72955c 308/**\r
878ddf1f 309 TODO: Add function description\r
310\r
ed72955c 311 @param IdeDev TODO: add argument description\r
312 @param TimeoutInMilliSeconds TODO: add argument description\r
878ddf1f 313\r
314 TODO: add return values\r
315\r
ed72955c 316**/\r
878ddf1f 317EFI_STATUS\r
318WaitForBSYClear2 (\r
319 IN IDE_BLK_IO_DEV *IdeDev,\r
320 IN UINTN TimeoutInMilliSeconds\r
321 )\r
ed72955c 322;\r
878ddf1f 323\r
ed72955c 324/**\r
878ddf1f 325 TODO: Add function description\r
326\r
ed72955c 327 @param IdeDev TODO: add argument description\r
328 @param DelayInMilliSeconds TODO: add argument description\r
878ddf1f 329\r
330 TODO: add return values\r
331\r
ed72955c 332**/\r
878ddf1f 333EFI_STATUS\r
334DRDYReady (\r
335 IN IDE_BLK_IO_DEV *IdeDev,\r
336 IN UINTN DelayInMilliSeconds\r
337 )\r
ed72955c 338;\r
878ddf1f 339\r
ed72955c 340/**\r
878ddf1f 341 TODO: Add function description\r
342\r
ed72955c 343 @param IdeDev TODO: add argument description\r
344 @param DelayInMilliSeconds TODO: add argument description\r
878ddf1f 345\r
346 TODO: add return values\r
347\r
ed72955c 348**/\r
878ddf1f 349EFI_STATUS\r
350DRDYReady2 (\r
351 IN IDE_BLK_IO_DEV *IdeDev,\r
352 IN UINTN DelayInMilliSeconds\r
353 )\r
ed72955c 354;\r
878ddf1f 355\r
ed72955c 356/**\r
878ddf1f 357 TODO: Add function description\r
358\r
ed72955c 359 @param Destination TODO: add argument description\r
360 @param Source TODO: add argument description\r
361 @param Size TODO: add argument description\r
878ddf1f 362\r
363 TODO: add return values\r
364\r
ed72955c 365**/\r
878ddf1f 366VOID\r
367SwapStringChars (\r
368 IN CHAR8 *Destination,\r
369 IN CHAR8 *Source,\r
370 IN UINT32 Size\r
371 )\r
ed72955c 372;\r
878ddf1f 373\r
ed72955c 374//\r
375// ATA device functions' prototype\r
376//\r
377/**\r
878ddf1f 378 TODO: Add function description\r
379\r
ed72955c 380 @param IdeDev TODO: add argument description\r
878ddf1f 381\r
382 TODO: add return values\r
383\r
ed72955c 384**/\r
878ddf1f 385EFI_STATUS\r
386ATAIdentify (\r
387 IN IDE_BLK_IO_DEV *IdeDev\r
388 )\r
ed72955c 389;\r
878ddf1f 390\r
ed72955c 391/**\r
878ddf1f 392 TODO: Add function description\r
393\r
ed72955c 394 @param IdeDev TODO: add argument description\r
878ddf1f 395\r
396 TODO: add return values\r
397\r
ed72955c 398**/\r
878ddf1f 399VOID\r
400PrintAtaModuleName (\r
401 IN IDE_BLK_IO_DEV *IdeDev\r
402 )\r
ed72955c 403;\r
878ddf1f 404\r
ed72955c 405/**\r
878ddf1f 406 TODO: Add function description\r
407\r
ed72955c 408 @param IdeDev TODO: add argument description\r
409 @param Buffer TODO: add argument description\r
410 @param ByteCount TODO: add argument description\r
411 @param AtaCommand TODO: add argument description\r
412 @param Head TODO: add argument description\r
413 @param SectorCount TODO: add argument description\r
414 @param SectorNumber TODO: add argument description\r
415 @param CylinderLsb TODO: add argument description\r
416 @param CylinderMsb TODO: add argument description\r
878ddf1f 417\r
418 TODO: add return values\r
419\r
ed72955c 420**/\r
878ddf1f 421EFI_STATUS\r
422AtaPioDataIn (\r
423 IN IDE_BLK_IO_DEV *IdeDev,\r
424 IN VOID *Buffer,\r
425 IN UINT32 ByteCount,\r
426 IN UINT8 AtaCommand,\r
427 IN UINT8 Head,\r
428 IN UINT8 SectorCount,\r
429 IN UINT8 SectorNumber,\r
430 IN UINT8 CylinderLsb,\r
431 IN UINT8 CylinderMsb\r
432 )\r
ed72955c 433;\r
878ddf1f 434\r
ed72955c 435/**\r
878ddf1f 436 TODO: Add function description\r
437\r
ed72955c 438 @param IdeDev TODO: add argument description\r
439 @param Buffer TODO: add argument description\r
440 @param ByteCount TODO: add argument description\r
441 @param AtaCommand TODO: add argument description\r
442 @param Head TODO: add argument description\r
443 @param SectorCount TODO: add argument description\r
444 @param SectorNumber TODO: add argument description\r
445 @param CylinderLsb TODO: add argument description\r
446 @param CylinderMsb TODO: add argument description\r
878ddf1f 447\r
448 TODO: add return values\r
449\r
ed72955c 450**/\r
878ddf1f 451EFI_STATUS\r
452AtaPioDataOut (\r
453 IN IDE_BLK_IO_DEV *IdeDev,\r
454 IN VOID *Buffer,\r
455 IN UINT32 ByteCount,\r
456 IN UINT8 AtaCommand,\r
457 IN UINT8 Head,\r
458 IN UINT8 SectorCount,\r
459 IN UINT8 SectorNumber,\r
460 IN UINT8 CylinderLsb,\r
461 IN UINT8 CylinderMsb\r
462 )\r
ed72955c 463;\r
878ddf1f 464\r
ed72955c 465/**\r
878ddf1f 466 TODO: Add function description\r
467\r
ed72955c 468 @param IdeDev TODO: add argument description\r
878ddf1f 469\r
470 TODO: add return values\r
471\r
ed72955c 472**/\r
878ddf1f 473EFI_STATUS\r
474CheckErrorStatus (\r
475 IN IDE_BLK_IO_DEV *IdeDev\r
476 )\r
ed72955c 477;\r
878ddf1f 478\r
ed72955c 479/**\r
878ddf1f 480 TODO: Add function description\r
481\r
ed72955c 482 @param IdeDev TODO: add argument description\r
483 @param DataBuffer TODO: add argument description\r
484 @param Lba TODO: add argument description\r
485 @param NumberOfBlocks TODO: add argument description\r
878ddf1f 486\r
487 TODO: add return values\r
488\r
ed72955c 489**/\r
878ddf1f 490EFI_STATUS\r
491AtaReadSectors (\r
492 IN IDE_BLK_IO_DEV *IdeDev,\r
493 IN VOID *DataBuffer,\r
494 IN EFI_LBA Lba,\r
495 IN UINTN NumberOfBlocks\r
496 )\r
ed72955c 497;\r
878ddf1f 498\r
ed72955c 499/**\r
878ddf1f 500 TODO: Add function description\r
501\r
ed72955c 502 @param IdeDev TODO: add argument description\r
503 @param BufferData TODO: add argument description\r
504 @param Lba TODO: add argument description\r
505 @param NumberOfBlocks TODO: add argument description\r
878ddf1f 506\r
507 TODO: add return values\r
508\r
ed72955c 509**/\r
878ddf1f 510EFI_STATUS\r
511AtaWriteSectors (\r
512 IN IDE_BLK_IO_DEV *IdeDev,\r
513 IN VOID *BufferData,\r
514 IN EFI_LBA Lba,\r
515 IN UINTN NumberOfBlocks\r
516 )\r
ed72955c 517;\r
878ddf1f 518\r
ed72955c 519/**\r
878ddf1f 520 TODO: Add function description\r
521\r
ed72955c 522 @param IdeDev TODO: add argument description\r
878ddf1f 523\r
524 TODO: add return values\r
525\r
ed72955c 526**/\r
878ddf1f 527EFI_STATUS\r
528AtaSoftReset (\r
529 IN IDE_BLK_IO_DEV *IdeDev\r
530 )\r
ed72955c 531;\r
878ddf1f 532\r
ed72955c 533/**\r
878ddf1f 534 TODO: Add function description\r
535\r
ed72955c 536 @param IdeBlkIoDevice TODO: add argument description\r
537 @param MediaId TODO: add argument description\r
538 @param LBA TODO: add argument description\r
539 @param BufferSize TODO: add argument description\r
540 @param Buffer TODO: add argument description\r
878ddf1f 541\r
542 TODO: add return values\r
543\r
ed72955c 544**/\r
878ddf1f 545EFI_STATUS\r
546AtaBlkIoReadBlocks (\r
547 IN IDE_BLK_IO_DEV *IdeBlkIoDevice,\r
548 IN UINT32 MediaId,\r
549 IN EFI_LBA LBA,\r
550 IN UINTN BufferSize,\r
551 OUT VOID *Buffer\r
552 )\r
ed72955c 553;\r
878ddf1f 554\r
ed72955c 555/**\r
878ddf1f 556 TODO: Add function description\r
557\r
ed72955c 558 @param IdeBlkIoDevice TODO: add argument description\r
559 @param MediaId TODO: add argument description\r
560 @param LBA TODO: add argument description\r
561 @param BufferSize TODO: add argument description\r
562 @param Buffer TODO: add argument description\r
878ddf1f 563\r
564 TODO: add return values\r
565\r
ed72955c 566**/\r
878ddf1f 567EFI_STATUS\r
568AtaBlkIoWriteBlocks (\r
569 IN IDE_BLK_IO_DEV *IdeBlkIoDevice,\r
570 IN UINT32 MediaId,\r
571 IN EFI_LBA LBA,\r
572 IN UINTN BufferSize,\r
573 OUT VOID *Buffer\r
574 )\r
ed72955c 575;\r
878ddf1f 576\r
ed72955c 577//\r
578// ATAPI device functions' prototype\r
579//\r
580/**\r
878ddf1f 581 TODO: Add function description\r
582\r
ed72955c 583 @param IdeDev TODO: add argument description\r
878ddf1f 584\r
585 TODO: add return values\r
586\r
ed72955c 587**/\r
878ddf1f 588EFI_STATUS\r
589ATAPIIdentify (\r
590 IN IDE_BLK_IO_DEV *IdeDev\r
591 )\r
ed72955c 592;\r
878ddf1f 593\r
ed72955c 594/**\r
878ddf1f 595 TODO: Add function description\r
596\r
ed72955c 597 @param IdeDev TODO: add argument description\r
878ddf1f 598\r
599 TODO: add return values\r
600\r
ed72955c 601**/\r
878ddf1f 602EFI_STATUS\r
603AtapiInquiry (\r
604 IN IDE_BLK_IO_DEV *IdeDev\r
605 )\r
ed72955c 606;\r
878ddf1f 607\r
ed72955c 608/**\r
878ddf1f 609 TODO: Add function description\r
610\r
ed72955c 611 @param IdeDev TODO: add argument description\r
612 @param Packet TODO: add argument description\r
613 @param Buffer TODO: add argument description\r
614 @param ByteCount TODO: add argument description\r
615 @param TimeOut TODO: add argument description\r
878ddf1f 616\r
617 TODO: add return values\r
618\r
ed72955c 619**/\r
878ddf1f 620EFI_STATUS\r
621AtapiPacketCommandIn (\r
622 IN IDE_BLK_IO_DEV *IdeDev,\r
623 IN ATAPI_PACKET_COMMAND *Packet,\r
624 IN UINT16 *Buffer,\r
625 IN UINT32 ByteCount,\r
626 IN UINTN TimeOut\r
627 )\r
ed72955c 628;\r
878ddf1f 629\r
ed72955c 630/**\r
878ddf1f 631 TODO: Add function description\r
632\r
ed72955c 633 @param IdeDev TODO: add argument description\r
634 @param Packet TODO: add argument description\r
635 @param Buffer TODO: add argument description\r
636 @param ByteCount TODO: add argument description\r
637 @param TimeOut TODO: add argument description\r
878ddf1f 638\r
639 TODO: add return values\r
640\r
ed72955c 641**/\r
878ddf1f 642EFI_STATUS\r
643AtapiPacketCommandOut (\r
644 IN IDE_BLK_IO_DEV *IdeDev,\r
645 IN ATAPI_PACKET_COMMAND *Packet,\r
646 IN UINT16 *Buffer,\r
647 IN UINT32 ByteCount,\r
648 IN UINTN TimeOut\r
649 )\r
ed72955c 650;\r
878ddf1f 651\r
ed72955c 652/**\r
878ddf1f 653 TODO: Add function description\r
654\r
ed72955c 655 @param IdeDev TODO: add argument description\r
656 @param Buffer TODO: add argument description\r
657 @param ByteCount TODO: add argument description\r
658 @param Read TODO: add argument description\r
659 @param TimeOut TODO: add argument description\r
878ddf1f 660\r
661 TODO: add return values\r
662\r
ed72955c 663**/\r
878ddf1f 664EFI_STATUS\r
665PioReadWriteData (\r
666 IN IDE_BLK_IO_DEV *IdeDev,\r
667 IN UINT16 *Buffer,\r
668 IN UINT32 ByteCount,\r
669 IN BOOLEAN Read,\r
670 IN UINTN TimeOut\r
671 )\r
ed72955c 672;\r
878ddf1f 673\r
ed72955c 674/**\r
878ddf1f 675 TODO: Add function description\r
676\r
a98f11c5 677 @param IdeDev TODO: add argument description\r
ed72955c 678 @param IdeDev TODO: add argument description\r
878ddf1f 679\r
680 TODO: add return values\r
681\r
ed72955c 682**/\r
878ddf1f 683EFI_STATUS\r
684AtapiTestUnitReady (\r
a98f11c5 685 IN IDE_BLK_IO_DEV *IdeDev,\r
686 OUT UINTN *SenseCount\r
878ddf1f 687 )\r
ed72955c 688;\r
878ddf1f 689\r
ed72955c 690/**\r
878ddf1f 691 TODO: Add function description\r
692\r
ed72955c 693 @param IdeDev TODO: add argument description\r
694 @param SenseCounts TODO: add argument description\r
878ddf1f 695\r
696 TODO: add return values\r
697\r
ed72955c 698**/\r
878ddf1f 699EFI_STATUS\r
700AtapiRequestSense (\r
701 IN IDE_BLK_IO_DEV *IdeDev,\r
702 OUT UINTN *SenseCounts\r
703 )\r
ed72955c 704;\r
878ddf1f 705\r
ed72955c 706/**\r
878ddf1f 707 TODO: Add function description\r
708\r
a98f11c5 709 @param IdeDev TODO: add argument description\r
ed72955c 710 @param IdeDev TODO: add argument description\r
878ddf1f 711\r
712 TODO: add return values\r
713\r
ed72955c 714**/\r
878ddf1f 715EFI_STATUS\r
716AtapiReadCapacity (\r
a98f11c5 717 IN IDE_BLK_IO_DEV *IdeDev,\r
718 OUT UINTN *SenseCount\r
878ddf1f 719 )\r
ed72955c 720;\r
878ddf1f 721\r
ed72955c 722/**\r
878ddf1f 723 TODO: Add function description\r
724\r
ed72955c 725 @param IdeDev TODO: add argument description\r
726 @param MediaChange TODO: add argument description\r
878ddf1f 727\r
728 TODO: add return values\r
729\r
ed72955c 730**/\r
878ddf1f 731EFI_STATUS\r
732AtapiDetectMedia (\r
733 IN IDE_BLK_IO_DEV *IdeDev,\r
734 OUT BOOLEAN *MediaChange\r
735 )\r
ed72955c 736;\r
878ddf1f 737\r
ed72955c 738/**\r
878ddf1f 739 TODO: Add function description\r
740\r
ed72955c 741 @param IdeDev TODO: add argument description\r
742 @param Buffer TODO: add argument description\r
743 @param Lba TODO: add argument description\r
744 @param NumberOfBlocks TODO: add argument description\r
878ddf1f 745\r
746 TODO: add return values\r
747\r
ed72955c 748**/\r
878ddf1f 749EFI_STATUS\r
750AtapiReadSectors (\r
751 IN IDE_BLK_IO_DEV *IdeDev,\r
752 IN VOID *Buffer,\r
753 IN EFI_LBA Lba,\r
754 IN UINTN NumberOfBlocks\r
755 )\r
ed72955c 756;\r
878ddf1f 757\r
ed72955c 758/**\r
878ddf1f 759 TODO: Add function description\r
760\r
ed72955c 761 @param IdeDev TODO: add argument description\r
762 @param Buffer TODO: add argument description\r
763 @param Lba TODO: add argument description\r
764 @param NumberOfBlocks TODO: add argument description\r
878ddf1f 765\r
766 TODO: add return values\r
767\r
ed72955c 768**/\r
878ddf1f 769EFI_STATUS\r
770AtapiWriteSectors (\r
771 IN IDE_BLK_IO_DEV *IdeDev,\r
772 IN VOID *Buffer,\r
773 IN EFI_LBA Lba,\r
774 IN UINTN NumberOfBlocks\r
775 )\r
ed72955c 776;\r
878ddf1f 777\r
ed72955c 778/**\r
878ddf1f 779 TODO: Add function description\r
780\r
ed72955c 781 @param IdeDev TODO: add argument description\r
878ddf1f 782\r
783 TODO: add return values\r
784\r
ed72955c 785**/\r
878ddf1f 786EFI_STATUS\r
787AtapiSoftReset (\r
788 IN IDE_BLK_IO_DEV *IdeDev\r
789 )\r
ed72955c 790;\r
878ddf1f 791\r
ed72955c 792/**\r
878ddf1f 793 TODO: Add function description\r
794\r
ed72955c 795 @param IdeBlkIoDevice TODO: add argument description\r
796 @param MediaId TODO: add argument description\r
797 @param LBA TODO: add argument description\r
798 @param BufferSize TODO: add argument description\r
799 @param Buffer TODO: add argument description\r
878ddf1f 800\r
801 TODO: add return values\r
802\r
ed72955c 803**/\r
878ddf1f 804EFI_STATUS\r
805AtapiBlkIoReadBlocks (\r
806 IN IDE_BLK_IO_DEV *IdeBlkIoDevice,\r
807 IN UINT32 MediaId,\r
808 IN EFI_LBA LBA,\r
809 IN UINTN BufferSize,\r
810 OUT VOID *Buffer\r
811 )\r
ed72955c 812;\r
878ddf1f 813\r
ed72955c 814/**\r
878ddf1f 815 TODO: Add function description\r
816\r
ed72955c 817 @param IdeBlkIoDevice TODO: add argument description\r
818 @param MediaId TODO: add argument description\r
819 @param LBA TODO: add argument description\r
820 @param BufferSize TODO: add argument description\r
821 @param Buffer TODO: add argument description\r
878ddf1f 822\r
823 TODO: add return values\r
824\r
ed72955c 825**/\r
878ddf1f 826EFI_STATUS\r
827AtapiBlkIoWriteBlocks (\r
828 IN IDE_BLK_IO_DEV *IdeBlkIoDevice,\r
829 IN UINT32 MediaId,\r
830 IN EFI_LBA LBA,\r
831 IN UINTN BufferSize,\r
832 OUT VOID *Buffer\r
833 )\r
ed72955c 834;\r
878ddf1f 835\r
ed72955c 836/**\r
878ddf1f 837 TODO: Add function description\r
838\r
a98f11c5 839 @param IdeDev TODO: add argument description\r
840 @param SenseCount TODO: add argument description\r
841 @param Result TODO: add argument description\r
878ddf1f 842\r
843 TODO: add return values\r
844\r
ed72955c 845**/\r
a98f11c5 846EFI_STATUS\r
847ParseSenseData (\r
848 IN IDE_BLK_IO_DEV *IdeDev,\r
849 IN UINTN SenseCount,\r
850 OUT SENSE_RESULT *Result\r
878ddf1f 851 )\r
ed72955c 852;\r
878ddf1f 853\r
ed72955c 854/**\r
878ddf1f 855 TODO: Add function description\r
856\r
a98f11c5 857 @param IdeDev TODO: add argument description\r
878ddf1f 858\r
859 TODO: add return values\r
860\r
ed72955c 861**/\r
a98f11c5 862EFI_STATUS\r
863AtapiReadPendingData (\r
864 IN IDE_BLK_IO_DEV *IdeDev\r
878ddf1f 865 )\r
ed72955c 866;\r
878ddf1f 867\r
ed72955c 868/**\r
878ddf1f 869 TODO: Add function description\r
870\r
ed72955c 871 @param IdeDev TODO: add argument description\r
872 @param WriteProtected TODO: add argument description\r
878ddf1f 873\r
874 TODO: add return values\r
875\r
ed72955c 876**/\r
878ddf1f 877EFI_STATUS\r
878IsLS120orZipWriteProtected (\r
879 IN IDE_BLK_IO_DEV *IdeDev,\r
880 OUT BOOLEAN *WriteProtected\r
881 )\r
ed72955c 882;\r
878ddf1f 883\r
ed72955c 884/**\r
878ddf1f 885 TODO: Add function description\r
886\r
ed72955c 887 @param IdeBlkIoDevice TODO: add argument description\r
878ddf1f 888\r
889 TODO: add return values\r
890\r
ed72955c 891**/\r
878ddf1f 892VOID\r
893ReleaseIdeResources (\r
894 IN IDE_BLK_IO_DEV *IdeBlkIoDevice\r
895 )\r
ed72955c 896;\r
878ddf1f 897\r
ed72955c 898/**\r
878ddf1f 899 TODO: Add function description\r
900\r
ed72955c 901 @param IdeDev TODO: add argument description\r
902 @param TransferMode TODO: add argument description\r
878ddf1f 903\r
904 TODO: add return values\r
905\r
ed72955c 906**/\r
878ddf1f 907EFI_STATUS\r
908SetDeviceTransferMode (\r
909 IN IDE_BLK_IO_DEV *IdeDev,\r
910 IN ATA_TRANSFER_MODE *TransferMode\r
911 )\r
ed72955c 912;\r
878ddf1f 913\r
ed72955c 914/**\r
878ddf1f 915 TODO: Add function description\r
916\r
ed72955c 917 @param IdeDev TODO: add argument description\r
918 @param NativeMaxAddress TODO: add argument description\r
878ddf1f 919\r
920 TODO: add return values\r
921\r
ed72955c 922**/\r
878ddf1f 923EFI_STATUS\r
924ReadNativeMaxAddress (\r
925 IN IDE_BLK_IO_DEV *IdeDev,\r
926 OUT EFI_LBA *NativeMaxAddress\r
927 )\r
ed72955c 928;\r
878ddf1f 929\r
ed72955c 930/**\r
878ddf1f 931 TODO: Add function description\r
932\r
ed72955c 933 @param IdeDev TODO: add argument description\r
934 @param MaxAddress TODO: add argument description\r
935 @param bVolatile TODO: add argument description\r
878ddf1f 936\r
937 TODO: add return values\r
938\r
ed72955c 939**/\r
878ddf1f 940EFI_STATUS\r
941SetMaxAddress (\r
942 IN IDE_BLK_IO_DEV *IdeDev,\r
943 IN EFI_LBA MaxAddress,\r
944 IN BOOLEAN bVolatile\r
945 )\r
ed72955c 946;\r
878ddf1f 947\r
ed72955c 948/**\r
878ddf1f 949 TODO: Add function description\r
950\r
ed72955c 951 @param IdeDev TODO: add argument description\r
952 @param AtaCommand TODO: add argument description\r
953 @param Device TODO: add argument description\r
954 @param Feature TODO: add argument description\r
955 @param SectorCount TODO: add argument description\r
956 @param LbaLow TODO: add argument description\r
957 @param LbaMiddle TODO: add argument description\r
958 @param LbaHigh TODO: add argument description\r
878ddf1f 959\r
960 TODO: add return values\r
961\r
ed72955c 962**/\r
878ddf1f 963EFI_STATUS\r
964AtaNonDataCommandIn (\r
965 IN IDE_BLK_IO_DEV *IdeDev,\r
966 IN UINT8 AtaCommand,\r
967 IN UINT8 Device,\r
968 IN UINT8 Feature,\r
969 IN UINT8 SectorCount,\r
970 IN UINT8 LbaLow,\r
971 IN UINT8 LbaMiddle,\r
972 IN UINT8 LbaHigh\r
973 )\r
ed72955c 974;\r
878ddf1f 975\r
ed72955c 976/**\r
878ddf1f 977 TODO: Add function description\r
978\r
ed72955c 979 @param IdeDev TODO: add argument description\r
980 @param AtaCommand TODO: add argument description\r
981 @param Device TODO: add argument description\r
982 @param Feature TODO: add argument description\r
983 @param SectorCount TODO: add argument description\r
984 @param LbaAddress TODO: add argument description\r
878ddf1f 985\r
986 TODO: add return values\r
987\r
ed72955c 988**/\r
878ddf1f 989EFI_STATUS\r
990AtaNonDataCommandInExt (\r
991 IN IDE_BLK_IO_DEV *IdeDev,\r
992 IN UINT8 AtaCommand,\r
993 IN UINT8 Device,\r
994 IN UINT16 Feature,\r
995 IN UINT16 SectorCount,\r
996 IN EFI_LBA LbaAddress\r
997 )\r
ed72955c 998;\r
878ddf1f 999\r
ed72955c 1000/**\r
878ddf1f 1001 TODO: Add function description\r
1002\r
ed72955c 1003 @param IdeDev TODO: add argument description\r
1004 @param DataBuffer TODO: add argument description\r
1005 @param StartLba TODO: add argument description\r
1006 @param NumberOfBlocks TODO: add argument description\r
878ddf1f 1007\r
1008 TODO: add return values\r
1009\r
ed72955c 1010**/\r
878ddf1f 1011EFI_STATUS\r
1012AtaReadSectorsExt (\r
1013 IN IDE_BLK_IO_DEV *IdeDev,\r
1014 IN VOID *DataBuffer,\r
1015 IN EFI_LBA StartLba,\r
1016 IN UINTN NumberOfBlocks\r
1017 )\r
ed72955c 1018;\r
878ddf1f 1019\r
ed72955c 1020/**\r
878ddf1f 1021 TODO: Add function description\r
1022\r
ed72955c 1023 @param IdeDev TODO: add argument description\r
1024 @param DataBuffer TODO: add argument description\r
1025 @param StartLba TODO: add argument description\r
1026 @param NumberOfBlocks TODO: add argument description\r
878ddf1f 1027\r
1028 TODO: add return values\r
1029\r
ed72955c 1030**/\r
878ddf1f 1031EFI_STATUS\r
1032AtaWriteSectorsExt (\r
1033 IN IDE_BLK_IO_DEV *IdeDev,\r
1034 IN VOID *DataBuffer,\r
1035 IN EFI_LBA StartLba,\r
1036 IN UINTN NumberOfBlocks\r
1037 )\r
ed72955c 1038;\r
878ddf1f 1039\r
ed72955c 1040/**\r
878ddf1f 1041 TODO: Add function description\r
1042\r
ed72955c 1043 @param IdeDev TODO: add argument description\r
1044 @param DataBuffer TODO: add argument description\r
1045 @param StartLba TODO: add argument description\r
1046 @param NumberOfBlocks TODO: add argument description\r
878ddf1f 1047\r
1048 TODO: add return values\r
1049\r
ed72955c 1050**/\r
878ddf1f 1051EFI_STATUS\r
1052AtaUdmaReadExt (\r
1053 IN IDE_BLK_IO_DEV *IdeDev,\r
1054 IN VOID *DataBuffer,\r
1055 IN EFI_LBA StartLba,\r
1056 IN UINTN NumberOfBlocks\r
1057 )\r
ed72955c 1058;\r
878ddf1f 1059\r
ed72955c 1060/**\r
878ddf1f 1061 TODO: Add function description\r
1062\r
ed72955c 1063 @param IdeDev TODO: add argument description\r
1064 @param DataBuffer TODO: add argument description\r
1065 @param StartLba TODO: add argument description\r
1066 @param NumberOfBlocks TODO: add argument description\r
878ddf1f 1067\r
1068 TODO: add return values\r
1069\r
ed72955c 1070**/\r
878ddf1f 1071EFI_STATUS\r
1072AtaUdmaRead (\r
1073 IN IDE_BLK_IO_DEV *IdeDev,\r
1074 IN VOID *DataBuffer,\r
1075 IN EFI_LBA StartLba,\r
1076 IN UINTN NumberOfBlocks\r
1077 )\r
ed72955c 1078;\r
878ddf1f 1079\r
ed72955c 1080/**\r
878ddf1f 1081 TODO: Add function description\r
1082\r
ed72955c 1083 @param IdeDev TODO: add argument description\r
1084 @param DataBuffer TODO: add argument description\r
1085 @param StartLba TODO: add argument description\r
1086 @param NumberOfBlocks TODO: add argument description\r
878ddf1f 1087\r
1088 TODO: add return values\r
1089\r
ed72955c 1090**/\r
878ddf1f 1091EFI_STATUS\r
1092AtaUdmaWriteExt (\r
1093 IN IDE_BLK_IO_DEV *IdeDev,\r
1094 IN VOID *DataBuffer,\r
1095 IN EFI_LBA StartLba,\r
1096 IN UINTN NumberOfBlocks\r
1097 )\r
ed72955c 1098;\r
878ddf1f 1099\r
bc4e770c 1100/**\r
1101 Perform an ATA Udma operation (Read, ReadExt, Write, WriteExt).\r
1102 \r
1103 @param[in] *IdeDev\r
1104 pointer pointing to IDE_BLK_IO_DEV data structure, used\r
1105 to record all the information of the IDE device.\r
1106\r
1107 @param[in] *DataBuffer\r
1108 A pointer to the source buffer for the data.\r
1109\r
1110 @param[in] StartLba\r
1111 The starting logical block address to write to\r
1112 on the device media.\r
1113\r
1114 @param[in] NumberOfBlocks\r
1115 The number of transfer data blocks.\r
1116 \r
1117 @param[in] UdmaOp\r
1118 The perform operations could be AtaUdmaReadOp, AtaUdmaReadExOp,\r
1119 AtaUdmaWriteOp, AtaUdmaWriteExOp\r
1120\r
1121 @return The device status of UDMA operation. If the operation is\r
1122 successful, return EFI_SUCCESS.\r
1123\r
1124**/\r
1125EFI_STATUS\r
1126DoAtaUdma (\r
1127 IN IDE_BLK_IO_DEV *IdeDev,\r
1128 IN VOID *DataBuffer,\r
1129 IN EFI_LBA StartLba,\r
1130 IN UINTN NumberOfBlocks,\r
1131 IN ATA_UDMA_OPERATION UdmaOp\r
1132 )\r
1133;\r
1134\r
1135\r
ed72955c 1136/**\r
878ddf1f 1137 TODO: Add function description\r
1138\r
ed72955c 1139 @param IdeDev TODO: add argument description\r
1140 @param DataBuffer TODO: add argument description\r
1141 @param StartLba TODO: add argument description\r
1142 @param NumberOfBlocks TODO: add argument description\r
878ddf1f 1143\r
1144 TODO: add return values\r
1145\r
ed72955c 1146**/\r
878ddf1f 1147EFI_STATUS\r
1148AtaUdmaWrite (\r
1149 IN IDE_BLK_IO_DEV *IdeDev,\r
1150 IN VOID *DataBuffer,\r
1151 IN EFI_LBA StartLba,\r
1152 IN UINTN NumberOfBlocks\r
1153 )\r
ed72955c 1154;\r
878ddf1f 1155\r
ed72955c 1156/**\r
878ddf1f 1157 TODO: Add function description\r
1158\r
ed72955c 1159 @param IdeDev TODO: add argument description\r
1160 @param AtaCommand TODO: add argument description\r
1161 @param Device TODO: add argument description\r
1162 @param Feature TODO: add argument description\r
1163 @param SectorCount TODO: add argument description\r
1164 @param LbaAddress TODO: add argument description\r
878ddf1f 1165\r
1166 TODO: add return values\r
1167\r
ed72955c 1168**/\r
878ddf1f 1169EFI_STATUS\r
1170AtaCommandIssueExt (\r
1171 IN IDE_BLK_IO_DEV *IdeDev,\r
1172 IN UINT8 AtaCommand,\r
1173 IN UINT8 Device,\r
1174 IN UINT16 Feature,\r
1175 IN UINT16 SectorCount,\r
1176 IN EFI_LBA LbaAddress\r
1177 )\r
ed72955c 1178;\r
878ddf1f 1179\r
ed72955c 1180/**\r
878ddf1f 1181 TODO: Add function description\r
1182\r
ed72955c 1183 @param IdeDev TODO: add argument description\r
1184 @param AtaCommand TODO: add argument description\r
1185 @param Device TODO: add argument description\r
1186 @param Feature TODO: add argument description\r
1187 @param SectorCount TODO: add argument description\r
1188 @param LbaAddress TODO: add argument description\r
878ddf1f 1189\r
1190 TODO: add return values\r
1191\r
ed72955c 1192**/\r
878ddf1f 1193EFI_STATUS\r
1194AtaCommandIssue (\r
1195 IN IDE_BLK_IO_DEV *IdeDev,\r
1196 IN UINT8 AtaCommand,\r
1197 IN UINT8 Device,\r
1198 IN UINT16 Feature,\r
1199 IN UINT16 SectorCount,\r
1200 IN EFI_LBA LbaAddress\r
1201 )\r
ed72955c 1202;\r
878ddf1f 1203\r
ed72955c 1204/**\r
878ddf1f 1205 TODO: Add function description\r
1206\r
ed72955c 1207 @param IdeDev TODO: add argument description\r
878ddf1f 1208\r
1209 TODO: add return values\r
1210\r
ed72955c 1211**/\r
878ddf1f 1212EFI_STATUS\r
1213AtaAtapi6Identify (\r
1214 IN IDE_BLK_IO_DEV *IdeDev\r
1215 )\r
ed72955c 1216;\r
878ddf1f 1217\r
878ddf1f 1218\r
ed72955c 1219/**\r
878ddf1f 1220 TODO: Add function description\r
1221\r
ed72955c 1222 @param IdeDev TODO: add argument description\r
878ddf1f 1223\r
1224 TODO: add return values\r
1225\r
ed72955c 1226**/\r
878ddf1f 1227VOID\r
1228AtaSMARTSupport (\r
1229 IN IDE_BLK_IO_DEV *IdeDev\r
1230 )\r
ed72955c 1231;\r
878ddf1f 1232\r
ed72955c 1233/**\r
878ddf1f 1234 TODO: Add function description\r
1235\r
ed72955c 1236 @param IdeDev TODO: add argument description\r
1237 @param Buffer TODO: add argument description\r
1238 @param ByteCount TODO: add argument description\r
1239 @param AtaCommand TODO: add argument description\r
1240 @param StartLba TODO: add argument description\r
1241 @param SectorCount TODO: add argument description\r
878ddf1f 1242\r
1243 TODO: add return values\r
1244\r
ed72955c 1245**/\r
878ddf1f 1246EFI_STATUS\r
1247AtaPioDataInExt (\r
1248 IN IDE_BLK_IO_DEV *IdeDev,\r
1249 IN OUT VOID *Buffer,\r
1250 IN UINT32 ByteCount,\r
1251 IN UINT8 AtaCommand,\r
1252 IN EFI_LBA StartLba,\r
1253 IN UINT16 SectorCount\r
1254 )\r
ed72955c 1255;\r
878ddf1f 1256\r
ed72955c 1257/**\r
878ddf1f 1258 TODO: Add function description\r
1259\r
ed72955c 1260 @param IdeDev TODO: add argument description\r
1261 @param Buffer TODO: add argument description\r
1262 @param ByteCount TODO: add argument description\r
1263 @param AtaCommand TODO: add argument description\r
1264 @param StartLba TODO: add argument description\r
1265 @param SectorCount TODO: add argument description\r
878ddf1f 1266\r
1267 TODO: add return values\r
1268\r
ed72955c 1269**/\r
878ddf1f 1270EFI_STATUS\r
1271AtaPioDataOutExt (\r
1272 IN IDE_BLK_IO_DEV *IdeDev,\r
1273 IN VOID *Buffer,\r
1274 IN UINT32 ByteCount,\r
1275 IN UINT8 AtaCommand,\r
1276 IN EFI_LBA StartLba,\r
1277 IN UINT16 SectorCount\r
1278 )\r
ed72955c 1279;\r
878ddf1f 1280\r
ed72955c 1281/**\r
878ddf1f 1282 TODO: Add function description\r
1283\r
ed72955c 1284 @param IdeDev TODO: add argument description\r
1285 @param DriveParameters TODO: add argument description\r
878ddf1f 1286\r
1287 TODO: add return values\r
1288\r
ed72955c 1289**/\r
878ddf1f 1290EFI_STATUS\r
1291SetDriveParameters (\r
1292 IN IDE_BLK_IO_DEV *IdeDev,\r
1293 IN ATA_DRIVE_PARMS *DriveParameters\r
1294 )\r
ed72955c 1295;\r
878ddf1f 1296\r
ed72955c 1297/**\r
878ddf1f 1298 TODO: Add function description\r
1299\r
ed72955c 1300 @param IdeDev TODO: add argument description\r
878ddf1f 1301\r
1302 TODO: add return values\r
1303\r
ed72955c 1304**/\r
878ddf1f 1305EFI_STATUS\r
1306EnableInterrupt (\r
1307 IN IDE_BLK_IO_DEV *IdeDev\r
1308 )\r
878ddf1f 1309;\r
a98f11c5 1310\r
905dd497 1311/**\r
1312 Clear pending IDE interrupt before OS loader/kernel take control of the IDE device.\r
1313\r
1314 @param[in] Event Pointer to this event\r
1315 @param[in] Context Event hanlder private data\r
1316\r
1317 @retval EFI_SUCCESS - Interrupt cleared\r
1318\r
1319**/\r
66ce26da 1320VOID\r
1321EFIAPI\r
905dd497 1322ClearInterrupt (\r
1323 IN EFI_EVENT Event,\r
1324 IN VOID *Context\r
1325 )\r
1326;\r
878ddf1f 1327\r
1328#endif\r