]>
Commit | Line | Data |
---|---|---|
fe69ac84 | 1 | /** @file\r |
2 | Smbus Library Services that do SMBus transactions and also enable the operatation\r | |
3 | to be replayed during an S3 resume. This library class maps directly on top\r | |
4 | of the SmbusLib class. \r | |
5 | \r | |
6 | Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r | |
7 | \r | |
8 | This program and the accompanying materials\r | |
9 | are licensed and made available under the terms and conditions\r | |
10 | of the BSD License which accompanies this distribution. The\r | |
11 | full text of the license may be found at\r | |
12 | http://opensource.org/licenses/bsd-license.php\r | |
13 | \r | |
14 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
15 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
16 | \r | |
17 | **/\r | |
18 | \r | |
19 | \r | |
20 | #include <Base.h>\r | |
21 | \r | |
22 | #include <Library/DebugLib.h>\r | |
23 | #include <Library/S3BootScriptLib.h>\r | |
24 | #include <Library/SmbusLib.h>\r | |
25 | #include <Library/S3SmbusLib.h>\r | |
26 | \r | |
27 | /**\r | |
28 | Saves an SMBus operation to S3 script to be replayed on S3 resume. \r | |
29 | \r | |
30 | This function provides a standard way to save SMBus operation to S3 boot Script.\r | |
31 | The data can either be of the Length byte, word, or a block of data.\r | |
32 | If it falis to save S3 boot script, then ASSERT ().\r | |
33 | \r | |
34 | @param SmbusOperation Signifies which particular SMBus hardware protocol instance that it will use to\r | |
35 | execute the SMBus transactions.\r | |
36 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
37 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
38 | @param Length Signifies the number of bytes that this operation will do. The maximum number of\r | |
39 | bytes can be revision specific and operation specific.\r | |
40 | @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations\r | |
41 | require this argument. The length of this buffer is identified by Length.\r | |
42 | \r | |
43 | **/\r | |
44 | VOID\r | |
45 | InternalSaveSmBusExecToBootScript (\r | |
46 | IN EFI_SMBUS_OPERATION SmbusOperation,\r | |
47 | IN UINTN SmBusAddress,\r | |
48 | IN UINTN Length,\r | |
49 | IN OUT VOID *Buffer\r | |
50 | )\r | |
51 | {\r | |
52 | RETURN_STATUS Status;\r | |
53 | \r | |
54 | Status = S3BootScriptSaveSmbusExecute (\r | |
55 | SmBusAddress,\r | |
56 | SmbusOperation,\r | |
57 | &Length,\r | |
58 | Buffer\r | |
59 | );\r | |
60 | ASSERT (Status == RETURN_SUCCESS);\r | |
61 | }\r | |
62 | \r | |
63 | /**\r | |
64 | Executes an SMBUS quick read command and saves the value in the S3 script to be replayed\r | |
65 | on S3 resume.\r | |
66 | \r | |
67 | Executes an SMBUS quick read command on the SMBUS device specified by SmBusAddress.\r | |
68 | Only the SMBUS slave address field of SmBusAddress is required.\r | |
69 | If Status is not NULL, then the status of the executed command is returned in Status.\r | |
70 | If PEC is set in SmBusAddress, then ASSERT().\r | |
71 | If Command in SmBusAddress is not zero, then ASSERT().\r | |
72 | If Length in SmBusAddress is not zero, then ASSERT().\r | |
73 | If any reserved bits of SmBusAddress are set, then ASSERT().\r | |
74 | \r | |
75 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
76 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
77 | @param Status Return status for the executed command.\r | |
78 | This is an optional parameter and may be NULL.\r | |
79 | \r | |
80 | **/\r | |
81 | VOID\r | |
82 | EFIAPI\r | |
83 | S3SmBusQuickRead (\r | |
84 | IN UINTN SmBusAddress,\r | |
85 | OUT RETURN_STATUS *Status OPTIONAL\r | |
86 | )\r | |
87 | {\r | |
88 | SmBusQuickRead (SmBusAddress, Status);\r | |
89 | \r | |
90 | InternalSaveSmBusExecToBootScript (EfiSmbusQuickRead, SmBusAddress, 0, NULL);\r | |
91 | }\r | |
92 | \r | |
93 | /**\r | |
94 | Executes an SMBUS quick write command and saves the value in the S3 script to be replayed\r | |
95 | on S3 resume.\r | |
96 | \r | |
97 | Executes an SMBUS quick write command on the SMBUS device specified by SmBusAddress.\r | |
98 | Only the SMBUS slave address field of SmBusAddress is required.\r | |
99 | If Status is not NULL, then the status of the executed command is returned in Status.\r | |
100 | If PEC is set in SmBusAddress, then ASSERT().\r | |
101 | If Command in SmBusAddress is not zero, then ASSERT().\r | |
102 | If Length in SmBusAddress is not zero, then ASSERT().\r | |
103 | If any reserved bits of SmBusAddress are set, then ASSERT().\r | |
104 | \r | |
105 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
106 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
107 | @param Status Return status for the executed command.\r | |
108 | This is an optional parameter and may be NULL.\r | |
109 | \r | |
110 | **/\r | |
111 | VOID\r | |
112 | EFIAPI\r | |
113 | S3SmBusQuickWrite (\r | |
114 | IN UINTN SmBusAddress,\r | |
115 | OUT RETURN_STATUS *Status OPTIONAL\r | |
116 | )\r | |
117 | {\r | |
118 | SmBusQuickWrite (SmBusAddress, Status);\r | |
119 | \r | |
120 | InternalSaveSmBusExecToBootScript (EfiSmbusQuickWrite, SmBusAddress, 0, NULL);\r | |
121 | }\r | |
122 | \r | |
123 | /**\r | |
124 | Executes an SMBUS receive byte command and saves the value in the S3 script to be replayed\r | |
125 | on S3 resume.\r | |
126 | \r | |
127 | Executes an SMBUS receive byte command on the SMBUS device specified by SmBusAddress.\r | |
128 | Only the SMBUS slave address field of SmBusAddress is required.\r | |
129 | The byte received from the SMBUS is returned.\r | |
130 | If Status is not NULL, then the status of the executed command is returned in Status.\r | |
131 | If Command in SmBusAddress is not zero, then ASSERT().\r | |
132 | If Length in SmBusAddress is not zero, then ASSERT().\r | |
133 | If any reserved bits of SmBusAddress are set, then ASSERT().\r | |
134 | \r | |
135 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
136 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
137 | @param Status Return status for the executed command.\r | |
138 | This is an optional parameter and may be NULL.\r | |
139 | \r | |
140 | @return The byte received from the SMBUS.\r | |
141 | \r | |
142 | **/\r | |
143 | UINT8\r | |
144 | EFIAPI\r | |
145 | S3SmBusReceiveByte (\r | |
146 | IN UINTN SmBusAddress,\r | |
147 | OUT RETURN_STATUS *Status OPTIONAL\r | |
148 | )\r | |
149 | {\r | |
150 | UINT8 Byte;\r | |
151 | \r | |
152 | Byte = SmBusReceiveByte (SmBusAddress, Status);\r | |
153 | \r | |
154 | InternalSaveSmBusExecToBootScript (EfiSmbusReceiveByte, SmBusAddress, 1, &Byte);\r | |
155 | \r | |
156 | return Byte;\r | |
157 | }\r | |
158 | \r | |
159 | /**\r | |
160 | Executes an SMBUS send byte command and saves the value in the S3 script to be replayed\r | |
161 | on S3 resume.\r | |
162 | \r | |
163 | Executes an SMBUS send byte command on the SMBUS device specified by SmBusAddress.\r | |
164 | The byte specified by Value is sent.\r | |
165 | Only the SMBUS slave address field of SmBusAddress is required. Value is returned.\r | |
166 | If Status is not NULL, then the status of the executed command is returned in Status.\r | |
167 | If Command in SmBusAddress is not zero, then ASSERT().\r | |
168 | If Length in SmBusAddress is not zero, then ASSERT().\r | |
169 | If any reserved bits of SmBusAddress are set, then ASSERT().\r | |
170 | \r | |
171 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
172 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
173 | @param Value The 8-bit value to send.\r | |
174 | @param Status Return status for the executed command.\r | |
175 | This is an optional parameter and may be NULL.\r | |
176 | \r | |
177 | @return The parameter of Value.\r | |
178 | \r | |
179 | **/\r | |
180 | UINT8\r | |
181 | EFIAPI\r | |
182 | S3SmBusSendByte (\r | |
183 | IN UINTN SmBusAddress,\r | |
184 | IN UINT8 Value,\r | |
185 | OUT RETURN_STATUS *Status OPTIONAL\r | |
186 | )\r | |
187 | {\r | |
188 | UINT8 Byte;\r | |
189 | \r | |
190 | Byte = SmBusSendByte (SmBusAddress, Value, Status);\r | |
191 | \r | |
192 | InternalSaveSmBusExecToBootScript (EfiSmbusSendByte, SmBusAddress, 1, &Byte);\r | |
193 | \r | |
194 | return Byte;\r | |
195 | }\r | |
196 | \r | |
197 | /**\r | |
198 | Executes an SMBUS read data byte command and saves the value in the S3 script to be replayed\r | |
199 | on S3 resume.\r | |
200 | \r | |
201 | Executes an SMBUS read data byte command on the SMBUS device specified by SmBusAddress.\r | |
202 | Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.\r | |
203 | The 8-bit value read from the SMBUS is returned.\r | |
204 | If Status is not NULL, then the status of the executed command is returned in Status.\r | |
205 | If Length in SmBusAddress is not zero, then ASSERT().\r | |
206 | If any reserved bits of SmBusAddress are set, then ASSERT().\r | |
207 | \r | |
208 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
209 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
210 | @param Status Return status for the executed command.\r | |
211 | This is an optional parameter and may be NULL.\r | |
212 | \r | |
213 | @return The byte read from the SMBUS.\r | |
214 | \r | |
215 | **/\r | |
216 | UINT8\r | |
217 | EFIAPI\r | |
218 | S3SmBusReadDataByte (\r | |
219 | IN UINTN SmBusAddress,\r | |
220 | OUT RETURN_STATUS *Status OPTIONAL\r | |
221 | )\r | |
222 | {\r | |
223 | UINT8 Byte;\r | |
224 | \r | |
225 | Byte = SmBusReadDataByte (SmBusAddress, Status);\r | |
226 | \r | |
227 | InternalSaveSmBusExecToBootScript (EfiSmbusReadByte, SmBusAddress, 1, &Byte);\r | |
228 | \r | |
229 | return Byte;\r | |
230 | }\r | |
231 | \r | |
232 | /**\r | |
233 | Executes an SMBUS write data byte command and saves the value in the S3 script to be replayed\r | |
234 | on S3 resume.\r | |
235 | \r | |
236 | Executes an SMBUS write data byte command on the SMBUS device specified by SmBusAddress.\r | |
237 | The 8-bit value specified by Value is written.\r | |
238 | Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.\r | |
239 | Value is returned.\r | |
240 | If Status is not NULL, then the status of the executed command is returned in Status.\r | |
241 | If Length in SmBusAddress is not zero, then ASSERT().\r | |
242 | If any reserved bits of SmBusAddress are set, then ASSERT().\r | |
243 | \r | |
244 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
245 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
246 | @param Value The 8-bit value to write.\r | |
247 | @param Status Return status for the executed command.\r | |
248 | This is an optional parameter and may be NULL.\r | |
249 | \r | |
250 | @return The parameter of Value.\r | |
251 | \r | |
252 | **/\r | |
253 | UINT8\r | |
254 | EFIAPI\r | |
255 | S3SmBusWriteDataByte (\r | |
256 | IN UINTN SmBusAddress,\r | |
257 | IN UINT8 Value,\r | |
258 | OUT RETURN_STATUS *Status OPTIONAL\r | |
259 | )\r | |
260 | {\r | |
261 | UINT8 Byte;\r | |
262 | \r | |
263 | Byte = SmBusWriteDataByte (SmBusAddress, Value, Status);\r | |
264 | \r | |
265 | InternalSaveSmBusExecToBootScript (EfiSmbusWriteByte, SmBusAddress, 1, &Byte);\r | |
266 | \r | |
267 | return Byte;\r | |
268 | }\r | |
269 | \r | |
270 | /**\r | |
271 | Executes an SMBUS read data word command and saves the value in the S3 script to be replayed\r | |
272 | on S3 resume.\r | |
273 | \r | |
274 | Executes an SMBUS read data word command on the SMBUS device specified by SmBusAddress.\r | |
275 | Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.\r | |
276 | The 16-bit value read from the SMBUS is returned.\r | |
277 | If Status is not NULL, then the status of the executed command is returned in Status.\r | |
278 | If Length in SmBusAddress is not zero, then ASSERT().\r | |
279 | If any reserved bits of SmBusAddress are set, then ASSERT().\r | |
280 | \r | |
281 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
282 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
283 | @param Status Return status for the executed command.\r | |
284 | This is an optional parameter and may be NULL.\r | |
285 | \r | |
286 | @return The byte read from the SMBUS.\r | |
287 | \r | |
288 | **/\r | |
289 | UINT16\r | |
290 | EFIAPI\r | |
291 | S3SmBusReadDataWord (\r | |
292 | IN UINTN SmBusAddress,\r | |
293 | OUT RETURN_STATUS *Status OPTIONAL\r | |
294 | )\r | |
295 | {\r | |
296 | UINT16 Word;\r | |
297 | \r | |
298 | Word = SmBusReadDataWord (SmBusAddress, Status);\r | |
299 | \r | |
300 | InternalSaveSmBusExecToBootScript (EfiSmbusReadWord, SmBusAddress, 2, &Word);\r | |
301 | \r | |
302 | return Word;\r | |
303 | }\r | |
304 | \r | |
305 | /**\r | |
306 | Executes an SMBUS write data word command and saves the value in the S3 script to be replayed\r | |
307 | on S3 resume.\r | |
308 | \r | |
309 | Executes an SMBUS write data word command on the SMBUS device specified by SmBusAddress.\r | |
310 | The 16-bit value specified by Value is written.\r | |
311 | Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.\r | |
312 | Value is returned.\r | |
313 | If Status is not NULL, then the status of the executed command is returned in Status.\r | |
314 | If Length in SmBusAddress is not zero, then ASSERT().\r | |
315 | If any reserved bits of SmBusAddress are set, then ASSERT().\r | |
316 | \r | |
317 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
318 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
319 | @param Value The 16-bit value to write.\r | |
320 | @param Status Return status for the executed command.\r | |
321 | This is an optional parameter and may be NULL.\r | |
322 | \r | |
323 | @return The parameter of Value.\r | |
324 | \r | |
325 | **/\r | |
326 | UINT16\r | |
327 | EFIAPI\r | |
328 | S3SmBusWriteDataWord (\r | |
329 | IN UINTN SmBusAddress,\r | |
330 | IN UINT16 Value,\r | |
331 | OUT RETURN_STATUS *Status OPTIONAL\r | |
332 | )\r | |
333 | {\r | |
334 | UINT16 Word;\r | |
335 | \r | |
336 | Word = SmBusWriteDataWord (SmBusAddress, Value, Status);\r | |
337 | \r | |
338 | InternalSaveSmBusExecToBootScript (EfiSmbusWriteWord, SmBusAddress, 2, &Word);\r | |
339 | \r | |
340 | return Word;\r | |
341 | }\r | |
342 | \r | |
343 | /**\r | |
344 | Executes an SMBUS process call command and saves the value in the S3 script to be replayed\r | |
345 | on S3 resume.\r | |
346 | \r | |
347 | Executes an SMBUS process call command on the SMBUS device specified by SmBusAddress.\r | |
348 | The 16-bit value specified by Value is written.\r | |
349 | Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.\r | |
350 | The 16-bit value returned by the process call command is returned.\r | |
351 | If Status is not NULL, then the status of the executed command is returned in Status.\r | |
352 | If Length in SmBusAddress is not zero, then ASSERT().\r | |
353 | If any reserved bits of SmBusAddress are set, then ASSERT().\r | |
354 | \r | |
355 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
356 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
357 | @param Value The 16-bit value to write.\r | |
358 | @param Status Return status for the executed command.\r | |
359 | This is an optional parameter and may be NULL.\r | |
360 | \r | |
361 | @return The 16-bit value returned by the process call command.\r | |
362 | \r | |
363 | **/\r | |
364 | UINT16\r | |
365 | EFIAPI\r | |
366 | S3SmBusProcessCall (\r | |
367 | IN UINTN SmBusAddress,\r | |
368 | IN UINT16 Value,\r | |
369 | OUT RETURN_STATUS *Status OPTIONAL\r | |
370 | )\r | |
371 | {\r | |
372 | UINT16 Word;\r | |
373 | \r | |
374 | Word = SmBusProcessCall (SmBusAddress, Value, Status);\r | |
375 | \r | |
376 | InternalSaveSmBusExecToBootScript (EfiSmbusProcessCall, SmBusAddress, 2, &Value);\r | |
377 | \r | |
378 | return Word; \r | |
379 | }\r | |
380 | \r | |
381 | /**\r | |
382 | Executes an SMBUS read block command and saves the value in the S3 script to be replayed\r | |
383 | on S3 resume.\r | |
384 | \r | |
385 | Executes an SMBUS read block command on the SMBUS device specified by SmBusAddress.\r | |
386 | Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.\r | |
387 | Bytes are read from the SMBUS and stored in Buffer.\r | |
388 | The number of bytes read is returned, and will never return a value larger than 32-bytes.\r | |
389 | If Status is not NULL, then the status of the executed command is returned in Status.\r | |
390 | It is the caller's responsibility to make sure Buffer is large enough for the total number of bytes read.\r | |
391 | SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.\r | |
392 | If Length in SmBusAddress is not zero, then ASSERT().\r | |
393 | If Buffer is NULL, then ASSERT().\r | |
394 | If any reserved bits of SmBusAddress are set, then ASSERT().\r | |
395 | \r | |
396 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
397 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
398 | @param Buffer Pointer to the buffer to store the bytes read from the SMBUS.\r | |
399 | @param Status Return status for the executed command.\r | |
400 | This is an optional parameter and may be NULL.\r | |
401 | \r | |
402 | @return The number of bytes read.\r | |
403 | \r | |
404 | **/\r | |
405 | UINTN\r | |
406 | EFIAPI\r | |
407 | S3SmBusReadBlock (\r | |
408 | IN UINTN SmBusAddress,\r | |
409 | OUT VOID *Buffer,\r | |
410 | OUT RETURN_STATUS *Status OPTIONAL\r | |
411 | )\r | |
412 | {\r | |
413 | UINTN Length;\r | |
414 | \r | |
415 | Length = SmBusReadBlock (SmBusAddress, Buffer, Status);\r | |
416 | \r | |
417 | InternalSaveSmBusExecToBootScript (EfiSmbusReadBlock, SmBusAddress, Length, Buffer);\r | |
418 | \r | |
419 | return Length;\r | |
420 | }\r | |
421 | \r | |
422 | /**\r | |
423 | Executes an SMBUS write block command and saves the value in the S3 script to be replayed\r | |
424 | on S3 resume.\r | |
425 | \r | |
426 | Executes an SMBUS write block command on the SMBUS device specified by SmBusAddress.\r | |
427 | The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.\r | |
428 | Bytes are written to the SMBUS from Buffer.\r | |
429 | The number of bytes written is returned, and will never return a value larger than 32-bytes.\r | |
430 | If Status is not NULL, then the status of the executed command is returned in Status. \r | |
431 | If Length in SmBusAddress is zero or greater than 32, then ASSERT().\r | |
432 | If Buffer is NULL, then ASSERT().\r | |
433 | If any reserved bits of SmBusAddress are set, then ASSERT().\r | |
434 | \r | |
435 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
436 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
437 | @param Buffer Pointer to the buffer to store the bytes read from the SMBUS.\r | |
438 | @param Status Return status for the executed command.\r | |
439 | This is an optional parameter and may be NULL.\r | |
440 | \r | |
441 | @return The number of bytes written.\r | |
442 | \r | |
443 | **/\r | |
444 | UINTN\r | |
445 | EFIAPI\r | |
446 | S3SmBusWriteBlock (\r | |
447 | IN UINTN SmBusAddress,\r | |
448 | OUT VOID *Buffer,\r | |
449 | OUT RETURN_STATUS *Status OPTIONAL\r | |
450 | )\r | |
451 | {\r | |
452 | UINTN Length;\r | |
453 | \r | |
454 | Length = SmBusWriteBlock (SmBusAddress, Buffer, Status);\r | |
455 | \r | |
456 | InternalSaveSmBusExecToBootScript (EfiSmbusWriteBlock, SmBusAddress, SMBUS_LIB_LENGTH (SmBusAddress), Buffer);\r | |
457 | \r | |
458 | return Length;\r | |
459 | }\r | |
460 | \r | |
461 | /**\r | |
462 | Executes an SMBUS block process call command and saves the value in the S3 script to be replayed\r | |
463 | on S3 resume.\r | |
464 | \r | |
465 | Executes an SMBUS block process call command on the SMBUS device specified by SmBusAddress.\r | |
466 | The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.\r | |
467 | Bytes are written to the SMBUS from WriteBuffer. Bytes are then read from the SMBUS into ReadBuffer.\r | |
468 | If Status is not NULL, then the status of the executed command is returned in Status.\r | |
469 | It is the caller's responsibility to make sure ReadBuffer is large enough for the total number of bytes read.\r | |
470 | SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.\r | |
471 | If Length in SmBusAddress is zero or greater than 32, then ASSERT().\r | |
472 | If WriteBuffer is NULL, then ASSERT().\r | |
473 | If ReadBuffer is NULL, then ASSERT().\r | |
474 | If any reserved bits of SmBusAddress are set, then ASSERT().\r | |
475 | \r | |
476 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
477 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
478 | @param WriteBuffer Pointer to the buffer of bytes to write to the SMBUS.\r | |
479 | @param ReadBuffer Pointer to the buffer of bytes to read from the SMBUS.\r | |
480 | @param Status Return status for the executed command.\r | |
481 | This is an optional parameter and may be NULL.\r | |
482 | \r | |
483 | @return The number of bytes written.\r | |
484 | \r | |
485 | **/\r | |
486 | UINTN\r | |
487 | EFIAPI\r | |
488 | S3SmBusBlockProcessCall (\r | |
489 | IN UINTN SmBusAddress,\r | |
490 | IN VOID *WriteBuffer,\r | |
491 | OUT VOID *ReadBuffer,\r | |
492 | OUT RETURN_STATUS *Status OPTIONAL\r | |
493 | )\r | |
494 | {\r | |
495 | UINTN Length;\r | |
496 | \r | |
497 | Length = SmBusBlockProcessCall (SmBusAddress, WriteBuffer, ReadBuffer, Status);\r | |
498 | \r | |
499 | InternalSaveSmBusExecToBootScript (EfiSmbusBWBRProcessCall, SmBusAddress, SMBUS_LIB_LENGTH (SmBusAddress), ReadBuffer);\r | |
500 | \r | |
501 | return Length;\r | |
502 | }\r |