Home | History | Annotate | Download | only in MiscSubClassPlatformDxe
      1 /** @file
      2   ResetCapabilities.
      3   SMBIOS type 23.
      4 
      5   Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
      6   This program and the accompanying materials
      7   are licensed and made available under the terms and conditions of the BSD License
      8   which accompanies this distribution.  The full text of the license may be found at
      9   http://opensource.org/licenses/bsd-license.php
     10 
     11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     13 
     14 **/
     15 
     16 #include "MiscSubClassDriver.h"
     17 /**
     18   This function makes boot time changes to the contents of the
     19   MiscOemString (Type 11).
     20 
     21   @param  RecordData                 Pointer to copy of RecordData from the Data Table.
     22 
     23   @retval EFI_SUCCESS                All parameters were valid.
     24   @retval EFI_UNSUPPORTED            Unexpected RecordType value.
     25   @retval EFI_INVALID_PARAMETER      Invalid parameter was found.
     26 
     27 **/
     28 MISC_SMBIOS_TABLE_FUNCTION(MiscResetCapabilities)
     29 {
     30   EFI_STATUS               Status;
     31   EFI_SMBIOS_HANDLE        SmbiosHandle;
     32   SMBIOS_TABLE_TYPE23      *SmbiosRecord;
     33   EFI_MISC_RESET_CAPABILITIES   *ForType23InputData;
     34 
     35   ForType23InputData = (EFI_MISC_RESET_CAPABILITIES *)RecordData;
     36 
     37   //
     38   // First check for invalid parameters.
     39   //
     40   if (RecordData == NULL) {
     41     return EFI_INVALID_PARAMETER;
     42   }
     43 
     44 
     45   //
     46   // Two zeros following the last string.
     47   //
     48   SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);
     49   ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);
     50 
     51   SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_RESET;
     52   SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE23);
     53   //
     54   // Make handle chosen by smbios protocol.add automatically.
     55   //
     56   SmbiosRecord->Hdr.Handle    = 0;
     57   SmbiosRecord->Capabilities  = *(UINT8*)&(ForType23InputData->ResetCapabilities);
     58   SmbiosRecord->ResetCount    = (UINT16)ForType23InputData->ResetCount;
     59   SmbiosRecord->ResetLimit    = (UINT16)ForType23InputData->ResetLimit;
     60   SmbiosRecord->TimerInterval = (UINT16)ForType23InputData->ResetTimerInterval;
     61   SmbiosRecord->Timeout       = (UINT16)ForType23InputData->ResetTimeout;
     62 
     63   //
     64   // Now we have got the full smbios record, call smbios protocol to add this record.
     65   //
     66   Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
     67 
     68   FreePool(SmbiosRecord);
     69   return Status;
     70 }
     71 
     72