diff options
author | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
---|---|---|
committer | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
commit | b7c51c9cf4864df6aabb99a1ae843becd577237c (patch) | |
tree | eebe9b0d0ca03062955223097e57da84dd618b9a /Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen | |
download | zprj-b7c51c9cf4864df6aabb99a1ae843becd577237c.tar.xz |
Diffstat (limited to 'Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen')
7 files changed, 540 insertions, 0 deletions
diff --git a/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.c b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.c new file mode 100644 index 0000000..c28650d --- /dev/null +++ b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.c @@ -0,0 +1,93 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/BIN/Modules/Network/UEFINetworkStack II/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.c 3 6/09/14 4:10a Anushav $Revision: +// +// $Date: +//********************************************************************** +// Revision History +// ---------------- +// +//********************************************************************** + +#include <AmiDxeLib.h> +#include <NetworkStackSetupScreen.h> + +NETWORK_STACK mNetworkStackData; +EFI_GUID mNetworkStackGuid = NETWORK_STACK_GUID; + + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: InitNetworkStackVar +// +// Description: Entry point of the network stack setup driver. This entry point is +// necessary to initlialize the NetworkStack setup driver. +// +// Input: +// ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver +// SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table +// +// Output: +// EFI_SUCCESS: Driver initialized successfully +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +EFI_STATUS InitNetworkStackVar ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + + UINTN Size; + EFI_STATUS Status; + + InitAmiLib(ImageHandle,SystemTable); + + Size = sizeof(NETWORK_STACK); + Status = pRS->GetVariable(L"NetworkStackVar",&mNetworkStackGuid, NULL, &Size, &mNetworkStackData); + + if (Status == EFI_NOT_FOUND) { + + pBS->SetMem(&mNetworkStackData, + sizeof(NETWORK_STACK), + 0); + + pRS->SetVariable( + L"NetworkStackVar",&mNetworkStackGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, + sizeof(NETWORK_STACK), &mNetworkStackData + ); + + } + + return EFI_SUCCESS; + +} + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + diff --git a/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.cif b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.cif new file mode 100644 index 0000000..27b98c2 --- /dev/null +++ b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.cif @@ -0,0 +1,13 @@ +<component> + name = "NetworkStackSetupScreen" + category = ModulePart + LocalRoot = "Core\EM\UEfiNetworkStack\Common\NetworkStackSetupScreen\" + RefName = "NetworkStackSetupScreen" +[files] +"NetworkStackSetupScreen.sdl" +"NetworkStackSetupScreen.mak" +"NetworkStackSetupScreen.uni" +"NetworkStackSetupScreen.h" +"NetworkStackSetupScreen.sd" +"NetworkStackSetupScreen.c" +<endComponent> diff --git a/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.h b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.h new file mode 100644 index 0000000..a8a3470 --- /dev/null +++ b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.h @@ -0,0 +1,82 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Modules/Network/UEFINetworkStack II/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.h 7 1/08/14 5:27a Anushav $ +// +// $Revision: 7 $ +// +// $Date: 1/08/14 5:27a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/Network/UEFINetworkStack II/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.h $ +// +// 7 1/08/14 5:27a Anushav +// [TAG] EIP148764 +// [Category] Improvement +// [Description] Add Media Detect Time setup option. +// [Files] PxeBcImpl.c, +// PxeBcDriver.c, +// NetworkStackSetupScreen.uni, +// NetworkStackSetupScreen.sd, +// NetworkStackSetup.h, +// NetworkStackSetupScreen.c. +// +// 6 3/01/13 3:29a Nareshk +// [TAG]-EIP113577 +// [Category]-IMPROVEMENT +// [Description]-Support to Handle ESC key to abort PXE boot. +// [Files]-SnpDxe.efi, SnpDxeIa32.efi, UefiPxeBcDxe.efi, +// UefiPxeBcDxeIa32.efi, NetworkStackSetupScreen.h, +// NetworkStackSetupScreen.sd and NetworkStackSetupScreen.uni +// +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: NetworkStackSetupScreen.h +// +// Description: Network stack setup data structure definintion +// +//<AMI_FHDR_END> +//********************************************************************** + +#pragma pack (1) +typedef struct{ + UINT8 Enable; + UINT8 Ipv4Pxe; + UINT8 Ipv6Pxe; + UINT8 IpsecCertificate; + UINT8 PxeBootWaitTime; + UINT8 MediaDetectTime; +} NETWORK_STACK; +#pragma pack () + +#define NETWORK_STACK_GUID \ + { 0xD1405D16, 0x7AFC, 0x4695, 0xBB, 0x12, 0x41, 0x45, 0x9D, 0x36, 0x95, 0xA2 } + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.mak b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.mak new file mode 100644 index 0000000..90b57a2 --- /dev/null +++ b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.mak @@ -0,0 +1,68 @@ +# #**********************************************************************# +#**********************************************************************# +#** **# +#** (C)Copyright 1985-2008, American Megatrends, Inc. **# +#** **# +#** All Rights Reserved. **# +#** **# +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 **# +#** **# +#** Phone: (770)-246-8600 **# +#** **# +#**********************************************************************# +#**********************************************************************# +#**********************************************************************# +# $Header: /Alaska/BIN/Modules/Network/UEFINetworkStack II/COMMON/NetworkStackSetupScreen/NetworkStackSetupScreen.mak 1 6/02/11 11:47a Hari $ +# +# $Revision: 1 $ +# +# $Date: 6/02/11 11:47a $(BUILD_DIR)\NetworkStackSetupScreen.mak NETWORKSTACKSETUPSCREENSDB +#**********************************************************************# +# Revision History +# ---------------- + +#<AMI_FHDR_START> +#--------------------------------------------------------------------------- +# Name: NetworkStackSetupScreen.mak +# +# Description: Make file for the NetworkStackSetupScreen component +# +#--------------------------------------------------------------------------- +#<AMI_FHDR_END> +all : NetworkStackSetupScreen + +NetworkStackSetupScreen : $(BUILD_DIR)\NetworkStackSetupScreen.mak NetworkStackSetupScreenBin + +SetupSdbs : $(BUILD_DIR)\NetworkStackSetupScreen.mak NETWORKSTACKSETUPSCREENSDB + +$(BUILD_DIR)\NetworkStackSetupScreen.mak : $(NETWORK_STACK_SETUP_SCREEN_DIR)\NetworkStackSetupScreen.cif $(NETWORK_STACK_SETUP_SCREEN_DIR)\NetworkStackSetupScreen.mak $(BUILD_RULES) + $(CIF2MAK) $(NETWORK_STACK_SETUP_SCREEN_DIR)\NetworkStackSetupScreen.cif $(CIF2MAK_DEFAULTS) + +NETWORKSTACKSETUPSCREENSDB : + copy $(NETWORK_STACK_SETUP_SCREEN_DIR)\NetworkStackSetupScreen.h $(BUILD_DIR) + $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\ + /f $(BUILD_DIR)\NetworkStackSetupScreen.mak all\ + TYPE=SDB NAME=NETWORKSTACKSETUPSCREEN MAKEFILE=$(BUILD_DIR)\NetworkStackSetupScreen.mak STRING_CONSUMERS=$(NETWORK_STACK_SETUP_SCREEN_DIR)\NetworkStackSetupScreen.sd + +NetworkStackSetupScreenBin : $(AMIDXELIB) + copy $(NETWORK_STACK_SETUP_SCREEN_DIR)\NetworkStackSetupScreen.h $(BUILD_DIR) + $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\ + /f $(BUILD_DIR)\NetworkStackSetupScreen.mak all\ + GUID=0029DE6A-E024-4eb8-A91D-9F23AA1F4E92\ + ENTRY_POINT=InitNetworkStackVar\ + TYPE=BS_DRIVER\ + COMPRESS=1 + +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2008, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** diff --git a/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.sd b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.sd new file mode 100644 index 0000000..925984e --- /dev/null +++ b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.sd @@ -0,0 +1,246 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2014, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Modules/Network/UEFINetworkStack II/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.sd 8 6/04/14 10:26a Anushav $ +// +// $Revision: 8 $ +// +// $Date: 6/04/14 10:26a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/Network/UEFINetworkStack II/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.sd $ +// +// 8 6/04/14 10:26a Anushav +// [TAG] EIP147413 +// [Category] Improvement +// [Description] Conversion of NetworkStackSetupScreen.sd to the new +// setup format. +// [Files] NetworkStackSetupScreen.sd +// +// 7 1/08/14 5:28a Anushav +// [TAG] EIP148764 +// [Category] Improvement +// [Description] Add Media Detect Time setup option. +// [Files] PxeBcImpl.c, +// PxeBcDriver.c, +// NetworkStackSetupScreen.uni, +// NetworkStackSetupScreen.sd, +// NetworkStackSetup.h, +// NetworkStackSetupScreen.c. +// +// 6 3/01/13 3:30a Nareshk +// [TAG]-EIP113577 +// [Category]-IMPROVEMENT +// [Description]-Support to Handle ESC key to abort PXE boot. +// [Files]-SnpDxe.efi, SnpDxeIa32.efi, UefiPxeBcDxe.efi, +// UefiPxeBcDxeIa32.efi, NetworkStackSetupScreen.h, +// NetworkStackSetupScreen.sd and NetworkStackSetupScreen.uni +// +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: NetworkStackSetupScreen.sd +// +// Description: Setup definitions for NetworkStack setup screen +// +//<AMI_FHDR_END> +//********************************************************************** + +//********************************************************************** +// Compatibility Section +//********************************************************************** + +#if defined(VFRCOMPILE) && !defined(CONTROLS_ARE_DEFINED) + #define CONTROL_DEFINITION +#endif + +//********************************************************************** +// Controls Section +// +// The following section contains control macros that can be overridden +// in external files. This allows customization of control content, +// while ensuring the control's data is available. +//********************************************************************** + +#ifdef CONTROL_DEFINITION + #define NETWORKSTACK_ONEOF_NETWORK_STACK_SUPPORT \ + oneof varid = NETWORK_STACK.Enable,\ + prompt = STRING_TOKEN(STR_NETWORK_STACK_ENABLE),\ + help = STRING_TOKEN(STR_NETWORK_STACK_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value=0, flags= DEFAULT | RESET_REQUIRED;\ + option text = STRING_TOKEN(STR_ENABLED), value=1, flags= 0 | RESET_REQUIRED;\ + endoneof; + + #if UefiIpv4StackII_SUPPORT == 1 + #define NETWORKSTACK_ONEOF_IPV4_PXE_SUPPORT \ + oneof varid = NETWORK_STACK.Ipv4Pxe,\ + prompt = STRING_TOKEN(STR_IPV4_PXE_ENABLE),\ + help = STRING_TOKEN(STR_IPV4_PXE_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value=0, flags= RESET_REQUIRED;\ + option text = STRING_TOKEN(STR_ENABLED), value=1, flags= DEFAULT | RESET_REQUIRED;\ + endoneof; + #endif + + #if UefiIpv6StackII_SUPPORT == 1 + #define NETWORKSTACK_ONEOF_IPV6_PXE_SUPPORT \ + oneof varid = NETWORK_STACK.Ipv6Pxe,\ + prompt = STRING_TOKEN(STR_IPV6_PXE_ENABLE),\ + help = STRING_TOKEN(STR_IPV6_PXE_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value=0, flags= RESET_REQUIRED;\ + option text = STRING_TOKEN(STR_ENABLED), value=1, flags= DEFAULT | RESET_REQUIRED;\ + endoneof; + #endif + + #if IpSec_SUPPORT == 1 + #define NETWORKSTACK_ONEOF_IPSEC_CERTIFICATE \ + oneof varid = NETWORK_STACK.IpsecCertificate,\ + prompt = STRING_TOKEN(STR_IPSEC_CERTIFICATE_ENABLE),\ + help = STRING_TOKEN(STR_IPSEC_CERTIFICATE_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value=0, flags= RESET_REQUIRED;\ + option text = STRING_TOKEN(STR_ENABLED), value=1, flags= DEFAULT | RESET_REQUIRED;\ + endoneof; + #endif + + #if UefiPxeBc_SUPPORT == 1 + #define NETWORKSTACK_NUMERIC_PXE_BOOT_WAIT_TIME \ + numeric varid = NETWORK_STACK.PxeBootWaitTime,\ + prompt = STRING_TOKEN(STR_PXE_BOOT_WAIT_TIME),\ + help = STRING_TOKEN(STR_PXE_BOOT_WAIT_TIME_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 5,\ + step = 1,\ + default = 0,\ + endnumeric; + + #define NETWORKSTACK_NUMERIC_MEDIA_DETECT_TIME \ + numeric varid = NETWORK_STACK.MediaDetectTime,\ + prompt = STRING_TOKEN(STR_MEDIA_DETECT_TIME),\ + help = STRING_TOKEN(STR_MEDIA_DETECT_TIME_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 50,\ + step = 1,\ + default = 0,\ + endnumeric; + #endif +#endif //#ifdef CONTROL_DEFINITION + +//********************************************************************** +// ADVANCED - Network Stack Configuration Form +//********************************************************************** + +#ifdef ADVANCED_FORM_SET + +#ifdef CONTROLS_WITH_DEFAULTS + NETWORKSTACK_ONEOF_NETWORK_STACK_SUPPORT + #if UefiIpv4StackII_SUPPORT == 1 + NETWORKSTACK_ONEOF_IPV4_PXE_SUPPORT + #endif + #if UefiIpv6StackII_SUPPORT == 1 + NETWORKSTACK_ONEOF_IPV6_PXE_SUPPORT + #endif + #if IpSec_SUPPORT == 1 + NETWORKSTACK_ONEOF_IPSEC_CERTIFICATE + #endif + #if UefiPxeBc_SUPPORT == 1 + NETWORKSTACK_NUMERIC_PXE_BOOT_WAIT_TIME + NETWORKSTACK_NUMERIC_MEDIA_DETECT_TIME + #endif +#endif //#ifdef CONTROLS_WITH_DEFAULTS + +#ifdef FORM_SET_TYPEDEF +#include <NetworkStackSetupScreen.h> +#endif + + +#ifdef FORM_SET_VARSTORE + varstore NETWORK_STACK, + key = AUTO_ID(NETWORK_STACK_KEY_ID), + name = NetworkStackVar, + guid = NETWORK_STACK_GUID; +#endif + +#ifdef FORM_SET_GOTO +// Define goto commands for the forms defined in this file + goto STACK_FORM_ID, + prompt = STRING_TOKEN(STR_STACK_FORM), + help = STRING_TOKEN(STR_STACK_FORM_HELP); +#endif + + +#ifdef FORM_SET_FORM +// Define forms + #ifndef NETWORK_STACK_FORM_SETUP + #define NETWORK_STACK_FORM_SETUP + + form formid = AUTO_ID(STACK_FORM_ID), + title = STRING_TOKEN(STR_STACK_FORM); + + NETWORKSTACK_ONEOF_NETWORK_STACK_SUPPORT + +#if UefiIpv4StackII_SUPPORT == 1 + + suppressif ideqval NETWORK_STACK.Enable == 0; + NETWORKSTACK_ONEOF_IPV4_PXE_SUPPORT + endif; +#endif + +#if UefiIpv6StackII_SUPPORT == 1 + suppressif ideqval NETWORK_STACK.Enable == 0; + NETWORKSTACK_ONEOF_IPV6_PXE_SUPPORT + endif; +#endif + + +#if IpSec_SUPPORT == 1 + suppressif ideqval NETWORK_STACK.Enable == 0; + NETWORKSTACK_ONEOF_IPSEC_CERTIFICATE + endif; +#endif + +#if UefiPxeBc_SUPPORT == 1 + + suppressif ideqval NETWORK_STACK.Enable == 0; + NETWORKSTACK_NUMERIC_PXE_BOOT_WAIT_TIME + endif; + + suppressif ideqval NETWORK_STACK.Enable == 0; + NETWORKSTACK_NUMERIC_MEDIA_DETECT_TIME + endif; +#endif // #if UefiPxeBc_SUPPORT == 1 + + endform; + #endif // NETWORK_STACK_FORM_SETUP +#endif // #ifdef FORM_SET_GOTO + +#endif // ADVANCED_FORM_SET + + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2014, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.sdl b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.sdl new file mode 100644 index 0000000..e8a1995 --- /dev/null +++ b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.sdl @@ -0,0 +1,38 @@ +TOKEN + Name = NetworkStackSetupScreen_SUPPORT + Value = "1" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes + Help = "Main switch to enable NetworkStackSetupScreen support in Project" +End + +MODULE + Help = "Includes NetworkStackSetupScreen.mak to Project" + File = "NetworkStackSetupScreen.mak" +End + +PATH + Name = "NETWORK_STACK_SETUP_SCREEN_DIR" +End + +ELINK + Name = "$(BUILD_DIR)\NetworkStackSetupScreen.ffs" + Parent = "FV_MAIN" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(BUILD_DIR)\NetworkStackSetupScreen.sdb" + Parent = "SETUP_SDBS" + Priority = 254 + InvokeOrder = AfterParent +End + +ELINK + Name = "$(NETWORK_STACK_SETUP_SCREEN_DIR)\NetworkStackSetupScreen.sd" + Parent = "SETUP_DEFINITIONS" + Priority = 254 + InvokeOrder = AfterParent +End diff --git a/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.uni b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.uni Binary files differnew file mode 100644 index 0000000..a15a050 --- /dev/null +++ b/Core/EM/UEfiNetworkStack/Common/NetworkStackSetupScreen/NetworkStackSetupScreen.uni |