TianoCore EDK2 master
Loading...
Searching...
No Matches
WifiConnectionMgrHiiConfigAccess.c
Go to the documentation of this file.
1
11
12CHAR16 mVendorStorageName[] = L"WIFI_MANAGER_IFR_NVDATA";
13
14HII_VENDOR_DEVICE_PATH mWifiMgrDxeHiiVendorDevicePath = {
15 {
16 {
19 {
20 (UINT8)(sizeof (VENDOR_DEVICE_PATH)),
21 (UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
22 }
23 },
24 WIFI_CONNECTION_MANAGER_CONFIG_GUID
25 },
26 {
27 END_DEVICE_PATH_TYPE,
28 END_ENTIRE_DEVICE_PATH_SUBTYPE,
29 {
30 (UINT8)(END_DEVICE_PATH_LENGTH),
31 (UINT8)((END_DEVICE_PATH_LENGTH) >> 8)
32 }
33 }
34};
35
36//
37// HII Config Access Protocol instance
38//
40EFI_HII_CONFIG_ACCESS_PROTOCOL gWifiMgrDxeHiiConfigAccess = {
44};
45
46CHAR16 *mSecurityType[] = {
47 L"OPEN ",
48 L"WPA-Enterprise ",
49 L"WPA2-Enterprise",
50 L"WPA-Personal ",
51 L"WPA2-Personal ",
52 L"WEP ",
53 L"WPA3-Personal ",
54 L"WPA3-Enterprise",
55 L"UnKnown "
56};
57
58CHAR16 *mSignalStrengthBar[] = {
59 L"[-----]",
60 L"[*----]",
61 L"[**---]",
62 L"[***--]",
63 L"[****-]",
64 L"[*****]"
65};
66
67#define RSSI_TO_SIGNAL_STRENGTH_BAR(Rssi) mSignalStrengthBar[((Rssi + 19)/20)]
68
69#define NET_LIST_FOR_EACH_FROM_NODE(Entry, Node, ListHead) \
70 for(Entry = Node->ForwardLink; Entry != (ListHead); Entry = Entry->ForwardLink)
71
72extern EFI_GUID gWifiConfigFormSetGuid;
73
91 IN UINT16 StartLabelNumber,
92 OUT VOID **StartOpCodeHandle,
93 OUT VOID **EndOpCodeHandle
94 )
95{
96 EFI_STATUS Status;
97 EFI_IFR_GUID_LABEL *InternalStartLabel;
98 EFI_IFR_GUID_LABEL *InternalEndLabel;
99
100 if ((StartOpCodeHandle == NULL) || (EndOpCodeHandle == NULL)) {
101 return EFI_INVALID_PARAMETER;
102 }
103
104 Status = EFI_OUT_OF_RESOURCES;
105 *StartOpCodeHandle = NULL;
106 *EndOpCodeHandle = NULL;
107
108 //
109 // Initialize the container for dynamic opcodes.
110 //
111 *StartOpCodeHandle = HiiAllocateOpCodeHandle ();
112 if (*StartOpCodeHandle == NULL) {
113 goto Exit;
114 }
115
116 *EndOpCodeHandle = HiiAllocateOpCodeHandle ();
117 if (*EndOpCodeHandle == NULL) {
118 goto Exit;
119 }
120
121 //
122 // Create Hii Extend Label OpCode as the start opcode.
123 //
124 InternalStartLabel = (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode (
125 *StartOpCodeHandle,
126 &gEfiIfrTianoGuid,
127 NULL,
128 sizeof (EFI_IFR_GUID_LABEL)
129 );
130 if (InternalStartLabel == NULL) {
131 goto Exit;
132 }
133
134 InternalStartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
135 InternalStartLabel->Number = StartLabelNumber;
136
137 //
138 // Create Hii Extend Label OpCode as the end opcode.
139 //
140 InternalEndLabel = (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode (
141 *EndOpCodeHandle,
142 &gEfiIfrTianoGuid,
143 NULL,
144 sizeof (EFI_IFR_GUID_LABEL)
145 );
146 if (InternalEndLabel == NULL) {
147 goto Exit;
148 }
149
150 InternalEndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
151 InternalEndLabel->Number = LABEL_END;
152
153 return EFI_SUCCESS;
154
155Exit:
156
157 if (*StartOpCodeHandle != NULL) {
158 HiiFreeOpCodeHandle (*StartOpCodeHandle);
159 }
160
161 if (*EndOpCodeHandle != NULL) {
162 HiiFreeOpCodeHandle (*EndOpCodeHandle);
163 }
164
165 return Status;
166}
167
180 )
181{
182 EFI_STATUS Status;
183 CHAR16 MacString[WIFI_MGR_MAX_MAC_STRING_LEN];
184 CHAR16 PortString[WIFI_STR_MAX_SIZE];
185 EFI_STRING_ID PortTitleToken;
186 EFI_STRING_ID PortTitleHelpToken;
188 LIST_ENTRY *Entry;
189 VOID *StartOpCodeHandle;
190 VOID *EndOpCodeHandle;
191
192 if (Private == NULL) {
193 return EFI_INVALID_PARAMETER;
194 }
195
196 Status = WifiMgrCreateOpCode (
197 LABEL_MAC_ENTRY,
198 &StartOpCodeHandle,
199 &EndOpCodeHandle
200 );
201 if (EFI_ERROR (Status)) {
202 return Status;
203 }
204
205 NET_LIST_FOR_EACH (Entry, &Private->NicList) {
206 Nic = NET_LIST_USER_STRUCT_S (Entry, WIFI_MGR_DEVICE_DATA, Link, WIFI_MGR_DEVICE_DATA_SIGNATURE);
207 WifiMgrMacAddrToStr (&Nic->MacAddress, sizeof (MacString), MacString);
208 UnicodeSPrint (PortString, sizeof (PortString), L"MAC %s", MacString);
209 PortTitleToken = HiiSetString (
210 Private->RegisteredHandle,
211 0,
212 PortString,
213 NULL
214 );
215 if (PortTitleToken == 0) {
216 Status = EFI_INVALID_PARAMETER;
217 goto Exit;
218 }
219
220 UnicodeSPrint (PortString, sizeof (PortString), L"MAC Address");
221 PortTitleHelpToken = HiiSetString (
222 Private->RegisteredHandle,
223 0,
224 PortString,
225 NULL
226 );
227 if (PortTitleHelpToken == 0) {
228 Status = EFI_INVALID_PARAMETER;
229 goto Exit;
230 }
231
233 StartOpCodeHandle,
234 FORMID_WIFI_MAINPAGE,
235 PortTitleToken,
236 PortTitleHelpToken,
237 EFI_IFR_FLAG_CALLBACK,
238 (UINT16)(KEY_MAC_ENTRY_BASE + Nic->NicIndex)
239 );
240 }
241
242 Status = HiiUpdateForm (
243 Private->RegisteredHandle, // HII handle
244 &gWifiConfigFormSetGuid, // Formset GUID
245 FORMID_MAC_SELECTION, // Form ID
246 StartOpCodeHandle, // Label for where to insert opcodes
247 EndOpCodeHandle // Replace data
248 );
249
250Exit:
251
252 HiiFreeOpCodeHandle (StartOpCodeHandle);
253 HiiFreeOpCodeHandle (EndOpCodeHandle);
254 return Status;
255}
256
266CHAR16 *
269 )
270{
271 UINT8 Index;
272 UINT16 AKMSuiteCount;
273 CHAR16 *AKMListDisplay;
274 UINTN Length;
275
276 AKMListDisplay = NULL;
277 if ((Profile == NULL) || (Profile->Network.AKMSuite == NULL)) {
278 goto Exit;
279 }
280
281 AKMSuiteCount = Profile->Network.AKMSuite->AKMSuiteCount;
282 if (AKMSuiteCount != 0) {
283 //
284 // Current AKM Suite is between 1-18
285 //
286 AKMListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * (AKMSuiteCount * 3 + 1));
287 Length = 0;
288 if (AKMListDisplay != NULL) {
289 for (Index = 0; Index < AKMSuiteCount; Index++) {
290 //
291 // The size of buffer should be 4 CHAR16 for Null-terminated Unicode string.
292 //
294 AKMListDisplay + Length,
295 sizeof (CHAR16) * 4,
296 L"%d ",
297 Profile->Network.AKMSuite->AKMSuiteList[Index].SuiteType
298 );
299 Length = StrLen (AKMListDisplay + Length) + Length;
300 if (Index == AKMSuiteCount - 1) {
301 *(AKMListDisplay + (Length - 1)) = L'\0';
302 }
303 }
304 }
305 }
306
307Exit:
308
309 if (AKMListDisplay == NULL) {
310 AKMListDisplay = AllocateCopyPool (sizeof (L"None"), L"None");
311 }
312
313 return AKMListDisplay;
314}
315
325CHAR16 *
328 )
329{
330 UINT8 Index;
331 UINT16 CipherSuiteCount;
332 CHAR16 *CipherListDisplay;
333
334 CipherListDisplay = NULL;
335 if ((Profile == NULL) || (Profile->Network.CipherSuite == NULL)) {
336 goto Exit;
337 }
338
339 CipherSuiteCount = Profile->Network.CipherSuite->CipherSuiteCount;
340 if (CipherSuiteCount != 0) {
341 //
342 // Current Cipher Suite is between 1-9
343 //
344 CipherListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * (CipherSuiteCount * 2 + 1));
345 if (CipherListDisplay != NULL) {
346 for (Index = 0; Index < CipherSuiteCount; Index++) {
347 //
348 // The size of buffer should be 3 CHAR16 for Null-terminated Unicode string.
349 // The first char is the Cipher Suite number, the second char is ' ', the third char is '\0'.
350 //
352 CipherListDisplay + (Index * 2),
353 sizeof (CHAR16) * 3,
354 L"%d ",
355 Profile->Network.CipherSuite->CipherSuiteList[Index].SuiteType
356 );
357 if (Index == CipherSuiteCount - 1) {
358 *(CipherListDisplay + (Index * 2 + 1)) = L'\0';
359 }
360 }
361 }
362 }
363
364Exit:
365
366 if (CipherListDisplay == NULL) {
367 CipherListDisplay = AllocateCopyPool (sizeof (L"None"), L"None");
368 }
369
370 return CipherListDisplay;
371}
372
387 IN WIFI_MGR_PRIVATE_DATA *Private,
389 )
390{
391 EFI_STATUS Status;
392 EFI_TPL OldTpl;
393 UINT32 AvailableCount;
394 EFI_STRING_ID PortPromptToken;
395 EFI_STRING_ID PortTextToken;
396 EFI_STRING_ID PortHelpToken;
398 LIST_ENTRY *Entry;
399 VOID *StartOpCodeHandle;
400 VOID *EndOpCodeHandle;
401 CHAR16 *AKMListDisplay;
402 CHAR16 *CipherListDisplay;
403 CHAR16 PortString[WIFI_STR_MAX_SIZE];
404 UINTN PortStringSize;
405 WIFI_MGR_NETWORK_PROFILE *ConnectedProfile;
406
407 if (Private->CurrentNic == NULL) {
408 return EFI_SUCCESS;
409 }
410
411 Status = WifiMgrCreateOpCode (
412 LABEL_NETWORK_LIST_ENTRY,
413 &StartOpCodeHandle,
414 &EndOpCodeHandle
415 );
416 if (EFI_ERROR (Status)) {
417 return Status;
418 }
419
420 OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
421 AvailableCount = 0;
422 PortStringSize = sizeof (PortString);
423 ConnectedProfile = NULL;
424 AKMListDisplay = NULL;
425 CipherListDisplay = NULL;
426
427 if (Private->CurrentNic->ConnectState == WifiMgrConnectedToAp) {
428 //
429 // Display the current connected network.
430 // Find the current operate network under connected status.
431 //
432 if ((Private->CurrentNic->CurrentOperateNetwork != NULL) &&
433 Private->CurrentNic->CurrentOperateNetwork->IsAvailable)
434 {
435 Profile = Private->CurrentNic->CurrentOperateNetwork;
436 AvailableCount++;
437
438 AKMListDisplay = WifiMgrGetStrAKMList (Profile);
439 if (AKMListDisplay == NULL) {
440 Status = EFI_OUT_OF_RESOURCES;
441 goto Exit;
442 }
443
444 CipherListDisplay = WifiMgrGetStrCipherList (Profile);
445 if (CipherListDisplay == NULL) {
446 Status = EFI_OUT_OF_RESOURCES;
447 goto Exit;
448 }
449
450 UnicodeSPrint (PortString, PortStringSize, L"%s (Connected)", Profile->SSId);
451 PortPromptToken = HiiSetString (Private->RegisteredHandle, 0, PortString, NULL);
452
453 if (Profile->SecurityType == SECURITY_TYPE_NONE) {
454 PortHelpToken = 0;
455 } else {
456 UnicodeSPrint (PortString, PortStringSize, L"AKMSuite: %s CipherSuite: %s", AKMListDisplay, CipherListDisplay);
457 PortHelpToken = HiiSetString (Private->RegisteredHandle, 0, PortString, NULL);
458 }
459
460 FreePool (AKMListDisplay);
461 FreePool (CipherListDisplay);
462 AKMListDisplay = NULL;
463 CipherListDisplay = NULL;
464
466 StartOpCodeHandle,
467 FORMID_CONNECT_NETWORK,
468 PortPromptToken,
469 PortHelpToken,
470 EFI_IFR_FLAG_CALLBACK,
471 (UINT16)(KEY_AVAILABLE_NETWORK_ENTRY_BASE + Profile->ProfileIndex)
472 );
473
475 PortString,
476 PortStringSize,
477 L"%s %s %s",
478 (Profile->SecurityType != SECURITY_TYPE_NONE ? L"Secured" : L"Open "),
479 mSecurityType[Profile->SecurityType],
480 RSSI_TO_SIGNAL_STRENGTH_BAR (Profile->NetworkQuality)
481 );
482 PortTextToken = HiiSetString (Private->RegisteredHandle, 0, PortString, NULL);
483
485 StartOpCodeHandle,
486 PortTextToken,
487 0,
488 0
489 );
490
491 ConnectedProfile = Profile;
492 } else {
493 Private->CurrentNic->HasDisconnectPendingNetwork = TRUE;
494 }
495 }
496
497 //
498 // Display all supported available networks.
499 //
500 NET_LIST_FOR_EACH (Entry, &Private->CurrentNic->ProfileList) {
501 Profile = NET_LIST_USER_STRUCT_S (
502 Entry,
504 Link,
505 WIFI_MGR_PROFILE_SIGNATURE
506 );
507 if (ConnectedProfile == Profile) {
508 continue;
509 }
510
511 if (Profile->IsAvailable && Profile->CipherSuiteSupported) {
512 AvailableCount++;
513
514 AKMListDisplay = WifiMgrGetStrAKMList (Profile);
515 if (AKMListDisplay == NULL) {
516 Status = EFI_OUT_OF_RESOURCES;
517 goto Exit;
518 }
519
520 CipherListDisplay = WifiMgrGetStrCipherList (Profile);
521 if (CipherListDisplay == NULL) {
522 Status = EFI_OUT_OF_RESOURCES;
523 goto Exit;
524 }
525
526 PortPromptToken = HiiSetString (Private->RegisteredHandle, 0, Profile->SSId, NULL);
527 if (PortPromptToken == 0) {
528 Status = EFI_OUT_OF_RESOURCES;
529 goto Exit;
530 }
531
532 if (Profile->SecurityType == SECURITY_TYPE_NONE) {
533 PortHelpToken = 0;
534 } else {
536 PortString,
537 PortStringSize,
538 L"AKMSuite: %s CipherSuite: %s",
539 AKMListDisplay,
540 CipherListDisplay
541 );
542 PortHelpToken = HiiSetString (Private->RegisteredHandle, 0, PortString, NULL);
543 if (PortHelpToken == 0) {
544 Status = EFI_OUT_OF_RESOURCES;
545 goto Exit;
546 }
547 }
548
549 FreePool (AKMListDisplay);
550 FreePool (CipherListDisplay);
551 AKMListDisplay = NULL;
552 CipherListDisplay = NULL;
553
555 StartOpCodeHandle,
556 FORMID_CONNECT_NETWORK,
557 PortPromptToken,
558 PortHelpToken,
559 EFI_IFR_FLAG_CALLBACK,
560 (UINT16)(KEY_AVAILABLE_NETWORK_ENTRY_BASE + Profile->ProfileIndex)
561 );
562
564 PortString,
565 PortStringSize,
566 L"%s %s %s",
567 (Profile->SecurityType != SECURITY_TYPE_NONE ? L"Secured" : L"Open "),
568 mSecurityType[Profile->SecurityType],
569 RSSI_TO_SIGNAL_STRENGTH_BAR (Profile->NetworkQuality)
570 );
571 PortTextToken = HiiSetString (Private->RegisteredHandle, 0, PortString, NULL);
572 if (PortTextToken == 0) {
573 Status = EFI_OUT_OF_RESOURCES;
574 goto Exit;
575 }
576
578 StartOpCodeHandle,
579 PortTextToken,
580 0,
581 0
582 );
583 }
584 }
585
586 //
587 // Display all Unsupported available networks.
588 //
589 NET_LIST_FOR_EACH (Entry, &Private->CurrentNic->ProfileList) {
590 Profile = NET_LIST_USER_STRUCT_S (
591 Entry,
593 Link,
594 WIFI_MGR_PROFILE_SIGNATURE
595 );
596 if (ConnectedProfile == Profile) {
597 continue;
598 }
599
600 if (Profile->IsAvailable && !Profile->CipherSuiteSupported) {
601 AvailableCount++;
602
603 AKMListDisplay = WifiMgrGetStrAKMList (Profile);
604 if (AKMListDisplay == NULL) {
605 Status = EFI_OUT_OF_RESOURCES;
606 goto Exit;
607 }
608
609 CipherListDisplay = WifiMgrGetStrCipherList (Profile);
610 if (CipherListDisplay == NULL) {
611 Status = EFI_OUT_OF_RESOURCES;
612 goto Exit;
613 }
614
615 PortPromptToken = HiiSetString (Private->RegisteredHandle, 0, Profile->SSId, NULL);
616
617 if (Profile->AKMSuiteSupported) {
619 PortString,
620 PortStringSize,
621 L"AKMSuite: %s CipherSuite(UnSupported): %s",
622 AKMListDisplay,
623 CipherListDisplay
624 );
625 } else {
627 PortString,
628 PortStringSize,
629 L"AKMSuite(UnSupported): %s CipherSuite(UnSupported): %s",
630 AKMListDisplay,
631 CipherListDisplay
632 );
633 }
634
635 FreePool (AKMListDisplay);
636 FreePool (CipherListDisplay);
637 AKMListDisplay = NULL;
638 CipherListDisplay = NULL;
639
640 PortHelpToken = HiiSetString (Private->RegisteredHandle, 0, PortString, NULL);
641
643 StartOpCodeHandle,
644 FORMID_CONNECT_NETWORK,
645 PortPromptToken,
646 PortHelpToken,
647 EFI_IFR_FLAG_CALLBACK,
648 (UINT16)(KEY_AVAILABLE_NETWORK_ENTRY_BASE + Profile->ProfileIndex)
649 );
650
652 PortString,
653 PortStringSize,
654 L"%s %s %s",
655 L"UnSupported",
656 mSecurityType[Profile->SecurityType],
657 RSSI_TO_SIGNAL_STRENGTH_BAR (Profile->NetworkQuality)
658 );
659 PortTextToken = HiiSetString (Private->RegisteredHandle, 0, PortString, NULL);
660
662 StartOpCodeHandle,
663 PortTextToken,
664 0,
665 0
666 );
667 }
668 }
669
670 Status = HiiUpdateForm (
671 Private->RegisteredHandle, // HII handle
672 &gWifiConfigFormSetGuid, // Formset GUID
673 FORMID_NETWORK_LIST, // Form ID
674 StartOpCodeHandle, // Label for where to insert opcodes
675 EndOpCodeHandle // Replace data
676 );
677
678Exit:
679
680 gBS->RestoreTPL (OldTpl);
681
682 if (AKMListDisplay != NULL) {
683 FreePool (AKMListDisplay);
684 }
685
686 if (CipherListDisplay != NULL) {
687 FreePool (CipherListDisplay);
688 }
689
690 HiiFreeOpCodeHandle (StartOpCodeHandle);
691 HiiFreeOpCodeHandle (EndOpCodeHandle);
692
693 DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] Network List is Refreshed!\n"));
694 return Status;
695}
696
709 )
710{
711 EFI_STATUS Status;
712 EFI_TPL OldTpl;
713 UINTN Index;
714 EFI_STRING_ID StringId;
715 VOID *StartOpCodeHandle;
716 VOID *EndOpCodeHandle;
717 WIFI_HIDDEN_NETWORK_DATA *HiddenNetwork;
718 LIST_ENTRY *Entry;
719
720 if (Private == NULL) {
721 return EFI_SUCCESS;
722 }
723
724 Status = WifiMgrCreateOpCode (
725 LABEL_HIDDEN_NETWORK_ENTRY,
726 &StartOpCodeHandle,
727 &EndOpCodeHandle
728 );
729 if (EFI_ERROR (Status)) {
730 return Status;
731 }
732
733 OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
734 Index = 0;
735
736 NET_LIST_FOR_EACH (Entry, &Private->HiddenNetworkList) {
737 HiddenNetwork = NET_LIST_USER_STRUCT_S (
738 Entry,
740 Link,
741 WIFI_MGR_HIDDEN_NETWORK_SIGNATURE
742 );
743 StringId = HiiSetString (Private->RegisteredHandle, 0, HiddenNetwork->SSId, NULL);
744
746 StartOpCodeHandle,
747 (EFI_QUESTION_ID)(KEY_HIDDEN_NETWORK_ENTRY_BASE + Index),
748 MANAGER_VARSTORE_ID,
749 (UINT16)(HIDDEN_NETWORK_LIST_VAR_OFFSET + Index),
750 StringId,
751 0,
752 0,
753 0,
754 NULL
755 );
756 Index++;
757 }
758
759 Status = HiiUpdateForm (
760 Private->RegisteredHandle, // HII handle
761 &gWifiConfigFormSetGuid, // Formset GUID
762 FORMID_HIDDEN_NETWORK_LIST, // Form ID
763 StartOpCodeHandle, // Label for where to insert opcodes
764 EndOpCodeHandle // Replace data
765 );
766
767 gBS->RestoreTPL (OldTpl);
768 HiiFreeOpCodeHandle (StartOpCodeHandle);
769 HiiFreeOpCodeHandle (EndOpCodeHandle);
770 return Status;
771}
772
785 IN WIFI_MGR_PRIVATE_DATA *Private,
786 IN EFI_QUESTION_ID KeyValue
787 )
788{
790 UINT32 NicIndex;
791 CHAR16 MacString[WIFI_MGR_MAX_MAC_STRING_LEN];
792
793 NicIndex = KeyValue - KEY_MAC_ENTRY_BASE;
794 Nic = WifiMgrGetNicByIndex (Private, NicIndex);
795 if (Nic == NULL) {
796 return EFI_NOT_FOUND;
797 }
798
799 Private->CurrentNic = Nic;
800
801 WifiMgrMacAddrToStr (&Nic->MacAddress, sizeof (MacString), MacString);
802 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_MAC_ADDRESS), MacString, NULL);
803 return EFI_SUCCESS;
804}
805
813VOID
816 )
817{
818 Private->SecurityType = SECURITY_TYPE_NONE;
819 Private->EapAuthMethod = EAP_AUTH_METHOD_TTLS;
820 Private->EapSecondAuthMethod = EAP_SEAUTH_METHOD_MSCHAPV2;
821 Private->FileType = FileTypeMax;
822}
823
837 IN WIFI_MGR_PRIVATE_DATA *Private,
838 IN UINT32 ProfileIndex
839 )
840{
843
844 Nic = Private->CurrentNic;
845 if (Nic == NULL) {
846 return EFI_INVALID_PARAMETER;
847 }
848
849 //
850 // Initialize the connection page
851 //
852 WifiMgrCleanUserInput (Private);
853
854 Profile = WifiMgrGetProfileByProfileIndex (ProfileIndex, &Nic->ProfileList);
855 if (Profile == NULL) {
856 return EFI_NOT_FOUND;
857 }
858
859 Private->CurrentNic->UserSelectedProfile = Profile;
860
861 return EFI_SUCCESS;
862}
863
879 IN WIFI_MGR_PRIVATE_DATA *Private,
880 IN EFI_STRING_ID StringId,
881 IN CHAR16 *StringBuffer,
882 IN UINTN StringBufferLen
883 )
884{
885 CHAR16 *Password;
886
887 if ((StringId == 0) || (StringBuffer == NULL) || (StringBufferLen <= 0)) {
888 return EFI_INVALID_PARAMETER;
889 }
890
891 Password = HiiGetString (Private->RegisteredHandle, StringId, NULL);
892 if (Password == NULL) {
893 return EFI_NOT_FOUND;
894 }
895
896 if (StrLen (Password) > StringBufferLen) {
897 FreePool (Password);
898 return EFI_NOT_FOUND;
899 }
900
901 StrnCpyS (StringBuffer, StringBufferLen, Password, StrLen (Password));
902 ZeroMem (Password, (StrLen (Password) + 1) * sizeof (CHAR16));
903 FreePool (Password);
904
905 //
906 // Clean password in string package
907 //
908 HiiSetString (Private->RegisteredHandle, StringId, L"", NULL);
909 return EFI_SUCCESS;
910}
911
924VOID
927 IN BOOLEAN ConnectStateChanged,
928 IN EFI_STRING ConnectStatusMessage
929 )
930{
931 CHAR16 ConnectStatusStr[WIFI_STR_MAX_SIZE];
932 WIFI_MGR_PRIVATE_DATA *Private;
933
934 Private = Nic->Private;
935 if ((Private == NULL) || (Private->CurrentNic != Nic)) {
936 return;
937 }
938
939 //
940 // Update Connection Status Bar
941 //
942 if (ConnectStatusMessage != NULL) {
943 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECT_STATUS), ConnectStatusMessage, NULL);
944 } else {
945 if (Nic->ConnectState == WifiMgrConnectedToAp) {
947 ConnectStatusStr,
948 sizeof (ConnectStatusStr),
949 L"Connected to %s",
950 Nic->CurrentOperateNetwork->SSId
951 );
952 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECT_STATUS), ConnectStatusStr, NULL);
953 } else if (Nic->ConnectState == WifiMgrDisconnected) {
954 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECT_STATUS), L"Disconnected", NULL);
955 } else if (Nic->ConnectState == WifiMgrConnectingToAp) {
957 ConnectStatusStr,
958 sizeof (ConnectStatusStr),
959 L"Connecting to %s ...",
960 Nic->CurrentOperateNetwork->SSId
961 );
962 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECT_STATUS), ConnectStatusStr, NULL);
963 } else if (Nic->ConnectState == WifiMgrDisconnectingToAp) {
965 ConnectStatusStr,
966 sizeof (ConnectStatusStr),
967 L"Disconnecting from %s ...",
968 Nic->CurrentOperateNetwork->SSId
969 );
970 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECT_STATUS), ConnectStatusStr, NULL);
971 } else {
972 return;
973 }
974 }
975
976 //
977 // Update Connect Button
978 //
979 if ((Nic->ConnectState == WifiMgrConnectedToAp) && (Nic->UserSelectedProfile == Nic->CurrentOperateNetwork)) {
981 Private->RegisteredHandle,
982 STRING_TOKEN (STR_CONNECT_NOW),
983 L"Disconnect from this Network",
984 NULL
985 );
986 } else {
987 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECT_NOW), L"Connect to this Network", NULL);
988 }
989
990 gBS->SignalEvent (Private->ConnectFormRefreshEvent);
991
992 //
993 // Update Main Page and Network List
994 //
995 if (ConnectStateChanged) {
996 if (Nic->ConnectState == WifiMgrConnectedToAp) {
997 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECTION_INFO), L"Connected to", NULL);
999 Private->RegisteredHandle,
1000 STRING_TOKEN (STR_CONNECTED_SSID),
1001 Nic->CurrentOperateNetwork->SSId,
1002 NULL
1003 );
1004 } else {
1005 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECTION_INFO), L"Disconnected", NULL);
1006 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECTED_SSID), L"", NULL);
1007 }
1008
1009 gBS->SignalEvent (Private->NetworkListRefreshEvent);
1010 gBS->SignalEvent (Private->MainPageRefreshEvent);
1011 }
1012}
1013
1025 IN WIFI_MGR_PRIVATE_DATA *Private,
1026 OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData
1027 )
1028{
1029 //
1030 // Private shouldn't be NULL here, assert if Private is NULL.
1031 //
1032 ASSERT (Private != NULL);
1033
1034 if (Private->CurrentNic != NULL) {
1035 IfrNvData->ProfileCount = Private->CurrentNic->AvailableCount;
1036 } else {
1037 IfrNvData->ProfileCount = 0;
1038 }
1039
1040 return EFI_SUCCESS;
1041}
1042
1054 IN WIFI_MGR_PRIVATE_DATA *Private,
1055 IN OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData
1056 )
1057{
1058 return EFI_SUCCESS;
1059}
1060
1132EFIAPI
1135 IN CONST EFI_STRING Request,
1136 OUT EFI_STRING *Progress,
1137 OUT EFI_STRING *Results
1138 )
1139{
1140 WIFI_MGR_PRIVATE_DATA *Private;
1141 WIFI_MANAGER_IFR_NVDATA *IfrNvData;
1142 EFI_STRING ConfigRequestHdr;
1143 EFI_STRING ConfigRequest;
1144 UINTN Size;
1145 BOOLEAN AllocatedRequest;
1146 UINTN BufferSize;
1147 EFI_STATUS Status;
1148
1149 if ((This == NULL) || (Progress == NULL) || (Results == NULL)) {
1150 return EFI_INVALID_PARAMETER;
1151 }
1152
1153 *Progress = Request;
1154 if ((Request != NULL) &&
1155 !HiiIsConfigHdrMatch (Request, &gWifiConfigFormSetGuid, mVendorStorageName))
1156 {
1157 return EFI_NOT_FOUND;
1158 }
1159
1160 ConfigRequestHdr = NULL;
1161 ConfigRequest = NULL;
1162 AllocatedRequest = FALSE;
1163 Size = 0;
1164
1165 Private = WIFI_MGR_PRIVATE_DATA_FROM_CONFIG_ACCESS (This);
1166
1167 BufferSize = sizeof (WIFI_MANAGER_IFR_NVDATA);
1168 IfrNvData = AllocateZeroPool (BufferSize);
1169 if (IfrNvData == NULL) {
1170 return EFI_OUT_OF_RESOURCES;
1171 }
1172
1173 WifiMgrConvertConfigDataToIfrNvData (Private, IfrNvData);
1174
1175 ConfigRequest = Request;
1176 if ((Request == NULL) || (StrStr (Request, L"OFFSET") == NULL)) {
1177 //
1178 // Request has no request element, construct full request string.
1179 // Allocate and fill a buffer large enough to hold the <ConfigHdr> template
1180 // followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator.
1181 //
1182 ConfigRequestHdr = HiiConstructConfigHdr (
1183 &gWifiConfigFormSetGuid,
1184 mVendorStorageName,
1185 Private->DriverHandle
1186 );
1187 if (ConfigRequestHdr == NULL) {
1188 FreePool (IfrNvData);
1189 return EFI_OUT_OF_RESOURCES;
1190 }
1191
1192 Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);
1193 ConfigRequest = AllocateZeroPool (Size);
1194 if (ConfigRequest == NULL) {
1195 FreePool (IfrNvData);
1196 FreePool (ConfigRequestHdr);
1197 return EFI_OUT_OF_RESOURCES;
1198 }
1199
1200 AllocatedRequest = TRUE;
1202 ConfigRequest,
1203 Size,
1204 L"%s&OFFSET=0&WIDTH=%016LX",
1205 ConfigRequestHdr,
1206 (UINT64)BufferSize
1207 );
1208 FreePool (ConfigRequestHdr);
1209 }
1210
1211 //
1212 // Convert buffer data to <ConfigResp> by helper function BlockToConfig()
1213 //
1214 Status = gHiiConfigRouting->BlockToConfig (
1216 ConfigRequest,
1217 (UINT8 *)IfrNvData,
1218 BufferSize,
1219 Results,
1220 Progress
1221 );
1222
1223 FreePool (IfrNvData);
1224 //
1225 // Free the allocated config request string.
1226 //
1227 if (AllocatedRequest) {
1228 FreePool (ConfigRequest);
1229 ConfigRequest = NULL;
1230 }
1231
1232 //
1233 // Set Progress string to the original request string.
1234 //
1235 if (Request == NULL) {
1236 *Progress = NULL;
1237 } else if (StrStr (Request, L"OFFSET") == NULL) {
1238 *Progress = Request + StrLen (Request);
1239 }
1240
1241 return Status;
1242}
1243
1284EFIAPI
1287 IN CONST EFI_STRING Configuration,
1288 OUT EFI_STRING *Progress
1289 )
1290{
1291 EFI_STATUS Status;
1292 UINTN BufferSize;
1293 WIFI_MGR_PRIVATE_DATA *Private;
1294 WIFI_MANAGER_IFR_NVDATA *IfrNvData;
1295
1296 if ((Configuration == NULL) || (Progress == NULL)) {
1297 return EFI_INVALID_PARAMETER;
1298 }
1299
1300 IfrNvData = NULL;
1301 *Progress = Configuration;
1302 BufferSize = sizeof (WIFI_MANAGER_IFR_NVDATA);
1303 Private = WIFI_MGR_PRIVATE_DATA_FROM_CONFIG_ACCESS (This);
1304
1305 if (!HiiIsConfigHdrMatch (Configuration, &gWifiConfigFormSetGuid, mVendorStorageName)) {
1306 return EFI_NOT_FOUND;
1307 }
1308
1309 IfrNvData = AllocateZeroPool (BufferSize);
1310 if (IfrNvData == NULL) {
1311 return EFI_OUT_OF_RESOURCES;
1312 }
1313
1314 WifiMgrConvertConfigDataToIfrNvData (Private, IfrNvData);
1315
1316 Status = gHiiConfigRouting->ConfigToBlock (
1318 Configuration,
1319 (UINT8 *)IfrNvData,
1320 &BufferSize,
1321 Progress
1322 );
1323 if (EFI_ERROR (Status)) {
1324 return Status;
1325 }
1326
1327 Status = WifiMgrConvertIfrNvDataToConfigData (Private, IfrNvData);
1328 ZeroMem (IfrNvData, sizeof (WIFI_MANAGER_IFR_NVDATA));
1329 FreePool (IfrNvData);
1330
1331 return Status;
1332}
1333
1360EFIAPI
1363 IN EFI_BROWSER_ACTION Action,
1364 IN EFI_QUESTION_ID QuestionId,
1365 IN UINT8 Type,
1366 IN OUT EFI_IFR_TYPE_VALUE *Value,
1367 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
1368 )
1369{
1370 EFI_STATUS Status;
1371 EFI_INPUT_KEY Key;
1372 UINTN BufferSize;
1373 WIFI_MGR_PRIVATE_DATA *Private;
1374 WIFI_MANAGER_IFR_NVDATA *IfrNvData;
1375 EFI_DEVICE_PATH_PROTOCOL *FilePath;
1376 WIFI_MGR_NETWORK_PROFILE *Profile;
1377 WIFI_MGR_NETWORK_PROFILE *ProfileToConnect;
1378 WIFI_HIDDEN_NETWORK_DATA *HiddenNetwork;
1379 UINTN TempDataSize;
1380 VOID *TempData;
1381 LIST_ENTRY *Entry;
1382 UINT32 Index;
1383 UINT32 RemoveCount;
1384 CHAR16 *TempPassword;
1385 CHAR16 *ErrorMessage;
1386
1387 if ((Action != EFI_BROWSER_ACTION_FORM_OPEN) &&
1388 (Action != EFI_BROWSER_ACTION_FORM_CLOSE) &&
1389 (Action != EFI_BROWSER_ACTION_CHANGING) &&
1390 (Action != EFI_BROWSER_ACTION_CHANGED) &&
1391 (Action != EFI_BROWSER_ACTION_RETRIEVE))
1392 {
1393 return EFI_UNSUPPORTED;
1394 }
1395
1396 if ((Value == NULL) || (ActionRequest == NULL)) {
1397 return EFI_INVALID_PARAMETER;
1398 }
1399
1400 Status = EFI_SUCCESS;
1401 Private = WIFI_MGR_PRIVATE_DATA_FROM_CONFIG_ACCESS (This);
1402 if (Private->CurrentNic == NULL) {
1403 return EFI_DEVICE_ERROR;
1404 }
1405
1406 //
1407 // Retrieve uncommitted data from Browser
1408 //
1409 BufferSize = sizeof (WIFI_MANAGER_IFR_NVDATA);
1410 IfrNvData = AllocateZeroPool (BufferSize);
1411 if (IfrNvData == NULL) {
1412 return EFI_OUT_OF_RESOURCES;
1413 }
1414
1415 if (Action != EFI_BROWSER_ACTION_FORM_OPEN) {
1416 HiiGetBrowserData (&gWifiConfigFormSetGuid, mVendorStorageName, BufferSize, (UINT8 *)IfrNvData);
1417 }
1418
1419 if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
1420 switch (QuestionId) {
1421 case KEY_MAC_LIST:
1422
1423 Status = WifiMgrShowNicList (Private);
1424 break;
1425
1426 case KEY_REFRESH_NETWORK_LIST:
1427
1428 if (Private->CurrentNic->UserSelectedProfile != NULL) {
1429 Profile = Private->CurrentNic->UserSelectedProfile;
1430
1431 //
1432 // Erase secrets since user has left Connection Page
1433 // Connection Page may direct to Network List Page or Eap Configuration Page,
1434 // secrets only need to be erased when head to Network List Page
1435 //
1437
1438 Private->CurrentNic->UserSelectedProfile = NULL;
1439 }
1440
1441 break;
1442
1443 case KEY_ENROLLED_CERT_NAME:
1444
1445 if (Private->CurrentNic->UserSelectedProfile == NULL) {
1446 break;
1447 }
1448
1449 Profile = Private->CurrentNic->UserSelectedProfile;
1450
1451 //
1452 // Enter the key enrollment page
1453 // For TTLS and PEAP, only CA cert needs to be cared
1454 //
1455 if (Private->FileType == FileTypeCACert) {
1456 if (Profile->CACertData != NULL) {
1457 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), Profile->CACertName, NULL);
1458 } else {
1459 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), L"", NULL);
1460 }
1461 } else if (Private->FileType == FileTypeClientCert) {
1462 if (Profile->ClientCertData != NULL) {
1463 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), Profile->ClientCertName, NULL);
1464 } else {
1465 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), L"", NULL);
1466 }
1467 }
1468
1469 break;
1470
1471 case KEY_ENROLLED_PRIVATE_KEY_NAME:
1472
1473 if (Private->CurrentNic->UserSelectedProfile == NULL) {
1474 break;
1475 }
1476
1477 Profile = Private->CurrentNic->UserSelectedProfile;
1478
1479 if (Profile->PrivateKeyData != NULL) {
1480 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_PRIVATE_KEY_NAME), Profile->PrivateKeyName, NULL);
1481 } else {
1482 HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_PRIVATE_KEY_NAME), L"", NULL);
1483 }
1484
1485 break;
1486
1487 default:
1488 break;
1489 }
1490 } else if (Action == EFI_BROWSER_ACTION_FORM_CLOSE) {
1491 switch (QuestionId) {
1492 case KEY_EAP_ENROLL_CERT_FROM_FILE:
1493 case KEY_REFRESH_NETWORK_LIST:
1494
1495 if (Private->CurrentNic->UserSelectedProfile == NULL) {
1496 break;
1497 }
1498
1499 Profile = Private->CurrentNic->UserSelectedProfile;
1500
1501 //
1502 // Enter the network connection configuration page
1503 // Recovery from restored data
1504 //
1505 if (HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_SSID), Profile->SSId, NULL) == 0) {
1506 return EFI_OUT_OF_RESOURCES;
1507 }
1508
1509 IfrNvData->SecurityType = Profile->SecurityType;
1510 if (HiiSetString (
1511 Private->RegisteredHandle,
1512 STRING_TOKEN (STR_SECURITY_TYPE),
1513 mSecurityType[IfrNvData->SecurityType],
1514 NULL
1515 ) == 0)
1516 {
1517 return EFI_OUT_OF_RESOURCES;
1518 }
1519
1520 if ( (IfrNvData->SecurityType == SECURITY_TYPE_WPA2_ENTERPRISE)
1521 || (IfrNvData->SecurityType == SECURITY_TYPE_WPA3_ENTERPRISE))
1522 {
1523 IfrNvData->EapAuthMethod = Profile->EapAuthMethod;
1524 IfrNvData->EapSecondAuthMethod = Profile->EapSecondAuthMethod;
1525 StrCpyS (IfrNvData->EapIdentity, EAP_IDENTITY_SIZE, Profile->EapIdentity);
1526 }
1527
1528 break;
1529
1530 case KEY_CONNECT_ACTION:
1531
1532 if (Private->CurrentNic->UserSelectedProfile == NULL) {
1533 break;
1534 }
1535
1536 Profile = Private->CurrentNic->UserSelectedProfile;
1537
1538 //
1539 // Restore User Config Data for Page recovery
1540 //
1541 if ((IfrNvData->SecurityType == SECURITY_TYPE_WPA2_ENTERPRISE) ||
1542 (IfrNvData->SecurityType == SECURITY_TYPE_WPA3_ENTERPRISE))
1543 {
1544 Profile->EapAuthMethod = IfrNvData->EapAuthMethod;
1545 Profile->EapSecondAuthMethod = IfrNvData->EapSecondAuthMethod;
1546 StrCpyS (Profile->EapIdentity, EAP_IDENTITY_SIZE, IfrNvData->EapIdentity);
1547 }
1548
1549 break;
1550
1551 default:
1552 break;
1553 }
1554 } else if (Action == EFI_BROWSER_ACTION_CHANGING) {
1555 switch (QuestionId) {
1556 case KEY_NETWORK_LIST:
1557
1558 //
1559 // User triggered a scan process.
1560 //
1561 Private->CurrentNic->OneTimeScanRequest = TRUE;
1562 break;
1563
1564 case KEY_PASSWORD_CONNECT_NETWORK:
1565 case KEY_EAP_PASSWORD_CONNECT_NETWORK:
1566 case KEY_PRIVATE_KEY_PASSWORD:
1567
1568 if (Private->CurrentNic->UserSelectedProfile == NULL) {
1569 break;
1570 }
1571
1572 Profile = Private->CurrentNic->UserSelectedProfile;
1573
1574 if (QuestionId == KEY_PASSWORD_CONNECT_NETWORK) {
1575 TempPassword = Profile->Password;
1576 } else if (QuestionId == KEY_EAP_PASSWORD_CONNECT_NETWORK) {
1577 TempPassword = Profile->EapPassword;
1578 } else {
1579 TempPassword = Profile->PrivateKeyPassword;
1580 }
1581
1582 Status = WifiMgrRecordPassword (Private, Value->string, TempPassword, PASSWORD_STORAGE_SIZE);
1583 if (EFI_ERROR (Status)) {
1584 DEBUG ((DEBUG_ERROR, "[WiFi Connection Manager] Error: Failed to input password!"));
1585 break;
1586 }
1587
1588 //
1589 // This password is not a new created password, so no need to confirm.
1590 //
1591 Status = EFI_NOT_FOUND;
1592 break;
1593
1594 case KEY_CONNECT_ACTION:
1595
1596 ErrorMessage = NULL;
1597 ProfileToConnect = NULL;
1598
1599 if (Private->CurrentNic->UserSelectedProfile == NULL) {
1600 break;
1601 }
1602
1603 Profile = Private->CurrentNic->UserSelectedProfile;
1604
1605 if ((Private->CurrentNic->ConnectState == WifiMgrDisconnected) ||
1606 (Profile != Private->CurrentNic->CurrentOperateNetwork))
1607 {
1608 //
1609 // When this network is not currently connected, pend it to connect.
1610 //
1611 if (Profile->AKMSuiteSupported && Profile->CipherSuiteSupported) {
1612 if ((Profile->SecurityType == SECURITY_TYPE_NONE) ||
1613 (Profile->SecurityType == SECURITY_TYPE_WPA2_PERSONAL) ||
1614 (Profile->SecurityType == SECURITY_TYPE_WPA3_PERSONAL))
1615 {
1616 //
1617 // For Open network, connect directly.
1618 //
1619 ProfileToConnect = Profile;
1620 } else if ((Profile->SecurityType == SECURITY_TYPE_WPA2_ENTERPRISE) ||
1621 (Profile->SecurityType == SECURITY_TYPE_WPA3_ENTERPRISE))
1622 {
1623 //
1624 // For WPA/WPA2-Enterprise network, conduct eap configuration first.
1625 // Only EAP-TLS, TTLS and PEAP is supported now!
1626 //
1627 Profile->EapAuthMethod = IfrNvData->EapAuthMethod;
1628 StrCpyS (Profile->EapIdentity, EAP_IDENTITY_SIZE, IfrNvData->EapIdentity);
1629
1630 if ((IfrNvData->EapAuthMethod == EAP_AUTH_METHOD_TTLS) || (IfrNvData->EapAuthMethod == EAP_AUTH_METHOD_PEAP)) {
1631 Profile->EapSecondAuthMethod = IfrNvData->EapSecondAuthMethod;
1632 ProfileToConnect = Profile;
1633 } else if (IfrNvData->EapAuthMethod == EAP_AUTH_METHOD_TLS) {
1634 ProfileToConnect = Profile;
1635 } else {
1636 ErrorMessage = L"ERROR: Only EAP-TLS, TTLS or PEAP is supported now!";
1637 }
1638 } else {
1639 ErrorMessage = L"ERROR: Can't connect to this network!";
1640 }
1641 } else {
1642 ErrorMessage = L"ERROR: This network is not supported!";
1643 }
1644
1645 if (ErrorMessage != NULL) {
1646 CreatePopUp (
1647 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1648 &Key,
1649 ErrorMessage,
1650 NULL
1651 );
1652 }
1653
1654 if (ProfileToConnect != NULL) {
1655 Private->CurrentNic->OneTimeConnectRequest = TRUE;
1656 Private->CurrentNic->ConnectPendingNetwork = ProfileToConnect;
1657 }
1658 } else if (Private->CurrentNic->ConnectState == WifiMgrConnectedToAp) {
1659 //
1660 // This network is currently connected, just disconnect from it.
1661 //
1662 Private->CurrentNic->OneTimeDisconnectRequest = TRUE;
1663 Private->CurrentNic->HasDisconnectPendingNetwork = TRUE;
1664 }
1665
1666 break;
1667
1668 case KEY_ENROLL_CA_CERT_CONNECT_NETWORK:
1669
1670 Private->FileType = FileTypeCACert;
1671 break;
1672
1673 case KEY_ENROLL_CLIENT_CERT_CONNECT_NETWORK:
1674
1675 Private->FileType = FileTypeClientCert;
1676 break;
1677
1678 case KEY_EAP_ENROLL_PRIVATE_KEY_FROM_FILE:
1679
1680 FilePath = NULL;
1681 ChooseFile (NULL, NULL, NULL, &FilePath);
1682
1683 if (FilePath != NULL) {
1684 UpdatePrivateKeyFromFile (Private, FilePath);
1685 FreePool (FilePath);
1686 }
1687
1688 break;
1689
1690 case KEY_EAP_ENROLL_CERT_FROM_FILE:
1691
1692 //
1693 // User will select a cert file from File Explore
1694 //
1695 FilePath = NULL;
1696 ChooseFile (NULL, NULL, NULL, &FilePath);
1697
1698 if (FilePath != NULL) {
1699 UpdateCAFromFile (Private, FilePath);
1700 FreePool (FilePath);
1701 }
1702
1703 break;
1704
1705 case KEY_SAVE_PRIVATE_KEY_TO_MEM:
1706
1707 if ((Private->FileContext != NULL) && (Private->FileContext->FHandle != NULL) &&
1708 (Private->CurrentNic->UserSelectedProfile != NULL))
1709 {
1710 //
1711 // Read Private Key file to Buffer
1712 //
1713 Profile = Private->CurrentNic->UserSelectedProfile;
1714 if (Profile->PrivateKeyData != NULL) {
1715 ZeroMem (Profile->PrivateKeyData, Profile->PrivateKeyDataSize);
1716 FreePool (Profile->PrivateKeyData);
1717 Profile->PrivateKeyData = NULL;
1718 }
1719
1720 Status = WifiMgrReadFileToBuffer (
1721 Private->FileContext,
1722 &TempData,
1723 &TempDataSize
1724 );
1725 if (EFI_ERROR (Status)) {
1726 CreatePopUp (
1727 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1728 &Key,
1729 L"ERROR: Can't read this private key file!",
1730 NULL
1731 );
1732 } else {
1733 ASSERT (Private->FileContext->FileName != NULL);
1734
1735 Profile->PrivateKeyData = TempData;
1736 Profile->PrivateKeyDataSize = TempDataSize;
1737 StrCpyS (Profile->PrivateKeyName, WIFI_FILENAME_STR_MAX_SIZE, Private->FileContext->FileName);
1738
1739 DEBUG ((
1740 DEBUG_INFO,
1741 "[WiFi Connection Manager] Private Key: %s has been enrolled! Size: %d\n",
1742 Profile->PrivateKeyName,
1743 Profile->PrivateKeyDataSize
1744 ));
1745 }
1746 }
1747
1748 break;
1749
1750 case KEY_SAVE_CERT_TO_MEM:
1751
1752 if ((Private->FileContext != NULL) && (Private->FileContext->FHandle != NULL) &&
1753 (Private->CurrentNic->UserSelectedProfile != NULL))
1754 {
1755 //
1756 // Read Cert file to Buffer
1757 //
1758 Profile = Private->CurrentNic->UserSelectedProfile;
1759
1760 if (Private->FileType == FileTypeCACert) {
1761 if (Profile->CACertData != NULL) {
1762 ZeroMem (Profile->CACertData, Profile->CACertSize);
1763 FreePool (Profile->CACertData);
1764 Profile->CACertData = NULL;
1765 }
1766 } else if (Private->FileType == FileTypeClientCert) {
1767 if (Profile->ClientCertData != NULL) {
1768 ZeroMem (Profile->ClientCertData, Profile->ClientCertSize);
1769 FreePool (Profile->ClientCertData);
1770 Profile->ClientCertData = NULL;
1771 }
1772 } else {
1773 break;
1774 }
1775
1776 Status = WifiMgrReadFileToBuffer (
1777 Private->FileContext,
1778 &TempData,
1779 &TempDataSize
1780 );
1781 if (EFI_ERROR (Status)) {
1782 CreatePopUp (
1783 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1784 &Key,
1785 L"ERROR: Can't read this certificate file!",
1786 NULL
1787 );
1788 } else {
1789 ASSERT (Private->FileContext->FileName != NULL);
1790 if (Private->FileType == FileTypeCACert) {
1791 Profile->CACertData = TempData;
1792 Profile->CACertSize = TempDataSize;
1793 StrCpyS (Profile->CACertName, WIFI_FILENAME_STR_MAX_SIZE, Private->FileContext->FileName);
1794 DEBUG ((
1795 DEBUG_INFO,
1796 "[WiFi Connection Manager] CA Cert: %s has been enrolled! Size: %d\n",
1797 Profile->CACertName,
1798 Profile->CACertSize
1799 ));
1800 } else {
1801 Profile->ClientCertData = TempData;
1802 Profile->ClientCertSize = TempDataSize;
1803 StrCpyS (Profile->ClientCertName, WIFI_FILENAME_STR_MAX_SIZE, Private->FileContext->FileName);
1804 DEBUG ((
1805 DEBUG_INFO,
1806 "[WiFi Connection Manager] Client Cert: %s has been enrolled! Size: %d\n",
1807 Profile->ClientCertName,
1808 Profile->ClientCertSize
1809 ));
1810 }
1811 }
1812 }
1813
1814 break;
1815
1816 case KEY_ADD_HIDDEN_NETWORK:
1817
1818 //
1819 // Add a Hidden Network
1820 //
1821 if ((StrLen (IfrNvData->SSId) < SSID_MIN_LEN) ||
1822 (Private->HiddenNetworkCount >= HIDDEN_NETWORK_LIST_COUNT_MAX))
1823 {
1824 Status = EFI_ABORTED;
1825 break;
1826 } else {
1827 //
1828 // Check if this SSId is already in Hidden Network List
1829 //
1830 NET_LIST_FOR_EACH (Entry, &Private->HiddenNetworkList) {
1831 HiddenNetwork = NET_LIST_USER_STRUCT_S (
1832 Entry,
1834 Link,
1835 WIFI_MGR_HIDDEN_NETWORK_SIGNATURE
1836 );
1837 if (StrCmp (HiddenNetwork->SSId, IfrNvData->SSId) == 0) {
1838 Status = EFI_ABORTED;
1839 break;
1840 }
1841 }
1842 }
1843
1845 if (HiddenNetwork == NULL) {
1846 Status = EFI_OUT_OF_RESOURCES;
1847 break;
1848 }
1849
1850 HiddenNetwork->Signature = WIFI_MGR_HIDDEN_NETWORK_SIGNATURE;
1851 StrCpyS (HiddenNetwork->SSId, SSID_STORAGE_SIZE, IfrNvData->SSId);
1852
1853 InsertTailList (&Private->HiddenNetworkList, &HiddenNetwork->Link);
1854 Private->HiddenNetworkCount++;
1855
1856 WifiMgrRefreshHiddenList (Private);
1857 break;
1858
1859 case KEY_REMOVE_HIDDEN_NETWORK:
1860
1861 //
1862 // Remove Hidden Networks
1863 //
1864 Entry = GetFirstNode (&Private->HiddenNetworkList);
1865 RemoveCount = 0;
1866 for (Index = 0; Index < Private->HiddenNetworkCount; Index++) {
1867 if (IfrNvData->HiddenNetworkList[Index] != 0) {
1868 HiddenNetwork = NET_LIST_USER_STRUCT_S (Entry, WIFI_HIDDEN_NETWORK_DATA, Link, WIFI_MGR_HIDDEN_NETWORK_SIGNATURE);
1869 Entry = RemoveEntryList (Entry);
1870 RemoveCount++;
1871
1872 FreePool (HiddenNetwork);
1873 } else {
1874 Entry = GetNextNode (&Private->HiddenNetworkList, Entry);
1875 }
1876 }
1877
1878 Private->HiddenNetworkCount -= RemoveCount;
1879 WifiMgrRefreshHiddenList (Private);
1880 break;
1881
1882 default:
1883
1884 if ((QuestionId >= KEY_MAC_ENTRY_BASE) && (QuestionId < KEY_MAC_ENTRY_BASE + Private->NicCount)) {
1885 //
1886 // User selects a wireless NIC.
1887 //
1888 Status = WifiMgrSelectNic (Private, QuestionId);
1889 if (EFI_ERROR (Status)) {
1890 CreatePopUp (
1891 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1892 &Key,
1893 L"ERROR: Fail to operate the wireless NIC!",
1894 NULL
1895 );
1896 }
1897 } else if (Private->CurrentNic != NULL) {
1898 if ((QuestionId >= KEY_AVAILABLE_NETWORK_ENTRY_BASE) &&
1899 (QuestionId <= KEY_AVAILABLE_NETWORK_ENTRY_BASE + Private->CurrentNic->MaxProfileIndex))
1900 {
1901 Status = WifiMgrUserSelectProfileToConnect (Private, QuestionId - KEY_AVAILABLE_NETWORK_ENTRY_BASE);
1902 if (!EFI_ERROR (Status)) {
1903 WifiMgrUpdateConnectMessage (Private->CurrentNic, FALSE, NULL);
1904 }
1905 }
1906
1907 if (EFI_ERROR (Status)) {
1908 CreatePopUp (
1909 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1910 &Key,
1911 L"ERROR: Fail to operate this profile!",
1912 NULL
1913 );
1914 }
1915 }
1916
1917 break;
1918 }
1919 } else if (Action == EFI_BROWSER_ACTION_CHANGED) {
1920 switch (QuestionId) {
1921 case KEY_SAVE_CERT_TO_MEM:
1922 case KEY_SAVE_PRIVATE_KEY_TO_MEM:
1923
1924 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
1925 break;
1926
1927 case KEY_NO_SAVE_CERT_TO_MEM:
1928 case KEY_NO_SAVE_PRIVATE_KEY_TO_MEM:
1929
1930 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
1931 break;
1932
1933 default:
1934
1935 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
1936 break;
1937 }
1938 } else if (Action == EFI_BROWSER_ACTION_RETRIEVE) {
1939 switch (QuestionId) {
1940 case KEY_REFRESH_NETWORK_LIST:
1941
1942 WifiMgrRefreshNetworkList (Private, IfrNvData);
1943 break;
1944
1945 default:
1946 break;
1947 }
1948 }
1949
1950 if (!EFI_ERROR (Status) && (Action != EFI_BROWSER_ACTION_FORM_OPEN)) {
1951 //
1952 // Pass changed uncommitted data back to Form Browser.
1953 //
1954 BufferSize = sizeof (WIFI_MANAGER_IFR_NVDATA);
1955 HiiSetBrowserData (&gWifiConfigFormSetGuid, mVendorStorageName, BufferSize, (UINT8 *)IfrNvData, NULL);
1956 }
1957
1958 ZeroMem (IfrNvData, sizeof (WIFI_MANAGER_IFR_NVDATA));
1959 FreePool (IfrNvData);
1960 return Status;
1961}
1962
1976 WIFI_MGR_PRIVATE_DATA *Private
1977 )
1978{
1979 EFI_STATUS Status;
1980
1981 if (Private == NULL) {
1982 return EFI_INVALID_PARAMETER;
1983 }
1984
1985 Private->ConfigAccess.ExtractConfig = WifiMgrDxeHiiConfigAccessExtractConfig;
1986 Private->ConfigAccess.RouteConfig = WifiMgrDxeHiiConfigAccessRouteConfig;
1987 Private->ConfigAccess.Callback = WifiMgrDxeHiiConfigAccessCallback;
1988
1989 //
1990 // Install Device Path Protocol and Config Access protocol to driver handle.
1991 //
1992 Status = gBS->InstallMultipleProtocolInterfaces (
1993 &Private->DriverHandle,
1994 &gEfiDevicePathProtocolGuid,
1995 &mWifiMgrDxeHiiVendorDevicePath,
1996 &gEfiHiiConfigAccessProtocolGuid,
1997 &Private->ConfigAccess,
1998 NULL
1999 );
2000 if (EFI_ERROR (Status)) {
2001 return Status;
2002 }
2003
2004 //
2005 // Publish our HII data.
2006 //
2007 Private->RegisteredHandle = HiiAddPackages (
2008 &gWifiConfigFormSetGuid,
2009 Private->DriverHandle,
2010 WifiConnectionManagerDxeStrings,
2011 WifiConnectionManagerDxeBin,
2012 NULL
2013 );
2014 if (Private->RegisteredHandle == NULL) {
2015 gBS->UninstallMultipleProtocolInterfaces (
2016 Private->DriverHandle,
2017 &gEfiDevicePathProtocolGuid,
2018 &mWifiMgrDxeHiiVendorDevicePath,
2019 &gEfiHiiConfigAccessProtocolGuid,
2020 &Private->ConfigAccess,
2021 NULL
2022 );
2023 return EFI_OUT_OF_RESOURCES;
2024 }
2025
2026 Private->FileContext = AllocateZeroPool (sizeof (WIFI_MGR_FILE_CONTEXT));
2027 if (Private->FileContext == NULL) {
2028 return EFI_OUT_OF_RESOURCES;
2029 }
2030
2031 return EFI_SUCCESS;
2032}
2033
2046 WIFI_MGR_PRIVATE_DATA *Private
2047 )
2048{
2049 EFI_STATUS Status;
2050
2051 if (Private == NULL) {
2052 return EFI_INVALID_PARAMETER;
2053 }
2054
2055 if (Private->FileContext != NULL) {
2056 if (Private->FileContext->FHandle != NULL) {
2057 Private->FileContext->FHandle->Close (Private->FileContext->FHandle);
2058 }
2059
2060 if (Private->FileContext->FileName != NULL) {
2061 FreePool (Private->FileContext->FileName);
2062 }
2063
2064 FreePool (Private->FileContext);
2065 }
2066
2067 HiiRemovePackages (Private->RegisteredHandle);
2068
2069 Status = gBS->UninstallMultipleProtocolInterfaces (
2070 Private->DriverHandle,
2071 &gEfiDevicePathProtocolGuid,
2072 &mWifiMgrDxeHiiVendorDevicePath,
2073 &gEfiHiiConfigAccessProtocolGuid,
2074 &Private->ConfigAccess,
2075 NULL
2076 );
2077
2078 return Status;
2079}
UINT64 UINTN
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
Definition: SafeString.c:226
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
Definition: LinkedList.c:333
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
Definition: String.c:109
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
Definition: LinkedList.c:298
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
Definition: LinkedList.c:590
RETURN_STATUS EFIAPI StrnCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
Definition: SafeString.c:310
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
Definition: String.c:30
CHAR16 *EFIAPI StrStr(IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString)
Definition: String.c:224
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
Definition: LinkedList.c:259
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define HARDWARE_DEVICE_PATH
Definition: DevicePath.h:68
#define HW_VENDOR_DP
Definition: DevicePath.h:133
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
EFI_STATUS EFIAPI ChooseFile(IN EFI_DEVICE_PATH_PROTOCOL *RootDirectory, IN CHAR16 *FileType OPTIONAL, IN CHOOSE_HANDLER ChooseHandler OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **File OPTIONAL)
EFI_STRING EFIAPI HiiConstructConfigHdr(IN CONST EFI_GUID *Guid OPTIONAL, IN CONST CHAR16 *Name OPTIONAL, IN EFI_HANDLE DriverHandle)
Definition: HiiLib.c:723
BOOLEAN EFIAPI HiiGetBrowserData(IN CONST EFI_GUID *VariableGuid OPTIONAL, IN CONST CHAR16 *VariableName OPTIONAL, IN UINTN BufferSize, OUT UINT8 *Buffer)
Definition: HiiLib.c:2872
UINT8 *EFIAPI HiiCreateGotoOpCode(IN VOID *OpCodeHandle, IN EFI_FORM_ID FormId, IN EFI_STRING_ID Prompt, IN EFI_STRING_ID Help, IN UINT8 QuestionFlags, IN EFI_QUESTION_ID QuestionId)
Definition: HiiLib.c:3551
VOID *EFIAPI HiiAllocateOpCodeHandle(VOID)
Definition: HiiLib.c:3051
VOID EFIAPI HiiFreeOpCodeHandle(VOID *OpCodeHandle)
Definition: HiiLib.c:3085
EFI_HII_HANDLE EFIAPI HiiAddPackages(IN CONST EFI_GUID *PackageListGuid, IN EFI_HANDLE DeviceHandle OPTIONAL,...)
Definition: HiiLib.c:141
UINT8 *EFIAPI HiiCreateGuidOpCode(IN VOID *OpCodeHandle, IN CONST EFI_GUID *Guid, IN CONST VOID *GuidOpCode OPTIONAL, IN UINTN OpCodeSize)
Definition: HiiLib.c:3411
UINT8 *EFIAPI HiiCreateCheckBoxOpCode(IN VOID *OpCodeHandle, IN EFI_QUESTION_ID QuestionId, IN EFI_VARSTORE_ID VarStoreId, IN UINT16 VarOffset, IN EFI_STRING_ID Prompt, IN EFI_STRING_ID Help, IN UINT8 QuestionFlags, IN UINT8 CheckBoxFlags, IN VOID *DefaultsOpCodeHandle OPTIONAL)
Definition: HiiLib.c:3675
BOOLEAN EFIAPI HiiSetBrowserData(IN CONST EFI_GUID *VariableGuid OPTIONAL, IN CONST CHAR16 *VariableName OPTIONAL, IN UINTN BufferSize, IN CONST UINT8 *Buffer, IN CONST CHAR16 *RequestElement OPTIONAL)
Definition: HiiLib.c:2954
EFI_STRING EFIAPI HiiGetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
Definition: HiiString.c:211
EFI_STATUS EFIAPI HiiUpdateForm(IN EFI_HII_HANDLE HiiHandle, IN EFI_GUID *FormSetGuid OPTIONAL, IN EFI_FORM_ID FormId, IN VOID *StartOpCodeHandle, IN VOID *EndOpCodeHandle OPTIONAL)
Definition: HiiLib.c:4410
BOOLEAN EFIAPI HiiIsConfigHdrMatch(IN CONST EFI_STRING ConfigHdr, IN CONST EFI_GUID *Guid OPTIONAL, IN CONST CHAR16 *Name OPTIONAL)
Definition: HiiLib.c:2813
EFI_STRING_ID EFIAPI HiiSetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId OPTIONAL, IN CONST EFI_STRING String, IN CONST CHAR8 *SupportedLanguages OPTIONAL)
Definition: HiiString.c:52
UINT8 *EFIAPI HiiCreateTextOpCode(IN VOID *OpCodeHandle, IN EFI_STRING_ID Prompt, IN EFI_STRING_ID Help, IN EFI_STRING_ID TextTwo)
Definition: HiiLib.c:4037
VOID EFIAPI HiiRemovePackages(IN EFI_HII_HANDLE HiiHandle)
Definition: HiiLib.c:253
#define EFI_IFR_EXTEND_OP_LABEL
Definition: MdeModuleHii.h:33
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
Definition: PrintLib.c:408
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define GLOBAL_REMOVE_IF_UNREFERENCED
Definition: Base.h:48
#define DEBUG(Expression)
Definition: DebugLib.h:434
BOOLEAN EFIAPI UpdateCAFromFile(IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
VOID EFIAPI Exit(IN EFI_STATUS Status)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
UINTN EFI_TPL
Definition: UefiBaseType.h:41
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
EFI_HII_CONFIG_ROUTING_PROTOCOL * gHiiConfigRouting
#define STRING_TOKEN(t)
VOID EFIAPI CreatePopUp(IN UINTN Attribute, OUT EFI_INPUT_KEY *Key OPTIONAL,...)
Definition: Console.c:393
BOOLEAN UpdatePrivateKeyFromFile(IN WIFI_MGR_PRIVATE_DATA *Private, IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
EFI_STATUS WifiMgrShowNicList(IN WIFI_MGR_PRIVATE_DATA *Private)
EFI_STATUS WifiMgrRefreshHiddenList(IN WIFI_MGR_PRIVATE_DATA *Private)
EFI_STATUS EFIAPI WifiMgrDxeHiiConfigAccessRouteConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
EFI_STATUS WifiMgrRecordPassword(IN WIFI_MGR_PRIVATE_DATA *Private, IN EFI_STRING_ID StringId, IN CHAR16 *StringBuffer, IN UINTN StringBufferLen)
CHAR16 * WifiMgrGetStrCipherList(IN WIFI_MGR_NETWORK_PROFILE *Profile)
VOID WifiMgrUpdateConnectMessage(IN WIFI_MGR_DEVICE_DATA *Nic, IN BOOLEAN ConnectStateChanged, IN EFI_STRING ConnectStatusMessage)
EFI_STATUS WifiMgrCreateOpCode(IN UINT16 StartLabelNumber, OUT VOID **StartOpCodeHandle, OUT VOID **EndOpCodeHandle)
CHAR16 * WifiMgrGetStrAKMList(IN WIFI_MGR_NETWORK_PROFILE *Profile)
EFI_STATUS WifiMgrDxeConfigFormInit(WIFI_MGR_PRIVATE_DATA *Private)
EFI_STATUS WifiMgrSelectNic(IN WIFI_MGR_PRIVATE_DATA *Private, IN EFI_QUESTION_ID KeyValue)
EFI_STATUS WifiMgrRefreshNetworkList(IN WIFI_MGR_PRIVATE_DATA *Private, OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData)
EFI_STATUS EFIAPI WifiMgrDxeHiiConfigAccessExtractConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
EFI_STATUS WifiMgrDxeConfigFormUnload(WIFI_MGR_PRIVATE_DATA *Private)
VOID WifiMgrCleanUserInput(IN WIFI_MGR_PRIVATE_DATA *Private)
EFI_STATUS WifiMgrConvertIfrNvDataToConfigData(IN WIFI_MGR_PRIVATE_DATA *Private, IN OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData)
EFI_STATUS EFIAPI WifiMgrDxeHiiConfigAccessCallback(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN OUT EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
EFI_STATUS WifiMgrConvertConfigDataToIfrNvData(IN WIFI_MGR_PRIVATE_DATA *Private, OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData)
EFI_STATUS WifiMgrUserSelectProfileToConnect(IN WIFI_MGR_PRIVATE_DATA *Private, IN UINT32 ProfileIndex)
WIFI_MGR_DEVICE_DATA * WifiMgrGetNicByIndex(IN WIFI_MGR_PRIVATE_DATA *Private, IN UINT32 NicIndex)
WIFI_MGR_NETWORK_PROFILE * WifiMgrGetProfileByProfileIndex(IN UINT32 ProfileIndex, IN LIST_ENTRY *ProfileList)
EFI_STATUS WifiMgrReadFileToBuffer(IN WIFI_MGR_FILE_CONTEXT *FileContext, OUT VOID **DataAddr, OUT UINTN *DataSize)
VOID WifiMgrMacAddrToStr(IN EFI_80211_MAC_ADDRESS *Mac, IN UINT32 StrSize, OUT CHAR16 *Str)
VOID WifiMgrCleanProfileSecrets(IN WIFI_MGR_NETWORK_PROFILE *Profile)
Definition: Base.h:213