MdePkg[all]  1.08
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SmbusHc.h File Reference

Data Structures

struct  _EFI_SMBUS_HC_PROTOCOL
 

Macros

#define EFI_SMBUS_HC_PROTOCOL_GUID   {0xe49d33ed, 0x513d, 0x4634, { 0xb6, 0x98, 0x6f, 0x55, 0xaa, 0x75, 0x1c, 0x1b} }
 

Typedefs

typedef struct
_EFI_SMBUS_HC_PROTOCOL 
EFI_SMBUS_HC_PROTOCOL
 
typedef EFI_STATUS(EFIAPIEFI_SMBUS_HC_EXECUTE_OPERATION )(IN CONST EFI_SMBUS_HC_PROTOCOL *This, IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, IN EFI_SMBUS_DEVICE_COMMAND Command, IN EFI_SMBUS_OPERATION Operation, IN BOOLEAN PecCheck, IN OUT UINTN *Length, IN OUT VOID *Buffer)
 
typedef EFI_STATUS(EFIAPIEFI_SMBUS_HC_PROTOCOL_ARP_DEVICE )(IN CONST EFI_SMBUS_HC_PROTOCOL *This, IN BOOLEAN ArpAll, IN EFI_SMBUS_UDID *SmbusUdid, IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress)
 
typedef EFI_STATUS(EFIAPIEFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP )(IN CONST EFI_SMBUS_HC_PROTOCOL *This, IN OUT UINTN *Length, IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap)
 
typedef EFI_STATUS(EFIAPIEFI_SMBUS_NOTIFY_FUNCTION )(IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, IN UINTN Data)
 
typedef EFI_STATUS(EFIAPIEFI_SMBUS_HC_PROTOCOL_NOTIFY )(IN CONST EFI_SMBUS_HC_PROTOCOL *This, IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, IN UINTN Data, IN EFI_SMBUS_NOTIFY_FUNCTION NotifyFunction)
 

Variables

EFI_GUID gEfiSmbusHcProtocolGuid
 

Detailed Description

The file provides basic SMBus host controller management and basic data transactions over the SMBus.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Revision Reference: PI
Version 1.00.

Macro Definition Documentation

#define EFI_SMBUS_HC_PROTOCOL_GUID   {0xe49d33ed, 0x513d, 0x4634, { 0xb6, 0x98, 0x6f, 0x55, 0xaa, 0x75, 0x1c, 0x1b} }

Typedef Documentation

The Execute() function provides a standard way to execute an operation as defined in the System Management Bus (SMBus) Specification. The resulting transaction will be either that the SMBus slave devices accept this transaction or that this function returns with error.

Parameters
ThisA pointer to the EFI_SMBUS_HC_PROTOCOL instance. SlaveAddress The SMBus slave address of the device with which to communicate. Type EFI_SMBUS_DEVICE_ADDRESS is defined in EFI_PEI_SMBUS_PPI.Execute() in the Platform Initialization SMBus PPI Specification.
CommandThis command is transmitted by the SMBus host controller to the SMBus slave device and the interpretation is SMBus slave device specific. It can mean the offset to a list of functions inside an SMBus slave device. Not all operations or slave devices support this command's registers. Type EFI_SMBUS_DEVICE_COMMAND is defined in EFI_PEI_SMBUS_PPI.Execute() in the Platform Initialization SMBus PPI Specification.
OperationSignifies the particular SMBus hardware protocol instance it will use to execute the SMBus transactions. This SMBus hardware protocol is defined by the SMBus Specification and is not related to PI Architecture. Type EFI_SMBUS_OPERATION is defined in EFI_PEI_SMBUS_PPI.Execute() in the Platform Initialization SMBus PPI Specification.
PecCheckDefines if Packet Error Code (PEC) checking is required for this operation. SMBus Host Controller Code Definitions Version 1.0 August 21, 2006 13
LengthSignifies the number of bytes that this operation will do. The maximum number of bytes can be revision specific and operation specific. This field will contain the actual number of bytes that are executed for this operation. Not all operations require this argument.
BufferContains the value of data to execute to the SMBus slave device. Not all operations require this argument. The length of this buffer is identified by Length.
Return values
EFI_SUCCESSThe last data that was returned from the access matched the poll exit criteria.
EFI_CRC_ERRORChecksum is not correct (PEC is incorrect).
EFI_TIMEOUTTimeout expired before the operation was completed. Timeout is determined by the SMBus host controller device.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.
EFI_DEVICE_ERRORThe request was not completed because a failure that was reflected in the Host Status Register bit. Device errors are a result of a transaction collision, illegal command field, unclaimed cycle (host initiated), or bus errors (collisions).
EFI_INVALID_PARAMETEROperation is not defined in EFI_SMBUS_OPERATION.
EFI_INVALID_PARAMETERLength/Buffer is NULL for operations except for EfiSmbusQuickRead and EfiSmbusQuickWrite. Length is outside the range of valid values.
EFI_UNSUPPORTEDThe SMBus operation or PEC is not supported.
EFI_BUFFER_TOO_SMALLBuffer is not sufficient for this operation.
typedef EFI_STATUS(EFIAPI * EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE)(IN CONST EFI_SMBUS_HC_PROTOCOL *This, IN BOOLEAN ArpAll, IN EFI_SMBUS_UDID *SmbusUdid, IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress)

The ArpDevice() function provides a standard way for a device driver to enumerate the entire SMBus or specific devices on the bus.

Parameters
ThisA pointer to the EFI_SMBUS_HC_PROTOCOL instance.
ArpAllA Boolean expression that indicates if the host drivers need to enumerate all the devices or enumerate only the device that is identified by SmbusUdid. If ArpAll is TRUE, SmbusUdid and SlaveAddress are optional. If ArpAll is FALSE, ArpDevice will enumerate SmbusUdid and the address will be at SlaveAddress.
SmbusUdidThe Unique Device Identifier (UDID) that is associated with this device. Type EFI_SMBUS_UDID is defined in EFI_PEI_SMBUS_PPI.ArpDevice() in the Platform Initialization SMBus PPI Specification.
SlaveAddressThe SMBus slave address that is associated with an SMBus UDID.
Return values
EFI_SUCCESSThe last data that was returned from the access matched the poll exit criteria.
EFI_CRC_ERRORChecksum is not correct (PEC is incorrect).
EFI_TIMEOUTTimeout expired before the operation was completed. Timeout is determined by the SMBus host controller device.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.
EFI_DEVICE_ERRORThe request was not completed because a failure was reflected in the Host Status Register bit. Device Errors are a result of a transaction collision, illegal command field, unclaimed cycle (host initiated), or bus errors (collisions).
EFI_UNSUPPORTEDArpDevice, GetArpMap, and Notify are not implemented by this driver.
typedef EFI_STATUS(EFIAPI * EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP)(IN CONST EFI_SMBUS_HC_PROTOCOL *This, IN OUT UINTN *Length, IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap)

The GetArpMap() function returns the mapping of all the SMBus devices that were enumerated by the SMBus host driver.

Parameters
ThisA pointer to the EFI_SMBUS_HC_PROTOCOL instance.
LengthSize of the buffer that contains the SMBus device map.
SmbusDeviceMapThe pointer to the device map as enumerated by the SMBus controller driver.
Return values
EFI_SUCCESSThe SMBus returned the current device map.
EFI_UNSUPPORTEDArpDevice, GetArpMap, and Notify are not implemented by this driver.

The Notify() function registers all the callback functions to allow the bus driver to call these functions when the SlaveAddress/Data pair happens.

Parameters
ThisA pointer to the EFI_SMBUS_HC_PROTOCOL instance.
SlaveAddressAddress that the host controller detects as sending a message and calls all the registered function.
DataData that the host controller detects as sending message and calls all the registered function.
NotifyFunctionThe function to call when the bus driver detects the SlaveAddress and Data pair.
Return values
EFI_SUCCESSNotifyFunction was registered.
EFI_UNSUPPORTEDArpDevice, GetArpMap, and Notify are not implemented by this driver.
typedef EFI_STATUS(EFIAPI * EFI_SMBUS_NOTIFY_FUNCTION)(IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, IN UINTN Data)

The notify function does some actions.

Parameters
SlaveAddressThe SMBUS hardware address to which the SMBUS device is preassigned or allocated.
DataData of the SMBus host notify command that the caller wants to be called.
Returns
EFI_STATUS

Variable Documentation

EFI_GUID gEfiSmbusHcProtocolGuid