]>
Commit | Line | Data |
---|---|---|
dd51a993 | 1 | /** @file\r |
2 | Internal header file for Smbus library.\r | |
3 | \r | |
58380e9c | 4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r |
19388d29 | 5 | This program and the accompanying materials\r |
bad46384 | 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 | |
dd51a993 | 12 | \r |
13 | \r | |
14 | **/\r | |
15 | \r | |
42eedea9 | 16 | #ifndef __INTERNAL_SMBUS_LIB_H_\r |
17 | #define __INTERNAL_SMBUS_LIB_H_\r | |
dd51a993 | 18 | \r |
c892d846 | 19 | \r |
bad46384 | 20 | #include <PiPei.h>\r |
c892d846 | 21 | \r |
bad46384 | 22 | #include <Ppi/Smbus2.h>\r |
c892d846 | 23 | \r |
bad46384 | 24 | #include <Library/SmbusLib.h>\r |
25 | #include <Library/DebugLib.h>\r | |
1c280088 | 26 | #include <Library/PeiServicesLib.h>\r |
bad46384 | 27 | #include <Library/BaseMemoryLib.h>\r |
28 | \r | |
dd51a993 | 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 | |
1c280088 | 38 | @param VOID\r |
dd51a993 | 39 | \r |
40 | @return The pointer to Smbus PPI.\r | |
41 | \r | |
42 | **/\r | |
43 | EFI_PEI_SMBUS2_PPI *\r | |
44 | InternalGetSmbusPpi (\r | |
1c280088 | 45 | VOID\r |
dd51a993 | 46 | );\r |
47 | \r | |
48 | /**\r | |
bad46384 | 49 | Executes an SMBus operation to an SMBus controller.\r |
dd51a993 | 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 | |
58380e9c | 55 | @param SmbusOperation Signifies which particular SMBus hardware protocol \r |
56 | instance that it will use to execute the SMBus transactions.\r | |
2fc59a00 | 57 | @param SmBusAddress The address that encodes the SMBUS Slave Address,\r |
dd51a993 | 58 | SMBUS Command, SMBUS Data Length, and PEC.\r |
58380e9c | 59 | @param Length Signifies the number of bytes that this operation will \r |
60 | do. The maximum number of bytes can be revision specific \r | |
61 | and operation specific.\r | |
62 | @param Buffer Contains the value of data to execute to the SMBus slave \r | |
63 | device. Not all operations require this argument. The \r | |
64 | length of this buffer is identified by Length.\r | |
dd51a993 | 65 | @param Status Return status for the executed command.\r |
66 | This is an optional parameter and may be NULL.\r | |
67 | \r | |
68 | @return The actual number of bytes that are executed for this operation.\r | |
69 | \r | |
70 | **/\r | |
71 | UINTN\r | |
72 | InternalSmBusExec (\r | |
73 | IN EFI_SMBUS_OPERATION SmbusOperation,\r | |
74 | IN UINTN SmBusAddress,\r | |
75 | IN UINTN Length,\r | |
76 | IN OUT VOID *Buffer,\r | |
77 | OUT RETURN_STATUS *Status OPTIONAL\r | |
78 | );\r | |
79 | \r | |
80 | #endif\r |