]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/SmbusHc.h
MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC
[mirror_edk2.git] / MdePkg / Include / Protocol / SmbusHc.h
index 09d51642c513ed1b30e9399c8cd68a86723d66b4..ed20a471785913c5ab6a512fb783e1409580b5bd 100644 (file)
@@ -2,8 +2,8 @@
   The file provides basic SMBus host controller management \r
   and basic data transactions over the SMBus.\r
 \r
-  Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
-  All rights reserved. This program and the accompanying materials                          \r
+  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
   http://opensource.org/licenses/bsd-license.php                                            \r
@@ -19,7 +19,7 @@
 #ifndef __SMBUS_HC_H__\r
 #define __SMBUS_HC_H__\r
 \r
-#include <Ppi/Smbus2.h>\r
+#include <IndustryStandard/SmBus.h>\r
 \r
 #define EFI_SMBUS_HC_PROTOCOL_GUID \\r
   {0xe49d33ed, 0x513d, 0x4634, { 0xb6, 0x98, 0x6f, 0x55, 0xaa, 0x75, 0x1c, 0x1b} }\r
@@ -32,14 +32,14 @@ typedef struct _EFI_SMBUS_HC_PROTOCOL EFI_SMBUS_HC_PROTOCOL;
   operation as defined in the System Management Bus (SMBus)\r
   Specification. The resulting transaction will be either that\r
   the SMBus slave devices accept this transaction or that this\r
-  function returns with error. Status Codes Returned\r
+  function returns with error. \r
   \r
-  @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
-              SlaveAddress The SMBus slave address of the device\r
-              with which to communicate. Type\r
-              EFI_SMBUS_DEVICE_ADDRESS is defined in\r
-              EFI_PEI_SMBUS_PPI.Execute() in the Platform\r
-              Initialization SMBus PPI Specification.\r
+  @param This     A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
+                  SlaveAddress The SMBus slave address of the device\r
+                  with which to communicate. Type\r
+                  EFI_SMBUS_DEVICE_ADDRESS is defined in\r
+                  EFI_PEI_SMBUS_PPI.Execute() in the Platform\r
+                  Initialization SMBus PPI Specification.\r
 \r
   @param Command  This command is transmitted by the SMBus host\r
                   controller to the SMBus slave device and the\r
@@ -51,8 +51,9 @@ typedef struct _EFI_SMBUS_HC_PROTOCOL EFI_SMBUS_HC_PROTOCOL;
                   EFI_SMBUS_DEVICE_COMMAND is defined in\r
                   EFI_PEI_SMBUS_PPI.Execute() in the Platform\r
                   Initialization SMBus PPI Specification.\r
-                  Operation Signifies which particular SMBus\r
-                  hardware protocol instance that it will use to\r
+\r
+ @param Operation Signifies the particular SMBus\r
+                  hardware protocol instance it will use to\r
                   execute the SMBus transactions. This SMBus\r
                   hardware protocol is defined by the SMBus\r
                   Specification and is not related to PI\r
@@ -61,16 +62,17 @@ typedef struct _EFI_SMBUS_HC_PROTOCOL EFI_SMBUS_HC_PROTOCOL;
                   Platform Initialization SMBus PPI\r
                   Specification.\r
 \r
-  @param PecCheck   Defines if Packet Error Code (PEC) checking\r
-                    is required for this operation. SMBus Host\r
-                    Controller Code Definitions Version 1.0\r
-                    August 21, 2006 13 Length Signifies the\r
-                    number of bytes that this operation will do.\r
-                    The maximum number of bytes can be revision\r
-                    specific and operation specific. This field\r
-                    will contain the actual number of bytes that\r
-                    are executed for this operation. Not all\r
-                    operations require this argument.\r
+  @param PecCheck Defines if Packet Error Code (PEC) checking\r
+                  is required for this operation. SMBus Host\r
+                  Controller Code Definitions Version 1.0\r
+                  August 21, 2006 13 \r
+                  \r
+ @param Length    Signifies the number of bytes that this operation will do.\r
+                  The maximum number of bytes can be revision\r
+                  specific and operation specific. This field\r
+                  will contain the actual number of bytes that\r
+                  are executed for this operation. Not all\r
+                  operations require this argument.\r
 \r
   @param Buffer   Contains the value of data to execute to the\r
                   SMBus slave device. Not all operations require\r
@@ -78,28 +80,27 @@ typedef struct _EFI_SMBUS_HC_PROTOCOL EFI_SMBUS_HC_PROTOCOL;
                   identified by Length.\r
   \r
   \r
-  @retval EFI_SUCCESS   The last data that was returned from the\r
-                        access matched the poll exit criteria.\r
+  @retval EFI_SUCCESS           The last data that was returned from the\r
+                                access matched the poll exit criteria.\r
 \r
-  @retval EFI_CRC_ERROR Checksum is not correct (PEC is\r
-                        incorrect).\r
+  @retval EFI_CRC_ERROR         Checksum is not correct (PEC is incorrect).\r
 \r
-  @retval EFI_TIMEOUT   Timeout expired before the operation was\r
-                        completed. Timeout is determined by the\r
-                        SMBus host controller device.\r
+  @retval EFI_TIMEOUT           Timeout expired before the operation was\r
+                                completed. Timeout is determined by the\r
+                                SMBus host controller device.\r
 \r
   @retval EFI_OUT_OF_RESOURCES  The request could not be\r
                                 completed due to a lack of\r
                                 resources.\r
 \r
-  @retval EFI_DEVICE_ERROR  The request was not completed\r
-                            because a failure that was reflected\r
-                            in the Host Status Register bit.\r
-                            Device errors are a result of a\r
-                            transaction collision, illegal\r
-                            command field, unclaimed cycle (host\r
-                            initiated), or bus errors\r
-                            (collisions).\r
+  @retval EFI_DEVICE_ERROR      The request was not completed\r
+                                because a failure that was reflected\r
+                                in the Host Status Register bit.\r
+                                Device errors are a result of a\r
+                                transaction collision, illegal\r
+                                command field, unclaimed cycle (host\r
+                                initiated), or bus errors\r
+                                (collisions).\r
 \r
   @retval EFI_INVALID_PARAMETER Operation is not defined in\r
                                 EFI_SMBUS_OPERATION.\r
@@ -111,8 +112,8 @@ typedef struct _EFI_SMBUS_HC_PROTOCOL EFI_SMBUS_HC_PROTOCOL;
                                 outside the range of valid\r
                                 values.\r
 \r
-  @retval EFI_UNSUPPORTED   The SMBus operation or PEC is not\r
-                            supported. \r
+  @retval EFI_UNSUPPORTED       The SMBus operation or PEC is not\r
+                                supported. \r
 \r
   @retval EFI_BUFFER_TOO_SMALL  Buffer is not sufficient for\r
                                 this operation.\r
@@ -120,12 +121,12 @@ typedef struct _EFI_SMBUS_HC_PROTOCOL EFI_SMBUS_HC_PROTOCOL;
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_SMBUS_HC_EXECUTE_OPERATION) (\r
+(EFIAPI *EFI_SMBUS_HC_EXECUTE_OPERATION)(\r
   IN CONST  EFI_SMBUS_HC_PROTOCOL     *This,\r
-  IN CONST  EFI_SMBUS_DEVICE_ADDRESS  SlaveAddress,\r
-  IN CONST  EFI_SMBUS_DEVICE_COMMAND  Command,\r
-  IN CONST  EFI_SMBUS_OPERATION       Operation,\r
-  IN CONST  BOOLEAN                   PecCheck,\r
+  IN        EFI_SMBUS_DEVICE_ADDRESS  SlaveAddress,\r
+  IN        EFI_SMBUS_DEVICE_COMMAND  Command,\r
+  IN        EFI_SMBUS_OPERATION       Operation,\r
+  IN        BOOLEAN                   PecCheck,\r
   IN OUT    UINTN                     *Length,\r
   IN OUT    VOID                      *Buffer\r
 );\r
@@ -134,84 +135,80 @@ EFI_STATUS
 \r
 /**\r
    \r
-  The ArpDevice() function provides a standard way for a device driver to enumerate the entire\r
-  SMBus or specific devices on the bus.\r
+  The ArpDevice() function provides a standard way for a device driver to \r
+  enumerate the entire SMBus or specific devices on the bus.\r
   \r
-  \r
-  @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
-\r
-  @param ArpAll   A Boolean expression that indicates if the\r
-                  host drivers need to enumerate all the devices\r
-                  or enumerate only the device that is\r
-                  identified by SmbusUdid. If ArpAll is TRUE,\r
-                  SmbusUdid and SlaveAddress are optional. If\r
-                  ArpAll is FALSE, ArpDevice will enumerate\r
-                  SmbusUdid and the address will be at\r
-                  SlaveAddress.\r
-\r
-  @param SmbusUdid  The Unique Device Identifier (UDID) that is\r
-                    associated with this device. Type\r
-                    EFI_SMBUS_UDID is defined in\r
-                    EFI_PEI_SMBUS_PPI.ArpDevice() in the\r
-                    Platform Initialization SMBus PPI\r
-                    Specification.\r
+  @param This           A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
+\r
+  @param ArpAll         A Boolean expression that indicates if the\r
+                        host drivers need to enumerate all the devices\r
+                        or enumerate only the device that is\r
+                        identified by SmbusUdid. If ArpAll is TRUE,\r
+                        SmbusUdid and SlaveAddress are optional. If\r
+                        ArpAll is FALSE, ArpDevice will enumerate\r
+                        SmbusUdid and the address will be at\r
+                        SlaveAddress.\r
+\r
+  @param SmbusUdid      The Unique Device Identifier (UDID) that is\r
+                        associated with this device. Type\r
+                        EFI_SMBUS_UDID is defined in\r
+                        EFI_PEI_SMBUS_PPI.ArpDevice() in the\r
+                        Platform Initialization SMBus PPI\r
+                        Specification.\r
 \r
   @param SlaveAddress   The SMBus slave address that is\r
                         associated with an SMBus UDID.\r
 \r
+  @retval EFI_SUCCESS           The last data that was returned from the\r
+                                access matched the poll exit criteria.\r
 \r
+  @retval EFI_CRC_ERROR         Checksum is not correct (PEC is\r
+                                incorrect).\r
 \r
-  @retval EFI_SUCCESS   The last data that was returned from the\r
-                        access matched the poll exit criteria.\r
-\r
-  @retval EFI_CRC_ERROR Checksum is not correct (PEC is\r
-                        incorrect).\r
-\r
-  @retval EFI_TIMEOUT   Timeout expired before the operation was\r
-                        completed. Timeout is determined by the\r
-                        SMBus host controller device.\r
+  @retval EFI_TIMEOUT           Timeout expired before the operation was\r
+                                completed. Timeout is determined by the\r
+                                SMBus host controller device.\r
 \r
   @retval EFI_OUT_OF_RESOURCES  The request could not be\r
                                 completed due to a lack of\r
                                 resources.\r
 \r
-  @retval EFI_DEVICE_ERROR  The request was not completed\r
-                            because a failure was reflected in\r
-                            the Host Status Register bit. Device\r
-                            Errors are a result of a transaction\r
-                            collision, illegal command field,\r
-                            unclaimed cycle (host initiated), or\r
-                            bus errors (collisions).\r
+  @retval EFI_DEVICE_ERROR      The request was not completed\r
+                                because a failure was reflected in\r
+                                the Host Status Register bit. Device\r
+                                Errors are a result of a transaction\r
+                                collision, illegal command field,\r
+                                unclaimed cycle (host initiated), or\r
+                                bus errors (collisions).\r
 \r
-  @retval EFI_UNSUPPORTED   ArpDevice, GetArpMap, and Notify are\r
-                            not implemented by this driver.\r
+  @retval EFI_UNSUPPORTED       ArpDevice, GetArpMap, and Notify are\r
+                                not implemented by this driver.\r
    \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE) (\r
+(EFIAPI *EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE)(\r
   IN CONST  EFI_SMBUS_HC_PROTOCOL     *This,\r
-  IN CONST  BOOLEAN                   ArpAll,\r
-  IN CONST  EFI_SMBUS_UDID            *SmbusUdid,   OPTIONAL\r
+  IN        BOOLEAN                   ArpAll,\r
+  IN        EFI_SMBUS_UDID            *SmbusUdid,   OPTIONAL\r
   IN OUT    EFI_SMBUS_DEVICE_ADDRESS  *SlaveAddress OPTIONAL\r
 );\r
 \r
 \r
 /**\r
-  The GetArpMap() function returns the mapping of all the SMBus devices that were enumerated\r
-  by the SMBus host driver.\r
+  The GetArpMap() function returns the mapping of all the SMBus devices \r
+  that were enumerated by the SMBus host driver.\r
   \r
-  @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
+  @param This           A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
   \r
-  @param Length   Size of the buffer that contains the SMBus\r
-                  device map.\r
+  @param Length         Size of the buffer that contains the SMBus\r
+                        device map.\r
   \r
   @param SmbusDeviceMap The pointer to the device map as\r
                         enumerated by the SMBus controller\r
                         driver.\r
   \r
-  @retval EFI_SUCCESS   The SMBus returned the current device\r
-                        map.\r
+  @retval EFI_SUCCESS       The SMBus returned the current device map.\r
   \r
   @retval EFI_UNSUPPORTED   ArpDevice, GetArpMap, and Notify are\r
                             not implemented by this driver.\r
@@ -219,22 +216,28 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP) (\r
+(EFIAPI *EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP)(\r
   IN CONST  EFI_SMBUS_HC_PROTOCOL   *This,\r
   IN OUT    UINTN                   *Length,\r
   IN OUT    EFI_SMBUS_DEVICE_MAP    **SmbusDeviceMap\r
 );\r
 \r
+/**\r
+  The notify function does some actions.\r
+  \r
+  @param SlaveAddress\r
+  The SMBUS hardware address to which the SMBUS device is preassigned or allocated.\r
 \r
-\r
-//\r
-// EFI_SMBUS_NOTIFY_FUNCTION\r
-//\r
+  @param Data\r
+  Data of the SMBus host notify command that the caller wants to be called.\r
+  \r
+  @return EFI_STATUS\r
+**/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_SMBUS_NOTIFY_FUNCTION) (\r
-  IN CONST  EFI_SMBUS_DEVICE_ADDRESS  SlaveAddress,\r
-  IN CONST  UINTN                     Data\r
+(EFIAPI *EFI_SMBUS_NOTIFY_FUNCTION)(\r
+  IN        EFI_SMBUS_DEVICE_ADDRESS  SlaveAddress,\r
+  IN        UINTN                     Data\r
 );\r
 \r
 \r
@@ -244,20 +247,20 @@ EFI_STATUS
   allow the bus driver to call these functions when the \r
   SlaveAddress/Data pair happens.\r
   \r
-  @param  This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
+  @param  This            A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
   \r
-  @param  SlaveAddress  Address that the host controller detects\r
-                        as sending a message and calls all the registered function.\r
+  @param  SlaveAddress    Address that the host controller detects\r
+                          as sending a message and calls all the registered function.\r
 \r
-  @param  Data  Data that the host controller detects as sending\r
-                message and calls all the registered function.\r
+  @param  Data            Data that the host controller detects as sending\r
+                          message and calls all the registered function.\r
 \r
 \r
   @param  NotifyFunction  The function to call when the bus\r
                           driver detects the SlaveAddress and\r
                           Data pair.\r
 \r
-  @retval EFI_SUCCESS   NotifyFunction was registered.\r
+  @retval EFI_SUCCESS       NotifyFunction was registered.\r
   \r
   @retval EFI_UNSUPPORTED   ArpDevice, GetArpMap, and Notify are\r
                             not implemented by this driver.\r
@@ -265,36 +268,19 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_SMBUS_HC_PROTOCOL_NOTIFY) (\r
+(EFIAPI *EFI_SMBUS_HC_PROTOCOL_NOTIFY)(\r
   IN CONST  EFI_SMBUS_HC_PROTOCOL     *This,\r
-  IN CONST  EFI_SMBUS_DEVICE_ADDRESS  SlaveAddress,\r
-  IN CONST  UINTN                     Data,\r
-  IN CONST  EFI_SMBUS_NOTIFY_FUNCTION NotifyFunction\r
+  IN        EFI_SMBUS_DEVICE_ADDRESS  SlaveAddress,\r
+  IN        UINTN                     Data,\r
+  IN        EFI_SMBUS_NOTIFY_FUNCTION NotifyFunction\r
 );\r
 \r
 \r
-/**\r
-  The EFI_SMBUS_HC_PROTOCOL provides SMBus host controller management and basic data\r
-  transactions over SMBus. There is one EFI_SMBUS_HC_PROTOCOL instance for each SMBus\r
-  host controller.\r
-\r
-  @param Execute  Executes the SMBus operation to an SMBus slave\r
-                  device. See the Execute() function description.\r
-  \r
-  @param ArpDevice  Allows an SMBus 2.0 device(s) to be Address\r
-                    Resolution Protocol (ARP).\r
-  \r
-  @param GetArpMap  Allows a driver to retrieve the address that\r
-                    was allocated by the SMBus host controller\r
-                    during enumeration/ARP. See the GetArpMap()\r
-                    function description.\r
-  \r
-  @param  Notify    Allows a driver to register for a callback\r
-                    to the SMBus host controller driver when the\r
-                    bus issues a notification to the bus\r
-                    controller driver. See the Notify() function\r
-                    description.\r
-**/\r
+///\r
+/// The EFI_SMBUS_HC_PROTOCOL provides SMBus host controller management and basic data\r
+/// transactions over SMBus. There is one EFI_SMBUS_HC_PROTOCOL instance for each SMBus\r
+/// host controller.\r
+///\r
 struct _EFI_SMBUS_HC_PROTOCOL {\r
   EFI_SMBUS_HC_EXECUTE_OPERATION    Execute;\r
   EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE  ArpDevice;\r