]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Library/PeiSmbusLibSmbusPpi/InternalSmbusLib.h
remove some comments introduced by tools.
[mirror_edk2.git] / IntelFrameworkPkg / Library / PeiSmbusLibSmbusPpi / InternalSmbusLib.h
1 /** @file
2 Internal header file for Smbus library.
3
4 Copyright (c) 2006, Intel Corporation<BR>
5 All rights reserved. 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
16 #ifndef __INTERNAL_SMBUS_LIB_H
17 #define __INTERNAL_SMBUS_LIB_H
18
19
20 #include <PiPei.h>
21 #include <FrameworkPei.h>
22
23 #include <Ppi/Smbus.h>
24
25 #include <Library/SmbusLib.h>
26 #include <Library/DebugLib.h>
27 #include <Library/PeiServicesTablePointerLib.h>
28 #include <Library/BaseMemoryLib.h>
29
30 #define SMBUS_LIB_SLAVE_ADDRESS(SmBusAddress) (((SmBusAddress) >> 1) & 0x7f)
31 #define SMBUS_LIB_COMMAND(SmBusAddress) (((SmBusAddress) >> 8) & 0xff)
32 #define SMBUS_LIB_LENGTH(SmBusAddress) (((SmBusAddress) >> 16) & 0x3f)
33 #define SMBUS_LIB_PEC(SmBusAddress) ((BOOLEAN) (((SmBusAddress) & SMBUS_LIB_PEC_BIT) != 0))
34 #define SMBUS_LIB_RESEARVED(SmBusAddress) ((SmBusAddress) & ~(((1 << 22) - 2) | SMBUS_LIB_PEC_BIT))
35
36 //
37 // Declaration for internal functions
38 //
39
40 /**
41 Gets Smbus PPIs.
42
43 This internal function retrieves Smbus PPI from PPI database.
44
45 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES published by the PEI Foundation.
46
47 @return The pointer to Smbus PPI.
48
49 **/
50 EFI_PEI_SMBUS_PPI *
51 InternalGetSmbusPpi (
52 EFI_PEI_SERVICES **PeiServices
53 );
54
55 /**
56 Executes an SMBus operation to an SMBus controller.
57
58 This function provides a standard way to execute Smbus script
59 as defined in the SmBus Specification. The data can either be of
60 the Length byte, word, or a block of data.
61
62 @param SmbusOperation Signifies which particular SMBus hardware protocol instance that it will use to
63 execute the SMBus transactions.
64 @param SmBusAddress Address that encodes the SMBUS Slave Address,
65 SMBUS Command, SMBUS Data Length, and PEC.
66 @param Length Signifies the number of bytes that this operation will do. The maximum number of
67 bytes can be revision specific and operation specific.
68 @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations
69 require this argument. The length of this buffer is identified by Length.
70 @param Status Return status for the executed command.
71 This is an optional parameter and may be NULL.
72
73 @return The actual number of bytes that are executed for this operation.
74
75 **/
76 UINTN
77 InternalSmBusExec (
78 IN EFI_SMBUS_OPERATION SmbusOperation,
79 IN UINTN SmBusAddress,
80 IN UINTN Length,
81 IN OUT VOID *Buffer,
82 OUT RETURN_STATUS *Status OPTIONAL
83 );
84
85 #endif