2 The platform device manager reference implementation
4 Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include "DeviceManager.h"
17 DEVICE_MANAGER_CALLBACK_DATA gDeviceManagerPrivate
= {
18 DEVICE_MANAGER_CALLBACK_DATA_SIGNATURE
,
28 #define MAX_MAC_ADDRESS_NODE_LIST_LEN 10
30 EFI_GUID mDeviceManagerGuid
= DEVICE_MANAGER_FORMSET_GUID
;
33 // Which Mac Address string is select
34 // it will decide what menu need to show in the NETWORK_DEVICE_FORM_ID form.
36 EFI_STRING mSelectedMacAddrString
;
39 // The Mac Address show in the NETWORK_DEVICE_LIST_FORM_ID
41 MAC_ADDRESS_NODE_LIST mMacDeviceList
;
43 DEVICE_MANAGER_MENU_ITEM mDeviceManagerMenuItemTable
[] = {
44 { STRING_TOKEN (STR_DISK_DEVICE
), EFI_DISK_DEVICE_CLASS
},
45 { STRING_TOKEN (STR_VIDEO_DEVICE
), EFI_VIDEO_DEVICE_CLASS
},
46 { STRING_TOKEN (STR_NETWORK_DEVICE
), EFI_NETWORK_DEVICE_CLASS
},
47 { STRING_TOKEN (STR_INPUT_DEVICE
), EFI_INPUT_DEVICE_CLASS
},
48 { STRING_TOKEN (STR_ON_BOARD_DEVICE
), EFI_ON_BOARD_DEVICE_CLASS
},
49 { STRING_TOKEN (STR_OTHER_DEVICE
), EFI_OTHER_DEVICE_CLASS
}
52 HII_VENDOR_DEVICE_PATH mDeviceManagerHiiVendorDevicePath
= {
58 (UINT8
) (sizeof (VENDOR_DEVICE_PATH
)),
59 (UINT8
) ((sizeof (VENDOR_DEVICE_PATH
)) >> 8)
63 // {102579A0-3686-466e-ACD8-80C087044F4A}
65 { 0x102579a0, 0x3686, 0x466e, { 0xac, 0xd8, 0x80, 0xc0, 0x87, 0x4, 0x4f, 0x4a } }
69 END_ENTIRE_DEVICE_PATH_SUBTYPE
,
71 (UINT8
) (END_DEVICE_PATH_LENGTH
),
72 (UINT8
) ((END_DEVICE_PATH_LENGTH
) >> 8)
78 This function is invoked if user selected a interactive opcode from Device Manager's
79 Formset. If user set VBIOS, the new value is saved to EFI variable.
81 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
82 @param Action Specifies the type of action taken by the browser.
83 @param QuestionId A unique value which is sent to the original exporting driver
84 so that it can identify the type of data to expect.
85 @param Type The type of value for the question.
86 @param Value A pointer to the data being sent to the original exporting driver.
87 @param ActionRequest On return, points to the action requested by the callback function.
89 @retval EFI_SUCCESS The callback successfully handled the action.
90 @retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters.
95 DeviceManagerCallback (
96 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
97 IN EFI_BROWSER_ACTION Action
,
98 IN EFI_QUESTION_ID QuestionId
,
100 IN EFI_IFR_TYPE_VALUE
*Value
,
101 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest
106 if (Action
!= EFI_BROWSER_ACTION_CHANGING
) {
108 // Do nothing for other UEFI Action. Only do call back when data is changed.
110 return EFI_UNSUPPORTED
;
113 if ((Value
== NULL
) || (ActionRequest
== NULL
)) {
114 return EFI_INVALID_PARAMETER
;
116 if ((QuestionId
< MAX_KEY_SECTION_LEN
+ NETWORK_DEVICE_LIST_KEY_OFFSET
) && (QuestionId
>= NETWORK_DEVICE_LIST_KEY_OFFSET
)) {
118 // If user select the mac address, need to record mac address string to support next form show.
120 for (CurIndex
= 0; CurIndex
< mMacDeviceList
.CurListLen
; CurIndex
++) {
121 if (mMacDeviceList
.NodeList
[CurIndex
].QuestionId
== QuestionId
) {
122 mSelectedMacAddrString
= HiiGetString (gDeviceManagerPrivate
.HiiHandle
, mMacDeviceList
.NodeList
[CurIndex
].PromptId
, NULL
);
125 CreateDeviceManagerForm(NETWORK_DEVICE_FORM_ID
);
126 } else if(QuestionId
== QUESTION_NETWORK_DEVICE_ID
){
127 CreateDeviceManagerForm(NETWORK_DEVICE_LIST_FORM_ID
);
134 Get the mac address string from the device path.
135 if the device path has the vlan, get the vanid also.
137 @param MacAddressNode Device path begin with mac address
138 @param PBuffer Output string buffer contain mac address.
143 IN MAC_ADDR_DEVICE_PATH
*MacAddressNode
,
150 EFI_DEVICE_PATH_PROTOCOL
*Node
;
157 ASSERT(MacAddressNode
!= NULL
);
159 HwAddressSize
= sizeof (EFI_MAC_ADDRESS
);
160 if (MacAddressNode
->IfType
== 0x01 || MacAddressNode
->IfType
== 0x00) {
165 // The output format is MAC:XX:XX:XX:...\XXXX
166 // The size is the Number size + ":" size + Vlan size(\XXXX) + End
168 BufferLen
= (4 + 2 * HwAddressSize
+ (HwAddressSize
- 1) + 5 + 1) * sizeof (CHAR16
);
169 String
= AllocateZeroPool (BufferLen
);
170 if (String
== NULL
) {
175 StrCpyS(String
, BufferLen
/ sizeof (CHAR16
), L
"MAC:");
179 // Convert the MAC address into a unicode string.
181 HwAddress
= &MacAddressNode
->MacAddress
.Addr
[0];
182 for (Index
= 0; Index
< HwAddressSize
; Index
++) {
183 String
+= UnicodeValueToString (String
, PREFIX_ZERO
| RADIX_HEX
, *(HwAddress
++), 2);
184 if (Index
< HwAddressSize
- 1) {
190 // If VLAN is configured, it will need extra 5 characters like "\0005".
191 // Plus one unicode character for the null-terminator.
193 Node
= (EFI_DEVICE_PATH_PROTOCOL
*)MacAddressNode
;
194 while (!IsDevicePathEnd (Node
)) {
195 if (Node
->Type
== MESSAGING_DEVICE_PATH
&& Node
->SubType
== MSG_VLAN_DP
) {
196 VlanId
= ((VLAN_DEVICE_PATH
*) Node
)->VlanId
;
198 Node
= NextDevicePathNode (Node
);
203 String
+= UnicodeValueToString (String
, PREFIX_ZERO
| RADIX_HEX
, VlanId
, 4);
207 // Null terminate the Unicode string
215 Save question id and prompt id to the mac device list.
216 If the same mac address has saved yet, no need to add more.
218 @param MacAddrString Mac address string.
220 @retval EFI_SUCCESS Add the item is successful.
221 @return Other values if failed to Add the item.
224 AddIdToMacDeviceList (
225 IN EFI_STRING MacAddrString
228 MENU_INFO_ITEM
*TempDeviceList
;
230 EFI_STRING StoredString
;
231 EFI_STRING_ID PromptId
;
232 EFI_HII_HANDLE HiiHandle
;
234 HiiHandle
= gDeviceManagerPrivate
.HiiHandle
;
235 TempDeviceList
= NULL
;
237 for (Index
= 0; Index
< mMacDeviceList
.CurListLen
; Index
++) {
238 StoredString
= HiiGetString (HiiHandle
, mMacDeviceList
.NodeList
[Index
].PromptId
, NULL
);
239 if (StoredString
== NULL
) {
244 // Already has save the same mac address to the list.
246 if (StrCmp (MacAddrString
, StoredString
) == 0) {
251 PromptId
= HiiSetString(HiiHandle
, 0, MacAddrString
, NULL
);
253 // If not in the list, save it.
255 if (mMacDeviceList
.MaxListLen
> mMacDeviceList
.CurListLen
+ 1) {
256 mMacDeviceList
.NodeList
[mMacDeviceList
.CurListLen
].PromptId
= PromptId
;
257 mMacDeviceList
.NodeList
[mMacDeviceList
.CurListLen
].QuestionId
= (EFI_QUESTION_ID
) (mMacDeviceList
.CurListLen
+ NETWORK_DEVICE_LIST_KEY_OFFSET
);
259 mMacDeviceList
.MaxListLen
+= MAX_MAC_ADDRESS_NODE_LIST_LEN
;
260 if (mMacDeviceList
.CurListLen
!= 0) {
261 TempDeviceList
= (MENU_INFO_ITEM
*)AllocateCopyPool (sizeof (MENU_INFO_ITEM
) * mMacDeviceList
.MaxListLen
, (VOID
*)mMacDeviceList
.NodeList
);
263 TempDeviceList
= (MENU_INFO_ITEM
*)AllocatePool (sizeof (MENU_INFO_ITEM
) * mMacDeviceList
.MaxListLen
);
266 if (TempDeviceList
== NULL
) {
269 TempDeviceList
[mMacDeviceList
.CurListLen
].PromptId
= PromptId
;
270 TempDeviceList
[mMacDeviceList
.CurListLen
].QuestionId
= (EFI_QUESTION_ID
) (mMacDeviceList
.CurListLen
+ NETWORK_DEVICE_LIST_KEY_OFFSET
);
272 if (mMacDeviceList
.CurListLen
> 0) {
273 FreePool(mMacDeviceList
.NodeList
);
276 mMacDeviceList
.NodeList
= TempDeviceList
;
278 mMacDeviceList
.CurListLen
++;
284 Check the devcie path, try to find whether it has mac address path.
286 In this function, first need to check whether this path has mac address path.
287 second, when the mac address device path has find, also need to deicide whether
288 need to add this mac address relate info to the menu.
290 @param *Node Input device which need to be check.
291 @param NextShowFormId FormId Which need to be show.
292 @param *NeedAddItem Whether need to add the menu in the network device list.
294 @retval TRUE Has mac address device path.
295 @retval FALSE NOT Has mac address device path.
299 IsMacAddressDevicePath (
301 IN EFI_FORM_ID NextShowFormId
,
302 OUT BOOLEAN
*NeedAddItem
305 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
309 ASSERT (Node
!= NULL
);
310 *NeedAddItem
= FALSE
;
314 DevicePath
= (EFI_DEVICE_PATH_PROTOCOL
*) Node
;
317 // find the partition device path node
319 while (!IsDevicePathEnd (DevicePath
)) {
320 if ((DevicePathType (DevicePath
) == MESSAGING_DEVICE_PATH
) &&
321 (DevicePathSubType (DevicePath
) == MSG_MAC_ADDR_DP
)) {
324 if (DEVICE_MANAGER_FORM_ID
== NextShowFormId
) {
329 if (!GetMacAddressString((MAC_ADDR_DEVICE_PATH
*)DevicePath
, &Buffer
)) {
333 if (NETWORK_DEVICE_FORM_ID
== NextShowFormId
) {
334 if (StrCmp (Buffer
, mSelectedMacAddrString
) == 0) {
340 if (NETWORK_DEVICE_LIST_FORM_ID
== NextShowFormId
) {
342 // Same handle may has two network child handle, so the questionid
343 // has the offset of SAME_HANDLE_KEY_OFFSET.
345 if (AddIdToMacDeviceList (Buffer
)) {
351 DevicePath
= NextDevicePathNode (DevicePath
);
354 if (Buffer
!= NULL
) {
362 Check to see if the device path is for the network device.
364 @param Handle The HII handle which include the mac address device path.
365 @param NextShowFormId The FormId of the form which will be show next time.
366 @param ItemCount The new add Mac address item count.
368 @retval TRUE Need to add new item in the menu.
369 @return FALSE Do not need to add the menu about the network.
373 IsNeedAddNetworkMenu (
374 IN EFI_HII_HANDLE Handle
,
375 IN EFI_FORM_ID NextShowFormId
,
382 EFI_HII_HANDLE HiiDeviceManagerHandle
;
383 EFI_HANDLE DriverHandle
;
384 EFI_HANDLE ControllerHandle
;
385 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
386 EFI_DEVICE_PATH_PROTOCOL
*TmpDevicePath
;
387 EFI_DEVICE_PATH_PROTOCOL
*ChildDevicePath
;
388 EFI_OPEN_PROTOCOL_INFORMATION_ENTRY
*OpenInfoBuffer
;
391 HiiDeviceManagerHandle
= gDeviceManagerPrivate
.HiiHandle
;
393 OpenInfoBuffer
= NULL
;
394 if ((Handle
== NULL
) || (ItemCount
== NULL
)) {
399 Status
= gHiiDatabase
->GetPackageListHandle (gHiiDatabase
, Handle
, &DriverHandle
);
400 if (EFI_ERROR (Status
)) {
404 // Get the device path by the got Driver handle .
406 Status
= gBS
->HandleProtocol (DriverHandle
, &gEfiDevicePathProtocolGuid
, (VOID
**) &DevicePath
);
407 if (EFI_ERROR (Status
)) {
410 TmpDevicePath
= DevicePath
;
413 // Check whether this device path include mac address device path.
414 // If this path has mac address path, get the value whether need
415 // add this info to the menu and return.
416 // Else check more about the child handle devcie path.
418 if (IsMacAddressDevicePath(TmpDevicePath
, NextShowFormId
,&IsNeedAdd
)) {
419 if ((NETWORK_DEVICE_LIST_FORM_ID
== NextShowFormId
) && IsNeedAdd
) {
426 // Search whether this path is the controller path, not he child handle path.
427 // And the child handle has the network devcie connected.
429 TmpDevicePath
= DevicePath
;
430 Status
= gBS
->LocateDevicePath(&gEfiDevicePathProtocolGuid
, &TmpDevicePath
, &ControllerHandle
);
431 if (EFI_ERROR (Status
)) {
435 if (!IsDevicePathEnd (TmpDevicePath
)) {
440 // Retrieve the list of agents that are consuming the specific protocol
441 // on ControllerHandle.
442 // The buffer point by OpenInfoBuffer need be free at this function.
444 Status
= gBS
->OpenProtocolInformation (
446 &gEfiPciIoProtocolGuid
,
450 if (EFI_ERROR (Status
)) {
455 // Inspect if ChildHandle is one of the agents.
457 Status
= EFI_UNSUPPORTED
;
458 for (Index
= 0; Index
< EntryCount
; Index
++) {
460 // Query all the children created by the controller handle's driver
462 if ((OpenInfoBuffer
[Index
].Attributes
& EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
) != 0) {
463 Status
= gBS
->OpenProtocol (
464 OpenInfoBuffer
[Index
].ControllerHandle
,
465 &gEfiDevicePathProtocolGuid
,
466 (VOID
**) &ChildDevicePath
,
469 EFI_OPEN_PROTOCOL_GET_PROTOCOL
471 if (EFI_ERROR (Status
)) {
476 // Check whether this device path include mac address device path.
478 if (!IsMacAddressDevicePath(ChildDevicePath
, NextShowFormId
,&IsNeedAdd
)) {
480 // If this path not has mac address path, check the other.
485 // If need to update the NETWORK_DEVICE_LIST_FORM, try to get more.
487 if ((NETWORK_DEVICE_LIST_FORM_ID
== NextShowFormId
)) {
494 // If need to update other form, return whether need to add to the menu.
503 if (OpenInfoBuffer
!= NULL
) {
504 FreePool (OpenInfoBuffer
);
510 This function registers HII packages to HII database.
514 InitializeDeviceManager (
520 if (!gConnectAllHappened
){
521 EfiBootManagerConnectAll();
522 gConnectAllHappened
= TRUE
;
525 gDeviceManagerPrivate
.DriverHandle
= NULL
;
526 Status
= gBS
->InstallMultipleProtocolInterfaces (
527 &gDeviceManagerPrivate
.DriverHandle
,
528 &gEfiDevicePathProtocolGuid
,
529 &mDeviceManagerHiiVendorDevicePath
,
530 &gEfiHiiConfigAccessProtocolGuid
,
531 &gDeviceManagerPrivate
.ConfigAccess
,
534 ASSERT_EFI_ERROR (Status
);
537 // Publish our HII data.
539 gDeviceManagerPrivate
.HiiHandle
= HiiAddPackages (
541 gDeviceManagerPrivate
.DriverHandle
,
546 ASSERT (gDeviceManagerPrivate
.HiiHandle
!= NULL
);
550 Remove the installed packages from the HII Database.
560 Status
= gBS
->UninstallMultipleProtocolInterfaces (
561 gDeviceManagerPrivate
.DriverHandle
,
562 &gEfiDevicePathProtocolGuid
,
563 &mDeviceManagerHiiVendorDevicePath
,
564 &gEfiHiiConfigAccessProtocolGuid
,
565 &gDeviceManagerPrivate
.ConfigAccess
,
568 ASSERT_EFI_ERROR (Status
);
570 HiiRemovePackages (gDeviceManagerPrivate
.HiiHandle
);
574 Dynamic create Hii information for Device Manager.
576 @param NextShowFormId The FormId which need to be show.
580 CreateDeviceManagerForm(
581 IN EFI_FORM_ID NextShowFormId
587 EFI_STRING_ID TokenHelp
;
588 EFI_HII_HANDLE
*HiiHandles
;
589 EFI_HII_HANDLE HiiHandle
;
591 EFI_STRING_ID FormSetTitle
;
592 EFI_STRING_ID FormSetHelp
;
593 EFI_GUID FormSetGuid
;
594 VOID
*StartOpCodeHandle
;
595 VOID
*EndOpCodeHandle
;
596 EFI_IFR_GUID_LABEL
*StartLabel
;
597 EFI_IFR_GUID_LABEL
*EndLabel
;
598 BOOLEAN AddNetworkMenu
;
601 EFI_STRING NewStringTitle
;
602 CHAR16
*DevicePathStr
;
603 EFI_STRING_ID DevicePathId
;
605 HiiHandle
= gDeviceManagerPrivate
.HiiHandle
;
606 AddNetworkMenu
= FALSE
;
610 // If need show the Network device list form, clear the old save list first.
612 if ((NextShowFormId
== NETWORK_DEVICE_LIST_FORM_ID
) && (mMacDeviceList
.CurListLen
> 0)) {
613 mMacDeviceList
.CurListLen
= 0;
617 // Update the network device form titile.
619 if (NextShowFormId
== NETWORK_DEVICE_FORM_ID
) {
620 String
= HiiGetString (HiiHandle
, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE
), NULL
);
621 NewStringLen
= StrLen(mSelectedMacAddrString
) * 2;
622 NewStringLen
+= (StrLen(String
) + 2) * 2;
623 NewStringTitle
= AllocatePool (NewStringLen
);
624 UnicodeSPrint (NewStringTitle
, NewStringLen
, L
"%s %s", String
, mSelectedMacAddrString
);
625 HiiSetString (HiiHandle
, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE
), NewStringTitle
, NULL
);
627 FreePool (NewStringTitle
);
631 // Allocate space for creation of UpdateData Buffer
633 StartOpCodeHandle
= HiiAllocateOpCodeHandle ();
634 ASSERT (StartOpCodeHandle
!= NULL
);
636 EndOpCodeHandle
= HiiAllocateOpCodeHandle ();
637 ASSERT (EndOpCodeHandle
!= NULL
);
640 // Create Hii Extend Label OpCode as the start opcode
642 StartLabel
= (EFI_IFR_GUID_LABEL
*) HiiCreateGuidOpCode (StartOpCodeHandle
, &gEfiIfrTianoGuid
, NULL
, sizeof (EFI_IFR_GUID_LABEL
));
643 StartLabel
->ExtendOpCode
= EFI_IFR_EXTEND_OP_LABEL
;
645 // According to the next show Form id(mNextShowFormId) to decide which form need to update.
647 StartLabel
->Number
= (UINT16
) (LABEL_FORM_ID_OFFSET
+ NextShowFormId
);
650 // Create Hii Extend Label OpCode as the end opcode
652 EndLabel
= (EFI_IFR_GUID_LABEL
*) HiiCreateGuidOpCode (EndOpCodeHandle
, &gEfiIfrTianoGuid
, NULL
, sizeof (EFI_IFR_GUID_LABEL
));
653 EndLabel
->ExtendOpCode
= EFI_IFR_EXTEND_OP_LABEL
;
654 EndLabel
->Number
= LABEL_END
;
657 // Get all the Hii handles
659 HiiHandles
= HiiGetHiiHandles (NULL
);
660 ASSERT (HiiHandles
!= NULL
);
663 // Search for formset of each class type
666 for (Index
= 0; HiiHandles
[Index
] != NULL
; Index
++) {
668 // The QuestionId in the form which will call the driver form has this asssumption.
669 // QuestionId = Handle Index + NETWORK_DEVICE_LIST_KEY_OFFSET;
670 // Different QuestionId at least has the section of NETWORK_DEVICE_LIST_KEY_OFFSET.
672 ASSERT(Index
< MAX_KEY_SECTION_LEN
);
673 if (!ExtractDisplayedHiiFormFromHiiHandle (HiiHandles
[Index
], &gEfiHiiPlatformSetupFormsetGuid
, SkipCount
, &FormSetTitle
, &FormSetHelp
, &FormSetGuid
)) {
678 String
= HiiGetString (HiiHandles
[Index
], FormSetTitle
, NULL
);
679 if (String
== NULL
) {
680 String
= HiiGetString (HiiHandle
, STR_MISSING_STRING
, NULL
);
681 ASSERT (String
!= NULL
);
683 Token
= HiiSetString (HiiHandle
, 0, String
, NULL
);
686 String
= HiiGetString (HiiHandles
[Index
], FormSetHelp
, NULL
);
687 if (String
== NULL
) {
688 String
= HiiGetString (HiiHandle
, STR_MISSING_STRING
, NULL
);
689 ASSERT (String
!= NULL
);
691 TokenHelp
= HiiSetString (HiiHandle
, 0, String
, NULL
);
695 // Network device process
697 if (IsNeedAddNetworkMenu (HiiHandles
[Index
], NextShowFormId
,&AddItemCount
)) {
698 if (NextShowFormId
== DEVICE_MANAGER_FORM_ID
) {
700 // Only show one menu item "Network Config" in the device manger form.
702 if (!AddNetworkMenu
) {
703 AddNetworkMenu
= TRUE
;
704 HiiCreateGotoOpCode (
706 NETWORK_DEVICE_LIST_FORM_ID
,
707 STRING_TOKEN (STR_FORM_NETWORK_DEVICE_LIST_TITLE
),
708 STRING_TOKEN (STR_FORM_NETWORK_DEVICE_LIST_HELP
),
709 EFI_IFR_FLAG_CALLBACK
,
710 (EFI_QUESTION_ID
) QUESTION_NETWORK_DEVICE_ID
713 } else if (NextShowFormId
== NETWORK_DEVICE_LIST_FORM_ID
) {
715 // In network device list form, same mac address device only show one menu.
717 while (AddItemCount
> 0) {
718 HiiCreateGotoOpCode (
720 NETWORK_DEVICE_FORM_ID
,
721 mMacDeviceList
.NodeList
[mMacDeviceList
.CurListLen
- AddItemCount
].PromptId
,
722 STRING_TOKEN (STR_NETWORK_DEVICE_HELP
),
723 EFI_IFR_FLAG_CALLBACK
,
724 mMacDeviceList
.NodeList
[mMacDeviceList
.CurListLen
- AddItemCount
].QuestionId
728 } else if (NextShowFormId
== NETWORK_DEVICE_FORM_ID
) {
730 // In network device form, only the selected mac address device need to be show.
732 DevicePathStr
= ExtractDevicePathFromHiiHandle(HiiHandles
[Index
]);
734 if (DevicePathStr
!= NULL
){
735 DevicePathId
= HiiSetString (HiiHandle
, 0, DevicePathStr
, NULL
);
736 FreePool(DevicePathStr
);
738 HiiCreateGotoExOpCode (
744 (EFI_QUESTION_ID
) (Index
+ DEVICE_KEY_OFFSET
),
753 // Not network device process, only need to show at device manger form.
755 if (NextShowFormId
== DEVICE_MANAGER_FORM_ID
) {
756 DevicePathStr
= ExtractDevicePathFromHiiHandle(HiiHandles
[Index
]);
758 if (DevicePathStr
!= NULL
){
759 DevicePathId
= HiiSetString (HiiHandle
, 0, DevicePathStr
, NULL
);
760 FreePool(DevicePathStr
);
762 HiiCreateGotoExOpCode (
768 (EFI_QUESTION_ID
) (Index
+ DEVICE_KEY_OFFSET
),
776 //One packagelist may has more than one form package,
777 //Index-- means keep current HiiHandle and still extract from the packagelist,
778 //SkipCount++ means skip the formset which was found before in the same form package.
792 HiiFreeOpCodeHandle (StartOpCodeHandle
);
793 HiiFreeOpCodeHandle (EndOpCodeHandle
);
794 FreePool (HiiHandles
);