]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/PeiSmbusLibSmbus2Ppi/InternalSmbusLib.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / PeiSmbusLibSmbus2Ppi / InternalSmbusLib.h
1 /** @file
2 Internal header file for Smbus library.
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8 **/
9
10 #ifndef __INTERNAL_SMBUS_LIB_H_
11 #define __INTERNAL_SMBUS_LIB_H_
12
13
14 #include <PiPei.h>
15
16 #include <Ppi/Smbus2.h>
17
18 #include <Library/SmbusLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/PeiServicesLib.h>
21 #include <Library/BaseMemoryLib.h>
22
23 //
24 // Declaration for internal functions
25 //
26
27 /**
28 Gets Smbus PPIs.
29
30 This internal function retrieves Smbus PPI from PPI database.
31
32 @param VOID
33
34 @return The pointer to Smbus PPI.
35
36 **/
37 EFI_PEI_SMBUS2_PPI *
38 InternalGetSmbusPpi (
39 VOID
40 );
41
42 /**
43 Executes an SMBus operation to an SMBus controller.
44
45 This function provides a standard way to execute Smbus script
46 as defined in the SmBus Specification. The data can either be of
47 the Length byte, word, or a block of data.
48
49 @param SmbusOperation Signifies which particular SMBus hardware protocol
50 instance that it will use to execute the SMBus transactions.
51 @param SmBusAddress The address that encodes the SMBUS Slave Address,
52 SMBUS Command, SMBUS Data Length, and PEC.
53 @param Length Signifies the number of bytes that this operation will
54 do. The maximum number of bytes can be revision specific
55 and operation specific.
56 @param Buffer Contains the value of data to execute to the SMBus slave
57 device. Not all operations require this argument. The
58 length of this buffer is identified by Length.
59 @param Status Return status for the executed command.
60 This is an optional parameter and may be NULL.
61
62 @return The actual number of bytes that are executed for this operation.
63
64 **/
65 UINTN
66 InternalSmBusExec (
67 IN EFI_SMBUS_OPERATION SmbusOperation,
68 IN UINTN SmBusAddress,
69 IN UINTN Length,
70 IN OUT VOID *Buffer,
71 OUT RETURN_STATUS *Status OPTIONAL
72 );
73
74 #endif