X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FPeiSmbusLibSmbus2Ppi%2FSmbusLib.c;h=da9a6874692b583bd2823f402628466c8c1af50f;hp=e47d20d7c81a41e6b1b74489084cb932d5557767;hb=718715141abc0253f369ca55cce3b69c82913ee2;hpb=2d8debe71060fae61f4073240f618fa9682c976e diff --git a/MdePkg/Library/PeiSmbusLibSmbus2Ppi/SmbusLib.c b/MdePkg/Library/PeiSmbusLibSmbus2Ppi/SmbusLib.c index e47d20d7c8..da9a687469 100644 --- a/MdePkg/Library/PeiSmbusLibSmbus2Ppi/SmbusLib.c +++ b/MdePkg/Library/PeiSmbusLibSmbus2Ppi/SmbusLib.c @@ -26,10 +26,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. If Length in SmBusAddress is not zero, then ASSERT(). If any reserved bits of SmBusAddress are set, then ASSERT(). - @param SmBusAddress 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. + @param SmBusAddress 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_UNSUPPORTED The SMBus operation is not supported. **/ VOID @@ -58,10 +65,17 @@ SmBusQuickRead ( If Length in SmBusAddress is not zero, then ASSERT(). If any reserved bits of SmBusAddress are set, then ASSERT(). - @param SmBusAddress 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. + @param SmBusAddress 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_UNSUPPORTED The SMBus operation is not supported. **/ VOID @@ -90,10 +104,18 @@ SmBusQuickWrite ( If Length in SmBusAddress is not zero, then ASSERT(). If any reserved bits of SmBusAddress are set, then ASSERT(). - @param SmBusAddress 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. + @param SmBusAddress 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 The byte received from the SMBUS. @@ -127,11 +149,19 @@ SmBusReceiveByte ( If Length in SmBusAddress is not zero, then ASSERT(). If any reserved bits of SmBusAddress are set, then ASSERT(). - @param SmBusAddress Address that encodes the SMBUS Slave Address, - SMBUS Command, SMBUS Data Length, and PEC. - @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. + @param SmBusAddress Address that encodes the SMBUS Slave Address, + SMBUS Command, SMBUS Data Length, and PEC. + @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 The parameter of Value. @@ -168,8 +198,16 @@ SmBusSendByte ( @param SmBusAddress 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. + @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 The byte read from the SMBUS. @@ -202,11 +240,19 @@ SmBusReadDataByte ( If Length in SmBusAddress is not zero, then ASSERT(). If any reserved bits of SmBusAddress are set, then ASSERT(). - @param SmBusAddress Address that encodes the SMBUS Slave Address, - SMBUS Command, SMBUS Data Length, and PEC. - @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. + @param SmBusAddress Address that encodes the SMBUS Slave Address, + SMBUS Command, SMBUS Data Length, and PEC. + @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 The parameter of Value. @@ -239,11 +285,19 @@ SmBusWriteDataByte ( If Status is not NULL, then the status of the executed command is returned in Status. If Length in SmBusAddress is not zero, then ASSERT(). If any reserved bits of SmBusAddress are set, then ASSERT(). - - @param SmBusAddress 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. + + @param SmBusAddress 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 The byte read from the SMBUS. @@ -276,11 +330,19 @@ SmBusReadDataWord ( If Length in SmBusAddress is not zero, then ASSERT(). If any reserved bits of SmBusAddress are set, then ASSERT(). - @param SmBusAddress Address that encodes the SMBUS Slave Address, - SMBUS Command, SMBUS Data Length, and PEC. - @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. + @param SmBusAddress Address that encodes the SMBUS Slave Address, + SMBUS Command, SMBUS Data Length, and PEC. + @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 The parameter of Value. @@ -315,11 +377,19 @@ SmBusWriteDataWord ( If Length in SmBusAddress is not zero, then ASSERT(). If any reserved bits of SmBusAddress are set, then ASSERT(). - @param SmBusAddress Address that encodes the SMBUS Slave Address, - SMBUS Command, SMBUS Data Length, and PEC. - @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. + @param SmBusAddress Address that encodes the SMBUS Slave Address, + SMBUS Command, SMBUS Data Length, and PEC. + @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 The 16-bit value returned by the process call command. @@ -354,11 +424,19 @@ SmBusProcessCall ( If Buffer is NULL, then ASSERT(). If any reserved bits of SmBusAddress are set, then ASSERT(). - @param SmBusAddress Address that encodes the SMBUS Slave Address, - SMBUS Command, SMBUS Data Length, and PEC. - @param Buffer 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. + @param SmBusAddress Address that encodes the SMBUS Slave Address, + SMBUS Command, SMBUS Data Length, and PEC. + @param Buffer 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 The number of bytes read. @@ -385,16 +463,23 @@ SmBusReadBlock ( The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required. Bytes are written to the SMBUS from Buffer. The number of bytes written is returned, and will never return a value larger than 32-bytes. - If Status is not NULL, then the status of the executed command is returned in Status. + If Status is not NULL, then the status of the executed command is returned in Status. If Length in SmBusAddress is zero or greater than 32, then ASSERT(). If Buffer is NULL, then ASSERT(). If any reserved bits of SmBusAddress are set, then ASSERT(). - @param SmBusAddress Address that encodes the SMBUS Slave Address, - SMBUS Command, SMBUS Data Length, and PEC. - @param Buffer 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. + @param SmBusAddress Address that encodes the SMBUS Slave Address, + MBUS Command, SMBUS Data Length, and PEC. + @param Buffer 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 The number of bytes written. @@ -432,12 +517,19 @@ SmBusWriteBlock ( If ReadBuffer is NULL, then ASSERT(). If any reserved bits of SmBusAddress are set, then ASSERT(). - @param SmBusAddress Address that encodes the SMBUS Slave Address, - SMBUS Command, SMBUS Data Length, and PEC. - @param WriteBuffer Pointer to the buffer of bytes to write to the SMBUS. - @param ReadBuffer 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. + @param SmBusAddress Address that encodes the SMBUS Slave Address, + SMBUS Command, SMBUS Data Length, and PEC. + @param WriteBuffer Pointer to the buffer of bytes to write to the SMBUS. + @param ReadBuffer 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 The number of bytes written.