]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ISA Bus driver code scrub.
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 10 Jun 2009 06:35:16 +0000 (06:35 +0000)
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 10 Jun 2009 06:35:16 +0000 (06:35 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8505 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/ComponentName.c
IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/ComponentName.h
IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/InternalIsaBus.h
IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/InternalIsaIo.h
IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBus.c
IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf
IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaIo.c

index 5f3711293ba13fe3d4b07cf77325e85b66bc0ceb..7c614b558cd34bb252818abe32f0894d26b3b6aa 100644 (file)
@@ -1,6 +1,7 @@
 /**@file\r
+  UEFI Component Name(2) protocol implementation for IsaBus driver.\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation. <BR>\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
@@ -170,11 +171,11 @@ IsaBusComponentNameGetDriverName (
 EFI_STATUS\r
 EFIAPI\r
 IsaBusComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
+  IN  EFI_HANDLE                   ControllerHandle,\r
+  IN  EFI_HANDLE                   ChildHandle  OPTIONAL,\r
+  IN  CHAR8                        *Language,\r
+  OUT CHAR16                       **ControllerName\r
   )\r
 {\r
   return EFI_UNSUPPORTED;\r
index d4395f526a385de9817fb661da6a3be3b153e2ca..c198d870c688055f81bbf550b8d5f04f9e17dd9f 100644 (file)
@@ -1,6 +1,7 @@
 /**@file\r
+  Header file for implementation of UEFI Component Name(2) protocol.\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation<BR>\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
@@ -11,17 +12,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#ifndef _EFI_ISA_BUS_COMPONENT_NAME_H\r
-#define _EFI_ISA_BUS_COMPONENT_NAME_H\r
+#ifndef _COMPONENT_NAME_H_\r
+#define _COMPONENT_NAME_H_\r
 \r
 #include "InternalIsaBus.h"\r
 \r
 extern EFI_COMPONENT_NAME_PROTOCOL   gIsaBusComponentName;\r
 extern EFI_COMPONENT_NAME2_PROTOCOL  gIsaBusComponentName2;\r
 \r
-//\r
-// EFI Component Name Functions\r
-//\r
 /**\r
   Retrieves a Unicode string that is the user readable name of the driver.\r
 \r
@@ -141,12 +139,12 @@ IsaBusComponentNameGetDriverName (
 EFI_STATUS\r
 EFIAPI\r
 IsaBusComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
+  IN  EFI_HANDLE                   ControllerHandle,\r
+  IN  EFI_HANDLE                   ChildHandle  OPTIONAL,\r
+  IN  CHAR8                        *Language,\r
+  OUT CHAR16                       **ControllerName\r
   );\r
 \r
-\r
 #endif\r
+\r
index 9bfd065b1a2bbf31b78a17d420b6d82f498c9f81..ad2f945d477f57d8c6c51814989eeb9c16cdbdb1 100644 (file)
@@ -1,7 +1,7 @@
 /**@file\r
   The header file for ISA bus driver\r
   \r
-Copyright (c) 2006 - 2007, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation. <BR>\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
@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#ifndef _EFI_ISA_BUS_H\r
-#define _EFI_ISA_BUS_H\r
+#ifndef _INTERNAL_ISA_BUS_H_\r
+#define _INTERNAL_ISA_BUS_H_\r
 \r
 \r
 #include <PiDxe.h>\r
@@ -40,13 +40,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "ComponentName.h"\r
 \r
-//\r
-// Global Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL  gIsaBusControllerDriver;\r
-\r
-extern EFI_ISA_IO_PROTOCOL          IsaIoInterface;\r
-\r
 //\r
 // 8237 DMA registers\r
 //\r
@@ -165,70 +158,92 @@ typedef struct {
 // EFI Driver Binding Protocol Interface Functions\r
 //\r
 \r
+/** \r
+  Tests to see if a controller can be managed by the ISA Bus Driver. If a child device is provided, \r
+  it further tests to see if this driver supports creating a handle for the specified child device.\r
+\r
+  Note that the ISA Bus driver always creates all of its child handles on the first call to Start().\r
+  How the Start() function of a driver is implemented can affect how the Supported() function is implemented.\r
+\r
+  @param[in] This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.  \r
+  @param[in] Controller           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             The device is supported by this driver.\r
+  @retval EFI_ALREADY_STARTED     The device is already being managed by this driver.\r
+  @retval EFI_ACCESS_DENIED       The device is already being managed by a different driver \r
+                                  or an application that requires exclusive access.\r
+  @retval EFI_UNSUPPORTED         The device is is not supported by this driver.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IsaBusControllerDriverSupported (\r
   IN EFI_DRIVER_BINDING_PROTOCOL  * This,\r
   IN EFI_HANDLE                   Controller,\r
   IN EFI_DEVICE_PATH_PROTOCOL     * RemainingDevicePath OPTIONAL\r
-  )\r
-/**\r
-\r
-  Routine Description:\r
-  \r
-    This function checks to see if a controller can be managed by the ISA Bus \r
-    Driver. This is done by checking to see if the controller supports the \r
-    EFI_PCI_IO_PROTOCOL protocol, and then looking at the PCI Configuration \r
-    Header to see if the device is a PCI to ISA bridge. The class code of \r
-    PCI to ISA bridge: Base class 06h, Sub class 01h Interface 00h \r
-  \r
-  Arguments:\r
-  \r
-    This                 - The EFI_DRIVER_BINDING_PROTOCOL instance.\r
-    Controller           - The handle of the device to check.\r
-    RemainingDevicePath  - A pointer to the remaining portion of a device path.\r
+  );\r
 \r
-  Returns:\r
+/**\r
+  Start this driver on ControllerHandle. \r
   \r
-    EFI_SUCCESS          - The device is supported by this driver.\r
-    EFI_UNSUPPORTED      - The device is not supported by this driver.\r
-\r
+  Note that the ISA Bus driver always creates all of its child handles on the first call to Start().\r
+  The Start() function is designed to be invoked from the EFI boot service ConnectController(). \r
+  As a result, much of the error checking on the parameters to Start() has been moved into this \r
+  common boot service. It is legal to call Start() from other locations, but the following calling \r
+  restrictions must be followed or the system behavior will not be deterministic.\r
+  1. ControllerHandle must be a valid EFI_HANDLE.\r
+  2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
+     EFI_DEVICE_PATH_PROTOCOL.\r
+  3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
+     have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.  \r
+\r
+  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in]  ControllerHandle     The handle of the controller to start. This handle \r
+                                   must support a protocol interface that supplies \r
+                                   an I/O abstraction to the driver.\r
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path. \r
+                                   This parameter is ignored by device drivers, and is optional for bus drivers.\r
+\r
+  @retval EFI_SUCCESS              The device was started.\r
+  @retval EFI_DEVICE_ERROR         The device could not be started due to a device error.\r
+                                   Currently not implemented.\r
+  @retval EFI_OUT_OF_RESOURCES     The request could not be completed due to a lack of resources.\r
+  @retval Others                   The driver failded to start the device.\r
 **/\r
-;\r
-\r
 EFI_STATUS\r
 EFIAPI\r
 IsaBusControllerDriverStart (\r
   IN EFI_DRIVER_BINDING_PROTOCOL  * This,\r
   IN EFI_HANDLE                   Controller,\r
   IN EFI_DEVICE_PATH_PROTOCOL     * RemainingDevicePath OPTIONAL\r
-  )\r
-/**\r
+  );\r
 \r
-  Routine Description:\r
-  \r
-    This function tells the ISA Bus Driver to start managing a PCI to ISA \r
-    Bridge controller. \r
-  \r
-  Arguments:\r
-  \r
-    This                  - The EFI_DRIVER_BINDING_PROTOCOL instance.\r
-    Controller            - A handle to the device being started. \r
-    RemainingDevicePath   - A pointer to the remaining portion of a device path.\r
-\r
-  Returns:\r
+/**\r
+  Stop this driver on ControllerHandle. \r
   \r
-    EFI_SUCCESS           - The device was started.\r
-    EFI_UNSUPPORTED       - The device is not supported.\r
-    EFI_DEVICE_ERROR      - The device could not be started due to a device error.\r
-    EFI_ALREADY_STARTED   - The device has already been started.\r
-    EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r
-    EFI_OUT_OF_RESOURCES  - The request could not be completed due to a lack of \r
-                            resources.\r
+  The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). \r
+  As a result, much of the error checking on the parameters to Stop() has been moved \r
+  into this common boot service. It is legal to call Stop() from other locations, \r
+  but the following calling restrictions must be followed or the system behavior will not be deterministic.\r
+  1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
+     same driver's Start() function.\r
+  2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r
+     EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
+     Start() function, and the Start() function must have called OpenProtocol() on\r
+     ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
   \r
+  @param[in]  This              A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must \r
+                                support a bus specific I/O protocol for the driver \r
+                                to use to stop the device.\r
+  @param[in]  NumberOfChildren  The number of child device handles in ChildHandleBuffer.\r
+  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL \r
+                                if NumberOfChildren is 0.\r
+\r
+  @retval EFI_SUCCESS           The device was stopped.\r
+  @retval EFI_DEVICE_ERROR      The device could not be stopped due to a device error.\r
 **/\r
-;\r
-\r
 EFI_STATUS\r
 EFIAPI\r
 IsaBusControllerDriverStop (\r
@@ -236,38 +251,26 @@ IsaBusControllerDriverStop (
   IN  EFI_HANDLE                   Controller,\r
   IN  UINTN                        NumberOfChildren,\r
   IN  EFI_HANDLE                   * ChildHandleBuffer OPTIONAL\r
-  )\r
-/**\r
-\r
-  Routine Description:\r
-  \r
-    This function tells the ISA Bus Driver to stop managing a PCI to ISA \r
-    Bridge controller. \r
-     \r
-  Arguments:\r
-  \r
-    This                   - The EFI_DRIVER_BINDING_PROTOCOL instance.\r
-    Controller             - A handle to the device being stopped.\r
-    NumberOfChindren       - The number of child device handles in ChildHandleBuffer.\r
-    ChildHandleBuffer      - An array of child handles to be freed.\r
-\r
-  \r
-  Returns:\r
-  \r
-    EFI_SUCCESS            - The device was stopped.\r
-    EFI_DEVICE_ERROR       - The device could not be stopped due to a device error.\r
-    EFI_NOT_STARTED        - The device has not been started.\r
-    EFI_INVALID_PARAMETER  - One of the parameters has an invalid value.\r
-    EFI_OUT_OF_RESOURCES   - The request could not be completed due to a lack of \r
-                             resources.\r
-\r
-**/\r
-;\r
+  );\r
 \r
 //\r
 // Function Prototypes\r
 //\r
 \r
+/**\r
+  Create EFI Handle for a ISA device found via ISA ACPI Protocol \r
+\r
+  @param[in] This                   The EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in] Controller             The handle of ISA bus controller(PCI to ISA bridge)\r
+  @param[in] PciIo                  The Pointer to the PCI protocol \r
+  @param[in] ParentDevicePath       Device path of the ISA bus controller\r
+  @param[in] IsaDeviceResourceList  The resource list of the ISA device\r
+  @param[in] ChildDevicePath        The pointer to the child device.\r
+\r
+  @retval EFI_SUCCESS               The handle for the child device was created.\r
+  @retval EFI_OUT_OF_RESOURCES      The request could not be completed due to a lack of resources.\r
+  @retval EFI_DEVICE_ERROR          The handle for the child device can not be created.\r
+**/\r
 EFI_STATUS\r
 IsaCreateDevice (\r
   IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
@@ -276,53 +279,21 @@ IsaCreateDevice (
   IN EFI_DEVICE_PATH_PROTOCOL     *ParentDevicePath,\r
   IN EFI_ISA_ACPI_RESOURCE_LIST   *IsaDeviceResourceList,\r
   OUT EFI_DEVICE_PATH_PROTOCOL    **ChildDevicePath\r
-  )\r
-/**\r
+  );\r
 \r
-  Routine Description:\r
-  \r
-    Create ISA device found by IsaPnpProtocol \r
+/**\r
+  Initializes an ISA I/O Instance\r
 \r
-  Arguments:\r
-  \r
-    This                   - The EFI_DRIVER_BINDING_PROTOCOL instance.\r
-    Controller             - The handle of ISA bus controller(PCI to ISA bridge)\r
-    PciIo                  - The Pointer to the PCI protocol \r
-    ParentDevicePath       - Device path of the ISA bus controller\r
-    IsaDeviceResourceList  - The resource list of the ISA device\r
-    ChildDevicePath        - The pointer to the child device.\r
-\r
-  Returns:\r
+  @param[in] IsaIoDevice            The iso device to be initialized.\r
+  @param[in] IsaDeviceResourceList  The resource list.\r
   \r
-    EFI_SUCCESS            - Create the child device.\r
-    EFI_OUT_OF_RESOURCES   - The request could not be completed due to a lack of \r
-                             resources.\r
-    EFI_DEVICE_ERROR       - Can not create child device.\r
-    \r
+  @retval None\r
 **/\r
-;\r
-\r
-EFI_STATUS\r
+VOID\r
 InitializeIsaIoInstance (\r
   IN ISA_IO_DEVICE               *IsaIoDevice,\r
   IN EFI_ISA_ACPI_RESOURCE_LIST  *IsaDevice\r
-  )\r
-/**\r
-\r
-Routine Description:\r
-\r
-  Initializes an ISA I/O Instance\r
-\r
-Arguments:\r
-\r
-  IsaIoDevice            - The iso device to be initialized.\r
-  IsaDevice              - The resource list.\r
-  \r
-Returns:\r
-\r
-  EFI_SUCCESS            - Initial success.\r
-  \r
-**/\r
-;\r
+  );\r
 \r
 #endif\r
+\r
index d02c927e374b4be128f689d8777b1e5922c98452..b5e6694ca22fd42f5d24fb72a67e1d627ff93404 100644 (file)
@@ -1,7 +1,7 @@
 /**@file\r
   The header file for EFI_ISA_IO protocol implementation.\r
   \r
-Copyright (c) 2006 - 2007, Intel Corporation.<BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation.<BR>\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
@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#ifndef _EFI_ISA_IO_LOCAL_H\r
-#define _EFI_ISA_IO_LOCAL_H\r
+#ifndef _INTERNAL_ISA_IO_H_\r
+#define _INTERNAL_ISA_IO_H_\r
 \r
 #include "InternalIsaBus.h"\r
 \r
@@ -23,57 +23,57 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 EFI_STATUS\r
 IsaIoVerifyAccess (\r
-  IN     ISA_IO_DEVICE              *IsaIoDevice,\r
-  IN     ISA_ACCESS_TYPE            Type,\r
-  IN     EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
-  IN     UINTN                      Count,\r
-  IN OUT UINT32                     *Offset\r
+  IN ISA_IO_DEVICE              *IsaIoDevice,\r
+  IN ISA_ACCESS_TYPE            Type,\r
+  IN EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
+  IN UINTN                      Count,\r
+  IN UINT32                     Offset\r
   );\r
   \r
 EFI_STATUS\r
 EFIAPI\r
 IsaIoIoRead (\r
-  IN     EFI_ISA_IO_PROTOCOL                        *This,\r
-  IN     EFI_ISA_IO_PROTOCOL_WIDTH                  Width,\r
-  IN     UINT32                                     Offset,\r
-  IN     UINTN                                      Count,\r
-  IN OUT VOID                                       *Buffer\r
+  IN  EFI_ISA_IO_PROTOCOL        *This,\r
+  IN  EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
+  IN  UINT32                     Offset,\r
+  IN  UINTN                      Count,\r
+  OUT VOID                       *Buffer\r
   );\r
 \r
 EFI_STATUS\r
 EFIAPI\r
 IsaIoIoWrite (\r
-  IN     EFI_ISA_IO_PROTOCOL                        *This,\r
-  IN     EFI_ISA_IO_PROTOCOL_WIDTH                  Width,\r
-  IN     UINT32                                     Offset,\r
-  IN     UINTN                                      Count,\r
-  IN OUT VOID                                       *Buffer\r
+  IN EFI_ISA_IO_PROTOCOL        *This,\r
+  IN EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
+  IN UINT32                     Offset,\r
+  IN UINTN                      Count,\r
+  IN VOID                       *Buffer\r
   );\r
 \r
 EFI_STATUS\r
 EFIAPI\r
 IsaIoMap (\r
-  IN     EFI_ISA_IO_PROTOCOL                               *This,\r
-  IN     EFI_ISA_IO_PROTOCOL_OPERATION                     Operation,\r
-  IN     UINT8                                             ChannelNumber      OPTIONAL,\r
-  IN     UINT32                                            ChannelAttributes,\r
-  IN     VOID                                              *HostAddress,\r
-  IN OUT UINTN                                             *NumberOfBytes,\r
-  OUT    EFI_PHYSICAL_ADDRESS                              *DeviceAddress,\r
-  OUT    VOID                                              **Mapping\r
+  IN     EFI_ISA_IO_PROTOCOL            *This,\r
+  IN     EFI_ISA_IO_PROTOCOL_OPERATION  Operation,\r
+  IN     UINT8                          ChannelNumber  OPTIONAL,\r
+  IN     UINT32                         ChannelAttributes,\r
+  IN     VOID                           *HostAddress,\r
+  IN OUT UINTN                          *NumberOfBytes,\r
+  OUT    EFI_PHYSICAL_ADDRESS           *DeviceAddress,\r
+  OUT    VOID                           **Mapping\r
   );\r
 \r
 EFI_STATUS\r
 EFIAPI\r
 IsaIoUnmap (\r
-  IN EFI_ISA_IO_PROTOCOL                  *This,\r
-  IN VOID                                 *Mapping\r
+  IN EFI_ISA_IO_PROTOCOL  *This,\r
+  IN VOID                 *Mapping\r
   );\r
 \r
 EFI_STATUS\r
 EFIAPI\r
 IsaIoFlush (\r
-  IN EFI_ISA_IO_PROTOCOL                  *This\r
+  IN EFI_ISA_IO_PROTOCOL  *This\r
   );\r
 \r
 EFI_STATUS\r
@@ -83,69 +83,70 @@ ReportErrorStatusCode (
 \r
 EFI_STATUS\r
 WriteDmaPort (\r
-  IN EFI_ISA_IO_PROTOCOL                  *This,\r
-  IN UINT32                               AddrOffset,\r
-  IN UINT32                               PageOffset,\r
-  IN UINT32                               CountOffset,\r
-  IN UINT32                               BaseAddress,\r
-  IN UINT16                               Count\r
+  IN EFI_ISA_IO_PROTOCOL  *This,\r
+  IN UINT32               AddrOffset,\r
+  IN UINT32               PageOffset,\r
+  IN UINT32               CountOffset,\r
+  IN UINT32               BaseAddress,\r
+  IN UINT16               Count\r
   );\r
 \r
 EFI_STATUS\r
 WritePort (\r
-  IN EFI_ISA_IO_PROTOCOL                  *This,\r
-  IN UINT32                               Offset,\r
-  IN UINT8                                Value\r
+  IN EFI_ISA_IO_PROTOCOL  *This,\r
+  IN UINT32               Offset,\r
+  IN UINT8                Value\r
   );    \r
 \r
 EFI_STATUS\r
 EFIAPI\r
 IsaIoMemRead (\r
-  IN     EFI_ISA_IO_PROTOCOL                       *This,\r
-  IN     EFI_ISA_IO_PROTOCOL_WIDTH                 Width,\r
-  IN     UINT32                                    Offset,\r
-  IN     UINTN                                     Count,\r
-  IN OUT VOID                                      *Buffer\r
+  IN  EFI_ISA_IO_PROTOCOL        *This,\r
+  IN  EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
+  IN  UINT32                     Offset,\r
+  IN  UINTN                      Count,\r
+  OUT VOID                       *Buffer\r
   );\r
 \r
 \r
 EFI_STATUS\r
 EFIAPI\r
 IsaIoMemWrite (\r
-  IN     EFI_ISA_IO_PROTOCOL                        *This,\r
-  IN     EFI_ISA_IO_PROTOCOL_WIDTH                  Width,\r
-  IN     UINT32                                     Offset,\r
-  IN     UINTN                                      Count,\r
-  IN OUT VOID                                       *Buffer\r
+  IN EFI_ISA_IO_PROTOCOL        *This,\r
+  IN EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
+  IN UINT32                     Offset,\r
+  IN UINTN                      Count,\r
+  IN VOID                       *Buffer\r
   );\r
 \r
 EFI_STATUS\r
 EFIAPI\r
 IsaIoCopyMem (\r
-  IN EFI_ISA_IO_PROTOCOL                        *This,\r
-  IN EFI_ISA_IO_PROTOCOL_WIDTH                  Width,\r
-  IN UINT32                                     DestOffset,\r
-  IN UINT32                                     SrcOffset,\r
-  IN UINTN                                      Count\r
+  IN EFI_ISA_IO_PROTOCOL        *This,\r
+  IN EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
+  IN UINT32                     DestOffset,\r
+  IN UINT32                     SrcOffset,\r
+  IN UINTN                      Count\r
   );\r
 \r
 EFI_STATUS\r
 EFIAPI\r
 IsaIoAllocateBuffer (\r
-  IN  EFI_ISA_IO_PROTOCOL                  *This,\r
-  IN  EFI_ALLOCATE_TYPE                    Type,\r
-  IN  EFI_MEMORY_TYPE                      MemoryType,\r
-  IN  UINTN                                Pages,\r
-  OUT VOID                                 **HostAddress,\r
-  IN  UINT64                               Attributes\r
+  IN  EFI_ISA_IO_PROTOCOL  *This,\r
+  IN  EFI_ALLOCATE_TYPE    Type,\r
+  IN  EFI_MEMORY_TYPE      MemoryType,\r
+  IN  UINTN                Pages,\r
+  OUT VOID                 **HostAddress,\r
+  IN  UINT64               Attributes\r
   );\r
 \r
 EFI_STATUS\r
 EFIAPI\r
 IsaIoFreeBuffer (\r
-  IN EFI_ISA_IO_PROTOCOL                  *This,\r
-  IN UINTN                                Pages,\r
-  IN VOID                                 *HostAddress\r
+  IN EFI_ISA_IO_PROTOCOL  *This,\r
+  IN UINTN                Pages,\r
+  IN VOID                 *HostAddress\r
   );\r
 \r
 #endif\r
+\r
index c1d091514e2524f764ee85e3ea52fab6dc704fe3..6af43dc9d8ec43f0cb73d4d77cf9ca69b87711f7 100644 (file)
@@ -1,13 +1,12 @@
 /**@file\r
+  ISA Bus UEFI driver.\r
 \r
-  Discovers all the ISA Controllers and their resources by using the ISA PnP \r
+  Discovers all the ISA Controllers and their resources by using the ISA ACPI \r
   Protocol, produces an instance of the ISA I/O Protocol for every ISA \r
-  Controller found, loads and initializes all ISA Device Drivers, matches ISA\r
-  Device Drivers with their respective ISA Controllers in a deterministic \r
-  manner, and informs a ISA Device Driver when it is to start managing an ISA\r
-  Controller. \r
+  Controller found. This driver is designed to manage a PCI-to-ISA bridge Device\r
+  such as LPC bridge.\r
   \r
-Copyright (c) 2006 - 2007, Intel Corporation.<BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation.<BR>\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
@@ -18,7 +17,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-\r
 #include "InternalIsaBus.h"\r
 \r
 //\r
@@ -34,14 +32,13 @@ EFI_DRIVER_BINDING_PROTOCOL gIsaBusControllerDriver = {
 };\r
 \r
 /**\r
-  The user Entry Point for module IsaBus. The user code starts with this function.\r
+  The main entry point for the ISA Bus driver.\r
 \r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
+  @param[in] ImageHandle        The firmware allocated handle for the EFI image.  \r
+  @param[in] SystemTable        A pointer to the EFI System Table.\r
   \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
+  @retval EFI_SUCCESS           The entry point is executed successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  There was not enough memory in pool to install all the protocols.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -65,47 +62,44 @@ InitializeIsaBus(
              );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-\r
   return Status;\r
 }\r
 \r
+/** \r
+  Tests to see if a controller can be managed by the ISA Bus Driver. If a child device is provided, \r
+  it further tests to see if this driver supports creating a handle for the specified child device.\r
 \r
+  Note that the ISA Bus driver always creates all of its child handles on the first call to Start().\r
+  How the Start() function of a driver is implemented can affect how the Supported() function is implemented.\r
+\r
+  @param[in] This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.  \r
+  @param[in] Controller           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             The device is supported by this driver.\r
+  @retval EFI_ALREADY_STARTED     The device is already being managed by this driver.\r
+  @retval EFI_ACCESS_DENIED       The device is already being managed by a different driver \r
+                                  or an application that requires exclusive access.\r
+  @retval EFI_UNSUPPORTED         The device is is not supported by this driver.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IsaBusControllerDriverSupported (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL  * This,\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
   IN EFI_HANDLE                   Controller,\r
-  IN EFI_DEVICE_PATH_PROTOCOL     * RemainingDevicePath OPTIONAL\r
+  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath OPTIONAL\r
   )\r
-/**\r
-\r
-  Routine Description:\r
-  \r
-    This function checks to see if a controller can be managed by the ISA Bus \r
-    Driver. This is done by checking to see if the controller supports the \r
-    EFI_PCI_IO_PROTOCOL protocol, and then looking at the PCI Configuration \r
-    Header to see if the device is a PCI to ISA bridge. The class code of \r
-    PCI to ISA bridge: Base class 06h, Sub class 01h Interface 00h \r
-  \r
-  Arguments:\r
-  \r
-    This                 - The EFI_DRIVER_BINDING_PROTOCOL instance.\r
-    Controller           - The handle of the device to check.\r
-    RemainingDevicePath  - A pointer to the remaining portion of a device path.\r
-\r
-  Returns:\r
-  \r
-    EFI_SUCCESS          - The device is supported by this driver.\r
-    EFI_UNSUPPORTED      - The device is not supported by this driver.\r
-\r
-**/\r
 {\r
-  EFI_STATUS            Status;\r
-  EFI_ISA_ACPI_PROTOCOL *IsaAcpi;\r
+  EFI_STATUS                Status;\r
+  EFI_DEVICE_PATH_PROTOCOL  *ParentDevicePath;\r
+  EFI_PCI_IO_PROTOCOL       *PciIo;\r
+  EFI_ISA_ACPI_PROTOCOL     *IsaAcpi;\r
 \r
   //\r
   // If RemainingDevicePath is not NULL, it should verify that the first device\r
-  // path node in RemainingDevicePath is an ACPI Device path node\r
+  // path node in RemainingDevicePath is an ACPI Device path node which is a \r
+  // legal Device Path Node for this bus driver's children.\r
   //\r
   if (RemainingDevicePath != NULL) {\r
     if (RemainingDevicePath->Type != ACPI_DEVICE_PATH) {\r
@@ -123,21 +117,45 @@ IsaBusControllerDriverSupported (
     }\r
   }\r
   //\r
-  // Test the existence of DEVICE_PATH protocol\r
+  // Try to open EFI DEVICE PATH protocol on the controller\r
   //\r
   Status = gBS->OpenProtocol (\r
                   Controller,\r
                   &gEfiDevicePathProtocolGuid,\r
-                  NULL,\r
+                  (VOID **) &ParentDevicePath,\r
+                  This->DriverBindingHandle,\r
+                  Controller,\r
+                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  gBS->CloseProtocol (\r
+         Controller,\r
+         &gEfiDevicePathProtocolGuid,\r
+         This->DriverBindingHandle,\r
+         Controller\r
+         );\r
+\r
+  //\r
+  // Try to get Pci IO Protocol because it is assumed\r
+  // to have been opened by ISA ACPI driver\r
+  //\r
+  Status = gBS->OpenProtocol (\r
+                  Controller,\r
+                  &gEfiPciIoProtocolGuid,\r
+                  (VOID **) &PciIo,\r
                   This->DriverBindingHandle,\r
                   Controller,\r
-                  EFI_OPEN_PROTOCOL_TEST_PROTOCOL\r
+                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
                   );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
+\r
   //\r
-  // Get the Isa Acpi protocol\r
+  // Try to open the Isa Acpi protocol on the controller\r
   //\r
   Status = gBS->OpenProtocol (\r
                   Controller,\r
@@ -147,14 +165,14 @@ IsaBusControllerDriverSupported (
                   Controller,\r
                   EFI_OPEN_PROTOCOL_BY_DRIVER\r
                   );\r
-  if (Status == EFI_ALREADY_STARTED) {\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
+  //\r
+  // Add more check to see if the child device is valid by calling IsaAcpi->DeviceEnumerate?\r
+  //\r
+\r
   gBS->CloseProtocol (\r
          Controller,\r
          &gEfiIsaAcpiProtocolGuid,\r
@@ -165,37 +183,40 @@ IsaBusControllerDriverSupported (
   return Status;\r
 }\r
 \r
+/**\r
+  Start this driver on ControllerHandle. \r
+  \r
+  Note that the ISA Bus driver always creates all of its child handles on the first call to Start().\r
+  The Start() function is designed to be invoked from the EFI boot service ConnectController(). \r
+  As a result, much of the error checking on the parameters to Start() has been moved into this \r
+  common boot service. It is legal to call Start() from other locations, but the following calling \r
+  restrictions must be followed or the system behavior will not be deterministic.\r
+  1. ControllerHandle must be a valid EFI_HANDLE.\r
+  2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
+     EFI_DEVICE_PATH_PROTOCOL.\r
+  3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
+     have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.  \r
+\r
+  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in]  ControllerHandle     The handle of the controller to start. This handle \r
+                                   must support a protocol interface that supplies \r
+                                   an I/O abstraction to the driver.\r
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path. \r
+                                   This parameter is ignored by device drivers, and is optional for bus drivers.\r
+\r
+  @retval EFI_SUCCESS              The device was started.\r
+  @retval EFI_DEVICE_ERROR         The device could not be started due to a device error.\r
+                                   Currently not implemented.\r
+  @retval EFI_OUT_OF_RESOURCES     The request could not be completed due to a lack of resources.\r
+  @retval Others                   The driver failded to start the device.\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IsaBusControllerDriverStart (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL  * This,\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
   IN EFI_HANDLE                   Controller,\r
-  IN EFI_DEVICE_PATH_PROTOCOL     * RemainingDevicePath OPTIONAL\r
+  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath OPTIONAL\r
   )\r
-/**\r
-\r
-  Routine Description:\r
-  \r
-    This function tells the ISA Bus Driver to start managing a PCI to ISA \r
-    Bridge controller. \r
-  \r
-  Arguments:\r
-  \r
-    This                  - The EFI_DRIVER_BINDING_PROTOCOL instance.\r
-    Controller            - A handle to the device being started. \r
-    RemainingDevicePath   - A pointer to the remaining portion of a device path.\r
-\r
-  Returns:\r
-  \r
-    EFI_SUCCESS           - The device was started.\r
-    EFI_UNSUPPORTED       - The device is not supported.\r
-    EFI_DEVICE_ERROR      - The device could not be started due to a device error.\r
-    EFI_ALREADY_STARTED   - The device has already been started.\r
-    EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r
-    EFI_OUT_OF_RESOURCES  - The request could not be completed due to a lack of \r
-                            resources.\r
-  \r
-**/\r
 {\r
   EFI_STATUS                            Status;\r
   EFI_PCI_IO_PROTOCOL                   *PciIo;\r
@@ -211,42 +232,35 @@ IsaBusControllerDriverStart (
   EFI_DEVICE_PATH_PROTOCOL              *DevicePathData;\r
 \r
   //\r
-  // Open Device Path Protocol\r
+  // Get Pci IO Protocol\r
   //\r
   Status = gBS->OpenProtocol (\r
                   Controller,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  (VOID **) &ParentDevicePath,\r
+                  &gEfiPciIoProtocolGuid,\r
+                  (VOID **) &PciIo,\r
                   This->DriverBindingHandle,\r
                   Controller,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
+                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
                   );\r
-  if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {\r
+  if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
+\r
   //\r
-  // Open Pci IO Protocol\r
+  // Open Device Path Protocol\r
   //\r
   Status = gBS->OpenProtocol (\r
                   Controller,\r
-                  &gEfiPciIoProtocolGuid,\r
-                  (VOID **) &PciIo,\r
+                  &gEfiDevicePathProtocolGuid,\r
+                  (VOID **) &ParentDevicePath,\r
                   This->DriverBindingHandle,\r
                   Controller,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
+                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
                   );\r
   if (EFI_ERROR (Status)) {\r
-    //\r
-    // Close opened protocol\r
-    //\r
-    gBS->CloseProtocol (\r
-           Controller,\r
-           &gEfiDevicePathProtocolGuid,\r
-           This->DriverBindingHandle,\r
-           Controller\r
-           );\r
     return Status;\r
   }\r
+\r
   //\r
   // Open ISA Acpi Protocol\r
   //\r
@@ -258,7 +272,7 @@ IsaBusControllerDriverStart (
                   Controller,\r
                   EFI_OPEN_PROTOCOL_BY_DRIVER\r
                   );\r
-  if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {\r
+  if (EFI_ERROR (Status)) {\r
     //\r
     // Close opened protocol\r
     //\r
@@ -268,12 +282,6 @@ IsaBusControllerDriverStart (
            This->DriverBindingHandle,\r
            Controller\r
            );\r
-    gBS->CloseProtocol (\r
-           Controller,\r
-           &gEfiPciIoProtocolGuid,\r
-           This->DriverBindingHandle,\r
-           Controller\r
-           );\r
     return Status;\r
   }\r
   //\r
@@ -390,6 +398,31 @@ IsaBusControllerDriverStart (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Stop this driver on ControllerHandle. \r
+  \r
+  The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). \r
+  As a result, much of the error checking on the parameters to Stop() has been moved \r
+  into this common boot service. It is legal to call Stop() from other locations, \r
+  but the following calling restrictions must be followed or the system behavior will not be deterministic.\r
+  1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
+     same driver's Start() function.\r
+  2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r
+     EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
+     Start() function, and the Start() function must have called OpenProtocol() on\r
+     ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
+  \r
+  @param[in]  This              A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must \r
+                                support a bus specific I/O protocol for the driver \r
+                                to use to stop the device.\r
+  @param[in]  NumberOfChildren  The number of child device handles in ChildHandleBuffer.\r
+  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL \r
+                                if NumberOfChildren is 0.\r
+\r
+  @retval EFI_SUCCESS           The device was stopped.\r
+  @retval EFI_DEVICE_ERROR      The device could not be stopped due to a device error.\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IsaBusControllerDriverStop (\r
@@ -398,31 +431,6 @@ IsaBusControllerDriverStop (
   IN  UINTN                        NumberOfChildren,\r
   IN  EFI_HANDLE                   * ChildHandleBuffer OPTIONAL\r
   )\r
-/**\r
-\r
-  Routine Description:\r
-  \r
-    This function tells the ISA Bus Driver to stop managing a PCI to ISA \r
-    Bridge controller. \r
-     \r
-  Arguments:\r
-  \r
-    This                   - The EFI_DRIVER_BINDING_PROTOCOL instance.\r
-    Controller             - A handle to the device being stopped.\r
-    NumberOfChindren       - The number of child device handles in ChildHandleBuffer.\r
-    ChildHandleBuffer      - An array of child handles to be freed.\r
-\r
-  \r
-  Returns:\r
-  \r
-    EFI_SUCCESS            - The device was stopped.\r
-    EFI_DEVICE_ERROR       - The device could not be stopped due to a device error.\r
-    EFI_NOT_STARTED        - The device has not been started.\r
-    EFI_INVALID_PARAMETER  - One of the parameters has an invalid value.\r
-    EFI_OUT_OF_RESOURCES   - The request could not be completed due to a lack of \r
-                             resources.\r
-\r
-**/\r
 {\r
   EFI_STATUS                          Status;\r
   UINTN                               Index;\r
@@ -434,16 +442,6 @@ IsaBusControllerDriverStop (
     //\r
     // Close the bus driver\r
     //\r
-    Status = gBS->CloseProtocol (\r
-                    Controller,\r
-                    &gEfiPciIoProtocolGuid,\r
-                    This->DriverBindingHandle,\r
-                    Controller\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
     Status = gBS->CloseProtocol (\r
                     Controller,\r
                     &gEfiDevicePathProtocolGuid,\r
@@ -527,9 +525,25 @@ IsaBusControllerDriverStop (
 \r
   return EFI_SUCCESS;\r
 }\r
+\r
 //\r
 // Internal Function\r
 //\r
+\r
+/**\r
+  Create EFI Handle for a ISA device found via ISA ACPI Protocol \r
+\r
+  @param[in] This                   The EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in] Controller             The handle of ISA bus controller(PCI to ISA bridge)\r
+  @param[in] PciIo                  The Pointer to the PCI protocol \r
+  @param[in] ParentDevicePath       Device path of the ISA bus controller\r
+  @param[in] IsaDeviceResourceList  The resource list of the ISA device\r
+  @param[in] ChildDevicePath        The pointer to the child device.\r
+\r
+  @retval EFI_SUCCESS               The handle for the child device was created.\r
+  @retval EFI_OUT_OF_RESOURCES      The request could not be completed due to a lack of resources.\r
+  @retval EFI_DEVICE_ERROR          The handle for the child device can not be created.\r
+**/\r
 EFI_STATUS\r
 IsaCreateDevice (\r
   IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
@@ -539,29 +553,6 @@ IsaCreateDevice (
   IN EFI_ISA_ACPI_RESOURCE_LIST   *IsaDeviceResourceList,\r
   OUT EFI_DEVICE_PATH_PROTOCOL    **ChildDevicePath\r
   )\r
-/**\r
-\r
-  Routine Description:\r
-  \r
-    Create ISA device found by IsaPnpProtocol \r
-\r
-  Arguments:\r
-  \r
-    This                   - The EFI_DRIVER_BINDING_PROTOCOL instance.\r
-    Controller             - The handle of ISA bus controller(PCI to ISA bridge)\r
-    PciIo                  - The Pointer to the PCI protocol \r
-    ParentDevicePath       - Device path of the ISA bus controller\r
-    IsaDeviceResourceList  - The resource list of the ISA device\r
-    ChildDevicePath        - The pointer to the child device.\r
-\r
-  Returns:\r
-  \r
-    EFI_SUCCESS            - Create the child device.\r
-    EFI_OUT_OF_RESOURCES   - The request could not be completed due to a lack of \r
-                             resources.\r
-    EFI_DEVICE_ERROR       - Can not create child device.\r
-    \r
-**/\r
 {\r
   EFI_STATUS    Status;\r
   ISA_IO_DEVICE *IsaIoDevice;\r
@@ -582,11 +573,8 @@ IsaCreateDevice (
   //\r
   // Initialize the ISA I/O instance structure\r
   //\r
-  Status = InitializeIsaIoInstance (IsaIoDevice, IsaDeviceResourceList);\r
-  if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (IsaIoDevice);\r
-    return Status;\r
-  }\r
+  InitializeIsaIoInstance (IsaIoDevice, IsaDeviceResourceList);\r
+\r
   //\r
   // Build the child device path\r
   //\r
@@ -602,15 +590,14 @@ IsaCreateDevice (
                               );\r
 \r
   if (IsaIoDevice->DevicePath == NULL) {\r
-    Status = EFI_DEVICE_ERROR;\r
+    Status = EFI_OUT_OF_RESOURCES;\r
     goto Done;\r
   }\r
 \r
   *ChildDevicePath = IsaIoDevice->DevicePath;\r
 \r
   //\r
-  // Create a child handle and attach the DevicePath,\r
-  // PCI I/O, and Controller State\r
+  // Create a child handle and install Device Path and ISA I/O protocols\r
   //\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &IsaIoDevice->Handle,\r
@@ -655,3 +642,4 @@ Done:
 \r
   return Status;\r
 }\r
+\r
index 5b27881bf087702a4c3397d290212479a2f854eb..7f06f7fe1c9d540dcbe1ab901f7434968806494b 100644 (file)
@@ -1,12 +1,10 @@
 #/** @file\r
 # Component description file for IsaBus module.\r
 #\r
-# Discovers all the ISA Controllers and their resources by using the ISA PnP\r
-# Protocol, produces an instance of the ISA I/O Protocol for every ISA\r
-# Controller found, loads and initializes all ISA Device Drivers, matches ISA\r
-# Device Drivers with their respective ISA Controllers in a deterministic\r
-# manner, and informs a ISA Device Driver when it is to start managing an ISA\r
-# Controller.\r
+# Discovers all the ISA Controllers and their resources by using the ISA ACPI \r
+# Protocol, produces an instance of the ISA I/O Protocol for every ISA \r
+# Controller found. This driver is designed to manage a PCI-to-ISA bridge Device\r
+# such as LPC bridge.\r
 #\r
 # Copyright (c) 2007 - 2009, Intel Corporation\r
 #\r
index 3907e0a6c76e39f297ad8cb6fb72955e8f91f5af..99295f48c41e79c77e57a846d49e3b942b7d0ecb 100644 (file)
@@ -1,7 +1,7 @@
 /**@file\r
   The implementation for EFI_ISA_IO_PROTOCOL. \r
   \r
-Copyright (c) 2006 - 2007, Intel Corporation.<BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation.<BR>\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
@@ -15,9 +15,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "InternalIsaIo.h"\r
 \r
 //\r
-// Driver Support Global Variables\r
+// Module Variables\r
 //\r
-EFI_ISA_IO_PROTOCOL IsaIoInterface = {\r
+EFI_ISA_IO_PROTOCOL mIsaIoInterface = {\r
   {    \r
     IsaIoMemRead,\r
     IsaIoMemWrite\r
@@ -37,7 +37,7 @@ EFI_ISA_IO_PROTOCOL IsaIoInterface = {
   NULL\r
 };\r
 \r
-EFI_ISA_DMA_REGISTERS  DmaRegisters[8] = {\r
+EFI_ISA_DMA_REGISTERS  mDmaRegisters[8] = {\r
   {\r
     0x00,\r
     0x87,\r
@@ -81,82 +81,72 @@ EFI_ISA_DMA_REGISTERS  DmaRegisters[8] = {
 };\r
 \r
 /**\r
-  report a error Status code of PCI bus driver controller\r
+  report a error Status code\r
 \r
-  @param Code         - The error status code.\r
+  @param Code          The error status code.\r
   \r
-  @return EFI_SUCCESS  Success to report status code.\r
+  @return EFI_SUCCESS  Success to report status code.\r
 **/\r
 EFI_STATUS\r
 ReportErrorStatusCode (\r
   EFI_STATUS_CODE_VALUE Code\r
   )\r
-\r
 {\r
   return REPORT_STATUS_CODE (\r
-                EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
-                Code\r
-                );\r
+           EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
+           Code\r
+           );\r
 }\r
 \r
-//\r
-// Driver Support Functions\r
-//\r
 /**\r
-\r
   Initializes an ISA I/O Instance\r
 \r
-  @param IsaIoDevice            - The iso device to be initialized.\r
-  @param IsaDeviceResourceList  - The resource list.\r
-  \r
-  @retval EFI_SUCCESS            - Initial success.\r
+  @param[in] IsaIoDevice            The iso device to be initialized.\r
+  @param[in] IsaDeviceResourceList  The resource list.\r
   \r
+  @retval None\r
 **/\r
-EFI_STATUS\r
+VOID\r
 InitializeIsaIoInstance (\r
   IN ISA_IO_DEVICE               *IsaIoDevice,\r
   IN EFI_ISA_ACPI_RESOURCE_LIST  *IsaDeviceResourceList\r
   )\r
 {\r
   //\r
-  // Initializes an ISA I/O Instance\r
+  // Use the ISA IO Protocol structure template to initialize the ISA IO instance\r
   //\r
   CopyMem (\r
     &IsaIoDevice->IsaIo,\r
-    &IsaIoInterface,\r
+    &mIsaIoInterface,\r
     sizeof (EFI_ISA_IO_PROTOCOL)\r
     );\r
 \r
   IsaIoDevice->IsaIo.ResourceList = IsaDeviceResourceList;\r
-  \r
-  return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
   Performs an ISA I/O Read Cycle\r
 \r
-  @param This                  - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
-  @param Width                 - Signifies the width of the I/O operation.\r
-  @param Offset                - The offset in ISA I/O space to start the I/O operation.  \r
-  @param Count                 - The number of I/O operations to perform. \r
-  @param Buffer                - The destination buffer to store the results\r
-\r
-  @retval EFI_SUCCESS           - The data was read from 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
+  @param[in]  This              A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param[in]  Width             Specifies the width of the I/O operation.\r
+  @param[in]  Offset            The offset in ISA I/O space to start the I/O operation.  \r
+  @param[in]  Count             The number of I/O operations to perform. \r
+  @param[out] Buffer            The destination buffer to store the results\r
 \r
+  @retval EFI_SUCCESS           The data was read from 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
 EFI_STATUS\r
 EFIAPI\r
 IsaIoIoRead (\r
-  IN     EFI_ISA_IO_PROTOCOL                        *This,\r
-  IN     EFI_ISA_IO_PROTOCOL_WIDTH                  Width,\r
-  IN     UINT32                                     Offset,\r
-  IN     UINTN                                      Count,\r
-  IN OUT VOID                                       *Buffer\r
+  IN  EFI_ISA_IO_PROTOCOL        *This,\r
+  IN  EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
+  IN  UINT32                     Offset,\r
+  IN  UINTN                      Count,\r
+  OUT VOID                       *Buffer\r
   )\r
-\r
 {\r
   EFI_STATUS    Status;\r
   ISA_IO_DEVICE *IsaIoDevice;\r
@@ -171,14 +161,12 @@ IsaIoIoRead (
              IsaAccessTypeIo,\r
              Width,\r
              Count,\r
-             &Offset\r
+             Offset\r
              );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  //\r
-  // Call PciIo->Io.Read\r
-  //\r
+\r
   Status = IsaIoDevice->PciIo->Io.Read (\r
                                     IsaIoDevice->PciIo,\r
                                     (EFI_PCI_IO_PROTOCOL_WIDTH) Width,\r
@@ -198,26 +186,25 @@ IsaIoIoRead (
 /**\r
   Performs an ISA I/O Write Cycle\r
 \r
-  @param This                  - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
-  @param Width                 - Signifies the width of the I/O operation.\r
-  @param Offset                - The offset in ISA I/O space to start the I/O operation.  \r
-  @param Count                 - The number of I/O operations to perform. \r
-  @param Buffer                - The source buffer to write data from\r
-\r
-  @retval EFI_SUCCESS           - The data was writen 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
+  @param[in] This                A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param[in] Width               Specifies the width of the I/O operation.\r
+  @param[in] Offset              The offset in ISA I/O space to start the I/O operation.  \r
+  @param[in] Count               The number of I/O operations to perform. \r
+  @param[in] Buffer              The source buffer to write data from\r
 \r
+  @retval EFI_SUCCESS            The data was writen 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
 EFI_STATUS\r
 EFIAPI\r
 IsaIoIoWrite (\r
-  IN     EFI_ISA_IO_PROTOCOL                        *This,\r
-  IN     EFI_ISA_IO_PROTOCOL_WIDTH                  Width,\r
-  IN     UINT32                                     Offset,\r
-  IN     UINTN                                      Count,\r
-  IN OUT VOID                                       *Buffer\r
+  IN EFI_ISA_IO_PROTOCOL        *This,\r
+  IN EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
+  IN UINT32                     Offset,\r
+  IN UINTN                      Count,\r
+  IN VOID                       *Buffer\r
   )\r
 {\r
   EFI_STATUS    Status;\r
@@ -233,14 +220,12 @@ IsaIoIoWrite (
              IsaAccessTypeIo,\r
              Width,\r
              Count,\r
-             &Offset\r
+             Offset\r
              );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  //\r
-  // Call PciIo->Io.Write\r
-  //\r
+\r
   Status = IsaIoDevice->PciIo->Io.Write (\r
                                     IsaIoDevice->PciIo,\r
                                     (EFI_PCI_IO_PROTOCOL_WIDTH) Width,\r
@@ -258,34 +243,29 @@ IsaIoIoWrite (
 }\r
 \r
 /**\r
-  Writes an 8 bit I/O Port\r
+  Writes an 8-bit I/O Port\r
 \r
-  @param This                  - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
-  @param Offset                - The offset in ISA IO space to start the IO operation.  \r
-  @param Value                 - The data to write port.\r
+  @param[in] This                A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param[in] Offset              The offset in ISA IO space to start the IO operation.  \r
+  @param[in] Value               The data to write port.\r
 \r
-  @retval EFI_SUCCESS           - Success.\r
-  @retval EFI_INVALID_PARAMETER - Parameter is invalid.\r
-  @retval EFI_UNSUPPORTED       - The address range specified by Offset is not valid.\r
-  @retval EFI_OUT_OF_RESOURCES  - The request could not be completed due to a lack of resources.\r
-  \r
+  @retval EFI_SUCCESS            Success.\r
+  @retval EFI_INVALID_PARAMETER  Parameter is invalid.\r
+  @retval EFI_UNSUPPORTED        The address range specified by Offset is not valid.\r
+  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a lack of resources.\r
 **/\r
 EFI_STATUS\r
 WritePort (\r
-  IN EFI_ISA_IO_PROTOCOL                  *This,\r
-  IN UINT32                               Offset,\r
-  IN UINT8                                Value\r
+  IN EFI_ISA_IO_PROTOCOL  *This,\r
+  IN UINT32               Offset,\r
+  IN UINT8                Value\r
   )\r
-\r
 {\r
   EFI_STATUS    Status;\r
   ISA_IO_DEVICE *IsaIoDevice;\r
 \r
   IsaIoDevice = ISA_IO_DEVICE_FROM_ISA_IO_THIS (This);\r
 \r
-  //\r
-  // Call PciIo->Io.Write\r
-  //\r
   Status = IsaIoDevice->PciIo->Io.Write (\r
                                     IsaIoDevice->PciIo,\r
                                     EfiPciIoWidthUint8,\r
@@ -307,29 +287,27 @@ WritePort (
 /**\r
   Writes I/O operation base address and count number to a 8 bit I/O Port.\r
 \r
-  @param This                  - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
-  @param AddrOffset            - The address' offset.\r
-  @param PageOffset            - The page's offest.\r
-  @param CountOffset           - The count's offset.\r
-  @param BaseAddress           - The base address.\r
-  @param Count                 - The number of I/O operations to perform. \r
+  @param[in] This                A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param[in] AddrOffset          The address' offset.\r
+  @param[in] PageOffset          The page's offest.\r
+  @param[in] CountOffset         The count's offset.\r
+  @param[in] BaseAddress         The base address.\r
+  @param[in] Count               The number of I/O operations to perform. \r
   \r
-  @retval EFI_SUCCESS           - Success.\r
-  @retval EFI_INVALID_PARAMETER - Parameter is invalid.\r
-  @retval EFI_UNSUPPORTED       - The address range specified by these Offsets and Count is not valid.\r
-  @retval EFI_OUT_OF_RESOURCES  - The request could not be completed due to a lack of resources.\r
-\r
+  @retval EFI_SUCCESS            Success.\r
+  @retval EFI_INVALID_PARAMETER  Parameter is invalid.\r
+  @retval EFI_UNSUPPORTED        The address range specified by these Offsets and Count is not valid.\r
+  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a lack of resources.\r
 **/\r
 EFI_STATUS\r
 WriteDmaPort (\r
-  IN EFI_ISA_IO_PROTOCOL                  *This,\r
-  IN UINT32                               AddrOffset,\r
-  IN UINT32                               PageOffset,\r
-  IN UINT32                               CountOffset,\r
-  IN UINT32                               BaseAddress,\r
-  IN UINT16                               Count\r
+  IN EFI_ISA_IO_PROTOCOL  *This,\r
+  IN UINT32               AddrOffset,\r
+  IN UINT32               PageOffset,\r
+  IN UINT32               CountOffset,\r
+  IN UINT32               BaseAddress,\r
+  IN UINT16               Count\r
   )\r
-\r
 {\r
   EFI_STATUS  Status;\r
 \r
@@ -354,28 +332,23 @@ WriteDmaPort (
   }\r
 \r
   Status = WritePort (This, CountOffset, (UINT8) ((Count >> 8) & 0xff));\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
+  return Status;\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
+  @param[in] This           A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param[in] 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
 EFI_STATUS\r
 EFIAPI\r
 IsaIoUnmap (\r
-  IN EFI_ISA_IO_PROTOCOL                  *This,\r
-  IN VOID                                 *Mapping\r
+  IN EFI_ISA_IO_PROTOCOL  *This,\r
+  IN VOID                 *Mapping\r
   )\r
 {\r
   ISA_MAP_INFO  *IsaMapInfo;\r
@@ -421,29 +394,24 @@ IsaIoUnmap (
 }\r
 \r
 /**\r
-  Flushes a DMA buffer\r
+  Flushes any posted write data to the system memory.\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
+  @param[in] 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
 EFI_STATUS\r
 EFIAPI\r
 IsaIoFlush (\r
-  IN EFI_ISA_IO_PROTOCOL                  *This\r
+  IN EFI_ISA_IO_PROTOCOL  *This\r
   )\r
-\r
 {\r
   EFI_STATUS    Status;\r
   ISA_IO_DEVICE *IsaIoDevice;\r
 \r
   IsaIoDevice = ISA_IO_DEVICE_FROM_ISA_IO_THIS (This);\r
 \r
-  //\r
-  // Call PciIo->Flush\r
-  //\r
   Status = IsaIoDevice->PciIo->Flush (IsaIoDevice->PciIo);\r
 \r
   if (EFI_ERROR (Status)) {\r
@@ -456,26 +424,24 @@ IsaIoFlush (
 /**\r
   Verifies access to an ISA device\r
 \r
-  @param IsaIoDevice           - The ISA device to be verified.\r
-  @param Type                  - The Access type. The input must be either IsaAccessTypeMem or IsaAccessTypeIo.\r
-  @param Width                 - Signifies the width of the memory operation.\r
-  @param Count                 - The number of memory operations to perform. \r
-  @param Offset                - The offset in ISA memory space to start the memory operation.  \r
+  @param[in] IsaIoDevice         The ISA device to be verified.\r
+  @param[in] Type                The Access type. The input must be either IsaAccessTypeMem or IsaAccessTypeIo.\r
+  @param[in] Width               The width of the memory operation.\r
+  @param[in] Count               The number of memory operations to perform. \r
+  @param[in] Offset              The offset in ISA memory space to start the memory operation.  \r
   \r
-  @retval EFI_SUCCESS           - Verify success.\r
-  @retval EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r
-  @retval EFI_UNSUPPORTED       - The device ont support the access type.\r
-\r
+  @retval EFI_SUCCESS            Verify success.\r
+  @retval EFI_INVALID_PARAMETER  One of the parameters has an invalid value.\r
+  @retval EFI_UNSUPPORTED        The device ont support the access type.\r
 **/\r
 EFI_STATUS\r
 IsaIoVerifyAccess (\r
-  IN     ISA_IO_DEVICE              *IsaIoDevice,\r
-  IN     ISA_ACCESS_TYPE            Type,\r
-  IN     EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
-  IN     UINTN                      Count,\r
-  IN OUT UINT32                     *Offset\r
+  IN ISA_IO_DEVICE              *IsaIoDevice,\r
+  IN ISA_ACCESS_TYPE            Type,\r
+  IN EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
+  IN UINTN                      Count,\r
+  IN UINT32                     Offset\r
   )\r
-\r
 {\r
   EFI_ISA_ACPI_RESOURCE *Item;\r
   EFI_STATUS            Status;\r
@@ -493,7 +459,7 @@ IsaIoVerifyAccess (
   // If Width is EfiIsaIoWidthFifoUintX then convert to EfiIsaIoWidthUintX\r
   // If Width is EfiIsaIoWidthFillUintX then convert to EfiIsaIoWidthUintX\r
   //\r
-  if (Width >= EfiIsaIoWidthFifoUint8 && Width <= EfiIsaIoWidthFifoReserved) {\r
+  if (Width >= EfiIsaIoWidthFifoUint8 && Width < EfiIsaIoWidthFifoReserved) {\r
     Count = 1;\r
   }\r
 \r
@@ -503,13 +469,12 @@ IsaIoVerifyAccess (
   Item    = IsaIoDevice->IsaIo.ResourceList->ResourceItem;\r
   while (Item->Type != EfiIsaAcpiResourceEndOfList) {\r
     if ((Type == IsaAccessTypeMem && Item->Type == EfiIsaAcpiResourceMemory) ||\r
-        (Type == IsaAccessTypeIo && Item->Type == EfiIsaAcpiResourceIo)\r
-        ) {\r
-      if (*Offset >= Item->StartRange && (*Offset + Count * (UINT32)(1 << Width)) - 1 <= Item->EndRange) {\r
+        (Type == IsaAccessTypeIo && Item->Type == EfiIsaAcpiResourceIo)) {\r
+      if (Offset >= Item->StartRange && (Offset + Count * (UINT32)(1 << Width)) - 1 <= Item->EndRange) {\r
         return EFI_SUCCESS;\r
       }\r
 \r
-      if (*Offset >= Item->StartRange && *Offset <= Item->EndRange) {\r
+      if (Offset >= Item->StartRange && Offset <= Item->EndRange) {\r
         Status = EFI_INVALID_PARAMETER;\r
       }\r
     }\r
@@ -521,40 +486,35 @@ IsaIoVerifyAccess (
 }\r
 \r
 /**\r
-\r
   Performs an ISA Memory Read Cycle\r
 \r
-  @param This                  - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
-  @param Width                 - Signifies the width of the memory operation.\r
-  @param Offset                - The offset in ISA memory space to start the memory operation.  \r
-  @param Count                 - The number of memory operations to perform. \r
-  @param Buffer                - The destination buffer to store the results\r
+  @param[in]  This               A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param[in]  Width              Specifies the width of the memory operation.\r
+  @param[in]  Offset             The offset in ISA memory space to start the memory operation.  \r
+  @param[in]  Count              The number of memory operations to perform. \r
+  @param[out] Buffer             The destination buffer to store the results\r
  \r
-  @retval EFI_SUCCESS           - The data was read from the device successfully.\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
+  @retval EFI_SUCCESS            The data was read from the device successfully.\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
 EFI_STATUS\r
 EFIAPI\r
 IsaIoMemRead (\r
-  IN     EFI_ISA_IO_PROTOCOL                       *This,\r
-  IN     EFI_ISA_IO_PROTOCOL_WIDTH                 Width,\r
-  IN     UINT32                                    Offset,\r
-  IN     UINTN                                     Count,\r
-  IN OUT VOID                                      *Buffer\r
+  IN  EFI_ISA_IO_PROTOCOL        *This,\r
+  IN  EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
+  IN  UINT32                     Offset,\r
+  IN  UINTN                      Count,\r
+  OUT VOID                       *Buffer\r
   )\r
-\r
 {\r
   EFI_STATUS    Status;\r
   ISA_IO_DEVICE *IsaIoDevice;\r
 \r
   //\r
-  // Set Feature Flag PcdIsaBusSupportBusMaster to FALSE to disable support for \r
-  // ISA Bus Master.\r
-  //\r
-  // So we just return EFI_UNSUPPORTED for these functions.\r
+  // Set Feature Flag PcdIsaBusSupportIsaMemory to FALSE to disable support for\r
+  // ISA bus memory read/write operations.\r
   //\r
   if (!FeaturePcdGet (PcdIsaBusSupportIsaMemory)) {\r
     return EFI_UNSUPPORTED;\r
@@ -570,14 +530,12 @@ IsaIoMemRead (
              IsaAccessTypeMem,\r
              Width,\r
              Count,\r
-             &Offset\r
+             Offset\r
              );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  //\r
-  // Call PciIo->Mem.Read\r
-  //\r
+\r
   Status = IsaIoDevice->PciIo->Mem.Read (\r
                                      IsaIoDevice->PciIo,\r
                                      (EFI_PCI_IO_PROTOCOL_WIDTH) Width,\r
@@ -597,36 +555,33 @@ IsaIoMemRead (
 /**\r
   Performs an ISA Memory Write Cycle\r
 \r
-  @param This                  - A pointer to the EFI_ISA_IO_PROTOCOL instance.  \r
-  @param Width                 - Signifies the width of the memory operation.\r
-  @param Offset                - The offset in ISA memory space to start the memory operation.  \r
-  @param Count                 - The number of memory operations to perform. \r
-  @param Buffer                - The source buffer to write data from\r
-\r
-  @retval EFI_SUCCESS           - The data was 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
+  @param[in] This                A pointer to the EFI_ISA_IO_PROTOCOL instance.  \r
+  @param[in] Width               Specifies the width of the memory operation.\r
+  @param[in] Offset              The offset in ISA memory space to start the memory operation.  \r
+  @param[in] Count               The number of memory operations to perform. \r
+  @param[in] Buffer              The source buffer to write data from\r
 \r
+  @retval EFI_SUCCESS            The data was 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
 EFI_STATUS\r
 EFIAPI\r
 IsaIoMemWrite (\r
-  IN     EFI_ISA_IO_PROTOCOL                        *This,\r
-  IN     EFI_ISA_IO_PROTOCOL_WIDTH                  Width,\r
-  IN     UINT32                                     Offset,\r
-  IN     UINTN                                      Count,\r
-  IN OUT VOID                                       *Buffer\r
+  IN EFI_ISA_IO_PROTOCOL        *This,\r
+  IN EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
+  IN UINT32                     Offset,\r
+  IN UINTN                      Count,\r
+  IN VOID                       *Buffer\r
   )\r
 {\r
   EFI_STATUS    Status;\r
   ISA_IO_DEVICE *IsaIoDevice;\r
 \r
   //\r
-  // Set Feature Flag PcdIsaBusSupportBusMaster to FALSE to disable support for \r
-  // ISA Bus Master.\r
-  //\r
-  // So we just return EFI_UNSUPPORTED for these functions.\r
+  // Set Feature Flag PcdIsaBusSupportIsaMemory to FALSE to disable support for\r
+  // ISA bus memory read/write operations.\r
   //\r
   if (!FeaturePcdGet (PcdIsaBusSupportIsaMemory)) {\r
     return EFI_UNSUPPORTED;\r
@@ -642,14 +597,12 @@ IsaIoMemWrite (
              IsaAccessTypeMem,\r
              Width,\r
              Count,\r
-             &Offset\r
+             Offset\r
              );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  //\r
-  // Call PciIo->Mem.Write\r
-  //\r
+\r
   Status = IsaIoDevice->PciIo->Mem.Write (\r
                                      IsaIoDevice->PciIo,\r
                                      (EFI_PCI_IO_PROTOCOL_WIDTH) Width,\r
@@ -667,39 +620,35 @@ IsaIoMemWrite (
 }\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
+  Copy one region of ISA memory space to another region of ISA memory space on the ISA controller.\r
+\r
+  @param[in]  This               A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param[in]  Width              Specifies the width of the memory copy operation.\r
+  @param[out] DestOffset         The offset of the destination \r
+  @param[in]  SrcOffset          The offset of the source\r
+  @param[in]  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
 EFI_STATUS\r
 EFIAPI\r
 IsaIoCopyMem (\r
-  IN EFI_ISA_IO_PROTOCOL                        *This,\r
-  IN EFI_ISA_IO_PROTOCOL_WIDTH                  Width,\r
-  IN UINT32                                     DestOffset,\r
-  IN UINT32                                     SrcOffset,\r
-  IN UINTN                                      Count\r
+  IN EFI_ISA_IO_PROTOCOL        *This,\r
+  IN EFI_ISA_IO_PROTOCOL_WIDTH  Width,\r
+  IN UINT32                     DestOffset,\r
+  IN UINT32                     SrcOffset,\r
+  IN UINTN                      Count\r
   )\r
-\r
 {\r
   EFI_STATUS    Status;\r
   ISA_IO_DEVICE *IsaIoDevice;\r
 \r
   //\r
-  // Set Feature Flag PcdIsaBusSupportBusMaster to FALSE to disable support for \r
-  // ISA Bus Master.\r
-  //\r
-  // So we just return EFI_UNSUPPORTED for these functions.\r
+  // Set Feature Flag PcdIsaBusSupportIsaMemory to FALSE to disable support for\r
+  // ISA bus memory read/write operations.\r
   //\r
   if (!FeaturePcdGet (PcdIsaBusSupportIsaMemory)) {\r
     return EFI_UNSUPPORTED;\r
@@ -715,7 +664,7 @@ IsaIoCopyMem (
              IsaAccessTypeMem,\r
              Width,\r
              Count,\r
-             &DestOffset\r
+             DestOffset\r
              );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
@@ -726,14 +675,12 @@ IsaIoCopyMem (
              IsaAccessTypeMem,\r
              Width,\r
              Count,\r
-             &SrcOffset\r
+             SrcOffset\r
              );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  //\r
-  // Call PciIo->CopyMem\r
-  //\r
+\r
   Status = IsaIoDevice->PciIo->CopyMem (\r
                                  IsaIoDevice->PciIo,\r
                                  (EFI_PCI_IO_PROTOCOL_WIDTH) Width,\r
@@ -755,40 +702,38 @@ IsaIoCopyMem (
   Maps a memory region for DMA, note this implementation\r
   only supports slave read/write operation to save code size.\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
-  @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
+  @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
+  @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
 EFI_STATUS\r
-IsaIoMap_OnlySupportSlaveReadWrite (\r
-  IN     EFI_ISA_IO_PROTOCOL                                  *This,\r
-  IN     EFI_ISA_IO_PROTOCOL_OPERATION                        Operation,\r
-  IN     UINT8                                                ChannelNumber         OPTIONAL,\r
-  IN     UINT32                                               ChannelAttributes,\r
-  IN     VOID                                                 *HostAddress,\r
-  IN OUT UINTN                                                *NumberOfBytes,\r
-  OUT    EFI_PHYSICAL_ADDRESS                                 *DeviceAddress,\r
-  OUT    VOID                                                 **Mapping\r
+IsaIoMapOnlySupportSlaveReadWrite (\r
+  IN     EFI_ISA_IO_PROTOCOL            *This,\r
+  IN     EFI_ISA_IO_PROTOCOL_OPERATION  Operation,\r
+  IN     UINT8                          ChannelNumber  OPTIONAL,\r
+  IN     UINT32                         ChannelAttributes,\r
+  IN     VOID                           *HostAddress,\r
+  IN OUT UINTN                          *NumberOfBytes,\r
+  OUT    EFI_PHYSICAL_ADDRESS           *DeviceAddress,\r
+  OUT    VOID                           **Mapping\r
   )\r
-\r
 {\r
   EFI_STATUS            Status;\r
   EFI_PHYSICAL_ADDRESS  PhysicalAddress;\r
@@ -797,7 +742,6 @@ IsaIoMap_OnlySupportSlaveReadWrite (
   UINTN                 MaxNumberOfBytes;\r
   UINT32                BaseAddress;\r
   UINT16                Count;\r
-\r
   UINT8                 DmaMask;\r
   UINT8                 DmaClear;\r
   UINT8                 DmaChannelMode;\r
@@ -811,7 +755,6 @@ IsaIoMap_OnlySupportSlaveReadWrite (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-\r
   //\r
   // Initialize the return values to their defaults\r
   //\r
@@ -837,7 +780,7 @@ IsaIoMap_OnlySupportSlaveReadWrite (
   // Map the HostAddress to a DeviceAddress.\r
   //\r
   PhysicalAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress;\r
-  if ((PhysicalAddress +*NumberOfBytes) > ISA_MAX_MEMORY_ADDRESS) {\r
+  if ((PhysicalAddress + *NumberOfBytes) > ISA_MAX_MEMORY_ADDRESS) {\r
     //\r
     // Common Buffer operations can not be remapped.  If the common buffer\r
     // is above 16MB, then it is not possible to generate a mapping, so return\r
@@ -969,9 +912,9 @@ IsaIoMap_OnlySupportSlaveReadWrite (
 \r
   Status = WriteDmaPort (\r
              This,\r
-             DmaRegisters[ChannelNumber].Address,\r
-             DmaRegisters[ChannelNumber].Page,\r
-             DmaRegisters[ChannelNumber].Count,\r
+             mDmaRegisters[ChannelNumber].Address,\r
+             mDmaRegisters[ChannelNumber].Page,\r
+             mDmaRegisters[ChannelNumber].Count,\r
              BaseAddress,\r
              Count\r
              );\r
@@ -995,30 +938,29 @@ IsaIoMap_OnlySupportSlaveReadWrite (
   Maps a memory region for DMA. This implementation implement the \r
   the full mapping support.\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
+  @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
   @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
 EFI_STATUS\r
-IsaIoMap_FullSupport (\r
+IsaIoMapFullSupport (\r
   IN     EFI_ISA_IO_PROTOCOL                                  *This,\r
   IN     EFI_ISA_IO_PROTOCOL_OPERATION                        Operation,\r
   IN     UINT8                                                ChannelNumber         OPTIONAL,\r
@@ -1028,7 +970,6 @@ IsaIoMap_FullSupport (
   OUT    EFI_PHYSICAL_ADDRESS                                 *DeviceAddress,\r
   OUT    VOID                                                 **Mapping\r
   )\r
-\r
 {\r
   EFI_STATUS            Status;\r
   BOOLEAN               Master;\r
@@ -1039,7 +980,6 @@ IsaIoMap_FullSupport (
   UINTN                 MaxNumberOfBytes;\r
   UINT32                BaseAddress;\r
   UINT16                Count;\r
-\r
   UINT8                 DmaMask;\r
   UINT8                 DmaClear;\r
   UINT8                 DmaChannelMode;\r
@@ -1053,7 +993,6 @@ IsaIoMap_FullSupport (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-\r
   //\r
   // Initialize the return values to their defaults\r
   //\r
@@ -1303,9 +1242,9 @@ IsaIoMap_FullSupport (
 \r
   Status = WriteDmaPort (\r
              This,\r
-             DmaRegisters[ChannelNumber].Address,\r
-             DmaRegisters[ChannelNumber].Page,\r
-             DmaRegisters[ChannelNumber].Count,\r
+             mDmaRegisters[ChannelNumber].Address,\r
+             mDmaRegisters[ChannelNumber].Page,\r
+             mDmaRegisters[ChannelNumber].Count,\r
              BaseAddress,\r
              Count\r
              );\r
@@ -1328,45 +1267,42 @@ IsaIoMap_FullSupport (
 /**\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
+  @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
+  @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
 EFI_STATUS\r
 EFIAPI\r
 IsaIoMap (\r
-  IN     EFI_ISA_IO_PROTOCOL                                  *This,\r
-  IN     EFI_ISA_IO_PROTOCOL_OPERATION                        Operation,\r
-  IN     UINT8                                                ChannelNumber         OPTIONAL,\r
-  IN     UINT32                                               ChannelAttributes,\r
-  IN     VOID                                                 *HostAddress,\r
-  IN OUT UINTN                                                *NumberOfBytes,\r
-  OUT    EFI_PHYSICAL_ADDRESS                                 *DeviceAddress,\r
-  OUT    VOID                                                 **Mapping\r
+  IN     EFI_ISA_IO_PROTOCOL            *This,\r
+  IN     EFI_ISA_IO_PROTOCOL_OPERATION  Operation,\r
+  IN     UINT8                          ChannelNumber  OPTIONAL,\r
+  IN     UINT32                         ChannelAttributes,\r
+  IN     VOID                           *HostAddress,\r
+  IN OUT UINTN                          *NumberOfBytes,\r
+  OUT    EFI_PHYSICAL_ADDRESS           *DeviceAddress,\r
+  OUT    VOID                           **Mapping\r
   )\r
-\r
 {\r
   //\r
-  // Or unset Feature Flag PcdIsaBusSupportDma to disable support for ISA DMA.\r
+  // Set Feature Flag PcdIsaBusSupportDma to FALSE to disable support for ISA DMA.\r
   //\r
   if (!FeaturePcdGet (PcdIsaBusSupportDma)) {\r
     return EFI_UNSUPPORTED;\r
@@ -1378,57 +1314,56 @@ IsaIoMap (
   // So we just return EFI_UNSUPPORTED for these functions.\r
   //\r
   if (FeaturePcdGet (PcdIsaBusOnlySupportSlaveDma)) {\r
-    return IsaIoMap_OnlySupportSlaveReadWrite (\r
-              This,\r
-              Operation,\r
-              ChannelNumber,\r
-              ChannelAttributes,\r
-              HostAddress,\r
-              NumberOfBytes,\r
-              DeviceAddress,\r
-              Mapping\r
+    return IsaIoMapOnlySupportSlaveReadWrite (\r
+             This,\r
+             Operation,\r
+             ChannelNumber,\r
+             ChannelAttributes,\r
+             HostAddress,\r
+             NumberOfBytes,\r
+             DeviceAddress,\r
+             Mapping\r
              );\r
 \r
   } else {\r
-    return IsaIoMap_FullSupport (\r
-              This,\r
-              Operation,\r
-              ChannelNumber,\r
-              ChannelAttributes,\r
-              HostAddress,\r
-              NumberOfBytes,\r
-              DeviceAddress,\r
-              Mapping\r
+    return IsaIoMapFullSupport (\r
+             This,\r
+             Operation,\r
+             ChannelNumber,\r
+             ChannelAttributes,\r
+             HostAddress,\r
+             NumberOfBytes,\r
+             DeviceAddress,\r
+             Mapping\r
              );\r
   }\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
+  Allocates pages that are suitable for an EfiIsaIoOperationBusMasterCommonBuffer mapping.\r
+\r
+  @param[in]  This               A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param[in]  Type               The type allocation to perform.\r
+  @param[in]  MemoryType         The type of memory to allocate.\r
+  @param[in]  Pages              The number of pages to allocate.\r
+  @param[out] HostAddress        A pointer to store the base address of the allocated range.\r
+  @param[in]  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
 EFI_STATUS\r
 EFIAPI\r
 IsaIoAllocateBuffer (\r
-  IN  EFI_ISA_IO_PROTOCOL                  *This,\r
-  IN  EFI_ALLOCATE_TYPE                    Type,\r
-  IN  EFI_MEMORY_TYPE                      MemoryType,\r
-  IN  UINTN                                Pages,\r
-  OUT VOID                                 **HostAddress,\r
-  IN  UINT64                               Attributes\r
+  IN  EFI_ISA_IO_PROTOCOL  *This,\r
+  IN  EFI_ALLOCATE_TYPE    Type,\r
+  IN  EFI_MEMORY_TYPE      MemoryType,\r
+  IN  UINTN                Pages,\r
+  OUT VOID                 **HostAddress,\r
+  IN  UINT64               Attributes\r
   )\r
 {\r
   EFI_STATUS            Status;\r
@@ -1457,7 +1392,7 @@ IsaIoAllocateBuffer (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (Attributes &~(EFI_ISA_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE | EFI_ISA_IO_ATTRIBUTE_MEMORY_CACHED)) {\r
+  if (Attributes & ~(EFI_ISA_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE | EFI_ISA_IO_ATTRIBUTE_MEMORY_CACHED)) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -1485,29 +1420,24 @@ IsaIoAllocateBuffer (
 }\r
 \r
 /**\r
+  Frees memory that was allocated with EFI_ISA_IO.AllocateBuffer(). \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
+  @param[in] This                A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+  @param[in] Pages               The number of pages to free.\r
+  @param[in] HostAddress         The base address of the allocated range.\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
 EFI_STATUS\r
 EFIAPI\r
 IsaIoFreeBuffer (\r
-  IN EFI_ISA_IO_PROTOCOL                  *This,\r
-  IN UINTN                                Pages,\r
-  IN VOID                                 *HostAddress\r
+  IN EFI_ISA_IO_PROTOCOL  *This,\r
+  IN UINTN                Pages,\r
+  IN VOID                 *HostAddress\r
   )\r
 {\r
-  EFI_STATUS            Status;\r
-  EFI_PHYSICAL_ADDRESS  PhysicalAddress;\r
+  EFI_STATUS  Status;\r
 \r
   //\r
   // Set Feature Flag PcdIsaBusOnlySupportSlaveDma to FALSE to disable support for \r
@@ -1518,9 +1448,8 @@ IsaIoFreeBuffer (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  PhysicalAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress;\r
   Status = gBS->FreePages (\r
-                  PhysicalAddress,\r
+                  (EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress,\r
                   Pages\r
                   );\r
   if (EFI_ERROR (Status)) {\r