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