summaryrefslogtreecommitdiff
path: root/MdePkg/Library/DxeSmbusLib
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/DxeSmbusLib')
-rw-r--r--MdePkg/Library/DxeSmbusLib/DxeSmbusLib.c18
-rw-r--r--MdePkg/Library/DxeSmbusLib/InternalSmbusLib.h18
-rw-r--r--MdePkg/Library/DxeSmbusLib/SmbusLib.c228
3 files changed, 150 insertions, 114 deletions
diff --git a/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.c b/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.c
index ab3bd47aa0..985085c136 100644
--- a/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.c
+++ b/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.c
@@ -1,11 +1,11 @@
/** @file
Implementation of SmBusLib class library for DXE phase.
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
+http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@@ -57,14 +57,16 @@ SmbusLibConstructor (
as defined in the SmBus Specification. The data can either be of
the Length byte, word, or a block of data.
- @param SmbusOperation Signifies which particular SMBus hardware protocol instance that it will use to
- execute the SMBus transactions.
+ @param SmbusOperation Signifies which particular SMBus hardware protocol instance
+ that it will use to execute the SMBus transactions.
@param SmBusAddress The address that encodes the SMBUS Slave Address,
SMBUS Command, SMBUS Data Length, and PEC.
- @param Length Signifies the number of bytes that this operation will do. The maximum number of
- bytes can be revision specific and operation specific.
- @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations
- require this argument. The length of this buffer is identified by Length.
+ @param Length Signifies the number of bytes that this operation will do.
+ The maximum number of bytes can be revision specific
+ and operation specific.
+ @param Buffer Contains the value of data to execute to the SMBus slave
+ device. Not all operations require this argument. The
+ length of this buffer is identified by Length.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
diff --git a/MdePkg/Library/DxeSmbusLib/InternalSmbusLib.h b/MdePkg/Library/DxeSmbusLib/InternalSmbusLib.h
index 203ca50855..da7e58fc78 100644
--- a/MdePkg/Library/DxeSmbusLib/InternalSmbusLib.h
+++ b/MdePkg/Library/DxeSmbusLib/InternalSmbusLib.h
@@ -1,11 +1,11 @@
/** @file
Internal header file for Smbus library.
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
+http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@@ -38,14 +38,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
as defined in the SmBus Specification. The data can either be of
the Length byte, word, or a block of data.
- @param SmbusOperation Signifies which particular SMBus hardware protocol instance that it will use to
- execute the SMBus transactions.
+ @param SmbusOperation Signifies which particular SMBus hardware protocol instance
+ that it will use toexecute the SMBus transactions.
@param SmBusAddress The address that encodes the SMBUS Slave Address,
SMBUS Command, SMBUS Data Length, and PEC.
- @param Length Signifies the number of bytes that this operation will do. The maximum number of
- bytes can be revision specific and operation specific.
- @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations
- require this argument. The length of this buffer is identified by Length.
+ @param Length Signifies the number of bytes that this operation will
+ do. The maximum number of bytes can be revision specific
+ and operation specific.
+ @param Buffer Contains the value of data to execute to the SMBus slave
+ device. Not all operations require this argument. The
+ length of this buffer is identified by Length.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
diff --git a/MdePkg/Library/DxeSmbusLib/SmbusLib.c b/MdePkg/Library/DxeSmbusLib/SmbusLib.c
index 58733e6ee4..fe1a0944dc 100644
--- a/MdePkg/Library/DxeSmbusLib/SmbusLib.c
+++ b/MdePkg/Library/DxeSmbusLib/SmbusLib.c
@@ -1,11 +1,11 @@
/** @file
Implementation of SmBusLib class library for DXE phase.
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
+http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@@ -30,13 +30,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
SMBUS Command, SMBUS Data Length, and PEC.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
+ RETURN_SUCCESS: The SMBUS command was executed.
+ RETURN_TIMEOUT: A timeout occurred while executing the
+ SMBUS command.
+ RETURN_DEVICE_ERROR: The request was not
+ completed because a failure reflected in the Host Status
+ Register bit. Device errors are a result of a transaction
+ collision, illegal command field, unclaimed cycle (host
+ initiated), or bus errors (collisions).
+ RETURN_UNSUPPORTED: The SMBus operation is not supported.
**/
VOID
@@ -69,13 +71,15 @@ SmBusQuickRead (
SMBUS Command, SMBUS Data Length, and PEC.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
+ RETURN_SUCCESS: The SMBUS command was executed.
+ RETURN_TIMEOUT: A timeout occurred while executing the
+ SMBUS command.
+ RETURN_DEVICE_ERROR: The request was not completed because
+ a failure reflected in the Host Status Register bit.
+ Device errors are a result of a transaction collision,
+ illegal command field, unclaimed cycle (host initiated),
+ or bus errors (collisions).
+ RETURN_UNSUPPORTED: The SMBus operation is not supported.
**/
VOID
@@ -108,14 +112,16 @@ SmBusQuickWrite (
SMBUS Command, SMBUS Data Length, and PEC.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
+ RETURN_SUCCESS: The SMBUS command was executed.
+ RETURN_TIMEOUT: A timeout occurred while executing the
+ SMBUS command.
+ RETURN_DEVICE_ERROR: The request was not completed because
+ a failure reflected in the Host Status Register bit. Device
+ errors are a result of a transaction collision, illegal
+ command field, unclaimed cycle(host initiated), or bus
+ errors (collisions).
+ RETURN_CRC_ERROR: The checksum is not correct. (PEC is incorrect.)
+ RETURN_UNSUPPORTED: The SMBus operation is not supported.
@return The byte received from the SMBUS.
@@ -154,14 +160,16 @@ SmBusReceiveByte (
@param Value The 8-bit value to send.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
+ RETURN_SUCCESS: The SMBUS command was executed.
+ RETURN_TIMEOUT: A timeout occurred while executing the
+ SMBUS command.
+ RETURN_DEVICE_ERROR: The request was not completed because
+ a failure reflected in the Host Status Register bit. Device
+ errors are a result of a transaction collision, illegal
+ command field, unclaimed cycle(host initiated), or bus
+ errors (collisions).
+ RETURN_CRC_ERROR: The checksum is not correct (PEC is incorrect)
+ RETURN_UNSUPPORTED: The SMBus operation is not supported.
@return The parameter of Value.
@@ -196,18 +204,20 @@ SmBusSendByte (
If Length in SmBusAddress is not zero, then ASSERT().
If any reserved bits of SmBusAddress are set, then ASSERT().
- @param SmBusAddress The address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
+ @param SmBusAddress The address that encodes the SMBUS Slave Address,
+ SMBUS Command, SMBUS Data Length, and PEC.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
+ RETURN_SUCCESS: The SMBUS command was executed.
+ RETURN_TIMEOUT: A timeout occurred while executing the
+ SMBUS command.
+ RETURN_DEVICE_ERROR: The request was not completed because
+ a failurereflected in the Host Status Register bit. Device
+ errors are a result of a transaction collision, illegal
+ command field, unclaimed cycle (host initiated), or bus
+ errors (collisions).
+ RETURN_CRC_ERROR: The checksum is not correct (PEC is incorrect)
+ RETURN_UNSUPPORTED: The SMBus operation is not supported.
@return The byte read from the SMBUS.
@@ -245,14 +255,16 @@ SmBusReadDataByte (
@param Value The 8-bit value to write.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
+ RETURN_SUCCESS: The SMBUS command was executed.
+ RETURN_TIMEOUT: A timeout occurred while executing the
+ SMBUS command.
+ RETURN_DEVICE_ERROR: The request was not completed because
+ a failure reflected in the Host Status Register bit. Device
+ errors are a result of a transaction collision, illegal
+ command field, unclaimed cycle host initiated), or bus
+ errors (collisions).
+ RETURN_CRC_ERROR: The checksum is not correct. (PEC is incorrect.)
+ RETURN_UNSUPPORTED: The SMBus operation is not supported.
@return The parameter of Value.
@@ -290,14 +302,17 @@ SmBusWriteDataByte (
SMBUS Command, SMBUS Data Length, and PEC.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
+ RETURN_SUCCESS: The SMBUS command was executed.
+ RETURN_TIMEOUT: A timeout occurred while executing the
+ SMBUS command.
+ RETURN_DEVICE_ERROR: The request was not completed because
+ a failure reflected in the Host Status Register bit.
+ Device errors are a result of a transaction collision,
+ illegal command field, unclaimed cycle (host initiated),
+ or bus errors (collisions).
+ RETURN_CRC_ERROR: The checksum is not correct. (PEC is
+ incorrect.)
+ RETURN_UNSUPPORTED: The SMBus operation is not supported.
@return The byte read from the SMBUS.
@@ -335,14 +350,17 @@ SmBusReadDataWord (
@param Value The 16-bit value to write.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
+ RETURN_SUCCESS: The SMBUS command was executed.
+ RETURN_TIMEOUT: A timeout occurred while executing the SMBUS
+ command.
+ RETURN_DEVICE_ERROR: The request was not completed because
+ a failure reflected in the Host Status Register bit.
+ Device errors are a result of a transaction collision,
+ illegal command field, unclaimed cycle (host initiated),
+ or bus errors (collisions).
+ RETURN_CRC_ERROR: The checksum is not correct.
+ (PEC is incorrect.)
+ RETURN_UNSUPPORTED: The SMBus operation is not supported.
@return The parameter of Value.
@@ -382,14 +400,17 @@ SmBusWriteDataWord (
@param Value The 16-bit value to write.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
+ RETURN_SUCCESS: The SMBUS command was executed.
+ RETURN_TIMEOUT: A timeout occurred while executing the
+ SMBUS command.
+ RETURN_DEVICE_ERROR: The request was not completed because
+ a failure reflected in the Host Status Register bit.
+ Device errors are a result of a transaction collision,
+ illegal command field, unclaimed cycle (host initiated),
+ or bus errors (collisions).
+ RETURN_CRC_ERROR: The checksum is not correct. (PEC is
+ incorrect.)
+ RETURN_UNSUPPORTED: The SMBus operation is not supported.
@return The 16-bit value returned by the process call command.
@@ -426,17 +447,21 @@ SmBusProcessCall (
@param SmBusAddress The address that encodes the SMBUS Slave Address,
SMBUS Command, SMBUS Data Length, and PEC.
- @param Buffer The pointer to the buffer to store the bytes read from the SMBUS.
+ @param Buffer The pointer to the buffer to store the bytes read from
+ the SMBUS.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
+ RETURN_SUCCESS: The SMBUS command was executed.
+ RETURN_TIMEOUT: A timeout occurred while executing the SMBUS
+ command.
+ RETURN_DEVICE_ERROR: The request was not completed because
+ a failure reflected in the Host Status Register bit. Device
+ errors are a result of a transaction collision, illegal
+ command field, unclaimed cycle (host initiated), or bus
+ errors (collisions).
+ RETURN_CRC_ERROR: The checksum is not correct. (PEC is
+ incorrect.)
+ RETURN_UNSUPPORTED: The SMBus operation is not supported.
@return The number of bytes read.
@@ -470,16 +495,20 @@ SmBusReadBlock (
@param SmBusAddress The address that encodes the SMBUS Slave Address,
MBUS Command, SMBUS Data Length, and PEC.
- @param Buffer The pointer to the buffer to store the bytes read from the SMBUS.
+ @param Buffer The pointer to the buffer to store the bytes read from
+ the SMBUS.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
+ RETURN_TIMEOUT: A timeout occurred while executing the
+ SMBUS command.
+ RETURN_DEVICE_ERROR: The request was not completed because
+ a failure reflected in the Host Status Register bit. Device
+ errors are a result of a transaction collision, illegal
+ command field, unclaimed cycle (host initiated), or bus
+ errors (collisions).
+ RETURN_CRC_ERROR: The checksum is not correct. (PEC is
+ incorrect.)
+ RETURN_UNSUPPORTED: The SMBus operation is not supported.
@return The number of bytes written.
@@ -523,13 +552,16 @@ SmBusWriteBlock (
@param ReadBuffer The pointer to the buffer of bytes to read from the SMBUS.
@param Status Return status for the executed command.
This is an optional parameter and may be NULL.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
+ RETURN_TIMEOUT: A timeout occurred while executing the
+ SMBUS command.
+ RETURN_DEVICE_ERROR: The request was not completed because
+ a failure reflected in the Host Status Register bit. Device
+ errors are a result of a transaction collision, illegal
+ command field, unclaimed cycle (host initiated), or bus
+ errors (collisions).
+ RETURN_CRC_ERROR: The checksum is not correct. (PEC is
+ incorrect.)
+ RETURN_UNSUPPORTED: The SMBus operation is not supported.
@return The number of bytes written.