2 This file declares the EFI SMBus Host Controller protocol
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 @par Revision Reference:
16 This protocol is defined in Framework of EFI SMBus Host Controller Specification
24 #define EFI_SMBUS_HC_PROTOCOL_GUID \
26 0xe49d33ed, 0x513d, 0x4634, {0xb6, 0x98, 0x6f, 0x55, 0xaa, 0x75, 0x1c, 0x1b } \
29 typedef struct _EFI_SMBUS_HC_PROTOCOL EFI_SMBUS_HC_PROTOCOL
;
32 Executes an SMBus operation to an SMBus controller.
34 @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.
35 @param SlaveAddress The SMBus slave address of the device with which to communicate.
36 @param Command This command is transmitted by the SMBus host
37 controller to the SMBus slave device and the interpretation is
38 SMBus slave device specific.
39 @param Operation Signifies which particular SMBus hardware protocol
40 instance that it will use to execute the SMBus transactions.
41 @param PecCheck Defines if Packet Error Code (PEC) checking is required
43 @param Length Signifies the number of bytes that this operation will do.
44 @param Buffer Contains the value of data to execute to the SMBus slave device.
46 @retval EFI_SUCCESS The last data that was returned from the access
47 matched the poll exit criteria.
48 @retval EFI_CRC_ERROR The checksum is not correct (PEC is incorrect)
49 @retval EFI_TIMEOUT Timeout expired before the operation was completed.
50 Timeout is determined by the SMBus host controller device.
51 @retval EFI_OUT_OF_RESOURCES The request could not be completed
52 due to a lack of resources.
53 @retval EFI_DEVICE_ERROR The request was not completed because
54 a failure reflected in the Host Status Register bit.
55 @retval EFI_INVALID_PARAMETER Operation is not defined in EFI_SMBUS_OPERATION.
56 Or Length/Buffer is NULL for operations except for EfiSmbusQuickRead and
57 EfiSmbusQuickWrite. Length is outside the range of valid values.
58 @retval EFI_UNSUPPORTED The SMBus operation or PEC is not supported.
59 @retval EFI_BUFFER_TOO_SMALL Buffer is not sufficient for this operation.
64 (EFIAPI
*EFI_SMBUS_HC_EXECUTE_OPERATION
) (
65 IN EFI_SMBUS_HC_PROTOCOL
*This
,
66 IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress
,
67 IN EFI_SMBUS_DEVICE_COMMAND Command
,
68 IN EFI_SMBUS_OPERATION Operation
,
75 UINT32 VendorSpecificId
;
76 UINT16 SubsystemDeviceId
;
77 UINT16 SubsystemVendorId
;
82 UINT8 DeviceCapabilities
;
86 CallBack function can be registered in EFI_SMBUS_HC_PROTOCOL_NOTIFY.
88 @param SlaveAddress The SMBUS hardware address to which the SMBUS
89 device is preassigned or allocated.
90 @param Data Data of the SMBus host notify command that
91 the caller wants to be called.
98 (EFIAPI
*EFI_SMBUS_NOTIFY_FUNCTION
) (
99 IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress
,
104 Sets the SMBus slave device addresses for the device with a given unique ID
105 or enumerates the entire bus.
107 @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.
108 @param ArpAll A Boolean expression that indicates if the host drivers need
109 to enumerate all the devices or enumerate only the device that is identified
110 by SmbusUdid. If ArpAll is TRUE, SmbusUdid and SlaveAddress are optional.
111 If ArpAll is FALSE, ArpDevice will enumerate SmbusUdid and the address
112 will be at SlaveAddress.
113 @param SmbusUdid The Unique Device Identifier (UDID) that is associated
115 @param SlaveAddress The SMBus slave address that is associated with an SMBus UDID.
117 @retval EFI_SUCCESS The SMBus slave device address was set.
118 @retval EFI_INVALID_PARAMETER SlaveAddress is NULL.
119 @retval EFI_OUT_OF_RESOURCES The request could not be completed
120 due to a lack of resources.
121 @retval EFI_TIMEOUT The SMBus slave device did not respond.
122 @retval EFI_DEVICE_ERROR The request was not completed because the transaction failed.
127 (EFIAPI
*EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE
) (
128 IN EFI_SMBUS_HC_PROTOCOL
*This
,
130 IN EFI_SMBUS_UDID
*SmbusUdid
, OPTIONAL
131 IN OUT EFI_SMBUS_DEVICE_ADDRESS
*SlaveAddress OPTIONAL
135 EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress
;
136 EFI_SMBUS_UDID SmbusDeviceUdid
;
137 } EFI_SMBUS_DEVICE_MAP
;
140 The GetArpMap() function returns the mapping of all the SMBus devices
141 that are enumerated by the SMBus host driver.
143 @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.
144 @param Length Size of the buffer that contains the SMBus device map.
145 @param SmbusDeviceMap The pointer to the device map as enumerated
146 by the SMBus controller driver.
148 @retval EFI_SUCCESS The device map was returned correctly in the buffer.
153 (EFIAPI
*EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP
) (
154 IN EFI_SMBUS_HC_PROTOCOL
*This
,
155 IN OUT UINTN
*Length
,
156 IN OUT EFI_SMBUS_DEVICE_MAP
**SmbusDeviceMap
160 The Notify() function registers all the callback functions to allow the
161 bus driver to call these functions when the SlaveAddress/Data pair happens.
163 @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.
164 @param SlaveAddress Address that the host controller detects as
165 sending a message and calls all the registered functions.
166 @param Data Data that the host controller detects as sending a message
167 and calls all the registered functions.
168 @param NotifyFunction The function to call when the bus driver
169 detects the SlaveAddress and Data pair.
171 @retval EFI_SUCCESS NotifyFunction was registered.
176 (EFIAPI
*EFI_SMBUS_HC_PROTOCOL_NOTIFY
) (
177 IN EFI_SMBUS_HC_PROTOCOL
*This
,
178 IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress
,
180 IN EFI_SMBUS_NOTIFY_FUNCTION NotifyFunction
184 @par Protocol Description:
185 Provides basic SMBus host controller management and basic data
186 transactions over the SMBus.
189 Executes the SMBus operation to an SMBus slave device.
192 Allows an SMBus 2.0 device(s) to be Address Resolution Protocol (ARP)
195 Allows a driver to retrieve the address that was allocated by the SMBus
196 host controller during enumeration/ARP.
199 Allows a driver to register for a callback to the SMBus host
200 controller driver when the bus issues a notification to the bus controller driver.
203 struct _EFI_SMBUS_HC_PROTOCOL
{
204 EFI_SMBUS_HC_EXECUTE_OPERATION Execute
;
205 EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE ArpDevice
;
206 EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP GetArpMap
;
207 EFI_SMBUS_HC_PROTOCOL_NOTIFY Notify
;
210 extern EFI_GUID gEfiSmbusProtocolGuid
;