/** @file\r
The platform boot manager reference implementation\r
\r
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
EFI_GUID mBootManagerGuid = BOOT_MANAGER_FORMSET_GUID;\r
LIST_ENTRY mBootOptionsList;\r
BDS_COMMON_OPTION *gOption;\r
+CHAR16 *mDeviceTypeStr[] = {\r
+ L"Legacy BEV",\r
+ L"Legacy Floppy",\r
+ L"Legacy Hard Drive",\r
+ L"Legacy CD ROM",\r
+ L"Legacy PCMCIA",\r
+ L"Legacy USB",\r
+ L"Legacy Embedded Network",\r
+ L"Legacy Unknown Device"\r
+};\r
+\r
\r
HII_VENDOR_DEVICE_PATH mBootManagerHiiVendorDevicePath = {\r
{\r
VOID *EndOpCodeHandle;\r
EFI_IFR_GUID_LABEL *StartLabel;\r
EFI_IFR_GUID_LABEL *EndLabel;\r
+ UINT16 DeviceType;\r
+ BOOLEAN IsLegacyOption;\r
+ BOOLEAN NeedEndOp;\r
\r
- gOption = NULL;\r
+ DeviceType = (UINT16) -1;\r
+ gOption = NULL;\r
InitializeListHead (&mBootOptionsList);\r
\r
//\r
EndLabel->Number = LABEL_BOOT_OPTION_END;\r
\r
mKeyInput = 0;\r
-\r
+ NeedEndOp = FALSE;\r
for (Link = GetFirstNode (&mBootOptionsList); !IsNull (&mBootOptionsList, Link); Link = GetNextNode (&mBootOptionsList, Link)) {\r
Option = CR (Link, BDS_COMMON_OPTION, Link, BDS_LOAD_OPTION_SIGNATURE);\r
\r
if ((Option->Attribute & LOAD_OPTION_HIDDEN) != 0) {\r
continue;\r
}\r
- \r
+\r
+ //\r
+ // Group the legacy boot option in the sub title created dynamically\r
+ //\r
+ IsLegacyOption = (BOOLEAN) (\r
+ (DevicePathType (Option->DevicePath) == BBS_DEVICE_PATH) &&\r
+ (DevicePathSubType (Option->DevicePath) == BBS_BBS_DP)\r
+ );\r
+\r
+ if (!IsLegacyOption && NeedEndOp) {\r
+ NeedEndOp = FALSE;\r
+ HiiCreateEndOpCode (StartOpCodeHandle);\r
+ }\r
+ \r
+ if (IsLegacyOption && DeviceType != ((BBS_BBS_DEVICE_PATH *) Option->DevicePath)->DeviceType) {\r
+ if (NeedEndOp) {\r
+ HiiCreateEndOpCode (StartOpCodeHandle);\r
+ }\r
+\r
+ DeviceType = ((BBS_BBS_DEVICE_PATH *) Option->DevicePath)->DeviceType;\r
+ Token = HiiSetString (\r
+ HiiHandle,\r
+ 0,\r
+ mDeviceTypeStr[\r
+ MIN (DeviceType & 0xF, sizeof (mDeviceTypeStr) / sizeof (mDeviceTypeStr[0]) - 1)\r
+ ],\r
+ NULL\r
+ );\r
+ HiiCreateSubTitleOpCode (StartOpCodeHandle, Token, 0, 0, 1);\r
+ NeedEndOp = TRUE;\r
+ }\r
+\r
ASSERT (Option->Description != NULL);\r
\r
Token = HiiSetString (HiiHandle, 0, Option->Description, NULL);\r
);\r
}\r
\r
+ if (NeedEndOp) {\r
+ HiiCreateEndOpCode (StartOpCodeHandle);\r
+ }\r
+\r
HiiUpdateForm (\r
HiiHandle,\r
&mBootManagerGuid,\r