]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/DxeSmbusLib/InternalSmbusLib.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / DxeSmbusLib / 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 <PiDxe.h>
15
16 #include <Protocol/SmbusHc.h>
17
18 #include <Library/SmbusLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/UefiBootServicesTableLib.h>
21 #include <Library/BaseMemoryLib.h>
22
23 #include <IndustryStandard/SmBus.h>
24
25 //
26 // Declaration for internal functions
27 //
28 /**
29 Executes an SMBus operation to an SMBus controller.
30
31 This function provides a standard way to execute Smbus script
32 as defined in the SmBus Specification. The data can either be of
33 the Length byte, word, or a block of data.
34
35 @param SmbusOperation Signifies which particular SMBus hardware protocol instance
36 that it will use toexecute the SMBus transactions.
37 @param SmBusAddress The address that encodes the SMBUS Slave Address,
38 SMBUS Command, SMBUS Data Length, and PEC.
39 @param Length Signifies the number of bytes that this operation will
40 do. The maximum number of bytes can be revision specific
41 and operation specific.
42 @param Buffer Contains the value of data to execute to the SMBus slave
43 device. Not all operations require this argument. The
44 length of this buffer is identified by Length.
45 @param Status Return status for the executed command.
46 This is an optional parameter and may be NULL.
47
48 @return The actual number of bytes that are executed for this operation.
49
50 **/
51 UINTN
52 InternalSmBusExec (
53 IN EFI_SMBUS_OPERATION SmbusOperation,
54 IN UINTN SmBusAddress,
55 IN UINTN Length,
56 IN OUT VOID *Buffer,
57 OUT RETURN_STATUS *Status OPTIONAL
58 );
59
60 /**
61 The constructor function caches the pointer to Smbus protocol.
62
63 The constructor function locates Smbus protocol from protocol database.
64 It will ASSERT() if that operation fails and it will always return EFI_SUCCESS.
65
66 @param ImageHandle The firmware allocated handle for the EFI image.
67 @param SystemTable A pointer to the EFI System Table.
68
69 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
70
71 **/
72 EFI_STATUS
73 EFIAPI
74 SmbusLibConstructor (
75 IN EFI_HANDLE ImageHandle,
76 IN EFI_SYSTEM_TABLE *SystemTable
77 );
78
79 #endif