]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | This file declares the EFI SMBus Host Controller protocol\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2007, Intel Corporation \r | |
5 | All rights reserved. This program and the accompanying materials \r | |
6 | are licensed and made available under the terms and conditions of the BSD License \r | |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
12 | \r | |
13 | Module Name: Smbus.h\r | |
14 | \r | |
15 | @par Revision Reference:\r | |
16 | This protocol is defined in Framework of EFI SMBus Host Controller Specification\r | |
17 | Version 0.9\r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #ifndef _EFI_SMBUS_H\r | |
22 | #define _EFI_SMBUS_H\r | |
23 | \r | |
24 | #include <IndustryStandard/SmBus.h>\r | |
25 | \r | |
26 | #define EFI_SMBUS_HC_PROTOCOL_GUID \\r | |
27 | { \\r | |
28 | 0xe49d33ed, 0x513d, 0x4634, {0xb6, 0x98, 0x6f, 0x55, 0xaa, 0x75, 0x1c, 0x1b } \\r | |
29 | }\r | |
30 | \r | |
31 | typedef struct _EFI_SMBUS_HC_PROTOCOL EFI_SMBUS_HC_PROTOCOL;\r | |
32 | \r | |
33 | /**\r | |
34 | Executes an SMBus operation to an SMBus controller.\r | |
35 | \r | |
36 | @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r | |
37 | @param SlaveAddress The SMBus slave address of the device with which to communicate.\r | |
38 | @param Command This command is transmitted by the SMBus host\r | |
39 | controller to the SMBus slave device and the interpretation is\r | |
40 | SMBus slave device specific.\r | |
41 | @param Operation Signifies which particular SMBus hardware protocol\r | |
42 | instance that it will use to execute the SMBus transactions.\r | |
43 | @param PecCheck Defines if Packet Error Code (PEC) checking is required\r | |
44 | for this operation.\r | |
45 | @param Length Signifies the number of bytes that this operation will do.\r | |
46 | @param Buffer Contains the value of data to execute to the SMBus slave device.\r | |
47 | \r | |
48 | @retval EFI_SUCCESS The last data that was returned from the access\r | |
49 | matched the poll exit criteria.\r | |
50 | @retval EFI_CRC_ERROR The checksum is not correct (PEC is incorrect)\r | |
51 | @retval EFI_TIMEOUT Timeout expired before the operation was completed.\r | |
52 | Timeout is determined by the SMBus host controller device.\r | |
53 | @retval EFI_OUT_OF_RESOURCES The request could not be completed\r | |
54 | due to a lack of resources.\r | |
55 | @retval EFI_DEVICE_ERROR The request was not completed because\r | |
56 | a failure reflected in the Host Status Register bit.\r | |
57 | @retval EFI_INVALID_PARAMETER Operation is not defined in EFI_SMBUS_OPERATION.\r | |
58 | Or Length/Buffer is NULL for operations except for EfiSmbusQuickRead and\r | |
59 | EfiSmbusQuickWrite. Length is outside the range of valid values.\r | |
60 | @retval EFI_UNSUPPORTED The SMBus operation or PEC is not supported.\r | |
61 | @retval EFI_BUFFER_TOO_SMALL Buffer is not sufficient for this operation.\r | |
62 | \r | |
63 | **/\r | |
64 | typedef\r | |
65 | EFI_STATUS\r | |
66 | (EFIAPI *EFI_SMBUS_HC_EXECUTE_OPERATION) (\r | |
67 | IN EFI_SMBUS_HC_PROTOCOL *This,\r | |
68 | IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,\r | |
69 | IN EFI_SMBUS_DEVICE_COMMAND Command,\r | |
70 | IN EFI_SMBUS_OPERATION Operation,\r | |
71 | IN BOOLEAN PecCheck,\r | |
72 | IN OUT UINTN *Length,\r | |
73 | IN OUT VOID *Buffer\r | |
74 | );\r | |
75 | \r | |
76 | typedef struct {\r | |
77 | UINT32 VendorSpecificId;\r | |
78 | UINT16 SubsystemDeviceId;\r | |
79 | UINT16 SubsystemVendorId;\r | |
80 | UINT16 Interface;\r | |
81 | UINT16 DeviceId;\r | |
82 | UINT16 VendorId;\r | |
83 | UINT8 VendorRevision;\r | |
84 | UINT8 DeviceCapabilities;\r | |
85 | } EFI_SMBUS_UDID;\r | |
86 | \r | |
87 | /**\r | |
88 | CallBack function can be registered in EFI_SMBUS_HC_PROTOCOL_NOTIFY.\r | |
89 | \r | |
90 | @param SlaveAddress The SMBUS hardware address to which the SMBUS\r | |
91 | device is preassigned or allocated.\r | |
92 | @param Data Data of the SMBus host notify command that\r | |
93 | the caller wants to be called.\r | |
94 | \r | |
95 | @return Status Code\r | |
96 | \r | |
97 | **/\r | |
98 | typedef\r | |
99 | EFI_STATUS\r | |
100 | (EFIAPI *EFI_SMBUS_NOTIFY_FUNCTION) (\r | |
101 | IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,\r | |
102 | IN UINTN Data\r | |
103 | );\r | |
104 | \r | |
105 | /**\r | |
106 | Sets the SMBus slave device addresses for the device with a given unique ID \r | |
107 | or enumerates the entire bus.\r | |
108 | \r | |
109 | @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r | |
110 | @param ArpAll A Boolean expression that indicates if the host drivers need\r | |
111 | to enumerate all the devices or enumerate only the device that is identified\r | |
112 | by SmbusUdid. If ArpAll is TRUE, SmbusUdid and SlaveAddress are optional.\r | |
113 | If ArpAll is FALSE, ArpDevice will enumerate SmbusUdid and the address\r | |
114 | will be at SlaveAddress.\r | |
115 | @param SmbusUdid The Unique Device Identifier (UDID) that is associated\r | |
116 | with this device.\r | |
117 | @param SlaveAddress The SMBus slave address that is associated with an SMBus UDID.\r | |
118 | \r | |
119 | @retval EFI_SUCCESS The SMBus slave device address was set.\r | |
120 | @retval EFI_INVALID_PARAMETER SlaveAddress is NULL.\r | |
121 | @retval EFI_OUT_OF_RESOURCES The request could not be completed\r | |
122 | due to a lack of resources.\r | |
123 | @retval EFI_TIMEOUT The SMBus slave device did not respond.\r | |
124 | @retval EFI_DEVICE_ERROR The request was not completed because the transaction failed.\r | |
125 | \r | |
126 | **/\r | |
127 | typedef\r | |
128 | EFI_STATUS\r | |
129 | (EFIAPI *EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE) (\r | |
130 | IN EFI_SMBUS_HC_PROTOCOL *This,\r | |
131 | IN BOOLEAN ArpAll,\r | |
132 | IN EFI_SMBUS_UDID *SmbusUdid, OPTIONAL\r | |
133 | IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress OPTIONAL\r | |
134 | );\r | |
135 | \r | |
136 | typedef struct {\r | |
137 | EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress;\r | |
138 | EFI_SMBUS_UDID SmbusDeviceUdid;\r | |
139 | } EFI_SMBUS_DEVICE_MAP;\r | |
140 | \r | |
141 | /**\r | |
142 | The GetArpMap() function returns the mapping of all the SMBus devices \r | |
143 | that are enumerated by the SMBus host driver. \r | |
144 | \r | |
145 | @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r | |
146 | @param Length Size of the buffer that contains the SMBus device map.\r | |
147 | @param SmbusDeviceMap The pointer to the device map as enumerated\r | |
148 | by the SMBus controller driver.\r | |
149 | \r | |
150 | @retval EFI_SUCCESS The device map was returned correctly in the buffer.\r | |
151 | \r | |
152 | **/\r | |
153 | typedef\r | |
154 | EFI_STATUS\r | |
155 | (EFIAPI *EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP) (\r | |
156 | IN EFI_SMBUS_HC_PROTOCOL *This,\r | |
157 | IN OUT UINTN *Length,\r | |
158 | IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap\r | |
159 | );\r | |
160 | \r | |
161 | /**\r | |
162 | The Notify() function registers all the callback functions to allow the \r | |
163 | bus driver to call these functions when the SlaveAddress/Data pair happens.\r | |
164 | \r | |
165 | @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r | |
166 | @param SlaveAddress Address that the host controller detects as\r | |
167 | sending a message and calls all the registered functions.\r | |
168 | @param Data Data that the host controller detects as sending a message\r | |
169 | and calls all the registered functions.\r | |
170 | @param NotifyFunction The function to call when the bus driver\r | |
171 | detects the SlaveAddress and Data pair.\r | |
172 | \r | |
173 | @retval EFI_SUCCESS NotifyFunction was registered.\r | |
174 | \r | |
175 | **/\r | |
176 | typedef\r | |
177 | EFI_STATUS\r | |
178 | (EFIAPI *EFI_SMBUS_HC_PROTOCOL_NOTIFY) (\r | |
179 | IN EFI_SMBUS_HC_PROTOCOL *This,\r | |
180 | IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,\r | |
181 | IN UINTN Data,\r | |
182 | IN EFI_SMBUS_NOTIFY_FUNCTION NotifyFunction\r | |
183 | );\r | |
184 | \r | |
185 | /**\r | |
186 | @par Protocol Description:\r | |
187 | Provides basic SMBus host controller management and basic data \r | |
188 | transactions over the SMBus.\r | |
189 | \r | |
190 | @param Execute\r | |
191 | Executes the SMBus operation to an SMBus slave device.\r | |
192 | \r | |
193 | @param ArpDevice\r | |
194 | Allows an SMBus 2.0 device(s) to be Address Resolution Protocol (ARP)\r | |
195 | \r | |
196 | @param GetArpMap\r | |
197 | Allows a driver to retrieve the address that was allocated by the SMBus \r | |
198 | host controller during enumeration/ARP.\r | |
199 | \r | |
200 | @param Notify\r | |
201 | Allows a driver to register for a callback to the SMBus host \r | |
202 | controller driver when the bus issues a notification to the bus controller driver.\r | |
203 | \r | |
204 | **/\r | |
205 | struct _EFI_SMBUS_HC_PROTOCOL {\r | |
206 | EFI_SMBUS_HC_EXECUTE_OPERATION Execute;\r | |
207 | EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE ArpDevice;\r | |
208 | EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP GetArpMap;\r | |
209 | EFI_SMBUS_HC_PROTOCOL_NOTIFY Notify;\r | |
210 | };\r | |
211 | \r | |
212 | extern EFI_GUID gEfiSmbusProtocolGuid;\r | |
213 | #endif\r |