]>
Commit | Line | Data |
---|---|---|
dd51a993 | 1 | /** @file\r |
2 | Internal header file for Smbus library.\r | |
3 | \r | |
19388d29 HT |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r |
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 <PiDxe.h>\r |
c892d846 | 21 | \r |
bad46384 | 22 | #include <Protocol/SmbusHc.h>\r |
c892d846 | 23 | \r |
bad46384 | 24 | #include <Library/SmbusLib.h>\r |
25 | #include <Library/DebugLib.h>\r | |
26 | #include <Library/UefiBootServicesTableLib.h>\r | |
27 | #include <Library/BaseMemoryLib.h>\r | |
28 | \r | |
a3589760 | 29 | #include <IndustryStandard/SmBus.h>\r |
dd51a993 | 30 | \r |
dd51a993 | 31 | //\r |
32 | // Declaration for internal functions\r | |
33 | //\r | |
34 | /**\r | |
bad46384 | 35 | Executes an SMBus operation to an SMBus controller.\r |
dd51a993 | 36 | \r |
37 | This function provides a standard way to execute Smbus script\r | |
38 | as defined in the SmBus Specification. The data can either be of\r | |
39 | the Length byte, word, or a block of data.\r | |
40 | \r | |
41 | @param SmbusOperation Signifies which particular SMBus hardware protocol instance that it will use to\r | |
42 | execute the SMBus transactions.\r | |
43 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
44 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
45 | @param Length Signifies the number of bytes that this operation will do. The maximum number of\r | |
46 | bytes can be revision specific and operation specific.\r | |
47 | @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations\r | |
48 | require this argument. The length of this buffer is identified by Length.\r | |
49 | @param Status Return status for the executed command.\r | |
50 | This is an optional parameter and may be NULL.\r | |
51 | \r | |
52 | @return The actual number of bytes that are executed for this operation.\r | |
53 | \r | |
54 | **/\r | |
55 | UINTN\r | |
56 | InternalSmBusExec (\r | |
57 | IN EFI_SMBUS_OPERATION SmbusOperation,\r | |
58 | IN UINTN SmBusAddress,\r | |
59 | IN UINTN Length,\r | |
60 | IN OUT VOID *Buffer,\r | |
61 | OUT RETURN_STATUS *Status OPTIONAL\r | |
62 | );\r | |
63 | \r | |
a73480f6 | 64 | /**\r |
65 | The constructor function caches the pointer to Smbus protocol.\r | |
66 | \r | |
67 | The constructor function locates Smbus protocol from protocol database.\r | |
68 | It will ASSERT() if that operation fails and it will always return EFI_SUCCESS.\r | |
69 | \r | |
70 | @param ImageHandle The firmware allocated handle for the EFI image.\r | |
71 | @param SystemTable A pointer to the EFI System Table.\r | |
72 | \r | |
73 | @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r | |
74 | \r | |
75 | **/\r | |
76 | EFI_STATUS\r | |
77 | EFIAPI\r | |
78 | SmbusLibConstructor (\r | |
79 | IN EFI_HANDLE ImageHandle,\r | |
80 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
ed66e1bc | 81 | );\r |
a73480f6 | 82 | \r |
dd51a993 | 83 | #endif\r |