summaryrefslogtreecommitdiff
path: root/Core/EM/usb/setup
diff options
context:
space:
mode:
authorraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
committerraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
commitb7c51c9cf4864df6aabb99a1ae843becd577237c (patch)
treeeebe9b0d0ca03062955223097e57da84dd618b9a /Core/EM/usb/setup
downloadzprj-master.tar.xz
init. 1AQQW051HEADmaster
Diffstat (limited to 'Core/EM/usb/setup')
-rw-r--r--Core/EM/usb/setup/usb.sd1256
-rw-r--r--Core/EM/usb/setup/usb.unibin0 -> 19750 bytes
-rw-r--r--Core/EM/usb/setup/usbsetup.c804
-rw-r--r--Core/EM/usb/setup/usbsetup.cif10
4 files changed, 2070 insertions, 0 deletions
diff --git a/Core/EM/usb/setup/usb.sd b/Core/EM/usb/setup/usb.sd
new file mode 100644
index 0000000..89aeffe
--- /dev/null
+++ b/Core/EM/usb/setup/usb.sd
@@ -0,0 +1,1256 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Setup/usb.sd 48 12/24/14 10:40p Wilsonlee $
+//
+// $Revision: 48 $
+//
+// $Date: 12/24/14 10:40p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/USB/ALASKA/Setup/usb.sd $
+//
+// 48 12/24/14 10:40p Wilsonlee
+// [TAG] EIP196287
+// [Category] Improvement
+// [Description] Display info of connected usb controllers and remove or
+// grayed-out some item according the connected usb controller number.
+// [Files] uhcd.c, usbport.c, usb.uni, usb.sd, usbsetup.c,
+// AmiUsbController.h, UsbPolicy.h
+//
+// 47 12/23/14 10:27p Wilsonlee
+// [TAG] EIP196897
+// [Category] Improvement
+// [Description] Hide USB legacy support setup question if
+// USB_RUNTIME_DRIVER_IN_SMM is 0.
+// [Files] usb.sd
+//
+// 46 12/17/14 9:18p Wilsonlee
+// [TAG] EIP196712
+// [Category] Improvement
+// [Description] Change usb form definition to USB_FORM _USB.
+// [Files] usb.sd
+//
+// 45 11/23/14 10:30p Wilsonlee
+// [TAG] EIP190205
+// [Category] Improvement
+// [Description] Add the token "DEFAULT_XHCI_HANDOFF_OPTION" that
+// controls the default value of the XHCI Hand-off option.
+// [Files] usb.sdl, usb.sd
+//
+// 44 7/28/14 11:25p Wilsonlee
+// [TAG] EIP176898
+// [Category] Improvement
+// [Description] Use suppressif TRUE to hide the setup item.
+// [Files] usb.sd
+//
+// 43 4/29/14 10:23p Wilsonlee
+// [TAG] EIP161709
+// [Category] New Feature
+// [Description] Dynamically update the usb device list in BIOS setup.
+// [Files] usb.sdl, usb.sd, usbsetup.c, uhcd.c
+//
+// 42 10/20/13 10:33p Wilsonlee
+// [TAG] EIP138258
+// [Category] New Feature
+// [Description] Change option name "USB3.0 Support" to "XHCI Legacy
+// Support" and add the token
+// "HIDE_USB_XHCI_LEGACY_SUPPORT_SETUP_QUESTION" to switch to hide/Un-hide
+// USB XHCI Legacy Support setup question.
+// [Files] usb.sd, usb.uni, usb.sdl
+//
+// 41 5/27/13 2:21a Ryanchou
+// [TAG] EIP122407
+// [Category] Improvement
+// [Description] Move the USB varstore out ADVANCED_FORM_SET definition
+// check.
+// [Files] usb.sd
+//
+// 40 4/16/13 11:08a Ryanchou
+// Fix compile error if toke EFI_SPECIFICATION_VERSION greater than
+// 0x2000.
+//
+// 39 3/19/13 4:03a Ryanchou
+// [TAG] EIP118177
+// [Category] Improvement
+// [Description] Dynamically allocate HCStrucTable at runtime.
+// [Files] usb.sdl, usbport.c, usbsb.c, amiusb.c, ehci.c, ohci.c,
+// syskbc.c, sysnokbc.c, uhci.c, usb.c, usbCCID.c, usbdef.h, usbhid.c,
+// usbhub.c, usbmass.c, usbrt.mak, usb.sd, amiusbhc.c, efiusbccid.c,
+// efiusbhid.c, efiusbmass.c, efiusbms.c, uhcd.c, uhcd.h, uhcd.mak,
+// usbmisc.c, usbsrc.sdl
+//
+// 38 1/11/13 4:25a Ryanchou
+// [TAG] EIP102491
+// [Category] Improvement
+// [Description] Synchronized with Aptio V USB module
+// [Files] usbport.c, usbsb.c, ehci.c, ehci.h, ohci.c, ohci.h, uhci.h,
+// usb.c, usbdef.h, usbhid.c, usbhub.c, usbkbd.c, usbkbd.h, usbmass.c.
+// usbms.c, usbpoint.c, xhci.h, usb.sd, amiusbhc.c, componentname.c,
+// efiusbkc.c, efiusbmass.c, uhcd.c, uhcd.h, usbbus.c, usbbus.h, usbmisc.c
+//
+// 37 12/21/12 5:04a Ryanchou
+// [TAG] EIP71730
+// [Category] New Feature
+// [Description] Added OHCI handoff support.
+// [Files] usb.sdl, usbport.c, amiusb.c, usbdef.h, UsbPolicy.h, usb.sd,
+// usb.uni
+//
+// 36 10/25/12 1:38a Wilsonlee
+// [TAG] EIP102493
+// [Category] New Feature
+// [Description] USB Module version is added to the setup page.
+// [Files] usbsetup.c, usb.sd, usb.uni
+//
+// 35 9/04/12 8:02a Wilsonlee
+// [TAG] EIP99882
+// [Category] New Feature
+// [Description] Add the usb setup item and usbpolicyprotocol to enable
+// or disable the usb mass storage driver.
+// [Files] UsbPolicy.h, usb.uni, usb.sd, usbmass.c, usbdef.h,
+// efiusbmass.c, usbport.c, uhcd.c
+//
+// 34 8/07/12 9:38p Wilsonlee
+// [TAG] EIP96366
+// [Category] New Feature
+// [Description] Add the token "DEFAULT_USB_EMUL6064_OPTION" that
+// control the default value of the I/O port 60h/64h emulation support
+// option.
+// [Files] usb.sd, usb.sdl, amiusb.c, amiusb.h
+//
+// 33 7/12/12 2:35a Roberthsu
+// [TAG] EIP93460
+// [Category] Improvement
+// [Description] Add token decide mass available under efi application
+// when legacy support disabled.
+// [Files] usb.sd,usb.uni,usbmass.c,usbsrc.sdl
+//
+// 32 5/04/12 2:30a Wilsonlee
+// [TAG] EIP89212
+// [Category] Bug Fix
+// [Severity] Important
+// [Symptom] Build process stopped with EIP83614 change.
+// [RootCause] Build error when the token "EFI_SPECIFICATION_VERSION" is
+// 0x20000.
+// [Solution] Rollback the EIP83614 changee to avoid this issue.
+// [Files] usb.sd
+//
+// 31 5/03/12 5:09a Ryanchou
+// [TAG] EIP83361
+// [Category] New Feature
+// [Description] Added "USB 2.0 Controller Mode" setup item.
+// [Files] ehci.c, usb.sd, usb.sdl, usb.uni, usbdef.h, UsbPolicy.h,
+// usbport.c
+//
+// 30 3/04/12 9:41p Wilsonlee
+// [TAG] EIP83614
+// [Category] Improvement
+// [Description] Manufacturing mode fixes.
+// [Files] usb.sd
+//
+// 29 2/18/11 1:13a Ryanchou
+// [TAG] EIP48184
+// [Category] Improvement
+// [Description] Update files according to the new Setup Customization
+// guidelines.
+// [Files] usb.sd, UsbPolicy.h
+//
+// 28 10/12/10 2:31a Rameshr
+// [TAG]- EIP 44585
+// [Category]-IMPROVEMENT
+// [Description]- Number of maximum supported USB Mass Storage device
+// increased from 8 to 16.
+// [Files]- Uin13.bin, UsbPort.c, UsbInt13.h, Usb.c, Usbdef.h, Uasbmass.c,
+// Usb.sd, usb.uni, UsbSetup.c, UsbSrc.sdl, UsbPolicy.h
+//
+// 27 7/13/10 7:15a Ryanchou
+// EIP38356: Implement shutdown USB legacy support in ACPI enable call.
+//
+// 26 5/20/10 2:10p Olegi
+//
+// 25 5/17/10 5:20p Robert
+// two setup questions were using SUPPRESS_GRAYOUT_ENDIF when they should
+// only be using endif; PowerGoodDeviceDelay and UsbXhciSupport. The
+// change makes it UEFI 2.1 compliant
+//
+// 24 5/17/10 4:09p Olegi
+// Removed unnecessary inclusion of TOKEN.H
+//
+// 23 4/19/10 1:52p Olegi
+//
+// 22 4/12/10 12:19p Olegi
+// Moving structure definitions to the .H file. EIP36942
+//
+// 21 3/02/10 10:10a Olegi
+//
+// 20 12/10/09 10:13a Olegi
+// Added UsbControlTimeout setup selection. EIP30079.
+//
+// 19 11/10/09 8:54a Olegi
+// EIP30149: HII 2.1 compliance.
+//
+// 18 9/09/09 3:14p Davidd
+// Added "USB Support" setup question - EIP 25360
+//
+// 17 5/21/09 5:18p Olegi
+// Added hotplug devices support.
+//
+// 16 10/24/08 3:04p Olegi
+//
+// 15 8/12/08 10:34a Fasihm
+// Added the Manufacturing flag to all the setup questions.
+//
+// 14 7/04/08 1:04p Olegi
+//
+// 13 5/16/08 12:07p Olegi
+// Compliance with AMI coding standard.
+//
+// 11 6/04/07 11:07a Fasihm
+// Changed the setup structures to use OneOf instead of CheckBox, so as to
+// reset the system based on change in the setup options.
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: usb.sd
+//
+// Description: This is the setup page 'USB Configuration.'
+// The link to the page is in the setup 'Advanced' tab.
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifdef SETUP_DATA_DEFINITION
+/***********************************************************/
+/* Put NVRAM data definitions here.
+/* For example: UINT8 Data1;
+/* These definitions will be converted by the build process
+/* to a definitions of SETUP_DATA fields.
+/***********************************************************/
+#endif
+
+#if defined(VFRCOMPILE) && !defined(CONTROLS_ARE_DEFINED)
+#define CONTROL_DEFINITION
+#endif
+#ifdef CONTROL_DEFINITION
+
+#define USB_ONEOF_USBMAINSUPPORT\
+ oneof varid = USB_SUPPORT_SETUP.UsbMainSupport,\
+ prompt = STRING_TOKEN(STR_USB_SUPPORT),\
+ help = STRING_TOKEN(STR_USB_SUPPORT_HELP),\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 0, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 1, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ endoneof;
+ //(EIP93460)>
+#if LEGACY_USB_DISABLE_FOR_USB_MASS
+#if USB_RUNTIME_DRIVER_IN_SMM
+#define USB_ONEOF_USBLEGACYSUPPORT\
+ oneof varid = USB_SUPPORT_SETUP.UsbLegacySupport,\
+ prompt = STRING_TOKEN(STR_USB_LEGACY_SUPPORT),\
+ help = STRING_TOKEN(STR_USB_LEGACY_SUPPORT_HELP1),\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 1, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 2, flags = RESET_REQUIRED;\
+ endoneof;
+#else
+#define USB_ONEOF_USBLEGACYSUPPORT\
+ oneof varid = USB_SUPPORT_SETUP.UsbLegacySupport,\
+ prompt = STRING_TOKEN(STR_USB_LEGACY_SUPPORT),\
+ help = STRING_TOKEN(STR_USB_LEGACY_SUPPORT_HELP1),\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 0, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 1, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 2, flags = RESET_REQUIRED;\
+ endoneof;
+#endif
+#else
+#if USB_RUNTIME_DRIVER_IN_SMM
+#define USB_ONEOF_USBLEGACYSUPPORT\
+ oneof varid = USB_SUPPORT_SETUP.UsbLegacySupport,\
+ prompt = STRING_TOKEN(STR_USB_LEGACY_SUPPORT),\
+ help = STRING_TOKEN(STR_USB_LEGACY_SUPPORT_HELP),\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 1, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 2, flags = RESET_REQUIRED;\
+ endoneof;
+#else
+#define USB_ONEOF_USBLEGACYSUPPORT\
+ oneof varid = USB_SUPPORT_SETUP.UsbLegacySupport,\
+ prompt = STRING_TOKEN(STR_USB_LEGACY_SUPPORT),\
+ help = STRING_TOKEN(STR_USB_LEGACY_SUPPORT_HELP),\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 0, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 1, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 2, flags = RESET_REQUIRED;\
+ endoneof;
+#endif
+#endif
+ //<(EIP93460)
+#define USB_ONEOF_USBHISPEEDSUPPORT\
+ oneof varid = USB_SUPPORT_SETUP.UsbHiSpeedSupport,\
+ prompt = STRING_TOKEN(STR_USB_HISPEED_SUPPORT),\
+ help = STRING_TOKEN(STR_USB_HISPEED_SUPPORT_HELP),\
+ option text = STRING_TOKEN(STR_USB_HISPEED), value = 1, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_FULLSPEED), value = 0, flags = RESET_REQUIRED;\
+ endoneof;
+
+#if XHCI_SUPPORT
+#define USB_ONEOF_USBXHCISUPPORT\
+ oneof varid = USB_SUPPORT_SETUP.UsbXhciSupport,\
+ prompt = STRING_TOKEN(STR_USB_XHCI_SUPPORT),\
+ help = STRING_TOKEN(STR_USB_XHCI_SUPPORT_HELP),\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 1, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 0, flags = RESET_REQUIRED ;\
+ endoneof;
+#if EFI_SPECIFICATION_VERSION > 0x20000
+#define USB_ONEOF_USBXHCIHANDOFF\
+ oneof varid = USB_SUPPORT_SETUP.UsbXhciHandoff,\
+ prompt = STRING_TOKEN(STR_USB_BIOS_XHCI_HANDOFF),\
+ help = STRING_TOKEN(STR_USB_BIOS_XHCI_HANDOFF_HELP),\
+ default = DEFAULT_XHCI_HANDOFF_OPTION,\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 1, flags = MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 0, flags = RESET_REQUIRED ;\
+ endoneof;
+#else
+#define USB_ONEOF_USBXHCIHANDOFF\
+ oneof varid = USB_SUPPORT_SETUP.UsbXhciHandoff,\
+ prompt = STRING_TOKEN(STR_USB_BIOS_XHCI_HANDOFF),\
+ help = STRING_TOKEN(STR_USB_BIOS_XHCI_HANDOFF_HELP),\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 1, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 0, flags = RESET_REQUIRED ;\
+ endoneof;
+#endif
+#else
+#define USB_ONEOF_USBXHCISUPPORT
+#define USB_ONEOF_USBXHCIHANDOFF
+#endif
+
+#if USB_EHCI_HANDOFF_SUPPORT
+#define USB_ONEOF_USBEHCIHANDOFF\
+ oneof varid = USB_SUPPORT_SETUP.UsbEhciHandoff,\
+ prompt = STRING_TOKEN(STR_USB_BIOS_EHCI_HANDOFF),\
+ help = STRING_TOKEN(STR_USB_BIOS_EHCI_HANDOFF_HELP),\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 1, flags = RESET_REQUIRED;\
+ endoneof;
+#else
+#define USB_ONEOF_USBEHCIHANDOFF
+#endif
+
+#if USB_OHCI_HANDOFF_SUPPORT
+#define USB_ONEOF_USBOHCIHANDOFF\
+ oneof varid = USB_SUPPORT_SETUP.UsbOhciHandoff,\
+ prompt = STRING_TOKEN(STR_USB_BIOS_OHCI_HANDOFF),\
+ help = STRING_TOKEN(STR_USB_BIOS_OHCI_HANDOFF_HELP),\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 1, flags = RESET_REQUIRED;\
+ endoneof;
+#else
+#define USB_ONEOF_USBOHCIHANDOFF
+#endif
+
+#if USB_DEV_MASS
+#define USB_ONEOF_USBMASSDRIVERSUPPORT\
+ oneof varid = USB_SUPPORT_SETUP.UsbMassDriverSupport,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DRIVER_SUPPORT),\
+ help = STRING_TOKEN(STR_USB_MASS_DRIVER_SUPPORT_HELP),\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 0, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 1, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;\
+ endoneof;
+#else
+#define USB_ONEOF_USBMASSDRIVERSUPPORT
+#endif
+
+#if defined (EMUL6064_SUPPORT) && EMUL6064_SUPPORT
+#if EFI_SPECIFICATION_VERSION > 0x20000
+#define USB_ONEOF_USBEMUL6064\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmul6064,\
+ prompt = STRING_TOKEN(STR_USB_6064),\
+ help = STRING_TOKEN(STR_USB_6064_HELP),\
+ default = DEFAULT_USB_EMUL6064_OPTION,\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 0, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 1, flags = MANUFACTURING | RESET_REQUIRED;\
+ endoneof;
+#else
+#define USB_ONEOF_USBEMUL6064\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmul6064,\
+ prompt = STRING_TOKEN(STR_USB_6064),\
+ help = STRING_TOKEN(STR_USB_6064_HELP),\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 0, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 1, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;\
+ endoneof;
+#endif
+#else
+#define USB_ONEOF_USBEMUL6064
+#endif
+
+#if defined (USB_HOTPLUG_FDD) && USB_HOTPLUG_FDD
+#define USB_ONEOF_USBHOTPLUGFDDSUPPORT\
+ oneof varid = USB_SUPPORT_SETUP.UsbHotplugFddSupport,\
+ prompt = STRING_TOKEN(STR_USB_HOTPLUG_FDD),\
+ help = STRING_TOKEN(STR_USB_HOTPLUG_FDD_HELP),\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 2, flags = RESET_REQUIRED | MANUFACTURING | DEFAULT ;\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 3, flags = RESET_REQUIRED ;\
+ endoneof;
+#else
+#define USB_ONEOF_USBHOTPLUGFDDSUPPORT
+#endif
+
+#if defined (USB_HOTPLUG_HDD) && USB_HOTPLUG_HDD
+#define USB_ONEOF_USBHOTPLUGHDDSUPPORT\
+ oneof varid = USB_SUPPORT_SETUP.UsbHotplugHddSupport,\
+ prompt = STRING_TOKEN(STR_USB_HOTPLUG_HDD),\
+ help = STRING_TOKEN(STR_USB_HOTPLUG_HDD_HELP),\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 2, flags = RESET_REQUIRED | MANUFACTURING | DEFAULT ;\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 3, flags = RESET_REQUIRED ;\
+ endoneof;
+#else
+#define USB_ONEOF_USBHOTPLUGHDDSUPPORT
+#endif
+
+#if defined (USB_HOTPLUG_CDROM) && USB_HOTPLUG_CDROM
+#define USB_ONEOF_USBHOTPLUGCDROMSUPPORT\
+ oneof varid = USB_SUPPORT_SETUP.UsbHotplugCdromSupport,\
+ prompt = STRING_TOKEN(STR_USB_HOTPLUG_CDROM),\
+ help = STRING_TOKEN(STR_USB_HOTPLUG_CDROM_HELP),\
+ option text = STRING_TOKEN(STR_USB_ENABLED), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_DISABLED), value = 2, flags = RESET_REQUIRED | MANUFACTURING | DEFAULT ;\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 3, flags = RESET_REQUIRED ;\
+ endoneof;
+#else
+#define USB_ONEOF_USBHOTPLUGCDROMSUPPORT
+#endif
+
+#define USB_ONEOF_USBCONTROLTIMEOUT\
+ oneof varid = USB_SUPPORT_SETUP.UsbControlTimeOut,\
+ prompt = STRING_TOKEN(STR_USB_CONTROL_TIME_OUT),\
+ help = STRING_TOKEN(STR_USB_CONTROL_TIME_OUT_HELP),\
+ option text = STRING_TOKEN(STR_USB_DELAY_01), value = 1, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_DELAY_05), value = 5, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_DELAY_10), value = 10, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_DELAY_20), value = 20, flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;\
+ endoneof;
+
+#define USB_ONEOF_USBMASSRESETDELAY\
+ oneof varid = USB_SUPPORT_SETUP.UsbMassResetDelay,\
+ prompt = STRING_TOKEN(STR_USB_MASS_RESET_DELAY),\
+ help = STRING_TOKEN(STR_USB_MASS_RESET_DELAY_HELP),\
+ option text = STRING_TOKEN(STR_USB_DELAY_10), value = 0, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_DELAY_20), value = 1, flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;\
+ option text = STRING_TOKEN(STR_USB_DELAY_30), value = 2, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_DELAY_40), value = 3, flags = RESET_REQUIRED;\
+ endoneof;
+
+#define USB_ONEOF_POWERGOODDEVICEDELAY\
+ oneof varid = USB_SUPPORT_SETUP.PowerGoodDeviceDelay,\
+ prompt = STRING_TOKEN(STR_USB_POWERGOOD_DELAY),\
+ help = STRING_TOKEN(STR_USB_POWERGOOD_DELAY_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_DELAY_VALUE), value = 1, flags = RESET_REQUIRED;\
+ endoneof;
+
+#define USB_NUMERIC_POWERGOODDEVICENUMDELAY\
+ numeric varid = USB_SUPPORT_SETUP.PowerGoodDeviceNumDelay,\
+ prompt = STRING_TOKEN (STR_USB_DELAY_NUM_VALUE),\
+ help = STRING_TOKEN (STR_USB_DELAY_NUM_VALUE_HELP),\
+ flags = RESET_REQUIRED,\
+ minimum = 1,\
+ maximum = 40,\
+ step = 1,\
+ default = 5,\
+ endnumeric;
+
+#if USB_MASS_EMULATION_NATIVE
+#define USB_ONEOF_USBEMU1\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu1,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE1),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU2\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu2,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE2),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU3\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu3,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE3),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU4\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu4,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE4),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU5\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu5,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE5),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU6\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu6,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE6),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU7\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu7,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE7),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU8\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu8,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE8),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU9\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu9,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE9),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU10\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu10,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE10),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU11\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu11,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE11),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU12\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu12,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE12),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU13\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu13,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE13),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+#define USB_ONEOF_USBEMU14\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu14,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE14),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU15\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu15,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE15),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU16\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu16,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE16),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP1),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+#else //#if USB_MASS_EMULATION_NATIVE
+#define USB_ONEOF_USBEMU1\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu1,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE1),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU2\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu2,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE2),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU3\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu3,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE3),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU4\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu4,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE4),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU5\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu5,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE5),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU6\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu6,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE6),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU7\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu7,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE7),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU8\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu8,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE8),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU9\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu9,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE9),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU10\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu10,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE10),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU11\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu11,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE11),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU12\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu12,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE12),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU13\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu13,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE13),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+#define USB_ONEOF_USBEMU14\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu14,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE14),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU15\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu15,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE15),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+
+#define USB_ONEOF_USBEMU16\
+ oneof varid = USB_SUPPORT_SETUP.UsbEmu16,\
+ prompt = STRING_TOKEN(STR_USB_MASS_DEVICE16),\
+ help = STRING_TOKEN(STR_USB_EMULATION_TYPE_HELP),\
+ option text = STRING_TOKEN(STR_USB_AUTO), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FLOPPY), value = 1, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_FORCED_FDD), value = 2, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_HDD), value = 3, flags = RESET_REQUIRED ;\
+ option text = STRING_TOKEN(STR_USB_EMUL_CDROM), value = 4, flags = RESET_REQUIRED ;\
+ endoneof;
+#endif //#if USB_MASS_EMULATION_NATIVE
+
+#endif //#ifdef CONTROL_DEFINITION
+
+
+#ifdef CONTROLS_WITH_DEFAULTS
+
+USB_ONEOF_USBMAINSUPPORT // UINT8 UsbMainSupport; // Disable \[Enable]
+USB_ONEOF_USBLEGACYSUPPORT // UINT8 UsbLegacySupport; //[Enable]\ Disable \ Auto
+USB_ONEOF_USBHISPEEDSUPPORT // UINT8 UsbHiSpeedSupport; //[HiSpeed]\ FullSpeed
+USB_ONEOF_USBXHCISUPPORT // UINT8 UsbXhciSupport; //[Enable]\ Disable
+USB_ONEOF_USBXHCIHANDOFF // UINT8 UsbXhciHandoff; //[Enable]\ Disable
+USB_ONEOF_USBEHCIHANDOFF // UINT8 UsbEhciHandoff; //[Disable] \ Enable
+USB_ONEOF_USBMASSDRIVERSUPPORT // UINT8 UsbMassDriverSupport; // Disable \[Enable]
+USB_ONEOF_USBEMUL6064 // UINT8 UsbEmul6064; // Disable \[Enable]
+USB_ONEOF_USBHOTPLUGFDDSUPPORT // UINT8 UsbHotplugFddSupport; // Enable \[Disable]\ Auto
+USB_ONEOF_USBHOTPLUGHDDSUPPORT // UINT8 UsbHotplugHddSupport; // Enable \[Disable]\ Auto
+USB_ONEOF_USBHOTPLUGCDROMSUPPORT // UINT8 UsbHotplugCdromSupport; // Enable \[Disable]\ Auto
+USB_ONEOF_USBCONTROLTIMEOUT // UINT8 UsbControlTimeOut; // 1 sec \ 5 sec \ 10 sec \[20 sec]
+USB_ONEOF_USBMASSRESETDELAY // UINT8 UsbMassResetDelay; // 10 sec \[20 sec]\ 30 sec \ 40sec
+USB_ONEOF_POWERGOODDEVICEDELAY // UINT8 PowerGoodDeviceDelay; //[Auto]\ Manual
+USB_NUMERIC_POWERGOODDEVICENUMDELAY // UINT8 PowerGoodDeviceNumDelay; //[1...40] (seconds)
+USB_ONEOF_USBEMU1 // UINT8 UsbEmu1; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU2 // UINT8 UsbEmu2; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU3 // UINT8 UsbEmu3; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU4 // UINT8 UsbEmu4; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU5 // UINT8 UsbEmu5; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU6 // UINT8 UsbEmu6; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU7 // UINT8 UsbEmu7; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU8 // UINT8 UsbEmu8; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU9 // UINT8 UsbEmu9; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU10 // UINT8 UsbEmu10; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU11 // UINT8 UsbEmu11; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU12 // UINT8 UsbEmu12; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU13 // UINT8 UsbEmu13; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU14 // UINT8 UsbEmu14; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU15 // UINT8 UsbEmu15; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+USB_ONEOF_USBEMU16 // UINT8 UsbEmu16; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+
+#endif //#ifdef CONTROLS_WITH_DEFAULTS
+
+#ifdef FORM_SET_TYPEDEF
+ #include <Protocol\UsbPolicy.h>
+#endif
+
+#ifdef FORM_SET_VARSTORE
+ varstore USB_MASS_DEV_NUM,
+ key = AUTO_ID(USB_MASS_DEV_NUM_KEY),
+ name = UsbMassDevNum,
+ guid = SETUP_GUID;
+
+ varstore USB_MASS_DEV_VALID,
+ key = AUTO_ID(USB_MASS_DEV_VALID_KEY),
+ name = UsbMassDevValid,
+ guid = SETUP_GUID;
+
+ varstore USB_CONTROLLER_NUM,
+ key = AUTO_ID(USB_CONTROLLER_NUM_KEY),
+ name = UsbControllerNum,
+ guid = SETUP_GUID;
+
+ varstore USB_SUPPORT_SETUP,
+ key = AUTO_ID(USB_SUPPORT_KEY),
+ name = UsbSupport,
+ guid = SETUP_GUID;
+#endif
+
+//**********************************************************************
+// ADVANCED - USB Configuration Form
+//**********************************************************************
+#ifdef ADVANCED_FORM_SET
+
+#ifndef SUPPRESS_GRAYOUT_ENDIF //old Core
+#define SUPPRESS_GRAYOUT_ENDIF endif;
+#endif
+
+ #ifdef FORM_SET_ITEM
+ //
+ // Define controls to be added to the main page of the formset
+ //
+ #endif
+
+ #ifdef FORM_SET_GOTO
+ //
+ // Define goto commands for the forms defined in this file
+ //
+ goto USB_CONFIG_FORM_ID,
+ prompt = STRING_TOKEN(STR_USB_CONFIGURATION),
+ help = STRING_TOKEN(STR_USB_CONFIGURATION_HELP);
+ #endif
+
+ #ifdef FORM_SET_FORM
+ //
+ // Define forms
+ //
+ #ifndef USB_FORM_USB
+ #define USB_FORM_USB
+ form formid = AUTO_ID(USB_CONFIG_FORM_ID),
+ title = STRING_TOKEN(STR_USB_CONFIGURATION);
+
+ SUBTITLE(STRING_TOKEN(STR_USB_CONFIGURATION))
+ SEPARATOR
+ //(EIP102493+)>
+ //Display USB Module Version.
+ text
+ help = STRING_TOKEN(STR_EMPTY),
+ text = STRING_TOKEN(STR_USB_MODULE_VER_HELP),
+ text = STRING_TOKEN(STR_USB_MODULE_VER),
+ flags = 0,
+ key = 0;
+
+ SEPARATOR
+ //<(EIP102493+)
+ text
+ help = STRING_TOKEN(STR_EMPTY),
+ text = STRING_TOKEN(STR_USB_CONTROLLERS_ENABLED),
+ text = STRING_TOKEN(STR_EMPTY),
+ flags = 0,
+ key = 0;
+ SUBTITLE(STRING_TOKEN(STR_USB_CONTROLLERS_ENABLED_LIST))
+
+ text
+ help = STRING_TOKEN(STR_EMPTY),
+ text = STRING_TOKEN(STR_USB_DEVICES_ENABLED),
+ text = STRING_TOKEN(STR_EMPTY),
+ flags = 0,
+ key = 0;
+
+ SUBTITLE(STRING_TOKEN(STR_USB_DEVICES_ENABLED_LIST))
+ SEPARATOR
+// UINT8 UsbMainSupport; // Disable \[Enable]
+#if HIDE_USB_SUPPORT_SETUP_QUESTION
+ suppressif ideqid USB_SUPPORT_SETUP.UsbMainSupport == USB_SUPPORT_SETUP.UsbMainSupport;
+#endif
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+ USB_ONEOF_USBMAINSUPPORT
+ endif;
+#if HIDE_USB_SUPPORT_SETUP_QUESTION
+#if EFI_SPECIFICATION_VERSION>0x20000
+ endif; // suppress-grayout
+#endif
+#endif
+// UINT8 UsbLegacySupport; //[Enable]\ Disable \ Auto
+#if USB_RUNTIME_DRIVER_IN_SMM
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0;
+#else
+ suppressif TRUE;
+#endif
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+ USB_ONEOF_USBLEGACYSUPPORT
+ SUPPRESS_GRAYOUT_ENDIF
+
+#if EHCI_SUPPORT
+#if HIDE_USB_HISPEED_SUPPORT_SETUP_QUESTION
+ suppressif TRUE;
+#else
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_CONTROLLER_NUM.EhciNum == 0;
+#endif
+// UINT8 UsbHiSpeedSupport; //[HiSpeed]\ FullSpeed
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+ USB_ONEOF_USBHISPEEDSUPPORT
+ endif;
+#if EFI_SPECIFICATION_VERSION>0x20000
+ endif; // suppress-grayout
+#endif
+#endif
+
+#if XHCI_SUPPORT
+#if HIDE_USB_XHCI_LEGACY_SUPPORT_SETUP_QUESTION
+ suppressif TRUE;
+#else
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_CONTROLLER_NUM.XhciNum == 0;
+#endif
+// UINT8 UsbXhciSupport; //[Enable]\ Disable
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+ USB_ONEOF_USBXHCISUPPORT
+ endif;
+#if EFI_SPECIFICATION_VERSION>0x20000
+ endif; // suppress-grayout
+#endif
+
+// UINT8 UsbXhciHandoff; //[Enable]\ Disable
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_CONTROLLER_NUM.XhciNum == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+ USB_ONEOF_USBXHCIHANDOFF
+ endif;
+#if EFI_SPECIFICATION_VERSION>0x20000
+ endif; // suppress-grayout
+#endif
+#endif
+#if USB_EHCI_HANDOFF_SUPPORT
+// UINT8 UsbEhciHandoff; //[Disable] \ Enable
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_CONTROLLER_NUM.EhciNum == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+ USB_ONEOF_USBEHCIHANDOFF
+ SUPPRESS_GRAYOUT_ENDIF
+#endif
+
+#if USB_OHCI_HANDOFF_SUPPORT
+// UINT8 UsbOhciHandoff; //[Disable] \ Enable
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_CONTROLLER_NUM.OhciNum == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+ USB_ONEOF_USBOHCIHANDOFF
+ SUPPRESS_GRAYOUT_ENDIF
+#endif
+
+ #if USB_DEV_MASS
+// UINT8 UsbMassDriverSupport; // Disable \[Enable]
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR (
+ ideqval USB_CONTROLLER_NUM.UhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.OhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.EhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.XhciNum == 0);
+ USB_ONEOF_USBMASSDRIVERSUPPORT
+ SUPPRESS_GRAYOUT_ENDIF
+ #endif
+
+ #if defined (EMUL6064_SUPPORT) && EMUL6064_SUPPORT
+// UINT8 UsbEmul6064; // Disable \[Enable]
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+ USB_ONEOF_USBEMUL6064
+ SUPPRESS_GRAYOUT_ENDIF
+ #endif
+
+ #if defined (USB_HOTPLUG_FDD) && USB_HOTPLUG_FDD
+// UINT8 UsbHotplugFddSupport; // Enable \[Disable]\ Auto
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR (
+ ideqval USB_CONTROLLER_NUM.UhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.OhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.EhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.XhciNum == 0);
+ USB_ONEOF_USBHOTPLUGFDDSUPPORT
+ SUPPRESS_GRAYOUT_ENDIF
+ #endif
+
+ #if defined (USB_HOTPLUG_HDD) && USB_HOTPLUG_HDD
+// UINT8 UsbHotplugHddSupport; // Enable \[Disable]\ Auto
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR (
+ ideqval USB_CONTROLLER_NUM.UhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.OhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.EhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.XhciNum == 0);
+ USB_ONEOF_USBHOTPLUGHDDSUPPORT
+ SUPPRESS_GRAYOUT_ENDIF
+ #endif
+
+ #if defined (USB_HOTPLUG_CDROM) && USB_HOTPLUG_CDROM
+// UINT8 UsbHotplugCdromSupport; // Enable \[Disable]\ Auto
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR (
+ ideqval USB_CONTROLLER_NUM.UhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.OhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.EhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.XhciNum == 0);
+ USB_ONEOF_USBHOTPLUGCDROMSUPPORT
+ SUPPRESS_GRAYOUT_ENDIF
+ #endif
+
+ SEPARATOR
+ text
+ help = STRING_TOKEN(STR_EMPTY),
+ text = STRING_TOKEN(STR_USB_DELAYS),
+ text = STRING_TOKEN(STR_EMPTY),
+ flags = 0,
+ key = 0;
+
+//(EIP30079+)>
+// UINT8 UsbControlTimeOut; // 1 sec \ 5 sec \ 10 sec \[20 sec]
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR (
+ ideqval USB_CONTROLLER_NUM.UhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.OhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.EhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.XhciNum == 0);
+ USB_ONEOF_USBCONTROLTIMEOUT
+ SUPPRESS_GRAYOUT_ENDIF
+//<(EIP30079+)
+// UINT8 UsbMassResetDelay; // 10 sec \[20 sec]\ 30 sec \ 40sec
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR (
+ ideqval USB_CONTROLLER_NUM.UhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.OhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.EhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.XhciNum == 0);
+ USB_ONEOF_USBMASSRESETDELAY
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 PowerGoodDeviceDelay; //[Auto]\ Manual
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR (
+ ideqval USB_CONTROLLER_NUM.UhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.OhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.EhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.XhciNum == 0);
+ USB_ONEOF_POWERGOODDEVICEDELAY
+ endif;
+// UINT8 PowerGoodDeviceNumDelay; //[1...40] (seconds)
+ suppressif ideqval USB_SUPPORT_SETUP.PowerGoodDeviceDelay == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR (
+ ideqval USB_CONTROLLER_NUM.UhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.OhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.EhciNum == 0 AND
+ ideqval USB_CONTROLLER_NUM.XhciNum == 0);
+ USB_NUMERIC_POWERGOODDEVICENUMDELAY
+ SUPPRESS_GRAYOUT_ENDIF
+
+ SEPARATOR
+
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 0;
+ text
+ help = STRING_TOKEN(STR_EMPTY),
+ text = STRING_TOKEN(STR_USB_EMULATION),
+ text = STRING_TOKEN(STR_EMPTY),
+ flags = 0,
+ key = 0;
+ endif;
+// UINT8 UsbEmu1; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu1Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU1
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu2; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu2Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU2
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu3; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+// suppressif ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 2 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 1 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 0 OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu3Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU3
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu4; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+// suppressif ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 3 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 2 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 1 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 0 OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu4Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU4
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu5; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+// suppressif ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 4 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 3 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 2 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 1 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 0 OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu5Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU5
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu6; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+// suppressif ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 5 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 4 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 3 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 2 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 1 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 0 OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu6Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU6
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu7; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+// suppressif ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 6 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 5 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 4 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 3 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 2 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 1 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 0 OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu7Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU7
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu8; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+// suppressif ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 7 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 6 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 5 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 4 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 3 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 2 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 1 OR ideqval USB_MASS_DEV_NUM.UsbMassDevNum == 0 OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu8Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU8
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu9; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu9Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU9
+ SUPPRESS_GRAYOUT_ENDIF
+
+// UINT8 UsbEmu10; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu10Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU10
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu11; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu11Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU11
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu12; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu12Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU12
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu13; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu13Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU13
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu14; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu14Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU14
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu15; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu15Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU15
+ SUPPRESS_GRAYOUT_ENDIF
+// UINT8 UsbEmu16; //[Auto] \ Floppy \ Forced FDD \ Hard Disk \ CD-ROM
+ suppressif ideqval USB_SUPPORT_SETUP.UsbMainSupport == 0 OR ideqval USB_MASS_DEV_VALID.UsbEmu16Valid == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR ideqval USB_SUPPORT_SETUP.UsbLegacySupport == 1;
+ USB_ONEOF_USBEMU16
+ SUPPRESS_GRAYOUT_ENDIF
+
+ INTERACTIVE_TEXT(STRING_TOKEN(STR_EMPTY), \
+ STRING_TOKEN(STR_EMPTY), \
+ STRING_TOKEN(STR_EMPTY), \
+ AUTO_ID(USB_DEVICES_ENABLED_REFRESH_KEY))
+
+ endform;
+
+ #endif //#ifndef USB_FORM_USB
+
+ #endif
+
+#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 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Core/EM/usb/setup/usb.uni b/Core/EM/usb/setup/usb.uni
new file mode 100644
index 0000000..a3a9a63
--- /dev/null
+++ b/Core/EM/usb/setup/usb.uni
Binary files differ
diff --git a/Core/EM/usb/setup/usbsetup.c b/Core/EM/usb/setup/usbsetup.c
new file mode 100644
index 0000000..5b7cfe7
--- /dev/null
+++ b/Core/EM/usb/setup/usbsetup.c
@@ -0,0 +1,804 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//****************************************************************************
+// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Setup/usbsetup.c 24 12/24/14 10:40p Wilsonlee $
+//
+// $Revision: 24 $
+//
+// $Date: 12/24/14 10:40p $
+//
+//****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/USB/ALASKA/Setup/usbsetup.c $
+//
+// 24 12/24/14 10:40p Wilsonlee
+// [TAG] EIP196287
+// [Category] Improvement
+// [Description] Display info of connected usb controllers and remove or
+// grayed-out some item according the connected usb controller number.
+// [Files] uhcd.c, usbport.c, usb.uni, usb.sd, usbsetup.c,
+// AmiUsbController.h, UsbPolicy.h
+//
+// 23 8/20/14 5:26a Wilsonlee
+// [TAG] EIP182011
+// [Category] Improvement
+// [Description] We don't need to update NVRAM variables in
+// InstallUsbMass and UninstallUSBMass functions.
+// [Files] efiusbmass.c, usbsetup.c
+//
+// 22 6/26/14 1:18a Wilsonlee
+// [TAG] EIP173387
+// [Category] Improvement
+// [Description] Remove TODO comments.
+// [Files] usbsetup.c, xhci.c, usbmass.c, usbCCID.c, usb.c, uhci.c,
+// syskbc.c, usbport.c, usbbus.c, uhcd.c, UsbBotPeim.c, PeiXhci.c,
+// PeiEhci.c
+//
+// 21 5/07/14 10:37a Wilsonlee
+// [TAG] EIP166594
+// [Category] Improvement
+// [Description] Add the token "USB_SETUP_VARIABLE_RUNTIME_ACCESS" to
+// control if we set runtime attribute for the setup variables used by USB
+// module.
+// [Files] usb.sdl, usbport.c, usbsetup.c
+//
+// 20 4/29/14 10:23p Wilsonlee
+// [TAG] EIP161709
+// [Category] New Feature
+// [Description] Dynamically update the usb device list in BIOS setup.
+// [Files] usb.sdl, usb.sd, usbsetup.c, uhcd.c
+//
+// 19 2/08/13 3:33a Roberthsu
+// [TAG] EIP112379
+// [Category] Bug Fix
+// [Severity] Normal
+// [Symptom] USB device information is incorrect in Setup.
+// [RootCause] Memory copy size error.
+// [Solution] Change copy point device string size.
+// [Files] usbsetup.c
+//
+// 18 10/25/12 1:37a Wilsonlee
+// [TAG] EIP102493
+// [Category] New Feature
+// [Description] USB Module version is added to the setup page.
+// [Files] usbsetup.c, usb.sd, usb.uni
+//
+// 17 7/15/11 6:32a Ryanchou
+// [TAG] EIP38434
+// [Category] New Feature
+// [Description] Added USB HID report protocol support.
+// [Files] amiusb.c, AmiUsbController.h, amiusbhc.c, efiusbkb.c,
+// efiusbkb.h, efiusbpoint.c, ehci.c, ohci.c, uhcd.c uhcd.cif, uhci.c,
+// usb.c, usbdef.h, usbhid.c, usbkbd.c, usbkbd.h, usbms.c, usbpoint.c,
+// usbrt.cif, usbsb.c, usbsetup.c, usbsrc.sdl, xhci.c
+//
+// 16 7/12/11 8:19a Ryanchou
+// [TAG] EIP56918
+// [Category] New Feature
+// [Description] Added CCID device support.
+// [Files] amiusb.c, amiusb.h, amiusbrtCCID.h, ehci.c, ohci.c, uhci.c,
+// usb.c, UsbCCID.c, usbdef.h, usbrt.cif, usbsetup.c, efiusbccid.c,
+// framework.cif, uhcd.c, uhcd.cif, uhcd.h, usbsrc.sdl, AmiusbCCID.h,
+// AmiUsbController.h, AmiUSBProtocols.cif
+//
+// 15 10/14/10 4:42p Olegi
+// - Tabs replaced with spaces
+// - Changed the existing logic of getting strings correlated to device
+// number: from hardcoded table that was limted to 10 elements only (snum
+// array). If more than 10 devices used, the whole logic caused memory
+// corruption that ended with CPU exception.
+// - Changed the logic of conversion decimal number to CHAR16 string +
+// space as required.
+// - Added limitations for input numbers to be smaller than 127 which is
+// USB max device address; this limitation should never be approached but
+// it protects string operations on numbers.
+//
+// 14 10/12/10 2:34a Rameshr
+// [TAG]- EIP 44585
+// [Category]-IMPROVEMENT
+// [Description]- Number of maximum supported USB Mass Storage device
+// increased from 8 to 16.
+// [Files]- Uin13.bin, UsbPort.c, UsbInt13.h, Usb.c, Usbdef.h, Uasbmass.c,
+// Usb.sd, usb.uni, UsbSetup.c, UsbSrc.sdl, UsbPolicy.h
+//
+// 13 4/12/10 12:19p Olegi
+// Moving structure definitions to the .H file. EIP36942
+//
+// 12 1/29/10 5:15p Olegi
+//
+// 11 11/10/09 8:54a Olegi
+// EIP30149: HII 2.1 compliance.
+//
+// 10 9/09/09 3:18p Davidd
+// Removed the assertion caused by USB support disabled in setup - EIP
+// 25360
+//
+// 9 12/18/08 10:47a Olegi
+// Variable gEfiSetupGuid made static.
+//
+// 8 7/04/08 1:04p Olegi
+//
+// 7 6/27/08 6:00p Olegi
+//
+// 6 5/16/08 12:07p Olegi
+// Compliance with AMI coding standard.
+//
+//****************************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: UsbSetup.c
+//
+// Description: USB driver setup related functions implementation.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#include <AmiLib.h>
+#include <AmiDxeLib.h>
+#include <Setup.h>
+#include <SetupStrTokens.h>
+#include "Protocol/AMiUsbController.h"
+#include <Protocol/UsbPolicy.h>
+
+#define MAX_DEVS_LINE_LENGTH 80
+#define MAX_DEVICE_NUMBER_LENGTH 10
+#define MAX_DEVICE_AMOUNT 127
+
+static EFI_GUID gEfiSetupGuid = SETUP_GUID;
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: GetConnectedDevices
+//
+// Description: This function retrieves the information about connected
+// USB devices.
+//
+// Output: returns TRUE if device connection status has changed since this
+// function is called last time; otherwise FALSE.
+// Notes: When FALSE is returned, none of the output parameters are valid.
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+EFI_STATUS
+GetConnectedDevices(
+ CHAR16 *DevNumStr,
+ CHAR16 *ControllerNumStr,
+ EFI_USB_PROTOCOL *UsbProtocol,
+ CONNECTED_USB_DEVICES_NUM *Devs
+)
+{
+ CHAR16 StrMassStorage[] = L"Drive";
+ CHAR16 StrKeyboard[] = L"Keyboard";
+ CHAR16 StrMouse[] = L"Mouse";
+ CHAR16 StrPoint[] = L"Point"; //(EIP38434+)
+ CHAR16 StrMice[] = L"Mice";
+ CHAR16 StrHub[] = L"Hub";
+ CHAR16 StrCcid[] = L"SmartCard Reader";
+ CHAR16 StrUhci[] = L"UHCI";
+ CHAR16 StrOhci[] = L"OHCI";
+ CHAR16 StrEhci[] = L"EHCI";
+ CHAR16 StrXhci[] = L"XHCI";
+ CHAR16 Name[MAX_DEVS_LINE_LENGTH];
+ CHAR16 *StrPtr = Name;
+ CHAR16 NumberToString [MAX_DEVICE_NUMBER_LENGTH];
+ UINTN NumSize;
+ CHAR16 Comma[] = L", ";
+ CHAR16 Space[] = L" ";
+ CHAR16 LeadingSpace[] = L" None";
+ UINT8 MassStorageNumber;
+ UINT8 KeyboardNumber;
+ UINT8 MouseNumber;
+ UINT8 PointNumber;
+ UINT8 HubNumber;
+ UINT8 CcidNumber; //(EIP38434)
+ UINT8 UhciNumber;
+ UINT8 OhciNumber;
+ UINT8 EhciNumber;
+ UINT8 XhciNumber;
+ BOOLEAN Is1stItem = TRUE;
+
+ UsbProtocol->UsbReportDevices(Devs);
+ MassStorageNumber = Devs->NumUsbMass;
+ KeyboardNumber = Devs->NumUsbKbds;
+ MouseNumber = Devs->NumUsbMice;
+ PointNumber = Devs->NumUsbPoint;
+ HubNumber = Devs->NumUsbHubs;
+ CcidNumber = Devs->NumUsbCcids;
+ UhciNumber = Devs->NumUhcis;
+ OhciNumber = Devs->NumOhcis;
+ EhciNumber = Devs->NumEhcis;
+ XhciNumber = Devs->NumXhcis;
+
+ // Form the string
+ pBS->SetMem(StrPtr, MAX_DEVS_LINE_LENGTH * sizeof(CHAR16), 0);
+ pBS->CopyMem(StrPtr, LeadingSpace, 10 * sizeof(CHAR16));
+ StrPtr += 6; // leave string pointer at "None"
+
+ // Drive/Drives
+ if ((MassStorageNumber) && (MassStorageNumber < MAX_DEVICE_AMOUNT)) {
+ ItowEx(MassStorageNumber, NumberToString, 10, FALSE);
+ NumSize = Wcslen(NumberToString);
+
+ pBS->CopyMem(StrPtr, NumberToString, (NumSize * sizeof (CHAR16)));
+ StrPtr += NumSize;
+ // move pointer 1 more space
+ pBS->CopyMem(StrPtr, Space, 2);
+ StrPtr += 1;
+
+ pBS->CopyMem(StrPtr, StrMassStorage, 10);
+ StrPtr += 5; // L"Drive"
+ if (MassStorageNumber > 1) {
+ *StrPtr++ = L's'; // L"Drives"
+ }
+ Is1stItem = FALSE;
+ }
+
+ // Keyboard/Keyboards
+ if ((KeyboardNumber) && (KeyboardNumber < MAX_DEVICE_AMOUNT)) {
+ if (!Is1stItem) {
+ pBS->CopyMem(StrPtr, Comma, 4);
+ StrPtr += 2; // L" ,"
+ }
+ ItowEx(KeyboardNumber, NumberToString, 10, FALSE);
+ NumSize = Wcslen(NumberToString);
+
+ // move pointer 1 more space then string length
+ pBS->CopyMem(StrPtr, NumberToString, (NumSize * sizeof (CHAR16)));
+ StrPtr += NumSize;
+ // move pointer 1 more space
+ pBS->CopyMem(StrPtr, Space, 2);
+ StrPtr += 1;
+
+ pBS->CopyMem(StrPtr, StrKeyboard, 16);
+ StrPtr += 8; // L"Keyboard"
+ if (KeyboardNumber > 1) {
+ *StrPtr++ = L's'; // L"Keyboards"
+ }
+ Is1stItem = FALSE;
+ }
+
+ // Mouse/Mice
+ if ((MouseNumber) && (MouseNumber < MAX_DEVICE_AMOUNT)) {
+ if (!Is1stItem) {
+ pBS->CopyMem(StrPtr, Comma, 4);
+ StrPtr += 2; // L" ,"
+ }
+ ItowEx(MouseNumber, NumberToString, 10, FALSE);
+ NumSize = Wcslen(NumberToString);
+
+ // move pointer 1 more space then string length
+ pBS->CopyMem(StrPtr, NumberToString, (NumSize * sizeof (CHAR16)));
+ StrPtr += NumSize;
+ // move pointer 1 more space
+ pBS->CopyMem(StrPtr, Space, 2);
+ StrPtr += 1;
+
+ if (MouseNumber == 1) {
+ pBS->CopyMem(StrPtr, StrMouse, 10);
+ StrPtr += 5; // L"Mouse"
+ } else {
+ pBS->CopyMem(StrPtr, StrMice, 8);
+ StrPtr += 4; // L"Mice"
+ }
+ Is1stItem = FALSE;
+ }
+ //(EIP38434+)>
+ // Point/Points
+ if ((PointNumber) && (PointNumber < MAX_DEVICE_AMOUNT)) {
+ if (!Is1stItem) {
+ pBS->CopyMem(StrPtr, Comma, 4);
+ StrPtr += 2; // L" ,"
+ }
+ ItowEx(PointNumber, NumberToString, 10, FALSE);
+ NumSize = Wcslen(NumberToString);
+ // move pointer 1 more space then string length
+ pBS->CopyMem(StrPtr, NumberToString, (NumSize * sizeof (CHAR16)));
+ StrPtr += NumSize;
+ // move pointer 1 more space
+ pBS->CopyMem(StrPtr, Space, 2);
+ StrPtr += 1;
+
+ pBS->CopyMem(StrPtr, StrPoint, 10);
+ StrPtr += 5; // L"Point"
+ if (PointNumber > 1) {
+ *StrPtr++ = L's'; // L"Points"
+ }
+ Is1stItem = FALSE;
+ }
+ //<(EIP38434+)
+ // Hub/Hubs
+ if ((HubNumber) && (HubNumber < MAX_DEVICE_AMOUNT)) {
+ if (!Is1stItem) {
+ pBS->CopyMem(StrPtr, Comma, 4);
+ StrPtr += 2; // L" ,"
+ }
+ ItowEx(HubNumber, NumberToString, 10, FALSE);
+ NumSize = Wcslen(NumberToString);
+
+ // move pointer 1 more space then string length
+ pBS->CopyMem(StrPtr, NumberToString, (NumSize * sizeof (CHAR16)));
+ StrPtr += NumSize;
+ // move pointer 1 more space
+ pBS->CopyMem(StrPtr, Space, 2);
+ StrPtr += 1;
+ pBS->CopyMem(StrPtr, StrHub, 6);
+ StrPtr += 3; // L"Hub"
+ if (HubNumber > 1) {
+ *StrPtr++ = L's'; // L"Hubs"
+ }
+ Is1stItem = FALSE;
+ }
+ // Ccid/Ccids
+ if (CcidNumber) {
+ if (!Is1stItem) {
+ pBS->CopyMem(StrPtr, Comma, 4);
+ StrPtr += 2; // L" ,"
+ }
+ ItowEx(CcidNumber, NumberToString, 10, FALSE);
+ NumSize = Wcslen(NumberToString);
+
+ // move pointer 1 more space then string length
+ pBS->CopyMem(StrPtr, NumberToString, (NumSize * sizeof (CHAR16)));
+ StrPtr += NumSize;
+
+ // move pointer 1 more space
+ pBS->CopyMem(StrPtr, Space, 2);
+ StrPtr += 1; // L" "
+
+ pBS->CopyMem(StrPtr, StrCcid, 32);
+ StrPtr += 16; // L"SmartCard Reader"
+ if (CcidNumber > 1) {
+ *StrPtr++ = L's'; // L'SmartCard Readers'
+ }
+ Is1stItem = FALSE;
+ }
+
+ pBS->CopyMem(DevNumStr, Name, MAX_DEVS_LINE_LENGTH * sizeof(CHAR16));
+
+ Is1stItem = TRUE;
+ StrPtr = Name;
+ // Form the string
+ pBS->SetMem(StrPtr, MAX_DEVS_LINE_LENGTH * sizeof(CHAR16), 0);
+ pBS->CopyMem(StrPtr, LeadingSpace, 10 * sizeof(CHAR16));
+ StrPtr += 6; // leave string pointer at "None"
+
+ // Drive/Drives
+ if (UhciNumber) {
+ ItowEx(UhciNumber, NumberToString, 10, FALSE);
+ NumSize = Wcslen(NumberToString);
+
+ pBS->CopyMem(StrPtr, NumberToString, (NumSize * sizeof (CHAR16)));
+ StrPtr += NumSize;
+ // move pointer 1 more space
+ pBS->CopyMem(StrPtr, Space, 2);
+ StrPtr += 1;
+
+ pBS->CopyMem(StrPtr, StrUhci, 8);
+ StrPtr += 4; // L"UHCI"
+ if (UhciNumber > 1) {
+ *StrPtr++ = L's'; // L"UHCIs"
+ }
+ Is1stItem = FALSE;
+ }
+
+ if (OhciNumber) {
+ if (!Is1stItem) {
+ pBS->CopyMem(StrPtr, Comma, 4);
+ StrPtr += 2; // L" ,"
+ }
+ ItowEx(OhciNumber, NumberToString, 10, FALSE);
+ NumSize = Wcslen(NumberToString);
+
+ // move pointer 1 more space then string length
+ pBS->CopyMem(StrPtr, NumberToString, (NumSize * sizeof (CHAR16)));
+ StrPtr += NumSize;
+
+ // move pointer 1 more space
+ pBS->CopyMem(StrPtr, Space, 2);
+ StrPtr += 1; // L" "
+
+ pBS->CopyMem(StrPtr, StrOhci, 8);
+ StrPtr += 4; // L"OHCI"
+ if (OhciNumber > 1) {
+ *StrPtr++ = L's'; // L'OHCIs'
+ }
+ Is1stItem = FALSE;
+ }
+
+ if (EhciNumber) {
+ if (!Is1stItem) {
+ pBS->CopyMem(StrPtr, Comma, 4);
+ StrPtr += 2; // L" ,"
+ }
+ ItowEx(EhciNumber, NumberToString, 10, FALSE);
+ NumSize = Wcslen(NumberToString);
+
+ // move pointer 1 more space then string length
+ pBS->CopyMem(StrPtr, NumberToString, (NumSize * sizeof (CHAR16)));
+ StrPtr += NumSize;
+
+ // move pointer 1 more space
+ pBS->CopyMem(StrPtr, Space, 2);
+ StrPtr += 1; // L" "
+
+ pBS->CopyMem(StrPtr, StrEhci, 8);
+ StrPtr += 4; // L"EHCI"
+ if (EhciNumber > 1) {
+ *StrPtr++ = L's'; // L'EHCIs'
+ }
+ Is1stItem = FALSE;
+ }
+
+ if (XhciNumber) {
+ if (!Is1stItem) {
+ pBS->CopyMem(StrPtr, Comma, 4);
+ StrPtr += 2; // L" ,"
+ }
+ ItowEx(XhciNumber, NumberToString, 10, FALSE);
+ NumSize = Wcslen(NumberToString);
+
+ // move pointer 1 more space then string length
+ pBS->CopyMem(StrPtr, NumberToString, (NumSize * sizeof (CHAR16)));
+ StrPtr += NumSize;
+
+ // move pointer 1 more space
+ pBS->CopyMem(StrPtr, Space, 2);
+ StrPtr += 1; // L" "
+
+ pBS->CopyMem(StrPtr, StrXhci, 8);
+ StrPtr += 4; // L"XHCI"
+ if (XhciNumber > 1) {
+ *StrPtr++ = L's'; // L'XHCIs'
+ }
+ Is1stItem = FALSE;
+ }
+
+ pBS->CopyMem(ControllerNumStr, Name, MAX_DEVS_LINE_LENGTH * sizeof(CHAR16));
+
+ return EFI_SUCCESS;
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: GetMassDeviceName
+//
+// Description: This function retrieves the USB mass storage device ASCII name.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+UINT8
+GetMassDeviceName(
+ UINT8 *DevName,
+ UINT8 DevAddr,
+ EFI_USB_PROTOCOL *UsbProtocol
+)
+{
+ CHAR8 Data[48];
+ UINT8 NextDev;
+
+ // Get the name using USBMassAPIGetDeviceInformation
+ NextDev = UsbProtocol->UsbGetNextMassDeviceName(Data, sizeof(Data), DevAddr);
+ if (NextDev != 0xFF) {
+ Sprintf((char*)DevName, "%a", Data);
+ }
+ return NextDev;
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: InitUSBStrings
+//
+// Description: This function is eLink'ed with the chain executed right before
+// the Setup.
+//
+//----------------------------------------------------------------------------
+
+VOID
+InitUSBStrings(
+ EFI_HII_HANDLE HiiHandle,
+ UINT16 Class
+)
+{
+ CHAR16 DevNumStr[MAX_DEVS_LINE_LENGTH];
+ CHAR16 ControllerNumStr[MAX_DEVS_LINE_LENGTH];
+ CHAR8 MassStr[MAX_DEVS_LINE_LENGTH];
+ UINT8 NextDev;
+ UINT16 MassDev[16] = {
+ STRING_TOKEN(STR_USB_MASS_DEVICE1),
+ STRING_TOKEN(STR_USB_MASS_DEVICE2),
+ STRING_TOKEN(STR_USB_MASS_DEVICE3),
+ STRING_TOKEN(STR_USB_MASS_DEVICE4),
+ STRING_TOKEN(STR_USB_MASS_DEVICE5),
+ STRING_TOKEN(STR_USB_MASS_DEVICE6),
+ STRING_TOKEN(STR_USB_MASS_DEVICE7),
+ STRING_TOKEN(STR_USB_MASS_DEVICE8),
+ STRING_TOKEN(STR_USB_MASS_DEVICE9),
+ STRING_TOKEN(STR_USB_MASS_DEVICE10),
+ STRING_TOKEN(STR_USB_MASS_DEVICE11),
+ STRING_TOKEN(STR_USB_MASS_DEVICE12),
+ STRING_TOKEN(STR_USB_MASS_DEVICE13),
+ STRING_TOKEN(STR_USB_MASS_DEVICE14),
+ STRING_TOKEN(STR_USB_MASS_DEVICE15),
+ STRING_TOKEN(STR_USB_MASS_DEVICE16)
+
+ };
+ UINT8 MassDevValid[16];
+ UINT8 i;
+ UINTN VariableSize;
+ USB_MASS_DEV_NUM SetupData;
+ EFI_STATUS Status;
+ EFI_USB_PROTOCOL *UsbProtocol;
+ EFI_GUID UsbProtocolGuid = EFI_USB_PROTOCOL_GUID;
+ CONNECTED_USB_DEVICES_NUM DevNum;
+ UINT32 VariableAttributes = EFI_VARIABLE_BOOTSERVICE_ACCESS;
+ USB_CONTROLLER_NUM UsbControllerNum;
+
+#if USB_SETUP_VARIABLE_RUNTIME_ACCESS
+ VariableAttributes |= EFI_VARIABLE_RUNTIME_ACCESS;
+#endif
+
+
+ if (Class!=ADVANCED_FORM_SET_CLASS) {
+ return;
+ }
+ //(EIP102493+)>
+ InitString(HiiHandle, STRING_TOKEN(STR_USB_MODULE_VER), L"%d.%02d.%02d",
+ USB_DRIVER_MAJOR_VER, USB_DRIVER_MINOR_VER, USB_DRIVER_BUILD_VER);
+ //<(EIP102493+)
+
+ Status = pBS->LocateProtocol(&UsbProtocolGuid, NULL, &UsbProtocol);
+//#### ASSERT_EFI_ERROR(Status);
+ if (EFI_ERROR(Status)) {
+ return;
+ }
+
+ // Number of connected devices
+ GetConnectedDevices(DevNumStr, ControllerNumStr, UsbProtocol, &DevNum);
+
+ TRACE((-1, "Devices total: %d KBDs, %d HUBs, %d MICE, %d POINT %d MASS %d CCID\n",
+ DevNum.NumUsbKbds, DevNum.NumUsbHubs, DevNum.NumUsbMice,
+ DevNum.NumUsbPoint, DevNum.NumUsbMass, DevNum.NumUsbCcids));
+
+ InitString(HiiHandle, STRING_TOKEN(STR_USB_DEVICES_ENABLED_LIST), L"%s", DevNumStr);
+ InitString(HiiHandle, STRING_TOKEN(STR_USB_CONTROLLERS_ENABLED_LIST), L"%s", ControllerNumStr);
+
+ // Mass storage device names
+ for (i = 0, NextDev = 0; i < 16; i++) {
+ NextDev = GetMassDeviceName(MassStr, NextDev, UsbProtocol);
+ if (NextDev == 0xFF) {
+ break; // No more devices
+ }
+ InitString(HiiHandle, MassDev[i], L"%S", MassStr);
+ if (NextDev & 0x80) {
+ break; // Last device
+ }
+ }
+
+ for (i = 0; i < 16; i++) {
+ if (i < DevNum.NumUsbMass) {
+ MassDevValid[i] = 1;
+ } else {
+ MassDevValid[i] = 0;
+ }
+ }
+
+ VariableSize = sizeof(USB_MASS_DEV_VALID);
+
+ Status = pRS->SetVariable(L"UsbMassDevValid",
+ &gEfiSetupGuid,
+ VariableAttributes,
+ VariableSize,
+ &MassDevValid);
+
+ VariableSize = sizeof(SetupData);
+ Status = pRS->GetVariable(L"UsbMassDevNum",
+ &gEfiSetupGuid,
+ NULL,
+ &VariableSize,
+ &SetupData);
+
+ if (EFI_ERROR(Status)) {
+ return;
+ }
+
+ SetupData.IsInteractionAllowed = 0;
+ SetupData.UsbMassDevNum = DevNum.NumUsbMass;
+
+ Status = pRS->SetVariable(L"UsbMassDevNum",
+ &gEfiSetupGuid,
+ VariableAttributes,
+ VariableSize,
+ &SetupData);
+
+ VariableSize = sizeof(UsbControllerNum);
+ Status = pRS->GetVariable(L"UsbControllerNum",
+ &gEfiSetupGuid,
+ NULL,
+ &VariableSize,
+ &UsbControllerNum);
+
+ if (EFI_ERROR(Status)) {
+ return;
+ }
+
+ UsbControllerNum.UhciNum = DevNum.NumUhcis;
+ UsbControllerNum.OhciNum = DevNum.NumOhcis;
+ UsbControllerNum.EhciNum = DevNum.NumEhcis;
+ UsbControllerNum.XhciNum = DevNum.NumXhcis;
+
+ Status = pRS->SetVariable(L"UsbControllerNum",
+ &gEfiSetupGuid,
+ VariableAttributes,
+ VariableSize,
+ &UsbControllerNum);
+
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: UpdateUSBStrings
+//
+// Description: This function is updating usb setup page dynamically.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+VOID
+UpdateUSBStrings(
+ EFI_HII_HANDLE HiiHandle,
+ UINT16 Class,
+ UINT16 SubClass,
+ UINT16 Key
+)
+{
+ UINT8 MassDevValid[16];
+ UINT8 i;
+ UINT8 NextDev;
+ UINTN VariableSize;
+ EFI_GUID UsbProtocolGuid = EFI_USB_PROTOCOL_GUID;
+ EFI_STATUS Status;
+ EFI_USB_PROTOCOL *UsbProtocol;
+ CONNECTED_USB_DEVICES_NUM DevNum;
+ USB_MASS_DEV_NUM MassDevNumData;
+ USB_CONTROLLER_NUM UsbControllerNum;
+ CHAR16 DevNumStr[MAX_DEVS_LINE_LENGTH];
+ CHAR16 ControllerNumStr[MAX_DEVS_LINE_LENGTH];
+ CHAR8 MassStr[MAX_DEVS_LINE_LENGTH];
+ UINT16 MassDev[16] = {
+ STRING_TOKEN(STR_USB_MASS_DEVICE1),
+ STRING_TOKEN(STR_USB_MASS_DEVICE2),
+ STRING_TOKEN(STR_USB_MASS_DEVICE3),
+ STRING_TOKEN(STR_USB_MASS_DEVICE4),
+ STRING_TOKEN(STR_USB_MASS_DEVICE5),
+ STRING_TOKEN(STR_USB_MASS_DEVICE6),
+ STRING_TOKEN(STR_USB_MASS_DEVICE7),
+ STRING_TOKEN(STR_USB_MASS_DEVICE8),
+ STRING_TOKEN(STR_USB_MASS_DEVICE9),
+ STRING_TOKEN(STR_USB_MASS_DEVICE10),
+ STRING_TOKEN(STR_USB_MASS_DEVICE11),
+ STRING_TOKEN(STR_USB_MASS_DEVICE12),
+ STRING_TOKEN(STR_USB_MASS_DEVICE13),
+ STRING_TOKEN(STR_USB_MASS_DEVICE14),
+ STRING_TOKEN(STR_USB_MASS_DEVICE15),
+ STRING_TOKEN(STR_USB_MASS_DEVICE16)
+ };
+
+ if (Key == USB_DEVICES_ENABLED_REFRESH_KEY) {
+
+ Status = pBS->LocateProtocol(&UsbProtocolGuid, NULL, &UsbProtocol);
+
+ if (EFI_ERROR(Status)) {
+ return;
+ }
+
+ // Number of connected devices
+ GetConnectedDevices(DevNumStr, ControllerNumStr, UsbProtocol, &DevNum);
+
+ InitString(HiiHandle, STRING_TOKEN(STR_USB_DEVICES_ENABLED_LIST), L"%s", DevNumStr);
+
+ // Mass storage device names
+ for (i = 0, NextDev = 0; i < 16; i++) {
+ NextDev = GetMassDeviceName(MassStr, NextDev, UsbProtocol);
+ if (NextDev == 0xFF) {
+ break; // No more devices
+ }
+ InitString(HiiHandle, MassDev[i], L"%S", MassStr);
+ if (NextDev & 0x80) {
+ break; // Last device
+ }
+ }
+
+ VariableSize = sizeof(MassDevValid);
+
+ Status = HiiLibGetBrowserData(
+ &VariableSize, &MassDevValid,
+ &gEfiSetupGuid, L"UsbMassDevValid");
+
+ if (EFI_ERROR(Status)) {
+ return;
+ }
+
+ for (i = 0; i < 16; i++) {
+ if (i < DevNum.NumUsbMass) {
+ MassDevValid[i] = 1;
+ } else {
+ MassDevValid[i] = 0;
+ }
+ }
+
+ Status = HiiLibSetBrowserData(
+ VariableSize, &MassDevValid,
+ &gEfiSetupGuid, L"UsbMassDevValid");
+
+ if (EFI_ERROR(Status)) {
+ return;
+ }
+
+ VariableSize = sizeof(MassDevNumData);
+
+ Status = HiiLibGetBrowserData(
+ &VariableSize, &MassDevNumData,
+ &gEfiSetupGuid, L"UsbMassDevNum");
+
+ if (EFI_ERROR(Status)) {
+ return;
+ }
+
+ MassDevNumData.UsbMassDevNum = DevNum.NumUsbMass;
+
+ Status = HiiLibSetBrowserData(
+ VariableSize, &MassDevNumData,
+ &gEfiSetupGuid, L"UsbMassDevNum");
+
+ VariableSize = sizeof(UsbControllerNum);
+
+ Status = HiiLibGetBrowserData(
+ &VariableSize, &UsbControllerNum,
+ &gEfiSetupGuid, L"UsbControllerNum");
+
+ if (EFI_ERROR(Status)) {
+ return;
+ }
+
+ UsbControllerNum.UhciNum = DevNum.NumUhcis;
+ UsbControllerNum.OhciNum = DevNum.NumOhcis;
+ UsbControllerNum.EhciNum = DevNum.NumEhcis;
+ UsbControllerNum.XhciNum = DevNum.NumXhcis;
+
+ Status = HiiLibSetBrowserData(
+ VariableSize, &UsbControllerNum,
+ &gEfiSetupGuid, L"UsbControllerNum");
+
+ }
+
+}
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Core/EM/usb/setup/usbsetup.cif b/Core/EM/usb/setup/usbsetup.cif
new file mode 100644
index 0000000..a81fde2
--- /dev/null
+++ b/Core/EM/usb/setup/usbsetup.cif
@@ -0,0 +1,10 @@
+<component>
+ name = "UsbSetup"
+ category = ModulePart
+ LocalRoot = "core\em\usb\setup"
+ RefName = "USB_SETUP"
+[files]
+"\usb.uni"
+"\usb.sd"
+"\usbsetup.c"
+<endComponent>