}\r
};\r
\r
+#define MAX_MAC_ADDRESS_NODE_LIST_LEN 10\r
+\r
EFI_GUID mDeviceManagerGuid = DEVICE_MANAGER_FORMSET_GUID;\r
EFI_GUID mDriverHealthGuid = DRIVER_HEALTH_FORMSET_GUID;\r
\r
+//\r
+// Which Mac Address string is select\r
+// it will decide what menu need to show in the NETWORK_DEVICE_FORM_ID form.\r
+//\r
+EFI_STRING mSelectedMacAddrString;\r
+\r
+//\r
+// Which form Id need to be show.\r
+//\r
+EFI_FORM_ID mNextShowFormId = DEVICE_MANAGER_FORM_ID; \r
+\r
+//\r
+// The Mac Address show in the NETWORK_DEVICE_LIST_FORM_ID\r
+//\r
+MAC_ADDRESS_NODE_LIST mMacDeviceList;\r
+\r
DEVICE_MANAGER_MENU_ITEM mDeviceManagerMenuItemTable[] = {\r
{ STRING_TOKEN (STR_DISK_DEVICE), EFI_DISK_DEVICE_CLASS },\r
{ STRING_TOKEN (STR_VIDEO_DEVICE), EFI_VIDEO_DEVICE_CLASS },\r
OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r
)\r
{\r
+ UINTN CurIndex;\r
+ \r
if ((Action == EFI_BROWSER_ACTION_FORM_OPEN) || (Action == EFI_BROWSER_ACTION_FORM_CLOSE)) {\r
//\r
// Do nothing for UEFI OPEN/CLOSE Action\r
\r
gCallbackKey = QuestionId;\r
\r
+ if ((QuestionId < MAX_KEY_SECTION_LEN + NETWORK_DEVICE_LIST_KEY_OFFSET) && (QuestionId >= NETWORK_DEVICE_LIST_KEY_OFFSET)) {\r
+ //\r
+ // If user select the mac address, need to record mac address string to support next form show.\r
+ //\r
+ for (CurIndex = 0; CurIndex < mMacDeviceList.CurListLen; CurIndex ++) {\r
+ if (mMacDeviceList.NodeList[CurIndex].QuestionId == QuestionId) {\r
+ mSelectedMacAddrString = HiiGetString (gDeviceManagerPrivate.HiiHandle, mMacDeviceList.NodeList[CurIndex].PromptId, NULL);\r
+ }\r
+ }\r
+ }\r
+ \r
//\r
// Request to exit SendForm(), so as to switch to selected form\r
//\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
+ mMacDeviceList.CurListLen = 0;\r
+ mMacDeviceList.MaxListLen = 0;\r
+\r
return Status;\r
}\r
\r
return FALSE;\r
}\r
\r
+/**\r
+ Get the mac address string from the device path.\r
+ if the device path has the vlan, get the vanid also.\r
+ \r
+ @param MacAddressNode Device path begin with mac address \r
+ @param PBuffer Output string buffer contain mac address.\r
+\r
+**/\r
+BOOLEAN \r
+GetMacAddressString(\r
+ IN MAC_ADDR_DEVICE_PATH *MacAddressNode,\r
+ OUT CHAR16 **PBuffer\r
+ )\r
+{\r
+ UINTN HwAddressSize;\r
+ UINTN Index;\r
+ UINT8 *HwAddress;\r
+ EFI_DEVICE_PATH_PROTOCOL *Node;\r
+ UINT16 VlanId;\r
+ CHAR16 *String;\r
+ UINTN BufferLen;\r
+\r
+ VlanId = 0;\r
+ String = NULL;\r
+ ASSERT(MacAddressNode != NULL);\r
+\r
+ HwAddressSize = sizeof (EFI_MAC_ADDRESS);\r
+ if (MacAddressNode->IfType == 0x01 || MacAddressNode->IfType == 0x00) {\r
+ HwAddressSize = 6;\r
+ }\r
+\r
+ //\r
+ // The output format is MAC:XX:XX:XX:...\XXXX\r
+ // The size is the Number size + ":" size + Vlan size(\XXXX) + End\r
+ //\r
+ BufferLen = (4 + 2 * HwAddressSize + (HwAddressSize - 1) + 5 + 1) * sizeof (CHAR16);\r
+ String = AllocateZeroPool (BufferLen);\r
+ if (String == NULL) {\r
+ return FALSE;\r
+ }\r
+\r
+ *PBuffer = String;\r
+ StrCpy(String, L"MAC:");\r
+ String += 4;\r
+ \r
+ //\r
+ // Convert the MAC address into a unicode string.\r
+ //\r
+ HwAddress = &MacAddressNode->MacAddress.Addr[0];\r
+ for (Index = 0; Index < HwAddressSize; Index++) {\r
+ String += UnicodeValueToString (String, PREFIX_ZERO | RADIX_HEX, *(HwAddress++), 2);\r
+ if (Index < HwAddressSize - 1) {\r
+ *String++ = L':';\r
+ }\r
+ }\r
+ \r
+ //\r
+ // If VLAN is configured, it will need extra 5 characters like "\0005".\r
+ // Plus one unicode character for the null-terminator.\r
+ //\r
+ Node = (EFI_DEVICE_PATH_PROTOCOL *)MacAddressNode;\r
+ while (!IsDevicePathEnd (Node)) {\r
+ if (Node->Type == MESSAGING_DEVICE_PATH && Node->SubType == MSG_VLAN_DP) {\r
+ VlanId = ((VLAN_DEVICE_PATH *) Node)->VlanId;\r
+ }\r
+ Node = NextDevicePathNode (Node);\r
+ }\r
+\r
+ if (VlanId != 0) {\r
+ *String++ = L'\\';\r
+ String += UnicodeValueToString (String, PREFIX_ZERO | RADIX_HEX, VlanId, 4);\r
+ }\r
+\r
+ //\r
+ // Null terminate the Unicode string\r
+ //\r
+ *String = L'\0';\r
+\r
+ return TRUE;\r
+}\r
+\r
+/**\r
+ Save question id and prompt id to the mac device list.\r
+ If the same mac address has saved yet, no need to add more.\r
+\r
+ @param NewQuestionId New question id.\r
+ @param MacAddrString Mac address string.\r
+\r
+ @retval EFI_SUCCESS Add the item is successful.\r
+ @return Other values if failed to Add the item.\r
+**/\r
+BOOLEAN \r
+AddIdToMacDeviceList (\r
+ IN EFI_STRING MacAddrString\r
+ )\r
+{\r
+ MENU_INFO_ITEM *TempDeviceList;\r
+ UINTN Index;\r
+ EFI_STRING StoredString;\r
+ EFI_STRING_ID PromptId;\r
+ EFI_HII_HANDLE HiiHandle;\r
+\r
+ HiiHandle = gDeviceManagerPrivate.HiiHandle;\r
+ TempDeviceList = NULL;\r
+\r
+ for (Index = 0; Index < mMacDeviceList.CurListLen; Index ++) {\r
+ StoredString = HiiGetString (HiiHandle, mMacDeviceList.NodeList[Index].PromptId, NULL);\r
+ if (StoredString == NULL) {\r
+ return FALSE;\r
+ }\r
+\r
+ //\r
+ // Already has save the same mac address to the list.\r
+ //\r
+ if (StrCmp (MacAddrString, StoredString) == 0) {\r
+ return FALSE;\r
+ }\r
+ }\r
+\r
+ PromptId = HiiSetString(HiiHandle, 0, MacAddrString, NULL);\r
+ //\r
+ // If not in the list, save it.\r
+ //\r
+ if (mMacDeviceList.MaxListLen > mMacDeviceList.CurListLen + 1) {\r
+ mMacDeviceList.NodeList[mMacDeviceList.CurListLen].PromptId = PromptId;\r
+ mMacDeviceList.NodeList[mMacDeviceList.CurListLen].QuestionId = (EFI_QUESTION_ID) (mMacDeviceList.CurListLen + NETWORK_DEVICE_LIST_KEY_OFFSET);\r
+ } else {\r
+ mMacDeviceList.MaxListLen += MAX_MAC_ADDRESS_NODE_LIST_LEN;\r
+ if (mMacDeviceList.CurListLen != 0) {\r
+ TempDeviceList = (MENU_INFO_ITEM *)AllocateCopyPool (sizeof (MENU_INFO_ITEM) * mMacDeviceList.MaxListLen, (VOID *)mMacDeviceList.NodeList);\r
+ } else {\r
+ TempDeviceList = (MENU_INFO_ITEM *)AllocatePool (sizeof (MENU_INFO_ITEM) * mMacDeviceList.MaxListLen);\r
+ }\r
+ \r
+ if (TempDeviceList == NULL) {\r
+ return FALSE;\r
+ }\r
+ TempDeviceList[mMacDeviceList.CurListLen].PromptId = PromptId; \r
+ TempDeviceList[mMacDeviceList.CurListLen].QuestionId = (EFI_QUESTION_ID) (mMacDeviceList.CurListLen + NETWORK_DEVICE_LIST_KEY_OFFSET);\r
+ \r
+ if (mMacDeviceList.CurListLen > 0) {\r
+ FreePool(mMacDeviceList.NodeList);\r
+ }\r
+ \r
+ mMacDeviceList.NodeList = TempDeviceList;\r
+ }\r
+ mMacDeviceList.CurListLen ++;\r
+\r
+ return TRUE;\r
+}\r
+\r
+/**\r
+ Check the devcie path, try to find whether it has mac address path.\r
+\r
+ In this function, first need to check whether this path has mac address path.\r
+ second, when the mac address device path has find, also need to deicide whether\r
+ need to add this mac address relate info to the menu.\r
+\r
+ @param *Node Input device which need to be check.\r
+ @param *NeedAddItem Whether need to add the menu in the network device list.\r
+ \r
+ @retval TRUE Has mac address device path.\r
+ @retval FALSE NOT Has mac address device path. \r
+\r
+**/\r
+BOOLEAN\r
+IsMacAddressDevicePath (\r
+ IN VOID *Node,\r
+ OUT BOOLEAN *NeedAddItem\r
+ )\r
+{\r
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
+ CHAR16 *Buffer;\r
+ BOOLEAN ReturnVal;\r
+ \r
+ ASSERT (Node != NULL);\r
+ *NeedAddItem = FALSE;\r
+ ReturnVal = FALSE;\r
+ Buffer = NULL;\r
+\r
+ DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) Node;\r
+\r
+ //\r
+ // find the partition device path node\r
+ //\r
+ while (!IsDevicePathEnd (DevicePath)) {\r
+ if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&\r
+ (DevicePathSubType (DevicePath) == MSG_MAC_ADDR_DP)) {\r
+ ReturnVal = TRUE;\r
+ \r
+ if (DEVICE_MANAGER_FORM_ID == mNextShowFormId) {\r
+ *NeedAddItem = TRUE;\r
+ break;\r
+ } \r
+ \r
+ if (!GetMacAddressString((MAC_ADDR_DEVICE_PATH*)DevicePath, &Buffer)) {\r
+ break;\r
+ }\r
+\r
+ if (NETWORK_DEVICE_FORM_ID == mNextShowFormId) {\r
+ if (StrCmp (Buffer, mSelectedMacAddrString) == 0) {\r
+ *NeedAddItem = TRUE;\r
+ }\r
+ break;\r
+ }\r
+\r
+ if (NETWORK_DEVICE_LIST_FORM_ID == mNextShowFormId) {\r
+ //\r
+ // Same handle may has two network child handle, so the questionid \r
+ // has the offset of SAME_HANDLE_KEY_OFFSET.\r
+ //\r
+ if (AddIdToMacDeviceList (Buffer)) {\r
+ *NeedAddItem = TRUE;\r
+ }\r
+ break;\r
+ }\r
+ } \r
+ DevicePath = NextDevicePathNode (DevicePath);\r
+ }\r
+\r
+ if (Buffer != NULL) {\r
+ FreePool (Buffer);\r
+ }\r
+\r
+ return ReturnVal;\r
+}\r
+\r
+/**\r
+ Check to see if the device path is for the network device.\r
+\r
+ @param Handle The HII handle which include the mac address device path.\r
+ @param ItemCount The new add Mac address item count.\r
+\r
+ @retval TRUE Need to add new item in the menu.\r
+ @return FALSE Do not need to add the menu about the network.\r
+\r
+**/\r
+BOOLEAN \r
+IsNeedAddNetworkMenu (\r
+ IN EFI_HII_HANDLE Handle,\r
+ OUT UINTN *ItemCount\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ UINTN EntryCount;\r
+ UINTN Index; \r
+ EFI_HII_HANDLE HiiDeviceManagerHandle;\r
+ EFI_HANDLE DriverHandle;\r
+ EFI_HANDLE ControllerHandle;\r
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
+ EFI_DEVICE_PATH_PROTOCOL *TmpDevicePath;\r
+ EFI_DEVICE_PATH_PROTOCOL *ChildDevicePath;\r
+ EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;\r
+ BOOLEAN IsNeedAdd;\r
+\r
+ HiiDeviceManagerHandle = gDeviceManagerPrivate.HiiHandle;\r
+ IsNeedAdd = FALSE;\r
+ OpenInfoBuffer = NULL;\r
+ if ((Handle == NULL) || (ItemCount == NULL)) {\r
+ return FALSE;\r
+ }\r
+ *ItemCount = 0;\r
+\r
+ Status = gHiiDatabase->GetPackageListHandle (gHiiDatabase, Handle, &DriverHandle);\r
+ if (EFI_ERROR (Status)) {\r
+ return FALSE;\r
+ }\r
+ //\r
+ // Get the device path by the got Driver handle .\r
+ //\r
+ Status = gBS->HandleProtocol (DriverHandle, &gEfiDevicePathProtocolGuid, (VOID **) &DevicePath);\r
+ if (EFI_ERROR (Status)) {\r
+ return FALSE;\r
+ }\r
+ TmpDevicePath = DevicePath;\r
+\r
+ // \r
+ // Check whether this device path include mac address device path.\r
+ // If this path has mac address path, get the value whether need \r
+ // add this info to the menu and return.\r
+ // Else check more about the child handle devcie path.\r
+ //\r
+ if (IsMacAddressDevicePath(TmpDevicePath, &IsNeedAdd)) {\r
+ if ((NETWORK_DEVICE_LIST_FORM_ID == mNextShowFormId) && IsNeedAdd) {\r
+ (*ItemCount) = 1;\r
+ }\r
+ return IsNeedAdd;\r
+ }\r
+\r
+ //\r
+ // Search whether this path is the controller path, not he child handle path.\r
+ // And the child handle has the network devcie connected.\r
+ //\r
+ TmpDevicePath = DevicePath;\r
+ Status = gBS->LocateDevicePath(&gEfiDevicePathProtocolGuid, &TmpDevicePath, &ControllerHandle);\r
+ if (EFI_ERROR (Status)) {\r
+ return FALSE;\r
+ }\r
+\r
+ if (!IsDevicePathEnd (TmpDevicePath)) {\r
+ return FALSE; \r
+ }\r
+\r
+ //\r
+ // Retrieve the list of agents that are consuming the specific protocol\r
+ // on ControllerHandle.\r
+ // The buffer point by OpenInfoBuffer need be free at this function.\r
+ //\r
+ Status = gBS->OpenProtocolInformation (\r
+ ControllerHandle,\r
+ &gEfiPciIoProtocolGuid,\r
+ &OpenInfoBuffer,\r
+ &EntryCount\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return FALSE;\r
+ }\r
+\r
+ //\r
+ // Inspect if ChildHandle is one of the agents.\r
+ //\r
+ Status = EFI_UNSUPPORTED;\r
+ for (Index = 0; Index < EntryCount; Index++) {\r
+ //\r
+ // Query all the children created by the controller handle's driver\r
+ //\r
+ if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
+ Status = gBS->OpenProtocol (\r
+ OpenInfoBuffer[Index].ControllerHandle,\r
+ &gEfiDevicePathProtocolGuid,\r
+ (VOID **) &ChildDevicePath,\r
+ NULL,\r
+ NULL,\r
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ continue;\r
+ }\r
+\r
+ // \r
+ // Check whether this device path include mac address device path.\r
+ //\r
+ if (!IsMacAddressDevicePath(ChildDevicePath, &IsNeedAdd)) {\r
+ //\r
+ // If this path not has mac address path, check the other.\r
+ //\r
+ continue;\r
+ } else {\r
+ //\r
+ // If need to update the NETWORK_DEVICE_LIST_FORM, try to get more.\r
+ //\r
+ if ((NETWORK_DEVICE_LIST_FORM_ID == mNextShowFormId)) {\r
+ if (IsNeedAdd) {\r
+ (*ItemCount) += 1;\r
+ }\r
+ continue;\r
+ } else {\r
+ //\r
+ // If need to update other form, return whether need to add to the menu.\r
+ // \r
+ goto Done;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+Done:\r
+ if (OpenInfoBuffer != NULL) {\r
+ FreePool (OpenInfoBuffer); \r
+ }\r
+ return IsNeedAdd; \r
+}\r
+\r
/**\r
Call the browser and display the device manager to allow user\r
to configure the platform.\r
EFI_IFR_GUID_LABEL *EndLabel;\r
UINTN NumHandles;\r
EFI_HANDLE *DriverHealthHandles;\r
+ BOOLEAN AddNetworkMenu;\r
+ UINTN AddItemCount;\r
+ UINTN NewStringLen;\r
+ EFI_STRING NewStringTitle;\r
\r
HiiHandles = NULL;\r
Status = EFI_SUCCESS;\r
gCallbackKey = 0;\r
NumHandles = 0;\r
DriverHealthHandles = NULL;\r
+ AddNetworkMenu = FALSE;\r
+ AddItemCount = 0;\r
\r
//\r
// Connect all prior to entering the platform setup menu.\r
}\r
\r
//\r
- // Create Subtitle OpCodes\r
+ // If need show the Network device list form, clear the old save list first.\r
+ //\r
+ if ((mNextShowFormId == NETWORK_DEVICE_LIST_FORM_ID) && (mMacDeviceList.CurListLen > 0)) {\r
+ mMacDeviceList.CurListLen = 0;\r
+ }\r
+\r
//\r
+ // Update the network device form titile.\r
+ //\r
+ if (mNextShowFormId == NETWORK_DEVICE_FORM_ID) {\r
+ String = HiiGetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NULL);\r
+ NewStringLen = (StrLen(String) + StrLen(mSelectedMacAddrString) + 2) * 2;\r
+ NewStringTitle = AllocatePool (NewStringLen);\r
+ UnicodeSPrint (NewStringTitle, NewStringLen, L"%s %s", String, mSelectedMacAddrString);\r
+ HiiSetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL); \r
+ FreePool (String);\r
+ FreePool (NewStringTitle);\r
+ }\r
+\r
//\r
// Allocate space for creation of UpdateData Buffer\r
//\r
//\r
StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));\r
StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;\r
- StartLabel->Number = LABEL_DEVICES_LIST;\r
+ //\r
+ // According to the next show Form id(mNextShowFormId) to decide which form need to update.\r
+ //\r
+ StartLabel->Number = LABEL_FORM_ID_OFFSET + mNextShowFormId;\r
\r
//\r
// Create Hii Extend Label OpCode as the end opcode\r
EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;\r
EndLabel->Number = LABEL_END;\r
\r
- HiiCreateSubTitleOpCode (StartOpCodeHandle, STRING_TOKEN (STR_DEVICES_LIST), 0, 0, 1);\r
-\r
//\r
// Get all the Hii handles\r
//\r
// Search for formset of each class type\r
//\r
for (Index = 0; HiiHandles[Index] != NULL; Index++) {\r
+ //\r
+ // The QuestionId in the form which will call the driver form has this asssumption.\r
+ // QuestionId = Handle Index + NETWORK_DEVICE_LIST_KEY_OFFSET;\r
+ // Different QuestionId at least has the section of NETWORK_DEVICE_LIST_KEY_OFFSET.\r
+ //\r
+ ASSERT(Index < MAX_KEY_SECTION_LEN);\r
+\r
if (!ExtractDisplayedHiiFormFromHiiHandle (HiiHandles[Index], &gEfiHiiPlatformSetupFormsetGuid, &FormSetTitle, &FormSetHelp)) {\r
continue;\r
}\r
TokenHelp = HiiSetString (HiiHandle, 0, String, NULL);\r
FreePool (String);\r
\r
- HiiCreateActionOpCode (\r
- StartOpCodeHandle,\r
- (EFI_QUESTION_ID) (Index + DEVICE_KEY_OFFSET),\r
- Token,\r
- TokenHelp,\r
- EFI_IFR_FLAG_CALLBACK,\r
- 0\r
- );\r
+ //\r
+ // Network device process\r
+ // \r
+ if (IsNeedAddNetworkMenu (HiiHandles[Index], &AddItemCount)) {\r
+ if (mNextShowFormId == DEVICE_MANAGER_FORM_ID) {\r
+ //\r
+ // Only show one menu item "Network Config" in the device manger form.\r
+ //\r
+ if (!AddNetworkMenu) {\r
+ AddNetworkMenu = TRUE;\r
+ HiiCreateActionOpCode (\r
+ StartOpCodeHandle,\r
+ (EFI_QUESTION_ID) QUESTION_NETWORK_DEVICE_ID,\r
+ STRING_TOKEN (STR_FORM_NETWORK_DEVICE_LIST_TITLE),\r
+ STRING_TOKEN (STR_FORM_NETWORK_DEVICE_LIST_HELP),\r
+ EFI_IFR_FLAG_CALLBACK,\r
+ 0\r
+ );\r
+ }\r
+ } else if (mNextShowFormId == NETWORK_DEVICE_LIST_FORM_ID) {\r
+ //\r
+ // In network device list form, same mac address device only show one menu.\r
+ //\r
+ while (AddItemCount > 0) {\r
+ HiiCreateActionOpCode (\r
+ StartOpCodeHandle,\r
+ mMacDeviceList.NodeList[mMacDeviceList.CurListLen - AddItemCount].QuestionId,\r
+ mMacDeviceList.NodeList[mMacDeviceList.CurListLen - AddItemCount].PromptId,\r
+ STRING_TOKEN (STR_NETWORK_DEVICE_HELP),\r
+ EFI_IFR_FLAG_CALLBACK,\r
+ 0\r
+ );\r
+ AddItemCount -= 1;\r
+ }\r
+ } else if (mNextShowFormId == NETWORK_DEVICE_FORM_ID) {\r
+ //\r
+ // In network device form, only the selected mac address device need to be show.\r
+ //\r
+ HiiCreateActionOpCode (\r
+ StartOpCodeHandle,\r
+ (EFI_QUESTION_ID) (Index + DEVICE_KEY_OFFSET),\r
+ Token,\r
+ TokenHelp,\r
+ EFI_IFR_FLAG_CALLBACK,\r
+ 0\r
+ );\r
+ }\r
+ } else {\r
+ //\r
+ // \r
+ // Not network device process, only need to show at device manger form.\r
+ //\r
+ if (mNextShowFormId == DEVICE_MANAGER_FORM_ID) {\r
+ HiiCreateActionOpCode (\r
+ StartOpCodeHandle,\r
+ (EFI_QUESTION_ID) (Index + DEVICE_KEY_OFFSET),\r
+ Token,\r
+ TokenHelp,\r
+ EFI_IFR_FLAG_CALLBACK,\r
+ 0\r
+ );\r
+ }\r
+ }\r
}\r
\r
- //\r
- // Add End Opcode for Subtitle\r
- //\r
- HiiCreateEndOpCode (StartOpCodeHandle);\r
-\r
Status = gBS->LocateHandleBuffer (\r
ByProtocol,\r
&gEfiDriverHealthProtocolGuid,\r
HiiUpdateForm (\r
HiiHandle,\r
&mDeviceManagerGuid,\r
- DEVICE_MANAGER_FORM_ID,\r
+ mNextShowFormId,\r
StartOpCodeHandle,\r
EndOpCodeHandle\r
);\r
&HiiHandle,\r
1,\r
&mDeviceManagerGuid,\r
- 0,\r
+ mNextShowFormId,\r
NULL,\r
&ActionRequest\r
);\r
}\r
\r
//\r
- // We will have returned from processing a callback - user either hit ESC to exit, or selected\r
+ // We will have returned from processing a callback, selected\r
// a target to display\r
//\r
- if ((gCallbackKey != 0) && (gCallbackKey != DEVICE_MANAGER_KEY_DRIVER_HEALTH)) {\r
+ if ((gCallbackKey >= DEVICE_KEY_OFFSET)) {\r
ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;\r
Status = gFormBrowser2->SendForm (\r
gFormBrowser2,\r
// Force return to Device Manager\r
//\r
gCallbackKey = FRONT_PAGE_KEY_DEVICE_MANAGER;\r
+ goto Done;\r
}\r
\r
//\r
// Force return to Device Manager\r
//\r
gCallbackKey = FRONT_PAGE_KEY_DEVICE_MANAGER;\r
+ goto Done;\r
+ }\r
+\r
+ //\r
+ // Enter from device manager and into the network device list.\r
+ //\r
+ if (gCallbackKey == QUESTION_NETWORK_DEVICE_ID) {\r
+ mNextShowFormId = NETWORK_DEVICE_LIST_FORM_ID;\r
+ gCallbackKey = FRONT_PAGE_KEY_DEVICE_MANAGER;\r
+ goto Done;\r
+ }\r
+\r
+ //\r
+ // In this case, go from the network device list to the specify device.\r
+ //\r
+ if ((gCallbackKey < MAX_KEY_SECTION_LEN + NETWORK_DEVICE_LIST_KEY_OFFSET ) && (gCallbackKey >= NETWORK_DEVICE_LIST_KEY_OFFSET)) {\r
+ mNextShowFormId = NETWORK_DEVICE_FORM_ID;\r
+ gCallbackKey = FRONT_PAGE_KEY_DEVICE_MANAGER;\r
+ goto Done;\r
}\r
\r
+ //\r
+ // Select the ESC, the gCallbackKey == 0.\r
+ //\r
+ if(mNextShowFormId - 1 < DEVICE_MANAGER_FORM_ID) {\r
+ mNextShowFormId = DEVICE_MANAGER_FORM_ID;\r
+ } else {\r
+ mNextShowFormId = mNextShowFormId - 1;\r
+ gCallbackKey = FRONT_PAGE_KEY_DEVICE_MANAGER;\r
+ }\r
+\r
+Done:\r
//\r
// Remove our packagelist from HII database.\r
//\r