-/*++\r
-\r
-Copyright (c) 2005 - 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- Tpm12.h\r
-\r
-Abstract:\r
-\r
+/** \r
+ @file \r
TPM Specification data structures (TCG TPM Specification Version 1.2 Revision 94)\r
-\r
See http://trustedcomputinggroup.org for latest specification updates\r
\r
---*/\r
+ Copyright (c) 2006 - 2007, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials \r
+ are licensed and made available under the terms and conditions of the BSD License \r
+ which accompanies this distribution. The full text of the license may be found at \r
+ http://opensource.org/licenses/bsd-license.php \r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+**/\r
+\r
\r
#ifndef _TPM12_H_\r
#define _TPM12_H_\r
-/*++\r
-\r
-Copyright (c) 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
- IfrSupportLibrary.h\r
-\r
-Abstract:\r
-\r
+/** @file
The file contain all library functions and definitions for IFR opcode creation and \r
- related Form Browser utility Operations.\r
-\r
---*/\r
+ related Form Browser utility Operations.
+
+ Copyright (c) 2007, Intel Corporation
+ All rights reserved. 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
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/\r
\r
#ifndef _IFR_SUPPORT_LIBRARY_H\r
#define _IFR_SUPPORT_LIBRARY_H\r
The function allocate the EFI_PEI_PPI_DESCRIPTOR structure and update the fields accordingly to parameter passed\r
in and install the PPI.\r
\r
- @param FvStart Unique identifier of the format of the memory-mapped firmware volume. If NULL is specified,\r
+ @param FvFormat Unique identifier of the format of the memory-mapped firmware volume. If NULL is specified,\r
EFI_FIRMWARE_FILE_SYSTEM2_GUID is used as the Format GUID.\r
@param FvInfo Points to a buffer which allows the EFI_PEI_FIRMWARE_VOLUME_PPI to\r
process the volume. The format of this buffer is specific to the FvFormat. For\r
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- TcgService.h\r
-\r
-Abstract:\r
-\r
+/** @file
TCG Service Protocol as defined in TCG_EFI_Protocol_1_20_Final\r
-\r
- See http://trustedcomputinggroup.org for the latest specification\r
-\r
---*/\r
+ See http://trustedcomputinggroup.org for the latest specification
+
+ Copyright (c) 2007, Intel Corporation
+ All rights reserved. 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
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/\r
\r
#ifndef _TCG_SERVICE_PROTOCOL_H_\r
#define _TCG_SERVICE_PROTOCOL_H_\r
//\r
#pragma pack (pop)\r
\r
+/**\r
+ This service provides EFI protocol capability information, state information \r
+ about the TPM, and Event Log state information.\r
+\r
+ @param This Indicates the calling context\r
+ @param ProtocolCapability The callee allocates memory for a TCG_BOOT_SERVICE_CAPABILITY \r
+ structure and fills in the fields with the EFI protocol \r
+ capability information and the current TPM state information.\r
+ @param TCGFeatureFlags This is a pointer to the feature flags. No feature \r
+ flags are currently defined so this parameter \r
+ MUST be set to 0. However, in the future, \r
+ feature flags may be defined that, for example, \r
+ enable hash algorithm agility.\r
+ @param EventLogLocation This is a pointer to the address of the event log in memory.\r
+ @param EventLogLastEntry If the Event Log contains more than one entry, \r
+ this is a pointer to the address of the start of \r
+ the last entry in the event log in memory. \r
+\r
+ @retval EFI_SUCCESS Operation completed successfully.\r
+ @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.\r
+ @retval EFI_BUFFER_TOO_SMALL The receive buffer is too small.\r
+ @retval EFI_NOT_FOUND The component was not running\r
+\r
+**/\r
typedef\r
EFI_STATUS\r
(EFIAPI *EFI_TCG_STATUS_CHECK) (\r
OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry\r
);\r
\r
+/**\r
+ This service abstracts the capability to do a hash operation on a data buffer.\r
+ \r
+ @param This Indicates the calling context\r
+ @param HashData Pointer to the data buffer to be hashed\r
+ @param HashDataLen Length of the data buffer to be hashed\r
+ @param AlgorithmId Identification of the Algorithm to use for the hashing operation\r
+ @param HashedDataLen Resultant length of the hashed data\r
+ @param HashedDataResult Resultant buffer of the hashed data \r
+ \r
+ @retval EFI_SUCCESS Operation completed successfully.\r
+ @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.\r
+ @retval EFI_BUFFER_TOO_SMALL The receive buffer is too small.\r
+ @retval EFI_NOT_FOUND The component was not running\r
+\r
+**/\r
typedef\r
EFI_STATUS\r
(EFIAPI *EFI_TCG_HASH_ALL) (\r
IN OUT UINT8 **HashedDataResult\r
);\r
\r
+/**\r
+ This service abstracts the capability to add an entry to the Event Log.\r
+\r
+ @param This Indicates the calling context\r
+ @param TCGLogData Pointer to the start of the data buffer containing \r
+ the TCG_PCR_EVENT data structure. All fields in \r
+ this structure are properly filled by the caller.\r
+ @param EventNumber The event number of the event just logged\r
+ @param Flags Indicate additional flags. Only one flag has been \r
+ defined at this time, which is 0x01 and means the \r
+ extend operation should not be performed. All \r
+ other bits are reserved. \r
+ \r
+ @retval EFI_SUCCESS Operation completed successfully.\r
+ @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.\r
+ @retval EFI_BUFFER_TOO_SMALL The receive buffer is too small.\r
+ @retval EFI_NOT_FOUND The component was not running\r
+**/\r
typedef\r
EFI_STATUS\r
(EFIAPI *EFI_TCG_LOG_EVENT) (\r
IN UINT32 Flags\r
);\r
\r
+/**\r
+ This service is a proxy for commands to the TPM.\r
+\r
+ @param This Indicates the calling context\r
+ @param TpmInputParameterBlockSize Size of the TPM input parameter block\r
+ @param TpmInputParameterBlock Pointer to the TPM input parameter block\r
+ @param TpmOutputParameterBlockSize Size of the TPM output parameter block\r
+ @param TpmOutputParameterBlock Pointer to the TPM output parameter block\r
+\r
+ @retval EFI_SUCCESS Operation completed successfully.\r
+ @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.\r
+ @retval EFI_BUFFER_TOO_SMALL The receive buffer is too small.\r
+ @retval EFI_NOT_FOUND The component was not running\r
+**/\r
typedef\r
EFI_STATUS\r
(EFIAPI *EFI_TCG_PASS_THROUGH_TO_TPM) (\r
IN UINT8 *TpmOutputParameterBlock\r
);\r
\r
+/**\r
+ This service abstracts the capability to do a hash operation on a data buffer, extend a specific TPM PCR with the hash result, and add an entry to the Event Log\r
+\r
+ @param This Indicates the calling context\r
+ @param HashData Physical address of the start of the data buffer \r
+ to be hashed, extended, and logged.\r
+ @param HashDataLen The length, in bytes, of the buffer referenced by HashData\r
+ @param AlgorithmId Identification of the Algorithm to use for the hashing operation\r
+ @param TCGLogData The physical address of the start of the data \r
+ buffer containing the TCG_PCR_EVENT data structure.\r
+ @param EventNumber The event number of the event just logged.\r
+ @param EventLogLastEntry Physical address of the first byte of the entry \r
+ just placed in the Event Log. If the Event Log was \r
+ empty when this function was called then this physical \r
+ address will be the same as the physical address of \r
+ the start of the Event Log.\r
+\r
+ @retval EFI_SUCCESS Operation completed successfully.\r
+ @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.\r
+ @retval EFI_BUFFER_TOO_SMALL The receive buffer is too small.\r
+ @retval EFI_NOT_FOUND The component was not running\r
+**/\r
typedef\r
EFI_STATUS\r
(EFIAPI *EFI_TCG_HASH_LOG_EXTEND_EVENT) (\r
OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry\r
);\r
\r
+/**\r
+ The EFI_TCG Protocol abstracts TCG activity.\r
+\r
+ @param StatusCheck This service provides information on the TPM.\r
+ @param HashAll This service abstracts the capability to do a hash \r
+ operation on a data buffer.\r
+ @param LogEvent This service abstracts the capability to add \r
+ an entry to the Event Log.\r
+ @param PassThroughToTPM This service provides a pass-through capability \r
+ from the caller to the system¡¯s TPM.\r
+ @param HashLogExtendEvent This service abstracts the capability to do a hash \r
+ operation on a data buffer, extend a specific TPM PCR \r
+ with the hash result, and add an entry to the Event Log. \r
+\r
+**/\r
typedef struct _EFI_TCG_PROTOCOL {\r
EFI_TCG_STATUS_CHECK StatusCheck;\r
EFI_TCG_HASH_ALL HashAll;\r
@param Request A pointer to the USB device request that will be sent to the USB\r
device.\r
@param Direction Indicates the data direction.\r
- @param Data A pointer to the buffer of data that will be transmitted to USB\r
- device or received from USB device.\r
@param Timeout Indicating the transfer should be completed within this time frame.\r
The units are in milliseconds.\r
+ @param Data A pointer to the buffer of data that will be transmitted to USB\r
+ device or received from USB device.\r
@param DataLength The size, in bytes, of the data buffer specified by Data.\r
@param Status A pointer to the result of the USB transfer.\r
\r
-/*++\r
+/** @file\r
+ Provide generic extract guided section functions.\r
\r
-Copyright (c) 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
+ Copyright (c) 2007, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
-Module Name:\r
-\r
- DxeExtractGuidedSectionLib.c\r
-\r
-Abstract:\r
-\r
- Provide generic extract guided section functions. \r
-\r
---*/\r
+**/\r
\r
#include <PiDxe.h>\r
\r
-/*++\r
+/** @file\r
+ Provide generic extract guided section functions.\r
\r
-Copyright (c) 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
+ Copyright (c) 2007, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
-Module Name:\r
-\r
- PeiExtractGuidedSectionLib.c\r
-\r
-Abstract:\r
-\r
- Provide generic extract guided section functions. \r
-\r
---*/\r
+**/\r
\r
#include <PiPei.h>\r
\r
NULL //ParentFileName;\r
};\r
\r
+/**\r
+ Install a EFI_PEI_FIRMWARE_VOLUME_INFO PPI to inform PEI core about the existence of a new Firmware Volume.\r
+ \r
+ The function allocate the EFI_PEI_PPI_DESCRIPTOR structure and update the fields accordingly to parameter passed\r
+ in and install the PPI.\r
+ \r
+ @param FvFormat Unique identifier of the format of the memory-mapped firmware volume. If NULL is specified,\r
+ EFI_FIRMWARE_FILE_SYSTEM2_GUID is used as the Format GUID.\r
+ @param FvInfo Points to a buffer which allows the EFI_PEI_FIRMWARE_VOLUME_PPI to\r
+ process the volume. The format of this buffer is specific to the FvFormat. For\r
+ memory-mapped firmware volumes, this typically points to the first byte of the\r
+ firmware volume.\r
+ @param FvInfoSize Size of the data provided by FvInfo. For memory-mapped firmware volumes, this is\r
+ typically the size of the firmware volume.\r
+ @param ParentFvName, ParentFileName If the firmware volume originally came from a firmware file, then these point to the\r
+ parent firmware volume name and firmware volume file. If it did not originally come\r
+ from a firmware file, these should be NULL\r
+ \r
+ @retval VOID\r
+ \r
+**/\r
VOID\r
EFIAPI\r
PiLibInstallFvInfoPpi (\r
\r
@param[in] ScsiIo A pointer to SCSI IO protocol.\r
@param[in] Timeout The length of timeout period.\r
- @param[out] SenseData A pointer to output sense data.\r
- @param[out] SenseDataLength The length of output sense data.\r
+ @param[in out] SenseData A pointer to the sense data that \r
+ was generated by the execution of the SCSI Request Packet.\r
+ @param[in out] SenseDataLength On input, the length in bytes of the SenseData buffer. On\r
+ output, the number of bytes written to the SenseData buffer.\r
@param[out] HostAdapterStatus The status of Host Adapter.\r
@param[out] TargetStatus The status of the target.\r
\r
queued.\r
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send \r
the SCSI Request Packet.\r
- @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid. \r
+ @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid, or ScsiIo is NULL. \r
@retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
is not supported by the SCSI initiator(i.e., SCSI \r
Host Controller).\r
ScsiTestUnitReadyCommand (\r
IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
IN UINT64 Timeout,\r
- OUT VOID *SenseData,\r
- OUT UINT8 *SenseDataLength,\r
+ IN OUT VOID *SenseData,\r
+ IN OUT UINT8 *SenseDataLength,\r
OUT UINT8 *HostAdapterStatus,\r
OUT UINT8 *TargetStatus\r
)\r
EFI_STATUS Status;\r
UINT8 Cdb[6];\r
\r
+ ASSERT (SenseDataLength != NULL);\r
+ ASSERT (HostAdapterStatus != NULL);\r
+ ASSERT (TargetStatus != NULL);\r
+ \r
+ if (ScsiIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
\r
ZeroMem (&CommandPacket, sizeof (EFI_SCSI_IO_SCSI_REQUEST_PACKET));\r
ZeroMem (Cdb, 6);\r
@param[in] ScsiIo SCSI IO Protocol to use\r
@param[in] Timeout The length of timeout period.\r
@param[out] SenseData A pointer to output sense data.\r
- @param[in,out] SenseDataLength The length of output sense data.\r
+ @param[in out] SenseDataLength On input, the length in bytes of the SenseData buffer. On\r
+ output, the number of bytes written to the SenseData buffer.\r
@param[out] HostAdapterStatus The status of Host Adapter.\r
@param[out] TargetStatus The status of the target.\r
- @param[in,out] InquirydataBuffer A pointer to inquiry data buffer.\r
+ @param[in] InquirydataBuffer A pointer to inquiry data buffer.\r
@param[in,out] InquiryDataLength The length of inquiry data buffer.\r
@param[in] EnableVitalProductData Boolean to enable Vital Product Data.\r
\r
queued.\r
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send \r
the SCSI Request Packet.\r
- @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid. \r
+ @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid, or ScsiIo is NULL.\r
@retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
is not supported by the SCSI initiator(i.e., SCSI \r
Host Controller).\r
IN OUT UINT8 *SenseDataLength,\r
OUT UINT8 *HostAdapterStatus,\r
OUT UINT8 *TargetStatus,\r
- IN OUT VOID *InquiryDataBuffer,\r
+ IN VOID *InquiryDataBuffer,\r
IN OUT UINT32 *InquiryDataLength,\r
IN BOOLEAN EnableVitalProductData\r
)\r
EFI_STATUS Status;\r
UINT8 Cdb[6];\r
\r
+ ASSERT (SenseDataLength != NULL);\r
+ ASSERT (HostAdapterStatus != NULL);\r
+ ASSERT (TargetStatus != NULL);\r
+ ASSERT (InquiryDataLength != NULL);\r
+ \r
+ if (ScsiIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
ZeroMem (&CommandPacket, sizeof (EFI_SCSI_IO_SCSI_REQUEST_PACKET));\r
ZeroMem (Cdb, 6);\r
\r
@param[in] ScsiIo A pointer to SCSI IO protocol.\r
@param[in] Timeout The length of timeout period.\r
@param[out] SenseData A pointer to output sense data.\r
- @param[in,out] SenseDataLength The length of output sense data.\r
+ @param[in out] SenseDataLength On input, the length in bytes of the SenseData buffer. On\r
+ output, the number of bytes written to the SenseData buffer.\r
@param[out] HostAdapterStatus The status of Host Adapter.\r
@param[out] TargetStatus The status of the target.\r
@param[in] DataBuffer A pointer to input data buffer.\r
queued.\r
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send \r
the SCSI Request Packet.\r
- @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid. \r
+ @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid, or ScsiIo is NULL. \r
@retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
is not supported by the SCSI initiator(i.e., SCSI \r
Host Controller).\r
EFI_STATUS Status;\r
UINT8 Cdb[10];\r
\r
+ ASSERT (SenseDataLength != NULL);\r
+ ASSERT (HostAdapterStatus != NULL);\r
+ ASSERT (TargetStatus != NULL);\r
+ ASSERT (DataLength != NULL);\r
+ \r
+ if (ScsiIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
ZeroMem (&CommandPacket, sizeof (EFI_SCSI_IO_SCSI_REQUEST_PACKET));\r
ZeroMem (Cdb, 10);\r
\r
\r
/**\r
Function to submit SCSI request sense command.\r
- ScsiIo - A pointer to SCSI IO protocol.\r
- Timeout - The length of timeout period.\r
- SenseData - A pointer to output sense data.\r
- SenseDataLength - The length of output sense data.\r
- HostAdapterStatus - The status of Host Adapter.\r
- TargetStatus - The status of the target.\r
\r
- @param[in] ScsiIo SCSI IO Protocol to use\r
- @param[in] Timeout TODO:\r
- @param[out] SenseData TODO:\r
- @param[in,out] SenseDataLength TODO:\r
- @param[out] HostAdapterStatus TODO:\r
- @param[out] TargetStatus TODO:\r
+ @param[in] ScsiIo A pointer to SCSI IO protocol.\r
+ @param[in] Timeout The length of timeout period.\r
+ @param[in] SenseData A pointer to output sense data.\r
+ @param[in out] SenseDataLength On input, the length in bytes of the SenseData buffer. On\r
+ output, the number of bytes written to the SenseData buffer.\r
+ @param[out] HostAdapterStatus The status of Host Adapter.\r
+ @param[out] TargetStatus The status of the target.\r
\r
@retval EFI_SUCCESS Valid data returned\r
@retval EFI_SUCCESS The status of the unit is tested successfully.\r
queued.\r
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send \r
the SCSI Request Packet.\r
- @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid. \r
+ @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid, or ScsiIo is NULL.\r
@retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
is not supported by the SCSI initiator(i.e., SCSI \r
Host Controller).\r
EFI_STATUS Status;\r
UINT8 Cdb[6];\r
\r
+ ASSERT (SenseDataLength != NULL);\r
+ ASSERT (HostAdapterStatus != NULL);\r
+ ASSERT (TargetStatus != NULL);\r
+ \r
+ if (ScsiIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
ZeroMem (&CommandPacket, sizeof (EFI_SCSI_IO_SCSI_REQUEST_PACKET));\r
ZeroMem (Cdb, 6);\r
\r
@param[in] ScsiIo A pointer to SCSI IO protocol.\r
@param[in] Timeout The length of timeout period.\r
@param[out] SenseData A pointer to output sense data.\r
- @param[in,out] SenseDataLength The length of output sense data.\r
+ @param[in out] SenseDataLength On input, the length in bytes of the SenseData buffer. On\r
+ output, the number of bytes written to the SenseData buffer.\r
@param[out] HostAdapterStatus The status of Host Adapter.\r
@param[out] TargetStatus The status of the target.\r
@param[out] DataBuffer A pointer to a data buffer.\r
queued.\r
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send \r
the SCSI Request Packet.\r
- @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid. \r
+ @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid, or ScsiIo is NULL.\r
@retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
is not supported by the SCSI initiator(i.e., SCSI \r
Host Controller).\r
EFI_STATUS Status;\r
UINT8 Cdb[10];\r
\r
+ ASSERT (SenseDataLength != NULL);\r
+ ASSERT (HostAdapterStatus != NULL);\r
+ ASSERT (TargetStatus != NULL);\r
+ ASSERT (DataLength != NULL);\r
+ \r
+ if (ScsiIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
ZeroMem (&CommandPacket, sizeof (EFI_SCSI_IO_SCSI_REQUEST_PACKET));\r
ZeroMem (Cdb, 10);\r
\r
@param[in] ScsiIo A pointer to SCSI IO protocol.\r
@param[in] Timeout The length of timeout period.\r
@param[out] SenseData A pointer to output sense data.\r
- @param[in,out] SenseDataLength The length of output sense data.\r
+ @param[in out] SenseDataLength On input, the length in bytes of the SenseData buffer. On\r
+ output, the number of bytes written to the SenseData buffer.\r
@param[out] HostAdapterStatus The status of Host Adapter.\r
@param[out] TargetStatus The status of the target.\r
@param[out] DataBuffer Read 10 command data.\r
queued.\r
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send \r
the SCSI Request Packet.\r
- @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid. \r
+ @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid, or ScsiIo is NULL.\r
@retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
is not supported by the SCSI initiator(i.e., SCSI \r
Host Controller).\r
EFI_STATUS Status;\r
UINT8 Cdb[10];\r
\r
+ ASSERT (SenseDataLength != NULL);\r
+ ASSERT (HostAdapterStatus != NULL);\r
+ ASSERT (TargetStatus != NULL);\r
+ ASSERT (DataLength != NULL);\r
+ \r
+ if (ScsiIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
ZeroMem (&CommandPacket, sizeof (EFI_SCSI_IO_SCSI_REQUEST_PACKET));\r
ZeroMem (Cdb, 10);\r
\r
@param[in] ScsiIo SCSI IO Protocol to use\r
@param[in] Timeout The length of timeout period.\r
@param[out] SenseData A pointer to output sense data.\r
- @param[in,out] SenseDataLength The length of output sense data.\r
+ @param[in out] SenseDataLength On input, the length in bytes of the SenseData buffer. On\r
+ output, the number of bytes written to the SenseData buffer.\r
@param[out] HostAdapterStatus The status of Host Adapter.\r
@param[out] TargetStatus The status of the target.\r
@param[out] DataBuffer A pointer to a data buffer.\r
queued.\r
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send \r
the SCSI Request Packet.\r
- @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid. \r
+ @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid, or ScsiIo is NULL.\r
@retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
is not supported by the SCSI initiator(i.e., SCSI \r
Host Controller).\r
EFI_STATUS Status;\r
UINT8 Cdb[10];\r
\r
+ ASSERT (SenseDataLength != NULL);\r
+ ASSERT (HostAdapterStatus != NULL);\r
+ ASSERT (TargetStatus != NULL);\r
+ ASSERT (DataLength != NULL);\r
+ \r
+ if (ScsiIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
ZeroMem (&CommandPacket, sizeof (EFI_SCSI_IO_SCSI_REQUEST_PACKET));\r
ZeroMem (Cdb, 10);\r
\r
UINT32 Status;\r
EFI_STATUS Result;\r
EFI_USB_DEVICE_REQUEST Request;\r
+ \r
+ if (UsbIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
\r
Request.RequestType = 0x81;\r
Request.Request = 0x06;\r
EFI_STATUS Result;\r
EFI_USB_DEVICE_REQUEST Request;\r
\r
+ if (UsbIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
//\r
// Fill Device request packet\r
//\r
EFI_STATUS Result;\r
EFI_USB_DEVICE_REQUEST Request;\r
\r
+ if (UsbIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
//\r
// Fill Device request packet\r
//\r
EFI_STATUS Result;\r
EFI_USB_DEVICE_REQUEST Request;\r
\r
+ if (UsbIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
//\r
// Fill Device request packet\r
//\r
EFI_STATUS Result;\r
EFI_USB_DEVICE_REQUEST Request;\r
\r
+ if (UsbIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
//\r
// Fill Device request packet\r
//\r
UINT32 Status;\r
EFI_STATUS Result;\r
EFI_USB_DEVICE_REQUEST Request;\r
-\r
+ \r
+ if (UsbIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
//\r
// Fill Device request packet\r
//\r
EFI_STATUS Result;\r
EFI_USB_DEVICE_REQUEST Request;\r
\r
+ if (UsbIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
//\r
// Fill Device request packet\r
//\r
EFI_STATUS Result;\r
EFI_USB_DEVICE_REQUEST Request;\r
\r
+ if (UsbIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
//\r
// Fill Device request packet\r
//\r
EFI_USB_INTERFACE_DESCRIPTOR InterfaceDescriptor;\r
UINT8 Index;\r
\r
+ if (UsbIo == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
ZeroMem (&EndpointDescriptor, sizeof (EFI_USB_ENDPOINT_DESCRIPTOR));\r
//\r
// First seach the endpoint descriptor for that endpoint addr\r