1 /** @file 2 Internal header file for Smbus library. 3 4 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 13 **/ 14 15 #ifndef _INTERNAL_SMBUS_LIB_H_ 16 #define _INTERNAL_SMBUS_LIB_H_ 17 18 19 #include <FrameworkPei.h> 20 21 #include <Ppi/Smbus.h> 22 23 #include <Library/SmbusLib.h> 24 #include <Library/DebugLib.h> 25 #include <Library/PeiServicesLib.h> 26 #include <Library/BaseMemoryLib.h> 27 #include <Library/PeiServicesTablePointerLib.h> 28 29 // 30 // Declaration for internal functions 31 // 32 33 /** 34 Gets Smbus PPIs. 35 36 This internal function retrieves Smbus PPI from PPI database. 37 38 @param VOID 39 40 @return The pointer to Smbus PPI. 41 42 **/ 43 EFI_PEI_SMBUS_PPI * 44 InternalGetSmbusPpi ( 45 VOID 46 ); 47 48 /** 49 Executes an SMBus operation to an SMBus controller. 50 51 This function provides a standard way to execute Smbus script 52 as defined in the SmBus Specification. The data can either be of 53 the Length byte, word, or a block of data. 54 55 @param SmbusOperation Signifies which particular SMBus hardware protocol instance that it will use to 56 execute the SMBus transactions. 57 @param SmBusAddress Address that encodes the SMBUS Slave Address, 58 SMBUS Command, SMBUS Data Length, and PEC. 59 @param Length Signifies the number of bytes that this operation will do. The maximum number of 60 bytes can be revision specific and operation specific. 61 @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations 62 require this argument. The length of this buffer is identified by Length. 63 @param Status Return status for the executed command. 64 This is an optional parameter and may be NULL. 65 66 @return The actual number of bytes that are executed for this operation. 67 68 **/ 69 UINTN 70 InternalSmBusExec ( 71 IN EFI_SMBUS_OPERATION SmbusOperation, 72 IN UINTN SmBusAddress, 73 IN UINTN Length, 74 IN OUT VOID *Buffer, 75 OUT RETURN_STATUS *Status OPTIONAL 76 ); 77 78 #endif 79