]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c
Update comments to conform to the new, Doxygen friendly, coding standard. These...
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / IdeBus / Dxe / idebus.c
index 4cf882eb00f01d4abc4f6513eeedddbc95eda43e..e5157dab70831fd838144e51e4c09b914ceff9f5 100644 (file)
@@ -1,25 +1,17 @@
-/*++\r
+/** @file\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
-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
-Module Name:\r
-\r
-  idebus.c\r
-    \r
-Abstract: \r
-    \r
-\r
-Revision History\r
+  @par Revision Reference:\r
   This module is modified from DXE\IDE module for Ide Contriller Init support\r
 \r
---*/\r
+**/\r
 \r
 #include "idebus.h"\r
 \r
@@ -44,6 +36,17 @@ EFI_DRIVER_BINDING_PROTOCOL gIDEBusDriverBinding = {
 // IDEBusDriverBindingSupported\r
 // ***********************************************************************************\r
 //\r
+/**\r
+  Register Driver Binding protocol for this driver.\r
+\r
+  @param[in] This   -- A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in] ControllerHandle    -- The handle of the controller to test.\r
+  @param[in] RemainingDevicePath -- A pointer to the remaining portion of a device path.\r
+\r
+  @retval  EFI_SUCCESS Driver loaded.\r
+  @retval  other Driver not loaded.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IDEBusDriverBindingSupported (\r
@@ -51,20 +54,6 @@ IDEBusDriverBindingSupported (
   IN EFI_HANDLE                   Controller,\r
   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   )\r
-/*++\r
-  \r
-Routine Description:\r
-  Register Driver Binding protocol for this driver.\r
-  \r
-Arguments:\r
-  This   -- A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
-  ControllerHandle    -- The handle of the controller to test.\r
-  RemainingDevicePath -- A pointer to the remaining portion of a device path.\r
-\r
-Returns: \r
-  EFI_SUCCESS - Driver loaded.\r
-  other       - Driver not loaded.\r
---*/\r
 // TODO:    Controller - add argument and description to function comment\r
 // TODO:    EFI_UNSUPPORTED - add return value to function comment\r
 {\r
@@ -150,6 +139,19 @@ Returns:
 // IDEBusDriverBindingStart\r
 // ***********************************************************************************\r
 //\r
+/**\r
+  Start this driver on Controller by detecting all disks and installing \r
+  BlockIo protocol on them.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Controller Handle of device to bind driver to.\r
+  @param  RemainingDevicePath Not used, always produce all possible children.\r
+\r
+  @retval  EFI_SUCCESS This driver is added to ControllerHandle.\r
+  @retval  EFI_ALREADY_STARTED This driver is already running on ControllerHandle.\r
+  @retval  other This driver does not support this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IDEBusDriverBindingStart (\r
@@ -157,23 +159,6 @@ IDEBusDriverBindingStart (
   IN EFI_HANDLE                   Controller,\r
   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Start this driver on Controller by detecting all disks and installing \r
-      BlockIo protocol on them.\r
-\r
-  Arguments:\r
-    This                - Protocol instance pointer.\r
-    Controller          - Handle of device to bind driver to.\r
-    RemainingDevicePath - Not used, always produce all possible children.\r
-\r
-  Returns:\r
-    EFI_SUCCESS         - This driver is added to ControllerHandle.\r
-    EFI_ALREADY_STARTED - This driver is already running on ControllerHandle.\r
-    other               - This driver does not support this device.\r
-\r
---*/\r
 {\r
   EFI_STATUS                        Status;\r
   EFI_STATUS                        SavedStatus;\r
@@ -791,6 +776,18 @@ ErrorExit:
 // IDEBusDriverBindingStop\r
 // ***********************************************************************************\r
 //\r
+/**\r
+  Stop this driver on Controller Handle. \r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DeviceHandle Handle of device to stop driver on\r
+  @param  NumberOfChildren Not used\r
+  @param  ChildHandleBuffer Not used\r
+\r
+  @retval  EFI_SUCCESS This driver is removed DeviceHandle\r
+  @retval  other This driver was not removed from this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IDEBusDriverBindingStop (\r
@@ -799,22 +796,6 @@ IDEBusDriverBindingStop (
   IN  UINTN                           NumberOfChildren,\r
   IN  EFI_HANDLE                      *ChildHandleBuffer\r
   )\r
-/*++\r
-  \r
-  Routine Description:\r
-    Stop this driver on Controller Handle. \r
-\r
-  Arguments:\r
-    This              - Protocol instance pointer.\r
-    DeviceHandle      - Handle of device to stop driver on \r
-    NumberOfChildren  - Not used\r
-    ChildHandleBuffer - Not used\r
-\r
-  Returns:\r
-    EFI_SUCCESS       - This driver is removed DeviceHandle\r
-    other             - This driver was not removed from this device\r
-  \r
---*/\r
 // TODO:    Controller - add argument and description to function comment\r
 // TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
 {\r
@@ -912,29 +893,22 @@ IDEBusDriverBindingStop (
 // DeRegisterIdeDevice\r
 // ***********************************************************************************\r
 //\r
+/**\r
+  Deregister an IDE device and free resources\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Controller Ide device handle\r
+  @param  Handle Handle of device to deregister driver on\r
+\r
+  @return EFI_STATUS\r
+\r
+**/\r
 EFI_STATUS\r
 DeRegisterIdeDevice (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL    *This,\r
   IN  EFI_HANDLE                     Controller,\r
   IN  EFI_HANDLE                     Handle\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Deregister an IDE device and free resources\r
-  \r
-Arguments:\r
-\r
-  This            - Protocol instance pointer.\r
-  Controller      - Ide device handle\r
-  Handle          - Handle of device to deregister driver on \r
-  \r
-Returns:\r
-\r
-  EFI_STATUS\r
-\r
---*/\r
 // TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
   EFI_STATUS            Status;\r
@@ -1015,26 +989,18 @@ Returns:
 // IDEBlkIoReset\r
 // ***********************************************************************************\r
 //\r
+/**\r
+  TODO:    This - add argument and description to function comment\r
+  TODO:    ExtendedVerification - add argument and description to function comment\r
+  TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IDEBlkIoReset (\r
   IN  EFI_BLOCK_IO_PROTOCOL   *This,\r
   IN  BOOLEAN                 ExtendedVerification\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    ExtendedVerification - add argument and description to function comment\r
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
 {\r
   IDE_BLK_IO_DEV  *IdeBlkIoDevice;\r
   EFI_STATUS      Status;\r
@@ -1067,6 +1033,18 @@ Returns:
   return Status;\r
 }\r
 \r
+/**\r
+  Read data from block io device\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  MediaId The media ID of the device\r
+  @param  LBA Starting LBA address to read data\r
+  @param  BufferSize The size of data to be read\r
+  @param  Buffer Caller supplied buffer to save data\r
+\r
+  @return read data status\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IDEBlkIoReadBlocks (\r
@@ -1076,25 +1054,6 @@ IDEBlkIoReadBlocks (
   IN  UINTN                   BufferSize,\r
   OUT VOID                    *Buffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Read data from block io device\r
-  \r
-Arguments:\r
-\r
-  This            - Protocol instance pointer.\r
-  MediaId         - The media ID of the device\r
-  LBA             - Starting LBA address to read data\r
-  BufferSize      - The size of data to be read\r
-  Buffer          - Caller supplied buffer to save data\r
-  \r
-Returns:\r
-\r
-  read data status\r
-\r
---*/\r
 // TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
 {\r
   IDE_BLK_IO_DEV  *IdeBlkIoDevice;\r
@@ -1137,6 +1096,18 @@ Returns:
 \r
 }\r
 \r
+/**\r
+  Write data to block io device\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  MediaId The media ID of the device\r
+  @param  LBA Starting LBA address to write data\r
+  @param  BufferSize The size of data to be written\r
+  @param  Buffer Caller supplied buffer to save data\r
+\r
+  @return write data status\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IDEBlkIoWriteBlocks (\r
@@ -1146,25 +1117,6 @@ IDEBlkIoWriteBlocks (
   IN  UINTN                   BufferSize,\r
   IN  VOID                    *Buffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Write data to block io device\r
-  \r
-Arguments:\r
-\r
-  This            - Protocol instance pointer.\r
-  MediaId         - The media ID of the device\r
-  LBA             - Starting LBA address to write data\r
-  BufferSize      - The size of data to be written\r
-  Buffer          - Caller supplied buffer to save data\r
-  \r
-Returns:\r
-\r
-  write data status\r
-\r
---*/\r
 // TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
 {\r
   IDE_BLK_IO_DEV  *IdeBlkIoDevice;\r
@@ -1211,24 +1163,15 @@ Returns:
 // IDEBlkIoFlushBlocks\r
 // ***********************************************************************************\r
 //\r
+/**\r
+  TODO:    This - add argument and description to function comment\r
+  TODO:    EFI_SUCCESS - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IDEBlkIoFlushBlocks (\r
   IN  EFI_BLOCK_IO_PROTOCOL   *This\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
   //\r
   // return directly\r
@@ -1236,6 +1179,20 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Return the results of the Inquiry command to a drive in InquiryData.\r
+  Data format of Inquiry data is defined by the Interface GUID.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  InquiryData Results of Inquiry command to device\r
+  @param  InquiryDataSize Size of InquiryData in bytes.\r
+\r
+  @retval  EFI_SUCCESS InquiryData valid\r
+  @retval  EFI_NOT_FOUND Device does not support this data class\r
+  @retval  EFI_DEVICE_ERROR Error reading InquiryData from device\r
+  @retval  EFI_BUFFER_TOO_SMALL IntquiryDataSize not big enough\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IDEDiskInfoInquiry (\r
@@ -1243,24 +1200,6 @@ IDEDiskInfoInquiry (
   IN OUT VOID                     *InquiryData,\r
   IN OUT UINT32                   *InquiryDataSize\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Return the results of the Inquiry command to a drive in InquiryData.\r
-    Data format of Inquiry data is defined by the Interface GUID.\r
-\r
-  Arguments:\r
-    This        - Protocol instance pointer.\r
-    InquiryData - Results of Inquiry command to device\r
-    InquiryDataSize - Size of InquiryData in bytes.\r
-\r
-  Returns:\r
-    EFI_SUCCESS       - InquiryData valid\r
-    EFI_NOT_FOUND     - Device does not support this data class\r
-    EFI_DEVICE_ERROR  - Error reading InquiryData from device \r
-    EFI_BUFFER_TOO_SMALL - IntquiryDataSize not big enough\r
-\r
---*/\r
 {\r
   IDE_BLK_IO_DEV  *IdeBlkIoDevice;\r
 \r
@@ -1281,6 +1220,20 @@ IDEDiskInfoInquiry (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Return the results of the Identify command to a drive in IdentifyData.\r
+  Data format of Identify data is defined by the Interface GUID.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  IdentifyData Results of Identify command to device\r
+  @param  IdentifyDataSize Size of IdentifyData in bytes.\r
+\r
+  @retval  EFI_SUCCESS IdentifyData valid\r
+  @retval  EFI_NOT_FOUND Device does not support this data class\r
+  @retval  EFI_DEVICE_ERROR Error reading IdentifyData from device\r
+  @retval  EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IDEDiskInfoIdentify (\r
@@ -1288,24 +1241,6 @@ IDEDiskInfoIdentify (
   IN OUT VOID                     *IdentifyData,\r
   IN OUT UINT32                   *IdentifyDataSize\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Return the results of the Identify command to a drive in IdentifyData.\r
-    Data format of Identify data is defined by the Interface GUID.\r
-\r
-  Arguments:\r
-    This        - Protocol instance pointer.\r
-    IdentifyData - Results of Identify command to device\r
-    IdentifyDataSize - Size of IdentifyData in bytes.\r
-\r
-  Returns:\r
-    EFI_SUCCESS       - IdentifyData valid\r
-    EFI_NOT_FOUND     - Device does not support this data class\r
-    EFI_DEVICE_ERROR  - Error reading IdentifyData from device \r
-    EFI_BUFFER_TOO_SMALL - IdentifyDataSize not big enough\r
-\r
---*/\r
 {\r
   IDE_BLK_IO_DEV  *IdeBlkIoDevice;\r
 \r
@@ -1326,6 +1261,21 @@ IDEDiskInfoIdentify (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Return the results of the Request Sense command to a drive in SenseData.\r
+  Data format of Sense data is defined by the Interface GUID.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  SenseData Results of Request Sense command to device\r
+  @param  SenseDataSize Size of SenseData in bytes.\r
+  @param  SenseDataNumber Type of SenseData\r
+\r
+  @retval  EFI_SUCCESS InquiryData valid\r
+  @retval  EFI_NOT_FOUND Device does not support this data class\r
+  @retval  EFI_DEVICE_ERROR Error reading InquiryData from device\r
+  @retval  EFI_BUFFER_TOO_SMALL SenseDataSize not big enough\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IDEDiskInfoSenseData (\r
@@ -1334,29 +1284,22 @@ IDEDiskInfoSenseData (
   IN OUT UINT32                   *SenseDataSize,\r
   OUT    UINT8                    *SenseDataNumber\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Return the results of the Request Sense command to a drive in SenseData.\r
-    Data format of Sense data is defined by the Interface GUID.\r
-\r
-  Arguments:\r
-    This            - Protocol instance pointer.\r
-    SenseData       - Results of Request Sense command to device\r
-    SenseDataSize   - Size of SenseData in bytes.\r
-    SenseDataNumber - Type of SenseData\r
-\r
-  Returns:\r
-    EFI_SUCCESS       - InquiryData valid\r
-    EFI_NOT_FOUND     - Device does not support this data class\r
-    EFI_DEVICE_ERROR  - Error reading InquiryData from device \r
-    EFI_BUFFER_TOO_SMALL - SenseDataSize not big enough\r
-\r
---*/\r
 {\r
   return EFI_NOT_FOUND;\r
 }\r
 \r
+/**\r
+  Return the results of the Request Sense command to a drive in SenseData.\r
+  Data format of Sense data is defined by the Interface GUID.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  IdeChannel Primary or Secondary\r
+  @param  IdeDevice Master or Slave\r
+\r
+  @retval  EFI_SUCCESS IdeChannel and IdeDevice are valid\r
+  @retval  EFI_UNSUPPORTED This is not an IDE device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IDEDiskInfoWhichIde (\r
@@ -1364,22 +1307,6 @@ IDEDiskInfoWhichIde (
   OUT UINT32                   *IdeChannel,\r
   OUT UINT32                   *IdeDevice\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Return the results of the Request Sense command to a drive in SenseData.\r
-    Data format of Sense data is defined by the Interface GUID.\r
-\r
-  Arguments:\r
-    This        - Protocol instance pointer.\r
-    IdeChannel  - Primary or Secondary\r
-    IdeDevice   - Master or Slave\r
-\r
-  Returns:\r
-    EFI_SUCCESS       - IdeChannel and IdeDevice are valid\r
-    EFI_UNSUPPORTED   - This is not an IDE device\r
-\r
---*/\r
 {\r
   IDE_BLK_IO_DEV  *IdeBlkIoDevice;\r
 \r