]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Pci/IdeBus/Dxe/ide.h
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
index 177e842714b6f24b196818aec97c7dd0481d5b96..f382279ab54f0bf4fb83eb0b63d23325631938cd 100644 (file)
@@ -1,15 +1,15 @@
 /** @file\r
-  Header file for IDE Bus Driver, containing the helper functions' \r
+  Header file for IDE Bus Driver, containing the helper functions'\r
   entire prototype.\r
 \r
-  Copyright (c) 2006, Intel Corporation                                                         \r
-  All rights reserved. This program and the accompanying materials                          \r
-  are licensed and made available under the terms and conditions of the BSD License         \r
-  which accompanies this distribution.  The full text of the license may be found at        \r
-  http://opensource.org/licenses/bsd-license.php                                            \r
+  Copyright (c) 2006, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
 \r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
   @par Revision Reference:\r
   2002-6: Add Atapi6 enhancement, support >120GB hard disk, including\r
@@ -198,6 +198,19 @@ DiscoverIdeDevice (
   )\r
 ;\r
 \r
+/**\r
+  This interface is used to initialize all state data related to the\r
+  detection of one channel.\r
+\r
+  @retval EFI_SUCCESS Completed successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+InitializeIDEChannelData (\r
+  VOID\r
+  )\r
+;\r
+\r
 /**\r
   TODO: Add function description\r
 \r
@@ -661,6 +674,7 @@ PioReadWriteData (
 /**\r
   TODO: Add function description\r
 \r
+  @param  IdeDev TODO: add argument description\r
   @param  IdeDev TODO: add argument description\r
 \r
   TODO: add return values\r
@@ -668,7 +682,8 @@ PioReadWriteData (
 **/\r
 EFI_STATUS\r
 AtapiTestUnitReady (\r
-  IN  IDE_BLK_IO_DEV  *IdeDev\r
+  IN  IDE_BLK_IO_DEV  *IdeDev,\r
+  OUT UINTN           *SenseCount\r
   )\r
 ;\r
 \r
@@ -691,6 +706,7 @@ AtapiRequestSense (
 /**\r
   TODO: Add function description\r
 \r
+  @param  IdeDev TODO: add argument description\r
   @param  IdeDev TODO: add argument description\r
 \r
   TODO: add return values\r
@@ -698,7 +714,8 @@ AtapiRequestSense (
 **/\r
 EFI_STATUS\r
 AtapiReadCapacity (\r
-  IN  IDE_BLK_IO_DEV  *IdeDev\r
+  IN  IDE_BLK_IO_DEV  *IdeDev,\r
+  OUT UINTN           *SenseCount\r
   )\r
 ;\r
 \r
@@ -819,82 +836,32 @@ AtapiBlkIoWriteBlocks (
 /**\r
   TODO: Add function description\r
 \r
-  @param  SenseData TODO: add argument description\r
-  @param  SenseCounts TODO: add argument description\r
-\r
-  TODO: add return values\r
-\r
-**/\r
-BOOLEAN\r
-IsNoMedia (\r
-  IN  REQUEST_SENSE_DATA    *SenseData,\r
-  IN  UINTN                 SenseCounts\r
-  )\r
-;\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  SenseData TODO: add argument description\r
-  @param  SenseCounts TODO: add argument description\r
-\r
-  TODO: add return values\r
-\r
-**/\r
-BOOLEAN\r
-IsMediaError (\r
-  IN  REQUEST_SENSE_DATA    *SenseData,\r
-  IN  UINTN                 SenseCounts\r
-  )\r
-;\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  SenseData TODO: add argument description\r
-  @param  SenseCounts TODO: add argument description\r
-\r
-  TODO: add return values\r
-\r
-**/\r
-BOOLEAN\r
-IsMediaChange (\r
-  IN  REQUEST_SENSE_DATA    *SenseData,\r
-  IN  UINTN                 SenseCounts\r
-  )\r
-;\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  SenseData TODO: add argument description\r
-  @param  SenseCounts TODO: add argument description\r
-  @param  NeedRetry TODO: add argument description\r
+  @param  IdeDev TODO: add argument description\r
+  @param  SenseCount TODO: add argument description\r
+  @param  Result TODO: add argument description\r
 \r
   TODO: add return values\r
 \r
 **/\r
-BOOLEAN\r
-IsDriveReady (\r
-  IN  REQUEST_SENSE_DATA    *SenseData,\r
-  IN  UINTN                 SenseCounts,\r
-  OUT BOOLEAN               *NeedRetry\r
+EFI_STATUS\r
+ParseSenseData (\r
+  IN IDE_BLK_IO_DEV     *IdeDev,\r
+  IN UINTN              SenseCount,\r
+  OUT SENSE_RESULT      *Result\r
   )\r
 ;\r
 \r
 /**\r
   TODO: Add function description\r
 \r
-  @param  SenseData TODO: add argument description\r
-  @param  SenseCounts TODO: add argument description\r
+  @param  IdeDev TODO: add argument description\r
 \r
   TODO: add return values\r
 \r
 **/\r
-BOOLEAN\r
-HaveSenseKey (\r
-  IN  REQUEST_SENSE_DATA    *SenseData,\r
-  IN  UINTN                 SenseCounts\r
+EFI_STATUS\r
+AtapiReadPendingData (\r
+  IN IDE_BLK_IO_DEV     *IdeDev\r
   )\r
 ;\r
 \r
@@ -1130,6 +1097,42 @@ AtaUdmaWriteExt (
   )\r
 ;\r
 \r
+/**\r
+  Perform an ATA Udma operation (Read, ReadExt, Write, WriteExt).\r
+  \r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @param[in] *DataBuffer\r
+  A pointer to the source buffer for the data.\r
+\r
+  @param[in] StartLba\r
+  The starting logical block address to write to\r
+  on the device media.\r
+\r
+  @param[in] NumberOfBlocks\r
+  The number of transfer data blocks.\r
+  \r
+  @param[in] UdmaOp\r
+  The perform operations could be AtaUdmaReadOp, AtaUdmaReadExOp,\r
+  AtaUdmaWriteOp, AtaUdmaWriteExOp\r
+\r
+  @return The device status of UDMA operation. If the operation is\r
+  successful, return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+DoAtaUdma (\r
+  IN  IDE_BLK_IO_DEV      *IdeDev,\r
+  IN  VOID                *DataBuffer,\r
+  IN  EFI_LBA             StartLba,\r
+  IN  UINTN               NumberOfBlocks,\r
+  IN  ATA_UDMA_OPERATION  UdmaOp\r
+  )\r
+;\r
+\r
+\r
 /**\r
   TODO: Add function description\r
 \r
@@ -1305,4 +1308,21 @@ EnableInterrupt (
   )\r
 ;\r
 \r
+/**\r
+  Clear pending IDE interrupt before OS loader/kernel take control of the IDE device.\r
+\r
+  @param[in]  Event   Pointer to this event\r
+  @param[in]  Context Event hanlder private data\r
+\r
+  @retval  EFI_SUCCESS - Interrupt cleared\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+ClearInterrupt (\r
+  IN EFI_EVENT  Event,\r
+  IN VOID       *Context\r
+  )\r
+;\r
+\r
 #endif\r