/** @file\r
This file declares Smbus2 PPI.\r
+ This PPI provides the basic I/O interfaces that a PEIM uses to access its\r
+ SMBus controller and the slave devices attached to it.\r
\r
- Copyright (c) 2006 - 2007, Intel Corporation \r
- All rights reserved. This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
+ Copyright (c) 2006 - 2018, 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
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
@par Revision Reference:\r
- This PPI is defined in PI.\r
- Version 1.00\r
+ This PPI is introduced in PI Version 1.0.\r
\r
**/\r
\r
-#ifndef _PEI_SMBUS2_PPI_H\r
-#define _PEI_SMBUS2_PPI_H\r
+#ifndef __PEI_SMBUS2_PPI_H__\r
+#define __PEI_SMBUS2_PPI_H__\r
\r
#include <IndustryStandard/SmBus.h>\r
\r
\r
typedef struct _EFI_PEI_SMBUS2_PPI EFI_PEI_SMBUS2_PPI;\r
\r
-//\r
-// EFI_SMBUS_DEVICE_COMMAND\r
-//\r
-typedef UINTN EFI_SMBUS_DEVICE_COMMAND;\r
-\r
-\r
-/*\r
- Executes an SMBus operation to an SMBus controller.\r
+/**\r
+ Executes an SMBus operation to an SMBus controller. Returns when either\r
+ the command has been executed or an error is encountered in doing the operation.\r
\r
@param This A pointer to the EFI_PEI_SMBUS2_PPI instance.\r
@param SlaveAddress The SMBUS hardware address to which the SMBUS device is preassigned or\r
allocated.\r
- @param Command This command is transmitted by the SMBus host controller to the SMBus slave \r
- device and the interpretation is SMBus slave device specific. \r
- It can mean the offset to a list of functions inside \r
+ @param Command This command is transmitted by the SMBus host controller to the SMBus slave\r
+ device and the interpretation is SMBus slave device specific.\r
+ It can mean the offset to a list of functions inside\r
an SMBus slave device. Not all operations or slave devices support\r
this command's registers.\r
-\r
- @param Operation Signifies which particular SMBus hardware protocol instance that it \r
- will use to execute the SMBus transactions. \r
- This SMBus hardware protocol is defined by the System Management Bus (SMBus) \r
+ @param Operation Signifies which particular SMBus hardware protocol instance that it\r
+ will use to execute the SMBus transactions.\r
+ This SMBus hardware protocol is defined by the System Management Bus (SMBus)\r
Specification and is not related to UEFI.\r
-\r
@param PecCheck Defines if Packet Error Code (PEC) checking is required for this operation.\r
-\r
- @param Length Signifies the number of bytes that this operation will do. \r
+ @param Length Signifies the number of bytes that this operation will do.\r
The maximum number of bytes can be revision specific and operation specific.\r
This parameter will contain the actual number of bytes that are executed\r
for this operation. Not all operations require this argument.\r
-\r
- @param Buffer Contains the value of data to execute to the SMBus slave device. \r
- Not all operations require this argument. \r
+ @param Buffer Contains the value of data to execute to the SMBus slave device.\r
+ Not all operations require this argument.\r
The length of this buffer is identified by Length.\r
\r
\r
a failure reflected in the Host Status Register bit.\r
@retval EFI_INVALID_PARAMETER Operation is not defined in EFI_SMBUS_OPERATION.\r
Or Length/Buffer is NULL for operations except for EfiSmbusQuickRead and\r
- EfiSmbusQuickWrite. Length is outside the range of valid values.\r
+ EfiSmbusQuickWrite. Or Length is outside the range of valid values.\r
@retval EFI_UNSUPPORTED The SMBus operation or PEC is not supported.\r
@retval EFI_BUFFER_TOO_SMALL Buffer is not sufficient for this operation.\r
\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION) (\r
+(EFIAPI *EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION)(\r
IN CONST EFI_PEI_SMBUS2_PPI *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
\r
/**\r
- CallBack function can be registered in EFI_PEI_SMBUS_PPI_NOTIFY.\r
-\r
- @param This A pointer to the EFI_PEI_SMBUS_PPI instance.\r
- @param SlaveAddress The SMBUS hardware address to which the SMBUS\r
- device is preassigned or allocated.\r
- @param Data Data of the SMBus host notify command that\r
- the caller wants to be called.\r
+ The ArpDevice() function enumerates the entire bus or enumerates a specific\r
+ device that is identified by SmbusUdid.\r
\r
- @return Status Code\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_PEI_SMBUS_NOTIFY2_FUNCTION) (\r
- IN CONST EFI_PEI_SMBUS2_PPI *SmbusPpi,\r
- IN CONST EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,\r
- IN CONST UINTN Data\r
-);\r
-/**\r
- The ArpDevice() function enumerates the entire bus or enumerates a specific \r
- device that is identified by SmbusUdid. \r
-\r
- @param This A pointer to the EFI_PEI_SMBUS_PPI instance.\r
+ @param This A pointer to the EFI_PEI_SMBUS2_PPI instance.\r
@param ArpAll A Boolean expression that indicates if the host drivers need\r
to enumerate all the devices or enumerate only the device that is identified\r
by SmbusUdid. If ArpAll is TRUE, SmbusUdid and SlaveAddress are optional.\r
due to a lack of resources.\r
@retval EFI_TIMEOUT The SMBus slave device did not respond.\r
@retval EFI_DEVICE_ERROR The request was not completed because the transaction failed.\r
+ @retval EFI_UNSUPPORTED ArpDevice, GetArpMap, and Notify are not implemented by this PEIM.\r
\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_PEI_SMBUS2_PPI_ARP_DEVICE) (\r
+(EFIAPI *EFI_PEI_SMBUS2_PPI_ARP_DEVICE)(\r
IN CONST EFI_PEI_SMBUS2_PPI *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
-typedef struct {\r
- EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress;\r
- EFI_SMBUS_UDID SmbusDeviceUdid;\r
-} EFI_SMBUS_DEVICE_MAP;\r
-\r
/**\r
- The GetArpMap() function returns the mapping of all the SMBus devices \r
- that are enumerated by the SMBus host driver. \r
+ The GetArpMap() function returns the mapping of all the SMBus devices\r
+ that are enumerated by the SMBus host driver.\r
\r
- @param This A pointer to the EFI_PEI_SMBUS_PPI instance.\r
+ @param This A pointer to the EFI_PEI_SMBUS2_PPI instance.\r
@param Length Size of the buffer that contains the SMBus device map.\r
@param SmbusDeviceMap The pointer to the device map as enumerated\r
by the SMBus controller driver.\r
\r
@retval EFI_SUCCESS The device map was returned correctly in the buffer.\r
+ @retval EFI_UNSUPPORTED ArpDevice, GetArpMap, and Notify are not implemented by this PEIM.\r
\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_PEI_SMBUS2_PPI_GET_ARP_MAP) (\r
+(EFIAPI *EFI_PEI_SMBUS2_PPI_GET_ARP_MAP)(\r
IN CONST EFI_PEI_SMBUS2_PPI *This,\r
IN OUT UINTN *Length,\r
IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap\r
);\r
\r
+/**\r
+ CallBack function can be registered in EFI_PEI_SMBUS2_PPI_NOTIFY.\r
+\r
+ @param This A pointer to the EFI_PEI_SMBUS2_PPI instance.\r
+ @param SlaveAddress The SMBUS hardware address to which the SMBUS\r
+ device is preassigned or allocated.\r
+ @param Data Data of the SMBus host notify command that\r
+ the caller wants to be called.\r
+\r
+ @retval EFI_SUCCESS NotifyFunction has been registered.\r
+ @retval EFI_UNSUPPORTED ArpDevice, GetArpMap, and Notify are not\r
+ implemented by this PEIM.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_SMBUS_NOTIFY2_FUNCTION)(\r
+ IN CONST EFI_PEI_SMBUS2_PPI *SmbusPpi,\r
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,\r
+ IN UINTN Data\r
+);\r
\r
/**\r
- The Notify() function registers all the callback functions to allow the \r
+ The Notify() function registers all the callback functions to allow the\r
bus driver to call these functions when the SlaveAddress/Data pair happens.\r
\r
- @param PeiServices A pointer to the system PEI Services Table.\r
- @param This A pointer to the EFI_PEI_SMBUS_PPI instance.\r
+ @param This A pointer to the EFI_PEI_SMBUS2_PPI instance.\r
@param SlaveAddress Address that the host controller detects as\r
sending a message and calls all the registered functions.\r
@param Data Data that the host controller detects as sending a message\r
@param NotifyFunction The function to call when the bus driver\r
detects the SlaveAddress and Data pair.\r
\r
- @retval EFI_SUCCESS NotifyFunction has been registered.\r
-\r
+ @retval EFI_SUCCESS NotifyFunction has been registered.\r
+ @retval EFI_UNSUPPORTED ArpDevice, GetArpMap, and Notify are not\r
+ implemented by this PEIM.\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_PEI_SMBUS2_PPI_NOTIFY) (\r
- IN CONST EFI_PEI_SMBUS2_PPI *This,\r
- IN CONST EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,\r
- IN CONST UINTN Data,\r
- IN CONST EFI_PEI_SMBUS_NOTIFY2_FUNCTION NotifyFunction\r
+(EFIAPI *EFI_PEI_SMBUS2_PPI_NOTIFY)(\r
+ IN CONST EFI_PEI_SMBUS2_PPI *This,\r
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,\r
+ IN UINTN Data,\r
+ IN EFI_PEI_SMBUS_NOTIFY2_FUNCTION NotifyFunction\r
);\r
\r
-/**\r
- @par Ppi Description:\r
- Provides the basic I/O interfaces that a PEIM uses to access \r
- its SMBus controller and the slave devices attached to it.\r
-\r
- @param Execute\r
- Executes the SMBus operation to an SMBus slave device.\r
-\r
- @param ArpDevice\r
- Allows an SMBus 2.0 device(s) to be Address Resolution Protocol (ARP)\r
-\r
- @param GetArpMap\r
- Allows a PEIM to retrieve the address that was allocated by the SMBus \r
- host controller during enumeration/ARP.\r
-\r
- @param Notify\r
- Allows a driver to register for a callback to the SMBus host \r
- controller driver when the bus issues a notification to the bus controller PEIM.\r
-\r
- @param Identifier\r
- Identifier which uniquely identifies this SMBus controller in a system.\r
-\r
-**/\r
+///\r
+/// Provides the basic I/O interfaces that a PEIM uses to access\r
+/// its SMBus controller and the slave devices attached to it.\r
+///\r
struct _EFI_PEI_SMBUS2_PPI {\r
EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION Execute;\r
EFI_PEI_SMBUS2_PPI_ARP_DEVICE ArpDevice;\r
EFI_PEI_SMBUS2_PPI_GET_ARP_MAP GetArpMap;\r
EFI_PEI_SMBUS2_PPI_NOTIFY Notify;\r
+ ///\r
+ /// Identifier which uniquely identifies this SMBus controller in a system.\r
+ ///\r
EFI_GUID Identifier;\r
};\r
\r