a67d1f18 |
1 | /** @file\r |
b2cefd7c |
2 | Internal header file for Smbus library.\r |
a67d1f18 |
3 | \r |
4 | Copyright (c) 2006, Intel Corporation<BR>\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 |
a67d1f18 |
13 | **/\r |
14 | \r |
15 | #ifndef __INTERNAL_SMBUS_LIB_H\r |
16 | #define __INTERNAL_SMBUS_LIB_H\r |
17 | \r |
ed7748fe |
18 | \r |
a67d1f18 |
19 | #include <PiPei.h>\r |
20 | #include <FrameworkPei.h>\r |
ed7748fe |
21 | \r |
a67d1f18 |
22 | #include <Ppi/Smbus.h>\r |
ed7748fe |
23 | \r |
a67d1f18 |
24 | #include <Library/SmbusLib.h>\r |
25 | #include <Library/DebugLib.h>\r |
22936e95 |
26 | #include <Library/PeiServicesLib.h>\r |
a67d1f18 |
27 | #include <Library/BaseMemoryLib.h>\r |
28 | \r |
a67d1f18 |
29 | //\r |
30 | // Declaration for internal functions\r |
31 | //\r |
32 | \r |
33 | /**\r |
34 | Gets Smbus PPIs.\r |
35 | \r |
36 | This internal function retrieves Smbus PPI from PPI database.\r |
37 | \r |
22936e95 |
38 | @param VOID\r |
a67d1f18 |
39 | \r |
40 | @return The pointer to Smbus PPI.\r |
41 | \r |
42 | **/\r |
43 | EFI_PEI_SMBUS_PPI *\r |
44 | InternalGetSmbusPpi (\r |
22936e95 |
45 | VOID\r |
a67d1f18 |
46 | );\r |
47 | \r |
48 | /**\r |
49 | Executes an SMBus operation to an SMBus controller. \r |
50 | \r |
51 | This function provides a standard way to execute Smbus script\r |
52 | as defined in the SmBus Specification. The data can either be of\r |
53 | the Length byte, word, or a block of data.\r |
54 | \r |
55 | @param SmbusOperation Signifies which particular SMBus hardware protocol instance that it will use to\r |
56 | execute the SMBus transactions.\r |
57 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r |
58 | SMBUS Command, SMBUS Data Length, and PEC.\r |
59 | @param Length Signifies the number of bytes that this operation will do. The maximum number of\r |
60 | bytes can be revision specific and operation specific.\r |
61 | @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations\r |
62 | require this argument. The length of this buffer is identified by Length.\r |
63 | @param Status Return status for the executed command.\r |
64 | This is an optional parameter and may be NULL.\r |
65 | \r |
66 | @return The actual number of bytes that are executed for this operation.\r |
67 | \r |
68 | **/\r |
69 | UINTN\r |
70 | InternalSmBusExec (\r |
71 | IN EFI_SMBUS_OPERATION SmbusOperation,\r |
72 | IN UINTN SmBusAddress,\r |
73 | IN UINTN Length,\r |
74 | IN OUT VOID *Buffer,\r |
75 | OUT RETURN_STATUS *Status OPTIONAL\r |
76 | );\r |
77 | \r |
78 | #endif\r |