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