]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c
add comments to function declarations and definitions and updated to match coding...
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / LibSmbiosView.c
index 22a8065a0153c83fc996a9b1ed1989dd4d6f2d8f..409f6840ef6b648ba81209c84654ee4c41bba002 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   API for SMBIOS table.\r
 \r
-  Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>\r
   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
 #include <Guid/Smbios.h>\r
 #include "LIbSmbios.h"\r
 #include "LibSmbiosView.h"\r
-#include "smbiosview.h"\r
+#include "SmbiosView.h"\r
 \r
 STATIC UINT8                    mInit         = 0;\r
 STATIC SMBIOS_STRUCTURE_TABLE   *mSmbiosTable = NULL;\r
 STATIC SMBIOS_STRUCTURE_POINTER m_SmbiosStruct;\r
 STATIC SMBIOS_STRUCTURE_POINTER *mSmbiosStruct = &m_SmbiosStruct;\r
 \r
+/**\r
+  Init the SMBIOS VIEW API's environment.\r
+\r
+  @retval EFI_SUCCESS  Successful to init the SMBIOS VIEW Lib.\r
+**/\r
 EFI_STATUS\r
 LibSmbiosInit (\r
   VOID\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-    Init the SMBIOS VIEW API's environment.\r
-\r
-  Arguments:\r
-    None\r
-\r
-Returns:\r
-    EFI_SUCCESS       - Successful to init the SMBIOS VIEW Lib\r
-    Others            - Cannot get SMBIOS Table\r
-\r
-**/\r
 {\r
   EFI_STATUS  Status;\r
 \r
@@ -73,6 +65,9 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Cleanup the Smbios information.\r
+**/\r
 VOID\r
 LibSmbiosCleanup (\r
   VOID\r
@@ -88,98 +83,46 @@ LibSmbiosCleanup (
   mInit = 0;\r
 }\r
 \r
+/**\r
+  Get the entry point structure for the table.\r
+\r
+  @param[out] EntryPointStructure  The pointer to populate.\r
+**/\r
 VOID\r
 LibSmbiosGetEPS (\r
-  SMBIOS_STRUCTURE_TABLE **pEntryPointStructure\r
+  OUT SMBIOS_STRUCTURE_TABLE **EntryPointStructure\r
   )\r
 {\r
   //\r
   // return SMBIOS Table address\r
   //\r
-  *pEntryPointStructure = mSmbiosTable;\r
+  *EntryPointStructure = mSmbiosTable;\r
 }\r
 \r
-VOID\r
-LibSmbiosGetStructHead (\r
-  SMBIOS_STRUCTURE_POINTER *pHead\r
-  )\r
-{\r
-  //\r
-  // return SMBIOS structure table address\r
-  //\r
-  pHead = mSmbiosStruct;\r
-}\r
-\r
-EFI_STATUS\r
-LibGetSmbiosInfo (\r
-  OUT CHAR8   *dmiBIOSRevision,\r
-  OUT UINT16  *NumStructures,\r
-  OUT UINT16  *StructureSize,\r
-  OUT UINT32  *dmiStorageBase,\r
-  OUT UINT16  *dmiStorageSize\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-    Get SMBIOS Information.\r
+/**\r
+    Get SMBIOS structure given the Handle,copy data to the Buffer,\r
+    Handle is changed to the next handle or 0xFFFF when the end is\r
+    reached or the handle is not found.\r
 \r
-  Arguments:\r
-    dmiBIOSRevision   - Revision of the SMBIOS Extensions.\r
-    NumStructures     - Max. Number of Structures the BIOS will return.\r
-    StructureSize     - Size of largest SMBIOS Structure.\r
-    dmiStorageBase    - 32-bit physical base address for memory mapped SMBIOS data.\r
-    dmiStorageSize    - Size of the memory-mapped SMBIOS data.\r
+    @param[in,out] Handle     0xFFFF: get the first structure\r
+                              Others: get a structure according to this value.\r
+    @param[in,out] Buffer     The pointer to the caller's memory buffer.\r
+    @param[out] Length        Length of return buffer in bytes.\r
 \r
-  Returns:\r
-    DMI_SUCCESS                 - successful.\r
-    DMI_FUNCTION_NOT_SUPPORTED  - Does not support SMBIOS calling interface capability.\r
+    @retval DMI_SUCCESS   Buffer contains the required structure data\r
+                          Handle is updated with next structure handle or\r
+                          0xFFFF(end-of-list).\r
 \r
+    @retval DMI_INVALID_HANDLE  Buffer not contain the requiring structure data.\r
+                                Handle is updated with next structure handle or\r
+                                0xFFFF(end-of-list).\r
 **/\r
-{\r
-  //\r
-  // If no SMIBOS table, unsupported.\r
-  //\r
-  if (mSmbiosTable == NULL) {\r
-    return DMI_FUNCTION_NOT_SUPPORTED;\r
-  }\r
-\r
-  *dmiBIOSRevision  = mSmbiosTable->SmbiosBcdRevision;\r
-  *NumStructures    = mSmbiosTable->NumberOfSmbiosStructures;\r
-  *StructureSize    = mSmbiosTable->MaxStructureSize;\r
-  *dmiStorageBase   = mSmbiosTable->TableAddress;\r
-  *dmiStorageSize   = mSmbiosTable->TableLength;\r
-\r
-  return DMI_SUCCESS;\r
-}\r
-\r
 EFI_STATUS\r
 LibGetSmbiosStructure (\r
   IN  OUT UINT16  *Handle,\r
   IN  OUT UINT8   *Buffer,\r
   OUT UINT16      *Length\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Get SMBIOS structure given the Handle,copy data to the Buffer,\r
-    Handle is changed to the next handle or 0xFFFF when the end is\r
-    reached or the handle is not found.\r
-\r
-  Arguments:\r
-    Handle:         - 0xFFFF: get the first structure\r
-                    - Others: get a structure according to this value.\r
-    Buffter:        - The pointer to the caller's memory buffer.\r
-    Length:         - Length of return buffer in bytes.\r
-\r
-  Returns:\r
-    DMI_SUCCESS         - Buffer contains the required structure data\r
-                        - Handle is updated with next structure handle or\r
-                          0xFFFF(end-of-list).\r
-\r
-    DMI_INVALID_HANDLE  - Buffer not contain the requiring structure data\r
-                        - Handle is updated with next structure handle or\r
-                          0xFFFF(end-of-list).\r
-**/\r
 {\r
   SMBIOS_STRUCTURE_POINTER  Smbios;\r
   SMBIOS_STRUCTURE_POINTER  SmbiosEnd;\r
@@ -230,23 +173,18 @@ LibGetSmbiosStructure (
   return DMI_INVALID_HANDLE;\r
 }\r
 \r
+/**\r
+  Check the structure to see if it is legal.\r
+\r
+  @param[in] Smbios    - Pointer to the structure that will be checked.\r
+\r
+  @retval DMI_SUCCESS           Structure data is legal.\r
+  @retval DMI_BAD_PARAMETER     Structure data contains bad parameter.\r
+**/\r
 EFI_STATUS\r
 SmbiosCheckStructure (\r
   IN  SMBIOS_STRUCTURE_POINTER *Smbios\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Check the structure to see if it is legal.\r
-\r
-  Arguments:\r
-    Smbios    - Pointer to the structure that will be checked.\r
-\r
-  Returns:\r
-    DMI_SUCCESS     - Structure data is legal.\r
-    DMI_BAD_PARAMETER - Structure data contains bad parameter\r
-\r
-**/\r
 {\r
   //\r
   // If key != value, then error.\r
@@ -324,6 +262,13 @@ SmbiosCheckStructure (
   return Status;\r
 }\r
 \r
+/**\r
+  Get a string from the smbios information.\r
+\r
+  @param[in] Smbios         The pointer to the smbios information.\r
+  @param[in] StringNumber   The index to the string to get.\r
+  @param[out] Buffer        The buffer to fill with the string when retrieved.\r
+**/\r
 VOID\r
 SmbiosGetPendingString (\r
   IN  SMBIOS_STRUCTURE_POINTER      *Smbios,\r