]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Include/Protocol/IsaIo.h
Add comments for Include header files
[mirror_edk2.git] / IntelFrameworkModulePkg / Include / Protocol / IsaIo.h
index ce7f615621960efe78207017c4907f7f634fa71f..9a2822937f5622b848e89fb1bd1102d981f7a7af 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
-  EFI ISA I/O Protocol\r
+  ISA I/O Protocol is used to perform ISA device Io/Mem operations.\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2009, 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
@@ -19,18 +19,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/IsaAcpi.h>\r
 \r
 //\r
-// Global ID for the ISA I/O Protocol\r
+// Global GUID for the ISA I/O Protocol\r
 //\r
-\r
 #define EFI_ISA_IO_PROTOCOL_GUID \\r
   { 0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }\r
 \r
 typedef struct _EFI_ISA_IO_PROTOCOL EFI_ISA_IO_PROTOCOL;\r
 \r
 //\r
-// Prototypes for the ISA I/O Protocol\r
+// Width of ISA Io/Mem operation\r
 //\r
-\r
 typedef enum {\r
   EfiIsaIoWidthUint8,\r
   EfiIsaIoWidthUint16,\r
@@ -50,9 +48,9 @@ typedef enum {
 //\r
 // Attributes for common buffer allocations\r
 //\r
-#define EFI_ISA_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE  0x080    // Map a memory range so write are combined\r
-#define EFI_ISA_IO_ATTRIBUTE_MEMORY_CACHED         0x800    // Map a memory range so all r/w accesses are cached\r
-#define EFI_ISA_IO_ATTRIBUTE_MEMORY_DISABLE        0x1000   // Disable a memory range \r
+#define EFI_ISA_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE  0x080    ///< Map a memory range so write are combined\r
+#define EFI_ISA_IO_ATTRIBUTE_MEMORY_CACHED         0x800    ///< Map a memory range so all r/w accesses are cached\r
+#define EFI_ISA_IO_ATTRIBUTE_MEMORY_DISABLE        0x1000   ///< Disable a memory range \r
 \r
 //\r
 // Channel attribute for DMA operations\r
@@ -76,6 +74,22 @@ typedef enum {
   EfiIsaIoOperationMaximum\r
 } EFI_ISA_IO_PROTOCOL_OPERATION;\r
 \r
+/**\r
+  Performs an ISA Io/Memory Read/Write Cycle\r
+\r
+  @param This                    A pointer to the EFI_ISA_IO_PROTOCOL instance.  \r
+  @param Width                   Signifies the width of the Io/Memory operation.\r
+  @param Offset                  The offset in ISA Io/Memory space to start the Io/Memory operation.  \r
+  @param Count                   The number of Io/Memory operations to perform.\r
+  @param Buffer                  [OUT] The destination buffer to store the results.\r
+                                 [IN] The source buffer to write data to the device.\r
+\r
+  @retval EFI_SUCCESS             The data was read from / written to the device sucessfully.\r
+  @retval EFI_UNSUPPORTED         The Offset is not valid for this device.\r
+  @retval EFI_INVALID_PARAMETER   Width or Count, or both, were invalid.\r
+  @retval EFI_OUT_OF_RESOURCES    The request could not be completed due to a lack of resources.\r
+\r
+**/\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_ISA_IO_PROTOCOL_IO_MEM) (\r
@@ -91,6 +105,21 @@ typedef struct {
   EFI_ISA_IO_PROTOCOL_IO_MEM  Write;\r
 } EFI_ISA_IO_PROTOCOL_ACCESS;\r
 \r
+/**\r
+  Performs an ISA I/O Copy Memory \r
+\r
+  @param This                    A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param Width                   Signifies the width of the memory copy operation.\r
+  @param DestOffset              The offset of the destination \r
+  @param SrcOffset               The offset of the source\r
+  @param Count                   The number of memory copy  operations to perform\r
+\r
+  @retval EFI_SUCCESS             The data was copied sucessfully.\r
+  @retval EFI_UNSUPPORTED         The DestOffset or SrcOffset is not valid for this device.\r
+  @retval EFI_INVALID_PARAMETER   Width or Count, or both, were invalid.\r
+  @retval EFI_OUT_OF_RESOURCES    The request could not be completed due to a lack of resources.\r
+\r
+**/\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_ISA_IO_PROTOCOL_COPY_MEM) (\r
@@ -101,6 +130,32 @@ EFI_STATUS
   IN     UINTN                        Count\r
   );\r
 \r
+/**\r
+  Maps a memory region for DMA\r
+\r
+  @param This                    A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param Operation               Indicates the type of DMA (slave or bus master), and if \r
+                                 the DMA operation is going to read or write to system memory. \r
+  @param ChannelNumber           The slave channel number to use for this DMA operation. \r
+                                 If Operation and ChannelAttributes shows that this device \r
+                                 performs bus mastering DMA, then this field is ignored.  \r
+                                 The legal range for this field is 0..7.  \r
+  @param ChannelAttributes       The attributes of the DMA channel to use for this DMA operation\r
+  @param HostAddress             The system memory address to map to the device.  \r
+  @param NumberOfBytes           On input the number of bytes to map.  On output the number \r
+                                 of bytes that were mapped.\r
+  @param DeviceAddress           The resulting map address for the bus master device to use \r
+                                 to access the hosts HostAddress.  \r
+  @param Mapping                 A resulting value to pass to EFI_ISA_IO.Unmap().\r
+\r
+\r
+  @retval EFI_SUCCESS             The range was mapped for the returned NumberOfBytes.\r
+  @retval EFI_INVALID_PARAMETER   The Operation or HostAddress is undefined.\r
+  @retval EFI_UNSUPPORTED         The HostAddress can not be mapped as a common buffer.\r
+  @retval EFI_DEVICE_ERROR        The system hardware could not map the requested address.\r
+  @retval EFI_OUT_OF_RESOURCES    The memory pages could not be allocated.\r
+\r
+**/\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_ISA_IO_PROTOCOL_MAP) (\r
@@ -114,6 +169,16 @@ EFI_STATUS
   OUT    VOID                           **Mapping\r
   );\r
 \r
+/**\r
+  Unmaps a memory region for DMA\r
+\r
+  @param This               A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param Mapping            The mapping value returned from EFI_ISA_IO.Map().\r
+\r
+  @retval EFI_SUCCESS        The range was unmapped.\r
+  @retval EFI_DEVICE_ERROR   The data was not committed to the target system memory.\r
+\r
+**/\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_ISA_IO_PROTOCOL_UNMAP) (\r
@@ -121,6 +186,23 @@ EFI_STATUS
   IN  VOID                         *Mapping\r
   );\r
 \r
+/**\r
+  Allocates a common buffer for DMA\r
+\r
+  @param This                    A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param Type                    The type allocation to perform.\r
+  @param MemoryType              The type of memory to allocate.\r
+  @param Pages                   The number of pages to allocate.\r
+  @param HostAddress             A pointer to store the base address of the allocated range.\r
+  @param Attributes              The requested bit mask of attributes for the allocated range.\r
+\r
+  @retval EFI_SUCCESS             The requested memory pages were allocated.\r
+  @retval EFI_INVALID_PARAMETER   Type is invalid or MemoryType is invalid or HostAddress is NULL\r
+  @retval EFI_UNSUPPORTED         Attributes is unsupported or the memory range specified \r
+                                  by HostAddress, Pages, and Type is not available for common buffer use.\r
+  @retval EFI_OUT_OF_RESOURCES    The memory pages could not be allocated.\r
+\r
+**/\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_ISA_IO_PROTOCOL_ALLOCATE_BUFFER) (\r
@@ -132,6 +214,18 @@ EFI_STATUS
   IN  UINT64                       Attributes\r
   );\r
 \r
+/**\r
+  Frees a common buffer \r
+\r
+  @param This                    A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param Pages                   The number of pages to free.\r
+  @param HostAddress             The base address of the allocated range.\r
+\r
+\r
+  @retval EFI_SUCCESS             The requested memory pages were freed.\r
+  @retval EFI_INVALID_PARAMETER   The memory was not allocated with EFI_ISA_IO.AllocateBufer().\r
+\r
+**/\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_ISA_IO_PROTOCOL_FREE_BUFFER) (\r
@@ -140,6 +234,15 @@ EFI_STATUS
   IN  VOID                         *HostAddress\r
   );\r
 \r
+/**\r
+  Flushes a DMA buffer\r
+\r
+  @param This                 A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+\r
+  @retval  EFI_SUCCESS        The buffers were flushed.\r
+  @retval  EFI_DEVICE_ERROR   The buffers were not flushed due to a hardware error.\r
+\r
+**/\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_ISA_IO_PROTOCOL_FLUSH) (\r