]> git.proxmox.com Git - mirror_edk2.git/commitdiff
update comments and add assert for these files.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 25 Feb 2008 07:01:44 +0000 (07:01 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 25 Feb 2008 07:01:44 +0000 (07:01 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4750 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/IndustryStandard/Tpm12.h
MdePkg/Include/Library/IfrSupportLib.h
MdePkg/Include/Library/PeiPiLib.h
MdePkg/Include/Protocol/TcgService.h
MdePkg/Include/Protocol/UsbIo.h
MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c
MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c
MdePkg/Library/PeiPiLib/PeiPiLib.c
MdePkg/Library/UefiScsiLib/UefiScsiLib.c
MdePkg/Library/UefiUsbLib/Hid.c
MdePkg/Library/UefiUsbLib/UsbDxeLib.c

index 1d489815ca7a16e195d871dfc7f79ca714df3547..374d3131e3f8aa039c2a887eb5650d2f9afb7728 100644 (file)
@@ -1,25 +1,18 @@
-/*++\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
index 75c7f4785b02bb67bb83ed109859b319aeebef99..e3885e1db32d6e9f1393f79800b2bc5a2b660ab5 100644 (file)
@@ -1,24 +1,17 @@
-/*++\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
index a1b472ac69c10bc21e7134a9b0b603ea231431df..c79552c597ec7fe7c3903cc158e92f27521848c0 100644 (file)
@@ -23,7 +23,7 @@
     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
index ddc4eaf286d48c265cef560cf4d08b3161bc727c..aadd701719de40f9899688485c0187c650b1971f 100644 (file)
@@ -1,25 +1,17 @@
-/*++\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
@@ -60,6 +52,31 @@ typedef UINT32   TCG_ALGORITHM_ID;
 //\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
@@ -71,6 +88,23 @@ EFI_STATUS
   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
@@ -82,6 +116,25 @@ EFI_STATUS
   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
@@ -91,6 +144,21 @@ EFI_STATUS
   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
@@ -101,6 +169,29 @@ EFI_STATUS
   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
@@ -113,6 +204,21 @@ EFI_STATUS
      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
index 7d6ce276ab434b10c158652254e8ec3234ef7102..833b706847ad267455fc94374fd1c8f1ec578008 100644 (file)
@@ -99,10 +99,10 @@ EFI_STATUS
   @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
index acffa264fe3ec1a3913885db274db8d9a80b5142..752594484c4bc6611a4129e6848f3dc2cadffec4 100644 (file)
@@ -1,23 +1,16 @@
-/*++\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
index a360d59d852f7d39d2c7c2e4b73b9776a5ecee51..aa6c2fa33e10e9a8b121b9c751c8d052c18b1ed5 100644 (file)
@@ -1,23 +1,16 @@
-/*++\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
index d1e861136594fb7ef0d975c1dc4be2896bdc5908..3030b1cd7fb297d47873115badee1127d57aed91 100644 (file)
@@ -32,6 +32,27 @@ CONST EFI_PEI_FIRMWARE_VOLUME_INFO_PPI mFvInfoPpiTemplate = {
   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
index 6eb21dd8781d063fffb6e3d6b81b7256fc65c35d..5ac34334d09e21ecba0d46afd2017647166b7f06 100644 (file)
 \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
@@ -40,7 +42,7 @@
                                 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
@@ -52,8 +54,8 @@ EFI_STATUS
 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
@@ -65,6 +67,13 @@ ScsiTestUnitReadyCommand (
   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
@@ -103,10 +112,11 @@ ScsiTestUnitReadyCommand (
   @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
@@ -120,7 +130,7 @@ ScsiTestUnitReadyCommand (
                           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
@@ -136,7 +146,7 @@ ScsiInquiryCommand (
   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
@@ -148,6 +158,15 @@ ScsiInquiryCommand (
   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
@@ -192,7 +211,8 @@ ScsiInquiryCommand (
   @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
@@ -211,7 +231,7 @@ ScsiInquiryCommand (
                                     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
@@ -241,6 +261,15 @@ ScsiModeSense10Command (
   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
@@ -278,19 +307,14 @@ ScsiModeSense10Command (
 \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
@@ -303,7 +327,7 @@ ScsiModeSense10Command (
                                     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
@@ -328,6 +352,14 @@ ScsiRequestSenseCommand (
   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
@@ -366,7 +398,8 @@ ScsiRequestSenseCommand (
   @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
@@ -383,7 +416,7 @@ ScsiRequestSenseCommand (
                                       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
@@ -411,6 +444,15 @@ ScsiReadCapacityCommand (
   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
@@ -457,7 +499,8 @@ ScsiReadCapacityCommand (
   @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
@@ -475,7 +518,7 @@ ScsiReadCapacityCommand (
                                     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
@@ -504,6 +547,15 @@ ScsiRead10Command (
   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
@@ -548,7 +600,8 @@ ScsiRead10Command (
   @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
@@ -566,7 +619,7 @@ ScsiRead10Command (
                                     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
@@ -595,6 +648,15 @@ ScsiWrite10Command (
   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
index 7c0ee14284c5edc2456dca2a6b56ead46c34c99b..9391574fe0a8791b82df6b51122eca6cd4cd5acf 100644 (file)
@@ -38,6 +38,10 @@ UsbGetHidDescriptor (
   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
@@ -88,6 +92,9 @@ UsbGetReportDescriptor (
   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
@@ -137,6 +144,9 @@ UsbGetProtocolRequest (
   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
@@ -187,6 +197,9 @@ UsbSetProtocolRequest (
   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
@@ -238,6 +251,9 @@ UsbSetIdleRequest (
   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
@@ -287,7 +303,10 @@ UsbGetIdleRequest (
   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
@@ -344,6 +363,9 @@ UsbSetReportRequest (
   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
@@ -399,6 +421,9 @@ UsbGetReportRequest (
   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
index 90b0fd3ea5cc29233723f5ee269a5c5a1fd897ec..a1d61d52bfe835813af4167b55f46c58b7bb1b37 100644 (file)
@@ -527,6 +527,10 @@ UsbClearEndpointHalt (
   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