]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
2c7e5c2f HT |
3 | Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
3eb9473e | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | \r | |
13 | Module Name:\r | |
14 | \r | |
15 | DxeSmbusLibInternal.h\r | |
16 | \r | |
17 | Abstract: \r | |
18 | \r | |
19 | Declarations of internal functions in DxeSmbusLib.\r | |
20 | \r | |
21 | --*/\r | |
22 | \r | |
23 | #ifndef __DXE_SMBUS_LIB_INTERNAL_H__\r | |
24 | #define __DXE_SMBUS_LIB_INTERNAL_H__\r | |
25 | \r | |
26 | #include "EdkIIGlueDxe.h"\r | |
27 | \r | |
28 | #define SMBUS_LIB_SLAVE_ADDRESS(SmBusAddress) (((SmBusAddress) >> 1) & 0x7f)\r | |
29 | #define SMBUS_LIB_COMMAND(SmBusAddress) (((SmBusAddress) >> 8) & 0xff)\r | |
30 | #define SMBUS_LIB_LENGTH(SmBusAddress) (((SmBusAddress) >> 16) & 0x3f)\r | |
31 | #define SMBUS_LIB_PEC(SmBusAddress) ((BOOLEAN) (((SmBusAddress) & SMBUS_LIB_PEC_BIT) != 0))\r | |
32 | #define SMBUS_LIB_RESEARVED(SmBusAddress) ((SmBusAddress) & ~(((1 << 22) - 2) | SMBUS_LIB_PEC_BIT))\r | |
33 | \r | |
34 | //\r | |
35 | // Declaration for internal functions\r | |
36 | //\r | |
37 | /**\r | |
38 | Executes an SMBus operation to an SMBus controller. \r | |
39 | \r | |
40 | This function provides a standard way to execute Smbus script\r | |
41 | as defined in the SmBus Specification. The data can either be of\r | |
42 | the Length byte, word, or a block of data.\r | |
43 | \r | |
44 | @param SmbusOperation Signifies which particular SMBus hardware protocol instance that it will use to\r | |
45 | execute the SMBus transactions.\r | |
46 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
47 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
48 | @param Length Signifies the number of bytes that this operation will do. The maximum number of\r | |
49 | bytes can be revision specific and operation specific.\r | |
50 | @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations\r | |
51 | require this argument. The length of this buffer is identified by Length.\r | |
52 | @param Status Return status for the executed command.\r | |
53 | This is an optional parameter and may be NULL.\r | |
54 | \r | |
55 | @return The actual number of bytes that are executed for this operation.\r | |
56 | \r | |
57 | **/\r | |
58 | UINTN\r | |
59 | InternalSmBusExec (\r | |
60 | IN EFI_SMBUS_OPERATION SmbusOperation,\r | |
61 | IN UINTN SmBusAddress,\r | |
62 | IN UINTN Length,\r | |
63 | IN OUT VOID *Buffer,\r | |
64 | OUT RETURN_STATUS *Status OPTIONAL\r | |
65 | );\r | |
66 | \r | |
67 | #endif\r |