mirror of https://github.com/acidanthera/audk.git
Per PI 1.3 spec, when Reserved bit set in the SlaveAddress parameter, EFI_NOT_FOUND should be returned in EFI_I2C_HOST_PROTOCOL.QueueRequest().
Signed-off-by: Elvin Li <elvin.li@intel.com> Reviewed-by: Leahy Leroy P <leroy.p.leahy@intel.com> Reviewed-by: Lin Jie <jie.lin@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14952 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
3520e03f3d
commit
62eeb52af7
|
@ -930,6 +930,7 @@ I2cHostQueueRequest (
|
||||||
I2C_HOST_CONTEXT *I2cHostContext;
|
I2C_HOST_CONTEXT *I2cHostContext;
|
||||||
BOOLEAN FirstRequest;
|
BOOLEAN FirstRequest;
|
||||||
UINTN RequestPacketSize;
|
UINTN RequestPacketSize;
|
||||||
|
UINTN StartBit;
|
||||||
|
|
||||||
SyncEvent = NULL;
|
SyncEvent = NULL;
|
||||||
FirstRequest = FALSE;
|
FirstRequest = FALSE;
|
||||||
|
@ -939,6 +940,27 @@ I2cHostQueueRequest (
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((SlaveAddress & I2C_ADDRESSING_10_BIT) != 0) {
|
||||||
|
//
|
||||||
|
// 10-bit address, bits 0-9 are used for 10-bit I2C slave addresses,
|
||||||
|
// bits 10-30 are reserved bits and must be zero
|
||||||
|
//
|
||||||
|
StartBit = 10;
|
||||||
|
} else {
|
||||||
|
//
|
||||||
|
// 7-bit address, Bits 0-6 are used for 7-bit I2C slave addresses,
|
||||||
|
// bits 7-30 are reserved bits and must be zero
|
||||||
|
//
|
||||||
|
StartBit = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BitFieldRead32 ((UINT32)SlaveAddress, StartBit, 30) != 0) {
|
||||||
|
//
|
||||||
|
// Reserved bit set in the SlaveAddress parameter
|
||||||
|
//
|
||||||
|
return EFI_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
I2cHostContext = I2C_HOST_CONTEXT_FROM_PROTOCOL (This);
|
I2cHostContext = I2C_HOST_CONTEXT_FROM_PROTOCOL (This);
|
||||||
|
|
||||||
if (Event == NULL) {
|
if (Event == NULL) {
|
||||||
|
|
Loading…
Reference in New Issue