aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol')
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AbsolutePointer.h205
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AcpiSystemDescriptionTable.h266
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AcpiTable.h127
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AdapterInformation.h260
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Arp.h385
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AtaPassThru.h471
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AuthenticationInfo.h237
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Bds.h72
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Bis.h451
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BlockIo.h241
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BlockIo2.h206
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BlockIoCrypto.h527
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothAttribute.h283
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothConfig.h529
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothHc.h424
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothIo.h417
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothLeConfig.h634
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BootManagerPolicy.h138
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BusSpecificDriverOverride.h72
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Capsule.h35
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ComponentName.h129
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ComponentName2.h172
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Cpu.h300
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/CpuIo2.h142
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DebugPort.h146
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DebugSupport.h778
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Decompress.h122
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DeferredImageLoad.h80
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DeviceIo.h268
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePath.h1358
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePathFromText.h72
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePathToText.h85
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePathUtilities.h192
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dhcp4.h780
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dhcp6.h786
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DiskInfo.h227
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DiskIo.h117
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DiskIo2.h172
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dns4.h543
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dns6.h539
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverBinding.h201
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverConfiguration.h167
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverConfiguration2.h190
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverDiagnostics.h131
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverDiagnostics2.h111
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverFamilyOverride.h66
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverHealth.h247
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverSupportedEfiVersion.h46
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DxeMmReadyToLock.h25
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DxeSmmReadyToLock.h40
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Eap.h162
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EapConfiguration.h159
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EapManagement.h403
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EapManagement2.h87
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ebc.h314
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EdidActive.h52
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EdidDiscovered.h50
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EdidOverride.h67
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EraseBlock.h105
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ExtendedSalBootService.h214
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ExtendedSalServiceClasses.h275
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FirmwareManagement.h538
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FirmwareVolume2.h762
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FirmwareVolumeBlock.h366
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FormBrowser2.h180
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ftp4.h524
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/GraphicsOutput.h276
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/GuidedSectionExtraction.h141
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Hash.h175
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Hash2.h202
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiConfigAccess.h223
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiConfigKeyword.h201
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiConfigRouting.h419
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiDatabase.h531
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiFont.h472
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiImage.h356
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiImageDecoder.h203
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiImageEx.h251
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiPackageList.h33
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiPopup.h81
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiString.h241
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Http.h522
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HttpBootCallback.h100
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HttpUtilities.h124
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cBusConfigurationManagement.h171
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cEnumerate.h110
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cHost.h152
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cIo.h172
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cMaster.h192
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IScsiInitiatorName.h87
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IdeControllerInit.h565
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IncompatiblePciDeviceSupport.h173
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip4.h612
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip4Config.h182
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip4Config2.h323
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip6.h953
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip6Config.h374
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IpSec.h224
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IpSecConfig.h807
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IsaHc.h116
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Kms.h1343
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacyRegion2.h239
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiController.h265
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiFlash.h201
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiSmmController.h36
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiSmmFlash.h36
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LoadFile.h88
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LoadFile2.h85
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LoadedImage.h88
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ManagedNetwork.h372
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/McaInitPmi.h207
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Metronome.h80
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmAccess.h133
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmBase.h87
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmCommunication.h93
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmConfiguration.h86
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmControl.h106
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmCpu.h247
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmCpuIo.h96
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmEndOfDxe.h30
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmGpiDispatch.h125
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmIoTrapDispatch.h136
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmPciRootBridgeIo.h37
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmPeriodicTimerDispatch.h170
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmPowerButtonDispatch.h117
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmReadyToLock.h32
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmReportStatusCodeHandler.h81
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmStandbyButtonDispatch.h119
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmStatusCode.h65
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmSwDispatch.h136
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmSxDispatch.h135
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmUsbDispatch.h130
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MonotonicCounter.h28
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MpService.h632
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Mtftp4.h593
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Mtftp6.h826
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/NetworkInterfaceIdentifier.h118
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/NvdimmLabel.h351
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/NvmExpressPassthru.h286
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PartitionInfo.h74
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Pcd.h864
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PcdInfo.h105
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciEnumerationComplete.h30
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciHostBridgeResourceAllocation.h428
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciHotPlugInit.h278
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciHotPlugRequest.h170
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciIo.h557
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciOverride.h46
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciPlatform.h344
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciRootBridgeIo.h442
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PiPcd.h424
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PiPcdInfo.h83
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Pkcs7Verify.h229
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PlatformDriverOverride.h140
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PlatformToDriverConfiguration.h355
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PxeBaseCode.h934
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PxeBaseCodeCallBack.h130
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/RamDisk.h106
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/RealTimeClock.h36
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/RegularExpressionProtocol.h178
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ReportStatusCodeHandler.h94
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Reset.h31
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ResetNotification.h86
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Rest.h94
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Rng.h156
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Runtime.h128
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/S3SaveState.h176
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/S3SmmSaveState.h46
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ScsiIo.h317
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ScsiPassThru.h383
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ScsiPassThruExt.h394
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SdMmcPassThru.h264
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Security.h103
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Security2.h107
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SecurityPolicy.h26
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SerialIo.h300
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ServiceBinding.h94
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Shell.h1268
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ShellDynamicCommand.h85
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ShellParameters.h60
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleFileSystem.h562
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleNetwork.h681
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimplePointer.h143
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleTextIn.h133
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleTextInEx.h326
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleTextOut.h415
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmartCardEdge.h739
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmartCardReader.h325
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Smbios.h213
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmbusHc.h295
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmAccess2.h44
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmBase2.h85
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmCommunication.h33
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmConfiguration.h84
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmControl2.h41
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmCpu.h136
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmCpuIo2.h41
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmEndOfDxe.h32
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmGpiDispatch2.h49
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmIoTrapDispatch2.h53
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmPciRootBridgeIo.h34
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmPeriodicTimerDispatch2.h162
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmPowerButtonDispatch2.h42
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmReadyToLock.h34
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmReportStatusCodeHandler.h32
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmStandbyButtonDispatch2.h42
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmStatusCode.h31
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmSwDispatch2.h134
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmSxDispatch2.h38
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmUsbDispatch2.h47
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiConfiguration.h293
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiHc.h194
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiIo.h292
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiNorFlash.h262
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiSmmConfiguration.h36
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiSmmHc.h36
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiSmmNorFlash.h36
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/StatusCode.h59
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/StorageSecurityCommand.h212
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SuperIo.h175
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SuperIoControl.h92
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Supplicant.h464
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TapeIo.h237
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tcg2Protocol.h341
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TcgService.h201
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tcp4.h577
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tcp6.h864
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Timer.h180
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Timestamp.h101
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tls.h461
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TlsConfig.h133
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TrEEProtocol.h249
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Udp4.h445
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Udp6.h580
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UfsDeviceConfig.h143
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UgaDraw.h166
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UgaIo.h197
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UnicodeCollation.h192
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Usb2HostController.h664
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UsbFunctionIo.h687
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UsbHostController.h508
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UsbIo.h512
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UserCredential.h292
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UserCredential2.h314
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UserManager.h624
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Variable.h45
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/VariableWrite.h45
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/VlanConfig.h143
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/WatchdogTimer.h144
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/WiFi.h1129
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/WiFi2.h413
251 files changed, 64198 insertions, 0 deletions
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AbsolutePointer.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AbsolutePointer.h
new file mode 100644
index 0000000000..42693ab20b
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AbsolutePointer.h
@@ -0,0 +1,205 @@
+/** @file
+ The file provides services that allow information about an
+ absolute pointer device to be retrieved.
+
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ABSOLUTE_POINTER_H__
+#define __ABSOLUTE_POINTER_H__
+
+
+#define EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \
+ { 0x8D59D32B, 0xC655, 0x4AE9, { 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43 } }
+
+
+typedef struct _EFI_ABSOLUTE_POINTER_PROTOCOL EFI_ABSOLUTE_POINTER_PROTOCOL;
+
+
+//*******************************************************
+// EFI_ABSOLUTE_POINTER_MODE
+//*******************************************************
+
+
+/**
+ The following data values in the EFI_ABSOLUTE_POINTER_MODE
+ interface are read-only and are changed by using the appropriate
+ interface functions.
+**/
+typedef struct {
+ UINT64 AbsoluteMinX; ///< The Absolute Minimum of the device on the x-axis
+ UINT64 AbsoluteMinY; ///< The Absolute Minimum of the device on the y axis.
+ UINT64 AbsoluteMinZ; ///< The Absolute Minimum of the device on the z-axis
+ UINT64 AbsoluteMaxX; ///< The Absolute Maximum of the device on the x-axis. If 0, and the
+ ///< AbsoluteMinX is 0, then the pointer device does not support a xaxis
+ UINT64 AbsoluteMaxY; ///< The Absolute Maximum of the device on the y -axis. If 0, and the
+ ///< AbsoluteMinX is 0, then the pointer device does not support a yaxis.
+ UINT64 AbsoluteMaxZ; ///< The Absolute Maximum of the device on the z-axis. If 0 , and the
+ ///< AbsoluteMinX is 0, then the pointer device does not support a zaxis
+ UINT32 Attributes; ///< The following bits are set as needed (or'd together) to indicate the
+ ///< capabilities of the device supported. The remaining bits are undefined
+ ///< and should be 0
+} EFI_ABSOLUTE_POINTER_MODE;
+
+///
+/// If set, indicates this device supports an alternate button input.
+///
+#define EFI_ABSP_SupportsAltActive 0x00000001
+
+///
+/// If set, indicates this device returns pressure data in parameter CurrentZ.
+///
+#define EFI_ABSP_SupportsPressureAsZ 0x00000002
+
+
+/**
+ This function resets the pointer device hardware. As part of
+ initialization process, the firmware/device will make a quick
+ but reasonable attempt to verify that the device is
+ functioning. If the ExtendedVerification flag is TRUE the
+ firmware may take an extended amount of time to verify the
+ device is operating on reset. Otherwise the reset operation is
+ to occur as quickly as possible. The hardware verification
+ process is not defined by this specification and is left up to
+ the platform firmware or driver to implement.
+
+ @param This A pointer to the EFI_ABSOLUTE_POINTER_PROTOCOL
+ instance.
+
+ @param ExtendedVerification Indicates that the driver may
+ perform a more exhaustive
+ verification operation of the
+ device during reset.
+
+ @retval EFI_SUCCESS The device was reset.
+
+ @retval EFI_DEVICE_ERROR The device is not functioning
+ correctly and could not be reset.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ABSOLUTE_POINTER_RESET)(
+ IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+);
+
+///
+/// This bit is set if the touch sensor is active.
+///
+#define EFI_ABSP_TouchActive 0x00000001
+
+///
+/// This bit is set if the alt sensor, such as pen-side button, is active
+///
+#define EFI_ABS_AltActive 0x00000002
+
+
+/**
+ Definition of EFI_ABSOLUTE_POINTER_STATE.
+**/
+typedef struct {
+ ///
+ /// The unsigned position of the activation on the x axis. If the AboluteMinX
+ /// and the AboluteMaxX fields of the EFI_ABSOLUTE_POINTER_MODE structure are
+ /// both 0, then this pointer device does not support an x-axis, and this field
+ /// must be ignored.
+ ///
+ UINT64 CurrentX;
+
+ ///
+ /// The unsigned position of the activation on the y axis. If the AboluteMinY
+ /// and the AboluteMaxY fields of the EFI_ABSOLUTE_POINTER_MODE structure are
+ /// both 0, then this pointer device does not support an y-axis, and this field
+ /// must be ignored.
+ ///
+ UINT64 CurrentY;
+
+ ///
+ /// The unsigned position of the activation on the z axis, or the pressure
+ /// measurement. If the AboluteMinZ and the AboluteMaxZ fields of the
+ /// EFI_ABSOLUTE_POINTER_MODE structure are both 0, then this pointer device
+ /// does not support an z-axis, and this field must be ignored.
+ ///
+ UINT64 CurrentZ;
+
+ ///
+ /// Bits are set to 1 in this structure item to indicate that device buttons are
+ /// active.
+ ///
+ UINT32 ActiveButtons;
+} EFI_ABSOLUTE_POINTER_STATE;
+
+/**
+ The GetState() function retrieves the current state of a pointer
+ device. This includes information on the active state associated
+ with the pointer device and the current position of the axes
+ associated with the pointer device. If the state of the pointer
+ device has not changed since the last call to GetState(), then
+ EFI_NOT_READY is returned. If the state of the pointer device
+ has changed since the last call to GetState(), then the state
+ information is placed in State, and EFI_SUCCESS is returned. If
+ a device error occurs while attempting to retrieve the state
+ information, then EFI_DEVICE_ERROR is returned.
+
+
+ @param This A pointer to the EFI_ABSOLUTE_POINTER_PROTOCOL
+ instance.
+
+ @param State A pointer to the state information on the
+ pointer device.
+
+ @retval EFI_SUCCESS The state of the pointer device was
+ returned in State.
+
+ @retval EFI_NOT_READY The state of the pointer device has not
+ changed since the last call to GetState().
+
+ @retval EFI_DEVICE_ERROR A device error occurred while
+ attempting to retrieve the pointer
+ device's current state.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ABSOLUTE_POINTER_GET_STATE)(
+ IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,
+ IN OUT EFI_ABSOLUTE_POINTER_STATE *State
+);
+
+
+///
+/// The EFI_ABSOLUTE_POINTER_PROTOCOL provides a set of services
+/// for a pointer device that can be used as an input device from an
+/// application written to this specification. The services include
+/// the ability to: reset the pointer device, retrieve the state of
+/// the pointer device, and retrieve the capabilities of the pointer
+/// device. The service also provides certain data items describing the device.
+///
+struct _EFI_ABSOLUTE_POINTER_PROTOCOL {
+ EFI_ABSOLUTE_POINTER_RESET Reset;
+ EFI_ABSOLUTE_POINTER_GET_STATE GetState;
+ ///
+ /// Event to use with WaitForEvent() to wait for input from the pointer device.
+ ///
+ EFI_EVENT WaitForInput;
+ ///
+ /// Pointer to EFI_ABSOLUTE_POINTER_MODE data.
+ ///
+ EFI_ABSOLUTE_POINTER_MODE *Mode;
+};
+
+
+extern EFI_GUID gEfiAbsolutePointerProtocolGuid;
+
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AcpiSystemDescriptionTable.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AcpiSystemDescriptionTable.h
new file mode 100644
index 0000000000..b98862f6d8
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AcpiSystemDescriptionTable.h
@@ -0,0 +1,266 @@
+/** @file
+ This protocol provides services for creating ACPI system description tables.
+
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ACPI_SYSTEM_DESCRIPTION_TABLE_H___
+#define __ACPI_SYSTEM_DESCRIPTION_TABLE_H___
+
+#define EFI_ACPI_SDT_PROTOCOL_GUID \
+ { 0xeb97088e, 0xcfdf, 0x49c6, { 0xbe, 0x4b, 0xd9, 0x6, 0xa5, 0xb2, 0xe, 0x86 }}
+
+typedef UINT32 EFI_ACPI_TABLE_VERSION;
+typedef VOID *EFI_ACPI_HANDLE;
+
+#define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)
+#define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)
+#define EFI_ACPI_TABLE_VERSION_2_0 (1 << 2)
+#define EFI_ACPI_TABLE_VERSION_3_0 (1 << 3)
+#define EFI_ACPI_TABLE_VERSION_4_0 (1 << 4)
+#define EFI_ACPI_TABLE_VERSION_5_0 (1 << 5)
+
+typedef UINT32 EFI_ACPI_DATA_TYPE;
+#define EFI_ACPI_DATA_TYPE_NONE 0
+#define EFI_ACPI_DATA_TYPE_OPCODE 1
+#define EFI_ACPI_DATA_TYPE_NAME_STRING 2
+#define EFI_ACPI_DATA_TYPE_OP 3
+#define EFI_ACPI_DATA_TYPE_UINT 4
+#define EFI_ACPI_DATA_TYPE_STRING 5
+#define EFI_ACPI_DATA_TYPE_CHILD 6
+
+typedef struct {
+ UINT32 Signature;
+ UINT32 Length;
+ UINT8 Revision;
+ UINT8 Checksum;
+ CHAR8 OemId[6];
+ CHAR8 OemTableId[8];
+ UINT32 OemRevision;
+ UINT32 CreatorId;
+ UINT32 CreatorRevision;
+} EFI_ACPI_SDT_HEADER;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_NOTIFICATION_FN)(
+ IN EFI_ACPI_SDT_HEADER *Table, ///< A pointer to the ACPI table header.
+ IN EFI_ACPI_TABLE_VERSION Version, ///< The ACPI table's version.
+ IN UINTN TableKey ///< The table key for this ACPI table.
+);
+
+/**
+ Returns a requested ACPI table.
+
+ The GetAcpiTable() function returns a pointer to a buffer containing the ACPI table associated
+ with the Index that was input. The following structures are not considered elements in the list of
+ ACPI tables:
+ - Root System Description Pointer (RSD_PTR)
+ - Root System Description Table (RSDT)
+ - Extended System Description Table (XSDT)
+ Version is updated with a bit map containing all the versions of ACPI of which the table is a
+ member. For tables installed via the EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable() interface,
+ the function returns the value of EFI_ACPI_STD_PROTOCOL.AcpiVersion.
+
+ @param[in] Index The zero-based index of the table to retrieve.
+ @param[out] Table Pointer for returning the table buffer.
+ @param[out] Version On return, updated with the ACPI versions to which this table belongs. Type
+ EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the
+ EFI_ACPI_SDT_PROTOCOL.
+ @param[out] TableKey On return, points to the table key for the specified ACPI system definition table.
+ This is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.
+ The TableKey can be passed to EFI_ACPI_TABLE_PROTOCOL.UninstallAcpiTable()
+ to uninstall the table.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NOT_FOUND The requested index is too large and a table was not found.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_GET_ACPI_TABLE2)(
+ IN UINTN Index,
+ OUT EFI_ACPI_SDT_HEADER **Table,
+ OUT EFI_ACPI_TABLE_VERSION *Version,
+ OUT UINTN *TableKey
+);
+
+/**
+ Register or unregister a callback when an ACPI table is installed.
+
+ This function registers or unregisters a function which will be called whenever a new ACPI table is
+ installed.
+
+ @param[in] Register If TRUE, then the specified function will be registered. If FALSE, then the specified
+ function will be unregistered.
+ @param[in] Notification Points to the callback function to be registered or unregistered.
+
+ @retval EFI_SUCCESS Callback successfully registered or unregistered.
+ @retval EFI_INVALID_PARAMETER Notification is NULL
+ @retval EFI_INVALID_PARAMETER Register is FALSE and Notification does not match a known registration function.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_REGISTER_NOTIFY)(
+ IN BOOLEAN Register,
+ IN EFI_ACPI_NOTIFICATION_FN Notification
+);
+
+/**
+ Create a handle from an ACPI opcode
+
+ @param[in] Buffer Points to the ACPI opcode.
+ @param[out] Handle Upon return, holds the handle.
+
+ @retval EFI_SUCCESS Success
+ @retval EFI_INVALID_PARAMETER Buffer is NULL or Handle is NULL or Buffer points to an
+ invalid opcode.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_OPEN)(
+ IN VOID *Buffer,
+ OUT EFI_ACPI_HANDLE *Handle
+);
+
+/**
+ Create a handle for the first ACPI opcode in an ACPI system description table.
+
+ @param[in] TableKey The table key for the ACPI table, as returned by GetTable().
+ @param[out] Handle On return, points to the newly created ACPI handle.
+
+ @retval EFI_SUCCESS Handle created successfully.
+ @retval EFI_NOT_FOUND TableKey does not refer to a valid ACPI table.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_OPEN_SDT)(
+ IN UINTN TableKey,
+ OUT EFI_ACPI_HANDLE *Handle
+);
+
+/**
+ Close an ACPI handle.
+
+ @param[in] Handle Returns the handle.
+
+ @retval EFI_SUCCESS Success
+ @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_CLOSE)(
+ IN EFI_ACPI_HANDLE Handle
+);
+
+/**
+ Return the child ACPI objects.
+
+ @param[in] ParentHandle Parent handle.
+ @param[in, out] Handle On entry, points to the previously returned handle or NULL to start with the first
+ handle. On return, points to the next returned ACPI handle or NULL if there are no
+ child objects.
+
+ @retval EFI_SUCCESS Success
+ @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_GET_CHILD)(
+ IN EFI_ACPI_HANDLE ParentHandle,
+ IN OUT EFI_ACPI_HANDLE *Handle
+);
+
+/**
+ Retrieve information about an ACPI object.
+
+ @param[in] Handle ACPI object handle.
+ @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right
+ in the ACPI encoding, with index 0 always being the ACPI opcode.
+ @param[out] DataType Points to the returned data type or EFI_ACPI_DATA_TYPE_NONE if no data exists
+ for the specified index.
+ @param[out] Data Upon return, points to the pointer to the data.
+ @param[out] DataSize Upon return, points to the size of Data.
+
+ @retval
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_GET_OPTION)(
+ IN EFI_ACPI_HANDLE Handle,
+ IN UINTN Index,
+ OUT EFI_ACPI_DATA_TYPE *DataType,
+ OUT CONST VOID **Data,
+ OUT UINTN *DataSize
+);
+
+/**
+ Change information about an ACPI object.
+
+ @param[in] Handle ACPI object handle.
+ @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right
+ in the ACPI encoding, with index 0 always being the ACPI opcode.
+ @param[in] Data Points to the data.
+ @param[in] DataSize The size of the Data.
+
+ @retval EFI_SUCCESS Success
+ @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.
+ @retval EFI_BAD_BUFFER_SIZE Data cannot be accommodated in the space occupied by
+ the option.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_SET_OPTION)(
+ IN EFI_ACPI_HANDLE Handle,
+ IN UINTN Index,
+ IN CONST VOID *Data,
+ IN UINTN DataSize
+);
+
+/**
+ Returns the handle of the ACPI object representing the specified ACPI path
+
+ @param[in] HandleIn Points to the handle of the object representing the starting point for the path search.
+ @param[in] AcpiPath Points to the ACPI path, which conforms to the ACPI encoded path format.
+ @param[out] HandleOut On return, points to the ACPI object which represents AcpiPath, relative to
+ HandleIn.
+
+ @retval EFI_SUCCESS Success
+ @retval EFI_INVALID_PARAMETER HandleIn is NULL or does not refer to a valid ACPI object.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_FIND_PATH)(
+ IN EFI_ACPI_HANDLE HandleIn,
+ IN VOID *AcpiPath,
+ OUT EFI_ACPI_HANDLE *HandleOut
+);
+
+typedef struct _EFI_ACPI_SDT_PROTOCOL {
+ ///
+ /// A bit map containing all the ACPI versions supported by this protocol.
+ ///
+ EFI_ACPI_TABLE_VERSION AcpiVersion;
+ EFI_ACPI_GET_ACPI_TABLE2 GetAcpiTable;
+ EFI_ACPI_REGISTER_NOTIFY RegisterNotify;
+ EFI_ACPI_OPEN Open;
+ EFI_ACPI_OPEN_SDT OpenSdt;
+ EFI_ACPI_CLOSE Close;
+ EFI_ACPI_GET_CHILD GetChild;
+ EFI_ACPI_GET_OPTION GetOption;
+ EFI_ACPI_SET_OPTION SetOption;
+ EFI_ACPI_FIND_PATH FindPath;
+} EFI_ACPI_SDT_PROTOCOL;
+
+extern EFI_GUID gEfiAcpiSdtProtocolGuid;
+
+#endif // __ACPI_SYSTEM_DESCRIPTION_TABLE_H___
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AcpiTable.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AcpiTable.h
new file mode 100644
index 0000000000..c608182326
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AcpiTable.h
@@ -0,0 +1,127 @@
+/** @file
+ The file provides the protocol to install or remove an ACPI
+ table from a platform.
+
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ACPI_TABLE_H___
+#define __ACPI_TABLE_H___
+
+#define EFI_ACPI_TABLE_PROTOCOL_GUID \
+ { 0xffe06bdd, 0x6107, 0x46a6, { 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c }}
+
+
+typedef struct _EFI_ACPI_TABLE_PROTOCOL EFI_ACPI_TABLE_PROTOCOL;
+
+/**
+
+ The InstallAcpiTable() function allows a caller to install an
+ ACPI table. When successful, the table will be linked by the
+ RSDT/XSDT. AcpiTableBuffer specifies the table to be installed.
+ InstallAcpiTable() will make a copy of the table and insert the
+ copy into the RSDT/XSDT. InstallAcpiTable() must insert the new
+ table at the end of the RSDT/XSDT. To prevent namespace
+ collision, ACPI tables may be created using UEFI ACPI table
+ format. If this protocol is used to install a table with a
+ signature already present in the system, the new table will not
+ replace the existing table. It is a platform implementation
+ decision to add a new table with a signature matching an
+ existing table or disallow duplicate table signatures and
+ return EFI_ACCESS_DENIED. On successful output, TableKey is
+ initialized with a unique key. Its value may be used in a
+ subsequent call to UninstallAcpiTable to remove an ACPI table.
+ If an EFI application is running at the time of this call, the
+ relevant EFI_CONFIGURATION_TABLE pointer to the RSDT is no
+ longer considered valid.
+
+
+ @param This A pointer to a EFI_ACPI_TABLE_PROTOCOL.
+
+ @param AcpiTableBuffer A pointer to a buffer containing the
+ ACPI table to be installed.
+
+ @param AcpiTableBufferSize Specifies the size, in bytes, of
+ the AcpiTableBuffer buffer.
+
+
+ @param TableKey Returns a key to refer to the ACPI table.
+
+ @retval EFI_SUCCESS The table was successfully inserted
+
+ @retval EFI_INVALID_PARAMETER Either AcpiTableBuffer is NULL,
+ TableKey is NULL, or
+ AcpiTableBufferSize and the size
+ field embedded in the ACPI table
+ pointed to by AcpiTableBuffer
+ are not in sync.
+
+ @retval EFI_OUT_OF_RESOURCES Insufficient resources exist to
+ complete the request.
+ @retval EFI_ACCESS_DENIED The table signature matches a table already
+ present in the system and platform policy
+ does not allow duplicate tables of this type.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_TABLE_INSTALL_ACPI_TABLE)(
+ IN EFI_ACPI_TABLE_PROTOCOL *This,
+ IN VOID *AcpiTableBuffer,
+ IN UINTN AcpiTableBufferSize,
+ OUT UINTN *TableKey
+);
+
+
+/**
+
+ The UninstallAcpiTable() function allows a caller to remove an
+ ACPI table. The routine will remove its reference from the
+ RSDT/XSDT. A table is referenced by the TableKey parameter
+ returned from a prior call to InstallAcpiTable(). If an EFI
+ application is running at the time of this call, the relevant
+ EFI_CONFIGURATION_TABLE pointer to the RSDT is no longer
+ considered valid.
+
+ @param This A pointer to a EFI_ACPI_TABLE_PROTOCOL.
+
+ @param TableKey Specifies the table to uninstall. The key was
+ returned from InstallAcpiTable().
+
+ @retval EFI_SUCCESS The table was successfully inserted
+
+ @retval EFI_NOT_FOUND TableKey does not refer to a valid key
+ for a table entry.
+
+ @retval EFI_OUT_OF_RESOURCES Insufficient resources exist to
+ complete the request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE)(
+ IN EFI_ACPI_TABLE_PROTOCOL *This,
+ IN UINTN TableKey
+);
+
+///
+/// The EFI_ACPI_TABLE_PROTOCOL provides the ability for a component
+/// to install and uninstall ACPI tables from a platform.
+///
+struct _EFI_ACPI_TABLE_PROTOCOL {
+ EFI_ACPI_TABLE_INSTALL_ACPI_TABLE InstallAcpiTable;
+ EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE UninstallAcpiTable;
+};
+
+extern EFI_GUID gEfiAcpiTableProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AdapterInformation.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AdapterInformation.h
new file mode 100644
index 0000000000..daaff3fe04
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AdapterInformation.h
@@ -0,0 +1,260 @@
+/** @file
+ EFI Adapter Information Protocol definition.
+ The EFI Adapter Information Protocol is used to dynamically and quickly discover
+ or set device information for an adapter.
+
+ Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.4
+
+**/
+
+#ifndef __EFI_ADAPTER_INFORMATION_PROTOCOL_H__
+#define __EFI_ADAPTER_INFORMATION_PROTOCOL_H__
+
+
+#define EFI_ADAPTER_INFORMATION_PROTOCOL_GUID \
+ { \
+ 0xE5DD1403, 0xD622, 0xC24E, {0x84, 0x88, 0xC7, 0x1B, 0x17, 0xF5, 0xE8, 0x02 } \
+ }
+
+#define EFI_ADAPTER_INFO_MEDIA_STATE_GUID \
+ { \
+ 0xD7C74207, 0xA831, 0x4A26, {0xB1, 0xF5, 0xD1, 0x93, 0x06, 0x5C, 0xE8, 0xB6 } \
+ }
+
+#define EFI_ADAPTER_INFO_NETWORK_BOOT_GUID \
+ { \
+ 0x1FBD2960, 0x4130, 0x41E5, {0x94, 0xAC, 0xD2, 0xCF, 0x03, 0x7F, 0xB3, 0x7C } \
+ }
+
+#define EFI_ADAPTER_INFO_SAN_MAC_ADDRESS_GUID \
+ { \
+ 0x114da5ef, 0x2cf1, 0x4e12, {0x9b, 0xbb, 0xc4, 0x70, 0xb5, 0x52, 0x5, 0xd9 } \
+ }
+
+#define EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT_GUID \
+ { \
+ 0x4bd56be3, 0x4975, 0x4d8a, {0xa0, 0xad, 0xc4, 0x91, 0x20, 0x4b, 0x5d, 0x4d} \
+ }
+
+#define EFI_ADAPTER_INFO_MEDIA_TYPE_GUID \
+ { \
+ 0x8484472f, 0x71ec, 0x411a, { 0xb3, 0x9c, 0x62, 0xcd, 0x94, 0xd9, 0x91, 0x6e } \
+ }
+
+
+typedef struct _EFI_ADAPTER_INFORMATION_PROTOCOL EFI_ADAPTER_INFORMATION_PROTOCOL;
+
+///
+/// EFI_ADAPTER_INFO_MEDIA_STATE
+///
+typedef struct {
+ ///
+ /// Returns the current media state status. MediaState can have any of the following values:
+ /// EFI_SUCCESS: There is media attached to the network adapter. EFI_NOT_READY: This detects a bounced state.
+ /// There was media attached to the network adapter, but it was removed and reattached. EFI_NO_MEDIA: There is
+ /// not any media attached to the network.
+ ///
+ EFI_STATUS MediaState;
+} EFI_ADAPTER_INFO_MEDIA_STATE;
+
+///
+/// EFI_ADAPTER_INFO_MEDIA_TYPE
+///
+typedef struct {
+ ///
+ /// Indicates the current media type. MediaType can have any of the following values:
+ /// 1: Ethernet Network Adapter
+ /// 2: Ethernet Wireless Network Adapter
+ /// 3~255: Reserved
+ ///
+ UINT8 MediaType;
+} EFI_ADAPTER_INFO_MEDIA_TYPE;
+
+///
+/// EFI_ADAPTER_INFO_NETWORK_BOOT
+///
+typedef struct {
+ ///
+ /// TRUE if the adapter supports booting from iSCSI IPv4 targets.
+ ///
+ BOOLEAN iScsiIpv4BootCapablity;
+ ///
+ /// TRUE if the adapter supports booting from iSCSI IPv6 targets.
+ ///
+ BOOLEAN iScsiIpv6BootCapablity;
+ ///
+ /// TRUE if the adapter supports booting from FCoE targets.
+ ///
+ BOOLEAN FCoeBootCapablity;
+ ///
+ /// TRUE if the adapter supports an offload engine (such as TCP
+ /// Offload Engine (TOE)) for its iSCSI or FCoE boot operations.
+ ///
+ BOOLEAN OffloadCapability;
+ ///
+ /// TRUE if the adapter supports multipath I/O (MPIO) for its iSCSI
+ /// boot operations.
+ ///
+ BOOLEAN iScsiMpioCapability;
+ ///
+ /// TRUE if the adapter is currently configured to boot from iSCSI
+ /// IPv4 targets.
+ ///
+ BOOLEAN iScsiIpv4Boot;
+ ///
+ /// TRUE if the adapter is currently configured to boot from iSCSI
+ /// IPv6 targets.
+ ///
+ BOOLEAN iScsiIpv6Boot;
+ ///
+ /// TRUE if the adapter is currently configured to boot from FCoE targets.
+ ///
+ BOOLEAN FCoeBoot;
+} EFI_ADAPTER_INFO_NETWORK_BOOT;
+
+///
+/// EFI_ADAPTER_INFO_SAN_MAC_ADDRESS
+///
+typedef struct {
+ ///
+ /// Returns the SAN MAC address for the adapter.For adapters that support today's 802.3 ethernet
+ /// networking and Fibre-Channel Over Ethernet (FCOE), this conveys the FCOE SAN MAC address from the adapter.
+ ///
+ EFI_MAC_ADDRESS SanMacAddress;
+} EFI_ADAPTER_INFO_SAN_MAC_ADDRESS;
+
+///
+/// EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT
+///
+typedef struct {
+ ///
+ /// Returns capability of UNDI to support IPv6 traffic.
+ ///
+ BOOLEAN Ipv6Support;
+} EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT;
+
+/**
+ Returns the current state information for the adapter.
+
+ This function returns information of type InformationType from the adapter.
+ If an adapter does not support the requested informational type, then
+ EFI_UNSUPPORTED is returned.
+
+ @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.
+ @param[in] InformationType A pointer to an EFI_GUID that defines the contents of InformationBlock.
+ @param[out] InforamtionBlock The service returns a pointer to the buffer with the InformationBlock
+ structure which contains details about the data specific to InformationType.
+ @param[out] InforamtionBlockSize The driver returns the size of the InformationBlock in bytes.
+
+ @retval EFI_SUCCESS The InformationType information was retrieved.
+ @retval EFI_UNSUPPORTED The InformationType is not known.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER InformationBlock is NULL.
+ @retval EFI_INVALID_PARAMETER InformationBlockSize is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ADAPTER_INFO_GET_INFO)(
+ IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,
+ IN EFI_GUID *InformationType,
+ OUT VOID **InformationBlock,
+ OUT UINTN *InformationBlockSize
+ );
+
+/**
+ Sets state information for an adapter.
+
+ This function sends information of type InformationType for an adapter.
+ If an adapter does not support the requested information type, then EFI_UNSUPPORTED
+ is returned.
+
+ @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.
+ @param[in] InformationType A pointer to an EFI_GUID that defines the contents of InformationBlock.
+ @param[in] InforamtionBlock A pointer to the InformationBlock structure which contains details
+ about the data specific to InformationType.
+ @param[in] InforamtionBlockSize The size of the InformationBlock in bytes.
+
+ @retval EFI_SUCCESS The information was received and interpreted successfully.
+ @retval EFI_UNSUPPORTED The InformationType is not known.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER InformationBlock is NULL.
+ @retval EFI_WRITE_PROTECTED The InformationType cannot be modified using EFI_ADAPTER_INFO_SET_INFO().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ADAPTER_INFO_SET_INFO)(
+ IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,
+ IN EFI_GUID *InformationType,
+ IN VOID *InformationBlock,
+ IN UINTN InformationBlockSize
+ );
+
+/**
+ Get a list of supported information types for this instance of the protocol.
+
+ This function returns a list of InformationType GUIDs that are supported on an
+ adapter with this instance of EFI_ADAPTER_INFORMATION_PROTOCOL. The list is returned
+ in InfoTypesBuffer, and the number of GUID pointers in InfoTypesBuffer is returned in
+ InfoTypesBufferCount.
+
+ @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.
+ @param[out] InfoTypesBuffer A pointer to the array of InformationType GUIDs that are supported
+ by This.
+ @param[out] InfoTypesBufferCount A pointer to the number of GUIDs present in InfoTypesBuffer.
+
+ @retval EFI_SUCCESS The list of information type GUIDs that are supported on this adapter was
+ returned in InfoTypesBuffer. The number of information type GUIDs was
+ returned in InfoTypesBufferCount.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER InfoTypesBuffer is NULL.
+ @retval EFI_INVALID_PARAMETER InfoTypesBufferCount is NULL.
+ @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the results.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ADAPTER_INFO_GET_SUPPORTED_TYPES)(
+ IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,
+ OUT EFI_GUID **InfoTypesBuffer,
+ OUT UINTN *InfoTypesBufferCount
+ );
+
+///
+/// EFI_ADAPTER_INFORMATION_PROTOCOL
+/// The protocol for adapter provides the following services.
+/// - Gets device state information from adapter.
+/// - Sets device information for adapter.
+/// - Gets a list of supported information types for this instance of the protocol.
+///
+struct _EFI_ADAPTER_INFORMATION_PROTOCOL {
+ EFI_ADAPTER_INFO_GET_INFO GetInformation;
+ EFI_ADAPTER_INFO_SET_INFO SetInformation;
+ EFI_ADAPTER_INFO_GET_SUPPORTED_TYPES GetSupportedTypes;
+};
+
+extern EFI_GUID gEfiAdapterInformationProtocolGuid;
+
+extern EFI_GUID gEfiAdapterInfoMediaStateGuid;
+
+extern EFI_GUID gEfiAdapterInfoNetworkBootGuid;
+
+extern EFI_GUID gEfiAdapterInfoSanMacAddressGuid;
+
+extern EFI_GUID gEfiAdapterInfoUndiIpv6SupportGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Arp.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Arp.h
new file mode 100644
index 0000000000..0295cc644d
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Arp.h
@@ -0,0 +1,385 @@
+/** @file
+ EFI ARP Protocol Definition
+
+ The EFI ARP Service Binding Protocol is used to locate EFI
+ ARP Protocol drivers to create and destroy child of the
+ driver to communicate with other host using ARP protocol.
+ The EFI ARP Protocol provides services to map IP network
+ address to hardware address used by a data link protocol.
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI Specification 2.0.
+
+**/
+
+#ifndef __EFI_ARP_PROTOCOL_H__
+#define __EFI_ARP_PROTOCOL_H__
+
+#define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0xf44c00ee, 0x1f2c, 0x4a00, {0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3 } \
+ }
+
+#define EFI_ARP_PROTOCOL_GUID \
+ { \
+ 0xf4b427bb, 0xba21, 0x4f16, {0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } \
+ }
+
+typedef struct _EFI_ARP_PROTOCOL EFI_ARP_PROTOCOL;
+
+typedef struct {
+ ///
+ /// Length in bytes of this entry.
+ ///
+ UINT32 Size;
+
+ ///
+ /// Set to TRUE if this entry is a "deny" entry.
+ /// Set to FALSE if this entry is a "normal" entry.
+ ///
+ BOOLEAN DenyFlag;
+
+ ///
+ /// Set to TRUE if this entry will not time out.
+ /// Set to FALSE if this entry will time out.
+ ///
+ BOOLEAN StaticFlag;
+
+ ///
+ /// 16-bit ARP hardware identifier number.
+ ///
+ UINT16 HwAddressType;
+
+ ///
+ /// 16-bit protocol type number.
+ ///
+ UINT16 SwAddressType;
+
+ ///
+ /// The length of the hardware address.
+ ///
+ UINT8 HwAddressLength;
+
+ ///
+ /// The length of the protocol address.
+ ///
+ UINT8 SwAddressLength;
+} EFI_ARP_FIND_DATA;
+
+typedef struct {
+ ///
+ /// 16-bit protocol type number in host byte order.
+ ///
+ UINT16 SwAddressType;
+
+ ///
+ /// The length in bytes of the station's protocol address to register.
+ ///
+ UINT8 SwAddressLength;
+
+ ///
+ /// The pointer to the first byte of the protocol address to register. For
+ /// example, if SwAddressType is 0x0800 (IP), then
+ /// StationAddress points to the first byte of this station's IP
+ /// address stored in network byte order.
+ ///
+ VOID *StationAddress;
+
+ ///
+ /// The timeout value in 100-ns units that is associated with each
+ /// new dynamic ARP cache entry. If it is set to zero, the value is
+ /// implementation-specific.
+ ///
+ UINT32 EntryTimeOut;
+
+ ///
+ /// The number of retries before a MAC address is resolved. If it is
+ /// set to zero, the value is implementation-specific.
+ ///
+ UINT32 RetryCount;
+
+ ///
+ /// The timeout value in 100-ns units that is used to wait for the ARP
+ /// reply packet or the timeout value between two retries. Set to zero
+ /// to use implementation-specific value.
+ ///
+ UINT32 RetryTimeOut;
+} EFI_ARP_CONFIG_DATA;
+
+
+/**
+ This function is used to assign a station address to the ARP cache for this instance
+ of the ARP driver.
+
+ Each ARP instance has one station address. The EFI_ARP_PROTOCOL driver will
+ respond to ARP requests that match this registered station address. A call to
+ this function with the ConfigData field set to NULL will reset this ARP instance.
+
+ Once a protocol type and station address have been assigned to this ARP instance,
+ all the following ARP functions will use this information. Attempting to change
+ the protocol type or station address to a configured ARP instance will result in errors.
+
+ @param This The pointer to the EFI_ARP_PROTOCOL instance.
+ @param ConfigData The pointer to the EFI_ARP_CONFIG_DATA structure.
+
+ @retval EFI_SUCCESS The new station address was successfully
+ registered.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ * This is NULL.
+ * SwAddressLength is zero when ConfigData is not NULL.
+ * StationAddress is NULL when ConfigData is not NULL.
+ @retval EFI_ACCESS_DENIED The SwAddressType, SwAddressLength, or
+ StationAddress is different from the one that is
+ already registered.
+ @retval EFI_OUT_OF_RESOURCES Storage for the new StationAddress could not be
+ allocated.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ARP_CONFIGURE)(
+ IN EFI_ARP_PROTOCOL *This,
+ IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL
+ );
+
+/**
+ This function is used to insert entries into the ARP cache.
+
+ ARP cache entries are typically inserted and updated by network protocol drivers
+ as network traffic is processed. Most ARP cache entries will time out and be
+ deleted if the network traffic stops. ARP cache entries that were inserted
+ by the Add() function may be static (will not time out) or dynamic (will time out).
+ Default ARP cache timeout values are not covered in most network protocol
+ specifications (although RFC 1122 comes pretty close) and will only be
+ discussed in general terms in this specification. The timeout values that are
+ used in the EFI Sample Implementation should be used only as a guideline.
+ Final product implementations of the EFI network stack should be tuned for
+ their expected network environments.
+
+ @param This Pointer to the EFI_ARP_PROTOCOL instance.
+ @param DenyFlag Set to TRUE if this entry is a deny entry. Set to
+ FALSE if this entry is a normal entry.
+ @param TargetSwAddress Pointer to a protocol address to add (or deny).
+ May be set to NULL if DenyFlag is TRUE.
+ @param TargetHwAddress Pointer to a hardware address to add (or deny).
+ May be set to NULL if DenyFlag is TRUE.
+ @param TimeoutValue Time in 100-ns units that this entry will remain
+ in the ARP cache. A value of zero means that the
+ entry is permanent. A nonzero value will override
+ the one given by Configure() if the entry to be
+ added is a dynamic entry.
+ @param Overwrite If TRUE, the matching cache entry will be
+ overwritten with the supplied parameters. If
+ FALSE, EFI_ACCESS_DENIED is returned if the
+ corresponding cache entry already exists.
+
+ @retval EFI_SUCCESS The entry has been added or updated.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ * This is NULL.
+ * DenyFlag is FALSE and TargetHwAddress is NULL.
+ * DenyFlag is FALSE and TargetSwAddress is NULL.
+ * TargetHwAddress is NULL and TargetSwAddress is NULL.
+ * Neither TargetSwAddress nor TargetHwAddress are NULL when DenyFlag is
+ TRUE.
+ @retval EFI_OUT_OF_RESOURCES The new ARP cache entry could not be allocated.
+ @retval EFI_ACCESS_DENIED The ARP cache entry already exists and Overwrite
+ is not true.
+ @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ARP_ADD)(
+ IN EFI_ARP_PROTOCOL *This,
+ IN BOOLEAN DenyFlag,
+ IN VOID *TargetSwAddress OPTIONAL,
+ IN VOID *TargetHwAddress OPTIONAL,
+ IN UINT32 TimeoutValue,
+ IN BOOLEAN Overwrite
+ );
+
+/**
+ This function searches the ARP cache for matching entries and allocates a buffer into
+ which those entries are copied.
+
+ The first part of the allocated buffer is EFI_ARP_FIND_DATA, following which
+ are protocol address pairs and hardware address pairs.
+ When finding a specific protocol address (BySwAddress is TRUE and AddressBuffer
+ is not NULL), the ARP cache timeout for the found entry is reset if Refresh is
+ set to TRUE. If the found ARP cache entry is a permanent entry, it is not
+ affected by Refresh.
+
+ @param This The pointer to the EFI_ARP_PROTOCOL instance.
+ @param BySwAddress Set to TRUE to look for matching software protocol
+ addresses. Set to FALSE to look for matching
+ hardware protocol addresses.
+ @param AddressBuffer The pointer to the address buffer. Set to NULL
+ to match all addresses.
+ @param EntryLength The size of an entry in the entries buffer.
+ @param EntryCount The number of ARP cache entries that are found by
+ the specified criteria.
+ @param Entries The pointer to the buffer that will receive the ARP
+ cache entries.
+ @param Refresh Set to TRUE to refresh the timeout value of the
+ matching ARP cache entry.
+
+ @retval EFI_SUCCESS The requested ARP cache entries were copied into
+ the buffer.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL. Both EntryCount and EntryLength are
+ NULL, when Refresh is FALSE.
+ @retval EFI_NOT_FOUND No matching entries were found.
+ @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ARP_FIND)(
+ IN EFI_ARP_PROTOCOL *This,
+ IN BOOLEAN BySwAddress,
+ IN VOID *AddressBuffer OPTIONAL,
+ OUT UINT32 *EntryLength OPTIONAL,
+ OUT UINT32 *EntryCount OPTIONAL,
+ OUT EFI_ARP_FIND_DATA **Entries OPTIONAL,
+ IN BOOLEAN Refresh
+ );
+
+
+/**
+ This function removes specified ARP cache entries.
+
+ @param This The pointer to the EFI_ARP_PROTOCOL instance.
+ @param BySwAddress Set to TRUE to delete matching protocol addresses.
+ Set to FALSE to delete matching hardware
+ addresses.
+ @param AddressBuffer The pointer to the address buffer that is used as a
+ key to look for the cache entry. Set to NULL to
+ delete all entries.
+
+ @retval EFI_SUCCESS The entry was removed from the ARP cache.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_FOUND The specified deletion key was not found.
+ @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ARP_DELETE)(
+ IN EFI_ARP_PROTOCOL *This,
+ IN BOOLEAN BySwAddress,
+ IN VOID *AddressBuffer OPTIONAL
+ );
+
+/**
+ This function delete all dynamic entries from the ARP cache that match the specified
+ software protocol type.
+
+ @param This The pointer to the EFI_ARP_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The cache has been flushed.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_FOUND There are no matching dynamic cache entries.
+ @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ARP_FLUSH)(
+ IN EFI_ARP_PROTOCOL *This
+ );
+
+/**
+ This function tries to resolve the TargetSwAddress and optionally returns a
+ TargetHwAddress if it already exists in the ARP cache.
+
+ @param This The pointer to the EFI_ARP_PROTOCOL instance.
+ @param TargetSwAddress The pointer to the protocol address to resolve.
+ @param ResolvedEvent The pointer to the event that will be signaled when
+ the address is resolved or some error occurs.
+ @param TargetHwAddress The pointer to the buffer for the resolved hardware
+ address in network byte order.
+
+ @retval EFI_SUCCESS The data is copied from the ARP cache into the
+ TargetHwAddress buffer.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL. TargetHwAddress is NULL.
+ @retval EFI_ACCESS_DENIED The requested address is not present in the normal
+ ARP cache but is present in the deny address list.
+ Outgoing traffic to that address is forbidden.
+ @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
+ @retval EFI_NOT_READY The request has been started and is not finished.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ARP_REQUEST)(
+ IN EFI_ARP_PROTOCOL *This,
+ IN VOID *TargetSwAddress OPTIONAL,
+ IN EFI_EVENT ResolvedEvent OPTIONAL,
+ OUT VOID *TargetHwAddress
+ );
+
+/**
+ This function aborts the previous ARP request (identified by This, TargetSwAddress
+ and ResolvedEvent) that is issued by EFI_ARP_PROTOCOL.Request().
+
+ If the request is in the internal ARP request queue, the request is aborted
+ immediately and its ResolvedEvent is signaled. Only an asynchronous address
+ request needs to be canceled. If TargeSwAddress and ResolveEvent are both
+ NULL, all the pending asynchronous requests that have been issued by This
+ instance will be cancelled and their corresponding events will be signaled.
+
+ @param This The pointer to the EFI_ARP_PROTOCOL instance.
+ @param TargetSwAddress The pointer to the protocol address in previous
+ request session.
+ @param ResolvedEvent Pointer to the event that is used as the
+ notification event in previous request session.
+
+ @retval EFI_SUCCESS The pending request session(s) is/are aborted and
+ corresponding event(s) is/are signaled.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL. TargetSwAddress is not NULL and
+ ResolvedEvent is NULL. TargetSwAddress is NULL and
+ ResolvedEvent is not NULL.
+ @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
+ @retval EFI_NOT_FOUND The request is not issued by
+ EFI_ARP_PROTOCOL.Request().
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ARP_CANCEL)(
+ IN EFI_ARP_PROTOCOL *This,
+ IN VOID *TargetSwAddress OPTIONAL,
+ IN EFI_EVENT ResolvedEvent OPTIONAL
+ );
+
+///
+/// ARP is used to resolve local network protocol addresses into
+/// network hardware addresses.
+///
+struct _EFI_ARP_PROTOCOL {
+ EFI_ARP_CONFIGURE Configure;
+ EFI_ARP_ADD Add;
+ EFI_ARP_FIND Find;
+ EFI_ARP_DELETE Delete;
+ EFI_ARP_FLUSH Flush;
+ EFI_ARP_REQUEST Request;
+ EFI_ARP_CANCEL Cancel;
+};
+
+
+extern EFI_GUID gEfiArpServiceBindingProtocolGuid;
+extern EFI_GUID gEfiArpProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AtaPassThru.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AtaPassThru.h
new file mode 100644
index 0000000000..1cc596f9e4
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AtaPassThru.h
@@ -0,0 +1,471 @@
+/** @file
+ The EFI_ATA_PASS_THRU_PROTOCOL provides information about an ATA controller and the ability
+ to send ATA Command Blocks to any ATA device attached to that ATA controller. The information
+ includes the attributes of the ATA controller.
+
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ATA_PASS_THROUGH_H__
+#define __ATA_PASS_THROUGH_H__
+
+#define EFI_ATA_PASS_THRU_PROTOCOL_GUID \
+ { \
+ 0x1d3de7f0, 0x807, 0x424f, {0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f } \
+ }
+
+typedef struct _EFI_ATA_PASS_THRU_PROTOCOL EFI_ATA_PASS_THRU_PROTOCOL;
+
+typedef struct {
+ UINT32 Attributes;
+ UINT32 IoAlign;
+} EFI_ATA_PASS_THRU_MODE;
+
+///
+/// If this bit is set, then the EFI_ATA_PASS_THRU_PROTOCOL interface is for physical
+/// devices on the ATA controller.
+///
+#define EFI_ATA_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001
+///
+/// If this bit is set, then the EFI_ATA_PASS_THRU_PROTOCOL interface is for logical
+/// devices on the ATA controller.
+///
+#define EFI_ATA_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002
+///
+/// If this bit is set, then the EFI_ATA_PASS_THRU_PROTOCOL interface supports non blocking
+/// I/O. Every EFI_ATA_PASS_THRU_PROTOCOL must support blocking I/O. The support of non-blocking
+/// I/O is optional.
+///
+#define EFI_ATA_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004
+
+typedef struct _EFI_ATA_COMMAND_BLOCK {
+ UINT8 Reserved1[2];
+ UINT8 AtaCommand;
+ UINT8 AtaFeatures;
+ UINT8 AtaSectorNumber;
+ UINT8 AtaCylinderLow;
+ UINT8 AtaCylinderHigh;
+ UINT8 AtaDeviceHead;
+ UINT8 AtaSectorNumberExp;
+ UINT8 AtaCylinderLowExp;
+ UINT8 AtaCylinderHighExp;
+ UINT8 AtaFeaturesExp;
+ UINT8 AtaSectorCount;
+ UINT8 AtaSectorCountExp;
+ UINT8 Reserved2[6];
+} EFI_ATA_COMMAND_BLOCK;
+
+typedef struct _EFI_ATA_STATUS_BLOCK {
+ UINT8 Reserved1[2];
+ UINT8 AtaStatus;
+ UINT8 AtaError;
+ UINT8 AtaSectorNumber;
+ UINT8 AtaCylinderLow;
+ UINT8 AtaCylinderHigh;
+ UINT8 AtaDeviceHead;
+ UINT8 AtaSectorNumberExp;
+ UINT8 AtaCylinderLowExp;
+ UINT8 AtaCylinderHighExp;
+ UINT8 Reserved2;
+ UINT8 AtaSectorCount;
+ UINT8 AtaSectorCountExp;
+ UINT8 Reserved3[6];
+} EFI_ATA_STATUS_BLOCK;
+
+typedef UINT8 EFI_ATA_PASS_THRU_CMD_PROTOCOL;
+
+#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_HARDWARE_RESET 0x00
+#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_SOFTWARE_RESET 0x01
+#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_NON_DATA 0x02
+#define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_IN 0x04
+#define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_OUT 0x05
+#define EFI_ATA_PASS_THRU_PROTOCOL_DMA 0x06
+#define EFI_ATA_PASS_THRU_PROTOCOL_DMA_QUEUED 0x07
+#define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_DIAGNOSTIC 0x08
+#define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_RESET 0x09
+#define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_IN 0x0A
+#define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_OUT 0x0B
+#define EFI_ATA_PASS_THRU_PROTOCOL_FPDMA 0x0C
+#define EFI_ATA_PASS_THRU_PROTOCOL_RETURN_RESPONSE 0xFF
+
+typedef UINT8 EFI_ATA_PASS_THRU_LENGTH;
+
+#define EFI_ATA_PASS_THRU_LENGTH_BYTES 0x80
+
+
+#define EFI_ATA_PASS_THRU_LENGTH_MASK 0x70
+#define EFI_ATA_PASS_THRU_LENGTH_NO_DATA_TRANSFER 0x00
+#define EFI_ATA_PASS_THRU_LENGTH_FEATURES 0x10
+#define EFI_ATA_PASS_THRU_LENGTH_SECTOR_COUNT 0x20
+#define EFI_ATA_PASS_THRU_LENGTH_TPSIU 0x30
+
+#define EFI_ATA_PASS_THRU_LENGTH_COUNT 0x0F
+
+typedef struct {
+ ///
+ /// A pointer to the sense data that was generated by the execution of the ATA
+ /// command. It must be aligned to the boundary specified in the IoAlign field
+ /// in the EFI_ATA_PASS_THRU_MODE structure.
+ ///
+ EFI_ATA_STATUS_BLOCK *Asb;
+ ///
+ /// A pointer to buffer that contains the Command Data Block to send to the ATA
+ /// device specified by Port and PortMultiplierPort.
+ ///
+ EFI_ATA_COMMAND_BLOCK *Acb;
+ ///
+ /// The timeout, in 100 ns units, to use for the execution of this ATA command.
+ /// A Timeout value of 0 means that this function will wait indefinitely for the
+ /// ATA command to execute. If Timeout is greater than zero, then this function
+ /// will return EFI_TIMEOUT if the time required to execute the ATA command is
+ /// greater than Timeout.
+ ///
+ UINT64 Timeout;
+ ///
+ /// A pointer to the data buffer to transfer between the ATA controller and the
+ /// ATA device for read and bidirectional commands. For all write and non data
+ /// commands where InTransferLength is 0 this field is optional and may be NULL.
+ /// If this field is not NULL, then it must be aligned on the boundary specified
+ /// by the IoAlign field in the EFI_ATA_PASS_THRU_MODE structure.
+ ///
+ VOID *InDataBuffer;
+ ///
+ /// A pointer to the data buffer to transfer between the ATA controller and the
+ /// ATA device for write or bidirectional commands. For all read and non data
+ /// commands where OutTransferLength is 0 this field is optional and may be NULL.
+ /// If this field is not NULL, then it must be aligned on the boundary specified
+ /// by the IoAlign field in the EFI_ATA_PASS_THRU_MODE structure.
+ ///
+ VOID *OutDataBuffer;
+ ///
+ /// On input, the size, in bytes, of InDataBuffer. On output, the number of bytes
+ /// transferred between the ATA controller and the ATA device. If InTransferLength
+ /// is larger than the ATA controller can handle, no data will be transferred,
+ /// InTransferLength will be updated to contain the number of bytes that the ATA
+ /// controller is able to transfer, and EFI_BAD_BUFFER_SIZE will be returned.
+ ///
+ UINT32 InTransferLength;
+ ///
+ /// On Input, the size, in bytes of OutDataBuffer. On Output, the Number of bytes
+ /// transferred between ATA Controller and the ATA device. If OutTransferLength is
+ /// larger than the ATA controller can handle, no data will be transferred,
+ /// OutTransferLength will be updated to contain the number of bytes that the ATA
+ /// controller is able to transfer, and EFI_BAD_BUFFER_SIZE will be returned.
+ ///
+ UINT32 OutTransferLength;
+ ///
+ /// Specifies the protocol used when the ATA device executes the command.
+ ///
+ EFI_ATA_PASS_THRU_CMD_PROTOCOL Protocol;
+ ///
+ /// Specifies the way in which the ATA command length is encoded.
+ ///
+ EFI_ATA_PASS_THRU_LENGTH Length;
+} EFI_ATA_PASS_THRU_COMMAND_PACKET;
+
+
+/**
+ Sends an ATA command to an ATA device that is attached to the ATA controller. This function
+ supports both blocking I/O and non-blocking I/O. The blocking I/O functionality is required,
+ and the non-blocking I/O functionality is optional.
+
+ @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
+ @param[in] Port The port number of the ATA device to send the command.
+ @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.
+ If there is no port multiplier, then specify 0xFFFF.
+ @param[in,out] Packet A pointer to the ATA command to send to the ATA device specified by Port
+ and PortMultiplierPort.
+ @param[in] Event If non-blocking I/O is not supported then Event is ignored, and blocking
+ I/O is performed. If Event is NULL, then blocking I/O is performed. If
+ Event is not NULL and non blocking I/O is supported, then non-blocking
+ I/O is performed, and Event will be signaled when the ATA command completes.
+
+ @retval EFI_SUCCESS The ATA command was sent by the host. For bi-directional commands,
+ InTransferLength bytes were transferred from InDataBuffer. For write and
+ bi-directional commands, OutTransferLength bytes were transferred by OutDataBuffer.
+ @retval EFI_BAD_BUFFER_SIZE The ATA command was not executed. The number of bytes that could be transferred
+ is returned in InTransferLength. For write and bi-directional commands,
+ OutTransferLength bytes were transferred by OutDataBuffer.
+ @retval EFI_NOT_READY The ATA command could not be sent because there are too many ATA commands
+ already queued. The caller may retry again later.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the ATA command.
+ @retval EFI_INVALID_PARAMETER Port, PortMultiplierPort, or the contents of Acb are invalid. The ATA
+ command was not sent, so no additional status information is available.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ATA_PASS_THRU_PASSTHRU)(
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN UINT16 Port,
+ IN UINT16 PortMultiplierPort,
+ IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET *Packet,
+ IN EFI_EVENT Event OPTIONAL
+ );
+
+/**
+ Used to retrieve the list of legal port numbers for ATA devices on an ATA controller.
+ These can either be the list of ports where ATA devices are actually present or the
+ list of legal port numbers for the ATA controller. Regardless, the caller of this
+ function must probe the port number returned to see if an ATA device is actually
+ present at that location on the ATA controller.
+
+ The GetNextPort() function retrieves the port number on an ATA controller. If on input
+ Port is 0xFFFF, then the port number of the first port on the ATA controller is returned
+ in Port and EFI_SUCCESS is returned.
+
+ If Port is a port number that was returned on a previous call to GetNextPort(), then the
+ port number of the next port on the ATA controller is returned in Port, and EFI_SUCCESS
+ is returned. If Port is not 0xFFFF and Port was not returned on a previous call to
+ GetNextPort(), then EFI_INVALID_PARAMETER is returned.
+
+ If Port is the port number of the last port on the ATA controller, then EFI_NOT_FOUND is
+ returned.
+
+ @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
+ @param[in,out] Port On input, a pointer to the port number on the ATA controller.
+ On output, a pointer to the next port number on the ATA
+ controller. An input value of 0xFFFF retrieves the first port
+ number on the ATA controller.
+
+ @retval EFI_SUCCESS The next port number on the ATA controller was returned in Port.
+ @retval EFI_NOT_FOUND There are no more ports on this ATA controller.
+ @retval EFI_INVALID_PARAMETER Port is not 0xFFFF and Port was not returned on a previous call
+ to GetNextPort().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ATA_PASS_THRU_GET_NEXT_PORT)(
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN OUT UINT16 *Port
+ );
+
+/**
+ Used to retrieve the list of legal port multiplier port numbers for ATA devices on a port of an ATA
+ controller. These can either be the list of port multiplier ports where ATA devices are actually
+ present on port or the list of legal port multiplier ports on that port. Regardless, the caller of this
+ function must probe the port number and port multiplier port number returned to see if an ATA
+ device is actually present.
+
+ The GetNextDevice() function retrieves the port multiplier port number of an ATA device
+ present on a port of an ATA controller.
+
+ If PortMultiplierPort points to a port multiplier port number value that was returned on a
+ previous call to GetNextDevice(), then the port multiplier port number of the next ATA device
+ on the port of the ATA controller is returned in PortMultiplierPort, and EFI_SUCCESS is
+ returned.
+
+ If PortMultiplierPort points to 0xFFFF, then the port multiplier port number of the first
+ ATA device on port of the ATA controller is returned in PortMultiplierPort and
+ EFI_SUCCESS is returned.
+
+ If PortMultiplierPort is not 0xFFFF and the value pointed to by PortMultiplierPort
+ was not returned on a previous call to GetNextDevice(), then EFI_INVALID_PARAMETER
+ is returned.
+
+ If PortMultiplierPort is the port multiplier port number of the last ATA device on the port of
+ the ATA controller, then EFI_NOT_FOUND is returned.
+
+ @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
+ @param[in] Port The port number present on the ATA controller.
+ @param[in,out] PortMultiplierPort On input, a pointer to the port multiplier port number of an
+ ATA device present on the ATA controller.
+ If on input a PortMultiplierPort of 0xFFFF is specified,
+ then the port multiplier port number of the first ATA device
+ is returned. On output, a pointer to the port multiplier port
+ number of the next ATA device present on an ATA controller.
+
+ @retval EFI_SUCCESS The port multiplier port number of the next ATA device on the port
+ of the ATA controller was returned in PortMultiplierPort.
+ @retval EFI_NOT_FOUND There are no more ATA devices on this port of the ATA controller.
+ @retval EFI_INVALID_PARAMETER PortMultiplierPort is not 0xFFFF, and PortMultiplierPort was not
+ returned on a previous call to GetNextDevice().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ATA_PASS_THRU_GET_NEXT_DEVICE)(
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN UINT16 Port,
+ IN OUT UINT16 *PortMultiplierPort
+ );
+
+/**
+ Used to allocate and build a device path node for an ATA device on an ATA controller.
+
+ The BuildDevicePath() function allocates and builds a single device node for the ATA
+ device specified by Port and PortMultiplierPort. If the ATA device specified by Port and
+ PortMultiplierPort is not present on the ATA controller, then EFI_NOT_FOUND is returned.
+ If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned. If there are not enough
+ resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned.
+
+ Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of
+ DevicePath are initialized to describe the ATA device specified by Port and PortMultiplierPort,
+ and EFI_SUCCESS is returned.
+
+ @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
+ @param[in] Port Port specifies the port number of the ATA device for which a
+ device path node is to be allocated and built.
+ @param[in] PortMultiplierPort The port multiplier port number of the ATA device for which a
+ device path node is to be allocated and built. If there is no
+ port multiplier, then specify 0xFFFF.
+ @param[in,out] DevicePath A pointer to a single device path node that describes the ATA
+ device specified by Port and PortMultiplierPort. This function
+ is responsible for allocating the buffer DevicePath with the
+ boot service AllocatePool(). It is the caller's responsibility
+ to free DevicePath when the caller is finished with DevicePath.
+ @retval EFI_SUCCESS The device path node that describes the ATA device specified by
+ Port and PortMultiplierPort was allocated and returned in DevicePath.
+ @retval EFI_NOT_FOUND The ATA device specified by Port and PortMultiplierPort does not
+ exist on the ATA controller.
+ @retval EFI_INVALID_PARAMETER DevicePath is NULL.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ATA_PASS_THRU_BUILD_DEVICE_PATH)(
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN UINT16 Port,
+ IN UINT16 PortMultiplierPort,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
+ );
+
+/**
+ Used to translate a device path node to a port number and port multiplier port number.
+
+ The GetDevice() function determines the port and port multiplier port number associated with
+ the ATA device described by DevicePath. If DevicePath is a device path node type that the
+ ATA Pass Thru driver supports, then the ATA Pass Thru driver will attempt to translate the contents
+ DevicePath into a port number and port multiplier port number.
+
+ If this translation is successful, then that port number and port multiplier port number are returned
+ in Port and PortMultiplierPort, and EFI_SUCCESS is returned.
+
+ If DevicePath, Port, or PortMultiplierPort are NULL, then EFI_INVALID_PARAMETER is returned.
+
+ If DevicePath is not a device path node type that the ATA Pass Thru driver supports, then
+ EFI_UNSUPPORTED is returned.
+
+ If DevicePath is a device path node type that the ATA Pass Thru driver supports, but there is not
+ a valid translation from DevicePath to a port number and port multiplier port number, then
+ EFI_NOT_FOUND is returned.
+
+ @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
+ @param[in] DevicePath A pointer to the device path node that describes an ATA device on the
+ ATA controller.
+ @param[out] Port On return, points to the port number of an ATA device on the ATA controller.
+ @param[out] PortMultiplierPort On return, points to the port multiplier port number of an ATA device
+ on the ATA controller.
+
+ @retval EFI_SUCCESS DevicePath was successfully translated to a port number and port multiplier
+ port number, and they were returned in Port and PortMultiplierPort.
+ @retval EFI_INVALID_PARAMETER DevicePath is NULL.
+ @retval EFI_INVALID_PARAMETER Port is NULL.
+ @retval EFI_INVALID_PARAMETER PortMultiplierPort is NULL.
+ @retval EFI_UNSUPPORTED This driver does not support the device path node type in DevicePath.
+ @retval EFI_NOT_FOUND A valid translation from DevicePath to a port number and port multiplier
+ port number does not exist.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ATA_PASS_THRU_GET_DEVICE)(
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ OUT UINT16 *Port,
+ OUT UINT16 *PortMultiplierPort
+ );
+
+/**
+ Resets a specific port on the ATA controller. This operation also resets all the ATA devices
+ connected to the port.
+
+ The ResetChannel() function resets an a specific port on an ATA controller. This operation
+ resets all the ATA devices connected to that port. If this ATA controller does not support
+ a reset port operation, then EFI_UNSUPPORTED is returned.
+
+ If a device error occurs while executing that port reset operation, then EFI_DEVICE_ERROR is
+ returned.
+
+ If a timeout occurs during the execution of the port reset operation, then EFI_TIMEOUT is returned.
+
+ If the port reset operation is completed, then EFI_SUCCESS is returned.
+
+ @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
+ @param[in] Port The port number on the ATA controller.
+
+ @retval EFI_SUCCESS The ATA controller port was reset.
+ @retval EFI_UNSUPPORTED The ATA controller does not support a port reset operation.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA port.
+ @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA port.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ATA_PASS_THRU_RESET_PORT)(
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN UINT16 Port
+ );
+
+/**
+ Resets an ATA device that is connected to an ATA controller.
+
+ The ResetDevice() function resets the ATA device specified by Port and PortMultiplierPort.
+ If this ATA controller does not support a device reset operation, then EFI_UNSUPPORTED is
+ returned.
+
+ If Port or PortMultiplierPort are not in a valid range for this ATA controller, then
+ EFI_INVALID_PARAMETER is returned.
+
+ If a device error occurs while executing that device reset operation, then EFI_DEVICE_ERROR
+ is returned.
+
+ If a timeout occurs during the execution of the device reset operation, then EFI_TIMEOUT is
+ returned.
+
+ If the device reset operation is completed, then EFI_SUCCESS is returned.
+
+ @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
+ @param[in] Port Port represents the port number of the ATA device to be reset.
+ @param[in] PortMultiplierPort The port multiplier port number of the ATA device to reset.
+ If there is no port multiplier, then specify 0xFFFF.
+ @retval EFI_SUCCESS The ATA device specified by Port and PortMultiplierPort was reset.
+ @retval EFI_UNSUPPORTED The ATA controller does not support a device reset operation.
+ @retval EFI_INVALID_PARAMETER Port or PortMultiplierPort are invalid.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA device
+ specified by Port and PortMultiplierPort.
+ @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA device
+ specified by Port and PortMultiplierPort.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ATA_PASS_THRU_RESET_DEVICE)(
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN UINT16 Port,
+ IN UINT16 PortMultiplierPort
+ );
+
+struct _EFI_ATA_PASS_THRU_PROTOCOL {
+ EFI_ATA_PASS_THRU_MODE *Mode;
+ EFI_ATA_PASS_THRU_PASSTHRU PassThru;
+ EFI_ATA_PASS_THRU_GET_NEXT_PORT GetNextPort;
+ EFI_ATA_PASS_THRU_GET_NEXT_DEVICE GetNextDevice;
+ EFI_ATA_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath;
+ EFI_ATA_PASS_THRU_GET_DEVICE GetDevice;
+ EFI_ATA_PASS_THRU_RESET_PORT ResetPort;
+ EFI_ATA_PASS_THRU_RESET_DEVICE ResetDevice;
+};
+
+extern EFI_GUID gEfiAtaPassThruProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AuthenticationInfo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AuthenticationInfo.h
new file mode 100644
index 0000000000..99e2023591
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/AuthenticationInfo.h
@@ -0,0 +1,237 @@
+/** @file
+ EFI_AUTHENTICATION_INFO_PROTOCOL as defined in UEFI 2.0.
+ This protocol is used on any device handle to obtain authentication information
+ associated with the physical or logical device.
+
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __AUTHENTICATION_INFO_H__
+#define __AUTHENTICATION_INFO_H__
+
+#define EFI_AUTHENTICATION_INFO_PROTOCOL_GUID \
+ { \
+ 0x7671d9d0, 0x53db, 0x4173, {0xaa, 0x69, 0x23, 0x27, 0xf2, 0x1f, 0x0b, 0xc7 } \
+ }
+
+#define EFI_AUTHENTICATION_CHAP_RADIUS_GUID \
+ { \
+ 0xd6062b50, 0x15ca, 0x11da, {0x92, 0x19, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \
+ }
+
+#define EFI_AUTHENTICATION_CHAP_LOCAL_GUID \
+ { \
+ 0xc280c73e, 0x15ca, 0x11da, {0xb0, 0xca, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \
+ }
+
+typedef struct _EFI_AUTHENTICATION_INFO_PROTOCOL EFI_AUTHENTICATION_INFO_PROTOCOL;
+
+#pragma pack(1)
+typedef struct {
+ ///
+ /// Authentication Type GUID.
+ ///
+ EFI_GUID Guid;
+
+ ///
+ /// Length of this structure in bytes.
+ ///
+ UINT16 Length;
+} AUTH_NODE_HEADER;
+
+typedef struct {
+ AUTH_NODE_HEADER Header;
+
+ ///
+ /// RADIUS Server IPv4 or IPv6 Address.
+ ///
+ UINT8 RadiusIpAddr[16]; ///< IPv4 or IPv6 address.
+
+ ///
+ /// Reserved for future use.
+ ///
+ UINT16 Reserved;
+
+ ///
+ /// Network Access Server IPv4 or IPv6 Address (OPTIONAL).
+ ///
+ UINT8 NasIpAddr[16]; ///< IPv4 or IPv6 address.
+
+ ///
+ /// Network Access Server Secret Length in bytes (OPTIONAL).
+ ///
+ UINT16 NasSecretLength;
+
+ ///
+ /// Network Access Server Secret (OPTIONAL).
+ ///
+ UINT8 NasSecret[1];
+
+ ///
+ /// CHAP Initiator Secret Length in bytes on offset NasSecret + NasSecretLength.
+ ///
+ /// UINT16 ChapSecretLength;
+ ///
+ /// CHAP Initiator Secret.
+ ///
+ /// UINT8 ChapSecret[];
+ ///
+ /// CHAP Initiator Name Length in bytes on offset ChapSecret + ChapSecretLength.
+ ///
+ /// UINT16 ChapNameLength;
+ ///
+ /// CHAP Initiator Name.
+ ///
+ /// UINT8 ChapName[];
+ ///
+ /// Reverse CHAP Name Length in bytes on offset ChapName + ChapNameLength.
+ ///
+ /// UINT16 ReverseChapNameLength;
+ ///
+ /// Reverse CHAP Name.
+ ///
+ /// UINT8 ReverseChapName[];
+ ///
+ /// Reverse CHAP Secret Length in bytes on offseet ReverseChapName + ReverseChapNameLength.
+ ///
+ /// UINT16 ReverseChapSecretLength;
+ ///
+ /// Reverse CHAP Secret.
+ ///
+ /// UINT8 ReverseChapSecret[];
+ ///
+} CHAP_RADIUS_AUTH_NODE;
+
+typedef struct {
+ AUTH_NODE_HEADER Header;
+
+ ///
+ /// Reserved for future use.
+ ///
+ UINT16 Reserved;
+
+ ///
+ /// User Secret Length in bytes.
+ ///
+ UINT16 UserSecretLength;
+
+ ///
+ /// User Secret.
+ ///
+ UINT8 UserSecret[1];
+
+ ///
+ /// User Name Length in bytes on offset UserSecret + UserSecretLength.
+ ///
+ /// UINT16 UserNameLength;
+ ///
+ /// User Name.
+ ///
+ /// UINT8 UserName[];
+ ///
+ /// CHAP Initiator Secret Length in bytes on offset UserName + UserNameLength.
+ ///
+ /// UINT16 ChapSecretLength;
+ ///
+ /// CHAP Initiator Secret.
+ ///
+ /// UINT8 ChapSecret[];
+ ///
+ /// CHAP Initiator Name Length in bytes on offset ChapSecret + ChapSecretLength.
+ ///
+ /// UINT16 ChapNameLength;
+ ///
+ /// CHAP Initiator Name.
+ ///
+ /// UINT8 ChapName[];
+ ///
+ /// Reverse CHAP Name Length in bytes on offset ChapName + ChapNameLength.
+ ///
+ /// UINT16 ReverseChapNameLength;
+ ///
+ /// Reverse CHAP Name.
+ ///
+ /// UINT8 ReverseChapName[];
+ ///
+ /// Reverse CHAP Secret Length in bytes on offset ReverseChapName + ReverseChapNameLength.
+ ///
+ /// UINT16 ReverseChapSecretLength;
+ ///
+ /// Reverse CHAP Secret.
+ ///
+ /// UINT8 ReverseChapSecret[];
+ ///
+} CHAP_LOCAL_AUTH_NODE;
+#pragma pack()
+
+/**
+ Retrieves the authentication information associated with a particular controller handle.
+
+ @param[in] This The pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.
+ @param[in] ControllerHandle The handle to the Controller.
+ @param[out] Buffer The pointer to the authentication information. This function is
+ responsible for allocating the buffer and it is the caller's
+ responsibility to free buffer when the caller is finished with buffer.
+
+ @retval EFI_SUCCESS Successfully retrieved authentication information
+ for the given ControllerHandle.
+ @retval EFI_INVALID_PARAMETER No matching authentication information found for
+ the given ControllerHandle.
+ @retval EFI_DEVICE_ERROR The authentication information could not be retrieved
+ due to a hardware error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_GET)(
+ IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ OUT VOID **Buffer
+ );
+
+/**
+ Set the authentication information for a given controller handle.
+
+ @param[in] This The pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.
+ @param[in] ControllerHandle The handle to the Controller.
+ @param[in] Buffer The pointer to the authentication information.
+
+ @retval EFI_SUCCESS Successfully set authentication information for the
+ given ControllerHandle.
+ @retval EFI_UNSUPPORTED If the platform policies do not allow setting of
+ the authentication information.
+ @retval EFI_DEVICE_ERROR The authentication information could not be configured
+ due to a hardware error.
+ @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_SET)(
+ IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN VOID *Buffer
+ );
+
+///
+/// This protocol is used on any device handle to obtain authentication
+/// information associated with the physical or logical device.
+///
+struct _EFI_AUTHENTICATION_INFO_PROTOCOL {
+ EFI_AUTHENTICATION_INFO_PROTOCOL_GET Get;
+ EFI_AUTHENTICATION_INFO_PROTOCOL_SET Set;
+};
+
+extern EFI_GUID gEfiAuthenticationInfoProtocolGuid;
+extern EFI_GUID gEfiAuthenticationChapRadiusGuid;
+extern EFI_GUID gEfiAuthenticationChapLocalGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Bds.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Bds.h
new file mode 100644
index 0000000000..0ecc66c8ca
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Bds.h
@@ -0,0 +1,72 @@
+/** @file
+ Boot Device Selection Architectural Protocol as defined in PI spec Volume 2 DXE
+
+ When the DXE core is done it calls the BDS via this protocol.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARCH_PROTOCOL_BDS_H__
+#define __ARCH_PROTOCOL_BDS_H__
+
+///
+/// Global ID for the BDS Architectural Protocol
+///
+#define EFI_BDS_ARCH_PROTOCOL_GUID \
+ { 0x665E3FF6, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }
+
+///
+/// Declare forward reference for the BDS Architectural Protocol
+///
+typedef struct _EFI_BDS_ARCH_PROTOCOL EFI_BDS_ARCH_PROTOCOL;
+
+/**
+ This function uses policy data from the platform to determine what operating
+ system or system utility should be loaded and invoked. This function call
+ also optionally make the use of user input to determine the operating system
+ or system utility to be loaded and invoked. When the DXE Core has dispatched
+ all the drivers on the dispatch queue, this function is called. This
+ function will attempt to connect the boot devices required to load and invoke
+ the selected operating system or system utility. During this process,
+ additional firmware volumes may be discovered that may contain addition DXE
+ drivers that can be dispatched by the DXE Core. If a boot device cannot be
+ fully connected, this function calls the DXE Service Dispatch() to allow the
+ DXE drivers from any newly discovered firmware volumes to be dispatched.
+ Then the boot device connection can be attempted again. If the same boot
+ device connection operation fails twice in a row, then that boot device has
+ failed, and should be skipped. This function should never return.
+
+ @param This The EFI_BDS_ARCH_PROTOCOL instance.
+
+ @return None.
+
+**/
+typedef
+VOID
+(EFIAPI *EFI_BDS_ENTRY)(
+ IN EFI_BDS_ARCH_PROTOCOL *This
+ );
+
+///
+/// The EFI_BDS_ARCH_PROTOCOL transfers control from DXE to an operating
+/// system or a system utility. If there are not enough drivers initialized
+/// when this protocol is used to access the required boot device(s), then
+/// this protocol should add drivers to the dispatch queue and return control
+/// back to the dispatcher. Once the required boot devices are available, then
+/// the boot device can be used to load and invoke an OS or a system utility.
+///
+struct _EFI_BDS_ARCH_PROTOCOL {
+ EFI_BDS_ENTRY Entry;
+};
+
+extern EFI_GUID gEfiBdsArchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Bis.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Bis.h
new file mode 100644
index 0000000000..b3ac58ec03
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Bis.h
@@ -0,0 +1,451 @@
+/** @file
+ The EFI_BIS_PROTOCOL is used to check a digital signature of a data block
+ against a digital certificate for the purpose of an integrity and authorization check.
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in EFI Specification 1.10.
+
+**/
+
+#ifndef __BIS_H__
+#define __BIS_H__
+
+#define EFI_BIS_PROTOCOL_GUID \
+ { \
+ 0x0b64aab0, 0x5429, 0x11d4, {0x98, 0x16, 0x00, 0xa0, 0xc9, 0x1f, 0xad, 0xcf } \
+ }
+
+//
+// X-Intel-BIS-ParameterSet
+// Attribute value
+// Binary Value of X-Intel-BIS-ParameterSet Attribute.
+// (Value is Base-64 encoded in actual signed manifest).
+//
+#define BOOT_OBJECT_AUTHORIZATION_PARMSET_GUID \
+ { \
+ 0xedd35e31, 0x7b9, 0x11d2, { 0x83,0xa3,0x0,0xa0,0xc9,0x1f,0xad,0xcf } \
+ }
+
+
+
+typedef struct _EFI_BIS_PROTOCOL EFI_BIS_PROTOCOL;
+
+
+//
+// Basic types
+//
+typedef VOID *BIS_APPLICATION_HANDLE;
+typedef UINT16 BIS_ALG_ID;
+typedef UINT32 BIS_CERT_ID;
+
+///
+/// EFI_BIS_DATA instances obtained from BIS must be freed by calling Free( ).
+///
+typedef struct {
+ UINT32 Length; ///< The length of Data in 8 bit bytes.
+ UINT8 *Data; ///< 32 Bit Flat Address of data.
+} EFI_BIS_DATA;
+
+///
+/// EFI_BIS_VERSION type.
+///
+typedef struct {
+ UINT32 Major; ///< The major BIS version number.
+ UINT32 Minor; ///< A minor BIS version number.
+} EFI_BIS_VERSION;
+
+//
+// ----------------------------------------------------//
+// Use these values to initialize EFI_BIS_VERSION.Major
+// and to interpret results of Initialize.
+// ----------------------------------------------------//
+//
+#define BIS_CURRENT_VERSION_MAJOR BIS_VERSION_1
+#define BIS_VERSION_1 1
+
+///
+/// EFI_BIS_SIGNATURE_INFO type.
+///
+typedef struct {
+ BIS_CERT_ID CertificateID; ///< Truncated hash of platform Boot Object
+ BIS_ALG_ID AlgorithmID; ///< A signature algorithm number.
+ UINT16 KeyLength; ///< The length of alg. keys in bits.
+} EFI_BIS_SIGNATURE_INFO;
+
+///
+/// values for EFI_BIS_SIGNATURE_INFO.AlgorithmID.
+/// The exact numeric values come from the
+/// "Common Data Security Architecture (CDSA) Specification".
+///
+#define BIS_ALG_DSA (41) // CSSM_ALGID_DSA
+#define BIS_ALG_RSA_MD5 (42) // CSSM_ALGID_MD5_WITH_RSA
+///
+/// values for EFI_BIS_SIGNATURE_INFO.CertificateId.
+///
+#define BIS_CERT_ID_DSA BIS_ALG_DSA // CSSM_ALGID_DSA
+#define BIS_CERT_ID_RSA_MD5 BIS_ALG_RSA_MD5 // CSSM_ALGID_MD5_WITH_RSA
+///
+/// The mask value that gets applied to the truncated hash of a
+/// platform Boot Object Authorization Certificate to create the certificateID.
+/// A certificateID must not have any bits set to the value 1 other than bits in
+/// this mask.
+///
+#define BIS_CERT_ID_MASK (0xFF7F7FFF)
+
+///
+/// Macros for dealing with the EFI_BIS_DATA object obtained
+/// from BIS_GetSignatureInfo().
+/// BIS_GET_SIGINFO_COUNT - tells how many EFI_BIS_SIGNATURE_INFO
+/// elements are contained in a EFI_BIS_DATA struct pointed to
+/// by the provided EFI_BIS_DATA*.
+///
+#define BIS_GET_SIGINFO_COUNT(BisDataPtr) ((BisDataPtr)->Length / sizeof (EFI_BIS_SIGNATURE_INFO))
+
+///
+/// BIS_GET_SIGINFO_ARRAY - produces a EFI_BIS_SIGNATURE_INFO*
+/// from a given EFI_BIS_DATA*.
+///
+#define BIS_GET_SIGINFO_ARRAY(BisDataPtr) ((EFI_BIS_SIGNATURE_INFO *) (BisDataPtr)->Data)
+
+///
+/// Support an old name for backward compatibility.
+///
+#define BOOT_OBJECT_AUTHORIZATION_PARMSET_GUIDVALUE \
+ BOOT_OBJECT_AUTHORIZATION_PARMSET_GUID
+
+/**
+ Initializes the BIS service, checking that it is compatible with the version requested by the caller.
+ After this call, other BIS functions may be invoked.
+
+ @param This A pointer to the EFI_BIS_PROTOCOL object.
+ @param AppHandle The function writes the new BIS_APPLICATION_HANDLE if
+ successful, otherwise it writes NULL. The caller must eventually
+ destroy this handle by calling Shutdown().
+ @param InterfaceVersion On input, the caller supplies the major version number of the
+ interface version desired.
+ On output, both the major and minor
+ version numbers are updated with the major and minor version
+ numbers of the interface. This update is done whether or not the
+ initialization was successful.
+ @param TargetAddress Indicates a network or device address of the BIS platform to connect to.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_INCOMPATIBLE_VERSION The InterfaceVersion.Major requested by the
+ caller was not compatible with the interface version of the
+ implementation. The InterfaceVersion.Major has
+ been updated with the current interface version.
+ @retval EFI_UNSUPPORTED This is a local-platform implementation and
+ TargetAddress.Data was not NULL, or
+ TargetAddress.Data was any other value that was not
+ supported by the implementation.
+ @retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
+ @retval EFI_DEVICE_ERROR One of the following device errors:
+ * The function encountered an unexpected internal failure while initializing a cryptographic software module
+ * No cryptographic software module with compatible version was found
+ found
+ * A resource limitation was encountered while using a cryptographic software module.
+ @retval EFI_INVALID_PARAMETER The This parameter supplied by the caller is NULL or does not
+ reference a valid EFI_BIS_PROTOCOL object. Or,
+ the AppHandle parameter supplied by the caller is NULL or
+ an invalid memory reference. Or,
+ the InterfaceVersion parameter supplied by the caller
+ is NULL or an invalid memory reference. Or,
+ the TargetAddress parameter supplied by the caller is
+ NULL or an invalid memory reference.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BIS_INITIALIZE)(
+ IN EFI_BIS_PROTOCOL *This,
+ OUT BIS_APPLICATION_HANDLE *AppHandle,
+ IN OUT EFI_BIS_VERSION *InterfaceVersion,
+ IN EFI_BIS_DATA *TargetAddress
+ );
+
+/**
+ Frees memory structures allocated and returned by other functions in the EFI_BIS protocol.
+
+ @param AppHandle An opaque handle that identifies the caller's instance of initialization
+ of the BIS service.
+ @param ToFree An EFI_BIS_DATA* and associated memory block to be freed.
+ This EFI_BIS_DATA* must have been allocated by one of the other BIS functions.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
+ application instance handle associated with the EFI_BIS protocol.
+ @retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
+ @retval EFI_INVALID_PARAMETER The ToFree parameter is not or is no longer a memory resource
+ associated with this AppHandle.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BIS_FREE)(
+ IN BIS_APPLICATION_HANDLE AppHandle,
+ IN EFI_BIS_DATA *ToFree
+ );
+
+/**
+ Shuts down an application's instance of the BIS service, invalidating the application handle. After
+ this call, other BIS functions may no longer be invoked using the application handle value.
+
+ @param AppHandle An opaque handle that identifies the caller's instance of initialization
+ of the BIS service.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NO_MAPPING The AppHandle parameter is not, or is no longer, a valid
+ application instance handle associated with the EFI_BIS protocol.
+ @retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
+ @retval EFI_DEVICE_ERROR The function encountered an unexpected internal failure while
+ returning resources associated with a cryptographic software module, or
+ while trying to shut down a cryptographic software module.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BIS_SHUTDOWN)(
+ IN BIS_APPLICATION_HANDLE AppHandle
+ );
+
+/**
+ Retrieves the certificate that has been configured as the identity of the organization designated as
+ the source of authorization for signatures of boot objects.
+
+ @param AppHandle An opaque handle that identifies the caller's instance of initialization
+ of the BIS service.
+ @param Certificate The function writes an allocated EFI_BIS_DATA* containing the Boot
+ Object Authorization Certificate object. The caller must
+ eventually free the memory allocated by this function using the function Free().
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
+ application instance handle associated with the EFI_BIS protocol.
+ @retval EFI_NOT_FOUND There is no Boot Object Authorization Certificate currently installed.
+ @retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
+ @retval EFI_INVALID_PARAMETER The Certificate parameter supplied by the caller is NULL or
+ an invalid memory reference.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CERTIFICATE)(
+ IN BIS_APPLICATION_HANDLE AppHandle,
+ OUT EFI_BIS_DATA **Certificate
+ );
+
+/**
+ Verifies the integrity and authorization of the indicated data object according to the
+ indicated credentials.
+
+ @param AppHandle An opaque handle that identifies the caller's instance of initialization
+ of the BIS service.
+ @param Credentials A Signed Manifest containing verification information for the indicated
+ data object.
+ @param DataObject An in-memory copy of the raw data object to be verified.
+ @param IsVerified The function writes TRUE if the verification succeeded, otherwise
+ FALSE.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
+ application instance handle associated with the EFI_BIS protocol.
+ @retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_SECURITY_VIOLATION The signed manifest supplied as the Credentials parameter
+ was invalid (could not be parsed) or Platform-specific authorization failed, etc.
+ @retval EFI_DEVICE_ERROR An unexpected internal error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BIS_VERIFY_BOOT_OBJECT)(
+ IN BIS_APPLICATION_HANDLE AppHandle,
+ IN EFI_BIS_DATA *Credentials,
+ IN EFI_BIS_DATA *DataObject,
+ OUT BOOLEAN *IsVerified
+ );
+
+/**
+ Retrieves the current status of the Boot Authorization Check Flag.
+
+ @param AppHandle An opaque handle that identifies the caller's instance of initialization
+ of the BIS service.
+ @param CheckIsRequired The function writes the value TRUE if a Boot Authorization Check is
+ currently required on this platform, otherwise the function writes
+ FALSE.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
+ application instance handle associated with the EFI_BIS protocol.
+ @retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
+ @retval EFI_INVALID_PARAMETER The CheckIsRequired parameter supplied by the caller is
+ NULL or an invalid memory reference.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CHECKFLAG)(
+ IN BIS_APPLICATION_HANDLE AppHandle,
+ OUT BOOLEAN *CheckIsRequired
+ );
+
+/**
+ Retrieves a unique token value to be included in the request credential for the next update of any
+ parameter in the Boot Object Authorization set
+
+ @param AppHandle An opaque handle that identifies the caller's
+ instance of initialization of the BIS service.
+ @param UpdateToken The function writes an allocated EFI_BIS_DATA*
+ containing the newunique update token value.
+ The caller musteventually free the memory allocated
+ by this function using the function Free().
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
+ application instance handle associated with the EFI_BIS protocol.
+ @retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
+ @retval EFI_INVALID_PARAMETER The UpdateToken parameter supplied by the caller is NULL or
+ an invalid memory reference.
+ @retval EFI_DEVICE_ERROR An unexpected internal error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_UPDATE_TOKEN)(
+ IN BIS_APPLICATION_HANDLE AppHandle,
+ OUT EFI_BIS_DATA **UpdateToken
+ );
+
+/**
+ Updates one of the configurable parameters of the Boot Object Authorization set.
+
+ @param AppHandle An opaque handle that identifies the caller's
+ instance of initialization of the BIS service.
+ @param RequestCredential This is a Signed Manifest with embedded attributes
+ that carry the details of the requested update.
+ @param NewUpdateToken The function writes an allocated EFI_BIS_DATA*
+ containing the new unique update token value.
+ The caller must eventually free the memory allocated
+ by this function using the function Free().
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
+ application instance handle associated with the EFI_BIS protocol.
+ @retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_SECURITY_VIOLATION The signed manifest supplied as the RequestCredential parameter
+ was invalid (could not be parsed) or Platform-specific authorization failed, etc.
+ @retval EFI_DEVICE_ERROR An unexpected internal error occurred while analyzing the new
+ certificate's key algorithm, or while attempting to retrieve
+ the public key algorithm of the manifest's signer's certificate,
+ or An unexpected internal error occurred in a cryptographic software module.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BIS_UPDATE_BOOT_OBJECT_AUTHORIZATION)(
+ IN BIS_APPLICATION_HANDLE AppHandle,
+ IN EFI_BIS_DATA *RequestCredential,
+ OUT EFI_BIS_DATA **NewUpdateToken
+ );
+
+/**
+ Verifies the integrity and authorization of the indicated data object according to the indicated
+ credentials and authority certificate.
+
+ @param AppHandle An opaque handle that identifies the caller's instance of initialization
+ of the BIS service.
+ @param Credentials A Signed Manifest containing verification information for the
+ indicated data object.
+ @param DataObject An in-memory copy of the raw data object to be verified.
+ @param SectionName An ASCII string giving the section name in the
+ manifest holding the verification information (in other words,
+ hash value) that corresponds to DataObject.
+ @param AuthorityCertificate A digital certificate whose public key must match the signer's
+ public key which is found in the credentials.
+ @param IsVerified The function writes TRUE if the verification was successful.
+ Otherwise, the function writes FALSE.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
+ application instance handle associated with the EFI_BIS protocol.
+ @retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_SECURITY_VIOLATION The Credentials.Data supplied by the caller is NULL,
+ or the AuthorityCertificate supplied by the caller was
+ invalid (could not be parsed),
+ or Platform-specific authorization failed, etc.
+ @retval EFI_DEVICE_ERROR An unexpected internal error occurred while attempting to retrieve
+ the public key algorithm of the manifest's signer's certificate,
+ or An unexpected internal error occurred in a cryptographic software module.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BIS_VERIFY_OBJECT_WITH_CREDENTIAL)(
+ IN BIS_APPLICATION_HANDLE AppHandle,
+ IN EFI_BIS_DATA *Credentials,
+ IN EFI_BIS_DATA *DataObject,
+ IN EFI_BIS_DATA *SectionName,
+ IN EFI_BIS_DATA *AuthorityCertificate,
+ OUT BOOLEAN *IsVerified
+ );
+
+/**
+ Retrieves a list of digital certificate identifier, digital signature algorithm, hash algorithm, and keylength
+ combinations that the platform supports.
+
+ @param AppHandle An opaque handle that identifies the caller's instance of initialization
+ of the BIS service.
+ @param SignatureInfo The function writes an allocated EFI_BIS_DATA* containing the array
+ of EFI_BIS_SIGNATURE_INFO structures representing the supported
+ digital certificate identifier, algorithm, and key length combinations.
+ The caller must eventually free the memory allocated by this function using the function Free().
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
+ application instance handle associated with the EFI_BIS protocol.
+ @retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
+ @retval EFI_INVALID_PARAMETER The SignatureInfo parameter supplied by the caller is NULL
+ or an invalid memory reference.
+ @retval EFI_DEVICE_ERROR An unexpected internal error occurred in a
+ cryptographic software module, or
+ The function encountered an unexpected internal consistency check
+ failure (possible corruption of stored Boot Object Authorization Certificate).
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BIS_GET_SIGNATURE_INFO)(
+ IN BIS_APPLICATION_HANDLE AppHandle,
+ OUT EFI_BIS_DATA **SignatureInfo
+ );
+
+///
+/// The EFI_BIS_PROTOCOL is used to check a digital signature of a data block against a digital
+/// certificate for the purpose of an integrity and authorization check.
+///
+struct _EFI_BIS_PROTOCOL {
+ EFI_BIS_INITIALIZE Initialize;
+ EFI_BIS_SHUTDOWN Shutdown;
+ EFI_BIS_FREE Free;
+ EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CERTIFICATE GetBootObjectAuthorizationCertificate;
+ EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CHECKFLAG GetBootObjectAuthorizationCheckFlag;
+ EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_UPDATE_TOKEN GetBootObjectAuthorizationUpdateToken;
+ EFI_BIS_GET_SIGNATURE_INFO GetSignatureInfo;
+ EFI_BIS_UPDATE_BOOT_OBJECT_AUTHORIZATION UpdateBootObjectAuthorization;
+ EFI_BIS_VERIFY_BOOT_OBJECT VerifyBootObject;
+ EFI_BIS_VERIFY_OBJECT_WITH_CREDENTIAL VerifyObjectWithCredential;
+};
+
+extern EFI_GUID gEfiBisProtocolGuid;
+extern EFI_GUID gBootObjectAuthorizationParmsetGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BlockIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BlockIo.h
new file mode 100644
index 0000000000..4bc2109db1
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BlockIo.h
@@ -0,0 +1,241 @@
+/** @file
+ Block IO protocol as defined in the UEFI 2.0 specification.
+
+ The Block IO protocol is used to abstract block devices like hard drives,
+ DVD-ROMs and floppy drives.
+
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __BLOCK_IO_H__
+#define __BLOCK_IO_H__
+
+#define EFI_BLOCK_IO_PROTOCOL_GUID \
+ { \
+ 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+ }
+
+typedef struct _EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL;
+
+///
+/// Protocol GUID name defined in EFI1.1.
+///
+#define BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL_GUID
+
+///
+/// Protocol defined in EFI1.1.
+///
+typedef EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO;
+
+/**
+ Reset the Block Device.
+
+ @param This Indicates a pointer to the calling context.
+ @param ExtendedVerification Driver may perform diagnostics on reset.
+
+ @retval EFI_SUCCESS The device was reset.
+ @retval EFI_DEVICE_ERROR The device is not functioning properly and could
+ not be reset.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_RESET)(
+ IN EFI_BLOCK_IO_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+ );
+
+/**
+ Read BufferSize bytes from Lba into Buffer.
+
+ @param This Indicates a pointer to the calling context.
+ @param MediaId Id of the media, changes every time the media is replaced.
+ @param Lba The starting Logical Block Address to read from
+ @param BufferSize Size of Buffer, must be a multiple of device block size.
+ @param Buffer A pointer to the destination buffer for the data. The caller is
+ responsible for either having implicit or explicit ownership of the buffer.
+
+ @retval EFI_SUCCESS The data was read correctly from the device.
+ @retval EFI_DEVICE_ERROR The device reported an error while performing the read.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHANGED The MediaId does not matched the current device.
+ @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
+ @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,
+ or the buffer is not on proper alignment.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_READ)(
+ IN EFI_BLOCK_IO_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN EFI_LBA Lba,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
+ );
+
+/**
+ Write BufferSize bytes from Lba into Buffer.
+
+ @param This Indicates a pointer to the calling context.
+ @param MediaId The media ID that the write request is for.
+ @param Lba The starting logical block address to be written. The caller is
+ responsible for writing to only legitimate locations.
+ @param BufferSize Size of Buffer, must be a multiple of device block size.
+ @param Buffer A pointer to the source buffer for the data.
+
+ @retval EFI_SUCCESS The data was written correctly to the device.
+ @retval EFI_WRITE_PROTECTED The device can not be written to.
+ @retval EFI_DEVICE_ERROR The device reported an error while performing the write.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
+ @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
+ @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,
+ or the buffer is not on proper alignment.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_WRITE)(
+ IN EFI_BLOCK_IO_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN EFI_LBA Lba,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+ );
+
+/**
+ Flush the Block Device.
+
+ @param This Indicates a pointer to the calling context.
+
+ @retval EFI_SUCCESS All outstanding data was written to the device
+ @retval EFI_DEVICE_ERROR The device reported an error while writting back the data
+ @retval EFI_NO_MEDIA There is no media in the device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_FLUSH)(
+ IN EFI_BLOCK_IO_PROTOCOL *This
+ );
+
+/**
+ Block IO read only mode data and updated only via members of BlockIO
+**/
+typedef struct {
+ ///
+ /// The curent media Id. If the media changes, this value is changed.
+ ///
+ UINT32 MediaId;
+
+ ///
+ /// TRUE if the media is removable; otherwise, FALSE.
+ ///
+ BOOLEAN RemovableMedia;
+
+ ///
+ /// TRUE if there is a media currently present in the device;
+ /// othersise, FALSE. THis field shows the media present status
+ /// as of the most recent ReadBlocks() or WriteBlocks() call.
+ ///
+ BOOLEAN MediaPresent;
+
+ ///
+ /// TRUE if LBA 0 is the first block of a partition; otherwise
+ /// FALSE. For media with only one partition this would be TRUE.
+ ///
+ BOOLEAN LogicalPartition;
+
+ ///
+ /// TRUE if the media is marked read-only otherwise, FALSE.
+ /// This field shows the read-only status as of the most recent WriteBlocks () call.
+ ///
+ BOOLEAN ReadOnly;
+
+ ///
+ /// TRUE if the WriteBlock () function caches write data.
+ ///
+ BOOLEAN WriteCaching;
+
+ ///
+ /// The intrinsic block size of the device. If the media changes, then
+ /// this field is updated.
+ ///
+ UINT32 BlockSize;
+
+ ///
+ /// Supplies the alignment requirement for any buffer to read or write block(s).
+ ///
+ UINT32 IoAlign;
+
+ ///
+ /// The last logical block address on the device.
+ /// If the media changes, then this field is updated.
+ ///
+ EFI_LBA LastBlock;
+
+ ///
+ /// Only present if EFI_BLOCK_IO_PROTOCOL.Revision is greater than or equal to
+ /// EFI_BLOCK_IO_PROTOCOL_REVISION2. Returns the first LBA is aligned to
+ /// a physical block boundary.
+ ///
+ EFI_LBA LowestAlignedLba;
+
+ ///
+ /// Only present if EFI_BLOCK_IO_PROTOCOL.Revision is greater than or equal to
+ /// EFI_BLOCK_IO_PROTOCOL_REVISION2. Returns the number of logical blocks
+ /// per physical block.
+ ///
+ UINT32 LogicalBlocksPerPhysicalBlock;
+
+ ///
+ /// Only present if EFI_BLOCK_IO_PROTOCOL.Revision is greater than or equal to
+ /// EFI_BLOCK_IO_PROTOCOL_REVISION3. Returns the optimal transfer length
+ /// granularity as a number of logical blocks.
+ ///
+ UINT32 OptimalTransferLengthGranularity;
+} EFI_BLOCK_IO_MEDIA;
+
+#define EFI_BLOCK_IO_PROTOCOL_REVISION 0x00010000
+#define EFI_BLOCK_IO_PROTOCOL_REVISION2 0x00020001
+#define EFI_BLOCK_IO_PROTOCOL_REVISION3 0x00020031
+
+///
+/// Revision defined in EFI1.1.
+///
+#define EFI_BLOCK_IO_INTERFACE_REVISION EFI_BLOCK_IO_PROTOCOL_REVISION
+
+///
+/// This protocol provides control over block devices.
+///
+struct _EFI_BLOCK_IO_PROTOCOL {
+ ///
+ /// The revision to which the block IO interface adheres. All future
+ /// revisions must be backwards compatible. If a future version is not
+ /// back wards compatible, it is not the same GUID.
+ ///
+ UINT64 Revision;
+ ///
+ /// Pointer to the EFI_BLOCK_IO_MEDIA data for this device.
+ ///
+ EFI_BLOCK_IO_MEDIA *Media;
+
+ EFI_BLOCK_RESET Reset;
+ EFI_BLOCK_READ ReadBlocks;
+ EFI_BLOCK_WRITE WriteBlocks;
+ EFI_BLOCK_FLUSH FlushBlocks;
+
+};
+
+extern EFI_GUID gEfiBlockIoProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BlockIo2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BlockIo2.h
new file mode 100644
index 0000000000..0e4bb289cf
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BlockIo2.h
@@ -0,0 +1,206 @@
+/** @file
+ Block IO2 protocol as defined in the UEFI 2.3.1 specification.
+
+ The Block IO2 protocol defines an extension to the Block IO protocol which
+ enables the ability to read and write data at a block level in a non-blocking
+ manner.
+
+ Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __BLOCK_IO2_H__
+#define __BLOCK_IO2_H__
+
+#include <Protocol/BlockIo.h>
+
+#define EFI_BLOCK_IO2_PROTOCOL_GUID \
+ { \
+ 0xa77b2472, 0xe282, 0x4e9f, {0xa2, 0x45, 0xc2, 0xc0, 0xe2, 0x7b, 0xbc, 0xc1} \
+ }
+
+typedef struct _EFI_BLOCK_IO2_PROTOCOL EFI_BLOCK_IO2_PROTOCOL;
+
+/**
+ The struct of Block IO2 Token.
+**/
+typedef struct {
+
+ ///
+ /// If Event is NULL, then blocking I/O is performed.If Event is not NULL and
+ /// non-blocking I/O is supported, then non-blocking I/O is performed, and
+ /// Event will be signaled when the read request is completed.
+ ///
+ EFI_EVENT Event;
+
+ ///
+ /// Defines whether or not the signaled event encountered an error.
+ ///
+ EFI_STATUS TransactionStatus;
+} EFI_BLOCK_IO2_TOKEN;
+
+
+/**
+ Reset the block device hardware.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] ExtendedVerification Indicates that the driver may perform a more
+ exhausive verification operation of the device
+ during reset.
+
+ @retval EFI_SUCCESS The device was reset.
+ @retval EFI_DEVICE_ERROR The device is not functioning properly and could
+ not be reset.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_RESET_EX) (
+ IN EFI_BLOCK_IO2_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+ );
+
+/**
+ Read BufferSize bytes from Lba into Buffer.
+
+ This function reads the requested number of blocks from the device. All the
+ blocks are read, or an error is returned.
+ If EFI_DEVICE_ERROR, EFI_NO_MEDIA,_or EFI_MEDIA_CHANGED is returned and
+ non-blocking I/O is being used, the Event associated with this request will
+ not be signaled.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] MediaId Id of the media, changes every time the media is
+ replaced.
+ @param[in] Lba The starting Logical Block Address to read from.
+ @param[in, out] Token A pointer to the token associated with the transaction.
+ @param[in] BufferSize Size of Buffer, must be a multiple of device block size.
+ @param[out] Buffer A pointer to the destination buffer for the data. The
+ caller is responsible for either having implicit or
+ explicit ownership of the buffer.
+
+ @retval EFI_SUCCESS The read request was queued if Token->Event is
+ not NULL.The data was read correctly from the
+ device if the Token->Event is NULL.
+ @retval EFI_DEVICE_ERROR The device reported an error while performing
+ the read.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
+ @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of the
+ intrinsic block size of the device.
+ @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,
+ or the buffer is not on proper alignment.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack
+ of resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_READ_EX) (
+ IN EFI_BLOCK_IO2_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN EFI_LBA LBA,
+ IN OUT EFI_BLOCK_IO2_TOKEN *Token,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
+ );
+
+/**
+ Write BufferSize bytes from Lba into Buffer.
+
+ This function writes the requested number of blocks to the device. All blocks
+ are written, or an error is returned.If EFI_DEVICE_ERROR, EFI_NO_MEDIA,
+ EFI_WRITE_PROTECTED or EFI_MEDIA_CHANGED is returned and non-blocking I/O is
+ being used, the Event associated with this request will not be signaled.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] MediaId The media ID that the write request is for.
+ @param[in] Lba The starting logical block address to be written. The
+ caller is responsible for writing to only legitimate
+ locations.
+ @param[in, out] Token A pointer to the token associated with the transaction.
+ @param[in] BufferSize Size of Buffer, must be a multiple of device block size.
+ @param[in] Buffer A pointer to the source buffer for the data.
+
+ @retval EFI_SUCCESS The write request was queued if Event is not NULL.
+ The data was written correctly to the device if
+ the Event is NULL.
+ @retval EFI_WRITE_PROTECTED The device can not be written to.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
+ @retval EFI_DEVICE_ERROR The device reported an error while performing the write.
+ @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
+ @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,
+ or the buffer is not on proper alignment.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack
+ of resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_WRITE_EX) (
+ IN EFI_BLOCK_IO2_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN EFI_LBA LBA,
+ IN OUT EFI_BLOCK_IO2_TOKEN *Token,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+ );
+
+/**
+ Flush the Block Device.
+
+ If EFI_DEVICE_ERROR, EFI_NO_MEDIA,_EFI_WRITE_PROTECTED or EFI_MEDIA_CHANGED
+ is returned and non-blocking I/O is being used, the Event associated with
+ this request will not be signaled.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in,out] Token A pointer to the token associated with the transaction
+
+ @retval EFI_SUCCESS The flush request was queued if Event is not NULL.
+ All outstanding data was written correctly to the
+ device if the Event is NULL.
+ @retval EFI_DEVICE_ERROR The device reported an error while writting back
+ the data.
+ @retval EFI_WRITE_PROTECTED The device cannot be written to.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack
+ of resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_FLUSH_EX) (
+ IN EFI_BLOCK_IO2_PROTOCOL *This,
+ IN OUT EFI_BLOCK_IO2_TOKEN *Token
+ );
+
+///
+/// The Block I/O2 protocol defines an extension to the Block I/O protocol which
+/// enables the ability to read and write data at a block level in a non-blocking
+// manner.
+///
+struct _EFI_BLOCK_IO2_PROTOCOL {
+ ///
+ /// A pointer to the EFI_BLOCK_IO_MEDIA data for this device.
+ /// Type EFI_BLOCK_IO_MEDIA is defined in BlockIo.h.
+ ///
+ EFI_BLOCK_IO_MEDIA *Media;
+
+ EFI_BLOCK_RESET_EX Reset;
+ EFI_BLOCK_READ_EX ReadBlocksEx;
+ EFI_BLOCK_WRITE_EX WriteBlocksEx;
+ EFI_BLOCK_FLUSH_EX FlushBlocksEx;
+};
+
+extern EFI_GUID gEfiBlockIo2ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BlockIoCrypto.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BlockIoCrypto.h
new file mode 100644
index 0000000000..ffac54b3b1
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BlockIoCrypto.h
@@ -0,0 +1,527 @@
+/** @file
+ The UEFI Inline Cryptographic Interface protocol provides services to abstract
+ access to inline cryptographic capabilities.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __BLOCK_IO_CRYPTO_H__
+#define __BLOCK_IO_CRYPTO_H__
+
+#include <Protocol/BlockIo.h>
+
+#define EFI_BLOCK_IO_CRYPTO_PROTOCOL_GUID \
+ { \
+ 0xa00490ba, 0x3f1a, 0x4b4c, {0xab, 0x90, 0x4f, 0xa9, 0x97, 0x26, 0xa1, 0xe8} \
+ }
+
+typedef struct _EFI_BLOCK_IO_CRYPTO_PROTOCOL EFI_BLOCK_IO_CRYPTO_PROTOCOL;
+
+///
+/// The struct of Block I/O Crypto Token.
+///
+typedef struct {
+ //
+ // If Event is NULL, then blocking I/O is performed. If Event is not NULL and
+ // non-blocking I/O is supported, then non-blocking I/O is performed, and
+ // Event will be signaled when the read request is completed and data was
+ // decrypted (when Index was specified).
+ //
+ EFI_EVENT Event;
+ //
+ // Defines whether or not the signaled event encountered an error.
+ //
+ EFI_STATUS TransactionStatus;
+} EFI_BLOCK_IO_CRYPTO_TOKEN;
+
+typedef struct {
+ //
+ // GUID of the algorithm.
+ //
+ EFI_GUID Algorithm;
+ //
+ // Specifies KeySizein bits used with this Algorithm.
+ //
+ UINT64 KeySize;
+ //
+ // Specifies bitmask of block sizes supported by this algorithm.
+ // Bit j being set means that 2^j bytes crypto block size is supported.
+ //
+ UINT64 CryptoBlockSizeBitMask;
+} EFI_BLOCK_IO_CRYPTO_CAPABILITY;
+
+///
+/// EFI_BLOCK_IO_CRYPTO_IV_INPUT structure is used as a common header in CryptoIvInput
+/// parameters passed to the ReadExtended and WriteExtended methods for Inline
+/// Cryptographic Interface.
+/// Its purpose is to pass size of the entire CryptoIvInputparameter memory buffer to
+/// the Inline Cryptographic Interface.
+///
+typedef struct {
+ UINT64 InputSize;
+} EFI_BLOCK_IO_CRYPTO_IV_INPUT;
+
+#define EFI_BLOCK_IO_CRYPTO_ALGO_GUID_AES_XTS \
+ { \
+ 0x2f87ba6a, 0x5c04, 0x4385, {0xa7, 0x80, 0xf3, 0xbf, 0x78, 0xa9, 0x7b, 0xec} \
+ }
+
+extern EFI_GUID gEfiBlockIoCryptoAlgoAesXtsGuid;
+
+typedef struct {
+ EFI_BLOCK_IO_CRYPTO_IV_INPUT Header;
+ UINT64 CryptoBlockNumber;
+ UINT64 CryptoBlockByteSize;
+} EFI_BLOCK_IO_CRYPTO_IV_INPUT_AES_XTS;
+
+#define EFI_BLOCK_IO_CRYPTO_ALGO_GUID_AES_CBC_MICROSOFT_BITLOCKER \
+ { \
+ 0x689e4c62, 0x70bf, 0x4cf3, {0x88, 0xbb, 0x33, 0xb3, 0x18, 0x26, 0x86, 0x70} \
+ }
+
+extern EFI_GUID gEfiBlockIoCryptoAlgoAesCbcMsBitlockerGuid;
+
+typedef struct {
+ EFI_BLOCK_IO_CRYPTO_IV_INPUT Header;
+ UINT64 CryptoBlockByteOffset;
+ UINT64 CryptoBlockByteSize;
+} EFI_BLOCK_IO_CRYPTO_IV_INPUT_AES_CBC_MICROSOFT_BITLOCKER;
+
+#define EFI_BLOCK_IO_CRYPTO_INDEX_ANY 0xFFFFFFFFFFFFFFFF
+
+typedef struct {
+ //
+ // Is inline cryptographic capability supported on this device.
+ //
+ BOOLEAN Supported;
+ //
+ // Maximum number of keys that can be configured at the same time.
+ //
+ UINT64 KeyCount;
+ //
+ // Number of supported capabilities.
+ //
+ UINT64 CapabilityCount;
+ //
+ // Array of supported capabilities.
+ //
+ EFI_BLOCK_IO_CRYPTO_CAPABILITY Capabilities[1];
+} EFI_BLOCK_IO_CRYPTO_CAPABILITIES;
+
+typedef struct {
+ //
+ // Configuration table index. A special Index EFI_BLOCK_IO_CRYPTO_INDEX_ANY can be
+ // used to set any available entry in the configuration table.
+ //
+ UINT64 Index;
+ //
+ // Identifies the owner of the configuration table entry. Entry can also be used
+ // with the Nil value to clear key from the configuration table index.
+ //
+ EFI_GUID KeyOwnerGuid;
+ //
+ // A supported capability to be used. The CryptoBlockSizeBitMask field of the
+ // structure should have only one bit set from the supported mask.
+ //
+ EFI_BLOCK_IO_CRYPTO_CAPABILITY Capability;
+ //
+ // Pointer to the key. The size of the key is defined by the KeySize field of
+ // the capability specified by the Capability parameter.
+ //
+ VOID *CryptoKey;
+} EFI_BLOCK_IO_CRYPTO_CONFIGURATION_TABLE_ENTRY;
+
+typedef struct {
+ //
+ // Configuration table index.
+ //
+ UINT64 Index;
+ //
+ // Identifies the current owner of the entry.
+ //
+ EFI_GUID KeyOwnerGuid;
+ //
+ // The capability to be used. The CryptoBlockSizeBitMask field of the structure
+ // has only one bit set from the supported mask.
+ //
+ EFI_BLOCK_IO_CRYPTO_CAPABILITY Capability;
+} EFI_BLOCK_IO_CRYPTO_RESPONSE_CONFIGURATION_ENTRY;
+
+/**
+ Reset the block device hardware.
+
+ The Reset() function resets the block device hardware.
+
+ As part of the initialization process, the firmware/device will make a quick but
+ reasonable attempt to verify that the device is functioning.
+
+ If the ExtendedVerificationflag is TRUE the firmware may take an extended amount
+ of time to verify the device is operating on reset. Otherwise the reset operation
+ is to occur as quickly as possible.
+
+ The hardware verification process is not defined by this specification and is left
+ up to the platform firmware or driver to implement.
+
+ @param[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
+ @param[in] ExtendedVerification Indicates that the driver may perform a more exhausive
+ verification operation of the device during reset.
+
+ @retval EFI_SUCCESS The block device was reset.
+ @retval EFI_DEVICE_ERROR The block device is not functioning correctly and could
+ not be reset.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_IO_CRYPTO_RESET) (
+ IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+ );
+
+/**
+ Get the capabilities of the underlying inline cryptographic interface.
+
+ The GetCapabilities() function determines whether pre-OS controllable inline crypto
+ is supported by the system for the current disk and, if so, returns the capabilities
+ of the crypto engine.
+
+ The caller is responsible for providing the Capabilities structure with a sufficient
+ number of entries.
+
+ If the structure is too small, the EFI_BUFFER_TOO_SMALL error code is returned and the
+ CapabilityCount field contains the number of entries needed to contain the capabilities.
+
+ @param[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
+ @param[out] Capabilities Pointer to the EFI_BLOCK_IO_CRYPTO_CAPABILITIES structure.
+
+ @retval EFI_SUCCESS The ICI is ready for use.
+ @retval EFI_BUFFER_TOO_SMALL The Capabilities structure was too small. The number of
+ entries needed is returned in the CapabilityCount field
+ of the structure.
+ @retval EFI_NO_RESPONSE No response was received from the ICI.
+ @retval EFI_DEVICE_ERROR An error occurred when attempting to access the ICI.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER Capabilities is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_IO_CRYPTO_GET_CAPABILITIES) (
+ IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This,
+ OUT EFI_BLOCK_IO_CRYPTO_CAPABILITIES *Capabilities
+ );
+
+/**
+ Set the configuration of the underlying inline cryptographic interface.
+
+ The SetConfiguration() function allows the user to set the current configuration of the
+ inline cryptographic interface and should be called before attempting any crypto operations.
+
+ This configures the configuration table entries with algorithms, key sizes and keys. Each
+ configured entry can later be referred to by index at the time of storage transaction.
+
+ The configuration table index will refer to the combination ofKeyOwnerGuid, Algorithm, and
+ CryptoKey.
+
+ KeyOwnerGuid identifies the component taking ownership of the entry. It helps components to
+ identify their own entries, cooperate with other owner components, and avoid conflicts. This
+ Guid identifier is there to help coordination between cooperating components and not a security
+ or synchronization feature. The Nil GUID can be used by a component to release use of entry
+ owned. It is also used to identify potentially available entries (see GetConfiguration).
+
+ CryptoKey specifies algorithm-specific key material to use within parameters of selected crypto
+ capability.
+
+ This function is called infrequently typically once, on device start, before IO starts. It
+ can be called at later times in cases the number of keysused on the drive is higher than what
+ can be configured at a time or a new key has to be added.
+
+ Components setting or changing an entry or entries for a given index or indices must ensure
+ that IO referencing affected indices is temporarily blocked (run-down) at the time of change.
+
+ Indices parameters in each parameter table entry allow to set only a portion of the available
+ table entries in the crypto module anywhere from single entry to entire table supported.
+
+ If corresponding table entry or entries being set are already in use by another owner the call
+ should be failed and none of the entries should be modified. The interface implementation must
+ enforce atomicity of this operation (should either succeed fully or fail completely without
+ modifying state).
+
+ Note that components using GetConfiguration command to discover available entries should be
+ prepared that by the time of calling SetConfiguration the previously available entry may have
+ become occupied. Such components should be prepared to re-try the sequence of operations.
+
+ Alternatively EFI_BLOCK_IO_CRYPTO_INDEX_ANY can be used to have the implementation discover
+ and allocate available,if any, indices atomically.
+
+ An optional ResultingTable pointer can be provided by the caller to receive the newly configured
+ entries. The array provided by the caller must have at least ConfigurationCount of entries.
+
+ @param[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
+ @param[in] ConfigurationCount Number of entries being configured with this call.
+ @param[in] ConfigurationTable Pointer to a table used to populate the configuration table.
+ @param[out] ResultingTable Optional pointer to a table that receives the newly configured
+ entries.
+
+ @retval EFI_SUCCESS The ICI is ready for use.
+ @retval EFI_NO_RESPONSE No response was received from the ICI.
+ @retval EFI_DEVICE_ERROR An error occurred when attempting to access the ICI.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER ConfigurationTable is NULL.
+ @retval EFI_INVALID_PARAMETER ConfigurationCount is 0.
+ @retval EFI_OUT_OF_RESOURCES Could not find the requested number of available entries in the
+ configuration table.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_IO_CRYPTO_SET_CONFIGURATION) (
+ IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This,
+ IN UINT64 ConfigurationCount,
+ IN EFI_BLOCK_IO_CRYPTO_CONFIGURATION_TABLE_ENTRY *ConfigurationTable,
+ OUT EFI_BLOCK_IO_CRYPTO_RESPONSE_CONFIGURATION_ENTRY *ResultingTable OPTIONAL
+ );
+
+/**
+ Get the configuration of the underlying inline cryptographic interface.
+
+ The GetConfiguration() function allows the user to get the configuration of the inline
+ cryptographic interface.
+
+ Retrieves, entirely or partially, the currently configured key table. Note that the keys
+ themselves are not retrieved, but rather just indices, owner GUIDs and capabilities.
+
+ If fewer entries than specified by ConfigurationCount are returned, the Index field of the
+ unused entries is set to EFI_BLOCK_IO_CRYPTO_INDEX_ANY.
+
+ @param[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
+ @param[in] StartIndex Configuration table index at which to start the configuration
+ query.
+ @param[in] ConfigurationCount Number of entries to return in the response table.
+ @param[in] KeyOwnerGuid Optional parameter to filter response down to entries with a
+ given owner. A pointer to the Nil value can be used to return
+ available entries. Set to NULL when no owner filtering is required.
+ @param[out] ConfigurationTable Table of configured configuration table entries (with no CryptoKey
+ returned): configuration table index, KeyOwnerGuid, Capability.
+ Should have sufficient space to store up to ConfigurationCount
+ entries.
+
+ @retval EFI_SUCCESS The ICI is ready for use.
+ @retval EFI_NO_RESPONSE No response was received from the ICI.
+ @retval EFI_DEVICE_ERROR An error occurred when attempting to access the ICI.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER Configuration table is NULL.
+ @retval EFI_INVALID_PARAMETER StartIndex is out of bounds.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_IO_CRYPTO_GET_CONFIGURATION) (
+ IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This,
+ IN UINT64 StartIndex,
+ IN UINT64 ConfigurationCount,
+ IN EFI_GUID *KeyOwnerGuid OPTIONAL,
+ OUT EFI_BLOCK_IO_CRYPTO_RESPONSE_CONFIGURATION_ENTRY *ConfigurationTable
+);
+
+/**
+ Reads the requested number of blocks from the device and optionally decrypts
+ them inline.
+
+ TheReadExtended() function allows the caller to perform a storage device read
+ operation. The function reads the requested number of blocks from the device
+ and then if Index is specified decrypts them inline. All the blocks are read
+ and decrypted (if decryption requested), or an error is returned.
+
+ If there is no media in the device, the function returns EFI_NO_MEDIA. If the
+ MediaId is not the ID for the current media in the device, the function returns
+ EFI_MEDIA_CHANGED.
+
+ If EFI_DEVICE_ERROR, EFI_NO_MEDIA, or EFI_MEDIA_CHANGED is returned and nonblocking
+ I/O is being used, the Event associated with this request will not be signaled.
+
+ In addition to standard storage transaction parameters (LBA, IO size, and buffer),
+ this command will also specify a configuration table Index and CryptoIvInput
+ when data has to be decrypted inline by the controller after being read from
+ the storage device. If an Index parameter is not specified, no decryption is
+ performed.
+
+ @param[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
+ @param[in] MediaId The media ID that the read request is for.
+ @param[in] LBA The starting logical block address to read from on
+ the device.
+ @param[in, out] Token A pointer to the token associated with the transaction.
+ @param[in] BufferSize The size of the Buffer in bytes. This must be a multiple
+ of the intrinsic block size of the device.
+ @param[out] Buffer A pointer to the destination buffer for the data. The
+ caller is responsible for either having implicit or
+ explicit ownership of the buffer.
+ @param[in] Index A pointer to the configuration table index. This is
+ optional.
+ @param[in] CryptoIvInput A pointer to a buffer that contains additional
+ cryptographic parameters as required by the capability
+ referenced by the configuration table index, such as
+ cryptographic initialization vector.
+
+ @retval EFI_SUCCESS The read request was queued if Token-> Event is not NULL.
+ The data was read correctly from the device if the
+ Token->Event is NULL.
+ @retval EFI_DEVICE_ERROR The device reported an error while attempting to perform
+ the read operation and/or decryption operation.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
+ @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of the intrinsic
+ block size of the device.
+ @retval EFI_INVALID_PARAMETER This is NULL, or the read request contains LBAs that are
+ not valid, or the buffer is not on proper alignment.
+ @retval EFI_INVALID_PARAMETER CryptoIvInput is incorrect.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of
+ resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_IO_CRYPTO_READ_EXTENDED) (
+ IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN EFI_LBA LBA,
+ IN OUT EFI_BLOCK_IO_CRYPTO_TOKEN *Token,
+ IN UINT64 BufferSize,
+ OUT VOID *Buffer,
+ IN UINT64 *Index OPTIONAL,
+ IN VOID *CryptoIvInput OPTIONAL
+ );
+
+/**
+ Optionally encrypts a specified number of blocks inline and then writes to the
+ device.
+
+ The WriteExtended() function allows the caller to perform a storage device write
+ operation. The function encrypts the requested number of blocks inline if Index
+ is specified and then writes them to the device. All the blocks are encrypted
+ (if encryption requested) and written, or an error is returned.
+
+ If there is no media in the device, the function returns EFI_NO_MEDIA. If the
+ MediaId is not the ID for the current media in the device, the function returns
+ EFI_MEDIA_CHANGED.
+
+ If EFI_DEVICE_ERROR, EFI_NO_MEDIA, or EFI_MEDIA_CHANGED is returned and nonblocking
+ I/O is being used, the Event associated with this request will not be signaled.
+
+ In addition to standard storage transaction parameters (LBA, IO size, and buffer),
+ this command will also specify a configuration table Index and a CryptoIvInput
+ when data has to be decrypted inline by the controller before being written to
+ the storage device. If no Index parameter is specified, no encryption is performed.
+
+ @param[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
+ @param[in] MediaId The media ID that the read request is for.
+ @param[in] LBA The starting logical block address to read from on
+ the device.
+ @param[in, out] Token A pointer to the token associated with the transaction.
+ @param[in] BufferSize The size of the Buffer in bytes. This must be a multiple
+ of the intrinsic block size of the device.
+ @param[in] Buffer A pointer to the source buffer for the data.
+ @param[in] Index A pointer to the configuration table index. This is
+ optional.
+ @param[in] CryptoIvInput A pointer to a buffer that contains additional
+ cryptographic parameters as required by the capability
+ referenced by the configuration table index, such as
+ cryptographic initialization vector.
+
+ @retval EFI_SUCCESS The request to encrypt (optionally) and write was queued
+ if Event is not NULL. The data was encrypted (optionally)
+ and written correctly to the device if the Event is NULL.
+ @retval EFI_WRITE_PROTECTED The device cannot be written to.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
+ @retval EFI_DEVICE_ERROR The device reported an error while attempting to encrypt
+ blocks or to perform the write operation.
+ @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of the intrinsic
+ block size of the device.
+ @retval EFI_INVALID_PARAMETER This is NULL, or the write request contains LBAs that are
+ not valid, or the buffer is not on proper alignment.
+ @retval EFI_INVALID_PARAMETER CryptoIvInput is incorrect.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of
+ resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_IO_CRYPTO_WRITE_EXTENDED) (
+ IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN EFI_LBA LBA,
+ IN OUT EFI_BLOCK_IO_CRYPTO_TOKEN *Token,
+ IN UINT64 BufferSize,
+ IN VOID *Buffer,
+ IN UINT64 *Index OPTIONAL,
+ IN VOID *CryptoIvInput OPTIONAL
+ );
+
+/**
+ Flushes all modified data toa physical block device.
+
+ The FlushBlocks() function flushes all modified data to the physical block device.
+ Any modified data that has to be encrypted must have been already encrypted as a
+ part of WriteExtended() operation - inline crypto operation cannot be a part of
+ flush operation.
+
+ All data written to the device prior to the flush must be physically written before
+ returning EFI_SUCCESS from this function. This would include any cached data the
+ driver may have cached, and cached data the device may have cached. A flush may
+ cause a read request following the flush to force a device access.
+
+ If EFI_DEVICE_ERROR, EFI_NO_MEDIA, EFI_WRITE_PROTECTED or EFI_MEDIA_CHANGED is
+ returned and non-blocking I/O is being used, the Event associated with this request
+ will not be signaled.
+
+ @param[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
+ @param[in, out] Token A pointer to the token associated with the transaction.
+
+ @retval EFI_SUCCESS The flush request was queued if Event is not NULL. All
+ outstanding data was written correctly to the device if
+ the Event is NULL.
+ @retval EFI_DEVICE_ERROR The device reported an error while attempting to write data.
+ @retval EFI_WRITE_PROTECTED The device cannot be written to.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of
+ resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_IO_CRYPTO_FLUSH) (
+ IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This,
+ IN OUT EFI_BLOCK_IO_CRYPTO_TOKEN *Token
+ );
+
+///
+/// The EFI_BLOCK_IO_CRYPTO_PROTOCOL defines a UEFI protocol that can be used by UEFI
+/// drivers and applications to perform block encryption on a storage device, such as UFS.
+///
+struct _EFI_BLOCK_IO_CRYPTO_PROTOCOL {
+ EFI_BLOCK_IO_MEDIA *Media;
+ EFI_BLOCK_IO_CRYPTO_RESET Reset;
+ EFI_BLOCK_IO_CRYPTO_GET_CAPABILITIES GetCapabilities;
+ EFI_BLOCK_IO_CRYPTO_SET_CONFIGURATION SetConfiguration;
+ EFI_BLOCK_IO_CRYPTO_GET_CONFIGURATION GetConfiguration;
+ EFI_BLOCK_IO_CRYPTO_READ_EXTENDED ReadExtended;
+ EFI_BLOCK_IO_CRYPTO_WRITE_EXTENDED WriteExtended;
+ EFI_BLOCK_IO_CRYPTO_FLUSH FlushBlocks;
+};
+
+extern EFI_GUID gEfiBlockIoCryptoProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothAttribute.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothAttribute.h
new file mode 100644
index 0000000000..71df2b9459
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothAttribute.h
@@ -0,0 +1,283 @@
+/** @file
+ EFI Bluetooth Attribute Protocol as defined in UEFI 2.7.
+ This protocol provides service for Bluetooth ATT (Attribute Protocol) and GATT (Generic
+ Attribute Profile) based protocol interfaces.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.7
+
+**/
+
+#ifndef __EFI_BLUETOOTH_ATTRIBUTE_H__
+#define __EFI_BLUETOOTH_ATTRIBUTE_H__
+
+#define EFI_BLUETOOTH_ATTRIBUTE_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0x5639867a, 0x8c8e, 0x408d, { 0xac, 0x2f, 0x4b, 0x61, 0xbd, 0xc0, 0xbb, 0xbb } \
+ }
+
+#define EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL_GUID \
+ { \
+ 0x898890e9, 0x84b2, 0x4f3a, { 0x8c, 0x58, 0xd8, 0x57, 0x78, 0x13, 0xe0, 0xac } \
+ }
+
+typedef struct _EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL;
+
+#pragma pack(1)
+
+//
+// Bluetooth UUID
+//
+typedef struct {
+ UINT8 Length;
+ union {
+ UINT16 Uuid16;
+ UINT32 Uuid32;
+ UINT8 Uuid128[16];
+ } Data;
+} EFI_BLUETOOTH_UUID;
+
+
+#define UUID_16BIT_TYPE_LEN 2
+#define UUID_32BIT_TYPE_LEN 4
+#define UUID_128BIT_TYPE_LEN 16
+
+#define BLUETOOTH_IS_ATTRIBUTE_OF_TYPE(a,t) ((a)->Type.Length == UUID_16BIT_TYPE_LEN && (a)->Type.Data.Uuid16 == (t))
+
+//
+// Bluetooth Attribute Permission
+//
+typedef union {
+ struct {
+ UINT16 Readable : 1;
+ UINT16 ReadEncryption : 1;
+ UINT16 ReadAuthentication : 1;
+ UINT16 ReadAuthorization : 1;
+ UINT16 ReadKeySize : 5;
+ UINT16 Reserved1 : 7;
+ UINT16 Writeable : 1;
+ UINT16 WriteEncryption : 1;
+ UINT16 WriteAuthentication : 1;
+ UINT16 WriteAuthorization : 1;
+ UINT16 WriteKeySize : 5;
+ UINT16 Reserved2 : 7;
+ } Permission;
+ UINT32 Data32;
+} EFI_BLUETOOTH_ATTRIBUTE_PERMISSION;
+
+typedef struct {
+ EFI_BLUETOOTH_UUID Type;
+ UINT16 Length;
+ UINT16 AttributeHandle;
+ EFI_BLUETOOTH_ATTRIBUTE_PERMISSION AttributePermission;
+} EFI_BLUETOOTH_ATTRIBUTE_HEADER;
+
+typedef struct {
+ EFI_BLUETOOTH_ATTRIBUTE_HEADER Header;
+ UINT16 EndGroupHandle;
+ EFI_BLUETOOTH_UUID ServiceUuid;
+} EFI_BLUETOOTH_GATT_PRIMARY_SERVICE_INFO;
+
+typedef struct {
+ EFI_BLUETOOTH_ATTRIBUTE_HEADER Header;
+ UINT16 StartGroupHandle;
+ UINT16 EndGroupHandle;
+ EFI_BLUETOOTH_UUID ServiceUuid;
+} EFI_BLUETOOTH_GATT_INCLUDE_SERVICE_INFO;
+
+typedef struct {
+ EFI_BLUETOOTH_ATTRIBUTE_HEADER Header;
+ UINT8 CharacteristicProperties;
+ UINT16 CharacteristicValueHandle;
+ EFI_BLUETOOTH_UUID CharacteristicUuid;
+} EFI_BLUETOOTH_GATT_CHARACTERISTIC_INFO;
+
+typedef struct {
+ EFI_BLUETOOTH_ATTRIBUTE_HEADER Header;
+ EFI_BLUETOOTH_UUID CharacteristicDescriptorUuid;
+} EFI_BLUETOOTH_GATT_CHARACTERISTIC_DESCRIPTOR_INFO;
+
+#pragma pack()
+
+typedef struct {
+ UINT16 AttributeHandle;
+} EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_PARAMETER_NOTIFICATION;
+
+typedef struct {
+ UINT16 AttributeHandle;
+} EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_PARAMETER_INDICATION;
+
+typedef struct {
+ UINT32 Version;
+ UINT8 AttributeOpCode;
+ union {
+ EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_PARAMETER_NOTIFICATION Notification;
+ EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_PARAMETER_INDICATION Indication;
+ } Parameter;
+} EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_PARAMETER;
+
+typedef struct {
+ UINT32 Version;
+ BLUETOOTH_LE_ADDRESS BD_ADDR;
+ BLUETOOTH_LE_ADDRESS DirectAddress;
+ UINT8 RSSI;
+ UINTN AdvertisementDataSize;
+ VOID *AdvertisementData;
+} EFI_BLUETOOTH_LE_DEVICE_INFO;
+
+/**
+ The callback function to send request.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL instance.
+ @param[in] Data Data received. The first byte is the attribute opcode, followed by opcode specific
+ fields. See Bluetooth specification, Vol 3, Part F, Attribute Protocol. It might be a
+ normal RESPONSE message, or ERROR RESPONSE messag
+ @param[in] DataLength The length of Data in bytes.
+ @param[in] Context The context passed from the callback registration request.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_FUNCTION) (
+ IN EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL *This,
+ IN VOID *Data,
+ IN UINTN DataLength,
+ IN VOID *Context
+ );
+
+/**
+ Send a "REQUEST" or "COMMAND" message to remote server and receive a "RESPONSE" message
+ for "REQUEST" from remote server according to Bluetooth attribute protocol data unit(PDU).
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL instance.
+ @param[in] Data Data of a REQUEST or COMMAND message. The first byte is the attribute PDU
+ related opcode, followed by opcode specific fields. See Bluetooth specification,
+ Vol 3, Part F, Attribute Protocol.
+ @param[in] DataLength The length of Data in bytes.
+ @param[in] Callback Callback function to notify the RESPONSE is received to the caller, with the
+ response buffer. Caller must check the response buffer content to know if the
+ request action is success or fail. It may be NULL if the data is a COMMAND.
+ @param[in] Context Data passed into Callback function. It is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The request is sent successfully.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid due to following conditions:
+ - The Buffer is NULL.
+ - The BufferLength is 0.
+ - The opcode in Buffer is not a valid OPCODE according to Bluetooth specification.
+ - The Callback is NULL.
+ @retval EFI_DEVICE_ERROR Sending the request failed due to the host controller or the device error.
+ @retval EFI_NOT_READY A GATT operation is already underway for this device.
+ @retval EFI_UNSUPPORTED The attribute does not support the corresponding operation.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_ATTRIBUTE_SEND_REQUEST) (
+ IN EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL *This,
+ IN VOID *Data,
+ IN UINTN DataLength,
+ IN EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_FUNCTION Callback,
+ IN VOID *Context
+ );
+
+/**
+ Register or unregister a server initiated message, such as NOTIFICATION or INDICATION, on a
+ characteristic value on remote server.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL instance.
+ @param[in] CallbackParameter The parameter of the callback.
+ @param[in] Callback Callback function for server initiated attribute protocol. NULL callback
+ function means unregister the server initiated callback.
+ @param[in] Context Data passed into Callback function. It is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The callback function is registered or unregistered successfully
+ @retval EFI_INVALID_PARAMETER The attribute opcode is not server initiated message opcode. See
+ Bluetooth specification, Vol 3, Part F, Attribute Protocol.
+ @retval EFI_ALREADY_STARTED A callback function is already registered on the same attribute
+ opcode and attribute handle, when the Callback is not NULL.
+ @retval EFI_NOT_STARTED A callback function is not registered on the same attribute opcode
+ and attribute handle, when the Callback is NULL.
+ @retval EFI_NOT_READY A GATT operation is already underway for this device.
+ @retval EFI_UNSUPPORTED The attribute does not support notification.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_ATTRIBUTE_REGISTER_FOR_SERVER_NOTIFICATION)(
+ IN EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL *This,
+ IN EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_PARAMETER *CallbackParameter,
+ IN EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_FUNCTION Callback,
+ IN VOID *Context
+ );
+
+/**
+ Get Bluetooth discovered service information.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL instance.
+ @param[out] ServiceInfoSize A pointer to the size, in bytes, of the ServiceInfo buffer.
+ @param[out] ServiceInfo A pointer to a callee allocated buffer that returns Bluetooth
+ discovered service information. Callee allocates this buffer by
+ using EFI Boot Service AllocatePool().
+
+ @retval EFI_SUCCESS The Bluetooth discovered service information is returned successfully.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the Bluetooth discovered
+ service information.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_ATTRIBUTE_GET_SERVICE_INFO)(
+ IN EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL *This,
+ OUT UINTN *ServiceInfoSize,
+ OUT VOID **ServiceInfo
+ );
+
+/**
+ Get Bluetooth device information.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL instance.
+ @param[out] DeviceInfoSize A pointer to the size, in bytes, of the DeviceInfo buffer.
+ @param[out] DeviceInfo A pointer to a callee allocated buffer that returns Bluetooth
+ device information. Callee allocates this buffer by using EFI Boot
+ Service AllocatePool(). If this device is Bluetooth classic
+ device, EFI_BLUETOOTH_DEVICE_INFO should be used. If
+ this device is Bluetooth LE device, EFI_BLUETOOTH_LE_DEVICE_INFO
+ should be used.
+
+ @retval EFI_SUCCESS The Bluetooth device information is returned successfully.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the Bluetooth device
+ information
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_ATTRIBUTE_GET_DEVICE_INFO)(
+ IN EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL *This,
+ OUT UINTN *DeviceInfoSize,
+ OUT VOID **DeviceInfo
+ );
+
+struct _EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL {
+ EFI_BLUETOOTH_ATTRIBUTE_SEND_REQUEST SendRequest;
+ EFI_BLUETOOTH_ATTRIBUTE_REGISTER_FOR_SERVER_NOTIFICATION RegisterForServerNotification;
+ EFI_BLUETOOTH_ATTRIBUTE_GET_SERVICE_INFO GetServiceInfo;
+ EFI_BLUETOOTH_ATTRIBUTE_GET_DEVICE_INFO GetDeviceInfo;
+};
+
+
+extern EFI_GUID gEfiBluetoothAttributeProtocolGuid;
+extern EFI_GUID gEfiBluetoothAttributeServiceBindingProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothConfig.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothConfig.h
new file mode 100644
index 0000000000..cd72d2f6bc
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothConfig.h
@@ -0,0 +1,529 @@
+/** @file
+ EFI Bluetooth Configuration Protocol as defined in UEFI 2.7.
+ This protocol abstracts user interface configuration for Bluetooth device.
+
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.7
+
+**/
+
+#ifndef __EFI_BLUETOOTH_CONFIG_PROTOCOL_H__
+#define __EFI_BLUETOOTH_CONFIG_PROTOCOL_H__
+
+#include <IndustryStandard/Bluetooth.h>
+
+#define EFI_BLUETOOTH_CONFIG_PROTOCOL_GUID \
+ { \
+ 0x62960cf3, 0x40ff, 0x4263, { 0xa7, 0x7c, 0xdf, 0xde, 0xbd, 0x19, 0x1b, 0x4b } \
+ }
+
+typedef struct _EFI_BLUETOOTH_CONFIG_PROTOCOL EFI_BLUETOOTH_CONFIG_PROTOCOL;
+
+typedef UINT32 EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_TYPE;
+#define EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_CONNECTED 0x1
+#define EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_PAIRED 0x2
+
+///
+/// EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION
+///
+typedef struct {
+ ///
+ /// 48bit Bluetooth device address.
+ ///
+ BLUETOOTH_ADDRESS BDAddr;
+ ///
+ /// State of the remote deive
+ ///
+ UINT8 RemoteDeviceState;
+ ///
+ /// Bluetooth ClassOfDevice. See Bluetooth specification for detail.
+ ///
+ BLUETOOTH_CLASS_OF_DEVICE ClassOfDevice;
+ ///
+ /// Remote device name
+ ///
+ UINT8 RemoteDeviceName[BLUETOOTH_HCI_COMMAND_LOCAL_READABLE_NAME_MAX_SIZE];
+} EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION;
+
+///
+/// EFI_BLUETOOTH_CONFIG_DATA_TYPE
+///
+typedef enum {
+ ///
+ /// Local/Remote Bluetooth device name. Data structure is zero terminated CHAR8[].
+ ///
+ EfiBluetoothConfigDataTypeDeviceName,
+ ///
+ /// Local/Remote Bluetooth device ClassOfDevice. Data structure is BLUETOOTH_CLASS_OF_DEVICE.
+ ///
+ EfiBluetoothConfigDataTypeClassOfDevice,
+ ///
+ /// Remote Bluetooth device state. Data structure is EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_TYPE.
+ ///
+ EfiBluetoothConfigDataTypeRemoteDeviceState, /* Relevant for LE*/
+ ///
+ /// Local/Remote Bluetooth device SDP information. Data structure is UINT8[].
+ ///
+ EfiBluetoothConfigDataTypeSdpInfo,
+ ///
+ /// Local Bluetooth device address. Data structure is BLUETOOTH_ADDRESS.
+ ///
+ EfiBluetoothConfigDataTypeBDADDR, /* Relevant for LE*/
+ ///
+ /// Local Bluetooth discoverable state. Data structure is UINT8. (Page scan and/or Inquiry scan)
+ ///
+ EfiBluetoothConfigDataTypeDiscoverable, /* Relevant for LE*/
+ ///
+ /// Local Bluetooth controller stored paired device list. Data structure is BLUETOOTH_ADDRESS[].
+ ///
+ EfiBluetoothConfigDataTypeControllerStoredPairedDeviceList,
+ ///
+ /// Local available device list. Data structure is BLUETOOTH_ADDRESS[].
+ ///
+ EfiBluetoothConfigDataTypeAvailableDeviceList,
+ EfiBluetoothConfigDataTypeRandomAddress, /* Relevant for LE*/
+ EfiBluetoothConfigDataTypeRSSI, /* Relevant for LE*/
+ ///
+ /// Advertisement report. Data structure is UNIT8[].
+ ///
+ EfiBluetoothConfigDataTypeAdvertisementData, /* Relevant for LE*/
+ EfiBluetoothConfigDataTypeIoCapability, /* Relevant for LE*/
+ EfiBluetoothConfigDataTypeOOBDataFlag, /* Relevant for LE*/
+ ///
+ /// KeyType of Authentication Requirements flag of local
+ /// device as UINT8, indicating requested security properties.
+ /// See Bluetooth specification 3.H.3.5.1. BIT0: MITM, BIT1:SC.
+ ///
+ EfiBluetoothConfigDataTypeKeyType, /* Relevant for LE*/
+ EfiBluetoothConfigDataTypeEncKeySize, /* Relevant for LE*/
+ EfiBluetoothConfigDataTypeMax,
+} EFI_BLUETOOTH_CONFIG_DATA_TYPE;
+
+///
+/// EFI_BLUETOOTH_PIN_CALLBACK_TYPE.
+///
+typedef enum {
+ ///
+ /// For SSP - passkey entry. Input buffer is Passkey (4 bytes). No output buffer.
+ /// See Bluetooth HCI command for detail.
+ ///
+ EfiBluetoothCallbackTypeUserPasskeyNotification,
+ ///
+ /// For SSP - just work and numeric comparison. Input buffer is numeric value (4 bytes).
+ /// Output buffer is BOOLEAN (1 byte). See Bluetooth HCI command for detail.
+ ///
+ EfiBluetoothCallbackTypeUserConfirmationRequest,
+ ///
+ /// For SSP - OOB. See Bluetooth HCI command for detail.
+ ///
+ EfiBluetoothCallbackTypeOOBDataRequest,
+ ///
+ /// For legacy paring. No input buffer. Output buffer is PIN code( <= 16 bytes).
+ /// See Bluetooth HCI command for detail.
+ ///
+ EfiBluetoothCallbackTypePinCodeRequest,
+ EfiBluetoothCallbackTypeMax
+} EFI_BLUETOOTH_PIN_CALLBACK_TYPE;
+
+///
+/// EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.
+///
+typedef enum {
+ ///
+ /// This callback is called when Bluetooth receive Disconnection_Complete event. Input buffer is Event
+ /// Parameters of Disconnection_Complete Event defined in Bluetooth specification.
+ ///
+ EfiBluetoothConnCallbackTypeDisconnected,
+ ///
+ /// This callback is called when Bluetooth receive Connection_Complete event. Input buffer is Event
+ /// Parameters of Connection_Complete Event defined in Bluetooth specification.
+ ///
+ EfiBluetoothConnCallbackTypeConnected,
+ ///
+ /// This callback is called when Bluetooth receive Authentication_Complete event. Input buffer is Event
+ /// Parameters of Authentication_Complete Event defined in Bluetooth specification.
+ ///
+ EfiBluetoothConnCallbackTypeAuthenticated,
+ ///
+ /// This callback is called when Bluetooth receive Encryption_Change event. Input buffer is Event
+ /// Parameters of Encryption_Change Event defined in Bluetooth specification.
+ ///
+ EfiBluetoothConnCallbackTypeEncrypted
+} EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE;
+
+
+/**
+ Initialize Bluetooth host controller and local device.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The Bluetooth host controller and local device is initialized successfully.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to initialize the Bluetooth host controller
+ and local device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_INIT)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This
+ );
+
+/**
+ Callback function, it is called if a Bluetooth device is found during scan process.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Context Context passed from scan request.
+ @param CallbackInfo Data related to scan result. NULL CallbackInfo means scan complete.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION) (
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION *CallbackInfo
+ );
+
+/**
+ Scan Bluetooth device.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param ReScan If TRUE, a new scan request is submitted no matter there is scan result before.
+ If FALSE and there is scan result, the previous scan result is returned and no scan request
+ is submitted.
+ @param ScanType Bluetooth scan type, Inquiry and/or Page. See Bluetooth specification for detail.
+ @param Callback The callback function. This function is called if a Bluetooth device is found during scan
+ process.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The Bluetooth scan request is submitted.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to scan the Bluetooth device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_SCAN)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN BOOLEAN ReScan,
+ IN UINT8 ScanType,
+ IN EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION Callback,
+ IN VOID *Context
+ );
+
+/**
+ Connect a Bluetooth device.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param BD_ADDR The address of Bluetooth device to be connected.
+
+ @retval EFI_SUCCESS The Bluetooth device is connected successfully.
+ @retval EFI_ALREADY_STARTED The Bluetooth device is already connected.
+ @retval EFI_NOT_FOUND The Bluetooth device is not found.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to connect the Bluetooth device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_CONNECT)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN BLUETOOTH_ADDRESS *BD_ADDR
+ );
+
+/**
+ Disconnect a Bluetooth device.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param BD_ADDR The address of Bluetooth device to be connected.
+ @param Reason Bluetooth disconnect reason. See Bluetooth specification for detail.
+
+ @retval EFI_SUCCESS The Bluetooth device is disconnected successfully.
+ @retval EFI_NOT_STARTED The Bluetooth device is not connected.
+ @retval EFI_NOT_FOUND The Bluetooth device is not found.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to disconnect the Bluetooth device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_DISCONNECT)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN BLUETOOTH_ADDRESS *BD_ADDR,
+ IN UINT8 Reason
+ );
+
+/**
+ Get Bluetooth configuration data.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param DataType Configuration data type.
+ @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.
+ On output, indicates the amount of data actually returned.
+ @param Data A pointer to the buffer of data that will be returned.
+
+ @retval EFI_SUCCESS The Bluetooth configuration data is returned successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataSize is NULL.
+ - *DataSize is not 0 and Data is NULL.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_NOT_FOUND The DataType is not found.
+ @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
+ *DataSize has been updated with the size needed to complete the request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_GET_DATA)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,
+ IN OUT UINTN *DataSize,
+ IN OUT VOID *Data
+ );
+
+/**
+ Set Bluetooth configuration data.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param DataType Configuration data type.
+ @param DataSize Indicates the size, in bytes, of the data buffer specified by Data.
+ @param Data A pointer to the buffer of data that will be set.
+
+ @retval EFI_SUCCESS The Bluetooth configuration data is set successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataSize is 0.
+ - Data is NULL.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_BUFFER_TOO_SMALL Cannot set configuration data.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_SET_DATA)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,
+ IN UINTN DataSize,
+ IN VOID *Data
+ );
+
+/**
+ Get remove Bluetooth device configuration data.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param DataType Configuration data type.
+ @param BDAddr Remote Bluetooth device address.
+ @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.
+ On output, indicates the amount of data actually returned.
+ @param Data A pointer to the buffer of data that will be returned.
+
+ @retval EFI_SUCCESS The remote Bluetooth device configuration data is returned successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataSize is NULL.
+ - *DataSize is not 0 and Data is NULL.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_NOT_FOUND The DataType is not found.
+ @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
+ *DataSize has been updated with the size needed to complete the request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,
+ IN BLUETOOTH_ADDRESS *BDAddr,
+ IN OUT UINTN *DataSize,
+ IN OUT VOID *Data
+ );
+
+/**
+ The callback function for PIN code.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Context Context passed from registration.
+ @param CallbackType Callback type in EFI_BLUETOOTH_PIN_CALLBACK_TYPE.
+ @param InputBuffer A pointer to the buffer of data that is input from callback caller.
+ @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.
+ @param OutputBuffer A pointer to the buffer of data that will be output from callback callee.
+ Callee allocates this buffer by using EFI Boot Service AllocatePool().
+ @param OutputBufferSize Indicates the size, in bytes, of the data buffer specified by OutputBuffer.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN EFI_BLUETOOTH_PIN_CALLBACK_TYPE CallbackType,
+ IN VOID *InputBuffer,
+ IN UINTN InputBufferSize,
+ OUT VOID **OutputBuffer,
+ OUT UINTN *OutputBufferSize
+ );
+
+/**
+ Register PIN callback function.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Callback The callback function. NULL means unregister.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The PIN callback function is registered successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION Callback,
+ IN VOID *Context
+ );
+
+/**
+ The callback function to get link key.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Context Context passed from registration.
+ @param BDAddr A pointer to Bluetooth device address.
+ @param LinkKey A pointer to the buffer of link key.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN BLUETOOTH_ADDRESS *BDAddr,
+ OUT UINT8 LinkKey[BLUETOOTH_HCI_LINK_KEY_SIZE]
+ );
+
+/**
+ Register get link key callback function.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Callback The callback function. NULL means unregister.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The link key callback function is registered successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION Callback,
+ IN VOID *Context
+ );
+
+/**
+ The callback function to set link key.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Context Context passed from registration.
+ @param BDAddr A pointer to Bluetooth device address.
+ @param LinkKey A pointer to the buffer of link key.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN BLUETOOTH_ADDRESS *BDAddr,
+ IN UINT8 LinkKey[BLUETOOTH_HCI_LINK_KEY_SIZE]
+ );
+
+/**
+ Register set link key callback function.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Callback The callback function. NULL means unregister.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The link key callback function is registered successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION Callback,
+ IN VOID *Context
+ );
+
+/**
+ The callback function. It is called after connect completed.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Context Context passed from registration.
+ @param CallbackType Callback type in EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.
+ @param BDAddr A pointer to Bluetooth device address.
+ @param InputBuffer A pointer to the buffer of data that is input from callback caller.
+ @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE CallbackType,
+ IN BLUETOOTH_ADDRESS *BDAddr,
+ IN VOID *InputBuffer,
+ IN UINTN InputBufferSize
+ );
+
+/**
+ Register link connect complete callback function.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Callback The callback function. NULL means unregister.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The link connect complete callback function is registered successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION Callback,
+ IN VOID *Context
+ );
+
+///
+/// This protocol abstracts user interface configuration for Bluetooth device.
+///
+struct _EFI_BLUETOOTH_CONFIG_PROTOCOL {
+ EFI_BLUETOOTH_CONFIG_INIT Init;
+ EFI_BLUETOOTH_CONFIG_SCAN Scan;
+ EFI_BLUETOOTH_CONFIG_CONNECT Connect;
+ EFI_BLUETOOTH_CONFIG_DISCONNECT Disconnect;
+ EFI_BLUETOOTH_CONFIG_GET_DATA GetData;
+ EFI_BLUETOOTH_CONFIG_SET_DATA SetData;
+ EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA GetRemoteData;
+ EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK RegisterPinCallback;
+ EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK RegisterGetLinkKeyCallback;
+ EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK RegisterSetLinkKeyCallback;
+ EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK RegisterLinkConnectCompleteCallback;
+};
+
+extern EFI_GUID gEfiBluetoothConfigProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothHc.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothHc.h
new file mode 100644
index 0000000000..8311079609
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothHc.h
@@ -0,0 +1,424 @@
+/** @file
+ EFI Bluetooth Host Controller Protocol as defined in UEFI 2.5.
+ This protocol abstracts the Bluetooth host controller layer message transmit and receive.
+
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_BLUETOOTH_HC_PROTOCOL_H__
+#define __EFI_BLUETOOTH_HC_PROTOCOL_H__
+
+#define EFI_BLUETOOTH_HC_PROTOCOL_GUID \
+ { \
+ 0xb3930571, 0xbeba, 0x4fc5, { 0x92, 0x3, 0x94, 0x27, 0x24, 0x2e, 0x6a, 0x43 } \
+ }
+
+typedef struct _EFI_BLUETOOTH_HC_PROTOCOL EFI_BLUETOOTH_HC_PROTOCOL;
+
+/**
+ Send HCI command packet.
+
+ The SendCommand() function sends HCI command packet. Buffer holds the whole HCI
+ command packet, including OpCode, OCF, OGF, parameter length, and parameters. When
+ this function is returned, it just means the HCI command packet is sent, it does not mean
+ the command is success or complete. Caller might need to wait a command status event
+ to know the command status, or wait a command complete event to know if the
+ command is completed.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param[in,out] BufferSize On input, indicates the size, in bytes, of the data buffer
+ specified by Buffer. On output, indicates the amount of
+ data actually transferred.
+ @param[in] Buffer A pointer to the buffer of data that will be transmitted to
+ Bluetooth host controller.
+ @param[in] Timeout Indicating the transfer should be completed within this
+ time frame. The units are in milliseconds. If Timeout is 0,
+ then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The HCI command packet is sent successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ BufferSize is NULL.
+ *BufferSize is 0.
+ Buffer is NULL.
+ @retval EFI_TIMEOUT Sending HCI command packet fail due to timeout.
+ @retval EFI_DEVICE_ERROR Sending HCI command packet fail due to host controller or device
+ error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_SEND_COMMAND)(
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Receive HCI event packet.
+
+ The ReceiveEvent() function receives HCI event packet. Buffer holds the whole HCI event
+ packet, including EventCode, parameter length, and parameters.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param[in,out] BufferSize On input, indicates the size, in bytes, of the data buffer
+ specified by Buffer. On output, indicates the amount of
+ data actually transferred.
+ @param[out] Buffer A pointer to the buffer of data that will be received from
+ Bluetooth host controller.
+ @param[in] Timeout Indicating the transfer should be completed within this
+ time frame. The units are in milliseconds. If Timeout is 0,
+ then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The HCI event packet is received successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ BufferSize is NULL.
+ *BufferSize is 0.
+ Buffer is NULL.
+ @retval EFI_TIMEOUT Receiving HCI event packet fail due to timeout.
+ @retval EFI_DEVICE_ERROR Receiving HCI event packet fail due to host controller or device
+ error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_RECEIVE_EVENT)(
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ The async callback of AsyncReceiveEvent().
+
+ @param[in] Data Data received via asynchronous transfer.
+ @param[in] DataLength The length of Data in bytes, received via asynchronous
+ transfer.
+ @param[in] Context Context passed from asynchronous transfer request.
+
+ @retval EFI_SUCCESS The callback does execute successfully.
+ @retval Others The callback doesn't execute successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK) (
+ IN VOID *Data,
+ IN UINTN DataLength,
+ IN VOID *Context
+ );
+
+/**
+ Receive HCI event packet in non-blocking way.
+
+ The AsyncReceiveEvent() function receives HCI event packet in non-blocking way. Data
+ in Callback function holds the whole HCI event packet, including EventCode, parameter
+ length, and parameters.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param[in] IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the
+ request is deleted.
+ @param[in] PollingInterval Indicates the periodic rate, in milliseconds, that the
+ transfer is to be executed.
+ @param[in] DataLength Specifies the length, in bytes, of the data to be received.
+ @param[in] Callback The callback function. This function is called if the
+ asynchronous transfer is completed.
+ @param[in] Context Data passed into Callback function. This is optional
+ parameter and may be NULL.
+
+ @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ DataLength is 0.
+ If IsNewTransfer is TRUE, and an asynchronous receive
+ request already exists.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_ASYNC_RECEIVE_EVENT) (
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN BOOLEAN IsNewTransfer,
+ IN UINTN PollingInterval,
+ IN UINTN DataLength,
+ IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+/**
+ Send HCI ACL data packet.
+
+ The SendACLData() function sends HCI ACL data packet. Buffer holds the whole HCI ACL
+ data packet, including Handle, PB flag, BC flag, data length, and data.
+
+ The SendACLData() function and ReceiveACLData() function just send and receive data
+ payload from application layer. In order to protect the payload data, the Bluetooth bus is
+ required to call HCI_Set_Connection_Encryption command to enable hardware based
+ encryption after authentication completed, according to pairing mode and host
+ capability.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param[in, out] BufferSize On input, indicates the size, in bytes, of the data buffer
+ specified by Buffer. On output, indicates the amount of
+ data actually transferred.
+ @param[in] Buffer A pointer to the buffer of data that will be transmitted to
+ Bluetooth host controller.
+ @param[in] Timeout Indicating the transfer should be completed within this
+ time frame. The units are in milliseconds. If Timeout is 0,
+ then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The HCI ACL data packet is sent successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ BufferSize is NULL.
+ *BufferSize is 0.
+ Buffer is NULL.
+ @retval EFI_TIMEOUT Sending HCI ACL data packet fail due to timeout.
+ @retval EFI_DEVICE_ERROR Sending HCI ACL data packet fail due to host controller or device
+ error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_SEND_ACL_DATA)(
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Receive HCI ACL data packet.
+
+ The ReceiveACLData() function receives HCI ACL data packet. Buffer holds the whole HCI
+ ACL data packet, including Handle, PB flag, BC flag, data length, and data.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param[in, out] BufferSize On input, indicates the size, in bytes, of the data buffer
+ specified by Buffer. On output, indicates the amount of
+ data actually transferred.
+ @param[out] Buffer A pointer to the buffer of data that will be received from
+ Bluetooth host controller.
+ @param[in] Timeout Indicating the transfer should be completed within this
+ time frame. The units are in milliseconds. If Timeout is 0,
+ then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The HCI ACL data packet is received successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ BufferSize is NULL.
+ *BufferSize is 0.
+ Buffer is NULL.
+ @retval EFI_TIMEOUT Receiving HCI ACL data packet fail due to timeout.
+ @retval EFI_DEVICE_ERROR Receiving HCI ACL data packet fail due to host controller or device
+ error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_RECEIVE_ACL_DATA)(
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Receive HCI ACL data packet in non-blocking way.
+
+ The AsyncReceiveACLData() function receives HCI ACL data packet in non-blocking way.
+ Data in Callback holds the whole HCI ACL data packet, including Handle, PB flag, BC flag,
+ data length, and data.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param[in] IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the
+ request is deleted.
+ @param[in] PollingInterval Indicates the periodic rate, in milliseconds, that the
+ transfer is to be executed.
+ @param[in] DataLength Specifies the length, in bytes, of the data to be received.
+ @param[in] Callback The callback function. This function is called if the
+ asynchronous transfer is completed.
+ @param[in] Context Data passed into Callback function. This is optional
+ parameter and may be NULL.
+
+ @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ DataLength is 0.
+ If IsNewTransfer is TRUE, and an asynchronous receive
+ request already exists.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_ASYNC_RECEIVE_ACL_DATA) (
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN BOOLEAN IsNewTransfer,
+ IN UINTN PollingInterval,
+ IN UINTN DataLength,
+ IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+/**
+ Send HCI SCO data packet.
+
+ The SendSCOData() function sends HCI SCO data packet. Buffer holds the whole HCI SCO
+ data packet, including ConnectionHandle, PacketStatus flag, data length, and data.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param[in,out] BufferSize On input, indicates the size, in bytes, of the data buffer
+ specified by Buffer. On output, indicates the amount of
+ data actually transferred.
+ @param[in] Buffer A pointer to the buffer of data that will be transmitted to
+ Bluetooth host controller.
+ @param[in] Timeout Indicating the transfer should be completed within this
+ time frame. The units are in milliseconds. If Timeout is 0,
+ then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The HCI SCO data packet is sent successfully.
+ @retval EFI_UNSUPPORTED The implementation does not support HCI SCO transfer.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ BufferSize is NULL.
+ *BufferSize is 0.
+ Buffer is NULL.
+ @retval EFI_TIMEOUT Sending HCI SCO data packet fail due to timeout.
+ @retval EFI_DEVICE_ERROR Sending HCI SCO data packet fail due to host controller or device
+ error.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_SEND_SCO_DATA)(
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Receive HCI SCO data packet.
+
+ The ReceiveSCOData() function receives HCI SCO data packet. Buffer holds the whole HCI
+ SCO data packet, including ConnectionHandle, PacketStatus flag, data length, and data.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param[in,out] BufferSize On input, indicates the size, in bytes, of the data buffer
+ specified by Buffer. On output, indicates the amount of
+ data actually transferred.
+ @param[out] Buffer A pointer to the buffer of data that will be received from
+ Bluetooth host controller.
+ @param[in] Timeout Indicating the transfer should be completed within this
+ time frame. The units are in milliseconds. If Timeout is 0,
+ then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The HCI SCO data packet is received successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ BufferSize is NULL.
+ *BufferSize is 0.
+ Buffer is NULL.
+ @retval EFI_TIMEOUT Receiving HCI SCO data packet fail due to timeout.
+ @retval EFI_DEVICE_ERROR Receiving HCI SCO data packet fail due to host controller or device
+ error.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_RECEIVE_SCO_DATA)(
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Receive HCI SCO data packet in non-blocking way.
+
+ The AsyncReceiveSCOData() function receives HCI SCO data packet in non-blocking way.
+ Data in Callback holds the whole HCI SCO data packet, including ConnectionHandle,
+ PacketStatus flag, data length, and data.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param[in] IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the
+ request is deleted.
+ @param[in] PollingInterval Indicates the periodic rate, in milliseconds, that the
+ transfer is to be executed.
+ @param[in] DataLength Specifies the length, in bytes, of the data to be received.
+ @param[in] Callback The callback function. This function is called if the
+ asynchronous transfer is completed.
+ @param[in] Context Data passed into Callback function. This is optional
+ parameter and may be NULL.
+
+ @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ DataLength is 0.
+ If IsNewTransfer is TRUE, and an asynchronous receive
+ request already exists.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_ASYNC_RECEIVE_SCO_DATA) (
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN BOOLEAN IsNewTransfer,
+ IN UINTN PollingInterval,
+ IN UINTN DataLength,
+ IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+//
+// The EFI_BLUETOOTH_HC_PROTOCOL is used to transmit or receive HCI layer data packets.
+//
+struct _EFI_BLUETOOTH_HC_PROTOCOL {
+ //
+ // Send HCI command packet.
+ //
+ EFI_BLUETOOTH_HC_SEND_COMMAND SendCommand;
+ //
+ // Receive HCI event packets.
+ //
+ EFI_BLUETOOTH_HC_RECEIVE_EVENT ReceiveEvent;
+ //
+ // Non-blocking receive HCI event packets.
+ //
+ EFI_BLUETOOTH_HC_ASYNC_RECEIVE_EVENT AsyncReceiveEvent;
+ //
+ // Send HCI ACL (asynchronous connection-oriented) data packets.
+ //
+ EFI_BLUETOOTH_HC_SEND_ACL_DATA SendACLData;
+ //
+ // Receive HCI ACL data packets.
+ //
+ EFI_BLUETOOTH_HC_RECEIVE_ACL_DATA ReceiveACLData;
+ //
+ // Non-blocking receive HCI ACL data packets.
+ //
+ EFI_BLUETOOTH_HC_ASYNC_RECEIVE_ACL_DATA AsyncReceiveACLData;
+ //
+ // Send HCI synchronous (SCO and eSCO) data packets.
+ //
+ EFI_BLUETOOTH_HC_SEND_SCO_DATA SendSCOData;
+ //
+ // Receive HCI synchronous data packets.
+ //
+ EFI_BLUETOOTH_HC_RECEIVE_SCO_DATA ReceiveSCOData;
+ //
+ // Non-blocking receive HCI synchronous data packets.
+ //
+ EFI_BLUETOOTH_HC_ASYNC_RECEIVE_SCO_DATA AsyncReceiveSCOData;
+};
+
+extern EFI_GUID gEfiBluetoothHcProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothIo.h
new file mode 100644
index 0000000000..a0463eddfa
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothIo.h
@@ -0,0 +1,417 @@
+/** @file
+ EFI Bluetooth IO Service Binding Protocol as defined in UEFI 2.5.
+ EFI Bluetooth IO Protocol as defined in UEFI 2.5.
+ The EFI Bluetooth IO Service Binding Protocol is used to locate EFI Bluetooth IO Protocol drivers to
+ create and destroy child of the driver to communicate with other Bluetooth device by using Bluetooth IO protocol.
+
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_BLUETOOTH_IO_PROTOCOL_H__
+#define __EFI_BLUETOOTH_IO_PROTOCOL_H__
+
+#include <IndustryStandard/Bluetooth.h>
+
+#define EFI_BLUETOOTH_IO_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0x388278d3, 0x7b85, 0x42f0, { 0xab, 0xa9, 0xfb, 0x4b, 0xfd, 0x69, 0xf5, 0xab } \
+ }
+
+#define EFI_BLUETOOTH_IO_PROTOCOL_GUID \
+ { \
+ 0x467313de, 0x4e30, 0x43f1, { 0x94, 0x3e, 0x32, 0x3f, 0x89, 0x84, 0x5d, 0xb5 } \
+ }
+
+typedef struct _EFI_BLUETOOTH_IO_PROTOCOL EFI_BLUETOOTH_IO_PROTOCOL;
+
+///
+/// EFI_BLUETOOTH_DEVICE_INFO
+///
+typedef struct {
+ ///
+ /// The version of the structure
+ ///
+ UINT32 Version;
+ ///
+ /// 48bit Bluetooth device address.
+ ///
+ BLUETOOTH_ADDRESS BD_ADDR;
+ ///
+ /// Bluetooth PageScanRepetitionMode. See Bluetooth specification for detail.
+ ///
+ UINT8 PageScanRepetitionMode;
+ ///
+ /// Bluetooth ClassOfDevice. See Bluetooth specification for detail.
+ ///
+ BLUETOOTH_CLASS_OF_DEVICE ClassOfDevice;
+ ///
+ /// Bluetooth CloseOffset. See Bluetooth specification for detail.
+ ///
+ UINT16 ClockOffset;
+ ///
+ /// Bluetooth RSSI. See Bluetooth specification for detail.
+ ///
+ UINT8 RSSI;
+ ///
+ /// Bluetooth ExtendedInquiryResponse. See Bluetooth specification for detail.
+ ///
+ UINT8 ExtendedInquiryResponse[240];
+} EFI_BLUETOOTH_DEVICE_INFO;
+
+/**
+ Get Bluetooth device information.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param[out] DeviceInfoSize A pointer to the size, in bytes, of the DeviceInfo buffer.
+ @param[out] DeviceInfo A pointer to a callee allocated buffer that returns Bluetooth device information.
+
+ @retval EFI_SUCCESS The Bluetooth device information is returned successfully.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the Bluetooth device information.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_GET_DEVICE_INFO)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ OUT UINTN *DeviceInfoSize,
+ OUT VOID **DeviceInfo
+ );
+
+/**
+ Get Bluetooth SDP information.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param[out] SdpInfoSize A pointer to the size, in bytes, of the SdpInfo buffer.
+ @param[out] SdpInfo A pointer to a callee allocated buffer that returns Bluetooth SDP information.
+
+ @retval EFI_SUCCESS The Bluetooth device information is returned successfully.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the Bluetooth SDP information.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_GET_SDP_INFO)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ OUT UINTN *SdpInfoSize,
+ OUT VOID **SdpInfo
+ );
+
+/**
+ Send L2CAP message (including L2CAP header).
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param[in, out] BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
+ On output, indicates the amount of data actually transferred.
+ @param[in] Buffer A pointer to the buffer of data that will be transmitted to Bluetooth L2CAP layer.
+ @param[in] Timeout Indicating the transfer should be completed within this time frame. The units are in
+ milliseconds. If Timeout is 0, then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The L2CAP message is sent successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Sending L2CAP message fail due to timeout.
+ @retval EFI_DEVICE_ERROR Sending L2CAP message fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_RAW_SEND)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Receive L2CAP message (including L2CAP header).
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param[in] BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
+ On output, indicates the amount of data actually transferred.
+ @param[out] Buffer A pointer to the buffer of data that will be received from Bluetooth L2CAP layer.
+ @param[in] Timeout Indicating the transfer should be completed within this time frame. The units are in
+ milliseconds. If Timeout is 0, then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The L2CAP message is received successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Receiving L2CAP message fail due to timeout.
+ @retval EFI_DEVICE_ERROR Receiving L2CAP message fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_RAW_RECEIVE)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Callback function, it is called when asynchronous transfer is completed.
+
+ @param[in] ChannelID Bluetooth L2CAP message channel ID.
+ @param[in] Data Data received via asynchronous transfer.
+ @param[in] DataLength The length of Data in bytes, received via asynchronous transfer.
+ @param[in] Context Context passed from asynchronous transfer request.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_ASYNC_FUNC_CALLBACK) (
+ IN UINT16 ChannelID,
+ IN VOID *Data,
+ IN UINTN DataLength,
+ IN VOID *Context
+ );
+
+/**
+ Receive L2CAP message (including L2CAP header) in non-blocking way.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param[in] IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the request is deleted.
+ @param[in] PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be executed.
+ @param[in] DataLength Specifies the length, in bytes, of the data to be received.
+ @param[in] Callback The callback function. This function is called if the asynchronous transfer is
+ completed.
+ @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The L2CAP asynchronous receive request is submitted successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataLength is 0.
+ - If IsNewTransfer is TRUE, and an asynchronous receive request already exists.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_RAW_ASYNC_RECEIVE)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN BOOLEAN IsNewTransfer,
+ IN UINTN PollingInterval,
+ IN UINTN DataLength,
+ IN EFI_BLUETOOTH_IO_ASYNC_FUNC_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+/**
+ Send L2CAP message (excluding L2CAP header) to a specific channel.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param[in] Handle A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2CapConnect indicates which channel to send.
+ @param[in, out] BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
+ On output, indicates the amount of data actually transferred.
+ @param[in] Buffer A pointer to the buffer of data that will be transmitted to Bluetooth L2CAP layer.
+ @param[in] Timeout Indicating the transfer should be completed within this time frame. The units are in
+ milliseconds. If Timeout is 0, then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The L2CAP message is sent successfully.
+ @retval EFI_NOT_FOUND Handle is invalid or not found.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Sending L2CAP message fail due to timeout.
+ @retval EFI_DEVICE_ERROR Sending L2CAP message fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_SEND)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN EFI_HANDLE Handle,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Receive L2CAP message (excluding L2CAP header) from a specific channel.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param[in] Handle A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2CapConnect indicates which channel to receive.
+ @param[out] BufferSize Indicates the size, in bytes, of the data buffer specified by Buffer.
+ @param[out] Buffer A pointer to the buffer of data that will be received from Bluetooth L2CAP layer.
+ @param[in] Timeout Indicating the transfer should be completed within this time frame. The units are in
+ milliseconds. If Timeout is 0, then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The L2CAP message is received successfully.
+ @retval EFI_NOT_FOUND Handle is invalid or not found.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Receiving L2CAP message fail due to timeout.
+ @retval EFI_DEVICE_ERROR Receiving L2CAP message fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_RECEIVE)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN EFI_HANDLE Handle,
+ OUT UINTN *BufferSize,
+ OUT VOID **Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Callback function, it is called when asynchronous transfer is completed.
+
+ @param[in] Data Data received via asynchronous transfer.
+ @param[in] DataLength The length of Data in bytes, received via asynchronous transfer.
+ @param[in] Context Context passed from asynchronous transfer request.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK) (
+ IN VOID *Data,
+ IN UINTN DataLength,
+ IN VOID *Context
+ );
+
+/**
+ Receive L2CAP message (excluding L2CAP header) in non-blocking way from a specific channel.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param[in] Handel A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2CapConnect indicates which channel
+ to receive.
+ @param[in] Callback The callback function. This function is called if the asynchronous transfer is
+ completed.
+ @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The L2CAP asynchronous receive request is submitted successfully.
+ @retval EFI_NOT_FOUND Handle is invalid or not found.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataLength is 0.
+ - If an asynchronous receive request already exists on same Handle.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_ASYNC_RECEIVE)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN EFI_HANDLE Handle,
+ IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback,
+ IN VOID* Context
+ );
+
+/**
+ Do L2CAP connection.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param[out] Handel A handle to indicate this L2CAP connection.
+ @param[in] Psm Bluetooth PSM. See Bluetooth specification for detail.
+ @param[in] Mtu Bluetooth MTU. See Bluetooth specification for detail.
+ @param[in] Callback The callback function. This function is called whenever there is message received
+ in this channel.
+ @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The Bluetooth L2CAP layer connection is created successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - Handle is NULL.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to do Bluetooth L2CAP connection.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_CONNECT)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ OUT EFI_HANDLE *Handle,
+ IN UINT16 Psm,
+ IN UINT16 Mtu,
+ IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+/**
+ Do L2CAP disconnection.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param[in] Handel A handle to indicate this L2CAP connection.
+
+ @retval EFI_SUCCESS The Bluetooth L2CAP layer is disconnected successfully.
+ @retval EFI_NOT_FOUND Handle is invalid or not found.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to do Bluetooth L2CAP disconnection.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_DISCONNECT)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN EFI_HANDLE Handle
+ );
+
+/**
+ Register L2CAP callback function for special channel.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param[out] Handel A handle to indicate this L2CAP connection.
+ @param[in] Psm Bluetooth PSM. See Bluetooth specification for detail.
+ @param[in] Mtu Bluetooth MTU. See Bluetooth specification for detail.
+ @param[in] Callback The callback function. This function is called whenever there is message received
+ in this channel. NULL means unregister.
+ @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The Bluetooth L2CAP callback function is registered successfully.
+ @retval EFI_ALREADY_STARTED The callback function already exists when register.
+ @retval EFI_NOT_FOUND The callback function does not exist when unregister.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_REGISTER_SERVICE)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ OUT EFI_HANDLE *Handle,
+ IN UINT16 Psm,
+ IN UINT16 Mtu,
+ IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+///
+/// This protocol provides service for Bluetooth L2CAP (Logical Link Control and Adaptation Protocol)
+/// and SDP (Service Discovery Protocol).
+///
+struct _EFI_BLUETOOTH_IO_PROTOCOL {
+ EFI_BLUETOOTH_IO_GET_DEVICE_INFO GetDeviceInfo;
+ EFI_BLUETOOTH_IO_GET_SDP_INFO GetSdpInfo;
+ EFI_BLUETOOTH_IO_L2CAP_RAW_SEND L2CapRawSend;
+ EFI_BLUETOOTH_IO_L2CAP_RAW_RECEIVE L2CapRawReceive;
+ EFI_BLUETOOTH_IO_L2CAP_RAW_ASYNC_RECEIVE L2CapRawAsyncReceive;
+ EFI_BLUETOOTH_IO_L2CAP_SEND L2CapSend;
+ EFI_BLUETOOTH_IO_L2CAP_RECEIVE L2CapReceive;
+ EFI_BLUETOOTH_IO_L2CAP_ASYNC_RECEIVE L2CapAsyncReceive;
+ EFI_BLUETOOTH_IO_L2CAP_CONNECT L2CapConnect;
+ EFI_BLUETOOTH_IO_L2CAP_DISCONNECT L2CapDisconnect;
+ EFI_BLUETOOTH_IO_L2CAP_REGISTER_SERVICE L2CapRegisterService;
+};
+
+extern EFI_GUID gEfiBluetoothIoServiceBindingProtocolGuid;
+extern EFI_GUID gEfiBluetoothIoProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothLeConfig.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothLeConfig.h
new file mode 100644
index 0000000000..b4f1e9b6d1
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BluetoothLeConfig.h
@@ -0,0 +1,634 @@
+/** @file
+ EFI Bluetooth LE Config Protocol as defined in UEFI 2.7.
+ This protocol abstracts user interface configuration for BluetoothLe device.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.7
+
+**/
+
+#ifndef __EFI_BLUETOOTH_LE_CONFIG_H__
+#define __EFI_BLUETOOTH_LE_CONFIG_H__
+
+#include <Protocol/BluetoothConfig.h>
+#include <Protocol/BluetoothAttribute.h>
+
+#define EFI_BLUETOOTH_LE_CONFIG_PROTOCOL_GUID \
+ { \
+ 0x8f76da58, 0x1f99, 0x4275, { 0xa4, 0xec, 0x47, 0x56, 0x51, 0x5b, 0x1c, 0xe8 } \
+ }
+
+typedef struct _EFI_BLUETOOTH_LE_CONFIG_PROTOCOL EFI_BLUETOOTH_LE_CONFIG_PROTOCOL;
+
+/**
+ Initialize BluetoothLE host controller and local device.
+
+ The Init() function initializes BluetoothLE host controller and local device.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The BluetoothLE host controller and local device is initialized successfully.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to initialize the BluetoothLE host controller
+ and local device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_INIT)(
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This
+ );
+
+typedef struct {
+ ///
+ /// The version of the structure. A value of zero represents the EFI_BLUETOOTH_LE_CONFIG_SCAN_PARAMETER
+ /// structure as defined here. Future version of this specification may extend this data structure in a
+ /// backward compatible way and increase the value of Version.
+ ///
+ UINT32 Version;
+ ///
+ /// Passive scanning or active scanning. See Bluetooth specification.
+ ///
+ UINT8 ScanType;
+ ///
+ /// Recommended scan interval to be used while performing scan.
+ ///
+ UINT16 ScanInterval;
+ ///
+ /// Recommended scan window to be used while performing a scan.
+ ///
+ UINT16 ScanWindow;
+ ///
+ /// Recommended scanning filter policy to be used while performing a scan.
+ ///
+ UINT8 ScanningFilterPolicy;
+ ///
+ /// This is one byte flag to serve as a filter to remove unneeded scan
+ /// result. For example, set BIT0 means scan in LE Limited Discoverable
+ /// Mode. Set BIT1 means scan in LE General Discoverable Mode.
+ ///
+ UINT8 AdvertisementFlagFilter;
+} EFI_BLUETOOTH_LE_CONFIG_SCAN_PARAMETER;
+
+typedef struct{
+ BLUETOOTH_LE_ADDRESS BDAddr;
+ BLUETOOTH_LE_ADDRESS DirectAddress;
+ UINT8 RemoteDeviceState;
+ INT8 RSSI;
+ UINTN AdvertisementDataSize;
+ VOID *AdvertisementData;
+} EFI_BLUETOOTH_LE_SCAN_CALLBACK_INFORMATION;
+
+/**
+ Callback function, it is called if a BluetoothLE device is found during scan process.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] Context Context passed from scan request.
+ @param[in] CallbackInfo Data related to scan result. NULL CallbackInfo means scan complete.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_SCAN_CALLBACK_FUNCTION) (
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN EFI_BLUETOOTH_LE_SCAN_CALLBACK_INFORMATION *CallbackInfo
+ );
+
+/**
+ Scan BluetoothLE device.
+
+ The Scan() function scans BluetoothLE device. When this function is returned, it just means scan
+ request is submitted. It does not mean scan process is started or finished. Whenever there is a
+ BluetoothLE device is found, the Callback function will be called. Callback function might be
+ called before this function returns or after this function returns
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] ReScan If TRUE, a new scan request is submitted no matter there is scan result before.
+ If FALSE and there is scan result, the previous scan result is returned and no scan request
+ is submitted.
+ @param[in] Timeout Duration in milliseconds for which to scan.
+ @param[in] ScanParameter If it is not NULL, the ScanParameter is used to perform a scan by the BluetoothLE bus driver.
+ If it is NULL, the default parameter is used.
+ @param[in] Callback The callback function. This function is called if a BluetoothLE device is found during
+ scan process.
+ @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The Bluetooth scan request is submitted.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to scan the BluetoothLE device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_SCAN)(
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN BOOLEAN ReScan,
+ IN UINT32 Timeout,
+ IN EFI_BLUETOOTH_LE_CONFIG_SCAN_PARAMETER *ScanParameter, OPTIONAL
+ IN EFI_BLUETOOTH_LE_CONFIG_SCAN_CALLBACK_FUNCTION Callback,
+ IN VOID *Context
+ );
+
+typedef struct {
+ ///
+ /// The version of the structure. A value of zero represents the
+ /// EFI_BLUETOOTH_LE_CONFIG_CONNECT_PARAMETER
+ /// structure as defined here. Future version of this specification may
+ /// extend this data structure in a backward compatible way and
+ /// increase the value of Version.
+ ///
+ UINT32 Version;
+ ///
+ /// Recommended scan interval to be used while performing scan before connect.
+ ///
+ UINT16 ScanInterval;
+ ///
+ /// Recommended scan window to be used while performing a connection
+ ///
+ UINT16 ScanWindow;
+ ///
+ /// Minimum allowed connection interval. Shall be less than or equal to ConnIntervalMax.
+ ///
+ UINT16 ConnIntervalMin;
+ ///
+ /// Maximum allowed connection interval. Shall be greater than or equal to ConnIntervalMin.
+ ///
+ UINT16 ConnIntervalMax;
+ ///
+ /// Slave latency for the connection in number of connection events.
+ ///
+ UINT16 ConnLatency;
+ ///
+ /// Link supervision timeout for the connection.
+ ///
+ UINT16 SupervisionTimeout;
+} EFI_BLUETOOTH_LE_CONFIG_CONNECT_PARAMETER;
+
+/**
+ Connect a BluetoothLE device.
+
+ The Connect() function connects a Bluetooth device. When this function is returned successfully,
+ a new EFI_BLUETOOTH_IO_PROTOCOL is created.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] AutoReconnect If TRUE, the BluetoothLE host controller needs to do an auto
+ reconnect. If FALSE, the BluetoothLE host controller does not do
+ an auto reconnect.
+ @param[in] DoBonding If TRUE, the BluetoothLE host controller needs to do a bonding.
+ If FALSE, the BluetoothLE host controller does not do a bonding.
+ @param[in] ConnectParameter If it is not NULL, the ConnectParameter is used to perform a
+ scan by the BluetoothLE bus driver. If it is NULL, the default
+ parameter is used.
+ @param[in] BD_ADDR The address of the BluetoothLE device to be connected.
+
+ @retval EFI_SUCCESS The BluetoothLE device is connected successfully.
+ @retval EFI_ALREADY_STARTED The BluetoothLE device is already connected.
+ @retval EFI_NOT_FOUND The BluetoothLE device is not found.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to connect the BluetoothLE device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_CONNECT)(
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN BOOLEAN AutoReconnect,
+ IN BOOLEAN DoBonding,
+ IN EFI_BLUETOOTH_LE_CONFIG_CONNECT_PARAMETER *ConnectParameter, OPTIONAL
+ IN BLUETOOTH_LE_ADDRESS *BD_ADDR
+ );
+
+/**
+ Disconnect a BluetoothLE device.
+
+ The Disconnect() function disconnects a BluetoothLE device. When this function is returned
+ successfully, the EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL associated with this device is
+ destroyed and all services associated are stopped.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] BD_ADDR The address of BluetoothLE device to be connected.
+ @param[in] Reason Bluetooth disconnect reason. See Bluetooth specification for detail.
+
+ @retval EFI_SUCCESS The BluetoothLE device is disconnected successfully.
+ @retval EFI_NOT_STARTED The BluetoothLE device is not connected.
+ @retval EFI_NOT_FOUND The BluetoothLE device is not found.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to disconnect the BluetoothLE device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_DISCONNECT)(
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN BLUETOOTH_LE_ADDRESS *BD_ADDR,
+ IN UINT8 Reason
+ );
+
+/**
+ Get BluetoothLE configuration data.
+
+ The GetData() function returns BluetoothLE configuration data. For remote BluetoothLE device
+ configuration data, please use GetRemoteData() function with valid BD_ADDR.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] DataType Configuration data type.
+ @param[in, out] DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.
+ On output, indicates the amount of data actually returned.
+ @param[in, out] Data A pointer to the buffer of data that will be returned.
+
+ @retval EFI_SUCCESS The BluetoothLE configuration data is returned successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataSize is NULL.
+ - *DataSize is 0.
+ - Data is NULL.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_NOT_FOUND The DataType is not found.
+ @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_GET_DATA) (
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,
+ IN OUT UINTN *DataSize,
+ IN OUT VOID *Data OPTIONAL
+ );
+
+/**
+ Set BluetoothLE configuration data.
+
+ The SetData() function sets local BluetoothLE device configuration data. Not all DataType can be
+ set.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] DataType Configuration data type.
+ @param[in] DataSize Indicates the size, in bytes, of the data buffer specified by Data.
+ @param[in] Data A pointer to the buffer of data that will be set.
+
+ @retval EFI_SUCCESS The BluetoothLE configuration data is set successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataSize is 0.
+ - Data is NULL.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_WRITE_PROTECTED Cannot set configuration data.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_SET_DATA) (
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,
+ IN UINTN DataSize,
+ IN VOID *Data
+ );
+
+/**
+ Get remove BluetoothLE device configuration data.
+
+ The GetRemoteData() function returns remote BluetoothLE device configuration data.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] DataType Configuration data type.
+ @param[in] BDAddr Remote BluetoothLE device address.
+ @param[in, out] DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.
+ On output, indicates the amount of data actually returned.
+ @param[in, out] Data A pointer to the buffer of data that will be returned.
+
+ @retval EFI_SUCCESS The remote BluetoothLE device configuration data is returned successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataSize is NULL.
+ - *DataSize is 0.
+ - Data is NULL.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_NOT_FOUND The DataType is not found.
+ @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_GET_REMOTE_DATA) (
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,
+ IN BLUETOOTH_LE_ADDRESS *BDAddr,
+ IN OUT UINTN *DataSize,
+ IN OUT VOID *Data
+ );
+
+typedef enum {
+ ///
+ /// It indicates an authorization request. No data is associated with the callback
+ /// input. In the output data, the application should return the authorization value.
+ /// The data structure is BOOLEAN. TRUE means YES. FALSE means NO.
+ ///
+ EfiBluetoothSmpAuthorizationRequestEvent,
+ ///
+ /// It indicates that a passkey has been generated locally by the driver, and the same
+ /// passkey should be entered at the remote device. The callback input data is the
+ /// passkey of type UINT32, to be displayed by the application. No output data
+ /// should be returned.
+ ///
+ EfiBluetoothSmpPasskeyReadyEvent,
+ ///
+ /// It indicates that the driver is requesting for the passkey has been generated at
+ /// the remote device. No data is associated with the callback input. The output data
+ /// is the passkey of type UINT32, to be entered by the user.
+ ///
+ EfiBluetoothSmpPasskeyRequestEvent,
+ ///
+ /// It indicates that the driver is requesting for the passkey that has been pre-shared
+ /// out-of-band with the remote device. No data is associated with the callback
+ /// input. The output data is the stored OOB data of type UINT8[16].
+ ///
+ EfiBluetoothSmpOOBDataRequestEvent,
+ ///
+ /// In indicates that a number have been generated locally by the bus driver, and
+ /// also at the remote device, and the bus driver wants to know if the two numbers
+ /// match. The callback input data is the number of type UINT32. The output data
+ /// is confirmation value of type BOOLEAN. TRUE means comparison pass. FALSE
+ /// means comparison fail.
+ ///
+ EfiBluetoothSmpNumericComparisonEvent,
+} EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE;
+
+/**
+ The callback function for SMP.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] Context Data passed into callback function. This is optional parameter
+ and may be NULL.
+ @param[in] BDAddr Remote BluetoothLE device address.
+ @param[in] EventDataType Event data type in EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE.
+ @param[in] DataSize Indicates the size, in bytes, of the data buffer specified by Data.
+ @param[in] Data A pointer to the buffer of data.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_LE_SMP_CALLBACK) (
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN BLUETOOTH_LE_ADDRESS *BDAddr,
+ IN EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE EventDataType,
+ IN UINTN DataSize,
+ IN VOID *Data
+ );
+
+/**
+ Register Security Manager Protocol callback function for user authentication/authorization.
+
+ The RegisterSmpAuthCallback() function register Security Manager Protocol callback
+ function for user authentication/authorization.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] Callback Callback function for user authentication/authorization.
+ @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The SMP callback function is registered successfully.
+ @retval EFI_ALREADY_STARTED A callback function is already registered on the same attribute
+ opcode and attribute handle, when the Callback is not NULL.
+ @retval EFI_NOT_STARTED A callback function is not registered on the same attribute opcode
+ and attribute handle, when the Callback is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_LE_REGISTER_SMP_AUTH_CALLBACK) (
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_LE_SMP_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+/**
+ Send user authentication/authorization to remote device.
+
+ The SendSmpAuthData() function sends user authentication/authorization to remote device. It
+ should be used to send these information after the caller gets the request data from the callback
+ function by RegisterSmpAuthCallback().
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] BDAddr Remote BluetoothLE device address.
+ @param[in] EventDataType Event data type in EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE.
+ @param[in] DataSize The size of Data in bytes, of the data buffer specified by Data.
+ @param[in] Data A pointer to the buffer of data that will be sent. The data format
+ depends on the type of SMP event data being responded to.
+
+ @retval EFI_SUCCESS The SMP authorization data is sent successfully.
+ @retval EFI_NOT_READY SMP is not in the correct state to receive the auth data.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_LE_SEND_SMP_AUTH_DATA) (
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN BLUETOOTH_LE_ADDRESS *BDAddr,
+ IN EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE EventDataType,
+ IN UINTN DataSize,
+ IN VOID *Data
+ );
+
+typedef enum {
+ // For local device only
+ EfiBluetoothSmpLocalIR, /* If Key hierarchy is supported */
+ EfiBluetoothSmpLocalER, /* If Key hierarchy is supported */
+ EfiBluetoothSmpLocalDHK, /* If Key hierarchy is supported. OPTIONAL */
+ // For peer specific
+ EfiBluetoothSmpKeysDistributed = 0x1000,
+ EfiBluetoothSmpKeySize,
+ EfiBluetoothSmpKeyType,
+ EfiBluetoothSmpPeerLTK,
+ EfiBluetoothSmpPeerIRK,
+ EfiBluetoothSmpPeerCSRK,
+ EfiBluetoothSmpPeerRand,
+ EfiBluetoothSmpPeerEDIV,
+ EfiBluetoothSmpPeerSignCounter,
+ EfiBluetoothSmpLocalLTK, /* If Key hierarchy not supported */
+ EfiBluetoothSmpLocalIRK, /* If Key hierarchy not supported */
+ EfiBluetoothSmpLocalCSRK, /* If Key hierarchy not supported */
+ EfiBluetoothSmpLocalSignCounter,
+ EfiBluetoothSmpLocalDIV,
+} EFI_BLUETOOTH_LE_SMP_DATA_TYPE;
+
+/**
+ The callback function to get SMP data.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] Context Data passed into callback function. This is optional parameter
+ and may be NULL.
+ @param[in] BDAddr Remote BluetoothLE device address. For Local device setting, it
+ should be NULL.
+ @param[in] DataType Data type in EFI_BLUETOOTH_LE_SMP_DATA_TYPE.
+ @param[in, out] DataSize On input, indicates the size, in bytes, of the data buffer specified
+ by Data. On output, indicates the amount of data actually returned.
+ @param[out] Data A pointer to the buffer of data that will be returned.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_SMP_GET_DATA_CALLBACK) (
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN BLUETOOTH_LE_ADDRESS *BDAddr,
+ IN EFI_BLUETOOTH_LE_SMP_DATA_TYPE DataType,
+ IN OUT UINTN *DataSize,
+ OUT VOID *Data
+ );
+
+/**
+ Register a callback function to get SMP related data.
+
+ The RegisterSmpGetDataCallback() function registers a callback function to get SMP related data.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] Callback Callback function for SMP get data.
+ @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The SMP get data callback function is registered successfully.
+ @retval EFI_ALREADY_STARTED A callback function is already registered on the same attribute
+ opcode and attribute handle, when the Callback is not NULL.
+ @retval EFI_NOT_STARTED A callback function is not registered on the same attribute opcode
+ and attribute handle, when the Callback is NULL
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_REGISTER_SMP_GET_DATA_CALLBACK) (
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_LE_CONFIG_SMP_GET_DATA_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+/**
+ The callback function to set SMP data.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] Context Data passed into callback function. This is optional parameter
+ and may be NULL.
+ @param[in] BDAddr Remote BluetoothLE device address.
+ @param[in] DataType Data type in EFI_BLUETOOTH_LE_SMP_DATA_TYPE.
+ @param[in] DataSize Indicates the size, in bytes, of the data buffer specified by Data.
+ @param[in] Data A pointer to the buffer of data.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_SMP_SET_DATA_CALLBACK) (
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN BLUETOOTH_LE_ADDRESS *BDAddr,
+ IN EFI_BLUETOOTH_LE_SMP_DATA_TYPE Type,
+ IN UINTN DataSize,
+ IN VOID *Data
+ );
+
+/**
+ Register a callback function to set SMP related data.
+
+ The RegisterSmpSetDataCallback() function registers a callback function to set SMP related data.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] Callback Callback function for SMP set data.
+ @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The SMP set data callback function is registered successfully.
+ @retval EFI_ALREADY_STARTED A callback function is already registered on the same attribute
+ opcode and attribute handle, when the Callback is not NULL.
+ @retval EFI_NOT_STARTED A callback function is not registered on the same attribute opcode
+ and attribute handle, when the Callback is NULL
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_REGISTER_SMP_SET_DATA_CALLBACK) (
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_LE_CONFIG_SMP_SET_DATA_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+/**
+ The callback function to hook connect complete event.
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] Context Data passed into callback function. This is optional parameter
+ and may be NULL.
+ @param[in] CallbackType The value defined in EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.
+ @param[in] BDAddr Remote BluetoothLE device address.
+ @param[in] InputBuffer A pointer to the buffer of data that is input from callback caller.
+ @param[in] InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_CONNECT_COMPLETE_CALLBACK) (
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE CallbackType,
+ IN BLUETOOTH_LE_ADDRESS *BDAddr,
+ IN VOID *InputBuffer,
+ IN UINTN InputBufferSize
+ );
+
+/**
+ Register link connect complete callback function.
+
+ The RegisterLinkConnectCompleteCallback() function registers Bluetooth link connect
+ complete callback function. The Bluetooth Configuration driver may call
+ RegisterLinkConnectCompleteCallback() to register a callback function. During pairing,
+ Bluetooth bus driver must trigger this callback function to report device state, if it is registered.
+ Then Bluetooth Configuration driver will get information on device connection, according to
+ CallbackType defined by EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE
+
+ @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
+ @param[in] Callback The callback function. NULL means unregister.
+ @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The link connect complete callback function is registered successfully.
+ @retval EFI_ALREADY_STARTED A callback function is already registered on the same attribute
+ opcode and attribute handle, when the Callback is not NULL.
+ @retval EFI_NOT_STARTED A callback function is not registered on the same attribute opcode
+ and attribute handle, when the Callback is NULL
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK) (
+ IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_LE_CONFIG_CONNECT_COMPLETE_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+///
+/// This protocol abstracts user interface configuration for BluetoothLe device.
+///
+struct _EFI_BLUETOOTH_LE_CONFIG_PROTOCOL {
+ EFI_BLUETOOTH_LE_CONFIG_INIT Init;
+ EFI_BLUETOOTH_LE_CONFIG_SCAN Scan;
+ EFI_BLUETOOTH_LE_CONFIG_CONNECT Connect;
+ EFI_BLUETOOTH_LE_CONFIG_DISCONNECT Disconnect;
+ EFI_BLUETOOTH_LE_CONFIG_GET_DATA GetData;
+ EFI_BLUETOOTH_LE_CONFIG_SET_DATA SetData;
+ EFI_BLUETOOTH_LE_CONFIG_GET_REMOTE_DATA GetRemoteData;
+ EFI_BLUETOOTH_LE_REGISTER_SMP_AUTH_CALLBACK RegisterSmpAuthCallback;
+ EFI_BLUETOOTH_LE_SEND_SMP_AUTH_DATA SendSmpAuthData;
+ EFI_BLUETOOTH_LE_CONFIG_REGISTER_SMP_GET_DATA_CALLBACK RegisterSmpGetDataCallback;
+ EFI_BLUETOOTH_LE_CONFIG_REGISTER_SMP_SET_DATA_CALLBACK RegisterSmpSetDataCallback;
+ EFI_BLUETOOTH_LE_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK RegisterLinkConnectCompleteCallback;
+};
+
+extern EFI_GUID gEfiBluetoothLeConfigProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BootManagerPolicy.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BootManagerPolicy.h
new file mode 100644
index 0000000000..f348e3f101
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BootManagerPolicy.h
@@ -0,0 +1,138 @@
+/** @file
+ Boot Manager Policy Protocol as defined in UEFI Specification.
+
+ This protocol is used by EFI Applications to request the UEFI Boot Manager
+ to connect devices using platform policy.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
+#ifndef __BOOT_MANAGER_POLICY_H__
+#define __BOOT_MANAGER_POLICY_H__
+
+#define EFI_BOOT_MANAGER_POLICY_PROTOCOL_GUID \
+ { \
+ 0xFEDF8E0C, 0xE147, 0x11E3, { 0x99, 0x03, 0xB8, 0xE8, 0x56, 0x2C, 0xBA, 0xFA } \
+ }
+
+#define EFI_BOOT_MANAGER_POLICY_CONSOLE_GUID \
+ { \
+ 0xCAB0E94C, 0xE15F, 0x11E3, { 0x91, 0x8D, 0xB8, 0xE8, 0x56, 0x2C, 0xBA, 0xFA } \
+ }
+
+#define EFI_BOOT_MANAGER_POLICY_NETWORK_GUID \
+ { \
+ 0xD04159DC, 0xE15F, 0x11E3, { 0xB2, 0x61, 0xB8, 0xE8, 0x56, 0x2C, 0xBA, 0xFA } \
+ }
+
+#define EFI_BOOT_MANAGER_POLICY_CONNECT_ALL_GUID \
+ { \
+ 0x113B2126, 0xFC8A, 0x11E3, { 0xBD, 0x6C, 0xB8, 0xE8, 0x56, 0x2C, 0xBA, 0xFA } \
+ }
+
+typedef struct _EFI_BOOT_MANAGER_POLICY_PROTOCOL EFI_BOOT_MANAGER_POLICY_PROTOCOL;
+
+#define EFI_BOOT_MANAGER_POLICY_PROTOCOL_REVISION 0x00010000
+
+/**
+ Connect a device path following the platforms EFI Boot Manager policy.
+
+ The ConnectDevicePath() function allows the caller to connect a DevicePath using the
+ same policy as the EFI Boot Manger.
+
+ @param[in] This A pointer to the EFI_BOOT_MANAGER_POLICY_PROTOCOL instance.
+ @param[in] DevicePath Points to the start of the EFI device path to connect.
+ If DevicePath is NULL then all the controllers in the
+ system will be connected using the platforms EFI Boot
+ Manager policy.
+ @param[in] Recursive If TRUE, then ConnectController() is called recursively
+ until the entire tree of controllers below the
+ controller specified by DevicePath have been created.
+ If FALSE, then the tree of controllers is only expanded
+ one level. If DevicePath is NULL then Recursive is ignored.
+
+ @retval EFI_SUCCESS The DevicePath was connected.
+ @retval EFI_NOT_FOUND The DevicePath was not found.
+ @retval EFI_NOT_FOUND No driver was connected to DevicePath.
+ @retval EFI_SECURITY_VIOLATION The user has no permission to start UEFI device
+ drivers on the DevicePath.
+ @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BOOT_MANAGER_POLICY_CONNECT_DEVICE_PATH)(
+ IN EFI_BOOT_MANAGER_POLICY_PROTOCOL *This,
+ IN EFI_DEVICE_PATH *DevicePath,
+ IN BOOLEAN Recursive
+ );
+
+/**
+ Connect a class of devices using the platform Boot Manager policy.
+
+ The ConnectDeviceClass() function allows the caller to request that the Boot
+ Manager connect a class of devices.
+
+ If Class is EFI_BOOT_MANAGER_POLICY_CONSOLE_GUID then the Boot Manager will
+ use platform policy to connect consoles. Some platforms may restrict the
+ number of consoles connected as they attempt to fast boot, and calling
+ ConnectDeviceClass() with a Class value of EFI_BOOT_MANAGER_POLICY_CONSOLE_GUID
+ must connect the set of consoles that follow the Boot Manager platform policy,
+ and the EFI_SIMPLE_TEXT_INPUT_PROTOCOL, EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL, and
+ the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL are produced on the connected handles.
+ The Boot Manager may restrict which consoles get connect due to platform policy,
+ for example a security policy may require that a given console is not connected.
+
+ If Class is EFI_BOOT_MANAGER_POLICY_NETWORK_GUID then the Boot Manager will
+ connect the protocols the platforms supports for UEFI general purpose network
+ applications on one or more handles. If more than one network controller is
+ available a platform will connect, one, many, or all of the networks based
+ on platform policy. Connecting UEFI networking protocols, like EFI_DHCP4_PROTOCOL,
+ does not establish connections on the network. The UEFI general purpose network
+ application that called ConnectDeviceClass() may need to use the published
+ protocols to establish the network connection. The Boot Manager can optionally
+ have a policy to establish a network connection.
+
+ If Class is EFI_BOOT_MANAGER_POLICY_CONNECT_ALL_GUID then the Boot Manager
+ will connect all UEFI drivers using the UEFI Boot Service
+ EFI_BOOT_SERVICES.ConnectController(). If the Boot Manager has policy
+ associated with connect all UEFI drivers this policy will be used.
+
+ A platform can also define platform specific Class values as a properly generated
+ EFI_GUID would never conflict with this specification.
+
+ @param[in] This A pointer to the EFI_BOOT_MANAGER_POLICY_PROTOCOL instance.
+ @param[in] Class A pointer to an EFI_GUID that represents a class of devices
+ that will be connected using the Boot Mangers platform policy.
+
+ @retval EFI_SUCCESS At least one devices of the Class was connected.
+ @retval EFI_DEVICE_ERROR Devices were not connected due to an error.
+ @retval EFI_NOT_FOUND The Class is not supported by the platform.
+ @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BOOT_MANAGER_POLICY_CONNECT_DEVICE_CLASS)(
+ IN EFI_BOOT_MANAGER_POLICY_PROTOCOL *This,
+ IN EFI_GUID *Class
+ );
+
+struct _EFI_BOOT_MANAGER_POLICY_PROTOCOL {
+ UINT64 Revision;
+ EFI_BOOT_MANAGER_POLICY_CONNECT_DEVICE_PATH ConnectDevicePath;
+ EFI_BOOT_MANAGER_POLICY_CONNECT_DEVICE_CLASS ConnectDeviceClass;
+};
+
+extern EFI_GUID gEfiBootManagerPolicyProtocolGuid;
+
+extern EFI_GUID gEfiBootManagerPolicyConsoleGuid;
+extern EFI_GUID gEfiBootManagerPolicyNetworkGuid;
+extern EFI_GUID gEfiBootManagerPolicyConnectAllGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BusSpecificDriverOverride.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BusSpecificDriverOverride.h
new file mode 100644
index 0000000000..dcaeb9c535
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/BusSpecificDriverOverride.h
@@ -0,0 +1,72 @@
+/** @file
+ Bus Specific Driver Override protocol as defined in the UEFI 2.0 specification.
+
+ Bus drivers that have a bus specific algorithm for matching drivers to controllers are
+ required to produce this protocol for each controller. For example, a PCI Bus Driver will produce an
+ instance of this protocol for every PCI controller that has a PCI option ROM that contains one or
+ more UEFI drivers. The protocol instance is attached to the handle of the PCI controller.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_H_
+#define _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_H_
+
+///
+/// Global ID for the Bus Specific Driver Override Protocol
+///
+#define EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID \
+ { \
+ 0x3bc1b285, 0x8a15, 0x4a82, {0xaa, 0xbf, 0x4d, 0x7d, 0x13, 0xfb, 0x32, 0x65 } \
+ }
+
+typedef struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL;
+
+//
+// Prototypes for the Bus Specific Driver Override Protocol
+//
+
+/**
+ Uses a bus specific algorithm to retrieve a driver image handle for a controller.
+
+ @param This A pointer to the EFI_BUS_SPECIFIC_DRIVER_
+ OVERRIDE_PROTOCOL instance.
+ @param DriverImageHandle On input, a pointer to the previous driver image handle returned
+ by GetDriver(). On output, a pointer to the next driver
+ image handle. Passing in a NULL, will return the first driver
+ image handle.
+
+ @retval EFI_SUCCESS A bus specific override driver is returned in DriverImageHandle.
+ @retval EFI_NOT_FOUND The end of the list of override drivers was reached.
+ A bus specific override driver is not returned in DriverImageHandle.
+ @retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a
+ previous call to GetDriver().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER)(
+ IN EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *This,
+ IN OUT EFI_HANDLE *DriverImageHandle
+ );
+
+///
+/// This protocol matches one or more drivers to a controller. This protocol is produced by a bus driver,
+/// and it is installed on the child handles of buses that require a bus specific algorithm for matching
+/// drivers to controllers.
+///
+struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL {
+ EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER GetDriver;
+};
+
+extern EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Capsule.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Capsule.h
new file mode 100644
index 0000000000..e35035da6a
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Capsule.h
@@ -0,0 +1,35 @@
+/** @file
+ Capsule Architectural Protocol as defined in PI1.0a Specification VOLUME 2 DXE
+
+ The DXE Driver that produces this protocol must be a runtime driver.
+ The driver is responsible for initializing the CapsuleUpdate() and
+ QueryCapsuleCapabilities() fields of the UEFI Runtime Services Table.
+ After the two fields of the UEFI Runtime Services Table have been initialized,
+ the driver must install the EFI_CAPSULE_ARCH_PROTOCOL_GUID on a new handle
+ with a NULL interface pointer. The installation of this protocol informs
+ the DXE Foundation that the Capsule related services are now available and
+ that the DXE Foundation must update the 32-bit CRC of the UEFI Runtime Services Table.
+
+Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARCH_PROTOCOL_CAPSULE_ARCH_H__
+#define __ARCH_PROTOCOL_CAPSULE_ARCH_H__
+
+//
+// Global ID for the Capsule Architectural Protocol
+//
+#define EFI_CAPSULE_ARCH_PROTOCOL_GUID \
+ { 0x5053697e, 0x2cbc, 0x4819, {0x90, 0xd9, 0x05, 0x80, 0xde, 0xee, 0x57, 0x54 }}
+
+extern EFI_GUID gEfiCapsuleArchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ComponentName.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ComponentName.h
new file mode 100644
index 0000000000..cdd87fce31
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ComponentName.h
@@ -0,0 +1,129 @@
+/** @file
+ EFI Component Name Protocol as defined in the EFI 1.1 specification.
+ This protocol is used to retrieve user readable names of EFI Drivers
+ and controllers managed by EFI Drivers.
+
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_COMPONENT_NAME_H__
+#define __EFI_COMPONENT_NAME_H__
+
+///
+/// The global ID for the Component Name Protocol.
+///
+#define EFI_COMPONENT_NAME_PROTOCOL_GUID \
+ { \
+ 0x107a772c, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
+ }
+
+typedef struct _EFI_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL;
+
+
+/**
+ Retrieves a Unicode string that is the user-readable name of the EFI Driver.
+
+ @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
+ @param Language A pointer to a three-character ISO 639-2 language identifier.
+ This is the language of the driver name that that the caller
+ is requesting, and it must match one of the languages specified
+ in SupportedLanguages. The number of languages supported by a
+ driver is up to the driver writer.
+ @param DriverName A pointer to the Unicode string to return. This Unicode string
+ is the name of the driver specified by This in the language
+ specified by Language.
+
+ @retval EFI_SUCCESS The Unicode string for the Driver specified by This
+ and the language specified by Language was returned
+ in DriverName.
+ @retval EFI_INVALID_PARAMETER Language is NULL.
+ @retval EFI_INVALID_PARAMETER DriverName is NULL.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the
+ language specified by Language.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME)(
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,
+ IN CHAR8 *Language,
+ OUT CHAR16 **DriverName
+ );
+
+
+/**
+ Retrieves a Unicode string that is the user readable name of the controller
+ that is being managed by an EFI Driver.
+
+ @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
+ @param ControllerHandle The handle of a controller that the driver specified by
+ This is managing. This handle specifies the controller
+ whose name is to be returned.
+ @param ChildHandle The handle of the child controller to retrieve the name
+ of. This is an optional parameter that may be NULL. It
+ will be NULL for device drivers. It will also be NULL
+ for a bus drivers that wish to retrieve the name of the
+ bus controller. It will not be NULL for a bus driver
+ that wishes to retrieve the name of a child controller.
+ @param Language A pointer to a three character ISO 639-2 language
+ identifier. This is the language of the controller name
+ that the caller is requesting, and it must match one
+ of the languages specified in SupportedLanguages. The
+ number of languages supported by a driver is up to the
+ driver writer.
+ @param ControllerName A pointer to the Unicode string to return. This Unicode
+ string is the name of the controller specified by
+ ControllerHandle and ChildHandle in the language specified
+ by Language, from the point of view of the driver specified
+ by This.
+
+ @retval EFI_SUCCESS The Unicode string for the user-readable name in the
+ language specified by Language for the driver
+ specified by This was returned in DriverName.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER Language is NULL.
+ @retval EFI_INVALID_PARAMETER ControllerName is NULL.
+ @retval EFI_UNSUPPORTED The driver specified by This is not currently managing
+ the controller specified by ControllerHandle and
+ ChildHandle.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the
+ language specified by Language.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME)(
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN CHAR8 *Language,
+ OUT CHAR16 **ControllerName
+ );
+
+///
+/// This protocol is used to retrieve user readable names of drivers
+/// and controllers managed by UEFI Drivers.
+///
+struct _EFI_COMPONENT_NAME_PROTOCOL {
+ EFI_COMPONENT_NAME_GET_DRIVER_NAME GetDriverName;
+ EFI_COMPONENT_NAME_GET_CONTROLLER_NAME GetControllerName;
+ ///
+ /// A Null-terminated ASCII string that contains one or more
+ /// ISO 639-2 language codes. This is the list of language codes
+ /// that this protocol supports.
+ ///
+ CHAR8 *SupportedLanguages;
+};
+
+extern EFI_GUID gEfiComponentNameProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ComponentName2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ComponentName2.h
new file mode 100644
index 0000000000..d005b02b87
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ComponentName2.h
@@ -0,0 +1,172 @@
+/** @file
+ UEFI Component Name 2 Protocol as defined in the UEFI 2.1 specification.
+ This protocol is used to retrieve user readable names of drivers
+ and controllers managed by UEFI Drivers.
+
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_COMPONENT_NAME2_H__
+#define __EFI_COMPONENT_NAME2_H__
+
+///
+/// Global ID for the Component Name Protocol
+///
+#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \
+ {0x6a7a5cff, 0xe8d9, 0x4f70, { 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14 } }
+
+typedef struct _EFI_COMPONENT_NAME2_PROTOCOL EFI_COMPONENT_NAME2_PROTOCOL;
+
+
+/**
+ Retrieves a string that is the user readable name of
+ the EFI Driver.
+
+ @param This A pointer to the
+ EFI_COMPONENT_NAME2_PROTOCOL instance.
+
+ @param Language A pointer to a Null-terminated ASCII string
+ array indicating the language. This is the
+ language of the driver name that the caller
+ is requesting, and it must match one of the
+ languages specified in SupportedLanguages.
+ The number of languages supported by a
+ driver is up to the driver writer. Language
+ is specified in RFC 4646 language code
+ format.
+
+ @param DriverName A pointer to the string to return.
+ This string is the name of the
+ driver specified by This in the language
+ specified by Language.
+
+ @retval EFI_SUCCESS The string for the
+ Driver specified by This and the
+ language specified by Language
+ was returned in DriverName.
+
+ @retval EFI_INVALID_PARAMETER Language is NULL.
+
+ @retval EFI_INVALID_PARAMETER DriverName is NULL.
+
+ @retval EFI_UNSUPPORTED The driver specified by This
+ does not support the language
+ specified by Language.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_COMPONENT_NAME2_GET_DRIVER_NAME)(
+ IN EFI_COMPONENT_NAME2_PROTOCOL *This,
+ IN CHAR8 *Language,
+ OUT CHAR16 **DriverName
+ );
+
+
+/**
+ Retrieves a string that is the user readable name of
+ the controller that is being managed by an EFI Driver.
+
+ @param This A pointer to the
+ EFI_COMPONENT_NAME2_PROTOCOL instance.
+
+ @param ControllerHandle The handle of a controller that the
+ driver specified by This is managing.
+ This handle specifies the controller
+ whose name is to be returned.
+
+ @param ChildHandle The handle of the child controller to
+ retrieve the name of. This is an
+ optional parameter that may be NULL.
+ It will be NULL for device drivers.
+ It will also be NULL for bus
+ drivers that wish to retrieve the
+ name of the bus controller. It will
+ not be NULL for a bus driver that
+ wishes to retrieve the name of a
+ child controller.
+
+ @param Language A pointer to a Null-terminated ASCII
+ string array indicating the language.
+ This is the language of the driver
+ name that the caller is requesting,
+ and it must match one of the
+ languages specified in
+ SupportedLanguages. The number of
+ languages supported by a driver is up
+ to the driver writer. Language is
+ specified in RFC 4646 language code
+ format.
+
+ @param ControllerName A pointer to the string to return.
+ This string is the name of the controller
+ specified by ControllerHandle and ChildHandle
+ in the language specified by Language
+ from the point of view of the driver
+ specified by This.
+
+ @retval EFI_SUCCESS The string for the user
+ readable name in the language
+ specified by Language for the
+ driver specified by This was
+ returned in DriverName.
+
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
+
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it
+ is not a valid EFI_HANDLE.
+
+ @retval EFI_INVALID_PARAMETER Language is NULL.
+
+ @retval EFI_INVALID_PARAMETER ControllerName is NULL.
+
+ @retval EFI_UNSUPPORTED The driver specified by This is
+ not currently managing the
+ controller specified by
+ ControllerHandle and
+ ChildHandle.
+
+ @retval EFI_UNSUPPORTED The driver specified by This
+ does not support the language
+ specified by Language.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)(
+ IN EFI_COMPONENT_NAME2_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN CHAR8 *Language,
+ OUT CHAR16 **ControllerName
+ );
+
+///
+/// This protocol is used to retrieve user readable names of drivers
+/// and controllers managed by UEFI Drivers.
+///
+struct _EFI_COMPONENT_NAME2_PROTOCOL {
+ EFI_COMPONENT_NAME2_GET_DRIVER_NAME GetDriverName;
+ EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME GetControllerName;
+
+ ///
+ /// A Null-terminated ASCII string array that contains one or more
+ /// supported language codes. This is the list of language codes that
+ /// this protocol supports. The number of languages supported by a
+ /// driver is up to the driver writer. SupportedLanguages is
+ /// specified in RFC 4646 format.
+ ///
+ CHAR8 *SupportedLanguages;
+};
+
+extern EFI_GUID gEfiComponentName2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Cpu.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Cpu.h
new file mode 100644
index 0000000000..cfb2e75701
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Cpu.h
@@ -0,0 +1,300 @@
+/** @file
+ CPU Architectural Protocol as defined in PI spec Volume 2 DXE
+
+ This code abstracts the DXE core from processor implementation details.
+
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARCH_PROTOCOL_CPU_H__
+#define __ARCH_PROTOCOL_CPU_H__
+
+#include <Protocol/DebugSupport.h>
+
+#define EFI_CPU_ARCH_PROTOCOL_GUID \
+ { 0x26baccb1, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
+
+typedef struct _EFI_CPU_ARCH_PROTOCOL EFI_CPU_ARCH_PROTOCOL;
+
+///
+/// The type of flush operation
+///
+typedef enum {
+ EfiCpuFlushTypeWriteBackInvalidate,
+ EfiCpuFlushTypeWriteBack,
+ EfiCpuFlushTypeInvalidate,
+ EfiCpuMaxFlushType
+} EFI_CPU_FLUSH_TYPE;
+
+///
+/// The type of processor INIT.
+///
+typedef enum {
+ EfiCpuInit,
+ EfiCpuMaxInitType
+} EFI_CPU_INIT_TYPE;
+
+/**
+ EFI_CPU_INTERRUPT_HANDLER that is called when a processor interrupt occurs.
+
+ @param InterruptType Defines the type of interrupt or exception that
+ occurred on the processor.This parameter is processor architecture specific.
+ @param SystemContext A pointer to the processor context when
+ the interrupt occurred on the processor.
+
+ @return None
+
+**/
+typedef
+VOID
+(EFIAPI *EFI_CPU_INTERRUPT_HANDLER)(
+ IN CONST EFI_EXCEPTION_TYPE InterruptType,
+ IN CONST EFI_SYSTEM_CONTEXT SystemContext
+ );
+
+/**
+ This function flushes the range of addresses from Start to Start+Length
+ from the processor's data cache. If Start is not aligned to a cache line
+ boundary, then the bytes before Start to the preceding cache line boundary
+ are also flushed. If Start+Length is not aligned to a cache line boundary,
+ then the bytes past Start+Length to the end of the next cache line boundary
+ are also flushed. The FlushType of EfiCpuFlushTypeWriteBackInvalidate must be
+ supported. If the data cache is fully coherent with all DMA operations, then
+ this function can just return EFI_SUCCESS. If the processor does not support
+ flushing a range of the data cache, then the entire data cache can be flushed.
+
+ @param This The EFI_CPU_ARCH_PROTOCOL instance.
+ @param Start The beginning physical address to flush from the processor's data
+ cache.
+ @param Length The number of bytes to flush from the processor's data cache. This
+ function may flush more bytes than Length specifies depending upon
+ the granularity of the flush operation that the processor supports.
+ @param FlushType Specifies the type of flush operation to perform.
+
+ @retval EFI_SUCCESS The address range from Start to Start+Length was flushed from
+ the processor's data cache.
+ @retval EFI_UNSUPPORTED The processor does not support the cache flush type specified
+ by FlushType.
+ @retval EFI_DEVICE_ERROR The address range from Start to Start+Length could not be flushed
+ from the processor's data cache.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CPU_FLUSH_DATA_CACHE)(
+ IN EFI_CPU_ARCH_PROTOCOL *This,
+ IN EFI_PHYSICAL_ADDRESS Start,
+ IN UINT64 Length,
+ IN EFI_CPU_FLUSH_TYPE FlushType
+ );
+
+
+/**
+ This function enables interrupt processing by the processor.
+
+ @param This The EFI_CPU_ARCH_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Interrupts are enabled on the processor.
+ @retval EFI_DEVICE_ERROR Interrupts could not be enabled on the processor.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CPU_ENABLE_INTERRUPT)(
+ IN EFI_CPU_ARCH_PROTOCOL *This
+ );
+
+
+/**
+ This function disables interrupt processing by the processor.
+
+ @param This The EFI_CPU_ARCH_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Interrupts are disabled on the processor.
+ @retval EFI_DEVICE_ERROR Interrupts could not be disabled on the processor.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CPU_DISABLE_INTERRUPT)(
+ IN EFI_CPU_ARCH_PROTOCOL *This
+ );
+
+
+/**
+ This function retrieves the processor's current interrupt state a returns it in
+ State. If interrupts are currently enabled, then TRUE is returned. If interrupts
+ are currently disabled, then FALSE is returned.
+
+ @param This The EFI_CPU_ARCH_PROTOCOL instance.
+ @param State A pointer to the processor's current interrupt state. Set to TRUE if
+ interrupts are enabled and FALSE if interrupts are disabled.
+
+ @retval EFI_SUCCESS The processor's current interrupt state was returned in State.
+ @retval EFI_INVALID_PARAMETER State is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CPU_GET_INTERRUPT_STATE)(
+ IN EFI_CPU_ARCH_PROTOCOL *This,
+ OUT BOOLEAN *State
+ );
+
+
+/**
+ This function generates an INIT on the processor. If this function succeeds, then the
+ processor will be reset, and control will not be returned to the caller. If InitType is
+ not supported by this processor, or the processor cannot programmatically generate an
+ INIT without help from external hardware, then EFI_UNSUPPORTED is returned. If an error
+ occurs attempting to generate an INIT, then EFI_DEVICE_ERROR is returned.
+
+ @param This The EFI_CPU_ARCH_PROTOCOL instance.
+ @param InitType The type of processor INIT to perform.
+
+ @retval EFI_SUCCESS The processor INIT was performed. This return code should never be seen.
+ @retval EFI_UNSUPPORTED The processor INIT operation specified by InitType is not supported
+ by this processor.
+ @retval EFI_DEVICE_ERROR The processor INIT failed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CPU_INIT)(
+ IN EFI_CPU_ARCH_PROTOCOL *This,
+ IN EFI_CPU_INIT_TYPE InitType
+ );
+
+
+/**
+ This function registers and enables the handler specified by InterruptHandler for a processor
+ interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
+ handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
+ The installed handler is called once for each processor interrupt or exception.
+
+ @param This The EFI_CPU_ARCH_PROTOCOL instance.
+ @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts
+ are enabled and FALSE if interrupts are disabled.
+ @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
+ when a processor interrupt occurs. If this parameter is NULL, then the handler
+ will be uninstalled.
+
+ @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
+ @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
+ previously installed.
+ @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
+ previously installed.
+ @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CPU_REGISTER_INTERRUPT_HANDLER)(
+ IN EFI_CPU_ARCH_PROTOCOL *This,
+ IN EFI_EXCEPTION_TYPE InterruptType,
+ IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
+ );
+
+
+/**
+ This function reads the processor timer specified by TimerIndex and returns it in TimerValue.
+
+ @param This The EFI_CPU_ARCH_PROTOCOL instance.
+ @param TimerIndex Specifies which processor timer is to be returned in TimerValue. This parameter
+ must be between 0 and NumberOfTimers-1.
+ @param TimerValue Pointer to the returned timer value.
+ @param TimerPeriod A pointer to the amount of time that passes in femtoseconds for each increment
+ of TimerValue. If TimerValue does not increment at a predictable rate, then 0 is
+ returned. This parameter is optional and may be NULL.
+
+ @retval EFI_SUCCESS The processor timer value specified by TimerIndex was returned in TimerValue.
+ @retval EFI_DEVICE_ERROR An error occurred attempting to read one of the processor's timers.
+ @retval EFI_INVALID_PARAMETER TimerValue is NULL or TimerIndex is not valid.
+ @retval EFI_UNSUPPORTED The processor does not have any readable timers.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CPU_GET_TIMER_VALUE)(
+ IN EFI_CPU_ARCH_PROTOCOL *This,
+ IN UINT32 TimerIndex,
+ OUT UINT64 *TimerValue,
+ OUT UINT64 *TimerPeriod OPTIONAL
+ );
+
+
+/**
+ This function modifies the attributes for the memory region specified by BaseAddress and
+ Length from their current attributes to the attributes specified by Attributes.
+
+ @param This The EFI_CPU_ARCH_PROTOCOL instance.
+ @param BaseAddress The physical address that is the start address of a memory region.
+ @param Length The size in bytes of the memory region.
+ @param Attributes The bit mask of attributes to set for the memory region.
+
+ @retval EFI_SUCCESS The attributes were set for the memory region.
+ @retval EFI_ACCESS_DENIED The attributes for the memory resource range specified by
+ BaseAddress and Length cannot be modified.
+ @retval EFI_INVALID_PARAMETER Length is zero.
+ Attributes specified an illegal combination of attributes that
+ cannot be set together.
+ @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of
+ the memory resource range.
+ @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory
+ resource range specified by BaseAddress and Length.
+ The bit mask of attributes is not support for the memory resource
+ range specified by BaseAddress and Length.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CPU_SET_MEMORY_ATTRIBUTES)(
+ IN EFI_CPU_ARCH_PROTOCOL *This,
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length,
+ IN UINT64 Attributes
+ );
+
+
+///
+/// The EFI_CPU_ARCH_PROTOCOL is used to abstract processor-specific functions from the DXE
+/// Foundation. This includes flushing caches, enabling and disabling interrupts, hooking interrupt
+/// vectors and exception vectors, reading internal processor timers, resetting the processor, and
+/// determining the processor frequency.
+///
+struct _EFI_CPU_ARCH_PROTOCOL {
+ EFI_CPU_FLUSH_DATA_CACHE FlushDataCache;
+ EFI_CPU_ENABLE_INTERRUPT EnableInterrupt;
+ EFI_CPU_DISABLE_INTERRUPT DisableInterrupt;
+ EFI_CPU_GET_INTERRUPT_STATE GetInterruptState;
+ EFI_CPU_INIT Init;
+ EFI_CPU_REGISTER_INTERRUPT_HANDLER RegisterInterruptHandler;
+ EFI_CPU_GET_TIMER_VALUE GetTimerValue;
+ EFI_CPU_SET_MEMORY_ATTRIBUTES SetMemoryAttributes;
+ ///
+ /// The number of timers that are available in a processor. The value in this
+ /// field is a constant that must not be modified after the CPU Architectural
+ /// Protocol is installed. All consumers must treat this as a read-only field.
+ ///
+ UINT32 NumberOfTimers;
+ ///
+ /// The size, in bytes, of the alignment required for DMA buffer allocations.
+ /// This is typically the size of the largest data cache line in the platform.
+ /// The value in this field is a constant that must not be modified after the
+ /// CPU Architectural Protocol is installed. All consumers must treat this as
+ /// a read-only field.
+ ///
+ UINT32 DmaBufferAlignment;
+};
+
+extern EFI_GUID gEfiCpuArchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/CpuIo2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/CpuIo2.h
new file mode 100644
index 0000000000..49fb470713
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/CpuIo2.h
@@ -0,0 +1,142 @@
+/** @file
+ This files describes the CPU I/O 2 Protocol.
+
+ This protocol provides an I/O abstraction for a system processor. This protocol
+ is used by a PCI root bridge I/O driver to perform memory-mapped I/O and I/O transactions.
+ The I/O or memory primitives can be used by the consumer of the protocol to materialize
+ bus-specific configuration cycles, such as the transitional configuration address and data
+ ports for PCI. Only drivers that require direct access to the entire system should use this
+ protocol.
+
+ Note: This is a boot-services only protocol and it may not be used by runtime drivers after
+ ExitBootServices(). It is different from the Framework CPU I/O Protocol, which is a runtime
+ protocol and can be used by runtime drivers after ExitBootServices().
+
+ Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is defined in UEFI Platform Initialization Specification 1.2
+ Volume 5: Standards
+
+**/
+
+#ifndef __CPU_IO2_H__
+#define __CPU_IO2_H__
+
+#define EFI_CPU_IO2_PROTOCOL_GUID \
+ { \
+ 0xad61f191, 0xae5f, 0x4c0e, {0xb9, 0xfa, 0xe8, 0x69, 0xd2, 0x88, 0xc6, 0x4f} \
+ }
+
+typedef struct _EFI_CPU_IO2_PROTOCOL EFI_CPU_IO2_PROTOCOL;
+
+///
+/// Enumeration that defines the width of the I/O operation.
+///
+typedef enum {
+ EfiCpuIoWidthUint8,
+ EfiCpuIoWidthUint16,
+ EfiCpuIoWidthUint32,
+ EfiCpuIoWidthUint64,
+ EfiCpuIoWidthFifoUint8,
+ EfiCpuIoWidthFifoUint16,
+ EfiCpuIoWidthFifoUint32,
+ EfiCpuIoWidthFifoUint64,
+ EfiCpuIoWidthFillUint8,
+ EfiCpuIoWidthFillUint16,
+ EfiCpuIoWidthFillUint32,
+ EfiCpuIoWidthFillUint64,
+ EfiCpuIoWidthMaximum
+} EFI_CPU_IO_PROTOCOL_WIDTH;
+
+/**
+ Enables a driver to access registers in the PI CPU I/O space.
+
+ The Io.Read() and Io.Write() functions enable a driver to access PCI controller
+ registers in the PI CPU I/O space.
+
+ The I/O operations are carried out exactly as requested. The caller is responsible
+ for satisfying any alignment and I/O width restrictions that a PI System on a
+ platform might require. For example on some platforms, width requests of
+ EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
+ be handled by the driver.
+
+ If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
+ or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
+ each of the Count operations that is performed.
+
+ If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
+ EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
+ incremented for each of the Count operations that is performed. The read or
+ write operation is performed Count times on the same Address.
+
+ If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
+ EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
+ incremented for each of the Count operations that is performed. The read or
+ write operation is performed Count times from the first element of Buffer.
+
+ @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance.
+ @param[in] Width Signifies the width of the I/O or Memory operation.
+ @param[in] Address The base address of the I/O operation.
+ @param[in] Count The number of I/O operations to perform. The number
+ of bytes moved is Width size * Count, starting at Address.
+ @param[in, out] Buffer For read operations, the destination buffer to store the results.
+ For write operations, the source buffer from which to write data.
+
+ @retval EFI_SUCCESS The data was read from or written to the PI system.
+ @retval EFI_INVALID_PARAMETER Width is invalid for this PI system.
+ @retval EFI_INVALID_PARAMETER Buffer is NULL.
+ @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width.
+ @retval EFI_UNSUPPORTED The address range specified by Address, Width,
+ and Count is not valid for this PI system.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CPU_IO_PROTOCOL_IO_MEM)(
+ IN EFI_CPU_IO2_PROTOCOL *This,
+ IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+ );
+
+///
+/// Service for read and write accesses.
+///
+typedef struct {
+ ///
+ /// This service provides the various modalities of memory and I/O read.
+ ///
+ EFI_CPU_IO_PROTOCOL_IO_MEM Read;
+ ///
+ /// This service provides the various modalities of memory and I/O write.
+ ///
+ EFI_CPU_IO_PROTOCOL_IO_MEM Write;
+} EFI_CPU_IO_PROTOCOL_ACCESS;
+
+///
+/// Provides the basic memory and I/O interfaces that are used to abstract
+/// accesses to devices in a system.
+///
+struct _EFI_CPU_IO2_PROTOCOL {
+ ///
+ /// Enables a driver to access memory-mapped registers in the EFI system memory space.
+ ///
+ EFI_CPU_IO_PROTOCOL_ACCESS Mem;
+ ///
+ /// Enables a driver to access registers in the EFI CPU I/O space.
+ ///
+ EFI_CPU_IO_PROTOCOL_ACCESS Io;
+};
+
+extern EFI_GUID gEfiCpuIo2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DebugPort.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DebugPort.h
new file mode 100644
index 0000000000..ba14591107
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DebugPort.h
@@ -0,0 +1,146 @@
+/** @file
+
+ The file defines the EFI Debugport protocol.
+ This protocol is used by debug agent to communicate with the
+ remote debug host.
+
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __DEBUG_PORT_H__
+#define __DEBUG_PORT_H__
+
+
+///
+/// DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}
+///
+#define EFI_DEBUGPORT_PROTOCOL_GUID \
+ { \
+ 0xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \
+ }
+
+extern EFI_GUID gEfiDebugPortProtocolGuid;
+
+typedef struct _EFI_DEBUGPORT_PROTOCOL EFI_DEBUGPORT_PROTOCOL;
+
+//
+// DebugPort member functions
+//
+
+/**
+ Resets the debugport.
+
+ @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The debugport device was reset and is in usable state.
+ @retval EFI_DEVICE_ERROR The debugport device could not be reset and is unusable.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DEBUGPORT_RESET)(
+ IN EFI_DEBUGPORT_PROTOCOL *This
+ );
+
+/**
+ Writes data to the debugport.
+
+ @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
+ @param Timeout The number of microseconds to wait before timing out a write operation.
+ @param BufferSize On input, the requested number of bytes of data to write. On output, the
+ number of bytes of data actually written.
+ @param Buffer A pointer to a buffer containing the data to write.
+
+ @retval EFI_SUCCESS The data was written.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_TIMEOUT The data write was stopped due to a timeout.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DEBUGPORT_WRITE)(
+ IN EFI_DEBUGPORT_PROTOCOL *This,
+ IN UINT32 Timeout,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer
+ );
+
+/**
+ Reads data from the debugport.
+
+ @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
+ @param Timeout The number of microseconds to wait before timing out a read operation.
+ @param BufferSize On input, the requested number of bytes of data to read. On output, the
+ number of bytes of data actually number of bytes
+ of data read and returned in Buffer.
+ @param Buffer A pointer to a buffer into which the data read will be saved.
+
+ @retval EFI_SUCCESS The data was read.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_TIMEOUT The operation was stopped due to a timeout or overrun.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DEBUGPORT_READ)(
+ IN EFI_DEBUGPORT_PROTOCOL *This,
+ IN UINT32 Timeout,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+ );
+
+/**
+ Checks to see if any data is available to be read from the debugport device.
+
+ @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
+
+ @retval EFI_SUCCESS At least one byte of data is available to be read.
+ @retval EFI_DEVICE_ERROR The debugport device is not functioning correctly.
+ @retval EFI_NOT_READY No data is available to be read.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DEBUGPORT_POLL)(
+ IN EFI_DEBUGPORT_PROTOCOL *This
+ );
+
+///
+/// This protocol provides the communication link between the debug agent and the remote host.
+///
+struct _EFI_DEBUGPORT_PROTOCOL {
+ EFI_DEBUGPORT_RESET Reset;
+ EFI_DEBUGPORT_WRITE Write;
+ EFI_DEBUGPORT_READ Read;
+ EFI_DEBUGPORT_POLL Poll;
+};
+
+//
+// DEBUGPORT variable definitions...
+//
+#define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"
+#define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID
+
+extern EFI_GUID gEfiDebugPortVariableGuid;
+
+//
+// DebugPort device path definitions...
+//
+#define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID
+
+extern EFI_GUID gEfiDebugPortDevicePathGuid;
+
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ EFI_GUID Guid;
+} DEBUGPORT_DEVICE_PATH;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DebugSupport.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DebugSupport.h
new file mode 100644
index 0000000000..80f87061bd
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DebugSupport.h
@@ -0,0 +1,778 @@
+/** @file
+ DebugSupport protocol and supporting definitions as defined in the UEFI2.4
+ specification.
+
+ The DebugSupport protocol is used by source level debuggers to abstract the
+ processor and handle context save and restore operations.
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
+
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __DEBUG_SUPPORT_H__
+#define __DEBUG_SUPPORT_H__
+
+#include <IndustryStandard/PeImage.h>
+
+typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;
+
+///
+/// Debug Support protocol {2755590C-6F3C-42FA-9EA4-A3BA543CDA25}.
+///
+#define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \
+ { \
+ 0x2755590C, 0x6F3C, 0x42FA, {0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } \
+ }
+
+///
+/// Processor exception to be hooked.
+/// All exception types for IA32, X64, Itanium and EBC processors are defined.
+///
+typedef INTN EFI_EXCEPTION_TYPE;
+
+///
+/// IA-32 processor exception types.
+///
+#define EXCEPT_IA32_DIVIDE_ERROR 0
+#define EXCEPT_IA32_DEBUG 1
+#define EXCEPT_IA32_NMI 2
+#define EXCEPT_IA32_BREAKPOINT 3
+#define EXCEPT_IA32_OVERFLOW 4
+#define EXCEPT_IA32_BOUND 5
+#define EXCEPT_IA32_INVALID_OPCODE 6
+#define EXCEPT_IA32_DOUBLE_FAULT 8
+#define EXCEPT_IA32_INVALID_TSS 10
+#define EXCEPT_IA32_SEG_NOT_PRESENT 11
+#define EXCEPT_IA32_STACK_FAULT 12
+#define EXCEPT_IA32_GP_FAULT 13
+#define EXCEPT_IA32_PAGE_FAULT 14
+#define EXCEPT_IA32_FP_ERROR 16
+#define EXCEPT_IA32_ALIGNMENT_CHECK 17
+#define EXCEPT_IA32_MACHINE_CHECK 18
+#define EXCEPT_IA32_SIMD 19
+
+///
+/// FXSAVE_STATE.
+/// FP / MMX / XMM registers (see fxrstor instruction definition).
+///
+typedef struct {
+ UINT16 Fcw;
+ UINT16 Fsw;
+ UINT16 Ftw;
+ UINT16 Opcode;
+ UINT32 Eip;
+ UINT16 Cs;
+ UINT16 Reserved1;
+ UINT32 DataOffset;
+ UINT16 Ds;
+ UINT8 Reserved2[10];
+ UINT8 St0Mm0[10], Reserved3[6];
+ UINT8 St1Mm1[10], Reserved4[6];
+ UINT8 St2Mm2[10], Reserved5[6];
+ UINT8 St3Mm3[10], Reserved6[6];
+ UINT8 St4Mm4[10], Reserved7[6];
+ UINT8 St5Mm5[10], Reserved8[6];
+ UINT8 St6Mm6[10], Reserved9[6];
+ UINT8 St7Mm7[10], Reserved10[6];
+ UINT8 Xmm0[16];
+ UINT8 Xmm1[16];
+ UINT8 Xmm2[16];
+ UINT8 Xmm3[16];
+ UINT8 Xmm4[16];
+ UINT8 Xmm5[16];
+ UINT8 Xmm6[16];
+ UINT8 Xmm7[16];
+ UINT8 Reserved11[14 * 16];
+} EFI_FX_SAVE_STATE_IA32;
+
+///
+/// IA-32 processor context definition.
+///
+typedef struct {
+ UINT32 ExceptionData;
+ EFI_FX_SAVE_STATE_IA32 FxSaveState;
+ UINT32 Dr0;
+ UINT32 Dr1;
+ UINT32 Dr2;
+ UINT32 Dr3;
+ UINT32 Dr6;
+ UINT32 Dr7;
+ UINT32 Cr0;
+ UINT32 Cr1; /* Reserved */
+ UINT32 Cr2;
+ UINT32 Cr3;
+ UINT32 Cr4;
+ UINT32 Eflags;
+ UINT32 Ldtr;
+ UINT32 Tr;
+ UINT32 Gdtr[2];
+ UINT32 Idtr[2];
+ UINT32 Eip;
+ UINT32 Gs;
+ UINT32 Fs;
+ UINT32 Es;
+ UINT32 Ds;
+ UINT32 Cs;
+ UINT32 Ss;
+ UINT32 Edi;
+ UINT32 Esi;
+ UINT32 Ebp;
+ UINT32 Esp;
+ UINT32 Ebx;
+ UINT32 Edx;
+ UINT32 Ecx;
+ UINT32 Eax;
+} EFI_SYSTEM_CONTEXT_IA32;
+
+///
+/// x64 processor exception types.
+///
+#define EXCEPT_X64_DIVIDE_ERROR 0
+#define EXCEPT_X64_DEBUG 1
+#define EXCEPT_X64_NMI 2
+#define EXCEPT_X64_BREAKPOINT 3
+#define EXCEPT_X64_OVERFLOW 4
+#define EXCEPT_X64_BOUND 5
+#define EXCEPT_X64_INVALID_OPCODE 6
+#define EXCEPT_X64_DOUBLE_FAULT 8
+#define EXCEPT_X64_INVALID_TSS 10
+#define EXCEPT_X64_SEG_NOT_PRESENT 11
+#define EXCEPT_X64_STACK_FAULT 12
+#define EXCEPT_X64_GP_FAULT 13
+#define EXCEPT_X64_PAGE_FAULT 14
+#define EXCEPT_X64_FP_ERROR 16
+#define EXCEPT_X64_ALIGNMENT_CHECK 17
+#define EXCEPT_X64_MACHINE_CHECK 18
+#define EXCEPT_X64_SIMD 19
+
+///
+/// FXSAVE_STATE.
+/// FP / MMX / XMM registers (see fxrstor instruction definition).
+///
+typedef struct {
+ UINT16 Fcw;
+ UINT16 Fsw;
+ UINT16 Ftw;
+ UINT16 Opcode;
+ UINT64 Rip;
+ UINT64 DataOffset;
+ UINT8 Reserved1[8];
+ UINT8 St0Mm0[10], Reserved2[6];
+ UINT8 St1Mm1[10], Reserved3[6];
+ UINT8 St2Mm2[10], Reserved4[6];
+ UINT8 St3Mm3[10], Reserved5[6];
+ UINT8 St4Mm4[10], Reserved6[6];
+ UINT8 St5Mm5[10], Reserved7[6];
+ UINT8 St6Mm6[10], Reserved8[6];
+ UINT8 St7Mm7[10], Reserved9[6];
+ UINT8 Xmm0[16];
+ UINT8 Xmm1[16];
+ UINT8 Xmm2[16];
+ UINT8 Xmm3[16];
+ UINT8 Xmm4[16];
+ UINT8 Xmm5[16];
+ UINT8 Xmm6[16];
+ UINT8 Xmm7[16];
+ //
+ // NOTE: UEFI 2.0 spec definition as follows.
+ //
+ UINT8 Reserved11[14 * 16];
+} EFI_FX_SAVE_STATE_X64;
+
+///
+/// x64 processor context definition.
+///
+typedef struct {
+ UINT64 ExceptionData;
+ EFI_FX_SAVE_STATE_X64 FxSaveState;
+ UINT64 Dr0;
+ UINT64 Dr1;
+ UINT64 Dr2;
+ UINT64 Dr3;
+ UINT64 Dr6;
+ UINT64 Dr7;
+ UINT64 Cr0;
+ UINT64 Cr1; /* Reserved */
+ UINT64 Cr2;
+ UINT64 Cr3;
+ UINT64 Cr4;
+ UINT64 Cr8;
+ UINT64 Rflags;
+ UINT64 Ldtr;
+ UINT64 Tr;
+ UINT64 Gdtr[2];
+ UINT64 Idtr[2];
+ UINT64 Rip;
+ UINT64 Gs;
+ UINT64 Fs;
+ UINT64 Es;
+ UINT64 Ds;
+ UINT64 Cs;
+ UINT64 Ss;
+ UINT64 Rdi;
+ UINT64 Rsi;
+ UINT64 Rbp;
+ UINT64 Rsp;
+ UINT64 Rbx;
+ UINT64 Rdx;
+ UINT64 Rcx;
+ UINT64 Rax;
+ UINT64 R8;
+ UINT64 R9;
+ UINT64 R10;
+ UINT64 R11;
+ UINT64 R12;
+ UINT64 R13;
+ UINT64 R14;
+ UINT64 R15;
+} EFI_SYSTEM_CONTEXT_X64;
+
+///
+/// Itanium Processor Family Exception types.
+///
+#define EXCEPT_IPF_VHTP_TRANSLATION 0
+#define EXCEPT_IPF_INSTRUCTION_TLB 1
+#define EXCEPT_IPF_DATA_TLB 2
+#define EXCEPT_IPF_ALT_INSTRUCTION_TLB 3
+#define EXCEPT_IPF_ALT_DATA_TLB 4
+#define EXCEPT_IPF_DATA_NESTED_TLB 5
+#define EXCEPT_IPF_INSTRUCTION_KEY_MISSED 6
+#define EXCEPT_IPF_DATA_KEY_MISSED 7
+#define EXCEPT_IPF_DIRTY_BIT 8
+#define EXCEPT_IPF_INSTRUCTION_ACCESS_BIT 9
+#define EXCEPT_IPF_DATA_ACCESS_BIT 10
+#define EXCEPT_IPF_BREAKPOINT 11
+#define EXCEPT_IPF_EXTERNAL_INTERRUPT 12
+//
+// 13 - 19 reserved
+//
+#define EXCEPT_IPF_PAGE_NOT_PRESENT 20
+#define EXCEPT_IPF_KEY_PERMISSION 21
+#define EXCEPT_IPF_INSTRUCTION_ACCESS_RIGHTS 22
+#define EXCEPT_IPF_DATA_ACCESS_RIGHTS 23
+#define EXCEPT_IPF_GENERAL_EXCEPTION 24
+#define EXCEPT_IPF_DISABLED_FP_REGISTER 25
+#define EXCEPT_IPF_NAT_CONSUMPTION 26
+#define EXCEPT_IPF_SPECULATION 27
+//
+// 28 reserved
+//
+#define EXCEPT_IPF_DEBUG 29
+#define EXCEPT_IPF_UNALIGNED_REFERENCE 30
+#define EXCEPT_IPF_UNSUPPORTED_DATA_REFERENCE 31
+#define EXCEPT_IPF_FP_FAULT 32
+#define EXCEPT_IPF_FP_TRAP 33
+#define EXCEPT_IPF_LOWER_PRIVILEGE_TRANSFER_TRAP 34
+#define EXCEPT_IPF_TAKEN_BRANCH 35
+#define EXCEPT_IPF_SINGLE_STEP 36
+//
+// 37 - 44 reserved
+//
+#define EXCEPT_IPF_IA32_EXCEPTION 45
+#define EXCEPT_IPF_IA32_INTERCEPT 46
+#define EXCEPT_IPF_IA32_INTERRUPT 47
+
+///
+/// IPF processor context definition.
+///
+typedef struct {
+ //
+ // The first reserved field is necessary to preserve alignment for the correct
+ // bits in UNAT and to insure F2 is 16 byte aligned.
+ //
+ UINT64 Reserved;
+ UINT64 R1;
+ UINT64 R2;
+ UINT64 R3;
+ UINT64 R4;
+ UINT64 R5;
+ UINT64 R6;
+ UINT64 R7;
+ UINT64 R8;
+ UINT64 R9;
+ UINT64 R10;
+ UINT64 R11;
+ UINT64 R12;
+ UINT64 R13;
+ UINT64 R14;
+ UINT64 R15;
+ UINT64 R16;
+ UINT64 R17;
+ UINT64 R18;
+ UINT64 R19;
+ UINT64 R20;
+ UINT64 R21;
+ UINT64 R22;
+ UINT64 R23;
+ UINT64 R24;
+ UINT64 R25;
+ UINT64 R26;
+ UINT64 R27;
+ UINT64 R28;
+ UINT64 R29;
+ UINT64 R30;
+ UINT64 R31;
+
+ UINT64 F2[2];
+ UINT64 F3[2];
+ UINT64 F4[2];
+ UINT64 F5[2];
+ UINT64 F6[2];
+ UINT64 F7[2];
+ UINT64 F8[2];
+ UINT64 F9[2];
+ UINT64 F10[2];
+ UINT64 F11[2];
+ UINT64 F12[2];
+ UINT64 F13[2];
+ UINT64 F14[2];
+ UINT64 F15[2];
+ UINT64 F16[2];
+ UINT64 F17[2];
+ UINT64 F18[2];
+ UINT64 F19[2];
+ UINT64 F20[2];
+ UINT64 F21[2];
+ UINT64 F22[2];
+ UINT64 F23[2];
+ UINT64 F24[2];
+ UINT64 F25[2];
+ UINT64 F26[2];
+ UINT64 F27[2];
+ UINT64 F28[2];
+ UINT64 F29[2];
+ UINT64 F30[2];
+ UINT64 F31[2];
+
+ UINT64 Pr;
+
+ UINT64 B0;
+ UINT64 B1;
+ UINT64 B2;
+ UINT64 B3;
+ UINT64 B4;
+ UINT64 B5;
+ UINT64 B6;
+ UINT64 B7;
+
+ //
+ // application registers
+ //
+ UINT64 ArRsc;
+ UINT64 ArBsp;
+ UINT64 ArBspstore;
+ UINT64 ArRnat;
+
+ UINT64 ArFcr;
+
+ UINT64 ArEflag;
+ UINT64 ArCsd;
+ UINT64 ArSsd;
+ UINT64 ArCflg;
+ UINT64 ArFsr;
+ UINT64 ArFir;
+ UINT64 ArFdr;
+
+ UINT64 ArCcv;
+
+ UINT64 ArUnat;
+
+ UINT64 ArFpsr;
+
+ UINT64 ArPfs;
+ UINT64 ArLc;
+ UINT64 ArEc;
+
+ //
+ // control registers
+ //
+ UINT64 CrDcr;
+ UINT64 CrItm;
+ UINT64 CrIva;
+ UINT64 CrPta;
+ UINT64 CrIpsr;
+ UINT64 CrIsr;
+ UINT64 CrIip;
+ UINT64 CrIfa;
+ UINT64 CrItir;
+ UINT64 CrIipa;
+ UINT64 CrIfs;
+ UINT64 CrIim;
+ UINT64 CrIha;
+
+ //
+ // debug registers
+ //
+ UINT64 Dbr0;
+ UINT64 Dbr1;
+ UINT64 Dbr2;
+ UINT64 Dbr3;
+ UINT64 Dbr4;
+ UINT64 Dbr5;
+ UINT64 Dbr6;
+ UINT64 Dbr7;
+
+ UINT64 Ibr0;
+ UINT64 Ibr1;
+ UINT64 Ibr2;
+ UINT64 Ibr3;
+ UINT64 Ibr4;
+ UINT64 Ibr5;
+ UINT64 Ibr6;
+ UINT64 Ibr7;
+
+ //
+ // virtual registers - nat bits for R1-R31
+ //
+ UINT64 IntNat;
+
+} EFI_SYSTEM_CONTEXT_IPF;
+
+///
+/// EBC processor exception types.
+///
+#define EXCEPT_EBC_UNDEFINED 0
+#define EXCEPT_EBC_DIVIDE_ERROR 1
+#define EXCEPT_EBC_DEBUG 2
+#define EXCEPT_EBC_BREAKPOINT 3
+#define EXCEPT_EBC_OVERFLOW 4
+#define EXCEPT_EBC_INVALID_OPCODE 5 ///< Opcode out of range.
+#define EXCEPT_EBC_STACK_FAULT 6
+#define EXCEPT_EBC_ALIGNMENT_CHECK 7
+#define EXCEPT_EBC_INSTRUCTION_ENCODING 8 ///< Malformed instruction.
+#define EXCEPT_EBC_BAD_BREAK 9 ///< BREAK 0 or undefined BREAK.
+#define EXCEPT_EBC_STEP 10 ///< To support debug stepping.
+///
+/// For coding convenience, define the maximum valid EBC exception.
+///
+#define MAX_EBC_EXCEPTION EXCEPT_EBC_STEP
+
+///
+/// EBC processor context definition.
+///
+typedef struct {
+ UINT64 R0;
+ UINT64 R1;
+ UINT64 R2;
+ UINT64 R3;
+ UINT64 R4;
+ UINT64 R5;
+ UINT64 R6;
+ UINT64 R7;
+ UINT64 Flags;
+ UINT64 ControlFlags;
+ UINT64 Ip;
+} EFI_SYSTEM_CONTEXT_EBC;
+
+
+
+///
+/// ARM processor exception types.
+///
+#define EXCEPT_ARM_RESET 0
+#define EXCEPT_ARM_UNDEFINED_INSTRUCTION 1
+#define EXCEPT_ARM_SOFTWARE_INTERRUPT 2
+#define EXCEPT_ARM_PREFETCH_ABORT 3
+#define EXCEPT_ARM_DATA_ABORT 4
+#define EXCEPT_ARM_RESERVED 5
+#define EXCEPT_ARM_IRQ 6
+#define EXCEPT_ARM_FIQ 7
+
+///
+/// For coding convenience, define the maximum valid ARM exception.
+///
+#define MAX_ARM_EXCEPTION EXCEPT_ARM_FIQ
+
+///
+/// ARM processor context definition.
+///
+typedef struct {
+ UINT32 R0;
+ UINT32 R1;
+ UINT32 R2;
+ UINT32 R3;
+ UINT32 R4;
+ UINT32 R5;
+ UINT32 R6;
+ UINT32 R7;
+ UINT32 R8;
+ UINT32 R9;
+ UINT32 R10;
+ UINT32 R11;
+ UINT32 R12;
+ UINT32 SP;
+ UINT32 LR;
+ UINT32 PC;
+ UINT32 CPSR;
+ UINT32 DFSR;
+ UINT32 DFAR;
+ UINT32 IFSR;
+ UINT32 IFAR;
+} EFI_SYSTEM_CONTEXT_ARM;
+
+
+///
+/// AARCH64 processor exception types.
+///
+#define EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS 0
+#define EXCEPT_AARCH64_IRQ 1
+#define EXCEPT_AARCH64_FIQ 2
+#define EXCEPT_AARCH64_SERROR 3
+
+///
+/// For coding convenience, define the maximum valid ARM exception.
+///
+#define MAX_AARCH64_EXCEPTION EXCEPT_AARCH64_SERROR
+
+typedef struct {
+ // General Purpose Registers
+ UINT64 X0;
+ UINT64 X1;
+ UINT64 X2;
+ UINT64 X3;
+ UINT64 X4;
+ UINT64 X5;
+ UINT64 X6;
+ UINT64 X7;
+ UINT64 X8;
+ UINT64 X9;
+ UINT64 X10;
+ UINT64 X11;
+ UINT64 X12;
+ UINT64 X13;
+ UINT64 X14;
+ UINT64 X15;
+ UINT64 X16;
+ UINT64 X17;
+ UINT64 X18;
+ UINT64 X19;
+ UINT64 X20;
+ UINT64 X21;
+ UINT64 X22;
+ UINT64 X23;
+ UINT64 X24;
+ UINT64 X25;
+ UINT64 X26;
+ UINT64 X27;
+ UINT64 X28;
+ UINT64 FP; // x29 - Frame pointer
+ UINT64 LR; // x30 - Link Register
+ UINT64 SP; // x31 - Stack pointer
+
+ // FP/SIMD Registers
+ UINT64 V0[2];
+ UINT64 V1[2];
+ UINT64 V2[2];
+ UINT64 V3[2];
+ UINT64 V4[2];
+ UINT64 V5[2];
+ UINT64 V6[2];
+ UINT64 V7[2];
+ UINT64 V8[2];
+ UINT64 V9[2];
+ UINT64 V10[2];
+ UINT64 V11[2];
+ UINT64 V12[2];
+ UINT64 V13[2];
+ UINT64 V14[2];
+ UINT64 V15[2];
+ UINT64 V16[2];
+ UINT64 V17[2];
+ UINT64 V18[2];
+ UINT64 V19[2];
+ UINT64 V20[2];
+ UINT64 V21[2];
+ UINT64 V22[2];
+ UINT64 V23[2];
+ UINT64 V24[2];
+ UINT64 V25[2];
+ UINT64 V26[2];
+ UINT64 V27[2];
+ UINT64 V28[2];
+ UINT64 V29[2];
+ UINT64 V30[2];
+ UINT64 V31[2];
+
+ UINT64 ELR; // Exception Link Register
+ UINT64 SPSR; // Saved Processor Status Register
+ UINT64 FPSR; // Floating Point Status Register
+ UINT64 ESR; // Exception syndrome register
+ UINT64 FAR; // Fault Address Register
+} EFI_SYSTEM_CONTEXT_AARCH64;
+
+
+///
+/// Universal EFI_SYSTEM_CONTEXT definition.
+///
+typedef union {
+ EFI_SYSTEM_CONTEXT_EBC *SystemContextEbc;
+ EFI_SYSTEM_CONTEXT_IA32 *SystemContextIa32;
+ EFI_SYSTEM_CONTEXT_X64 *SystemContextX64;
+ EFI_SYSTEM_CONTEXT_IPF *SystemContextIpf;
+ EFI_SYSTEM_CONTEXT_ARM *SystemContextArm;
+ EFI_SYSTEM_CONTEXT_AARCH64 *SystemContextAArch64;
+} EFI_SYSTEM_CONTEXT;
+
+//
+// DebugSupport callback function prototypes
+//
+
+/**
+ Registers and enables an exception callback function for the specified exception.
+
+ @param ExceptionType Exception types in EBC, IA-32, x64, or IPF.
+ @param SystemContext Exception content.
+
+**/
+typedef
+VOID
+(EFIAPI *EFI_EXCEPTION_CALLBACK)(
+ IN EFI_EXCEPTION_TYPE ExceptionType,
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext
+ );
+
+/**
+ Registers and enables the on-target debug agent's periodic entry point.
+
+ @param SystemContext Exception content.
+
+**/
+typedef
+VOID
+(EFIAPI *EFI_PERIODIC_CALLBACK)(
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext
+ );
+
+///
+/// Machine type definition
+///
+typedef enum {
+ IsaIa32 = IMAGE_FILE_MACHINE_I386, ///< 0x014C
+ IsaX64 = IMAGE_FILE_MACHINE_X64, ///< 0x8664
+ IsaIpf = IMAGE_FILE_MACHINE_IA64, ///< 0x0200
+ IsaEbc = IMAGE_FILE_MACHINE_EBC, ///< 0x0EBC
+ IsaArm = IMAGE_FILE_MACHINE_ARMTHUMB_MIXED, ///< 0x01c2
+ IsaAArch64 = IMAGE_FILE_MACHINE_ARM64 ///< 0xAA64
+} EFI_INSTRUCTION_SET_ARCHITECTURE;
+
+
+//
+// DebugSupport member function definitions
+//
+
+/**
+ Returns the maximum value that may be used for the ProcessorIndex parameter in
+ RegisterPeriodicCallback() and RegisterExceptionCallback().
+
+ @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.
+ @param MaxProcessorIndex Pointer to a caller-allocated UINTN in which the maximum supported
+ processor index is returned.
+
+ @retval EFI_SUCCESS The function completed successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_GET_MAXIMUM_PROCESSOR_INDEX)(
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
+ OUT UINTN *MaxProcessorIndex
+ );
+
+/**
+ Registers a function to be called back periodically in interrupt context.
+
+ @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.
+ @param ProcessorIndex Specifies which processor the callback function applies to.
+ @param PeriodicCallback A pointer to a function of type PERIODIC_CALLBACK that is the main
+ periodic entry point of the debug agent.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_ALREADY_STARTED Non-NULL PeriodicCallback parameter when a callback
+ function was previously registered.
+ @retval EFI_OUT_OF_RESOURCES System has insufficient memory resources to register new callback
+ function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_REGISTER_PERIODIC_CALLBACK)(
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
+ IN UINTN ProcessorIndex,
+ IN EFI_PERIODIC_CALLBACK PeriodicCallback
+ );
+
+/**
+ Registers a function to be called when a given processor exception occurs.
+
+ @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.
+ @param ProcessorIndex Specifies which processor the callback function applies to.
+ @param ExceptionCallback A pointer to a function of type EXCEPTION_CALLBACK that is called
+ when the processor exception specified by ExceptionType occurs.
+ @param ExceptionType Specifies which processor exception to hook.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_ALREADY_STARTED Non-NULL PeriodicCallback parameter when a callback
+ function was previously registered.
+ @retval EFI_OUT_OF_RESOURCES System has insufficient memory resources to register new callback
+ function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_REGISTER_EXCEPTION_CALLBACK)(
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
+ IN UINTN ProcessorIndex,
+ IN EFI_EXCEPTION_CALLBACK ExceptionCallback,
+ IN EFI_EXCEPTION_TYPE ExceptionType
+ );
+
+/**
+ Invalidates processor instruction cache for a memory range. Subsequent execution in this range
+ causes a fresh memory fetch to retrieve code to be executed.
+
+ @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.
+ @param ProcessorIndex Specifies which processor's instruction cache is to be invalidated.
+ @param Start Specifies the physical base of the memory range to be invalidated.
+ @param Length Specifies the minimum number of bytes in the processor's instruction
+ cache to invalidate.
+
+ @retval EFI_SUCCESS The function completed successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_INVALIDATE_INSTRUCTION_CACHE)(
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
+ IN UINTN ProcessorIndex,
+ IN VOID *Start,
+ IN UINT64 Length
+ );
+
+///
+/// This protocol provides the services to allow the debug agent to register
+/// callback functions that are called either periodically or when specific
+/// processor exceptions occur.
+///
+struct _EFI_DEBUG_SUPPORT_PROTOCOL {
+ ///
+ /// Declares the processor architecture for this instance of the EFI Debug Support protocol.
+ ///
+ EFI_INSTRUCTION_SET_ARCHITECTURE Isa;
+ EFI_GET_MAXIMUM_PROCESSOR_INDEX GetMaximumProcessorIndex;
+ EFI_REGISTER_PERIODIC_CALLBACK RegisterPeriodicCallback;
+ EFI_REGISTER_EXCEPTION_CALLBACK RegisterExceptionCallback;
+ EFI_INVALIDATE_INSTRUCTION_CACHE InvalidateInstructionCache;
+};
+
+extern EFI_GUID gEfiDebugSupportProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Decompress.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Decompress.h
new file mode 100644
index 0000000000..965b7d2f45
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Decompress.h
@@ -0,0 +1,122 @@
+/** @file
+ The Decompress Protocol Interface as defined in UEFI spec
+
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __DECOMPRESS_H__
+#define __DECOMPRESS_H__
+
+#define EFI_DECOMPRESS_PROTOCOL_GUID \
+ { \
+ 0xd8117cfe, 0x94a6, 0x11d4, {0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
+ }
+
+typedef struct _EFI_DECOMPRESS_PROTOCOL EFI_DECOMPRESS_PROTOCOL;
+
+/**
+ The GetInfo() function retrieves the size of the uncompressed buffer
+ and the temporary scratch buffer required to decompress the buffer
+ specified by Source and SourceSize. If the size of the uncompressed
+ buffer or the size of the scratch buffer cannot be determined from
+ the compressed data specified by Source and SourceData, then
+ EFI_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed
+ buffer is returned in DestinationSize, the size of the scratch buffer is
+ returned in ScratchSize, and EFI_SUCCESS is returned.
+
+ The GetInfo() function does not have a scratch buffer available to perform
+ a thorough checking of the validity of the source data. It just retrieves
+ the 'Original Size' field from the beginning bytes of the source data and
+ output it as DestinationSize. And ScratchSize is specific to the decompression
+ implementation.
+
+ @param This A pointer to the EFI_DECOMPRESS_PROTOCOL instance.
+ @param Source The source buffer containing the compressed data.
+ @param SourceSize The size, in bytes, of source buffer.
+ @param DestinationSize A pointer to the size, in bytes, of the uncompressed buffer
+ that will be generated when the compressed buffer specified
+ by Source and SourceSize is decompressed.
+ @param ScratchSize A pointer to the size, in bytes, of the scratch buffer that
+ is required to decompress the compressed buffer specified by
+ Source and SourceSize.
+
+ @retval EFI_SUCCESS The size of the uncompressed data was returned in DestinationSize
+ and the size of the scratch buffer was returned in ScratchSize.
+ @retval EFI_INVALID_PARAMETER The size of the uncompressed data or the size of the scratch
+ buffer cannot be determined from the compressed data specified by
+ Source and SourceData.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DECOMPRESS_GET_INFO)(
+ IN EFI_DECOMPRESS_PROTOCOL *This,
+ IN VOID *Source,
+ IN UINT32 SourceSize,
+ OUT UINT32 *DestinationSize,
+ OUT UINT32 *ScratchSize
+ );
+
+/**
+ The Decompress() function extracts decompressed data to its original form.
+
+ This protocol is designed so that the decompression algorithm can be
+ implemented without using any memory services. As a result, the
+ Decompress() function is not allowed to call AllocatePool() or
+ AllocatePages() in its implementation. It is the caller's responsibility
+ to allocate and free the Destination and Scratch buffers.
+
+ If the compressed source data specified by Source and SourceSize is
+ successfully decompressed into Destination, then EFI_SUCCESS is returned.
+ If the compressed source data specified by Source and SourceSize is not in
+ a valid compressed data format, then EFI_INVALID_PARAMETER is returned.
+
+ @param This A pointer to the EFI_DECOMPRESS_PROTOCOL instance.
+ @param Source The source buffer containing the compressed data.
+ @param SourceSize The size of source data.
+ @param Destination On output, the destination buffer that contains
+ the uncompressed data.
+ @param DestinationSize The size of destination buffer. The size of destination
+ buffer needed is obtained from GetInfo().
+ @param Scratch A temporary scratch buffer that is used to perform the
+ decompression.
+ @param ScratchSize The size of scratch buffer. The size of scratch buffer needed
+ is obtained from GetInfo().
+
+ @retval EFI_SUCCESS Decompression completed successfully, and the uncompressed
+ buffer is returned in Destination.
+ @retval EFI_INVALID_PARAMETER The source buffer specified by Source and SourceSize is
+ corrupted (not in a valid compressed format).
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DECOMPRESS_DECOMPRESS)(
+ IN EFI_DECOMPRESS_PROTOCOL *This,
+ IN VOID *Source,
+ IN UINT32 SourceSize,
+ IN OUT VOID *Destination,
+ IN UINT32 DestinationSize,
+ IN OUT VOID *Scratch,
+ IN UINT32 ScratchSize
+ );
+
+///
+/// Provides a decompression service.
+///
+struct _EFI_DECOMPRESS_PROTOCOL {
+ EFI_DECOMPRESS_GET_INFO GetInfo;
+ EFI_DECOMPRESS_DECOMPRESS Decompress;
+};
+
+extern EFI_GUID gEfiDecompressProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DeferredImageLoad.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DeferredImageLoad.h
new file mode 100644
index 0000000000..4d1bbf0ed4
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DeferredImageLoad.h
@@ -0,0 +1,80 @@
+/** @file
+ UEFI 2.2 Deferred Image Load Protocol definition.
+
+ This protocol returns information about images whose load was denied because of security
+ considerations. This information can be used by the Boot Manager or another agent to reevaluate the
+ images when the current security profile has been changed, such as when the current user profile
+ changes. There can be more than one instance of this protocol installed.
+
+ Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __DEFERRED_IMAGE_LOAD_H__
+#define __DEFERRED_IMAGE_LOAD_H__
+
+///
+/// Global ID for the Deferred Image Load Protocol
+///
+#define EFI_DEFERRED_IMAGE_LOAD_PROTOCOL_GUID \
+ { \
+ 0x15853d7c, 0x3ddf, 0x43e0, { 0xa1, 0xcb, 0xeb, 0xf8, 0x5b, 0x8f, 0x87, 0x2c } \
+ };
+
+typedef struct _EFI_DEFERRED_IMAGE_LOAD_PROTOCOL EFI_DEFERRED_IMAGE_LOAD_PROTOCOL;
+
+/**
+ Returns information about a deferred image.
+
+ This function returns information about a single deferred image. The deferred images are numbered
+ consecutively, starting with 0. If there is no image which corresponds to ImageIndex, then
+ EFI_NOT_FOUND is returned. All deferred images may be returned by iteratively calling this
+ function until EFI_NOT_FOUND is returned.
+ Image may be NULL and ImageSize set to 0 if the decision to defer execution was made because
+ of the location of the executable image rather than its actual contents. record handle until
+ there are no more, at which point UserInfo will point to NULL.
+
+ @param[in] This Points to this instance of the EFI_DEFERRED_IMAGE_LOAD_PROTOCOL.
+ @param[in] ImageIndex Zero-based index of the deferred index.
+ @param[out] ImageDevicePath On return, points to a pointer to the device path of the image.
+ The device path should not be freed by the caller.
+ @param[out] Image On return, points to the first byte of the image or NULL if the
+ image is not available. The image should not be freed by the caller
+ unless LoadImage() has been called successfully.
+ @param[out] ImageSize On return, the size of the image, or 0 if the image is not available.
+ @param[out] BootOption On return, points to TRUE if the image was intended as a boot option
+ or FALSE if it was not intended as a boot option.
+
+ @retval EFI_SUCCESS Image information returned successfully.
+ @retval EFI_NOT_FOUND ImageIndex does not refer to a valid image.
+ @retval EFI_INVALID_PARAMETER ImageDevicePath is NULL or Image is NULL or ImageSize is NULL or
+ BootOption is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DEFERRED_IMAGE_INFO)(
+ IN EFI_DEFERRED_IMAGE_LOAD_PROTOCOL *This,
+ IN UINTN ImageIndex,
+ OUT EFI_DEVICE_PATH_PROTOCOL **ImageDevicePath,
+ OUT VOID **Image,
+ OUT UINTN *ImageSize,
+ OUT BOOLEAN *BootOption
+ );
+
+///
+/// This protocol returns information about a deferred image.
+///
+struct _EFI_DEFERRED_IMAGE_LOAD_PROTOCOL {
+ EFI_DEFERRED_IMAGE_INFO GetImageInfo;
+};
+
+extern EFI_GUID gEfiDeferredImageLoadProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DeviceIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DeviceIo.h
new file mode 100644
index 0000000000..d84a6202ef
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DeviceIo.h
@@ -0,0 +1,268 @@
+/** @file
+ Device IO protocol as defined in the EFI 1.10 specification.
+
+ Device IO is used to abstract hardware access to devices. It includes
+ memory mapped IO, IO, PCI Config space, and DMA.
+
+ Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __DEVICE_IO_H__
+#define __DEVICE_IO_H__
+
+#define EFI_DEVICE_IO_PROTOCOL_GUID \
+ { \
+ 0xaf6ac311, 0x84c3, 0x11d2, {0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+ }
+
+typedef struct _EFI_DEVICE_IO_PROTOCOL EFI_DEVICE_IO_PROTOCOL;
+
+///
+/// Protocol GUID name defined in EFI1.1.
+///
+#define DEVICE_IO_PROTOCOL EFI_DEVICE_IO_PROTOCOL_GUID
+
+///
+/// Protocol defined in EFI1.1.
+///
+typedef EFI_DEVICE_IO_PROTOCOL EFI_DEVICE_IO_INTERFACE;
+
+///
+/// Device IO Access Width
+///
+typedef enum {
+ IO_UINT8 = 0,
+ IO_UINT16 = 1,
+ IO_UINT32 = 2,
+ IO_UINT64 = 3,
+ //
+ // Below enumerations are added in "Extensible Firmware Interface Specification,
+ // Version 1.10, Specification Update, Version 001".
+ //
+ MMIO_COPY_UINT8 = 4,
+ MMIO_COPY_UINT16 = 5,
+ MMIO_COPY_UINT32 = 6,
+ MMIO_COPY_UINT64 = 7
+} EFI_IO_WIDTH;
+
+/**
+ Enables a driver to access device registers in the appropriate memory or I/O space.
+
+ @param This A pointer to the EFI_DEVICE_IO_INTERFACE instance.
+ @param Width Signifies the width of the I/O operations.
+ @param Address The base address of the I/O operations.
+ @param Count The number of I/O operations to perform.
+ @param Buffer For read operations, the destination buffer to store the results. For write
+ operations, the source buffer to write data from. If
+ Width is MMIO_COPY_UINT8, MMIO_COPY_UINT16,
+ MMIO_COPY_UINT32, or MMIO_COPY_UINT64, then
+ Buffer is interpreted as a base address of an I/O operation such as Address.
+
+ @retval EFI_SUCCESS The data was read from or written to the device.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER Width is invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DEVICE_IO)(
+ IN EFI_DEVICE_IO_PROTOCOL *This,
+ IN EFI_IO_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+ );
+
+typedef struct {
+ EFI_DEVICE_IO Read;
+ EFI_DEVICE_IO Write;
+} EFI_IO_ACCESS;
+
+/**
+ Provides an EFI Device Path for a PCI device with the given PCI configuration space address.
+
+ @param This A pointer to the EFI_DEVICE_IO_INTERFACE instance.
+ @param PciAddress The PCI configuration space address of the device whose Device Path
+ is going to be returned.
+ @param PciDevicePath A pointer to the pointer for the EFI Device Path for PciAddress.
+ Memory for the Device Path is allocated from the pool.
+
+ @retval EFI_SUCCESS The PciDevicePath returns a pointer to a valid EFI Device Path.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_UNSUPPORTED The PciAddress does not map to a valid EFI Device Path.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_DEVICE_PATH)(
+ IN EFI_DEVICE_IO_PROTOCOL *This,
+ IN UINT64 PciAddress,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **PciDevicePath
+ );
+
+typedef enum {
+ ///
+ /// A read operation from system memory by a bus master.
+ ///
+ EfiBusMasterRead,
+
+ ///
+ /// A write operation to system memory by a bus master.
+ ///
+ EfiBusMasterWrite,
+
+ ///
+ /// Provides both read and write access to system memory
+ /// by both the processor and a bus master. The buffer is
+ /// coherent from both the processor's and the bus master's
+ /// point of view.
+ ///
+ EfiBusMasterCommonBuffer
+} EFI_IO_OPERATION_TYPE;
+
+/**
+ Provides the device-specific addresses needed to access system memory.
+
+ @param This A pointer to the EFI_DEVICE_IO_INTERFACE instance.
+ @param Operation Indicates if the bus master is going to read or write to system memory.
+ @param HostAddress The system memory address to map to the device.
+ @param NumberOfBytes On input, the number of bytes to map.
+ On output, the number of bytes that were mapped.
+ @param DeviceAddress The resulting map address for the bus master device to use to access the
+ hosts HostAddress.
+ @param Mapping A resulting value to pass to Unmap().
+
+ @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.
+ @retval EFI_INVALID_PARAMETER The Operation or HostAddress is undefined.
+ @retval EFI_DEVICE_ERROR The system hardware could not map the requested address.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IO_MAP)(
+ IN EFI_DEVICE_IO_PROTOCOL *This,
+ IN EFI_IO_OPERATION_TYPE Operation,
+ IN EFI_PHYSICAL_ADDRESS *HostAddress,
+ IN OUT UINTN *NumberOfBytes,
+ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
+ OUT VOID **Mapping
+ );
+
+/**
+ Completes the Map() operation and releases any corresponding resources.
+
+ @param This A pointer to the EFI_DEVICE_IO_INTERFACE instance.
+ @param Mapping A resulting value to pass to Unmap().
+
+ @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
+ @retval EFI_DEVICE_ERROR The system hardware could not map the requested address.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IO_UNMAP)(
+ IN EFI_DEVICE_IO_PROTOCOL *This,
+ IN VOID *Mapping
+ );
+
+/**
+ Allocates pages that are suitable for an EFIBusMasterCommonBuffer mapping.
+
+ @param This A pointer to the EFI_DEVICE_IO_INTERFACE instance.
+ @param Type The type allocation to perform.
+ @param MemoryType The type of memory to allocate, EfiBootServicesData or
+ EfiRuntimeServicesData.
+ @param Pages The number of pages to allocate.
+ @param HostAddress A pointer to store the base address of the allocated range.
+
+ @retval EFI_SUCCESS The requested memory pages were allocated.
+ @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
+ @retval EFI_INVALID_PARAMETER The requested memory type is invalid.
+ @retval EFI_UNSUPPORTED The requested HostAddress is not supported on
+ this platform.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IO_ALLOCATE_BUFFER)(
+ IN EFI_DEVICE_IO_PROTOCOL *This,
+ IN EFI_ALLOCATE_TYPE Type,
+ IN EFI_MEMORY_TYPE MemoryType,
+ IN UINTN Pages,
+ IN OUT EFI_PHYSICAL_ADDRESS *HostAddress
+ );
+
+/**
+ Flushes any posted write data to the device.
+
+ @param This A pointer to the EFI_DEVICE_IO_INTERFACE instance.
+
+ @retval EFI_SUCCESS The buffers were flushed.
+ @retval EFI_DEVICE_ERROR The buffers were not flushed due to a hardware error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IO_FLUSH)(
+ IN EFI_DEVICE_IO_PROTOCOL *This
+ );
+
+/**
+ Frees pages that were allocated with AllocateBuffer().
+
+ @param This A pointer to the EFI_DEVICE_IO_INTERFACE instance.
+ @param Pages The number of pages to free.
+ @param HostAddress The base address of the range to free.
+
+ @retval EFI_SUCCESS The requested memory pages were allocated.
+ @retval EFI_NOT_FOUND The requested memory pages were not allocated with
+ AllocateBuffer().
+ @retval EFI_INVALID_PARAMETER HostAddress is not page aligned or Pages is invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IO_FREE_BUFFER)(
+ IN EFI_DEVICE_IO_PROTOCOL *This,
+ IN UINTN Pages,
+ IN EFI_PHYSICAL_ADDRESS HostAddress
+ );
+
+///
+/// This protocol provides the basic Memory, I/O, and PCI interfaces that
+/// are used to abstract accesses to devices.
+///
+struct _EFI_DEVICE_IO_PROTOCOL {
+ ///
+ /// Allows reads and writes to memory mapped I/O space.
+ ///
+ EFI_IO_ACCESS Mem;
+ ///
+ /// Allows reads and writes to I/O space.
+ ///
+ EFI_IO_ACCESS Io;
+ ///
+ /// Allows reads and writes to PCI configuration space.
+ ///
+ EFI_IO_ACCESS Pci;
+ EFI_IO_MAP Map;
+ EFI_PCI_DEVICE_PATH PciDevicePath;
+ EFI_IO_UNMAP Unmap;
+ EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
+ EFI_IO_FLUSH Flush;
+ EFI_IO_FREE_BUFFER FreeBuffer;
+};
+
+extern EFI_GUID gEfiDeviceIoProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePath.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePath.h
new file mode 100644
index 0000000000..81d47c0627
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePath.h
@@ -0,0 +1,1358 @@
+/** @file
+ The device path protocol as defined in UEFI 2.0.
+
+ The device path represents a programmatic path to a device,
+ from a software point of view. The path must persist from boot to boot, so
+ it can not contain things like PCI bus numbers that change from boot to boot.
+
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_DEVICE_PATH_PROTOCOL_H__
+#define __EFI_DEVICE_PATH_PROTOCOL_H__
+
+#include <Guid/PcAnsi.h>
+#include <IndustryStandard/Bluetooth.h>
+#include <IndustryStandard/Acpi60.h>
+
+///
+/// Device Path protocol.
+///
+#define EFI_DEVICE_PATH_PROTOCOL_GUID \
+ { \
+ 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+ }
+
+///
+/// Device Path guid definition for backward-compatible with EFI1.1.
+///
+#define DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL_GUID
+
+#pragma pack(1)
+
+/**
+ This protocol can be used on any device handle to obtain generic path/location
+ information concerning the physical device or logical device. If the handle does
+ not logically map to a physical device, the handle may not necessarily support
+ the device path protocol. The device path describes the location of the device
+ the handle is for. The size of the Device Path can be determined from the structures
+ that make up the Device Path.
+**/
+typedef struct {
+ UINT8 Type; ///< 0x01 Hardware Device Path.
+ ///< 0x02 ACPI Device Path.
+ ///< 0x03 Messaging Device Path.
+ ///< 0x04 Media Device Path.
+ ///< 0x05 BIOS Boot Specification Device Path.
+ ///< 0x7F End of Hardware Device Path.
+
+ UINT8 SubType; ///< Varies by Type
+ ///< 0xFF End Entire Device Path, or
+ ///< 0x01 End This Instance of a Device Path and start a new
+ ///< Device Path.
+
+ UINT8 Length[2]; ///< Specific Device Path data. Type and Sub-Type define
+ ///< type of data. Size of data is included in Length.
+
+} EFI_DEVICE_PATH_PROTOCOL;
+
+///
+/// Device Path protocol definition for backward-compatible with EFI1.1.
+///
+typedef EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH;
+
+///
+/// Hardware Device Paths.
+///
+#define HARDWARE_DEVICE_PATH 0x01
+
+///
+/// PCI Device Path SubType.
+///
+#define HW_PCI_DP 0x01
+
+///
+/// PCI Device Path.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// PCI Function Number.
+ ///
+ UINT8 Function;
+ ///
+ /// PCI Device Number.
+ ///
+ UINT8 Device;
+} PCI_DEVICE_PATH;
+
+///
+/// PCCARD Device Path SubType.
+///
+#define HW_PCCARD_DP 0x02
+
+///
+/// PCCARD Device Path.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Function Number (0 = First Function).
+ ///
+ UINT8 FunctionNumber;
+} PCCARD_DEVICE_PATH;
+
+///
+/// Memory Mapped Device Path SubType.
+///
+#define HW_MEMMAP_DP 0x03
+
+///
+/// Memory Mapped Device Path.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// EFI_MEMORY_TYPE
+ ///
+ UINT32 MemoryType;
+ ///
+ /// Starting Memory Address.
+ ///
+ EFI_PHYSICAL_ADDRESS StartingAddress;
+ ///
+ /// Ending Memory Address.
+ ///
+ EFI_PHYSICAL_ADDRESS EndingAddress;
+} MEMMAP_DEVICE_PATH;
+
+///
+/// Hardware Vendor Device Path SubType.
+///
+#define HW_VENDOR_DP 0x04
+
+///
+/// The Vendor Device Path allows the creation of vendor-defined Device Paths. A vendor must
+/// allocate a Vendor GUID for a Device Path. The Vendor GUID can then be used to define the
+/// contents on the n bytes that follow in the Vendor Device Path node.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Vendor-assigned GUID that defines the data that follows.
+ ///
+ EFI_GUID Guid;
+ ///
+ /// Vendor-defined variable size data.
+ ///
+} VENDOR_DEVICE_PATH;
+
+///
+/// Controller Device Path SubType.
+///
+#define HW_CONTROLLER_DP 0x05
+
+///
+/// Controller Device Path.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Controller number.
+ ///
+ UINT32 ControllerNumber;
+} CONTROLLER_DEVICE_PATH;
+
+///
+/// BMC Device Path SubType.
+///
+#define HW_BMC_DP 0x06
+
+///
+/// BMC Device Path.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Interface Type.
+ ///
+ UINT8 InterfaceType;
+ ///
+ /// Base Address.
+ ///
+ UINT8 BaseAddress[8];
+} BMC_DEVICE_PATH;
+
+///
+/// ACPI Device Paths.
+///
+#define ACPI_DEVICE_PATH 0x02
+
+///
+/// ACPI Device Path SubType.
+///
+#define ACPI_DP 0x01
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Device's PnP hardware ID stored in a numeric 32-bit
+ /// compressed EISA-type ID. This value must match the
+ /// corresponding _HID in the ACPI name space.
+ ///
+ UINT32 HID;
+ ///
+ /// Unique ID that is required by ACPI if two devices have the
+ /// same _HID. This value must also match the corresponding
+ /// _UID/_HID pair in the ACPI name space. Only the 32-bit
+ /// numeric value type of _UID is supported. Thus, strings must
+ /// not be used for the _UID in the ACPI name space.
+ ///
+ UINT32 UID;
+} ACPI_HID_DEVICE_PATH;
+
+///
+/// Expanded ACPI Device Path SubType.
+///
+#define ACPI_EXTENDED_DP 0x02
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Device's PnP hardware ID stored in a numeric 32-bit
+ /// compressed EISA-type ID. This value must match the
+ /// corresponding _HID in the ACPI name space.
+ ///
+ UINT32 HID;
+ ///
+ /// Unique ID that is required by ACPI if two devices have the
+ /// same _HID. This value must also match the corresponding
+ /// _UID/_HID pair in the ACPI name space.
+ ///
+ UINT32 UID;
+ ///
+ /// Device's compatible PnP hardware ID stored in a numeric
+ /// 32-bit compressed EISA-type ID. This value must match at
+ /// least one of the compatible device IDs returned by the
+ /// corresponding _CID in the ACPI name space.
+ ///
+ UINT32 CID;
+ ///
+ /// Optional variable length _HIDSTR.
+ /// Optional variable length _UIDSTR.
+ /// Optional variable length _CIDSTR.
+ ///
+} ACPI_EXTENDED_HID_DEVICE_PATH;
+
+//
+// EISA ID Macro
+// EISA ID Definition 32-bits
+// bits[15:0] - three character compressed ASCII EISA ID.
+// bits[31:16] - binary number
+// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
+//
+#define PNP_EISA_ID_CONST 0x41d0
+#define EISA_ID(_Name, _Num) ((UINT32)((_Name) | (_Num) << 16))
+#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
+#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
+
+#define PNP_EISA_ID_MASK 0xffff
+#define EISA_ID_TO_NUM(_Id) ((_Id) >> 16)
+
+///
+/// ACPI _ADR Device Path SubType.
+///
+#define ACPI_ADR_DP 0x03
+
+///
+/// The _ADR device path is used to contain video output device attributes to support the Graphics
+/// Output Protocol. The device path can contain multiple _ADR entries if multiple video output
+/// devices are displaying the same output.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// _ADR value. For video output devices the value of this
+ /// field comes from Table B-2 of the ACPI 3.0 specification. At
+ /// least one _ADR value is required.
+ ///
+ UINT32 ADR;
+ //
+ // This device path may optionally contain more than one _ADR entry.
+ //
+} ACPI_ADR_DEVICE_PATH;
+
+#define ACPI_ADR_DISPLAY_TYPE_OTHER 0
+#define ACPI_ADR_DISPLAY_TYPE_VGA 1
+#define ACPI_ADR_DISPLAY_TYPE_TV 2
+#define ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL 3
+#define ACPI_ADR_DISPLAY_TYPE_INTERNAL_DIGITAL 4
+
+#define ACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput, _BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \
+ ((UINT32)( ((UINT32)((_DeviceIdScheme) & 0x1) << 31) | \
+ (((_HeadId) & 0x7) << 18) | \
+ (((_NonVgaOutput) & 0x1) << 17) | \
+ (((_BiosCanDetect) & 0x1) << 16) | \
+ (((_VendorInfo) & 0xf) << 12) | \
+ (((_Type) & 0xf) << 8) | \
+ (((_Port) & 0xf) << 4) | \
+ ((_Index) & 0xf) ))
+
+///
+/// Messaging Device Paths.
+/// This Device Path is used to describe the connection of devices outside the resource domain of the
+/// system. This Device Path can describe physical messaging information like SCSI ID, or abstract
+/// information like networking protocol IP addresses.
+///
+#define MESSAGING_DEVICE_PATH 0x03
+
+///
+/// ATAPI Device Path SubType
+///
+#define MSG_ATAPI_DP 0x01
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Set to zero for primary, or one for secondary.
+ ///
+ UINT8 PrimarySecondary;
+ ///
+ /// Set to zero for master, or one for slave mode.
+ ///
+ UINT8 SlaveMaster;
+ ///
+ /// Logical Unit Number.
+ ///
+ UINT16 Lun;
+} ATAPI_DEVICE_PATH;
+
+///
+/// SCSI Device Path SubType.
+///
+#define MSG_SCSI_DP 0x02
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Target ID on the SCSI bus (PUN).
+ ///
+ UINT16 Pun;
+ ///
+ /// Logical Unit Number (LUN).
+ ///
+ UINT16 Lun;
+} SCSI_DEVICE_PATH;
+
+///
+/// Fibre Channel SubType.
+///
+#define MSG_FIBRECHANNEL_DP 0x03
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Reserved for the future.
+ ///
+ UINT32 Reserved;
+ ///
+ /// Fibre Channel World Wide Number.
+ ///
+ UINT64 WWN;
+ ///
+ /// Fibre Channel Logical Unit Number.
+ ///
+ UINT64 Lun;
+} FIBRECHANNEL_DEVICE_PATH;
+
+///
+/// Fibre Channel Ex SubType.
+///
+#define MSG_FIBRECHANNELEX_DP 0x15
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Reserved for the future.
+ ///
+ UINT32 Reserved;
+ ///
+ /// 8 byte array containing Fibre Channel End Device Port Name.
+ ///
+ UINT8 WWN[8];
+ ///
+ /// 8 byte array containing Fibre Channel Logical Unit Number.
+ ///
+ UINT8 Lun[8];
+} FIBRECHANNELEX_DEVICE_PATH;
+
+///
+/// 1394 Device Path SubType
+///
+#define MSG_1394_DP 0x04
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Reserved for the future.
+ ///
+ UINT32 Reserved;
+ ///
+ /// 1394 Global Unique ID (GUID).
+ ///
+ UINT64 Guid;
+} F1394_DEVICE_PATH;
+
+///
+/// USB Device Path SubType.
+///
+#define MSG_USB_DP 0x05
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// USB Parent Port Number.
+ ///
+ UINT8 ParentPortNumber;
+ ///
+ /// USB Interface Number.
+ ///
+ UINT8 InterfaceNumber;
+} USB_DEVICE_PATH;
+
+///
+/// USB Class Device Path SubType.
+///
+#define MSG_USB_CLASS_DP 0x0f
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Vendor ID assigned by USB-IF. A value of 0xFFFF will
+ /// match any Vendor ID.
+ ///
+ UINT16 VendorId;
+ ///
+ /// Product ID assigned by USB-IF. A value of 0xFFFF will
+ /// match any Product ID.
+ ///
+ UINT16 ProductId;
+ ///
+ /// The class code assigned by the USB-IF. A value of 0xFF
+ /// will match any class code.
+ ///
+ UINT8 DeviceClass;
+ ///
+ /// The subclass code assigned by the USB-IF. A value of
+ /// 0xFF will match any subclass code.
+ ///
+ UINT8 DeviceSubClass;
+ ///
+ /// The protocol code assigned by the USB-IF. A value of
+ /// 0xFF will match any protocol code.
+ ///
+ UINT8 DeviceProtocol;
+} USB_CLASS_DEVICE_PATH;
+
+///
+/// USB WWID Device Path SubType.
+///
+#define MSG_USB_WWID_DP 0x10
+
+///
+/// This device path describes a USB device using its serial number.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// USB interface number.
+ ///
+ UINT16 InterfaceNumber;
+ ///
+ /// USB vendor id of the device.
+ ///
+ UINT16 VendorId;
+ ///
+ /// USB product id of the device.
+ ///
+ UINT16 ProductId;
+ ///
+ /// Last 64-or-fewer UTF-16 characters of the USB
+ /// serial number. The length of the string is
+ /// determined by the Length field less the offset of the
+ /// Serial Number field (10)
+ ///
+ /// CHAR16 SerialNumber[...];
+} USB_WWID_DEVICE_PATH;
+
+///
+/// Device Logical Unit SubType.
+///
+#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Logical Unit Number for the interface.
+ ///
+ UINT8 Lun;
+} DEVICE_LOGICAL_UNIT_DEVICE_PATH;
+
+///
+/// SATA Device Path SubType.
+///
+#define MSG_SATA_DP 0x12
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// The HBA port number that facilitates the connection to the
+ /// device or a port multiplier. The value 0xFFFF is reserved.
+ ///
+ UINT16 HBAPortNumber;
+ ///
+ /// The Port multiplier port number that facilitates the connection
+ /// to the device. Must be set to 0xFFFF if the device is directly
+ /// connected to the HBA.
+ ///
+ UINT16 PortMultiplierPortNumber;
+ ///
+ /// Logical Unit Number.
+ ///
+ UINT16 Lun;
+} SATA_DEVICE_PATH;
+
+///
+/// Flag for if the device is directly connected to the HBA.
+///
+#define SATA_HBA_DIRECT_CONNECT_FLAG 0x8000
+
+///
+/// I2O Device Path SubType.
+///
+#define MSG_I2O_DP 0x06
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Target ID (TID) for a device.
+ ///
+ UINT32 Tid;
+} I2O_DEVICE_PATH;
+
+///
+/// MAC Address Device Path SubType.
+///
+#define MSG_MAC_ADDR_DP 0x0b
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// The MAC address for a network interface padded with 0s.
+ ///
+ EFI_MAC_ADDRESS MacAddress;
+ ///
+ /// Network interface type(i.e. 802.3, FDDI).
+ ///
+ UINT8 IfType;
+} MAC_ADDR_DEVICE_PATH;
+
+///
+/// IPv4 Device Path SubType
+///
+#define MSG_IPv4_DP 0x0c
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// The local IPv4 address.
+ ///
+ EFI_IPv4_ADDRESS LocalIpAddress;
+ ///
+ /// The remote IPv4 address.
+ ///
+ EFI_IPv4_ADDRESS RemoteIpAddress;
+ ///
+ /// The local port number.
+ ///
+ UINT16 LocalPort;
+ ///
+ /// The remote port number.
+ ///
+ UINT16 RemotePort;
+ ///
+ /// The network protocol(i.e. UDP, TCP).
+ ///
+ UINT16 Protocol;
+ ///
+ /// 0x00 - The Source IP Address was assigned though DHCP.
+ /// 0x01 - The Source IP Address is statically bound.
+ ///
+ BOOLEAN StaticIpAddress;
+ ///
+ /// The gateway IP address
+ ///
+ EFI_IPv4_ADDRESS GatewayIpAddress;
+ ///
+ /// The subnet mask
+ ///
+ EFI_IPv4_ADDRESS SubnetMask;
+} IPv4_DEVICE_PATH;
+
+///
+/// IPv6 Device Path SubType.
+///
+#define MSG_IPv6_DP 0x0d
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// The local IPv6 address.
+ ///
+ EFI_IPv6_ADDRESS LocalIpAddress;
+ ///
+ /// The remote IPv6 address.
+ ///
+ EFI_IPv6_ADDRESS RemoteIpAddress;
+ ///
+ /// The local port number.
+ ///
+ UINT16 LocalPort;
+ ///
+ /// The remote port number.
+ ///
+ UINT16 RemotePort;
+ ///
+ /// The network protocol(i.e. UDP, TCP).
+ ///
+ UINT16 Protocol;
+ ///
+ /// 0x00 - The Local IP Address was manually configured.
+ /// 0x01 - The Local IP Address is assigned through IPv6
+ /// stateless auto-configuration.
+ /// 0x02 - The Local IP Address is assigned through IPv6
+ /// stateful configuration.
+ ///
+ UINT8 IpAddressOrigin;
+ ///
+ /// The prefix length
+ ///
+ UINT8 PrefixLength;
+ ///
+ /// The gateway IP address
+ ///
+ EFI_IPv6_ADDRESS GatewayIpAddress;
+} IPv6_DEVICE_PATH;
+
+///
+/// InfiniBand Device Path SubType.
+///
+#define MSG_INFINIBAND_DP 0x09
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Flags to help identify/manage InfiniBand device path elements:
+ /// Bit 0 - IOC/Service (0b = IOC, 1b = Service).
+ /// Bit 1 - Extend Boot Environment.
+ /// Bit 2 - Console Protocol.
+ /// Bit 3 - Storage Protocol.
+ /// Bit 4 - Network Protocol.
+ /// All other bits are reserved.
+ ///
+ UINT32 ResourceFlags;
+ ///
+ /// 128-bit Global Identifier for remote fabric port.
+ ///
+ UINT8 PortGid[16];
+ ///
+ /// 64-bit unique identifier to remote IOC or server process.
+ /// Interpretation of field specified by Resource Flags (bit 0).
+ ///
+ UINT64 ServiceId;
+ ///
+ /// 64-bit persistent ID of remote IOC port.
+ ///
+ UINT64 TargetPortId;
+ ///
+ /// 64-bit persistent ID of remote device.
+ ///
+ UINT64 DeviceId;
+} INFINIBAND_DEVICE_PATH;
+
+#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01
+#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02
+#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04
+#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08
+#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10
+
+///
+/// UART Device Path SubType.
+///
+#define MSG_UART_DP 0x0e
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Reserved.
+ ///
+ UINT32 Reserved;
+ ///
+ /// The baud rate setting for the UART style device. A value of 0
+ /// means that the device's default baud rate will be used.
+ ///
+ UINT64 BaudRate;
+ ///
+ /// The number of data bits for the UART style device. A value
+ /// of 0 means that the device's default number of data bits will be used.
+ ///
+ UINT8 DataBits;
+ ///
+ /// The parity setting for the UART style device.
+ /// Parity 0x00 - Default Parity.
+ /// Parity 0x01 - No Parity.
+ /// Parity 0x02 - Even Parity.
+ /// Parity 0x03 - Odd Parity.
+ /// Parity 0x04 - Mark Parity.
+ /// Parity 0x05 - Space Parity.
+ ///
+ UINT8 Parity;
+ ///
+ /// The number of stop bits for the UART style device.
+ /// Stop Bits 0x00 - Default Stop Bits.
+ /// Stop Bits 0x01 - 1 Stop Bit.
+ /// Stop Bits 0x02 - 1.5 Stop Bits.
+ /// Stop Bits 0x03 - 2 Stop Bits.
+ ///
+ UINT8 StopBits;
+} UART_DEVICE_PATH;
+
+//
+// Use VENDOR_DEVICE_PATH struct
+//
+#define MSG_VENDOR_DP 0x0a
+typedef VENDOR_DEVICE_PATH VENDOR_DEFINED_DEVICE_PATH;
+
+#define DEVICE_PATH_MESSAGING_PC_ANSI EFI_PC_ANSI_GUID
+#define DEVICE_PATH_MESSAGING_VT_100 EFI_VT_100_GUID
+#define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID
+#define DEVICE_PATH_MESSAGING_VT_UTF8 EFI_VT_UTF8_GUID
+
+///
+/// A new device path node is defined to declare flow control characteristics.
+/// UART Flow Control Messaging Device Path
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL GUID.
+ ///
+ EFI_GUID Guid;
+ ///
+ /// Bitmap of supported flow control types.
+ /// Bit 0 set indicates hardware flow control.
+ /// Bit 1 set indicates Xon/Xoff flow control.
+ /// All other bits are reserved and are clear.
+ ///
+ UINT32 FlowControlMap;
+} UART_FLOW_CONTROL_DEVICE_PATH;
+
+#define UART_FLOW_CONTROL_HARDWARE 0x00000001
+#define UART_FLOW_CONTROL_XON_XOFF 0x00000010
+
+#define DEVICE_PATH_MESSAGING_SAS EFI_SAS_DEVICE_PATH_GUID
+///
+/// Serial Attached SCSI (SAS) Device Path.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// DEVICE_PATH_MESSAGING_SAS GUID.
+ ///
+ EFI_GUID Guid;
+ ///
+ /// Reserved for future use.
+ ///
+ UINT32 Reserved;
+ ///
+ /// SAS Address for Serial Attached SCSI Target.
+ ///
+ UINT64 SasAddress;
+ ///
+ /// SAS Logical Unit Number.
+ ///
+ UINT64 Lun;
+ ///
+ /// More Information about the device and its interconnect.
+ ///
+ UINT16 DeviceTopology;
+ ///
+ /// Relative Target Port (RTP).
+ ///
+ UINT16 RelativeTargetPort;
+} SAS_DEVICE_PATH;
+
+///
+/// Serial Attached SCSI (SAS) Ex Device Path SubType
+///
+#define MSG_SASEX_DP 0x16
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// 8-byte array of the SAS Address for Serial Attached SCSI Target Port.
+ ///
+ UINT8 SasAddress[8];
+ ///
+ /// 8-byte array of the SAS Logical Unit Number.
+ ///
+ UINT8 Lun[8];
+ ///
+ /// More Information about the device and its interconnect.
+ ///
+ UINT16 DeviceTopology;
+ ///
+ /// Relative Target Port (RTP).
+ ///
+ UINT16 RelativeTargetPort;
+} SASEX_DEVICE_PATH;
+
+///
+/// NvmExpress Namespace Device Path SubType.
+///
+#define MSG_NVME_NAMESPACE_DP 0x17
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 NamespaceId;
+ UINT64 NamespaceUuid;
+} NVME_NAMESPACE_DEVICE_PATH;
+
+///
+/// DNS Device Path SubType
+///
+#define MSG_DNS_DP 0x1F
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Indicates the DNS server address is IPv4 or IPv6 address.
+ ///
+ UINT8 IsIPv6;
+ ///
+ /// Instance of the DNS server address.
+ ///
+ EFI_IP_ADDRESS DnsServerIp[];
+} DNS_DEVICE_PATH;
+
+///
+/// Uniform Resource Identifiers (URI) Device Path SubType
+///
+#define MSG_URI_DP 0x18
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Instance of the URI pursuant to RFC 3986.
+ ///
+ CHAR8 Uri[];
+} URI_DEVICE_PATH;
+
+///
+/// Universal Flash Storage (UFS) Device Path SubType.
+///
+#define MSG_UFS_DP 0x19
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Target ID on the UFS bus (PUN).
+ ///
+ UINT8 Pun;
+ ///
+ /// Logical Unit Number (LUN).
+ ///
+ UINT8 Lun;
+} UFS_DEVICE_PATH;
+
+///
+/// SD (Secure Digital) Device Path SubType.
+///
+#define MSG_SD_DP 0x1A
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT8 SlotNumber;
+} SD_DEVICE_PATH;
+
+///
+/// EMMC (Embedded MMC) Device Path SubType.
+///
+#define MSG_EMMC_DP 0x1D
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT8 SlotNumber;
+} EMMC_DEVICE_PATH;
+
+///
+/// iSCSI Device Path SubType
+///
+#define MSG_ISCSI_DP 0x13
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Network Protocol (0 = TCP, 1+ = reserved).
+ ///
+ UINT16 NetworkProtocol;
+ ///
+ /// iSCSI Login Options.
+ ///
+ UINT16 LoginOption;
+ ///
+ /// iSCSI Logical Unit Number.
+ ///
+ UINT64 Lun;
+ ///
+ /// iSCSI Target Portal group tag the initiator intends
+ /// to establish a session with.
+ ///
+ UINT16 TargetPortalGroupTag;
+ ///
+ /// iSCSI NodeTarget Name. The length of the name
+ /// is determined by subtracting the offset of this field from Length.
+ ///
+ /// CHAR8 iSCSI Target Name.
+} ISCSI_DEVICE_PATH;
+
+#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST 0x0000
+#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C 0x0002
+#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST 0x0000
+#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C 0x0008
+#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP 0x0000
+#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON 0x1000
+#define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000
+#define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000
+
+///
+/// VLAN Device Path SubType.
+///
+#define MSG_VLAN_DP 0x14
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// VLAN identifier (0-4094).
+ ///
+ UINT16 VlanId;
+} VLAN_DEVICE_PATH;
+
+///
+/// Bluetooth Device Path SubType.
+///
+#define MSG_BLUETOOTH_DP 0x1b
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// 48bit Bluetooth device address.
+ ///
+ BLUETOOTH_ADDRESS BD_ADDR;
+} BLUETOOTH_DEVICE_PATH;
+
+///
+/// Wi-Fi Device Path SubType.
+///
+#define MSG_WIFI_DP 0x1C
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Service set identifier. A 32-byte octets string.
+ ///
+ UINT8 SSId[32];
+} WIFI_DEVICE_PATH;
+
+///
+/// Bluetooth LE Device Path SubType.
+///
+#define MSG_BLUETOOTH_LE_DP 0x1E
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ BLUETOOTH_LE_ADDRESS Address;
+} BLUETOOTH_LE_DEVICE_PATH;
+
+//
+// Media Device Path
+//
+#define MEDIA_DEVICE_PATH 0x04
+
+///
+/// Hard Drive Media Device Path SubType.
+///
+#define MEDIA_HARDDRIVE_DP 0x01
+
+///
+/// The Hard Drive Media Device Path is used to represent a partition on a hard drive.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Describes the entry in a partition table, starting with entry 1.
+ /// Partition number zero represents the entire device. Valid
+ /// partition numbers for a MBR partition are [1, 4]. Valid
+ /// partition numbers for a GPT partition are [1, NumberOfPartitionEntries].
+ ///
+ UINT32 PartitionNumber;
+ ///
+ /// Starting LBA of the partition on the hard drive.
+ ///
+ UINT64 PartitionStart;
+ ///
+ /// Size of the partition in units of Logical Blocks.
+ ///
+ UINT64 PartitionSize;
+ ///
+ /// Signature unique to this partition:
+ /// If SignatureType is 0, this field has to be initialized with 16 zeros.
+ /// If SignatureType is 1, the MBR signature is stored in the first 4 bytes of this field.
+ /// The other 12 bytes are initialized with zeros.
+ /// If SignatureType is 2, this field contains a 16 byte signature.
+ ///
+ UINT8 Signature[16];
+ ///
+ /// Partition Format: (Unused values reserved).
+ /// 0x01 - PC-AT compatible legacy MBR.
+ /// 0x02 - GUID Partition Table.
+ ///
+ UINT8 MBRType;
+ ///
+ /// Type of Disk Signature: (Unused values reserved).
+ /// 0x00 - No Disk Signature.
+ /// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR.
+ /// 0x02 - GUID signature.
+ ///
+ UINT8 SignatureType;
+} HARDDRIVE_DEVICE_PATH;
+
+#define MBR_TYPE_PCAT 0x01
+#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
+
+#define NO_DISK_SIGNATURE 0x00
+#define SIGNATURE_TYPE_MBR 0x01
+#define SIGNATURE_TYPE_GUID 0x02
+
+///
+/// CD-ROM Media Device Path SubType.
+///
+#define MEDIA_CDROM_DP 0x02
+
+///
+/// The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Boot Entry number from the Boot Catalog. The Initial/Default entry is defined as zero.
+ ///
+ UINT32 BootEntry;
+ ///
+ /// Starting RBA of the partition on the medium. CD-ROMs use Relative logical Block Addressing.
+ ///
+ UINT64 PartitionStart;
+ ///
+ /// Size of the partition in units of Blocks, also called Sectors.
+ ///
+ UINT64 PartitionSize;
+} CDROM_DEVICE_PATH;
+
+//
+// Use VENDOR_DEVICE_PATH struct
+//
+#define MEDIA_VENDOR_DP 0x03 ///< Media vendor device path subtype.
+
+///
+/// File Path Media Device Path SubType
+///
+#define MEDIA_FILEPATH_DP 0x04
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// A NULL-terminated Path string including directory and file names.
+ ///
+ CHAR16 PathName[1];
+} FILEPATH_DEVICE_PATH;
+
+#define SIZE_OF_FILEPATH_DEVICE_PATH OFFSET_OF(FILEPATH_DEVICE_PATH,PathName)
+
+///
+/// Media Protocol Device Path SubType.
+///
+#define MEDIA_PROTOCOL_DP 0x05
+
+///
+/// The Media Protocol Device Path is used to denote the protocol that is being
+/// used in a device path at the location of the path specified.
+/// Many protocols are inherent to the style of device path.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// The ID of the protocol.
+ ///
+ EFI_GUID Protocol;
+} MEDIA_PROTOCOL_DEVICE_PATH;
+
+///
+/// PIWG Firmware File SubType.
+///
+#define MEDIA_PIWG_FW_FILE_DP 0x06
+
+///
+/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware file.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Firmware file name
+ ///
+ EFI_GUID FvFileName;
+} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;
+
+///
+/// PIWG Firmware Volume Device Path SubType.
+///
+#define MEDIA_PIWG_FW_VOL_DP 0x07
+
+///
+/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware volume.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Firmware volume name.
+ ///
+ EFI_GUID FvName;
+} MEDIA_FW_VOL_DEVICE_PATH;
+
+///
+/// Media relative offset range device path.
+///
+#define MEDIA_RELATIVE_OFFSET_RANGE_DP 0x08
+
+///
+/// Used to describe the offset range of media relative.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 Reserved;
+ UINT64 StartingOffset;
+ UINT64 EndingOffset;
+} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;
+
+///
+/// This GUID defines a RAM Disk supporting a raw disk format in volatile memory.
+///
+#define EFI_VIRTUAL_DISK_GUID EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE
+
+extern EFI_GUID gEfiVirtualDiskGuid;
+
+///
+/// This GUID defines a RAM Disk supporting an ISO image in volatile memory.
+///
+#define EFI_VIRTUAL_CD_GUID EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE
+
+extern EFI_GUID gEfiVirtualCdGuid;
+
+///
+/// This GUID defines a RAM Disk supporting a raw disk format in persistent memory.
+///
+#define EFI_PERSISTENT_VIRTUAL_DISK_GUID EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT
+
+extern EFI_GUID gEfiPersistentVirtualDiskGuid;
+
+///
+/// This GUID defines a RAM Disk supporting an ISO image in persistent memory.
+///
+#define EFI_PERSISTENT_VIRTUAL_CD_GUID EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT
+
+extern EFI_GUID gEfiPersistentVirtualCdGuid;
+
+///
+/// Media ram disk device path.
+///
+#define MEDIA_RAM_DISK_DP 0x09
+
+///
+/// Used to describe the ram disk device path.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Starting Memory Address.
+ ///
+ UINT32 StartingAddr[2];
+ ///
+ /// Ending Memory Address.
+ ///
+ UINT32 EndingAddr[2];
+ ///
+ /// GUID that defines the type of the RAM Disk.
+ ///
+ EFI_GUID TypeGuid;
+ ///
+ /// RAM Diskinstance number, if supported. The default value is zero.
+ ///
+ UINT16 Instance;
+} MEDIA_RAM_DISK_DEVICE_PATH;
+
+///
+/// BIOS Boot Specification Device Path.
+///
+#define BBS_DEVICE_PATH 0x05
+
+///
+/// BIOS Boot Specification Device Path SubType.
+///
+#define BBS_BBS_DP 0x01
+
+///
+/// This Device Path is used to describe the booting of non-EFI-aware operating systems.
+///
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// Device Type as defined by the BIOS Boot Specification.
+ ///
+ UINT16 DeviceType;
+ ///
+ /// Status Flags as defined by the BIOS Boot Specification.
+ ///
+ UINT16 StatusFlag;
+ ///
+ /// Null-terminated ASCII string that describes the boot device to a user.
+ ///
+ CHAR8 String[1];
+} BBS_BBS_DEVICE_PATH;
+
+//
+// DeviceType definitions - from BBS specification
+//
+#define BBS_TYPE_FLOPPY 0x01
+#define BBS_TYPE_HARDDRIVE 0x02
+#define BBS_TYPE_CDROM 0x03
+#define BBS_TYPE_PCMCIA 0x04
+#define BBS_TYPE_USB 0x05
+#define BBS_TYPE_EMBEDDED_NETWORK 0x06
+#define BBS_TYPE_BEV 0x80
+#define BBS_TYPE_UNKNOWN 0xFF
+
+
+///
+/// Union of all possible Device Paths and pointers to Device Paths.
+///
+typedef union {
+ EFI_DEVICE_PATH_PROTOCOL DevPath;
+ PCI_DEVICE_PATH Pci;
+ PCCARD_DEVICE_PATH PcCard;
+ MEMMAP_DEVICE_PATH MemMap;
+ VENDOR_DEVICE_PATH Vendor;
+
+ CONTROLLER_DEVICE_PATH Controller;
+ BMC_DEVICE_PATH Bmc;
+ ACPI_HID_DEVICE_PATH Acpi;
+ ACPI_EXTENDED_HID_DEVICE_PATH ExtendedAcpi;
+ ACPI_ADR_DEVICE_PATH AcpiAdr;
+
+ ATAPI_DEVICE_PATH Atapi;
+ SCSI_DEVICE_PATH Scsi;
+ ISCSI_DEVICE_PATH Iscsi;
+ FIBRECHANNEL_DEVICE_PATH FibreChannel;
+ FIBRECHANNELEX_DEVICE_PATH FibreChannelEx;
+
+ F1394_DEVICE_PATH F1394;
+ USB_DEVICE_PATH Usb;
+ SATA_DEVICE_PATH Sata;
+ USB_CLASS_DEVICE_PATH UsbClass;
+ USB_WWID_DEVICE_PATH UsbWwid;
+ DEVICE_LOGICAL_UNIT_DEVICE_PATH LogicUnit;
+ I2O_DEVICE_PATH I2O;
+ MAC_ADDR_DEVICE_PATH MacAddr;
+ IPv4_DEVICE_PATH Ipv4;
+ IPv6_DEVICE_PATH Ipv6;
+ VLAN_DEVICE_PATH Vlan;
+ INFINIBAND_DEVICE_PATH InfiniBand;
+ UART_DEVICE_PATH Uart;
+ UART_FLOW_CONTROL_DEVICE_PATH UartFlowControl;
+ SAS_DEVICE_PATH Sas;
+ SASEX_DEVICE_PATH SasEx;
+ NVME_NAMESPACE_DEVICE_PATH NvmeNamespace;
+ DNS_DEVICE_PATH Dns;
+ URI_DEVICE_PATH Uri;
+ BLUETOOTH_DEVICE_PATH Bluetooth;
+ WIFI_DEVICE_PATH WiFi;
+ UFS_DEVICE_PATH Ufs;
+ SD_DEVICE_PATH Sd;
+ EMMC_DEVICE_PATH Emmc;
+ HARDDRIVE_DEVICE_PATH HardDrive;
+ CDROM_DEVICE_PATH CD;
+
+ FILEPATH_DEVICE_PATH FilePath;
+ MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol;
+
+ MEDIA_FW_VOL_DEVICE_PATH FirmwareVolume;
+ MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FirmwareFile;
+ MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH Offset;
+ MEDIA_RAM_DISK_DEVICE_PATH RamDisk;
+ BBS_BBS_DEVICE_PATH Bbs;
+} EFI_DEV_PATH;
+
+
+
+typedef union {
+ EFI_DEVICE_PATH_PROTOCOL *DevPath;
+ PCI_DEVICE_PATH *Pci;
+ PCCARD_DEVICE_PATH *PcCard;
+ MEMMAP_DEVICE_PATH *MemMap;
+ VENDOR_DEVICE_PATH *Vendor;
+
+ CONTROLLER_DEVICE_PATH *Controller;
+ BMC_DEVICE_PATH *Bmc;
+ ACPI_HID_DEVICE_PATH *Acpi;
+ ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;
+ ACPI_ADR_DEVICE_PATH *AcpiAdr;
+
+ ATAPI_DEVICE_PATH *Atapi;
+ SCSI_DEVICE_PATH *Scsi;
+ ISCSI_DEVICE_PATH *Iscsi;
+ FIBRECHANNEL_DEVICE_PATH *FibreChannel;
+ FIBRECHANNELEX_DEVICE_PATH *FibreChannelEx;
+
+ F1394_DEVICE_PATH *F1394;
+ USB_DEVICE_PATH *Usb;
+ SATA_DEVICE_PATH *Sata;
+ USB_CLASS_DEVICE_PATH *UsbClass;
+ USB_WWID_DEVICE_PATH *UsbWwid;
+ DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicUnit;
+ I2O_DEVICE_PATH *I2O;
+ MAC_ADDR_DEVICE_PATH *MacAddr;
+ IPv4_DEVICE_PATH *Ipv4;
+ IPv6_DEVICE_PATH *Ipv6;
+ VLAN_DEVICE_PATH *Vlan;
+ INFINIBAND_DEVICE_PATH *InfiniBand;
+ UART_DEVICE_PATH *Uart;
+ UART_FLOW_CONTROL_DEVICE_PATH *UartFlowControl;
+ SAS_DEVICE_PATH *Sas;
+ SASEX_DEVICE_PATH *SasEx;
+ NVME_NAMESPACE_DEVICE_PATH *NvmeNamespace;
+ DNS_DEVICE_PATH *Dns;
+ URI_DEVICE_PATH *Uri;
+ BLUETOOTH_DEVICE_PATH *Bluetooth;
+ WIFI_DEVICE_PATH *WiFi;
+ UFS_DEVICE_PATH *Ufs;
+ SD_DEVICE_PATH *Sd;
+ EMMC_DEVICE_PATH *Emmc;
+ HARDDRIVE_DEVICE_PATH *HardDrive;
+ CDROM_DEVICE_PATH *CD;
+
+ FILEPATH_DEVICE_PATH *FilePath;
+ MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol;
+
+ MEDIA_FW_VOL_DEVICE_PATH *FirmwareVolume;
+ MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FirmwareFile;
+ MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;
+ MEDIA_RAM_DISK_DEVICE_PATH *RamDisk;
+ BBS_BBS_DEVICE_PATH *Bbs;
+ UINT8 *Raw;
+} EFI_DEV_PATH_PTR;
+
+#pragma pack()
+
+#define END_DEVICE_PATH_TYPE 0x7f
+#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF
+#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01
+
+extern EFI_GUID gEfiDevicePathProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePathFromText.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePathFromText.h
new file mode 100644
index 0000000000..cbdbc466dc
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePathFromText.h
@@ -0,0 +1,72 @@
+/** @file
+ EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL as defined in UEFI 2.0.
+ This protocol provides service to convert text to device paths and device nodes.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __DEVICE_PATH_FROM_TEXT_PROTOCOL_H__
+#define __DEVICE_PATH_FROM_TEXT_PROTOCOL_H__
+
+///
+/// Device Path From Text protocol
+///
+#define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \
+ { \
+ 0x5c99a21, 0xc70f, 0x4ad2, {0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e } \
+ }
+
+/**
+ Convert text to the binary representation of a device node.
+
+ @param TextDeviceNode TextDeviceNode points to the text representation of a device
+ node. Conversion starts with the first character and continues
+ until the first non-device node character.
+
+ @retval a_pointer Pointer to the EFI device node.
+ @retval NULL if TextDeviceNode is NULL or there was insufficient memory.
+
+**/
+typedef
+EFI_DEVICE_PATH_PROTOCOL*
+(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE)(
+ IN CONST CHAR16 *TextDeviceNode
+ );
+
+
+/**
+ Convert text to the binary representation of a device node.
+
+ @param TextDeviceNode TextDevicePath points to the text representation of a device
+ path. Conversion starts with the first character and continues
+ until the first non-device path character.
+
+ @retval a_pointer Pointer to the allocated device path.
+ @retval NULL if TextDeviceNode is NULL or there was insufficient memory.
+
+**/
+typedef
+EFI_DEVICE_PATH_PROTOCOL*
+(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH)(
+ IN CONST CHAR16 *TextDevicePath
+ );
+
+///
+/// This protocol converts text to device paths and device nodes.
+///
+typedef struct {
+ EFI_DEVICE_PATH_FROM_TEXT_NODE ConvertTextToDeviceNode;
+ EFI_DEVICE_PATH_FROM_TEXT_PATH ConvertTextToDevicePath;
+} EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;
+
+extern EFI_GUID gEfiDevicePathFromTextProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePathToText.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePathToText.h
new file mode 100644
index 0000000000..923ee64840
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePathToText.h
@@ -0,0 +1,85 @@
+/** @file
+ EFI_DEVICE_PATH_TO_TEXT_PROTOCOL as defined in UEFI 2.0.
+ This protocol provides service to convert device nodes and paths to text.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __DEVICE_PATH_TO_TEXT_PROTOCOL_H__
+#define __DEVICE_PATH_TO_TEXT_PROTOCOL_H__
+
+///
+/// Device Path To Text protocol
+///
+#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \
+ { \
+ 0x8b843e20, 0x8132, 0x4852, {0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } \
+ }
+
+/**
+ Convert a device node to its text representation.
+
+ @param DeviceNode Points to the device node to be converted.
+ @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
+ of the display node is used, where applicable. If DisplayOnly
+ is FALSE, then the longer text representation of the display node
+ is used.
+ @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
+ representation for a device node can be used, where applicable.
+
+ @retval a_pointer a pointer to the allocated text representation of the device node data
+ @retval NULL if DeviceNode is NULL or there was insufficient memory.
+
+**/
+typedef
+CHAR16*
+(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode,
+ IN BOOLEAN DisplayOnly,
+ IN BOOLEAN AllowShortcuts
+ );
+
+/**
+ Convert a device path to its text representation.
+
+ @param DevicePath Points to the device path to be converted.
+ @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
+ of the display node is used, where applicable. If DisplayOnly
+ is FALSE, then the longer text representation of the display node
+ is used.
+ @param AllowShortcuts The AllowShortcuts is FALSE, then the shortcut forms of
+ text representation for a device node cannot be used.
+
+ @retval a_pointer a pointer to the allocated text representation of the device node.
+ @retval NULL if DevicePath is NULL or there was insufficient memory.
+
+**/
+typedef
+CHAR16*
+(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN BOOLEAN DisplayOnly,
+ IN BOOLEAN AllowShortcuts
+ );
+
+///
+/// This protocol converts device paths and device nodes to text.
+///
+typedef struct {
+ EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText;
+ EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText;
+} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;
+
+extern EFI_GUID gEfiDevicePathToTextProtocolGuid;
+
+#endif
+
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePathUtilities.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePathUtilities.h
new file mode 100644
index 0000000000..35fd624f2c
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DevicePathUtilities.h
@@ -0,0 +1,192 @@
+/** @file
+ EFI_DEVICE_PATH_UTILITIES_PROTOCOL as defined in UEFI 2.0.
+ Use to create and manipulate device paths and device nodes.
+
+ Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __DEVICE_PATH_UTILITIES_PROTOCOL_H__
+#define __DEVICE_PATH_UTILITIES_PROTOCOL_H__
+
+///
+/// Device Path Utilities protocol
+///
+#define EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \
+ { \
+ 0x379be4e, 0xd706, 0x437d, {0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } \
+ }
+
+/**
+ Returns the size of the device path, in bytes.
+
+ @param DevicePath Points to the start of the EFI device path.
+
+ @return Size Size of the specified device path, in bytes, including the end-of-path tag.
+ @retval 0 DevicePath is NULL
+
+**/
+typedef
+UINTN
+(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ );
+
+
+/**
+ Create a duplicate of the specified path.
+
+ @param DevicePath Points to the source EFI device path.
+
+ @retval Pointer A pointer to the duplicate device path.
+ @retval NULL insufficient memory or DevicePath is NULL
+
+**/
+typedef
+EFI_DEVICE_PATH_PROTOCOL*
+(EFIAPI *EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ );
+
+/**
+ Create a new path by appending the second device path to the first.
+ If Src1 is NULL and Src2 is non-NULL, then a duplicate of Src2 is returned.
+ If Src1 is non-NULL and Src2 is NULL, then a duplicate of Src1 is returned.
+ If Src1 and Src2 are both NULL, then a copy of an end-of-device-path is returned.
+
+ @param Src1 Points to the first device path.
+ @param Src2 Points to the second device path.
+
+ @retval Pointer A pointer to the newly created device path.
+ @retval NULL Memory could not be allocated
+
+**/
+typedef
+EFI_DEVICE_PATH_PROTOCOL*
+(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_PATH)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2
+ );
+
+/**
+ Creates a new path by appending the device node to the device path.
+ If DeviceNode is NULL then a copy of DevicePath is returned.
+ If DevicePath is NULL then a copy of DeviceNode, followed by an end-of-device path device node is returned.
+ If both DeviceNode and DevicePath are NULL then a copy of an end-of-device-path device node is returned.
+
+ @param DevicePath Points to the device path.
+ @param DeviceNode Points to the device node.
+
+ @retval Pointer A pointer to the allocated device node.
+ @retval NULL There was insufficient memory.
+
+**/
+typedef
+EFI_DEVICE_PATH_PROTOCOL*
+(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_NODE)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode
+ );
+
+/**
+ Creates a new path by appending the specified device path instance to the specified device path.
+
+ @param DevicePath Points to the device path. If NULL, then ignored.
+ @param DevicePathInstance Points to the device path instance.
+
+ @retval Pointer A pointer to the newly created device path
+ @retval NULL Memory could not be allocated or DevicePathInstance is NULL.
+
+**/
+typedef
+EFI_DEVICE_PATH_PROTOCOL*
+(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
+ );
+
+/**
+ Creates a copy of the current device path instance and returns a pointer to the next device path
+ instance.
+
+ @param DevicePathInstance On input, this holds the pointer to the current device path
+ instance. On output, this holds the pointer to the next
+ device path instance or NULL if there are no more device
+ path instances in the device path.
+ @param DevicePathInstanceSize On output, this holds the size of the device path instance,
+ in bytes or zero, if DevicePathInstance is NULL.
+ If NULL, then the instance size is not output.
+
+ @retval Pointer A pointer to the copy of the current device path instance.
+ @retval NULL DevicePathInstace was NULL on entry or there was insufficient memory.
+
+**/
+typedef
+EFI_DEVICE_PATH_PROTOCOL*
+(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE)(
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance,
+ OUT UINTN *DevicePathInstanceSize
+ );
+
+/**
+ Creates a device node
+
+ @param NodeType NodeType is the device node type (EFI_DEVICE_PATH.Type) for
+ the new device node.
+ @param NodeSubType NodeSubType is the device node sub-type
+ EFI_DEVICE_PATH.SubType) for the new device node.
+ @param NodeLength NodeLength is the length of the device node
+ (EFI_DEVICE_PATH.Length) for the new device node.
+
+ @retval Pointer A pointer to the newly created device node.
+ @retval NULL NodeLength is less than
+ the size of the header or there was insufficient memory.
+
+**/
+typedef
+EFI_DEVICE_PATH_PROTOCOL*
+(EFIAPI *EFI_DEVICE_PATH_UTILS_CREATE_NODE)(
+ IN UINT8 NodeType,
+ IN UINT8 NodeSubType,
+ IN UINT16 NodeLength
+);
+
+/**
+ Returns whether a device path is multi-instance.
+
+ @param DevicePath Points to the device path. If NULL, then ignored.
+
+ @retval TRUE The device path has more than one instance
+ @retval FALSE The device path is empty or contains only a single instance.
+
+**/
+typedef
+BOOLEAN
+(EFIAPI *EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ );
+
+///
+/// This protocol is used to creates and manipulates device paths and device nodes.
+///
+typedef struct {
+ EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize;
+ EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH DuplicateDevicePath;
+ EFI_DEVICE_PATH_UTILS_APPEND_PATH AppendDevicePath;
+ EFI_DEVICE_PATH_UTILS_APPEND_NODE AppendDeviceNode;
+ EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE AppendDevicePathInstance;
+ EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE GetNextDevicePathInstance;
+ EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE IsDevicePathMultiInstance;
+ EFI_DEVICE_PATH_UTILS_CREATE_NODE CreateDeviceNode;
+} EFI_DEVICE_PATH_UTILITIES_PROTOCOL;
+
+extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dhcp4.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dhcp4.h
new file mode 100644
index 0000000000..5dcd47c76b
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dhcp4.h
@@ -0,0 +1,780 @@
+/** @file
+ EFI_DHCP4_PROTOCOL as defined in UEFI 2.0.
+ EFI_DHCP4_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.
+ These protocols are used to collect configuration information for the EFI IPv4 Protocol
+ drivers and to provide DHCPv4 server and PXE boot server discovery services.
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI Specification 2.0.
+
+**/
+
+#ifndef __EFI_DHCP4_PROTOCOL_H__
+#define __EFI_DHCP4_PROTOCOL_H__
+
+#define EFI_DHCP4_PROTOCOL_GUID \
+ { \
+ 0x8a219718, 0x4ef5, 0x4761, {0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56 } \
+ }
+
+#define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0x9d9a39d8, 0xbd42, 0x4a73, {0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80 } \
+ }
+
+typedef struct _EFI_DHCP4_PROTOCOL EFI_DHCP4_PROTOCOL;
+
+
+#pragma pack(1)
+typedef struct {
+ ///
+ /// DHCP option code.
+ ///
+ UINT8 OpCode;
+ ///
+ /// Length of the DHCP option data. Not present if OpCode is 0 or 255.
+ ///
+ UINT8 Length;
+ ///
+ /// Start of the DHCP option data. Not present if OpCode is 0 or 255 or if Length is zero.
+ ///
+ UINT8 Data[1];
+} EFI_DHCP4_PACKET_OPTION;
+#pragma pack()
+
+
+#pragma pack(1)
+///
+/// EFI_DHCP4_PACKET defines the format of DHCPv4 packets. See RFC 2131 for more information.
+///
+typedef struct {
+ UINT8 OpCode;
+ UINT8 HwType;
+ UINT8 HwAddrLen;
+ UINT8 Hops;
+ UINT32 Xid;
+ UINT16 Seconds;
+ UINT16 Reserved;
+ EFI_IPv4_ADDRESS ClientAddr; ///< Client IP address from client.
+ EFI_IPv4_ADDRESS YourAddr; ///< Client IP address from server.
+ EFI_IPv4_ADDRESS ServerAddr; ///< IP address of next server in bootstrap.
+ EFI_IPv4_ADDRESS GatewayAddr; ///< Relay agent IP address.
+ UINT8 ClientHwAddr[16]; ///< Client hardware address.
+ CHAR8 ServerName[64];
+ CHAR8 BootFileName[128];
+}EFI_DHCP4_HEADER;
+#pragma pack()
+
+
+#pragma pack(1)
+typedef struct {
+ ///
+ /// Size of the EFI_DHCP4_PACKET buffer.
+ ///
+ UINT32 Size;
+ ///
+ /// Length of the EFI_DHCP4_PACKET from the first byte of the Header field
+ /// to the last byte of the Option[] field.
+ ///
+ UINT32 Length;
+
+ struct {
+ ///
+ /// DHCP packet header.
+ ///
+ EFI_DHCP4_HEADER Header;
+ ///
+ /// DHCP magik cookie in network byte order.
+ ///
+ UINT32 Magik;
+ ///
+ /// Start of the DHCP packed option data.
+ ///
+ UINT8 Option[1];
+ } Dhcp4;
+} EFI_DHCP4_PACKET;
+#pragma pack()
+
+
+typedef enum {
+ ///
+ /// The EFI DHCPv4 Protocol driver is stopped.
+ ///
+ Dhcp4Stopped = 0x0,
+ ///
+ /// The EFI DHCPv4 Protocol driver is inactive.
+ ///
+ Dhcp4Init = 0x1,
+ ///
+ /// The EFI DHCPv4 Protocol driver is collecting DHCP offer packets from DHCP servers.
+ ///
+ Dhcp4Selecting = 0x2,
+ ///
+ /// The EFI DHCPv4 Protocol driver has sent the request to the DHCP server and is waiting for a response.
+ ///
+ Dhcp4Requesting = 0x3,
+ ///
+ /// The DHCP configuration has completed.
+ ///
+ Dhcp4Bound = 0x4,
+ ///
+ /// The DHCP configuration is being renewed and another request has
+ /// been sent out, but it has not received a response from the server yet.
+ ///
+ Dhcp4Renewing = 0x5,
+ ///
+ /// The DHCP configuration has timed out and the EFI DHCPv4
+ /// Protocol driver is trying to extend the lease time.
+ ///
+ Dhcp4Rebinding = 0x6,
+ ///
+ /// The EFI DHCPv4 Protocol driver was initialized with a previously
+ /// allocated or known IP address.
+ ///
+ Dhcp4InitReboot = 0x7,
+ ///
+ /// The EFI DHCPv4 Protocol driver is seeking to reuse the previously
+ /// allocated IP address by sending a request to the DHCP server.
+ ///
+ Dhcp4Rebooting = 0x8
+} EFI_DHCP4_STATE;
+
+
+typedef enum{
+ ///
+ /// The packet to start the configuration sequence is about to be sent.
+ ///
+ Dhcp4SendDiscover = 0x01,
+ ///
+ /// A reply packet was just received.
+ ///
+ Dhcp4RcvdOffer = 0x02,
+ ///
+ /// It is time for Dhcp4Callback to select an offer.
+ ///
+ Dhcp4SelectOffer = 0x03,
+ ///
+ /// A request packet is about to be sent.
+ ///
+ Dhcp4SendRequest = 0x04,
+ ///
+ /// A DHCPACK packet was received and will be passed to Dhcp4Callback.
+ ///
+ Dhcp4RcvdAck = 0x05,
+ ///
+ /// A DHCPNAK packet was received and will be passed to Dhcp4Callback.
+ ///
+ Dhcp4RcvdNak = 0x06,
+ ///
+ /// A decline packet is about to be sent.
+ ///
+ Dhcp4SendDecline = 0x07,
+ ///
+ /// The DHCP configuration process has completed. No packet is associated with this event.
+ ///
+ Dhcp4BoundCompleted = 0x08,
+ ///
+ /// It is time to enter the Dhcp4Renewing state and to contact the server
+ /// that originally issued the network address. No packet is associated with this event.
+ ///
+ Dhcp4EnterRenewing = 0x09,
+ ///
+ /// It is time to enter the Dhcp4Rebinding state and to contact any server.
+ /// No packet is associated with this event.
+ ///
+ Dhcp4EnterRebinding = 0x0a,
+ ///
+ /// The configured IP address was lost either because the lease has expired,
+ /// the user released the configuration, or a DHCPNAK packet was received in
+ /// the Dhcp4Renewing or Dhcp4Rebinding state. No packet is associated with this event.
+ ///
+ Dhcp4AddressLost = 0x0b,
+ ///
+ /// The DHCP process failed because a DHCPNAK packet was received or the user
+ /// aborted the DHCP process at a time when the configuration was not available yet.
+ /// No packet is associated with this event.
+ ///
+ Dhcp4Fail = 0x0c
+} EFI_DHCP4_EVENT;
+
+/**
+ Callback routine.
+
+ EFI_DHCP4_CALLBACK is provided by the consumer of the EFI DHCPv4 Protocol driver
+ to intercept events that occurred in the configuration process. This structure
+ provides advanced control of each state transition of the DHCP process. The
+ returned status code determines the behavior of the EFI DHCPv4 Protocol driver.
+ There are three possible returned values, which are described in the following
+ table.
+
+ @param This The pointer to the EFI DHCPv4 Protocol instance that is used to
+ configure this callback function.
+ @param Context The pointer to the context that is initialized by
+ EFI_DHCP4_PROTOCOL.Configure().
+ @param CurrentState The current operational state of the EFI DHCPv4 Protocol
+ driver.
+ @param Dhcp4Event The event that occurs in the current state, which usually means a
+ state transition.
+ @param Packet The DHCP packet that is going to be sent or already received.
+ @param NewPacket The packet that is used to replace the above Packet.
+
+ @retval EFI_SUCCESS Tells the EFI DHCPv4 Protocol driver to continue the DHCP process.
+ When it is in the Dhcp4Selecting state, it tells the EFI DHCPv4 Protocol
+ driver to stop collecting additional packets. The driver will exit
+ the Dhcp4Selecting state and enter the Dhcp4Requesting state.
+ @retval EFI_NOT_READY Only used in the Dhcp4Selecting state. The EFI DHCPv4 Protocol
+ driver will continue to wait for more packets until the retry
+ timeout expires.
+ @retval EFI_ABORTED Tells the EFI DHCPv4 Protocol driver to abort the current process and
+ return to the Dhcp4Init or Dhcp4InitReboot state.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP4_CALLBACK)(
+ IN EFI_DHCP4_PROTOCOL *This,
+ IN VOID *Context,
+ IN EFI_DHCP4_STATE CurrentState,
+ IN EFI_DHCP4_EVENT Dhcp4Event,
+ IN EFI_DHCP4_PACKET *Packet OPTIONAL,
+ OUT EFI_DHCP4_PACKET **NewPacket OPTIONAL
+ );
+
+typedef struct {
+ ///
+ /// The number of times to try sending a packet during the Dhcp4SendDiscover
+ /// event and waiting for a response during the Dhcp4RcvdOffer event.
+ /// Set to zero to use the default try counts and timeout values.
+ ///
+ UINT32 DiscoverTryCount;
+ ///
+ /// The maximum amount of time (in seconds) to wait for returned packets in each
+ /// of the retries. Timeout values of zero will default to a timeout value
+ /// of one second. Set to NULL to use default timeout values.
+ ///
+ UINT32 *DiscoverTimeout;
+ ///
+ /// The number of times to try sending a packet during the Dhcp4SendRequest event
+ /// and waiting for a response during the Dhcp4RcvdAck event before accepting
+ /// failure. Set to zero to use the default try counts and timeout values.
+ ///
+ UINT32 RequestTryCount;
+ ///
+ /// The maximum amount of time (in seconds) to wait for return packets in each of the retries.
+ /// Timeout values of zero will default to a timeout value of one second.
+ /// Set to NULL to use default timeout values.
+ ///
+ UINT32 *RequestTimeout;
+ ///
+ /// For a DHCPDISCOVER, setting this parameter to the previously allocated IP
+ /// address will cause the EFI DHCPv4 Protocol driver to enter the Dhcp4InitReboot state.
+ /// And set this field to 0.0.0.0 to enter the Dhcp4Init state.
+ /// For a DHCPINFORM this parameter should be set to the client network address
+ /// which was assigned to the client during a DHCPDISCOVER.
+ ///
+ EFI_IPv4_ADDRESS ClientAddress;
+ ///
+ /// The callback function to intercept various events that occurred in
+ /// the DHCP configuration process. Set to NULL to ignore all those events.
+ ///
+ EFI_DHCP4_CALLBACK Dhcp4Callback;
+ ///
+ /// The pointer to the context that will be passed to Dhcp4Callback when it is called.
+ ///
+ VOID *CallbackContext;
+ ///
+ /// Number of DHCP options in the OptionList.
+ ///
+ UINT32 OptionCount;
+ ///
+ /// List of DHCP options to be included in every packet that is sent during the
+ /// Dhcp4SendDiscover event. Pad options are appended automatically by DHCP driver
+ /// in outgoing DHCP packets. If OptionList itself contains pad option, they are
+ /// ignored by the driver. OptionList can be freed after EFI_DHCP4_PROTOCOL.Configure()
+ /// returns. Ignored if OptionCount is zero.
+ ///
+ EFI_DHCP4_PACKET_OPTION **OptionList;
+} EFI_DHCP4_CONFIG_DATA;
+
+
+typedef struct {
+ ///
+ /// The EFI DHCPv4 Protocol driver operating state.
+ ///
+ EFI_DHCP4_STATE State;
+ ///
+ /// The configuration data of the current EFI DHCPv4 Protocol driver instance.
+ ///
+ EFI_DHCP4_CONFIG_DATA ConfigData;
+ ///
+ /// The client IP address that was acquired from the DHCP server. If it is zero,
+ /// the DHCP acquisition has not completed yet and the following fields in this structure are undefined.
+ ///
+ EFI_IPv4_ADDRESS ClientAddress;
+ ///
+ /// The local hardware address.
+ ///
+ EFI_MAC_ADDRESS ClientMacAddress;
+ ///
+ /// The server IP address that is providing the DHCP service to this client.
+ ///
+ EFI_IPv4_ADDRESS ServerAddress;
+ ///
+ /// The router IP address that was acquired from the DHCP server.
+ /// May be zero if the server does not offer this address.
+ ///
+ EFI_IPv4_ADDRESS RouterAddress;
+ ///
+ /// The subnet mask of the connected network that was acquired from the DHCP server.
+ ///
+ EFI_IPv4_ADDRESS SubnetMask;
+ ///
+ /// The lease time (in 1-second units) of the configured IP address.
+ /// The value 0xFFFFFFFF means that the lease time is infinite.
+ /// A default lease of 7 days is used if the DHCP server does not provide a value.
+ ///
+ UINT32 LeaseTime;
+ ///
+ /// The cached latest DHCPACK or DHCPNAK or BOOTP REPLY packet. May be NULL if no packet is cached.
+ ///
+ EFI_DHCP4_PACKET *ReplyPacket;
+} EFI_DHCP4_MODE_DATA;
+
+
+typedef struct {
+ ///
+ /// Alternate listening address. It can be a unicast, multicast, or broadcast address.
+ ///
+ EFI_IPv4_ADDRESS ListenAddress;
+ ///
+ /// The subnet mask of above listening unicast/broadcast IP address.
+ /// Ignored if ListenAddress is a multicast address.
+ ///
+ EFI_IPv4_ADDRESS SubnetMask;
+ ///
+ /// Alternate station source (or listening) port number.
+ /// If zero, then the default station port number (68) will be used.
+ ///
+ UINT16 ListenPort;
+} EFI_DHCP4_LISTEN_POINT;
+
+
+typedef struct {
+ ///
+ /// The completion status of transmitting and receiving.
+ ///
+ EFI_STATUS Status;
+ ///
+ /// If not NULL, the event that will be signaled when the collection process
+ /// completes. If NULL, this function will busy-wait until the collection process competes.
+ ///
+ EFI_EVENT CompletionEvent;
+ ///
+ /// The pointer to the server IP address. This address may be a unicast, multicast, or broadcast address.
+ ///
+ EFI_IPv4_ADDRESS RemoteAddress;
+ ///
+ /// The server listening port number. If zero, the default server listening port number (67) will be used.
+ ///
+ UINT16 RemotePort;
+ ///
+ /// The pointer to the gateway address to override the existing setting.
+ ///
+ EFI_IPv4_ADDRESS GatewayAddress;
+ ///
+ /// The number of entries in ListenPoints. If zero, the default station address and port number 68 are used.
+ ///
+ UINT32 ListenPointCount;
+ ///
+ /// An array of station address and port number pairs that are used as receiving filters.
+ /// The first entry is also used as the source address and source port of the outgoing packet.
+ ///
+ EFI_DHCP4_LISTEN_POINT *ListenPoints;
+ ///
+ /// The number of seconds to collect responses. Zero is invalid.
+ ///
+ UINT32 TimeoutValue;
+ ///
+ /// The pointer to the packet to be transmitted.
+ ///
+ EFI_DHCP4_PACKET *Packet;
+ ///
+ /// Number of received packets.
+ ///
+ UINT32 ResponseCount;
+ ///
+ /// The pointer to the allocated list of received packets.
+ ///
+ EFI_DHCP4_PACKET *ResponseList;
+} EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN;
+
+
+/**
+ Returns the current operating mode and cached data packet for the EFI DHCPv4 Protocol driver.
+
+ The GetModeData() function returns the current operating mode and cached data
+ packet for the EFI DHCPv4 Protocol driver.
+
+ @param This The pointer to the EFI_DHCP4_PROTOCOL instance.
+ @param Dhcp4ModeData The pointer to storage for the EFI_DHCP4_MODE_DATA structure.
+
+ @retval EFI_SUCCESS The mode data was returned.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP4_GET_MODE_DATA)(
+ IN EFI_DHCP4_PROTOCOL *This,
+ OUT EFI_DHCP4_MODE_DATA *Dhcp4ModeData
+ );
+
+/**
+ Initializes, changes, or resets the operational settings for the EFI DHCPv4 Protocol driver.
+
+ The Configure() function is used to initialize, change, or reset the operational
+ settings of the EFI DHCPv4 Protocol driver for the communication device on which
+ the EFI DHCPv4 Service Binding Protocol is installed. This function can be
+ successfully called only if both of the following are true:
+ * This instance of the EFI DHCPv4 Protocol driver is in the Dhcp4Stopped, Dhcp4Init,
+ Dhcp4InitReboot, or Dhcp4Bound states.
+ * No other EFI DHCPv4 Protocol driver instance that is controlled by this EFI
+ DHCPv4 Service Binding Protocol driver instance has configured this EFI DHCPv4
+ Protocol driver.
+ When this driver is in the Dhcp4Stopped state, it can transfer into one of the
+ following two possible initial states:
+ * Dhcp4Init
+ * Dhcp4InitReboot.
+ The driver can transfer into these states by calling Configure() with a non-NULL
+ Dhcp4CfgData. The driver will transfer into the appropriate state based on the
+ supplied client network address in the ClientAddress parameter and DHCP options
+ in the OptionList parameter as described in RFC 2131.
+ When Configure() is called successfully while Dhcp4CfgData is set to NULL, the
+ default configuring data will be reset in the EFI DHCPv4 Protocol driver and
+ the state of the EFI DHCPv4 Protocol driver will not be changed. If one instance
+ wants to make it possible for another instance to configure the EFI DHCPv4 Protocol
+ driver, it must call this function with Dhcp4CfgData set to NULL.
+
+ @param This The pointer to the EFI_DHCP4_PROTOCOL instance.
+ @param Dhcp4CfgData The pointer to the EFI_DHCP4_CONFIG_DATA.
+
+ @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Init or
+ Dhcp4InitReboot state, if the original state of this driver
+ was Dhcp4Stopped, Dhcp4Init,Dhcp4InitReboot, or Dhcp4Bound
+ and the value of Dhcp4CfgData was not NULL.
+ Otherwise, the state was left unchanged.
+ @retval EFI_ACCESS_DENIED This instance of the EFI DHCPv4 Protocol driver was not in the
+ Dhcp4Stopped, Dhcp4Init, Dhcp4InitReboot, or Dhcp4Bound state;
+ Or onother instance of this EFI DHCPv4 Protocol driver is already
+ in a valid configured state.
+ @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
+ This is NULL.
+ DiscoverTryCount > 0 and DiscoverTimeout is NULL
+ RequestTryCount > 0 and RequestTimeout is NULL.
+ OptionCount >0 and OptionList is NULL.
+ ClientAddress is not a valid unicast address.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP4_CONFIGURE)(
+ IN EFI_DHCP4_PROTOCOL *This,
+ IN EFI_DHCP4_CONFIG_DATA *Dhcp4CfgData OPTIONAL
+ );
+
+
+/**
+ Starts the DHCP configuration process.
+
+ The Start() function starts the DHCP configuration process. This function can
+ be called only when the EFI DHCPv4 Protocol driver is in the Dhcp4Init or
+ Dhcp4InitReboot state.
+ If the DHCP process completes successfully, the state of the EFI DHCPv4 Protocol
+ driver will be transferred through Dhcp4Selecting and Dhcp4Requesting to the
+ Dhcp4Bound state. The CompletionEvent will then be signaled if it is not NULL.
+ If the process aborts, either by the user or by some unexpected network error,
+ the state is restored to the Dhcp4Init state. The Start() function can be called
+ again to restart the process.
+ Refer to RFC 2131 for precise state transitions during this process. At the
+ time when each event occurs in this process, the callback function that was set
+ by EFI_DHCP4_PROTOCOL.Configure() will be called and the user can take this
+ opportunity to control the process.
+
+ @param This The pointer to the EFI_DHCP4_PROTOCOL instance.
+ @param CompletionEvent If not NULL, it indicates the event that will be signaled when the
+ EFI DHCPv4 Protocol driver is transferred into the
+ Dhcp4Bound state or when the DHCP process is aborted.
+ EFI_DHCP4_PROTOCOL.GetModeData() can be called to
+ check the completion status. If NULL,
+ EFI_DHCP4_PROTOCOL.Start() will wait until the driver
+ is transferred into the Dhcp4Bound state or the process fails.
+
+ @retval EFI_SUCCESS The DHCP configuration process has started, or it has completed
+ when CompletionEvent is NULL.
+ @retval EFI_NOT_STARTED The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped
+ state. EFI_DHCP4_PROTOCOL. Configure() needs to be called.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_TIMEOUT The DHCP configuration process failed because no response was
+ received from the server within the specified timeout value.
+ @retval EFI_ABORTED The user aborted the DHCP process.
+ @retval EFI_ALREADY_STARTED Some other EFI DHCPv4 Protocol instance already started the
+ DHCP process.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_NO_MEDIA There was a media error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP4_START)(
+ IN EFI_DHCP4_PROTOCOL *This,
+ IN EFI_EVENT CompletionEvent OPTIONAL
+ );
+
+/**
+ Extends the lease time by sending a request packet.
+
+ The RenewRebind() function is used to manually extend the lease time when the
+ EFI DHCPv4 Protocol driver is in the Dhcp4Bound state, and the lease time has
+ not expired yet. This function will send a request packet to the previously
+ found server (or to any server when RebindRequest is TRUE) and transfer the
+ state into the Dhcp4Renewing state (or Dhcp4Rebinding when RebindingRequest is
+ TRUE). When a response is received, the state is returned to Dhcp4Bound.
+ If no response is received before the try count is exceeded (the RequestTryCount
+ field that is specified in EFI_DHCP4_CONFIG_DATA) but before the lease time that
+ was issued by the previous server expires, the driver will return to the Dhcp4Bound
+ state, and the previous configuration is restored. The outgoing and incoming packets
+ can be captured by the EFI_DHCP4_CALLBACK function.
+
+ @param This The pointer to the EFI_DHCP4_PROTOCOL instance.
+ @param RebindRequest If TRUE, this function broadcasts the request packets and enters
+ the Dhcp4Rebinding state. Otherwise, it sends a unicast
+ request packet and enters the Dhcp4Renewing state.
+ @param CompletionEvent If not NULL, this event is signaled when the renew/rebind phase
+ completes or some error occurs.
+ EFI_DHCP4_PROTOCOL.GetModeData() can be called to
+ check the completion status. If NULL,
+ EFI_DHCP4_PROTOCOL.RenewRebind() will busy-wait
+ until the DHCP process finishes.
+
+ @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the
+ Dhcp4Renewing state or is back to the Dhcp4Bound state.
+ @retval EFI_NOT_STARTED The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped
+ state. EFI_DHCP4_PROTOCOL.Configure() needs to
+ be called.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_TIMEOUT There was no response from the server when the try count was
+ exceeded.
+ @retval EFI_ACCESS_DENIED The driver is not in the Dhcp4Bound state.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP4_RENEW_REBIND)(
+ IN EFI_DHCP4_PROTOCOL *This,
+ IN BOOLEAN RebindRequest,
+ IN EFI_EVENT CompletionEvent OPTIONAL
+ );
+
+/**
+ Releases the current address configuration.
+
+ The Release() function releases the current configured IP address by doing either
+ of the following:
+ * Sending a DHCPRELEASE packet when the EFI DHCPv4 Protocol driver is in the
+ Dhcp4Bound state
+ * Setting the previously assigned IP address that was provided with the
+ EFI_DHCP4_PROTOCOL.Configure() function to 0.0.0.0 when the driver is in
+ Dhcp4InitReboot state
+ After a successful call to this function, the EFI DHCPv4 Protocol driver returns
+ to the Dhcp4Init state, and any subsequent incoming packets will be discarded silently.
+
+ @param This The pointer to the EFI_DHCP4_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Init phase.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_ACCESS_DENIED The EFI DHCPv4 Protocol driver is not Dhcp4InitReboot state.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP4_RELEASE)(
+ IN EFI_DHCP4_PROTOCOL *This
+ );
+
+/**
+ Stops the current address configuration.
+
+ The Stop() function is used to stop the DHCP configuration process. After this
+ function is called successfully, the EFI DHCPv4 Protocol driver is transferred
+ into the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL.Configure() needs to be called
+ before DHCP configuration process can be started again. This function can be
+ called when the EFI DHCPv4 Protocol driver is in any state.
+
+ @param This The pointer to the EFI_DHCP4_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Stopped phase.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP4_STOP)(
+ IN EFI_DHCP4_PROTOCOL *This
+ );
+
+/**
+ Builds a DHCP packet, given the options to be appended or deleted or replaced.
+
+ The Build() function is used to assemble a new packet from the original packet
+ by replacing or deleting existing options or appending new options. This function
+ does not change any state of the EFI DHCPv4 Protocol driver and can be used at
+ any time.
+
+ @param This The pointer to the EFI_DHCP4_PROTOCOL instance.
+ @param SeedPacket Initial packet to be used as a base for building new packet.
+ @param DeleteCount Number of opcodes in the DeleteList.
+ @param DeleteList List of opcodes to be deleted from the seed packet.
+ Ignored if DeleteCount is zero.
+ @param AppendCount Number of entries in the OptionList.
+ @param AppendList The pointer to a DHCP option list to be appended to SeedPacket.
+ If SeedPacket also contains options in this list, they are
+ replaced by new options (except pad option). Ignored if
+ AppendCount is zero. Type EFI_DHCP4_PACKET_OPTION
+ @param NewPacket The pointer to storage for the pointer to the new allocated packet.
+ Use the EFI Boot Service FreePool() on the resulting pointer
+ when done with the packet.
+
+ @retval EFI_SUCCESS The new packet was built.
+ @retval EFI_OUT_OF_RESOURCES Storage for the new packet could not be allocated.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ SeedPacket is NULL.
+ SeedPacket is not a well-formed DHCP packet.
+ AppendCount is not zero and AppendList is NULL.
+ DeleteCount is not zero and DeleteList is NULL.
+ NewPacket is NULL
+ Both DeleteCount and AppendCount are zero and
+ NewPacket is not NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP4_BUILD)(
+ IN EFI_DHCP4_PROTOCOL *This,
+ IN EFI_DHCP4_PACKET *SeedPacket,
+ IN UINT32 DeleteCount,
+ IN UINT8 *DeleteList OPTIONAL,
+ IN UINT32 AppendCount,
+ IN EFI_DHCP4_PACKET_OPTION *AppendList[] OPTIONAL,
+ OUT EFI_DHCP4_PACKET **NewPacket
+ );
+
+
+/**
+ Transmits a DHCP formatted packet and optionally waits for responses.
+
+ The TransmitReceive() function is used to transmit a DHCP packet and optionally
+ wait for the response from servers. This function does not change the state of
+ the EFI DHCPv4 Protocol driver. It can be used at any time because of this.
+
+ @param This The pointer to the EFI_DHCP4_PROTOCOL instance.
+ @param Token The pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure.
+
+ @retval EFI_SUCCESS The packet was successfully queued for transmission.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Token.RemoteAddress is zero.
+ Token.Packet is NULL.
+ Token.Packet is not a well-formed DHCP packet.
+ The transaction ID in Token.Packet is in use by another DHCP process.
+ @retval EFI_NOT_READY The previous call to this function has not finished yet. Try to call
+ this function after collection process completes.
+ @retval EFI_NO_MAPPING The default station address is not available yet.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_UNSUPPORTED The implementation doesn't support this function
+ @retval Others Some other unexpected error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP4_TRANSMIT_RECEIVE)(
+ IN EFI_DHCP4_PROTOCOL *This,
+ IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN *Token
+ );
+
+
+/**
+ Parses the packed DHCP option data.
+
+ The Parse() function is used to retrieve the option list from a DHCP packet.
+ If *OptionCount isn't zero, and there is enough space for all the DHCP options
+ in the Packet, each element of PacketOptionList is set to point to somewhere in
+ the Packet->Dhcp4.Option where a new DHCP option begins. If RFC3396 is supported,
+ the caller should reassemble the parsed DHCP options to get the final result.
+ If *OptionCount is zero or there isn't enough space for all of them, the number
+ of DHCP options in the Packet is returned in OptionCount.
+
+ @param This The pointer to the EFI_DHCP4_PROTOCOL instance.
+ @param Packet The pointer to packet to be parsed.
+ @param OptionCount On input, the number of entries in the PacketOptionList.
+ On output, the number of entries that were written into the
+ PacketOptionList.
+ @param PacketOptionList A list of packet option entries to be filled in. End option or pad
+ options are not included.
+
+ @retval EFI_SUCCESS The packet was successfully parsed.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ The packet is NULL.
+ The packet is not a well-formed DHCP packet.
+ OptionCount is NULL.
+ @retval EFI_BUFFER_TOO_SMALL One or more of the following conditions is TRUE:
+ 1) *OptionCount is smaller than the number of options that
+ were found in the Packet.
+ 2) PacketOptionList is NULL.
+ @retval EFI_OUT_OF_RESOURCE The packet failed to parse because of a resource shortage.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP4_PARSE)(
+ IN EFI_DHCP4_PROTOCOL *This,
+ IN EFI_DHCP4_PACKET *Packet,
+ IN OUT UINT32 *OptionCount,
+ OUT EFI_DHCP4_PACKET_OPTION *PacketOptionList[] OPTIONAL
+ );
+
+///
+/// This protocol is used to collect configuration information for the EFI IPv4 Protocol drivers
+/// and to provide DHCPv4 server and PXE boot server discovery services.
+///
+struct _EFI_DHCP4_PROTOCOL {
+ EFI_DHCP4_GET_MODE_DATA GetModeData;
+ EFI_DHCP4_CONFIGURE Configure;
+ EFI_DHCP4_START Start;
+ EFI_DHCP4_RENEW_REBIND RenewRebind;
+ EFI_DHCP4_RELEASE Release;
+ EFI_DHCP4_STOP Stop;
+ EFI_DHCP4_BUILD Build;
+ EFI_DHCP4_TRANSMIT_RECEIVE TransmitReceive;
+ EFI_DHCP4_PARSE Parse;
+};
+
+extern EFI_GUID gEfiDhcp4ProtocolGuid;
+extern EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dhcp6.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dhcp6.h
new file mode 100644
index 0000000000..8e0ae27eb9
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dhcp6.h
@@ -0,0 +1,786 @@
+/** @file
+ UEFI Dynamic Host Configuration Protocol 6 Definition, which is used to get IPv6
+ addresses and other configuration parameters from DHCPv6 servers.
+
+ Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.2
+
+**/
+
+#ifndef __EFI_DHCP6_PROTOCOL_H__
+#define __EFI_DHCP6_PROTOCOL_H__
+
+#define EFI_DHCP6_PROTOCOL_GUID \
+ { \
+ 0x87c8bad7, 0x595, 0x4053, {0x82, 0x97, 0xde, 0xde, 0x39, 0x5f, 0x5d, 0x5b } \
+ }
+
+#define EFI_DHCP6_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0x9fb9a8a1, 0x2f4a, 0x43a6, {0x88, 0x9c, 0xd0, 0xf7, 0xb6, 0xc4, 0x7a, 0xd5 } \
+ }
+
+typedef struct _EFI_DHCP6_PROTOCOL EFI_DHCP6_PROTOCOL;
+
+typedef enum {
+ ///
+ /// The EFI DHCPv6 Protocol instance is configured, and start() needs
+ /// to be called
+ ///
+ Dhcp6Init = 0x0,
+ ///
+ /// A Solicit packet is sent out to discover DHCPv6 server, and the EFI
+ /// DHCPv6 Protocol instance is collecting Advertise packets.
+ ///
+ Dhcp6Selecting = 0x1,
+ ///
+ /// A Request is sent out to the DHCPv6 server, and the EFI DHCPv6
+ /// Protocol instance is waiting for Reply packet.
+ ///
+ Dhcp6Requesting = 0x2,
+ ///
+ /// A Decline packet is sent out to indicate one or more addresses of the
+ /// configured IA are in use by another node, and the EFI DHCPv6.
+ /// Protocol instance is waiting for Reply packet.
+ ///
+ Dhcp6Declining = 0x3,
+ ///
+ /// A Confirm packet is sent out to confirm the IPv6 addresses of the
+ /// configured IA, and the EFI DHCPv6 Protocol instance is waiting for Reply packet.
+ ///
+ Dhcp6Confirming = 0x4,
+ ///
+ /// A Release packet is sent out to release one or more IPv6 addresses of
+ /// the configured IA, and the EFI DHCPv6 Protocol instance is waiting for Reply packet.
+ ///
+ Dhcp6Releasing = 0x5,
+ ///
+ /// The DHCPv6 S.A.R.R process is completed for the configured IA.
+ ///
+ Dhcp6Bound = 0x6,
+ ///
+ /// A Renew packet is sent out to extend lifetime for the IPv6 addresses of
+ /// the configured IA, and the EFI DHCPv6 Protocol instance is waiting for Reply packet.
+ ///
+ Dhcp6Renewing = 0x7,
+ ///
+ /// A Rebind packet is sent out to extend lifetime for the IPv6 addresses of
+ /// the configured IA, and the EFI DHCPv6 Protocol instance is waiting for Reply packet.
+ ///
+ Dhcp6Rebinding = 0x8
+} EFI_DHCP6_STATE;
+
+typedef enum {
+ ///
+ /// A Solicit packet is about to be sent. The packet is passed to Dhcp6Callback and
+ /// can be modified or replaced in Dhcp6Callback.
+ ///
+ Dhcp6SendSolicit = 0x0,
+ ///
+ /// An Advertise packet is received and will be passed to Dhcp6Callback.
+ ///
+ Dhcp6RcvdAdvertise = 0x1,
+ ///
+ /// It is time for Dhcp6Callback to determine whether select the default Advertise
+ /// packet by RFC 3315 policy, or overwrite it by specific user policy.
+ ///
+ Dhcp6SelectAdvertise = 0x2,
+ ///
+ /// A Request packet is about to be sent. The packet is passed to Dhcp6Callback and
+ /// can be modified or replaced in Dhcp6Callback.
+ ///
+ Dhcp6SendRequest = 0x3,
+ ///
+ /// A Reply packet is received and will be passed to Dhcp6Callback.
+ ///
+ Dhcp6RcvdReply = 0x4,
+ ///
+ /// A Reconfigure packet is received and will be passed to Dhcp6Callback.
+ ///
+ Dhcp6RcvdReconfigure = 0x5,
+ ///
+ /// A Decline packet is about to be sent. The packet is passed to Dhcp6Callback and
+ /// can be modified or replaced in Dhcp6Callback.
+ ///
+ Dhcp6SendDecline = 0x6,
+ ///
+ /// A Confirm packet is about to be sent. The packet is passed to Dhcp6Callback and
+ /// can be modified or replaced in Dhcp6Callback.
+ ///
+ Dhcp6SendConfirm = 0x7,
+ ///
+ /// A Release packet is about to be sent. The packet is passed to Dhcp6Callback and
+ /// can be modified or replaced in Dhcp6Callback.
+ ///
+ Dhcp6SendRelease = 0x8,
+ ///
+ /// A Renew packet is about to be sent. The packet is passed to Dhcp6Callback and
+ /// can be modified or replaced in Dhcp6Callback.
+ ///
+ Dhcp6EnterRenewing = 0x9,
+ ///
+ /// A Rebind packet is about to be sent. The packet is passed to Dhcp6Callback and
+ /// can be modified or replaced in Dhcp6Callback.
+ ///
+ Dhcp6EnterRebinding = 0xa
+} EFI_DHCP6_EVENT;
+
+///
+/// An IA which carries assigned not temporary address.
+///
+#define EFI_DHCP6_IA_TYPE_NA 3
+///
+/// An IA which carries assigned temporary address.
+///
+#define EFI_DHCP6_IA_TYPE_TA 4
+
+#pragma pack(1)
+///
+/// EFI_DHCP6_PACKET_OPTION
+/// defines the format of the DHCPv6 option, See RFC 3315 for more information.
+/// This data structure is used to reference option data that is packed in the DHCPv6 packet.
+///
+typedef struct {
+ ///
+ /// The DHCPv6 option code, stored in network order.
+ ///
+ UINT16 OpCode;
+ ///
+ /// Length of the DHCPv6 option data, stored in network order.
+ /// From the first byte to the last byte of the Data field.
+ ///
+ UINT16 OpLen;
+ ///
+ /// The data for the DHCPv6 option, stored in network order.
+ ///
+ UINT8 Data[1];
+} EFI_DHCP6_PACKET_OPTION;
+
+///
+/// EFI_DHCP6_HEADER
+/// defines the format of the DHCPv6 header. See RFC 3315 for more information.
+///
+typedef struct{
+ ///
+ /// The DHCPv6 transaction ID.
+ ///
+ UINT32 MessageType:8;
+ ///
+ /// The DHCPv6 message type.
+ ///
+ UINT32 TransactionId:24;
+} EFI_DHCP6_HEADER;
+
+///
+/// EFI_DHCP6_PACKET
+/// defines the format of the DHCPv6 packet. See RFC 3315 for more information.
+///
+typedef struct {
+ ///
+ /// Size of the EFI_DHCP6_PACKET buffer.
+ ///
+ UINT32 Size;
+ ///
+ /// Length of the EFI_DHCP6_PACKET from the first byte of the Header field to the last
+ /// byte of the Option[] field.
+ ///
+ UINT32 Length;
+ struct{
+ ///
+ /// The DHCPv6 packet header.
+ ///
+ EFI_DHCP6_HEADER Header;
+ ///
+ /// Start of the DHCPv6 packed option data.
+ ///
+ UINT8 Option[1];
+ } Dhcp6;
+} EFI_DHCP6_PACKET;
+
+#pragma pack()
+
+typedef struct {
+ ///
+ /// Length of DUID in octects.
+ ///
+ UINT16 Length;
+ ///
+ /// Array of DUID octects.
+ ///
+ UINT8 Duid[1];
+} EFI_DHCP6_DUID;
+
+typedef struct {
+ ///
+ /// Initial retransmission timeout.
+ ///
+ UINT32 Irt;
+ ///
+ /// Maximum retransmission count for one packet. If Mrc is zero, there's no upper limit
+ /// for retransmission count.
+ ///
+ UINT32 Mrc;
+ ///
+ /// Maximum retransmission timeout for each retry. It's the upper bound of the number of
+ /// retransmission timeout. If Mrt is zero, there is no upper limit for retransmission
+ /// timeout.
+ ///
+ UINT32 Mrt;
+ ///
+ /// Maximum retransmission duration for one packet. It's the upper bound of the numbers
+ /// the client may retransmit a message. If Mrd is zero, there's no upper limit for
+ /// retransmission duration.
+ ///
+ UINT32 Mrd;
+} EFI_DHCP6_RETRANSMISSION;
+
+typedef struct {
+ ///
+ /// The IPv6 address.
+ ///
+ EFI_IPv6_ADDRESS IpAddress;
+ ///
+ /// The preferred lifetime in unit of seconds for the IPv6 address.
+ ///
+ UINT32 PreferredLifetime;
+ ///
+ /// The valid lifetime in unit of seconds for the IPv6 address.
+ ///
+ UINT32 ValidLifetime;
+} EFI_DHCP6_IA_ADDRESS;
+
+typedef struct {
+ UINT16 Type; ///< Type for an IA.
+ UINT32 IaId; ///< The identifier for an IA.
+} EFI_DHCP6_IA_DESCRIPTOR;
+
+typedef struct {
+ ///
+ /// The descriptor for IA.
+ ///
+ EFI_DHCP6_IA_DESCRIPTOR Descriptor;
+ ///
+ /// The state of the configured IA.
+ ///
+ EFI_DHCP6_STATE State;
+ ///
+ /// Pointer to the cached latest Reply packet. May be NULL if no packet is cached.
+ ///
+ EFI_DHCP6_PACKET *ReplyPacket;
+ ///
+ /// Number of IPv6 addresses of the configured IA.
+ ///
+ UINT32 IaAddressCount;
+ ///
+ /// List of the IPv6 addresses of the configured IA. When the state of the configured IA is
+ /// in Dhcp6Bound, Dhcp6Renewing and Dhcp6Rebinding, the IPv6 addresses are usable.
+ ///
+ EFI_DHCP6_IA_ADDRESS IaAddress[1];
+} EFI_DHCP6_IA;
+
+typedef struct {
+ ///
+ /// Pointer to the DHCPv6 unique identifier. The caller is responsible for freeing this buffer.
+ ///
+ EFI_DHCP6_DUID *ClientId;
+ ///
+ /// Pointer to the configured IA of current instance. The caller can free this buffer after
+ /// using it.
+ ///
+ EFI_DHCP6_IA *Ia;
+} EFI_DHCP6_MODE_DATA;
+
+/**
+ EFI_DHCP6_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol instance to
+ intercept events that occurs in the DHCPv6 S.A.R.R process.
+
+ @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance that is used to configure this
+ callback function.
+ @param[in] Context Pointer to the context that is initialized by EFI_DHCP6_PROTOCOL.Configure().
+ @param[in] CurrentState The current state of the configured IA.
+ @param[in] Dhcp6Event The event that occurs in the current state, which usually means a state transition.
+ @param[in] Packet Pointer to the DHCPv6 packet that is about to be sent or has been received.
+ The EFI DHCPv6 Protocol instance is responsible for freeing the buffer.
+ @param[out] NewPacket Pointer to the new DHCPv6 packet to overwrite the Packet. NewPacket can not
+ share the buffer with Packet. If *NewPacket is not NULL, the EFI DHCPv6
+ Protocol instance is responsible for freeing the buffer.
+
+ @retval EFI_SUCCESS Tell the EFI DHCPv6 Protocol instance to continue the DHCPv6 S.A.R.R process.
+ @retval EFI_ABORTED Tell the EFI DHCPv6 Protocol instance to abort the DHCPv6 S.A.R.R process,
+ and the state of the configured IA will be transferred to Dhcp6Init.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP6_CALLBACK)(
+ IN EFI_DHCP6_PROTOCOL *This,
+ IN VOID *Context,
+ IN EFI_DHCP6_STATE CurrentState,
+ IN EFI_DHCP6_EVENT Dhcp6Event,
+ IN EFI_DHCP6_PACKET *Packet,
+ OUT EFI_DHCP6_PACKET **NewPacket OPTIONAL
+ );
+
+typedef struct {
+ ///
+ /// The callback function is to intercept various events that occur in the DHCPv6 S.A.R.R
+ /// process. Set to NULL to ignore all those events.
+ ///
+ EFI_DHCP6_CALLBACK Dhcp6Callback;
+ ///
+ /// Pointer to the context that will be passed to Dhcp6Callback.
+ ///
+ VOID *CallbackContext;
+ ///
+ /// Number of the DHCPv6 options in the OptionList.
+ ///
+ UINT32 OptionCount;
+ ///
+ /// List of the DHCPv6 options to be included in Solicit and Request packet. The buffer
+ /// can be freed after EFI_DHCP6_PROTOCOL.Configure() returns. Ignored if
+ /// OptionCount is zero. OptionList should not contain Client Identifier option
+ /// and any IA option, which will be appended by EFI DHCPv6 Protocol instance
+ /// automatically.
+ ///
+ EFI_DHCP6_PACKET_OPTION **OptionList;
+ ///
+ /// The descriptor for the IA of the EFI DHCPv6 Protocol instance.
+ ///
+ EFI_DHCP6_IA_DESCRIPTOR IaDescriptor;
+ ///
+ /// If not NULL, the event will be signaled when any IPv6 address information of the
+ /// configured IA is updated, including IPv6 address, preferred lifetime and valid
+ /// lifetime, or the DHCPv6 S.A.R.R process fails. Otherwise, Start(),
+ /// renewrebind(), decline(), release() and stop() will be blocking
+ /// operations, and they will wait for the exchange process completion or failure.
+ ///
+ EFI_EVENT IaInfoEvent;
+ ///
+ /// If TRUE, the EFI DHCPv6 Protocol instance is willing to accept Reconfigure packet.
+ /// Otherwise, it will ignore it. Reconfigure Accept option can not be specified through
+ /// OptionList parameter.
+ ///
+ BOOLEAN ReconfigureAccept;
+ ///
+ /// If TRUE, the EFI DHCPv6 Protocol instance will send Solicit packet with Rapid
+ /// Commit option. Otherwise, Rapid Commit option will not be included in Solicit
+ /// packet. Rapid Commit option can not be specified through OptionList parameter.
+ ///
+ BOOLEAN RapidCommit;
+ ///
+ /// Parameter to control Solicit packet retransmission behavior. The
+ /// buffer can be freed after EFI_DHCP6_PROTOCOL.Configure() returns.
+ ///
+ EFI_DHCP6_RETRANSMISSION *SolicitRetransmission;
+} EFI_DHCP6_CONFIG_DATA;
+
+/**
+ EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol
+ instance to intercept events that occurs in the DHCPv6 Information Request exchange process.
+
+ @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance that is used to configure this
+ callback function.
+ @param[in] Context Pointer to the context that is initialized in the EFI_DHCP6_PROTOCOL.InfoRequest().
+ @param[in] Packet Pointer to Reply packet that has been received. The EFI DHCPv6 Protocol instance is
+ responsible for freeing the buffer.
+
+ @retval EFI_SUCCESS Tell the EFI DHCPv6 Protocol instance to finish Information Request exchange process.
+ @retval EFI_NOT_READY Tell the EFI DHCPv6 Protocol instance to continue Information Request exchange process.
+ @retval EFI_ABORTED Tell the EFI DHCPv6 Protocol instance to abort the Information Request exchange process.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP6_INFO_CALLBACK)(
+ IN EFI_DHCP6_PROTOCOL *This,
+ IN VOID *Context,
+ IN EFI_DHCP6_PACKET *Packet
+ );
+
+/**
+ Retrieve the current operating mode data and configuration data for the EFI DHCPv6 Protocol instance.
+
+ @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.
+ @param[out] Dhcp6ModeData Pointer to the DHCPv6 mode data structure. The caller is responsible for freeing this
+ structure and each reference buffer.
+ @param[out] Dhcp6ConfigData Pointer to the DHCPv6 configuration data structure. The caller is responsible for
+ freeing this structure and each reference buffer.
+
+ @retval EFI_SUCCESS The mode data was returned.
+ @retval EFI_ACCESS_DENIED The EFI DHCPv6 Protocol instance has not been configured when Dhcp6ConfigData is not NULL.
+ @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
+ - This is NULL.
+ - Both Dhcp6ConfigData and Dhcp6ModeData are NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP6_GET_MODE_DATA)(
+ IN EFI_DHCP6_PROTOCOL *This,
+ OUT EFI_DHCP6_MODE_DATA *Dhcp6ModeData OPTIONAL,
+ OUT EFI_DHCP6_CONFIG_DATA *Dhcp6ConfigData OPTIONAL
+ );
+
+/**
+ Initialize or clean up the configuration data for the EFI DHCPv6 Protocol instance.
+
+ The Configure() function is used to initialize or clean up the configuration data of the EFI
+ DHCPv6 Protocol instance.
+ - When Dhcp6CfgData is not NULL and Configure() is called successfully, the
+ configuration data will be initialized in the EFI DHCPv6 Protocol instance and the state of the
+ configured IA will be transferred into Dhcp6Init.
+ - When Dhcp6CfgData is NULL and Configure() is called successfully, the configuration
+ data will be cleaned up and no IA will be associated with the EFI DHCPv6 Protocol instance.
+
+ To update the configuration data for an EFI DCHPv6 Protocol instance, the original data must be
+ cleaned up before setting the new configuration data.
+
+ @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.
+ @param[in] Dhcp6CfgData Pointer to the DHCPv6 configuration data structure.
+
+ @retval EFI_SUCCESS The mode data was returned.
+ @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE
+ - This is NULL.
+ - OptionCount > 0 and OptionList is NULL.
+ - OptionList is not NULL, and Client Id option, Reconfigure Accept option,
+ Rapid Commit option or any IA option is specified in the OptionList.
+ - IaDescriptor.Type is neither EFI_DHCP6_IA_TYPE_NA nor EFI_DHCP6_IA_TYPE_NA.
+ - IaDescriptor is not unique.
+ - Both IaInfoEvent and SolicitRetransimssion are NULL.
+ - SolicitRetransmission is not NULL, and both SolicitRetransimssion->Mrc and
+ SolicitRetransmission->Mrd are zero.
+ @retval EFI_ACCESS_DENIED The EFI DHCPv6 Protocol instance has been already configured
+ when Dhcp6CfgData is not NULL.
+ The EFI DHCPv6 Protocol instance has already started the
+ DHCPv6 S.A.R.R when Dhcp6CfgData is NULL.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP6_CONFIGURE)(
+ IN EFI_DHCP6_PROTOCOL *This,
+ IN EFI_DHCP6_CONFIG_DATA *Dhcp6CfgData OPTIONAL
+ );
+
+/**
+ Start the DHCPv6 S.A.R.R process.
+
+ The Start() function starts the DHCPv6 S.A.R.R process. This function can be called only when
+ the state of the configured IA is in the Dhcp6Init state. If the DHCPv6 S.A.R.R process completes
+ successfully, the state of the configured IA will be transferred through Dhcp6Selecting and
+ Dhcp6Requesting to Dhcp6Bound state. The update of the IPv6 addresses will be notified through
+ EFI_DHCP6_CONFIG_DATA.IaInfoEvent. At the time when each event occurs in this process, the
+ callback function set by EFI_DHCP6_PROTOCOL.Configure() will be called and the user can take
+ this opportunity to control the process. If EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL, the
+ Start() function call is a blocking operation. It will return after the DHCPv6 S.A.R.R process
+ completes or aborted by users. If the process is aborted by system or network error, the state of
+ the configured IA will be transferred to Dhcp6Init. The Start() function can be called again to
+ restart the process.
+
+ @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The DHCPv6 S.A.R.R process is completed and at least one IPv6
+ address has been bound to the configured IA when
+ EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL.
+ The DHCPv6 S.A.R.R process is started when
+ EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.
+ @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_ALREADY_STARTED The DHCPv6 S.A.R.R process has already started.
+ @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
+ @retval EFI_NO_RESPONSE The DHCPv6 S.A.R.R process failed because of no response.
+ @retval EFI_NO_MAPPING No IPv6 address has been bound to the configured IA after the
+ DHCPv6 S.A.R.R process.
+ @retval EFI_ABORTED The DHCPv6 S.A.R.R process aborted by user.
+ @retval EFI_NO_MEDIA There was a media error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP6_START)(
+ IN EFI_DHCP6_PROTOCOL *This
+ );
+
+/**
+ Request configuration information without the assignment of any IA addresses of the client.
+
+ The InfoRequest() function is used to request configuration information without the assignment
+ of any IPv6 address of the client. Client sends out Information Request packet to obtain
+ the required configuration information, and DHCPv6 server responds with Reply packet containing
+ the information for the client. The received Reply packet will be passed to the user by
+ ReplyCallback function. If user returns EFI_NOT_READY from ReplyCallback, the EFI DHCPv6
+ Protocol instance will continue to receive other Reply packets unless timeout according to
+ the Retransmission parameter. Otherwise, the Information Request exchange process will be
+ finished successfully if user returns EFI_SUCCESS from ReplyCallback.
+
+ @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.
+ @param[in] SendClientId If TRUE, the EFI DHCPv6 Protocol instance will build Client
+ Identifier option and include it into Information Request
+ packet. If FALSE, Client Identifier option will not be included.
+ Client Identifier option can not be specified through OptionList
+ parameter.
+ @param[in] OptionRequest Pointer to the Option Request option in the Information Request
+ packet. Option Request option can not be specified through
+ OptionList parameter.
+ @param[in] OptionCount Number of options in OptionList.
+ @param[in] OptionList List of other DHCPv6 options. These options will be appended
+ to the Option Request option. The caller is responsible for
+ freeing this buffer. Type is defined in EFI_DHCP6_PROTOCOL.GetModeData().
+ @param[in] Retransmission Parameter to control Information Request packet retransmission
+ behavior. The buffer can be freed after EFI_DHCP6_PROTOCOL.InfoRequest()
+ returns.
+ @param[in] TimeoutEvent If not NULL, this event is signaled when the information request
+ exchange aborted because of no response. If NULL, the function
+ call is a blocking operation; and it will return after the
+ information-request exchange process finish or aborted by users.
+ @param[in] ReplyCallback The callback function is to intercept various events that occur
+ in the Information Request exchange process. It should not be
+ set to NULL.
+ @param[in] CallbackContext Pointer to the context that will be passed to ReplyCallback.
+
+ @retval EFI_SUCCESS The DHCPv6 S.A.R.R process is completed and at least one IPv6
+ @retval EFI_SUCCESS The DHCPv6 information request exchange process completed
+ when TimeoutEvent is NULL. Information Request packet has been
+ sent to DHCPv6 server when TimeoutEvent is not NULL.
+ @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
+ - This is NULL.
+ - OptionRequest is NULL or OptionRequest->OpCode is invalid.
+ - OptionCount > 0 and OptionList is NULL.
+ - OptionList is not NULL, and Client Identify option or
+ Option Request option is specified in the OptionList.
+ - Retransimssion is NULL.
+ - Both Retransimssion->Mrc and Retransmission->Mrd are zero.
+ - ReplyCallback is NULL.
+ @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
+ @retval EFI_NO_RESPONSE The DHCPv6 information request exchange process failed
+ because of no response, or not all requested-options are
+ responded by DHCPv6 servers when Timeout happened.
+ @retval EFI_ABORTED The DHCPv6 information request exchange process aborted by user.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP6_INFO_REQUEST)(
+ IN EFI_DHCP6_PROTOCOL *This,
+ IN BOOLEAN SendClientId,
+ IN EFI_DHCP6_PACKET_OPTION *OptionRequest,
+ IN UINT32 OptionCount,
+ IN EFI_DHCP6_PACKET_OPTION *OptionList[] OPTIONAL,
+ IN EFI_DHCP6_RETRANSMISSION *Retransmission,
+ IN EFI_EVENT TimeoutEvent OPTIONAL,
+ IN EFI_DHCP6_INFO_CALLBACK ReplyCallback,
+ IN VOID *CallbackContext OPTIONAL
+ );
+
+/**
+ Manually extend the valid and preferred lifetimes for the IPv6 addresses of the configured
+ IA and update other configuration parameters by sending Renew or Rebind packet.
+
+ The RenewRebind() function is used to manually extend the valid and preferred lifetimes for the
+ IPv6 addresses of the configured IA and update other configuration parameters by sending Renew or
+ Rebind packet.
+ - When RebindRequest is FALSE and the state of the configured IA is Dhcp6Bound, it
+ will send Renew packet to the previously DHCPv6 server and transfer the state of the configured
+ IA to Dhcp6Renewing. If valid Reply packet received, the state transfers to Dhcp6Bound
+ and the valid and preferred timer restarts. If fails, the state transfers to Dhcp6Bound but the
+ timer continues.
+ - When RebindRequest is TRUE and the state of the configured IA is Dhcp6Bound, it will
+ send Rebind packet. If valid Reply packet received, the state transfers to Dhcp6Bound and the
+ valid and preferred timer restarts. If fails, the state transfers to Dhcp6Init and the IA can't
+ be used.
+
+ @param[in] This Pointer to the EFI_DHCP4_PROTOCOL instance.
+ @param[in] RebindRequest If TRUE, it will send Rebind packet and enter the Dhcp6Rebinding state.
+ Otherwise, it will send Renew packet and enter the Dhcp6Renewing state.
+
+ @retval EFI_SUCCESS The DHCPv6 renew/rebind exchange process has completed and at
+ least one IPv6 address of the configured IA has been bound again
+ when EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL.
+ The EFI DHCPv6 Protocol instance has sent Renew or Rebind packet
+ when EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.
+ @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured, or the state
+ of the configured IA is not in Dhcp6Bound.
+ @retval EFI_ALREADY_STARTED The state of the configured IA has already entered Dhcp6Renewing
+ when RebindRequest is FALSE.
+ The state of the configured IA has already entered Dhcp6Rebinding
+ when RebindRequest is TRUE.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_DEVICE_ERROR An unexpected system or system error occurred.
+ @retval EFI_NO_RESPONSE The DHCPv6 renew/rebind exchange process failed because of no response.
+ @retval EFI_NO_MAPPING No IPv6 address has been bound to the configured IA after the DHCPv6
+ renew/rebind exchange process.
+ @retval EFI_ABORTED The DHCPv6 renew/rebind exchange process aborted by user.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP6_RENEW_REBIND)(
+ IN EFI_DHCP6_PROTOCOL *This,
+ IN BOOLEAN RebindRequest
+ );
+
+/**
+ Inform that one or more IPv6 addresses assigned by a server are already in use by
+ another node.
+
+ The Decline() function is used to manually decline the assignment of IPv6 addresses, which
+ have been already used by another node. If all IPv6 addresses of the configured IA are declined
+ through this function, the state of the IA will switch through Dhcp6Declining to Dhcp6Init,
+ otherwise, the state of the IA will restore to Dhcp6Bound after the declining process. The
+ Decline() can only be called when the IA is in Dhcp6Bound state. If the
+ EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL, this function is a blocking operation. It
+ will return after the declining process finishes, or aborted by user.
+
+ @param[in] This Pointer to the EFI_DHCP4_PROTOCOL instance.
+ @param[in] AddressCount Number of declining IPv6 addresses.
+ @param[in] Addresses Pointer to the buffer stored all the declining IPv6 addresses.
+
+ @retval EFI_SUCCESS The DHCPv6 decline exchange process has completed when
+ EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL.
+ The EFI DHCPv6 Protocol instance has sent Decline packet when
+ EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.
+ @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE
+ - This is NULL.
+ - AddressCount is zero or Addresses is NULL.
+ @retval EFI_NOT_FOUND Any specified IPv6 address is not correlated with the configured IA
+ for this instance.
+ @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured, or the
+ state of the configured IA is not in Dhcp6Bound.
+ @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
+ @retval EFI_ABORTED The DHCPv6 decline exchange process aborted by user.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP6_DECLINE)(
+ IN EFI_DHCP6_PROTOCOL *This,
+ IN UINT32 AddressCount,
+ IN EFI_IPv6_ADDRESS *Addresses
+ );
+
+/**
+ Release one or more IPv6 addresses associated with the configured IA for current instance.
+
+ The Release() function is used to manually release the one or more IPv6 address. If AddressCount
+ is zero, it will release all IPv6 addresses of the configured IA. If all IPv6 addresses of the IA
+ are released through this function, the state of the IA will switch through Dhcp6Releasing to
+ Dhcp6Init, otherwise, the state of the IA will restore to Dhcp6Bound after the releasing process.
+ The Release() can only be called when the IA is in Dhcp6Bound state. If the
+ EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL, the function is a blocking operation. It will return
+ after the releasing process finishes, or aborted by user.
+
+ @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.
+ @param[in] AddressCount Number of releasing IPv6 addresses.
+ @param[in] Addresses Pointer to the buffer stored all the releasing IPv6 addresses.
+ Ignored if AddressCount is zero.
+ @retval EFI_SUCCESS The DHCPv6 release exchange process has completed when
+ EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL.
+ The EFI DHCPv6 Protocol instance has sent Release packet when
+ EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.
+ @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE
+ - This is NULL.
+ - AddressCount is not zero or Addresses is NULL.
+ @retval EFI_NOT_FOUND Any specified IPv6 address is not correlated with the configured
+ IA for this instance.
+ @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured, or the
+ state of the configured IA is not in Dhcp6Bound.
+ @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
+ @retval EFI_ABORTED The DHCPv6 release exchange process aborted by user.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP6_RELEASE)(
+ IN EFI_DHCP6_PROTOCOL *This,
+ IN UINT32 AddressCount,
+ IN EFI_IPv6_ADDRESS *Addresses
+ );
+
+/**
+ Stop the DHCPv6 S.A.R.R process.
+
+ The Stop() function is used to stop the DHCPv6 S.A.R.R process. If this function is called
+ successfully, all the IPv6 addresses of the configured IA will be released and the state of
+ the configured IA will be transferred to Dhcp6Init.
+
+ @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The DHCPv6 S.A.R.R process has been stopped when
+ EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL.
+ The EFI DHCPv6 Protocol instance has sent Release packet if
+ need release or has been stopped if needn't, when
+ EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP6_STOP)(
+ IN EFI_DHCP6_PROTOCOL *This
+ );
+
+/**
+ Parse the option data in the DHCPv6 packet.
+
+ The Parse() function is used to retrieve the option list in the DHCPv6 packet.
+
+ @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.
+
+ @param[in] Packet Pointer to packet to be parsed.
+ @param[in] OptionCount On input, the number of entries in the PacketOptionList.
+ On output, the number of DHCPv6 options in the Packet.
+ @param[in] PacketOptionList List of pointers to the DHCPv6 options in the Packet.
+ The OpCode and OpLen in EFI_DHCP6_PACKET_OPTION are
+ both stored in network byte order.
+ @retval EFI_SUCCESS The packet was successfully parsed.
+ @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE
+ - This is NULL.
+ - Packet is NULL.
+ - Packet is not a well-formed DHCPv6 packet.
+ - OptionCount is NULL.
+ - *OptionCount is not zero and PacketOptionList is NULL.
+ @retval EFI_BUFFER_TOO_SMALL *OptionCount is smaller than the number of options that were
+ found in the Packet.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DHCP6_PARSE)(
+ IN EFI_DHCP6_PROTOCOL *This,
+ IN EFI_DHCP6_PACKET *Packet,
+ IN OUT UINT32 *OptionCount,
+ OUT EFI_DHCP6_PACKET_OPTION *PacketOptionList[] OPTIONAL
+);
+
+///
+/// The EFI DHCPv6 Protocol is used to get IPv6 addresses and other configuration parameters
+/// from DHCPv6 servers.
+///
+struct _EFI_DHCP6_PROTOCOL {
+ EFI_DHCP6_GET_MODE_DATA GetModeData;
+ EFI_DHCP6_CONFIGURE Configure;
+ EFI_DHCP6_START Start;
+ EFI_DHCP6_INFO_REQUEST InfoRequest;
+ EFI_DHCP6_RENEW_REBIND RenewRebind;
+ EFI_DHCP6_DECLINE Decline;
+ EFI_DHCP6_RELEASE Release;
+ EFI_DHCP6_STOP Stop;
+ EFI_DHCP6_PARSE Parse;
+};
+
+extern EFI_GUID gEfiDhcp6ProtocolGuid;
+extern EFI_GUID gEfiDhcp6ServiceBindingProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DiskInfo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DiskInfo.h
new file mode 100644
index 0000000000..5e025bdb16
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DiskInfo.h
@@ -0,0 +1,227 @@
+/** @file
+ Provides the basic interfaces to abstract platform information regarding an
+ IDE controller.
+
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is defined in UEFI Platform Initialization Specification 1.6
+ Volume 5: Standards
+
+**/
+
+#ifndef __DISK_INFO_H__
+#define __DISK_INFO_H__
+
+///
+/// Global ID for EFI_DISK_INFO_PROTOCOL
+///
+#define EFI_DISK_INFO_PROTOCOL_GUID \
+ { \
+ 0xd432a67f, 0x14dc, 0x484b, {0xb3, 0xbb, 0x3f, 0x2, 0x91, 0x84, 0x93, 0x27 } \
+ }
+
+///
+/// Forward declaration for EFI_DISK_INFO_PROTOCOL
+///
+typedef struct _EFI_DISK_INFO_PROTOCOL EFI_DISK_INFO_PROTOCOL;
+
+///
+/// Global ID for an IDE interface. Used to fill in EFI_DISK_INFO_PROTOCOL.Interface
+///
+#define EFI_DISK_INFO_IDE_INTERFACE_GUID \
+ { \
+ 0x5e948fe3, 0x26d3, 0x42b5, {0xaf, 0x17, 0x61, 0x2, 0x87, 0x18, 0x8d, 0xec } \
+ }
+
+///
+/// Global ID for a SCSI interface. Used to fill in EFI_DISK_INFO_PROTOCOL.Interface
+///
+#define EFI_DISK_INFO_SCSI_INTERFACE_GUID \
+ { \
+ 0x8f74baa, 0xea36, 0x41d9, {0x95, 0x21, 0x21, 0xa7, 0xf, 0x87, 0x80, 0xbc } \
+ }
+
+///
+/// Global ID for a USB interface. Used to fill in EFI_DISK_INFO_PROTOCOL.Interface
+///
+#define EFI_DISK_INFO_USB_INTERFACE_GUID \
+ { \
+ 0xcb871572, 0xc11a, 0x47b5, {0xb4, 0x92, 0x67, 0x5e, 0xaf, 0xa7, 0x77, 0x27 } \
+ }
+
+///
+/// Global ID for an AHCI interface. Used to fill in EFI_DISK_INFO_PROTOCOL.Interface
+///
+#define EFI_DISK_INFO_AHCI_INTERFACE_GUID \
+ { \
+ 0x9e498932, 0x4abc, 0x45af, {0xa3, 0x4d, 0x2, 0x47, 0x78, 0x7b, 0xe7, 0xc6 } \
+ }
+
+///
+/// Global ID for a NVME interface. Used to fill in EFI_DISK_INFO_PROTOCOL.Interface
+///
+#define EFI_DISK_INFO_NVME_INTERFACE_GUID \
+ { \
+ 0x3ab14680, 0x5d3f, 0x4a4d, {0xbc, 0xdc, 0xcc, 0x38, 0x0, 0x18, 0xc7, 0xf7 } \
+ }
+
+///
+/// Global ID for a UFS interface. Used to fill in EFI_DISK_INFO_PROTOCOL.Interface
+///
+#define EFI_DISK_INFO_UFS_INTERFACE_GUID \
+ { \
+ 0x4b3029cc, 0x6b98, 0x47fb, { 0xbc, 0x96, 0x76, 0xdc, 0xb8, 0x4, 0x41, 0xf0 } \
+ }
+
+///
+/// Global ID for an SD/MMC interface. Used to fill in EFI_DISK_INFO_PROTOCOL.Interface
+///
+#define EFI_DISK_INFO_SD_MMC_INTERFACE_GUID \
+ { \
+ 0x8deec992, 0xd39c, 0x4a5c, { 0xab, 0x6b, 0x98, 0x6e, 0x14, 0x24, 0x2b, 0x9d } \
+ }
+
+/**
+ Provides inquiry information for the controller type.
+
+ This function is used by the IDE bus driver to get inquiry data. Data format
+ of Identify data is defined by the Interface GUID.
+
+ @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
+ @param[in,out] InquiryData Pointer to a buffer for the inquiry data.
+ @param[in,out] InquiryDataSize Pointer to the value for the inquiry data size.
+
+ @retval EFI_SUCCESS The command was accepted without any errors.
+ @retval EFI_NOT_FOUND Device does not support this data class
+ @retval EFI_DEVICE_ERROR Error reading InquiryData from device
+ @retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DISK_INFO_INQUIRY)(
+ IN EFI_DISK_INFO_PROTOCOL *This,
+ IN OUT VOID *InquiryData,
+ IN OUT UINT32 *InquiryDataSize
+ );
+
+/**
+ Provides identify information for the controller type.
+
+ This function is used by the IDE bus driver to get identify data. Data format
+ of Identify data is defined by the Interface GUID.
+
+ @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL
+ instance.
+ @param[in,out] IdentifyData Pointer to a buffer for the identify data.
+ @param[in,out] IdentifyDataSize Pointer to the value for the identify data
+ size.
+
+ @retval EFI_SUCCESS The command was accepted without any errors.
+ @retval EFI_NOT_FOUND Device does not support this data class
+ @retval EFI_DEVICE_ERROR Error reading IdentifyData from device
+ @retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DISK_INFO_IDENTIFY)(
+ IN EFI_DISK_INFO_PROTOCOL *This,
+ IN OUT VOID *IdentifyData,
+ IN OUT UINT32 *IdentifyDataSize
+ );
+
+/**
+ Provides sense data information for the controller type.
+
+ This function is used by the IDE bus driver to get sense data.
+ Data format of Sense data is defined by the Interface GUID.
+
+ @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
+ @param[in,out] SenseData Pointer to the SenseData.
+ @param[in,out] SenseDataSize Size of SenseData in bytes.
+ @param[out] SenseDataNumber Pointer to the value for the sense data size.
+
+ @retval EFI_SUCCESS The command was accepted without any errors.
+ @retval EFI_NOT_FOUND Device does not support this data class.
+ @retval EFI_DEVICE_ERROR Error reading SenseData from device.
+ @retval EFI_BUFFER_TOO_SMALL SenseDataSize not big enough.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DISK_INFO_SENSE_DATA)(
+ IN EFI_DISK_INFO_PROTOCOL *This,
+ IN OUT VOID *SenseData,
+ IN OUT UINT32 *SenseDataSize,
+ OUT UINT8 *SenseDataNumber
+ );
+
+/**
+ This function is used by the IDE bus driver to get controller information.
+
+ @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
+ @param[out] IdeChannel Pointer to the Ide Channel number. Primary or secondary.
+ @param[out] IdeDevice Pointer to the Ide Device number. Master or slave.
+
+ @retval EFI_SUCCESS IdeChannel and IdeDevice are valid.
+ @retval EFI_UNSUPPORTED This is not an IDE device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DISK_INFO_WHICH_IDE)(
+ IN EFI_DISK_INFO_PROTOCOL *This,
+ OUT UINT32 *IdeChannel,
+ OUT UINT32 *IdeDevice
+ );
+
+///
+/// The EFI_DISK_INFO_PROTOCOL provides controller specific information.
+///
+struct _EFI_DISK_INFO_PROTOCOL {
+ ///
+ /// A GUID that defines the format of buffers for the other member functions
+ /// of this protocol.
+ ///
+ EFI_GUID Interface;
+ ///
+ /// Return the results of the Inquiry command to a drive in InquiryData. Data
+ /// format of Inquiry data is defined by the Interface GUID.
+ ///
+ EFI_DISK_INFO_INQUIRY Inquiry;
+ ///
+ /// Return the results of the Identify command to a drive in IdentifyData. Data
+ /// format of Identify data is defined by the Interface GUID.
+ ///
+ EFI_DISK_INFO_IDENTIFY Identify;
+ ///
+ /// Return the results of the Request Sense command to a drive in SenseData. Data
+ /// format of Sense data is defined by the Interface GUID.
+ ///
+ EFI_DISK_INFO_SENSE_DATA SenseData;
+ ///
+ /// Specific controller.
+ ///
+ EFI_DISK_INFO_WHICH_IDE WhichIde;
+};
+
+extern EFI_GUID gEfiDiskInfoProtocolGuid;
+
+extern EFI_GUID gEfiDiskInfoIdeInterfaceGuid;
+extern EFI_GUID gEfiDiskInfoScsiInterfaceGuid;
+extern EFI_GUID gEfiDiskInfoUsbInterfaceGuid;
+extern EFI_GUID gEfiDiskInfoAhciInterfaceGuid;
+extern EFI_GUID gEfiDiskInfoNvmeInterfaceGuid;
+extern EFI_GUID gEfiDiskInfoUfsInterfaceGuid;
+extern EFI_GUID gEfiDiskInfoSdMmcInterfaceGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DiskIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DiskIo.h
new file mode 100644
index 0000000000..9f2526161c
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DiskIo.h
@@ -0,0 +1,117 @@
+/** @file
+ Disk IO protocol as defined in the UEFI 2.0 specification.
+
+ The Disk IO protocol is used to convert block oriented devices into byte
+ oriented devices. The Disk IO protocol is intended to layer on top of the
+ Block IO protocol.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __DISK_IO_H__
+#define __DISK_IO_H__
+
+#define EFI_DISK_IO_PROTOCOL_GUID \
+ { \
+ 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+ }
+
+///
+/// Protocol GUID name defined in EFI1.1.
+///
+#define DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL_GUID
+
+typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL;
+
+///
+/// Protocol defined in EFI1.1.
+///
+typedef EFI_DISK_IO_PROTOCOL EFI_DISK_IO;
+
+/**
+ Read BufferSize bytes from Offset into Buffer.
+
+ @param This Protocol instance pointer.
+ @param MediaId Id of the media, changes every time the media is replaced.
+ @param Offset The starting byte offset to read from
+ @param BufferSize Size of Buffer
+ @param Buffer Buffer containing read data
+
+ @retval EFI_SUCCESS The data was read correctly from the device.
+ @retval EFI_DEVICE_ERROR The device reported an error while performing the read.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
+ @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not
+ valid for the device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DISK_READ)(
+ IN EFI_DISK_IO_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN UINT64 Offset,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
+ );
+
+/**
+ Writes a specified number of bytes to a device.
+
+ @param This Indicates a pointer to the calling context.
+ @param MediaId ID of the medium to be written.
+ @param Offset The starting byte offset on the logical block I/O device to write.
+ @param BufferSize The size in bytes of Buffer. The number of bytes to write to the device.
+ @param Buffer A pointer to the buffer containing the data to be written.
+
+ @retval EFI_SUCCESS The data was written correctly to the device.
+ @retval EFI_WRITE_PROTECTED The device can not be written to.
+ @retval EFI_DEVICE_ERROR The device reported an error while performing the write.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
+ @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not
+ valid for the device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DISK_WRITE)(
+ IN EFI_DISK_IO_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN UINT64 Offset,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+ );
+
+#define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000
+
+///
+/// Revision defined in EFI1.1
+///
+#define EFI_DISK_IO_INTERFACE_REVISION EFI_DISK_IO_PROTOCOL_REVISION
+
+///
+/// This protocol is used to abstract Block I/O interfaces.
+///
+struct _EFI_DISK_IO_PROTOCOL {
+ ///
+ /// The revision to which the disk I/O interface adheres. All future
+ /// revisions must be backwards compatible. If a future version is not
+ /// backwards compatible, it is not the same GUID.
+ ///
+ UINT64 Revision;
+ EFI_DISK_READ ReadDisk;
+ EFI_DISK_WRITE WriteDisk;
+};
+
+extern EFI_GUID gEfiDiskIoProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DiskIo2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DiskIo2.h
new file mode 100644
index 0000000000..c2994c2fac
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DiskIo2.h
@@ -0,0 +1,172 @@
+/** @file
+ Disk I/O 2 protocol as defined in the UEFI 2.4 specification.
+
+ The Disk I/O 2 protocol defines an extension to the Disk I/O protocol to enable
+ non-blocking / asynchronous byte-oriented disk operation.
+
+ Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __DISK_IO2_H__
+#define __DISK_IO2_H__
+
+#define EFI_DISK_IO2_PROTOCOL_GUID \
+ { \
+ 0x151c8eae, 0x7f2c, 0x472c, 0x9e, 0x54, 0x98, 0x28, 0x19, 0x4f, 0x6a, 0x88 \
+ }
+
+typedef struct _EFI_DISK_IO2_PROTOCOL EFI_DISK_IO2_PROTOCOL;
+
+/**
+ The struct of Disk IO2 Token.
+**/
+typedef struct {
+ //
+ // If Event is NULL, then blocking I/O is performed.
+ // If Event is not NULL and non-blocking I/O is supported, then non-blocking I/O is performed,
+ // and Event will be signaled when the I/O request is completed.
+ // The caller must be prepared to handle the case where the callback associated with Event occurs
+ // before the original asynchronous I/O request call returns.
+ //
+ EFI_EVENT Event;
+
+ //
+ // Defines whether or not the signaled event encountered an error.
+ //
+ EFI_STATUS TransactionStatus;
+} EFI_DISK_IO2_TOKEN;
+
+/**
+ Terminate outstanding asynchronous requests to a device.
+
+ @param This Indicates a pointer to the calling context.
+
+ @retval EFI_SUCCESS All outstanding requests were successfully terminated.
+ @retval EFI_DEVICE_ERROR The device reported an error while performing the cancel
+ operation.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DISK_CANCEL_EX) (
+ IN EFI_DISK_IO2_PROTOCOL *This
+ );
+
+/**
+ Reads a specified number of bytes from a device.
+
+ @param This Indicates a pointer to the calling context.
+ @param MediaId ID of the medium to be read.
+ @param Offset The starting byte offset on the logical block I/O device to read from.
+ @param Token A pointer to the token associated with the transaction.
+ If this field is NULL, synchronous/blocking IO is performed.
+ @param BufferSize The size in bytes of Buffer. The number of bytes to read from the device.
+ @param Buffer A pointer to the destination buffer for the data.
+ The caller is responsible either having implicit or explicit ownership of the buffer.
+
+ @retval EFI_SUCCESS If Event is NULL (blocking I/O): The data was read correctly from the device.
+ If Event is not NULL (asynchronous I/O): The request was successfully queued for processing.
+ Event will be signaled upon completion.
+ @retval EFI_DEVICE_ERROR The device reported an error while performing the write.
+ @retval EFI_NO_MEDIA There is no medium in the device.
+ @retval EFI_MEDIA_CHNAGED The MediaId is not for the current medium.
+ @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not valid for the device.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DISK_READ_EX) (
+ IN EFI_DISK_IO2_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN UINT64 Offset,
+ IN OUT EFI_DISK_IO2_TOKEN *Token,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
+ );
+
+/**
+ Writes a specified number of bytes to a device.
+
+ @param This Indicates a pointer to the calling context.
+ @param MediaId ID of the medium to be written.
+ @param Offset The starting byte offset on the logical block I/O device to write to.
+ @param Token A pointer to the token associated with the transaction.
+ If this field is NULL, synchronous/blocking IO is performed.
+ @param BufferSize The size in bytes of Buffer. The number of bytes to write to the device.
+ @param Buffer A pointer to the buffer containing the data to be written.
+
+ @retval EFI_SUCCESS If Event is NULL (blocking I/O): The data was written correctly to the device.
+ If Event is not NULL (asynchronous I/O): The request was successfully queued for processing.
+ Event will be signaled upon completion.
+ @retval EFI_WRITE_PROTECTED The device cannot be written to.
+ @retval EFI_DEVICE_ERROR The device reported an error while performing the write operation.
+ @retval EFI_NO_MEDIA There is no medium in the device.
+ @retval EFI_MEDIA_CHNAGED The MediaId is not for the current medium.
+ @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not valid for the device.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DISK_WRITE_EX) (
+ IN EFI_DISK_IO2_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN UINT64 Offset,
+ IN OUT EFI_DISK_IO2_TOKEN *Token,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+ );
+
+/**
+ Flushes all modified data to the physical device.
+
+ @param This Indicates a pointer to the calling context.
+ @param MediaId ID of the medium to be written.
+ @param Token A pointer to the token associated with the transaction.
+ If this field is NULL, synchronous/blocking IO is performed.
+
+ @retval EFI_SUCCESS If Event is NULL (blocking I/O): The data was flushed successfully to the device.
+ If Event is not NULL (asynchronous I/O): The request was successfully queued for processing.
+ Event will be signaled upon completion.
+ @retval EFI_WRITE_PROTECTED The device cannot be written to.
+ @retval EFI_DEVICE_ERROR The device reported an error while performing the write operation.
+ @retval EFI_NO_MEDIA There is no medium in the device.
+ @retval EFI_MEDIA_CHNAGED The MediaId is not for the current medium.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DISK_FLUSH_EX) (
+ IN EFI_DISK_IO2_PROTOCOL *This,
+ IN OUT EFI_DISK_IO2_TOKEN *Token
+ );
+
+#define EFI_DISK_IO2_PROTOCOL_REVISION 0x00020000
+
+///
+/// This protocol is used to abstract Block I/O interfaces.
+///
+struct _EFI_DISK_IO2_PROTOCOL {
+ ///
+ /// The revision to which the disk I/O interface adheres. All future
+ /// revisions must be backwards compatible. If a future version is not
+ /// backwards compatible, it is not the same GUID.
+ ///
+ UINT64 Revision;
+ EFI_DISK_CANCEL_EX Cancel;
+ EFI_DISK_READ_EX ReadDiskEx;
+ EFI_DISK_WRITE_EX WriteDiskEx;
+ EFI_DISK_FLUSH_EX FlushDiskEx;
+};
+
+extern EFI_GUID gEfiDiskIo2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dns4.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dns4.h
new file mode 100644
index 0000000000..61c8e5c38a
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dns4.h
@@ -0,0 +1,543 @@
+/** @file
+ This file defines the EFI Domain Name Service Binding Protocol interface. It is split
+ into the following two main sections:
+ DNSv4 Service Binding Protocol (DNSv4SB)
+ DNSv4 Protocol (DNSv4)
+
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_DNS4_PROTOCOL_H__
+#define __EFI_DNS4_PROTOCOL_H__
+
+#define EFI_DNS4_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0xb625b186, 0xe063, 0x44f7, {0x89, 0x5, 0x6a, 0x74, 0xdc, 0x6f, 0x52, 0xb4 } \
+ }
+
+#define EFI_DNS4_PROTOCOL_GUID \
+ { \
+ 0xae3d28cc, 0xe05b, 0x4fa1, {0xa0, 0x11, 0x7e, 0xb5, 0x5a, 0x3f, 0x14, 0x1 } \
+ }
+
+typedef struct _EFI_DNS4_PROTOCOL EFI_DNS4_PROTOCOL;
+
+///
+/// EFI_DNS4_CONFIG_DATA
+///
+typedef struct {
+ ///
+ /// Count of the DNS servers. When used with GetModeData(),
+ /// this field is the count of originally configured servers when
+ /// Configure() was called for this instance. When used with
+ /// Configure() this is the count of caller-supplied servers. If the
+ /// DnsServerListCount is zero, the DNS server configuration
+ /// will be retrieved from DHCP server automatically.
+ ///
+ UINTN DnsServerListCount;
+ ///
+ /// Pointer to DNS server list containing DnsServerListCount entries or NULL
+ /// if DnsServerListCountis 0. For Configure(), this will be NULL when there are
+ /// no caller supplied server addresses, and, the DNS instance will retrieve
+ /// DNS server from DHCP Server. The provided DNS server list is
+ /// recommended to be filled up in the sequence of preference. When
+ /// used with GetModeData(), the buffer containing the list will
+ /// be allocated by the driver implementing this protocol and must be
+ /// freed by the caller. When used with Configure(), the buffer
+ /// containing the list will be allocated and released by the caller.
+ ///
+ EFI_IPv4_ADDRESS *DnsServerList;
+ ///
+ /// Set to TRUE to use the default IP address/subnet mask and default routing table.
+ ///
+ BOOLEAN UseDefaultSetting;
+ ///
+ /// If TRUE, enable DNS cache function for this DNS instance. If FALSE, all DNS
+ /// query will not lookup local DNS cache.
+ ///
+ BOOLEAN EnableDnsCache;
+ ///
+ /// Use the protocol number defined in "Links to UEFI-Related
+ /// Documents"(http://uefi.org/uefi) under the heading "IANA
+ /// Protocol Numbers". Only TCP or UDP are supported, and other
+ /// protocol values are invalid. An implementation can choose to
+ /// support only UDP, or both TCP and UDP.
+ ///
+ UINT8 Protocol;
+ ///
+ /// If UseDefaultSetting is FALSE indicates the station address to use.
+ ///
+ EFI_IPv4_ADDRESS StationIp;
+ ///
+ /// If UseDefaultSetting is FALSE indicates the subnet mask to use.
+ ///
+ EFI_IPv4_ADDRESS SubnetMask;
+ ///
+ /// Local port number. Set to zero to use the automatically assigned port number.
+ ///
+ UINT16 LocalPort;
+ ///
+ /// Retry number if no response received after RetryInterval.
+ ///
+ UINT32 RetryCount;
+ ///
+ /// Minimum interval of retry is 2 second. If the retry interval is less than 2
+ /// seconds, then use the 2 seconds.
+ ///
+ UINT32 RetryInterval;
+} EFI_DNS4_CONFIG_DATA;
+
+
+///
+/// EFI_DNS4_CACHE_ENTRY
+///
+typedef struct {
+ ///
+ /// Host name.
+ ///
+ CHAR16 *HostName;
+ ///
+ /// IP address of this host.
+ ///
+ EFI_IPv4_ADDRESS *IpAddress;
+ ///
+ /// Time in second unit that this entry will remain in DNS cache. A value of zero
+ /// means that this entry is permanent. A nonzero value will override the existing
+ /// one if this entry to be added is dynamic entry. Implementations may set its
+ /// default timeout value for the dynamically created DNS cache entry after one DNS
+ /// resolve succeeds.
+ ///
+ UINT32 Timeout;
+} EFI_DNS4_CACHE_ENTRY;
+
+///
+/// EFI_DNS4_MODE_DATA
+///
+typedef struct {
+ ///
+ /// The configuration data of this instance.
+ ///
+ EFI_DNS4_CONFIG_DATA DnsConfigData;
+ ///
+ /// Number of configured DNS server. Each DNS instance has its own DNS server
+ /// configuration.
+ ///
+ UINT32 DnsServerCount;
+ ///
+ /// Pointer to common list of addresses of all configured DNS server
+ /// used by EFI_DNS4_PROTOCOL instances. List will include
+ /// DNS servers configured by this or any other EFI_DNS4_PROTOCOL instance.
+ /// The storage for this list is allocated by the driver publishing this
+ /// protocol, and must be freed by the caller.
+ ///
+ EFI_IPv4_ADDRESS *DnsServerList;
+ ///
+ /// Number of DNS Cache entries. The DNS Cache is shared among all DNS instances.
+ ///
+ UINT32 DnsCacheCount;
+ ///
+ /// Pointer to a buffer containing DnsCacheCount DNS Cache
+ /// entry structures. The storage for this list is allocated by the driver
+ /// publishing this protocol and must be freed by caller.
+ ///
+ EFI_DNS4_CACHE_ENTRY *DnsCacheList;
+} EFI_DNS4_MODE_DATA;
+
+///
+/// DNS_HOST_TO_ADDR_DATA
+///
+typedef struct {
+ ///
+ /// Number of the returned IP addresses.
+ ///
+ UINT32 IpCount;
+ ///
+ /// Pointer to the all the returned IP addresses.
+ ///
+ EFI_IPv4_ADDRESS *IpList;
+} DNS_HOST_TO_ADDR_DATA;
+
+///
+/// DNS_ADDR_TO_HOST_DATA
+///
+typedef struct {
+ ///
+ /// Pointer to the primary name for this host address. It's the caller's
+ /// responsibility to free the response memory.
+ ///
+ CHAR16 *HostName;
+} DNS_ADDR_TO_HOST_DATA;
+
+///
+/// DNS_RESOURCE_RECORD
+///
+typedef struct {
+ ///
+ /// The Owner name.
+ ///
+ CHAR8 *QName;
+ ///
+ /// The Type Code of this RR.
+ ///
+ UINT16 QType;
+ ///
+ /// The CLASS code of this RR.
+ ///
+ UINT16 QClass;
+ ///
+ /// 32 bit integer which specify the time interval that the resource record may be
+ /// cached before the source of the information should again be consulted. Zero means
+ /// this RR can not be cached.
+ ///
+ UINT32 TTL;
+ ///
+ /// 16 big integer which specify the length of RData.
+ ///
+ UINT16 DataLength;
+ ///
+ /// A string of octets that describe the resource, the format of this information
+ /// varies according to QType and QClass difference.
+ ///
+ CHAR8 *RData;
+} DNS_RESOURCE_RECORD;
+
+///
+/// DNS_GENERAL_LOOKUP_DATA
+///
+typedef struct {
+ ///
+ /// Number of returned matching RRs.
+ ///
+ UINTN RRCount;
+ ///
+ /// Pointer to the all the returned matching RRs. It's caller responsibility to free
+ /// the allocated memory to hold the returned RRs.
+ ///
+ DNS_RESOURCE_RECORD *RRList;
+} DNS_GENERAL_LOOKUP_DATA;
+
+///
+/// EFI_DNS4_COMPLETION_TOKEN
+///
+typedef struct {
+ ///
+ /// This Event will be signaled after the Status field is updated by the EFI DNS
+ /// protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// Will be set to one of the following values:
+ /// EFI_SUCCESS: The host name to address translation completed successfully.
+ /// EFI_NOT_FOUND: No matching Resource Record (RR) is found.
+ /// EFI_TIMEOUT: No DNS server reachable, or RetryCount was exhausted without
+ /// response from all specified DNS servers.
+ /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.
+ /// EFI_NO_MEDIA: There was a media error.
+ ///
+ EFI_STATUS Status;
+ ///
+ /// Retry number if no response received after RetryInterval. If zero, use the
+ /// parameter configured through Dns.Configure() interface.
+ ///
+ UINT32 RetryCount;
+ ///
+ /// Minimum interval of retry is 2 second. If the retry interval is less than 2
+ /// seconds, then use the 2 seconds. If zero, use the parameter configured through
+ /// Dns.Configure() interface.
+ UINT32 RetryInterval;
+ ///
+ /// DNSv4 completion token data
+ ///
+ union {
+ ///
+ /// When the Token is used for host name to address translation, H2AData is a pointer
+ /// to the DNS_HOST_TO_ADDR_DATA.
+ ///
+ DNS_HOST_TO_ADDR_DATA *H2AData;
+ ///
+ /// When the Token is used for host address to host name translation, A2HData is a
+ /// pointer to the DNS_ADDR_TO_HOST_DATA.
+ ///
+ DNS_ADDR_TO_HOST_DATA *A2HData;
+ ///
+ /// When the Token is used for a general lookup function, GLookupDATA is a pointer to
+ /// the DNS_GENERAL_LOOKUP_DATA.
+ ///
+ DNS_GENERAL_LOOKUP_DATA *GLookupData;
+ } RspData;
+} EFI_DNS4_COMPLETION_TOKEN;
+
+/**
+ Retrieve mode data of this DNS instance.
+
+ This function is used to retrieve DNS mode data for this DNS instance.
+
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
+ @param[out] DnsModeData Point to the mode data.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data
+ is available because this instance has not been
+ configured.
+ @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS4_GET_MODE_DATA) (
+ IN EFI_DNS4_PROTOCOL *This,
+ OUT EFI_DNS4_MODE_DATA *DnsModeData
+ );
+
+/**
+ Configure this DNS instance.
+
+ This function is used to configure DNS mode data for this DNS instance.
+
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
+ @param[in] DnsConfigData Point to the Configuration data.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_UNSUPPORTED The designated protocol is not supported.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ The StationIp address provided in DnsConfigData is not a
+ valid unicast.
+ DnsServerList is NULL while DnsServerListCount
+ is not ZERO.
+ DnsServerListCount is ZERO while DnsServerList
+ is not NULL
+ @retval EFI_OUT_OF_RESOURCES The DNS instance data or required space could not be
+ allocated.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The
+ EFI DNSv4 Protocol instance is not configured.
+ @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To
+ reconfigure the instance the caller must call Configure()
+ with NULL first to return driver to unconfigured state.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS4_CONFIGURE) (
+ IN EFI_DNS4_PROTOCOL *This,
+ IN EFI_DNS4_CONFIG_DATA *DnsConfigData
+ );
+
+/**
+ Host name to host address translation.
+
+ The HostNameToIp () function is used to translate the host name to host IP address. A
+ type A query is used to get the one or more IP addresses for this host.
+
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
+ @param[in] HostName Host name.
+ @param[in] Token Point to the completion token to translate host name
+ to host address.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Token is NULL.
+ Token.Event is NULL.
+ HostName is NULL. HostName string is unsupported format.
+ @retval EFI_NO_MAPPING There's no source address is available for use.
+ @retval EFI_NOT_STARTED This instance has not been started.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS4_HOST_NAME_TO_IP) (
+ IN EFI_DNS4_PROTOCOL *This,
+ IN CHAR16 *HostName,
+ IN EFI_DNS4_COMPLETION_TOKEN *Token
+ );
+
+/**
+ IPv4 address to host name translation also known as Reverse DNS lookup.
+
+ The IpToHostName() function is used to translate the host address to host name. A type PTR
+ query is used to get the primary name of the host. Support of this function is optional.
+
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
+ @param[in] IpAddress Ip Address.
+ @param[in] Token Point to the completion token to translate host
+ address to host name.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_UNSUPPORTED This function is not supported.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Token is NULL.
+ Token.Event is NULL.
+ IpAddress is not valid IP address .
+ @retval EFI_NO_MAPPING There's no source address is available for use.
+ @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS4_IP_TO_HOST_NAME) (
+ IN EFI_DNS4_PROTOCOL *This,
+ IN EFI_IPv4_ADDRESS IpAddress,
+ IN EFI_DNS4_COMPLETION_TOKEN *Token
+ );
+
+/**
+ Retrieve arbitrary information from the DNS server.
+
+ This GeneralLookup() function retrieves arbitrary information from the DNS. The caller
+ supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All
+ RR content (e.g., TTL) was returned. The caller need parse the returned RR to get
+ required information. The function is optional.
+
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
+ @param[in] QName Pointer to Query Name.
+ @param[in] QType Query Type.
+ @param[in] QClass Query Name.
+ @param[in] Token Point to the completion token to retrieve arbitrary
+ information.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_UNSUPPORTED This function is not supported. Or the requested
+ QType is not supported
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Token is NULL.
+ Token.Event is NULL.
+ QName is NULL.
+ @retval EFI_NO_MAPPING There's no source address is available for use.
+ @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS4_GENERAL_LOOKUP) (
+ IN EFI_DNS4_PROTOCOL *This,
+ IN CHAR8 *QName,
+ IN UINT16 QType,
+ IN UINT16 QClass,
+ IN EFI_DNS4_COMPLETION_TOKEN *Token
+ );
+
+/**
+ This function is to update the DNS Cache.
+
+ The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache
+ can be normally dynamically updated after the DNS resolve succeeds. This function
+ provided capability to manually add/delete/modify the DNS cache.
+
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
+ @param[in] DeleteFlag If FALSE, this function is to add one entry to the
+ DNS Cahce. If TRUE, this function will delete
+ matching DNS Cache entry.
+ @param[in] Override If TRUE, the maching DNS cache entry will be
+ overwritten with the supplied parameter. If FALSE,
+ EFI_ACCESS_DENIED will be returned if the entry to
+ be added is already existed.
+ @param[in] DnsCacheEntry Pointer to DNS Cache entry.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ DnsCacheEntry.HostName is NULL.
+ DnsCacheEntry.IpAddress is NULL.
+ DnsCacheEntry.Timeout is zero.
+ @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is
+ not TRUE.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS4_UPDATE_DNS_CACHE) (
+ IN EFI_DNS4_PROTOCOL *This,
+ IN BOOLEAN DeleteFlag,
+ IN BOOLEAN Override,
+ IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry
+ );
+
+/**
+ Polls for incoming data packets and processes outgoing data packets.
+
+ The Poll() function can be used by network drivers and applications to increase the
+ rate that data packets are moved between the communications device and the transmit
+ and receive queues.
+ In some systems, the periodic timer event in the managed network driver may not poll
+ the underlying communications device fast enough to transmit and/or receive all data
+ packets without missing incoming packets or dropping outgoing packets. Drivers and
+ applications that are experiencing packet loss should try calling the Poll()
+ function more often.
+
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive
+ queue. Consider increasing the polling rate.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS4_POLL) (
+ IN EFI_DNS4_PROTOCOL *This
+ );
+
+/**
+ Abort an asynchronous DNS operation, including translation between IP and Host, and
+ general look up behavior.
+
+ The Cancel() function is used to abort a pending resolution request. After calling
+ this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be
+ signaled. If the token is not in one of the queues, which usually means that the
+ asynchronous operation has completed, this function will not signal the token and
+ EFI_NOT_FOUND is returned.
+
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
+ @param[in] Token Pointer to a token that has been issued by
+ EFI_DNS4_PROTOCOL.HostNameToIp (),
+ EFI_DNS4_PROTOCOL.IpToHostName() or
+ EFI_DNS4_PROTOCOL.GeneralLookup().
+ If NULL, all pending tokens are aborted.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_NOT_STARTED This EFI DNS4 Protocol instance has not been started.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS
+ operation was not found in the transmit queue. It
+ was either completed or was not issued by
+ HostNameToIp(), IpToHostName() or GeneralLookup().
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS4_CANCEL) (
+ IN EFI_DNS4_PROTOCOL *This,
+ IN EFI_DNS4_COMPLETION_TOKEN *Token
+ );
+
+///
+/// The EFI_DNS4_Protocol provides the function to get the host name and address
+/// mapping, also provides pass through interface to retrieve arbitrary information
+/// from DNS.
+///
+struct _EFI_DNS4_PROTOCOL {
+ EFI_DNS4_GET_MODE_DATA GetModeData;
+ EFI_DNS4_CONFIGURE Configure;
+ EFI_DNS4_HOST_NAME_TO_IP HostNameToIp;
+ EFI_DNS4_IP_TO_HOST_NAME IpToHostName;
+ EFI_DNS4_GENERAL_LOOKUP GeneralLookUp;
+ EFI_DNS4_UPDATE_DNS_CACHE UpdateDnsCache;
+ EFI_DNS4_POLL Poll;
+ EFI_DNS4_CANCEL Cancel;
+};
+
+extern EFI_GUID gEfiDns4ServiceBindingProtocolGuid;
+extern EFI_GUID gEfiDns4ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dns6.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dns6.h
new file mode 100644
index 0000000000..bf8814606e
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Dns6.h
@@ -0,0 +1,539 @@
+/** @file
+ This file defines the EFI DNSv6 (Domain Name Service version 6) Protocol. It is split
+ into the following two main sections:
+ DNSv6 Service Binding Protocol (DNSv6SB)
+ DNSv6 Protocol (DNSv6)
+
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_DNS6_PROTOCOL_H__
+#define __EFI_DNS6_PROTOCOL_H__
+
+#define EFI_DNS6_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0x7f1647c8, 0xb76e, 0x44b2, {0xa5, 0x65, 0xf7, 0xf, 0xf1, 0x9c, 0xd1, 0x9e } \
+ }
+
+#define EFI_DNS6_PROTOCOL_GUID \
+ { \
+ 0xca37bc1f, 0xa327, 0x4ae9, {0x82, 0x8a, 0x8c, 0x40, 0xd8, 0x50, 0x6a, 0x17 } \
+ }
+
+typedef struct _EFI_DNS6_PROTOCOL EFI_DNS6_PROTOCOL;
+
+///
+/// EFI_DNS6_CONFIG_DATA
+///
+typedef struct {
+ ///
+ /// If TRUE, enable DNS cache function for this DNS instance. If FALSE, all DNS query
+ /// will not lookup local DNS cache.
+ ///
+ BOOLEAN EnableDnsCache;
+ ///
+ /// Use the protocol number defined in
+ /// http://www.iana.org/assignments/protocol-numbers. Beside TCP/UDP, Other protocol
+ /// is invalid value. An implementation can choose to support UDP, or both TCP and UDP.
+ ///
+ UINT8 Protocol;
+ ///
+ /// The local IP address to use. Set to zero to let the underlying IPv6
+ /// driver choose a source address. If not zero it must be one of the
+ /// configured IP addresses in the underlying IPv6 driver.
+ ///
+ EFI_IPv6_ADDRESS StationIp;
+ ///
+ /// Local port number. Set to zero to use the automatically assigned port number.
+ ///
+ UINT16 LocalPort;
+ ///
+ /// Count of the DNS servers. When used with GetModeData(),
+ /// this field is the count of originally configured servers when
+ /// Configure() was called for this instance. When used with
+ /// Configure() this is the count of caller-supplied servers. If the
+ /// DnsServerListCount is zero, the DNS server configuration
+ /// will be retrieved from DHCP server automatically.
+ ///
+ UINT32 DnsServerCount;
+ ///
+ /// Pointer to DNS server list containing DnsServerListCount
+ /// entries or NULL if DnsServerListCount is 0. For Configure(),
+ /// this will be NULL when there are no caller supplied server addresses
+ /// and the DNS instance will retrieve DNS server from DHCP Server.
+ /// The provided DNS server list is recommended to be filled up in the sequence
+ /// of preference. When used with GetModeData(), the buffer containing the list
+ /// will be allocated by the driver implementing this protocol and must be
+ /// freed by the caller. When used with Configure(), the buffer
+ /// containing the list will be allocated and released by the caller.
+ ///
+ EFI_IPv6_ADDRESS *DnsServerList;
+ ///
+ /// Retry number if no response received after RetryInterval.
+ ///
+ UINT32 RetryCount;
+ ///
+ /// Minimum interval of retry is 2 second. If the retry interval is less than 2
+ /// seconds, then use the 2 seconds.
+ UINT32 RetryInterval;
+} EFI_DNS6_CONFIG_DATA;
+
+///
+/// EFI_DNS6_CACHE_ENTRY
+///
+typedef struct {
+ ///
+ /// Host name. This should be interpreted as Unicode characters.
+ ///
+ CHAR16 *HostName;
+ ///
+ /// IP address of this host.
+ ///
+ EFI_IPv6_ADDRESS *IpAddress;
+ ///
+ /// Time in second unit that this entry will remain in DNS cache. A value of zero means
+ /// that this entry is permanent. A nonzero value will override the existing one if
+ /// this entry to be added is dynamic entry. Implementations may set its default
+ /// timeout value for the dynamically created DNS cache entry after one DNS resolve
+ /// succeeds.
+ UINT32 Timeout;
+} EFI_DNS6_CACHE_ENTRY;
+
+///
+/// EFI_DNS6_MODE_DATA
+///
+typedef struct {
+ ///
+ /// The configuration data of this instance.
+ ///
+ EFI_DNS6_CONFIG_DATA DnsConfigData;
+ ///
+ /// Number of configured DNS6 servers.
+ ///
+ UINT32 DnsServerCount;
+ ///
+ /// Pointer to common list of addresses of all configured DNS server used by EFI_DNS6_PROTOCOL
+ /// instances. List will include DNS servers configured by this or any other EFI_DNS6_PROTOCOL
+ /// instance. The storage for this list is allocated by the driver publishing this protocol,
+ /// and must be freed by the caller.
+ ///
+ EFI_IPv6_ADDRESS *DnsServerList;
+ ///
+ /// Number of DNS Cache entries. The DNS Cache is shared among all DNS instances.
+ ///
+ UINT32 DnsCacheCount;
+ ///
+ /// Pointer to a buffer containing DnsCacheCount DNS Cache
+ /// entry structures. The storage for thislist is allocated by the driver
+ /// publishing this protocol and must be freed by caller.
+ ///
+ EFI_DNS6_CACHE_ENTRY *DnsCacheList;
+} EFI_DNS6_MODE_DATA;
+
+///
+/// DNS6_HOST_TO_ADDR_DATA
+///
+typedef struct {
+ ///
+ /// Number of the returned IP address.
+ ///
+ UINT32 IpCount;
+ ///
+ /// Pointer to the all the returned IP address.
+ ///
+ EFI_IPv6_ADDRESS *IpList;
+} DNS6_HOST_TO_ADDR_DATA;
+
+///
+/// DNS6_ADDR_TO_HOST_DATA
+///
+typedef struct {
+ ///
+ /// Pointer to the primary name for this host address. It's the caller's
+ /// responsibility to free the response memory.
+ ///
+ CHAR16 *HostName;
+} DNS6_ADDR_TO_HOST_DATA;
+
+///
+/// DNS6_RESOURCE_RECORD
+///
+typedef struct {
+ ///
+ /// The Owner name.
+ ///
+ CHAR8 *QName;
+ ///
+ /// The Type Code of this RR.
+ ///
+ UINT16 QType;
+ ///
+ /// The CLASS code of this RR.
+ ///
+ UINT16 QClass;
+ ///
+ /// 32 bit integer which specify the time interval that the resource record may be
+ /// cached before the source of the information should again be consulted. Zero means
+ /// this RR cannot be cached.
+ ///
+ UINT32 TTL;
+ ///
+ /// 16 big integer which specify the length of RData.
+ ///
+ UINT16 DataLength;
+ ///
+ /// A string of octets that describe the resource, the format of this information
+ /// varies according to QType and QClass difference.
+ ///
+ CHAR8 *RData;
+} DNS6_RESOURCE_RECORD;
+
+///
+/// DNS6_GENERAL_LOOKUP_DATA
+///
+typedef struct {
+ ///
+ /// Number of returned matching RRs.
+ ///
+ UINTN RRCount;
+ ///
+ /// Pointer to the all the returned matching RRs. It's caller responsibility to free
+ /// the allocated memory to hold the returned RRs.
+ ///
+ DNS6_RESOURCE_RECORD *RRList;
+} DNS6_GENERAL_LOOKUP_DATA;
+
+///
+/// EFI_DNS6_COMPLETION_TOKEN
+///
+typedef struct {
+ ///
+ /// This Event will be signaled after the Status field is updated by the EFI DNSv6
+ /// protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// Will be set to one of the following values:
+ /// EFI_SUCCESS: The host name to address translation completed successfully.
+ /// EFI_NOT_FOUND: No matching Resource Record (RR) is found.
+ /// EFI_TIMEOUT: No DNS server reachable, or RetryCount was exhausted without
+ /// response from all specified DNS servers.
+ /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.
+ /// EFI_NO_MEDIA: There was a media error.
+ ///
+ EFI_STATUS Status;
+ ///
+ /// The parameter configured through DNSv6.Configure() interface. Retry number if no
+ /// response received after RetryInterval.
+ ///
+ UINT32 RetryCount;
+ ///
+ /// The parameter configured through DNSv6.Configure() interface. Minimum interval of
+ /// retry is 2 seconds. If the retry interval is less than 2 seconds, then use the 2
+ /// seconds.
+ ///
+ UINT32 RetryInterval;
+ ///
+ /// DNSv6 completion token data
+ ///
+ union {
+ ///
+ /// When the Token is used for host name to address translation, H2AData is a pointer
+ /// to the DNS6_HOST_TO_ADDR_DATA.
+ ///
+ DNS6_HOST_TO_ADDR_DATA *H2AData;
+ ///
+ /// When the Token is used for host address to host name translation, A2HData is a
+ /// pointer to the DNS6_ADDR_TO_HOST_DATA.
+ ///
+ DNS6_ADDR_TO_HOST_DATA *A2HData;
+ ///
+ /// When the Token is used for a general lookup function, GLookupDATA is a pointer to
+ /// the DNS6_GENERAL_LOOKUP_DATA.
+ ///
+ DNS6_GENERAL_LOOKUP_DATA *GLookupData;
+ } RspData;
+} EFI_DNS6_COMPLETION_TOKEN;
+
+/**
+ Retrieve mode data of this DNS instance.
+
+ This function is used to retrieve DNS mode data for this DNS instance.
+
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
+ @param[out] DnsModeData Pointer to the caller-allocated storage for the
+ EFI_DNS6_MODE_DATA data.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data
+ is available because this instance has not been
+ configured.
+ @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.
+ @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_DNS6_GET_MODE_DATA)(
+ IN EFI_DNS6_PROTOCOL *This,
+ OUT EFI_DNS6_MODE_DATA *DnsModeData
+ );
+
+/**
+ Configure this DNS instance.
+
+ The Configure() function is used to set and change the configuration data for this
+ EFI DNSv6 Protocol driver instance. Reset the DNS instance if DnsConfigData is NULL.
+
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
+ @param[in] DnsConfigData Pointer to the configuration data structure. All associated
+ storage to be allocated and released by caller.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ The StationIp address provided in DnsConfigData is not zero and not a valid unicast.
+ DnsServerList is NULL while DnsServerList Count is not ZERO.
+ DnsServerList Count is ZERO while DnsServerList is not NULL.
+ @retval EFI_OUT_OF_RESOURCES The DNS instance data or required space could not be allocated.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The
+ EFI DNSv6 Protocol instance is not configured.
+ @retval EFI_UNSUPPORTED The designated protocol is not supported.
+ @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To
+ reconfigure the instance the caller must call Configure() with
+ NULL first to return driver to unconfigured state.
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_DNS6_CONFIGURE)(
+ IN EFI_DNS6_PROTOCOL *This,
+ IN EFI_DNS6_CONFIG_DATA *DnsConfigData
+ );
+
+/**
+ Host name to host address translation.
+
+ The HostNameToIp () function is used to translate the host name to host IP address. A
+ type AAAA query is used to get the one or more IPv6 addresses for this host.
+
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
+ @param[in] HostName Host name.
+ @param[in] Token Point to the completion token to translate host name
+ to host address.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Token is NULL.
+ Token.Event is NULL.
+ HostName is NULL or buffer contained unsupported characters.
+ @retval EFI_NO_MAPPING There's no source address is available for use.
+ @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.
+ @retval EFI_NOT_STARTED This instance has not been started.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS6_HOST_NAME_TO_IP) (
+ IN EFI_DNS6_PROTOCOL *This,
+ IN CHAR16 *HostName,
+ IN EFI_DNS6_COMPLETION_TOKEN *Token
+ );
+
+/**
+ Host address to host name translation.
+
+ The IpToHostName () function is used to translate the host address to host name. A
+ type PTR query is used to get the primary name of the host. Implementation can choose
+ to support this function or not.
+
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
+ @param[in] IpAddress Ip Address.
+ @param[in] Token Point to the completion token to translate host
+ address to host name.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_UNSUPPORTED This function is not supported.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Token is NULL.
+ Token.Event is NULL.
+ IpAddress is not valid IP address.
+ @retval EFI_NO_MAPPING There's no source address is available for use.
+ @retval EFI_NOT_STARTED This instance has not been started.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS6_IP_TO_HOST_NAME) (
+ IN EFI_DNS6_PROTOCOL *This,
+ IN EFI_IPv6_ADDRESS IpAddress,
+ IN EFI_DNS6_COMPLETION_TOKEN *Token
+ );
+
+/**
+ This function provides capability to retrieve arbitrary information from the DNS
+ server.
+
+ This GeneralLookup() function retrieves arbitrary information from the DNS. The caller
+ supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All
+ RR content (e.g., TTL) was returned. The caller need parse the returned RR to get
+ required information. The function is optional. Implementation can choose to support
+ it or not.
+
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
+ @param[in] QName Pointer to Query Name.
+ @param[in] QType Query Type.
+ @param[in] QClass Query Name.
+ @param[in] Token Point to the completion token to retrieve arbitrary
+ information.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_UNSUPPORTED This function is not supported. Or the requested
+ QType is not supported
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Token is NULL.
+ Token.Event is NULL.
+ QName is NULL.
+ @retval EFI_NO_MAPPING There's no source address is available for use.
+ @retval EFI_NOT_STARTED This instance has not been started.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS6_GENERAL_LOOKUP) (
+ IN EFI_DNS6_PROTOCOL *This,
+ IN CHAR8 *QName,
+ IN UINT16 QType,
+ IN UINT16 QClass,
+ IN EFI_DNS6_COMPLETION_TOKEN *Token
+ );
+
+/**
+ This function is to update the DNS Cache.
+
+ The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache
+ can be normally dynamically updated after the DNS resolve succeeds. This function
+ provided capability to manually add/delete/modify the DNS cache.
+
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
+ @param[in] DeleteFlag If FALSE, this function is to add one entry to the
+ DNS Cahce. If TRUE, this function will delete
+ matching DNS Cache entry.
+ @param[in] Override If TRUE, the maching DNS cache entry will be
+ overwritten with the supplied parameter. If FALSE,
+ EFI_ACCESS_DENIED will be returned if the entry to
+ be added is already existed.
+ @param[in] DnsCacheEntry Pointer to DNS Cache entry.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ DnsCacheEntry.HostName is NULL.
+ DnsCacheEntry.IpAddress is NULL.
+ DnsCacheEntry.Timeout is zero.
+ @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is
+ not TRUE.
+ @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS6_UPDATE_DNS_CACHE) (
+ IN EFI_DNS6_PROTOCOL *This,
+ IN BOOLEAN DeleteFlag,
+ IN BOOLEAN Override,
+ IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry
+ );
+
+/**
+ Polls for incoming data packets and processes outgoing data packets.
+
+ The Poll() function can be used by network drivers and applications to increase the
+ rate that data packets are moved between the communications device and the transmit
+ and receive queues.
+
+ In some systems, the periodic timer event in the managed network driver may not poll
+ the underlying communications device fast enough to transmit and/or receive all data
+ packets without missing incoming packets or dropping outgoing packets. Drivers and
+ applications that are experiencing packet loss should try calling the Poll()
+ function more often.
+
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NO_MAPPING There is no source address is available for use.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive
+ queue. Consider increasing the polling rate.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS6_POLL) (
+ IN EFI_DNS6_PROTOCOL *This
+ );
+
+/**
+ Abort an asynchronous DNS operation, including translation between IP and Host, and
+ general look up behavior.
+
+ The Cancel() function is used to abort a pending resolution request. After calling
+ this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be
+ signaled. If the token is not in one of the queues, which usually means that the
+ asynchronous operation has completed, this function will not signal the token and
+ EFI_NOT_FOUND is returned.
+
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
+ @param[in] Token Pointer to a token that has been issued by
+ EFI_DNS6_PROTOCOL.HostNameToIp (),
+ EFI_DNS6_PROTOCOL.IpToHostName() or
+ EFI_DNS6_PROTOCOL.GeneralLookup().
+ If NULL, all pending tokens are aborted.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_NOT_STARTED This EFI DNS6 Protocol instance has not been started.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NO_MAPPING There's no source address is available for use.
+ @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS
+ operation was not found in the transmit queue. It
+ was either completed or was not issued by
+ HostNameToIp(), IpToHostName() or GeneralLookup().
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DNS6_CANCEL) (
+ IN EFI_DNS6_PROTOCOL *This,
+ IN EFI_DNS6_COMPLETION_TOKEN *Token
+ );
+
+///
+/// The EFI_DNS6_PROTOCOL provides the function to get the host name and address
+/// mapping, also provide pass through interface to retrieve arbitrary information from
+/// DNSv6.
+///
+struct _EFI_DNS6_PROTOCOL {
+ EFI_DNS6_GET_MODE_DATA GetModeData;
+ EFI_DNS6_CONFIGURE Configure;
+ EFI_DNS6_HOST_NAME_TO_IP HostNameToIp;
+ EFI_DNS6_IP_TO_HOST_NAME IpToHostName;
+ EFI_DNS6_GENERAL_LOOKUP GeneralLookUp;
+ EFI_DNS6_UPDATE_DNS_CACHE UpdateDnsCache;
+ EFI_DNS6_POLL Poll;
+ EFI_DNS6_CANCEL Cancel;
+};
+
+extern EFI_GUID gEfiDns6ServiceBindingProtocolGuid;
+extern EFI_GUID gEfiDns6ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverBinding.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverBinding.h
new file mode 100644
index 0000000000..b325c0ccf7
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverBinding.h
@@ -0,0 +1,201 @@
+/** @file
+ UEFI DriverBinding Protocol is defined in UEFI specification.
+
+ This protocol is produced by every driver that follows the UEFI Driver Model,
+ and it is the central component that allows drivers and controllers to be managed.
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_DRIVER_BINDING_H__
+#define __EFI_DRIVER_BINDING_H__
+
+///
+/// The global ID for the ControllerHandle Driver Protocol.
+///
+#define EFI_DRIVER_BINDING_PROTOCOL_GUID \
+ { \
+ 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71 } \
+ }
+
+typedef struct _EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL;
+
+/**
+ Tests to see if this driver supports a given controller. If a child device is provided,
+ it further tests to see if this driver supports creating a handle for the specified child device.
+
+ This function checks to see if the driver specified by This supports the device specified by
+ ControllerHandle. Drivers will typically use the device path attached to
+ ControllerHandle and/or the services from the bus I/O abstraction attached to
+ ControllerHandle to determine if the driver supports ControllerHandle. This function
+ may be called many times during platform initialization. In order to reduce boot times, the tests
+ performed by this function must be very small, and take as little time as possible to execute. This
+ function must not change the state of any hardware devices, and this function must be aware that the
+ device specified by ControllerHandle may already be managed by the same driver or a
+ different driver. This function must match its calls to AllocatePages() with FreePages(),
+ AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
+ Because ControllerHandle may have been previously started by the same driver, if a protocol is
+ already in the opened state, then it must not be closed with CloseProtocol(). This is required
+ to guarantee the state of ControllerHandle is not modified by this function.
+
+ @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
+ @param[in] ControllerHandle The handle of the controller to test. This handle
+ must support a protocol interface that supplies
+ an I/O abstraction to the driver.
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
+ parameter is ignored by device drivers, and is optional for bus
+ drivers. For bus drivers, if this parameter is not NULL, then
+ the bus driver must determine if the bus controller specified
+ by ControllerHandle and the child controller specified
+ by RemainingDevicePath are both supported by this
+ bus driver.
+
+ @retval EFI_SUCCESS The device specified by ControllerHandle and
+ RemainingDevicePath is supported by the driver specified by This.
+ @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
+ RemainingDevicePath is already being managed by the driver
+ specified by This.
+ @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
+ RemainingDevicePath is already being managed by a different
+ driver or an application that requires exclusive access.
+ Currently not implemented.
+ @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
+ RemainingDevicePath is not supported by the driver specified by This.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_BINDING_SUPPORTED)(
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
+ );
+
+/**
+ Starts a device controller or a bus controller.
+
+ The Start() function is designed to be invoked from the EFI boot service ConnectController().
+ As a result, much of the error checking on the parameters to Start() has been moved into this
+ common boot service. It is legal to call Start() from other locations,
+ but the following calling restrictions must be followed, or the system behavior will not be deterministic.
+ 1. ControllerHandle must be a valid EFI_HANDLE.
+ 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
+ EFI_DEVICE_PATH_PROTOCOL.
+ 3. Prior to calling Start(), the Supported() function for the driver specified by This must
+ have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
+
+ @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
+ @param[in] ControllerHandle The handle of the controller to start. This handle
+ must support a protocol interface that supplies
+ an I/O abstraction to the driver.
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
+ parameter is ignored by device drivers, and is optional for bus
+ drivers. For a bus driver, if this parameter is NULL, then handles
+ for all the children of Controller are created by this driver.
+ If this parameter is not NULL and the first Device Path Node is
+ not the End of Device Path Node, then only the handle for the
+ child device specified by the first Device Path Node of
+ RemainingDevicePath is created by this driver.
+ If the first Device Path Node of RemainingDevicePath is
+ the End of Device Path Node, no child handle is created by this
+ driver.
+
+ @retval EFI_SUCCESS The device was started.
+ @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval Others The driver failded to start the device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_BINDING_START)(
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
+ );
+
+/**
+ Stops a device controller or a bus controller.
+
+ The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
+ As a result, much of the error checking on the parameters to Stop() has been moved
+ into this common boot service. It is legal to call Stop() from other locations,
+ but the following calling restrictions must be followed, or the system behavior will not be deterministic.
+ 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
+ same driver's Start() function.
+ 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
+ EFI_HANDLE. In addition, all of these handles must have been created in this driver's
+ Start() function, and the Start() function must have called OpenProtocol() on
+ ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
+
+ @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
+ @param[in] ControllerHandle A handle to the device being stopped. The handle must
+ support a bus specific I/O protocol for the driver
+ to use to stop the device.
+ @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
+ @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
+ if NumberOfChildren is 0.
+
+ @retval EFI_SUCCESS The device was stopped.
+ @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_BINDING_STOP)(
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN UINTN NumberOfChildren,
+ IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
+ );
+
+///
+/// This protocol provides the services required to determine if a driver supports a given controller.
+/// If a controller is supported, then it also provides routines to start and stop the controller.
+///
+struct _EFI_DRIVER_BINDING_PROTOCOL {
+ EFI_DRIVER_BINDING_SUPPORTED Supported;
+ EFI_DRIVER_BINDING_START Start;
+ EFI_DRIVER_BINDING_STOP Stop;
+
+ ///
+ /// The version number of the UEFI driver that produced the
+ /// EFI_DRIVER_BINDING_PROTOCOL. This field is used by
+ /// the EFI boot service ConnectController() to determine
+ /// the order that driver's Supported() service will be used when
+ /// a controller needs to be started. EFI Driver Binding Protocol
+ /// instances with higher Version values will be used before ones
+ /// with lower Version values. The Version values of 0x0-
+ /// 0x0f and 0xfffffff0-0xffffffff are reserved for
+ /// platform/OEM specific drivers. The Version values of 0x10-
+ /// 0xffffffef are reserved for IHV-developed drivers.
+ ///
+ UINT32 Version;
+
+ ///
+ /// The image handle of the UEFI driver that produced this instance
+ /// of the EFI_DRIVER_BINDING_PROTOCOL.
+ ///
+ EFI_HANDLE ImageHandle;
+
+ ///
+ /// The handle on which this instance of the
+ /// EFI_DRIVER_BINDING_PROTOCOL is installed. In most
+ /// cases, this is the same handle as ImageHandle. However, for
+ /// UEFI drivers that produce more than one instance of the
+ /// EFI_DRIVER_BINDING_PROTOCOL, this value may not be
+ /// the same as ImageHandle.
+ ///
+ EFI_HANDLE DriverBindingHandle;
+};
+
+extern EFI_GUID gEfiDriverBindingProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverConfiguration.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverConfiguration.h
new file mode 100644
index 0000000000..53c5296720
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverConfiguration.h
@@ -0,0 +1,167 @@
+/** @file
+ EFI Driver Configuration Protocol
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_DRIVER_CONFIGURATION_H__
+#define __EFI_DRIVER_CONFIGURATION_H__
+
+#include <Protocol/DriverConfiguration2.h>
+
+///
+/// Global ID for the Driver Configuration Protocol defined in EFI 1.1
+///
+#define EFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \
+ { \
+ 0x107a772b, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
+ }
+
+typedef struct _EFI_DRIVER_CONFIGURATION_PROTOCOL EFI_DRIVER_CONFIGURATION_PROTOCOL;
+
+/**
+ Allows the user to set controller specific options for a controller that a
+ driver is currently managing.
+
+ @param This A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.
+ @param ControllerHandle The handle of the controller to set options on.
+ @param ChildHandle The handle of the child controller to set options on. This
+ is an optional parameter that may be NULL. It will be NULL
+ for device drivers, and for bus drivers that wish to set
+ options for the bus controller. It will not be NULL for a
+ bus driver that wishes to set options for one of its child
+ controllers.
+ @param Language A pointer to a three character ISO 639-2 language identifier.
+ This is the language of the user interface that should be
+ presented to the user, and it must match one of the languages
+ specified in SupportedLanguages. The number of languages
+ supported by a driver is up to the driver writer.
+ @param ActionRequired A pointer to the action that the calling agent is required
+ to perform when this function returns. See "Related
+ Definitions" for a list of the actions that the calling
+ agent is required to perform prior to accessing
+ ControllerHandle again.
+
+ @retval EFI_SUCCESS The driver specified by This successfully set the
+ configuration options for the controller specified
+ by ControllerHandle..
+ @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER ActionRequired is NULL.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support setting
+ configuration options for the controller specified by
+ ControllerHandle and ChildHandle.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the
+ language specified by Language.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempt to set the
+ configuration options for the controller specified
+ by ControllerHandle and ChildHandle.
+ @retval EFI_OUT_RESOURCES There are not enough resources available to set the
+ configuration options for the controller specified
+ by ControllerHandle and ChildHandle.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_CONFIGURATION_SET_OPTIONS)(
+ IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN CHAR8 *Language,
+ OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
+ );
+
+/**
+ Tests to see if a controller's current configuration options are valid.
+
+ @param This A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.
+ @param ControllerHandle The handle of the controller to test if it's current
+ configuration options are valid.
+ @param ChildHandle The handle of the child controller to test if it's current
+ configuration options are valid. This is an optional
+ parameter that may be NULL. It will be NULL for device
+ drivers. It will also be NULL for bus drivers that wish
+ to test the configuration options for the bus controller.
+ It will not be NULL for a bus driver that wishes to test
+ configuration options for one of its child controllers.
+
+ @retval EFI_SUCCESS The controller specified by ControllerHandle and
+ ChildHandle that is being managed by the driver
+ specified by This has a valid set of configuration
+ options.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
+ @retval EFI_UNSUPPORTED The driver specified by This is not currently
+ managing the controller specified by ControllerHandle
+ and ChildHandle.
+ @retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and
+ ChildHandle that is being managed by the driver
+ specified by This has an invalid set of configuration
+ options.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_CONFIGURATION_OPTIONS_VALID)(
+ IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL
+ );
+
+/**
+ Forces a driver to set the default configuration options for a controller.
+
+ @param This A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.
+ @param ControllerHandle The handle of the controller to force default configuration options on.
+ @param ChildHandle The handle of the child controller to force default configuration options on This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for bus drivers that wish to force default configuration options for the bus controller. It will not be NULL for a bus driver that wishes to force default configuration options for one of its child controllers.
+ @param DefaultType The type of default configuration options to force on the controller specified by ControllerHandle and ChildHandle. See Table 9-1 for legal values. A DefaultType of 0x00000000 must be supported by this protocol.
+ @param ActionRequired A pointer to the action that the calling agent is required to perform when this function returns. See "Related Definitions" in Section 9.1 for a list of the actions that the calling agent is required to perform prior to accessing ControllerHandle again.
+
+ @retval EFI_SUCCESS The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER ActionRequired is NULL.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the configuration type specified by DefaultType.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempt to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
+ @retval EFI_OUT_RESOURCES There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS)(
+ IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN UINT32 DefaultType,
+ OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
+ );
+
+
+///
+/// Used to set configuration options for a controller that an EFI Driver is managing.
+///
+struct _EFI_DRIVER_CONFIGURATION_PROTOCOL {
+ EFI_DRIVER_CONFIGURATION_SET_OPTIONS SetOptions;
+ EFI_DRIVER_CONFIGURATION_OPTIONS_VALID OptionsValid;
+ EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS ForceDefaults;
+ ///
+ /// A Null-terminated ASCII string that contains one or more
+ /// ISO 639-2 language codes. This is the list of language
+ /// codes that this protocol supports.
+ ///
+ CHAR8 *SupportedLanguages;
+};
+
+
+extern EFI_GUID gEfiDriverConfigurationProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverConfiguration2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverConfiguration2.h
new file mode 100644
index 0000000000..1610eb4741
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverConfiguration2.h
@@ -0,0 +1,190 @@
+/** @file
+ UEFI Driver Configuration2 Protocol
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_DRIVER_CONFIGURATION2_H__
+#define __EFI_DRIVER_CONFIGURATION2_H__
+
+///
+/// Global ID for the Driver Configuration Protocol defined in UEFI 2.0
+///
+#define EFI_DRIVER_CONFIGURATION2_PROTOCOL_GUID \
+ { \
+ 0xbfd7dc1d, 0x24f1, 0x40d9, {0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe } \
+ }
+
+typedef struct _EFI_DRIVER_CONFIGURATION2_PROTOCOL EFI_DRIVER_CONFIGURATION2_PROTOCOL;
+
+typedef enum {
+ ///
+ /// The controller is still in a usable state. No actions
+ /// are required before this controller can be used again.
+ ///
+ EfiDriverConfigurationActionNone = 0,
+ ///
+ /// The driver has detected that the controller is not in a
+ /// usable state, and it needs to be stopped.
+ ///
+ EfiDriverConfigurationActionStopController = 1,
+ ///
+ /// This controller needs to be stopped and restarted
+ /// before it can be used again.
+ ///
+ EfiDriverConfigurationActionRestartController = 2,
+ ///
+ /// A configuration change has been made that requires the platform to be restarted before
+ /// the controller can be used again.
+ ///
+ EfiDriverConfigurationActionRestartPlatform = 3,
+ EfiDriverConfigurationActionMaximum
+} EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED;
+
+#define EFI_DRIVER_CONFIGURATION_SAFE_DEFAULTS 0x00000000
+#define EFI_DRIVER_CONFIGURATION_MANUFACTURING_DEFAULTS 0x00000001
+#define EFI_DRIVER_CONFIGURATION_CUSTOM_DEFAULTS 0x00000002
+#define EFI_DRIVER_CONFIGURATION_PERORMANCE_DEFAULTS 0x00000003
+
+/**
+ Allows the user to set controller specific options for a controller that a
+ driver is currently managing.
+
+ @param This A pointer to the EFI_DRIVER_CONFIGURATION2_PROTOCOL instance.
+ @param ControllerHandle The handle of the controller to set options on.
+ @param ChildHandle The handle of the child controller to set options on. This
+ is an optional parameter that may be NULL. It will be NULL
+ for device drivers, and for bus drivers that wish to set
+ options for the bus controller. It will not be NULL for a
+ bus driver that wishes to set options for one of its child
+ controllers.
+ @param Language A Null-terminated ASCII string that contains one or more RFC 4646
+ language codes. This is the list of language codes that this
+ protocol supports. The number of languages
+ supported by a driver is up to the driver writer.
+ @param ActionRequired A pointer to the action that the calling agent is required
+ to perform when this function returns. See "Related
+ Definitions" for a list of the actions that the calling
+ agent is required to perform prior to accessing
+ ControllerHandle again.
+
+ @retval EFI_SUCCESS The driver specified by This successfully set the
+ configuration options for the controller specified
+ by ControllerHandle.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER ActionRequired is NULL.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support setting
+ configuration options for the controller specified by
+ ControllerHandle and ChildHandle.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the
+ language specified by Language.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to set the
+ configuration options for the controller specified
+ by ControllerHandle and ChildHandle.
+ @retval EFI_OUT_RESOURCES There are not enough resources available to set the
+ configuration options for the controller specified
+ by ControllerHandle and ChildHandle.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_CONFIGURATION2_SET_OPTIONS)(
+ IN EFI_DRIVER_CONFIGURATION2_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN CHAR8 *Language,
+ OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
+ );
+
+/**
+ Tests to see if a controller's current configuration options are valid.
+
+ @param This A pointer to the EFI_DRIVER_CONFIGURATION2_PROTOCOL instance.
+ @param ControllerHandle The handle of the controller to test if it's current
+ configuration options are valid.
+ @param ChildHandle The handle of the child controller to test if it's current
+ configuration options are valid. This is an optional
+ parameter that may be NULL. It will be NULL for device
+ drivers. It will also be NULL for bus drivers that wish
+ to test the configuration options for the bus controller.
+ It will not be NULL for a bus driver that wishes to test
+ configuration options for one of its child controllers.
+
+ @retval EFI_SUCCESS The controller specified by ControllerHandle and
+ ChildHandle that is being managed by the driver
+ specified by This has a valid set of configuration
+ options.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
+ @retval EFI_UNSUPPORTED The driver specified by This is not currently
+ managing the controller specified by ControllerHandle
+ and ChildHandle.
+ @retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and
+ ChildHandle that is being managed by the driver
+ specified by This has an invalid set of configuration
+ options.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_CONFIGURATION2_OPTIONS_VALID)(
+ IN EFI_DRIVER_CONFIGURATION2_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL
+ );
+
+/**
+ Forces a driver to set the default configuration options for a controller.
+
+ @param This A pointer to the EFI_DRIVER_CONFIGURATION2_PROTOCOL instance.
+ @param ControllerHandle The handle of the controller to force default configuration options on.
+ @param ChildHandle The handle of the child controller to force default configuration options on This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for bus drivers that wish to force default configuration options for the bus controller. It will not be NULL for a bus driver that wishes to force default configuration options for one of its child controllers.
+ @param DefaultType The type of default configuration options to force on the controller specified by ControllerHandle and ChildHandle. See Table 9-1 for legal values. A DefaultType of 0x00000000 must be supported by this protocol.
+ @param ActionRequired A pointer to the action that the calling agent is required to perform when this function returns. See "Related Definitions" in Section 9.1 for a list of the actions that the calling agent is required to perform prior to accessing ControllerHandle again.
+
+ @retval EFI_SUCCESS The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER ActionRequired is NULL.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the configuration type specified by DefaultType.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempt to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
+ @retval EFI_OUT_RESOURCES There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_CONFIGURATION2_FORCE_DEFAULTS)(
+ IN EFI_DRIVER_CONFIGURATION2_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN UINT32 DefaultType,
+ OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
+ );
+
+///
+/// Used to set configuration options for a controller that an EFI Driver is managing.
+///
+struct _EFI_DRIVER_CONFIGURATION2_PROTOCOL {
+ EFI_DRIVER_CONFIGURATION2_SET_OPTIONS SetOptions;
+ EFI_DRIVER_CONFIGURATION2_OPTIONS_VALID OptionsValid;
+ EFI_DRIVER_CONFIGURATION2_FORCE_DEFAULTS ForceDefaults;
+ ///
+ /// A Null-terminated ASCII string that contains one or more RFC 4646
+ /// language codes. This is the list of language codes that this protocol supports.
+ ///
+ CHAR8 *SupportedLanguages;
+};
+
+extern EFI_GUID gEfiDriverConfiguration2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverDiagnostics.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverDiagnostics.h
new file mode 100644
index 0000000000..431b649223
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverDiagnostics.h
@@ -0,0 +1,131 @@
+/** @file
+ EFI Driver Diagnostics Protocol
+
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_DRIVER_DIAGNOSTICS_H__
+#define __EFI_DRIVER_DIAGNOSTICS_H__
+
+///
+/// The global ID for the Driver Diagnostics Protocol as defined in EFI 1.1.
+///
+#define EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \
+ { \
+ 0x0784924f, 0xe296, 0x11d4, {0x9a, 0x49, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
+ }
+
+typedef struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL EFI_DRIVER_DIAGNOSTICS_PROTOCOL;
+
+typedef enum {
+ ///
+ /// Performs standard diagnostics on the controller.
+ ///
+ EfiDriverDiagnosticTypeStandard = 0,
+ ///
+ /// This is an optional diagnostic type that performs diagnostics on the controller that may
+ /// take an extended amount of time to execute.
+ ///
+ EfiDriverDiagnosticTypeExtended = 1,
+ ///
+ /// This is an optional diagnostic type that performs diagnostics on the controller that are
+ /// suitable for a manufacturing and test environment.
+ ///
+ EfiDriverDiagnosticTypeManufacturing= 2,
+ ///
+ /// This is an optional diagnostic type that would only be used in the situation where an
+ /// EFI_NOT_READY had been returned by a previous call to RunDiagnostics()
+ /// and there is a desire to cancel the current running diagnostics operation.
+ ///
+ EfiDriverDiagnosticTypeCancel = 3,
+ EfiDriverDiagnosticTypeMaximum
+} EFI_DRIVER_DIAGNOSTIC_TYPE;
+
+/**
+ Runs diagnostics on a controller.
+
+ @param This A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.
+ @param ControllerHandle The handle of the controller to run diagnostics on.
+ @param ChildHandle The handle of the child controller to run diagnostics on
+ This is an optional parameter that may be NULL. It will
+ be NULL for device drivers. It will also be NULL for a
+ bus drivers that wish to run diagnostics on the bus
+ controller. It will not be NULL for a bus driver that
+ wishes to run diagnostics on one of its child controllers.
+ @param DiagnosticType Indicates type of diagnostics to perform on the controller
+ specified by ControllerHandle and ChildHandle. See
+ "Related Definitions" for the list of supported types.
+ @param Language A pointer to a three character ISO 639-2 language
+ identifier. This is the language in which the optional
+ error message should be returned in Buffer, and it must
+ match one of the languages specified in SupportedLanguages.
+ The number of languages supported by a driver is up to
+ the driver writer.
+ @param ErrorType A GUID that defines the format of the data returned in Buffer.
+ @param BufferSize The size, in bytes, of the data returned in Buffer.
+ @param Buffer A buffer that contains a Null-terminated string
+ plus some additional data whose format is defined by
+ ErrorType. Buffer is allocated by this function with
+ AllocatePool(), and it is the caller's responsibility
+ to free it with a call to FreePool().
+
+ @retval EFI_SUCCESS The controller specified by ControllerHandle and
+ ChildHandle passed the diagnostic.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL, and it is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER Language is NULL.
+ @retval EFI_INVALID_PARAMETER ErrorType is NULL.
+ @retval EFI_INVALID_PARAMETER BufferType is NULL.
+ @retval EFI_INVALID_PARAMETER Buffer is NULL.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support
+ running diagnostics for the controller specified
+ by ControllerHandle and ChildHandle.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the
+ type of diagnostic specified by DiagnosticType.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the
+ language specified by Language.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to complete
+ the diagnostics.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to return
+ the status information in ErrorType, BufferSize,
+ and Buffer.
+ @retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and
+ ChildHandle did not pass the diagnostic.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS)(
+ IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,
+ IN CHAR8 *Language,
+ OUT EFI_GUID **ErrorType,
+ OUT UINTN *BufferSize,
+ OUT CHAR16 **Buffer
+ );
+
+///
+/// Used to perform diagnostics on a controller that an EFI Driver is managing.
+///
+struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL {
+ EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS RunDiagnostics;
+ ///
+ /// A Null-terminated ASCII string that contains one or more ISO 639-2
+ /// language codes. This is the list of language codes that this protocol supports.
+ ///
+ CHAR8 *SupportedLanguages;
+};
+
+extern EFI_GUID gEfiDriverDiagnosticsProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverDiagnostics2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverDiagnostics2.h
new file mode 100644
index 0000000000..78d5ec6fe9
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverDiagnostics2.h
@@ -0,0 +1,111 @@
+/** @file
+ UEFI Driver Diagnostics2 Protocol
+
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_DRIVER_DIAGNOSTICS2_H__
+#define __EFI_DRIVER_DIAGNOSTICS2_H__
+
+#include <Protocol/DriverDiagnostics.h>
+
+#define EFI_DRIVER_DIAGNOSTICS2_PROTOCOL_GUID \
+ { \
+ 0x4d330321, 0x025f, 0x4aac, {0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63 } \
+ }
+
+typedef struct _EFI_DRIVER_DIAGNOSTICS2_PROTOCOL EFI_DRIVER_DIAGNOSTICS2_PROTOCOL;
+
+/**
+ Runs diagnostics on a controller.
+
+ @param This A pointer to the EFI_DRIVER_DIAGNOSTICS2_PROTOCOL instance.
+ @param ControllerHandle The handle of the controller to run diagnostics on.
+ @param ChildHandle The handle of the child controller to run diagnostics on
+ This is an optional parameter that may be NULL. It will
+ be NULL for device drivers. It will also be NULL for
+ bus drivers that wish to run diagnostics on the bus
+ controller. It will not be NULL for a bus driver that
+ wishes to run diagnostics on one of its child controllers.
+ @param DiagnosticType Indicates the type of diagnostics to perform on the controller
+ specified by ControllerHandle and ChildHandle. See
+ "Related Definitions" for the list of supported types.
+ @param Language A pointer to a Null-terminated ASCII string
+ array indicating the language. This is the
+ language of the driver name that the caller
+ is requesting, and it must match one of the
+ languages specified in SupportedLanguages.
+ The number of languages supported by a
+ driver is up to the driver writer. Language
+ is specified in RFC 4646 language code format.
+ @param ErrorType A GUID that defines the format of the data returned in Buffer.
+ @param BufferSize The size, in bytes, of the data returned in Buffer.
+ @param Buffer A buffer that contains a Null-terminated Unicode string
+ plus some additional data whose format is defined by
+ ErrorType. Buffer is allocated by this function with
+ AllocatePool(), and it is the caller's responsibility
+ to free it with a call to FreePool().
+
+ @retval EFI_SUCCESS The controller specified by ControllerHandle and
+ ChildHandle passed the diagnostic.
+ @retval EFI_ACCESS_DENIED The request for initiating diagnostics was unable
+ to be complete due to some underlying hardware or
+ software state.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER Language is NULL.
+ @retval EFI_INVALID_PARAMETER ErrorType is NULL.
+ @retval EFI_INVALID_PARAMETER BufferType is NULL.
+ @retval EFI_INVALID_PARAMETER Buffer is NULL.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support
+ running diagnostics for the controller specified
+ by ControllerHandle and ChildHandle.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the
+ type of diagnostic specified by DiagnosticType.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the
+ language specified by Language.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to complete
+ the diagnostics.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to return
+ the status information in ErrorType, BufferSize,
+ and Buffer.
+ @retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and
+ ChildHandle did not pass the diagnostic.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_DIAGNOSTICS2_RUN_DIAGNOSTICS)(
+ IN EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,
+ IN CHAR8 *Language,
+ OUT EFI_GUID **ErrorType,
+ OUT UINTN *BufferSize,
+ OUT CHAR16 **Buffer
+ );
+
+///
+/// Used to perform diagnostics on a controller that an EFI Driver is managing.
+///
+struct _EFI_DRIVER_DIAGNOSTICS2_PROTOCOL {
+ EFI_DRIVER_DIAGNOSTICS2_RUN_DIAGNOSTICS RunDiagnostics;
+ ///
+ /// A Null-terminated ASCII string that contains one or more RFC 4646
+ /// language codes. This is the list of language codes that this protocol supports.
+ ///
+ CHAR8 *SupportedLanguages;
+};
+
+extern EFI_GUID gEfiDriverDiagnostics2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverFamilyOverride.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverFamilyOverride.h
new file mode 100644
index 0000000000..868c773411
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverFamilyOverride.h
@@ -0,0 +1,66 @@
+/** @file
+ UEFI Driver Family Protocol
+
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_DRIVER_FAMILY_OVERRIDE_H__
+#define __EFI_DRIVER_FAMILY_OVERRIDE_H__
+
+#define EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL_GUID \
+ { \
+ 0xb1ee129e, 0xda36, 0x4181, { 0x91, 0xf8, 0x4, 0xa4, 0x92, 0x37, 0x66, 0xa7 } \
+ }
+
+typedef struct _EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL;
+
+//
+// Prototypes for the Driver Family Override Protocol
+//
+//
+/**
+ This function returns the version value associated with the driver specified by This.
+
+ Retrieves the version of the driver that is used by the EFI Boot Service ConnectController()
+ to sort the set of Driver Binding Protocols in order from highest priority to lowest priority.
+ For drivers that support the Driver Family Override Protocol, those drivers are sorted so that
+ the drivers with higher values returned by GetVersion() are higher priority than drivers that
+ return lower values from GetVersion().
+
+ @param This A pointer to the EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL instance.
+
+ @return The version value associated with the driver specified by This.
+
+**/
+typedef
+UINT32
+(EFIAPI *EFI_DRIVER_FAMILY_OVERRIDE_GET_VERSION)(
+ IN EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL *This
+ );
+
+///
+/// When installed, the Driver Family Override Protocol produces a GUID that represents
+/// a family of drivers. Drivers with the same GUID are members of the same family
+/// When drivers are connected to controllers, drivers with a higher revision value
+/// in the same driver family are connected with a higher priority than drivers
+/// with a lower revision value in the same driver family. The EFI Boot Service
+/// Connect Controller uses five rules to build a prioritized list of drivers when
+/// a request is made to connect a driver to a controller. The Driver Family Protocol
+/// rule is between the Platform Specific Driver Override Protocol and above the
+/// Bus Specific Driver Override Protocol.
+///
+struct _EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL {
+ EFI_DRIVER_FAMILY_OVERRIDE_GET_VERSION GetVersion;
+};
+
+extern EFI_GUID gEfiDriverFamilyOverrideProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverHealth.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverHealth.h
new file mode 100644
index 0000000000..d23140d20b
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverHealth.h
@@ -0,0 +1,247 @@
+/** @file
+ EFI Driver Health Protocol definitions.
+
+ When installed, the Driver Health Protocol produces a collection of services that allow
+ the health status for a controller to be retrieved. If a controller is not in a usable
+ state, status messages may be reported to the user, repair operations can be invoked,
+ and the user may be asked to make software and/or hardware configuration changes.
+
+ The Driver Health Protocol is optionally produced by a driver that follows the
+ EFI Driver Model. If an EFI Driver needs to report health status to the platform,
+ provide warning or error messages to the user, perform length repair operations,
+ or request the user to make hardware or software configuration changes, then the
+ Driver Health Protocol must be produced.
+
+ A controller that is managed by driver that follows the EFI Driver Model and
+ produces the Driver Health Protocol must report the current health of the
+ controllers that the driver is currently managing. The controller can initially
+ be healthy, failed, require repair, or require configuration. If a controller
+ requires configuration, and the user make configuration changes, the controller
+ may then need to be reconnected or the system may need to be rebooted for the
+ configuration changes to take affect.
+
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is defined in UEFI Specification 2.3d
+
+**/
+
+#ifndef __EFI_DRIVER_HEALTH_H__
+#define __EFI_DRIVER_HEALTH_H__
+
+#define EFI_DRIVER_HEALTH_PROTOCOL_GUID \
+ { \
+ 0x2a534210, 0x9280, 0x41d8, { 0xae, 0x79, 0xca, 0xda, 0x1, 0xa2, 0xb1, 0x27 } \
+ }
+
+typedef struct _EFI_DRIVER_HEALTH_PROTOCOL EFI_DRIVER_HEALTH_PROTOCOL;
+
+///
+/// EFI_DRIVER_HEALTH_HEALTH_STATUS
+///
+typedef enum {
+ EfiDriverHealthStatusHealthy,
+ EfiDriverHealthStatusRepairRequired,
+ EfiDriverHealthStatusConfigurationRequired,
+ EfiDriverHealthStatusFailed,
+ EfiDriverHealthStatusReconnectRequired,
+ EfiDriverHealthStatusRebootRequired
+} EFI_DRIVER_HEALTH_STATUS;
+
+///
+/// EFI_DRIVER_HEALTH_HII_MESSAGE
+///
+typedef struct {
+ EFI_HII_HANDLE HiiHandle;
+ EFI_STRING_ID StringId;
+
+ ///
+ /// 64-bit numeric value of the warning/error specified by this message.
+ /// A value of 0x0000000000000000 is used to indicate that MessageCode is not specified.
+ /// The values 0x0000000000000001 to 0x0fffffffffffffff are reserved for allocation by the UEFI Specification.
+ /// The values 0x1000000000000000 to 0x1fffffffffffffff are reserved for IHV-developed drivers.
+ /// The values 0x8000000000000000 to 0x8fffffffffffffff is reserved for platform/OEM drivers.
+ /// All other values are reserved and should not be used.
+ ///
+ UINT64 MessageCode;
+} EFI_DRIVER_HEALTH_HII_MESSAGE;
+
+/**
+ Reports the progress of a repair operation
+
+ @param[in] Value A value between 0 and Limit that identifies the current
+ progress of the repair operation.
+
+ @param[in] Limit The maximum value of Value for the current repair operation.
+ For example, a driver that wants to specify progress in
+ percent would use a Limit value of 100.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_HEALTH_REPAIR_NOTIFY)(
+ IN UINTN Value,
+ IN UINTN Limit
+ );
+
+/**
+ Retrieves the health status of a controller in the platform. This function can also
+ optionally return warning messages, error messages, and a set of HII Forms that may
+ be repair a controller that is not proper configured.
+
+ @param[in] This A pointer to the EFI_DRIVER_HEALTH_PROTOCOL instance.
+
+ @param[in] ControllerHandle The handle of the controller to retrieve the health status
+ on. This is an optional parameter that may be NULL. If
+ this parameter is NULL, then the value of ChildHandle is
+ ignored, and the combined health status of all the devices
+ that the driver is managing is returned.
+
+ @param[in] ChildHandle The handle of the child controller to retrieve the health
+ status on. This is an optional parameter that may be NULL.
+ This parameter is ignored of ControllerHandle is NULL. It
+ will be NULL for device drivers. It will also be NULL for
+ bus drivers when an attempt is made to collect the health
+ status of the bus controller. If will not be NULL when an
+ attempt is made to collect the health status for a child
+ controller produced by the driver.
+
+ @param[out] HealthStatus A pointer to the health status that is returned by this
+ function. This is an optional parameter that may be NULL.
+ This parameter is ignored of ControllerHandle is NULL.
+ The health status for the controller specified by
+ ControllerHandle and ChildHandle is returned.
+
+ @param[out] MessageList A pointer to an array of warning or error messages associated
+ with the controller specified by ControllerHandle and
+ ChildHandle. This is an optional parameter that may be NULL.
+ MessageList is allocated by this function with the EFI Boot
+ Service AllocatePool(), and it is the caller's responsibility
+ to free MessageList with the EFI Boot Service FreePool().
+ Each message is specified by tuple of an EFI_HII_HANDLE and
+ an EFI_STRING_ID. The array of messages is terminated by tuple
+ containing a EFI_HII_HANDLE with a value of NULL. The
+ EFI_HII_STRING_PROTOCOL.GetString() function can be used to
+ retrieve the warning or error message as a Null-terminated
+ string in a specific language. Messages may be
+ returned for any of the HealthStatus values except
+ EfiDriverHealthStatusReconnectRequired and
+ EfiDriverHealthStatusRebootRequired.
+
+ @param[out] FormHiiHandle A pointer to the HII handle containing the HII form used when
+ configuration is required. The HII handle is associated with
+ the controller specified by ControllerHandle and ChildHandle.
+ If this is NULL, then no HII form is available. An HII handle
+ will only be returned with a HealthStatus value of
+ EfiDriverHealthStatusConfigurationRequired.
+
+ @retval EFI_SUCCESS ControllerHandle is NULL, and all the controllers
+ managed by this driver specified by This have a health
+ status of EfiDriverHealthStatusHealthy with no warning
+ messages to be returned. The ChildHandle, HealthStatus,
+ MessageList, and FormList parameters are ignored.
+
+ @retval EFI_DEVICE_ERROR ControllerHandle is NULL, and one or more of the
+ controllers managed by this driver specified by This
+ do not have a health status of EfiDriverHealthStatusHealthy.
+ The ChildHandle, HealthStatus, MessageList, and
+ FormList parameters are ignored.
+
+ @retval EFI_DEVICE_ERROR ControllerHandle is NULL, and one or more of the
+ controllers managed by this driver specified by This
+ have one or more warning and/or error messages.
+ The ChildHandle, HealthStatus, MessageList, and
+ FormList parameters are ignored.
+
+ @retval EFI_SUCCESS ControllerHandle is not NULL and the health status
+ of the controller specified by ControllerHandle and
+ ChildHandle was returned in HealthStatus. A list
+ of warning and error messages may be optionally
+ returned in MessageList, and a list of HII Forms
+ may be optionally returned in FormList.
+
+ @retval EFI_UNSUPPORTED ControllerHandle is not NULL, and the controller
+ specified by ControllerHandle and ChildHandle is not
+ currently being managed by the driver specified by This.
+
+ @retval EFI_INVALID_PARAMETER HealthStatus is NULL.
+
+ @retval EFI_OUT_OF_RESOURCES MessageList is not NULL, and there are not enough
+ resource available to allocate memory for MessageList.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_HEALTH_GET_HEALTH_STATUS)(
+ IN EFI_DRIVER_HEALTH_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle OPTIONAL,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ OUT EFI_DRIVER_HEALTH_STATUS *HealthStatus,
+ OUT EFI_DRIVER_HEALTH_HII_MESSAGE **MessageList OPTIONAL,
+ OUT EFI_HII_HANDLE *FormHiiHandle OPTIONAL
+ );
+
+/**
+ Performs a repair operation on a controller in the platform. This function can
+ optionally report repair progress information back to the platform.
+
+ @param[in] This A pointer to the EFI_DRIVER_HEALTH_PROTOCOL instance.
+ @param[in] ControllerHandle The handle of the controller to repair.
+ @param[in] ChildHandle The handle of the child controller to repair. This is
+ an optional parameter that may be NULL. It will be NULL
+ for device drivers. It will also be NULL for bus
+ drivers when an attempt is made to repair a bus controller.
+ If will not be NULL when an attempt is made to repair a
+ child controller produced by the driver.
+ @param[in] RepairNotify A notification function that may be used by a driver to
+ report the progress of the repair operation. This is
+ an optional parameter that may be NULL.
+
+
+ @retval EFI_SUCCESS An attempt to repair the controller specified by
+ ControllerHandle and ChildHandle was performed.
+ The result of the repair operation can bet
+ determined by calling GetHealthStatus().
+ @retval EFI_UNSUPPORTED The driver specified by This is not currently
+ managing the controller specified by ControllerHandle
+ and ChildHandle.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources to perform the
+ repair operation.
+
+*/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_HEALTH_REPAIR)(
+ IN EFI_DRIVER_HEALTH_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN EFI_DRIVER_HEALTH_REPAIR_NOTIFY RepairNotify OPTIONAL
+ );
+
+///
+/// When installed, the Driver Health Protocol produces a collection of services
+/// that allow the health status for a controller to be retrieved. If a controller
+/// is not in a usable state, status messages may be reported to the user, repair
+/// operations can be invoked, and the user may be asked to make software and/or
+/// hardware configuration changes.
+///
+struct _EFI_DRIVER_HEALTH_PROTOCOL {
+ EFI_DRIVER_HEALTH_GET_HEALTH_STATUS GetHealthStatus;
+ EFI_DRIVER_HEALTH_REPAIR Repair;
+};
+
+extern EFI_GUID gEfiDriverHealthProtocolGuid;
+
+#endif
+
+
+
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverSupportedEfiVersion.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverSupportedEfiVersion.h
new file mode 100644
index 0000000000..2689ddd7f9
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DriverSupportedEfiVersion.h
@@ -0,0 +1,46 @@
+/** @file
+ The protocol provides information about the version of the EFI
+ specification that a driver is following. This protocol is
+ required for EFI drivers that are on PCI and other plug-in
+ cards.
+
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __DRIVER_SUPPORTED_EFI_VERSION_H__
+#define __DRIVER_SUPPORTED_EFI_VERSION_H__
+
+#define EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL_GUID \
+ { 0x5c198761, 0x16a8, 0x4e69, { 0x97, 0x2c, 0x89, 0xd6, 0x79, 0x54, 0xf8, 0x1d } }
+
+
+///
+/// The EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL provides a
+/// mechanism for an EFI driver to publish the version of the EFI
+/// specification it conforms to. This protocol must be placed on
+/// the driver's image handle when the driver's entry point is
+/// called.
+///
+typedef struct _EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL {
+ ///
+ /// The size, in bytes, of the entire structure. Future versions of this
+ /// specification may grow the size of the structure.
+ ///
+ UINT32 Length;
+ ///
+ /// The latest version of the UEFI specification that this driver conforms to.
+ ///
+ UINT32 FirmwareVersion;
+} EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL;
+
+extern EFI_GUID gEfiDriverSupportedEfiVersionProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DxeMmReadyToLock.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DxeMmReadyToLock.h
new file mode 100644
index 0000000000..68d93f1ce9
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DxeMmReadyToLock.h
@@ -0,0 +1,25 @@
+/** @file
+ DXE MM Ready To Lock protocol introduced in the PI 1.5 specification.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _DXE_MM_READY_TO_LOCK_H_
+#define _DXE_MM_READY_TO_LOCK_H_
+
+#define EFI_DXE_MM_READY_TO_LOCK_PROTOCOL_GUID \
+ { \
+ 0x60ff8964, 0xe906, 0x41d0, { 0xaf, 0xed, 0xf2, 0x41, 0xe9, 0x74, 0xe0, 0x8e } \
+ }
+
+extern EFI_GUID gEfiDxeMmReadyToLockProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DxeSmmReadyToLock.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DxeSmmReadyToLock.h
new file mode 100644
index 0000000000..930dcb683a
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/DxeSmmReadyToLock.h
@@ -0,0 +1,40 @@
+/** @file
+ DXE SMM Ready To Lock protocol introduced in the PI 1.2 specification.
+
+ According to PI 1.4a specification, this UEFI protocol indicates that
+ resources and services that should not be used by the third party code
+ are about to be locked.
+ This protocol is a mandatory protocol published by PI platform code.
+ This protocol in tandem with the End of DXE Event facilitates transition
+ of the platform from the environment where all of the components are
+ under the authority of the platform manufacturer to the environment where
+ third party extensible modules such as UEFI drivers and UEFI applications
+ are executed. The protocol is published immediately after signaling of the
+ End of DXE Event. PI modules that need to lock or protect their resources
+ in anticipation of the invocation of 3rd party extensible modules should
+ register for notification on installation of this protocol and effect the
+ appropriate protections in their notification handlers. For example, PI
+ platform code may choose to use notification handler to lock SMM by invoking
+ EFI_SMM_ACCESS2_PROTOCOL.Lock() function.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _DXE_SMM_READY_TO_LOCK_H_
+#define _DXE_SMM_READY_TO_LOCK_H_
+
+#include <Protocol/DxeMmReadyToLock.h>
+
+#define EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL_GUID EFI_DXE_MM_READY_TO_LOCK_PROTOCOL_GUID
+
+extern EFI_GUID gEfiDxeSmmReadyToLockProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Eap.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Eap.h
new file mode 100644
index 0000000000..e91deb8670
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Eap.h
@@ -0,0 +1,162 @@
+/** @file
+ EFI EAP(Extended Authenticaton Protocol) Protocol Definition
+ The EFI EAP Protocol is used to abstract the ability to configure and extend the
+ EAP framework.
+ The definitions in this file are defined in UEFI Specification 2.3.1B, which have
+ not been verified by one implementation yet.
+
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.2
+
+**/
+
+#ifndef __EFI_EAP_PROTOCOL_H__
+#define __EFI_EAP_PROTOCOL_H__
+
+
+#define EFI_EAP_PROTOCOL_GUID \
+ { \
+ 0x5d9f96db, 0xe731, 0x4caa, {0xa0, 0xd, 0x72, 0xe1, 0x87, 0xcd, 0x77, 0x62 } \
+ }
+
+typedef struct _EFI_EAP_PROTOCOL EFI_EAP_PROTOCOL;
+
+///
+/// Type for the identification number assigned to the Port by the
+/// System in which the Port resides.
+///
+typedef VOID * EFI_PORT_HANDLE;
+
+///
+/// EAP Authentication Method Type (RFC 3748)
+///@{
+#define EFI_EAP_TYPE_TLS 13 ///< REQUIRED - RFC 5216
+///@}
+
+//
+// EAP_TYPE MD5, OTP and TOEKN_CARD has been removed from UEFI2.3.1B.
+// Definitions are kept for backward compatibility.
+//
+#define EFI_EAP_TYPE_MD5 4
+#define EFI_EAP_TYPE_OTP 5
+#define EFI_EAP_TYPE_TOKEN_CARD 6
+
+/**
+ One user provided EAP authentication method.
+
+ Build EAP response packet in response to the EAP request packet specified by
+ (RequestBuffer, RequestSize).
+
+ @param[in] PortNumber Specified the Port where the EAP request packet comes.
+ @param[in] RequestBuffer Pointer to the most recently received EAP- Request packet.
+ @param[in] RequestSize Packet size in bytes for the most recently received
+ EAP-Request packet.
+ @param[in] Buffer Pointer to the buffer to hold the built packet.
+ @param[in, out] BufferSize Pointer to the buffer size in bytes.
+ On input, it is the buffer size provided by the caller.
+ On output, it is the buffer size in fact needed to contain
+ the packet.
+
+ @retval EFI_SUCCESS The required EAP response packet is built successfully.
+ @retval others Failures are encountered during the packet building process.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_BUILD_RESPONSE_PACKET)(
+ IN EFI_PORT_HANDLE PortNumber,
+ IN UINT8 *RequestBuffer,
+ IN UINTN RequestSize,
+ IN UINT8 *Buffer,
+ IN OUT UINTN *BufferSize
+ );
+
+/**
+ Set the desired EAP authentication method for the Port.
+
+ The SetDesiredAuthMethod() function sets the desired EAP authentication method indicated
+ by EapAuthType for the Port.
+
+ If EapAuthType is an invalid EAP authentication type, then EFI_INVALID_PARAMETER is
+ returned.
+ If the EAP authentication method of EapAuthType is unsupported by the Ports, then it will
+ return EFI_UNSUPPORTED.
+ The cryptographic strength of EFI_EAP_TYPE_TLS shall be at least of hash strength
+ SHA-256 and RSA key length of at least 2048 bits.
+
+ @param[in] This A pointer to the EFI_EAP_PROTOCOL instance that indicates
+ the calling context.
+ @param[in] EapAuthType The type of the EAP authentication method to register. It should
+ be the type value defined by RFC. See RFC 2284 for details.
+ @param[in] Handler The handler of the EAP authentication method to register.
+
+ @retval EFI_SUCCESS The EAP authentication method of EapAuthType is
+ registered successfully.
+ @retval EFI_INVALID_PARAMETER EapAuthType is an invalid EAP authentication type.
+ @retval EFI_UNSUPPORTED The EAP authentication method of EapAuthType is
+ unsupported by the Port.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_SET_DESIRED_AUTHENTICATION_METHOD)(
+ IN EFI_EAP_PROTOCOL *This,
+ IN UINT8 EapAuthType
+ );
+
+/**
+ Register an EAP authentication method.
+
+ The RegisterAuthMethod() function registers the user provided EAP authentication method,
+ the type of which is EapAuthType and the handler of which is Handler.
+
+ If EapAuthType is an invalid EAP authentication type, then EFI_INVALID_PARAMETER is
+ returned.
+ If there is not enough system memory to perform the registration, then
+ EFI_OUT_OF_RESOURCES is returned.
+
+ @param[in] This A pointer to the EFI_EAP_PROTOCOL instance that indicates
+ the calling context.
+ @param[in] EapAuthType The type of the EAP authentication method to register. It should
+ be the type value defined by RFC. See RFC 2284 for details.
+ @param[in] Handler The handler of the EAP authentication method to register.
+
+ @retval EFI_SUCCESS The EAP authentication method of EapAuthType is
+ registered successfully.
+ @retval EFI_INVALID_PARAMETER EapAuthType is an invalid EAP authentication type.
+ @retval EFI_OUT_OF_RESOURCES There is not enough system memory to perform the registration.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_REGISTER_AUTHENTICATION_METHOD)(
+ IN EFI_EAP_PROTOCOL *This,
+ IN UINT8 EapAuthType,
+ IN EFI_EAP_BUILD_RESPONSE_PACKET Handler
+ );
+
+///
+/// EFI_EAP_PROTOCOL
+/// is used to configure the desired EAP authentication method for the EAP
+/// framework and extend the EAP framework by registering new EAP authentication
+/// method on a Port. The EAP framework is built on a per-Port basis. Herein, a
+/// Port means a NIC. For the details of EAP protocol, please refer to RFC 2284.
+///
+struct _EFI_EAP_PROTOCOL {
+ EFI_EAP_SET_DESIRED_AUTHENTICATION_METHOD SetDesiredAuthMethod;
+ EFI_EAP_REGISTER_AUTHENTICATION_METHOD RegisterAuthMethod;
+};
+
+extern EFI_GUID gEfiEapProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EapConfiguration.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EapConfiguration.h
new file mode 100644
index 0000000000..dc30e62ad0
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EapConfiguration.h
@@ -0,0 +1,159 @@
+/** @file
+ This file defines the EFI EAP Configuration protocol.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_EAP_CONFIGURATION_PROTOCOL_H__
+#define __EFI_EAP_CONFIGURATION_PROTOCOL_H__
+
+///
+/// EFI EAP Configuration protocol provides a way to set and get EAP configuration.
+///
+#define EFI_EAP_CONFIGURATION_PROTOCOL_GUID \
+ { \
+ 0xe5b58dbb, 0x7688, 0x44b4, {0x97, 0xbf, 0x5f, 0x1d, 0x4b, 0x7c, 0xc8, 0xdb } \
+ }
+
+typedef struct _EFI_EAP_CONFIGURATION_PROTOCOL EFI_EAP_CONFIGURATION_PROTOCOL;
+
+///
+/// Make sure it not conflict with any real EapTypeXXX
+///
+#define EFI_EAP_TYPE_ATTRIBUTE 0
+
+typedef enum {
+ ///
+ /// EFI_EAP_TYPE_ATTRIBUTE
+ ///
+ EfiEapConfigEapAuthMethod,
+ EfiEapConfigEapSupportedAuthMethod,
+ ///
+ /// EapTypeIdentity
+ ///
+ EfiEapConfigIdentityString,
+ ///
+ /// EapTypeEAPTLS/EapTypePEAP
+ ///
+ EfiEapConfigEapTlsCACert,
+ EfiEapConfigEapTlsClientCert,
+ EfiEapConfigEapTlsClientPrivateKeyFile,
+ EfiEapConfigEapTlsClientPrivateKeyFilePassword, // ASCII format, Volatile
+ EfiEapConfigEapTlsCipherSuite,
+ EfiEapConfigEapTlsSupportedCipherSuite,
+ ///
+ /// EapTypeMSChapV2
+ ///
+ EfiEapConfigEapMSChapV2Password, // UNICODE format, Volatile
+ ///
+ /// EapTypePEAP
+ ///
+ EfiEapConfigEap2ndAuthMethod,
+ ///
+ /// More...
+ ///
+} EFI_EAP_CONFIG_DATA_TYPE;
+
+///
+/// EFI_EAP_TYPE
+///
+typedef UINT8 EFI_EAP_TYPE;
+#define EFI_EAP_TYPE_ATTRIBUTE 0
+#define EFI_EAP_TYPE_IDENTITY 1
+#define EFI_EAP_TYPE_NOTIFICATION 2
+#define EFI_EAP_TYPE_NAK 3
+#define EFI_EAP_TYPE_MD5CHALLENGE 4
+#define EFI_EAP_TYPE_OTP 5
+#define EFI_EAP_TYPE_GTC 6
+#define EFI_EAP_TYPE_EAPTLS 13
+#define EFI_EAP_TYPE_EAPSIM 18
+#define EFI_EAP_TYPE_TTLS 21
+#define EFI_EAP_TYPE_PEAP 25
+#define EFI_EAP_TYPE_MSCHAPV2 26
+#define EFI_EAP_TYPE_EAP_EXTENSION 33
+
+/**
+ Set EAP configuration data.
+
+ The SetData() function sets EAP configuration to non-volatile storage or volatile
+ storage.
+
+ @param[in] This Pointer to the EFI_EAP_CONFIGURATION_PROTOCOL instance.
+ @param[in] EapType EAP type.
+ @param[in] DataType Configuration data type.
+ @param[in] Data Pointer to configuration data.
+ @param[in] DataSize Total size of configuration data.
+
+ @retval EFI_SUCCESS The EAP configuration data is set successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ Data is NULL.
+ DataSize is 0.
+ @retval EFI_UNSUPPORTED The EapType or DataType is unsupported.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_CONFIGURATION_SET_DATA) (
+ IN EFI_EAP_CONFIGURATION_PROTOCOL *This,
+ IN EFI_EAP_TYPE EapType,
+ IN EFI_EAP_CONFIG_DATA_TYPE DataType,
+ IN VOID *Data,
+ IN UINTN DataSize
+ );
+
+/**
+ Get EAP configuration data.
+
+ The GetData() function gets EAP configuration.
+
+ @param[in] This Pointer to the EFI_EAP_CONFIGURATION_PROTOCOL instance.
+ @param[in] EapType EAP type.
+ @param[in] DataType Configuration data type.
+ @param[in, out] Data Pointer to configuration data.
+ @param[in, out] DataSize Total size of configuration data. On input, it means
+ the size of Data buffer. On output, it means the size
+ of copied Data buffer if EFI_SUCCESS, and means the
+ size of desired Data buffer if EFI_BUFFER_TOO_SMALL.
+
+ @retval EFI_SUCCESS The EAP configuration data is got successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ Data is NULL.
+ DataSize is NULL.
+ @retval EFI_UNSUPPORTED The EapType or DataType is unsupported.
+ @retval EFI_NOT_FOUND The EAP configuration data is not found.
+ @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_CONFIGURATION_GET_DATA) (
+ IN EFI_EAP_CONFIGURATION_PROTOCOL *This,
+ IN EFI_EAP_TYPE EapType,
+ IN EFI_EAP_CONFIG_DATA_TYPE DataType,
+ IN OUT VOID *Data,
+ IN OUT UINTN *DataSize
+ );
+
+///
+/// The EFI_EAP_CONFIGURATION_PROTOCOL
+/// is designed to provide a way to set and get EAP configuration, such as Certificate,
+/// private key file.
+///
+struct _EFI_EAP_CONFIGURATION_PROTOCOL {
+ EFI_EAP_CONFIGURATION_SET_DATA SetData;
+ EFI_EAP_CONFIGURATION_GET_DATA GetData;
+};
+
+extern EFI_GUID gEfiEapConfigurationProtocolGuid;
+
+#endif \ No newline at end of file
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EapManagement.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EapManagement.h
new file mode 100644
index 0000000000..8fe4afb2a1
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EapManagement.h
@@ -0,0 +1,403 @@
+/** @file
+ EFI EAP Management Protocol Definition
+ The EFI EAP Management Protocol is designed to provide ease of management and
+ ease of test for EAPOL state machine. It is intended for the supplicant side.
+ It conforms to IEEE 802.1x specification.
+ The definitions in this file are defined in UEFI Specification 2.2, which have
+ not been verified by one implementation yet.
+
+ Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.2
+
+**/
+
+#ifndef __EFI_EAP_MANAGEMENT_PROTOCOL_H__
+#define __EFI_EAP_MANAGEMENT_PROTOCOL_H__
+
+#include <Protocol/Eap.h>
+
+#define EFI_EAP_MANAGEMENT_PROTOCOL_GUID \
+ { \
+ 0xbb62e663, 0x625d, 0x40b2, {0xa0, 0x88, 0xbb, 0xe8, 0x36, 0x23, 0xa2, 0x45 } \
+ }
+
+typedef struct _EFI_EAP_MANAGEMENT_PROTOCOL EFI_EAP_MANAGEMENT_PROTOCOL;
+
+///
+/// PAE Capabilities
+///
+///@{
+#define PAE_SUPPORT_AUTHENTICATOR 0x01
+#define PAE_SUPPORT_SUPPLICANT 0x02
+///@}
+
+///
+/// EFI_EAPOL_PORT_INFO
+///
+typedef struct _EFI_EAPOL_PORT_INFO {
+ ///
+ /// The identification number assigned to the Port by the System in
+ /// which the Port resides.
+ ///
+ EFI_PORT_HANDLE PortNumber;
+ ///
+ /// The protocol version number of the EAPOL implementation
+ /// supported by the Port.
+ ///
+ UINT8 ProtocolVersion;
+ ///
+ /// The capabilities of the PAE associated with the Port. This field
+ /// indicates whether Authenticator functionality, Supplicant
+ /// functionality, both, or neither, is supported by the Port's PAE.
+ ///
+ UINT8 PaeCapabilities;
+} EFI_EAPOL_PORT_INFO;
+
+///
+/// Supplicant PAE state machine (IEEE Std 802.1X Section 8.5.10)
+///
+typedef enum _EFI_EAPOL_SUPPLICANT_PAE_STATE {
+ Logoff,
+ Disconnected,
+ Connecting,
+ Acquired,
+ Authenticating,
+ Held,
+ Authenticated,
+ MaxSupplicantPaeState
+} EFI_EAPOL_SUPPLICANT_PAE_STATE;
+
+///
+/// Definitions for ValidFieldMask
+///
+///@{
+#define AUTH_PERIOD_FIELD_VALID 0x01
+#define HELD_PERIOD_FIELD_VALID 0x02
+#define START_PERIOD_FIELD_VALID 0x04
+#define MAX_START_FIELD_VALID 0x08
+///@}
+
+///
+/// EFI_EAPOL_SUPPLICANT_PAE_CONFIGURATION
+///
+typedef struct _EFI_EAPOL_SUPPLICANT_PAE_CONFIGURATION {
+ ///
+ /// Indicates which of the following fields are valid.
+ ///
+ UINT8 ValidFieldMask;
+ ///
+ /// The initial value for the authWhile timer. Its default value is 30s.
+ ///
+ UINTN AuthPeriod;
+ ///
+ /// The initial value for the heldWhile timer. Its default value is 60s.
+ ///
+ UINTN HeldPeriod;
+ ///
+ /// The initial value for the startWhen timer. Its default value is 30s.
+ ///
+ UINTN StartPeriod;
+ ///
+ /// The maximum number of successive EAPOL-Start messages will
+ /// be sent before the Supplicant assumes that there is no
+ /// Authenticator present. Its default value is 3.
+ ///
+ UINTN MaxStart;
+} EFI_EAPOL_SUPPLICANT_PAE_CONFIGURATION;
+
+///
+/// Supplicant Statistics (IEEE Std 802.1X Section 9.5.2)
+///
+typedef struct _EFI_EAPOL_SUPPLICANT_PAE_STATISTICS {
+ ///
+ /// The number of EAPOL frames of any type that have been received by this Supplican.
+ ///
+ UINTN EapolFramesReceived;
+ ///
+ /// The number of EAPOL frames of any type that have been transmitted by this Supplicant.
+ ///
+ UINTN EapolFramesTransmitted;
+ ///
+ /// The number of EAPOL Start frames that have been transmitted by this Supplicant.
+ ///
+ UINTN EapolStartFramesTransmitted;
+ ///
+ /// The number of EAPOL Logoff frames that have been transmitted by this Supplicant.
+ ///
+ UINTN EapolLogoffFramesTransmitted;
+ ///
+ /// The number of EAP Resp/Id frames that have been transmitted by this Supplicant.
+ ///
+ UINTN EapRespIdFramesTransmitted;
+ ///
+ /// The number of valid EAP Response frames (other than Resp/Id frames) that have been
+ /// transmitted by this Supplicant.
+ ///
+ UINTN EapResponseFramesTransmitted;
+ ///
+ /// The number of EAP Req/Id frames that have been received by this Supplicant.
+ ///
+ UINTN EapReqIdFramesReceived;
+ ///
+ /// The number of EAP Request frames (other than Rq/Id frames) that have been received
+ /// by this Supplicant.
+ ///
+ UINTN EapRequestFramesReceived;
+ ///
+ /// The number of EAPOL frames that have been received by this Supplicant in which the
+ /// frame type is not recognized.
+ ///
+ UINTN InvalidEapolFramesReceived;
+ ///
+ /// The number of EAPOL frames that have been received by this Supplicant in which the
+ /// Packet Body Length field (7.5.5) is invalid.
+ ///
+ UINTN EapLengthErrorFramesReceived;
+ ///
+ /// The protocol version number carried in the most recently received EAPOL frame.
+ ///
+ UINTN LastEapolFrameVersion;
+ ///
+ /// The source MAC address carried in the most recently received EAPOL frame.
+ ///
+ UINTN LastEapolFrameSource;
+} EFI_EAPOL_SUPPLICANT_PAE_STATISTICS;
+
+/**
+ Read the system configuration information associated with the Port.
+
+ The GetSystemConfiguration() function reads the system configuration
+ information associated with the Port, including the value of the
+ SystemAuthControl parameter of the System is returned in SystemAuthControl
+ and the Port's information is returned in the buffer pointed to by PortInfo.
+ The Port's information is optional.
+ If PortInfo is NULL, then reading the Port's information is ignored.
+
+ If SystemAuthControl is NULL, then EFI_INVALID_PARAMETER is returned.
+
+ @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
+ instance that indicates the calling context.
+ @param[out] SystemAuthControl Returns the value of the SystemAuthControl
+ parameter of the System.
+ TRUE means Enabled. FALSE means Disabled.
+ @param[out] PortInfo Returns EFI_EAPOL_PORT_INFO structure to describe
+ the Port's information. This parameter can be NULL
+ to ignore reading the Port's information.
+
+ @retval EFI_SUCCESS The system configuration information of the
+ Port is read successfully.
+ @retval EFI_INVALID_PARAMETER SystemAuthControl is NULL.
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_GET_SYSTEM_CONFIGURATION)(
+ IN EFI_EAP_MANAGEMENT_PROTOCOL *This,
+ OUT BOOLEAN *SystemAuthControl,
+ OUT EFI_EAPOL_PORT_INFO *PortInfo OPTIONAL
+ );
+
+/**
+ Set the system configuration information associated with the Port.
+
+ The SetSystemConfiguration() function sets the value of the SystemAuthControl
+ parameter of the System to SystemAuthControl.
+
+ @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
+ instance that indicates the calling context.
+ @param[in] SystemAuthControl The desired value of the SystemAuthControl
+ parameter of the System.
+ TRUE means Enabled. FALSE means Disabled.
+
+ @retval EFI_SUCCESS The system configuration information of the
+ Port is set successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_SET_SYSTEM_CONFIGURATION)(
+ IN EFI_EAP_MANAGEMENT_PROTOCOL *This,
+ IN BOOLEAN SystemAuthControl
+ );
+
+/**
+ Cause the EAPOL state machines for the Port to be initialized.
+
+ The InitializePort() function causes the EAPOL state machines for the Port.
+
+ @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
+ instance that indicates the calling context.
+
+ @retval EFI_SUCCESS The Port is initialized successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_INITIALIZE_PORT)(
+ IN EFI_EAP_MANAGEMENT_PROTOCOL *This
+ );
+
+/**
+ Notify the EAPOL state machines for the Port that the user of the System has
+ logged on.
+
+ The UserLogon() function notifies the EAPOL state machines for the Port.
+
+ @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
+ instance that indicates the calling context.
+
+ @retval EFI_SUCCESS The Port is notified successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_USER_LOGON)(
+ IN EFI_EAP_MANAGEMENT_PROTOCOL *This
+ );
+
+/**
+ Notify the EAPOL state machines for the Port that the user of the System has
+ logged off.
+
+ The UserLogoff() function notifies the EAPOL state machines for the Port.
+
+ @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
+ instance that indicates the calling context.
+
+ @retval EFI_SUCCESS The Port is notified successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_USER_LOGOFF)(
+ IN EFI_EAP_MANAGEMENT_PROTOCOL *This
+ );
+
+/**
+ Read the status of the Supplicant PAE state machine for the Port, including the
+ current state and the configuration of the operational parameters.
+
+ The GetSupplicantStatus() function reads the status of the Supplicant PAE state
+ machine for the Port, including the current state CurrentState and the configuration
+ of the operational parameters Configuration. The configuration of the operational
+ parameters is optional. If Configuration is NULL, then reading the configuration
+ is ignored. The operational parameters in Configuration to be read can also be
+ specified by Configuration.ValidFieldMask.
+
+ If CurrentState is NULL, then EFI_INVALID_PARAMETER is returned.
+
+ @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
+ instance that indicates the calling context.
+ @param[out] CurrentState Returns the current state of the Supplicant PAE
+ state machine for the Port.
+ @param[in, out] Configuration Returns the configuration of the operational
+ parameters of the Supplicant PAE state machine
+ for the Port as required. This parameter can be
+ NULL to ignore reading the configuration.
+ On input, Configuration.ValidFieldMask specifies the
+ operational parameters to be read.
+ On output, Configuration returns the configuration
+ of the required operational parameters.
+
+ @retval EFI_SUCCESS The configuration of the operational parameter
+ of the Supplicant PAE state machine for the Port
+ is set successfully.
+ @retval EFI_INVALID_PARAMETER CurrentState is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_GET_SUPPLICANT_STATUS)(
+ IN EFI_EAP_MANAGEMENT_PROTOCOL *This,
+ OUT EFI_EAPOL_SUPPLICANT_PAE_STATE *CurrentState,
+ IN OUT EFI_EAPOL_SUPPLICANT_PAE_CONFIGURATION *Configuration OPTIONAL
+ );
+
+/**
+ Set the configuration of the operational parameter of the Supplicant PAE
+ state machine for the Port.
+
+ The SetSupplicantConfiguration() function sets the configuration of the
+ operational Parameter of the Supplicant PAE state machine for the Port to
+ Configuration. The operational parameters in Configuration to be set can be
+ specified by Configuration.ValidFieldMask.
+
+ If Configuration is NULL, then EFI_INVALID_PARAMETER is returned.
+
+ @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
+ instance that indicates the calling context.
+ @param[in] Configuration The desired configuration of the operational
+ parameters of the Supplicant PAE state machine
+ for the Port as required.
+
+ @retval EFI_SUCCESS The configuration of the operational parameter
+ of the Supplicant PAE state machine for the Port
+ is set successfully.
+ @retval EFI_INVALID_PARAMETER Configuration is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_SET_SUPPLICANT_CONFIGURATION)(
+ IN EFI_EAP_MANAGEMENT_PROTOCOL *This,
+ IN EFI_EAPOL_SUPPLICANT_PAE_CONFIGURATION *Configuration
+ );
+
+/**
+ Read the statistical information regarding the operation of the Supplicant
+ associated with the Port.
+
+ The GetSupplicantStatistics() function reads the statistical information
+ Statistics regarding the operation of the Supplicant associated with the Port.
+
+ If Statistics is NULL, then EFI_INVALID_PARAMETER is returned.
+
+ @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
+ instance that indicates the calling context.
+ @param[out] Statistics Returns the statistical information regarding the
+ operation of the Supplicant for the Port.
+
+ @retval EFI_SUCCESS The statistical information regarding the operation
+ of the Supplicant for the Port is read successfully.
+ @retval EFI_INVALID_PARAMETER Statistics is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_GET_SUPPLICANT_STATISTICS)(
+ IN EFI_EAP_MANAGEMENT_PROTOCOL *This,
+ OUT EFI_EAPOL_SUPPLICANT_PAE_STATISTICS *Statistics
+ );
+
+///
+/// EFI_EAP_MANAGEMENT_PROTOCOL
+/// is used to control, configure and monitor EAPOL state machine on
+/// a Port. EAPOL state machine is built on a per-Port basis. Herein,
+/// a Port means a NIC. For the details of EAPOL, please refer to
+/// IEEE 802.1x specification.
+///
+struct _EFI_EAP_MANAGEMENT_PROTOCOL {
+ EFI_EAP_GET_SYSTEM_CONFIGURATION GetSystemConfiguration;
+ EFI_EAP_SET_SYSTEM_CONFIGURATION SetSystemConfiguration;
+ EFI_EAP_INITIALIZE_PORT InitializePort;
+ EFI_EAP_USER_LOGON UserLogon;
+ EFI_EAP_USER_LOGOFF UserLogoff;
+ EFI_EAP_GET_SUPPLICANT_STATUS GetSupplicantStatus;
+ EFI_EAP_SET_SUPPLICANT_CONFIGURATION SetSupplicantConfiguration;
+ EFI_EAP_GET_SUPPLICANT_STATISTICS GetSupplicantStatistics;
+};
+
+extern EFI_GUID gEfiEapManagementProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EapManagement2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EapManagement2.h
new file mode 100644
index 0000000000..d1e5981d03
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EapManagement2.h
@@ -0,0 +1,87 @@
+/** @file
+ This file defines the EFI EAP Management2 protocol.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_EAP_MANAGEMENT2_PROTOCOL_H__
+#define __EFI_EAP_MANAGEMENT2_PROTOCOL_H__
+
+#include <Protocol/EapManagement.h>
+
+///
+/// This EFI EAP Management2 protocol provides the ability to configure and control EAPOL
+/// state machine, and retrieve the information, status and the statistics information of
+/// EAPOL state machine.
+///
+#define EFI_EAP_MANAGEMENT2_PROTOCOL_GUID \
+ { \
+ 0x5e93c847, 0x456d, 0x40b3, {0xa6, 0xb4, 0x78, 0xb0, 0xc9, 0xcf, 0x7f, 0x20 } \
+ }
+
+typedef struct _EFI_EAP_MANAGEMENT2_PROTOCOL EFI_EAP_MANAGEMENT2_PROTOCOL;
+
+/**
+ Return key generated through EAP process.
+
+ The GetKey() function return the key generated through EAP process, so that the 802.11
+ MAC layer driver can use MSK to derive more keys, e.g. PMK (Pairwise Master Key).
+
+ @param[in] This Pointer to the EFI_EAP_MANAGEMENT2_PROTOCOL instance.
+ @param[in, out] Msk Pointer to MSK (Master Session Key) buffer.
+ @param[in, out] MskSize MSK buffer size.
+ @param[in, out] Emsk Pointer to EMSK (Extended Master Session Key) buffer.
+ @param[in, out] EmskSize EMSK buffer size.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ Msk is NULL.
+ MskSize is NULL.
+ Emsk is NULL.
+ EmskSize is NULL.
+ @retval EFI_NOT_READY MSK and EMSK are not generated in current session yet.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EAP_GET_KEY) (
+ IN EFI_EAP_MANAGEMENT2_PROTOCOL *This,
+ IN OUT UINT8 *Msk,
+ IN OUT UINTN *MskSize,
+ IN OUT UINT8 *Emsk,
+ IN OUT UINT8 *EmskSize
+ );
+
+///
+/// The EFI_EAP_MANAGEMENT2_PROTOCOL
+/// is used to control, configure and monitor EAPOL state machine on a Port, and return
+/// information of the Port. EAPOL state machine is built on a per-Port basis. Herein, a
+/// Port means a NIC. For the details of EAPOL, please refer to IEEE 802.1x
+/// specification.
+///
+struct _EFI_EAP_MANAGEMENT2_PROTOCOL {
+ EFI_EAP_GET_SYSTEM_CONFIGURATION GetSystemConfiguration;
+ EFI_EAP_SET_SYSTEM_CONFIGURATION SetSystemConfiguration;
+ EFI_EAP_INITIALIZE_PORT InitializePort;
+ EFI_EAP_USER_LOGON UserLogon;
+ EFI_EAP_USER_LOGOFF UserLogoff;
+ EFI_EAP_GET_SUPPLICANT_STATUS GetSupplicantStatus;
+ EFI_EAP_SET_SUPPLICANT_CONFIGURATION SetSupplicantConfiguration;
+ EFI_EAP_GET_SUPPLICANT_STATISTICS GetSupplicantStatistics;
+ EFI_EAP_GET_KEY GetKey;
+};
+
+extern EFI_GUID gEfiEapManagement2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ebc.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ebc.h
new file mode 100644
index 0000000000..dd6320d61c
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ebc.h
@@ -0,0 +1,314 @@
+/** @file
+ Describes the protocol interface to the EBC interpreter.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_EBC_PROTOCOL_H__
+#define __EFI_EBC_PROTOCOL_H__
+
+#define EFI_EBC_INTERPRETER_PROTOCOL_GUID \
+ { \
+ 0x13AC6DD1, 0x73D0, 0x11D4, {0xB0, 0x6B, 0x00, 0xAA, 0x00, 0xBD, 0x6D, 0xE7 } \
+ }
+
+//
+// Define OPCODES
+//
+#define OPCODE_BREAK 0x00
+#define OPCODE_JMP 0x01
+#define OPCODE_JMP8 0x02
+#define OPCODE_CALL 0x03
+#define OPCODE_RET 0x04
+#define OPCODE_CMPEQ 0x05
+#define OPCODE_CMPLTE 0x06
+#define OPCODE_CMPGTE 0x07
+#define OPCODE_CMPULTE 0x08
+#define OPCODE_CMPUGTE 0x09
+#define OPCODE_NOT 0x0A
+#define OPCODE_NEG 0x0B
+#define OPCODE_ADD 0x0C
+#define OPCODE_SUB 0x0D
+#define OPCODE_MUL 0x0E
+#define OPCODE_MULU 0x0F
+#define OPCODE_DIV 0x10
+#define OPCODE_DIVU 0x11
+#define OPCODE_MOD 0x12
+#define OPCODE_MODU 0x13
+#define OPCODE_AND 0x14
+#define OPCODE_OR 0x15
+#define OPCODE_XOR 0x16
+#define OPCODE_SHL 0x17
+#define OPCODE_SHR 0x18
+#define OPCODE_ASHR 0x19
+#define OPCODE_EXTNDB 0x1A
+#define OPCODE_EXTNDW 0x1B
+#define OPCODE_EXTNDD 0x1C
+#define OPCODE_MOVBW 0x1D
+#define OPCODE_MOVWW 0x1E
+#define OPCODE_MOVDW 0x1F
+#define OPCODE_MOVQW 0x20
+#define OPCODE_MOVBD 0x21
+#define OPCODE_MOVWD 0x22
+#define OPCODE_MOVDD 0x23
+#define OPCODE_MOVQD 0x24
+#define OPCODE_MOVSNW 0x25 // Move signed natural with word index
+#define OPCODE_MOVSND 0x26 // Move signed natural with dword index
+//
+// #define OPCODE_27 0x27
+//
+#define OPCODE_MOVQQ 0x28 // Does this go away?
+#define OPCODE_LOADSP 0x29
+#define OPCODE_STORESP 0x2A
+#define OPCODE_PUSH 0x2B
+#define OPCODE_POP 0x2C
+#define OPCODE_CMPIEQ 0x2D
+#define OPCODE_CMPILTE 0x2E
+#define OPCODE_CMPIGTE 0x2F
+#define OPCODE_CMPIULTE 0x30
+#define OPCODE_CMPIUGTE 0x31
+#define OPCODE_MOVNW 0x32
+#define OPCODE_MOVND 0x33
+//
+// #define OPCODE_34 0x34
+//
+#define OPCODE_PUSHN 0x35
+#define OPCODE_POPN 0x36
+#define OPCODE_MOVI 0x37
+#define OPCODE_MOVIN 0x38
+#define OPCODE_MOVREL 0x39
+
+//
+// Bit masks for opcode encodings
+//
+#define OPCODE_M_OPCODE 0x3F // bits of interest for first level decode
+#define OPCODE_M_IMMDATA 0x80
+#define OPCODE_M_IMMDATA64 0x40
+#define OPCODE_M_64BIT 0x40 // for CMP
+#define OPCODE_M_RELADDR 0x10 // for CALL instruction
+#define OPCODE_M_CMPI32_DATA 0x80 // for CMPI
+#define OPCODE_M_CMPI64 0x40 // for CMPI 32 or 64 bit comparison
+#define OPERAND_M_MOVIN_N 0x80
+#define OPERAND_M_CMPI_INDEX 0x10
+
+//
+// Masks for instructions that encode presence of indexes for operand1 and/or
+// operand2.
+//
+#define OPCODE_M_IMMED_OP1 0x80
+#define OPCODE_M_IMMED_OP2 0x40
+
+//
+// Bit masks for operand encodings
+//
+#define OPERAND_M_INDIRECT1 0x08
+#define OPERAND_M_INDIRECT2 0x80
+#define OPERAND_M_OP1 0x07
+#define OPERAND_M_OP2 0x70
+
+//
+// Masks for data manipulation instructions
+//
+#define DATAMANIP_M_64 0x40 // 64-bit width operation
+#define DATAMANIP_M_IMMDATA 0x80
+
+//
+// For MOV instructions, need a mask for the opcode when immediate
+// data applies to R2.
+//
+#define OPCODE_M_IMMED_OP2 0x40
+
+//
+// The MOVI/MOVIn instructions use bit 6 of operands byte to indicate
+// if an index is present. Then bits 4 and 5 are used to indicate the width
+// of the move.
+//
+#define MOVI_M_IMMDATA 0x40
+#define MOVI_M_DATAWIDTH 0xC0
+#define MOVI_DATAWIDTH16 0x40
+#define MOVI_DATAWIDTH32 0x80
+#define MOVI_DATAWIDTH64 0xC0
+#define MOVI_M_MOVEWIDTH 0x30
+#define MOVI_MOVEWIDTH8 0x00
+#define MOVI_MOVEWIDTH16 0x10
+#define MOVI_MOVEWIDTH32 0x20
+#define MOVI_MOVEWIDTH64 0x30
+
+//
+// Masks for CALL instruction encodings
+//
+#define OPERAND_M_RELATIVE_ADDR 0x10
+#define OPERAND_M_NATIVE_CALL 0x20
+
+//
+// Masks for decoding push/pop instructions
+//
+#define PUSHPOP_M_IMMDATA 0x80 // opcode bit indicating immediate data
+#define PUSHPOP_M_64 0x40 // opcode bit indicating 64-bit operation
+//
+// Mask for operand of JMP instruction
+//
+#define JMP_M_RELATIVE 0x10
+#define JMP_M_CONDITIONAL 0x80
+#define JMP_M_CS 0x40
+
+//
+// Macros to determine if a given operand is indirect
+//
+#define OPERAND1_INDIRECT(op) ((op) & OPERAND_M_INDIRECT1)
+#define OPERAND2_INDIRECT(op) ((op) & OPERAND_M_INDIRECT2)
+
+//
+// Macros to extract the operands from second byte of instructions
+//
+#define OPERAND1_REGNUM(op) ((op) & OPERAND_M_OP1)
+#define OPERAND2_REGNUM(op) (((op) & OPERAND_M_OP2) >> 4)
+
+#define OPERAND1_CHAR(op) ('0' + OPERAND1_REGNUM (op))
+#define OPERAND2_CHAR(op) ('0' + OPERAND2_REGNUM (op))
+
+//
+// Condition masks usually for byte 1 encodings of code
+//
+#define CONDITION_M_CONDITIONAL 0x80
+#define CONDITION_M_CS 0x40
+
+///
+/// Protocol Guid Name defined in spec.
+///
+#define EFI_EBC_PROTOCOL_GUID EFI_EBC_INTERPRETER_PROTOCOL_GUID
+
+///
+/// Define for forward reference.
+///
+typedef struct _EFI_EBC_PROTOCOL EFI_EBC_PROTOCOL;
+
+/**
+ Creates a thunk for an EBC entry point, returning the address of the thunk.
+
+ A PE32+ EBC image, like any other PE32+ image, contains an optional header that specifies the
+ entry point for image execution. However, for EBC images, this is the entry point of EBC
+ instructions, so is not directly executable by the native processor. Therefore, when an EBC image is
+ loaded, the loader must call this service to get a pointer to native code (thunk) that can be executed,
+ which will invoke the interpreter to begin execution at the original EBC entry point.
+
+ @param This A pointer to the EFI_EBC_PROTOCOL instance.
+ @param ImageHandle Handle of image for which the thunk is being created.
+ @param EbcEntryPoint Address of the actual EBC entry point or protocol service the thunk should call.
+ @param Thunk Returned pointer to a thunk created.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_INVALID_PARAMETER Image entry point is not 2-byte aligned.
+ @retval EFI_OUT_OF_RESOURCES Memory could not be allocated for the thunk.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EBC_CREATE_THUNK)(
+ IN EFI_EBC_PROTOCOL *This,
+ IN EFI_HANDLE ImageHandle,
+ IN VOID *EbcEntryPoint,
+ OUT VOID **Thunk
+ );
+
+/**
+ Called prior to unloading an EBC image from memory.
+
+ This function is called after an EBC image has exited, but before the image is actually unloaded. It
+ is intended to provide the interpreter with the opportunity to perform any cleanup that may be
+ necessary as a result of loading and executing the image.
+
+ @param This A pointer to the EFI_EBC_PROTOCOL instance.
+ @param ImageHandle Image handle of the EBC image that is being unloaded from memory.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_INVALID_PARAMETER Image handle is not recognized as belonging
+ to an EBC image that has been executed.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EBC_UNLOAD_IMAGE)(
+ IN EFI_EBC_PROTOCOL *This,
+ IN EFI_HANDLE ImageHandle
+ );
+
+/**
+ This is the prototype for the Flush callback routine. A pointer to a routine
+ of this type is passed to the EBC EFI_EBC_REGISTER_ICACHE_FLUSH protocol service.
+
+ @param Start The beginning physical address to flush from the processor's instruction cache.
+ @param Length The number of bytes to flush from the processor's instruction cache.
+
+ @retval EFI_SUCCESS The function completed successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EBC_ICACHE_FLUSH)(
+ IN EFI_PHYSICAL_ADDRESS Start,
+ IN UINT64 Length
+ );
+
+/**
+ Registers a callback function that the EBC interpreter calls to flush
+ the processor instruction cache following creation of thunks.
+
+ @param This A pointer to the EFI_EBC_PROTOCOL instance.
+ @param Flush Pointer to a function of type EBC_ICACH_FLUSH.
+
+ @retval EFI_SUCCESS The function completed successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EBC_REGISTER_ICACHE_FLUSH)(
+ IN EFI_EBC_PROTOCOL *This,
+ IN EBC_ICACHE_FLUSH Flush
+ );
+
+/**
+ Called to get the version of the interpreter.
+
+ This function is called to get the version of the loaded EBC interpreter. The value and format of the
+ returned version is identical to that returned by the EBC BREAK 1 instruction.
+
+ @param This A pointer to the EFI_EBC_PROTOCOL instance.
+ @param Version Pointer to where to store the returned version of the interpreter.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_INVALID_PARAMETER Version pointer is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EBC_GET_VERSION)(
+ IN EFI_EBC_PROTOCOL *This,
+ IN OUT UINT64 *Version
+ );
+
+///
+/// The EFI EBC protocol provides services to load and execute EBC images, which will typically be
+/// loaded into option ROMs. The image loader will load the EBC image, perform standard relocations,
+/// and invoke the CreateThunk() service to create a thunk for the EBC image's entry point. The
+/// image can then be run using the standard EFI start image services.
+///
+struct _EFI_EBC_PROTOCOL {
+ EFI_EBC_CREATE_THUNK CreateThunk;
+ EFI_EBC_UNLOAD_IMAGE UnloadImage;
+ EFI_EBC_REGISTER_ICACHE_FLUSH RegisterICacheFlush;
+ EFI_EBC_GET_VERSION GetVersion;
+};
+
+//
+// Extern the global EBC protocol GUID
+//
+extern EFI_GUID gEfiEbcProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EdidActive.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EdidActive.h
new file mode 100644
index 0000000000..8e1ec84262
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EdidActive.h
@@ -0,0 +1,52 @@
+/** @file
+ EDID Active Protocol from the UEFI 2.0 specification.
+
+ Placed on the video output device child handle that is actively displaying output.
+
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EDID_ACTIVE_H__
+#define __EDID_ACTIVE_H__
+
+#define EFI_EDID_ACTIVE_PROTOCOL_GUID \
+ { \
+ 0xbd8c1056, 0x9f36, 0x44ec, {0x92, 0xa8, 0xa6, 0x33, 0x7f, 0x81, 0x79, 0x86 } \
+ }
+
+///
+/// This protocol contains the EDID information for an active video output device. This is either the
+/// EDID information retrieved from the EFI_EDID_OVERRIDE_PROTOCOL if an override is
+/// available, or an identical copy of the EDID information from the
+/// EFI_EDID_DISCOVERED_PROTOCOL if no overrides are available.
+///
+typedef struct {
+ ///
+ /// The size, in bytes, of the Edid buffer. 0 if no EDID information
+ /// is available from the video output device. Otherwise, it must be a
+ /// minimum of 128 bytes.
+ ///
+ UINT32 SizeOfEdid;
+
+ ///
+ /// A pointer to a read-only array of bytes that contains the EDID
+ /// information for an active video output device. This pointer is
+ /// NULL if no EDID information is available for the video output
+ /// device. The minimum size of a valid Edid buffer is 128 bytes.
+ /// EDID information is defined in the E-EDID EEPROM
+ /// specification published by VESA (www.vesa.org).
+ ///
+ UINT8 *Edid;
+} EFI_EDID_ACTIVE_PROTOCOL;
+
+extern EFI_GUID gEfiEdidActiveProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EdidDiscovered.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EdidDiscovered.h
new file mode 100644
index 0000000000..ccaae1bbb3
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EdidDiscovered.h
@@ -0,0 +1,50 @@
+/** @file
+ EDID Discovered Protocol from the UEFI 2.0 specification.
+
+ This protocol is placed on the video output device child handle. It represents
+ the EDID information being used for the output device represented by the child handle.
+
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EDID_DISCOVERED_H__
+#define __EDID_DISCOVERED_H__
+
+#define EFI_EDID_DISCOVERED_PROTOCOL_GUID \
+ { \
+ 0x1c0c34f6, 0xd380, 0x41fa, {0xa0, 0x49, 0x8a, 0xd0, 0x6c, 0x1a, 0x66, 0xaa } \
+ }
+
+///
+/// This protocol contains the EDID information retrieved from a video output device.
+///
+typedef struct {
+ ///
+ /// The size, in bytes, of the Edid buffer. 0 if no EDID information
+ /// is available from the video output device. Otherwise, it must be a
+ /// minimum of 128 bytes.
+ ///
+ UINT32 SizeOfEdid;
+
+ ///
+ /// A pointer to a read-only array of bytes that contains the EDID
+ /// information for an active video output device. This pointer is
+ /// NULL if no EDID information is available for the video output
+ /// device. The minimum size of a valid Edid buffer is 128 bytes.
+ /// EDID information is defined in the E-EDID EEPROM
+ /// specification published by VESA (www.vesa.org).
+ ///
+ UINT8 *Edid;
+} EFI_EDID_DISCOVERED_PROTOCOL;
+
+extern EFI_GUID gEfiEdidDiscoveredProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EdidOverride.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EdidOverride.h
new file mode 100644
index 0000000000..cd847b666d
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EdidOverride.h
@@ -0,0 +1,67 @@
+/** @file
+ EDID Override Protocol from the UEFI 2.0 specification.
+
+ Allow platform to provide EDID information to the producer of the Graphics Output
+ protocol.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EDID_OVERRIDE_H__
+#define __EDID_OVERRIDE_H__
+
+#define EFI_EDID_OVERRIDE_PROTOCOL_GUID \
+ { \
+ 0x48ecb431, 0xfb72, 0x45c0, {0xa9, 0x22, 0xf4, 0x58, 0xfe, 0x4, 0xb, 0xd5 } \
+ }
+
+typedef struct _EFI_EDID_OVERRIDE_PROTOCOL EFI_EDID_OVERRIDE_PROTOCOL;
+
+#define EFI_EDID_OVERRIDE_DONT_OVERRIDE 0x01
+#define EFI_EDID_OVERRIDE_ENABLE_HOT_PLUG 0x02
+
+/**
+ Returns policy information and potentially a replacement EDID for the specified video output device.
+
+ @param This The EFI_EDID_OVERRIDE_PROTOCOL instance.
+ @param ChildHandle A child handle produced by the Graphics Output EFI
+ driver that represents a video output device.
+ @param Attributes The attributes associated with ChildHandle video output device.
+ @param EdidSize A pointer to the size, in bytes, of the Edid buffer.
+ @param Edid A pointer to callee allocated buffer that contains the EDID that
+ should be used for ChildHandle. A value of NULL
+ represents no EDID override for ChildHandle.
+
+ @retval EFI_SUCCESS Valid overrides returned for ChildHandle.
+ @retval EFI_UNSUPPORTED ChildHandle has no overrides.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID)(
+ IN EFI_EDID_OVERRIDE_PROTOCOL *This,
+ IN EFI_HANDLE *ChildHandle,
+ OUT UINT32 *Attributes,
+ IN OUT UINTN *EdidSize,
+ IN OUT UINT8 **Edid
+ );
+
+///
+/// This protocol is produced by the platform to allow the platform to provide
+/// EDID information to the producer of the Graphics Output protocol.
+///
+struct _EFI_EDID_OVERRIDE_PROTOCOL {
+ EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID GetEdid;
+};
+
+extern EFI_GUID gEfiEdidOverrideProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EraseBlock.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EraseBlock.h
new file mode 100644
index 0000000000..d136ccee24
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/EraseBlock.h
@@ -0,0 +1,105 @@
+/** @file
+ This file defines the EFI Erase Block Protocol.
+
+ Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.6
+
+**/
+
+#ifndef __EFI_ERASE_BLOCK_PROTOCOL_H__
+#define __EFI_ERASE_BLOCK_PROTOCOL_H__
+
+#define EFI_ERASE_BLOCK_PROTOCOL_GUID \
+ { \
+ 0x95a9a93e, 0xa86e, 0x4926, { 0xaa, 0xef, 0x99, 0x18, 0xe7, 0x72, 0xd9, 0x87 } \
+ }
+
+typedef struct _EFI_ERASE_BLOCK_PROTOCOL EFI_ERASE_BLOCK_PROTOCOL;
+
+#define EFI_ERASE_BLOCK_PROTOCOL_REVISION ((2<<16) | (60))
+
+///
+/// EFI_ERASE_BLOCK_TOKEN
+///
+typedef struct {
+ //
+ // If Event is NULL, then blocking I/O is performed. If Event is not NULL and
+ // non-blocking I/O is supported, then non-blocking I/O is performed, and
+ // Event will be signaled when the erase request is completed.
+ //
+ EFI_EVENT Event;
+ //
+ // Defines whether the signaled event encountered an error.
+ //
+ EFI_STATUS TransactionStatus;
+} EFI_ERASE_BLOCK_TOKEN;
+
+/**
+ Erase a specified number of device blocks.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] MediaId The media ID that the erase request is for.
+ @param[in] LBA The starting logical block address to be
+ erased. The caller is responsible for erasing
+ only legitimate locations.
+ @param[in, out] Token A pointer to the token associated with the
+ transaction.
+ @param[in] Size The size in bytes to be erased. This must be
+ a multiple of the physical block size of the
+ device.
+
+ @retval EFI_SUCCESS The erase request was queued if Event is not
+ NULL. The data was erased correctly to the
+ device if the Event is NULL.to the device.
+ @retval EFI_WRITE_PROTECTED The device cannot be erased due to write
+ protection.
+ @retval EFI_DEVICE_ERROR The device reported an error while attempting
+ to perform the erase operation.
+ @retval EFI_INVALID_PARAMETER The erase request contains LBAs that are not
+ valid.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_ERASE) (
+ IN EFI_ERASE_BLOCK_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN EFI_LBA LBA,
+ IN OUT EFI_ERASE_BLOCK_TOKEN *Token,
+ IN UINTN Size
+ );
+
+///
+/// The EFI Erase Block Protocol provides the ability for a device to expose
+/// erase functionality. This optional protocol is installed on the same handle
+/// as the EFI_BLOCK_IO_PROTOCOL or EFI_BLOCK_IO2_PROTOCOL.
+///
+struct _EFI_ERASE_BLOCK_PROTOCOL {
+ //
+ // The revision to which the EFI_ERASE_BLOCK_PROTOCOL adheres. All future
+ // revisions must be backwards compatible. If a future version is not
+ // backwards compatible, it is not the same GUID.
+ //
+ UINT64 Revision;
+ //
+ // Returns the erase length granularity as a number of logical blocks. A
+ // value of 1 means the erase granularity is one logical block.
+ //
+ UINT32 EraseLengthGranularity;
+ EFI_BLOCK_ERASE EraseBlocks;
+};
+
+extern EFI_GUID gEfiEraseBlockProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ExtendedSalBootService.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ExtendedSalBootService.h
new file mode 100644
index 0000000000..167201d85a
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ExtendedSalBootService.h
@@ -0,0 +1,214 @@
+/** @file
+ Definition of Extended SAL Boot Service Protocol
+
+ The Extended SAL Boot Service Protocol provides a mechanisms for platform specific
+ drivers to update the SAL System Table and register Extended SAL Procedures that are
+ callable in physical or virtual mode using the SAL calling convention.
+
+ Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _EXTENDED_SAL_BOOT_SERVICE_PROTOCOL_H_
+#define _EXTENDED_SAL_BOOT_SERVICE_PROTOCOL_H_
+
+#include <IndustryStandard/Sal.h>
+
+#define EXTENDED_SAL_BOOT_SERVICE_PROTOCOL_GUID \
+ { 0xde0ee9a4, 0x3c7a, 0x44f2, {0xb7, 0x8b, 0xe3, 0xcc, 0xd6, 0x9c, 0x3a, 0xf7 } }
+
+typedef struct _EXTENDED_SAL_BOOT_SERVICE_PROTOCOL EXTENDED_SAL_BOOT_SERVICE_PROTOCOL;
+
+/**
+ Adds platform specific information to the to the header of the SAL System Table.
+
+ @param This A pointer to the EXTENDED_SAL_BOOT_SERVICE_PROTOCOL instance.
+ @param SalAVersion Version of recovery SAL PEIM(s) in BCD format. Higher byte contains
+ the major revision and the lower byte contains the minor revision.
+ @param SalBVersion Version of DXE SAL Driver in BCD format. Higher byte contains
+ the major revision and the lower byte contains the minor revision.
+ @param OemId A pointer to a Null-terminated ASCII string that contains OEM unique string.
+ The string cannot be longer than 32 bytes in total length
+ @param ProductId A pointer to a Null-terminated ASCII string that uniquely identifies a family of
+ compatible products. The string cannot be longer than 32 bytes in total length.
+
+ @retval EFI_SUCCESS The SAL System Table header was updated successfully.
+ @retval EFI_INVALID_PARAMETER OemId is NULL.
+ @retval EFI_INVALID_PARAMETER ProductId is NULL.
+ @retval EFI_INVALID_PARAMETER The length of OemId is greater than 32 characters.
+ @retval EFI_INVALID_PARAMETER The length of ProductId is greater than 32 characters.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EXTENDED_SAL_ADD_SST_INFO)(
+ IN EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *This,
+ IN UINT16 SalAVersion,
+ IN UINT16 SalBVersion,
+ IN CHAR8 *OemId,
+ IN CHAR8 *ProductId
+ );
+
+/**
+ Adds an entry to the SAL System Table.
+
+ This function adds the SAL System Table Entry specified by TableEntry and EntrySize
+ to the SAL System Table.
+
+ @param This A pointer to the EXTENDED_SAL_BOOT_SERVICE_PROTOCOL instance.
+ @param TableEntry Pointer to a buffer containing a SAL System Table entry that is EntrySize bytes
+ in length. The first byte of the TableEntry describes the type of entry.
+ @param EntrySize The size, in bytes, of TableEntry.
+
+ @retval EFI_SUCCESSThe SAL System Table was updated successfully.
+ @retval EFI_INVALID_PARAMETER TableEntry is NULL.
+ @retval EFI_INVALID_PARAMETER TableEntry specifies an invalid entry type.
+ @retval EFI_INVALID_PARAMETER EntrySize is not valid for this type of entry.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EXTENDED_SAL_ADD_SST_ENTRY)(
+ IN EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *This,
+ IN UINT8 *TableEntry,
+ IN UINTN EntrySize
+ );
+
+/**
+ Internal ESAL procedures.
+
+ This is prototype of internal Extended SAL procedures, which is registerd by
+ EXTENDED_SAL_REGISTER_INTERNAL_PROC service.
+
+ @param FunctionId The Function ID associated with this Extended SAL Procedure.
+ @param Arg2 Second argument to the Extended SAL procedure.
+ @param Arg3 Third argument to the Extended SAL procedure.
+ @param Arg4 Fourth argument to the Extended SAL procedure.
+ @param Arg5 Fifth argument to the Extended SAL procedure.
+ @param Arg6 Sixth argument to the Extended SAL procedure.
+ @param Arg7 Seventh argument to the Extended SAL procedure.
+ @param Arg8 Eighth argument to the Extended SAL procedure.
+ @param VirtualMode TRUE if the Extended SAL Procedure is being invoked in virtual mode.
+ FALSE if the Extended SAL Procedure is being invoked in physical mode.
+ @param ModuleGlobal A pointer to the global context associated with this Extended SAL Procedure.
+
+ @return The result returned from the specified Extended SAL Procedure
+
+**/
+typedef
+SAL_RETURN_REGS
+(EFIAPI *SAL_INTERNAL_EXTENDED_SAL_PROC)(
+ IN UINT64 FunctionId,
+ IN UINT64 Arg2,
+ IN UINT64 Arg3,
+ IN UINT64 Arg4,
+ IN UINT64 Arg5,
+ IN UINT64 Arg6,
+ IN UINT64 Arg7,
+ IN UINT64 Arg8,
+ IN BOOLEAN VirtualMode,
+ IN VOID *ModuleGlobal OPTIONAL
+ );
+
+/**
+ Registers an Extended SAL Procedure.
+
+ The Extended SAL Procedure specified by InternalSalProc and named by ClassGuidLo,
+ ClassGuidHi, and FunctionId is added to the set of available Extended SAL Procedures.
+
+ @param This A pointer to the EXTENDED_SAL_BOOT_SERVICE_PROTOCOL instance.
+ @param ClassGuidLo The lower 64-bits of the class GUID for the Extended SAL Procedure being added.
+ Each class GUID contains one or more functions specified by a Function ID.
+ @param ClassGuidHi The upper 64-bits of the class GUID for the Extended SAL Procedure being added.
+ Each class GUID contains one or more functions specified by a Function ID.
+ @param FunctionId The Function ID for the Extended SAL Procedure that is being added. This Function
+ ID is a member of the Extended SAL Procedure class specified by ClassGuidLo
+ and ClassGuidHi.
+ @param InternalSalProc A pointer to the Extended SAL Procedure being added.
+ @param PhysicalModuleGlobal Pointer to a module global structure. This is a physical mode pointer.
+ This pointer is passed to the Extended SAL Procedure specified by ClassGuidLo,
+ ClassGuidHi, FunctionId, and InternalSalProc. If the system is in physical mode,
+ then this pointer is passed unmodified to InternalSalProc. If the system is in
+ virtual mode, then the virtual address associated with this pointer is passed to
+ InternalSalProc.
+
+ @retval EFI_SUCCESS The Extended SAL Procedure was added.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to add the Extended SAL Procedure.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EXTENDED_SAL_REGISTER_INTERNAL_PROC)(
+ IN EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *This,
+ IN UINT64 ClassGuidLo,
+ IN UINT64 ClassGuidHi,
+ IN UINT64 FunctionId,
+ IN SAL_INTERNAL_EXTENDED_SAL_PROC InternalSalProc,
+ IN VOID *PhysicalModuleGlobal OPTIONAL
+ );
+
+/**
+ Calls a previously registered Extended SAL Procedure.
+
+ This function calls the Extended SAL Procedure specified by ClassGuidLo, ClassGuidHi,
+ and FunctionId. The set of previously registered Extended SAL Procedures is searched for a
+ matching ClassGuidLo, ClassGuidHi, and FunctionId. If a match is not found, then
+ EFI_SAL_NOT_IMPLEMENTED is returned.
+
+ @param ClassGuidLo The lower 64-bits of the class GUID for the Extended SAL Procedure
+ that is being called.
+ @param ClassGuidHi The upper 64-bits of the class GUID for the Extended SAL Procedure
+ that is being called.
+ @param FunctionId Function ID for the Extended SAL Procedure being called.
+ @param Arg2 Second argument to the Extended SAL procedure.
+ @param Arg3 Third argument to the Extended SAL procedure.
+ @param Arg4 Fourth argument to the Extended SAL procedure.
+ @param Arg5 Fifth argument to the Extended SAL procedure.
+ @param Arg6 Sixth argument to the Extended SAL procedure.
+ @param Arg7 Seventh argument to the Extended SAL procedure.
+ @param Arg8 Eighth argument to the Extended SAL procedure.
+
+ @retval EFI_SAL_NOT_IMPLEMENTED The Extended SAL Procedure specified by ClassGuidLo,
+ ClassGuidHi, and FunctionId has not been registered.
+ @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before virtual mappings
+ for the specified Extended SAL Procedure are available.
+ @retval Other The result returned from the specified Extended SAL Procedure
+
+**/
+typedef
+SAL_RETURN_REGS
+(EFIAPI *EXTENDED_SAL_PROC)(
+ IN UINT64 ClassGuidLo,
+ IN UINT64 ClassGuidHi,
+ IN UINT64 FunctionId,
+ IN UINT64 Arg2,
+ IN UINT64 Arg3,
+ IN UINT64 Arg4,
+ IN UINT64 Arg5,
+ IN UINT64 Arg6,
+ IN UINT64 Arg7,
+ IN UINT64 Arg8
+ );
+
+///
+/// The EXTENDED_SAL_BOOT_SERVICE_PROTOCOL provides a mechanisms for platform specific
+/// drivers to update the SAL System Table and register Extended SAL Procedures that are
+/// callable in physical or virtual mode using the SAL calling convention.
+///
+struct _EXTENDED_SAL_BOOT_SERVICE_PROTOCOL {
+ EXTENDED_SAL_ADD_SST_INFO AddSalSystemTableInfo;
+ EXTENDED_SAL_ADD_SST_ENTRY AddSalSystemTableEntry;
+ EXTENDED_SAL_REGISTER_INTERNAL_PROC RegisterExtendedSalProc;
+ EXTENDED_SAL_PROC ExtendedSalProc;
+};
+
+extern EFI_GUID gEfiExtendedSalBootServiceProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ExtendedSalServiceClasses.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ExtendedSalServiceClasses.h
new file mode 100644
index 0000000000..126beedacf
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ExtendedSalServiceClasses.h
@@ -0,0 +1,275 @@
+/** @file
+ The standard set of Extended SAL service classes.
+
+ Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _EXTENDED_SAL_SERVICE_CLASSES_H_
+#define _EXTENDED_SAL_SERVICE_CLASSES_H_
+
+///
+/// Extended SAL Base I/O Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_LO 0x451531e15aea42b5
+#define EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_HI 0xa6657525d5b831bc
+#define EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID \
+ { 0x5aea42b5, 0x31e1, 0x4515, {0xbc, 0x31, 0xb8, 0xd5, 0x25, 0x75, 0x65, 0xa6 } }
+
+typedef enum {
+ IoReadFunctionId,
+ IoWriteFunctionId,
+ MemReadFunctionId,
+ MemWriteFunctionId
+} EFI_EXTENDED_SAL_BASE_IO_SERVICES_FUNC_ID;
+///@}
+
+///
+/// Extended SAL Stall Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_LO 0x4d8cac2753a58d06
+#define EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_HI 0x704165808af0e9b5
+#define EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID \
+ { 0x53a58d06, 0xac27, 0x4d8c, {0xb5, 0xe9, 0xf0, 0x8a, 0x80, 0x65, 0x41, 0x70 } }
+
+typedef enum {
+ StallFunctionId
+} EFI_EXTENDED_SAL_STALL_FUNC_ID;
+///@}
+
+///
+/// Extended SAL Real Time Clock Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_LO 0x4d02efdb7e97a470
+#define EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_HI 0x96a27bd29061ce8f
+#define EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID \
+ { 0x7e97a470, 0xefdb, 0x4d02, {0x8f, 0xce, 0x61, 0x90, 0xd2, 0x7b, 0xa2, 0x96 } }
+
+typedef enum {
+ GetTimeFunctionId,
+ SetTimeFunctionId,
+ GetWakeupTimeFunctionId,
+ SetWakeupTimeFunctionId,
+ GetRtcFreqFunctionId,
+ InitializeThresholdFunctionId,
+ BumpThresholdCountFunctionId,
+ GetThresholdCountFunctionId
+} EFI_EXTENDED_SAL_RTC_SERVICES_FUNC_ID;
+///@}
+
+///
+/// Extended SAL Variable Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID_LO 0x4370c6414ecb6c53
+#define EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID_HI 0x78836e490e3bb28c
+#define EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID \
+ { 0x4ecb6c53, 0xc641, 0x4370, {0x8c, 0xb2, 0x3b, 0x0e, 0x49, 0x6e, 0x83, 0x78 } }
+
+typedef enum {
+ EsalGetVariableFunctionId,
+ EsalGetNextVariableNameFunctionId,
+ EsalSetVariableFunctionId,
+ EsalQueryVariableInfoFunctionId
+} EFI_EXTENDED_SAL_VARIABLE_SERVICES_FUNC_ID;
+///@}
+
+///
+/// Extended SAL Monotonic Counter Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_MTC_SERVICES_PROTOCOL_GUID_LO 0x408b75e8899afd18
+#define EFI_EXTENDED_SAL_MTC_SERVICES_PROTOCOL_GUID_HI 0x54f4cd7e2e6e1aa4
+#define EFI_EXTENDED_SAL_MTC_SERVICES_PROTOCOL_GUID \
+ { 0x899afd18, 0x75e8, 0x408b, {0xa4, 0x1a, 0x6e, 0x2e, 0x7e, 0xcd, 0xf4, 0x54 } }
+
+typedef enum {
+ GetNextHighMonotonicCountFunctionId
+} EFI_EXTENDED_SAL_MTC_SERVICES_FUNC_ID;
+///@}
+
+///
+/// Extended SAL Reset Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_RESET_SERVICES_PROTOCOL_GUID_LO 0x46f58ce17d019990
+#define EFI_EXTENDED_SAL_RESET_SERVICES_PROTOCOL_GUID_HI 0xa06a6798513c76a7
+#define EFI_EXTENDED_SAL_RESET_SERVICES_PROTOCOL_GUID \
+ { 0x7d019990, 0x8ce1, 0x46f5, {0xa7, 0x76, 0x3c, 0x51, 0x98, 0x67, 0x6a, 0xa0 } }
+
+typedef enum {
+ ResetSystemFunctionId
+} EFI_EXTENDED_SAL_RESET_SERVICES_FUNC_ID;
+///@}
+
+///
+/// Extended SAL Status Code Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_STATUS_CODE_SERVICES_PROTOCOL_GUID_LO 0x420f55e9dbd91d
+#define EFI_EXTENDED_SAL_STATUS_CODE_SERVICES_PROTOCOL_GUID_HI 0x4fb437849f5e3996
+#define EFI_EXTENDED_SAL_STATUS_CODE_SERVICES_PROTOCOL_GUID \
+ { 0xdbd91d, 0x55e9, 0x420f, {0x96, 0x39, 0x5e, 0x9f, 0x84, 0x37, 0xb4, 0x4f } }
+
+typedef enum {
+ ReportStatusCodeServiceFunctionId
+} EFI_EXTENDED_SAL_STATUS_CODE_SERVICES_FUNC_ID;
+///@}
+
+///
+/// Extended SAL Firmware Volume Block Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_LO 0x4f1dbcbba2271df1
+#define EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_HI 0x1a072f17bc06a998
+#define EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID \
+ { 0xa2271df1, 0xbcbb, 0x4f1d, {0x98, 0xa9, 0x06, 0xbc, 0x17, 0x2f, 0x07, 0x1a } }
+
+typedef enum {
+ ReadFunctionId,
+ WriteFunctionId,
+ EraseBlockFunctionId,
+ GetVolumeAttributesFunctionId,
+ SetVolumeAttributesFunctionId,
+ GetPhysicalAddressFunctionId,
+ GetBlockSizeFunctionId,
+} EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_FUNC_ID;
+///@}
+
+///
+/// Extended SAL MP Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO 0x4dc0cf18697d81a2
+#define EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI 0x3f8a613b11060d9e
+#define EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID \
+ { 0x697d81a2, 0xcf18, 0x4dc0, {0x9e, 0x0d, 0x06, 0x11, 0x3b, 0x61, 0x8a, 0x3f } }
+
+typedef enum {
+ AddCpuDataFunctionId,
+ RemoveCpuDataFunctionId,
+ ModifyCpuDataFunctionId,
+ GetCpuDataByIDFunctionId,
+ GetCpuDataByIndexFunctionId,
+ SendIpiFunctionId,
+ CurrentProcInfoFunctionId,
+ NumProcessorsFunctionId,
+ SetMinStateFunctionId,
+ GetMinStateFunctionId
+} EFI_EXTENDED_SAL_MP_SERVICES_FUNC_ID;
+///@}
+
+///
+/// Extended SAL PAL Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO 0x438d0fc2e1cd9d21
+#define EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI 0x571e966de6040397
+#define EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID \
+ { 0xe1cd9d21, 0x0fc2, 0x438d, {0x97, 0x03, 0x04, 0xe6, 0x6d, 0x96, 0x1e, 0x57 } }
+
+typedef enum {
+ PalProcFunctionId,
+ SetNewPalEntryFunctionId,
+ GetNewPalEntryFunctionId,
+ EsalUpdatePalFunctionId
+} EFI_EXTENDED_SAL_PAL_SERVICES_FUNC_ID;
+///@}
+
+///
+/// Extended SAL Base Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO 0x41c30fe0d9e9fa06
+#define EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI 0xf894335a4283fb96
+#define EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID \
+ { 0xd9e9fa06, 0x0fe0, 0x41c3, {0x96, 0xfb, 0x83, 0x42, 0x5a, 0x33, 0x94, 0xf8 } }
+
+typedef enum {
+ SalSetVectorsFunctionId,
+ SalMcRendezFunctionId,
+ SalMcSetParamsFunctionId,
+ EsalGetVectorsFunctionId,
+ EsalMcGetParamsFunctionId,
+ EsalMcGetMcParamsFunctionId,
+ EsalGetMcCheckinFlagsFunctionId,
+ EsalGetPlatformBaseFreqFunctionId,
+ EsalPhysicalIdInfoFunctionId,
+ EsalRegisterPhysicalAddrFunctionId
+} EFI_EXTENDED_SAL_BASE_SERVICES_FUNC_ID;
+///@}
+
+///
+/// Extended SAL MCA Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_LO 0x42b16cc72a591128
+#define EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_HI 0xbb2d683b9358f08a
+#define EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID \
+ { 0x2a591128, 0x6cc7, 0x42b1, {0x8a, 0xf0, 0x58, 0x93, 0x3b, 0x68, 0x2d, 0xbb } }
+
+typedef enum {
+ McaGetStateInfoFunctionId,
+ McaRegisterCpuFunctionId
+} EFI_EXTENDED_SAL_MCA_SERVICES_FUNC_ID;
+///@}
+
+///
+/// Extended SAL PCI Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_PCI_SERVICES_PROTOCOL_GUID_LO 0x4905ad66a46b1a31
+#define EFI_EXTENDED_SAL_PCI_SERVICES_PROTOCOL_GUID_HI 0x6330dc59462bf692
+#define EFI_EXTENDED_SAL_PCI_SERVICES_PROTOCOL_GUID \
+ { 0xa46b1a31, 0xad66, 0x4905, {0x92, 0xf6, 0x2b, 0x46, 0x59, 0xdc, 0x30, 0x63 } }
+
+typedef enum {
+ SalPciConfigReadFunctionId,
+ SalPciConfigWriteFunctionId
+} EFI_EXTENDED_SAL_PCI_SERVICES_FUNC_ID;
+///@}
+
+///
+/// Extended SAL Cache Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_CACHE_SERVICES_PROTOCOL_GUID_LO 0x4ba52743edc9494
+#define EFI_EXTENDED_SAL_CACHE_SERVICES_PROTOCOL_GUID_HI 0x88f11352ef0a1888
+#define EFI_EXTENDED_SAL_CACHE_SERVICES_PROTOCOL_GUID \
+ { 0xedc9494, 0x2743, 0x4ba5, { 0x88, 0x18, 0x0a, 0xef, 0x52, 0x13, 0xf1, 0x88 } }
+
+typedef enum {
+ SalCacheInitFunctionId,
+ SalCacheFlushFunctionId
+} EFI_EXTENDED_SAL_CACHE_SERVICES_FUNC_ID;
+///@}
+
+///
+/// Extended SAL MCA Log Services Class
+///
+///@{
+#define EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO 0x4c0338a3cb3fd86e
+#define EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI 0x7aaba2a3cf905c9a
+#define EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID \
+ { 0xcb3fd86e, 0x38a3, 0x4c03, {0x9a, 0x5c, 0x90, 0xcf, 0xa3, 0xa2, 0xab, 0x7a } }
+
+typedef enum {
+ SalGetStateInfoFunctionId,
+ SalGetStateInfoSizeFunctionId,
+ SalClearStateInfoFunctionId,
+ EsalGetStateBufferFunctionId,
+ EsalSaveStateBufferFunctionId
+} EFI_EXTENDED_SAL_MCA_LOG_SERVICES_FUNC_ID;
+///@}
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FirmwareManagement.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FirmwareManagement.h
new file mode 100644
index 0000000000..e9a9e04ea0
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FirmwareManagement.h
@@ -0,0 +1,538 @@
+/** @file
+ UEFI Firmware Management Protocol definition
+ Firmware Management Protocol provides an abstraction for device to provide firmware
+ management support. The base requirements for managing device firmware images include
+ identifying firmware image revision level and programming the image into the device.
+
+ GetImageInfo() is the only required function. GetImage(), SetImage(),
+ CheckImage(), GetPackageInfo(), and SetPackageInfo() shall return
+ EFI_UNSUPPORTED if not supported by the driver.
+
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2013 - 2014, Hewlett-Packard Development Company, L.P.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.3
+
+**/
+
+#ifndef __EFI_FIRMWARE_MANAGEMENT_PROTOCOL_H__
+#define __EFI_FIRMWARE_MANAGEMENT_PROTOCOL_H__
+
+
+#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GUID \
+ { \
+ 0x86c77a67, 0xb97, 0x4633, {0xa1, 0x87, 0x49, 0x10, 0x4d, 0x6, 0x85, 0xc7 } \
+ }
+
+typedef struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL EFI_FIRMWARE_MANAGEMENT_PROTOCOL;
+
+///
+/// EFI_FIRMWARE_IMAGE_DESCRIPTOR
+///
+typedef struct {
+ ///
+ /// A unique number identifying the firmware image within the device. The number is
+ /// between 1 and DescriptorCount.
+ ///
+ UINT8 ImageIndex;
+ ///
+ /// A unique GUID identifying the firmware image type.
+ ///
+ EFI_GUID ImageTypeId;
+ ///
+ /// A unique number identifying the firmware image.
+ ///
+ UINT64 ImageId;
+ ///
+ /// A pointer to a null-terminated string representing the firmware image name.
+ ///
+ CHAR16 *ImageIdName;
+ ///
+ /// Identifies the version of the device firmware. The format is vendor specific and new
+ /// version must have a greater value than an old version.
+ ///
+ UINT32 Version;
+ ///
+ /// A pointer to a null-terminated string representing the firmware image version name.
+ ///
+ CHAR16 *VersionName;
+ ///
+ /// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid.
+ ///
+ UINTN Size;
+ ///
+ /// Image attributes that are supported by this device. See 'Image Attribute Definitions'
+ /// for possible returned values of this parameter. A value of 1 indicates the attribute is
+ /// supported and the current setting value is indicated in AttributesSetting. A
+ /// value of 0 indicates the attribute is not supported and the current setting value in
+ /// AttributesSetting is meaningless.
+ ///
+ UINT64 AttributesSupported;
+ ///
+ /// Image attributes. See 'Image Attribute Definitions' for possible returned values of
+ /// this parameter.
+ ///
+ UINT64 AttributesSetting;
+ ///
+ /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned
+ /// values of this parameter.
+ ///
+ UINT64 Compatibilities;
+ ///
+ /// Describes the lowest ImageDescriptor version that the device will accept. Only
+ /// present in version 2 or higher.
+ ///
+ UINT32 LowestSupportedImageVersion;
+ ///
+ /// Describes the version that was last attempted to update. If no update attempted the
+ /// value will be 0. If the update attempted was improperly formatted and no version
+ /// number was available then the value will be zero. Only present in version 3 or higher.
+ UINT32 LastAttemptVersion;
+ ///
+ /// Describes the status that was last attempted to update. If no update has been attempted
+ /// the value will be LAST_ATTEMPT_STATUS_SUCCESS. Only present in version 3 or higher.
+ ///
+ UINT32 LastAttemptStatus;
+ ///
+ /// An optional number to identify the unique hardware instance within the system for
+ /// devices that may have multiple instances (Example: a plug in pci network card). This
+ /// number must be unique within the namespace of the ImageTypeId GUID and
+ /// ImageIndex. For FMP instances that have multiple descriptors for a single
+ /// hardware instance, all descriptors must have the same HardwareInstance value.
+ /// This number must be consistent between boots and should be based on some sort of
+ /// hardware identified unique id (serial number, etc) whenever possible. If a hardware
+ /// based number is not available the FMP provider may use some other characteristic
+ /// such as device path, bus/dev/function, slot num, etc for generating the
+ /// HardwareInstance. For implementations that will never have more than one
+ /// instance a zero can be used. A zero means the FMP provider is not able to determine a
+ /// unique hardware instance number or a hardware instance number is not needed. Only
+ /// present in version 3 or higher.
+ ///
+ UINT64 HardwareInstance;
+} EFI_FIRMWARE_IMAGE_DESCRIPTOR;
+
+
+//
+// Image Attribute Definitions
+//
+///
+/// The attribute IMAGE_ATTRIBUTE_IMAGE_UPDATABLE indicates this device supports firmware
+/// image update.
+///
+#define IMAGE_ATTRIBUTE_IMAGE_UPDATABLE 0x0000000000000001
+///
+/// The attribute IMAGE_ATTRIBUTE_RESET_REQUIRED indicates a reset of the device is required
+/// for the new firmware image to take effect after a firmware update. The device is the device hosting
+/// the firmware image.
+///
+#define IMAGE_ATTRIBUTE_RESET_REQUIRED 0x0000000000000002
+///
+/// The attribute IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED indicates authentication is
+/// required to perform the following image operations: GetImage(), SetImage(), and
+/// CheckImage(). See 'Image Attribute - Authentication'.
+///
+#define IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED 0x0000000000000004
+///
+/// The attribute IMAGE_ATTRIBUTE_IN_USE indicates the current state of the firmware image.
+/// This distinguishes firmware images in a device that supports redundant images.
+///
+#define IMAGE_ATTRIBUTE_IN_USE 0x0000000000000008
+///
+/// The attribute IMAGE_ATTRIBUTE_UEFI_IMAGE indicates that this image is an EFI compatible image.
+///
+#define IMAGE_ATTRIBUTE_UEFI_IMAGE 0x0000000000000010
+
+
+//
+// Image Compatibility Definitions
+//
+/// Values from 0x0000000000000002 thru 0x000000000000FFFF are reserved for future assignments.
+/// Values from 0x0000000000010000 thru 0xFFFFFFFFFFFFFFFF are used by firmware vendor for
+/// compatibility check.
+///
+#define IMAGE_COMPATIBILITY_CHECK_SUPPORTED 0x0000000000000001
+
+///
+/// Descriptor Version exposed by GetImageInfo() function
+///
+#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION 3
+
+
+///
+/// Image Attribute -Authentication Required
+///
+typedef struct {
+ ///
+ /// It is included in the signature of AuthInfo. It is used to ensure freshness/no replay.
+ /// It is incremented during each firmware image operation.
+ ///
+ UINT64 MonotonicCount;
+ ///
+ /// Provides the authorization for the firmware image operations. It is a signature across
+ /// the image data and the Monotonic Count value. Caller uses the private key that is
+ /// associated with a public key that has been provisioned via the key exchange.
+ /// Because this is defined as a signature, WIN_CERTIFICATE_UEFI_GUID.CertType must
+ /// be EFI_CERT_TYPE_PKCS7_GUID.
+ ///
+ WIN_CERTIFICATE_UEFI_GUID AuthInfo;
+} EFI_FIRMWARE_IMAGE_AUTHENTICATION;
+
+
+//
+// ImageUpdatable Definitions
+//
+///
+/// IMAGE_UPDATABLE_VALID indicates SetImage() will accept the new image and update the
+/// device with the new image. The version of the new image could be higher or lower than
+/// the current image. SetImage VendorCode is optional but can be used for vendor
+/// specific action.
+///
+#define IMAGE_UPDATABLE_VALID 0x0000000000000001
+///
+/// IMAGE_UPDATABLE_INVALID indicates SetImage() will reject the new image. No additional
+/// information is provided for the rejection.
+///
+#define IMAGE_UPDATABLE_INVALID 0x0000000000000002
+///
+/// IMAGE_UPDATABLE_INVALID_TYPE indicates SetImage() will reject the new image. The
+/// rejection is due to the new image is not a firmware image recognized for this device.
+///
+#define IMAGE_UPDATABLE_INVALID_TYPE 0x0000000000000004
+///
+/// IMAGE_UPDATABLE_INVALID_OLD indicates SetImage() will reject the new image. The
+/// rejection is due to the new image version is older than the current firmware image
+/// version in the device. The device firmware update policy does not support firmware
+/// version downgrade.
+///
+#define IMAGE_UPDATABLE_INVALID_OLD 0x0000000000000008
+///
+/// IMAGE_UPDATABLE_VALID_WITH_VENDOR_CODE indicates SetImage() will accept and update
+/// the new image only if a correct VendorCode is provided or else image would be
+/// rejected and SetImage will return appropriate error.
+///
+#define IMAGE_UPDATABLE_VALID_WITH_VENDOR_CODE 0x0000000000000010
+
+
+//
+// Package Attribute Definitions
+//
+///
+/// The attribute PACKAGE_ATTRIBUTE_VERSION_UPDATABLE indicates this device supports the
+/// update of the firmware package version.
+///
+#define PACKAGE_ATTRIBUTE_VERSION_UPDATABLE 0x0000000000000001
+///
+/// The attribute PACKAGE_ATTRIBUTE_RESET_REQUIRED indicates a reset of the device is
+/// required for the new package info to take effect after an update.
+///
+#define PACKAGE_ATTRIBUTE_RESET_REQUIRED 0x0000000000000002
+///
+/// The attribute PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED indicates authentication
+/// is required to update the package info.
+///
+#define PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED 0x0000000000000004
+
+/**
+ Callback function to report the process of the firmware updating.
+
+ @param[in] Completion A value between 1 and 100 indicating the current completion
+ progress of the firmware update. Completion progress is
+ reported as from 1 to 100 percent. A value of 0 is used by
+ the driver to indicate that progress reporting is not supported.
+
+ @retval EFI_SUCCESS SetImage() continues to do the callback if supported.
+ @retval other SetImage() discontinues the callback and completes
+ the update and returns.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS)(
+ IN UINTN Completion
+ );
+
+/**
+ Returns information about the current firmware image(s) of the device.
+
+ This function allows a copy of the current firmware image to be created and saved.
+ The saved copy could later been used, for example, in firmware image recovery or rollback.
+
+ @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.
+ @param[in, out] ImageInfoSize A pointer to the size, in bytes, of the ImageInfo buffer.
+ On input, this is the size of the buffer allocated by the caller.
+ On output, it is the size of the buffer returned by the firmware
+ if the buffer was large enough, or the size of the buffer needed
+ to contain the image(s) information if the buffer was too small.
+ @param[in, out] ImageInfo A pointer to the buffer in which firmware places the current image(s)
+ information. The information is an array of EFI_FIRMWARE_IMAGE_DESCRIPTORs.
+ @param[out] DescriptorVersion A pointer to the location in which firmware returns the version number
+ associated with the EFI_FIRMWARE_IMAGE_DESCRIPTOR.
+ @param[out] DescriptorCount A pointer to the location in which firmware returns the number of
+ descriptors or firmware images within this device.
+ @param[out] DescriptorSize A pointer to the location in which firmware returns the size, in bytes,
+ of an individual EFI_FIRMWARE_IMAGE_DESCRIPTOR.
+ @param[out] PackageVersion A version number that represents all the firmware images in the device.
+ The format is vendor specific and new version must have a greater value
+ than the old version. If PackageVersion is not supported, the value is
+ 0xFFFFFFFF. A value of 0xFFFFFFFE indicates that package version comparison
+ is to be performed using PackageVersionName. A value of 0xFFFFFFFD indicates
+ that package version update is in progress.
+ @param[out] PackageVersionName A pointer to a pointer to a null-terminated string representing the
+ package version name. The buffer is allocated by this function with
+ AllocatePool(), and it is the caller's responsibility to free it with a call
+ to FreePool().
+
+ @retval EFI_SUCCESS The device was successfully updated with the new image.
+ @retval EFI_BUFFER_TOO_SMALL The ImageInfo buffer was too small. The current buffer size
+ needed to hold the image(s) information is returned in ImageInfoSize.
+ @retval EFI_INVALID_PARAMETER ImageInfoSize is NULL.
+ @retval EFI_DEVICE_ERROR Valid information could not be returned. Possible corrupted image.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE_INFO)(
+ IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
+ IN OUT UINTN *ImageInfoSize,
+ IN OUT EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo,
+ OUT UINT32 *DescriptorVersion,
+ OUT UINT8 *DescriptorCount,
+ OUT UINTN *DescriptorSize,
+ OUT UINT32 *PackageVersion,
+ OUT CHAR16 **PackageVersionName
+ );
+
+/**
+ Retrieves a copy of the current firmware image of the device.
+
+ This function allows a copy of the current firmware image to be created and saved.
+ The saved copy could later been used, for example, in firmware image recovery or rollback.
+
+ @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.
+ @param[in] ImageIndex A unique number identifying the firmware image(s) within the device.
+ The number is between 1 and DescriptorCount.
+ @param[out] Image Points to the buffer where the current image is copied to.
+ @param[out] ImageSize On entry, points to the size of the buffer pointed to by Image, in bytes.
+ On return, points to the length of the image, in bytes.
+
+ @retval EFI_SUCCESS The device was successfully updated with the new image.
+ @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to hold the
+ image. The current buffer size needed to hold the image is returned
+ in ImageSize.
+ @retval EFI_INVALID_PARAMETER The Image was NULL.
+ @retval EFI_NOT_FOUND The current image is not copied to the buffer.
+ @retval EFI_UNSUPPORTED The operation is not supported.
+ @retval EFI_SECURITY_VIOLATIO The operation could not be performed due to an authentication failure.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE)(
+ IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
+ IN UINT8 ImageIndex,
+ IN OUT VOID *Image,
+ IN OUT UINTN *ImageSize
+ );
+
+/**
+ Updates the firmware image of the device.
+
+ This function updates the hardware with the new firmware image.
+ This function returns EFI_UNSUPPORTED if the firmware image is not updatable.
+ If the firmware image is updatable, the function should perform the following minimal validations
+ before proceeding to do the firmware image update.
+ - Validate the image authentication if image has attribute
+ IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED. The function returns
+ EFI_SECURITY_VIOLATION if the validation fails.
+ - Validate the image is a supported image for this device. The function returns EFI_ABORTED if
+ the image is unsupported. The function can optionally provide more detailed information on
+ why the image is not a supported image.
+ - Validate the data from VendorCode if not null. Image validation must be performed before
+ VendorCode data validation. VendorCode data is ignored or considered invalid if image
+ validation failed. The function returns EFI_ABORTED if the data is invalid.
+
+ VendorCode enables vendor to implement vendor-specific firmware image update policy. Null if
+ the caller did not specify the policy or use the default policy. As an example, vendor can implement
+ a policy to allow an option to force a firmware image update when the abort reason is due to the new
+ firmware image version is older than the current firmware image version or bad image checksum.
+ Sensitive operations such as those wiping the entire firmware image and render the device to be
+ non-functional should be encoded in the image itself rather than passed with the VendorCode.
+ AbortReason enables vendor to have the option to provide a more detailed description of the abort
+ reason to the caller.
+
+ @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.
+ @param[in] ImageIndex A unique number identifying the firmware image(s) within the device.
+ The number is between 1 and DescriptorCount.
+ @param[in] Image Points to the new image.
+ @param[in] ImageSize Size of the new image in bytes.
+ @param[in] VendorCode This enables vendor to implement vendor-specific firmware image update policy.
+ Null indicates the caller did not specify the policy or use the default policy.
+ @param[in] Progress A function used by the driver to report the progress of the firmware update.
+ @param[out] AbortReason A pointer to a pointer to a null-terminated string providing more
+ details for the aborted operation. The buffer is allocated by this function
+ with AllocatePool(), and it is the caller's responsibility to free it with a
+ call to FreePool().
+
+ @retval EFI_SUCCESS The device was successfully updated with the new image.
+ @retval EFI_ABORTED The operation is aborted.
+ @retval EFI_INVALID_PARAMETER The Image was NULL.
+ @retval EFI_UNSUPPORTED The operation is not supported.
+ @retval EFI_SECURITY_VIOLATIO The operation could not be performed due to an authentication failure.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_IMAGE)(
+ IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
+ IN UINT8 ImageIndex,
+ IN CONST VOID *Image,
+ IN UINTN ImageSize,
+ IN CONST VOID *VendorCode,
+ IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress,
+ OUT CHAR16 **AbortReason
+ );
+
+/**
+ Checks if the firmware image is valid for the device.
+
+ This function allows firmware update application to validate the firmware image without
+ invoking the SetImage() first.
+
+ @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.
+ @param[in] ImageIndex A unique number identifying the firmware image(s) within the device.
+ The number is between 1 and DescriptorCount.
+ @param[in] Image Points to the new image.
+ @param[in] ImageSize Size of the new image in bytes.
+ @param[out] ImageUpdatable Indicates if the new image is valid for update. It also provides,
+ if available, additional information if the image is invalid.
+
+ @retval EFI_SUCCESS The image was successfully checked.
+ @retval EFI_INVALID_PARAMETER The Image was NULL.
+ @retval EFI_UNSUPPORTED The operation is not supported.
+ @retval EFI_SECURITY_VIOLATIO The operation could not be performed due to an authentication failure.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_CHECK_IMAGE)(
+ IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
+ IN UINT8 ImageIndex,
+ IN CONST VOID *Image,
+ IN UINTN ImageSize,
+ OUT UINT32 *ImageUpdatable
+ );
+
+/**
+ Returns information about the firmware package.
+
+ This function returns package information.
+
+ @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.
+ @param[out] PackageVersion A version number that represents all the firmware images in the device.
+ The format is vendor specific and new version must have a greater value
+ than the old version. If PackageVersion is not supported, the value is
+ 0xFFFFFFFF. A value of 0xFFFFFFFE indicates that package version
+ comparison is to be performed using PackageVersionName. A value of
+ 0xFFFFFFFD indicates that package version update is in progress.
+ @param[out] PackageVersionName A pointer to a pointer to a null-terminated string representing
+ the package version name. The buffer is allocated by this function with
+ AllocatePool(), and it is the caller's responsibility to free it with a
+ call to FreePool().
+ @param[out] PackageVersionNameMaxLen The maximum length of package version name if device supports update of
+ package version name. A value of 0 indicates the device does not support
+ update of package version name. Length is the number of Unicode characters,
+ including the terminating null character.
+ @param[out] AttributesSupported Package attributes that are supported by this device. See 'Package Attribute
+ Definitions' for possible returned values of this parameter. A value of 1
+ indicates the attribute is supported and the current setting value is
+ indicated in AttributesSetting. A value of 0 indicates the attribute is not
+ supported and the current setting value in AttributesSetting is meaningless.
+ @param[out] AttributesSetting Package attributes. See 'Package Attribute Definitions' for possible returned
+ values of this parameter
+
+ @retval EFI_SUCCESS The package information was successfully returned.
+ @retval EFI_UNSUPPORTED The operation is not supported.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_PACKAGE_INFO)(
+ IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
+ OUT UINT32 *PackageVersion,
+ OUT CHAR16 **PackageVersionName,
+ OUT UINT32 *PackageVersionNameMaxLen,
+ OUT UINT64 *AttributesSupported,
+ OUT UINT64 *AttributesSetting
+ );
+
+/**
+ Updates information about the firmware package.
+
+ This function updates package information.
+ This function returns EFI_UNSUPPORTED if the package information is not updatable.
+ VendorCode enables vendor to implement vendor-specific package information update policy.
+ Null if the caller did not specify this policy or use the default policy.
+
+ @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.
+ @param[in] Image Points to the authentication image.
+ Null if authentication is not required.
+ @param[in] ImageSize Size of the authentication image in bytes.
+ 0 if authentication is not required.
+ @param[in] VendorCode This enables vendor to implement vendor-specific firmware
+ image update policy.
+ Null indicates the caller did not specify this policy or use
+ the default policy.
+ @param[in] PackageVersion The new package version.
+ @param[in] PackageVersionName A pointer to the new null-terminated Unicode string representing
+ the package version name.
+ The string length is equal to or less than the value returned in
+ PackageVersionNameMaxLen.
+
+ @retval EFI_SUCCESS The device was successfully updated with the new package
+ information.
+ @retval EFI_INVALID_PARAMETER The PackageVersionName length is longer than the value
+ returned in PackageVersionNameMaxLen.
+ @retval EFI_UNSUPPORTED The operation is not supported.
+ @retval EFI_SECURITY_VIOLATIO The operation could not be performed due to an authentication failure.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_PACKAGE_INFO)(
+ IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
+ IN CONST VOID *Image,
+ IN UINTN ImageSize,
+ IN CONST VOID *VendorCode,
+ IN UINT32 PackageVersion,
+ IN CONST CHAR16 *PackageVersionName
+ );
+
+///
+/// EFI_FIRMWARE_MANAGEMENT_PROTOCOL
+/// The protocol for managing firmware provides the following services.
+/// - Get the attributes of the current firmware image. Attributes include revision level.
+/// - Get a copy of the current firmware image. As an example, this service could be used by a
+/// management application to facilitate a firmware roll-back.
+/// - Program the device with a firmware image supplied by the user.
+/// - Label all the firmware images within a device with a single version.
+///
+struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL {
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE_INFO GetImageInfo;
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE GetImage;
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_IMAGE SetImage;
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL_CHECK_IMAGE CheckImage;
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_PACKAGE_INFO GetPackageInfo;
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_PACKAGE_INFO SetPackageInfo;
+};
+
+extern EFI_GUID gEfiFirmwareManagementProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FirmwareVolume2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FirmwareVolume2.h
new file mode 100644
index 0000000000..00523bf083
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FirmwareVolume2.h
@@ -0,0 +1,762 @@
+/** @file
+ The Firmware Volume Protocol provides file-level access to the firmware volume.
+ Each firmware volume driver must produce an instance of the
+ Firmware Volume Protocol if the firmware volume is to be visible to
+ the system during the DXE phase. The Firmware Volume Protocol also provides
+ mechanisms for determining and modifying some attributes of the firmware volume.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference: PI
+ Version 1.00.
+
+**/
+
+#ifndef __FIRMWARE_VOLUME2_H__
+#define __FIRMWARE_VOLUME2_H__
+
+#define EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID \
+ { 0x220e73b6, 0x6bdb, 0x4413, { 0x84, 0x5, 0xb9, 0x74, 0xb1, 0x8, 0x61, 0x9a } }
+
+typedef struct _EFI_FIRMWARE_VOLUME2_PROTOCOL EFI_FIRMWARE_VOLUME2_PROTOCOL;
+
+
+///
+/// EFI_FV_ATTRIBUTES
+///
+typedef UINT64 EFI_FV_ATTRIBUTES;
+
+//
+// EFI_FV_ATTRIBUTES bit definitions
+//
+// EFI_FV_ATTRIBUTES bit semantics
+#define EFI_FV2_READ_DISABLE_CAP 0x0000000000000001ULL
+#define EFI_FV2_READ_ENABLE_CAP 0x0000000000000002ULL
+#define EFI_FV2_READ_STATUS 0x0000000000000004ULL
+#define EFI_FV2_WRITE_DISABLE_CAP 0x0000000000000008ULL
+#define EFI_FV2_WRITE_ENABLE_CAP 0x0000000000000010ULL
+#define EFI_FV2_WRITE_STATUS 0x0000000000000020ULL
+#define EFI_FV2_LOCK_CAP 0x0000000000000040ULL
+#define EFI_FV2_LOCK_STATUS 0x0000000000000080ULL
+#define EFI_FV2_WRITE_POLICY_RELIABLE 0x0000000000000100ULL
+#define EFI_FV2_READ_LOCK_CAP 0x0000000000001000ULL
+#define EFI_FV2_READ_LOCK_STATUS 0x0000000000002000ULL
+#define EFI_FV2_WRITE_LOCK_CAP 0x0000000000004000ULL
+#define EFI_FV2_WRITE_LOCK_STATUS 0x0000000000008000ULL
+#define EFI_FV2_ALIGNMENT 0x00000000001F0000ULL
+#define EFI_FV2_ALIGNMENT_1 0x0000000000000000ULL
+#define EFI_FV2_ALIGNMENT_2 0x0000000000010000ULL
+#define EFI_FV2_ALIGNMENT_4 0x0000000000020000ULL
+#define EFI_FV2_ALIGNMENT_8 0x0000000000030000ULL
+#define EFI_FV2_ALIGNMENT_16 0x0000000000040000ULL
+#define EFI_FV2_ALIGNMENT_32 0x0000000000050000ULL
+#define EFI_FV2_ALIGNMENT_64 0x0000000000060000ULL
+#define EFI_FV2_ALIGNMENT_128 0x0000000000070000ULL
+#define EFI_FV2_ALIGNMENT_256 0x0000000000080000ULL
+#define EFI_FV2_ALIGNMENT_512 0x0000000000090000ULL
+#define EFI_FV2_ALIGNMENT_1K 0x00000000000A0000ULL
+#define EFI_FV2_ALIGNMENT_2K 0x00000000000B0000ULL
+#define EFI_FV2_ALIGNMENT_4K 0x00000000000C0000ULL
+#define EFI_FV2_ALIGNMENT_8K 0x00000000000D0000ULL
+#define EFI_FV2_ALIGNMENT_16K 0x00000000000E0000ULL
+#define EFI_FV2_ALIGNMENT_32K 0x00000000000F0000ULL
+#define EFI_FV2_ALIGNMENT_64K 0x0000000000100000ULL
+#define EFI_FV2_ALIGNMENT_128K 0x0000000000110000ULL
+#define EFI_FV2_ALIGNMENT_256K 0x0000000000120000ULL
+#define EFI_FV2_ALIGNMENT_512K 0x0000000000130000ULL
+#define EFI_FV2_ALIGNMENT_1M 0x0000000000140000ULL
+#define EFI_FV2_ALIGNMENT_2M 0x0000000000150000ULL
+#define EFI_FV2_ALIGNMENT_4M 0x0000000000160000ULL
+#define EFI_FV2_ALIGNMENT_8M 0x0000000000170000ULL
+#define EFI_FV2_ALIGNMENT_16M 0x0000000000180000ULL
+#define EFI_FV2_ALIGNMENT_32M 0x0000000000190000ULL
+#define EFI_FV2_ALIGNMENT_64M 0x00000000001A0000ULL
+#define EFI_FV2_ALIGNMENT_128M 0x00000000001B0000ULL
+#define EFI_FV2_ALIGNMENT_256M 0x00000000001C0000ULL
+#define EFI_FV2_ALIGNMENT_512M 0x00000000001D0000ULL
+#define EFI_FV2_ALIGNMENT_1G 0x00000000001E0000ULL
+#define EFI_FV2_ALIGNMENT_2G 0x00000000001F0000ULL
+
+/**
+ Returns the attributes and current settings of the firmware volume.
+
+ Because of constraints imposed by the underlying firmware
+ storage, an instance of the Firmware Volume Protocol may not
+ be to able to support all possible variations of this
+ architecture. These constraints and the current state of the
+ firmware volume are exposed to the caller using the
+ GetVolumeAttributes() function. GetVolumeAttributes() is
+ callable only from TPL_NOTIFY and below. Behavior of
+ GetVolumeAttributes() at any EFI_TPL above TPL_NOTIFY is
+ undefined.
+
+ @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.
+
+ @param FvAttributes Pointer to an EFI_FV_ATTRIBUTES in which
+ the attributes and current settings are
+ returned.
+
+
+ @retval EFI_SUCCESS The firmware volume attributes were
+ returned.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_FV_GET_ATTRIBUTES)(
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ OUT EFI_FV_ATTRIBUTES *FvAttributes
+);
+
+
+/**
+ Modifies the current settings of the firmware volume according to the input parameter.
+
+ The SetVolumeAttributes() function is used to set configurable
+ firmware volume attributes. Only EFI_FV_READ_STATUS,
+ EFI_FV_WRITE_STATUS, and EFI_FV_LOCK_STATUS may be modified, and
+ then only in accordance with the declared capabilities. All
+ other bits of FvAttributes are ignored on input. On successful
+ return, all bits of *FvAttributes are valid and it contains the
+ completed EFI_FV_ATTRIBUTES for the volume. To modify an
+ attribute, the corresponding status bit in the EFI_FV_ATTRIBUTES
+ is set to the desired value on input. The EFI_FV_LOCK_STATUS bit
+ does not affect the ability to read or write the firmware
+ volume. Rather, once the EFI_FV_LOCK_STATUS bit is set, it
+ prevents further modification to all the attribute bits.
+ SetVolumeAttributes() is callable only from TPL_NOTIFY and
+ below. Behavior of SetVolumeAttributes() at any EFI_TPL above
+ TPL_NOTIFY is undefined.
+
+ @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.
+
+ @param FvAttributes On input, FvAttributes is a pointer to
+ an EFI_FV_ATTRIBUTES containing the
+ desired firmware volume settings. On
+ successful return, it contains the new
+ settings of the firmware volume. On
+ unsuccessful return, FvAttributes is not
+ modified and the firmware volume
+ settings are not changed.
+
+ @retval EFI_SUCCESS The requested firmware volume attributes
+ were set and the resulting
+ EFI_FV_ATTRIBUTES is returned in
+ FvAttributes.
+
+ @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_READ_STATUS
+ is set to 1 on input, but the
+ device does not support enabling
+ reads
+ (FvAttributes:EFI_FV_READ_ENABLE
+ is clear on return from
+ GetVolumeAttributes()). Actual
+ volume attributes are unchanged.
+
+ @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_READ_STATUS
+ is cleared to 0 on input, but
+ the device does not support
+ disabling reads
+ (FvAttributes:EFI_FV_READ_DISABL
+ is clear on return from
+ GetVolumeAttributes()). Actual
+ volume attributes are unchanged.
+
+ @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_WRITE_STATUS
+ is set to 1 on input, but the
+ device does not support enabling
+ writes
+ (FvAttributes:EFI_FV_WRITE_ENABL
+ is clear on return from
+ GetVolumeAttributes()). Actual
+ volume attributes are unchanged.
+
+ @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_WRITE_STATUS
+ is cleared to 0 on input, but
+ the device does not support
+ disabling writes
+ (FvAttributes:EFI_FV_WRITE_DISAB
+ is clear on return from
+ GetVolumeAttributes()). Actual
+ volume attributes are unchanged.
+
+ @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_LOCK_STATUS
+ is set on input, but the device
+ does not support locking
+ (FvAttributes:EFI_FV_LOCK_CAP is
+ clear on return from
+ GetVolumeAttributes()). Actual
+ volume attributes are unchanged.
+
+ @retval EFI_ACCESS_DENIED Device is locked and does not
+ allow attribute modification
+ (FvAttributes:EFI_FV_LOCK_STATUS
+ is set on return from
+ GetVolumeAttributes()). Actual
+ volume attributes are unchanged.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_FV_SET_ATTRIBUTES)(
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN OUT EFI_FV_ATTRIBUTES *FvAttributes
+);
+
+
+/**
+ Retrieves a file and/or file information from the firmware volume.
+
+ ReadFile() is used to retrieve any file from a firmware volume
+ during the DXE phase. The actual binary encoding of the file in
+ the firmware volume media may be in any arbitrary format as long
+ as it does the following: It is accessed using the Firmware
+ Volume Protocol. The image that is returned follows the image
+ format defined in Code Definitions: PI Firmware File Format.
+ If the input value of Buffer==NULL, it indicates the caller is
+ requesting only that the type, attributes, and size of the
+ file be returned and that there is no output buffer. In this
+ case, the following occurs:
+ - BufferSize is returned with the size that is required to
+ successfully complete the read.
+ - The output parameters FoundType and *FileAttributes are
+ returned with valid values.
+ - The returned value of *AuthenticationStatus is undefined.
+
+ If the input value of Buffer!=NULL, the output buffer is
+ specified by a double indirection of the Buffer parameter. The
+ input value of *Buffer is used to determine if the output
+ buffer is caller allocated or is dynamically allocated by
+ ReadFile(). If the input value of *Buffer!=NULL, it indicates
+ the output buffer is caller allocated. In this case, the input
+ value of *BufferSize indicates the size of the
+ caller-allocated output buffer. If the output buffer is not
+ large enough to contain the entire requested output, it is
+ filled up to the point that the output buffer is exhausted and
+ EFI_WARN_BUFFER_TOO_SMALL is returned, and then BufferSize is
+ returned with the size required to successfully complete the
+ read. All other output parameters are returned with valid
+ values. If the input value of *Buffer==NULL, it indicates the
+ output buffer is to be allocated by ReadFile(). In this case,
+ ReadFile() will allocate an appropriately sized buffer from
+ boot services pool memory, which will be returned in Buffer.
+ The size of the new buffer is returned in BufferSize and all
+ other output parameters are returned with valid values.
+ ReadFile() is callable only from TPL_NOTIFY and below.
+ Behavior of ReadFile() at any EFI_TPL above TPL_NOTIFY is
+ undefined.
+
+ @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.
+
+ @param NameGuid Pointer to an EFI_GUID, which is the file
+ name. All firmware file names are EFI_GUIDs.
+ A single firmware volume must not have two
+ valid files with the same file name
+ EFI_GUID.
+
+ @param Buffer Pointer to a pointer to a buffer in which the
+ file contents are returned, not including the
+ file header.
+
+ @param BufferSize Pointer to a caller-allocated UINTN. It
+ indicates the size of the memory
+ represented by Buffer.
+
+ @param FoundType Pointer to a caller-allocated EFI_FV_FILETYPE.
+
+ @param FileAttributes Pointer to a caller-allocated
+ EFI_FV_FILE_ATTRIBUTES.
+
+ @param AuthenticationStatus Pointer to a caller-allocated
+ UINT32 in which the
+ authentication status is
+ returned.
+
+ @retval EFI_SUCCESS The call completed successfully.
+
+ @retval EFI_WARN_BUFFER_TOO_SMALL The buffer is too small to
+ contain the requested
+ output. The buffer is
+ filled and the output is
+ truncated.
+
+ @retval EFI_OUT_OF_RESOURCES An allocation failure occurred.
+
+ @retval EFI_NOT_FOUND Name was not found in the firmware volume.
+
+ @retval EFI_DEVICE_ERROR A hardware error occurred when
+ attempting to access the firmware volume.
+
+ @retval EFI_ACCESS_DENIED The firmware volume is configured to
+ disallow reads.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_FV_READ_FILE)(
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN CONST EFI_GUID *NameGuid,
+ IN OUT VOID **Buffer,
+ IN OUT UINTN *BufferSize,
+ OUT EFI_FV_FILETYPE *FoundType,
+ OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes,
+ OUT UINT32 *AuthenticationStatus
+);
+
+
+
+/**
+ Locates the requested section within a file and returns it in a buffer.
+
+ ReadSection() is used to retrieve a specific section from a file
+ within a firmware volume. The section returned is determined
+ using a depth-first, left-to-right search algorithm through all
+ sections found in the specified file. The output buffer is specified by a double indirection
+ of the Buffer parameter. The input value of Buffer is used to
+ determine if the output buffer is caller allocated or is
+ dynamically allocated by ReadSection(). If the input value of
+ Buffer!=NULL, it indicates that the output buffer is caller
+ allocated. In this case, the input value of *BufferSize
+ indicates the size of the caller-allocated output buffer. If
+ the output buffer is not large enough to contain the entire
+ requested output, it is filled up to the point that the output
+ buffer is exhausted and EFI_WARN_BUFFER_TOO_SMALL is returned,
+ and then BufferSize is returned with the size that is required
+ to successfully complete the read. All other
+ output parameters are returned with valid values. If the input
+ value of *Buffer==NULL, it indicates the output buffer is to
+ be allocated by ReadSection(). In this case, ReadSection()
+ will allocate an appropriately sized buffer from boot services
+ pool memory, which will be returned in *Buffer. The size of
+ the new buffer is returned in *BufferSize and all other output
+ parameters are returned with valid values. ReadSection() is
+ callable only from TPL_NOTIFY and below. Behavior of
+ ReadSection() at any EFI_TPL above TPL_NOTIFY is
+ undefined.
+
+ @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.
+
+ @param NameGuid Pointer to an EFI_GUID, which indicates the
+ file name from which the requested section
+ will be read.
+
+ @param SectionType Indicates the section type to return.
+ SectionType in conjunction with
+ SectionInstance indicates which section to
+ return.
+
+ @param SectionInstance Indicates which instance of sections
+ with a type of SectionType to return.
+ SectionType in conjunction with
+ SectionInstance indicates which
+ section to return. SectionInstance is
+ zero based.
+
+ @param Buffer Pointer to a pointer to a buffer in which the
+ section contents are returned, not including
+ the section header.
+
+ @param BufferSize Pointer to a caller-allocated UINTN. It
+ indicates the size of the memory
+ represented by Buffer.
+
+ @param AuthenticationStatus Pointer to a caller-allocated
+ UINT32 in which the authentication
+ status is returned.
+
+
+ @retval EFI_SUCCESS The call completed successfully.
+
+ @retval EFI_WARN_BUFFER_TOO_SMALL The caller-allocated
+ buffer is too small to
+ contain the requested
+ output. The buffer is
+ filled and the output is
+ truncated.
+
+ @retval EFI_OUT_OF_RESOURCES An allocation failure occurred.
+
+ @retval EFI_NOT_FOUND The requested file was not found in
+ the firmware volume. EFI_NOT_FOUND The
+ requested section was not found in the
+ specified file.
+
+ @retval EFI_DEVICE_ERROR A hardware error occurred when
+ attempting to access the firmware
+ volume.
+
+ @retval EFI_ACCESS_DENIED The firmware volume is configured to
+ disallow reads. EFI_PROTOCOL_ERROR
+ The requested section was not found,
+ but the file could not be fully
+ parsed because a required
+ GUIDED_SECTION_EXTRACTION_PROTOCOL
+ was not found. It is possible the
+ requested section exists within the
+ file and could be successfully
+ extracted once the required
+ GUIDED_SECTION_EXTRACTION_PROTOCOL
+ is published.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_FV_READ_SECTION)(
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN CONST EFI_GUID *NameGuid,
+ IN EFI_SECTION_TYPE SectionType,
+ IN UINTN SectionInstance,
+ IN OUT VOID **Buffer,
+ IN OUT UINTN *BufferSize,
+ OUT UINT32 *AuthenticationStatus
+);
+
+///
+/// EFI_FV_WRITE_POLICY, two policies (unreliable write and reliable write) are defined.
+///
+typedef UINT32 EFI_FV_WRITE_POLICY;
+#define EFI_FV_UNRELIABLE_WRITE 0x00000000
+#define EFI_FV_RELIABLE_WRITE 0x00000001
+
+//
+// EFI_FV_WRITE_FILE_DATA
+//
+typedef struct {
+ ///
+ /// Pointer to a GUID, which is the file name to be written.
+ ///
+ EFI_GUID *NameGuid;
+ ///
+ /// Indicates the type of file to be written.
+ ///
+ EFI_FV_FILETYPE Type;
+ ///
+ /// Indicates the attributes for the file to be written.
+ ///
+ EFI_FV_FILE_ATTRIBUTES FileAttributes;
+ ///
+ /// Pointer to a buffer containing the file to be written.
+ ///
+ VOID *Buffer;
+ ///
+ /// Indicates the size of the file image contained in Buffer.
+ ///
+ UINT32 BufferSize;
+} EFI_FV_WRITE_FILE_DATA;
+
+/**
+ Locates the requested section within a file and returns it in a buffer.
+
+ WriteFile() is used to write one or more files to a firmware
+ volume. Each file to be written is described by an
+ EFI_FV_WRITE_FILE_DATA structure. The caller must ensure that
+ any required alignment for all files listed in the FileData
+ array is compatible with the firmware volume. Firmware volume
+ capabilities can be determined using the GetVolumeAttributes()
+ call. Similarly, if the WritePolicy is set to
+ EFI_FV_RELIABLE_WRITE, the caller must check the firmware volume
+ capabilities to ensure EFI_FV_RELIABLE_WRITE is supported by the
+ firmware volume. EFI_FV_UNRELIABLE_WRITE must always be
+ supported. Writing a file with a size of zero
+ (FileData[n].BufferSize == 0) deletes the file from the firmware
+ volume if it exists. Deleting a file must be done one at a time.
+ Deleting a file as part of a multiple file write is not allowed.
+ Platform Initialization Specification VOLUME 3 Shared
+ Architectural Elements 84 August 21, 2006 Version 1.0
+ WriteFile() is callable only from TPL_NOTIFY and below.
+ Behavior of WriteFile() at any EFI_TPL above TPL_NOTIFY is
+ undefined.
+
+ @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.
+
+ @param NumberOfFiles Indicates the number of elements in the array pointed to by FileData
+
+ @param WritePolicy Indicates the level of reliability for the
+ write in the event of a power failure or
+ other system failure during the write
+ operation.
+
+ @param FileData Pointer to an array of
+ EFI_FV_WRITE_FILE_DATA. Each element of
+ FileData[] represents a file to be written.
+
+
+ @retval EFI_SUCCESS The write completed successfully.
+
+ @retval EFI_OUT_OF_RESOURCES The firmware volume does not
+ have enough free space to
+ storefile(s).
+
+ @retval EFI_DEVICE_ERROR A hardware error occurred when
+ attempting to access the firmware volume.
+
+ @retval EFI_WRITE_PROTECTED The firmware volume is
+ configured to disallow writes.
+
+ @retval EFI_NOT_FOUND A delete was requested, but the
+ requested file was not found in the
+ firmware volume.
+
+ @retval EFI_INVALID_PARAMETER A delete was requested with a
+ multiple file write.
+
+ @retval EFI_INVALID_PARAMETER An unsupported WritePolicy was
+ requested.
+
+ @retval EFI_INVALID_PARAMETER An unknown file type was
+ specified.
+
+ @retval EFI_INVALID_PARAMETER A file system specific error
+ has occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_FV_WRITE_FILE)(
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN UINT32 NumberOfFiles,
+ IN EFI_FV_WRITE_POLICY WritePolicy,
+ IN EFI_FV_WRITE_FILE_DATA *FileData
+);
+
+
+/**
+ Retrieves information about the next file in the firmware volume store
+ that matches the search criteria.
+
+ GetNextFile() is the interface that is used to search a firmware
+ volume for a particular file. It is called successively until
+ the desired file is located or the function returns
+ EFI_NOT_FOUND. To filter uninteresting files from the output,
+ the type of file to search for may be specified in FileType. For
+ example, if *FileType is EFI_FV_FILETYPE_DRIVER, only files of
+ this type will be returned in the output. If *FileType is
+ EFI_FV_FILETYPE_ALL, no filtering of file types is done. The Key
+ parameter is used to indicate a starting point of the search. If
+ the buffer *Key is completely initialized to zero, the search
+ re-initialized and starts at the beginning. Subsequent calls to
+ GetNextFile() must maintain the value of *Key returned by the
+ immediately previous call. The actual contents of *Key are
+ implementation specific and no semantic content is implied.
+ GetNextFile() is callable only from TPL_NOTIFY and below.
+ Behavior of GetNextFile() at any EFI_TPL above TPL_NOTIFY is
+ undefined.
+
+ @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.
+
+ @param Key Pointer to a caller-allocated buffer that contains implementation-specific data that is
+ used to track where to begin the search for the next file. The size of the buffer must be
+ at least This->KeySize bytes long. To re-initialize the search and begin from the
+ beginning of the firmware volume, the entire buffer must be cleared to zero. Other
+ than clearing the buffer to initiate a new search, the caller must not modify the data in
+ the buffer between calls to GetNextFile().
+
+ @param FileType Pointer to a caller-allocated
+ EFI_FV_FILETYPE. The GetNextFile() API can
+ filter its search for files based on the
+ value of the FileType input. A *FileType
+ input of EFI_FV_FILETYPE_ALL causes
+ GetNextFile() to search for files of all
+ types. If a file is found, the file's type
+ is returned in FileType. *FileType is not
+ modified if no file is found.
+
+ @param NameGuid Pointer to a caller-allocated EFI_GUID. If a
+ matching file is found, the file's name is
+ returned in NameGuid. If no matching file is
+ found, *NameGuid is not modified.
+
+ @param Attributes Pointer to a caller-allocated
+ EFI_FV_FILE_ATTRIBUTES. If a matching file
+ is found, the file's attributes are returned
+ in Attributes. If no matching file is found,
+ Attributes is not modified. Type
+ EFI_FV_FILE_ATTRIBUTES is defined in
+ ReadFile().
+
+ @param Size Pointer to a caller-allocated UINTN. If a
+ matching file is found, the file's size is
+ returned in *Size. If no matching file is found,
+ Size is not modified.
+
+ @retval EFI_SUCCESS The output parameters are filled with data
+ obtained from the first matching file that
+ was found.
+
+ @retval FI_NOT_FOUND No files of type FileType were found.
+
+
+ @retval EFI_DEVICE_ERROR A hardware error occurred when
+ attempting to access the firmware
+ volume.
+
+ @retval EFI_ACCESS_DENIED The firmware volume is configured to
+ disallow reads.
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_FV_GET_NEXT_FILE)(
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN OUT VOID *Key,
+ IN OUT EFI_FV_FILETYPE *FileType,
+ OUT EFI_GUID *NameGuid,
+ OUT EFI_FV_FILE_ATTRIBUTES *Attributes,
+ OUT UINTN *Size
+);
+
+/**
+ Return information about a firmware volume.
+
+ The GetInfo() function returns information of type
+ InformationType for the requested firmware volume. If the volume
+ does not support the requested information type, then
+ EFI_UNSUPPORTED is returned. If the buffer is not large enough
+ to hold the requested structure, EFI_BUFFER_TOO_SMALL is
+ returned and the BufferSize is set to the size of buffer that is
+ required to make the request. The information types defined by
+ this specification are required information types that all file
+ systems must support.
+
+ @param This A pointer to the EFI_FIRMWARE_VOLUME2_PROTOCOL
+ instance that is the file handle the requested
+ information is for.
+
+ @param InformationType The type identifier for the
+ information being requested.
+
+ @param BufferSize On input, the size of Buffer. On output,
+ the amount of data returned in Buffer. In
+ both cases, the size is measured in bytes.
+
+ @param Buffer A pointer to the data buffer to return. The
+ buffer's type is indicated by InformationType.
+
+
+ @retval EFI_SUCCESS The information was retrieved.
+
+ @retval EFI_UNSUPPORTED The InformationType is not known.
+
+ @retval EFI_NO_MEDIA The device has no medium.
+
+ @retval EFI_DEVICE_ERROR The device reported an error.
+
+ @retval EFI_VOLUME_CORRUPTED The file system structures are
+ corrupted.
+
+ @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to
+ read the current directory
+ entry. BufferSize has been
+ updated with the size needed to
+ complete the request.
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FV_GET_INFO)(
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN CONST EFI_GUID *InformationType,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+);
+
+
+/**
+ Sets information about a firmware volume.
+
+ The SetInfo() function sets information of type InformationType
+ on the requested firmware volume.
+
+
+ @param This A pointer to the EFI_FIRMWARE_VOLUME2_PROTOCOL
+ instance that is the file handle the information
+ is for.
+
+ @param InformationType The type identifier for the
+ information being set.
+
+ @param BufferSize The size, in bytes, of Buffer.
+
+ @param Buffer A pointer to the data buffer to write. The
+ buffer's type is indicated by InformationType.
+
+ @retval EFI_SUCCESS The information was set.
+
+ @retval EFI_UNSUPPORTED The InformationType is not known.
+
+ @retval EFI_NO_MEDIA The device has no medium.
+
+ @retval EFI_DEVICE_ERROR The device reported an error.
+
+ @retval EFI_VOLUME_CORRUPTED The file system structures are
+ corrupted.
+
+
+ @retval EFI_WRITE_PROTECTED The media is read only.
+
+ @retval EFI_VOLUME_FULL The volume is full.
+
+ @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the
+ size of the type indicated by
+ InformationType.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FV_SET_INFO)(
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN CONST EFI_GUID *InformationType,
+ IN UINTN BufferSize,
+ IN CONST VOID *Buffer
+);
+
+
+///
+/// The Firmware Volume Protocol contains the file-level
+/// abstraction to the firmware volume as well as some firmware
+/// volume attribute reporting and configuration services. The
+/// Firmware Volume Protocol is the interface used by all parts of
+/// DXE that are not directly involved with managing the firmware
+/// volume itself. This abstraction allows many varied types of
+/// firmware volume implementations. A firmware volume may be a
+/// flash device or it may be a file in the UEFI system partition,
+/// for example. This level of firmware volume implementation
+/// detail is not visible to the consumers of the Firmware Volume
+/// Protocol.
+///
+struct _EFI_FIRMWARE_VOLUME2_PROTOCOL {
+ EFI_FV_GET_ATTRIBUTES GetVolumeAttributes;
+ EFI_FV_SET_ATTRIBUTES SetVolumeAttributes;
+ EFI_FV_READ_FILE ReadFile;
+ EFI_FV_READ_SECTION ReadSection;
+ EFI_FV_WRITE_FILE WriteFile;
+ EFI_FV_GET_NEXT_FILE GetNextFile;
+
+ ///
+ /// Data field that indicates the size in bytes
+ /// of the Key input buffer for the
+ /// GetNextFile() API.
+ ///
+ UINT32 KeySize;
+
+ ///
+ /// Handle of the parent firmware volume.
+ ///
+ EFI_HANDLE ParentHandle;
+ EFI_FV_GET_INFO GetInfo;
+ EFI_FV_SET_INFO SetInfo;
+};
+
+
+extern EFI_GUID gEfiFirmwareVolume2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FirmwareVolumeBlock.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FirmwareVolumeBlock.h
new file mode 100644
index 0000000000..48c06e1439
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FirmwareVolumeBlock.h
@@ -0,0 +1,366 @@
+/** @file
+ This file provides control over block-oriented firmware devices.
+
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference: PI
+ Version 1.0 and 1.2.
+
+**/
+
+#ifndef __FIRMWARE_VOLUME_BLOCK_H__
+#define __FIRMWARE_VOLUME_BLOCK_H__
+
+//
+// EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL is defined in PI 1.0 spec and its GUID value
+// is later updated to be the same as that of EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL
+// defined in PI 1.2 spec.
+//
+#define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \
+ { 0x8f644fa9, 0xe850, 0x4db1, {0x9c, 0xe2, 0xb, 0x44, 0x69, 0x8e, 0x8d, 0xa4 } }
+
+#define EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL_GUID \
+ { 0x8f644fa9, 0xe850, 0x4db1, {0x9c, 0xe2, 0xb, 0x44, 0x69, 0x8e, 0x8d, 0xa4 } }
+
+typedef struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL;
+
+typedef EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL;
+
+/**
+ The GetAttributes() function retrieves the attributes and
+ current settings of the block.
+
+ @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
+
+ @param Attributes Pointer to EFI_FVB_ATTRIBUTES_2 in which the
+ attributes and current settings are
+ returned. Type EFI_FVB_ATTRIBUTES_2 is defined
+ in EFI_FIRMWARE_VOLUME_HEADER.
+
+ @retval EFI_SUCCESS The firmware volume attributes were
+ returned.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_FVB_GET_ATTRIBUTES)(
+ IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
+ OUT EFI_FVB_ATTRIBUTES_2 *Attributes
+);
+
+
+/**
+ The SetAttributes() function sets configurable firmware volume
+ attributes and returns the new settings of the firmware volume.
+
+ @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
+
+ @param Attributes On input, Attributes is a pointer to
+ EFI_FVB_ATTRIBUTES_2 that contains the
+ desired firmware volume settings. On
+ successful return, it contains the new
+ settings of the firmware volume. Type
+ EFI_FVB_ATTRIBUTES_2 is defined in
+ EFI_FIRMWARE_VOLUME_HEADER.
+
+ @retval EFI_SUCCESS The firmware volume attributes were returned.
+
+ @retval EFI_INVALID_PARAMETER The attributes requested are in
+ conflict with the capabilities
+ as declared in the firmware
+ volume header.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_FVB_SET_ATTRIBUTES)(
+ IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
+ IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes
+);
+
+
+/**
+ The GetPhysicalAddress() function retrieves the base address of
+ a memory-mapped firmware volume. This function should be called
+ only for memory-mapped firmware volumes.
+
+ @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
+
+ @param Address Pointer to a caller-allocated
+ EFI_PHYSICAL_ADDRESS that, on successful
+ return from GetPhysicalAddress(), contains the
+ base address of the firmware volume.
+
+ @retval EFI_SUCCESS The firmware volume base address was returned.
+
+ @retval EFI_UNSUPPORTED The firmware volume is not memory mapped.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_FVB_GET_PHYSICAL_ADDRESS)(
+ IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
+ OUT EFI_PHYSICAL_ADDRESS *Address
+);
+
+/**
+ The GetBlockSize() function retrieves the size of the requested
+ block. It also returns the number of additional blocks with
+ the identical size. The GetBlockSize() function is used to
+ retrieve the block map (see EFI_FIRMWARE_VOLUME_HEADER).
+
+
+ @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
+
+ @param Lba Indicates the block for which to return the size.
+
+ @param BlockSize Pointer to a caller-allocated UINTN in which
+ the size of the block is returned.
+
+ @param NumberOfBlocks Pointer to a caller-allocated UINTN in
+ which the number of consecutive blocks,
+ starting with Lba, is returned. All
+ blocks in this range have a size of
+ BlockSize.
+
+
+ @retval EFI_SUCCESS The firmware volume base address was returned.
+
+ @retval EFI_INVALID_PARAMETER The requested LBA is out of range.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_FVB_GET_BLOCK_SIZE)(
+ IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
+ IN EFI_LBA Lba,
+ OUT UINTN *BlockSize,
+ OUT UINTN *NumberOfBlocks
+);
+
+
+/**
+ Reads the specified number of bytes into a buffer from the specified block.
+
+ The Read() function reads the requested number of bytes from the
+ requested block and stores them in the provided buffer.
+ Implementations should be mindful that the firmware volume
+ might be in the ReadDisabled state. If it is in this state,
+ the Read() function must return the status code
+ EFI_ACCESS_DENIED without modifying the contents of the
+ buffer. The Read() function must also prevent spanning block
+ boundaries. If a read is requested that would span a block
+ boundary, the read must read up to the boundary but not
+ beyond. The output parameter NumBytes must be set to correctly
+ indicate the number of bytes actually read. The caller must be
+ aware that a read may be partially completed.
+
+ @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
+
+ @param Lba The starting logical block index
+ from which to read.
+
+ @param Offset Offset into the block at which to begin reading.
+
+ @param NumBytes Pointer to a UINTN. At entry, *NumBytes
+ contains the total size of the buffer. At
+ exit, *NumBytes contains the total number of
+ bytes read.
+
+ @param Buffer Pointer to a caller-allocated buffer that will
+ be used to hold the data that is read.
+
+ @retval EFI_SUCCESS The firmware volume was read successfully,
+ and contents are in Buffer.
+
+ @retval EFI_BAD_BUFFER_SIZE Read attempted across an LBA
+ boundary. On output, NumBytes
+ contains the total number of bytes
+ returned in Buffer.
+
+ @retval EFI_ACCESS_DENIED The firmware volume is in the
+ ReadDisabled state.
+
+ @retval EFI_DEVICE_ERROR The block device is not
+ functioning correctly and could
+ not be read.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FVB_READ)(
+ IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
+ IN EFI_LBA Lba,
+ IN UINTN Offset,
+ IN OUT UINTN *NumBytes,
+ IN OUT UINT8 *Buffer
+);
+
+/**
+ Writes the specified number of bytes from the input buffer to the block.
+
+ The Write() function writes the specified number of bytes from
+ the provided buffer to the specified block and offset. If the
+ firmware volume is sticky write, the caller must ensure that
+ all the bits of the specified range to write are in the
+ EFI_FVB_ERASE_POLARITY state before calling the Write()
+ function, or else the result will be unpredictable. This
+ unpredictability arises because, for a sticky-write firmware
+ volume, a write may negate a bit in the EFI_FVB_ERASE_POLARITY
+ state but cannot flip it back again. Before calling the
+ Write() function, it is recommended for the caller to first call
+ the EraseBlocks() function to erase the specified block to
+ write. A block erase cycle will transition bits from the
+ (NOT)EFI_FVB_ERASE_POLARITY state back to the
+ EFI_FVB_ERASE_POLARITY state. Implementations should be
+ mindful that the firmware volume might be in the WriteDisabled
+ state. If it is in this state, the Write() function must
+ return the status code EFI_ACCESS_DENIED without modifying the
+ contents of the firmware volume. The Write() function must
+ also prevent spanning block boundaries. If a write is
+ requested that spans a block boundary, the write must store up
+ to the boundary but not beyond. The output parameter NumBytes
+ must be set to correctly indicate the number of bytes actually
+ written. The caller must be aware that a write may be
+ partially completed. All writes, partial or otherwise, must be
+ fully flushed to the hardware before the Write() service
+ returns.
+
+ @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
+
+ @param Lba The starting logical block index to write to.
+
+ @param Offset Offset into the block at which to begin writing.
+
+ @param NumBytes The pointer to a UINTN. At entry, *NumBytes
+ contains the total size of the buffer. At
+ exit, *NumBytes contains the total number of
+ bytes actually written.
+
+ @param Buffer The pointer to a caller-allocated buffer that
+ contains the source for the write.
+
+ @retval EFI_SUCCESS The firmware volume was written successfully.
+
+ @retval EFI_BAD_BUFFER_SIZE The write was attempted across an
+ LBA boundary. On output, NumBytes
+ contains the total number of bytes
+ actually written.
+
+ @retval EFI_ACCESS_DENIED The firmware volume is in the
+ WriteDisabled state.
+
+ @retval EFI_DEVICE_ERROR The block device is malfunctioning
+ and could not be written.
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_FVB_WRITE)(
+ IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
+ IN EFI_LBA Lba,
+ IN UINTN Offset,
+ IN OUT UINTN *NumBytes,
+ IN UINT8 *Buffer
+);
+
+
+
+
+///
+/// EFI_LBA_LIST_TERMINATOR
+///
+#define EFI_LBA_LIST_TERMINATOR 0xFFFFFFFFFFFFFFFFULL
+
+
+/**
+ Erases and initializes a firmware volume block.
+
+ The EraseBlocks() function erases one or more blocks as denoted
+ by the variable argument list. The entire parameter list of
+ blocks must be verified before erasing any blocks. If a block is
+ requested that does not exist within the associated firmware
+ volume (it has a larger index than the last block of the
+ firmware volume), the EraseBlocks() function must return the
+ status code EFI_INVALID_PARAMETER without modifying the contents
+ of the firmware volume. Implementations should be mindful that
+ the firmware volume might be in the WriteDisabled state. If it
+ is in this state, the EraseBlocks() function must return the
+ status code EFI_ACCESS_DENIED without modifying the contents of
+ the firmware volume. All calls to EraseBlocks() must be fully
+ flushed to the hardware before the EraseBlocks() service
+ returns.
+
+ @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL
+ instance.
+
+ @param ... The variable argument list is a list of tuples.
+ Each tuple describes a range of LBAs to erase
+ and consists of the following:
+ - An EFI_LBA that indicates the starting LBA
+ - A UINTN that indicates the number of blocks to
+ erase.
+
+ The list is terminated with an
+ EFI_LBA_LIST_TERMINATOR. For example, the
+ following indicates that two ranges of blocks
+ (5-7 and 10-11) are to be erased: EraseBlocks
+ (This, 5, 3, 10, 2, EFI_LBA_LIST_TERMINATOR);
+
+ @retval EFI_SUCCESS The erase request successfully
+ completed.
+
+ @retval EFI_ACCESS_DENIED The firmware volume is in the
+ WriteDisabled state.
+ @retval EFI_DEVICE_ERROR The block device is not functioning
+ correctly and could not be written.
+ The firmware device may have been
+ partially erased.
+ @retval EFI_INVALID_PARAMETER One or more of the LBAs listed
+ in the variable argument list do
+ not exist in the firmware volume.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_FVB_ERASE_BLOCKS)(
+ IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
+ ...
+);
+
+///
+/// The Firmware Volume Block Protocol is the low-level interface
+/// to a firmware volume. File-level access to a firmware volume
+/// should not be done using the Firmware Volume Block Protocol.
+/// Normal access to a firmware volume must use the Firmware
+/// Volume Protocol. Typically, only the file system driver that
+/// produces the Firmware Volume Protocol will bind to the
+/// Firmware Volume Block Protocol.
+///
+struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL{
+ EFI_FVB_GET_ATTRIBUTES GetAttributes;
+ EFI_FVB_SET_ATTRIBUTES SetAttributes;
+ EFI_FVB_GET_PHYSICAL_ADDRESS GetPhysicalAddress;
+ EFI_FVB_GET_BLOCK_SIZE GetBlockSize;
+ EFI_FVB_READ Read;
+ EFI_FVB_WRITE Write;
+ EFI_FVB_ERASE_BLOCKS EraseBlocks;
+ ///
+ /// The handle of the parent firmware volume.
+ ///
+ EFI_HANDLE ParentHandle;
+};
+
+
+extern EFI_GUID gEfiFirmwareVolumeBlockProtocolGuid;
+extern EFI_GUID gEfiFirmwareVolumeBlock2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FormBrowser2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FormBrowser2.h
new file mode 100644
index 0000000000..de132f88c0
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/FormBrowser2.h
@@ -0,0 +1,180 @@
+/** @file
+ This protocol is defined in UEFI spec.
+
+ The EFI_FORM_BROWSER2_PROTOCOL is the interface to call for drivers to
+ leverage the EFI configuration driver interface.
+
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_FORM_BROWSER2_H__
+#define __EFI_FORM_BROWSER2_H__
+
+#include <Guid/HiiPlatformSetupFormset.h>
+
+#define EFI_FORM_BROWSER2_PROTOCOL_GUID \
+ {0xb9d4c360, 0xbcfb, 0x4f9b, {0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58 }}
+
+
+typedef struct _EFI_FORM_BROWSER2_PROTOCOL EFI_FORM_BROWSER2_PROTOCOL;
+
+
+
+/**
+
+ @param LeftColumn The value that designates the text column
+ where the browser window will begin from
+ the left-hand side of the screen
+
+ @param RightColumn The value that designates the text
+ column where the browser window will end
+ on the right-hand side of the screen.
+
+ @param TopRow The value that designates the text row from the
+ top of the screen where the browser window
+ will start.
+
+ @param BottomRow The value that designates the text row from the
+ bottom of the screen where the browser
+ window will end.
+**/
+typedef struct {
+ UINTN LeftColumn;
+ UINTN RightColumn;
+ UINTN TopRow;
+ UINTN BottomRow;
+} EFI_SCREEN_DESCRIPTOR;
+
+typedef UINTN EFI_BROWSER_ACTION_REQUEST;
+
+#define EFI_BROWSER_ACTION_REQUEST_NONE 0
+#define EFI_BROWSER_ACTION_REQUEST_RESET 1
+#define EFI_BROWSER_ACTION_REQUEST_SUBMIT 2
+#define EFI_BROWSER_ACTION_REQUEST_EXIT 3
+#define EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT 4
+#define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT 5
+#define EFI_BROWSER_ACTION_REQUEST_FORM_APPLY 6
+#define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD 7
+#define EFI_BROWSER_ACTION_REQUEST_RECONNECT 8
+
+
+/**
+ Initialize the browser to display the specified configuration forms.
+
+ This function is the primary interface to the internal forms-based browser.
+ The forms browser will display forms associated with the specified Handles.
+ The browser will select all forms in packages which have the specified Type
+ and (for EFI_HII_PACKAGE_TYPE_GUID) the specified PackageGuid.
+
+ @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance
+
+ @param Handles A pointer to an array of Handles. This value should correspond
+ to the value of the HII form package that is required to be displayed.
+
+ @param HandleCount The number of Handles specified in Handle.
+
+ @param FormSetGuid This field points to the EFI_GUID which must match the Guid field or one of the
+ elements of the ClassId field in the EFI_IFR_FORM_SET op-code. If
+ FormsetGuid is NULL, then this function will display the form set class
+ EFI_HII_PLATFORM_SETUP_FORMSET_GUID.
+
+ @param FormId This field specifies the identifier of the form within the form set to render as the first
+ displayable page. If this field has a value of 0x0000, then the Forms Browser will
+ render the first enabled form in the form set.
+
+ @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
+ characters.
+
+ @param ActionRequest Points to the action recommended by the form.
+
+ @retval EFI_SUCCESS The function completed successfully
+
+ @retval EFI_NOT_FOUND The variable was not found.
+
+ @retval EFI_INVALID_PARAMETER One of the parameters has an
+ invalid value.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SEND_FORM2)(
+ IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,
+ IN EFI_HII_HANDLE *Handle,
+ IN UINTN HandleCount,
+ IN EFI_GUID *FormSetGuid, OPTIONAL
+ IN EFI_FORM_ID FormId, OPTIONAL
+ IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL
+ OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL
+);
+
+
+/**
+ This function is called by a callback handler to retrieve uncommitted state data from the browser.
+
+ This routine is called by a routine which was called by the
+ browser. This routine called this service in the browser to
+ retrieve or set certain uncommitted state information.
+
+ @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance.
+
+ @param ResultsDataSize A pointer to the size of the buffer
+ associated with ResultsData. On input, the size in
+ bytes of ResultsData. On output, the size of data
+ returned in ResultsData.
+
+ @param ResultsData A string returned from an IFR browser or
+ equivalent. The results string will have
+ no routing information in them.
+
+ @param RetrieveData A BOOLEAN field which allows an agent to
+ retrieve (if RetrieveData = TRUE) data
+ from the uncommitted browser state
+ information or set (if RetrieveData =
+ FALSE) data in the uncommitted browser
+ state information.
+
+ @param VariableGuid An optional field to indicate the target
+ variable GUID name to use.
+
+ @param VariableName An optional field to indicate the target
+ human-readable variable name.
+
+ @retval EFI_SUCCESS The results have been distributed or are
+ awaiting distribution.
+
+ @retval EFI_OUT_OF_RESOURCES The ResultsDataSize specified
+ was too small to contain the
+ results data.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BROWSER_CALLBACK2)(
+ IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,
+ IN OUT UINTN *ResultsDataSize,
+ IN OUT EFI_STRING ResultsData,
+ IN CONST BOOLEAN RetrieveData,
+ IN CONST EFI_GUID *VariableGuid, OPTIONAL
+ IN CONST CHAR16 *VariableName OPTIONAL
+);
+
+///
+/// This interface will allow the caller to direct the configuration
+/// driver to use either the HII database or use the passed-in packet of data.
+///
+struct _EFI_FORM_BROWSER2_PROTOCOL {
+ EFI_SEND_FORM2 SendForm;
+ EFI_BROWSER_CALLBACK2 BrowserCallback;
+} ;
+
+extern EFI_GUID gEfiFormBrowser2ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ftp4.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ftp4.h
new file mode 100644
index 0000000000..113e84a22d
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ftp4.h
@@ -0,0 +1,524 @@
+/** @file
+ EFI FTPv4 (File Transfer Protocol version 4) Protocol Definition
+ The EFI FTPv4 Protocol is used to locate communication devices that are
+ supported by an EFI FTPv4 Protocol driver and to create and destroy instances
+ of the EFI FTPv4 Protocol child protocol driver that can use the underlying
+ communication device.
+ The definitions in this file are defined in UEFI Specification 2.3, which have
+ not been verified by one implementation yet.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.2
+
+**/
+
+#ifndef __EFI_FTP4_PROTOCOL_H__
+#define __EFI_FTP4_PROTOCOL_H__
+
+
+#define EFI_FTP4_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0xfaaecb1, 0x226e, 0x4782, {0xaa, 0xce, 0x7d, 0xb9, 0xbc, 0xbf, 0x4d, 0xaf } \
+ }
+
+#define EFI_FTP4_PROTOCOL_GUID \
+ { \
+ 0xeb338826, 0x681b, 0x4295, {0xb3, 0x56, 0x2b, 0x36, 0x4c, 0x75, 0x7b, 0x9 } \
+ }
+
+typedef struct _EFI_FTP4_PROTOCOL EFI_FTP4_PROTOCOL;
+
+///
+/// EFI_FTP4_CONNECTION_TOKEN
+///
+typedef struct {
+ ///
+ /// The Event to signal after the connection is established and Status field is updated
+ /// by the EFI FTP v4 Protocol driver. The type of Event must be
+ /// EVENT_NOTIFY_SIGNAL, and its Task Priority Level (TPL) must be lower than or
+ /// equal to TPL_CALLBACK. If it is set to NULL, this function will not return until the
+ /// function completes.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// The variable to receive the result of the completed operation.
+ /// EFI_SUCCESS: The FTP connection is established successfully
+ /// EFI_ACCESS_DENIED: The FTP server denied the access the user's request to access it.
+ /// EFI_CONNECTION_RESET: The connect fails because the connection is reset either by instance
+ /// itself or communication peer.
+ /// EFI_TIMEOUT: The connection establishment timer expired and no more specific
+ /// information is available.
+ /// EFI_NETWORK_UNREACHABLE: The active open fails because an ICMP network unreachable error is
+ /// received.
+ /// EFI_HOST_UNREACHABLE: The active open fails because an ICMP host unreachable error is
+ /// received.
+ /// EFI_PROTOCOL_UNREACHABLE: The active open fails because an ICMP protocol unreachable error is
+ /// received.
+ /// EFI_PORT_UNREACHABLE: The connection establishment timer times out and an ICMP port
+ /// unreachable error is received.
+ /// EFI_ICMP_ERROR: The connection establishment timer timeout and some other ICMP
+ /// error is received.
+ /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.
+ ///
+ EFI_STATUS Status;
+} EFI_FTP4_CONNECTION_TOKEN;
+
+///
+/// EFI_FTP4_CONFIG_DATA
+///
+typedef struct {
+ ///
+ /// Pointer to a ASCII string that contains user name. The caller is
+ /// responsible for freeing Username after GetModeData() is called.
+ ///
+ UINT8 *Username;
+ ///
+ /// Pointer to a ASCII string that contains password. The caller is
+ /// responsible for freeing Password after GetModeData() is called.
+ ///
+ UINT8 *Password;
+ ///
+ /// Set it to TRUE to initiate an active data connection. Set it to
+ /// FALSE to initiate a passive data connection.
+ ///
+ BOOLEAN Active;
+ ///
+ /// Boolean value indicating if default network settting used.
+ ///
+ BOOLEAN UseDefaultSetting;
+ ///
+ /// IP address of station if UseDefaultSetting is FALSE.
+ ///
+ EFI_IPv4_ADDRESS StationIp;
+ ///
+ /// Subnet mask of station if UseDefaultSetting is FALSE.
+ ///
+ EFI_IPv4_ADDRESS SubnetMask;
+ ///
+ /// IP address of gateway if UseDefaultSetting is FALSE.
+ ///
+ EFI_IPv4_ADDRESS GatewayIp;
+ ///
+ /// IP address of FTPv4 server.
+ ///
+ EFI_IPv4_ADDRESS ServerIp;
+ ///
+ /// FTPv4 server port number of control connection, and the default
+ /// value is 21 as convention.
+ ///
+ UINT16 ServerPort;
+ ///
+ /// FTPv4 server port number of data connection. If it is zero, use
+ /// (ServerPort - 1) by convention.
+ ///
+ UINT16 AltDataPort;
+ ///
+ /// A byte indicate the representation type. The right 4 bit is used for
+ /// first parameter, the left 4 bit is use for second parameter
+ /// - For the first parameter, 0x0 = image, 0x1 = EBCDIC, 0x2 = ASCII, 0x3 = local
+ /// - For the second parameter, 0x0 = Non-print, 0x1 = Telnet format effectors, 0x2 =
+ /// Carriage Control.
+ /// - If it is a local type, the second parameter is the local byte byte size.
+ /// - If it is a image type, the second parameter is undefined.
+ ///
+ UINT8 RepType;
+ ///
+ /// Defines the file structure in FTP used. 0x00 = file, 0x01 = record, 0x02 = page.
+ ///
+ UINT8 FileStruct;
+ ///
+ /// Defines the transifer mode used in FTP. 0x00 = stream, 0x01 = Block, 0x02 = Compressed.
+ ///
+ UINT8 TransMode;
+} EFI_FTP4_CONFIG_DATA;
+
+typedef struct _EFI_FTP4_COMMAND_TOKEN EFI_FTP4_COMMAND_TOKEN;
+
+/**
+ Callback function when process inbound or outbound data.
+
+ If it is receiving function that leads to inbound data, the callback function
+ is called when data buffer is full. Then, old data in the data buffer should be
+ flushed and new data is stored from the beginning of data buffer.
+ If it is a transmit function that lead to outbound data and the size of
+ Data in daata buffer has been transmitted, this callback function is called to
+ supply additional data to be transmitted.
+
+ @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.
+ @param[in] Token Pointer to the token structure to provide the parameters that
+ are used in this operation.
+ @return User defined Status.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FTP4_DATA_CALLBACK)(
+ IN EFI_FTP4_PROTOCOL *This,
+ IN EFI_FTP4_COMMAND_TOKEN *Token
+ );
+
+///
+/// EFI_FTP4_COMMAND_TOKEN
+///
+struct _EFI_FTP4_COMMAND_TOKEN {
+ ///
+ /// The Event to signal after request is finished and Status field
+ /// is updated by the EFI FTP v4 Protocol driver. The type of Event
+ /// must be EVT_NOTIFY_SIGNAL, and its Task Priority Level
+ /// (TPL) must be lower than or equal to TPL_CALLBACK. If it is
+ /// set to NULL, related function must wait until the function
+ /// completes.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// Pointer to a null-terminated ASCII name string.
+ ///
+ UINT8 *Pathname;
+ ///
+ /// The size of data buffer in bytes.
+ ///
+ UINT64 DataBufferSize;
+ ///
+ /// Pointer to the data buffer. Data downloaded from FTP server
+ /// through connection is downloaded here.
+ ///
+ VOID *DataBuffer;
+ ///
+ /// Pointer to a callback function. If it is receiving function that leads
+ /// to inbound data, the callback function is called when databuffer is
+ /// full. Then, old data in the data buffer should be flushed and new
+ /// data is stored from the beginning of data buffer. If it is a transmit
+ /// function that lead to outbound data and DataBufferSize of
+ /// Data in DataBuffer has been transmitted, this callback
+ /// function is called to supply additional data to be transmitted. The
+ /// size of additional data to be transmitted is indicated in
+ /// DataBufferSize, again. If there is no data remained,
+ /// DataBufferSize should be set to 0.
+ ///
+ EFI_FTP4_DATA_CALLBACK DataCallback;
+ ///
+ /// Pointer to the parameter for DataCallback.
+ ///
+ VOID *Context;
+ ///
+ /// The variable to receive the result of the completed operation.
+ /// EFI_SUCCESS: The FTP command is completed successfully.
+ /// EFI_ACCESS_DENIED: The FTP server denied the access to the requested file.
+ /// EFI_CONNECTION_RESET: The connect fails because the connection is reset either
+ /// by instance itself or communication peer.
+ /// EFI_TIMEOUT: The connection establishment timer expired and no more
+ /// specific information is available.
+ /// EFI_NETWORK_UNREACHABLE: The active open fails because an ICMP network unreachable
+ /// error is received.
+ /// EFI_HOST_UNREACHABLE: The active open fails because an ICMP host unreachable
+ /// error is received.
+ /// EFI_PROTOCOL_UNREACHABLE: The active open fails because an ICMP protocol unreachable
+ /// error is received.
+ /// EFI_PORT_UNREACHABLE: The connection establishment timer times out and an ICMP port
+ /// unreachable error is received.
+ /// EFI_ICMP_ERROR: The connection establishment timer timeout and some other ICMP
+ /// error is received.
+ /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.
+ ///
+ EFI_STATUS Status;
+};
+
+/**
+ Gets the current operational settings.
+
+ The GetModeData() function reads the current operational settings of this
+ EFI FTPv4 Protocol driver instance. EFI_FTP4_CONFIG_DATA is defined in the
+ EFI_FTP4_PROTOCOL.Configure.
+
+ @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.
+ @param[out] ModeData Pointer to storage for the EFI FTPv4 Protocol driver
+ mode data. The string buffers for Username and Password
+ in EFI_FTP4_CONFIG_DATA are allocated by the function,
+ and the caller should take the responsibility to free the
+ buffer later.
+
+ @retval EFI_SUCCESS This function is called successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ - ModeData is NULL.
+ @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FTP4_GET_MODE_DATA)(
+ IN EFI_FTP4_PROTOCOL *This,
+ OUT EFI_FTP4_CONFIG_DATA *ModeData
+ );
+
+/**
+ Disconnecting a FTP connection gracefully.
+
+ The Connect() function will initiate a connection request to the remote FTP server
+ with the corresponding connection token. If this function returns EFI_SUCCESS, the
+ connection sequence is initiated successfully. If the connection succeeds or faild
+ due to any error, the Token->Event will be signaled and Token->Status will be updated
+ accordingly.
+
+ @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.
+ @param[in] Token Pointer to the token used to establish control connection.
+
+ @retval EFI_SUCCESS The connection sequence is successfully initiated.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token->Event is NULL.
+ @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FTP4_CONNECT)(
+ IN EFI_FTP4_PROTOCOL *This,
+ IN EFI_FTP4_CONNECTION_TOKEN *Token
+ );
+
+/**
+ Disconnecting a FTP connection gracefully.
+
+ The Close() function will initiate a close request to the remote FTP server with the
+ corresponding connection token. If this function returns EFI_SUCCESS, the control
+ connection with the remote FTP server is closed.
+
+ @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.
+ @param[in] Token Pointer to the token used to close control connection.
+
+ @retval EFI_SUCCESS The close request is successfully initiated.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token->Event is NULL.
+ @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FTP4_CLOSE)(
+ IN EFI_FTP4_PROTOCOL *This,
+ IN EFI_FTP4_CONNECTION_TOKEN *Token
+ );
+
+/**
+ Sets or clears the operational parameters for the FTP child driver.
+
+ The Configure() function will configure the connected FTP session with the
+ configuration setting specified in FtpConfigData. The configuration data can
+ be reset by calling Configure() with FtpConfigData set to NULL.
+
+ @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.
+ @param[in] FtpConfigData Pointer to configuration data that will be assigned to
+ the FTP child driver instance. If NULL, the FTP child
+ driver instance is reset to startup defaults and all
+ pending transmit and receive requests are flushed.
+
+ @retval EFI_SUCCESS The FTPv4 driver was configured successfully.
+ @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
+ - This is NULL.
+ - FtpConfigData.RepType is invalid.
+ - FtpConfigData.FileStruct is invalid.
+ - FtpConfigData.TransMode is invalid.
+ - IP address in FtpConfigData is invalid.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_UNSUPPORTED One or more of the configuration parameters are not supported
+ by this implementation.
+ @retval EFI_OUT_OF_RESOURCES The EFI FTPv4 Protocol driver instance data could not be
+ allocated.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI FTPv4
+ Protocol driver instance is not configured.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FTP4_CONFIGURE)(
+ IN EFI_FTP4_PROTOCOL *This,
+ IN EFI_FTP4_CONFIG_DATA *FtpConfigData OPTIONAL
+ );
+
+
+/**
+ Downloads a file from an FTPv4 server.
+
+ The ReadFile() function is used to initialize and start an FTPv4 download process
+ and optionally wait for completion. When the download operation completes, whether
+ successfully or not, the Token.Status field is updated by the EFI FTPv4 Protocol
+ driver and then Token.Event is signaled (if it is not NULL).
+
+ Data will be downloaded from the FTPv4 server into Token.DataBuffer. If the file size
+ is larger than Token.DataBufferSize, Token.DataCallback will be called to allow for
+ processing data and then new data will be placed at the beginning of Token.DataBuffer.
+
+ @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.
+ @param[in] Token Pointer to the token structure to provide the parameters that
+ are used in this operation.
+
+ @retval EFI_SUCCESS The data file is being downloaded successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters is not valid.
+ - This is NULL.
+ - Token is NULL.
+ - Token.Pathname is NULL.
+ - Token. DataBuffer is NULL.
+ - Token. DataBufferSize is 0.
+ @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FTP4_READ_FILE)(
+ IN EFI_FTP4_PROTOCOL *This,
+ IN EFI_FTP4_COMMAND_TOKEN *Token
+ );
+
+/**
+ Uploads a file from an FTPv4 server.
+
+ The WriteFile() function is used to initialize and start an FTPv4 upload process and
+ optionally wait for completion. When the upload operation completes, whether successfully
+ or not, the Token.Status field is updated by the EFI FTPv4 Protocol driver and then
+ Token.Event is signaled (if it is not NULL). Data to be uploaded to server is stored
+ into Token.DataBuffer. Token.DataBufferSize is the number bytes to be transferred.
+ If the file size is larger than Token.DataBufferSize, Token.DataCallback will be called
+ to allow for processing data and then new data will be placed at the beginning of
+ Token.DataBuffer. Token.DataBufferSize is updated to reflect the actual number of bytes
+ to be transferred. Token.DataBufferSize is set to 0 by the call back to indicate the
+ completion of data transfer.
+
+ @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.
+ @param[in] Token Pointer to the token structure to provide the parameters that
+ are used in this operation.
+
+ @retval EFI_SUCCESS TThe data file is being uploaded successfully.
+ @retval EFI_UNSUPPORTED The operation is not supported by this implementation.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters is not valid.
+ - This is NULL.
+ - Token is NULL.
+ - Token.Pathname is NULL.
+ - Token. DataBuffer is NULL.
+ - Token. DataBufferSize is 0.
+ @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FTP4_WRITE_FILE)(
+ IN EFI_FTP4_PROTOCOL *This,
+ IN EFI_FTP4_COMMAND_TOKEN *Token
+ );
+
+/**
+ Download a data file "directory" from a FTPv4 server. May be unsupported in some EFI
+ implementations.
+
+ The ReadDirectory() function is used to return a list of files on the FTPv4 server that
+ logically (or operationally) related to Token.Pathname, and optionally wait for completion.
+ When the download operation completes, whether successfully or not, the Token.Status field
+ is updated by the EFI FTPv4 Protocol driver and then Token.Event is signaled (if it is not
+ NULL). Data will be downloaded from the FTPv4 server into Token.DataBuffer. If the file size
+ is larger than Token.DataBufferSize, Token.DataCallback will be called to allow for processing
+ data and then new data will be placed at the beginning of Token.DataBuffer.
+
+ @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.
+ @param[in] Token Pointer to the token structure to provide the parameters that
+ are used in this operation.
+
+ @retval EFI_SUCCESS The file list information is being downloaded successfully.
+ @retval EFI_UNSUPPORTED The operation is not supported by this implementation.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters is not valid.
+ - This is NULL.
+ - Token is NULL.
+ - Token. DataBuffer is NULL.
+ - Token. DataBufferSize is 0.
+ @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FTP4_READ_DIRECTORY)(
+ IN EFI_FTP4_PROTOCOL *This,
+ IN EFI_FTP4_COMMAND_TOKEN *Token
+ );
+
+/**
+ Polls for incoming data packets and processes outgoing data packets.
+
+ The Poll() function can be used by network drivers and applications to increase the
+ rate that data packets are moved between the communications device and the transmit
+ and receive queues. In some systems, the periodic timer event in the managed network
+ driver may not poll the underlying communications device fast enough to transmit
+ and/or receive all data packets without missing incoming packets or dropping outgoing
+ packets. Drivers and applications that are experiencing packet loss should try calling
+ the Poll() function more often.
+
+ @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_NOT_STARTED This EFI FTPv4 Protocol instance has not been started.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_DEVICE_ERROR EapAuthType An unexpected system or network error occurred.
+ @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
+ Consider increasing the polling rate.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FTP4_POLL)(
+ IN EFI_FTP4_PROTOCOL *This
+ );
+
+///
+/// EFI_FTP4_PROTOCOL
+/// provides basic services for client-side FTP (File Transfer Protocol)
+/// operations.
+///
+struct _EFI_FTP4_PROTOCOL {
+ EFI_FTP4_GET_MODE_DATA GetModeData;
+ EFI_FTP4_CONNECT Connect;
+ EFI_FTP4_CLOSE Close;
+ EFI_FTP4_CONFIGURE Configure;
+ EFI_FTP4_READ_FILE ReadFile;
+ EFI_FTP4_WRITE_FILE WriteFile;
+ EFI_FTP4_READ_DIRECTORY ReadDirectory;
+ EFI_FTP4_POLL Poll;
+};
+
+extern EFI_GUID gEfiFtp4ServiceBindingProtocolGuid;
+extern EFI_GUID gEfiFtp4ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/GraphicsOutput.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/GraphicsOutput.h
new file mode 100644
index 0000000000..a3432ce1d6
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/GraphicsOutput.h
@@ -0,0 +1,276 @@
+/** @file
+ Graphics Output Protocol from the UEFI 2.0 specification.
+
+ Abstraction of a very simple graphics device.
+
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __GRAPHICS_OUTPUT_H__
+#define __GRAPHICS_OUTPUT_H__
+
+#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
+ { \
+ 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \
+ }
+
+typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL;
+
+typedef struct {
+ UINT32 RedMask;
+ UINT32 GreenMask;
+ UINT32 BlueMask;
+ UINT32 ReservedMask;
+} EFI_PIXEL_BITMASK;
+
+typedef enum {
+ ///
+ /// A pixel is 32-bits and byte zero represents red, byte one represents green,
+ /// byte two represents blue, and byte three is reserved. This is the definition
+ /// for the physical frame buffer. The byte values for the red, green, and blue
+ /// components represent the color intensity. This color intensity value range
+ /// from a minimum intensity of 0 to maximum intensity of 255.
+ ///
+ PixelRedGreenBlueReserved8BitPerColor,
+ ///
+ /// A pixel is 32-bits and byte zero represents blue, byte one represents green,
+ /// byte two represents red, and byte three is reserved. This is the definition
+ /// for the physical frame buffer. The byte values for the red, green, and blue
+ /// components represent the color intensity. This color intensity value range
+ /// from a minimum intensity of 0 to maximum intensity of 255.
+ ///
+ PixelBlueGreenRedReserved8BitPerColor,
+ ///
+ /// The Pixel definition of the physical frame buffer.
+ ///
+ PixelBitMask,
+ ///
+ /// This mode does not support a physical frame buffer.
+ ///
+ PixelBltOnly,
+ ///
+ /// Valid EFI_GRAPHICS_PIXEL_FORMAT enum values are less than this value.
+ ///
+ PixelFormatMax
+} EFI_GRAPHICS_PIXEL_FORMAT;
+
+typedef struct {
+ ///
+ /// The version of this data structure. A value of zero represents the
+ /// EFI_GRAPHICS_OUTPUT_MODE_INFORMATION structure as defined in this specification.
+ ///
+ UINT32 Version;
+ ///
+ /// The size of video screen in pixels in the X dimension.
+ ///
+ UINT32 HorizontalResolution;
+ ///
+ /// The size of video screen in pixels in the Y dimension.
+ ///
+ UINT32 VerticalResolution;
+ ///
+ /// Enumeration that defines the physical format of the pixel. A value of PixelBltOnly
+ /// implies that a linear frame buffer is not available for this mode.
+ ///
+ EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;
+ ///
+ /// This bit-mask is only valid if PixelFormat is set to PixelPixelBitMask.
+ /// A bit being set defines what bits are used for what purpose such as Red, Green, Blue, or Reserved.
+ ///
+ EFI_PIXEL_BITMASK PixelInformation;
+ ///
+ /// Defines the number of pixel elements per video memory line.
+ ///
+ UINT32 PixelsPerScanLine;
+} EFI_GRAPHICS_OUTPUT_MODE_INFORMATION;
+
+/**
+ Returns information for an available graphics mode that the graphics device
+ and the set of active video output devices supports.
+
+ @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
+ @param ModeNumber The mode number to return information on.
+ @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
+ @param Info A pointer to callee allocated buffer that returns information about ModeNumber.
+
+ @retval EFI_SUCCESS Valid mode information was returned.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.
+ @retval EFI_INVALID_PARAMETER ModeNumber is not valid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE)(
+ IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
+ IN UINT32 ModeNumber,
+ OUT UINTN *SizeOfInfo,
+ OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
+ );
+
+/**
+ Set the video device into the specified mode and clears the visible portions of
+ the output display to black.
+
+ @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
+ @param ModeNumber Abstraction that defines the current video mode.
+
+ @retval EFI_SUCCESS The graphics mode specified by ModeNumber was selected.
+ @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
+ @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE)(
+ IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
+ IN UINT32 ModeNumber
+ );
+
+typedef struct {
+ UINT8 Blue;
+ UINT8 Green;
+ UINT8 Red;
+ UINT8 Reserved;
+} EFI_GRAPHICS_OUTPUT_BLT_PIXEL;
+
+typedef union {
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;
+ UINT32 Raw;
+} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;
+
+///
+/// actions for BltOperations
+///
+typedef enum {
+ ///
+ /// Write data from the BltBuffer pixel (0, 0)
+ /// directly to every pixel of the video display rectangle
+ /// (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
+ /// Only one pixel will be used from the BltBuffer. Delta is NOT used.
+ ///
+ EfiBltVideoFill,
+
+ ///
+ /// Read data from the video display rectangle
+ /// (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
+ /// the BltBuffer rectangle (DestinationX, DestinationY )
+ /// (DestinationX + Width, DestinationY + Height). If DestinationX or
+ /// DestinationY is not zero then Delta must be set to the length in bytes
+ /// of a row in the BltBuffer.
+ ///
+ EfiBltVideoToBltBuffer,
+
+ ///
+ /// Write data from the BltBuffer rectangle
+ /// (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
+ /// video display rectangle (DestinationX, DestinationY)
+ /// (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
+ /// not zero then Delta must be set to the length in bytes of a row in the
+ /// BltBuffer.
+ ///
+ EfiBltBufferToVideo,
+
+ ///
+ /// Copy from the video display rectangle (SourceX, SourceY)
+ /// (SourceX + Width, SourceY + Height) to the video display rectangle
+ /// (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
+ /// The BltBuffer and Delta are not used in this mode.
+ ///
+ EfiBltVideoToVideo,
+
+ EfiGraphicsOutputBltOperationMax
+} EFI_GRAPHICS_OUTPUT_BLT_OPERATION;
+
+/**
+ Blt a rectangle of pixels on the graphics screen. Blt stands for BLock Transfer.
+
+ @param This Protocol instance pointer.
+ @param BltBuffer The data to transfer to the graphics screen.
+ Size is at least Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL).
+ @param BltOperation The operation to perform when copying BltBuffer on to the graphics screen.
+ @param SourceX The X coordinate of source for the BltOperation.
+ @param SourceY The Y coordinate of source for the BltOperation.
+ @param DestinationX The X coordinate of destination for the BltOperation.
+ @param DestinationY The Y coordinate of destination for the BltOperation.
+ @param Width The width of a rectangle in the blt rectangle in pixels.
+ @param Height The height of a rectangle in the blt rectangle in pixels.
+ @param Delta Not used for EfiBltVideoFill or the EfiBltVideoToVideo operation.
+ If a Delta of zero is used, the entire BltBuffer is being operated on.
+ If a subrectangle of the BltBuffer is being used then Delta
+ represents the number of bytes in a row of the BltBuffer.
+
+ @retval EFI_SUCCESS BltBuffer was drawn to the graphics screen.
+ @retval EFI_INVALID_PARAMETER BltOperation is not valid.
+ @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT)(
+ IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
+ IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
+ IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
+ IN UINTN SourceX,
+ IN UINTN SourceY,
+ IN UINTN DestinationX,
+ IN UINTN DestinationY,
+ IN UINTN Width,
+ IN UINTN Height,
+ IN UINTN Delta OPTIONAL
+ );
+
+typedef struct {
+ ///
+ /// The number of modes supported by QueryMode() and SetMode().
+ ///
+ UINT32 MaxMode;
+ ///
+ /// Current Mode of the graphics device. Valid mode numbers are 0 to MaxMode -1.
+ ///
+ UINT32 Mode;
+ ///
+ /// Pointer to read-only EFI_GRAPHICS_OUTPUT_MODE_INFORMATION data.
+ ///
+ EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
+ ///
+ /// Size of Info structure in bytes.
+ ///
+ UINTN SizeOfInfo;
+ ///
+ /// Base address of graphics linear frame buffer.
+ /// Offset zero in FrameBufferBase represents the upper left pixel of the display.
+ ///
+ EFI_PHYSICAL_ADDRESS FrameBufferBase;
+ ///
+ /// Amount of frame buffer needed to support the active mode as defined by
+ /// PixelsPerScanLine xVerticalResolution x PixelElementSize.
+ ///
+ UINTN FrameBufferSize;
+} EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE;
+
+///
+/// Provides a basic abstraction to set video modes and copy pixels to and from
+/// the graphics controller's frame buffer. The linear address of the hardware
+/// frame buffer is also exposed so software can write directly to the video hardware.
+///
+struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {
+ EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode;
+ EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode;
+ EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt;
+ ///
+ /// Pointer to EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE data.
+ ///
+ EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode;
+};
+
+extern EFI_GUID gEfiGraphicsOutputProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/GuidedSectionExtraction.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/GuidedSectionExtraction.h
new file mode 100644
index 0000000000..8f35002cdd
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/GuidedSectionExtraction.h
@@ -0,0 +1,141 @@
+/** @file
+ If a GUID-defined section is encountered when doing section
+ extraction, the section extraction driver calls the appropriate
+ instance of the GUIDed Section Extraction Protocol to extract
+ the section stream contained therein.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference: PI
+ Version 1.00.
+
+**/
+
+#ifndef __GUID_SECTION_EXTRACTION_PROTOCOL_H__
+#define __GUID_SECTION_EXTRACTION_PROTOCOL_H__
+
+//
+// The protocol interface structures are identified by associating
+// them with a GUID. Each instance of a protocol with a given
+// GUID must have the same interface structure. While all instances
+// of the GUIDed Section Extraction Protocol must have the same
+// interface structure, they do not all have the same GUID. The
+// GUID that is associated with an instance of the GUIDed Section
+// Extraction Protocol is used to correlate it with the GUIDed
+// section type that it is intended to process.
+//
+
+typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL;
+
+
+/**
+ The ExtractSection() function processes the input section and
+ allocates a buffer from the pool in which it returns the section
+ contents. If the section being extracted contains
+ authentication information (the section's
+ GuidedSectionHeader.Attributes field has the
+ EFI_GUIDED_SECTION_AUTH_STATUS_VALID bit set), the values
+ returned in AuthenticationStatus must reflect the results of
+ the authentication operation. Depending on the algorithm and
+ size of the encapsulated data, the time that is required to do
+ a full authentication may be prohibitively long for some
+ classes of systems. To indicate this, use
+ EFI_SECURITY_POLICY_PROTOCOL_GUID, which may be published by
+ the security policy driver (see the Platform Initialization
+ Driver Execution Environment Core Interface Specification for
+ more details and the GUID definition). If the
+ EFI_SECURITY_POLICY_PROTOCOL_GUID exists in the handle
+ database, then, if possible, full authentication should be
+ skipped and the section contents simply returned in the
+ OutputBuffer. In this case, the
+ EFI_AUTH_STATUS_PLATFORM_OVERRIDE bit AuthenticationStatus
+ must be set on return. ExtractSection() is callable only from
+ TPL_NOTIFY and below. Behavior of ExtractSection() at any
+ EFI_TPL above TPL_NOTIFY is undefined. Type EFI_TPL is
+ defined in RaiseTPL() in the UEFI 2.0 specification.
+
+
+ @param This Indicates the EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance.
+
+ @param InputSection Buffer containing the input GUIDed section
+ to be processed. OutputBuffer OutputBuffer
+ is allocated from boot services pool
+ memory and contains the new section
+ stream. The caller is responsible for
+ freeing this buffer.
+
+ @param OutputSize A pointer to a caller-allocated UINTN in
+ which the size of OutputBuffer allocation
+ is stored. If the function returns
+ anything other than EFI_SUCCESS, the value
+ of OutputSize is undefined.
+
+ @param AuthenticationStatus A pointer to a caller-allocated
+ UINT32 that indicates the
+ authentication status of the
+ output buffer. If the input
+ section's
+ GuidedSectionHeader.Attributes
+ field has the
+ EFI_GUIDED_SECTION_AUTH_STATUS_VAL
+ bit as clear, AuthenticationStatus
+ must return zero. Both local bits
+ (19:16) and aggregate bits (3:0)
+ in AuthenticationStatus are
+ returned by ExtractSection().
+ These bits reflect the status of
+ the extraction operation. The bit
+ pattern in both regions must be
+ the same, as the local and
+ aggregate authentication statuses
+ have equivalent meaning at this
+ level. If the function returns
+ anything other than EFI_SUCCESS,
+ the value of AuthenticationStatus
+ is undefined.
+
+ @retval EFI_SUCCESS The InputSection was successfully
+ processed and the section contents were
+ returned.
+
+ @retval EFI_OUT_OF_RESOURCES The system has insufficient
+ resources to process the
+ request.
+
+ @retval EFI_INVALID_PARAMETER The GUID in InputSection does
+ not match this instance of the
+ GUIDed Section Extraction
+ Protocol.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXTRACT_GUIDED_SECTION)(
+ IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
+ IN CONST VOID *InputSection,
+ OUT VOID **OutputBuffer,
+ OUT UINTN *OutputSize,
+ OUT UINT32 *AuthenticationStatus
+);
+
+
+///
+/// Typically, protocol interface structures are identified by associating them with a GUID. Each
+/// instance of a protocol with a given GUID must have the same interface structure. While all instances
+/// of the GUIDed Section Extraction Protocol must have the same interface structure, they do not all
+/// have the same GUID. The GUID that is associated with an instance of the GUIDed Section
+/// Extraction Protocol is used to correlate it with the GUIDed section type that it is intended to process.
+///
+struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL {
+ EFI_EXTRACT_GUIDED_SECTION ExtractSection;
+};
+
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Hash.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Hash.h
new file mode 100644
index 0000000000..872dfb7abf
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Hash.h
@@ -0,0 +1,175 @@
+/** @file
+ EFI_HASH_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.
+ EFI_HASH_PROTOCOL as defined in UEFI 2.0.
+ The EFI Hash Service Binding Protocol is used to locate hashing services support
+ provided by a driver and to create and destroy instances of the EFI Hash Protocol
+ so that a multiple drivers can use the underlying hashing services.
+
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_HASH_PROTOCOL_H__
+#define __EFI_HASH_PROTOCOL_H__
+
+#define EFI_HASH_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0x42881c98, 0xa4f3, 0x44b0, {0xa3, 0x9d, 0xdf, 0xa1, 0x86, 0x67, 0xd8, 0xcd } \
+ }
+
+#define EFI_HASH_PROTOCOL_GUID \
+ { \
+ 0xc5184932, 0xdba5, 0x46db, {0xa5, 0xba, 0xcc, 0x0b, 0xda, 0x9c, 0x14, 0x35 } \
+ }
+
+#define EFI_HASH_ALGORITHM_SHA1_GUID \
+ { \
+ 0x2ae9d80f, 0x3fb2, 0x4095, {0xb7, 0xb1, 0xe9, 0x31, 0x57, 0xb9, 0x46, 0xb6 } \
+ }
+
+#define EFI_HASH_ALGORITHM_SHA224_GUID \
+ { \
+ 0x8df01a06, 0x9bd5, 0x4bf7, {0xb0, 0x21, 0xdb, 0x4f, 0xd9, 0xcc, 0xf4, 0x5b } \
+ }
+
+#define EFI_HASH_ALGORITHM_SHA256_GUID \
+ { \
+ 0x51aa59de, 0xfdf2, 0x4ea3, {0xbc, 0x63, 0x87, 0x5f, 0xb7, 0x84, 0x2e, 0xe9 } \
+ }
+
+#define EFI_HASH_ALGORITHM_SHA384_GUID \
+ { \
+ 0xefa96432, 0xde33, 0x4dd2, {0xae, 0xe6, 0x32, 0x8c, 0x33, 0xdf, 0x77, 0x7a } \
+ }
+
+#define EFI_HASH_ALGORITHM_SHA512_GUID \
+ { \
+ 0xcaa4381e, 0x750c, 0x4770, {0xb8, 0x70, 0x7a, 0x23, 0xb4, 0xe4, 0x21, 0x30 } \
+ }
+
+#define EFI_HASH_ALGORTIHM_MD5_GUID \
+ { \
+ 0xaf7c79c, 0x65b5, 0x4319, {0xb0, 0xae, 0x44, 0xec, 0x48, 0x4e, 0x4a, 0xd7 } \
+ }
+
+#define EFI_HASH_ALGORITHM_SHA1_NOPAD_GUID \
+ { \
+ 0x24c5dc2f, 0x53e2, 0x40ca, {0x9e, 0xd6, 0xa5, 0xd9, 0xa4, 0x9f, 0x46, 0x3b } \
+ }
+
+#define EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID \
+ { \
+ 0x8628752a, 0x6cb7, 0x4814, {0x96, 0xfc, 0x24, 0xa8, 0x15, 0xac, 0x22, 0x26 } \
+ }
+
+//
+// Note: Use of the following algorithms with EFI_HASH_PROTOCOL is deprecated.
+// EFI_HASH_ALGORITHM_SHA1_GUID
+// EFI_HASH_ALGORITHM_SHA224_GUID
+// EFI_HASH_ALGORITHM_SHA256_GUID
+// EFI_HASH_ALGORITHM_SHA384_GUID
+// EFI_HASH_ALGORITHM_SHA512_GUID
+// EFI_HASH_ALGORTIHM_MD5_GUID
+//
+
+typedef struct _EFI_HASH_PROTOCOL EFI_HASH_PROTOCOL;
+
+typedef UINT8 EFI_MD5_HASH[16];
+typedef UINT8 EFI_SHA1_HASH[20];
+typedef UINT8 EFI_SHA224_HASH[28];
+typedef UINT8 EFI_SHA256_HASH[32];
+typedef UINT8 EFI_SHA384_HASH[48];
+typedef UINT8 EFI_SHA512_HASH[64];
+
+typedef union {
+ EFI_MD5_HASH *Md5Hash;
+ EFI_SHA1_HASH *Sha1Hash;
+ EFI_SHA224_HASH *Sha224Hash;
+ EFI_SHA256_HASH *Sha256Hash;
+ EFI_SHA384_HASH *Sha384Hash;
+ EFI_SHA512_HASH *Sha512Hash;
+} EFI_HASH_OUTPUT;
+
+/**
+ Returns the size of the hash which results from a specific algorithm.
+
+ @param[in] This Points to this instance of EFI_HASH_PROTOCOL.
+ @param[in] HashAlgorithm Points to the EFI_GUID which identifies the algorithm to use.
+ @param[out] HashSize Holds the returned size of the algorithm's hash.
+
+ @retval EFI_SUCCESS Hash size returned successfully.
+ @retval EFI_INVALID_PARAMETER HashSize is NULL or HashAlgorithm is NULL.
+ @retval EFI_UNSUPPORTED The algorithm specified by HashAlgorithm is not supported
+ by this driver.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HASH_GET_HASH_SIZE)(
+ IN CONST EFI_HASH_PROTOCOL *This,
+ IN CONST EFI_GUID *HashAlgorithm,
+ OUT UINTN *HashSize
+ );
+
+/**
+ Creates a hash for the specified message text.
+
+ @param[in] This Points to this instance of EFI_HASH_PROTOCOL.
+ @param[in] HashAlgorithm Points to the EFI_GUID which identifies the algorithm to use.
+ @param[in] Extend Specifies whether to create a new hash (FALSE) or extend the specified
+ existing hash (TRUE).
+ @param[in] Message Points to the start of the message.
+ @param[in] MessageSize The size of Message, in bytes.
+ @param[in,out] Hash On input, if Extend is TRUE, then this parameter holds a pointer
+ to a pointer to an array containing the hash to extend. If Extend
+ is FALSE, then this parameter holds a pointer to a pointer to a
+ caller-allocated array that will receive the result of the hash
+ computation. On output (regardless of the value of Extend), the
+ array will contain the result of the hash computation.
+
+ @retval EFI_SUCCESS Hash returned successfully.
+ @retval EFI_INVALID_PARAMETER Message or Hash, HashAlgorithm is NULL or MessageSize is 0.
+ MessageSize is not an integer multiple of block size.
+ @retval EFI_UNSUPPORTED The algorithm specified by HashAlgorithm is not supported by this
+ driver. Or, Extend is TRUE, and the algorithm doesn't support extending the hash.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HASH_HASH)(
+ IN CONST EFI_HASH_PROTOCOL *This,
+ IN CONST EFI_GUID *HashAlgorithm,
+ IN BOOLEAN Extend,
+ IN CONST UINT8 *Message,
+ IN UINT64 MessageSize,
+ IN OUT EFI_HASH_OUTPUT *Hash
+ );
+
+///
+/// This protocol allows creating a hash of an arbitrary message digest
+/// using one or more hash algorithms.
+///
+struct _EFI_HASH_PROTOCOL {
+ EFI_HASH_GET_HASH_SIZE GetHashSize;
+ EFI_HASH_HASH Hash;
+};
+
+extern EFI_GUID gEfiHashServiceBindingProtocolGuid;
+extern EFI_GUID gEfiHashProtocolGuid;
+extern EFI_GUID gEfiHashAlgorithmSha1Guid;
+extern EFI_GUID gEfiHashAlgorithmSha224Guid;
+extern EFI_GUID gEfiHashAlgorithmSha256Guid;
+extern EFI_GUID gEfiHashAlgorithmSha384Guid;
+extern EFI_GUID gEfiHashAlgorithmSha512Guid;
+extern EFI_GUID gEfiHashAlgorithmMD5Guid;
+extern EFI_GUID gEfiHashAlgorithmSha1NoPadGuid;
+extern EFI_GUID gEfiHashAlgorithmSha256NoPadGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Hash2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Hash2.h
new file mode 100644
index 0000000000..d049e8faff
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Hash2.h
@@ -0,0 +1,202 @@
+/** @file
+ EFI_HASH2_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.5.
+ EFI_HASH2_PROTOCOL as defined in UEFI 2.5.
+ The EFI Hash2 Service Binding Protocol is used to locate hashing services support
+ provided by a driver and to create and destroy instances of the EFI Hash2 Protocol
+ so that a multiple drivers can use the underlying hashing services.
+ EFI_HASH2_PROTOCOL describes hashing functions for which the algorithm-required
+ message padding and finalization are performed by the supporting driver.
+
+Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_HASH2_PROTOCOL_H__
+#define __EFI_HASH2_PROTOCOL_H__
+
+#define EFI_HASH2_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0xda836f8d, 0x217f, 0x4ca0, { 0x99, 0xc2, 0x1c, 0xa4, 0xe1, 0x60, 0x77, 0xea } \
+ }
+
+#define EFI_HASH2_PROTOCOL_GUID \
+ { \
+ 0x55b1d734, 0xc5e1, 0x49db, { 0x96, 0x47, 0xb1, 0x6a, 0xfb, 0xe, 0x30, 0x5b } \
+ }
+
+#include <Protocol/Hash.h>
+
+//
+// NOTE:
+// Algorithms EFI_HASH_ALGORITHM_SHA1_NOPAD and
+// EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID are not compatible with
+// EFI_HASH2_PROTOCOL and will return EFI_UNSUPPORTED if used with any
+// EFI_HASH2_PROTOCOL function.
+//
+
+//
+// Note: SHA-1 and MD5 are included for backwards compatibility.
+// New driver implementations are encouraged to consider stronger algorithms.
+//
+
+typedef struct _EFI_HASH2_PROTOCOL EFI_HASH2_PROTOCOL;
+
+typedef UINT8 EFI_MD5_HASH2[16];
+typedef UINT8 EFI_SHA1_HASH2[20];
+typedef UINT8 EFI_SHA224_HASH2[28];
+typedef UINT8 EFI_SHA256_HASH2[32];
+typedef UINT8 EFI_SHA384_HASH2[48];
+typedef UINT8 EFI_SHA512_HASH2[64];
+
+typedef union {
+ EFI_MD5_HASH2 Md5Hash;
+ EFI_SHA1_HASH2 Sha1Hash;
+ EFI_SHA224_HASH2 Sha224Hash;
+ EFI_SHA256_HASH2 Sha256Hash;
+ EFI_SHA384_HASH2 Sha384Hash;
+ EFI_SHA512_HASH2 Sha512Hash;
+} EFI_HASH2_OUTPUT;
+
+/**
+ Returns the size of the hash which results from a specific algorithm.
+
+ @param[in] This Points to this instance of EFI_HASH2_PROTOCOL.
+ @param[in] HashAlgorithm Points to the EFI_GUID which identifies the algorithm to use.
+ @param[out] HashSize Holds the returned size of the algorithm's hash.
+
+ @retval EFI_SUCCESS Hash size returned successfully.
+ @retval EFI_INVALID_PARAMETER This or HashSize is NULL.
+ @retval EFI_UNSUPPORTED The algorithm specified by HashAlgorithm is not supported by this driver
+ or HashAlgorithm is null.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HASH2_GET_HASH_SIZE)(
+ IN CONST EFI_HASH2_PROTOCOL *This,
+ IN CONST EFI_GUID *HashAlgorithm,
+ OUT UINTN *HashSize
+ );
+
+/**
+ Creates a hash for the specified message text. The hash is not extendable.
+ The output is final with any algorithm-required padding added by the function.
+
+ @param[in] This Points to this instance of EFI_HASH2_PROTOCOL.
+ @param[in] HashAlgorithm Points to the EFI_GUID which identifies the algorithm to use.
+ @param[in] Message Points to the start of the message.
+ @param[in] MessageSize The size of Message, in bytes.
+ @param[in,out] Hash On input, points to a caller-allocated buffer of the size
+ returned by GetHashSize() for the specified HashAlgorithm.
+ On output, the buffer holds the resulting hash computed from the message.
+
+ @retval EFI_SUCCESS Hash returned successfully.
+ @retval EFI_INVALID_PARAMETER This or Hash is NULL.
+ @retval EFI_UNSUPPORTED The algorithm specified by HashAlgorithm is not supported by this driver
+ or HashAlgorithm is Null.
+ @retval EFI_OUT_OF_RESOURCES Some resource required by the function is not available
+ or MessageSize is greater than platform maximum.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HASH2_HASH)(
+ IN CONST EFI_HASH2_PROTOCOL *This,
+ IN CONST EFI_GUID *HashAlgorithm,
+ IN CONST UINT8 *Message,
+ IN UINTN MessageSize,
+ IN OUT EFI_HASH2_OUTPUT *Hash
+ );
+
+/**
+ This function must be called to initialize a digest calculation to be subsequently performed using the
+ EFI_HASH2_PROTOCOL functions HashUpdate() and HashFinal().
+
+ @param[in] This Points to this instance of EFI_HASH2_PROTOCOL.
+ @param[in] HashAlgorithm Points to the EFI_GUID which identifies the algorithm to use.
+
+ @retval EFI_SUCCESS Initialized successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_UNSUPPORTED The algorithm specified by HashAlgorithm is not supported by this driver
+ or HashAlgorithm is Null.
+ @retval EFI_OUT_OF_RESOURCES Process failed due to lack of required resource.
+ @retval EFI_ALREADY_STARTED This function is called when the operation in progress is still in processing Hash(),
+ or HashInit() is already called before and not terminated by HashFinal() yet on the same instance.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HASH2_HASH_INIT)(
+ IN CONST EFI_HASH2_PROTOCOL *This,
+ IN CONST EFI_GUID *HashAlgorithm
+ );
+
+/**
+ Updates the hash of a computation in progress by adding a message text.
+
+ @param[in] This Points to this instance of EFI_HASH2_PROTOCOL.
+ @param[in] Message Points to the start of the message.
+ @param[in] MessageSize The size of Message, in bytes.
+
+ @retval EFI_SUCCESS Digest in progress updated successfully.
+ @retval EFI_INVALID_PARAMETER This or Hash is NULL.
+ @retval EFI_OUT_OF_RESOURCES Some resource required by the function is not available
+ or MessageSize is greater than platform maximum.
+ @retval EFI_NOT_READY This call was not preceded by a valid call to HashInit(),
+ or the operation in progress was terminated by a call to Hash() or HashFinal() on the same instance.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HASH2_HASH_UPDATE)(
+ IN CONST EFI_HASH2_PROTOCOL *This,
+ IN CONST UINT8 *Message,
+ IN UINTN MessageSize
+ );
+
+/**
+ Finalizes a hash operation in progress and returns calculation result.
+ The output is final with any necessary padding added by the function.
+ The hash may not be further updated or extended after HashFinal().
+
+ @param[in] This Points to this instance of EFI_HASH2_PROTOCOL.
+ @param[in,out] Hash On input, points to a caller-allocated buffer of the size
+ returned by GetHashSize() for the specified HashAlgorithm specified in preceding HashInit().
+ On output, the buffer holds the resulting hash computed from the message.
+
+ @retval EFI_SUCCESS Hash returned successfully.
+ @retval EFI_INVALID_PARAMETER This or Hash is NULL.
+ @retval EFI_NOT_READY This call was not preceded by a valid call to HashInit() and at least one call to HashUpdate(),
+ or the operation in progress was canceled by a call to Hash() on the same instance.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HASH2_HASH_FINAL)(
+ IN CONST EFI_HASH2_PROTOCOL *This,
+ IN OUT EFI_HASH2_OUTPUT *Hash
+ );
+
+///
+/// This protocol describes hashing functions for which the algorithm-required message padding and
+/// finalization are performed by the supporting driver.
+///
+struct _EFI_HASH2_PROTOCOL {
+ EFI_HASH2_GET_HASH_SIZE GetHashSize;
+ EFI_HASH2_HASH Hash;
+ EFI_HASH2_HASH_INIT HashInit;
+ EFI_HASH2_HASH_UPDATE HashUpdate;
+ EFI_HASH2_HASH_FINAL HashFinal;
+};
+
+extern EFI_GUID gEfiHash2ServiceBindingProtocolGuid;
+extern EFI_GUID gEfiHash2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiConfigAccess.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiConfigAccess.h
new file mode 100644
index 0000000000..3b076511c6
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiConfigAccess.h
@@ -0,0 +1,223 @@
+/** @file
+
+ The EFI HII results processing protocol invokes this type of protocol
+ when it needs to forward results to a driver's configuration handler.
+ This protocol is published by drivers providing and requesting
+ configuration data from HII. It may only be invoked by HII.
+
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+
+#ifndef __EFI_HII_CONFIG_ACCESS_H__
+#define __EFI_HII_CONFIG_ACCESS_H__
+
+#include <Protocol/FormBrowser2.h>
+
+#define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \
+ { 0x330d4706, 0xf2a0, 0x4e4f, { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } }
+
+typedef struct _EFI_HII_CONFIG_ACCESS_PROTOCOL EFI_HII_CONFIG_ACCESS_PROTOCOL;
+
+typedef UINTN EFI_BROWSER_ACTION;
+
+#define EFI_BROWSER_ACTION_CHANGING 0
+#define EFI_BROWSER_ACTION_CHANGED 1
+#define EFI_BROWSER_ACTION_RETRIEVE 2
+#define EFI_BROWSER_ACTION_FORM_OPEN 3
+#define EFI_BROWSER_ACTION_FORM_CLOSE 4
+#define EFI_BROWSER_ACTION_SUBMITTED 5
+#define EFI_BROWSER_ACTION_DEFAULT_STANDARD 0x1000
+#define EFI_BROWSER_ACTION_DEFAULT_MANUFACTURING 0x1001
+#define EFI_BROWSER_ACTION_DEFAULT_SAFE 0x1002
+#define EFI_BROWSER_ACTION_DEFAULT_PLATFORM 0x2000
+#define EFI_BROWSER_ACTION_DEFAULT_HARDWARE 0x3000
+#define EFI_BROWSER_ACTION_DEFAULT_FIRMWARE 0x4000
+
+/**
+
+ This function allows the caller to request the current
+ configuration for one or more named elements. The resulting
+ string is in <ConfigAltResp> format. Any and all alternative
+ configuration strings shall also be appended to the end of the
+ current configuration string. If they are, they must appear
+ after the current configuration. They must contain the same
+ routing (GUID, NAME, PATH) as the current configuration string.
+ They must have an additional description indicating the type of
+ alternative configuration the string represents,
+ "ALTCFG=<StringToken>". That <StringToken> (when
+ converted from Hex UNICODE to binary) is a reference to a
+ string in the associated string pack.
+
+ @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
+
+ @param Request A null-terminated Unicode string in
+ <ConfigRequest> format. Note that this
+ includes the routing information as well as
+ the configurable name / value pairs. It is
+ invalid for this string to be in
+ <MultiConfigRequest> format.
+ If a NULL is passed in for the Request field,
+ all of the settings being abstracted by this function
+ will be returned in the Results field. In addition,
+ if a ConfigHdr is passed in with no request elements,
+ all of the settings being abstracted for that particular
+ ConfigHdr reference will be returned in the Results Field.
+
+ @param Progress On return, points to a character in the
+ Request string. Points to the string's null
+ terminator if request was successful. Points
+ to the most recent "&" before the first
+ failing name / value pair (or the beginning
+ of the string if the failure is in the first
+ name / value pair) if the request was not
+ successful.
+
+ @param Results A null-terminated Unicode string in
+ <MultiConfigAltResp> format which has all values
+ filled in for the names in the Request string.
+ String to be allocated by the called function.
+
+ @retval EFI_SUCCESS The Results string is filled with the
+ values corresponding to all requested
+ names.
+
+ @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
+ parts of the results that must be
+ stored awaiting possible future
+ protocols.
+
+ @retval EFI_NOT_FOUND A configuration element matching
+ the routing data is not found.
+ Progress set to the first character
+ in the routing header.
+
+ @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set
+ to most recent "&" before the
+ error or the beginning of the
+ string.
+
+ @retval EFI_INVALID_PARAMETER Unknown name. Progress points
+ to the & before the name in
+ question.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_HII_ACCESS_EXTRACT_CONFIG)(
+ IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
+ IN CONST EFI_STRING Request,
+ OUT EFI_STRING *Progress,
+ OUT EFI_STRING *Results
+);
+
+
+/**
+
+ This function applies changes in a driver's configuration.
+ Input is a Configuration, which has the routing data for this
+ driver followed by name / value configuration pairs. The driver
+ must apply those pairs to its configurable storage. If the
+ driver's configuration is stored in a linear block of data
+ and the driver's name / value pairs are in <BlockConfig>
+ format, it may use the ConfigToBlock helper function (above) to
+ simplify the job.
+
+ @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
+
+ @param Configuration A null-terminated Unicode string in
+ <ConfigString> format.
+
+ @param Progress A pointer to a string filled in with the
+ offset of the most recent '&' before the
+ first failing name / value pair (or the
+ beginn ing of the string if the failure
+ is in the first name / value pair) or
+ the terminating NULL if all was
+ successful.
+
+ @retval EFI_SUCCESS The results have been distributed or are
+ awaiting distribution.
+
+ @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
+ parts of the results that must be
+ stored awaiting possible future
+ protocols.
+
+ @retval EFI_INVALID_PARAMETERS Passing in a NULL for the
+ Results parameter would result
+ in this type of error.
+
+ @retval EFI_NOT_FOUND Target for the specified routing data
+ was not found
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_HII_ACCESS_ROUTE_CONFIG)(
+ IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
+ IN CONST EFI_STRING Configuration,
+ OUT EFI_STRING *Progress
+);
+
+/**
+
+ This function is called to provide results data to the driver.
+ This data consists of a unique key that is used to identify
+ which data is either being passed back or being asked for.
+
+ @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
+ @param Action Specifies the type of action taken by the browser.
+ @param QuestionId A unique value which is sent to the original
+ exporting driver so that it can identify the type
+ of data to expect. The format of the data tends to
+ vary based on the opcode that generated the callback.
+ @param Type The type of value for the question.
+ @param Value A pointer to the data being sent to the original
+ exporting driver.
+ @param ActionRequest On return, points to the action requested by the
+ callback function.
+
+ @retval EFI_SUCCESS The callback successfully handled the action.
+ @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
+ variable and its data.
+ @retval EFI_DEVICE_ERROR The variable could not be saved.
+ @retval EFI_UNSUPPORTED The specified Action is not supported by the
+ callback.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_ACCESS_FORM_CALLBACK)(
+ IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
+ IN EFI_BROWSER_ACTION Action,
+ IN EFI_QUESTION_ID QuestionId,
+ IN UINT8 Type,
+ IN OUT EFI_IFR_TYPE_VALUE *Value,
+ OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
+ )
+ ;
+
+///
+/// This protocol provides a callable interface between the HII and
+/// drivers. Only drivers which provide IFR data to HII are required
+/// to publish this protocol.
+///
+struct _EFI_HII_CONFIG_ACCESS_PROTOCOL {
+ EFI_HII_ACCESS_EXTRACT_CONFIG ExtractConfig;
+ EFI_HII_ACCESS_ROUTE_CONFIG RouteConfig;
+ EFI_HII_ACCESS_FORM_CALLBACK Callback;
+} ;
+
+extern EFI_GUID gEfiHiiConfigAccessProtocolGuid;
+
+#endif
+
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiConfigKeyword.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiConfigKeyword.h
new file mode 100644
index 0000000000..1c2d3c67dc
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiConfigKeyword.h
@@ -0,0 +1,201 @@
+/** @file
+ The file provides the mechanism to set and get the values
+ associated with a keyword exposed through a x-UEFI- prefixed
+ configuration language namespace.
+
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_CONFIG_KEYWORD_HANDLER_H__
+#define __EFI_CONFIG_KEYWORD_HANDLER_H__
+
+#define EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL_GUID \
+{ \
+ 0x0a8badd5, 0x03b8, 0x4d19, {0xb1, 0x28, 0x7b, 0x8f, 0x0e, 0xda, 0xa5, 0x96 } \
+}
+
+//***********************************************************
+// Progress Errors
+//***********************************************************
+#define KEYWORD_HANDLER_NO_ERROR 0x00000000
+#define KEYWORD_HANDLER_NAMESPACE_ID_NOT_FOUND 0x00000001
+#define KEYWORD_HANDLER_MALFORMED_STRING 0x00000002
+#define KEYWORD_HANDLER_KEYWORD_NOT_FOUND 0x00000004
+#define KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED 0x00000008
+#define KEYWORD_HANDLER_ACCESS_NOT_PERMITTED 0x00000010
+#define KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR 0x80000000
+
+typedef struct _EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL;
+
+/**
+
+ This function accepts a <MultiKeywordResp> formatted string, finds the associated
+ keyword owners, creates a <MultiConfigResp> string from it and forwards it to the
+ EFI_HII_ROUTING_PROTOCOL.RouteConfig function.
+
+ If there is an issue in resolving the contents of the KeywordString, then the
+ function returns an error and also sets the Progress and ProgressErr with the
+ appropriate information about where the issue occurred and additional data about
+ the nature of the issue.
+
+ In the case when KeywordString containing multiple keywords, when an EFI_NOT_FOUND
+ error is generated during processing the second or later keyword element, the system
+ storage associated with earlier keywords is not modified. All elements of the
+ KeywordString must successfully pass all tests for format and access prior to making
+ any modifications to storage.
+
+ In the case when EFI_DEVICE_ERROR is returned from the processing of a KeywordString
+ containing multiple keywords, the state of storage associated with earlier keywords
+ is undefined.
+
+
+ @param This Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.
+
+ @param KeywordString A null-terminated string in <MultiKeywordResp> format.
+
+ @param Progress On return, points to a character in the KeywordString.
+ Points to the string's NULL terminator if the request
+ was successful. Points to the most recent '&' before
+ the first failing name / value pair (or the beginning
+ of the string if the failure is in the first name / value
+ pair) if the request was not successful.
+
+ @param ProgressErr If during the processing of the KeywordString there was
+ a failure, this parameter gives additional information
+ about the possible source of the problem. The various
+ errors are defined in "Related Definitions" below.
+
+
+ @retval EFI_SUCCESS The specified action was completed successfully.
+
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ 1. KeywordString is NULL.
+ 2. Parsing of the KeywordString resulted in an
+ error. See Progress and ProgressErr for more data.
+
+ @retval EFI_NOT_FOUND An element of the KeywordString was not found.
+ See ProgressErr for more data.
+
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ See ProgressErr for more data.
+
+ @retval EFI_ACCESS_DENIED The action violated system policy. See ProgressErr
+ for more data.
+
+ @retval EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr
+ for more data.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CONFIG_KEYWORD_HANDLER_SET_DATA) (
+ IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This,
+ IN CONST EFI_STRING KeywordString,
+ OUT EFI_STRING *Progress,
+ OUT UINT32 *ProgressErr
+ );
+
+
+/**
+
+ This function accepts a <MultiKeywordRequest> formatted string, finds the underlying
+ keyword owners, creates a <MultiConfigRequest> string from it and forwards it to the
+ EFI_HII_ROUTING_PROTOCOL.ExtractConfig function.
+
+ If there is an issue in resolving the contents of the KeywordString, then the function
+ returns an EFI_INVALID_PARAMETER and also set the Progress and ProgressErr with the
+ appropriate information about where the issue occurred and additional data about the
+ nature of the issue.
+
+ In the case when KeywordString is NULL, or contains multiple keywords, or when
+ EFI_NOT_FOUND is generated while processing the keyword elements, the Results string
+ contains values returned for all keywords processed prior to the keyword generating the
+ error but no values for the keyword with error or any following keywords.
+
+
+ @param This Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.
+
+ @param NameSpaceId A null-terminated string containing the platform configuration
+ language to search through in the system. If a NULL is passed
+ in, then it is assumed that any platform configuration language
+ with the prefix of "x-UEFI-" are searched.
+
+ @param KeywordString A null-terminated string in <MultiKeywordRequest> format. If a
+ NULL is passed in the KeywordString field, all of the known
+ keywords in the system for the NameSpaceId specified are
+ returned in the Results field.
+
+ @param Progress On return, points to a character in the KeywordString. Points
+ to the string's NULL terminator if the request was successful.
+ Points to the most recent '&' before the first failing name / value
+ pair (or the beginning of the string if the failure is in the first
+ name / value pair) if the request was not successful.
+
+ @param ProgressErr If during the processing of the KeywordString there was a
+ failure, this parameter gives additional information about the
+ possible source of the problem. See the definitions in SetData()
+ for valid value definitions.
+
+ @param Results A null-terminated string in <MultiKeywordResp> format is returned
+ which has all the values filled in for the keywords in the
+ KeywordString. This is a callee-allocated field, and must be freed
+ by the caller after being used.
+
+ @retval EFI_SUCCESS The specified action was completed successfully.
+
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ 1.Progress, ProgressErr, or Results is NULL.
+ 2.Parsing of the KeywordString resulted in an error. See
+ Progress and ProgressErr for more data.
+
+
+ @retval EFI_NOT_FOUND An element of the KeywordString was not found. See
+ ProgressErr for more data.
+
+ @retval EFI_NOT_FOUND The NamespaceId specified was not found. See ProgressErr
+ for more data.
+
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. See
+ ProgressErr for more data.
+
+ @retval EFI_ACCESS_DENIED The action violated system policy. See ProgressErr for
+ more data.
+
+ @retval EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr
+ for more data.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CONFIG_KEYWORD_HANDLER_GET_DATA) (
+ IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This,
+ IN CONST EFI_STRING NameSpaceId, OPTIONAL
+ IN CONST EFI_STRING KeywordString, OPTIONAL
+ OUT EFI_STRING *Progress,
+ OUT UINT32 *ProgressErr,
+ OUT EFI_STRING *Results
+ );
+
+///
+/// The EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL provides the mechanism
+/// to set and get the values associated with a keyword exposed
+/// through a x-UEFI- prefixed configuration language namespace
+///
+
+struct _EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL {
+ EFI_CONFIG_KEYWORD_HANDLER_SET_DATA SetData;
+ EFI_CONFIG_KEYWORD_HANDLER_GET_DATA GetData;
+};
+
+extern EFI_GUID gEfiConfigKeywordHandlerProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiConfigRouting.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiConfigRouting.h
new file mode 100644
index 0000000000..89f3f9b2db
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiConfigRouting.h
@@ -0,0 +1,419 @@
+/** @file
+ The file provides services to manage the movement of
+ configuration data from drivers to configuration applications.
+ It then serves as the single point to receive configuration
+ information from configuration applications, routing the
+ results to the appropriate drivers.
+
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __HII_CONFIG_ROUTING_H__
+#define __HII_CONFIG_ROUTING_H__
+
+#define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \
+ { 0x587e72d7, 0xcc50, 0x4f79, { 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f } }
+
+
+typedef struct _EFI_HII_CONFIG_ROUTING_PROTOCOL EFI_HII_CONFIG_ROUTING_PROTOCOL;
+
+/**
+
+ This function allows the caller to request the current
+ configuration for one or more named elements from one or more
+ drivers. The resulting string is in the standard HII
+ configuration string format. If Successful, Results contains an
+ equivalent string with "=" and the values associated with all
+ names added in. The expected implementation is for each
+ <ConfigRequest> substring in the Request to call the HII
+ Configuration Routing Protocol ExtractProtocol function for the
+ driver corresponding to the <ConfigHdr> at the start of the
+ <ConfigRequest> substring. The request fails if no driver
+ matches the <ConfigRequest> substring. Note: Alternative
+ configuration strings may also be appended to the end of the
+ current configuration string. If they are, they must appear
+ after the current configuration. They must contain the same
+ routing (GUID, NAME, PATH) as the current configuration string.
+ They must have an additional description indicating the type of
+ alternative configuration the string represents,
+ "ALTCFG=<StringToken>". That <StringToken> (when converted from
+ hexadecimal (encoded as text) to binary) is a reference to a string in the
+ associated string pack. As an example, assume that the Request
+ string is:
+ GUID=...&NAME=00480050&PATH=...&Fred&George&Ron&Neville A result
+ might be:
+ GUID=...&NAME=00480050&PATH=...&Fred=16&George=16&Ron=12&Neville=11&
+ GUID=...&NAME=00480050&PATH=...&ALTCFG=0037&Fred=12&Neville=7
+
+ @param This Points to the EFI_HII_CONFIG_ROUTING_PROTOCOL
+ instance.
+
+ @param Request A null-terminated string in <MultiConfigRequest> format.
+
+ @param Progress On return, points to a character in the
+ Request string. Points to the string's null
+ terminator if the request was successful. Points
+ to the most recent '&' before the first
+ failing name / value pair (or the beginning
+ of the string if the failure is in the first
+ name / value pair) if the request was not
+ successful
+
+ @param Results A null-terminated string in <MultiConfigAltResp> format
+ which has all values filled in for the names in the
+ Request string.
+
+ @retval EFI_SUCCESS The Results string is filled with the
+ values corresponding to all requested
+ names.
+
+ @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
+ parts of the results that must be
+ stored awaiting possible future
+ protocols.
+
+ @retval EFI_INVALID_PARAMETER For example, passing in a NULL
+ for the Request parameter
+ would result in this type of
+ error. The Progress parameter
+ is set to NULL.
+
+ @retval EFI_NOT_FOUND Routing data doesn't match any
+ known driver. Progress set to
+ the "G" in "GUID" of the
+ routing header that doesn't
+ match. Note: There is no
+ requirement that all routing
+ data be validated before any
+ configuration extraction.
+
+ @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set
+ to the most recent & before the
+ error, or the beginning of the
+ string.
+ @retval EFI_INVALID_PARAMETER The ExtractConfig function of the
+ underlying HII Configuration
+ Access Protocol returned
+ EFI_INVALID_PARAMETER. Progress
+ set to most recent & before the
+ error or the beginning of the
+ string.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_HII_EXTRACT_CONFIG)(
+ IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
+ IN CONST EFI_STRING Request,
+ OUT EFI_STRING *Progress,
+ OUT EFI_STRING *Results
+);
+
+/**
+ This function allows the caller to request the current configuration
+ for the entirety of the current HII database and returns the data in
+ a null-terminated string.
+
+ This function allows the caller to request the current
+ configuration for all of the current HII database. The results
+ include both the current and alternate configurations as
+ described in ExtractConfig() above.
+
+ @param This Points to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
+
+ @param Results Null-terminated Unicode string in
+ <MultiConfigAltResp> format which has all values
+ filled in for the entirety of the current HII
+ database. String to be allocated by the called
+ function. De-allocation is up to the caller.
+
+ @retval EFI_SUCCESS The Results string is filled with the
+ values corresponding to all requested
+ names.
+
+ @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
+ parts of the results that must be
+ stored awaiting possible future
+ protocols.
+
+ @retval EFI_INVALID_PARAMETERS For example, passing in a NULL
+ for the Results parameter
+ would result in this type of
+ error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_HII_EXPORT_CONFIG)(
+ IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
+ OUT EFI_STRING *Results
+);
+
+/**
+
+ This function routes the results of processing forms to the
+ appropriate targets. It scans for <ConfigHdr> within the string
+ and passes the header and subsequent body to the driver whose
+ location is described in the <ConfigHdr>. Many <ConfigHdr>s may
+ appear as a single request. The expected implementation is to
+ hand off the various <ConfigResp> substrings to the
+ Configuration Access Protocol RouteConfig routine corresponding
+ to the driver whose routing information is defined by the
+ <ConfigHdr> in turn.
+
+ @param This Points to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
+
+ @param Configuration A null-terminated string in <MulltiConfigResp> format.
+
+ @param Progress A pointer to a string filled in with the
+ offset of the most recent '&' before the
+ first failing name / value pair (or the
+ beginning of the string if the failure is in
+ the first name / value pair), or the
+ terminating NULL if all was successful.
+
+ @retval EFI_SUCCESS The results have been distributed or are
+ awaiting distribution.
+
+ @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
+ parts of the results that must be
+ stored awaiting possible future
+ protocols.
+
+ @retval EFI_INVALID_PARAMETERS Passing in a NULL for the
+ Results parameter would result
+ in this type of error.
+
+ @retval EFI_NOT_FOUND The target for the specified routing data
+ was not found.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_HII_ROUTE_CONFIG)(
+ IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
+ IN CONST EFI_STRING Configuration,
+ OUT EFI_STRING *Progress
+);
+
+
+/**
+
+ This function extracts the current configuration from a block of
+ bytes. To do so, it requires that the ConfigRequest string
+ consists of a list of <BlockName> formatted names. It uses the
+ offset in the name to determine the index into the Block to
+ start the extraction and the width of each name to determine the
+ number of bytes to extract. These are mapped to a string
+ using the equivalent of the C "%x" format (with optional leading
+ spaces). The call fails if, for any (offset, width) pair in
+ ConfigRequest, offset+value >= BlockSize.
+
+ @param This Points to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
+
+ @param ConfigRequest A null-terminated string in <ConfigRequest> format.
+
+ @param Block An array of bytes defining the block's
+ configuration.
+
+ @param BlockSize The length in bytes of Block.
+
+ @param Config The filled-in configuration string. String
+ allocated by the function. Returned only if
+ call is successful. The null-terminated string
+ will be <ConfigResp> format.
+
+ @param Progress A pointer to a string filled in with the
+ offset of the most recent '&' before the
+ first failing name / value pair (or the
+ beginning of the string if the failure is in
+ the first name / value pair), or the
+ terminating NULL if all was successful.
+
+ @retval EFI_SUCCESS The request succeeded. Progress points
+ to the null terminator at the end of the
+ ConfigRequest string.
+
+ @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate
+ Config. Progress points to the
+ first character of ConfigRequest.
+
+ @retval EFI_INVALID_PARAMETERS Passing in a NULL for the
+ ConfigRequest or Block
+ parameter would result in this
+ type of error. Progress points
+ to the first character of
+ ConfigRequest.
+
+ @retval EFI_NOT_FOUND The target for the specified routing data
+ was not found. Progress points to the
+ 'G' in "GUID" of the errant routing
+ data.
+ @retval EFI_DEVICE_ERROR The block is not large enough. Progress undefined.
+
+ @retval EFI_INVALID_PARAMETER Encountered non <BlockName>
+ formatted string. Block is
+ left updated and Progress
+ points at the '&' preceding
+ the first non-<BlockName>.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_HII_BLOCK_TO_CONFIG)(
+ IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
+ IN CONST EFI_STRING ConfigRequest,
+ IN CONST UINT8 *Block,
+ IN CONST UINTN BlockSize,
+ OUT EFI_STRING *Config,
+ OUT EFI_STRING *Progress
+);
+
+
+
+/**
+ This function maps a configuration containing a series of
+ <BlockConfig> formatted name value pairs in ConfigResp into a
+ Block so it may be stored in a linear mapped storage such as a
+ UEFI Variable. If present, the function skips GUID, NAME, and
+ PATH in <ConfigResp>. It stops when it finds a non-<BlockConfig>
+ name / value pair (after skipping the routing header) or when it
+ reaches the end of the string.
+ Example Assume an existing block containing: 00 01 02 03 04 05
+ And the ConfigResp string is:
+ OFFSET=4&WIDTH=1&VALUE=7&OFFSET=0&WIDTH=2&VALUE=AA55
+ The results are
+ 55 AA 02 07 04 05
+
+ @param This Points to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
+
+ @param ConfigResp A null-terminated string in <ConfigResp> format.
+
+ @param Block A possibly null array of bytes
+ representing the current block. Only
+ bytes referenced in the ConfigResp
+ string in the block are modified. If
+ this parameter is null or if the
+ BlockLength parameter is (on input)
+ shorter than required by the
+ Configuration string, only the BlockSize
+ parameter is updated, and an appropriate
+ status (see below) is returned.
+
+ @param BlockSize The length of the Block in units of UINT8.
+ On input, this is the size of the Block. On
+ output, if successful, contains the largest
+ index of the modified byte in the Block, or
+ the required buffer size if the Block is not
+ large enough.
+
+ @param Progress On return, points to an element of the
+ ConfigResp string filled in with the offset
+ of the most recent "&" before the first
+ failing name / value pair (or the beginning
+ of the string if the failure is in the first
+ name / value pair), or the terminating NULL
+ if all was successful.
+
+ @retval EFI_SUCCESS The request succeeded. Progress points to the null
+ terminator at the end of the ConfigResp string.
+ @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config. Progress
+ points to the first character of ConfigResp.
+ @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigResp or
+ Block parameter would result in this type of
+ error. Progress points to the first character of
+ ConfigResp.
+ @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted name /
+ value pair. Block is left updated and
+ Progress points at the '&' preceding the first
+ non-<BlockName>.
+ @retval EFI_DEVICE_ERROR Block not large enough. Progress undefined.
+ @retval EFI_NOT_FOUND Target for the specified routing data was not found.
+ Progress points to the "G" in "GUID" of the errant
+ routing data.
+ @retval EFI_BUFFER_TOO_SMALL Block not large enough. Progress undefined.
+ BlockSize is updated with the required buffer size.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_HII_CONFIG_TO_BLOCK)(
+ IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
+ IN CONST EFI_STRING ConfigResp,
+ IN OUT UINT8 *Block,
+ IN OUT UINTN *BlockSize,
+ OUT EFI_STRING *Progress
+);
+
+/**
+ This helper function is to be called by drivers to extract portions of
+ a larger configuration string.
+
+ @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
+ @param ConfigResp A null-terminated string in <ConfigAltResp> format.
+ @param Guid A pointer to the GUID value to search for in the
+ routing portion of the ConfigResp string when retrieving
+ the requested data. If Guid is NULL, then all GUID
+ values will be searched for.
+ @param Name A pointer to the NAME value to search for in the
+ routing portion of the ConfigResp string when retrieving
+ the requested data. If Name is NULL, then all Name
+ values will be searched for.
+ @param DevicePath A pointer to the PATH value to search for in the
+ routing portion of the ConfigResp string when retrieving
+ the requested data. If DevicePath is NULL, then all
+ DevicePath values will be searched for.
+ @param AltCfgId A pointer to the ALTCFG value to search for in the
+ routing portion of the ConfigResp string when retrieving
+ the requested data. If this parameter is NULL,
+ then the current setting will be retrieved.
+ @param AltCfgResp A pointer to a buffer which will be allocated by the
+ function which contains the retrieved string as requested.
+ This buffer is only allocated if the call was successful.
+ The null-terminated string will be <ConfigResp> format.
+
+ @retval EFI_SUCCESS The request succeeded. The requested data was extracted
+ and placed in the newly allocated AltCfgResp buffer.
+ @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate AltCfgResp.
+ @retval EFI_INVALID_PARAMETER Any parameter is invalid.
+ @retval EFI_NOT_FOUND The target for the specified routing data was not found.
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_HII_GET_ALT_CFG)(
+ IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
+ IN CONST EFI_STRING ConfigResp,
+ IN CONST EFI_GUID *Guid,
+ IN CONST EFI_STRING Name,
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN CONST UINT16 *AltCfgId,
+ OUT EFI_STRING *AltCfgResp
+ );
+
+///
+/// This protocol defines the configuration routing interfaces
+/// between external applications and the HII. There may only be one
+/// instance of this protocol in the system.
+///
+struct _EFI_HII_CONFIG_ROUTING_PROTOCOL {
+ EFI_HII_EXTRACT_CONFIG ExtractConfig;
+ EFI_HII_EXPORT_CONFIG ExportConfig;
+ EFI_HII_ROUTE_CONFIG RouteConfig;
+ EFI_HII_BLOCK_TO_CONFIG BlockToConfig;
+ EFI_HII_CONFIG_TO_BLOCK ConfigToBlock;
+ EFI_HII_GET_ALT_CFG GetAltConfig;
+};
+
+extern EFI_GUID gEfiHiiConfigRoutingProtocolGuid;
+
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiDatabase.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiDatabase.h
new file mode 100644
index 0000000000..435fe1be78
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiDatabase.h
@@ -0,0 +1,531 @@
+/** @file
+ The file provides Database manager for HII-related data
+ structures.
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __HII_DATABASE_H__
+#define __HII_DATABASE_H__
+
+#define EFI_HII_DATABASE_PROTOCOL_GUID \
+ { 0xef9fc172, 0xa1b2, 0x4693, { 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 } }
+
+
+typedef struct _EFI_HII_DATABASE_PROTOCOL EFI_HII_DATABASE_PROTOCOL;
+
+
+///
+/// EFI_HII_DATABASE_NOTIFY_TYPE.
+///
+typedef UINTN EFI_HII_DATABASE_NOTIFY_TYPE;
+
+#define EFI_HII_DATABASE_NOTIFY_NEW_PACK 0x00000001
+#define EFI_HII_DATABASE_NOTIFY_REMOVE_PACK 0x00000002
+#define EFI_HII_DATABASE_NOTIFY_EXPORT_PACK 0x00000004
+#define EFI_HII_DATABASE_NOTIFY_ADD_PACK 0x00000008
+/**
+
+ Functions which are registered to receive notification of
+ database events have this prototype. The actual event is encoded
+ in NotifyType. The following table describes how PackageType,
+ PackageGuid, Handle, and Package are used for each of the
+ notification types.
+
+ @param PackageType Package type of the notification.
+
+ @param PackageGuid If PackageType is
+ EFI_HII_PACKAGE_TYPE_GUID, then this is
+ the pointer to the GUID from the Guid
+ field of EFI_HII_PACKAGE_GUID_HEADER.
+ Otherwise, it must be NULL.
+
+ @param Package Points to the package referred to by the notification.
+
+ @param Handle The handle of the package
+ list which contains the specified package.
+
+ @param NotifyType The type of change concerning the
+ database. See
+ EFI_HII_DATABASE_NOTIFY_TYPE.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_NOTIFY)(
+ IN UINT8 PackageType,
+ IN CONST EFI_GUID *PackageGuid,
+ IN CONST EFI_HII_PACKAGE_HEADER *Package,
+ IN EFI_HII_HANDLE Handle,
+ IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
+);
+
+/**
+
+ This function adds the packages in the package list to the
+ database and returns a handle. If there is a
+ EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then
+ this function will create a package of type
+ EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list. For
+ each package in the package list, registered functions with the
+ notification type NEW_PACK and having the same package type will
+ be called. For each call to NewPackageList(), there should be a
+ corresponding call to
+ EFI_HII_DATABASE_PROTOCOL.RemovePackageList().
+
+ @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
+
+ @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER structure.
+
+ @param DriverHandle Associate the package list with this EFI handle.
+ If a NULL is specified, this data will not be associate
+ with any drivers and cannot have a callback induced.
+
+ @param Handle A pointer to the EFI_HII_HANDLE instance.
+
+ @retval EFI_SUCCESS The package list associated with the
+ Handle was added to the HII database.
+
+ @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary
+ resources for the new database
+ contents.
+
+ @retval EFI_INVALID_PARAMETER PackageList is NULL, or Handle is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_NEW_PACK)(
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList,
+ IN EFI_HANDLE DriverHandle, OPTIONAL
+ OUT EFI_HII_HANDLE *Handle
+);
+
+
+/**
+
+ This function removes the package list that is associated with a
+ handle Handle from the HII database. Before removing the
+ package, any registered functions with the notification type
+ REMOVE_PACK and the same package type will be called. For each
+ call to EFI_HII_DATABASE_PROTOCOL.NewPackageList(), there should
+ be a corresponding call to RemovePackageList.
+
+ @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
+
+ @param Handle The handle that was registered to the data
+ that is requested for removal.
+
+ @retval EFI_SUCCESS The data associated with the Handle was
+ removed from the HII database.
+ @retval EFI_NOT_FOUND The specified Handle is not in database.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_REMOVE_PACK)(
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle
+);
+
+
+/**
+
+ This function updates the existing package list (which has the
+ specified Handle) in the HII databases, using the new package
+ list specified by PackageList. The update process has the
+ following steps: Collect all the package types in the package
+ list specified by PackageList. A package type consists of the
+ Type field of EFI_HII_PACKAGE_HEADER and, if the Type is
+ EFI_HII_PACKAGE_TYPE_GUID, the Guid field, as defined in
+ EFI_HII_PACKAGE_GUID_HEADER. Iterate through the packages within
+ the existing package list in the HII database specified by
+ Handle. If a package's type matches one of the collected types collected
+ in step 1, then perform the following steps:
+ - Call any functions registered with the notification type
+ REMOVE_PACK.
+ - Remove the package from the package list and the HII
+ database.
+ Add all of the packages within the new package list specified
+ by PackageList, using the following steps:
+ - Add the package to the package list and the HII database.
+ - Call any functions registered with the notification type
+ ADD_PACK.
+
+ @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
+
+ @param Handle The handle that was registered to the data
+ that is requested for removal.
+
+ @param PackageList A pointer to an EFI_HII_PACKAGE_LIST
+ package.
+
+ @retval EFI_SUCCESS The HII database was successfully updated.
+
+ @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory
+ for the updated database.
+
+ @retval EFI_INVALID_PARAMETER PackageList was NULL.
+ @retval EFI_NOT_FOUND The specified Handle is not in database.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_UPDATE_PACK)(
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList
+);
+
+
+/**
+
+ This function returns a list of the package handles of the
+ specified type that are currently active in the database. The
+ pseudo-type EFI_HII_PACKAGE_TYPE_ALL will cause all package
+ handles to be listed.
+
+ @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
+
+ @param PackageType Specifies the package type of the packages
+ to list or EFI_HII_PACKAGE_TYPE_ALL for
+ all packages to be listed.
+
+ @param PackageGuid If PackageType is
+ EFI_HII_PACKAGE_TYPE_GUID, then this is
+ the pointer to the GUID which must match
+ the Guid field of
+ EFI_HII_PACKAGE_GUID_HEADER. Otherwise, it
+ must be NULL.
+
+ @param HandleBufferLength On input, a pointer to the length
+ of the handle buffer. On output,
+ the length of the handle buffer
+ that is required for the handles found.
+
+ @param Handle An array of EFI_HII_HANDLE instances returned.
+
+ @retval EFI_SUCCESS The matching handles are outputted successfully.
+ HandleBufferLength is updated with the actual length.
+ @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter
+ indicates that Handle is too
+ small to support the number of
+ handles. HandleBufferLength is
+ updated with a value that will
+ enable the data to fit.
+ @retval EFI_NOT_FOUND No matching handle could be found in database.
+ @retval EFI_INVALID_PARAMETER HandleBufferLength was NULL.
+ @retval EFI_INVALID_PARAMETER The value referenced by HandleBufferLength was not
+ zero and Handle was NULL.
+ @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but
+ PackageGuid is not NULL, PackageType is a EFI_HII_
+ PACKAGE_TYPE_GUID but PackageGuid is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_LIST_PACKS)(
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN UINT8 PackageType,
+ IN CONST EFI_GUID *PackageGuid,
+ IN OUT UINTN *HandleBufferLength,
+ OUT EFI_HII_HANDLE *Handle
+);
+
+/**
+
+ This function will export one or all package lists in the
+ database to a buffer. For each package list exported, this
+ function will call functions registered with EXPORT_PACK and
+ then copy the package list to the buffer. The registered
+ functions may call EFI_HII_DATABASE_PROTOCOL.UpdatePackageList()
+ to modify the package list before it is copied to the buffer. If
+ the specified BufferSize is too small, then the status
+ EFI_OUT_OF_RESOURCES will be returned and the actual package
+ size will be returned in BufferSize.
+
+ @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
+
+
+ @param Handle An EFI_HII_HANDLE that corresponds to the
+ desired package list in the HII database to
+ export or NULL to indicate all package lists
+ should be exported.
+
+ @param BufferSize On input, a pointer to the length of the
+ buffer. On output, the length of the
+ buffer that is required for the exported
+ data.
+
+ @param Buffer A pointer to a buffer that will contain the
+ results of the export function.
+
+
+ @retval EFI_SUCCESS Package exported.
+
+ @retval EFI_OUT_OF_RESOURCES BufferSize is too small to hold the package.
+
+ @retval EFI_NOT_FOUND The specified Handle could not be found in the
+ current database.
+
+ @retval EFI_INVALID_PARAMETER BufferSize was NULL.
+
+ @retval EFI_INVALID_PARAMETER The value referenced by BufferSize was not zero
+ and Buffer was NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_EXPORT_PACKS)(
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN OUT UINTN *BufferSize,
+ OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer
+);
+
+
+/**
+
+
+ This function registers a function which will be called when
+ specified actions related to packages of the specified type
+ occur in the HII database. By registering a function, other
+ HII-related drivers are notified when specific package types
+ are added, removed or updated in the HII database. Each driver
+ or application which registers a notification should use
+ EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before
+ exiting.
+
+
+ @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
+
+ @param PackageType The package type. See
+ EFI_HII_PACKAGE_TYPE_x in EFI_HII_PACKAGE_HEADER.
+
+ @param PackageGuid If PackageType is
+ EFI_HII_PACKAGE_TYPE_GUID, then this is
+ the pointer to the GUID which must match
+ the Guid field of
+ EFI_HII_PACKAGE_GUID_HEADER. Otherwise, it
+ must be NULL.
+
+ @param PackageNotifyFn Points to the function to be called
+ when the event specified by
+ NotificationType occurs. See
+ EFI_HII_DATABASE_NOTIFY.
+
+ @param NotifyType Describes the types of notification which
+ this function will be receiving. See
+ EFI_HII_DATABASE_NOTIFY_TYPE for a
+ list of types.
+
+ @param NotifyHandle Points to the unique handle assigned to
+ the registered notification. Can be used
+ in EFI_HII_DATABASE_PROTOCOL.UnregisterPack
+ to stop notifications.
+
+
+ @retval EFI_SUCCESS Notification registered successfully.
+
+ @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary
+ data structures.
+
+ @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when
+ PackageType is not
+ EFI_HII_PACKAGE_TYPE_GUID.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_REGISTER_NOTIFY)(
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN UINT8 PackageType,
+ IN CONST EFI_GUID *PackageGuid,
+ IN EFI_HII_DATABASE_NOTIFY PackageNotifyFn,
+ IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType,
+ OUT EFI_HANDLE *NotifyHandle
+);
+
+
+/**
+
+ Removes the specified HII database package-related notification.
+
+ @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
+
+ @param NotificationHandle The handle of the notification
+ function being unregistered.
+
+ @retval EFI_SUCCESS Successsfully unregistered the notification.
+
+ @retval EFI_NOT_FOUND The incoming notification handle does not exist
+ in the current hii database.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_UNREGISTER_NOTIFY)(
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN EFI_HANDLE NotificationHandle
+);
+
+
+/**
+
+ This routine retrieves an array of GUID values for each keyboard
+ layout that was previously registered in the system.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+
+ @param KeyGuidBufferLength On input, a pointer to the length
+ of the keyboard GUID buffer. On
+ output, the length of the handle
+ buffer that is required for the
+ handles found.
+
+ @param KeyGuidBuffer An array of keyboard layout GUID
+ instances returned.
+
+ @retval EFI_SUCCESS KeyGuidBuffer was updated successfully.
+
+ @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength
+ parameter indicates that
+ KeyGuidBuffer is too small to
+ support the number of GUIDs.
+ KeyGuidBufferLength is updated
+ with a value that will enable
+ the data to fit.
+ @retval EFI_INVALID_PARAMETER The KeyGuidBufferLength is NULL.
+ @retval EFI_INVALID_PARAMETER The value referenced by
+ KeyGuidBufferLength is not
+ zero and KeyGuidBuffer is NULL.
+ @retval EFI_NOT_FOUND There was no keyboard layout.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_FIND_KEYBOARD_LAYOUTS)(
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN OUT UINT16 *KeyGuidBufferLength,
+ OUT EFI_GUID *KeyGuidBuffer
+);
+
+
+/**
+
+ This routine retrieves the requested keyboard layout. The layout
+ is a physical description of the keys on a keyboard, and the
+ character(s) that are associated with a particular set of key
+ strokes.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+
+ @param KeyGuid A pointer to the unique ID associated with a
+ given keyboard layout. If KeyGuid is NULL then
+ the current layout will be retrieved.
+
+ @param KeyboardLayoutLength On input, a pointer to the length of the
+ KeyboardLayout buffer. On output, the length of
+ the data placed into KeyboardLayout.
+
+ @param KeyboardLayout A pointer to a buffer containing the
+ retrieved keyboard layout.
+
+ @retval EFI_SUCCESS The keyboard layout was retrieved
+ successfully.
+
+ @retval EFI_NOT_FOUND The requested keyboard layout was not found.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT)(
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN CONST EFI_GUID *KeyGuid,
+ IN OUT UINT16 *KeyboardLayoutLength,
+ OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout
+);
+
+/**
+
+ This routine sets the default keyboard layout to the one
+ referenced by KeyGuid. When this routine is called, an event
+ will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID
+ group type. This is so that agents which are sensitive to the
+ current keyboard layout being changed can be notified of this
+ change.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+
+ @param KeyGuid A pointer to the unique ID associated with a
+ given keyboard layout.
+
+ @retval EFI_SUCCESS The current keyboard layout was successfully set.
+
+ @retval EFI_NOT_FOUND The referenced keyboard layout was not
+ found, so action was taken.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_SET_KEYBOARD_LAYOUT)(
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN CONST EFI_GUID *KeyGuid
+);
+
+/**
+
+ Return the EFI handle associated with a package list.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+
+ @param PackageListHandle An EFI_HII_HANDLE that corresponds
+ to the desired package list in the
+ HIIdatabase.
+
+ @param DriverHandle On return, contains the EFI_HANDLE which
+ was registered with the package list in
+ NewPackageList().
+
+ @retval EFI_SUCCESS The DriverHandle was returned successfully.
+
+ @retval EFI_INVALID_PARAMETER The PackageListHandle was not valid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_GET_PACK_HANDLE)(
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageListHandle,
+ OUT EFI_HANDLE *DriverHandle
+);
+
+///
+/// Database manager for HII-related data structures.
+///
+struct _EFI_HII_DATABASE_PROTOCOL {
+ EFI_HII_DATABASE_NEW_PACK NewPackageList;
+ EFI_HII_DATABASE_REMOVE_PACK RemovePackageList;
+ EFI_HII_DATABASE_UPDATE_PACK UpdatePackageList;
+ EFI_HII_DATABASE_LIST_PACKS ListPackageLists;
+ EFI_HII_DATABASE_EXPORT_PACKS ExportPackageLists;
+ EFI_HII_DATABASE_REGISTER_NOTIFY RegisterPackageNotify;
+ EFI_HII_DATABASE_UNREGISTER_NOTIFY UnregisterPackageNotify;
+ EFI_HII_FIND_KEYBOARD_LAYOUTS FindKeyboardLayouts;
+ EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;
+ EFI_HII_SET_KEYBOARD_LAYOUT SetKeyboardLayout;
+ EFI_HII_DATABASE_GET_PACK_HANDLE GetPackageListHandle;
+};
+
+extern EFI_GUID gEfiHiiDatabaseProtocolGuid;
+
+#endif
+
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiFont.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiFont.h
new file mode 100644
index 0000000000..b940734496
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiFont.h
@@ -0,0 +1,472 @@
+/** @file
+ The file provides services to retrieve font information.
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __HII_FONT_H__
+#define __HII_FONT_H__
+
+#include <Protocol/GraphicsOutput.h>
+#include <Protocol/HiiImage.h>
+
+#define EFI_HII_FONT_PROTOCOL_GUID \
+{ 0xe9ca4775, 0x8657, 0x47fc, { 0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24 } }
+
+typedef struct _EFI_HII_FONT_PROTOCOL EFI_HII_FONT_PROTOCOL;
+
+typedef VOID *EFI_FONT_HANDLE;
+
+///
+/// EFI_HII_OUT_FLAGS.
+///
+typedef UINT32 EFI_HII_OUT_FLAGS;
+
+#define EFI_HII_OUT_FLAG_CLIP 0x00000001
+#define EFI_HII_OUT_FLAG_WRAP 0x00000002
+#define EFI_HII_OUT_FLAG_CLIP_CLEAN_Y 0x00000004
+#define EFI_HII_OUT_FLAG_CLIP_CLEAN_X 0x00000008
+#define EFI_HII_OUT_FLAG_TRANSPARENT 0x00000010
+#define EFI_HII_IGNORE_IF_NO_GLYPH 0x00000020
+#define EFI_HII_IGNORE_LINE_BREAK 0x00000040
+#define EFI_HII_DIRECT_TO_SCREEN 0x00000080
+
+/**
+ Definition of EFI_HII_ROW_INFO.
+**/
+typedef struct _EFI_HII_ROW_INFO {
+ ///
+ /// The index of the first character in the string which is displayed on the line.
+ ///
+ UINTN StartIndex;
+ ///
+ /// The index of the last character in the string which is displayed on the line.
+ /// If this is the same as StartIndex, then no characters are displayed.
+ ///
+ UINTN EndIndex;
+ UINTN LineHeight; ///< The height of the line, in pixels.
+ UINTN LineWidth; ///< The width of the text on the line, in pixels.
+
+ ///
+ /// The font baseline offset in pixels from the bottom of the row, or 0 if none.
+ ///
+ UINTN BaselineOffset;
+} EFI_HII_ROW_INFO;
+
+///
+/// Font info flag. All flags (FONT, SIZE, STYLE, and COLOR) are defined.
+/// They are defined as EFI_FONT_INFO_***
+///
+typedef UINT32 EFI_FONT_INFO_MASK;
+
+#define EFI_FONT_INFO_SYS_FONT 0x00000001
+#define EFI_FONT_INFO_SYS_SIZE 0x00000002
+#define EFI_FONT_INFO_SYS_STYLE 0x00000004
+#define EFI_FONT_INFO_SYS_FORE_COLOR 0x00000010
+#define EFI_FONT_INFO_SYS_BACK_COLOR 0x00000020
+#define EFI_FONT_INFO_RESIZE 0x00001000
+#define EFI_FONT_INFO_RESTYLE 0x00002000
+#define EFI_FONT_INFO_ANY_FONT 0x00010000
+#define EFI_FONT_INFO_ANY_SIZE 0x00020000
+#define EFI_FONT_INFO_ANY_STYLE 0x00040000
+
+//
+// EFI_FONT_INFO
+//
+typedef struct {
+ EFI_HII_FONT_STYLE FontStyle;
+ UINT16 FontSize; ///< character cell height in pixels
+ CHAR16 FontName[1];
+} EFI_FONT_INFO;
+
+/**
+ Describes font output-related information.
+
+ This structure is used for describing the way in which a string
+ should be rendered in a particular font. FontInfo specifies the
+ basic font information and ForegroundColor and BackgroundColor
+ specify the color in which they should be displayed. The flags
+ in FontInfoMask describe where the system default should be
+ supplied instead of the specified information. The flags also
+ describe what options can be used to make a match between the
+ font requested and the font available.
+**/
+typedef struct _EFI_FONT_DISPLAY_INFO {
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL ForegroundColor;
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL BackgroundColor;
+ EFI_FONT_INFO_MASK FontInfoMask;
+ EFI_FONT_INFO FontInfo;
+} EFI_FONT_DISPLAY_INFO;
+
+/**
+
+ This function renders a string to a bitmap or the screen using
+ the specified font, color and options. It either draws the
+ string and glyphs on an existing bitmap, allocates a new bitmap,
+ or uses the screen. The strings can be clipped or wrapped.
+ Optionally, the function also returns the information about each
+ row and the character position on that row. If
+ EFI_HII_OUT_FLAG_CLIP is set, then text will be formatted only
+ based on explicit line breaks and all pixels which would lie
+ outside the bounding box specified by Width and Height are
+ ignored. The information in the RowInfoArray only describes
+ characters which are at least partially displayed. For the final
+ row, the LineHeight and BaseLine may describe pixels that are
+ outside the limit specified by Height (unless
+ EFI_HII_OUT_FLAG_CLIP_CLEAN_Y is specified) even though those
+ pixels were not drawn. The LineWidth may describe pixels which
+ are outside the limit specified by Width (unless
+ EFI_HII_OUT_FLAG_CLIP_CLEAN_X is specified) even though those
+ pixels were not drawn. If EFI_HII_OUT_FLAG_CLIP_CLEAN_X is set,
+ then it modifies the behavior of EFI_HII_OUT_FLAG_CLIP so that
+ if a character's right-most on pixel cannot fit, then it will
+ not be drawn at all. This flag requires that
+ EFI_HII_OUT_FLAG_CLIP be set. If EFI_HII_OUT_FLAG_CLIP_CLEAN_Y
+ is set, then it modifies the behavior of EFI_HII_OUT_FLAG_CLIP
+ so that if a row's bottom-most pixel cannot fit, then it will
+ not be drawn at all. This flag requires that
+ EFI_HII_OUT_FLAG_CLIP be set. If EFI_HII_OUT_FLAG_WRAP is set,
+ then text will be wrapped at the right-most line-break
+ opportunity prior to a character whose right-most extent would
+ exceed Width. If no line-break opportunity can be found, then
+ the text will behave as if EFI_HII_OUT_FLAG_CLIP_CLEAN_X is set.
+ This flag cannot be used with EFI_HII_OUT_FLAG_CLIP_CLEAN_X. If
+ EFI_HII_OUT_FLAG_TRANSPARENT is set, then BackgroundColor is
+ ignored and all 'off' pixels in the character's drawn
+ will use the pixel value from Blt. This flag cannot be used if
+ Blt is NULL upon entry. If EFI_HII_IGNORE_IF_NO_GLYPH is set,
+ then characters which have no glyphs are not drawn. Otherwise,
+ they are replaced with Unicode character code 0xFFFD (REPLACEMENT
+ CHARACTER). If EFI_HII_IGNORE_LINE_BREAK is set, then explicit
+ line break characters will be ignored. If
+ EFI_HII_DIRECT_TO_SCREEN is set, then the string will be written
+ directly to the output device specified by Screen. Otherwise the
+ string will be rendered to the bitmap specified by Bitmap.
+
+ @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
+
+ @param Flags Describes how the string is to be drawn.
+
+ @param String Points to the null-terminated string to be
+
+ @param StringInfo Points to the string output information,
+ including the color and font. If NULL, then
+ the string will be output in the default
+ system font and color.
+
+ @param Blt If this points to a non-NULL on entry, this points
+ to the image, which is Width pixels wide and
+ Height pixels high. The string will be drawn onto
+ this image and EFI_HII_OUT_FLAG_CLIP is implied.
+ If this points to a NULL on entry, then a buffer
+ will be allocated to hold the generated image and
+ the pointer updated on exit. It is the caller's
+ responsibility to free this buffer.
+
+ @param BltX, BltY Specifies the offset from the left and top
+ edge of the image of the first character
+ cell in the image.
+
+ @param RowInfoArray If this is non-NULL on entry, then on
+ exit, this will point to an allocated buffer
+ containing row information and
+ RowInfoArraySize will be updated to contain
+ the number of elements. This array describes
+ the characters that were at least partially
+ drawn and the heights of the rows. It is the
+ caller's responsibility to free this buffer.
+
+ @param RowInfoArraySize If this is non-NULL on entry, then on
+ exit it contains the number of
+ elements in RowInfoArray.
+
+ @param ColumnInfoArray If this is non-NULL, then on return it
+ will be filled with the horizontal
+ offset for each character in the
+ string on the row where it is
+ displayed. Non-printing characters
+ will have the offset ~0. The caller is
+ responsible for allocating a buffer large
+ enough so that there is one entry for
+ each character in the string, not
+ including the null-terminator. It is
+ possible when character display is
+ normalized that some character cells
+ overlap.
+
+ @retval EFI_SUCCESS The string was successfully updated.
+
+ @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for RowInfoArray or Blt.
+
+ @retval EFI_INVALID_PARAMETER The String or Blt was NULL.
+
+ @retval EFI_INVALID_PARAMETER Flags were invalid combination.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_STRING_TO_IMAGE)(
+ IN CONST EFI_HII_FONT_PROTOCOL *This,
+ IN EFI_HII_OUT_FLAGS Flags,
+ IN CONST EFI_STRING String,
+ IN CONST EFI_FONT_DISPLAY_INFO *StringInfo,
+ IN OUT EFI_IMAGE_OUTPUT **Blt,
+ IN UINTN BltX,
+ IN UINTN BltY,
+ OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,
+ OUT UINTN *RowInfoArraySize OPTIONAL,
+ OUT UINTN *ColumnInfoArray OPTIONAL
+);
+
+
+
+/**
+
+ This function renders a string as a bitmap or to the screen
+ and can clip or wrap the string. The bitmap is either supplied
+ by the caller or allocated by the function. The
+ strings are drawn with the font, size and style specified and
+ can be drawn transparently or opaquely. The function can also
+ return information about each row and each character's
+ position on the row. If EFI_HII_OUT_FLAG_CLIP is set, then
+ text will be formatted based only on explicit line breaks, and
+ all pixels that would lie outside the bounding box specified
+ by Width and Height are ignored. The information in the
+ RowInfoArray only describes characters which are at least
+ partially displayed. For the final row, the LineHeight and
+ BaseLine may describe pixels which are outside the limit
+ specified by Height (unless EFI_HII_OUT_FLAG_CLIP_CLEAN_Y is
+ specified) even though those pixels were not drawn. If
+ EFI_HII_OUT_FLAG_CLIP_CLEAN_X is set, then it modifies the
+ behavior of EFI_HII_OUT_FLAG_CLIP so that if a character's
+ right-most on pixel cannot fit, then it will not be drawn at
+ all. This flag requires that EFI_HII_OUT_FLAG_CLIP be set. If
+ EFI_HII_OUT_FLAG_CLIP_CLEAN_Y is set, then it modifies the
+ behavior of EFI_HII_OUT_FLAG_CLIP so that if a row's bottom
+ most pixel cannot fit, then it will not be drawn at all. This
+ flag requires that EFI_HII_OUT_FLAG_CLIP be set. If
+ EFI_HII_OUT_FLAG_WRAP is set, then text will be wrapped at the
+ right-most line-break opportunity prior to a character whose
+ right-most extent would exceed Width. If no line-break
+ opportunity can be found, then the text will behave as if
+ EFI_HII_OUT_FLAG_CLIP_CLEAN_X is set. This flag cannot be used
+ with EFI_HII_OUT_FLAG_CLIP_CLEAN_X. If
+ EFI_HII_OUT_FLAG_TRANSPARENT is set, then BackgroundColor is
+ ignored and all off" pixels in the character's glyph will
+ use the pixel value from Blt. This flag cannot be used if Blt
+ is NULL upon entry. If EFI_HII_IGNORE_IF_NO_GLYPH is set, then
+ characters which have no glyphs are not drawn. Otherwise, they
+ are replaced with Unicode character code 0xFFFD (REPLACEMENT
+ CHARACTER). If EFI_HII_IGNORE_LINE_BREAK is set, then explicit
+ line break characters will be ignored. If
+ EFI_HII_DIRECT_TO_SCREEN is set, then the string will be
+ written directly to the output device specified by Screen.
+ Otherwise the string will be rendered to the bitmap specified
+ by Bitmap.
+
+
+ @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
+
+ @param Flags Describes how the string is to be drawn.
+
+ @param PackageList
+ The package list in the HII database to
+ search for the specified string.
+
+ @param StringId The string's id, which is unique within
+ PackageList.
+
+ @param Language Points to the language for the retrieved
+ string. If NULL, then the current system
+ language is used.
+
+ @param StringInfo Points to the string output information,
+ including the color and font. If NULL, then
+ the string will be output in the default
+ system font and color.
+
+ @param Blt If this points to a non-NULL on entry, this points
+ to the image, which is Width pixels wide and
+ Height pixels high. The string will be drawn onto
+ this image and EFI_HII_OUT_FLAG_CLIP is implied.
+ If this points to a NULL on entry, then a buffer
+ will be allocated to hold the generated image and
+ the pointer updated on exit. It is the caller's
+ responsibility to free this buffer.
+
+ @param BltX, BltY Specifies the offset from the left and top
+ edge of the output image of the first
+ character cell in the image.
+
+ @param RowInfoArray If this is non-NULL on entry, then on
+ exit, this will point to an allocated
+ buffer containing row information and
+ RowInfoArraySize will be updated to
+ contain the number of elements. This array
+ describes the characters which were at
+ least partially drawn and the heights of
+ the rows. It is the caller's
+ responsibility to free this buffer.
+
+ @param RowInfoArraySize If this is non-NULL on entry, then on
+ exit it contains the number of
+ elements in RowInfoArray.
+
+ @param ColumnInfoArray If non-NULL, on return it is filled
+ with the horizontal offset for each
+ character in the string on the row
+ where it is displayed. Non-printing
+ characters will have the offset ~0.
+ The caller is responsible to allocate
+ a buffer large enough so that there is
+ one entry for each character in the
+ string, not including the
+ null-terminator. It is possible when
+ character display is normalized that
+ some character cells overlap.
+
+
+ @retval EFI_SUCCESS The string was successfully updated.
+
+ @retval EFI_OUT_OF_RESOURCES Unable to allocate an output
+ buffer for RowInfoArray or Blt.
+
+ @retval EFI_INVALID_PARAMETER The String, or Blt, or Height, or
+ Width was NULL.
+ @retval EFI_INVALID_PARAMETER The Blt or PackageList was NULL.
+ @retval EFI_INVALID_PARAMETER Flags were invalid combination.
+ @retval EFI_NOT_FOUND The specified PackageList is not in the Database,
+ or the stringid is not in the specified PackageList.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_STRING_ID_TO_IMAGE)(
+ IN CONST EFI_HII_FONT_PROTOCOL *This,
+ IN EFI_HII_OUT_FLAGS Flags,
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_STRING_ID StringId,
+ IN CONST CHAR8 *Language,
+ IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL,
+ IN OUT EFI_IMAGE_OUTPUT **Blt,
+ IN UINTN BltX,
+ IN UINTN BltY,
+ OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,
+ OUT UINTN *RowInfoArraySize OPTIONAL,
+ OUT UINTN *ColumnInfoArray OPTIONAL
+);
+
+
+/**
+
+ Convert the glyph for a single character into a bitmap.
+
+ @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
+
+ @param Char The character to retrieve.
+
+ @param StringInfo Points to the string font and color
+ information or NULL if the string should use
+ the default system font and color.
+
+ @param Blt This must point to a NULL on entry. A buffer will
+ be allocated to hold the output and the pointer
+ updated on exit. It is the caller's responsibility
+ to free this buffer.
+
+ @param Baseline The number of pixels from the bottom of the bitmap
+ to the baseline.
+
+
+ @retval EFI_SUCCESS The glyph bitmap created.
+
+ @retval EFI_OUT_OF_RESOURCES Unable to allocate the output buffer Blt.
+
+ @retval EFI_WARN_UNKNOWN_GLYPH The glyph was unknown and was
+ replaced with the glyph for
+ Unicode character code 0xFFFD.
+
+ @retval EFI_INVALID_PARAMETER Blt is NULL, or Width is NULL, or
+ Height is NULL
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_GLYPH)(
+ IN CONST EFI_HII_FONT_PROTOCOL *This,
+ IN CONST CHAR16 Char,
+ IN CONST EFI_FONT_DISPLAY_INFO *StringInfo,
+ OUT EFI_IMAGE_OUTPUT **Blt,
+ OUT UINTN *Baseline OPTIONAL
+);
+
+/**
+
+ This function iterates through fonts which match the specified
+ font, using the specified criteria. If String is non-NULL, then
+ all of the characters in the string must exist in order for a
+ candidate font to be returned.
+
+ @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
+
+ @param FontHandle On entry, points to the font handle returned
+ by a previous call to GetFontInfo() or NULL
+ to start with the first font. On return,
+ points to the returned font handle or points
+ to NULL if there are no more matching fonts.
+
+ @param StringInfoIn Upon entry, points to the font to return
+ information about. If NULL, then the information
+ about the system default font will be returned.
+
+ @param StringInfoOut Upon return, contains the matching font's information.
+ If NULL, then no information is returned. This buffer
+ is allocated with a call to the Boot Service AllocatePool().
+ It is the caller's responsibility to call the Boot
+ Service FreePool() when the caller no longer requires
+ the contents of StringInfoOut.
+
+ @param String Points to the string which will be tested to
+ determine if all characters are available. If
+ NULL, then any font is acceptable.
+
+ @retval EFI_SUCCESS Matching font returned successfully.
+
+ @retval EFI_NOT_FOUND No matching font was found.
+
+ @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_FONT_INFO)(
+ IN CONST EFI_HII_FONT_PROTOCOL *This,
+ IN OUT EFI_FONT_HANDLE *FontHandle,
+ IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, OPTIONAL
+ OUT EFI_FONT_DISPLAY_INFO **StringInfoOut,
+ IN CONST EFI_STRING String OPTIONAL
+);
+
+///
+/// The protocol provides the service to retrieve the font informations.
+///
+struct _EFI_HII_FONT_PROTOCOL {
+ EFI_HII_STRING_TO_IMAGE StringToImage;
+ EFI_HII_STRING_ID_TO_IMAGE StringIdToImage;
+ EFI_HII_GET_GLYPH GetGlyph;
+ EFI_HII_GET_FONT_INFO GetFontInfo;
+};
+
+extern EFI_GUID gEfiHiiFontProtocolGuid;
+
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiImage.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiImage.h
new file mode 100644
index 0000000000..3407532ea2
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiImage.h
@@ -0,0 +1,356 @@
+/** @file
+ The file provides services to access to images in the images database.
+
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __HII_IMAGE_H__
+#define __HII_IMAGE_H__
+
+#include <Protocol/GraphicsOutput.h>
+
+#define EFI_HII_IMAGE_PROTOCOL_GUID \
+ { 0x31a6406a, 0x6bdf, 0x4e46, { 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } }
+
+typedef struct _EFI_HII_IMAGE_PROTOCOL EFI_HII_IMAGE_PROTOCOL;
+
+
+///
+/// Flags in EFI_IMAGE_INPUT
+///
+#define EFI_IMAGE_TRANSPARENT 0x00000001
+
+/**
+
+ Definition of EFI_IMAGE_INPUT.
+
+ @param Flags Describe image characteristics. If
+ EFI_IMAGE_TRANSPARENT is set, then the image was
+ designed for transparent display.
+
+ @param Width Image width, in pixels.
+
+ @param Height Image height, in pixels.
+
+ @param Bitmap A pointer to the actual bitmap, organized left-to-right,
+ top-to-bottom. The size of the bitmap is
+ Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL).
+
+
+**/
+typedef struct _EFI_IMAGE_INPUT {
+ UINT32 Flags;
+ UINT16 Width;
+ UINT16 Height;
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap;
+} EFI_IMAGE_INPUT;
+
+
+/**
+
+ This function adds the image Image to the group of images
+ owned by PackageList, and returns a new image identifier
+ (ImageId).
+
+ @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
+
+ @param PackageList Handle of the package list where this image will be added.
+
+ @param ImageId On return, contains the new image id, which is
+ unique within PackageList.
+
+ @param Image Points to the image.
+
+ @retval EFI_SUCCESS The new image was added
+ successfully
+
+ @retval EFI_OUT_OF_RESOURCES Could not add the image.
+
+ @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is
+ NULL.
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_NEW_IMAGE)(
+ IN CONST EFI_HII_IMAGE_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ OUT EFI_IMAGE_ID *ImageId,
+ IN CONST EFI_IMAGE_INPUT *Image
+);
+
+/**
+
+ This function retrieves the image specified by ImageId which
+ is associated with the specified PackageList and copies it
+ into the buffer specified by Image. If the image specified by
+ ImageId is not present in the specified PackageList, then
+ EFI_NOT_FOUND is returned. If the buffer specified by
+ ImageSize is too small to hold the image, then
+ EFI_BUFFER_TOO_SMALL will be returned. ImageSize will be
+ updated to the size of buffer actually required to hold the
+ image.
+
+ @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
+
+ @param PackageList The package list in the HII database to
+ search for the specified image.
+
+ @param ImageId The image's id, which is unique within
+ PackageList.
+
+ @param Image Points to the new image.
+
+ @retval EFI_SUCCESS The image was returned successfully.
+
+ @retval EFI_NOT_FOUND The image specified by ImageId is not
+ available. Or The specified PackageList is not in the database.
+
+ @retval EFI_INVALID_PARAMETER The Image or Langugae was NULL.
+ @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not
+ enough memory.
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_IMAGE)(
+ IN CONST EFI_HII_IMAGE_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_IMAGE_ID ImageId,
+ OUT EFI_IMAGE_INPUT *Image
+);
+
+/**
+
+ This function updates the image specified by ImageId in the
+ specified PackageListHandle to the image specified by Image.
+
+
+ @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
+
+ @param PackageList The package list containing the images.
+
+ @param ImageId The image id, which is unique within PackageList.
+
+ @param Image Points to the image.
+
+ @retval EFI_SUCCESS The image was successfully updated.
+
+ @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.
+ The specified PackageList is not in the database.
+
+ @retval EFI_INVALID_PARAMETER The Image or Language was NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_SET_IMAGE)(
+ IN CONST EFI_HII_IMAGE_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_IMAGE_ID ImageId,
+ IN CONST EFI_IMAGE_INPUT *Image
+);
+
+
+///
+/// EFI_HII_DRAW_FLAGS describes how the image is to be drawn.
+/// These flags are defined as EFI_HII_DRAW_FLAG_***
+///
+typedef UINT32 EFI_HII_DRAW_FLAGS;
+
+#define EFI_HII_DRAW_FLAG_CLIP 0x00000001
+#define EFI_HII_DRAW_FLAG_TRANSPARENT 0x00000030
+#define EFI_HII_DRAW_FLAG_DEFAULT 0x00000000
+#define EFI_HII_DRAW_FLAG_FORCE_TRANS 0x00000010
+#define EFI_HII_DRAW_FLAG_FORCE_OPAQUE 0x00000020
+#define EFI_HII_DIRECT_TO_SCREEN 0x00000080
+
+/**
+
+ Definition of EFI_IMAGE_OUTPUT.
+
+ @param Width Width of the output image.
+
+ @param Height Height of the output image.
+
+ @param Bitmap Points to the output bitmap.
+
+ @param Screen Points to the EFI_GRAPHICS_OUTPUT_PROTOCOL which
+ describes the screen on which to draw the
+ specified image.
+
+**/
+typedef struct _EFI_IMAGE_OUTPUT {
+ UINT16 Width;
+ UINT16 Height;
+ union {
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap;
+ EFI_GRAPHICS_OUTPUT_PROTOCOL *Screen;
+ } Image;
+} EFI_IMAGE_OUTPUT;
+
+
+/**
+
+ This function renders an image to a bitmap or the screen using
+ the specified color and options. It draws the image on an
+ existing bitmap, allocates a new bitmap or uses the screen. The
+ images can be clipped. If EFI_HII_DRAW_FLAG_CLIP is set, then
+ all pixels drawn outside the bounding box specified by Width and
+ Height are ignored. If EFI_HII_DRAW_FLAG_TRANSPARENT is set,
+ then all 'off' pixels in the images drawn will use the
+ pixel value from Blt. This flag cannot be used if Blt is NULL
+ upon entry. If EFI_HII_DIRECT_TO_SCREEN is set, then the image
+ will be written directly to the output device specified by
+ Screen. Otherwise the image will be rendered to the bitmap
+ specified by Bitmap.
+
+
+ @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
+
+ @param Flags Describes how the image is to be drawn.
+ EFI_HII_DRAW_FLAGS is defined in Related
+ Definitions, below.
+
+ @param Image Points to the image to be displayed.
+
+ @param Blt If this points to a non-NULL on entry, this points
+ to the image, which is Width pixels wide and
+ Height pixels high. The image will be drawn onto
+ this image and EFI_HII_DRAW_FLAG_CLIP is implied.
+ If this points to a NULL on entry, then a buffer
+ will be allocated to hold the generated image and
+ the pointer updated on exit. It is the caller's
+ responsibility to free this buffer.
+
+ @param BltX, BltY Specifies the offset from the left and top
+ edge of the image of the first pixel in
+ the image.
+
+ @retval EFI_SUCCESS The image was successfully updated.
+
+ @retval EFI_OUT_OF_RESOURCES Unable to allocate an output
+ buffer for RowInfoArray or Blt.
+
+ @retval EFI_INVALID_PARAMETER The Image or Blt or Height or
+ Width was NULL.
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_DRAW_IMAGE)(
+ IN CONST EFI_HII_IMAGE_PROTOCOL *This,
+ IN EFI_HII_DRAW_FLAGS Flags,
+ IN CONST EFI_IMAGE_INPUT *Image,
+ IN OUT EFI_IMAGE_OUTPUT **Blt,
+ IN UINTN BltX,
+ IN UINTN BltY
+);
+
+/**
+
+ This function renders an image as a bitmap or to the screen and
+ can clip the image. The bitmap is either supplied by the caller
+ or else is allocated by the function. The images can be drawn
+ transparently or opaquely. If EFI_HII_DRAW_FLAG_CLIP is set,
+ then all pixels drawn outside the bounding box specified by
+ Width and Height are ignored. If EFI_HII_DRAW_FLAG_TRANSPARENT
+ is set, then all "off" pixels in the character's glyph will
+ use the pixel value from Blt. This flag cannot be used if Blt
+ is NULL upon entry. If EFI_HII_DIRECT_TO_SCREEN is set, then
+ the image will be written directly to the output device
+ specified by Screen. Otherwise the image will be rendered to
+ the bitmap specified by Bitmap.
+ This function renders an image to a bitmap or the screen using
+ the specified color and options. It draws the image on an
+ existing bitmap, allocates a new bitmap or uses the screen. The
+ images can be clipped. If EFI_HII_DRAW_FLAG_CLIP is set, then
+ all pixels drawn outside the bounding box specified by Width and
+ Height are ignored. The EFI_HII_DRAW_FLAG_TRANSPARENT flag
+ determines whether the image will be drawn transparent or
+ opaque. If EFI_HII_DRAW_FLAG_FORCE_TRANS is set, then the image
+ will be drawn so that all 'off' pixels in the image will
+ be drawn using the pixel value from Blt and all other pixels
+ will be copied. If EFI_HII_DRAW_FLAG_FORCE_OPAQUE is set, then
+ the image's pixels will be copied directly to the
+ destination. If EFI_HII_DRAW_FLAG_DEFAULT is set, then the image
+ will be drawn transparently or opaque, depending on the
+ image's transparency setting (see EFI_IMAGE_TRANSPARENT).
+ Images cannot be drawn transparently if Blt is NULL. If
+ EFI_HII_DIRECT_TO_SCREEN is set, then the image will be written
+ directly to the output device specified by Screen. Otherwise the
+ image will be rendered to the bitmap specified by Bitmap.
+
+ @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
+
+ @param Flags Describes how the image is to be drawn.
+
+ @param PackageList The package list in the HII database to
+ search for the specified image.
+
+ @param ImageId The image's id, which is unique within PackageList.
+
+ @param Blt If this points to a non-NULL on entry, this points
+ to the image, which is Width pixels wide and
+ Height pixels high. The image will be drawn onto
+ this image and EFI_HII_DRAW_FLAG_CLIP is implied.
+ If this points to a NULL on entry, then a buffer
+ will be allocated to hold the generated image and
+ the pointer updated on exit. It is the caller's
+ responsibility to free this buffer.
+
+ @param BltX, BltY Specifies the offset from the left and top
+ edge of the output image of the first
+ pixel in the image.
+
+ @retval EFI_SUCCESS The image was successfully updated.
+
+ @retval EFI_OUT_OF_RESOURCES Unable to allocate an output
+ buffer for RowInfoArray or Blt.
+
+ @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.
+ Or The specified PackageList is not in the database.
+
+ @retval EFI_INVALID_PARAMETER The Blt was NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_DRAW_IMAGE_ID)(
+IN CONST EFI_HII_IMAGE_PROTOCOL *This,
+IN EFI_HII_DRAW_FLAGS Flags,
+IN EFI_HII_HANDLE PackageList,
+IN EFI_IMAGE_ID ImageId,
+IN OUT EFI_IMAGE_OUTPUT **Blt,
+IN UINTN BltX,
+IN UINTN BltY
+);
+
+
+///
+/// Services to access to images in the images database.
+///
+struct _EFI_HII_IMAGE_PROTOCOL {
+ EFI_HII_NEW_IMAGE NewImage;
+ EFI_HII_GET_IMAGE GetImage;
+ EFI_HII_SET_IMAGE SetImage;
+ EFI_HII_DRAW_IMAGE DrawImage;
+ EFI_HII_DRAW_IMAGE_ID DrawImageId;
+};
+
+extern EFI_GUID gEfiHiiImageProtocolGuid;
+
+#endif
+
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiImageDecoder.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiImageDecoder.h
new file mode 100644
index 0000000000..37f4b01e0d
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiImageDecoder.h
@@ -0,0 +1,203 @@
+/** @file
+ This protocol provides generic image decoder interfaces to various image formats.
+
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
+ Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+#ifndef __HII_IMAGE_DECODER_H__
+#define __HII_IMAGE_DECODER_H__
+
+#include <Protocol/HiiImage.h>
+
+#define EFI_HII_IMAGE_DECODER_PROTOCOL_GUID \
+ {0x9e66f251, 0x727c, 0x418c, { 0xbf, 0xd6, 0xc2, 0xb4, 0x25, 0x28, 0x18, 0xea }}
+
+
+#define EFI_HII_IMAGE_DECODER_NAME_JPEG_GUID \
+ {0xefefd093, 0xd9b, 0x46eb, { 0xa8, 0x56, 0x48, 0x35, 0x7, 0x0, 0xc9, 0x8 }}
+
+#define EFI_HII_IMAGE_DECODER_NAME_PNG_GUID \
+ {0xaf060190, 0x5e3a, 0x4025, { 0xaf, 0xbd, 0xe1, 0xf9, 0x5, 0xbf, 0xaa, 0x4c }}
+
+typedef struct _EFI_HII_IMAGE_DECODER_PROTOCOL EFI_HII_IMAGE_DECODER_PROTOCOL;
+
+typedef enum {
+ EFI_HII_IMAGE_DECODER_COLOR_TYPE_RGB = 0x0,
+ EFI_HII_IMAGE_DECODER_COLOR_TYPE_RGBA = 0x1,
+ EFI_HII_IMAGE_DECODER_COLOR_TYPE_CMYK = 0x2,
+ EFI_HII_IMAGE_DECODER_COLOR_TYPE_UNKNOWN = 0xFF
+} EFI_HII_IMAGE_DECODER_COLOR_TYPE;
+
+//
+// EFI_HII_IMAGE_DECODER_IMAGE_INFO_HEADER
+//
+// DecoderName Name of the decoder
+// ImageInfoSize The size of entire image information structure in bytes
+// ImageWidth The image width
+// ImageHeight The image height
+// ColorType The color type, see EFI_HII_IMAGE_DECODER_COLOR_TYPE.
+// ColorDepthInBits The color depth in bits
+//
+typedef struct _EFI_HII_IMAGE_DECODER_IMAGE_INFO_HEADER {
+ EFI_GUID DecoderName;
+ UINT16 ImageInfoSize;
+ UINT16 ImageWidth;
+ UINT16 ImageHeight;
+ EFI_HII_IMAGE_DECODER_COLOR_TYPE ColorType;
+ UINT8 ColorDepthInBits;
+} EFI_HII_IMAGE_DECODER_IMAGE_INFO_HEADER;
+
+#define EFI_IMAGE_JPEG_SCANTYPE_PROGREESSIVE 0x01
+#define EFI_IMAGE_JPEG_SCANTYPE_INTERLACED 0x02
+
+//
+// EFI_HII_IMAGE_DECODER_JPEG_INFO
+// Header The common header
+// ScanType The scan type of JPEG image
+// Reserved Reserved
+//
+typedef struct _EFI_HII_IMAGE_DECODER_JPEG_INFO {
+ EFI_HII_IMAGE_DECODER_IMAGE_INFO_HEADER Header;
+ UINT16 ScanType;
+ UINT64 Reserved;
+} EFI_HII_IMAGE_DECODER_JPEG_INFO;
+
+//
+// EFI_HII_IMAGE_DECODER_PNG_INFO
+// Header The common header
+// Channels Number of channels in the PNG image
+// Reserved Reserved
+//
+typedef struct _EFI_HII_IMAGE_DECODER_PNG_INFO {
+ EFI_HII_IMAGE_DECODER_IMAGE_INFO_HEADER Header;
+ UINT16 Channels;
+ UINT64 Reserved;
+} EFI_HII_IMAGE_DECODER_PNG_INFO;
+
+//
+// EFI_HII_IMAGE_DECODER_OTHER_INFO
+//
+typedef struct _EFI_HII_IMAGE_DECODER_OTHER_INFO {
+ EFI_HII_IMAGE_DECODER_IMAGE_INFO_HEADER Header;
+ CHAR16 ImageExtenion[1];
+ //
+ // Variable length of image file extension name.
+ //
+} EFI_HII_IMAGE_DECODER_OTHER_INFO;
+
+/**
+ There could be more than one EFI_HII_IMAGE_DECODER_PROTOCOL instances installed
+ in the system for different image formats. This function returns the decoder
+ name which callers can use to find the proper image decoder for the image. It
+ is possible to support multiple image formats in one EFI_HII_IMAGE_DECODER_PROTOCOL.
+ The capability of the supported image formats is returned in DecoderName and
+ NumberOfDecoderName.
+
+ @param This EFI_HII_IMAGE_DECODER_PROTOCOL instance.
+ @param DecoderName Pointer to a dimension to retrieve the decoder
+ names in EFI_GUID format. The number of the
+ decoder names is returned in NumberOfDecoderName.
+ @param NumberofDecoderName Pointer to retrieve the number of decoders which
+ supported by this decoder driver.
+
+ @retval EFI_SUCCESS Get decoder name success.
+ @retval EFI_UNSUPPORTED Get decoder name fail.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_IMAGE_DECODER_GET_NAME)(
+ IN EFI_HII_IMAGE_DECODER_PROTOCOL *This,
+ IN OUT EFI_GUID **DecoderName,
+ IN OUT UINT16 *NumberOfDecoderName
+ );
+
+/**
+ This function returns the image information of the given image raw data. This
+ function first checks whether the image raw data is supported by this decoder
+ or not. This function may go through the first few bytes in the image raw data
+ for the specific data structure or the image signature. If the image is not supported
+ by this image decoder, this function returns EFI_UNSUPPORTED to the caller.
+ Otherwise, this function returns the proper image information to the caller.
+ It is the caller?s responsibility to free the ImageInfo.
+
+ @param This EFI_HII_IMAGE_DECODER_PROTOCOL instance.
+ @param Image Pointer to the image raw data.
+ @param SizeOfImage Size of the entire image raw data.
+ @param ImageInfo Pointer to receive EFI_HII_IMAGE_DECODER_IMAGE_INFO_HEADER.
+
+ @retval EFI_SUCCESS Get image info success.
+ @retval EFI_UNSUPPORTED Unsupported format of image.
+ @retval EFI_INVALID_PARAMETER Incorrect parameter.
+ @retval EFI_BAD_BUFFER_SIZE Not enough memory.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_IMAGE_DECODER_GET_IMAGE_INFO)(
+ IN EFI_HII_IMAGE_DECODER_PROTOCOL *This,
+ IN VOID *Image,
+ IN UINTN SizeOfImage,
+ IN OUT EFI_HII_IMAGE_DECODER_IMAGE_INFO_HEADER **ImageInfo
+ );
+
+/**
+ This function decodes the image which the image type of this image is supported
+ by this EFI_HII_IMAGE_DECODER_PROTOCOL. If **Bitmap is not NULL, the caller intends
+ to put the image in the given image buffer. That allows the caller to put an
+ image overlap on the original image. The transparency is handled by the image
+ decoder because the transparency capability depends on the image format. Callers
+ can set Transparent to FALSE to force disabling the transparency process on the
+ image. Forcing Transparent to FALSE may also improve the performance of the image
+ decoding because the image decoder can skip the transparency processing. If **Bitmap
+ is NULL, the image decoder allocates the memory buffer for the EFI_IMAGE_OUTPUT
+ and decodes the image to the image buffer. It is the caller?s responsibility to
+ free the memory for EFI_IMAGE_OUTPUT. Image decoder doesn?t have to handle the
+ transparency in this case because there is no background image given by the caller.
+ The background color in this case is all black (#00000000).
+
+ @param This EFI_HII_IMAGE_DECODER_PROTOCOL instance.
+ @param Image Pointer to the image raw data.
+ @param ImageRawDataSize Size of the entire image raw data.
+ @param Blt EFI_IMAGE_OUTPUT to receive the image or overlap
+ the image on the original buffer.
+ @param Transparent BOOLEAN value indicates whether the image decoder
+ has to handle the transparent image or not.
+
+
+ @retval EFI_SUCCESS Image decode success.
+ @retval EFI_UNSUPPORTED Unsupported format of image.
+ @retval EFI_INVALID_PARAMETER Incorrect parameter.
+ @retval EFI_BAD_BUFFER_SIZE Not enough memory.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_IMAGE_DECODER_DECODE)(
+ IN EFI_HII_IMAGE_DECODER_PROTOCOL *This,
+ IN VOID *Image,
+ IN UINTN ImageRawDataSize,
+ IN OUT EFI_IMAGE_OUTPUT **Bitmap,
+ IN BOOLEAN Transparent
+ );
+
+struct _EFI_HII_IMAGE_DECODER_PROTOCOL {
+ EFI_HII_IMAGE_DECODER_GET_NAME GetImageDecoderName;
+ EFI_HII_IMAGE_DECODER_GET_IMAGE_INFO GetImageInfo;
+ EFI_HII_IMAGE_DECODER_DECODE DecodeImage;
+};
+
+extern EFI_GUID gEfiHiiImageDecoderProtocolGuid;
+extern EFI_GUID gEfiHiiImageDecoderNameJpegGuid;
+extern EFI_GUID gEfiHiiImageDecoderNamePngGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiImageEx.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiImageEx.h
new file mode 100644
index 0000000000..267f29fad0
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiImageEx.h
@@ -0,0 +1,251 @@
+/** @file
+ Protocol which allows access to the images in the images database.
+
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
+
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_HII_IMAGE_EX_H__
+#define __EFI_HII_IMAGE_EX_H__
+
+#include <Protocol/HiiImage.h>
+
+//
+// Global ID for the Hii Image Ex Protocol.
+//
+#define EFI_HII_IMAGE_EX_PROTOCOL_GUID \
+ {0x1a1241e6, 0x8f19, 0x41a9, { 0xbc, 0xe, 0xe8, 0xef, 0x39, 0xe0, 0x65, 0x46 }}
+
+typedef struct _EFI_HII_IMAGE_EX_PROTOCOL EFI_HII_IMAGE_EX_PROTOCOL;
+
+/**
+ The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.NewImage().
+ This protocol invokes EFI_HII_IMAGE_PROTOCOL.NewImage() implicitly.
+
+ @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.
+ @param PackageList Handle of the package list where this image will
+ be added.
+ @param ImageId On return, contains the new image id, which is
+ unique within PackageList.
+ @param Image Points to the image.
+
+ @retval EFI_SUCCESS The new image was added successfully.
+ @retval EFI_NOT_FOUND The specified PackageList could not be found in
+ database.
+ @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.
+ @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_NEW_IMAGE_EX)(
+ IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ OUT EFI_IMAGE_ID *ImageId,
+ IN CONST EFI_IMAGE_INPUT *Image
+ );
+
+/**
+ Return the information about the image, associated with the package list.
+ The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.GetImage().
+
+ This function is similar to EFI_HII_IMAGE_PROTOCOL.GetImage().The difference is that
+ this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the
+ system if the decoder of the certain image type is not supported by the
+ EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the
+ EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that
+ supports the requested image type.
+
+ @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.
+ @param PackageList The package list in the HII database to search for the
+ specified image.
+ @param ImageId The image's id, which is unique within PackageList.
+ @param Image Points to the image.
+
+ @retval EFI_SUCCESS The new image was returned successfully.
+ @retval EFI_NOT_FOUND The image specified by ImageId is not available. The specified
+ PackageList is not in the Database.
+ @retval EFI_INVALID_PARAMETER Image was NULL or ImageId was 0.
+ @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there
+ was not enough memory.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_IMAGE_EX)(
+ IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_IMAGE_ID ImageId,
+ OUT EFI_IMAGE_INPUT *Image
+ );
+
+/**
+ Change the information about the image.
+
+ Same with EFI_HII_IMAGE_PROTOCOL.SetImage(),this protocol invokes
+ EFI_HII_IMAGE_PROTOCOL.SetImage()implicitly.
+
+ @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.
+ @param PackageList The package list containing the images.
+ @param ImageId The image's id, which is unique within PackageList.
+ @param Image Points to the image.
+
+ @retval EFI_SUCCESS The new image was successfully updated.
+ @retval EFI_NOT_FOUND The image specified by ImageId is not in the
+ database. The specified PackageList is not in
+ the database.
+ @retval EFI_INVALID_PARAMETER The Image was NULL, the ImageId was 0 or
+ the Image->Bitmap was NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_SET_IMAGE_EX)(
+ IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_IMAGE_ID ImageId,
+ IN CONST EFI_IMAGE_INPUT *Image
+ );
+
+/**
+ Renders an image to a bitmap or to the display.
+
+ The prototype of this extension function is the same with
+ EFI_HII_IMAGE_PROTOCOL.DrawImage(). This protocol invokes
+ EFI_HII_IMAGE_PROTOCOL.DrawImage() implicitly.
+
+ @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.
+ @param Flags Describes how the image is to be drawn.
+ @param Image Points to the image to be displayed.
+ @param Blt If this points to a non-NULL on entry, this points
+ to the image, which is Width pixels wide and
+ Height pixels high. The image will be drawn onto
+ this image and EFI_HII_DRAW_FLAG_CLIP is implied.
+ If this points to a NULL on entry, then a buffer
+ will be allocated to hold the generated image and
+ the pointer updated on exit. It is the caller's
+ responsibility to free this buffer.
+ @param BltX Specifies the offset from the left and top edge of
+ the output image of the first pixel in the image.
+ @param BltY Specifies the offset from the left and top edge of
+ the output image of the first pixel in the image.
+
+ @retval EFI_SUCCESS The image was successfully drawn.
+ @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
+ @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_DRAW_IMAGE_EX)(
+ IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,
+ IN EFI_HII_DRAW_FLAGS Flags,
+ IN CONST EFI_IMAGE_INPUT *Image,
+ IN OUT EFI_IMAGE_OUTPUT **Blt,
+ IN UINTN BltX,
+ IN UINTN BltY
+ );
+
+/**
+ Renders an image to a bitmap or the screen containing the contents of the specified
+ image.
+
+ This function is similar to EFI_HII_IMAGE_PROTOCOL.DrawImageId(). The difference is that
+ this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the
+ system if the decoder of the certain image type is not supported by the
+ EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the
+ EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that
+ supports the requested image type.
+
+ @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.
+ @param Flags Describes how the image is to be drawn.
+ @param PackageList The package list in the HII database to search for
+ the specified image.
+ @param ImageId The image's id, which is unique within PackageList.
+ @param Blt If this points to a non-NULL on entry, this points
+ to the image, which is Width pixels wide and
+ Height pixels high. The image will be drawn onto
+ this image and EFI_HII_DRAW_FLAG_CLIP is implied.
+ If this points to a NULL on entry, then a buffer
+ will be allocated to hold the generated image
+ and the pointer updated on exit. It is the caller's
+ responsibility to free this buffer.
+ @param BltX Specifies the offset from the left and top edge of
+ the output image of the first pixel in the image.
+ @param BltY Specifies the offset from the left and top edge of
+ the output image of the first pixel in the image.
+
+ @retval EFI_SUCCESS The image was successfully drawn.
+ @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
+ @retval EFI_INVALID_PARAMETER The Blt was NULL or ImageId was 0.
+ @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.
+ The specified PackageList is not in the database.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_DRAW_IMAGE_ID_EX)(
+ IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,
+ IN EFI_HII_DRAW_FLAGS Flags,
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_IMAGE_ID ImageId,
+ IN OUT EFI_IMAGE_OUTPUT **Blt,
+ IN UINTN BltX,
+ IN UINTN BltY
+ );
+
+/**
+ This function returns the image information to EFI_IMAGE_OUTPUT. Only the width
+ and height are returned to the EFI_IMAGE_OUTPUT instead of decoding the image
+ to the buffer. This function is used to get the geometry of the image. This function
+ will try to locate all of the EFI_HII_IMAGE_DECODER_PROTOCOL installed on the
+ system if the decoder of image type is not supported by the EFI_HII_IMAGE_EX_PROTOCOL.
+
+ @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.
+ @param PackageList Handle of the package list where this image will
+ be searched.
+ @param ImageId The image's id, which is unique within PackageList.
+ @param Image Points to the image.
+
+ @retval EFI_SUCCESS The new image was returned successfully.
+ @retval EFI_NOT_FOUND The image specified by ImageId is not in the
+ database. The specified PackageList is not in the database.
+ @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to
+ hold the image.
+ @retval EFI_INVALID_PARAMETER The Image was NULL or the ImageId was 0.
+ @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there
+ was not enough memory.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_IMAGE_INFO)(
+ IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_IMAGE_ID ImageId,
+ OUT EFI_IMAGE_OUTPUT *Image
+ );
+
+///
+/// Protocol which allows access to the images in the images database.
+///
+struct _EFI_HII_IMAGE_EX_PROTOCOL {
+ EFI_HII_NEW_IMAGE_EX NewImageEx;
+ EFI_HII_GET_IMAGE_EX GetImageEx;
+ EFI_HII_SET_IMAGE_EX SetImageEx;
+ EFI_HII_DRAW_IMAGE_EX DrawImageEx;
+ EFI_HII_DRAW_IMAGE_ID_EX DrawImageIdEx;
+ EFI_HII_GET_IMAGE_INFO GetImageInfo;
+};
+
+extern EFI_GUID gEfiHiiImageExProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiPackageList.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiPackageList.h
new file mode 100644
index 0000000000..3842973281
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiPackageList.h
@@ -0,0 +1,33 @@
+/** @file
+ EFI_HII_PACKAGE_LIST_PROTOCOL as defined in UEFI 2.1.
+ Boot service LoadImage() installs EFI_HII_PACKAGE_LIST_PROTOCOL on the handle
+ if the image contains a custom PE/COFF resource with the type 'HII'.
+ The protocol's interface pointer points to the HII package list, which is
+ contained in the resource's data.
+
+ Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __HII_PACKAGE_LIST_H__
+#define __HII_PACKAGE_LIST_H__
+
+#define EFI_HII_PACKAGE_LIST_PROTOCOL_GUID \
+ { 0x6a1ee763, 0xd47a, 0x43b4, {0xaa, 0xbe, 0xef, 0x1d, 0xe2, 0xab, 0x56, 0xfc}}
+
+typedef EFI_HII_PACKAGE_LIST_HEADER * EFI_HII_PACKAGE_LIST_PROTOCOL;
+
+extern EFI_GUID gEfiHiiPackageListProtocolGuid;
+
+
+
+#endif
+
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiPopup.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiPopup.h
new file mode 100644
index 0000000000..a95a1b0f57
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiPopup.h
@@ -0,0 +1,81 @@
+/** @file
+ This protocol provides services to display a popup window.
+ The protocol is typically produced by the forms browser and consumed by a driver callback handler.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __HII_POPUP_H__
+#define __HII_POPUP_H__
+
+#define EFI_HII_POPUP_PROTOCOL_GUID \
+ {0x4311edc0, 0x6054, 0x46d4, {0x9e, 0x40, 0x89, 0x3e, 0xa9, 0x52, 0xfc, 0xcc}}
+
+#define EFI_HII_POPUP_PROTOCOL_REVISION 1
+
+typedef struct _EFI_HII_POPUP_PROTOCOL EFI_HII_POPUP_PROTOCOL;
+
+typedef enum {
+ EfiHiiPopupStyleInfo,
+ EfiHiiPopupStyleWarning,
+ EfiHiiPopupStyleError
+} EFI_HII_POPUP_STYLE;
+
+typedef enum {
+ EfiHiiPopupTypeOk,
+ EfiHiiPopupTypeOkCancel,
+ EfiHiiPopupTypeYesNo,
+ EfiHiiPopupTypeYesNoCancel
+} EFI_HII_POPUP_TYPE;
+
+typedef enum {
+ EfiHiiPopupSelectionOk,
+ EfiHiiPopupSelectionCancel,
+ EfiHiiPopupSelectionYes,
+ EfiHiiPopupSelectionNo
+} EFI_HII_POPUP_SELECTION;
+
+/**
+ Displays a popup window.
+
+ @param This A pointer to the EFI_HII_POPUP_PROTOCOL instance.
+ @param PopupStyle Popup style to use.
+ @param PopupType Type of the popup to display.
+ @param HiiHandle HII handle of the string pack containing Message
+ @param Message A message to display in the popup box.
+ @param UserSelection User selection.
+
+ @retval EFI_SUCCESS The popup box was successfully displayed.
+ @retval EFI_INVALID_PARAMETER HiiHandle and Message do not define a valid HII string.
+ @retval EFI_INVALID_PARAMETER PopupType is not one of the values defined by this specification.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to display the popup box.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_HII_CREATE_POPUP) (
+ IN EFI_HII_POPUP_PROTOCOL *This,
+ IN EFI_HII_POPUP_STYLE PopupStyle,
+ IN EFI_HII_POPUP_TYPE PopupType,
+ IN EFI_HII_HANDLE HiiHandle,
+ IN EFI_STRING_ID Message,
+ OUT EFI_HII_POPUP_SELECTION *UserSelection OPTIONAL
+);
+
+typedef struct _EFI_HII_POPUP_PROTOCOL {
+ UINT64 Revision;
+ EFI_HII_CREATE_POPUP CreatePopup;
+} EFI_HII_POPUP_PROTOCOL;
+
+extern EFI_GUID gEfiHiiPopupProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiString.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiString.h
new file mode 100644
index 0000000000..9e9f7ff507
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HiiString.h
@@ -0,0 +1,241 @@
+/** @file
+ The file provides services to manipulate string data.
+
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __HII_STRING_H__
+#define __HII_STRING_H__
+
+#include <Protocol/HiiFont.h>
+
+#define EFI_HII_STRING_PROTOCOL_GUID \
+ { 0xfd96974, 0x23aa, 0x4cdc, { 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a } }
+
+typedef struct _EFI_HII_STRING_PROTOCOL EFI_HII_STRING_PROTOCOL;
+
+/**
+ This function adds the string String to the group of strings owned by PackageList, with the
+ specified font information StringFontInfo, and returns a new string id.
+ The new string identifier is guaranteed to be unique within the package list.
+ That new string identifier is reserved for all languages in the package list.
+
+ @param This A pointer to the EFI_HII_STRING_PROTOCOL instance.
+ @param PackageList The handle of the package list where this string will
+ be added.
+ @param StringId On return, contains the new strings id, which is
+ unique within PackageList.
+ @param Language Points to the language for the new string.
+ @param LanguageName Points to the printable language name to associate
+ with the passed in Language field.If LanguageName
+ is not NULL and the string package header's
+ LanguageName associated with a given Language is
+ not zero, the LanguageName being passed in will
+ be ignored.
+ @param String Points to the new null-terminated string.
+ @param StringFontInfo Points to the new string's font information or
+ NULL if the string should have the default system
+ font, size and style.
+
+ @retval EFI_SUCCESS The new string was added successfully.
+ @retval EFI_NOT_FOUND The specified PackageList could not be found in
+ database.
+ @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of resources.
+ @retval EFI_INVALID_PARAMETER String is NULL, or StringId is NULL, or Language is NULL.
+ @retval EFI_INVALID_PARAMETER The specified StringFontInfo does not exist in
+ current database.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_NEW_STRING)(
+ IN CONST EFI_HII_STRING_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ OUT EFI_STRING_ID *StringId,
+ IN CONST CHAR8 *Language,
+ IN CONST CHAR16 *LanguageName, OPTIONAL
+ IN CONST EFI_STRING String,
+ IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL
+);
+
+
+/**
+ This function retrieves the string specified by StringId which is associated
+ with the specified PackageList in the language Language and copies it into
+ the buffer specified by String.
+
+ @param This A pointer to the EFI_HII_STRING_PROTOCOL instance.
+ @param Language Points to the language for the retrieved string.
+ @param PackageList The package list in the HII database to search for
+ the specified string.
+ @param StringId The string's id, which is unique within
+ PackageList.
+ @param String Points to the new null-terminated string.
+ @param StringSize On entry, points to the size of the buffer pointed
+ to by String, in bytes. On return, points to the
+ length of the string, in bytes.
+ @param StringFontInfo If not NULL, points to the string's font
+ information. It's caller's responsibility to free
+ this buffer.
+
+ @retval EFI_SUCCESS The string was returned successfully.
+ @retval EFI_NOT_FOUND The string specified by StringId is not available.
+ The specified PackageList is not in the database.
+ @retval EFI_INVALID_LANGUAGE The string specified by StringId is available but
+ not in the specified language.
+ @retval EFI_BUFFER_TOO_SMALL The buffer specified by StringSize is too small to
+ hold the string.
+ @retval EFI_INVALID_PARAMETER The Language or StringSize was NULL.
+ @retval EFI_INVALID_PARAMETER The value referenced by StringSize was not zero and
+ String was NULL.
+ @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
+ request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_STRING)(
+ IN CONST EFI_HII_STRING_PROTOCOL *This,
+ IN CONST CHAR8 *Language,
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_STRING_ID StringId,
+ OUT EFI_STRING String,
+ IN OUT UINTN *StringSize,
+ OUT EFI_FONT_INFO **StringFontInfo OPTIONAL
+);
+
+/**
+ This function updates the string specified by StringId in the specified PackageList to the text
+ specified by String and, optionally, the font information specified by StringFontInfo.
+
+ @param This A pointer to the EFI_HII_STRING_PROTOCOL instance.
+ @param PackageList The package list containing the strings.
+ @param StringId The string's id, which is unique within
+ PackageList.
+ @param Language Points to the language for the updated string.
+ @param String Points to the new null-terminated string.
+ @param StringFontInfo Points to the string's font information or NULL if
+ the string font information is not changed.
+
+ @retval EFI_SUCCESS The string was updated successfully.
+ @retval EFI_NOT_FOUND The string specified by StringId is not in the
+ database.
+ @retval EFI_INVALID_PARAMETER The String or Language was NULL.
+ @retval EFI_INVALID_PARAMETER The specified StringFontInfo does not exist in
+ current database.
+ @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
+ task.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_SET_STRING)(
+ IN CONST EFI_HII_STRING_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_STRING_ID StringId,
+ IN CONST CHAR8 *Language,
+ IN EFI_STRING String,
+ IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL
+);
+
+
+/**
+ This function returns the list of supported languages.
+
+ @param This A pointer to the EFI_HII_STRING_PROTOCOL instance.
+ @param PackageList The package list to examine.
+ @param Languages Points to the buffer to hold the returned
+ null-terminated ASCII string.
+ @param LanguagesSize On entry, points to the size of the buffer pointed
+ to by Languages, in bytes. On return, points to
+ the length of Languages, in bytes.
+
+ @retval EFI_SUCCESS The languages were returned successfully.
+ @retval EFI_INVALID_PARAMETER The LanguagesSize was NULL.
+ @retval EFI_INVALID_PARAMETER The value referenced by LanguagesSize is not zero
+ and Languages is NULL.
+ @retval EFI_BUFFER_TOO_SMALL The LanguagesSize is too small to hold the list of
+ supported languages. LanguageSize is updated to
+ contain the required size.
+ @retval EFI_NOT_FOUND Could not find string package in specified
+ packagelist.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_LANGUAGES)(
+ IN CONST EFI_HII_STRING_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ IN OUT CHAR8 *Languages,
+ IN OUT UINTN *LanguagesSize
+);
+
+
+/**
+ Each string package has associated with it a single primary language and zero
+ or more secondary languages. This routine returns the secondary languages
+ associated with a package list.
+
+ @param This A pointer to the EFI_HII_STRING_PROTOCOL instance.
+ @param PackageList The package list to examine.
+ @param PrimaryLanguage Points to the null-terminated ASCII string that specifies
+ the primary language. Languages are specified in the
+ format specified in Appendix M of the UEFI 2.0 specification.
+ @param SecondaryLanguages Points to the buffer to hold the returned null-terminated
+ ASCII string that describes the list of
+ secondary languages for the specified
+ PrimaryLanguage. If there are no secondary
+ languages, the function returns successfully, but
+ this is set to NULL.
+ @param SecondaryLanguagesSize On entry, points to the size of the buffer pointed
+ to by SecondaryLanguages, in bytes. On return,
+ points to the length of SecondaryLanguages in bytes.
+
+ @retval EFI_SUCCESS Secondary languages were correctly returned.
+ @retval EFI_INVALID_PARAMETER PrimaryLanguage or SecondaryLanguagesSize was NULL.
+ @retval EFI_INVALID_PARAMETER The value referenced by SecondaryLanguagesSize is not
+ zero and SecondaryLanguages is NULL.
+ @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondaryLanguagesSize is
+ too small to hold the returned information.
+ SecondaryLanguageSize is updated to hold the size of
+ the buffer required.
+ @retval EFI_INVALID_LANGUAGE The language specified by PrimaryLanguage is not
+ present in the specified package list.
+ @retval EFI_NOT_FOUND The specified PackageList is not in the Database.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_2ND_LANGUAGES)(
+ IN CONST EFI_HII_STRING_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ IN CONST CHAR8 *PrimaryLanguage,
+ IN OUT CHAR8 *SecondaryLanguages,
+ IN OUT UINTN *SecondaryLanguagesSize
+);
+
+
+///
+/// Services to manipulate the string.
+///
+struct _EFI_HII_STRING_PROTOCOL {
+ EFI_HII_NEW_STRING NewString;
+ EFI_HII_GET_STRING GetString;
+ EFI_HII_SET_STRING SetString;
+ EFI_HII_GET_LANGUAGES GetLanguages;
+ EFI_HII_GET_2ND_LANGUAGES GetSecondaryLanguages;
+};
+
+
+extern EFI_GUID gEfiHiiStringProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Http.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Http.h
new file mode 100644
index 0000000000..84de6bd37b
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Http.h
@@ -0,0 +1,522 @@
+/** @file
+ This file defines the EFI HTTP Protocol interface. It is split into
+ the following two main sections:
+ HTTP Service Binding Protocol (HTTPSB)
+ HTTP Protocol (HTTP)
+
+ Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
+ (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_HTTP_PROTOCOL_H__
+#define __EFI_HTTP_PROTOCOL_H__
+
+#define EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0xbdc8e6af, 0xd9bc, 0x4379, {0xa7, 0x2a, 0xe0, 0xc4, 0xe7, 0x5d, 0xae, 0x1c } \
+ }
+
+#define EFI_HTTP_PROTOCOL_GUID \
+ { \
+ 0x7a59b29b, 0x910b, 0x4171, {0x82, 0x42, 0xa8, 0x5a, 0x0d, 0xf2, 0x5b, 0x5b } \
+ }
+
+typedef struct _EFI_HTTP_PROTOCOL EFI_HTTP_PROTOCOL;
+
+///
+/// EFI_HTTP_VERSION
+///
+typedef enum {
+ HttpVersion10,
+ HttpVersion11,
+ HttpVersionUnsupported
+} EFI_HTTP_VERSION;
+
+///
+/// EFI_HTTP_METHOD
+///
+typedef enum {
+ HttpMethodGet,
+ HttpMethodPost,
+ HttpMethodPatch,
+ HttpMethodOptions,
+ HttpMethodConnect,
+ HttpMethodHead,
+ HttpMethodPut,
+ HttpMethodDelete,
+ HttpMethodTrace,
+ HttpMethodMax
+} EFI_HTTP_METHOD;
+
+///
+/// EFI_HTTP_STATUS_CODE
+///
+typedef enum {
+ HTTP_STATUS_UNSUPPORTED_STATUS = 0,
+ HTTP_STATUS_100_CONTINUE,
+ HTTP_STATUS_101_SWITCHING_PROTOCOLS,
+ HTTP_STATUS_200_OK,
+ HTTP_STATUS_201_CREATED,
+ HTTP_STATUS_202_ACCEPTED,
+ HTTP_STATUS_203_NON_AUTHORITATIVE_INFORMATION,
+ HTTP_STATUS_204_NO_CONTENT,
+ HTTP_STATUS_205_RESET_CONTENT,
+ HTTP_STATUS_206_PARTIAL_CONTENT,
+ HTTP_STATUS_300_MULTIPLE_CHOICES,
+ HTTP_STATUS_301_MOVED_PERMANENTLY,
+ HTTP_STATUS_302_FOUND,
+ HTTP_STATUS_303_SEE_OTHER,
+ HTTP_STATUS_304_NOT_MODIFIED,
+ HTTP_STATUS_305_USE_PROXY,
+ HTTP_STATUS_307_TEMPORARY_REDIRECT,
+ HTTP_STATUS_400_BAD_REQUEST,
+ HTTP_STATUS_401_UNAUTHORIZED,
+ HTTP_STATUS_402_PAYMENT_REQUIRED,
+ HTTP_STATUS_403_FORBIDDEN,
+ HTTP_STATUS_404_NOT_FOUND,
+ HTTP_STATUS_405_METHOD_NOT_ALLOWED,
+ HTTP_STATUS_406_NOT_ACCEPTABLE,
+ HTTP_STATUS_407_PROXY_AUTHENTICATION_REQUIRED,
+ HTTP_STATUS_408_REQUEST_TIME_OUT,
+ HTTP_STATUS_409_CONFLICT,
+ HTTP_STATUS_410_GONE,
+ HTTP_STATUS_411_LENGTH_REQUIRED,
+ HTTP_STATUS_412_PRECONDITION_FAILED,
+ HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE,
+ HTTP_STATUS_414_REQUEST_URI_TOO_LARGE,
+ HTTP_STATUS_415_UNSUPPORTED_MEDIA_TYPE,
+ HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED,
+ HTTP_STATUS_417_EXPECTATION_FAILED,
+ HTTP_STATUS_500_INTERNAL_SERVER_ERROR,
+ HTTP_STATUS_501_NOT_IMPLEMENTED,
+ HTTP_STATUS_502_BAD_GATEWAY,
+ HTTP_STATUS_503_SERVICE_UNAVAILABLE,
+ HTTP_STATUS_504_GATEWAY_TIME_OUT,
+ HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED,
+ HTTP_STATUS_308_PERMANENT_REDIRECT
+} EFI_HTTP_STATUS_CODE;
+
+///
+/// EFI_HTTPv4_ACCESS_POINT
+///
+typedef struct {
+ ///
+ /// Set to TRUE to instruct the EFI HTTP instance to use the default address
+ /// information in every TCP connection made by this instance. In addition, when set
+ /// to TRUE, LocalAddress and LocalSubnet are ignored.
+ ///
+ BOOLEAN UseDefaultAddress;
+ ///
+ /// If UseDefaultAddress is set to FALSE, this defines the local IP address to be
+ /// used in every TCP connection opened by this instance.
+ ///
+ EFI_IPv4_ADDRESS LocalAddress;
+ ///
+ /// If UseDefaultAddress is set to FALSE, this defines the local subnet to be used
+ /// in every TCP connection opened by this instance.
+ ///
+ EFI_IPv4_ADDRESS LocalSubnet;
+ ///
+ /// This defines the local port to be used in
+ /// every TCP connection opened by this instance.
+ ///
+ UINT16 LocalPort;
+} EFI_HTTPv4_ACCESS_POINT;
+
+///
+/// EFI_HTTPv6_ACCESS_POINT
+///
+typedef struct {
+ ///
+ /// Local IP address to be used in every TCP connection opened by this instance.
+ ///
+ EFI_IPv6_ADDRESS LocalAddress;
+ ///
+ /// Local port to be used in every TCP connection opened by this instance.
+ ///
+ UINT16 LocalPort;
+} EFI_HTTPv6_ACCESS_POINT;
+
+///
+/// EFI_HTTP_CONFIG_DATA_ACCESS_POINT
+///
+
+
+typedef struct {
+ ///
+ /// HTTP version that this instance will support.
+ ///
+ EFI_HTTP_VERSION HttpVersion;
+ ///
+ /// Time out (in milliseconds) when blocking for requests.
+ ///
+ UINT32 TimeOutMillisec;
+ ///
+ /// Defines behavior of EFI DNS and TCP protocols consumed by this instance. If
+ /// FALSE, this instance will use EFI_DNS4_PROTOCOL and EFI_TCP4_PROTOCOL. If TRUE,
+ /// this instance will use EFI_DNS6_PROTOCOL and EFI_TCP6_PROTOCOL.
+ ///
+ BOOLEAN LocalAddressIsIPv6;
+
+ union {
+ ///
+ /// When LocalAddressIsIPv6 is FALSE, this points to the local address, subnet, and
+ /// port used by the underlying TCP protocol.
+ ///
+ EFI_HTTPv4_ACCESS_POINT *IPv4Node;
+ ///
+ /// When LocalAddressIsIPv6 is TRUE, this points to the local IPv6 address and port
+ /// used by the underlying TCP protocol.
+ ///
+ EFI_HTTPv6_ACCESS_POINT *IPv6Node;
+ } AccessPoint;
+} EFI_HTTP_CONFIG_DATA;
+
+///
+/// EFI_HTTP_REQUEST_DATA
+///
+typedef struct {
+ ///
+ /// The HTTP method (e.g. GET, POST) for this HTTP Request.
+ ///
+ EFI_HTTP_METHOD Method;
+ ///
+ /// The URI of a remote host. From the information in this field, the HTTP instance
+ /// will be able to determine whether to use HTTP or HTTPS and will also be able to
+ /// determine the port number to use. If no port number is specified, port 80 (HTTP)
+ /// is assumed. See RFC 3986 for more details on URI syntax.
+ ///
+ CHAR16 *Url;
+} EFI_HTTP_REQUEST_DATA;
+
+///
+/// EFI_HTTP_RESPONSE_DATA
+///
+typedef struct {
+ ///
+ /// Response status code returned by the remote host.
+ ///
+ EFI_HTTP_STATUS_CODE StatusCode;
+} EFI_HTTP_RESPONSE_DATA;
+
+///
+/// EFI_HTTP_HEADER
+///
+typedef struct {
+ ///
+ /// Null terminated string which describes a field name. See RFC 2616 Section 14 for
+ /// detailed information about field names.
+ ///
+ CHAR8 *FieldName;
+ ///
+ /// Null terminated string which describes the corresponding field value. See RFC 2616
+ /// Section 14 for detailed information about field values.
+ ///
+ CHAR8 *FieldValue;
+} EFI_HTTP_HEADER;
+
+///
+/// EFI_HTTP_MESSAGE
+///
+typedef struct {
+ ///
+ /// HTTP message data.
+ ///
+ union {
+ ///
+ /// When the token is used to send a HTTP request, Request is a pointer to storage that
+ /// contains such data as URL and HTTP method.
+ ///
+ EFI_HTTP_REQUEST_DATA *Request;
+ ///
+ /// When used to await a response, Response points to storage containing HTTP response
+ /// status code.
+ ///
+ EFI_HTTP_RESPONSE_DATA *Response;
+ } Data;
+ ///
+ /// Number of HTTP header structures in Headers list. On request, this count is
+ /// provided by the caller. On response, this count is provided by the HTTP driver.
+ ///
+ UINTN HeaderCount;
+ ///
+ /// Array containing list of HTTP headers. On request, this array is populated by the
+ /// caller. On response, this array is allocated and populated by the HTTP driver. It
+ /// is the responsibility of the caller to free this memory on both request and
+ /// response.
+ ///
+ EFI_HTTP_HEADER *Headers;
+ ///
+ /// Length in bytes of the HTTP body. This can be zero depending on the HttpMethod type.
+ ///
+ UINTN BodyLength;
+ ///
+ /// Body associated with the HTTP request or response. This can be NULL depending on
+ /// the HttpMethod type.
+ ///
+ VOID *Body;
+} EFI_HTTP_MESSAGE;
+
+
+///
+/// EFI_HTTP_TOKEN
+///
+typedef struct {
+ ///
+ /// This Event will be signaled after the Status field is updated by the EFI HTTP
+ /// Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL. The Task Priority
+ /// Level (TPL) of Event must be lower than or equal to TPL_CALLBACK.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// Status will be set to one of the following value if the HTTP request is
+ /// successfully sent or if an unexpected error occurs:
+ /// EFI_SUCCESS: The HTTP request was successfully sent to the remote host.
+ /// EFI_HTTP_ERROR: The response message was successfully received but contains a
+ /// HTTP error. The response status code is returned in token.
+ /// EFI_ABORTED: The HTTP request was cancelled by the caller and removed from
+ /// the transmit queue.
+ /// EFI_TIMEOUT: The HTTP request timed out before reaching the remote host.
+ /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.
+ ///
+ EFI_STATUS Status;
+ ///
+ /// Pointer to storage containing HTTP message data.
+ ///
+ EFI_HTTP_MESSAGE *Message;
+} EFI_HTTP_TOKEN;
+
+/**
+ Returns the operational parameters for the current HTTP child instance.
+
+ The GetModeData() function is used to read the current mode data (operational
+ parameters) for this HTTP protocol instance.
+
+ @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.
+ @param[out] HttpConfigData Point to buffer for operational parameters of this
+ HTTP instance. It is the responsibility of the caller
+ to allocate the memory for HttpConfigData and
+ HttpConfigData->AccessPoint.IPv6Node/IPv4Node. In fact,
+ it is recommended to allocate sufficient memory to record
+ IPv6Node since it is big enough for all possibilities.
+
+ @retval EFI_SUCCESS Operation succeeded.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ HttpConfigData is NULL.
+ HttpConfigData->AccessPoint.IPv4Node or
+ HttpConfigData->AccessPoint.IPv6Node is NULL.
+ @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HTTP_GET_MODE_DATA)(
+ IN EFI_HTTP_PROTOCOL *This,
+ OUT EFI_HTTP_CONFIG_DATA *HttpConfigData
+ );
+
+/**
+ Initialize or brutally reset the operational parameters for this EFI HTTP instance.
+
+ The Configure() function does the following:
+ When HttpConfigData is not NULL Initialize this EFI HTTP instance by configuring
+ timeout, local address, port, etc.
+ When HttpConfigData is NULL, reset this EFI HTTP instance by closing all active
+ connections with remote hosts, canceling all asynchronous tokens, and flush request
+ and response buffers without informing the appropriate hosts.
+
+ No other EFI HTTP function can be executed by this instance until the Configure()
+ function is executed and returns successfully.
+
+ @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.
+ @param[in] HttpConfigData Pointer to the configure data to configure the instance.
+
+ @retval EFI_SUCCESS Operation succeeded.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ HttpConfigData->LocalAddressIsIPv6 is FALSE and
+ HttpConfigData->AccessPoint.IPv4Node is NULL.
+ HttpConfigData->LocalAddressIsIPv6 is TRUE and
+ HttpConfigData->AccessPoint.IPv6Node is NULL.
+ @retval EFI_ALREADY_STARTED Reinitialize this HTTP instance without calling
+ Configure() with NULL to reset it.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources when
+ executing Configure().
+ @retval EFI_UNSUPPORTED One or more options in ConfigData are not supported
+ in the implementation.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HTTP_CONFIGURE)(
+ IN EFI_HTTP_PROTOCOL *This,
+ IN EFI_HTTP_CONFIG_DATA *HttpConfigData OPTIONAL
+ );
+
+/**
+ The Request() function queues an HTTP request to this HTTP instance,
+ similar to Transmit() function in the EFI TCP driver. When the HTTP request is sent
+ successfully, or if there is an error, Status in token will be updated and Event will
+ be signaled.
+
+ @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.
+ @param[in] Token Pointer to storage containing HTTP request token.
+
+ @retval EFI_SUCCESS Outgoing data was processed.
+ @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_TIMEOUT Data was dropped out of the transmit or receive queue.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Token is NULL.
+ Token->Message is NULL.
+ Token->Message->Body is not NULL,
+ Token->Message->BodyLength is non-zero, and
+ Token->Message->Data is NULL, but a previous call to
+ Request()has not been completed successfully.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources.
+ @retval EFI_UNSUPPORTED The HTTP method is not supported in current implementation.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HTTP_REQUEST) (
+ IN EFI_HTTP_PROTOCOL *This,
+ IN EFI_HTTP_TOKEN *Token
+ );
+
+/**
+ Abort an asynchronous HTTP request or response token.
+
+ The Cancel() function aborts a pending HTTP request or response transaction. If
+ Token is not NULL and the token is in transmit or receive queues when it is being
+ cancelled, its Token->Status will be set to EFI_ABORTED and then Token->Event will
+ be signaled. If the token is not in one of the queues, which usually means that the
+ asynchronous operation has completed, EFI_NOT_FOUND is returned. If Token is NULL,
+ all asynchronous tokens issued by Request() or Response() will be aborted.
+
+ @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.
+ @param[in] Token Point to storage containing HTTP request or response
+ token.
+
+ @retval EFI_SUCCESS Request and Response queues are successfully flushed.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_STARTED This instance hasn't been configured.
+ @retval EFI_NOT_FOUND The asynchronous request or response token is not
+ found.
+ @retval EFI_UNSUPPORTED The implementation does not support this function.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HTTP_CANCEL)(
+ IN EFI_HTTP_PROTOCOL *This,
+ IN EFI_HTTP_TOKEN *Token
+ );
+
+/**
+ The Response() function queues an HTTP response to this HTTP instance, similar to
+ Receive() function in the EFI TCP driver. When the HTTP Response is received successfully,
+ or if there is an error, Status in token will be updated and Event will be signaled.
+
+ The HTTP driver will queue a receive token to the underlying TCP instance. When data
+ is received in the underlying TCP instance, the data will be parsed and Token will
+ be populated with the response data. If the data received from the remote host
+ contains an incomplete or invalid HTTP header, the HTTP driver will continue waiting
+ (asynchronously) for more data to be sent from the remote host before signaling
+ Event in Token.
+
+ It is the responsibility of the caller to allocate a buffer for Body and specify the
+ size in BodyLength. If the remote host provides a response that contains a content
+ body, up to BodyLength bytes will be copied from the receive buffer into Body and
+ BodyLength will be updated with the amount of bytes received and copied to Body. This
+ allows the client to download a large file in chunks instead of into one contiguous
+ block of memory. Similar to HTTP request, if Body is not NULL and BodyLength is
+ non-zero and all other fields are NULL or 0, the HTTP driver will queue a receive
+ token to underlying TCP instance. If data arrives in the receive buffer, up to
+ BodyLength bytes of data will be copied to Body. The HTTP driver will then update
+ BodyLength with the amount of bytes received and copied to Body.
+
+ If the HTTP driver does not have an open underlying TCP connection with the host
+ specified in the response URL, Request() will return EFI_ACCESS_DENIED. This is
+ consistent with RFC 2616 recommendation that HTTP clients should attempt to maintain
+ an open TCP connection between client and host.
+
+ @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.
+ @param[in] Token Pointer to storage containing HTTP response token.
+
+ @retval EFI_SUCCESS Allocation succeeded.
+ @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been
+ initialized.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Token is NULL.
+ Token->Message->Headers is NULL.
+ Token->Message is NULL.
+ Token->Message->Body is not NULL,
+ Token->Message->BodyLength is non-zero, and
+ Token->Message->Data is NULL, but a previous call to
+ Response() has not been completed successfully.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources.
+ @retval EFI_ACCESS_DENIED An open TCP connection is not present with the host
+ specified by response URL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HTTP_RESPONSE) (
+ IN EFI_HTTP_PROTOCOL *This,
+ IN EFI_HTTP_TOKEN *Token
+ );
+
+/**
+ The Poll() function can be used by network drivers and applications to increase the
+ rate that data packets are moved between the communication devices and the transmit
+ and receive queues.
+
+ In some systems, the periodic timer event in the managed network driver may not poll
+ the underlying communications device fast enough to transmit and/or receive all data
+ packets without missing incoming packets or dropping outgoing packets. Drivers and
+ applications that are experiencing packet loss should try calling the Poll() function
+ more often.
+
+ @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed..
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_READY No incoming or outgoing data is processed.
+ @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HTTP_POLL) (
+ IN EFI_HTTP_PROTOCOL *This
+ );
+
+///
+/// The EFI HTTP protocol is designed to be used by EFI drivers and applications to
+/// create and transmit HTTP Requests, as well as handle HTTP responses that are
+/// returned by a remote host. This EFI protocol uses and relies on an underlying EFI
+/// TCP protocol.
+///
+struct _EFI_HTTP_PROTOCOL {
+ EFI_HTTP_GET_MODE_DATA GetModeData;
+ EFI_HTTP_CONFIGURE Configure;
+ EFI_HTTP_REQUEST Request;
+ EFI_HTTP_CANCEL Cancel;
+ EFI_HTTP_RESPONSE Response;
+ EFI_HTTP_POLL Poll;
+};
+
+extern EFI_GUID gEfiHttpServiceBindingProtocolGuid;
+extern EFI_GUID gEfiHttpProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HttpBootCallback.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HttpBootCallback.h
new file mode 100644
index 0000000000..93423e15a8
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HttpBootCallback.h
@@ -0,0 +1,100 @@
+/** @file
+ This file defines the EFI HTTP Boot Callback Protocol interface.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.7
+
+**/
+
+#ifndef __EFI_HTTP_BOOT_CALLBACK_H__
+#define __EFI_HTTP_BOOT_CALLBACK_H__
+
+#define EFI_HTTP_BOOT_CALLBACK_PROTOCOL_GUID \
+ { \
+ 0xba23b311, 0x343d, 0x11e6, {0x91, 0x85, 0x58, 0x20, 0xb1, 0xd6, 0x52, 0x99} \
+ }
+
+typedef struct _EFI_HTTP_BOOT_CALLBACK_PROTOCOL EFI_HTTP_BOOT_CALLBACK_PROTOCOL;
+
+///
+/// EFI_HTTP_BOOT_CALLBACK_DATA_TYPE
+///
+typedef enum {
+ ///
+ /// Data points to a DHCP4 packet which is about to transmit or has received.
+ ///
+ HttpBootDhcp4,
+ ///
+ /// Data points to a DHCP6 packet which is about to be transmit or has received.
+ ///
+ HttpBootDhcp6,
+ ///
+ /// Data points to an EFI_HTTP_MESSAGE structure, whichcontians a HTTP request message
+ /// to be transmitted.
+ ///
+ HttpBootHttpRequest,
+ ///
+ /// Data points to an EFI_HTTP_MESSAGE structure, which contians a received HTTP
+ /// response message.
+ ///
+ HttpBootHttpResponse,
+ ///
+ /// Part of the entity body has been received from the HTTP server. Data points to the
+ /// buffer of the entity body data.
+ ///
+ HttpBootHttpEntityBody,
+ HttpBootTypeMax
+} EFI_HTTP_BOOT_CALLBACK_DATA_TYPE;
+
+/**
+ Callback function that is invoked when the HTTP Boot driver is about to transmit or has received a
+ packet.
+
+ This function is invoked when the HTTP Boot driver is about to transmit or has received packet.
+ Parameters DataType and Received specify the type of event and the format of the buffer pointed
+ to by Data. Due to the polling nature of UEFI device drivers, this callback function should not
+ execute for more than 5 ms.
+ The returned status code determines the behavior of the HTTP Boot driver.
+
+ @param[in] This Pointer to the EFI_HTTP_BOOT_CALLBACK_PROTOCOL instance.
+ @param[in] DataType The event that occurs in the current state.
+ @param[in] Received TRUE if the callback is being invoked due to a receive event.
+ FALSE if the callback is being invoked due to a transmit event.
+ @param[in] DataLength The length in bytes of the buffer pointed to by Data.
+ @param[in] Data A pointer to the buffer of data, the data type is specified by
+ DataType.
+
+ @retval EFI_SUCCESS Tells the HTTP Boot driver to continue the HTTP Boot process.
+ @retval EFI_ABORTED Tells the HTTP Boot driver to abort the current HTTP Boot process.
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_HTTP_BOOT_CALLBACK) (
+ IN EFI_HTTP_BOOT_CALLBACK_PROTOCOL *This,
+ IN EFI_HTTP_BOOT_CALLBACK_DATA_TYPE DataType,
+ IN BOOLEAN Received,
+ IN UINT32 DataLength,
+ IN VOID *Data OPTIONAL
+ );
+
+///
+/// EFI HTTP Boot Callback Protocol is invoked when the HTTP Boot driver is about to transmit or
+/// has received a packet. The EFI HTTP Boot Callback Protocol must be installed on the same handle
+/// as the Load File Protocol for the HTTP Boot.
+///
+struct _EFI_HTTP_BOOT_CALLBACK_PROTOCOL {
+ EFI_HTTP_BOOT_CALLBACK Callback;
+};
+
+extern EFI_GUID gEfiHttpBootCallbackProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HttpUtilities.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HttpUtilities.h
new file mode 100644
index 0000000000..59c1ea2f78
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/HttpUtilities.h
@@ -0,0 +1,124 @@
+/** @file
+ EFI HTTP Utilities protocol provides a platform independent abstraction for HTTP
+ message comprehension.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_HTTP_UTILITIES_PROTOCOL_H__
+#define __EFI_HTTP_UTILITIES_PROTOCOL_H__
+
+#include <Protocol/Http.h>
+
+#define EFI_HTTP_UTILITIES_PROTOCOL_GUID \
+ { \
+ 0x3e35c163, 0x4074, 0x45dd, {0x43, 0x1e, 0x23, 0x98, 0x9d, 0xd8, 0x6b, 0x32 } \
+ }
+
+typedef struct _EFI_HTTP_UTILITIES_PROTOCOL EFI_HTTP_UTILITIES_PROTOCOL;
+
+
+/**
+ Create HTTP header based on a combination of seed header, fields
+ to delete, and fields to append.
+
+ The Build() function is used to manage the headers portion of an
+ HTTP message by providing the ability to add, remove, or replace
+ HTTP headers.
+
+ @param[in] This Pointer to EFI_HTTP_UTILITIES_PROTOCOL instance.
+ @param[in] SeedMessageSize Size of the initial HTTP header. This can be zero.
+ @param[in] SeedMessage Initial HTTP header to be used as a base for
+ building a new HTTP header. If NULL,
+ SeedMessageSize is ignored.
+ @param[in] DeleteCount Number of null-terminated HTTP header field names
+ in DeleteList.
+ @param[in] DeleteList List of null-terminated HTTP header field names to
+ remove from SeedMessage. Only the field names are
+ in this list because the field values are irrelevant
+ to this operation.
+ @param[in] AppendCount Number of header fields in AppendList.
+ @param[in] AppendList List of HTTP headers to populate NewMessage with.
+ If SeedMessage is not NULL, AppendList will be
+ appended to the existing list from SeedMessage in
+ NewMessage.
+ @param[out] NewMessageSize Pointer to number of header fields in NewMessage.
+ @param[out] NewMessage Pointer to a new list of HTTP headers based on.
+
+ @retval EFI_SUCCESS Add, remove, and replace operations succeeded.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate memory for NewMessage.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HTTP_UTILS_BUILD) (
+ IN EFI_HTTP_UTILITIES_PROTOCOL *This,
+ IN UINTN SeedMessageSize,
+ IN VOID *SeedMessage, OPTIONAL
+ IN UINTN DeleteCount,
+ IN CHAR8 *DeleteList[], OPTIONAL
+ IN UINTN AppendCount,
+ IN EFI_HTTP_HEADER *AppendList[], OPTIONAL
+ OUT UINTN *NewMessageSize,
+ OUT VOID **NewMessage
+ );
+
+/**
+ Parses HTTP header and produces an array of key/value pairs.
+
+ The Parse() function is used to transform data stored in HttpHeader
+ into a list of fields paired with their corresponding values.
+
+ @param[in] This Pointer to EFI_HTTP_UTILITIES_PROTOCOL instance.
+ @param[in] HttpMessage Contains raw unformatted HTTP header string.
+ @param[in] HttpMessageSize Size of HTTP header.
+ @param[out] HeaderFields Array of key/value header pairs.
+ @param[out] FieldCount Number of headers in HeaderFields.
+
+ @retval EFI_SUCCESS Allocation succeeded.
+ @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been
+ initialized.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ HttpMessage is NULL.
+ HeaderFields is NULL.
+ FieldCount is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HTTP_UTILS_PARSE) (
+ IN EFI_HTTP_UTILITIES_PROTOCOL *This,
+ IN CHAR8 *HttpMessage,
+ IN UINTN HttpMessageSize,
+ OUT EFI_HTTP_HEADER **HeaderFields,
+ OUT UINTN *FieldCount
+ );
+
+
+///
+/// EFI_HTTP_UTILITIES_PROTOCOL
+/// designed to be used by EFI drivers and applications to parse HTTP
+/// headers from a byte stream. This driver is neither dependent on
+/// network connectivity, nor the existence of an underlying network
+/// infrastructure.
+///
+struct _EFI_HTTP_UTILITIES_PROTOCOL {
+ EFI_HTTP_UTILS_BUILD Build;
+ EFI_HTTP_UTILS_PARSE Parse;
+};
+
+extern EFI_GUID gEfiHttpUtilitiesProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cBusConfigurationManagement.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cBusConfigurationManagement.h
new file mode 100644
index 0000000000..b29333e000
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cBusConfigurationManagement.h
@@ -0,0 +1,171 @@
+/** @file
+ I2C Bus Configuration Management Protocol as defined in the PI 1.3 specification.
+
+ The EFI I2C bus configuration management protocol provides platform specific
+ services that allow the I2C host protocol to reconfigure the switches and multiplexers
+ and set the clock frequency for the I2C bus. This protocol also enables the I2C host protocol
+ to reset an I2C device which may be locking up the I2C bus by holding the clock or data line low.
+
+ Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.3.
+
+**/
+
+#ifndef __I2C_BUS_CONFIGURATION_MANAGEMENT_H__
+#define __I2C_BUS_CONFIGURATION_MANAGEMENT_H__
+
+#define EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL_GUID \
+ { 0x55b71fb5, 0x17c6, 0x410e, { 0xb5, 0xbd, 0x5f, 0xa2, 0xe3, 0xd4, 0x46, 0x6b }}
+
+///
+/// I2C bus configuration management protocol
+///
+/// The EFI I2C bus configuration management protocol provides platform
+/// specific services that allow the I2C host protocol to reconfigure the
+/// switches and multiplexers and set the clock frequency for the I2C bus.
+/// This protocol also enables the I2C host protocol to reset an I2C device
+/// which may be locking up the I2C bus by holding the clock or data line
+/// low.
+///
+/// The I2C protocol stack uses the concept of an I2C bus configuration as
+/// a way to describe a particular state of the switches and multiplexers
+/// in the I2C bus.
+///
+/// A simple I2C bus does not have any multiplexers or switches is described
+/// to the I2C protocol stack with a single I2C bus configuration which
+/// specifies the I2C bus frequency.
+///
+/// An I2C bus with switches and multiplexers use an I2C bus configuration
+/// to describe each of the unique settings for the switches and multiplexers
+/// and the I2C bus frequency. However the I2C bus configuration management
+/// protocol only needs to define the I2C bus configurations that the software
+/// uses, which may be a subset of the total.
+///
+/// The I2C bus configuration description includes a list of I2C devices
+/// which may be accessed when this I2C bus configuration is enabled. I2C
+/// devices before a switch or multiplexer must be included in one I2C bus
+/// configuration while I2C devices after a switch or multiplexer are on
+/// another I2C bus configuration.
+///
+/// The I2C bus configuration management protocol is an optional protocol.
+/// When the I2C bus configuration protocol is not defined the I2C host
+/// protocol does not start and the I2C master protocol may be used for
+/// other purposes such as SMBus traffic. When the I2C bus configuration
+/// protocol is available, the I2C host protocol uses the I2C bus
+/// configuration protocol to call into the platform specific code to set
+/// the switches and multiplexers and set the maximum I2C bus frequency.
+///
+/// The platform designers determine the maximum I2C bus frequency by
+/// selecting a frequency which supports all of the I2C devices on the
+/// I2C bus for the setting of switches and multiplexers. The platform
+/// designers must validate this against the I2C device data sheets and
+/// any limits of the I2C controller or bus length.
+///
+/// During I2C device enumeration, the I2C bus driver retrieves the I2C
+/// bus configuration that must be used to perform I2C transactions to
+/// each I2C device. This I2C bus configuration value is passed into
+/// the I2C host protocol to identify the I2C bus configuration required
+/// to access a specific I2C device. The I2C host protocol calls
+/// EnableBusConfiguration() to set the switches and multiplexers in the
+/// I2C bus and the I2C clock frequency. The I2C host protocol may
+/// optimize calls to EnableBusConfiguration() by only making the call
+/// when the I2C bus configuration value changes between I2C requests.
+///
+/// When I2C transactions are required on the same I2C bus to change the
+/// state of multiplexers or switches, the I2C master protocol must be
+/// used to perform the necessary I2C transactions.
+///
+/// It is up to the platform specific code to choose the proper I2C bus
+/// configuration when ExitBootServices() is called. Some operating systems
+/// are not able to manage the I2C bus configurations and must use the I2C
+/// bus configuration that is established by the platform firmware before
+/// ExitBootServices() returns.
+///
+typedef struct _EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL;
+
+
+/**
+ Enable access to an I2C bus configuration.
+
+ This routine must be called at or below TPL_NOTIFY. For synchronous
+ requests this routine must be called at or below TPL_CALLBACK.
+
+ Reconfigure the switches and multiplexers in the I2C bus to enable
+ access to a specific I2C bus configuration. Also select the maximum
+ clock frequency for this I2C bus configuration.
+
+ This routine uses the I2C Master protocol to perform I2C transactions
+ on the local bus. This eliminates any recursion in the I2C stack for
+ configuration transactions on the same I2C bus. This works because the
+ local I2C bus is idle while the I2C bus configuration is being enabled.
+
+ If I2C transactions must be performed on other I2C busses, then the
+ EFI_I2C_HOST_PROTOCOL, the EFI_I2C_IO_PROTCOL, or a third party I2C
+ driver interface for a specific device must be used. This requirement
+ is because the I2C host protocol controls the flow of requests to the
+ I2C controller. Use the EFI_I2C_HOST_PROTOCOL when the I2C device is
+ not enumerated by the EFI_I2C_ENUMERATE_PROTOCOL. Use a protocol
+ produced by a third party driver when it is available or the
+ EFI_I2C_IO_PROTOCOL when the third party driver is not available but
+ the device is enumerated with the EFI_I2C_ENUMERATE_PROTOCOL.
+
+ When Event is NULL, EnableI2cBusConfiguration operates synchronously
+ and returns the I2C completion status as its return value.
+
+ @param[in] This Pointer to an EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL
+ structure.
+ @param[in] I2cBusConfiguration Index of an I2C bus configuration. All
+ values in the range of zero to N-1 are
+ valid where N is the total number of I2C
+ bus configurations for an I2C bus.
+ @param[in] Event Event to signal when the transaction is complete
+ @param[out] I2cStatus Buffer to receive the transaction status.
+
+ @return When Event is NULL, EnableI2cBusConfiguration operates synchrouously
+ and returns the I2C completion status as its return value. In this case it is
+ recommended to use NULL for I2cStatus. The values returned from
+ EnableI2cBusConfiguration are:
+
+ @retval EFI_SUCCESS The asynchronous bus configuration request
+ was successfully started when Event is not
+ NULL.
+ @retval EFI_SUCCESS The bus configuration request completed
+ successfully when Event is NULL.
+ @retval EFI_DEVICE_ERROR The bus configuration failed.
+ @retval EFI_NO_MAPPING Invalid I2cBusConfiguration value
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL_ENABLE_I2C_BUS_CONFIGURATION) (
+ IN CONST EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL *This,
+ IN UINTN I2cBusConfiguration,
+ IN EFI_EVENT Event OPTIONAL,
+ IN EFI_STATUS *I2cStatus OPTIONAL
+ );
+
+///
+/// I2C bus configuration management protocol
+///
+struct _EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL {
+ ///
+ /// Enable an I2C bus configuration for use.
+ ///
+ EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL_ENABLE_I2C_BUS_CONFIGURATION EnableI2cBusConfiguration;
+};
+
+///
+/// Reference to variable defined in the .DEC file
+///
+extern EFI_GUID gEfiI2cBusConfigurationManagementProtocolGuid;
+
+#endif // __I2C_BUS_CONFIGURATION_MANAGEMENT_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cEnumerate.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cEnumerate.h
new file mode 100644
index 0000000000..00f80d0b68
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cEnumerate.h
@@ -0,0 +1,110 @@
+/** @file
+ I2C Device Enumerate Protocol as defined in the PI 1.3 specification.
+
+ This protocol supports the enumerations of device on the I2C bus.
+
+ Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.3.
+
+**/
+
+#ifndef __I2C_ENUMERATE_H__
+#define __I2C_ENUMERATE_H__
+
+#include <Pi/PiI2c.h>
+
+#define EFI_I2C_ENUMERATE_PROTOCOL_GUID { 0xda8cd7c4, 0x1c00, 0x49e2, { 0x80, 0x3e, 0x52, 0x14, 0xe7, 0x01, 0x89, 0x4c }}
+
+typedef struct _EFI_I2C_ENUMERATE_PROTOCOL EFI_I2C_ENUMERATE_PROTOCOL;
+
+/**
+ Enumerate the I2C devices
+
+ This function enables the caller to traverse the set of I2C devices
+ on an I2C bus.
+
+ @param[in] This The platform data for the next device on
+ the I2C bus was returned successfully.
+ @param[in, out] Device Pointer to a buffer containing an
+ EFI_I2C_DEVICE structure. Enumeration is
+ started by setting the initial EFI_I2C_DEVICE
+ structure pointer to NULL. The buffer
+ receives an EFI_I2C_DEVICE structure pointer
+ to the next I2C device.
+
+ @retval EFI_SUCCESS The platform data for the next device on
+ the I2C bus was returned successfully.
+ @retval EFI_INVALID_PARAMETER Device is NULL
+ @retval EFI_NO_MAPPING *Device does not point to a valid
+ EFI_I2C_DEVICE structure returned in a
+ previous call Enumerate().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_I2C_ENUMERATE_PROTOCOL_ENUMERATE) (
+ IN CONST EFI_I2C_ENUMERATE_PROTOCOL *This,
+ IN OUT CONST EFI_I2C_DEVICE **Device
+ );
+
+/**
+ Get the requested I2C bus frequency for a specified bus configuration.
+
+ This function returns the requested I2C bus clock frequency for the
+ I2cBusConfiguration. This routine is provided for diagnostic purposes
+ and is meant to be called after calling Enumerate to get the
+ I2cBusConfiguration value.
+
+ @param[in] This Pointer to an EFI_I2C_ENUMERATE_PROTOCOL
+ structure.
+ @param[in] I2cBusConfiguration I2C bus configuration to access the I2C
+ device
+ @param[out] *BusClockHertz Pointer to a buffer to receive the I2C
+ bus clock frequency in Hertz
+
+ @retval EFI_SUCCESS The I2C bus frequency was returned
+ successfully.
+ @retval EFI_INVALID_PARAMETER BusClockHertz was NULL
+ @retval EFI_NO_MAPPING Invalid I2cBusConfiguration value
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_I2C_ENUMERATE_PROTOCOL_GET_BUS_FREQUENCY) (
+ IN CONST EFI_I2C_ENUMERATE_PROTOCOL *This,
+ IN UINTN I2cBusConfiguration,
+ OUT UINTN *BusClockHertz
+ );
+
+///
+/// I2C Enumerate protocol
+///
+struct _EFI_I2C_ENUMERATE_PROTOCOL {
+ ///
+ /// Traverse the set of I2C devices on an I2C bus. This routine
+ /// returns the next I2C device on an I2C bus.
+ ///
+ EFI_I2C_ENUMERATE_PROTOCOL_ENUMERATE Enumerate;
+
+ ///
+ /// Get the requested I2C bus frequency for a specified bus
+ /// configuration.
+ ///
+ EFI_I2C_ENUMERATE_PROTOCOL_GET_BUS_FREQUENCY GetBusFrequency;
+};
+
+///
+/// Reference to variable defined in the .DEC file
+///
+extern EFI_GUID gEfiI2cEnumerateProtocolGuid;
+
+#endif // __I2C_ENUMERATE_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cHost.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cHost.h
new file mode 100644
index 0000000000..fcd82de6b9
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cHost.h
@@ -0,0 +1,152 @@
+/** @file
+ I2C Host Protocol as defined in the PI 1.3 specification.
+
+ This protocol provides callers with the ability to do I/O transactions
+ to all of the devices on the I2C bus.
+
+ Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.3.
+
+**/
+
+#ifndef __I2C_HOST_H__
+#define __I2C_HOST_H__
+
+#include <Pi/PiI2c.h>
+
+#define EFI_I2C_HOST_PROTOCOL_GUID { 0xa5aab9e3, 0xc727, 0x48cd, { 0x8b, 0xbf, 0x42, 0x72, 0x33, 0x85, 0x49, 0x48 }}
+
+///
+/// I2C Host Protocol
+///
+/// The I2C bus driver uses the services of the EFI_I2C_HOST_PROTOCOL
+/// to produce an instance of the EFI_I2C_IO_PROTOCOL for each I2C
+/// device on an I2C bus.
+///
+/// The EFI_I2C_HOST_PROTOCOL exposes an asynchronous interface to
+/// callers to perform transactions to any device on the I2C bus.
+/// Internally, the I2C host protocol manages the flow of the I2C
+/// transactions to the host controller, keeping them in FIFO order.
+/// Prior to each transaction, the I2C host protocol ensures that the
+/// switches and multiplexers are properly configured. The I2C host
+/// protocol then starts the transaction on the host controller using
+/// the EFI_I2C_MASTER_PROTOCOL.
+///
+typedef struct _EFI_I2C_HOST_PROTOCOL EFI_I2C_HOST_PROTOCOL;
+
+
+/**
+ Queue an I2C transaction for execution on the I2C controller.
+
+ This routine must be called at or below TPL_NOTIFY. For
+ synchronous requests this routine must be called at or below
+ TPL_CALLBACK.
+
+ The I2C host protocol uses the concept of I2C bus configurations
+ to describe the I2C bus. An I2C bus configuration is defined as
+ a unique setting of the multiplexers and switches in the I2C bus
+ which enable access to one or more I2C devices. When using a
+ switch to divide a bus, due to bus frequency differences, the
+ I2C bus configuration management protocol defines an I2C bus
+ configuration for the I2C devices on each side of the switch.
+ When using a multiplexer, the I2C bus configuration management
+ defines an I2C bus configuration for each of the selector values
+ required to control the multiplexer. See Figure 1 in the I2C -bus
+ specification and user manual for a complex I2C bus configuration.
+
+ The I2C host protocol processes all transactions in FIFO order.
+ Prior to performing the transaction, the I2C host protocol calls
+ EnableI2cBusConfiguration to reconfigure the switches and
+ multiplexers in the I2C bus enabling access to the specified I2C
+ device. The EnableI2cBusConfiguration also selects the I2C bus
+ frequency for the I2C device. After the I2C bus is configured,
+ the I2C host protocol calls the I2C master protocol to start the
+ I2C transaction.
+
+ When Event is NULL, QueueRequest() operates synchronously and
+ returns the I2C completion status as its return value.
+
+ When Event is not NULL, QueueRequest() synchronously returns
+ EFI_SUCCESS indicating that the asynchronously I2C transaction was
+ queued. The values above are returned in the buffer pointed to by
+ I2cStatus upon the completion of the I2C transaction when I2cStatus
+ is not NULL.
+
+ @param[in] This Pointer to an EFI_I2C_HOST_PROTOCOL structure.
+ @param[in] I2cBusConfiguration I2C bus configuration to access the I2C
+ device
+ @param[in] SlaveAddress Address of the device on the I2C bus. Set
+ the I2C_ADDRESSING_10_BIT when using 10-bit
+ addresses, clear this bit for 7-bit addressing.
+ Bits 0-6 are used for 7-bit I2C slave addresses
+ and bits 0-9 are used for 10-bit I2C slave
+ addresses.
+ @param[in] Event Event to signal for asynchronous transactions,
+ NULL for synchronous transactions
+ @param[in] RequestPacket Pointer to an EFI_I2C_REQUEST_PACKET structure
+ describing the I2C transaction
+ @param[out] I2cStatus Optional buffer to receive the I2C transaction
+ completion status
+
+ @retval EFI_SUCCESS The asynchronous transaction was successfully
+ queued when Event is not NULL.
+ @retval EFI_SUCCESS The transaction completed successfully when
+ Event is NULL.
+ @retval EFI_BAD_BUFFER_SIZE The RequestPacket->LengthInBytes value is
+ too large.
+ @retval EFI_DEVICE_ERROR There was an I2C error (NACK) during the
+ transaction.
+ @retval EFI_INVALID_PARAMETER RequestPacket is NULL
+ @retval EFI_NOT_FOUND Reserved bit set in the SlaveAddress parameter
+ @retval EFI_NO_MAPPING Invalid I2cBusConfiguration value
+ @retval EFI_NO_RESPONSE The I2C device is not responding to the slave
+ address. EFI_DEVICE_ERROR will be returned
+ if the controller cannot distinguish when the
+ NACK occurred.
+ @retval EFI_OUT_OF_RESOURCES Insufficient memory for I2C transaction
+ @retval EFI_UNSUPPORTED The controller does not support the requested
+ transaction.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_I2C_HOST_PROTOCOL_QUEUE_REQUEST) (
+ IN CONST EFI_I2C_HOST_PROTOCOL *This,
+ IN UINTN I2cBusConfiguration,
+ IN UINTN SlaveAddress,
+ IN EFI_EVENT Event OPTIONAL,
+ IN EFI_I2C_REQUEST_PACKET *RequestPacket,
+ OUT EFI_STATUS *I2cStatus OPTIONAL
+ );
+
+///
+/// I2C Host Protocol
+///
+struct _EFI_I2C_HOST_PROTOCOL {
+ ///
+ /// Queue an I2C transaction for execution on the I2C bus
+ ///
+ EFI_I2C_HOST_PROTOCOL_QUEUE_REQUEST QueueRequest;
+
+ ///
+ /// Pointer to an EFI_I2C_CONTROLLER_CAPABILITIES data structure
+ /// containing the capabilities of the I2C host controller.
+ ///
+ CONST EFI_I2C_CONTROLLER_CAPABILITIES *I2cControllerCapabilities;
+};
+
+///
+/// Reference to variable defined in the .DEC file
+///
+extern EFI_GUID gEfiI2cHostProtocolGuid;
+
+#endif // __I2C_HOST_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cIo.h
new file mode 100644
index 0000000000..4e4267d838
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cIo.h
@@ -0,0 +1,172 @@
+/** @file
+ I2C I/O Protocol as defined in the PI 1.3 specification.
+
+ The EFI I2C I/O protocol enables the user to manipulate a single
+ I2C device independent of the host controller and I2C design.
+
+ Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.3.
+
+**/
+
+#ifndef __I2C_IO_H__
+#define __I2C_IO_H__
+
+#include <Pi/PiI2c.h>
+
+#define EFI_I2C_IO_PROTOCOL_GUID { 0xb60a3e6b, 0x18c4, 0x46e5, { 0xa2, 0x9a, 0xc9, 0xa1, 0x06, 0x65, 0xa2, 0x8e }}
+
+///
+/// I2C I/O protocol
+///
+/// The I2C IO protocol enables access to a specific device on the I2C
+/// bus.
+///
+/// Each I2C device is identified uniquely in the system by the tuple
+/// DeviceGuid:DeviceIndex. The DeviceGuid represents the manufacture
+/// and part number and is provided by the silicon vendor or the third
+/// party I2C device driver writer. The DeviceIndex identifies the part
+/// within the system by using a unique number and is created by the
+/// board designer or the writer of the EFI_I2C_ENUMERATE_PROTOCOL.
+///
+/// I2C slave addressing is abstracted to validate addresses and limit
+/// operation to the specified I2C device. The third party providing
+/// the I2C device support provides an ordered list of slave addresses
+/// for the I2C device required to implement the EFI_I2C_ENUMERATE_PROTOCOL.
+/// The order of the list must be preserved.
+///
+typedef struct _EFI_I2C_IO_PROTOCOL EFI_I2C_IO_PROTOCOL;
+
+
+/**
+ Queue an I2C transaction for execution on the I2C device.
+
+ This routine must be called at or below TPL_NOTIFY. For synchronous
+ requests this routine must be called at or below TPL_CALLBACK.
+
+ This routine queues an I2C transaction to the I2C controller for
+ execution on the I2C bus.
+
+ When Event is NULL, QueueRequest() operates synchronously and returns
+ the I2C completion status as its return value.
+
+ When Event is not NULL, QueueRequest() synchronously returns EFI_SUCCESS
+ indicating that the asynchronous I2C transaction was queued. The values
+ above are returned in the buffer pointed to by I2cStatus upon the
+ completion of the I2C transaction when I2cStatus is not NULL.
+
+ The upper layer driver writer provides the following to the platform
+ vendor:
+
+ 1. Vendor specific GUID for the I2C part
+ 2. Guidance on proper construction of the slave address array when the
+ I2C device uses more than one slave address. The I2C bus protocol
+ uses the SlaveAddressIndex to perform relative to physical address
+ translation to access the blocks of hardware within the I2C device.
+
+ @param[in] This Pointer to an EFI_I2C_IO_PROTOCOL structure.
+ @param[in] SlaveAddressIndex Index value into an array of slave addresses
+ for the I2C device. The values in the array
+ are specified by the board designer, with the
+ third party I2C device driver writer providing
+ the slave address order.
+
+ For devices that have a single slave address,
+ this value must be zero. If the I2C device
+ uses more than one slave address then the
+ third party (upper level) I2C driver writer
+ needs to specify the order of entries in the
+ slave address array.
+
+ \ref ThirdPartyI2cDrivers "Third Party I2C
+ Drivers" section in I2cMaster.h.
+ @param[in] Event Event to signal for asynchronous transactions,
+ NULL for synchronous transactions
+ @param[in] RequestPacket Pointer to an EFI_I2C_REQUEST_PACKET structure
+ describing the I2C transaction
+ @param[out] I2cStatus Optional buffer to receive the I2C transaction
+ completion status
+
+ @retval EFI_SUCCESS The asynchronous transaction was successfully
+ queued when Event is not NULL.
+ @retval EFI_SUCCESS The transaction completed successfully when
+ Event is NULL.
+ @retval EFI_BAD_BUFFER_SIZE The RequestPacket->LengthInBytes value is too
+ large.
+ @retval EFI_DEVICE_ERROR There was an I2C error (NACK) during the
+ transaction.
+ @retval EFI_INVALID_PARAMETER RequestPacket is NULL.
+ @retval EFI_NO_MAPPING The EFI_I2C_HOST_PROTOCOL could not set the
+ bus configuration required to access this I2C
+ device.
+ @retval EFI_NO_RESPONSE The I2C device is not responding to the slave
+ address selected by SlaveAddressIndex.
+ EFI_DEVICE_ERROR will be returned if the
+ controller cannot distinguish when the NACK
+ occurred.
+ @retval EFI_OUT_OF_RESOURCES Insufficient memory for I2C transaction
+ @retval EFI_UNSUPPORTED The controller does not support the requested
+ transaction.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_I2C_IO_PROTOCOL_QUEUE_REQUEST) (
+ IN CONST EFI_I2C_IO_PROTOCOL *This,
+ IN UINTN SlaveAddressIndex,
+ IN EFI_EVENT Event OPTIONAL,
+ IN EFI_I2C_REQUEST_PACKET *RequestPacket,
+ OUT EFI_STATUS *I2cStatus OPTIONAL
+ );
+
+///
+/// I2C I/O protocol
+///
+struct _EFI_I2C_IO_PROTOCOL {
+ ///
+ /// Queue an I2C transaction for execution on the I2C device.
+ ///
+ EFI_I2C_IO_PROTOCOL_QUEUE_REQUEST QueueRequest;
+
+ ///
+ /// Unique value assigned by the silicon manufacture or the third
+ /// party I2C driver writer for the I2C part. This value logically
+ /// combines both the manufacture name and the I2C part number into
+ /// a single value specified as a GUID.
+ ///
+ CONST EFI_GUID *DeviceGuid;
+
+ ///
+ /// Unique ID of the I2C part within the system
+ ///
+ UINT32 DeviceIndex;
+
+ ///
+ /// Hardware revision - ACPI _HRV value. See the Advanced Configuration
+ /// and Power Interface Specification, Revision 5.0 for the field format
+ /// and the Plug and play support for I2C web-page for restriction on values.
+ ///
+ UINT32 HardwareRevision;
+
+ ///
+ /// Pointer to an EFI_I2C_CONTROLLER_CAPABILITIES data structure containing
+ /// the capabilities of the I2C host controller.
+ ///
+ CONST EFI_I2C_CONTROLLER_CAPABILITIES *I2cControllerCapabilities;
+};
+
+///
+/// Reference to variable defined in the .DEC file
+///
+extern EFI_GUID gEfiI2cIoProtocolGuid;
+
+#endif // __I2C_IO_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cMaster.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cMaster.h
new file mode 100644
index 0000000000..26f689788c
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/I2cMaster.h
@@ -0,0 +1,192 @@
+/** @file
+ I2C Master Protocol as defined in the PI 1.3 specification.
+
+ This protocol manipulates the I2C host controller to perform transactions as a master
+ on the I2C bus using the current state of any switches or multiplexers in the I2C bus.
+
+ Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.3.
+
+**/
+
+#ifndef __I2C_MASTER_H__
+#define __I2C_MASTER_H__
+
+#include <Pi/PiI2c.h>
+
+#define EFI_I2C_MASTER_PROTOCOL_GUID { 0xcd72881f, 0x45b5, 0x4feb, { 0x98, 0xc8, 0x31, 0x3d, 0xa8, 0x11, 0x74, 0x62 }}
+
+typedef struct _EFI_I2C_MASTER_PROTOCOL EFI_I2C_MASTER_PROTOCOL;
+
+/**
+ Set the frequency for the I2C clock line.
+
+ This routine must be called at or below TPL_NOTIFY.
+
+ The software and controller do a best case effort of using the specified
+ frequency for the I2C bus. If the frequency does not match exactly then
+ the I2C master protocol selects the next lower frequency to avoid
+ exceeding the operating conditions for any of the I2C devices on the bus.
+ For example if 400 KHz was specified and the controller's divide network
+ only supports 402 KHz or 398 KHz then the I2C master protocol selects 398
+ KHz. If there are not lower frequencies available, then return
+ EFI_UNSUPPORTED.
+
+ @param[in] This Pointer to an EFI_I2C_MASTER_PROTOCOL structure
+ @param[in] BusClockHertz Pointer to the requested I2C bus clock frequency
+ in Hertz. Upon return this value contains the
+ actual frequency in use by the I2C controller.
+
+ @retval EFI_SUCCESS The bus frequency was set successfully.
+ @retval EFI_ALREADY_STARTED The controller is busy with another transaction.
+ @retval EFI_INVALID_PARAMETER BusClockHertz is NULL
+ @retval EFI_UNSUPPORTED The controller does not support this frequency.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_I2C_MASTER_PROTOCOL_SET_BUS_FREQUENCY) (
+ IN CONST EFI_I2C_MASTER_PROTOCOL *This,
+ IN OUT UINTN *BusClockHertz
+ );
+
+/**
+ Reset the I2C controller and configure it for use
+
+ This routine must be called at or below TPL_NOTIFY.
+
+ The I2C controller is reset. The caller must call SetBusFrequench() after
+ calling Reset().
+
+ @param[in] This Pointer to an EFI_I2C_MASTER_PROTOCOL structure.
+
+ @retval EFI_SUCCESS The reset completed successfully.
+ @retval EFI_ALREADY_STARTED The controller is busy with another transaction.
+ @retval EFI_DEVICE_ERROR The reset operation failed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_I2C_MASTER_PROTOCOL_RESET) (
+ IN CONST EFI_I2C_MASTER_PROTOCOL *This
+ );
+
+/**
+ Start an I2C transaction on the host controller.
+
+ This routine must be called at or below TPL_NOTIFY. For synchronous
+ requests this routine must be called at or below TPL_CALLBACK.
+
+ This function initiates an I2C transaction on the controller. To
+ enable proper error handling by the I2C protocol stack, the I2C
+ master protocol does not support queuing but instead only manages
+ one I2C transaction at a time. This API requires that the I2C bus
+ is in the correct configuration for the I2C transaction.
+
+ The transaction is performed by sending a start-bit and selecting the
+ I2C device with the specified I2C slave address and then performing
+ the specified I2C operations. When multiple operations are requested
+ they are separated with a repeated start bit and the slave address.
+ The transaction is terminated with a stop bit.
+
+ When Event is NULL, StartRequest operates synchronously and returns
+ the I2C completion status as its return value.
+
+ When Event is not NULL, StartRequest synchronously returns EFI_SUCCESS
+ indicating that the I2C transaction was started asynchronously. The
+ transaction status value is returned in the buffer pointed to by
+ I2cStatus upon the completion of the I2C transaction when I2cStatus
+ is not NULL. After the transaction status is returned the Event is
+ signaled.
+
+ Note: The typical consumer of this API is the I2C host protocol.
+ Extreme care must be taken by other consumers of this API to prevent
+ confusing the third party I2C drivers due to a state change at the
+ I2C device which the third party I2C drivers did not initiate. I2C
+ platform specific code may use this API within these guidelines.
+
+ @param[in] This Pointer to an EFI_I2C_MASTER_PROTOCOL structure.
+ @param[in] SlaveAddress Address of the device on the I2C bus. Set the
+ I2C_ADDRESSING_10_BIT when using 10-bit addresses,
+ clear this bit for 7-bit addressing. Bits 0-6
+ are used for 7-bit I2C slave addresses and bits
+ 0-9 are used for 10-bit I2C slave addresses.
+ @param[in] RequestPacket Pointer to an EFI_I2C_REQUEST_PACKET
+ structure describing the I2C transaction.
+ @param[in] Event Event to signal for asynchronous transactions,
+ NULL for asynchronous transactions
+ @param[out] I2cStatus Optional buffer to receive the I2C transaction
+ completion status
+
+ @retval EFI_SUCCESS The asynchronous transaction was successfully
+ started when Event is not NULL.
+ @retval EFI_SUCCESS The transaction completed successfully when
+ Event is NULL.
+ @retval EFI_ALREADY_STARTED The controller is busy with another transaction.
+ @retval EFI_BAD_BUFFER_SIZE The RequestPacket->LengthInBytes value is too
+ large.
+ @retval EFI_DEVICE_ERROR There was an I2C error (NACK) during the
+ transaction.
+ @retval EFI_INVALID_PARAMETER RequestPacket is NULL
+ @retval EFI_NOT_FOUND Reserved bit set in the SlaveAddress parameter
+ @retval EFI_NO_RESPONSE The I2C device is not responding to the slave
+ address. EFI_DEVICE_ERROR will be returned if
+ the controller cannot distinguish when the NACK
+ occurred.
+ @retval EFI_OUT_OF_RESOURCES Insufficient memory for I2C transaction
+ @retval EFI_UNSUPPORTED The controller does not support the requested
+ transaction.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_I2C_MASTER_PROTOCOL_START_REQUEST) (
+ IN CONST EFI_I2C_MASTER_PROTOCOL *This,
+ IN UINTN SlaveAddress,
+ IN EFI_I2C_REQUEST_PACKET *RequestPacket,
+ IN EFI_EVENT Event OPTIONAL,
+ OUT EFI_STATUS *I2cStatus OPTIONAL
+ );
+
+///
+/// I2C master mode protocol
+///
+/// This protocol manipulates the I2C host controller to perform transactions as a
+/// master on the I2C bus using the current state of any switches or multiplexers
+/// in the I2C bus.
+///
+struct _EFI_I2C_MASTER_PROTOCOL {
+ ///
+ /// Set the clock frequency for the I2C bus.
+ ///
+ EFI_I2C_MASTER_PROTOCOL_SET_BUS_FREQUENCY SetBusFrequency;
+
+ ///
+ /// Reset the I2C host controller.
+ ///
+ EFI_I2C_MASTER_PROTOCOL_RESET Reset;
+
+ ///
+ /// Start an I2C transaction in master mode on the host controller.
+ ///
+ EFI_I2C_MASTER_PROTOCOL_START_REQUEST StartRequest;
+
+ ///
+ /// Pointer to an EFI_I2C_CONTROLLER_CAPABILITIES data structure containing
+ /// the capabilities of the I2C host controller.
+ ///
+ CONST EFI_I2C_CONTROLLER_CAPABILITIES *I2cControllerCapabilities;
+};
+
+extern EFI_GUID gEfiI2cMasterProtocolGuid;
+
+#endif // __I2C_MASTER_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IScsiInitiatorName.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IScsiInitiatorName.h
new file mode 100644
index 0000000000..5dffaeedf9
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IScsiInitiatorName.h
@@ -0,0 +1,87 @@
+/** @file
+ EFI_ISCSI_INITIATOR_NAME_PROTOCOL as defined in UEFI 2.0.
+ It provides the ability to get and set the iSCSI Initiator Name.
+
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ISCSI_INITIATOR_NAME_H__
+#define __ISCSI_INITIATOR_NAME_H__
+
+#define EFI_ISCSI_INITIATOR_NAME_PROTOCOL_GUID \
+{ \
+ 0x59324945, 0xec44, 0x4c0d, {0xb1, 0xcd, 0x9d, 0xb1, 0x39, 0xdf, 0x7, 0xc } \
+}
+
+typedef struct _EFI_ISCSI_INITIATOR_NAME_PROTOCOL EFI_ISCSI_INITIATOR_NAME_PROTOCOL;
+
+/**
+ Retrieves the current set value of iSCSI Initiator Name.
+
+ @param This Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.
+ @param BufferSize Size of the buffer in bytes pointed to by Buffer / Actual size of the
+ variable data buffer.
+ @param Buffer Pointer to the buffer for data to be read. The data is a null-terminated UTF-8 encoded string.
+ The maximum length is 223 characters, including the null-terminator.
+
+ @retval EFI_SUCCESS Data was successfully retrieved into the provided buffer and the
+ BufferSize was sufficient to handle the iSCSI initiator name
+ @retval EFI_BUFFER_TOO_SMALL BufferSize is too small for the result.
+ @retval EFI_INVALID_PARAMETER BufferSize or Buffer is NULL.
+ @retval EFI_DEVICE_ERROR The iSCSI initiator name could not be retrieved due to a hardware error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ISCSI_INITIATOR_NAME_GET)(
+ IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+ );
+
+
+
+/**
+ Sets the iSCSI Initiator Name.
+
+ @param This Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.
+ @param BufferSize Size of the buffer in bytes pointed to by Buffer.
+ @param Buffer Pointer to the buffer for data to be written. The data is a null-terminated UTF-8 encoded string.
+ The maximum length is 223 characters, including the null-terminator.
+
+ @retval EFI_SUCCESS Data was successfully stored by the protocol.
+ @retval EFI_UNSUPPORTED Platform policies do not allow for data to be written.
+ @retval EFI_INVALID_PARAMETER BufferSize or Buffer is NULL, or BufferSize exceeds the maximum allowed limit.
+ @retval EFI_DEVICE_ERROR The data could not be stored due to a hardware error.
+ @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data.
+ @retval EFI_PROTOCOL_ERROR Input iSCSI initiator name does not adhere to RFC 3720
+ (and other related protocols)
+
+**/
+typedef EFI_STATUS
+(EFIAPI *EFI_ISCSI_INITIATOR_NAME_SET)(
+ IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer
+ );
+
+///
+/// iSCSI Initiator Name Protocol for setting and obtaining the iSCSI Initiator Name.
+///
+struct _EFI_ISCSI_INITIATOR_NAME_PROTOCOL {
+ EFI_ISCSI_INITIATOR_NAME_GET Get;
+ EFI_ISCSI_INITIATOR_NAME_SET Set;
+};
+
+extern EFI_GUID gEfiIScsiInitiatorNameProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IdeControllerInit.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IdeControllerInit.h
new file mode 100644
index 0000000000..c099af3084
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IdeControllerInit.h
@@ -0,0 +1,565 @@
+/** @file
+ This file declares EFI IDE Controller Init Protocol
+
+ The EFI_IDE_CONTROLLER_INIT_PROTOCOL provides the chipset-specific information
+ to the driver entity. This protocol is mandatory for IDE controllers if the
+ IDE devices behind the controller are to be enumerated by a driver entity.
+
+ There can only be one instance of EFI_IDE_CONTROLLER_INIT_PROTOCOL for each IDE
+ controller in a system. It is installed on the handle that corresponds to the
+ IDE controller. A driver entity that wishes to manage an IDE bus and possibly
+ IDE devices in a system will have to retrieve the EFI_IDE_CONTROLLER_INIT_PROTOCOL
+ instance that is associated with the controller to be managed.
+
+ A device handle for an IDE controller must contain an EFI_DEVICE_PATH_PROTOCOL.
+
+Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is defined in UEFI Platform Initialization Specification 1.2
+ Volume 5: Standards.
+
+**/
+
+#ifndef _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H_
+#define _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H_
+
+#include <IndustryStandard/Atapi.h>
+
+///
+/// Global ID for the EFI_IDE_CONTROLLER_INIT_PROTOCOL.
+///
+#define EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID \
+ { \
+ 0xa1e37052, 0x80d9, 0x4e65, {0xa3, 0x17, 0x3e, 0x9a, 0x55, 0xc4, 0x3e, 0xc9 } \
+ }
+
+///
+/// Forward declaration for EFI_IDE_CONTROLLER_INIT_PROTOCOL.
+///
+typedef struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL EFI_IDE_CONTROLLER_INIT_PROTOCOL;
+
+///
+/// The phase of the IDE Controller enumeration.
+///
+typedef enum {
+ ///
+ /// The driver entity is about to begin enumerating the devices
+ /// behind the specified channel. This notification can be used to
+ /// perform any chipset-specific programming.
+ ///
+ EfiIdeBeforeChannelEnumeration,
+ ///
+ /// The driver entity has completed enumerating the devices
+ /// behind the specified channel. This notification can be used to
+ /// perform any chipset-specific programming.
+ ///
+ EfiIdeAfterChannelEnumeration,
+ ///
+ /// The driver entity is about to reset the devices behind the
+ /// specified channel. This notification can be used to perform any
+ /// chipset-specific programming.
+ ///
+ EfiIdeBeforeChannelReset,
+ ///
+ /// The driver entity has completed resetting the devices behind
+ /// the specified channel. This notification can be used to perform
+ /// any chipset-specific programming.
+ ///
+ EfiIdeAfterChannelReset,
+ ///
+ /// The driver entity is about to detect the presence of devices
+ /// behind the specified channel. This notification can be used to
+ /// set up the bus signals to default levels or for implementing
+ /// predelays.
+ ///
+ EfiIdeBusBeforeDevicePresenceDetection,
+ ///
+ /// The driver entity is done with detecting the presence of
+ /// devices behind the specified channel. This notification can be
+ /// used to perform any chipset-specific programming.
+ ///
+ EfiIdeBusAfterDevicePresenceDetection,
+ ///
+ /// The IDE bus is requesting the IDE controller driver to
+ /// reprogram the IDE controller hardware and thereby reset all
+ /// the mode and timing settings to default settings.
+ ///
+ EfiIdeResetMode,
+ EfiIdeBusPhaseMaximum
+} EFI_IDE_CONTROLLER_ENUM_PHASE;
+
+///
+/// This extended mode describes the SATA physical protocol.
+/// SATA physical layers can operate at different speeds.
+/// These speeds are defined below. Various PATA protocols
+/// and associated modes are not applicable to SATA devices.
+///
+typedef enum {
+ EfiAtaSataTransferProtocol
+} EFI_ATA_EXT_TRANSFER_PROTOCOL;
+
+///
+/// Automatically detects the optimum SATA speed.
+///
+#define EFI_SATA_AUTO_SPEED 0
+
+///
+/// Indicates a first-generation (Gen1) SATA speed.
+///
+#define EFI_SATA_GEN1_SPEED 1
+
+///
+/// Indicates a second-generation (Gen2) SATA speed.
+///
+#define EFI_SATA_GEN2_SPEED 2
+
+///
+/// EFI_ATA_MODE structure.
+///
+typedef struct {
+ BOOLEAN Valid; ///< TRUE if Mode is valid.
+ UINT32 Mode; ///< The actual ATA mode. This field is not a bit map.
+} EFI_ATA_MODE;
+
+///
+/// EFI_ATA_EXTENDED_MODE structure
+///
+typedef struct {
+ ///
+ /// An enumeration defining various transfer protocols other than the protocols
+ /// that exist at the time this specification was developed (i.e., PIO, single
+ /// word DMA, multiword DMA, and UDMA). Each transfer protocol is associated
+ /// with a mode. The various transfer protocols are defined by the ATA/ATAPI
+ /// specification. This enumeration makes the interface extensible because we
+ /// can support new transport protocols beyond UDMA. Type EFI_ATA_EXT_TRANSFER_PROTOCOL
+ /// is defined below.
+ ///
+ EFI_ATA_EXT_TRANSFER_PROTOCOL TransferProtocol;
+ ///
+ /// The mode for operating the transfer protocol that is identified by TransferProtocol.
+ ///
+ UINT32 Mode;
+} EFI_ATA_EXTENDED_MODE;
+
+///
+/// EFI_ATA_COLLECTIVE_MODE structure.
+///
+typedef struct {
+ ///
+ /// This field specifies the PIO mode. PIO modes are defined in the ATA/ATAPI
+ /// specification. The ATA/ATAPI specification defines the enumeration. In
+ /// other words, a value of 1 in this field means PIO mode 1. The actual meaning
+ /// of PIO mode 1 is governed by the ATA/ATAPI specification. Type EFI_ATA_MODE
+ /// is defined below.
+ ///
+ EFI_ATA_MODE PioMode;
+ ///
+ /// This field specifies the single word DMA mode. Single word DMA modes are defined
+ /// in the ATA/ATAPI specification, versions 1 and 2. Single word DMA support was
+ /// obsoleted in the ATA/ATAPI specification, version 3. Therefore, most devices and
+ /// controllers will not support this transfer mode. The ATA/ATAPI specification defines
+ /// the enumeration. In other words, a value of 1 in this field means single word DMA
+ /// mode 1. The actual meaning of single word DMA mode 1 is governed by the ATA/
+ /// ATAPI specification.
+ ///
+ EFI_ATA_MODE SingleWordDmaMode;
+ ///
+ /// This field specifies the multiword DMA mode. Various multiword DMA modes are
+ /// defined in the ATA/ATAPI specification. A value of 1 in this field means multiword
+ /// DMA mode 1. The actual meaning of multiword DMA mode 1 is governed by the
+ /// ATA/ATAPI specification.
+ ///
+ EFI_ATA_MODE MultiWordDmaMode;
+ ///
+ /// This field specifies the ultra DMA (UDMA) mode. UDMA modes are defined in the
+ /// ATA/ATAPI specification. A value of 1 in this field means UDMA mode 1. The
+ /// actual meaning of UDMA mode 1 is governed by the ATA/ATAPI specification.
+ ///
+ EFI_ATA_MODE UdmaMode;
+ ///
+ /// The number of extended-mode bitmap entries. Extended modes describe transfer
+ /// protocols beyond PIO, single word DMA, multiword DMA, and UDMA. This field
+ /// can be zero and provides extensibility.
+ ///
+ UINT32 ExtModeCount;
+ ///
+ /// ExtModeCount number of entries. Each entry represents a transfer protocol other
+ /// than the ones defined above (i.e., PIO, single word DMA, multiword DMA, and
+ /// UDMA). This field is defined for extensibility. At this time, only one extended
+ /// transfer protocol is defined to cover SATA transfers. Type
+ /// EFI_ATA_EXTENDED_MODE is defined below.
+ ///
+ EFI_ATA_EXTENDED_MODE ExtMode[1];
+} EFI_ATA_COLLECTIVE_MODE;
+
+///
+/// EFI_ATA_IDENTIFY_DATA & EFI_ATAPI_IDENTIFY_DATA structure
+///
+/// The definition of these two structures is not part of the protocol
+/// definition because the ATA/ATAPI Specification controls the definition
+/// of all the fields. The ATA/ATAPI Specification can obsolete old fields
+/// or redefine existing fields.
+typedef ATA_IDENTIFY_DATA EFI_ATA_IDENTIFY_DATA;
+typedef ATAPI_IDENTIFY_DATA EFI_ATAPI_IDENTIFY_DATA;
+
+///
+/// This flag indicates whether the IDENTIFY data is a response from an ATA device
+/// (EFI_ATA_IDENTIFY_DATA) or response from an ATAPI device
+/// (EFI_ATAPI_IDENTIFY_DATA). According to the ATA/ATAPI specification,
+/// EFI_IDENTIFY_DATA is for an ATA device if bit 15 of the Config field is zero.
+/// The Config field is common to both EFI_ATA_IDENTIFY_DATA and
+/// EFI_ATAPI_IDENTIFY_DATA.
+///
+#define EFI_ATAPI_DEVICE_IDENTIFY_DATA 0x8000
+
+///
+/// EFI_IDENTIFY_DATA structure.
+///
+typedef union {
+ ///
+ /// The data that is returned by an ATA device upon successful completion
+ /// of the ATA IDENTIFY_DEVICE command.
+ ///
+ EFI_ATA_IDENTIFY_DATA AtaData;
+ ///
+ /// The data that is returned by an ATAPI device upon successful completion
+ /// of the ATA IDENTIFY_PACKET_DEVICE command.
+ ///
+ EFI_ATAPI_IDENTIFY_DATA AtapiData;
+} EFI_IDENTIFY_DATA;
+
+/**
+ Returns the information about the specified IDE channel.
+
+ This function can be used to obtain information about a particular IDE channel.
+ The driver entity uses this information during the enumeration process.
+
+ If Enabled is set to FALSE, the driver entity will not scan the channel. Note
+ that it will not prevent an operating system driver from scanning the channel.
+
+ For most of today's controllers, MaxDevices will either be 1 or 2. For SATA
+ controllers, this value will always be 1. SATA configurations can contain SATA
+ port multipliers. SATA port multipliers behave like SATA bridges and can support
+ up to 16 devices on the other side. If a SATA port out of the IDE controller
+ is connected to a port multiplier, MaxDevices will be set to the number of SATA
+ devices that the port multiplier supports. Because today's port multipliers
+ support up to fifteen SATA devices, this number can be as large as fifteen. The IDE
+ bus driver is required to scan for the presence of port multipliers behind an SATA
+ controller and enumerate up to MaxDevices number of devices behind the port
+ multiplier.
+
+ In this context, the devices behind a port multiplier constitute a channel.
+
+ @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
+ @param[in] Channel Zero-based channel number.
+ @param[out] Enabled TRUE if this channel is enabled. Disabled channels
+ are not scanned to see if any devices are present.
+ @param[out] MaxDevices The maximum number of IDE devices that the bus driver
+ can expect on this channel. For the ATA/ATAPI
+ specification, version 6, this number will either be
+ one or two. For Serial ATA (SATA) configurations with a
+ port multiplier, this number can be as large as fifteen.
+
+ @retval EFI_SUCCESS Information was returned without any errors.
+ @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IDE_CONTROLLER_GET_CHANNEL_INFO)(
+ IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
+ IN UINT8 Channel,
+ OUT BOOLEAN *Enabled,
+ OUT UINT8 *MaxDevices
+ );
+
+/**
+ The notifications from the driver entity that it is about to enter a certain
+ phase of the IDE channel enumeration process.
+
+ This function can be used to notify the IDE controller driver to perform
+ specific actions, including any chipset-specific initialization, so that the
+ chipset is ready to enter the next phase. Seven notification points are defined
+ at this time.
+
+ More synchronization points may be added as required in the future.
+
+ @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
+ @param[in] Phase The phase during enumeration.
+ @param[in] Channel Zero-based channel number.
+
+ @retval EFI_SUCCESS The notification was accepted without any errors.
+ @retval EFI_UNSUPPORTED Phase is not supported.
+ @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
+ @retval EFI_NOT_READY This phase cannot be entered at this time; for
+ example, an attempt was made to enter a Phase
+ without having entered one or more previous
+ Phase.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IDE_CONTROLLER_NOTIFY_PHASE)(
+ IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
+ IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase,
+ IN UINT8 Channel
+ );
+
+/**
+ Submits the device information to the IDE controller driver.
+
+ This function is used by the driver entity to pass detailed information about
+ a particular device to the IDE controller driver. The driver entity obtains
+ this information by issuing an ATA or ATAPI IDENTIFY_DEVICE command. IdentifyData
+ is the pointer to the response data buffer. The IdentifyData buffer is owned
+ by the driver entity, and the IDE controller driver must make a local copy
+ of the entire buffer or parts of the buffer as needed. The original IdentifyData
+ buffer pointer may not be valid when
+
+ - EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() or
+ - EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() is called at a later point.
+
+ The IDE controller driver may consult various fields of EFI_IDENTIFY_DATA to
+ compute the optimum mode for the device. These fields are not limited to the
+ timing information. For example, an implementation of the IDE controller driver
+ may examine the vendor and type/mode field to match known bad drives.
+
+ The driver entity may submit drive information in any order, as long as it
+ submits information for all the devices belonging to the enumeration group
+ before EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() is called for any device
+ in that enumeration group. If a device is absent, EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
+ should be called with IdentifyData set to NULL. The IDE controller driver may
+ not have any other mechanism to know whether a device is present or not. Therefore,
+ setting IdentifyData to NULL does not constitute an error condition.
+ EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData() can be called only once for a
+ given (Channel, Device) pair.
+
+ @param[in] This A pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
+ @param[in] Channel Zero-based channel number.
+ @param[in] Device Zero-based device number on the Channel.
+ @param[in] IdentifyData The device's response to the ATA IDENTIFY_DEVICE command.
+
+ @retval EFI_SUCCESS The information was accepted without any errors.
+ @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
+ @retval EFI_INVALID_PARAMETER Device is invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IDE_CONTROLLER_SUBMIT_DATA)(
+ IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
+ IN UINT8 Channel,
+ IN UINT8 Device,
+ IN EFI_IDENTIFY_DATA *IdentifyData
+ );
+
+/**
+ Disqualifies specific modes for an IDE device.
+
+ This function allows the driver entity or other drivers (such as platform
+ drivers) to reject certain timing modes and request the IDE controller driver
+ to recalculate modes. This function allows the driver entity and the IDE
+ controller driver to negotiate the timings on a per-device basis. This function
+ is useful in the case of drives that lie about their capabilities. An example
+ is when the IDE device fails to accept the timing modes that are calculated
+ by the IDE controller driver based on the response to the Identify Drive command.
+
+ If the driver entity does not want to limit the ATA timing modes and leave that
+ decision to the IDE controller driver, it can either not call this function for
+ the given device or call this function and set the Valid flag to FALSE for all
+ modes that are listed in EFI_ATA_COLLECTIVE_MODE.
+
+ The driver entity may disqualify modes for a device in any order and any number
+ of times.
+
+ This function can be called multiple times to invalidate multiple modes of the
+ same type (e.g., Programmed Input/Output [PIO] modes 3 and 4). See the ATA/ATAPI
+ specification for more information on PIO modes.
+
+ For Serial ATA (SATA) controllers, this member function can be used to disqualify
+ a higher transfer rate mode on a given channel. For example, a platform driver
+ may inform the IDE controller driver to not use second-generation (Gen2) speeds
+ for a certain SATA drive.
+
+ @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
+ @param[in] Channel The zero-based channel number.
+ @param[in] Device The zero-based device number on the Channel.
+ @param[in] BadModes The modes that the device does not support and that
+ should be disqualified.
+
+ @retval EFI_SUCCESS The modes were accepted without any errors.
+ @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
+ @retval EFI_INVALID_PARAMETER Device is invalid.
+ @retval EFI_INVALID_PARAMETER IdentifyData is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IDE_CONTROLLER_DISQUALIFY_MODE)(
+ IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
+ IN UINT8 Channel,
+ IN UINT8 Device,
+ IN EFI_ATA_COLLECTIVE_MODE *BadModes
+ );
+
+/**
+ Returns the information about the optimum modes for the specified IDE device.
+
+ This function is used by the driver entity to obtain the optimum ATA modes for
+ a specific device. The IDE controller driver takes into account the following
+ while calculating the mode:
+ - The IdentifyData inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
+ - The BadModes inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode()
+
+ The driver entity is required to call EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
+ for all the devices that belong to an enumeration group before calling
+ EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() for any device in the same group.
+
+ The IDE controller driver will use controller- and possibly platform-specific
+ algorithms to arrive at SupportedModes. The IDE controller may base its
+ decision on user preferences and other considerations as well. This function
+ may be called multiple times because the driver entity may renegotiate the mode
+ with the IDE controller driver using EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode().
+
+ The driver entity may collect timing information for various devices in any
+ order. The driver entity is responsible for making sure that all the dependencies
+ are satisfied. For example, the SupportedModes information for device A that
+ was previously returned may become stale after a call to
+ EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() for device B.
+
+ The buffer SupportedModes is allocated by the callee because the caller does
+ not necessarily know the size of the buffer. The type EFI_ATA_COLLECTIVE_MODE
+ is defined in a way that allows for future extensibility and can be of variable
+ length. This memory pool should be deallocated by the caller when it is no
+ longer necessary.
+
+ The IDE controller driver for a Serial ATA (SATA) controller can use this
+ member function to force a lower speed (first-generation [Gen1] speeds on a
+ second-generation [Gen2]-capable hardware). The IDE controller driver can
+ also allow the driver entity to stay with the speed that has been negotiated
+ by the physical layer.
+
+ @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
+ @param[in] Channel A zero-based channel number.
+ @param[in] Device A zero-based device number on the Channel.
+ @param[out] SupportedModes The optimum modes for the device.
+
+ @retval EFI_SUCCESS SupportedModes was returned.
+ @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
+ @retval EFI_INVALID_PARAMETER Device is invalid.
+ @retval EFI_INVALID_PARAMETER SupportedModes is NULL.
+ @retval EFI_NOT_READY Modes cannot be calculated due to a lack of
+ data. This error may happen if
+ EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
+ and EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyData()
+ were not called for at least one drive in the
+ same enumeration group.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IDE_CONTROLLER_CALCULATE_MODE)(
+ IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
+ IN UINT8 Channel,
+ IN UINT8 Device,
+ OUT EFI_ATA_COLLECTIVE_MODE **SupportedModes
+ );
+
+/**
+ Commands the IDE controller driver to program the IDE controller hardware
+ so that the specified device can operate at the specified mode.
+
+ This function is used by the driver entity to instruct the IDE controller
+ driver to program the IDE controller hardware to the specified modes. This
+ function can be called only once for a particular device. For a Serial ATA
+ (SATA) Advanced Host Controller Interface (AHCI) controller, no controller-
+ specific programming may be required.
+
+ @param[in] This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
+ @param[in] Channel Zero-based channel number.
+ @param[in] Device Zero-based device number on the Channel.
+ @param[in] Modes The modes to set.
+
+ @retval EFI_SUCCESS The command was accepted without any errors.
+ @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
+ @retval EFI_INVALID_PARAMETER Device is invalid.
+ @retval EFI_NOT_READY Modes cannot be set at this time due to lack of data.
+ @retval EFI_DEVICE_ERROR Modes cannot be set due to hardware failure.
+ The driver entity should not use this device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IDE_CONTROLLER_SET_TIMING)(
+ IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
+ IN UINT8 Channel,
+ IN UINT8 Device,
+ IN EFI_ATA_COLLECTIVE_MODE *Modes
+ );
+
+///
+/// Provides the basic interfaces to abstract an IDE controller.
+///
+struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL {
+ ///
+ /// Returns the information about a specific channel.
+ ///
+ EFI_IDE_CONTROLLER_GET_CHANNEL_INFO GetChannelInfo;
+
+ ///
+ /// The notification that the driver entity is about to enter the
+ /// specified phase during the enumeration process.
+ ///
+ EFI_IDE_CONTROLLER_NOTIFY_PHASE NotifyPhase;
+
+ ///
+ /// Submits the Drive Identify data that was returned by the device.
+ ///
+ EFI_IDE_CONTROLLER_SUBMIT_DATA SubmitData;
+
+ ///
+ /// Submits information about modes that should be disqualified. The specified
+ /// IDE device does not support these modes and these modes should not be
+ /// returned by EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode()
+ ///
+ EFI_IDE_CONTROLLER_DISQUALIFY_MODE DisqualifyMode;
+
+ ///
+ /// Calculates and returns the optimum mode for a particular IDE device.
+ ///
+ EFI_IDE_CONTROLLER_CALCULATE_MODE CalculateMode;
+
+ ///
+ /// Programs the IDE controller hardware to the default timing or per the modes
+ /// that were returned by the last call to EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode().
+ ///
+ EFI_IDE_CONTROLLER_SET_TIMING SetTiming;
+
+ ///
+ /// Set to TRUE if the enumeration group includes all the channels that are
+ /// produced by this controller. Set to FALSE if an enumeration group consists of
+ /// only one channel.
+ ///
+ BOOLEAN EnumAll;
+
+ ///
+ /// The number of channels that are produced by this controller. Parallel ATA
+ /// (PATA) controllers can support up to two channels. Advanced Host Controller
+ /// Interface (AHCI) Serial ATA (SATA) controllers can support up to 32 channels,
+ /// each of which can have up to one device. In the presence of a multiplier,
+ /// each channel can have fifteen devices.
+ ///
+ UINT8 ChannelCount;
+};
+
+extern EFI_GUID gEfiIdeControllerInitProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IncompatiblePciDeviceSupport.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IncompatiblePciDeviceSupport.h
new file mode 100644
index 0000000000..9a924d4a67
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IncompatiblePciDeviceSupport.h
@@ -0,0 +1,173 @@
+/** @file
+ This file declares Incompatible PCI Device Support Protocol
+
+ Allows the PCI bus driver to support resource allocation for some PCI devices
+ that do not comply with the PCI Specification.
+
+ @par Note:
+ This protocol is optional. Only those platforms that implement this protocol
+ will have the capability to support incompatible PCI devices. The absence of
+ this protocol can cause the PCI bus driver to configure these incompatible
+ PCI devices incorrectly. As a result, these devices may not work properly.
+
+ The EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL is used by the PCI bus driver
+ to support resource allocation for some PCI devices that do not comply with the
+ PCI Specification. This protocol can find some incompatible PCI devices and
+ report their special resource requirements to the PCI bus driver. The generic
+ PCI bus driver does not have prior knowledge of any incompatible PCI devices.
+ It interfaces with the EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL to find out
+ if a device is incompatible and to obtain the special configuration requirements
+ for a specific incompatible PCI device.
+
+ This protocol is optional, and only one instance of this protocol can be present
+ in the system. If a platform supports this protocol, this protocol is produced
+ by a Driver Execution Environment (DXE) driver and must be made available before
+ the Boot Device Selection (BDS) phase. The PCI bus driver will look for the
+ presence of this protocol before it begins PCI enumeration. If this protocol
+ exists in a platform, it indicates that the platform has the capability to support
+ those incompatible PCI devices. However, final support for incompatible PCI
+ devices still depends on the implementation of the PCI bus driver. The PCI bus
+ driver may fully, partially, or not even support these incompatible devices.
+
+ During PCI bus enumeration, the PCI bus driver will probe the PCI Base Address
+ Registers (BARs) for each PCI device regardless of whether the PCI device is
+ incompatible or not to determine the resource requirements so that the PCI bus
+ driver can invoke the proper PCI resources for them. Generally, this resource
+ information includes the following:
+ - Resource type
+ - Resource length
+ - Alignment
+
+ However, some incompatible PCI devices may have special requirements. As a result,
+ the length or the alignment that is derived through BAR probing may not be exactly
+ the same as the actual resource requirement of the device. For example, there
+ are some devices that request I/O resources at a length of 0x100 from their I/O
+ BAR, but these incompatible devices will never work correctly if an odd I/O base
+ address, such as 0x100, 0x300, or 0x500, is assigned to the BAR. Instead, these
+ devices request an even base address, such as 0x200 or 0x400. The Incompatible
+ PCI Device Support Protocol can then be used to obtain these special resource
+ requirements for these incompatible PCI devices. In this way, the PCI bus driver
+ will take special consideration for these devices during PCI resource allocation
+ to ensure that they can work correctly.
+
+ This protocol may support the following incompatible PCI BAR types:
+ - I/O or memory length that is different from what the BAR reports
+ - I/O or memory alignment that is different from what the BAR reports
+ - Fixed I/O or memory base address
+
+ See the Conventional PCI Specification 3.0 for the details of how a PCI BAR
+ reports the resource length and the alignment that it requires.
+
+ Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is defined in UEFI Platform Initialization Specification 1.2
+ Volume 5: Standards
+
+**/
+
+#ifndef _INCOMPATIBLE_PCI_DEVICE_SUPPORT_H_
+#define _INCOMPATIBLE_PCI_DEVICE_SUPPORT_H_
+
+///
+/// Global ID for EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL
+///
+#define EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL_GUID \
+ { \
+ 0xeb23f55a, 0x7863, 0x4ac2, {0x8d, 0x3d, 0x95, 0x65, 0x35, 0xde, 0x03, 0x75} \
+ }
+
+///
+/// Forward declaration for EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL
+///
+typedef struct _EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL;
+
+/**
+ Returns a list of ACPI resource descriptors that detail the special resource
+ configuration requirements for an incompatible PCI device.
+
+ This function returns a list of ACPI resource descriptors that detail the
+ special resource configuration requirements for an incompatible PCI device.
+
+ Prior to bus enumeration, the PCI bus driver will look for the presence
+ of the EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL. Only one instance of this
+ protocol can be present in the system. For each PCI device that the PCI bus
+ driver discovers, the PCI bus driver calls this function with the device's vendor
+ ID, device ID, revision ID, subsystem vendor ID, and subsystem device ID. If the
+ VendorId, DeviceId, RevisionId, SubsystemVendorId, or SubsystemDeviceId value is
+ set to (UINTN)-1, that field will be ignored. The ID values that are not (UINTN)-1
+ will be used to identify the current device.
+
+ This function will only return EFI_SUCCESS. However, if the device is an
+ incompatible PCI device, a list of ACPI resource descriptors will be returned
+ in Configuration. Otherwise, NULL will be returned in Configuration instead.
+ The PCI bus driver does not need to allocate memory for Configuration. However,
+ it is the PCI bus driver's responsibility to free it. The PCI bus driver then
+ can configure this device with the information that is derived from this list
+ of resource nodes, rather than the result of BAR probing.
+
+ Only the following two resource descriptor types from the ACPI Specification
+ may be used to describe the incompatible PCI device resource requirements:
+ - QWORD Address Space Descriptor (ACPI 2.0, section 6.4.3.5.1; also ACPI 3.0)
+ - End Tag (ACPI 2.0, section 6.4.2.8; also ACPI 3.0)
+
+ The QWORD Address Space Descriptor can describe memory, I/O, and bus number
+ ranges for dynamic or fixed resources. The configuration of a PCI root bridge
+ is described with one or more QWORD Address Space Descriptors, followed by an
+ End Tag. See the ACPI Specification for details on the field values.
+
+ @param[in] This Pointer to the EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL
+ instance.
+ @param[in] VendorId A unique ID to identify the manufacturer of
+ the PCI device. See the Conventional PCI
+ Specification 3.0 for details.
+ @param[in] DeviceId A unique ID to identify the particular PCI
+ device. See the Conventional PCI Specification
+ 3.0 for details.
+ @param[in] RevisionId A PCI device-specific revision identifier.
+ See the Conventional PCI Specification 3.0
+ for details.
+ @param[in] SubsystemVendorId Specifies the subsystem vendor ID. See the
+ Conventional PCI Specification 3.0 for details.
+ @param[in] SubsystemDeviceId Specifies the subsystem device ID. See the
+ Conventional PCI Specification 3.0 for details.
+ @param[out] Configuration A list of ACPI resource descriptors that detail
+ the configuration requirement.
+
+ @retval EFI_SUCCESS The function always returns EFI_SUCCESS.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_CHECK_DEVICE)(
+ IN EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL *This,
+ IN UINTN VendorId,
+ IN UINTN DeviceId,
+ IN UINTN RevisionId,
+ IN UINTN SubsystemVendorId,
+ IN UINTN SubsystemDeviceId,
+ OUT VOID **Configuration
+ );
+
+///
+/// Interface structure for the Incompatible PCI Device Support Protocol
+///
+struct _EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL {
+ ///
+ /// Returns a list of ACPI resource descriptors that detail any special
+ /// resource configuration requirements if the specified device is a recognized
+ /// incompatible PCI device.
+ ///
+ EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_CHECK_DEVICE CheckDevice;
+};
+
+extern EFI_GUID gEfiIncompatiblePciDeviceSupportProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip4.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip4.h
new file mode 100644
index 0000000000..e36f38d8f5
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip4.h
@@ -0,0 +1,612 @@
+/** @file
+ This file defines the EFI IPv4 (Internet Protocol version 4)
+ Protocol interface. It is split into the following three main
+ sections:
+ - EFI IPv4 Service Binding Protocol
+ - EFI IPv4 Variable (deprecated in UEFI 2.4B)
+ - EFI IPv4 Protocol.
+ The EFI IPv4 Protocol provides basic network IPv4 packet I/O services,
+ which includes support foR a subset of the Internet Control Message
+ Protocol (ICMP) and may include support for the Internet Group Management
+ Protocol (IGMP).
+
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.0.
+
+**/
+
+#ifndef __EFI_IP4_PROTOCOL_H__
+#define __EFI_IP4_PROTOCOL_H__
+
+#include <Protocol/ManagedNetwork.h>
+
+#define EFI_IP4_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0xc51711e7, 0xb4bf, 0x404a, {0xbf, 0xb8, 0x0a, 0x04, 0x8e, 0xf1, 0xff, 0xe4 } \
+ }
+
+#define EFI_IP4_PROTOCOL_GUID \
+ { \
+ 0x41d94cd2, 0x35b6, 0x455a, {0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd } \
+ }
+
+typedef struct _EFI_IP4_PROTOCOL EFI_IP4_PROTOCOL;
+
+///
+/// EFI_IP4_ADDRESS_PAIR is deprecated in the UEFI 2.4B and should not be used any more.
+/// The definition in here is only present to provide backwards compatability.
+///
+typedef struct {
+ EFI_HANDLE InstanceHandle;
+ EFI_IPv4_ADDRESS Ip4Address;
+ EFI_IPv4_ADDRESS SubnetMask;
+} EFI_IP4_ADDRESS_PAIR;
+
+///
+/// EFI_IP4_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more.
+/// The definition in here is only present to provide backwards compatability.
+///
+typedef struct {
+ EFI_HANDLE DriverHandle;
+ UINT32 AddressCount;
+ EFI_IP4_ADDRESS_PAIR AddressPairs[1];
+} EFI_IP4_VARIABLE_DATA;
+
+typedef struct {
+ ///
+ /// The default IPv4 protocol packets to send and receive. Ignored
+ /// when AcceptPromiscuous is TRUE.
+ ///
+ UINT8 DefaultProtocol;
+ ///
+ /// Set to TRUE to receive all IPv4 packets that get through the receive filters.
+ /// Set to FALSE to receive only the DefaultProtocol IPv4
+ /// packets that get through the receive filters.
+ ///
+ BOOLEAN AcceptAnyProtocol;
+ ///
+ /// Set to TRUE to receive ICMP error report packets. Ignored when
+ /// AcceptPromiscuous or AcceptAnyProtocol is TRUE.
+ ///
+ BOOLEAN AcceptIcmpErrors;
+ ///
+ /// Set to TRUE to receive broadcast IPv4 packets. Ignored when
+ /// AcceptPromiscuous is TRUE.
+ /// Set to FALSE to stop receiving broadcast IPv4 packets.
+ ///
+ BOOLEAN AcceptBroadcast;
+ ///
+ /// Set to TRUE to receive all IPv4 packets that are sent to any
+ /// hardware address or any protocol address.
+ /// Set to FALSE to stop receiving all promiscuous IPv4 packets
+ ///
+ BOOLEAN AcceptPromiscuous;
+ ///
+ /// Set to TRUE to use the default IPv4 address and default routing table.
+ ///
+ BOOLEAN UseDefaultAddress;
+ ///
+ /// The station IPv4 address that will be assigned to this EFI IPv4Protocol instance.
+ ///
+ EFI_IPv4_ADDRESS StationAddress;
+ ///
+ /// The subnet address mask that is associated with the station address.
+ ///
+ EFI_IPv4_ADDRESS SubnetMask;
+ ///
+ /// TypeOfService field in transmitted IPv4 packets.
+ ///
+ UINT8 TypeOfService;
+ ///
+ /// TimeToLive field in transmitted IPv4 packets.
+ ///
+ UINT8 TimeToLive;
+ ///
+ /// State of the DoNotFragment bit in transmitted IPv4 packets.
+ ///
+ BOOLEAN DoNotFragment;
+ ///
+ /// Set to TRUE to send and receive unformatted packets. The other
+ /// IPv4 receive filters are still applied. Fragmentation is disabled for RawData mode.
+ ///
+ BOOLEAN RawData;
+ ///
+ /// The timer timeout value (number of microseconds) for the
+ /// receive timeout event to be associated with each assembled
+ /// packet. Zero means do not drop assembled packets.
+ ///
+ UINT32 ReceiveTimeout;
+ ///
+ /// The timer timeout value (number of microseconds) for the
+ /// transmit timeout event to be associated with each outgoing
+ /// packet. Zero means do not drop outgoing packets.
+ ///
+ UINT32 TransmitTimeout;
+} EFI_IP4_CONFIG_DATA;
+
+
+typedef struct {
+ EFI_IPv4_ADDRESS SubnetAddress;
+ EFI_IPv4_ADDRESS SubnetMask;
+ EFI_IPv4_ADDRESS GatewayAddress;
+} EFI_IP4_ROUTE_TABLE;
+
+typedef struct {
+ UINT8 Type;
+ UINT8 Code;
+} EFI_IP4_ICMP_TYPE;
+
+typedef struct {
+ ///
+ /// Set to TRUE after this EFI IPv4 Protocol instance has been successfully configured.
+ ///
+ BOOLEAN IsStarted;
+ ///
+ /// The maximum packet size, in bytes, of the packet which the upper layer driver could feed.
+ ///
+ UINT32 MaxPacketSize;
+ ///
+ /// Current configuration settings.
+ ///
+ EFI_IP4_CONFIG_DATA ConfigData;
+ ///
+ /// Set to TRUE when the EFI IPv4 Protocol instance has a station address and subnet mask.
+ ///
+ BOOLEAN IsConfigured;
+ ///
+ /// Number of joined multicast groups.
+ ///
+ UINT32 GroupCount;
+ ///
+ /// List of joined multicast group addresses.
+ ///
+ EFI_IPv4_ADDRESS *GroupTable;
+ ///
+ /// Number of entries in the routing table.
+ ///
+ UINT32 RouteCount;
+ ///
+ /// Routing table entries.
+ ///
+ EFI_IP4_ROUTE_TABLE *RouteTable;
+ ///
+ /// Number of entries in the supported ICMP types list.
+ ///
+ UINT32 IcmpTypeCount;
+ ///
+ /// Array of ICMP types and codes that are supported by this EFI IPv4 Protocol driver
+ ///
+ EFI_IP4_ICMP_TYPE *IcmpTypeList;
+} EFI_IP4_MODE_DATA;
+
+#pragma pack(1)
+
+typedef struct {
+ UINT8 HeaderLength:4;
+ UINT8 Version:4;
+ UINT8 TypeOfService;
+ UINT16 TotalLength;
+ UINT16 Identification;
+ UINT16 Fragmentation;
+ UINT8 TimeToLive;
+ UINT8 Protocol;
+ UINT16 Checksum;
+ EFI_IPv4_ADDRESS SourceAddress;
+ EFI_IPv4_ADDRESS DestinationAddress;
+} EFI_IP4_HEADER;
+#pragma pack()
+
+
+typedef struct {
+ UINT32 FragmentLength;
+ VOID *FragmentBuffer;
+} EFI_IP4_FRAGMENT_DATA;
+
+
+typedef struct {
+ EFI_TIME TimeStamp;
+ EFI_EVENT RecycleSignal;
+ UINT32 HeaderLength;
+ EFI_IP4_HEADER *Header;
+ UINT32 OptionsLength;
+ VOID *Options;
+ UINT32 DataLength;
+ UINT32 FragmentCount;
+ EFI_IP4_FRAGMENT_DATA FragmentTable[1];
+} EFI_IP4_RECEIVE_DATA;
+
+
+typedef struct {
+ EFI_IPv4_ADDRESS SourceAddress;
+ EFI_IPv4_ADDRESS GatewayAddress;
+ UINT8 Protocol;
+ UINT8 TypeOfService;
+ UINT8 TimeToLive;
+ BOOLEAN DoNotFragment;
+} EFI_IP4_OVERRIDE_DATA;
+
+typedef struct {
+ EFI_IPv4_ADDRESS DestinationAddress;
+ EFI_IP4_OVERRIDE_DATA *OverrideData; //OPTIONAL
+ UINT32 OptionsLength; //OPTIONAL
+ VOID *OptionsBuffer; //OPTIONAL
+ UINT32 TotalDataLength;
+ UINT32 FragmentCount;
+ EFI_IP4_FRAGMENT_DATA FragmentTable[1];
+} EFI_IP4_TRANSMIT_DATA;
+
+typedef struct {
+ ///
+ /// This Event will be signaled after the Status field is updated
+ /// by the EFI IPv4 Protocol driver. The type of Event must be
+ /// EFI_NOTIFY_SIGNAL. The Task Priority Level (TPL) of
+ /// Event must be lower than or equal to TPL_CALLBACK.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// The status that is returned to the caller at the end of the operation
+ /// to indicate whether this operation completed successfully.
+ ///
+ EFI_STATUS Status;
+ union {
+ ///
+ /// When this token is used for receiving, RxData is a pointer to the EFI_IP4_RECEIVE_DATA.
+ ///
+ EFI_IP4_RECEIVE_DATA *RxData;
+ ///
+ /// When this token is used for transmitting, TxData is a pointer to the EFI_IP4_TRANSMIT_DATA.
+ ///
+ EFI_IP4_TRANSMIT_DATA *TxData;
+ } Packet;
+} EFI_IP4_COMPLETION_TOKEN;
+
+/**
+ Gets the current operational settings for this instance of the EFI IPv4 Protocol driver.
+
+ The GetModeData() function returns the current operational mode data for this
+ driver instance. The data fields in EFI_IP4_MODE_DATA are read only. This
+ function is used optionally to retrieve the operational mode data of underlying
+ networks or drivers.
+
+ @param This The pointer to the EFI_IP4_PROTOCOL instance.
+ @param Ip4ModeData The pointer to the EFI IPv4 Protocol mode data structure.
+ @param MnpConfigData The pointer to the managed network configuration data structure.
+ @param SnpModeData The pointer to the simple network mode data structure.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_GET_MODE_DATA)(
+ IN CONST EFI_IP4_PROTOCOL *This,
+ OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,
+ OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
+ OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
+ );
+
+/**
+ Assigns an IPv4 address and subnet mask to this EFI IPv4 Protocol driver instance.
+
+ The Configure() function is used to set, change, or reset the operational
+ parameters and filter settings for this EFI IPv4 Protocol instance. Until these
+ parameters have been set, no network traffic can be sent or received by this
+ instance. Once the parameters have been reset (by calling this function with
+ IpConfigData set to NULL), no more traffic can be sent or received until these
+ parameters have been set again. Each EFI IPv4 Protocol instance can be started
+ and stopped independently of each other by enabling or disabling their receive
+ filter settings with the Configure() function.
+
+ When IpConfigData.UseDefaultAddress is set to FALSE, the new station address will
+ be appended as an alias address into the addresses list in the EFI IPv4 Protocol
+ driver. While set to TRUE, Configure() will trigger the EFI_IP4_CONFIG_PROTOCOL
+ to retrieve the default IPv4 address if it is not available yet. Clients could
+ frequently call GetModeData() to check the status to ensure that the default IPv4
+ address is ready.
+
+ If operational parameters are reset or changed, any pending transmit and receive
+ requests will be cancelled. Their completion token status will be set to EFI_ABORTED
+ and their events will be signaled.
+
+ @param This The pointer to the EFI_IP4_PROTOCOL instance.
+ @param IpConfigData The pointer to the EFI IPv4 Protocol configuration data structure.
+
+ @retval EFI_SUCCESS The driver instance was successfully opened.
+ @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ IpConfigData.StationAddress is not a unicast IPv4 address.
+ IpConfigData.SubnetMask is not a valid IPv4 subnet
+ @retval EFI_UNSUPPORTED One or more of the following conditions is TRUE:
+ A configuration protocol (DHCP, BOOTP, RARP, etc.) could
+ not be located when clients choose to use the default IPv4
+ address. This EFI IPv4 Protocol implementation does not
+ support this requested filter or timeout setting.
+ @retval EFI_OUT_OF_RESOURCES The EFI IPv4 Protocol driver instance data could not be allocated.
+ @retval EFI_ALREADY_STARTED The interface is already open and must be stopped before the
+ IPv4 address or subnet mask can be changed. The interface must
+ also be stopped when switching to/from raw packet mode.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI IPv4
+ Protocol driver instance is not opened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_CONFIGURE)(
+ IN EFI_IP4_PROTOCOL *This,
+ IN EFI_IP4_CONFIG_DATA *IpConfigData OPTIONAL
+ );
+
+/**
+ Joins and leaves multicast groups.
+
+ The Groups() function is used to join and leave multicast group sessions. Joining
+ a group will enable reception of matching multicast packets. Leaving a group will
+ disable the multicast packet reception.
+
+ If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left.
+
+ @param This The pointer to the EFI_IP4_PROTOCOL instance.
+ @param JoinFlag Set to TRUE to join the multicast group session and FALSE to leave.
+ @param GroupAddress The pointer to the IPv4 multicast address.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following is TRUE:
+ - This is NULL.
+ - JoinFlag is TRUE and GroupAddress is NULL.
+ - GroupAddress is not NULL and *GroupAddress is
+ not a multicast IPv4 address.
+ @retval EFI_NOT_STARTED This instance has not been started.
+ @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_OUT_OF_RESOURCES System resources could not be allocated.
+ @retval EFI_UNSUPPORTED This EFI IPv4 Protocol implementation does not support multicast groups.
+ @retval EFI_ALREADY_STARTED The group address is already in the group table (when
+ JoinFlag is TRUE).
+ @retval EFI_NOT_FOUND The group address is not in the group table (when JoinFlag is FALSE).
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_GROUPS)(
+ IN EFI_IP4_PROTOCOL *This,
+ IN BOOLEAN JoinFlag,
+ IN EFI_IPv4_ADDRESS *GroupAddress OPTIONAL
+ );
+
+/**
+ Adds and deletes routing table entries.
+
+ The Routes() function adds a route to or deletes a route from the routing table.
+
+ Routes are determined by comparing the SubnetAddress with the destination IPv4
+ address arithmetically AND-ed with the SubnetMask. The gateway address must be
+ on the same subnet as the configured station address.
+
+ The default route is added with SubnetAddress and SubnetMask both set to 0.0.0.0.
+ The default route matches all destination IPv4 addresses that do not match any
+ other routes.
+
+ A GatewayAddress that is zero is a nonroute. Packets are sent to the destination
+ IP address if it can be found in the ARP cache or on the local subnet. One automatic
+ nonroute entry will be inserted into the routing table for outgoing packets that
+ are addressed to a local subnet (gateway address of 0.0.0.0).
+
+ Each EFI IPv4 Protocol instance has its own independent routing table. Those EFI
+ IPv4 Protocol instances that use the default IPv4 address will also have copies
+ of the routing table that was provided by the EFI_IP4_CONFIG_PROTOCOL, and these
+ copies will be updated whenever the EIF IPv4 Protocol driver reconfigures its
+ instances. As a result, client modification to the routing table will be lost.
+
+ @param This The pointer to the EFI_IP4_PROTOCOL instance.
+ @param DeleteRoute Set to TRUE to delete this route from the routing table. Set to
+ FALSE to add this route to the routing table. SubnetAddress
+ and SubnetMask are used as the key to each route entry.
+ @param SubnetAddress The address of the subnet that needs to be routed.
+ @param SubnetMask The subnet mask of SubnetAddress.
+ @param GatewayAddress The unicast gateway IPv4 address for this route.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_NOT_STARTED The driver instance has not been started.
+ @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - SubnetAddress is NULL.
+ - SubnetMask is NULL.
+ - GatewayAddress is NULL.
+ - *SubnetAddress is not a valid subnet address.
+ - *SubnetMask is not a valid subnet mask.
+ - *GatewayAddress is not a valid unicast IPv4 address.
+ @retval EFI_OUT_OF_RESOURCES Could not add the entry to the routing table.
+ @retval EFI_NOT_FOUND This route is not in the routing table (when DeleteRoute is TRUE).
+ @retval EFI_ACCESS_DENIED The route is already defined in the routing table (when
+ DeleteRoute is FALSE).
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_ROUTES)(
+ IN EFI_IP4_PROTOCOL *This,
+ IN BOOLEAN DeleteRoute,
+ IN EFI_IPv4_ADDRESS *SubnetAddress,
+ IN EFI_IPv4_ADDRESS *SubnetMask,
+ IN EFI_IPv4_ADDRESS *GatewayAddress
+ );
+
+/**
+ Places outgoing data packets into the transmit queue.
+
+ The Transmit() function places a sending request in the transmit queue of this
+ EFI IPv4 Protocol instance. Whenever the packet in the token is sent out or some
+ errors occur, the event in the token will be signaled and the status is updated.
+
+ @param This The pointer to the EFI_IP4_PROTOCOL instance.
+ @param Token The pointer to the transmit token.
+
+ @retval EFI_SUCCESS The data has been queued for transmission.
+ @retval EFI_NOT_STARTED This instance has not been started.
+ @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_INVALID_PARAMETER One or more pameters are invalid.
+ @retval EFI_ACCESS_DENIED The transmit completion token with the same Token.Event
+ was already in the transmit queue.
+ @retval EFI_NOT_READY The completion token could not be queued because the transmit
+ queue is full.
+ @retval EFI_NOT_FOUND Not route is found to destination address.
+ @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.
+ @retval EFI_BUFFER_TOO_SMALL Token.Packet.TxData.TotalDataLength is too
+ short to transmit.
+ @retval EFI_BAD_BUFFER_SIZE The length of the IPv4 header + option length + total data length is
+ greater than MTU (or greater than the maximum packet size if
+ Token.Packet.TxData.OverrideData.
+ DoNotFragment is TRUE.)
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_TRANSMIT)(
+ IN EFI_IP4_PROTOCOL *This,
+ IN EFI_IP4_COMPLETION_TOKEN *Token
+ );
+
+/**
+ Places a receiving request into the receiving queue.
+
+ The Receive() function places a completion token into the receive packet queue.
+ This function is always asynchronous.
+
+ The Token.Event field in the completion token must be filled in by the caller
+ and cannot be NULL. When the receive operation completes, the EFI IPv4 Protocol
+ driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event
+ is signaled.
+
+ @param This The pointer to the EFI_IP4_PROTOCOL instance.
+ @param Token The pointer to a token that is associated with the receive data descriptor.
+
+ @retval EFI_SUCCESS The receive completion token was cached.
+ @retval EFI_NOT_STARTED This EFI IPv4 Protocol instance has not been started.
+ @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP, RARP, etc.)
+ is not finished yet.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token.Event is NULL.
+ @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of system
+ resources (usually memory).
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ The EFI IPv4 Protocol instance has been reset to startup defaults.
+ @retval EFI_ACCESS_DENIED The receive completion token with the same Token.Event was already
+ in the receive queue.
+ @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
+ @retval EFI_ICMP_ERROR An ICMP error packet was received.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_RECEIVE)(
+ IN EFI_IP4_PROTOCOL *This,
+ IN EFI_IP4_COMPLETION_TOKEN *Token
+ );
+
+/**
+ Abort an asynchronous transmit or receive request.
+
+ The Cancel() function is used to abort a pending transmit or receive request.
+ If the token is in the transmit or receive request queues, after calling this
+ function, Token->Status will be set to EFI_ABORTED and then Token->Event will
+ be signaled. If the token is not in one of the queues, which usually means the
+ asynchronous operation has completed, this function will not signal the token
+ and EFI_NOT_FOUND is returned.
+
+ @param This The pointer to the EFI_IP4_PROTOCOL instance.
+ @param Token The pointer to a token that has been issued by
+ EFI_IP4_PROTOCOL.Transmit() or
+ EFI_IP4_PROTOCOL.Receive(). If NULL, all pending
+ tokens are aborted. Type EFI_IP4_COMPLETION_TOKEN is
+ defined in EFI_IP4_PROTOCOL.Transmit().
+
+ @retval EFI_SUCCESS The asynchronous I/O request was aborted and
+ Token->Event was signaled. When Token is NULL, all
+ pending requests were aborted and their events were signaled.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_STARTED This instance has not been started.
+ @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was
+ not found in the transmit or receive queue. It has either completed
+ or was not issued by Transmit() and Receive().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_CANCEL)(
+ IN EFI_IP4_PROTOCOL *This,
+ IN EFI_IP4_COMPLETION_TOKEN *Token OPTIONAL
+ );
+
+/**
+ Polls for incoming data packets and processes outgoing data packets.
+
+ The Poll() function polls for incoming data packets and processes outgoing data
+ packets. Network drivers and applications can call the EFI_IP4_PROTOCOL.Poll()
+ function to increase the rate that data packets are moved between the communications
+ device and the transmit and receive queues.
+
+ In some systems the periodic timer event may not poll the underlying communications
+ device fast enough to transmit and/or receive all data packets without missing
+ incoming packets or dropping outgoing packets. Drivers and applications that are
+ experiencing packet loss should try calling the EFI_IP4_PROTOCOL.Poll() function
+ more often.
+
+ @param This The pointer to the EFI_IP4_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_NOT_STARTED This EFI IPv4 Protocol instance has not been started.
+ @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_NOT_READY No incoming or outgoing data is processed.
+ @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
+ Consider increasing the polling rate.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_POLL)(
+ IN EFI_IP4_PROTOCOL *This
+ );
+
+///
+/// The EFI IPv4 Protocol implements a simple packet-oriented interface that can be
+/// used by drivers, daemons, and applications to transmit and receive network packets.
+///
+struct _EFI_IP4_PROTOCOL {
+ EFI_IP4_GET_MODE_DATA GetModeData;
+ EFI_IP4_CONFIGURE Configure;
+ EFI_IP4_GROUPS Groups;
+ EFI_IP4_ROUTES Routes;
+ EFI_IP4_TRANSMIT Transmit;
+ EFI_IP4_RECEIVE Receive;
+ EFI_IP4_CANCEL Cancel;
+ EFI_IP4_POLL Poll;
+};
+
+extern EFI_GUID gEfiIp4ServiceBindingProtocolGuid;
+extern EFI_GUID gEfiIp4ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip4Config.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip4Config.h
new file mode 100644
index 0000000000..ece7efb668
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip4Config.h
@@ -0,0 +1,182 @@
+/** @file
+ This file provides a definition of the EFI IPv4 Configuration
+ Protocol.
+
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.0.
+
+**/
+#ifndef __EFI_IP4CONFIG_PROTOCOL_H__
+#define __EFI_IP4CONFIG_PROTOCOL_H__
+
+#include <Protocol/Ip4.h>
+
+#define EFI_IP4_CONFIG_PROTOCOL_GUID \
+ { \
+ 0x3b95aa31, 0x3793, 0x434b, {0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } \
+ }
+
+typedef struct _EFI_IP4_CONFIG_PROTOCOL EFI_IP4_CONFIG_PROTOCOL;
+
+#define IP4_CONFIG_VARIABLE_ATTRIBUTES \
+ (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)
+
+///
+/// EFI_IP4_IPCONFIG_DATA contains the minimum IPv4 configuration data
+/// that is needed to start basic network communication. The StationAddress
+/// and SubnetMask must be a valid unicast IP address and subnet mask.
+/// If RouteTableSize is not zero, then RouteTable contains a properly
+/// formatted routing table for the StationAddress/SubnetMask, with the
+/// last entry in the table being the default route.
+///
+typedef struct {
+ ///
+ /// Default station IP address, stored in network byte order.
+ ///
+ EFI_IPv4_ADDRESS StationAddress;
+ ///
+ /// Default subnet mask, stored in network byte order.
+ ///
+ EFI_IPv4_ADDRESS SubnetMask;
+ ///
+ /// Number of entries in the following RouteTable. May be zero.
+ ///
+ UINT32 RouteTableSize;
+ ///
+ /// Default routing table data (stored in network byte order).
+ /// Ignored if RouteTableSize is zero.
+ ///
+ EFI_IP4_ROUTE_TABLE *RouteTable;
+} EFI_IP4_IPCONFIG_DATA;
+
+
+/**
+ Starts running the configuration policy for the EFI IPv4 Protocol driver.
+
+ The Start() function is called to determine and to begin the platform
+ configuration policy by the EFI IPv4 Protocol driver. This determination may
+ be as simple as returning EFI_UNSUPPORTED if there is no EFI IPv4 Protocol
+ driver configuration policy. It may be as involved as loading some defaults
+ from nonvolatile storage, downloading dynamic data from a DHCP server, and
+ checking permissions with a site policy server.
+ Starting the configuration policy is just the beginning. It may finish almost
+ instantly or it may take several minutes before it fails to retrieve configuration
+ information from one or more servers. Once the policy is started, drivers
+ should use the DoneEvent parameter to determine when the configuration policy
+ has completed. EFI_IP4_CONFIG_PROTOCOL.GetData() must then be called to
+ determine if the configuration succeeded or failed.
+ Until the configuration completes successfully, EFI IPv4 Protocol driver instances
+ that are attempting to use default configurations must return EFI_NO_MAPPING.
+ Once the configuration is complete, the EFI IPv4 Configuration Protocol driver
+ signals DoneEvent. The configuration may need to be updated in the future.
+ Note that in this case the EFI IPv4 Configuration Protocol driver must signal
+ ReconfigEvent, and all EFI IPv4 Protocol driver instances that are using default
+ configurations must return EFI_NO_MAPPING until the configuration policy has
+ been rerun.
+
+ @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
+ @param DoneEvent Event that will be signaled when the EFI IPv4
+ Protocol driver configuration policy completes
+ execution. This event must be of type EVT_NOTIFY_SIGNAL.
+ @param ReconfigEvent Event that will be signaled when the EFI IPv4
+ Protocol driver configuration needs to be updated.
+ This event must be of type EVT_NOTIFY_SIGNAL.
+
+ @retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol
+ driver is now running.
+ @retval EFI_INVALID_PARAMETER One or more of the following parameters is NULL:
+ This
+ DoneEvent
+ ReconfigEvent
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_ALREADY_STARTED The configuration policy for the EFI IPv4 Protocol
+ driver was already started.
+ @retval EFI_DEVICE_ERROR An unexpected system error or network error occurred.
+ @retval EFI_UNSUPPORTED This interface does not support the EFI IPv4 Protocol
+ driver configuration.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_CONFIG_START)(
+ IN EFI_IP4_CONFIG_PROTOCOL *This,
+ IN EFI_EVENT DoneEvent,
+ IN EFI_EVENT ReconfigEvent
+ );
+
+/**
+ Stops running the configuration policy for the EFI IPv4 Protocol driver.
+
+ The Stop() function stops the configuration policy for the EFI IPv4 Protocol driver.
+ All configuration data will be lost after calling Stop().
+
+ @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol
+ driver has been stopped.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol
+ driver was not started.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_CONFIG_STOP)(
+ IN EFI_IP4_CONFIG_PROTOCOL *This
+ );
+
+/**
+ Returns the default configuration data (if any) for the EFI IPv4 Protocol driver.
+
+ The GetData() function returns the current configuration data for the EFI IPv4
+ Protocol driver after the configuration policy has completed.
+
+ @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
+ @param IpConfigDataSize On input, the size of the IpConfigData buffer.
+ On output, the count of bytes that were written
+ into the IpConfigData buffer.
+ @param IpConfigData The pointer to the EFI IPv4 Configuration Protocol
+ driver configuration data structure.
+ Type EFI_IP4_IPCONFIG_DATA is defined in
+ "Related Definitions" below.
+
+ @retval EFI_SUCCESS The EFI IPv4 Protocol driver configuration has been returned.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol
+ driver is not running.
+ @retval EFI_NOT_READY EFI IPv4 Protocol driver configuration is still running.
+ @retval EFI_ABORTED EFI IPv4 Protocol driver configuration could not complete.
+ @retval EFI_BUFFER_TOO_SMALL *IpConfigDataSize is smaller than the configuration
+ data buffer or IpConfigData is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_CONFIG_GET_DATA)(
+ IN EFI_IP4_CONFIG_PROTOCOL *This,
+ IN OUT UINTN *IpConfigDataSize,
+ OUT EFI_IP4_IPCONFIG_DATA *IpConfigData OPTIONAL
+ );
+
+///
+/// The EFI_IP4_CONFIG_PROTOCOL driver performs platform-dependent and policy-dependent
+/// configurations for the EFI IPv4 Protocol driver.
+///
+struct _EFI_IP4_CONFIG_PROTOCOL {
+ EFI_IP4_CONFIG_START Start;
+ EFI_IP4_CONFIG_STOP Stop;
+ EFI_IP4_CONFIG_GET_DATA GetData;
+};
+
+extern EFI_GUID gEfiIp4ConfigProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip4Config2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip4Config2.h
new file mode 100644
index 0000000000..c81d4c600f
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip4Config2.h
@@ -0,0 +1,323 @@
+/** @file
+ This file provides a definition of the EFI IPv4 Configuration II
+ Protocol.
+
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at<BR>
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+@par Revision Reference:
+This Protocol is introduced in UEFI Specification 2.5
+
+**/
+#ifndef __EFI_IP4CONFIG2_PROTOCOL_H__
+#define __EFI_IP4CONFIG2_PROTOCOL_H__
+
+#include <Protocol/Ip4.h>
+
+#define EFI_IP4_CONFIG2_PROTOCOL_GUID \
+ { \
+ 0x5b446ed1, 0xe30b, 0x4faa, {0x87, 0x1a, 0x36, 0x54, 0xec, 0xa3, 0x60, 0x80 } \
+ }
+
+typedef struct _EFI_IP4_CONFIG2_PROTOCOL EFI_IP4_CONFIG2_PROTOCOL;
+
+
+///
+/// EFI_IP4_CONFIG2_DATA_TYPE
+///
+typedef enum {
+ ///
+ /// The interface information of the communication device this EFI
+ /// IPv4 Configuration II Protocol instance manages. This type of
+ /// data is read only. The corresponding Data is of type
+ /// EFI_IP4_CONFIG2_INTERFACE_INFO.
+ ///
+ Ip4Config2DataTypeInterfaceInfo,
+ ///
+ /// The general configuration policy for the EFI IPv4 network stack
+ /// running on the communication device this EFI IPv4
+ /// Configuration II Protocol instance manages. The policy will
+ /// affect other configuration settings. The corresponding Data is of
+ /// type EFI_IP4_CONFIG2_POLICY.
+ ///
+ Ip4Config2DataTypePolicy,
+ ///
+ /// The station addresses set manually for the EFI IPv4 network
+ /// stack. It is only configurable when the policy is
+ /// Ip4Config2PolicyStatic. The corresponding Data is of
+ /// type EFI_IP4_CONFIG2_MANUAL_ADDRESS. When DataSize
+ /// is 0 and Data is NULL, the existing configuration is cleared
+ /// from the EFI IPv4 Configuration II Protocol instance.
+ ///
+ Ip4Config2DataTypeManualAddress,
+ ///
+ /// The gateway addresses set manually for the EFI IPv4 network
+ /// stack running on the communication device this EFI IPv4
+ /// Configuration II Protocol manages. It is not configurable when
+ /// the policy is Ip4Config2PolicyDhcp. The gateway
+ /// addresses must be unicast IPv4 addresses. The corresponding
+ /// Data is a pointer to an array of EFI_IPv4_ADDRESS instances.
+ /// When DataSize is 0 and Data is NULL, the existing configuration
+ /// is cleared from the EFI IPv4 Configuration II Protocol instance.
+ ///
+ Ip4Config2DataTypeGateway,
+ ///
+ /// The DNS server list for the EFI IPv4 network stack running on
+ /// the communication device this EFI IPv4 Configuration II
+ /// Protocol manages. It is not configurable when the policy is
+ /// Ip4Config2PolicyDhcp. The DNS server addresses must be
+ /// unicast IPv4 addresses. The corresponding Data is a pointer to
+ /// an array of EFI_IPv4_ADDRESS instances. When DataSize
+ /// is 0 and Data is NULL, the existing configuration is cleared
+ /// from the EFI IPv4 Configuration II Protocol instance.
+ ///
+ Ip4Config2DataTypeDnsServer,
+ Ip4Config2DataTypeMaximum
+} EFI_IP4_CONFIG2_DATA_TYPE;
+
+///
+/// EFI_IP4_CONFIG2_INTERFACE_INFO related definitions
+///
+#define EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE 32
+
+///
+/// EFI_IP4_CONFIG2_INTERFACE_INFO
+///
+typedef struct {
+ ///
+ /// The name of the interface. It is a NULL-terminated Unicode string.
+ ///
+ CHAR16 Name[EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE];
+ ///
+ /// The interface type of the network interface. See RFC 1700,
+ /// section "Number Hardware Type".
+ ///
+ UINT8 IfType;
+ ///
+ /// The size, in bytes, of the network interface's hardware address.
+ ///
+ UINT32 HwAddressSize;
+ ///
+ /// The hardware address for the network interface.
+ ///
+ EFI_MAC_ADDRESS HwAddress;
+ ///
+ /// The station IPv4 address of this EFI IPv4 network stack.
+ ///
+ EFI_IPv4_ADDRESS StationAddress;
+ ///
+ /// The subnet address mask that is associated with the station address.
+ ///
+ EFI_IPv4_ADDRESS SubnetMask;
+ ///
+ /// Size of the following RouteTable, in bytes. May be zero.
+ ///
+ UINT32 RouteTableSize;
+ ///
+ /// The route table of the IPv4 network stack runs on this interface.
+ /// Set to NULL if RouteTableSize is zero. Type EFI_IP4_ROUTE_TABLE is defined in
+ /// EFI_IP4_PROTOCOL.GetModeData().
+ ///
+ EFI_IP4_ROUTE_TABLE *RouteTable OPTIONAL;
+} EFI_IP4_CONFIG2_INTERFACE_INFO;
+
+///
+/// EFI_IP4_CONFIG2_POLICY
+///
+typedef enum {
+ ///
+ /// Under this policy, the Ip4Config2DataTypeManualAddress,
+ /// Ip4Config2DataTypeGateway and Ip4Config2DataTypeDnsServer configuration
+ /// data are required to be set manually. The EFI IPv4 Protocol will get all
+ /// required configuration such as IPv4 address, subnet mask and
+ /// gateway settings from the EFI IPv4 Configuration II protocol.
+ ///
+ Ip4Config2PolicyStatic,
+ ///
+ /// Under this policy, the Ip4Config2DataTypeManualAddress,
+ /// Ip4Config2DataTypeGateway and Ip4Config2DataTypeDnsServer configuration data are
+ /// not allowed to set via SetData(). All of these configurations are retrieved from DHCP
+ /// server or other auto-configuration mechanism.
+ ///
+ Ip4Config2PolicyDhcp,
+ Ip4Config2PolicyMax
+} EFI_IP4_CONFIG2_POLICY;
+
+///
+/// EFI_IP4_CONFIG2_MANUAL_ADDRESS
+///
+typedef struct {
+ ///
+ /// The IPv4 unicast address.
+ ///
+ EFI_IPv4_ADDRESS Address;
+ ///
+ /// The subnet mask.
+ ///
+ EFI_IPv4_ADDRESS SubnetMask;
+} EFI_IP4_CONFIG2_MANUAL_ADDRESS;
+
+/**
+ Set the configuration for the EFI IPv4 network stack running on the communication device this EFI
+ IPv4 Configuration II Protocol instance manages.
+
+ This function is used to set the configuration data of type DataType for the EFI IPv4 network stack
+ running on the communication device this EFI IPv4 Configuration II Protocol instance manages.
+ The successfully configured data is valid after system reset or power-off.
+ The DataSize is used to calculate the count of structure instances in the Data for some
+ DataType that multiple structure instances are allowed.
+ This function is always non-blocking. When setting some typeof configuration data, an
+ asynchronous process is invoked to check the correctness of the data, such as doing address conflict
+ detection on the manually set local IPv4 address. EFI_NOT_READY is returned immediately to
+ indicate that such an asynchronous process is invoked and the process is not finished yet. The caller
+ willing to get the result of the asynchronous process is required to call RegisterDataNotify()
+ to register an event on the specified configuration data. Once the event is signaled, the caller can call
+ GetData()to get back the configuration data in order to know the result. For other types of
+ configuration data that do not require an asynchronous configuration process, the result of the
+ operation is immediately returned.
+
+ @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
+ @param[in] DataType The type of data to set.
+ @param[in] DataSize Size of the buffer pointed to by Data in bytes.
+ @param[in] Data The data buffer to set. The type ofthe data buffer is associated
+ with the DataType.
+
+ @retval EFI_SUCCESS The specified configuration data for the EFI IPv4 network stack is set
+ successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ This is NULL.
+ One or more fields in Data and DataSize do not match the
+ requirement of the data type indicated by DataType.
+ @retval EFI_WRITE_PROTECTED The specified configuration data is read-only or the specified configuration
+ data can not be set under the current policy.
+ @retval EFI_ACCESS_DENIED Another set operation on the specified configuration data is already in process.
+ @retval EFI_NOT_READY An asynchronous process is invoked to set the specified configuration data and
+ the process is not finished yet.
+ @retval EFI_BAD_BUFFER_SIZE The DataSize does not match the size of the type indicated by DataType.
+ @retval EFI_UNSUPPORTED This DataType is not supported.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_DEVICE_ERROR An unexpected system error or network error occurred.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_CONFIG2_SET_DATA) (
+ IN EFI_IP4_CONFIG2_PROTOCOL *This,
+ IN EFI_IP4_CONFIG2_DATA_TYPE DataType,
+ IN UINTN DataSize,
+ IN VOID *Data
+ );
+
+/**
+ Get the configuration data for the EFI IPv4 network stack running on the communication device this
+ EFI IPv4 Configuration II Protocol instance manages.
+
+ This function returns the configuration data of type DataType for the EFI IPv4 network stack
+ running on the communication device this EFI IPv4 Configuration II Protocol instance manages.
+ The caller is responsible for allocating the buffer usedto return the specified configuration data and
+ the required size will be returned to the caller if the size of the buffer is too small.
+ EFI_NOT_READY is returned if the specified configuration data is not ready due to an already in
+ progress asynchronous configuration process. The caller can call RegisterDataNotify() to
+ register an event on the specified configuration data. Once the asynchronous configuration process is
+ finished, the event will be signaled and a subsequent GetData() call will return the specified
+ configuration data.
+
+ @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
+ @param[in] DataType The type of data to get.
+ @param[out] DataSize On input, in bytes, the size of Data. On output, in bytes, the size
+ of buffer required to store the specified configuration data.
+ @param[in] Data The data buffer in which the configuration data is returned. The
+ type of the data buffer is associated with the DataType. Ignored
+ if DataSize is 0.
+
+ @retval EFI_SUCCESS The specified configuration data is got successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:
+ This is NULL.
+ DataSize is NULL.
+ Data is NULL if *DataSizeis not zero.
+ @retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified configuration data
+ and the required size is returned in DataSize.
+ @retval EFI_NOT_READY The specified configuration data is not ready due to an already in
+ progress asynchronous configuration process.
+ @retval EFI_NOT_FOUND The specified configuration data is not found.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_CONFIG2_GET_DATA) (
+ IN EFI_IP4_CONFIG2_PROTOCOL *This,
+ IN EFI_IP4_CONFIG2_DATA_TYPE DataType,
+ IN OUT UINTN *DataSize,
+ IN VOID *Data OPTIONAL
+ );
+
+/**
+ Register an event that is to be signaled whenever a configuration process on the specified
+ configuration data is done.
+
+ This function registers an event that is to be signaled whenever a configuration process on the
+ specified configuration data is done. An event can be registered for different DataType
+ simultaneously and the caller is responsible for determining which type of configuration data causes
+ the signaling of the event in such case.
+
+ @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
+ @param[in] DataType The type of data to unregister the event for.
+ @param[in] Event The event to register.
+
+ @retval EFI_SUCCESS The notification event for the specified configuration data is
+ registered.
+ @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
+ @retval EFI_UNSUPPORTED The configuration data type specified by DataType is not supported.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_ACCESS_DENIED The Event is already registered for the DataType.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_CONFIG2_REGISTER_NOTIFY) (
+ IN EFI_IP4_CONFIG2_PROTOCOL *This,
+ IN EFI_IP4_CONFIG2_DATA_TYPE DataType,
+ IN EFI_EVENT Event
+ );
+
+/**
+ Remove a previously registered event for the specified configuration data.
+
+ This function removes a previously registeredevent for the specified configuration data.
+
+ @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
+ @param[in] DataType The type of data to remove the previously registered event for.
+ @param[in] Event The event to unregister.
+
+ @retval EFI_SUCCESS The event registered for the specified configuration data is removed.
+ @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
+ @retval EFI_NOT_FOUND The Eventhas not been registered for the specified DataType.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP4_CONFIG2_UNREGISTER_NOTIFY) (
+ IN EFI_IP4_CONFIG2_PROTOCOL *This,
+ IN EFI_IP4_CONFIG2_DATA_TYPE DataType,
+ IN EFI_EVENT Event
+ );
+
+///
+/// The EFI_IP4_CONFIG2_PROTOCOL is designed to be the central repository for the common
+/// configurations and the administrator configurable settings for the EFI IPv4 network stack.
+/// An EFI IPv4 Configuration II Protocol instance will be installed on each communication device that
+/// the EFI IPv4 network stack runs on.
+///
+struct _EFI_IP4_CONFIG2_PROTOCOL {
+ EFI_IP4_CONFIG2_SET_DATA SetData;
+ EFI_IP4_CONFIG2_GET_DATA GetData;
+ EFI_IP4_CONFIG2_REGISTER_NOTIFY RegisterDataNotify;
+ EFI_IP4_CONFIG2_UNREGISTER_NOTIFY UnregisterDataNotify;
+};
+
+extern EFI_GUID gEfiIp4Config2ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip6.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip6.h
new file mode 100644
index 0000000000..1598f8250a
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip6.h
@@ -0,0 +1,953 @@
+/** @file
+ This file defines the EFI IPv6 (Internet Protocol version 6)
+ Protocol interface. It is split into the following three main
+ sections:
+ - EFI IPv6 Service Binding Protocol
+ - EFI IPv6 Variable (deprecated in UEFI 2.4B)
+ - EFI IPv6 Protocol
+ The EFI IPv6 Protocol provides basic network IPv6 packet I/O services,
+ which includes support for Neighbor Discovery Protocol (ND), Multicast
+ Listener Discovery Protocol (MLD), and a subset of the Internet Control
+ Message Protocol (ICMPv6).
+
+ Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.2
+
+**/
+
+#ifndef __EFI_IP6_PROTOCOL_H__
+#define __EFI_IP6_PROTOCOL_H__
+
+#include <Protocol/ManagedNetwork.h>
+
+
+#define EFI_IP6_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0xec835dd3, 0xfe0f, 0x617b, {0xa6, 0x21, 0xb3, 0x50, 0xc3, 0xe1, 0x33, 0x88 } \
+ }
+
+#define EFI_IP6_PROTOCOL_GUID \
+ { \
+ 0x2c8759d5, 0x5c2d, 0x66ef, {0x92, 0x5f, 0xb6, 0x6c, 0x10, 0x19, 0x57, 0xe2 } \
+ }
+
+typedef struct _EFI_IP6_PROTOCOL EFI_IP6_PROTOCOL;
+
+///
+/// EFI_IP6_ADDRESS_PAIR is deprecated in the UEFI 2.4B and should not be used any more.
+/// The definition in here is only present to provide backwards compatability.
+///
+typedef struct{
+ ///
+ /// The EFI IPv6 Protocol instance handle that is using this address/prefix pair.
+ ///
+ EFI_HANDLE InstanceHandle;
+ ///
+ /// IPv6 address in network byte order.
+ ///
+ EFI_IPv6_ADDRESS Ip6Address;
+ ///
+ /// The length of the prefix associated with the Ip6Address.
+ ///
+ UINT8 PrefixLength;
+} EFI_IP6_ADDRESS_PAIR;
+
+///
+/// EFI_IP6_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more.
+/// The definition in here is only present to provide backwards compatability.
+///
+typedef struct {
+ ///
+ /// The handle of the driver that creates this entry.
+ ///
+ EFI_HANDLE DriverHandle;
+ ///
+ /// The number of IPv6 address pairs that follow this data structure.
+ ///
+ UINT32 AddressCount;
+ ///
+ /// List of IPv6 address pairs that are currently in use.
+ ///
+ EFI_IP6_ADDRESS_PAIR AddressPairs[1];
+} EFI_IP6_VARIABLE_DATA;
+
+///
+/// ICMPv6 type definitions for error messages
+///
+///@{
+#define ICMP_V6_DEST_UNREACHABLE 0x1
+#define ICMP_V6_PACKET_TOO_BIG 0x2
+#define ICMP_V6_TIME_EXCEEDED 0x3
+#define ICMP_V6_PARAMETER_PROBLEM 0x4
+///@}
+
+///
+/// ICMPv6 type definition for informational messages
+///
+///@{
+#define ICMP_V6_ECHO_REQUEST 0x80
+#define ICMP_V6_ECHO_REPLY 0x81
+#define ICMP_V6_LISTENER_QUERY 0x82
+#define ICMP_V6_LISTENER_REPORT 0x83
+#define ICMP_V6_LISTENER_DONE 0x84
+#define ICMP_V6_ROUTER_SOLICIT 0x85
+#define ICMP_V6_ROUTER_ADVERTISE 0x86
+#define ICMP_V6_NEIGHBOR_SOLICIT 0x87
+#define ICMP_V6_NEIGHBOR_ADVERTISE 0x88
+#define ICMP_V6_REDIRECT 0x89
+#define ICMP_V6_LISTENER_REPORT_2 0x8F
+///@}
+
+///
+/// ICMPv6 code definitions for ICMP_V6_DEST_UNREACHABLE
+///
+///@{
+#define ICMP_V6_NO_ROUTE_TO_DEST 0x0
+#define ICMP_V6_COMM_PROHIBITED 0x1
+#define ICMP_V6_BEYOND_SCOPE 0x2
+#define ICMP_V6_ADDR_UNREACHABLE 0x3
+#define ICMP_V6_PORT_UNREACHABLE 0x4
+#define ICMP_V6_SOURCE_ADDR_FAILED 0x5
+#define ICMP_V6_ROUTE_REJECTED 0x6
+///@}
+
+///
+/// ICMPv6 code definitions for ICMP_V6_TIME_EXCEEDED
+///
+///@{
+#define ICMP_V6_TIMEOUT_HOP_LIMIT 0x0
+#define ICMP_V6_TIMEOUT_REASSEMBLE 0x1
+///@}
+
+///
+/// ICMPv6 code definitions for ICMP_V6_PARAMETER_PROBLEM
+///
+///@{
+#define ICMP_V6_ERRONEOUS_HEADER 0x0
+#define ICMP_V6_UNRECOGNIZE_NEXT_HDR 0x1
+#define ICMP_V6_UNRECOGNIZE_OPTION 0x2
+///@}
+
+///
+/// EFI_IP6_CONFIG_DATA
+/// is used to report and change IPv6 session parameters.
+///
+typedef struct {
+ ///
+ /// For the IPv6 packet to send and receive, this is the default value
+ /// of the 'Next Header' field in the last IPv6 extension header or in
+ /// the IPv6 header if there are no extension headers. Ignored when
+ /// AcceptPromiscuous is TRUE.
+ ///
+ UINT8 DefaultProtocol;
+ ///
+ /// Set to TRUE to receive all IPv6 packets that get through the
+ /// receive filters.
+ /// Set to FALSE to receive only the DefaultProtocol IPv6
+ /// packets that get through the receive filters. Ignored when
+ /// AcceptPromiscuous is TRUE.
+ ///
+ BOOLEAN AcceptAnyProtocol;
+ ///
+ /// Set to TRUE to receive ICMP error report packets. Ignored when
+ /// AcceptPromiscuous or AcceptAnyProtocol is TRUE.
+ ///
+ BOOLEAN AcceptIcmpErrors;
+ ///
+ /// Set to TRUE to receive all IPv6 packets that are sent to any
+ /// hardware address or any protocol address. Set to FALSE to stop
+ /// receiving all promiscuous IPv6 packets.
+ ///
+ BOOLEAN AcceptPromiscuous;
+ ///
+ /// The destination address of the packets that will be transmitted.
+ /// Ignored if it is unspecified.
+ ///
+ EFI_IPv6_ADDRESS DestinationAddress;
+ ///
+ /// The station IPv6 address that will be assigned to this EFI IPv6
+ /// Protocol instance. This field can be set and changed only when
+ /// the EFI IPv6 driver is transitioning from the stopped to the started
+ /// states. If the StationAddress is specified, the EFI IPv6 Protocol
+ /// driver will deliver only incoming IPv6 packets whose destination
+ /// matches this IPv6 address exactly. The StationAddress is required
+ /// to be one of currently configured IPv6 addresses. An address
+ /// containing all zeroes is also accepted as a special case. Under this
+ /// situation, the IPv6 driver is responsible for binding a source
+ /// address to this EFI IPv6 protocol instance according to the source
+ /// address selection algorithm. Only incoming packets destined to
+ /// the selected address will be delivered to the user. And the
+ /// selected station address can be retrieved through later
+ /// GetModeData() call. If no address is available for selecting,
+ /// EFI_NO_MAPPING will be returned, and the station address will
+ /// only be successfully bound to this EFI IPv6 protocol instance
+ /// after IP6ModeData.IsConfigured changed to TRUE.
+ ///
+ EFI_IPv6_ADDRESS StationAddress;
+ ///
+ /// TrafficClass field in transmitted IPv6 packets. Default value
+ /// is zero.
+ ///
+ UINT8 TrafficClass;
+ ///
+ /// HopLimit field in transmitted IPv6 packets.
+ ///
+ UINT8 HopLimit;
+ ///
+ /// FlowLabel field in transmitted IPv6 packets. Default value is
+ /// zero.
+ ///
+ UINT32 FlowLabel;
+ ///
+ /// The timer timeout value (number of microseconds) for the
+ /// receive timeout event to be associated with each assembled
+ /// packet. Zero means do not drop assembled packets.
+ ///
+ UINT32 ReceiveTimeout;
+ ///
+ /// The timer timeout value (number of microseconds) for the
+ /// transmit timeout event to be associated with each outgoing
+ /// packet. Zero means do not drop outgoing packets.
+ ///
+ UINT32 TransmitTimeout;
+} EFI_IP6_CONFIG_DATA;
+
+///
+/// EFI_IP6_ADDRESS_INFO
+///
+typedef struct {
+ EFI_IPv6_ADDRESS Address; ///< The IPv6 address.
+ UINT8 PrefixLength; ///< The length of the prefix associated with the Address.
+} EFI_IP6_ADDRESS_INFO;
+
+///
+/// EFI_IP6_ROUTE_TABLE
+/// is the entry structure that is used in routing tables
+///
+typedef struct {
+ ///
+ /// The IPv6 address of the gateway to be used as the next hop for
+ /// packets to this prefix. If the IPv6 address is all zeros, then the
+ /// prefix is on-link.
+ ///
+ EFI_IPv6_ADDRESS Gateway;
+ ///
+ /// The destination prefix to be routed.
+ ///
+ EFI_IPv6_ADDRESS Destination;
+ ///
+ /// The length of the prefix associated with the Destination.
+ ///
+ UINT8 PrefixLength;
+} EFI_IP6_ROUTE_TABLE;
+
+///
+/// EFI_IP6_NEIGHBOR_STATE
+///
+typedef enum {
+ ///
+ /// Address resolution is being performed on this entry. Specially,
+ /// Neighbor Solicitation has been sent to the solicited-node
+ /// multicast address of the target, but corresponding Neighbor
+ /// Advertisement has not been received.
+ ///
+ EfiNeighborInComplete,
+ ///
+ /// Positive confirmation was received that the forward path to the
+ /// neighbor was functioning properly.
+ ///
+ EfiNeighborReachable,
+ ///
+ ///Reachable Time has elapsed since the last positive confirmation
+ ///was received. In this state, the forward path to the neighbor was
+ ///functioning properly.
+ ///
+ EfiNeighborStale,
+ ///
+ /// This state is an optimization that gives upper-layer protocols
+ /// additional time to provide reachability confirmation.
+ ///
+ EfiNeighborDelay,
+ ///
+ /// A reachability confirmation is actively sought by retransmitting
+ /// Neighbor Solicitations every RetransTimer milliseconds until a
+ /// reachability confirmation is received.
+ ///
+ EfiNeighborProbe
+} EFI_IP6_NEIGHBOR_STATE;
+
+///
+/// EFI_IP6_NEIGHBOR_CACHE
+/// is the entry structure that is used in neighbor cache. It records a set
+/// of entries about individual neighbors to which traffic has been sent recently.
+///
+typedef struct {
+ EFI_IPv6_ADDRESS Neighbor; ///< The on-link unicast/anycast IP address of the neighbor.
+ EFI_MAC_ADDRESS LinkAddress; ///< Link-layer address of the neighbor.
+ EFI_IP6_NEIGHBOR_STATE State; ///< State of this neighbor cache entry.
+} EFI_IP6_NEIGHBOR_CACHE;
+
+///
+/// EFI_IP6_ICMP_TYPE
+/// is used to describe those ICMP messages that are supported by this EFI
+/// IPv6 Protocol driver.
+///
+typedef struct {
+ UINT8 Type; ///< The type of ICMP message.
+ UINT8 Code; ///< The code of the ICMP message.
+} EFI_IP6_ICMP_TYPE;
+
+///
+/// EFI_IP6_MODE_DATA
+///
+typedef struct {
+ ///
+ /// Set to TRUE after this EFI IPv6 Protocol instance is started.
+ /// All other fields in this structure are undefined until this field is TRUE.
+ /// Set to FALSE when the EFI IPv6 Protocol instance is stopped.
+ ///
+ BOOLEAN IsStarted;
+ ///
+ /// The maximum packet size, in bytes, of the packet which the upper layer driver could feed.
+ ///
+ UINT32 MaxPacketSize;
+ ///
+ /// Current configuration settings. Undefined until IsStarted is TRUE.
+ ///
+ EFI_IP6_CONFIG_DATA ConfigData;
+ ///
+ /// Set to TRUE when the EFI IPv6 Protocol instance is configured.
+ /// The instance is configured when it has a station address and
+ /// corresponding prefix length.
+ /// Set to FALSE when the EFI IPv6 Protocol instance is not configured.
+ ///
+ BOOLEAN IsConfigured;
+ ///
+ /// Number of configured IPv6 addresses on this interface.
+ ///
+ UINT32 AddressCount;
+ ///
+ /// List of currently configured IPv6 addresses and corresponding
+ /// prefix lengths assigned to this interface. It is caller's
+ /// responsibility to free this buffer.
+ ///
+ EFI_IP6_ADDRESS_INFO *AddressList;
+ ///
+ /// Number of joined multicast groups. Undefined until
+ /// IsConfigured is TRUE.
+ ///
+ UINT32 GroupCount;
+ ///
+ /// List of joined multicast group addresses. It is caller's
+ /// responsibility to free this buffer. Undefined until
+ /// IsConfigured is TRUE.
+ ///
+ EFI_IPv6_ADDRESS *GroupTable;
+ ///
+ /// Number of entries in the routing table. Undefined until
+ /// IsConfigured is TRUE.
+ ///
+ UINT32 RouteCount;
+ ///
+ /// Routing table entries. It is caller's responsibility to free this buffer.
+ ///
+ EFI_IP6_ROUTE_TABLE *RouteTable;
+ ///
+ /// Number of entries in the neighbor cache. Undefined until
+ /// IsConfigured is TRUE.
+ ///
+ UINT32 NeighborCount;
+ ///
+ /// Neighbor cache entries. It is caller's responsibility to free this
+ /// buffer. Undefined until IsConfigured is TRUE.
+ ///
+ EFI_IP6_NEIGHBOR_CACHE *NeighborCache;
+ ///
+ /// Number of entries in the prefix table. Undefined until
+ /// IsConfigured is TRUE.
+ ///
+ UINT32 PrefixCount;
+ ///
+ /// On-link Prefix table entries. It is caller's responsibility to free this
+ /// buffer. Undefined until IsConfigured is TRUE.
+ ///
+ EFI_IP6_ADDRESS_INFO *PrefixTable;
+ ///
+ /// Number of entries in the supported ICMP types list.
+ ///
+ UINT32 IcmpTypeCount;
+ ///
+ /// Array of ICMP types and codes that are supported by this EFI
+ /// IPv6 Protocol driver. It is caller's responsibility to free this
+ /// buffer.
+ ///
+ EFI_IP6_ICMP_TYPE *IcmpTypeList;
+} EFI_IP6_MODE_DATA;
+
+///
+/// EFI_IP6_HEADER
+/// The fields in the IPv6 header structure are defined in the Internet
+/// Protocol version6 specification.
+///
+#pragma pack(1)
+typedef struct _EFI_IP6_HEADER {
+ UINT8 TrafficClassH:4;
+ UINT8 Version:4;
+ UINT8 FlowLabelH:4;
+ UINT8 TrafficClassL:4;
+ UINT16 FlowLabelL;
+ UINT16 PayloadLength;
+ UINT8 NextHeader;
+ UINT8 HopLimit;
+ EFI_IPv6_ADDRESS SourceAddress;
+ EFI_IPv6_ADDRESS DestinationAddress;
+} EFI_IP6_HEADER;
+#pragma pack()
+
+///
+/// EFI_IP6_FRAGMENT_DATA
+/// describes the location and length of the IPv6 packet
+/// fragment to transmit or that has been received.
+///
+typedef struct _EFI_IP6_FRAGMENT_DATA {
+ UINT32 FragmentLength; ///< Length of fragment data. This field may not be set to zero.
+ VOID *FragmentBuffer; ///< Pointer to fragment data. This field may not be set to NULL.
+} EFI_IP6_FRAGMENT_DATA;
+
+///
+/// EFI_IP6_RECEIVE_DATA
+///
+typedef struct _EFI_IP6_RECEIVE_DATA {
+ ///
+ /// Time when the EFI IPv6 Protocol driver accepted the packet.
+ /// Ignored if it is zero.
+ ///
+ EFI_TIME TimeStamp;
+ ///
+ /// After this event is signaled, the receive data structure is released
+ /// and must not be referenced.
+ ///
+ EFI_EVENT RecycleSignal;
+ ///
+ ///Length of the IPv6 packet headers, including both the IPv6
+ ///header and any extension headers.
+ ///
+ UINT32 HeaderLength;
+ ///
+ /// Pointer to the IPv6 packet header. If the IPv6 packet was
+ /// fragmented, this argument is a pointer to the header in the first
+ /// fragment.
+ ///
+ EFI_IP6_HEADER *Header;
+ ///
+ /// Sum of the lengths of IPv6 packet buffers in FragmentTable. May
+ /// be zero.
+ ///
+ UINT32 DataLength;
+ ///
+ /// Number of IPv6 payload fragments. May be zero.
+ ///
+ UINT32 FragmentCount;
+ ///
+ /// Array of payload fragment lengths and buffer pointers.
+ ///
+ EFI_IP6_FRAGMENT_DATA FragmentTable[1];
+} EFI_IP6_RECEIVE_DATA;
+
+///
+/// EFI_IP6_OVERRIDE_DATA
+/// The information and flags in the override data structure will override
+/// default parameters or settings for one Transmit() function call.
+///
+typedef struct _EFI_IP6_OVERRIDE_DATA {
+ UINT8 Protocol; ///< Protocol type override.
+ UINT8 HopLimit; ///< Hop-Limit override.
+ UINT32 FlowLabel; ///< Flow-Label override.
+} EFI_IP6_OVERRIDE_DATA;
+
+///
+/// EFI_IP6_TRANSMIT_DATA
+///
+typedef struct _EFI_IP6_TRANSMIT_DATA {
+ ///
+ /// The destination IPv6 address. If it is unspecified,
+ /// ConfigData.DestinationAddress will be used instead.
+ ///
+ EFI_IPv6_ADDRESS DestinationAddress;
+ ///
+ /// If not NULL, the IPv6 transmission control override data.
+ ///
+ EFI_IP6_OVERRIDE_DATA *OverrideData;
+ ///
+ /// Total length in byte of the IPv6 extension headers specified in
+ /// ExtHdrs.
+ ///
+ UINT32 ExtHdrsLength;
+ ///
+ /// Pointer to the IPv6 extension headers. The IP layer will append
+ /// the required extension headers if they are not specified by
+ /// ExtHdrs. Ignored if ExtHdrsLength is zero.
+ ///
+ VOID *ExtHdrs;
+ ///
+ /// The protocol of first extension header in ExtHdrs. Ignored if
+ /// ExtHdrsLength is zero.
+ ///
+ UINT8 NextHeader;
+ ///
+ /// Total length in bytes of the FragmentTable data to transmit.
+ ///
+ UINT32 DataLength;
+ ///
+ /// Number of entries in the fragment data table.
+ ///
+ UINT32 FragmentCount;
+ ///
+ /// Start of the fragment data table.
+ ///
+ EFI_IP6_FRAGMENT_DATA FragmentTable[1];
+} EFI_IP6_TRANSMIT_DATA;
+
+///
+/// EFI_IP6_COMPLETION_TOKEN
+/// structures are used for both transmit and receive operations.
+///
+typedef struct {
+ ///
+ /// This Event will be signaled after the Status field is updated by
+ /// the EFI IPv6 Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// Will be set to one of the following values:
+ /// - EFI_SUCCESS: The receive or transmit completed
+ /// successfully.
+ /// - EFI_ABORTED: The receive or transmit was aborted
+ /// - EFI_TIMEOUT: The transmit timeout expired.
+ /// - EFI_ICMP_ERROR: An ICMP error packet was received.
+ /// - EFI_DEVICE_ERROR: An unexpected system or network
+ /// error occurred.
+ /// - EFI_SECURITY_VIOLATION: The transmit or receive was
+ /// failed because of an IPsec policy check.
+ /// - EFI_NO_MEDIA: There was a media error.
+ ///
+ EFI_STATUS Status;
+ union {
+ ///
+ /// When the Token is used for receiving, RxData is a pointer to the EFI_IP6_RECEIVE_DATA.
+ ///
+ EFI_IP6_RECEIVE_DATA *RxData;
+ ///
+ /// When the Token is used for transmitting, TxData is a pointer to the EFI_IP6_TRANSMIT_DATA.
+ ///
+ EFI_IP6_TRANSMIT_DATA *TxData;
+ } Packet;
+} EFI_IP6_COMPLETION_TOKEN;
+
+/**
+ Gets the current operational settings for this instance of the EFI IPv6 Protocol driver.
+
+ The GetModeData() function returns the current operational mode data for this driver instance.
+ The data fields in EFI_IP6_MODE_DATA are read only. This function is used optionally to
+ retrieve the operational mode data of underlying networks or drivers..
+
+ @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.
+ @param[out] Ip6ModeData Pointer to the EFI IPv6 Protocol mode data structure.
+ @param[out] MnpConfigData Pointer to the managed network configuration data structure.
+ @param[out] SnpModeData Pointer to the simple network mode data structure.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP6_GET_MODE_DATA)(
+ IN EFI_IP6_PROTOCOL *This,
+ OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,
+ OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
+ OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
+ );
+
+/**
+ Assigns an IPv6 address and subnet mask to this EFI IPv6 Protocol driver instance.
+
+ The Configure() function is used to set, change, or reset the operational parameters and filter
+ settings for this EFI IPv6 Protocol instance. Until these parameters have been set, no network traffic
+ can be sent or received by this instance. Once the parameters have been reset (by calling this
+ function with Ip6ConfigData set to NULL), no more traffic can be sent or received until these
+ parameters have been set again. Each EFI IPv6 Protocol instance can be started and stopped
+ independently of each other by enabling or disabling their receive filter settings with the
+ Configure() function.
+
+ If Ip6ConfigData.StationAddress is a valid non-zero IPv6 unicast address, it is required
+ to be one of the currently configured IPv6 addresses list in the EFI IPv6 drivers, or else
+ EFI_INVALID_PARAMETER will be returned. If Ip6ConfigData.StationAddress is
+ unspecified, the IPv6 driver will bind a source address according to the source address selection
+ algorithm. Clients could frequently call GetModeData() to check get currently configured IPv6
+ address list in the EFI IPv6 driver. If both Ip6ConfigData.StationAddress and
+ Ip6ConfigData.Destination are unspecified, when transmitting the packet afterwards, the
+ source address filled in each outgoing IPv6 packet is decided based on the destination of this packet. .
+
+ If operational parameters are reset or changed, any pending transmit and receive requests will be
+ cancelled. Their completion token status will be set to EFI_ABORTED and their events will be
+ signaled.
+
+ @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.
+ @param[in] Ip6ConfigData Pointer to the EFI IPv6 Protocol configuration data structure.
+
+ @retval EFI_SUCCESS The driver instance was successfully opened.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - Ip6ConfigData.StationAddress is neither zero nor
+ a unicast IPv6 address.
+ - Ip6ConfigData.StationAddress is neither zero nor
+ one of the configured IP addresses in the EFI IPv6 driver.
+ - Ip6ConfigData.DefaultProtocol is illegal.
+ @retval EFI_OUT_OF_RESOURCES The EFI IPv6 Protocol driver instance data could not be allocated.
+ @retval EFI_NO_MAPPING The IPv6 driver was responsible for choosing a source address for
+ this instance, but no source address was available for use.
+ @retval EFI_ALREADY_STARTED The interface is already open and must be stopped before the IPv6
+ address or prefix length can be changed.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI IPv6
+ Protocol driver instance is not opened.
+ @retval EFI_UNSUPPORTED Default protocol specified through
+ Ip6ConfigData.DefaulProtocol isn't supported.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP6_CONFIGURE)(
+ IN EFI_IP6_PROTOCOL *This,
+ IN EFI_IP6_CONFIG_DATA *Ip6ConfigData OPTIONAL
+ );
+
+/**
+ Joins and leaves multicast groups.
+
+ The Groups() function is used to join and leave multicast group sessions. Joining a group will
+ enable reception of matching multicast packets. Leaving a group will disable reception of matching
+ multicast packets. Source-Specific Multicast isn't required to be supported.
+
+ If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left.
+
+ @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.
+ @param[in] JoinFlag Set to TRUE to join the multicast group session and FALSE to leave.
+ @param[in] GroupAddress Pointer to the IPv6 multicast address.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following is TRUE:
+ - This is NULL.
+ - JoinFlag is TRUE and GroupAddress is NULL.
+ - GroupAddress is not NULL and *GroupAddress is
+ not a multicast IPv6 address.
+ - GroupAddress is not NULL and *GroupAddress is in the
+ range of SSM destination address.
+ @retval EFI_NOT_STARTED This instance has not been started.
+ @retval EFI_OUT_OF_RESOURCES System resources could not be allocated.
+ @retval EFI_UNSUPPORTED This EFI IPv6 Protocol implementation does not support multicast groups.
+ @retval EFI_ALREADY_STARTED The group address is already in the group table (when
+ JoinFlag is TRUE).
+ @retval EFI_NOT_FOUND The group address is not in the group table (when JoinFlag is FALSE).
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP6_GROUPS)(
+ IN EFI_IP6_PROTOCOL *This,
+ IN BOOLEAN JoinFlag,
+ IN EFI_IPv6_ADDRESS *GroupAddress OPTIONAL
+ );
+
+/**
+ Adds and deletes routing table entries.
+
+ The Routes() function adds a route to or deletes a route from the routing table.
+
+ Routes are determined by comparing the leftmost PrefixLength bits of Destination with
+ the destination IPv6 address arithmetically. The gateway address must be on the same subnet as the
+ configured station address.
+
+ The default route is added with Destination and PrefixLegth both set to all zeros. The
+ default route matches all destination IPv6 addresses that do not match any other routes.
+
+ All EFI IPv6 Protocol instances share a routing table.
+
+ @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.
+ @param[in] DeleteRoute Set to TRUE to delete this route from the routing table. Set to
+ FALSE to add this route to the routing table. Destination,
+ PrefixLength and Gateway are used as the key to each
+ route entry.
+ @param[in] Destination The address prefix of the subnet that needs to be routed.
+ @param[in] PrefixLength The prefix length of Destination. Ignored if Destination
+ is NULL.
+ @param[in] GatewayAddress The unicast gateway IPv6 address for this route.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_NOT_STARTED The driver instance has not been started.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - When DeleteRoute is TRUE, both Destination and
+ GatewayAddress are NULL.
+ - When DeleteRoute is FALSE, either Destination or
+ GatewayAddress is NULL.
+ - *GatewayAddress is not a valid unicast IPv6 address.
+ - *GatewayAddress is one of the local configured IPv6
+ addresses.
+ @retval EFI_OUT_OF_RESOURCES Could not add the entry to the routing table.
+ @retval EFI_NOT_FOUND This route is not in the routing table (when DeleteRoute is TRUE).
+ @retval EFI_ACCESS_DENIED The route is already defined in the routing table (when
+ DeleteRoute is FALSE).
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP6_ROUTES)(
+ IN EFI_IP6_PROTOCOL *This,
+ IN BOOLEAN DeleteRoute,
+ IN EFI_IPv6_ADDRESS *Destination OPTIONAL,
+ IN UINT8 PrefixLength,
+ IN EFI_IPv6_ADDRESS *GatewayAddress OPTIONAL
+ );
+
+/**
+ Add or delete Neighbor cache entries.
+
+ The Neighbors() function is used to add, update, or delete an entry from neighbor cache.
+ IPv6 neighbor cache entries are typically inserted and updated by the network protocol driver as
+ network traffic is processed. Most neighbor cache entries will time out and be deleted if the network
+ traffic stops. Neighbor cache entries that were inserted by Neighbors() may be static (will not
+ timeout) or dynamic (will time out).
+
+ The implementation should follow the neighbor cache timeout mechanism which is defined in
+ RFC4861. The default neighbor cache timeout value should be tuned for the expected network
+ environment
+
+ @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.
+ @param[in] DeleteFlag Set to TRUE to delete the specified cache entry, set to FALSE to
+ add (or update, if it already exists and Override is TRUE) the
+ specified cache entry. TargetIp6Address is used as the key
+ to find the requested cache entry.
+ @param[in] TargetIp6Address Pointer to Target IPv6 address.
+ @param[in] TargetLinkAddress Pointer to link-layer address of the target. Ignored if NULL.
+ @param[in] Timeout Time in 100-ns units that this entry will remain in the neighbor
+ cache, it will be deleted after Timeout. A value of zero means that
+ the entry is permanent. A non-zero value means that the entry is
+ dynamic.
+ @param[in] Override If TRUE, the cached link-layer address of the matching entry will
+ be overridden and updated; if FALSE, EFI_ACCESS_DENIED
+ will be returned if a corresponding cache entry already existed.
+
+ @retval EFI_SUCCESS The data has been queued for transmission.
+ @retval EFI_NOT_STARTED This instance has not been started.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - TargetIpAddress is NULL.
+ - *TargetLinkAddress is invalid when not NULL.
+ - *TargetIpAddress is not a valid unicast IPv6 address.
+ - *TargetIpAddress is one of the local configured IPv6
+ addresses.
+ @retval EFI_OUT_OF_RESOURCES Could not add the entry to the neighbor cache.
+ @retval EFI_NOT_FOUND This entry is not in the neighbor cache (when DeleteFlag is
+ TRUE or when DeleteFlag is FALSE while
+ TargetLinkAddress is NULL.).
+ @retval EFI_ACCESS_DENIED The to-be-added entry is already defined in the neighbor cache,
+ and that entry is tagged as un-overridden (when DeleteFlag
+ is FALSE).
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP6_NEIGHBORS)(
+ IN EFI_IP6_PROTOCOL *This,
+ IN BOOLEAN DeleteFlag,
+ IN EFI_IPv6_ADDRESS *TargetIp6Address,
+ IN EFI_MAC_ADDRESS *TargetLinkAddress,
+ IN UINT32 Timeout,
+ IN BOOLEAN Override
+ );
+
+/**
+ Places outgoing data packets into the transmit queue.
+
+ The Transmit() function places a sending request in the transmit queue of this
+ EFI IPv6 Protocol instance. Whenever the packet in the token is sent out or some
+ errors occur, the event in the token will be signaled and the status is updated.
+
+ @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.
+ @param[in] Token Pointer to the transmit token.
+
+ @retval EFI_SUCCESS The data has been queued for transmission.
+ @retval EFI_NOT_STARTED This instance has not been started.
+ @retval EFI_NO_MAPPING The IPv6 driver was responsible for choosing a source address for
+ this transmission, but no source address was available for use.
+ @retval EFI_INVALID_PARAMETER One or more of the following is TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token.Event is NULL.
+ - Token.Packet.TxData is NULL.
+ - Token.Packet.ExtHdrsLength is not zero and Token.Packet.ExtHdrs is NULL.
+ - Token.Packet.FragmentCount is zero.
+ - One or more of the Token.Packet.TxData.FragmentTable[].FragmentLength fields is zero.
+ - One or more of the Token.Packet.TxData.FragmentTable[].FragmentBuffer fields is NULL.
+ - Token.Packet.TxData.DataLength is zero or not equal to the sum of fragment lengths.
+ - Token.Packet.TxData.DestinationAddress is non-zero when DestinationAddress is configured as
+ non-zero when doing Configure() for this EFI IPv6 protocol instance.
+ - Token.Packet.TxData.DestinationAddress is unspecified when DestinationAddress is unspecified
+ when doing Configure() for this EFI IPv6 protocol instance.
+ @retval EFI_ACCESS_DENIED The transmit completion token with the same Token.Event
+ was already in the transmit queue.
+ @retval EFI_NOT_READY The completion token could not be queued because the transmit
+ queue is full.
+ @retval EFI_NOT_FOUND Not route is found to destination address.
+ @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.
+ @retval EFI_BUFFER_TOO_SMALL Token.Packet.TxData.TotalDataLength is too
+ short to transmit.
+ @retval EFI_BAD_BUFFER_SIZE If Token.Packet.TxData.DataLength is beyond the
+ maximum that which can be described through the Fragment Offset
+ field in Fragment header when performing fragmentation.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP6_TRANSMIT)(
+ IN EFI_IP6_PROTOCOL *This,
+ IN EFI_IP6_COMPLETION_TOKEN *Token
+ );
+
+/**
+ Places a receiving request into the receiving queue.
+
+ The Receive() function places a completion token into the receive packet queue.
+ This function is always asynchronous.
+
+ The Token.Event field in the completion token must be filled in by the caller
+ and cannot be NULL. When the receive operation completes, the EFI IPv6 Protocol
+ driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event
+ is signaled.
+
+ @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.
+ @param[in] Token Pointer to a token that is associated with the receive data descriptor.
+
+ @retval EFI_SUCCESS The receive completion token was cached.
+ @retval EFI_NOT_STARTED This EFI IPv6 Protocol instance has not been started.
+ @retval EFI_NO_MAPPING When IP6 driver responsible for binding source address to this instance,
+ while no source address is available for use.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token.Event is NULL.
+ @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of system
+ resources (usually memory).
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ The EFI IPv6 Protocol instance has been reset to startup defaults.
+ @retval EFI_ACCESS_DENIED The receive completion token with the same Token.Event was already
+ in the receive queue.
+ @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP6_RECEIVE)(
+ IN EFI_IP6_PROTOCOL *This,
+ IN EFI_IP6_COMPLETION_TOKEN *Token
+ );
+
+/**
+ Abort an asynchronous transmit or receive request.
+
+ The Cancel() function is used to abort a pending transmit or receive request.
+ If the token is in the transmit or receive request queues, after calling this
+ function, Token->Status will be set to EFI_ABORTED and then Token->Event will
+ be signaled. If the token is not in one of the queues, which usually means the
+ asynchronous operation has completed, this function will not signal the token
+ and EFI_NOT_FOUND is returned.
+
+ @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.
+ @param[in] Token Pointer to a token that has been issued by
+ EFI_IP6_PROTOCOL.Transmit() or
+ EFI_IP6_PROTOCOL.Receive(). If NULL, all pending
+ tokens are aborted. Type EFI_IP6_COMPLETION_TOKEN is
+ defined in EFI_IP6_PROTOCOL.Transmit().
+
+ @retval EFI_SUCCESS The asynchronous I/O request was aborted and
+ Token->Event was signaled. When Token is NULL, all
+ pending requests were aborted and their events were signaled.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_STARTED This instance has not been started.
+ @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was
+ not found in the transmit or receive queue. It has either completed
+ or was not issued by Transmit() and Receive().
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP6_CANCEL)(
+ IN EFI_IP6_PROTOCOL *This,
+ IN EFI_IP6_COMPLETION_TOKEN *Token OPTIONAL
+ );
+
+/**
+ Polls for incoming data packets and processes outgoing data packets.
+
+ The Poll() function polls for incoming data packets and processes outgoing data
+ packets. Network drivers and applications can call the EFI_IP6_PROTOCOL.Poll()
+ function to increase the rate that data packets are moved between the communications
+ device and the transmit and receive queues.
+
+ In some systems the periodic timer event may not poll the underlying communications
+ device fast enough to transmit and/or receive all data packets without missing
+ incoming packets or dropping outgoing packets. Drivers and applications that are
+ experiencing packet loss should try calling the EFI_IP6_PROTOCOL.Poll() function
+ more often.
+
+ @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_NOT_STARTED This EFI IPv6 Protocol instance has not been started.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_NOT_READY No incoming or outgoing data is processed.
+ @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
+ Consider increasing the polling rate.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP6_POLL)(
+ IN EFI_IP6_PROTOCOL *This
+ );
+
+///
+/// The EFI IPv6 Protocol implements a simple packet-oriented interface that can be
+/// used by drivers, daemons, and applications to transmit and receive network packets.
+///
+struct _EFI_IP6_PROTOCOL {
+ EFI_IP6_GET_MODE_DATA GetModeData;
+ EFI_IP6_CONFIGURE Configure;
+ EFI_IP6_GROUPS Groups;
+ EFI_IP6_ROUTES Routes;
+ EFI_IP6_NEIGHBORS Neighbors;
+ EFI_IP6_TRANSMIT Transmit;
+ EFI_IP6_RECEIVE Receive;
+ EFI_IP6_CANCEL Cancel;
+ EFI_IP6_POLL Poll;
+};
+
+extern EFI_GUID gEfiIp6ServiceBindingProtocolGuid;
+extern EFI_GUID gEfiIp6ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip6Config.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip6Config.h
new file mode 100644
index 0000000000..58982fc883
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Ip6Config.h
@@ -0,0 +1,374 @@
+/** @file
+ This file provides a definition of the EFI IPv6 Configuration
+ Protocol.
+
+Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at<BR>
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+#ifndef __EFI_IP6CONFIG_PROTOCOL_H__
+#define __EFI_IP6CONFIG_PROTOCOL_H__
+
+#include <Protocol/Ip6.h>
+
+#define EFI_IP6_CONFIG_PROTOCOL_GUID \
+ { \
+ 0x937fe521, 0x95ae, 0x4d1a, {0x89, 0x29, 0x48, 0xbc, 0xd9, 0x0a, 0xd3, 0x1a } \
+ }
+
+typedef struct _EFI_IP6_CONFIG_PROTOCOL EFI_IP6_CONFIG_PROTOCOL;
+
+///
+/// EFI_IP6_CONFIG_DATA_TYPE
+///
+typedef enum {
+ ///
+ /// The interface information of the communication
+ /// device this EFI IPv6 Configuration Protocol instance manages.
+ /// This type of data is read only.The corresponding Data is of type
+ /// EFI_IP6_CONFIG_INTERFACE_INFO.
+ ///
+ Ip6ConfigDataTypeInterfaceInfo,
+ ///
+ /// The alternative interface ID for the
+ /// communication device this EFI IPv6 Configuration Protocol
+ /// instance manages if the link local IPv6 address generated from
+ /// the interfaced ID based on the default source the EFI IPv6
+ /// Protocol uses is a duplicate address. The length of the interface
+ /// ID is 64 bit. The corresponding Data is of type
+ /// EFI_IP6_CONFIG_INTERFACE_ID.
+ ///
+ Ip6ConfigDataTypeAltInterfaceId,
+ ///
+ /// The general configuration policy for the EFI IPv6 network
+ /// stack running on the communication device this EFI IPv6
+ /// Configuration Protocol instance manages. The policy will affect
+ /// other configuration settings. The corresponding Data is of type
+ /// EFI_IP6_CONFIG_POLICY.
+ ///
+ Ip6ConfigDataTypePolicy,
+ ///
+ /// The number of consecutive
+ /// Neighbor Solicitation messages sent while performing Duplicate
+ /// Address Detection on a tentative address. A value of zero
+ /// indicates that Duplicate Address Detection will not be performed
+ /// on tentative addresses. The corresponding Data is of type
+ /// EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS.
+ ///
+ Ip6ConfigDataTypeDupAddrDetectTransmits,
+ ///
+ /// The station addresses set manually for the EFI
+ /// IPv6 network stack. It is only configurable when the policy is
+ /// Ip6ConfigPolicyManual. The corresponding Data is a
+ /// pointer to an array of EFI_IPv6_ADDRESS instances. When
+ /// DataSize is 0 and Data is NULL, the existing configuration
+ /// is cleared from the EFI IPv6 Configuration Protocol instance.
+ ///
+ Ip6ConfigDataTypeManualAddress,
+ ///
+ /// The gateway addresses set manually for the EFI IPv6
+ /// network stack running on the communication device this EFI
+ /// IPv6 Configuration Protocol manages. It is not configurable when
+ /// the policy is Ip6ConfigPolicyAutomatic. The gateway
+ /// addresses must be unicast IPv6 addresses. The corresponding
+ /// Data is a pointer to an array of EFI_IPv6_ADDRESS instances.
+ /// When DataSize is 0 and Data is NULL, the existing configuration
+ /// is cleared from the EFI IPv6 Configuration Protocol instance.
+ ///
+ Ip6ConfigDataTypeGateway,
+ ///
+ /// The DNS server list for the EFI IPv6 network stack
+ /// running on the communication device this EFI IPv6
+ /// Configuration Protocol manages. It is not configurable when the
+ /// policy is Ip6ConfigPolicyAutomatic.The DNS server
+ /// addresses must be unicast IPv6 addresses. The corresponding
+ /// Data is a pointer to an array of EFI_IPv6_ADDRESS instances.
+ /// When DataSize is 0 and Data is NULL, the existing configuration
+ /// is cleared from the EFI IPv6 Configuration Protocol instance.
+ ///
+ Ip6ConfigDataTypeDnsServer,
+ ///
+ /// The number of this enumeration memebers.
+ ///
+ Ip6ConfigDataTypeMaximum
+} EFI_IP6_CONFIG_DATA_TYPE;
+
+///
+/// EFI_IP6_CONFIG_INTERFACE_INFO
+/// describes the operational state of the interface this
+/// EFI IPv6 Configuration Protocol instance manages.
+///
+typedef struct {
+ ///
+ /// The name of the interface. It is a NULL-terminated string.
+ ///
+ CHAR16 Name[32];
+ ///
+ /// The interface type of the network interface.
+ ///
+ UINT8 IfType;
+ ///
+ /// The size, in bytes, of the network interface's hardware address.
+ ///
+ UINT32 HwAddressSize;
+ ///
+ /// The hardware address for the network interface.
+ ///
+ EFI_MAC_ADDRESS HwAddress;
+ ///
+ /// Number of EFI_IP6_ADDRESS_INFO structures pointed to by AddressInfo.
+ ///
+ UINT32 AddressInfoCount;
+ ///
+ /// Pointer to an array of EFI_IP6_ADDRESS_INFO instances
+ /// which contain the local IPv6 addresses and the corresponding
+ /// prefix length information. Set to NULL if AddressInfoCount
+ /// is zero.
+ ///
+ EFI_IP6_ADDRESS_INFO *AddressInfo;
+ ///
+ /// Number of route table entries in the following RouteTable.
+ ///
+ UINT32 RouteCount;
+ ///
+ /// The route table of the IPv6 network stack runs on this interface.
+ /// Set to NULL if RouteCount is zero.
+ ///
+ EFI_IP6_ROUTE_TABLE *RouteTable;
+} EFI_IP6_CONFIG_INTERFACE_INFO;
+
+///
+/// EFI_IP6_CONFIG_INTERFACE_ID
+/// describes the 64-bit interface ID.
+///
+typedef struct {
+ UINT8 Id[8];
+} EFI_IP6_CONFIG_INTERFACE_ID;
+
+///
+/// EFI_IP6_CONFIG_POLICY
+/// defines the general configuration policy the EFI IPv6
+/// Configuration Protocol supports.
+///
+typedef enum {
+ ///
+ /// Under this policy, the IpI6ConfigDataTypeManualAddress,
+ /// Ip6ConfigDataTypeGateway and Ip6ConfigDataTypeDnsServer
+ /// configuration data are required to be set manually.
+ /// The EFI IPv6 Protocol will get all required configuration
+ /// such as address, prefix and gateway settings from the EFI
+ /// IPv6 Configuration protocol.
+ ///
+ Ip6ConfigPolicyManual,
+ ///
+ /// Under this policy, the IpI6ConfigDataTypeManualAddress,
+ /// Ip6ConfigDataTypeGateway and Ip6ConfigDataTypeDnsServer
+ /// configuration data are not allowed to set via SetData().
+ /// All of these configurations are retrieved from some auto
+ /// configuration mechanism.
+ /// The EFI IPv6 Protocol will use the IPv6 stateless address
+ /// autoconfiguration mechanism and/or the IPv6 stateful address
+ /// autoconfiguration mechanism described in the related RFCs to
+ /// get address and other configuration information
+ ///
+ Ip6ConfigPolicyAutomatic
+} EFI_IP6_CONFIG_POLICY;
+
+///
+/// EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS
+/// describes the number of consecutive Neighbor Solicitation messages sent
+/// while performing Duplicate Address Detection on a tentative address.
+/// The default value for a newly detected communication device is 1.
+///
+typedef struct {
+ UINT32 DupAddrDetectTransmits; ///< The number of consecutive Neighbor Solicitation messages sent.
+} EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS;
+
+///
+/// EFI_IP6_CONFIG_MANUAL_ADDRESS
+/// is used to set the station address information for the EFI IPv6 network
+/// stack manually when the policy is Ip6ConfigPolicyManual.
+///
+typedef struct {
+ EFI_IPv6_ADDRESS Address; ///< The IPv6 unicast address.
+ BOOLEAN IsAnycast; ///< Set to TRUE if Address is anycast.
+ UINT8 PrefixLength; ///< The length, in bits, of the prefix associated with this Address.
+} EFI_IP6_CONFIG_MANUAL_ADDRESS;
+
+
+/**
+ Set the configuration for the EFI IPv6 network stack running on the communication
+ device this EFI IPv6 Configuration Protocol instance manages.
+
+ This function is used to set the configuration data of type DataType for the EFI
+ IPv6 network stack running on the communication device this EFI IPv6 Configuration
+ Protocol instance manages.
+
+ The DataSize is used to calculate the count of structure instances in the Data for
+ some DataType that multiple structure instances are allowed.
+
+ This function is always non-blocking. When setting some type of configuration data,
+ an asynchronous process is invoked to check the correctness of the data, such as
+ doing Duplicate Address Detection on the manually set local IPv6 addresses.
+ EFI_NOT_READY is returned immediately to indicate that such an asynchronous process
+ is invoked and the process is not finished yet. The caller willing to get the result
+ of the asynchronous process is required to call RegisterDataNotify() to register an
+ event on the specified configuration data. Once the event is signaled, the caller
+ can call GetData() to get back the configuration data in order to know the result.
+ For other types of configuration data that do not require an asynchronous configuration
+ process, the result of the operation is immediately returned.
+
+ @param[in] This Pointer to the EFI_IP6_CONFIG_PROTOCOL instance.
+ @param[in] DataType The type of data to set.
+ @param[in] DataSize Size of the buffer pointed to by Data in bytes.
+ @param[in] Data The data buffer to set. The type of the data buffer is
+ associated with the DataType.
+
+ @retval EFI_SUCCESS The specified configuration data for the EFI IPv6
+ network stack is set successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ - One or more fields in Data and DataSize do not match the
+ requirement of the data type indicated by DataType.
+ @retval EFI_WRITE_PROTECTED The specified configuration data is read-only or the specified
+ configuration data can not be set under the current policy
+ @retval EFI_ACCESS_DENIED Another set operation on the specified configuration
+ data is already in process.
+ @retval EFI_NOT_READY An asynchronous process is invoked to set the specified
+ configuration data and the process is not finished yet.
+ @retval EFI_BAD_BUFFER_SIZE The DataSize does not match the size of the type
+ indicated by DataType.
+ @retval EFI_UNSUPPORTED This DataType is not supported.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_DEVICE_ERROR An unexpected system error or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP6_CONFIG_SET_DATA)(
+ IN EFI_IP6_CONFIG_PROTOCOL *This,
+ IN EFI_IP6_CONFIG_DATA_TYPE DataType,
+ IN UINTN DataSize,
+ IN VOID *Data
+ );
+
+/**
+ Get the configuration data for the EFI IPv6 network stack running on the communication
+ device this EFI IPv6 Configuration Protocol instance manages.
+
+ This function returns the configuration data of type DataType for the EFI IPv6 network
+ stack running on the communication device this EFI IPv6 Configuration Protocol instance
+ manages.
+
+ The caller is responsible for allocating the buffer used to return the specified
+ configuration data and the required size will be returned to the caller if the size of
+ the buffer is too small.
+
+ EFI_NOT_READY is returned if the specified configuration data is not ready due to an
+ already in progress asynchronous configuration process. The caller can call RegisterDataNotify()
+ to register an event on the specified configuration data. Once the asynchronous configuration
+ process is finished, the event will be signaled and a subsequent GetData() call will return
+ the specified configuration data.
+
+ @param[in] This Pointer to the EFI_IP6_CONFIG_PROTOCOL instance.
+ @param[in] DataType The type of data to get.
+ @param[in,out] DataSize On input, in bytes, the size of Data. On output, in bytes, the
+ size of buffer required to store the specified configuration data.
+ @param[in] Data The data buffer in which the configuration data is returned. The
+ type of the data buffer is associated with the DataType.
+
+ @retval EFI_SUCCESS The specified configuration data is got successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:
+ - This is NULL.
+ - DataSize is NULL.
+ - Data is NULL if *DataSize is not zero.
+ @retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified configuration data
+ and the required size is returned in DataSize.
+ @retval EFI_NOT_READY The specified configuration data is not ready due to an already in
+ progress asynchronous configuration process.
+ @retval EFI_NOT_FOUND The specified configuration data is not found.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP6_CONFIG_GET_DATA)(
+ IN EFI_IP6_CONFIG_PROTOCOL *This,
+ IN EFI_IP6_CONFIG_DATA_TYPE DataType,
+ IN OUT UINTN *DataSize,
+ IN VOID *Data OPTIONAL
+ );
+
+/**
+ Register an event that is to be signaled whenever a configuration process on the specified
+ configuration data is done.
+
+ This function registers an event that is to be signaled whenever a configuration process
+ on the specified configuration data is done. An event can be registered for different DataType
+ simultaneously and the caller is responsible for determining which type of configuration data
+ causes the signaling of the event in such case.
+
+ @param[in] This Pointer to the EFI_IP6_CONFIG_PROTOCOL instance.
+ @param[in] DataType The type of data to unregister the event for.
+ @param[in] Event The event to register.
+
+ @retval EFI_SUCCESS The notification event for the specified configuration data is
+ registered.
+ @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
+ @retval EFI_UNSUPPORTED The configuration data type specified by DataType is not
+ supported.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_ACCESS_DENIED The Event is already registered for the DataType.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP6_CONFIG_REGISTER_NOTIFY)(
+ IN EFI_IP6_CONFIG_PROTOCOL *This,
+ IN EFI_IP6_CONFIG_DATA_TYPE DataType,
+ IN EFI_EVENT Event
+ );
+
+/**
+ Remove a previously registered event for the specified configuration data.
+
+ This function removes a previously registered event for the specified configuration data.
+
+ @param[in] This Pointer to the EFI_IP6_CONFIG_PROTOCOL instance.
+ @param[in] DataType The type of data to remove the previously registered event for.
+ @param[in] Event The event to unregister.
+
+ @retval EFI_SUCCESS The event registered for the specified configuration data is removed.
+ @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
+ @retval EFI_NOT_FOUND The Event has not been registered for the specified
+ DataType.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IP6_CONFIG_UNREGISTER_NOTIFY)(
+ IN EFI_IP6_CONFIG_PROTOCOL *This,
+ IN EFI_IP6_CONFIG_DATA_TYPE DataType,
+ IN EFI_EVENT Event
+ );
+
+///
+/// The EFI_IP6_CONFIG_PROTOCOL provides the mechanism to set and get various
+/// types of configurations for the EFI IPv6 network stack.
+///
+struct _EFI_IP6_CONFIG_PROTOCOL {
+ EFI_IP6_CONFIG_SET_DATA SetData;
+ EFI_IP6_CONFIG_GET_DATA GetData;
+ EFI_IP6_CONFIG_REGISTER_NOTIFY RegisterDataNotify;
+ EFI_IP6_CONFIG_UNREGISTER_NOTIFY UnregisterDataNotify;
+};
+
+extern EFI_GUID gEfiIp6ConfigProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IpSec.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IpSec.h
new file mode 100644
index 0000000000..a22326309c
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IpSec.h
@@ -0,0 +1,224 @@
+/** @file
+ EFI IPSEC Protocol Definition
+ The EFI_IPSEC_PROTOCOL is used to abstract the ability to deal with the individual
+ packets sent and received by the host and provide packet-level security for IP
+ datagram.
+ The EFI_IPSEC2_PROTOCOL is used to abstract the ability to deal with the individual
+ packets sent and received by the host and provide packet-level security for IP
+ datagram. In addition, it supports the Option (extension header) processing in
+ IPsec which doesn't support in EFI_IPSEC_PROTOCOL. It is also recommended to
+ use EFI_IPSEC2_PROTOCOL instead of EFI_IPSEC_PROTOCOL especially for IPsec Tunnel
+ Mode.
+
+ Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ The EFI_IPSEC2_PROTOCOL is introduced in UEFI Specification 2.3D.
+
+**/
+
+#ifndef __EFI_IPSEC_PROTOCOL_H__
+#define __EFI_IPSEC_PROTOCOL_H__
+
+#include <Protocol/IpSecConfig.h>
+
+#define EFI_IPSEC_PROTOCOL_GUID \
+ { \
+ 0xdfb386f7, 0xe100, 0x43ad, {0x9c, 0x9a, 0xed, 0x90, 0xd0, 0x8a, 0x5e, 0x12 } \
+ }
+
+#define EFI_IPSEC2_PROTOCOL_GUID \
+ { \
+ 0xa3979e64, 0xace8, 0x4ddc, {0xbc, 0x7, 0x4d, 0x66, 0xb8, 0xfd, 0x9, 0x77 } \
+ }
+
+typedef struct _EFI_IPSEC_PROTOCOL EFI_IPSEC_PROTOCOL;
+typedef struct _EFI_IPSEC2_PROTOCOL EFI_IPSEC2_PROTOCOL;
+
+///
+/// EFI_IPSEC_FRAGMENT_DATA
+/// defines the instances of packet fragments.
+///
+typedef struct _EFI_IPSEC_FRAGMENT_DATA {
+ UINT32 FragmentLength;
+ VOID *FragmentBuffer;
+} EFI_IPSEC_FRAGMENT_DATA;
+
+
+/**
+ Handles IPsec packet processing for inbound and outbound IP packets.
+
+ The EFI_IPSEC_PROCESS process routine handles each inbound or outbound packet.
+ The behavior is that it can perform one of the following actions:
+ bypass the packet, discard the packet, or protect the packet.
+
+ @param[in] This Pointer to the EFI_IPSEC_PROTOCOL instance.
+ @param[in] NicHandle Instance of the network interface.
+ @param[in] IpVer IPV4 or IPV6.
+ @param[in, out] IpHead Pointer to the IP Header.
+ @param[in] LastHead The protocol of the next layer to be processed by IPsec.
+ @param[in] OptionsBuffer Pointer to the options buffer.
+ @param[in] OptionsLength Length of the options buffer.
+ @param[in, out] FragmentTable Pointer to a list of fragments.
+ @param[in] FragmentCount Number of fragments.
+ @param[in] TrafficDirection Traffic direction.
+ @param[out] RecycleSignal Event for recycling of resources.
+
+ @retval EFI_SUCCESS The packet was bypassed and all buffers remain the same.
+ @retval EFI_SUCCESS The packet was protected.
+ @retval EFI_ACCESS_DENIED The packet was discarded.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IPSEC_PROCESS)(
+ IN EFI_IPSEC_PROTOCOL *This,
+ IN EFI_HANDLE NicHandle,
+ IN UINT8 IpVer,
+ IN OUT VOID *IpHead,
+ IN UINT8 *LastHead,
+ IN VOID *OptionsBuffer,
+ IN UINT32 OptionsLength,
+ IN OUT EFI_IPSEC_FRAGMENT_DATA **FragmentTable,
+ IN UINT32 *FragmentCount,
+ IN EFI_IPSEC_TRAFFIC_DIR TrafficDirection,
+ OUT EFI_EVENT *RecycleSignal
+ );
+
+///
+/// EFI_IPSEC_PROTOCOL
+/// provides the ability for securing IP communications by authenticating
+/// and/or encrypting each IP packet in a data stream.
+// EFI_IPSEC_PROTOCOL can be consumed by both the IPv4 and IPv6 stack.
+// A user can employ this protocol for IPsec package handling in both IPv4
+// and IPv6 environment.
+///
+struct _EFI_IPSEC_PROTOCOL {
+ EFI_IPSEC_PROCESS Process; ///< Handle the IPsec message.
+ EFI_EVENT DisabledEvent; ///< Event signaled when the interface is disabled.
+ BOOLEAN DisabledFlag; ///< State of the interface.
+};
+
+/**
+ Handles IPsec processing for both inbound and outbound IP packets. Compare with
+ Process() in EFI_IPSEC_PROTOCOL, this interface has the capability to process
+ Option(Extension Header).
+
+ The EFI_IPSEC2_PROCESS process routine handles each inbound or outbound packet.
+ The behavior is that it can perform one of the following actions:
+ bypass the packet, discard the packet, or protect the packet.
+
+ @param[in] This Pointer to the EFI_IPSEC2_PROTOCOL instance.
+ @param[in] NicHandle Instance of the network interface.
+ @param[in] IpVer IP version.IPv4 or IPv6.
+ @param[in, out] IpHead Pointer to the IP Header it is either
+ the EFI_IP4_HEADER or EFI_IP6_HEADER.
+ On input, it contains the IP header.
+ On output, 1) in tunnel mode and the
+ traffic direction is inbound, the buffer
+ will be reset to zero by IPsec; 2) in
+ tunnel mode and the traffic direction
+ is outbound, the buffer will reset to
+ be the tunnel IP header.3) in transport
+ mode, the related fielders (like payload
+ length, Next header) in IP header will
+ be modified according to the condition.
+ @param[in, out] LastHead For IP4, it is the next protocol in IP
+ header. For IP6 it is the Next Header
+ of the last extension header.
+ @param[in, out] OptionsBuffer On input, it contains the options
+ (extensions header) to be processed by
+ IPsec. On output, 1) in tunnel mode and
+ the traffic direction is outbound, it
+ will be set to NULL, and that means this
+ contents was wrapped after inner header
+ and should not be concatenated after
+ tunnel header again; 2) in transport
+ mode and the traffic direction is inbound,
+ if there are IP options (extension headers)
+ protected by IPsec, IPsec will concatenate
+ the those options after the input options
+ (extension headers); 3) on other situations,
+ the output of contents of OptionsBuffer
+ might be same with input's. The caller
+ should take the responsibility to free
+ the buffer both on input and on output.
+ @param[in, out] OptionsLength On input, the input length of the options
+ buffer. On output, the output length of
+ the options buffer.
+ @param[in, out] FragmentTable Pointer to a list of fragments. On input,
+ these fragments contain the IP payload.
+ On output, 1) in tunnel mode and the traffic
+ direction is inbound, the fragments contain
+ the whole IP payload which is from the
+ IP inner header to the last byte of the
+ packet; 2) in tunnel mode and the traffic
+ direction is the outbound, the fragments
+ contains the whole encapsulated payload
+ which encapsulates the whole IP payload
+ between the encapsulated header and
+ encapsulated trailer fields. 3) in transport
+ mode and the traffic direction is inbound,
+ the fragments contains the IP payload
+ which is from the next layer protocol to
+ the last byte of the packet; 4) in transport
+ mode and the traffic direction is outbound,
+ the fragments contains the whole encapsulated
+ payload which encapsulates the next layer
+ protocol information between the encapsulated
+ header and encapsulated trailer fields.
+ @param[in, out] FragmentCount Number of fragments.
+ @param[in] TrafficDirection Traffic direction.
+ @param[out] RecycleSignal Event for recycling of resources.
+
+ @retval EFI_SUCCESS The packet was processed by IPsec successfully.
+ @retval EFI_ACCESS_DENIED The packet was discarded.
+ @retval EFI_NOT_READY The IKE negotiation is invoked and the packet
+ was discarded.
+ @retval EFI_INVALID_PARAMETER One or more of following are TRUE:
+ If OptionsBuffer is NULL;
+ If OptionsLength is NULL;
+ If FragmentTable is NULL;
+ If FragmentCount is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IPSEC_PROCESSEXT) (
+ IN EFI_IPSEC2_PROTOCOL *This,
+ IN EFI_HANDLE NicHandle,
+ IN UINT8 IpVer,
+ IN OUT VOID *IpHead,
+ IN OUT UINT8 *LastHead,
+ IN OUT VOID **OptionsBuffer,
+ IN OUT UINT32 *OptionsLength,
+ IN OUT EFI_IPSEC_FRAGMENT_DATA **FragmentTable,
+ IN OUT UINT32 *FragmentCount,
+ IN EFI_IPSEC_TRAFFIC_DIR TrafficDirection,
+ OUT EFI_EVENT *RecycleSignal
+ );
+
+///
+/// EFI_IPSEC2_PROTOCOL
+/// supports the Option (extension header) processing in IPsec which doesn't support
+/// in EFI_IPSEC_PROTOCOL. It is also recommended to use EFI_IPSEC2_PROTOCOL instead
+/// of EFI_IPSEC_PROTOCOL especially for IPsec Tunnel Mode.
+/// provides the ability for securing IP communications by authenticating and/or
+/// encrypting each IP packet in a data stream.
+///
+struct _EFI_IPSEC2_PROTOCOL {
+EFI_IPSEC_PROCESSEXT ProcessExt;
+EFI_EVENT DisabledEvent;
+BOOLEAN DisabledFlag;
+};
+
+extern EFI_GUID gEfiIpSecProtocolGuid;
+extern EFI_GUID gEfiIpSec2ProtocolGuid;
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IpSecConfig.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IpSecConfig.h
new file mode 100644
index 0000000000..4efc2e3d74
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IpSecConfig.h
@@ -0,0 +1,807 @@
+/** @file
+ EFI IPsec Configuration Protocol Definition
+ The EFI_IPSEC_CONFIG_PROTOCOL provides the mechanism to set and retrieve security and
+ policy related information for the EFI IPsec protocol driver.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.2
+
+**/
+
+#ifndef __EFI_IPSE_CCONFIG_PROTOCOL_H__
+#define __EFI_IPSE_CCONFIG_PROTOCOL_H__
+
+
+#define EFI_IPSEC_CONFIG_PROTOCOL_GUID \
+ { \
+ 0xce5e5929, 0xc7a3, 0x4602, {0xad, 0x9e, 0xc9, 0xda, 0xf9, 0x4e, 0xbf, 0xcf } \
+ }
+
+typedef struct _EFI_IPSEC_CONFIG_PROTOCOL EFI_IPSEC_CONFIG_PROTOCOL;
+
+///
+/// EFI_IPSEC_CONFIG_DATA_TYPE
+///
+typedef enum {
+ ///
+ /// The IPsec Security Policy Database (aka SPD) setting. In IPsec,
+ /// an essential element of Security Association (SA) processing is
+ /// underlying SPD that specifies what services are to be offered to
+ /// IP datagram and in what fashion. The SPD must be consulted
+ /// during the processing of all traffic (inbound and outbound),
+ /// including traffic not protected by IPsec, that traverses the IPsec
+ /// boundary. With this DataType, SetData() function is to set
+ /// the SPD entry information, which may add one new entry, delete
+ /// one existed entry or flush the whole database according to the
+ /// parameter values. The corresponding Data is of type
+ /// EFI_IPSEC_SPD_DATA
+ ///
+ IPsecConfigDataTypeSpd,
+ ///
+ /// The IPsec Security Association Database (aka SAD) setting. A
+ /// SA is a simplex connection that affords security services to the
+ /// traffic carried by it. Security services are afforded to an SA by the
+ /// use of AH, or ESP, but not both. The corresponding Data is of
+ /// type EFI_IPSEC_SAD_DATA.
+ ///
+ IPsecConfigDataTypeSad,
+ ///
+ /// The IPsec Peer Authorization Database (aka PAD) setting, which
+ /// provides the link between the SPD and a security association
+ /// management protocol. The PAD entry specifies the
+ /// authentication protocol (e.g. IKEv1, IKEv2) method used and the
+ /// authentication data. The corresponding Data is of type
+ /// EFI_IPSEC_PAD_DATA.
+ ///
+ IPsecConfigDataTypePad,
+ IPsecConfigDataTypeMaximum
+} EFI_IPSEC_CONFIG_DATA_TYPE;
+
+///
+/// EFI_IP_ADDRESS_INFO
+///
+typedef struct _EFI_IP_ADDRESS_INFO {
+ EFI_IP_ADDRESS Address; ///< The IPv4 or IPv6 address
+ UINT8 PrefixLength; ///< The length of the prefix associated with the Address.
+} EFI_IP_ADDRESS_INFO;
+
+
+///
+/// EFI_IPSEC_SPD_SELECTOR
+///
+typedef struct _EFI_IPSEC_SPD_SELECTOR {
+ ///
+ /// Specifies the actual number of entries in LocalAddress.
+ ///
+ UINT32 LocalAddressCount;
+ ///
+ /// A list of ranges of IPv4 or IPv6 addresses, which refers to the
+ /// addresses being protected by IPsec policy.
+ ///
+ EFI_IP_ADDRESS_INFO *LocalAddress;
+ ///
+ /// Specifies the actual number of entries in RemoteAddress.
+ ///
+ UINT32 RemoteAddressCount;
+ ///
+ /// A list of ranges of IPv4 or IPv6 addresses, which are peer entities
+ /// to LocalAddress.
+ ///
+ EFI_IP_ADDRESS_INFO *RemoteAddress;
+ ///
+ /// Next layer protocol. Obtained from the IPv4 Protocol or the IPv6
+ /// Next Header fields. The next layer protocol is whatever comes
+ /// after any IP extension headers that are present. A zero value is a
+ /// wildcard that matches any value in NextLayerProtocol field.
+ ///
+ UINT16 NextLayerProtocol;
+ ///
+ /// Local Port if the Next Layer Protocol uses two ports (as do TCP,
+ /// UDP, and others). A zero value is a wildcard that matches any
+ /// value in LocalPort field.
+ ///
+ UINT16 LocalPort;
+ ///
+ /// A designed port range size. The start port is LocalPort, and
+ /// the total number of ports is described by LocalPortRange.
+ /// This field is ignored if NextLayerProtocol does not use
+ /// ports.
+ ///
+ UINT16 LocalPortRange;
+ ///
+ /// Remote Port if the Next Layer Protocol uses two ports. A zero
+ /// value is a wildcard that matches any value in RemotePort field.
+ ///
+ UINT16 RemotePort;
+ ///
+ /// A designed port range size. The start port is RemotePort, and
+ /// the total number of ports is described by RemotePortRange.
+ /// This field is ignored if NextLayerProtocol does not use ports.
+ ///
+ UINT16 RemotePortRange;
+} EFI_IPSEC_SPD_SELECTOR;
+
+///
+/// EFI_IPSEC_TRAFFIC_DIR
+/// represents the directionality in an SPD entry.
+///
+typedef enum {
+ ///
+ /// The EfiIPsecInBound refers to traffic entering an IPsec implementation via
+ /// the unprotected interface or emitted by the implementation on the unprotected
+ /// side of the boundary and directed towards the protected interface.
+ ///
+ EfiIPsecInBound,
+ ///
+ /// The EfiIPsecOutBound refers to traffic entering the implementation via
+ /// the protected interface, or emitted by the implementation on the protected side
+ /// of the boundary and directed toward the unprotected interface.
+ ///
+ EfiIPsecOutBound
+} EFI_IPSEC_TRAFFIC_DIR;
+
+///
+/// EFI_IPSEC_ACTION
+/// represents three possible processing choices.
+///
+typedef enum {
+ ///
+ /// Refers to traffic that is not allowed to traverse the IPsec boundary.
+ ///
+ EfiIPsecActionDiscard,
+ ///
+ /// Refers to traffic that is allowed to cross the IPsec boundary
+ /// without protection.
+ ///
+ EfiIPsecActionBypass,
+ ///
+ /// Refers to traffic that is afforded IPsec protection, and for such
+ /// traffic the SPD must specify the security protocols to be
+ /// employed, their mode, security service options, and the
+ /// cryptographic algorithms to be used.
+ ///
+ EfiIPsecActionProtect
+} EFI_IPSEC_ACTION;
+
+///
+/// EFI_IPSEC_SA_LIFETIME
+/// defines the lifetime of an SA, which represents when a SA must be
+/// replaced or terminated. A value of all 0 for each field removes
+/// the limitation of a SA lifetime.
+///
+typedef struct _EFI_IPSEC_SA_LIFETIME {
+ ///
+ /// The number of bytes to which the IPsec cryptographic algorithm
+ /// can be applied. For ESP, this is the encryption algorithm and for
+ /// AH, this is the authentication algorithm. The ByteCount
+ /// includes pad bytes for cryptographic operations.
+ ///
+ UINT64 ByteCount;
+ ///
+ /// A time interval in second that warns the implementation to
+ /// initiate action such as setting up a replacement SA.
+ ///
+ UINT64 SoftLifetime;
+ ///
+ /// A time interval in second when the current SA ends and is
+ /// destroyed.
+ ///
+ UINT64 HardLifetime;
+} EFI_IPSEC_SA_LIFETIME;
+
+///
+/// EFI_IPSEC_MODE
+/// There are two modes of IPsec operation: transport mode and tunnel mode. In
+/// EfiIPsecTransport mode, AH and ESP provide protection primarily for next layer protocols;
+/// In EfiIPsecTunnel mode, AH and ESP are applied to tunneled IP packets.
+///
+typedef enum {
+ EfiIPsecTransport,
+ EfiIPsecTunnel
+} EFI_IPSEC_MODE;
+
+///
+/// EFI_IPSEC_TUNNEL_DF_OPTION
+/// The option of copying the DF bit from an outbound package to
+/// the tunnel mode header that it emits, when traffic is carried
+/// via a tunnel mode SA. This applies to SAs where both inner and
+/// outer headers are IPv4.
+///
+typedef enum {
+ EfiIPsecTunnelClearDf, ///< Clear DF bit from inner header.
+ EfiIPsecTunnelSetDf, ///< Set DF bit from inner header.
+ EfiIPsecTunnelCopyDf ///< Copy DF bit from inner header.
+} EFI_IPSEC_TUNNEL_DF_OPTION;
+
+///
+/// EFI_IPSEC_TUNNEL_OPTION
+///
+typedef struct _EFI_IPSEC_TUNNEL_OPTION {
+ ///
+ /// Local tunnel address when IPsec mode is EfiIPsecTunnel.
+ ///
+ EFI_IP_ADDRESS LocalTunnelAddress;
+ ///
+ /// Remote tunnel address when IPsec mode is EfiIPsecTunnel.
+ ///
+ EFI_IP_ADDRESS RemoteTunnelAddress;
+ ///
+ /// The option of copying the DF bit from an outbound package
+ /// to the tunnel mode header that it emits, when traffic is
+ /// carried via a tunnel mode SA.
+ ///
+ EFI_IPSEC_TUNNEL_DF_OPTION DF;
+} EFI_IPSEC_TUNNEL_OPTION;
+
+///
+/// EFI_IPSEC_PROTOCOL_TYPE
+///
+typedef enum {
+ EfiIPsecAH, ///< IP Authentication Header protocol which is specified in RFC 4302.
+ EfiIPsecESP ///< IP Encapsulating Security Payload which is specified in RFC 4303.
+} EFI_IPSEC_PROTOCOL_TYPE;
+
+///
+/// EFI_IPSEC_PROCESS_POLICY
+/// describes a policy list for traffic processing.
+///
+typedef struct _EFI_IPSEC_PROCESS_POLICY {
+ ///
+ /// Extended Sequence Number. Is this SA using extended sequence
+ /// numbers. 64 bit counter is used if TRUE.
+ ///
+ BOOLEAN ExtSeqNum;
+ ///
+ /// A flag indicating whether overflow of the sequence number
+ /// counter should generate an auditable event and prevent
+ /// transmission of additional packets on the SA, or whether rollover
+ /// is permitted.
+ ///
+ BOOLEAN SeqOverflow;
+ ///
+ /// Is this SA using stateful fragment checking. TRUE represents
+ /// stateful fragment checking.
+ ///
+ BOOLEAN FragCheck;
+ ///
+ /// A time interval after which a SA must be replaced with a new SA
+ /// (and new SPI) or terminated.
+ ///
+ EFI_IPSEC_SA_LIFETIME SaLifetime;
+ ///
+ /// IPsec mode: tunnel or transport.
+ ///
+ EFI_IPSEC_MODE Mode;
+ ///
+ /// Tunnel Option. TunnelOption is ignored if Mode is EfiIPsecTransport.
+ ///
+ EFI_IPSEC_TUNNEL_OPTION *TunnelOption;
+ ///
+ /// IPsec protocol: AH or ESP
+ ///
+ EFI_IPSEC_PROTOCOL_TYPE Proto;
+ ///
+ /// Cryptographic algorithm type used for authentication.
+ ///
+ UINT8 AuthAlgoId;
+ ///
+ /// Cryptographic algorithm type used for encryption. EncAlgo is
+ /// NULL when IPsec protocol is AH. For ESP protocol, EncAlgo
+ /// can also be used to describe the algorithm if a combined mode
+ /// algorithm is used.
+ ///
+ UINT8 EncAlgoId;
+} EFI_IPSEC_PROCESS_POLICY;
+
+///
+/// EFI_IPSEC_SA_ID
+/// A triplet to identify an SA, consisting of the following members.
+///
+typedef struct _EFI_IPSEC_SA_ID {
+ ///
+ /// Security Parameter Index (aka SPI). An arbitrary 32-bit value
+ /// that is used by a receiver to identity the SA to which an incoming
+ /// package should be bound.
+ ///
+ UINT32 Spi;
+ ///
+ /// IPsec protocol: AH or ESP
+ ///
+ EFI_IPSEC_PROTOCOL_TYPE Proto;
+ ///
+ /// Destination IP address.
+ ///
+ EFI_IP_ADDRESS DestAddress;
+} EFI_IPSEC_SA_ID;
+
+
+#define MAX_PEERID_LEN 128
+
+///
+/// EFI_IPSEC_SPD_DATA
+///
+typedef struct _EFI_IPSEC_SPD_DATA {
+ ///
+ /// A null-terminated ASCII name string which is used as a symbolic
+ /// identifier for an IPsec Local or Remote address.
+ ///
+ UINT8 Name[MAX_PEERID_LEN];
+ ///
+ /// Bit-mapped list describing Populate from Packet flags. When
+ /// creating a SA, if PackageFlag bit is set to TRUE, instantiate
+ /// the selector from the corresponding field in the package that
+ /// triggered the creation of the SA, else from the value(s) in the
+ /// corresponding SPD entry. The PackageFlag bit setting for
+ /// corresponding selector field of EFI_IPSEC_SPD_SELECTOR:
+ /// Bit 0: EFI_IPSEC_SPD_SELECTOR.LocalAddress
+ /// Bit 1: EFI_IPSEC_SPD_SELECTOR.RemoteAddress
+ /// Bit 2:
+ /// EFI_IPSEC_SPD_SELECTOR.NextLayerProtocol
+ /// Bit 3: EFI_IPSEC_SPD_SELECTOR.LocalPort
+ /// Bit 4: EFI_IPSEC_SPD_SELECTOR.RemotePort
+ /// Others: Reserved.
+ ///
+ UINT32 PackageFlag;
+ ///
+ /// The traffic direction of data gram.
+ ///
+ EFI_IPSEC_TRAFFIC_DIR TrafficDirection;
+ ///
+ /// Processing choices to indicate which action is required by this
+ /// policy.
+ ///
+ EFI_IPSEC_ACTION Action;
+ ///
+ /// The policy and rule information for a SPD entry.
+ ///
+ EFI_IPSEC_PROCESS_POLICY *ProcessingPolicy;
+ ///
+ /// Specifies the actual number of entries in SaId list.
+ ///
+ UINTN SaIdCount;
+ ///
+ /// The SAD entry used for the traffic processing. The
+ /// existed SAD entry links indicate this is the manual key case.
+ ///
+ EFI_IPSEC_SA_ID SaId[1];
+} EFI_IPSEC_SPD_DATA;
+
+///
+/// EFI_IPSEC_AH_ALGO_INFO
+/// The security algorithm selection for IPsec AH authentication.
+/// The required authentication algorithm is specified in RFC 4305.
+///
+typedef struct _EFI_IPSEC_AH_ALGO_INFO {
+ UINT8 AuthAlgoId;
+ UINTN AuthKeyLength;
+ VOID *AuthKey;
+} EFI_IPSEC_AH_ALGO_INFO;
+
+///
+/// EFI_IPSEC_ESP_ALGO_INFO
+/// The security algorithm selection for IPsec ESP encryption and authentication.
+/// The required authentication algorithm is specified in RFC 4305.
+/// EncAlgoId fields can also specify an ESP combined mode algorithm
+/// (e.g. AES with CCM mode, specified in RFC 4309), which provides both
+/// confidentiality and authentication services.
+///
+typedef struct _EFI_IPSEC_ESP_ALGO_INFO {
+ UINT8 EncAlgoId;
+ UINTN EncKeyLength;
+ VOID *EncKey;
+ UINT8 AuthAlgoId;
+ UINTN AuthKeyLength;
+ VOID *AuthKey;
+} EFI_IPSEC_ESP_ALGO_INFO;
+
+///
+/// EFI_IPSEC_ALGO_INFO
+///
+typedef union {
+ EFI_IPSEC_AH_ALGO_INFO AhAlgoInfo;
+ EFI_IPSEC_ESP_ALGO_INFO EspAlgoInfo;
+} EFI_IPSEC_ALGO_INFO;
+
+///
+/// EFI_IPSEC_SA_DATA
+///
+typedef struct _EFI_IPSEC_SA_DATA {
+ ///
+ /// IPsec mode: tunnel or transport.
+ ///
+ EFI_IPSEC_MODE Mode;
+ ///
+ /// Sequence Number Counter. A 64-bit counter used to generate the
+ /// sequence number field in AH or ESP headers.
+ ///
+ UINT64 SNCount;
+ ///
+ /// Anti-Replay Window. A 64-bit counter and a bit-map used to
+ /// determine whether an inbound AH or ESP packet is a replay.
+ ///
+ UINT8 AntiReplayWindows;
+ ///
+ /// AH/ESP cryptographic algorithm, key and parameters.
+ ///
+ EFI_IPSEC_ALGO_INFO AlgoInfo;
+ ///
+ /// Lifetime of this SA.
+ ///
+ EFI_IPSEC_SA_LIFETIME SaLifetime;
+ ///
+ /// Any observed path MTU and aging variables. The Path MTU
+ /// processing is defined in section 8 of RFC 4301.
+ ///
+ UINT32 PathMTU;
+ ///
+ /// Link to one SPD entry.
+ ///
+ EFI_IPSEC_SPD_SELECTOR *SpdSelector;
+ ///
+ /// Indication of whether it's manually set or negotiated automatically.
+ /// If ManualSet is FALSE, the corresponding SA entry is inserted through
+ /// IKE protocol negotiation.
+ ///
+ BOOLEAN ManualSet;
+} EFI_IPSEC_SA_DATA;
+
+///
+/// EFI_IPSEC_SA_DATA2
+///
+typedef struct _EFI_IPSEC_SA_DATA2 {
+ ///
+ /// IPsec mode: tunnel or transport
+ ///
+ EFI_IPSEC_MODE Mode;
+ ///
+ /// Sequence Number Counter. A 64-bit counter used to generate the sequence
+ /// number field in AH or ESP headers.
+ ///
+ UINT64 SNCount;
+ ///
+ /// Anti-Replay Window. A 64-bit counter and a bit-map used to determine
+ /// whether an inbound AH or ESP packet is a replay.
+ ///
+ UINT8 AntiReplayWindows;
+ ///
+ /// AH/ESP cryptographic algorithm, key and parameters.
+ ///
+ EFI_IPSEC_ALGO_INFO AlgoInfo;
+ ///
+ /// Lifetime of this SA.
+ ///
+ EFI_IPSEC_SA_LIFETIME SaLifetime;
+ ///
+ /// Any observed path MTU and aging variables. The Path MTU processing is
+ /// defined in section 8 of RFC 4301.
+ ///
+ UINT32 PathMTU;
+ ///
+ /// Link to one SPD entry
+ ///
+ EFI_IPSEC_SPD_SELECTOR *SpdSelector;
+ ///
+ /// Indication of whether it's manually set or negotiated automatically.
+ /// If ManualSet is FALSE, the corresponding SA entry is inserted through IKE
+ /// protocol negotiation
+ ///
+ BOOLEAN ManualSet;
+ ///
+ /// The tunnel header IP source address.
+ ///
+ EFI_IP_ADDRESS TunnelSourceAddress;
+ ///
+ /// The tunnel header IP destination address.
+ ///
+ EFI_IP_ADDRESS TunnelDestinationAddress;
+} EFI_IPSEC_SA_DATA2;
+
+
+///
+/// EFI_IPSEC_PAD_ID
+/// specifies the identifier for PAD entry, which is also used for SPD lookup.
+/// IpAddress Pointer to the IPv4 or IPv6 address range.
+///
+typedef struct _EFI_IPSEC_PAD_ID {
+ ///
+ /// Flag to identify which type of PAD Id is used.
+ ///
+ BOOLEAN PeerIdValid;
+ union {
+ ///
+ /// Pointer to the IPv4 or IPv6 address range.
+ ///
+ EFI_IP_ADDRESS_INFO IpAddress;
+ ///
+ /// Pointer to a null terminated ASCII string
+ /// representing the symbolic names. A PeerId can be a DNS
+ /// name, Distinguished Name, RFC 822 email address or Key ID
+ /// (specified in section 4.4.3.1 of RFC 4301)
+ ///
+ UINT8 PeerId[MAX_PEERID_LEN];
+ } Id;
+} EFI_IPSEC_PAD_ID;
+
+///
+/// EFI_IPSEC_CONFIG_SELECTOR
+/// describes the expected IPsec configuration data selector
+/// of type EFI_IPSEC_CONFIG_DATA_TYPE.
+///
+typedef union {
+ EFI_IPSEC_SPD_SELECTOR SpdSelector;
+ EFI_IPSEC_SA_ID SaId;
+ EFI_IPSEC_PAD_ID PadId;
+} EFI_IPSEC_CONFIG_SELECTOR;
+
+///
+/// EFI_IPSEC_AUTH_PROTOCOL_TYPE
+/// defines the possible authentication protocol for IPsec
+/// security association management.
+///
+typedef enum {
+ EfiIPsecAuthProtocolIKEv1,
+ EfiIPsecAuthProtocolIKEv2,
+ EfiIPsecAuthProtocolMaximum
+} EFI_IPSEC_AUTH_PROTOCOL_TYPE;
+
+///
+/// EFI_IPSEC_AUTH_METHOD
+///
+typedef enum {
+ ///
+ /// Using Pre-shared Keys for manual security associations.
+ ///
+ EfiIPsecAuthMethodPreSharedSecret,
+ ///
+ /// IKE employs X.509 certificates for SA establishment.
+ ///
+ EfiIPsecAuthMethodCertificates,
+ EfiIPsecAuthMethodMaximum
+} EFI_IPSEC_AUTH_METHOD;
+
+///
+/// EFI_IPSEC_PAD_DATA
+///
+typedef struct _EFI_IPSEC_PAD_DATA {
+ ///
+ /// Authentication Protocol for IPsec security association management.
+ ///
+ EFI_IPSEC_AUTH_PROTOCOL_TYPE AuthProtocol;
+ ///
+ /// Authentication method used.
+ ///
+ EFI_IPSEC_AUTH_METHOD AuthMethod;
+ ///
+ /// The IKE ID payload will be used as a symbolic name for SPD
+ /// lookup if IkeIdFlag is TRUE. Otherwise, the remote IP
+ /// address provided in traffic selector playloads will be used.
+ ///
+ BOOLEAN IkeIdFlag;
+ ///
+ /// The size of Authentication data buffer, in bytes.
+ ///
+ UINTN AuthDataSize;
+ ///
+ /// Buffer for Authentication data, (e.g., the pre-shared secret or the
+ /// trust anchor relative to which the peer's certificate will be
+ /// validated).
+ ///
+ VOID *AuthData;
+ ///
+ /// The size of RevocationData, in bytes
+ ///
+ UINTN RevocationDataSize;
+ ///
+ /// Pointer to CRL or OCSP data, if certificates are used for
+ /// authentication method.
+ ///
+ VOID *RevocationData;
+} EFI_IPSEC_PAD_DATA;
+
+
+/**
+ Set the security association, security policy and peer authorization configuration
+ information for the EFI IPsec driver.
+
+ This function is used to set the IPsec configuration information of type DataType for
+ the EFI IPsec driver.
+ The IPsec configuration data has a unique selector/identifier separately to identify
+ a data entry. The selector structure depends on DataType's definition.
+ Using SetData() with a Data of NULL causes the IPsec configuration data entry identified
+ by DataType and Selector to be deleted.
+
+ @param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
+ @param[in] DataType The type of data to be set.
+ @param[in] Selector Pointer to an entry selector on operated configuration data
+ specified by DataType. A NULL Selector causes the entire
+ specified-type configuration information to be flushed.
+ @param[in] Data The data buffer to be set. The structure of the data buffer is
+ associated with the DataType.
+ @param[in] InsertBefore Pointer to one entry selector which describes the expected
+ position the new data entry will be added. If InsertBefore is NULL,
+ the new entry will be appended the end of database.
+
+ @retval EFI_SUCCESS The specified configuration entry data is set successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ @retval EFI_UNSUPPORTED The specified DataType is not supported.
+ @retval EFI_OUT_OF_RESOURCED The required system resource could not be allocated.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IPSEC_CONFIG_SET_DATA)(
+ IN EFI_IPSEC_CONFIG_PROTOCOL *This,
+ IN EFI_IPSEC_CONFIG_DATA_TYPE DataType,
+ IN EFI_IPSEC_CONFIG_SELECTOR *Selector,
+ IN VOID *Data,
+ IN EFI_IPSEC_CONFIG_SELECTOR *InsertBefore OPTIONAL
+ );
+
+/**
+ Return the configuration value for the EFI IPsec driver.
+
+ This function lookup the data entry from IPsec database or IKEv2 configuration
+ information. The expected data type and unique identification are described in
+ DataType and Selector parameters.
+
+ @param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
+ @param[in] DataType The type of data to retrieve.
+ @param[in] Selector Pointer to an entry selector which is an identifier of the IPsec
+ configuration data entry.
+ @param[in, out] DataSize On output the size of data returned in Data.
+ @param[out] Data The buffer to return the contents of the IPsec configuration data.
+ The type of the data buffer is associated with the DataType.
+
+ @retval EFI_SUCCESS The specified configuration data is got successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:
+ - This is NULL.
+ - Selector is NULL.
+ - DataSize is NULL.
+ - Data is NULL and *DataSize is not zero
+ @retval EFI_NOT_FOUND The configuration data specified by Selector is not found.
+ @retval EFI_UNSUPPORTED The specified DataType is not supported.
+ @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result. DataSize has been
+ updated with the size needed to complete the request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IPSEC_CONFIG_GET_DATA)(
+ IN EFI_IPSEC_CONFIG_PROTOCOL *This,
+ IN EFI_IPSEC_CONFIG_DATA_TYPE DataType,
+ IN EFI_IPSEC_CONFIG_SELECTOR *Selector,
+ IN OUT UINTN *DataSize,
+ OUT VOID *Data
+ );
+
+/**
+ Enumerates the current selector for IPsec configuration data entry.
+
+ This function is called multiple times to retrieve the entry Selector in IPsec
+ configuration database. On each call to GetNextSelector(), the next entry
+ Selector are retrieved into the output interface.
+
+ If the entire IPsec configuration database has been iterated, the error
+ EFI_NOT_FOUND is returned.
+ If the Selector buffer is too small for the next Selector copy, an
+ EFI_BUFFER_TOO_SMALL error is returned, and SelectorSize is updated to reflect
+ the size of buffer needed.
+
+ On the initial call to GetNextSelector() to start the IPsec configuration database
+ search, a pointer to the buffer with all zero value is passed in Selector. Calls
+ to SetData() between calls to GetNextSelector may produce unpredictable results.
+
+ @param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
+ @param[in] DataType The type of IPsec configuration data to retrieve.
+ @param[in, out] SelectorSize The size of the Selector buffer.
+ @param[in, out] Selector On input, supplies the pointer to last Selector that was
+ returned by GetNextSelector().
+ On output, returns one copy of the current entry Selector
+ of a given DataType.
+
+ @retval EFI_SUCCESS The specified configuration data is got successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:
+ - This is NULL.
+ - SelectorSize is NULL.
+ - Selector is NULL.
+ @retval EFI_NOT_FOUND The next configuration data entry was not found.
+ @retval EFI_UNSUPPORTED The specified DataType is not supported.
+ @retval EFI_BUFFER_TOO_SMALL The SelectorSize is too small for the result. This parameter
+ has been updated with the size needed to complete the search
+ request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IPSEC_CONFIG_GET_NEXT_SELECTOR)(
+ IN EFI_IPSEC_CONFIG_PROTOCOL *This,
+ IN EFI_IPSEC_CONFIG_DATA_TYPE DataType,
+ IN OUT UINTN *SelectorSize,
+ IN OUT EFI_IPSEC_CONFIG_SELECTOR *Selector
+ );
+
+/**
+ Register an event that is to be signaled whenever a configuration process on the
+ specified IPsec configuration information is done.
+
+ This function registers an event that is to be signaled whenever a configuration
+ process on the specified IPsec configuration data is done (e.g. IPsec security
+ policy database configuration is ready). An event can be registered for different
+ DataType simultaneously and the caller is responsible for determining which type
+ of configuration data causes the signaling of the event in such case.
+
+ @param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
+ @param[in] DataType The type of data to be registered the event for.
+ @param[in] Event The event to be registered.
+
+ @retval EFI_SUCCESS The event is registered successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
+ @retval EFI_ACCESS_DENIED The Event is already registered for the DataType.
+ @retval EFI_UNSUPPORTED The notify registration unsupported or the specified
+ DataType is not supported.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IPSEC_CONFIG_REGISTER_NOTIFY)(
+ IN EFI_IPSEC_CONFIG_PROTOCOL *This,
+ IN EFI_IPSEC_CONFIG_DATA_TYPE DataType,
+ IN EFI_EVENT Event
+ );
+
+/**
+ Remove the specified event that is previously registered on the specified IPsec
+ configuration data.
+
+ This function removes a previously registered event for the specified configuration data.
+
+ @param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
+ @param[in] DataType The configuration data type to remove the registered event for.
+ @param[in] Event The event to be unregistered.
+
+ @retval EFI_SUCCESS The event is removed successfully.
+ @retval EFI_NOT_FOUND The Event specified by DataType could not be found in the
+ database.
+ @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
+ @retval EFI_UNSUPPORTED The notify registration unsupported or the specified
+ DataType is not supported.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IPSEC_CONFIG_UNREGISTER_NOTIFY)(
+ IN EFI_IPSEC_CONFIG_PROTOCOL *This,
+ IN EFI_IPSEC_CONFIG_DATA_TYPE DataType,
+ IN EFI_EVENT Event
+ );
+
+///
+/// EFI_IPSEC_CONFIG_PROTOCOL
+/// provides the ability to set and lookup the IPsec SAD (Security Association Database),
+/// SPD (Security Policy Database) data entry and configure the security association
+/// management protocol such as IKEv2. This protocol is used as the central
+/// repository of any policy-specific configuration for EFI IPsec driver.
+/// EFI_IPSEC_CONFIG_PROTOCOL can be bound to both IPv4 and IPv6 stack. User can use this
+/// protocol for IPsec configuration in both IPv4 and IPv6 environment.
+///
+struct _EFI_IPSEC_CONFIG_PROTOCOL {
+ EFI_IPSEC_CONFIG_SET_DATA SetData;
+ EFI_IPSEC_CONFIG_GET_DATA GetData;
+ EFI_IPSEC_CONFIG_GET_NEXT_SELECTOR GetNextSelector;
+ EFI_IPSEC_CONFIG_REGISTER_NOTIFY RegisterDataNotify;
+ EFI_IPSEC_CONFIG_UNREGISTER_NOTIFY UnregisterDataNotify;
+};
+
+extern EFI_GUID gEfiIpSecConfigProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IsaHc.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IsaHc.h
new file mode 100644
index 0000000000..bc92675d12
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/IsaHc.h
@@ -0,0 +1,116 @@
+/** @file
+ ISA HC Protocol as defined in the PI 1.2.1 specification.
+
+ This protocol provides registration for ISA devices on a positive- or
+ subtractive-decode ISA bus. It allows devices to be registered and also
+ handles opening and closing the apertures which are positively-decoded.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.2.1.
+
+**/
+
+#ifndef __ISA_HC_PROTOCOL_H__
+#define __ISA_HC_PROTOCOL_H__
+
+#define EFI_ISA_HC_PROTOCOL_GUID \
+ { \
+ 0xbcdaf080, 0x1bde, 0x4e22, {0xae, 0x6a, 0x43, 0x54, 0x1e, 0x12, 0x8e, 0xc4} \
+ }
+
+#define EFI_ISA_HC_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0xfad7933a, 0x6c21, 0x4234, {0xa4, 0x34, 0x0a, 0x8a, 0x0d, 0x2b, 0x07, 0x81} \
+ }
+
+typedef struct _EFI_ISA_HC_PROTOCOL EFI_ISA_HC_PROTOCOL;
+typedef struct _EFI_ISA_HC_PROTOCOL *PEFI_ISA_HC_PROTOCOL;
+
+/**
+ Open I/O aperture.
+
+ This function opens an I/O aperture in a ISA Host Controller for the I/O addresses
+ specified by IoAddress to IoAddress + IoLength - 1. It may be possible that a
+ single hardware aperture may be used for more than one device. This function
+ tracks the number of times that each aperture is referenced, and does not close
+ the hardware aperture (via CloseIoAperture()) until there are no more references to it.
+
+ @param This A pointer to this instance of the EFI_ISA_HC_PROTOCOL.
+ @param IoAddress An unsigned integer that specifies the first byte of the
+ I/O space required.
+ @param IoLength An unsigned integer that specifies the number of bytes
+ of the I/O space required.
+ @param IoApertureHandle A pointer to the returned I/O aperture handle. This
+ value can be used on subsequent calls to CloseIoAperture().
+
+ @retval EFI_SUCCESS The I/O aperture was opened successfully.
+ @retval EFI_UNSUPPORTED The ISA Host Controller is a subtractive-decode controller.
+ @retval EFI_OUT_OF_RESOURCES There is no available I/O aperture.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ISA_HC_OPEN_IO) (
+ IN CONST EFI_ISA_HC_PROTOCOL *This,
+ IN UINT16 IoAddress,
+ IN UINT16 IoLength,
+ OUT UINT64 *IoApertureHandle
+ );
+
+/**
+ Close I/O aperture.
+
+ This function closes a previously opened I/O aperture handle. If there are no
+ more I/O aperture handles that refer to the hardware I/O aperture resource,
+ then the hardware I/O aperture is closed. It may be possible that a single
+ hardware aperture may be used for more than one device. This function tracks
+ the number of times that each aperture is referenced, and does not close the
+ hardware aperture (via CloseIoAperture()) until there are no more references to it.
+
+ @param This A pointer to this instance of the EFI_ISA_HC_PROTOCOL.
+ @param IoApertureHandle The I/O aperture handle previously returned from a
+ call to OpenIoAperture().
+
+ @retval EFI_SUCCESS The IO aperture was closed successfully.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ISA_HC_CLOSE_IO) (
+ IN CONST EFI_ISA_HC_PROTOCOL *This,
+ IN UINT64 IoApertureHandle
+ );
+
+///
+/// ISA HC Protocol
+///
+struct _EFI_ISA_HC_PROTOCOL {
+ ///
+ /// The version of this protocol. Higher version numbers are backward
+ /// compatible with lower version numbers.
+ ///
+ UINT32 Version;
+ ///
+ /// Open an I/O aperture.
+ ///
+ EFI_ISA_HC_OPEN_IO OpenIoAperture;
+ ///
+ /// Close an I/O aperture.
+ ///
+ EFI_ISA_HC_CLOSE_IO CloseIoAperture;
+};
+
+///
+/// Reference to variable defined in the .DEC file
+///
+extern EFI_GUID gEfiIsaHcProtocolGuid;
+extern EFI_GUID gEfiIsaHcServiceBindingProtocolGuid;
+
+#endif // __ISA_HC_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Kms.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Kms.h
new file mode 100644
index 0000000000..fa0afa132d
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Kms.h
@@ -0,0 +1,1343 @@
+/** @file
+ The Key Management Service (KMS) protocol as defined in the UEFI 2.3.1 specification is to
+ provides services to generate, store, retrieve, and manage cryptographic keys.
+ The intention is to specify a simple generic protocol that could be used for many implementations.
+
+ A driver implementing the protocol may need to provide basic key service that consists of a
+ key store and cryptographic key generation capability. It may connect to an external key
+ server over the network, or to a Hardware Security Module (HSM) attached to the system it
+ runs on, or anything else that is capable of providing the key management service.
+
+ Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __KMS_H__
+#define __KMS_H__
+
+#define EFI_KMS_PROTOCOL_GUID \
+ { \
+ 0xEC3A978D, 0x7C4E, 0x48FA, {0x9A, 0xBE, 0x6A, 0xD9, 0x1C, 0xC8, 0xF8, 0x11 } \
+ }
+
+typedef struct _EFI_KMS_PROTOCOL EFI_KMS_PROTOCOL;
+
+//
+// Where appropriate, EFI_KMS_DATA_TYPE values may be combined using a bitwise 'OR'
+// operation to indicate support for multiple data types.
+//
+#define EFI_KMS_DATA_TYPE_NONE 0
+#define EFI_KMS_DATA_TYPE_BINARY 1
+#define EFI_KMS_DATA_TYPE_ASCII 2
+#define EFI_KMS_DATA_TYPE_UNICODE 4
+#define EFI_KMS_DATA_TYPE_UTF8 8
+
+
+//
+// The key formats recognized by the KMS protocol are defined by an EFI_GUID which specifies
+// a (key-algorithm, key-size) pair. The names of these GUIDs are in the format
+// EFI_KMS_KEY_(key-algorithm)_(key-size)_GUID, where the key-size is expressed in bits.
+// The key formats recognized fall into three categories, generic (no algorithm), hash algorithms,
+// and encrypted algorithms.
+//
+
+///
+/// The following GUIDs define formats that contain generic key data of a specific size in bits,
+/// but which is not associated with any specific key algorithm(s).
+///@{
+#define EFI_KMS_FORMAT_GENERIC_128_GUID \
+ { \
+ 0xec8a3d69, 0x6ddf, 0x4108, {0x94, 0x76, 0x73, 0x37, 0xfc, 0x52, 0x21, 0x36 } \
+ }
+#define EFI_KMS_FORMAT_GENERIC_160_GUID \
+ { \
+ 0xa3b3e6f8, 0xefca, 0x4bc1, {0x88, 0xfb, 0xcb, 0x87, 0x33, 0x9b, 0x25, 0x79 } \
+ }
+#define EFI_KMS_FORMAT_GENERIC_256_GUID \
+ { \
+ 0x70f64793, 0xc323, 0x4261, {0xac, 0x2c, 0xd8, 0x76, 0xf2, 0x7c, 0x53, 0x45 } \
+ }
+#define EFI_KMS_FORMAT_GENERIC_512_GUID \
+ { \
+ 0x978fe043, 0xd7af, 0x422e, {0x8a, 0x92, 0x2b, 0x48, 0xe4, 0x63, 0xbd, 0xe6 } \
+ }
+#define EFI_KMS_FORMAT_GENERIC_1024_GUID \
+ { \
+ 0x43be0b44, 0x874b, 0x4ead, {0xb0, 0x9c, 0x24, 0x1a, 0x4f, 0xbd, 0x7e, 0xb3 } \
+ }
+#define EFI_KMS_FORMAT_GENERIC_2048_GUID \
+ { \
+ 0x40093f23, 0x630c, 0x4626, {0x9c, 0x48, 0x40, 0x37, 0x3b, 0x19, 0xcb, 0xbe } \
+ }
+#define EFI_KMS_FORMAT_GENERIC_3072_GUID \
+ { \
+ 0xb9237513, 0x6c44, 0x4411, {0xa9, 0x90, 0x21, 0xe5, 0x56, 0xe0, 0x5a, 0xde } \
+ }
+#define EFI_KMS_FORMAT_GENERIC_DYNAMIC_GUID \
+ { \
+ 0x2156e996, 0x66de, 0x4b27, {0x9c, 0xc9, 0xb0, 0x9f, 0xac, 0x4d, 0x2, 0xbe } \
+ }
+///@}
+
+///
+/// These GUIDS define key data formats that contain data generated by basic hash algorithms
+/// with no cryptographic properties.
+///@{
+#define EFI_KMS_FORMAT_MD2_128_GUID \
+ { \
+ 0x78be11c4, 0xee44, 0x4a22, {0x9f, 0x05, 0x03, 0x85, 0x2e, 0xc5, 0xc9, 0x78 } \
+ }
+#define EFI_KMS_FORMAT_MDC2_128_GUID \
+ { \
+ 0xf7ad60f8, 0xefa8, 0x44a3, {0x91, 0x13, 0x23, 0x1f, 0x39, 0x9e, 0xb4, 0xc7 } \
+ }
+#define EFI_KMS_FORMAT_MD4_128_GUID \
+ { \
+ 0xd1c17aa1, 0xcac5, 0x400f, {0xbe, 0x17, 0xe2, 0xa2, 0xae, 0x06, 0x67, 0x7c } \
+ }
+#define EFI_KMS_FORMAT_MDC4_128_GUID \
+ { \
+ 0x3fa4f847, 0xd8eb, 0x4df4, {0xbd, 0x49, 0x10, 0x3a, 0x0a, 0x84, 0x7b, 0xbc } \
+ }
+#define EFI_KMS_FORMAT_MD5_128_GUID \
+ { \
+ 0xdcbc3662, 0x9cda, 0x4b52, {0xa0, 0x4c, 0x82, 0xeb, 0x1d, 0x23, 0x48, 0xc7 } \
+ }
+#define EFI_KMS_FORMAT_MD5SHA_128_GUID \
+ { \
+ 0x1c178237, 0x6897, 0x459e, {0x9d, 0x36, 0x67, 0xce, 0x8e, 0xf9, 0x4f, 0x76 } \
+ }
+#define EFI_KMS_FORMAT_SHA1_160_GUID \
+ { \
+ 0x453c5e5a, 0x482d, 0x43f0, {0x87, 0xc9, 0x59, 0x41, 0xf3, 0xa3, 0x8a, 0xc2 } \
+ }
+#define EFI_KMS_FORMAT_SHA256_256_GUID \
+ { \
+ 0x6bb4f5cd, 0x8022, 0x448d, {0xbc, 0x6d, 0x77, 0x1b, 0xae, 0x93, 0x5f, 0xc6 } \
+ }
+#define EFI_KMS_FORMAT_SHA512_512_GUID \
+ { \
+ 0x2f240e12, 0xe14d, 0x475c, {0x83, 0xb0, 0xef, 0xff, 0x22, 0xd7, 0x7b, 0xe7 } \
+ }
+///@}
+
+///
+/// These GUIDs define key data formats that contain data generated by cryptographic key algorithms.
+/// There may or may not be a separate data hashing algorithm associated with the key algorithm.
+///@{
+#define EFI_KMS_FORMAT_AESXTS_128_GUID \
+ { \
+ 0x4776e33f, 0xdb47, 0x479a, {0xa2, 0x5f, 0xa1, 0xcd, 0x0a, 0xfa, 0xb3, 0x8b } \
+ }
+#define EFI_KMS_FORMAT_AESXTS_256_GUID \
+ { \
+ 0xdc7e8613, 0xc4bb, 0x4db0, {0x84, 0x62, 0x13, 0x51, 0x13, 0x57, 0xab, 0xe2 } \
+ }
+#define EFI_KMS_FORMAT_AESCBC_128_GUID \
+ { \
+ 0xa0e8ee6a, 0x0e92, 0x44d4, {0x86, 0x1b, 0x0e, 0xaa, 0x4a, 0xca, 0x44, 0xa2 } \
+ }
+#define EFI_KMS_FORMAT_AESCBC_256_GUID \
+ { \
+ 0xd7e69789, 0x1f68, 0x45e8, {0x96, 0xef, 0x3b, 0x64, 0x07, 0xa5, 0xb2, 0xdc } \
+ }
+#define EFI_KMS_FORMAT_RSASHA1_1024_GUID \
+ { \
+ 0x56417bed, 0x6bbe, 0x4882, {0x86, 0xa0, 0x3a, 0xe8, 0xbb, 0x17, 0xf8, 0xf9 } \
+ }
+#define EFI_KMS_FORMAT_RSASHA1_2048_GUID \
+ { \
+ 0xf66447d4, 0x75a6, 0x463e, {0xa8, 0x19, 0x07, 0x7f, 0x2d, 0xda, 0x05, 0xe9 } \
+ }
+#define EFI_KMS_FORMAT_RSASHA256_2048_GUID \
+ { \
+ 0xa477af13, 0x877d, 0x4060, {0xba, 0xa1, 0x25, 0xd1, 0xbe, 0xa0, 0x8a, 0xd3 } \
+ }
+#define EFI_KMS_FORMAT_RSASHA256_3072_GUID \
+ { \
+ 0x4e1356c2, 0xeed, 0x463f, {0x81, 0x47, 0x99, 0x33, 0xab, 0xdb, 0xc7, 0xd5 } \
+ }
+///@}
+
+#define EFI_KMS_ATTRIBUTE_TYPE_NONE 0x00
+#define EFI_KMS_ATTRIBUTE_TYPE_INTEGER 0x01
+#define EFI_KMS_ATTRIBUTE_TYPE_LONG_INTEGER 0x02
+#define EFI_KMS_ATTRIBUTE_TYPE_BIG_INTEGER 0x03
+#define EFI_KMS_ATTRIBUTE_TYPE_ENUMERATION 0x04
+#define EFI_KMS_ATTRIBUTE_TYPE_BOOLEAN 0x05
+#define EFI_KMS_ATTRIBUTE_TYPE_BYTE_STRING 0x06
+#define EFI_KMS_ATTRIBUTE_TYPE_TEXT_STRING 0x07
+#define EFI_KMS_ATTRIBUTE_TYPE_DATE_TIME 0x08
+#define EFI_KMS_ATTRIBUTE_TYPE_INTERVAL 0x09
+#define EFI_KMS_ATTRIBUTE_TYPE_STRUCTURE 0x0A
+#define EFI_KMS_ATTRIBUTE_TYPE_DYNAMIC 0x0B
+
+typedef struct {
+ ///
+ /// Length in bytes of the KeyData.
+ ///
+ UINT32 KeySize;
+ ///
+ /// The data of the key.
+ ///
+ UINT8 KeyData[1];
+} EFI_KMS_FORMAT_GENERIC_DYNAMIC;
+
+typedef struct {
+ ///
+ /// The size in bytes for the client identifier.
+ ///
+ UINT16 ClientIdSize;
+ ///
+ /// Pointer to a valid client identifier.
+ ///
+ VOID *ClientId;
+ ///
+ /// The client name string type used by this client. The string type set here must be one of
+ /// the string types reported in the ClientNameStringTypes field of the KMS protocol. If the
+ /// KMS does not support client names, this field should be set to EFI_KMS_DATA_TYPE_NONE.
+ ///
+ UINT8 ClientNameType;
+ ///
+ /// The size in characters for the client name. This field will be ignored if
+ /// ClientNameStringType is set to EFI_KMS_DATA_TYPE_NONE. Otherwise, it must contain
+ /// number of characters contained in the ClientName field.
+ ///
+ UINT8 ClientNameCount;
+ ///
+ /// Pointer to a client name. This field will be ignored if ClientNameStringType is set to
+ /// EFI_KMS_DATA_TYPE_NONE. Otherwise, it must point to a valid string of the specified type.
+ ///
+ VOID *ClientName;
+} EFI_KMS_CLIENT_INFO;
+
+typedef struct {
+ ///
+ /// The size of the KeyIdentifier field in bytes. This field is limited to the range 0 to 255.
+ ///
+ UINT8 KeyIdentifierSize;
+ ///
+ /// Pointer to an array of KeyIdentifierType elements.
+ ///
+ VOID *KeyIdentifier;
+ ///
+ /// An EFI_GUID which specifies the algorithm and key value size for this key.
+ ///
+ EFI_GUID KeyFormat;
+ ///
+ /// Pointer to a key value for a key specified by the KeyFormat field. A NULL value for this
+ /// field indicates that no key is available.
+ ///
+ VOID *KeyValue;
+ ///
+ /// Specifies the results of KMS operations performed with this descriptor. This field is used
+ /// to indicate the status of individual operations when a KMS function is called with multiple
+ /// EFI_KMS_KEY_DESCRIPTOR structures.
+ /// KeyStatus codes returned for the individual key requests are:
+ /// EFI_SUCCESS Successfully processed this key.
+ /// EFI_WARN_STALE_DATA Successfully processed this key, however, the key's parameters
+ /// exceed internal policies/limits and should be replaced.
+ /// EFI_COMPROMISED_DATA Successfully processed this key, but the key may have been
+ /// compromised and must be replaced.
+ /// EFI_UNSUPPORTED Key format is not supported by the service.
+ /// EFI_OUT_OF_RESOURCES Could not allocate resources for the key processing.
+ /// EFI_TIMEOUT Timed out waiting for device or key server.
+ /// EFI_DEVICE_ERROR Device or key server error.
+ /// EFI_INVALID_PARAMETER KeyFormat is invalid.
+ /// EFI_NOT_FOUND The key does not exist on the KMS.
+ ///
+ EFI_STATUS KeyStatus;
+} EFI_KMS_KEY_DESCRIPTOR;
+
+typedef struct {
+ ///
+ /// Part of a tag-type-length triplet that identifies the KeyAttributeData formatting. The
+ /// definition of the value is outside the scope of this standard and may be defined by the KMS.
+ ///
+ UINT16 Tag;
+ ///
+ /// Part of a tag-type-length triplet that identifies the KeyAttributeData formatting. The
+ /// definition of the value is outside the scope of this standard and may be defined by the KMS.
+ ///
+ UINT16 Type;
+ ///
+ /// Length in bytes of the KeyAttributeData.
+ ///
+ UINT32 Length;
+ ///
+ /// An array of bytes to hold the attribute data associated with the KeyAttributeIdentifier.
+ ///
+ UINT8 KeyAttributeData[1];
+} EFI_KMS_DYNAMIC_FIELD;
+
+typedef struct {
+ ///
+ /// The number of members in the EFI_KMS_DYNAMIC_ATTRIBUTE structure.
+ ///
+ UINT32 FieldCount;
+ ///
+ /// An array of EFI_KMS_DYNAMIC_FIELD structures.
+ ///
+ EFI_KMS_DYNAMIC_FIELD Field[1];
+} EFI_KMS_DYNAMIC_ATTRIBUTE;
+
+typedef struct {
+ ///
+ /// The data type used for the KeyAttributeIdentifier field. Values for this field are defined
+ /// by the EFI_KMS_DATA_TYPE constants, except that EFI_KMS_DATA_TYPE_BINARY is not
+ /// valid for this field.
+ ///
+ UINT8 KeyAttributeIdentifierType;
+ ///
+ /// The length of the KeyAttributeIdentifier field in units defined by KeyAttributeIdentifierType
+ /// field. This field is limited to the range 0 to 255.
+ ///
+ UINT8 KeyAttributeIdentifierCount;
+ ///
+ /// Pointer to an array of KeyAttributeIdentifierType elements. For string types, there must
+ /// not be a null-termination element at the end of the array.
+ ///
+ VOID *KeyAttributeIdentifier;
+ ///
+ /// The instance number of this attribute. If there is only one instance, the value is set to
+ /// one. If this value is set to 0xFFFF (all binary 1's) then this field should be ignored if an
+ /// output or treated as a wild card matching any value if it is an input. If the attribute is
+ /// stored with this field, it will match any attribute request regardless of the setting of the
+ /// field in the request. If set to 0xFFFF in the request, it will match any attribute with the
+ /// same KeyAttributeIdentifier.
+ ///
+ UINT16 KeyAttributeInstance;
+ ///
+ /// The data type of the KeyAttributeValue (e.g. struct, bool, etc.). See the list of
+ /// KeyAttributeType definitions.
+ ///
+ UINT16 KeyAttributeType;
+ ///
+ /// The size in bytes of the KeyAttribute field. A value of zero for this field indicates that no
+ /// key attribute value is available.
+ ///
+ UINT16 KeyAttributeValueSize;
+ ///
+ /// Pointer to a key attribute value for the attribute specified by the KeyAttributeIdentifier
+ /// field. If the KeyAttributeValueSize field is zero, then this field must be NULL.
+ ///
+ VOID *KeyAttributeValue;
+ ///
+ /// KeyAttributeStatusSpecifies the results of KMS operations performed with this attribute.
+ /// This field is used to indicate the status of individual operations when a KMS function is
+ /// called with multiple EFI_KMS_KEY_ATTRIBUTE structures.
+ /// KeyAttributeStatus codes returned for the individual key attribute requests are:
+ /// EFI_SUCCESS Successfully processed this request.
+ /// EFI_WARN_STALE_DATA Successfully processed this request, however, the key's
+ /// parameters exceed internal policies/limits and should be replaced.
+ /// EFI_COMPROMISED_DATA Successfully processed this request, but the key may have been
+ /// compromised and must be replaced.
+ /// EFI_UNSUPPORTED Key attribute format is not supported by the service.
+ /// EFI_OUT_OF_RESOURCES Could not allocate resources for the request processing.
+ /// EFI_TIMEOUT Timed out waiting for device or key server.
+ /// EFI_DEVICE_ERROR Device or key server error.
+ /// EFI_INVALID_PARAMETER A field in the EFI_KMS_KEY_ATTRIBUTE structure is invalid.
+ /// EFI_NOT_FOUND The key attribute does not exist on the KMS.
+ ///
+ EFI_STATUS KeyAttributeStatus;
+} EFI_KMS_KEY_ATTRIBUTE;
+
+/**
+ Get the current status of the key management service.
+
+ @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The KMS is ready for use.
+ @retval EFI_NOT_READY No connection to the KMS is available.
+ @retval EFI_NO_MAPPING No valid connection configuration exists for the KMS.
+ @retval EFI_NO_RESPONSE No response was received from the KMS.
+ @retval EFI_DEVICE_ERROR An error occurred when attempting to access the KMS.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_KMS_GET_SERVICE_STATUS) (
+ IN EFI_KMS_PROTOCOL *This
+ );
+
+/**
+ Register client information with the supported KMS.
+
+ @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.
+ @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
+ @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of
+ data specified by the ClientData parameter. This
+ parameter may be NULL, in which case the ClientData
+ parameter will be ignored and no data will be
+ transferred to or from the KMS. If the parameter is
+ not NULL, then ClientData must be a valid pointer.
+ If the value pointed to is 0, no data will be transferred
+ to the KMS, but data may be returned by the KMS.
+ For all non-zero values *ClientData will be transferred
+ to the KMS, which may also return data to the caller.
+ In all cases, the value upon return to the caller will
+ be the size of the data block returned to the caller,
+ which will be zero if no data is returned from the KMS.
+ @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of
+ *ClientDataSize that is to be passed directly to the
+ KMS if it supports the use of client data. This
+ parameter may be NULL if and only if the
+ ClientDataSize parameter is also NULL. Upon return to
+ the caller, *ClientData points to a block of data of
+ *ClientDataSize that was returned from the KMS.
+ If the returned value for *ClientDataSize is zero,
+ then the returned value for *ClientData must be NULL
+ and should be ignored by the caller. The KMS protocol
+ consumer is responsible for freeing all valid buffers
+ used for client data regardless of whether they are
+ allocated by the caller for input to the function or by
+ the implementation for output back to the caller.
+
+ @retval EFI_SUCCESS The client information has been accepted by the KMS.
+ @retval EFI_NOT_READY No connection to the KMS is available.
+ @retval EFI_NO_RESPONSE There was no response from the device or the key server.
+ @retval EFI_ACCESS_DENIED Access was denied by the device or the key server.
+ @retval EFI_DEVICE_ERROR An error occurred when attempting to access the KMS.
+ @retval EFI_OUT_OF_RESOURCES Required resources were not available to perform the function.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_UNSUPPORTED The KMS does not support the use of client identifiers.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_KMS_REGISTER_CLIENT) (
+ IN EFI_KMS_PROTOCOL *This,
+ IN EFI_KMS_CLIENT_INFO *Client,
+ IN OUT UINTN *ClientDataSize OPTIONAL,
+ IN OUT VOID **ClientData OPTIONAL
+ );
+
+/**
+ Request that the KMS generate one or more new keys and associate them with key identifiers.
+ The key value(s) is returned to the caller.
+
+ @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.
+ @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
+ @param[in, out] KeyDescriptorCount Pointer to a count of the number of key descriptors to be
+ processed by this operation. On return, this number
+ will be updated with the number of key descriptors
+ successfully processed.
+ @param[in, out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR
+ structures which describe the keys to be generated.
+ On input, the KeyIdentifierSize and the KeyIdentifier
+ may specify an identifier to be used for the key,
+ but this is not required. The KeyFormat field must
+ specify a key format GUID reported as supported by
+ the KeyFormats field of the EFI_KMS_PROTOCOL.
+ The value for this field in the first key descriptor will
+ be considered the default value for subsequent key
+ descriptors requested in this operation if those key
+ descriptors have a NULL GUID in the key format field.
+ On output, the KeyIdentifierSize and KeyIdentifier fields
+ will specify an identifier for the key which will be either
+ the original identifier if one was provided, or an identifier
+ generated either by the KMS or the KMS protocol
+ implementation. The KeyFormat field will be updated
+ with the GUID used to generate the key if it was a
+ NULL GUID, and the KeyValue field will contain a pointer
+ to memory containing the key value for the generated
+ key. Memory for both the KeyIdentifier and the KeyValue
+ fields will be allocated with the BOOT_SERVICES_DATA
+ type and must be freed by the caller when it is no longer
+ needed. Also, the KeyStatus field must reflect the result
+ of the request relative to that key.
+ @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of
+ data specified by the ClientData parameter. This
+ parameter may be NULL, in which case the ClientData
+ parameter will be ignored and no data will be
+ transferred to or from the KMS. If the parameter is
+ not NULL, then ClientData must be a valid pointer.
+ If the value pointed to is 0, no data will be transferred
+ to the KMS, but data may be returned by the KMS.
+ For all non-zero values *ClientData will be transferred
+ to the KMS, which may also return data to the caller.
+ In all cases, the value upon return to the caller will
+ be the size of the data block returned to the caller,
+ which will be zero if no data is returned from the KMS.
+ @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of
+ *ClientDataSize that is to be passed directly to the
+ KMS if it supports the use of client data. This
+ parameter may be NULL if and only if the
+ ClientDataSize parameter is also NULL. Upon return to
+ the caller, *ClientData points to a block of data of
+ *ClientDataSize that was returned from the KMS.
+ If the returned value for *ClientDataSize is zero,
+ then the returned value for *ClientData must be NULL
+ and should be ignored by the caller. The KMS protocol
+ consumer is responsible for freeing all valid buffers
+ used for client data regardless of whether they are
+ allocated by the caller for input to the function or by
+ the implementation for output back to the caller.
+
+ @retval EFI_SUCCESS Successfully generated and retrieved all requested keys.
+ @retval EFI_UNSUPPORTED This function is not supported by the KMS. --OR--
+ One (or more) of the key requests submitted is not supported by
+ the KMS. Check individual key request(s) to see which ones
+ may have been processed.
+ @retval EFI_OUT_OF_RESOURCES Required resources were not available to perform the function.
+ @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key
+ request(s) to see which ones may have been processed.
+ @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a
+ ClientId is required by the server and either no id was
+ provided or an invalid id was provided.
+ @retval EFI_DEVICE_ERROR An error occurred when attempting to access the KMS. Check
+ individual key request(s) to see which ones may have been
+ processed.
+ @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,
+ KeyDescriptorCount is NULL, or Keys is NULL.
+ @retval EFI_NOT_FOUND One or more EFI_KMS_KEY_DESCRIPTOR structures
+ could not be processed properly. KeyDescriptorCount
+ contains the number of structures which were successfully
+ processed. Individual structures will reflect the status of the
+ processing for that structure.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_KMS_CREATE_KEY) (
+ IN EFI_KMS_PROTOCOL *This,
+ IN EFI_KMS_CLIENT_INFO *Client,
+ IN OUT UINT16 *KeyDescriptorCount,
+ IN OUT EFI_KMS_KEY_DESCRIPTOR *KeyDescriptors,
+ IN OUT UINTN *ClientDataSize OPTIONAL,
+ IN OUT VOID **ClientData OPTIONAL
+ );
+
+/**
+ Retrieve an existing key.
+
+ @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.
+ @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
+ @param[in, out] KeyDescriptorCount Pointer to a count of the number of key descriptors to be
+ processed by this operation. On return, this number
+ will be updated with the number of key descriptors
+ successfully processed.
+ @param[in, out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR
+ structures which describe the keys to be retrieved
+ from the KMS.
+ On input, the KeyIdentifierSize and the KeyIdentifier
+ must specify an identifier to be used to retrieve a
+ specific key. All other fields in the descriptor should
+ be NULL.
+ On output, the KeyIdentifierSize and KeyIdentifier fields
+ will be unchanged, while the KeyFormat and KeyValue
+ fields will be updated values associated with this key
+ identifier. Memory for the KeyValue field will be
+ allocated with the BOOT_SERVICES_DATA type and
+ must be freed by the caller when it is no longer needed.
+ Also, the KeyStatus field will reflect the result of the
+ request relative to the individual key descriptor.
+ @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of
+ data specified by the ClientData parameter. This
+ parameter may be NULL, in which case the ClientData
+ parameter will be ignored and no data will be
+ transferred to or from the KMS. If the parameter is
+ not NULL, then ClientData must be a valid pointer.
+ If the value pointed to is 0, no data will be transferred
+ to the KMS, but data may be returned by the KMS.
+ For all non-zero values *ClientData will be transferred
+ to the KMS, which may also return data to the caller.
+ In all cases, the value upon return to the caller will
+ be the size of the data block returned to the caller,
+ which will be zero if no data is returned from the KMS.
+ @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of
+ *ClientDataSize that is to be passed directly to the
+ KMS if it supports the use of client data. This
+ parameter may be NULL if and only if the
+ ClientDataSize parameter is also NULL. Upon return to
+ the caller, *ClientData points to a block of data of
+ *ClientDataSize that was returned from the KMS.
+ If the returned value for *ClientDataSize is zero,
+ then the returned value for *ClientData must be NULL
+ and should be ignored by the caller. The KMS protocol
+ consumer is responsible for freeing all valid buffers
+ used for client data regardless of whether they are
+ allocated by the caller for input to the function or by
+ the implementation for output back to the caller.
+
+ @retval EFI_SUCCESS Successfully retrieved all requested keys.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate resources for the method processing.
+ @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key
+ request(s) to see which ones may have been processed.
+ @retval EFI_BUFFER_TOO_SMALL If multiple keys are associated with a single identifier, and the
+ KeyValue buffer does not contain enough structures
+ (KeyDescriptorCount) to contain all the key data, then
+ the available structures will be filled and
+ KeyDescriptorCount will be updated to indicate the
+ number of keys which could not be processed.
+ @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a
+ ClientId is required by the server and either none or an
+ invalid id was provided.
+ @retval EFI_DEVICE_ERROR Device or key server error. Check individual key request(s) to
+ see which ones may have been processed.
+ @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,
+ KeyDescriptorCount is NULL, or Keys is NULL.
+ @retval EFI_NOT_FOUND One or more EFI_KMS_KEY_DESCRIPTOR structures
+ could not be processed properly. KeyDescriptorCount
+ contains the number of structures which were successfully
+ processed. Individual structures will reflect the status of the
+ processing for that structure.
+ @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_KMS_GET_KEY) (
+ IN EFI_KMS_PROTOCOL *This,
+ IN EFI_KMS_CLIENT_INFO *Client,
+ IN OUT UINT16 *KeyDescriptorCount,
+ IN OUT EFI_KMS_KEY_DESCRIPTOR *KeyDescriptors,
+ IN OUT UINTN *ClientDataSize OPTIONAL,
+ IN OUT VOID **ClientData OPTIONAL
+ );
+
+/**
+ Add a new key.
+
+ @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.
+ @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
+ @param[in, out] KeyDescriptorCount Pointer to a count of the number of key descriptors to be
+ processed by this operation. On normal return, this
+ number will be updated with the number of key
+ descriptors successfully processed.
+ @param[in, out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR
+ structures which describe the keys to be added.
+ On input, the KeyId field for first key must contain
+ valid identifier data to be used for adding a key to
+ the KMS. The values for these fields in this key
+ definition will be considered default values for
+ subsequent keys requested in this operation. A value
+ of 0 in any subsequent KeyId field will be replaced
+ with the current default value. The KeyFormat and
+ KeyValue fields for each key to be added must contain
+ consistent values to be associated with the given KeyId.
+ On return, the KeyStatus field will reflect the result
+ of the operation for each key request.
+ @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of
+ data specified by the ClientData parameter. This
+ parameter may be NULL, in which case the ClientData
+ parameter will be ignored and no data will be
+ transferred to or from the KMS. If the parameter is
+ not NULL, then ClientData must be a valid pointer.
+ If the value pointed to is 0, no data will be transferred
+ to the KMS, but data may be returned by the KMS.
+ For all non-zero values *ClientData will be transferred
+ to the KMS, which may also return data to the caller.
+ In all cases, the value upon return to the caller will
+ be the size of the data block returned to the caller,
+ which will be zero if no data is returned from the KMS.
+ @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of
+ *ClientDataSize that is to be passed directly to the
+ KMS if it supports the use of client data. This
+ parameter may be NULL if and only if the
+ ClientDataSize parameter is also NULL. Upon return to
+ the caller, *ClientData points to a block of data of
+ *ClientDataSize that was returned from the KMS.
+ If the returned value for *ClientDataSize is zero,
+ then the returned value for *ClientData must be NULL
+ and should be ignored by the caller. The KMS protocol
+ consumer is responsible for freeing all valid buffers
+ used for client data regardless of whether they are
+ allocated by the caller for input to the function or by
+ the implementation for output back to the caller.
+
+ @retval EFI_SUCCESS Successfully added all requested keys.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate required resources.
+ @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key
+ request(s) to see which ones may have been processed.
+ @retval EFI_BUFFER_TOO_SMALL If multiple keys are associated with a single identifier, and the
+ KeyValue buffer does not contain enough structures
+ (KeyDescriptorCount) to contain all the key data, then
+ the available structures will be filled and
+ KeyDescriptorCount will be updated to indicate the
+ number of keys which could not be processed
+ @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a
+ ClientId is required by the server and either none or an
+ invalid id was provided.
+ @retval EFI_DEVICE_ERROR Device or key server error. Check individual key request(s) to
+ see which ones may have been processed.
+ @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,
+ KeyDescriptorCount is NULL, or Keys is NULL.
+ @retval EFI_NOT_FOUND One or more EFI_KMS_KEY_DESCRIPTOR structures
+ could not be processed properly. KeyDescriptorCount
+ contains the number of structures which were successfully
+ processed. Individual structures will reflect the status of the
+ processing for that structure.
+ @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_KMS_ADD_KEY) (
+ IN EFI_KMS_PROTOCOL *This,
+ IN EFI_KMS_CLIENT_INFO *Client,
+ IN OUT UINT16 *KeyDescriptorCount,
+ IN OUT EFI_KMS_KEY_DESCRIPTOR *KeyDescriptors,
+ IN OUT UINTN *ClientDataSize OPTIONAL,
+ IN OUT VOID **ClientData OPTIONAL
+ );
+
+/**
+ Delete an existing key from the KMS database.
+
+ @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.
+ @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
+ @param[in, out] KeyDescriptorCount Pointer to a count of the number of key descriptors to be
+ processed by this operation. On normal return, this
+ number will be updated with the number of key
+ descriptors successfully processed.
+ @param[in, out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR
+ structures which describe the keys to be deleted.
+ On input, the KeyId field for first key must contain
+ valid identifier data to be used for adding a key to
+ the KMS. The values for these fields in this key
+ definition will be considered default values for
+ subsequent keys requested in this operation. A value
+ of 0 in any subsequent KeyId field will be replaced
+ with the current default value. The KeyFormat and
+ KeyValue fields are ignored, but should be 0.
+ On return, the KeyStatus field will reflect the result
+ of the operation for each key request.
+ @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of
+ data specified by the ClientData parameter. This
+ parameter may be NULL, in which case the ClientData
+ parameter will be ignored and no data will be
+ transferred to or from the KMS. If the parameter is
+ not NULL, then ClientData must be a valid pointer.
+ If the value pointed to is 0, no data will be transferred
+ to the KMS, but data may be returned by the KMS.
+ For all non-zero values *ClientData will be transferred
+ to the KMS, which may also return data to the caller.
+ In all cases, the value upon return to the caller will
+ be the size of the data block returned to the caller,
+ which will be zero if no data is returned from the KMS.
+ @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of
+ *ClientDataSize that is to be passed directly to the
+ KMS if it supports the use of client data. This
+ parameter may be NULL if and only if the
+ ClientDataSize parameter is also NULL. Upon return to
+ the caller, *ClientData points to a block of data of
+ *ClientDataSize that was returned from the KMS.
+ If the returned value for *ClientDataSize is zero,
+ then the returned value for *ClientData must be NULL
+ and should be ignored by the caller. The KMS protocol
+ consumer is responsible for freeing all valid buffers
+ used for client data regardless of whether they are
+ allocated by the caller for input to the function or by
+ the implementation for output back to the caller.
+
+ @retval EFI_SUCCESS Successfully deleted all requested keys.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate required resources.
+ @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key
+ request(s) to see which ones may have been processed.
+ @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a
+ ClientId is required by the server and either none or an
+ invalid id was provided.
+ @retval EFI_DEVICE_ERROR Device or key server error. Check individual key request(s) to
+ see which ones may have been processed.
+ @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,
+ KeyDescriptorCount is NULL, or Keys is NULL.
+ @retval EFI_NOT_FOUND One or more EFI_KMS_KEY_DESCRIPTOR structures
+ could not be processed properly. KeyDescriptorCount
+ contains the number of structures which were successfully
+ processed. Individual structures will reflect the status of the
+ processing for that structure.
+ @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_KMS_DELETE_KEY) (
+ IN EFI_KMS_PROTOCOL *This,
+ IN EFI_KMS_CLIENT_INFO *Client,
+ IN OUT UINT16 *KeyDescriptorCount,
+ IN OUT EFI_KMS_KEY_DESCRIPTOR *KeyDescriptors,
+ IN OUT UINTN *ClientDataSize OPTIONAL,
+ IN OUT VOID **ClientData OPTIONAL
+ );
+
+/**
+ Get one or more attributes associated with a specified key identifier.
+ If none are found, the returned attributes count contains a value of zero.
+
+ @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.
+ @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
+ @param[in] KeyIdentifierSize Pointer to the size in bytes of the KeyIdentifier variable.
+ @param[in] KeyIdentifier Pointer to the key identifier associated with this key.
+ @param[in, out] KeyAttributesCount Pointer to the number of EFI_KMS_KEY_ATTRIBUTE
+ structures associated with the Key identifier. If none
+ are found, the count value is zero on return.
+ On input this value reflects the number of KeyAttributes
+ that may be returned.
+ On output, the value reflects the number of completed
+ KeyAttributes structures found.
+ @param[in, out] KeyAttributes Pointer to an array of EFI_KMS_KEY_ATTRIBUTE
+ structures associated with the Key Identifier.
+ On input, the fields in the structure should be NULL.
+ On output, the attribute fields will have updated values
+ for attributes associated with this key identifier.
+ @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of
+ data specified by the ClientData parameter. This
+ parameter may be NULL, in which case the ClientData
+ parameter will be ignored and no data will be
+ transferred to or from the KMS. If the parameter is
+ not NULL, then ClientData must be a valid pointer.
+ If the value pointed to is 0, no data will be transferred
+ to the KMS, but data may be returned by the KMS.
+ For all non-zero values *ClientData will be transferred
+ to the KMS, which may also return data to the caller.
+ In all cases, the value upon return to the caller will
+ be the size of the data block returned to the caller,
+ which will be zero if no data is returned from the KMS.
+ @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of
+ *ClientDataSize that is to be passed directly to the
+ KMS if it supports the use of client data. This
+ parameter may be NULL if and only if the
+ ClientDataSize parameter is also NULL. Upon return to
+ the caller, *ClientData points to a block of data of
+ *ClientDataSize that was returned from the KMS.
+ If the returned value for *ClientDataSize is zero,
+ then the returned value for *ClientData must be NULL
+ and should be ignored by the caller. The KMS protocol
+ consumer is responsible for freeing all valid buffers
+ used for client data regardless of whether they are
+ allocated by the caller for input to the function or by
+ the implementation for output back to the caller.
+
+ @retval EFI_SUCCESS Successfully retrieved all key attributes.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate resources for the method processing.
+ @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key
+ attribute request(s) to see which ones may have been
+ processed.
+ @retval EFI_BUFFER_TOO_SMALL If multiple key attributes are associated with a single identifier,
+ and the KeyAttributes buffer does not contain enough
+ structures (KeyAttributesCount) to contain all the key
+ attributes data, then the available structures will be filled and
+ KeyAttributesCount will be updated to indicate the
+ number of key attributes which could not be processed.
+ @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a
+ ClientId is required by the server and either none or an
+ invalid id was provided.
+ @retval EFI_DEVICE_ERROR Device or key server error. Check individual key attribute
+ request(s) (i.e. key attribute status for each) to see which ones
+ may have been processed.
+ @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,
+ KeyIdentifierSize is NULL , or KeyIdentifier
+ is NULL, or KeyAttributes is NULL, or
+ KeyAttributesSize is NULL.
+ @retval EFI_NOT_FOUND The KeyIdentifier could not be found.
+ KeyAttributesCount contains zero. Individual
+ structures will reflect the status of the processing for that
+ structure.
+ @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_KMS_GET_KEY_ATTRIBUTES) (
+ IN EFI_KMS_PROTOCOL *This,
+ IN EFI_KMS_CLIENT_INFO *Client,
+ IN UINT8 *KeyIdentifierSize,
+ IN CONST VOID *KeyIdentifier,
+ IN OUT UINT16 *KeyAttributesCount,
+ IN OUT EFI_KMS_KEY_ATTRIBUTE *KeyAttributes,
+ IN OUT UINTN *ClientDataSize OPTIONAL,
+ IN OUT VOID **ClientData OPTIONAL
+ );
+
+/**
+ Add one or more attributes to a key specified by a key identifier.
+
+ @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.
+ @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
+ @param[in] KeyIdentifierSize Pointer to the size in bytes of the KeyIdentifier variable.
+ @param[in] KeyIdentifier Pointer to the key identifier associated with this key.
+ @param[in, out] KeyAttributesCount Pointer to the number of EFI_KMS_KEY_ATTRIBUTE
+ structures to associate with the Key. On normal returns,
+ this number will be updated with the number of key
+ attributes successfully processed.
+ @param[in, out] KeyAttributes Pointer to an array of EFI_KMS_KEY_ATTRIBUTE
+ structures providing the attribute information to
+ associate with the key.
+ On input, the values for the fields in the structure
+ are completely filled in.
+ On return the KeyAttributeStatus field will reflect the
+ result of the operation for each key attribute request.
+ @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of
+ data specified by the ClientData parameter. This
+ parameter may be NULL, in which case the ClientData
+ parameter will be ignored and no data will be
+ transferred to or from the KMS. If the parameter is
+ not NULL, then ClientData must be a valid pointer.
+ If the value pointed to is 0, no data will be transferred
+ to the KMS, but data may be returned by the KMS.
+ For all non-zero values *ClientData will be transferred
+ to the KMS, which may also return data to the caller.
+ In all cases, the value upon return to the caller will
+ be the size of the data block returned to the caller,
+ which will be zero if no data is returned from the KMS.
+ @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of
+ *ClientDataSize that is to be passed directly to the
+ KMS if it supports the use of client data. This
+ parameter may be NULL if and only if the
+ ClientDataSize parameter is also NULL. Upon return to
+ the caller, *ClientData points to a block of data of
+ *ClientDataSize that was returned from the KMS.
+ If the returned value for *ClientDataSize is zero,
+ then the returned value for *ClientData must be NULL
+ and should be ignored by the caller. The KMS protocol
+ consumer is responsible for freeing all valid buffers
+ used for client data regardless of whether they are
+ allocated by the caller for input to the function or by
+ the implementation for output back to the caller.
+
+ @retval EFI_SUCCESS Successfully added all requested key attributes.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate required resources.
+ @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key
+ attribute request(s) to see which ones may have been
+ processed.
+ @retval EFI_BUFFER_TOO_SMALL If multiple keys attributes are associated with a single key
+ identifier, and the attributes buffer does not contain
+ enough structures (KeyAttributesCount) to contain all
+ the data, then the available structures will be filled and
+ KeyAttributesCount will be updated to indicate the
+ number of key attributes which could not be processed. The
+ status of each key attribute is also updated indicating success or
+ failure for that attribute in case there are other errors for those
+ attributes that could be processed.
+ @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a
+ ClientId is required by the server and either none or an
+ invalid id was provided.
+ @retval EFI_DEVICE_ERROR Device or key server error. Check individual key attribute
+ request(s) (i.e. key attribute status for each) to see which ones
+ may have been processed.
+ @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,
+ KeyAttributesCount is NULL, or KeyAttributes
+ is NULL, or KeyIdentifierSize is NULL, or
+ KeyIdentifer is NULL.
+ @retval EFI_NOT_FOUND The KeyIdentifier could not be found. On return the
+ KeyAttributesCount contains the number of attributes
+ processed. Individual structures will reflect the status of the
+ processing for that structure.
+ @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_KMS_ADD_KEY_ATTRIBUTES) (
+ IN EFI_KMS_PROTOCOL *This,
+ IN EFI_KMS_CLIENT_INFO *Client,
+ IN UINT8 *KeyIdentifierSize,
+ IN CONST VOID *KeyIdentifier,
+ IN OUT UINT16 *KeyAttributesCount,
+ IN OUT EFI_KMS_KEY_ATTRIBUTE *KeyAttributes,
+ IN OUT UINTN *ClientDataSize OPTIONAL,
+ IN OUT VOID **ClientData OPTIONAL
+ );
+
+/**
+ Delete attributes to a key specified by a key identifier.
+
+ @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.
+ @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
+ @param[in] KeyIdentifierSize Pointer to the size in bytes of the KeyIdentifier variable.
+ @param[in] KeyIdentifier Pointer to the key identifier associated with this key.
+ @param[in, out] KeyAttributesCount Pointer to the number of EFI_KMS_KEY_ATTRIBUTE
+ structures to associate with the Key.
+ On input, the count value is one or more.
+ On normal returns, this number will be updated with
+ the number of key attributes successfully processed.
+ @param[in, out] KeyAttributes Pointer to an array of EFI_KMS_KEY_ATTRIBUTE
+ structures providing the attribute information to
+ associate with the key.
+ On input, the values for the fields in the structure
+ are completely filled in.
+ On return the KeyAttributeStatus field will reflect the
+ result of the operation for each key attribute request.
+ @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of
+ data specified by the ClientData parameter. This
+ parameter may be NULL, in which case the ClientData
+ parameter will be ignored and no data will be
+ transferred to or from the KMS. If the parameter is
+ not NULL, then ClientData must be a valid pointer.
+ If the value pointed to is 0, no data will be transferred
+ to the KMS, but data may be returned by the KMS.
+ For all non-zero values *ClientData will be transferred
+ to the KMS, which may also return data to the caller.
+ In all cases, the value upon return to the caller will
+ be the size of the data block returned to the caller,
+ which will be zero if no data is returned from the KMS.
+ @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of
+ *ClientDataSize that is to be passed directly to the
+ KMS if it supports the use of client data. This
+ parameter may be NULL if and only if the
+ ClientDataSize parameter is also NULL. Upon return to
+ the caller, *ClientData points to a block of data of
+ *ClientDataSize that was returned from the KMS.
+ If the returned value for *ClientDataSize is zero,
+ then the returned value for *ClientData must be NULL
+ and should be ignored by the caller. The KMS protocol
+ consumer is responsible for freeing all valid buffers
+ used for client data regardless of whether they are
+ allocated by the caller for input to the function or by
+ the implementation for output back to the caller.
+
+ @retval EFI_SUCCESS Successfully deleted all requested key attributes.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate required resources.
+ @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key
+ attribute request(s) to see which ones may have been
+ processed.
+ @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a
+ ClientId is required by the server and either none or an
+ invalid id was provided.
+ @retval EFI_DEVICE_ERROR Device or key server error. Check individual key attribute
+ request(s) (i.e. key attribute status for each) to see which ones
+ may have been processed.
+ @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,
+ KeyAttributesCount is NULL, or
+ KeyAttributes is NULL, or KeyIdentifierSize
+ is NULL, or KeyIdentifer is NULL.
+ @retval EFI_NOT_FOUND The KeyIdentifier could not be found or the attribute
+ could not be found. On return the KeyAttributesCount
+ contains the number of attributes processed. Individual
+ structures will reflect the status of the processing for that
+ structure.
+ @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_KMS_DELETE_KEY_ATTRIBUTES) (
+ IN EFI_KMS_PROTOCOL *This,
+ IN EFI_KMS_CLIENT_INFO *Client,
+ IN UINT8 *KeyIdentifierSize,
+ IN CONST VOID *KeyIdentifier,
+ IN OUT UINT16 *KeyAttributesCount,
+ IN OUT EFI_KMS_KEY_ATTRIBUTE *KeyAttributes,
+ IN OUT UINTN *ClientDataSize OPTIONAL,
+ IN OUT VOID **ClientData OPTIONAL
+ );
+
+/**
+ Retrieve one or more key that has matched all of the specified key attributes.
+
+ @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.
+ @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
+ @param[in, out] KeyAttributesCount Pointer to a count of the number of key attribute structures
+ that must be matched for each returned key descriptor.
+ On input the count value is one or more.
+ On normal returns, this number will be updated with
+ the number of key attributes successfully processed.
+ @param[in, out] KeyAttributes Pointer to an array of EFI_KMS_KEY_ATTRIBUTE
+ structure to search for.
+ On input, the values for the fields in the structure are
+ completely filled in.
+ On return the KeyAttributeStatus field will reflect the
+ result of the operation for each key attribute request.
+ @param[in, out] KeyDescriptorCount Pointer to a count of the number of key descriptors matched
+ by this operation.
+ On entry, this number will be zero.
+ On return, this number will be updated to the number
+ of key descriptors successfully found.
+ @param[in, out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR
+ structures which describe the keys from the KMS
+ having the KeyAttribute(s) specified.
+ On input, this pointer will be NULL.
+ On output, the array will contain an
+ EFI_KMS_KEY_DESCRIPTOR structure for each key
+ meeting the search criteria. Memory for the array
+ and all KeyValue fields will be allocated with the
+ EfiBootServicesData type and must be freed by the
+ caller when it is no longer needed. Also, the KeyStatus
+ field of each descriptor will reflect the result of the
+ request relative to that key descriptor.
+ @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of
+ data specified by the ClientData parameter. This
+ parameter may be NULL, in which case the ClientData
+ parameter will be ignored and no data will be
+ transferred to or from the KMS. If the parameter is
+ not NULL, then ClientData must be a valid pointer.
+ If the value pointed to is 0, no data will be transferred
+ to the KMS, but data may be returned by the KMS.
+ For all non-zero values *ClientData will be transferred
+ to the KMS, which may also return data to the caller.
+ In all cases, the value upon return to the caller will
+ be the size of the data block returned to the caller,
+ which will be zero if no data is returned from the KMS.
+ @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of
+ *ClientDataSize that is to be passed directly to the
+ KMS if it supports the use of client data. This
+ parameter may be NULL if and only if the
+ ClientDataSize parameter is also NULL. Upon return to
+ the caller, *ClientData points to a block of data of
+ *ClientDataSize that was returned from the KMS.
+ If the returned value for *ClientDataSize is zero,
+ then the returned value for *ClientData must be NULL
+ and should be ignored by the caller. The KMS protocol
+ consumer is responsible for freeing all valid buffers
+ used for client data regardless of whether they are
+ allocated by the caller for input to the function or by
+ the implementation for output back to the caller.
+
+ @retval EFI_SUCCESS Successfully retrieved all requested keys.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate required resources.
+ @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key
+ attribute request(s) to see which ones may have been
+ processed.
+ @retval EFI_BUFFER_TOO_SMALL If multiple keys are associated with the attribute(s), and the
+ KeyValue buffer does not contain enough structures
+ (KeyDescriptorCount) to contain all the key data, then
+ the available structures will be filled and
+ KeyDescriptorCount will be updated to indicate the
+ number of keys which could not be processed.
+ @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a
+ ClientId is required by the server and either none or an
+ invalid id was provided.
+ @retval EFI_DEVICE_ERROR Device or key server error. Check individual key attribute
+ request(s) (i.e. key attribute status for each) to see which ones
+ may have been processed.
+ @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,
+ KeyDescriptorCount is NULL, or
+ KeyDescriptors is NULL or KeyAttributes is
+ NULL, or KeyAttributesCount is NULL.
+ @retval EFI_NOT_FOUND One or more EFI_KMS_KEY_ATTRIBUTE structures could
+ not be processed properly. KeyAttributeCount contains
+ the number of structures which were successfully processed.
+ Individual structures will reflect the status of the processing for
+ that structure.
+ @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_KMS_GET_KEY_BY_ATTRIBUTES) (
+ IN EFI_KMS_PROTOCOL *This,
+ IN EFI_KMS_CLIENT_INFO *Client,
+ IN OUT UINTN *KeyAttributeCount,
+ IN OUT EFI_KMS_KEY_ATTRIBUTE *KeyAttributes,
+ IN OUT UINTN *KeyDescriptorCount,
+ IN OUT EFI_KMS_KEY_DESCRIPTOR *KeyDescriptors,
+ IN OUT UINTN *ClientDataSize OPTIONAL,
+ IN OUT VOID **ClientData OPTIONAL
+ );
+
+///
+/// The Key Management Service (KMS) protocol provides services to generate, store, retrieve,
+/// and manage cryptographic keys.
+///
+struct _EFI_KMS_PROTOCOL {
+ ///
+ /// Get the current status of the key management service. If the implementation has not yet
+ /// connected to the KMS, then a call to this function will initiate a connection. This is the
+ /// only function that is valid for use prior to the service being marked available.
+ ///
+ EFI_KMS_GET_SERVICE_STATUS GetServiceStatus;
+ ///
+ /// Register a specific client with the KMS.
+ ///
+ EFI_KMS_REGISTER_CLIENT RegisterClient;
+ ///
+ /// Request the generation of a new key and retrieve it.
+ ///
+ EFI_KMS_CREATE_KEY CreateKey;
+ ///
+ /// Retrieve an existing key.
+ ///
+ EFI_KMS_GET_KEY GetKey;
+ ///
+ /// Add a local key to KMS database. If there is an existing key with this key identifier in the
+ /// KMS database, it will be replaced with the new key.
+ ///
+ EFI_KMS_ADD_KEY AddKey;
+ ///
+ /// Delete an existing key from the KMS database.
+ ///
+ EFI_KMS_DELETE_KEY DeleteKey;
+ ///
+ /// Get attributes for an existing key in the KMS database.
+ ///
+ EFI_KMS_GET_KEY_ATTRIBUTES GetKeyAttributes;
+ ///
+ /// Add attributes to an existing key in the KMS database.
+ ///
+ EFI_KMS_ADD_KEY_ATTRIBUTES AddKeyAttributes;
+ ///
+ /// Delete attributes for an existing key in the KMS database.
+ ///
+ EFI_KMS_DELETE_KEY_ATTRIBUTES DeleteKeyAttributes;
+ ///
+ /// Get existing key(s) with the specified attributes.
+ ///
+ EFI_KMS_GET_KEY_BY_ATTRIBUTES GetKeyByAttributes;
+ ///
+ /// The version of this EFI_KMS_PROTOCOL structure. This must be set to 0x00020040 for
+ /// the initial version of this protocol.
+ ///
+ UINT32 ProtocolVersion;
+ ///
+ /// Optional GUID used to identify a specific KMS. This GUID may be supplied by the provider,
+ /// by the implementation, or may be null. If is null, then the ServiceName must not be null.
+ ///
+ EFI_GUID ServiceId;
+ ///
+ /// Optional pointer to a unicode string which may be used to identify the KMS or provide
+ /// other information about the supplier.
+ ///
+ CHAR16 *ServiceName;
+ ///
+ /// Optional 32-bit value which may be used to indicate the version of the KMS provided by
+ /// the supplier.
+ ///
+ UINT32 ServiceVersion;
+ ///
+ /// TRUE if and only if the service is active and available for use. To avoid unnecessary
+ /// delays in POST, this protocol may be installed without connecting to the service. In this
+ /// case, the first call to the GetServiceStatus () function will cause the implementation to
+ /// connect to the supported service and mark it as available. The capabilities of this service
+ /// as defined in the reminder of this protocol are not guaranteed to be valid until the service
+ /// has been marked available.
+ ///
+ BOOLEAN ServiceAvailable;
+ ///
+ /// TRUE if and only if the service supports client identifiers. Client identifiers may be used
+ /// for auditing, access control or any other purpose specific to the implementation.
+ ///
+ BOOLEAN ClientIdSupported;
+ ///
+ /// TRUE if and only if the service requires a client identifier in order to process key requests.
+ /// FALSE otherwise.
+ ///
+ BOOLEAN ClientIdRequired;
+ ///
+ /// The maximum size in bytes for the client identifier.
+ ///
+ UINT16 ClientIdMaxSize;
+ ///
+ /// The client name string type(s) supported by the KMS service. If client names are not
+ /// supported, this field will be set the EFI_KMS_DATA_TYPE_NONE. Otherwise, it will be set
+ /// to the inclusive 'OR' of all client name formats supported. Client names may be used for
+ /// auditing, access control or any other purpose specific to the implementation.
+ ///
+ UINT8 ClientNameStringTypes;
+ ///
+ /// TRUE if only if the KMS requires a client name to be supplied to the service.
+ /// FALSE otherwise.
+ ///
+ BOOLEAN ClientNameRequired;
+ ///
+ /// The maximum number of characters allowed for the client name.
+ ///
+ UINT16 ClientNameMaxCount;
+ ///
+ /// TRUE if and only if the service supports arbitrary client data requests. The use of client
+ /// data requires the caller to have specific knowledge of the individual KMS service and
+ /// should be used only if absolutely necessary.
+ /// FALSE otherwise.
+ ///
+ BOOLEAN ClientDataSupported;
+ ///
+ /// The maximum size in bytes for the client data. If the maximum data size is not specified
+ /// by the KMS or it is not known, then this field must be filled with all ones.
+ ///
+ UINTN ClientDataMaxSize;
+ ///
+ /// TRUE if variable length key identifiers are supported.
+ /// FALSE if a fixed length key identifier is supported.
+ ///
+ BOOLEAN KeyIdVariableLenSupported;
+ ///
+ /// If KeyIdVariableLenSupported is TRUE, this is the maximum supported key identifier length
+ /// in bytes. Otherwise this is the fixed length of key identifier supported. Key ids shorter
+ /// than the fixed length will be padded on the right with blanks.
+ ///
+ UINTN KeyIdMaxSize;
+ ///
+ /// The number of key format/size GUIDs returned in the KeyFormats field.
+ ///
+ UINTN KeyFormatsCount;
+ ///
+ /// A pointer to an array of EFI_GUID values which specify key formats/sizes supported by
+ /// this KMS. Each format/size pair will be specified by a separate EFI_GUID. At least one
+ /// key format/size must be supported. All formats/sizes with the same hashing algorithm
+ /// must be contiguous in the array, and for each hashing algorithm, the key sizes must be in
+ /// ascending order. See "Related Definitions" for GUIDs which identify supported key formats/sizes.
+ /// This list of GUIDs supported by the KMS is not required to be exhaustive, and the KMS
+ /// may provide support for additional key formats/sizes. Users may request key information
+ /// using an arbitrary GUID, but any GUID not recognized by the implementation or not
+ /// supported by the KMS will return an error code of EFI_UNSUPPORTED
+ ///
+ EFI_GUID *KeyFormats;
+ ///
+ /// TRUE if key attributes are supported.
+ /// FALSE if key attributes are not supported.
+ ///
+ BOOLEAN KeyAttributesSupported;
+ ///
+ /// The key attribute identifier string type(s) supported by the KMS service. If key attributes
+ /// are not supported, this field will be set to EFI_KMS_DATA_TYPE_NONE. Otherwise, it will
+ /// be set to the inclusive 'OR' of all key attribute identifier string types supported.
+ /// EFI_KMS_DATA_TYPE_BINARY is not valid for this field.
+ ///
+ UINT8 KeyAttributeIdStringTypes;
+ UINT16 KeyAttributeIdMaxCount;
+ ///
+ /// The number of predefined KeyAttributes structures returned in the KeyAttributes
+ /// parameter. If the KMS does not support predefined key attributes, or if it does not
+ /// provide a method to obtain predefined key attributes data, then this field must be zero.
+ ///
+ UINTN KeyAttributesCount;
+ ///
+ /// A pointer to an array of KeyAttributes structures which contains the predefined
+ /// attributes supported by this KMS. Each structure must contain a valid key attribute
+ /// identifier and should provide any other information as appropriate for the attribute,
+ /// including a default value if one exists. This variable must be set to NULL if the
+ /// KeyAttributesCount variable is zero. It must point to a valid buffer if the
+ /// KeyAttributesCount variable is non-zero.
+ /// This list of predefined attributes is not required to be exhaustive, and the KMS may
+ /// provide additional predefined attributes not enumerated in this list. The implementation
+ /// does not distinguish between predefined and used defined attributes, and therefore,
+ /// predefined attributes not enumerated will still be processed to the KMS.
+ ///
+ EFI_KMS_KEY_ATTRIBUTE *KeyAttributes;
+};
+
+extern EFI_GUID gEfiKmsFormatGeneric128Guid;
+extern EFI_GUID gEfiKmsFormatGeneric160Guid;
+extern EFI_GUID gEfiKmsFormatGeneric256Guid;
+extern EFI_GUID gEfiKmsFormatGeneric512Guid;
+extern EFI_GUID gEfiKmsFormatGeneric1024Guid;
+extern EFI_GUID gEfiKmsFormatGeneric2048Guid;
+extern EFI_GUID gEfiKmsFormatGeneric3072Guid;
+extern EFI_GUID gEfiKmsFormatMd2128Guid;
+extern EFI_GUID gEfiKmsFormatMdc2128Guid;
+extern EFI_GUID gEfiKmsFormatMd4128Guid;
+extern EFI_GUID gEfiKmsFormatMdc4128Guid;
+extern EFI_GUID gEfiKmsFormatMd5128Guid;
+extern EFI_GUID gEfiKmsFormatMd5sha128Guid;
+extern EFI_GUID gEfiKmsFormatSha1160Guid;
+extern EFI_GUID gEfiKmsFormatSha256256Guid;
+extern EFI_GUID gEfiKmsFormatSha512512Guid;
+extern EFI_GUID gEfiKmsFormatAesxts128Guid;
+extern EFI_GUID gEfiKmsFormatAesxts256Guid;
+extern EFI_GUID gEfiKmsFormatAescbc128Guid;
+extern EFI_GUID gEfiKmsFormatAescbc256Guid;
+extern EFI_GUID gEfiKmsFormatRsasha11024Guid;
+extern EFI_GUID gEfiKmsFormatRsasha12048Guid;
+extern EFI_GUID gEfiKmsFormatRsasha2562048Guid;
+extern EFI_GUID gEfiKmsFormatRsasha2563072Guid;
+extern EFI_GUID gEfiKmsProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacyRegion2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacyRegion2.h
new file mode 100644
index 0000000000..6f553bd7ad
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacyRegion2.h
@@ -0,0 +1,239 @@
+/** @file
+ The Legacy Region Protocol controls the read, write and boot-lock attributes for
+ the region 0xC0000 to 0xFFFFF.
+
+ Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is defined in UEFI Platform Initialization Specification 1.2
+ Volume 5: Standards
+
+**/
+
+#ifndef __LEGACY_REGION2_H__
+#define __LEGACY_REGION2_H__
+
+
+#define EFI_LEGACY_REGION2_PROTOCOL_GUID \
+{ \
+ 0x70101eaf, 0x85, 0x440c, {0xb3, 0x56, 0x8e, 0xe3, 0x6f, 0xef, 0x24, 0xf0 } \
+}
+
+typedef struct _EFI_LEGACY_REGION2_PROTOCOL EFI_LEGACY_REGION2_PROTOCOL;
+
+/**
+ Modify the hardware to allow (decode) or disallow (not decode) memory reads in a region.
+
+ If the On parameter evaluates to TRUE, this function enables memory reads in the address range
+ Start to (Start + Length - 1).
+ If the On parameter evaluates to FALSE, this function disables memory reads in the address range
+ Start to (Start + Length - 1).
+
+ @param This[in] Indicates the EFI_LEGACY_REGION2_PROTOCOL instance.
+ @param Start[in] The beginning of the physical address of the region whose attributes
+ should be modified.
+ @param Length[in] The number of bytes of memory whose attributes should be modified.
+ The actual number of bytes modified may be greater than the number
+ specified.
+ @param Granularity[out] The number of bytes in the last region affected. This may be less
+ than the total number of bytes affected if the starting address
+ was not aligned to a region's starting address or if the length
+ was greater than the number of bytes in the first region.
+ @param On[in] Decode / Non-Decode flag.
+
+ @retval EFI_SUCCESS The region's attributes were successfully modified.
+ @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_REGION2_DECODE)(
+ IN EFI_LEGACY_REGION2_PROTOCOL *This,
+ IN UINT32 Start,
+ IN UINT32 Length,
+ OUT UINT32 *Granularity,
+ IN BOOLEAN *On
+ );
+
+
+/**
+ Modify the hardware to disallow memory writes in a region.
+
+ This function changes the attributes of a memory range to not allow writes.
+
+ @param This[in] Indicates the EFI_LEGACY_REGION2_PROTOCOL instance.
+ @param Start[in] The beginning of the physical address of the region whose
+ attributes should be modified.
+ @param Length[in] The number of bytes of memory whose attributes should be modified.
+ The actual number of bytes modified may be greater than the number
+ specified.
+ @param Granularity[out] The number of bytes in the last region affected. This may be less
+ than the total number of bytes affected if the starting address was
+ not aligned to a region's starting address or if the length was
+ greater than the number of bytes in the first region.
+
+ @retval EFI_SUCCESS The region's attributes were successfully modified.
+ @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_REGION2_LOCK)(
+ IN EFI_LEGACY_REGION2_PROTOCOL *This,
+ IN UINT32 Start,
+ IN UINT32 Length,
+ OUT UINT32 *Granularity
+ );
+
+
+/**
+ Modify the hardware to disallow memory attribute changes in a region.
+
+ This function makes the attributes of a region read only. Once a region is boot-locked with this
+ function, the read and write attributes of that region cannot be changed until a power cycle has
+ reset the boot-lock attribute. Calls to Decode(), Lock() and Unlock() will have no effect.
+
+ @param This[in] Indicates the EFI_LEGACY_REGION2_PROTOCOL instance.
+ @param Start[in] The beginning of the physical address of the region whose
+ attributes should be modified.
+ @param Length[in] The number of bytes of memory whose attributes should be modified.
+ The actual number of bytes modified may be greater than the number
+ specified.
+ @param Granularity[out] The number of bytes in the last region affected. This may be less
+ than the total number of bytes affected if the starting address was
+ not aligned to a region's starting address or if the length was
+ greater than the number of bytes in the first region.
+
+ @retval EFI_SUCCESS The region's attributes were successfully modified.
+ @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.
+ @retval EFI_UNSUPPORTED The chipset does not support locking the configuration registers in
+ a way that will not affect memory regions outside the legacy memory
+ region.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_REGION2_BOOT_LOCK)(
+ IN EFI_LEGACY_REGION2_PROTOCOL *This,
+ IN UINT32 Start,
+ IN UINT32 Length,
+ OUT UINT32 *Granularity OPTIONAL
+ );
+
+
+/**
+ Modify the hardware to allow memory writes in a region.
+
+ This function changes the attributes of a memory range to allow writes.
+
+ @param This[in] Indicates the EFI_LEGACY_REGION2_PROTOCOL instance.
+ @param Start[in] The beginning of the physical address of the region whose
+ attributes should be modified.
+ @param Length[in] The number of bytes of memory whose attributes should be modified.
+ The actual number of bytes modified may be greater than the number
+ specified.
+ @param Granularity[out] The number of bytes in the last region affected. This may be less
+ than the total number of bytes affected if the starting address was
+ not aligned to a region's starting address or if the length was
+ greater than the number of bytes in the first region.
+
+ @retval EFI_SUCCESS The region's attributes were successfully modified.
+ @retval EFI_INVALID_PARAMETER If Start or Length describe an address not in the Legacy Region.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_REGION2_UNLOCK)(
+ IN EFI_LEGACY_REGION2_PROTOCOL *This,
+ IN UINT32 Start,
+ IN UINT32 Length,
+ OUT UINT32 *Granularity
+ );
+
+
+typedef enum {
+ LegacyRegionDecoded, ///< This region is currently set to allow reads.
+ LegacyRegionNotDecoded, ///< This region is currently set to not allow reads.
+ LegacyRegionWriteEnabled, ///< This region is currently set to allow writes.
+ LegacyRegionWriteDisabled, ///< This region is currently set to write protected.
+ LegacyRegionBootLocked, ///< This region's attributes are locked, cannot be modified until
+ ///< after a power cycle.
+ LegacyRegionNotLocked ///< This region's attributes are not locked.
+} EFI_LEGACY_REGION_ATTRIBUTE;
+
+
+typedef struct {
+ ///
+ /// The beginning of the physical address of this
+ /// region.
+ ///
+ UINT32 Start;
+ ///
+ /// The number of bytes in this region.
+ ///
+ UINT32 Length;
+ ///
+ /// Attribute of the Legacy Region Descriptor that
+ /// describes the capabilities for that memory region.
+ ///
+ EFI_LEGACY_REGION_ATTRIBUTE Attribute;
+ ///
+ /// Describes the byte length programmability
+ /// associated with the Start address and the specified
+ /// Attribute setting.
+ UINT32 Granularity;
+} EFI_LEGACY_REGION_DESCRIPTOR;
+
+
+/**
+ Get region information for the attributes of the Legacy Region.
+
+ This function is used to discover the granularity of the attributes for the memory in the legacy
+ region. Each attribute may have a different granularity and the granularity may not be the same
+ for all memory ranges in the legacy region.
+
+ @param This[in] Indicates the EFI_LEGACY_REGION2_PROTOCOL instance.
+ @param DescriptorCount[out] The number of region descriptor entries returned in the Descriptor
+ buffer.
+ @param Descriptor[out] A pointer to a pointer used to return a buffer where the legacy
+ region information is deposited. This buffer will contain a list of
+ DescriptorCount number of region descriptors. This function will
+ provide the memory for the buffer.
+
+ @retval EFI_SUCCESS The information structure was returned.
+ @retval EFI_UNSUPPORTED This function is not supported.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_REGION_GET_INFO)(
+ IN EFI_LEGACY_REGION2_PROTOCOL *This,
+ OUT UINT32 *DescriptorCount,
+ OUT EFI_LEGACY_REGION_DESCRIPTOR **Descriptor
+ );
+
+
+///
+/// The EFI_LEGACY_REGION2_PROTOCOL is used to abstract the hardware control of the memory
+/// attributes of the Option ROM shadowing region, 0xC0000 to 0xFFFFF.
+/// There are three memory attributes that can be modified through this protocol: read, write and
+/// boot-lock. These protocols may be set in any combination.
+///
+struct _EFI_LEGACY_REGION2_PROTOCOL {
+ EFI_LEGACY_REGION2_DECODE Decode;
+ EFI_LEGACY_REGION2_LOCK Lock;
+ EFI_LEGACY_REGION2_BOOT_LOCK BootLock;
+ EFI_LEGACY_REGION2_UNLOCK UnLock;
+ EFI_LEGACY_REGION_GET_INFO GetInfo;
+};
+
+extern EFI_GUID gEfiLegacyRegion2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiController.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiController.h
new file mode 100644
index 0000000000..2d36eaefc0
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiController.h
@@ -0,0 +1,265 @@
+/** @file
+ This file defines the Legacy SPI Controller Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD
+ License which accompanies this distribution. The full text of the license may
+ be found at http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI PI Specification 1.6.
+
+**/
+
+#ifndef __LEGACY_SPI_CONTROLLER_PROTOCOL_H__
+#define __LEGACY_SPI_CONTROLLER_PROTOCOL_H__
+
+///
+/// Note: The UEFI PI 1.6 specification uses the character 'l' in the GUID
+/// definition. This definition assumes it was supposed to be '1'.
+///
+/// Global ID for the Legacy SPI Controller Protocol
+///
+#define EFI_LEGACY_SPI_CONTROLLER_GUID \
+ { 0x39136fc7, 0x1a11, 0x49de, \
+ { 0xbf, 0x35, 0x0e, 0x78, 0xdd, 0xb5, 0x24, 0xfc }}
+
+typedef
+struct _EFI_LEGACY_SPI_CONTROLLER_PROTOCOL
+EFI_LEGACY_SPI_CONTROLLER_PROTOCOL;
+
+/**
+ Set the erase block opcode.
+
+ This routine must be called at or below TPL_NOTIFY.
+ The menu table contains SPI transaction opcodes which are accessible after
+ the legacy SPI flash controller's configuration is locked. The board layer
+ specifies the erase block size for the SPI NOR flash part. The SPI NOR flash
+ peripheral driver selects the erase block opcode which matches the erase
+ block size and uses this API to load the opcode into the opcode menu table.
+
+ @param[in] This Pointer to an EFI_LEGACY_SPI_CONTROLLER_PROTOCOL
+ structure.
+ @param[in] EraseBlockOpcode Erase block opcode to be placed into the opcode
+ menu table.
+
+ @retval EFI_SUCCESS The opcode menu table was updated
+ @retval EFI_ACCESS_ERROR The SPI controller is locked
+
+**/
+typedef EFI_STATUS
+(EFIAPI *EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_ERASE_BLOCK_OPCODE) (
+ IN CONST EFI_LEGACY_SPI_CONTROLLER_PROTOCOL *This,
+ IN UINT8 EraseBlockOpcode
+ );
+
+/**
+ Set the write status prefix opcode.
+
+ This routine must be called at or below TPL_NOTIFY.
+ The prefix table contains SPI transaction write prefix opcodes which are
+ accessible after the legacy SPI flash controller's configuration is locked.
+ The board layer specifies the write status prefix opcode for the SPI NOR
+ flash part. The SPI NOR flash peripheral driver uses this API to load the
+ opcode into the prefix table.
+
+ @param[in] This Pointer to an
+ EFI_LEGACY_SPI_CONTROLLER_PROTOCOL structure.
+ @param[in] WriteStatusPrefix Prefix opcode for the write status command.
+
+ @retval EFI_SUCCESS The prefix table was updated
+ @retval EFI_ACCESS_ERROR The SPI controller is locked
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_WRITE_STATUS_PREFIX) (
+ IN CONST EFI_LEGACY_SPI_CONTROLLER_PROTOCOL *This,
+ IN UINT8 WriteStatusPrefix
+ );
+
+/**
+ Set the BIOS base address.
+
+ This routine must be called at or below TPL_NOTIFY.
+ The BIOS base address works with the protect range registers to protect
+ portions of the SPI NOR flash from erase and write operat ions. The BIOS
+ calls this API prior to passing control to the OS loader.
+
+ @param[in] This Pointer to an EFI_LEGACY_SPI_CONTROLLER_PROTOCOL
+ structure.
+ @param[in] BiosBaseAddress The BIOS base address.
+
+ @retval EFI_SUCCESS The BIOS base address was properly set
+ @retval EFI_ACCESS_ERROR The SPI controller is locked
+ @retval EFI_INVALID_PARAMETER The BIOS base address is greater than
+ This->Maxi.mumOffset
+ @retval EFI_UNSUPPORTED The BIOS base address was already set
+
+**/
+typedef EFI_STATUS
+(EFIAPI *EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_BIOS_BASE_ADDRESS) (
+ IN CONST EFI_LEGACY_SPI_CONTROLLER_PROTOCOL *This,
+ IN UINT32 BiosBaseAddress
+ );
+
+/**
+ Clear the SPI protect range registers.
+
+ This routine must be called at or below TPL_NOTIFY.
+ The BIOS uses this routine to set an initial condition on the SPI protect
+ range registers.
+
+ @param[in] This Pointer to an EFI_LEGACY_SPI_CONTROLLER_PROTOCOL structure.
+
+ @retval EFI_SUCCESS The registers were successfully cleared
+ @retval EFI_ACCESS_ERROR The SPI controller is locked
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_CLEAR_SPI_PROTECT) (
+ IN CONST EFI_LEGACY_SPI_CONTROLLER_PROTOCOL *This
+ );
+
+/**
+ Determine if the SPI range is protected.
+
+ This routine must be called at or below TPL_NOTIFY.
+ The BIOS uses this routine to verify a range in the SPI is protected.
+
+ @param[in] This Pointer to an EFI_LEGACY_SPI_CONTROLLER_PROTOCOL
+ structure.
+ @param[in] BiosAddress Address within a 4 KiB block to start protecting.
+ @param[in] BytesToProtect The number of 4 KiB blocks to protect.
+
+ @retval TRUE The range is protected
+ @retval FALSE The range is not protected
+
+**/
+typedef
+BOOLEAN
+(EFIAPI *EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_IS_RANGE_PROTECTED) (
+ IN CONST EFI_LEGACY_SPI_CONTROLLER_PROTOCOL *This,
+ IN UINT32 BiosAddress,
+ IN UINT32 BlocksToProtect
+ );
+
+/**
+ Set the next protect range register.
+
+ This routine must be called at or below TPL_NOTIFY.
+ The BIOS sets the protect range register to prevent write and erase
+ operations to a portion of the SPI NOR flash device.
+
+ @param[in] This Pointer to an EFI_LEGACY_SPI_CONTROLLER_PROTOCOL
+ structure.
+ @param[in] BiosAddress Address within a 4 KiB block to start protecting.
+ @param[in] BlocksToProtect The number of 4 KiB blocks to protect.
+
+ @retval EFI_SUCCESS The register was successfully updated
+ @retval EFI_ACCESS_ERROR The SPI controller is locked
+ @retval EFI_INVALID_PARAMETER BiosAddress < This->BiosBaseAddress, or
+ BlocksToProtect * 4 KiB
+ > This->MaximumRangeBytes, or
+ BiosAddress - This->BiosBaseAddress
+ + (BlocksToProtect * 4 KiB)
+ > This->MaximumRangeBytes
+ @retval EFI_OUT_OF_RESOURCES No protect range register available
+ @retval EFI_UNSUPPORTED Call This->SetBaseAddress because the BIOS base
+ address is not set
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_PROTECT_NEXT_RANGE) (
+ IN CONST EFI_LEGACY_SPI_CONTROLLER_PROTOCOL *This,
+ IN UINT32 BiosAddress,
+ IN UINT32 BlocksToProtect
+ );
+
+/**
+ Lock the SPI controller configuration.
+
+ This routine must be called at or below TPL_NOTIFY.
+ This routine locks the SPI controller's configuration so that the software
+ is no longer able to update:
+ * Prefix table
+ * Opcode menu
+ * Opcode type table
+ * BIOS base address
+ * Protect range registers
+
+ @param[in] This Pointer to an EFI_LEGACY_SPI_CONTROLLER_PROTOCOL structure.
+
+ @retval EFI_SUCCESS The SPI controller was successfully locked
+ @retval EFI_ALREADY_STARTED The SPI controller was already locked
+
+**/
+typedef EFI_STATUS
+(EFIAPI *EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_LOCK_CONTROLLER) (
+ IN CONST EFI_LEGACY_SPI_CONTROLLER_PROTOCOL *This
+ );
+
+///
+/// Support the extra features of the legacy SPI flash controller.
+///
+struct _EFI_LEGACY_SPI_CONTROLLER_PROTOCOL {
+ ///
+ /// Maximum offset from the BIOS base address that is able to be protected.
+ ///
+ UINT32 MaximumOffset;
+
+ ///
+ /// Maximum number of bytes that can be protected by one range register.
+ ///
+ UINT32 MaximumRangeBytes;
+
+ ///
+ /// The number of registers available for protecting the BIOS.
+ ///
+ UINT32 RangeRegisterCount;
+
+ ///
+ /// Set the erase block opcode.
+ ///
+ EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_ERASE_BLOCK_OPCODE EraseBlockOpcode;
+
+ ///
+ /// Set the write status prefix opcode.
+ ///
+ EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_WRITE_STATUS_PREFIX WriteStatusPrefix;
+
+ ///
+ /// Set the BIOS base address.
+ ///
+ EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_BIOS_BASE_ADDRESS BiosBaseAddress;
+
+ ///
+ /// Clear the SPI protect range registers.
+ ///
+ EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_CLEAR_SPI_PROTECT ClearSpiProtect;
+
+ ///
+ /// Determine if the SPI range is protected.
+ ///
+ EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_IS_RANGE_PROTECTED IsRangeProtected;
+
+ ///
+ /// Set the next protect range register.
+ ///
+ EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_PROTECT_NEXT_RANGE ProtectNextRange;
+
+ ///
+ /// Lock the SPI controller configuration.
+ ///
+ EFI_LEGACY_SPI_CONTROLLER_PROTOCOL_LOCK_CONTROLLER LockController;
+};
+
+extern EFI_GUID gEfiLegacySpiControllerProtocolGuid;
+
+#endif // __LEGACY_SPI_CONTROLLER_PROTOCOL_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiFlash.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiFlash.h
new file mode 100644
index 0000000000..fa9f463996
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiFlash.h
@@ -0,0 +1,201 @@
+/** @file
+ This file defines the Legacy SPI Flash Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD
+ License which accompanies this distribution. The full text of the license may
+ be found at http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI PI Specification 1.6.
+
+**/
+
+#ifndef __LEGACY_SPI_FLASH_PROTOCOL_H__
+#define __LEGACY_SPI_FLASH_PROTOCOL_H__
+
+#include <Protocol/SpiNorFlash.h>
+
+///
+/// Global ID for the Legacy SPI Flash Protocol
+///
+#define EFI_LEGACY_SPI_FLASH_PROTOCOL_GUID \
+ { 0xf01bed57, 0x04bc, 0x4f3f, \
+ { 0x96, 0x60, 0xd6, 0xf2, 0xea, 0x22, 0x82, 0x59 }}
+
+typedef struct _EFI_LEGACY_SPI_FLASH_PROTOCOL EFI_LEGACY_SPI_FLASH_PROTOCOL;
+
+/**
+ Set the BIOS base address.
+
+ This routine must be called at or below TPL_NOTIFY.
+ The BIOS base address works with the protect range registers to protect
+ portions of the SPI NOR flash from erase and write operat ions.
+ The BIOS calls this API prior to passing control to the OS loader.
+
+ @param[in] This Pointer to an EFI_LEGACY_SPI_FLASH_PROTOCOL data
+ structure.
+ @param[in] BiosBaseAddress The BIOS base address.
+
+ @retval EFI_SUCCESS The BIOS base address was properly set
+ @retval EFI_ACCESS_ERROR The SPI controller is locked
+ @retval EFI_INVALID_PARAMETER BiosBaseAddress > This->MaximumOffset
+ @retval EFI_UNSUPPORTED The BIOS base address was already set or not a
+ legacy SPI host controller
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_SPI_FLASH_PROTOCOL_BIOS_BASE_ADDRESS) (
+ IN CONST EFI_LEGACY_SPI_FLASH_PROTOCOL *This,
+ IN UINT32 BiosBaseAddress
+ );
+
+/**
+ Clear the SPI protect range registers.
+
+ This routine must be called at or below TPL_NOTIFY.
+ The BIOS uses this routine to set an initial condition on the SPI protect
+ range registers.
+
+ @param[in] This Pointer to an EFI_LEGACY_SPI_FLASH_PROTOCOL data structure.
+
+ @retval EFI_SUCCESS The registers were successfully cleared
+ @retval EFI_ACCESS_ERROR The SPI controller is locked
+ @retval EFI_UNSUPPORTED Not a legacy SPI host controller
+
+**/
+typedef EFI_STATUS
+(EFIAPI *EFI_LEGACY_SPI_FLASH_PROTOCOL_CLEAR_SPI_PROTECT) (
+ IN CONST EFI_LEGACY_SPI_FLASH_PROTOCOL *This
+ );
+
+/**
+ Determine if the SPI range is protected.
+
+ This routine must be called at or below TPL_NOTIFY.
+ The BIOS uses this routine to verify a range in the SPI is protected.
+
+ @param[in] This Pointer to an EFI_LEGACY_SPI_FLASH_PROTOCOL data
+ structure.
+ @param[in] BiosAddress Address within a 4 KiB block to start protecting.
+ @param[in] BlocksToProtect The number of 4 KiB blocks to protect.
+
+ @retval TRUE The range is protected
+ @retval FALSE The range is not protected
+
+**/
+typedef
+BOOLEAN
+(EFIAPI *EFI_LEGACY_SPI_FLASH_PROTOCOL_IS_RANGE_PROTECTED) (
+ IN CONST EFI_LEGACY_SPI_FLASH_PROTOCOL *This,
+ IN UINT32 BiosAddress,
+ IN UINT32 BlocksToProtect
+ );
+
+/**
+ Set the next protect range register.
+
+ This routine must be called at or below TPL_NOTIFY.
+ The BIOS sets the protect range register to prevent write and erase
+ operations to a portion of the SPI NOR flash device.
+
+ @param[in] This Pointer to an EFI_LEGACY_SPI_FLASH_PROTOCOL data
+ structure.
+ @param[in] BiosAddress Address within a 4 KiB block to start protecting.
+ @param[in] BlocksToProtect The number of 4 KiB blocks to protect.
+
+ @retval EFI_SUCCESS The register was successfully updated
+ @retval EFI_ACCESS_ERROR The SPI controller is locked
+ @retval EFI_INVALID_PARAMETER BiosAddress < This->BiosBaseAddress, or
+ @retval EFI_INVALID_PARAMETER BlocksToProtect * 4 KiB
+ > This->MaximumRangeBytes, or
+ BiosAddress - This->BiosBaseAddress
+ + (BlocksToProtect * 4 KiB)
+ > This->MaximumRangeBytes
+ @retval EFI_OUT_OF_RESOURCES No protect range register available
+ @retval EFI_UNSUPPORTED Call This->SetBaseAddress because the BIOS
+ base address is not set Not a legacy SPI host
+ controller
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_SPI_FLASH_PROTOCOL_PROTECT_NEXT_RANGE) (
+ IN CONST EFI_LEGACY_SPI_FLASH_PROTOCOL *This,
+ IN UINT32 BiosAddress,
+ IN UINT32 BlocksToProtect
+ );
+
+/**
+ Lock the SPI controller configuration.
+
+ This routine must be called at or below TPL_NOTIFY.
+ This routine locks the SPI controller's configuration so that the software is
+ no longer able to update:
+ * Prefix table
+ * Opcode menu
+ * Opcode type table
+ * BIOS base address
+ * Protect range registers
+
+ @param[in] This Pointer to an EFI_LEGACY_SPI_FLASH_PROTOCOL data structure.
+
+ @retval EFI_SUCCESS The SPI controller was successfully locked
+ @retval EFI_ALREADY_STARTED The SPI controller was already locked
+ @retval EFI_UNSUPPORTED Not a legacy SPI host controller
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_SPI_FLASH_PROTOCOL_LOCK_CONTROLLER) (
+ IN CONST EFI_LEGACY_SPI_FLASH_PROTOCOL *This
+ );
+
+///
+/// The EFI_LEGACY_SPI_FLASH_PROTOCOL extends the EFI_SPI_NOR_FLASH_PROTOCOL
+/// with APls to support the legacy SPI flash controller.
+///
+struct _EFI_LEGACY_SPI_FLASH_PROTOCOL {
+ ///
+ /// This protocol manipulates the SPI NOR flash parts using a common set of
+ /// commands.
+ ///
+ EFI_SPI_NOR_FLASH_PROTOCOL FlashProtocol;
+
+ //
+ // Legacy flash (SPI host) controller support
+ //
+
+ ///
+ /// Set the BIOS base address.
+ ///
+ EFI_LEGACY_SPI_FLASH_PROTOCOL_BIOS_BASE_ADDRESS BiosBaseAddress;
+
+ ///
+ /// Clear the SPI protect range registers.
+ ///
+ EFI_LEGACY_SPI_FLASH_PROTOCOL_CLEAR_SPI_PROTECT ClearSpiProtect;
+
+ ///
+ /// Determine if the SPI range is protected.
+ ///
+ EFI_LEGACY_SPI_FLASH_PROTOCOL_IS_RANGE_PROTECTED IsRangeProtected;
+
+ ///
+ /// Set the next protect range register.
+ ///
+ EFI_LEGACY_SPI_FLASH_PROTOCOL_PROTECT_NEXT_RANGE ProtectNextRange;
+
+ ///
+ /// Lock the SPI controller configuration.
+ ///
+ EFI_LEGACY_SPI_FLASH_PROTOCOL_LOCK_CONTROLLER LockController;
+};
+
+extern EFI_GUID gEfiLegacySpiFlashProtocolGuid;
+
+#endif // __LEGACY_SPI_FLASH_PROTOCOL_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiSmmController.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiSmmController.h
new file mode 100644
index 0000000000..5e1d763579
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiSmmController.h
@@ -0,0 +1,36 @@
+/** @file
+ This file defines the Legacy SPI SMM Controler Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD
+ License which accompanies this distribution. The full text of the license may
+ be found at http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI PI Specification 1.6.
+
+**/
+
+#ifndef __LEGACY_SPI_SMM_CONTROLLER_PROTOCOL_H__
+#define __LEGACY_SPI_SMM_CONTROLLER_PROTOCOL_H__
+
+#include <Protocol/LegacySpiController.h>
+
+///
+/// Global ID for the Legacy SPI SMM Controller Protocol
+///
+#define EFI_LEGACY_SPI_SMM_CONTROLLER_PROTOCOL_GUID \
+ { 0x62331b78, 0xd8d0, 0x4c8c, \
+ { 0x8c, 0xcb, 0xd2, 0x7d, 0xfe, 0x32, 0xdb, 0x9b }}
+
+typedef
+struct _EFI_LEGACY_SPI_CONTROLLER_PROTOCOL
+EFI_LEGACY_SPI_SMM_CONTROLLER_PROTOCOL;
+
+extern EFI_GUID gEfiLegacySpiSmmControllerProtocolGuid;
+
+#endif // __LEGACY_SPI_SMM_CONTROLLER_PROTOCOL_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiSmmFlash.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiSmmFlash.h
new file mode 100644
index 0000000000..a604a22f90
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LegacySpiSmmFlash.h
@@ -0,0 +1,36 @@
+/** @file
+ This file defines the Legacy SPI SMM Flash Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD
+ License which accompanies this distribution. The full text of the license may
+ be found at http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI PI Specification 1.6.
+
+**/
+
+#ifndef __LEGACY_SPI_SMM_FLASH_PROTOCOL_H__
+#define __LEGACY_SPI_SMM_FLASH_PROTOCOL_H__
+
+#include <Protocol/LegacySpiFlash.h>
+
+///
+/// Global ID for the Legacy SPI SMM Flash Protocol
+///
+#define EFI_LEGACY_SPI_SMM_FLASH_PROTOCOL_GUID \
+ { 0x5e3848d4, 0x0db5, 0x4fc0, \
+ { 0x97, 0x29, 0x3f, 0x35, 0x3d, 0x4f, 0x87, 0x9f }}
+
+typedef
+struct _EFI_LEGACY_SPI_FLASH_PROTOCOL
+EFI_LEGACY_SPI_SMM_FLASH_PROTOCOL;
+
+extern EFI_GUID gEfiLegacySpiSmmFlashProtocolGuid;
+
+#endif // __SPI_SMM_FLASH_PROTOCOL_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LoadFile.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LoadFile.h
new file mode 100644
index 0000000000..430ddb843d
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LoadFile.h
@@ -0,0 +1,88 @@
+/** @file
+ Load File protocol as defined in the UEFI 2.0 specification.
+
+ The load file protocol exists to supports the addition of new boot devices,
+ and to support booting from devices that do not map well to file system.
+ Network boot is done via a LoadFile protocol.
+
+ UEFI 2.0 can boot from any device that produces a LoadFile protocol.
+
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_LOAD_FILE_PROTOCOL_H__
+#define __EFI_LOAD_FILE_PROTOCOL_H__
+
+#define EFI_LOAD_FILE_PROTOCOL_GUID \
+ { \
+ 0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \
+ }
+
+///
+/// Protocol Guid defined by EFI1.1.
+///
+#define LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL_GUID
+
+typedef struct _EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL;
+
+///
+/// Backward-compatible with EFI1.1
+///
+typedef EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_INTERFACE;
+
+/**
+ Causes the driver to load a specified file.
+
+ @param This Protocol instance pointer.
+ @param FilePath The device specific path of the file to load.
+ @param BootPolicy If TRUE, indicates that the request originates from the
+ boot manager is attempting to load FilePath as a boot
+ selection. If FALSE, then FilePath must match as exact file
+ to be loaded.
+ @param BufferSize On input the size of Buffer in bytes. On output with a return
+ code of EFI_SUCCESS, the amount of data transferred to
+ Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,
+ the size of Buffer required to retrieve the requested file.
+ @param Buffer The memory buffer to transfer the file to. IF Buffer is NULL,
+ then the size of the requested file is returned in
+ BufferSize.
+
+ @retval EFI_SUCCESS The file was loaded.
+ @retval EFI_UNSUPPORTED The device does not support the provided BootPolicy
+ @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or
+ BufferSize is NULL.
+ @retval EFI_NO_MEDIA No medium was present to load the file.
+ @retval EFI_DEVICE_ERROR The file was not loaded due to a device error.
+ @retval EFI_NO_RESPONSE The remote system did not respond.
+ @retval EFI_NOT_FOUND The file was not found.
+ @retval EFI_ABORTED The file load process was manually cancelled.
+ @retval EFI_WARN_FILE_SYSTEM The resulting Buffer contains UEFI-compliant file system.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LOAD_FILE)(
+ IN EFI_LOAD_FILE_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
+ IN BOOLEAN BootPolicy,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer OPTIONAL
+ );
+
+///
+/// The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices.
+///
+struct _EFI_LOAD_FILE_PROTOCOL {
+ EFI_LOAD_FILE LoadFile;
+};
+
+extern EFI_GUID gEfiLoadFileProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LoadFile2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LoadFile2.h
new file mode 100644
index 0000000000..cb977fbf3e
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LoadFile2.h
@@ -0,0 +1,85 @@
+/** @file
+ Load File protocol as defined in the UEFI 2.0 specification.
+
+ Load file protocol exists to supports the addition of new boot devices,
+ and to support booting from devices that do not map well to file system.
+ Network boot is done via a LoadFile protocol.
+
+ UEFI 2.0 can boot from any device that produces a LoadFile protocol.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_LOAD_FILE2_PROTOCOL_H__
+#define __EFI_LOAD_FILE2_PROTOCOL_H__
+
+#define EFI_LOAD_FILE2_PROTOCOL_GUID \
+ { \
+ 0x4006c0c1, 0xfcb3, 0x403e, {0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d } \
+ }
+
+///
+/// Protocol Guid defined by UEFI2.1.
+///
+#define LOAD_FILE2_PROTOCOL EFI_LOAD_FILE2_PROTOCOL_GUID
+
+typedef struct _EFI_LOAD_FILE2_PROTOCOL EFI_LOAD_FILE2_PROTOCOL;
+
+
+/**
+ Causes the driver to load a specified file.
+
+ @param This Protocol instance pointer.
+ @param FilePath The device specific path of the file to load.
+ @param BootPolicy Should always be FALSE.
+ @param BufferSize On input the size of Buffer in bytes. On output with a return
+ code of EFI_SUCCESS, the amount of data transferred to
+ Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,
+ the size of Buffer required to retrieve the requested file.
+ @param Buffer The memory buffer to transfer the file to. IF Buffer is NULL,
+ then no the size of the requested file is returned in
+ BufferSize.
+
+ @retval EFI_SUCCESS The file was loaded.
+ @retval EFI_UNSUPPORTED BootPolicy is TRUE.
+ @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or
+ BufferSize is NULL.
+ @retval EFI_NO_MEDIA No medium was present to load the file.
+ @retval EFI_DEVICE_ERROR The file was not loaded due to a device error.
+ @retval EFI_NO_RESPONSE The remote system did not respond.
+ @retval EFI_NOT_FOUND The file was not found
+ @retval EFI_ABORTED The file load process was manually canceled.
+ @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current
+ directory entry. BufferSize has been updated with
+ the size needed to complete the request.
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LOAD_FILE2)(
+ IN EFI_LOAD_FILE2_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
+ IN BOOLEAN BootPolicy,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer OPTIONAL
+ );
+
+///
+/// The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices.
+///
+struct _EFI_LOAD_FILE2_PROTOCOL {
+ EFI_LOAD_FILE2 LoadFile;
+};
+
+extern EFI_GUID gEfiLoadFile2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LoadedImage.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LoadedImage.h
new file mode 100644
index 0000000000..53971bc918
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/LoadedImage.h
@@ -0,0 +1,88 @@
+/** @file
+ UEFI 2.0 Loaded image protocol definition.
+
+ Every EFI driver and application is passed an image handle when it is loaded.
+ This image handle will contain a Loaded Image Protocol.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __LOADED_IMAGE_PROTOCOL_H__
+#define __LOADED_IMAGE_PROTOCOL_H__
+
+#define EFI_LOADED_IMAGE_PROTOCOL_GUID \
+ { \
+ 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \
+ }
+
+#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \
+ { \
+ 0xbc62157e, 0x3e33, 0x4fec, {0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf } \
+ }
+
+///
+/// Protocol GUID defined in EFI1.1.
+///
+#define LOADED_IMAGE_PROTOCOL EFI_LOADED_IMAGE_PROTOCOL_GUID
+
+///
+/// EFI_SYSTEM_TABLE & EFI_IMAGE_UNLOAD are defined in EfiApi.h
+///
+#define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000
+
+///
+/// Revision defined in EFI1.1.
+///
+#define EFI_LOADED_IMAGE_INFORMATION_REVISION EFI_LOADED_IMAGE_PROTOCOL_REVISION
+
+///
+/// Can be used on any image handle to obtain information about the loaded image.
+///
+typedef struct {
+ UINT32 Revision; ///< Defines the revision of the EFI_LOADED_IMAGE_PROTOCOL structure.
+ ///< All future revisions will be backward compatible to the current revision.
+ EFI_HANDLE ParentHandle; ///< Parent image's image handle. NULL if the image is loaded directly from
+ ///< the firmware's boot manager.
+ EFI_SYSTEM_TABLE *SystemTable; ///< the image's EFI system table pointer.
+
+ //
+ // Source location of image
+ //
+ EFI_HANDLE DeviceHandle; ///< The device handle that the EFI Image was loaded from.
+ EFI_DEVICE_PATH_PROTOCOL *FilePath; ///< A pointer to the file path portion specific to DeviceHandle
+ ///< that the EFI Image was loaded from.
+ VOID *Reserved; ///< Reserved. DO NOT USE.
+
+ //
+ // Images load options
+ //
+ UINT32 LoadOptionsSize;///< The size in bytes of LoadOptions.
+ VOID *LoadOptions; ///< A pointer to the image's binary load options.
+
+ //
+ // Location of where image was loaded
+ //
+ VOID *ImageBase; ///< The base address at which the image was loaded.
+ UINT64 ImageSize; ///< The size in bytes of the loaded image.
+ EFI_MEMORY_TYPE ImageCodeType; ///< The memory type that the code sections were loaded as.
+ EFI_MEMORY_TYPE ImageDataType; ///< The memory type that the data sections were loaded as.
+ EFI_IMAGE_UNLOAD Unload;
+} EFI_LOADED_IMAGE_PROTOCOL;
+
+//
+// For backward-compatible with EFI1.1.
+//
+typedef EFI_LOADED_IMAGE_PROTOCOL EFI_LOADED_IMAGE;
+
+extern EFI_GUID gEfiLoadedImageProtocolGuid;
+extern EFI_GUID gEfiLoadedImageDevicePathProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ManagedNetwork.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ManagedNetwork.h
new file mode 100644
index 0000000000..2ac001c4f9
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ManagedNetwork.h
@@ -0,0 +1,372 @@
+/** @file
+ EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.
+ EFI_MANAGED_NETWORK_PROTOCOL as defined in UEFI 2.0.
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.0
+
+**/
+
+#ifndef __EFI_MANAGED_NETWORK_PROTOCOL_H__
+#define __EFI_MANAGED_NETWORK_PROTOCOL_H__
+
+#include <Protocol/SimpleNetwork.h>
+
+#define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0xf36ff770, 0xa7e1, 0x42cf, {0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } \
+ }
+
+#define EFI_MANAGED_NETWORK_PROTOCOL_GUID \
+ { \
+ 0x7ab33a91, 0xace5, 0x4326, { 0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16 } \
+ }
+
+typedef struct _EFI_MANAGED_NETWORK_PROTOCOL EFI_MANAGED_NETWORK_PROTOCOL;
+
+typedef struct {
+ ///
+ /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed
+ /// from the MNP receive queue will be dropped if its receive timeout expires.
+ ///
+ UINT32 ReceivedQueueTimeoutValue;
+ ///
+ /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed
+ /// from the MNP transmit queue will be dropped if its receive timeout expires.
+ ///
+ UINT32 TransmitQueueTimeoutValue;
+ ///
+ /// Ethernet type II 16-bit protocol type in host byte order. Valid
+ /// values are zero and 1,500 to 65,535.
+ ///
+ UINT16 ProtocolTypeFilter;
+ ///
+ /// Set to TRUE to receive packets that are sent to the network
+ /// device MAC address. The startup default value is FALSE.
+ ///
+ BOOLEAN EnableUnicastReceive;
+ ///
+ /// Set to TRUE to receive packets that are sent to any of the
+ /// active multicast groups. The startup default value is FALSE.
+ ///
+ BOOLEAN EnableMulticastReceive;
+ ///
+ /// Set to TRUE to receive packets that are sent to the network
+ /// device broadcast address. The startup default value is FALSE.
+ ///
+ BOOLEAN EnableBroadcastReceive;
+ ///
+ /// Set to TRUE to receive packets that are sent to any MAC address.
+ /// The startup default value is FALSE.
+ ///
+ BOOLEAN EnablePromiscuousReceive;
+ ///
+ /// Set to TRUE to drop queued packets when the configuration
+ /// is changed. The startup default value is FALSE.
+ ///
+ BOOLEAN FlushQueuesOnReset;
+ ///
+ /// Set to TRUE to timestamp all packets when they are received
+ /// by the MNP. Note that timestamps may be unsupported in some
+ /// MNP implementations. The startup default value is FALSE.
+ ///
+ BOOLEAN EnableReceiveTimestamps;
+ ///
+ /// Set to TRUE to disable background polling in this MNP
+ /// instance. Note that background polling may not be supported in
+ /// all MNP implementations. The startup default value is FALSE,
+ /// unless background polling is not supported.
+ ///
+ BOOLEAN DisableBackgroundPolling;
+} EFI_MANAGED_NETWORK_CONFIG_DATA;
+
+typedef struct {
+ EFI_TIME Timestamp;
+ EFI_EVENT RecycleEvent;
+ UINT32 PacketLength;
+ UINT32 HeaderLength;
+ UINT32 AddressLength;
+ UINT32 DataLength;
+ BOOLEAN BroadcastFlag;
+ BOOLEAN MulticastFlag;
+ BOOLEAN PromiscuousFlag;
+ UINT16 ProtocolType;
+ VOID *DestinationAddress;
+ VOID *SourceAddress;
+ VOID *MediaHeader;
+ VOID *PacketData;
+} EFI_MANAGED_NETWORK_RECEIVE_DATA;
+
+typedef struct {
+ UINT32 FragmentLength;
+ VOID *FragmentBuffer;
+} EFI_MANAGED_NETWORK_FRAGMENT_DATA;
+
+typedef struct {
+ EFI_MAC_ADDRESS *DestinationAddress; //OPTIONAL
+ EFI_MAC_ADDRESS *SourceAddress; //OPTIONAL
+ UINT16 ProtocolType; //OPTIONAL
+ UINT32 DataLength;
+ UINT16 HeaderLength; //OPTIONAL
+ UINT16 FragmentCount;
+ EFI_MANAGED_NETWORK_FRAGMENT_DATA FragmentTable[1];
+} EFI_MANAGED_NETWORK_TRANSMIT_DATA;
+
+
+typedef struct {
+ ///
+ /// This Event will be signaled after the Status field is updated
+ /// by the MNP. The type of Event must be
+ /// EFI_NOTIFY_SIGNAL. The Task Priority Level (TPL) of
+ /// Event must be lower than or equal to TPL_CALLBACK.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// The status that is returned to the caller at the end of the operation
+ /// to indicate whether this operation completed successfully.
+ ///
+ EFI_STATUS Status;
+ union {
+ ///
+ /// When this token is used for receiving, RxData is a pointer to the EFI_MANAGED_NETWORK_RECEIVE_DATA.
+ ///
+ EFI_MANAGED_NETWORK_RECEIVE_DATA *RxData;
+ ///
+ /// When this token is used for transmitting, TxData is a pointer to the EFI_MANAGED_NETWORK_TRANSMIT_DATA.
+ ///
+ EFI_MANAGED_NETWORK_TRANSMIT_DATA *TxData;
+ } Packet;
+} EFI_MANAGED_NETWORK_COMPLETION_TOKEN;
+
+/**
+ Returns the operational parameters for the current MNP child driver.
+
+ @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
+ @param MnpConfigData The pointer to storage for MNP operational parameters.
+ @param SnpModeData The pointer to storage for SNP operational parameters.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
+ @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. The default
+ values are returned in MnpConfigData if it is not NULL.
+ @retval Other The mode data could not be read.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MANAGED_NETWORK_GET_MODE_DATA)(
+ IN EFI_MANAGED_NETWORK_PROTOCOL *This,
+ OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
+ OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
+ );
+
+/**
+ Sets or clears the operational parameters for the MNP child driver.
+
+ @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
+ @param MnpConfigData The pointer to configuration data that will be assigned to the MNP
+ child driver instance. If NULL, the MNP child driver instance is
+ reset to startup defaults and all pending transmit and receive
+ requests are flushed.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES Required system resources (usually memory) could not be
+ allocated.
+ @retval EFI_UNSUPPORTED The requested feature is unsupported in this [MNP]
+ implementation.
+ @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
+ @retval Other The MNP child driver instance has been reset to startup defaults.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MANAGED_NETWORK_CONFIGURE)(
+ IN EFI_MANAGED_NETWORK_PROTOCOL *This,
+ IN EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL
+ );
+
+/**
+ Translates an IP multicast address to a hardware (MAC) multicast address.
+
+ @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
+ @param Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.
+ Set to FALSE if IpAddress is an IPv4 multicast address.
+ @param IpAddress The pointer to the multicast IP address (in network byte order) to convert.
+ @param MacAddress The pointer to the resulting multicast MAC address.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:
+ - This is NULL.
+ - IpAddress is NULL.
+ - *IpAddress is not a valid multicast IP address.
+ - MacAddress is NULL.
+ @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
+ @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
+ @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
+ @retval Other The address could not be converted.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC)(
+ IN EFI_MANAGED_NETWORK_PROTOCOL *This,
+ IN BOOLEAN Ipv6Flag,
+ IN EFI_IP_ADDRESS *IpAddress,
+ OUT EFI_MAC_ADDRESS *MacAddress
+ );
+
+/**
+ Enables and disables receive filters for multicast address.
+
+ @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
+ @param JoinFlag Set to TRUE to join this multicast group.
+ Set to FALSE to leave this multicast group.
+ @param MacAddress The pointer to the multicast MAC group (address) to join or leave.
+
+ @retval EFI_SUCCESS The requested operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - JoinFlag is TRUE and MacAddress is NULL.
+ - *MacAddress is not a valid multicast MAC address.
+ @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
+ @retval EFI_ALREADY_STARTED The supplied multicast group is already joined.
+ @retval EFI_NOT_FOUND The supplied multicast group is not joined.
+ @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
+ @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
+ @retval Other The requested operation could not be completed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MANAGED_NETWORK_GROUPS)(
+ IN EFI_MANAGED_NETWORK_PROTOCOL *This,
+ IN BOOLEAN JoinFlag,
+ IN EFI_MAC_ADDRESS *MacAddress OPTIONAL
+ );
+
+/**
+ Places asynchronous outgoing data packets into the transmit queue.
+
+ @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
+ @param Token The pointer to a token associated with the transmit data descriptor.
+
+ @retval EFI_SUCCESS The transmit completion token was cached.
+ @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_ACCESS_DENIED The transmit completion token is already in the transmit queue.
+ @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources
+ (usually memory).
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_NOT_READY The transmit request could not be queued because the transmit queue is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MANAGED_NETWORK_TRANSMIT)(
+ IN EFI_MANAGED_NETWORK_PROTOCOL *This,
+ IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token
+ );
+
+/**
+ Places an asynchronous receiving request into the receiving queue.
+
+ @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
+ @param Token The pointer to a token associated with the receive data descriptor.
+
+ @retval EFI_SUCCESS The receive completion token was cached.
+ @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token.Event is NULL.
+ @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources
+ (usually memory).
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_ACCESS_DENIED The receive completion token was already in the receive queue.
+ @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MANAGED_NETWORK_RECEIVE)(
+ IN EFI_MANAGED_NETWORK_PROTOCOL *This,
+ IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token
+ );
+
+
+/**
+ Aborts an asynchronous transmit or receive request.
+
+ @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
+ @param Token The pointer to a token that has been issued by
+ EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or
+ EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If
+ NULL, all pending tokens are aborted.
+
+ @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event
+ was signaled. When Token is NULL, all pending requests were
+ aborted and their events were signaled.
+ @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was
+ not found in the transmit or receive queue. It has either completed
+ or was not issued by Transmit() and Receive().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MANAGED_NETWORK_CANCEL)(
+ IN EFI_MANAGED_NETWORK_PROTOCOL *This,
+ IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token OPTIONAL
+ );
+
+/**
+ Polls for incoming data packets and processes outgoing data packets.
+
+ @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_NOT_READY No incoming or outgoing data was processed. Consider increasing
+ the polling rate.
+ @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
+ Consider increasing the polling rate.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MANAGED_NETWORK_POLL)(
+ IN EFI_MANAGED_NETWORK_PROTOCOL *This
+ );
+
+///
+/// The MNP is used by network applications (and drivers) to
+/// perform raw (unformatted) asynchronous network packet I/O.
+///
+struct _EFI_MANAGED_NETWORK_PROTOCOL {
+ EFI_MANAGED_NETWORK_GET_MODE_DATA GetModeData;
+ EFI_MANAGED_NETWORK_CONFIGURE Configure;
+ EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC McastIpToMac;
+ EFI_MANAGED_NETWORK_GROUPS Groups;
+ EFI_MANAGED_NETWORK_TRANSMIT Transmit;
+ EFI_MANAGED_NETWORK_RECEIVE Receive;
+ EFI_MANAGED_NETWORK_CANCEL Cancel;
+ EFI_MANAGED_NETWORK_POLL Poll;
+};
+
+extern EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid;
+extern EFI_GUID gEfiManagedNetworkProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/McaInitPmi.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/McaInitPmi.h
new file mode 100644
index 0000000000..c0c66147ea
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/McaInitPmi.h
@@ -0,0 +1,207 @@
+/** @file
+ MCA/PMI/INIT Protocol as defined in PI Specification VOLUME 4.
+
+ This protocol provides services to handle Machine Checks (MCA),
+ Initialization (INIT) events, and Platform Management Interrupt (PMI) events
+ on an Intel Itanium Processor Family based system.
+
+ Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __MCA_INIT_PMI_PROTOCOL_H__
+#define __MCA_INIT_PMI_PROTOCOL_H__
+
+///
+/// Global ID for the MCA/PMI/INIT Protocol.
+///
+#define EFI_SAL_MCA_INIT_PMI_PROTOCOL_GUID \
+ { 0xb60dc6e8, 0x3b6f, 0x11d5, {0xaf, 0x9, 0x0, 0xa0, 0xc9, 0x44, 0xa0, 0x5b} }
+
+
+///
+/// Declare forward reference for the Timer Architectural Protocol
+///
+typedef struct _EFI_SAL_MCA_INIT_PMI_PROTOCOL EFI_SAL_MCA_INIT_PMI_PROTOCOL;
+
+#pragma pack(1)
+///
+/// MCA Records Structure
+///
+typedef struct {
+ UINT64 First : 1;
+ UINT64 Last : 1;
+ UINT64 EntryCount : 16;
+ UINT64 DispatchedCount : 16;
+ UINT64 Reserved : 30;
+} SAL_MCA_COUNT_STRUCTURE;
+
+#pragma pack()
+
+/**
+ Prototype of MCA handler.
+
+ @param ModuleGlobal The context of MCA Handler
+ @param ProcessorStateParameters The processor state parameters (PSP)
+ @param MinstateBase Base address of the min-state
+ @param RendezvouseStateInformation Rendezvous state information to be passed to
+ the OS on OS MCA entry
+ @param CpuIndex Index of the logical processor
+ @param McaCountStructure Pointer to the MCA records structure
+ @param CorrectedMachineCheck This flag is set to TRUE is the MCA has been
+ corrected by the handler or by a previous handler
+
+ @retval EFI_SUCCESS Handler successfully returned
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SAL_MCA_HANDLER)(
+ IN VOID *ModuleGlobal,
+ IN UINT64 ProcessorStateParameters,
+ IN EFI_PHYSICAL_ADDRESS MinstateBase,
+ IN UINT64 RendezvouseStateInformation,
+ IN UINT64 CpuIndex,
+ IN SAL_MCA_COUNT_STRUCTURE *McaCountStructure,
+ OUT BOOLEAN *CorrectedMachineCheck
+ );
+
+/**
+ Prototype of INIT handler.
+
+ @param ModuleGlobal The context of INIT Handler
+ @param ProcessorStateParameters The processor state parameters (PSP)
+ @param MinstateBase Base address of the min-state
+ @param McaInProgress This flag indicates if an MCA is in progress
+ @param CpuIndex Index of the logical processor
+ @param McaCountStructure Pointer to the MCA records structure
+ @param DumpSwitchPressed This flag indicates the crash dump switch has been pressed
+
+ @retval EFI_SUCCESS Handler successfully returned
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SAL_INIT_HANDLER)(
+ IN VOID *ModuleGlobal,
+ IN UINT64 ProcessorStateParameters,
+ IN EFI_PHYSICAL_ADDRESS MinstateBase,
+ IN BOOLEAN McaInProgress,
+ IN UINT64 CpuIndex,
+ IN SAL_MCA_COUNT_STRUCTURE *McaCountStructure,
+ OUT BOOLEAN *DumpSwitchPressed
+ );
+
+/**
+ Prototype of PMI handler
+
+ @param ModuleGlobal The context of PMI Handler
+ @param CpuIndex Index of the logical processor
+ @param PmiVector The PMI vector number as received from the PALE_PMI exit state (GR24)
+
+ @retval EFI_SUCCESS Handler successfully returned
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SAL_PMI_HANDLER)(
+ IN VOID *ModuleGlobal,
+ IN UINT64 CpuIndex,
+ IN UINT64 PmiVector
+ );
+
+/**
+ Register a MCA handler with the MCA dispatcher.
+
+ @param This The EFI_SAL_MCA_INIT_PMI_PROTOCOL instance
+ @param McaHandler The MCA handler to register
+ @param ModuleGlobal The context of MCA Handler
+ @param MakeFirst This flag specifies the handler should be made first in the list
+ @param MakeLast This flag specifies the handler should be made last in the list
+
+ @retval EFI_SUCCESS MCA Handle was registered
+ @retval EFI_OUT_OF_RESOURCES No more resources to register an MCA handler
+ @retval EFI_INVALID_PARAMETER Invalid parameters were passed
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SAL_REGISTER_MCA_HANDLER)(
+ IN EFI_SAL_MCA_INIT_PMI_PROTOCOL *This,
+ IN EFI_SAL_MCA_HANDLER McaHandler,
+ IN VOID *ModuleGlobal,
+ IN BOOLEAN MakeFirst,
+ IN BOOLEAN MakeLast
+ );
+
+/**
+ Register an INIT handler with the INIT dispatcher.
+
+ @param This The EFI_SAL_MCA_INIT_PMI_PROTOCOL instance
+ @param InitHandler The INIT handler to register
+ @param ModuleGlobal The context of INIT Handler
+ @param MakeFirst This flag specifies the handler should be made first in the list
+ @param MakeLast This flag specifies the handler should be made last in the list
+
+ @retval EFI_SUCCESS INIT Handle was registered
+ @retval EFI_OUT_OF_RESOURCES No more resources to register an INIT handler
+ @retval EFI_INVALID_PARAMETER Invalid parameters were passed
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SAL_REGISTER_INIT_HANDLER)(
+ IN EFI_SAL_MCA_INIT_PMI_PROTOCOL *This,
+ IN EFI_SAL_INIT_HANDLER InitHandler,
+ IN VOID *ModuleGlobal,
+ IN BOOLEAN MakeFirst,
+ IN BOOLEAN MakeLast
+ );
+
+/**
+ Register a PMI handler with the PMI dispatcher.
+
+ @param This The EFI_SAL_MCA_INIT_PMI_PROTOCOL instance
+ @param PmiHandler The PMI handler to register
+ @param ModuleGlobal The context of PMI Handler
+ @param MakeFirst This flag specifies the handler should be made first in the list
+ @param MakeLast This flag specifies the handler should be made last in the list
+
+ @retval EFI_SUCCESS PMI Handle was registered
+ @retval EFI_OUT_OF_RESOURCES No more resources to register an PMI handler
+ @retval EFI_INVALID_PARAMETER Invalid parameters were passed
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SAL_REGISTER_PMI_HANDLER)(
+ IN EFI_SAL_MCA_INIT_PMI_PROTOCOL *This,
+ IN EFI_SAL_PMI_HANDLER PmiHandler,
+ IN VOID *ModuleGlobal,
+ IN BOOLEAN MakeFirst,
+ IN BOOLEAN MakeLast
+ );
+
+///
+/// This protocol is used to register MCA, INIT and PMI handlers with their respective dispatcher
+///
+struct _EFI_SAL_MCA_INIT_PMI_PROTOCOL {
+ EFI_SAL_REGISTER_MCA_HANDLER RegisterMcaHandler;
+ EFI_SAL_REGISTER_INIT_HANDLER RegisterInitHandler;
+ EFI_SAL_REGISTER_PMI_HANDLER RegisterPmiHandler;
+ BOOLEAN McaInProgress; ///< Whether MCA handler is in progress
+ BOOLEAN InitInProgress; ///< Whether Init handler is in progress
+ BOOLEAN PmiInProgress; ///< Whether Pmi handler is in progress
+};
+
+extern EFI_GUID gEfiSalMcaInitPmiProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Metronome.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Metronome.h
new file mode 100644
index 0000000000..358d94b722
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Metronome.h
@@ -0,0 +1,80 @@
+/** @file
+ Metronome Architectural Protocol as defined in PI SPEC VOLUME 2 DXE
+
+ This code abstracts the DXE core to provide delay services.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARCH_PROTOCOL_METRONOME_H__
+#define __ARCH_PROTOCOL_METRONOME_H__
+
+///
+/// Global ID for the Metronome Architectural Protocol
+///
+#define EFI_METRONOME_ARCH_PROTOCOL_GUID \
+ { 0x26baccb2, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
+
+///
+/// Declare forward reference for the Metronome Architectural Protocol
+///
+typedef struct _EFI_METRONOME_ARCH_PROTOCOL EFI_METRONOME_ARCH_PROTOCOL;
+
+/**
+ The WaitForTick() function waits for the number of ticks specified by
+ TickNumber from a known time source in the platform. If TickNumber of
+ ticks are detected, then EFI_SUCCESS is returned. The actual time passed
+ between entry of this function and the first tick is between 0 and
+ TickPeriod 100 nS units. If you want to guarantee that at least TickPeriod
+ time has elapsed, wait for two ticks. This function waits for a hardware
+ event to determine when a tick occurs. It is possible for interrupt
+ processing, or exception processing to interrupt the execution of the
+ WaitForTick() function. Depending on the hardware source for the ticks, it
+ is possible for a tick to be missed. This function cannot guarantee that
+ ticks will not be missed. If a timeout occurs waiting for the specified
+ number of ticks, then EFI_TIMEOUT is returned.
+
+ @param This The EFI_METRONOME_ARCH_PROTOCOL instance.
+ @param TickNumber Number of ticks to wait.
+
+ @retval EFI_SUCCESS The wait for the number of ticks specified by TickNumber
+ succeeded.
+ @retval EFI_TIMEOUT A timeout occurred waiting for the specified number of ticks.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_METRONOME_WAIT_FOR_TICK)(
+ IN EFI_METRONOME_ARCH_PROTOCOL *This,
+ IN UINT32 TickNumber
+ );
+
+///
+/// This protocol provides access to a known time source in the platform to the
+/// core. The core uses this known time source to produce core services that
+/// require calibrated delays.
+///
+struct _EFI_METRONOME_ARCH_PROTOCOL {
+ EFI_METRONOME_WAIT_FOR_TICK WaitForTick;
+
+ ///
+ /// The period of platform's known time source in 100 nS units.
+ /// This value on any platform must be at least 10 uS, and must not
+ /// exceed 200 uS. The value in this field is a constant that must
+ /// not be modified after the Metronome architectural protocol is
+ /// installed. All consumers must treat this as a read-only field.
+ ///
+ UINT32 TickPeriod;
+};
+
+extern EFI_GUID gEfiMetronomeArchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmAccess.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmAccess.h
new file mode 100644
index 0000000000..eb94bc529b
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmAccess.h
@@ -0,0 +1,133 @@
+/** @file
+ EFI MM Access Protocol as defined in the PI 1.5 specification.
+
+ This protocol is used to control the visibility of the MMRAM on the platform.
+ It abstracts the location and characteristics of MMRAM. The expectation is
+ that the north bridge or memory controller would publish this protocol.
+
+ The principal functionality found in the memory controller includes the following:
+ - Exposing the MMRAM to all non-MM agents, or the "open" state
+ - Shrouding the MMRAM to all but the MM agents, or the "closed" state
+ - Preserving the system integrity, or "locking" the MMRAM, such that the settings cannot be
+ perturbed by either boot service or runtime agents
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MM_ACCESS_H_
+#define _MM_ACCESS_H_
+
+#define EFI_MM_ACCESS_PROTOCOL_GUID \
+ { \
+ 0xc2702b74, 0x800c, 0x4131, {0x87, 0x46, 0x8f, 0xb5, 0xb8, 0x9c, 0xe4, 0xac } \
+ }
+
+
+typedef struct _EFI_MM_ACCESS_PROTOCOL EFI_MM_ACCESS_PROTOCOL;
+
+/**
+ Opens the MMRAM area to be accessible by a boot-service driver.
+
+ This function "opens" MMRAM so that it is visible while not inside of MM. The function should
+ return EFI_UNSUPPORTED if the hardware does not support hiding of MMRAM. The function
+ should return EFI_DEVICE_ERROR if the MMRAM configuration is locked.
+
+ @param[in] This The EFI_MM_ACCESS_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_UNSUPPORTED The system does not support opening and closing of MMRAM.
+ @retval EFI_DEVICE_ERROR MMRAM cannot be opened, perhaps because it is locked.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_OPEN)(
+ IN EFI_MM_ACCESS_PROTOCOL *This
+ );
+
+/**
+ Inhibits access to the MMRAM.
+
+ This function "closes" MMRAM so that it is not visible while outside of MM. The function should
+ return EFI_UNSUPPORTED if the hardware does not support hiding of MMRAM.
+
+ @param[in] This The EFI_MM_ACCESS_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_UNSUPPORTED The system does not support opening and closing of MMRAM.
+ @retval EFI_DEVICE_ERROR MMRAM cannot be closed.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_CLOSE)(
+ IN EFI_MM_ACCESS_PROTOCOL *This
+ );
+
+/**
+ Inhibits access to the MMRAM.
+
+ This function prohibits access to the MMRAM region. This function is usually implemented such
+ that it is a write-once operation.
+
+ @param[in] This The EFI_MM_ACCESS_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The device was successfully locked.
+ @retval EFI_UNSUPPORTED The system does not support locking of MMRAM.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_LOCK)(
+ IN EFI_MM_ACCESS_PROTOCOL *This
+ );
+
+/**
+ Queries the memory controller for the possible regions that will support MMRAM.
+
+ @param[in] This The EFI_MM_ACCESS_PROTOCOL instance.
+ @param[in,out] MmramMapSize A pointer to the size, in bytes, of the MmramMemoryMap buffer.
+ @param[in,out] MmramMap A pointer to the buffer in which firmware places the current memory map.
+
+ @retval EFI_SUCCESS The chipset supported the given resource.
+ @retval EFI_BUFFER_TOO_SMALL The MmramMap parameter was too small. The current buffer size
+ needed to hold the memory map is returned in MmramMapSize.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_CAPABILITIES)(
+ IN CONST EFI_MM_ACCESS_PROTOCOL *This,
+ IN OUT UINTN *MmramMapSize,
+ IN OUT EFI_MMRAM_DESCRIPTOR *MmramMap
+ );
+
+///
+/// EFI MM Access Protocol is used to control the visibility of the MMRAM on the platform.
+/// It abstracts the location and characteristics of MMRAM. The platform should report all
+/// MMRAM via EFI_MM_ACCESS_PROTOCOL. The expectation is that the north bridge or memory
+/// controller would publish this protocol.
+///
+struct _EFI_MM_ACCESS_PROTOCOL {
+ EFI_MM_OPEN Open;
+ EFI_MM_CLOSE Close;
+ EFI_MM_LOCK Lock;
+ EFI_MM_CAPABILITIES GetCapabilities;
+ ///
+ /// Indicates the current state of the MMRAM. Set to TRUE if MMRAM is locked.
+ ///
+ BOOLEAN LockState;
+ ///
+ /// Indicates the current state of the MMRAM. Set to TRUE if MMRAM is open.
+ ///
+ BOOLEAN OpenState;
+};
+
+extern EFI_GUID gEfiMmAccessProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmBase.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmBase.h
new file mode 100644
index 0000000000..4ce410e3f1
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmBase.h
@@ -0,0 +1,87 @@
+/** @file
+ EFI MM Base Protocol as defined in the PI 1.5 specification.
+
+ This protocol is utilized by all MM drivers to locate the MM infrastructure services and determine
+ whether the driver is being invoked inside MMRAM or outside of MMRAM.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MM_BASE_H_
+#define _MM_BASE_H_
+
+#include <Pi/PiMmCis.h>
+
+#define EFI_MM_BASE_PROTOCOL_GUID \
+ { \
+ 0xf4ccbfb7, 0xf6e0, 0x47fd, {0x9d, 0xd4, 0x10, 0xa8, 0xf1, 0x50, 0xc1, 0x91 } \
+ }
+
+typedef struct _EFI_MM_BASE_PROTOCOL EFI_MM_BASE_PROTOCOL;
+
+/**
+ Service to indicate whether the driver is currently executing in the MM Initialization phase.
+
+ This service is used to indicate whether the driver is currently executing in the MM Initialization
+ phase. For MM drivers, this will return TRUE in InMmram while inside the driver's entry point and
+ otherwise FALSE. For combination MM/DXE drivers, this will return FALSE in the DXE launch. For the
+ MM launch, it behaves as an MM driver.
+
+ @param[in] This The EFI_MM_BASE_PROTOCOL instance.
+ @param[out] InMmram Pointer to a Boolean which, on return, indicates that the driver is
+ currently executing inside of MMRAM (TRUE) or outside of MMRAM (FALSE).
+
+ @retval EFI_SUCCESS The call returned successfully.
+ @retval EFI_INVALID_PARAMETER InMmram was NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_INSIDE_OUT)(
+ IN CONST EFI_MM_BASE_PROTOCOL *This,
+ OUT BOOLEAN *InMmram
+ )
+;
+
+/**
+ Returns the location of the Management Mode Service Table (MMST).
+
+ This function returns the location of the Management Mode Service Table (MMST). The use of the
+ API is such that a driver can discover the location of the MMST in its entry point and then cache it in
+ some driver global variable so that the MMST can be invoked in subsequent handlers.
+
+ @param[in] This The EFI_MM_BASE_PROTOCOL instance.
+ @param[in,out] Mmst On return, points to a pointer to the Management Mode Service Table (MMST).
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_INVALID_PARAMETER Mmst was invalid.
+ @retval EFI_UNSUPPORTED Not in MM.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_GET_MMST_LOCATION)(
+ IN CONST EFI_MM_BASE_PROTOCOL *This,
+ IN OUT EFI_MM_SYSTEM_TABLE **Mmst
+ )
+;
+
+///
+/// EFI MM Base Protocol is utilized by all MM drivers to locate the MM infrastructure
+/// services and determine whether the driver is being invoked inside MMRAM or outside of MMRAM.
+///
+struct _EFI_MM_BASE_PROTOCOL {
+ EFI_MM_INSIDE_OUT InMm;
+ EFI_MM_GET_MMST_LOCATION GetMmstLocation;
+};
+
+extern EFI_GUID gEfiMmBaseProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmCommunication.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmCommunication.h
new file mode 100644
index 0000000000..db87dd83e4
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmCommunication.h
@@ -0,0 +1,93 @@
+/** @file
+ EFI MM Communication Protocol as defined in the PI 1.5 specification.
+
+ This protocol provides a means of communicating between drivers outside of MM and MMI
+ handlers inside of MM.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MM_COMMUNICATION_H_
+#define _MM_COMMUNICATION_H_
+
+#pragma pack(1)
+
+///
+/// To avoid confusion in interpreting frames, the communication buffer should always
+/// begin with EFI_MM_COMMUNICATE_HEADER
+///
+typedef struct {
+ ///
+ /// Allows for disambiguation of the message format.
+ ///
+ EFI_GUID HeaderGuid;
+ ///
+ /// Describes the size of Data (in bytes) and does not include the size of the header.
+ ///
+ UINTN MessageLength;
+ ///
+ /// Designates an array of bytes that is MessageLength in size.
+ ///
+ UINT8 Data[1];
+} EFI_MM_COMMUNICATE_HEADER;
+
+#pragma pack()
+
+#define EFI_MM_COMMUNICATION_PROTOCOL_GUID \
+ { \
+ 0xc68ed8e2, 0x9dc6, 0x4cbd, { 0x9d, 0x94, 0xdb, 0x65, 0xac, 0xc5, 0xc3, 0x32 } \
+ }
+
+typedef struct _EFI_MM_COMMUNICATION_PROTOCOL EFI_MM_COMMUNICATION_PROTOCOL;
+
+/**
+ Communicates with a registered handler.
+
+ This function provides a service to send and receive messages from a registered UEFI service.
+
+ @param[in] This The EFI_MM_COMMUNICATION_PROTOCOL instance.
+ @param[in] CommBuffer A pointer to the buffer to convey into MMRAM.
+ @param[in] CommSize The size of the data buffer being passed in. On exit, the size of data
+ being returned. Zero if the handler does not wish to reply with any data.
+ This parameter is optional and may be NULL.
+
+ @retval EFI_SUCCESS The message was successfully posted.
+ @retval EFI_INVALID_PARAMETER The CommBuffer was NULL.
+ @retval EFI_BAD_BUFFER_SIZE The buffer is too large for the MM implementation.
+ If this error is returned, the MessageLength field
+ in the CommBuffer header or the integer pointed by
+ CommSize, are updated to reflect the maximum payload
+ size the implementation can accommodate.
+ @retval EFI_ACCESS_DENIED The CommunicateBuffer parameter or CommSize parameter,
+ if not omitted, are in address range that cannot be
+ accessed by the MM environment.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_COMMUNICATE)(
+ IN CONST EFI_MM_COMMUNICATION_PROTOCOL *This,
+ IN OUT VOID *CommBuffer,
+ IN OUT UINTN *CommSize OPTIONAL
+ );
+
+///
+/// EFI MM Communication Protocol provides runtime services for communicating
+/// between DXE drivers and a registered MMI handler.
+///
+struct _EFI_MM_COMMUNICATION_PROTOCOL {
+ EFI_MM_COMMUNICATE Communicate;
+};
+
+extern EFI_GUID gEfiMmCommunicationProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmConfiguration.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmConfiguration.h
new file mode 100644
index 0000000000..5bb5ddfbf6
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmConfiguration.h
@@ -0,0 +1,86 @@
+/** @file
+ EFI MM Configuration Protocol as defined in the PI 1.5 specification.
+
+ This protocol is used to:
+ 1) report the portions of MMRAM regions which cannot be used for the MMRAM heap.
+ 2) register the MM Foundation entry point with the processor code. The entry
+ point will be invoked by the MM processor entry code.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MM_CONFIGURATION_H_
+#define _MM_CONFIGURATION_H_
+
+#include <Pi/PiMmCis.h>
+
+#define EFI_MM_CONFIGURATION_PROTOCOL_GUID \
+ { \
+ 0x26eeb3de, 0xb689, 0x492e, {0x80, 0xf0, 0xbe, 0x8b, 0xd7, 0xda, 0x4b, 0xa7 } \
+ }
+
+///
+/// Structure describing a MMRAM region which cannot be used for the MMRAM heap.
+///
+typedef struct _EFI_MM_RESERVED_MMRAM_REGION {
+ ///
+ /// Starting address of the reserved MMRAM area, as it appears while MMRAM is open.
+ /// Ignored if MmramReservedSize is 0.
+ ///
+ EFI_PHYSICAL_ADDRESS MmramReservedStart;
+ ///
+ /// Number of bytes occupied by the reserved MMRAM area. A size of zero indicates the
+ /// last MMRAM area.
+ ///
+ UINT64 MmramReservedSize;
+} EFI_MM_RESERVED_MMRAM_REGION;
+
+typedef struct _EFI_MM_CONFIGURATION_PROTOCOL EFI_MM_CONFIGURATION_PROTOCOL;
+
+/**
+ Register the MM Foundation entry point.
+
+ This function registers the MM Foundation entry point with the processor code. This entry point
+ will be invoked by the MM Processor entry code.
+
+ @param[in] This The EFI_MM_CONFIGURATION_PROTOCOL instance.
+ @param[in] MmEntryPoint MM Foundation entry point.
+
+ @retval EFI_SUCCESS Success to register MM Entry Point.
+ @retval EFI_INVALID_PARAMETER MmEntryPoint is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_REGISTER_MM_ENTRY)(
+ IN CONST EFI_MM_CONFIGURATION_PROTOCOL *This,
+ IN EFI_MM_ENTRY_POINT MmEntryPoint
+ );
+
+///
+/// The EFI MM Configuration Protocol is a mandatory protocol published by a DXE CPU driver to
+/// indicate which areas within MMRAM are reserved for use by the CPU for any purpose,
+/// such as stack, save state or MM entry point.
+///
+/// The RegistermmEntry() function allows the MM IPL DXE driver to register the MM
+/// Foundation entry point with the MM entry vector code.
+///
+struct _EFI_MM_CONFIGURATION_PROTOCOL {
+ ///
+ /// A pointer to an array MMRAM ranges used by the initial MM entry code.
+ ///
+ EFI_MM_RESERVED_MMRAM_REGION *MmramReservedRegions;
+ EFI_MM_REGISTER_MM_ENTRY RegisterMmEntry;
+};
+
+extern EFI_GUID gEfiMmConfigurationProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmControl.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmControl.h
new file mode 100644
index 0000000000..e1d0dc1b28
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmControl.h
@@ -0,0 +1,106 @@
+/** @file
+ EFI MM Control Protocol as defined in the PI 1.5 specification.
+
+ This protocol is used initiate synchronous MMI activations. This protocol could be published by a
+ processor driver to abstract the MMI IPI or a driver which abstracts the ASIC that is supporting the
+ APM port. Because of the possibility of performing MMI IPI transactions, the ability to generate this
+ event from a platform chipset agent is an optional capability for both IA-32 and x64-based systems.
+
+ The EFI_MM_CONTROL_PROTOCOL is produced by a runtime driver. It provides an
+ abstraction of the platform hardware that generates an MMI. There are often I/O ports that, when
+ accessed, will generate the MMI. Also, the hardware optionally supports the periodic generation of
+ these signals.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MM_CONTROL_H_
+#define _MM_CONTROL_H_
+
+#include <PiDxe.h>
+
+#define EFI_MM_CONTROL_PROTOCOL_GUID \
+ { \
+ 0x843dc720, 0xab1e, 0x42cb, {0x93, 0x57, 0x8a, 0x0, 0x78, 0xf3, 0x56, 0x1b} \
+ }
+
+typedef struct _EFI_MM_CONTROL_PROTOCOL EFI_MM_CONTROL_PROTOCOL;
+typedef UINTN EFI_MM_PERIOD;
+
+/**
+ Invokes MMI activation from either the preboot or runtime environment.
+
+ This function generates an MMI.
+
+ @param[in] This The EFI_MM_CONTROL_PROTOCOL instance.
+ @param[in,out] CommandPort The value written to the command port.
+ @param[in,out] DataPort The value written to the data port.
+ @param[in] Periodic Optional mechanism to engender a periodic stream.
+ @param[in] ActivationInterval Optional parameter to repeat at this period one
+ time or, if the Periodic Boolean is set, periodically.
+
+ @retval EFI_SUCCESS The MMI/PMI has been engendered.
+ @retval EFI_DEVICE_ERROR The timing is unsupported.
+ @retval EFI_INVALID_PARAMETER The activation period is unsupported.
+ @retval EFI_INVALID_PARAMETER The last periodic activation has not been cleared.
+ @retval EFI_NOT_STARTED The MM base service has not been initialized.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_ACTIVATE)(
+ IN CONST EFI_MM_CONTROL_PROTOCOL *This,
+ IN OUT UINT8 *CommandPort OPTIONAL,
+ IN OUT UINT8 *DataPort OPTIONAL,
+ IN BOOLEAN Periodic OPTIONAL,
+ IN UINTN ActivationInterval OPTIONAL
+ );
+
+/**
+ Clears any system state that was created in response to the Trigger() call.
+
+ This function acknowledges and causes the deassertion of the MMI activation source.
+
+ @param[in] This The EFI_MM_CONTROL_PROTOCOL instance.
+ @param[in] Periodic Optional parameter to repeat at this period one time
+
+ @retval EFI_SUCCESS The MMI/PMI has been engendered.
+ @retval EFI_DEVICE_ERROR The source could not be cleared.
+ @retval EFI_INVALID_PARAMETER The service did not support the Periodic input argument.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_DEACTIVATE)(
+ IN CONST EFI_MM_CONTROL_PROTOCOL *This,
+ IN BOOLEAN Periodic OPTIONAL
+ );
+
+///
+/// The EFI_MM_CONTROL_PROTOCOL is produced by a runtime driver. It provides an
+/// abstraction of the platform hardware that generates an MMI. There are often I/O ports that, when
+/// accessed, will generate the MMI. Also, the hardware optionally supports the periodic generation of
+/// these signals.
+///
+struct _EFI_MM_CONTROL_PROTOCOL {
+ EFI_MM_ACTIVATE Trigger;
+ EFI_MM_DEACTIVATE Clear;
+ ///
+ /// Minimum interval at which the platform can set the period. A maximum is not
+ /// specified in that the MM infrastructure code can emulate a maximum interval that is
+ /// greater than the hardware capabilities by using software emulation in the MM
+ /// infrastructure code.
+ ///
+ EFI_MM_PERIOD MinimumTriggerPeriod;
+};
+
+extern EFI_GUID gEfiMmControlProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmCpu.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmCpu.h
new file mode 100644
index 0000000000..9670cda9c8
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmCpu.h
@@ -0,0 +1,247 @@
+/** @file
+ EFI MM CPU Protocol as defined in the PI 1.5 specification.
+
+ This protocol allows MM drivers to access architecture-standard registers from any of the CPU
+ save state areas. In some cases, difference processors provide the same information in the save state,
+ but not in the same format. These so-called pseudo-registers provide this information in a standard
+ format.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MM_CPU_H_
+#define _MM_CPU_H_
+
+#define EFI_MM_CPU_PROTOCOL_GUID \
+ { \
+ 0xeb346b97, 0x975f, 0x4a9f, { 0x8b, 0x22, 0xf8, 0xe9, 0x2b, 0xb3, 0xd5, 0x69 } \
+ }
+
+///
+/// Save State register index
+///
+typedef enum {
+ ///
+ /// x86/X64 standard registers
+ ///
+ EFI_MM_SAVE_STATE_REGISTER_GDTBASE = 4,
+ EFI_MM_SAVE_STATE_REGISTER_IDTBASE = 5,
+ EFI_MM_SAVE_STATE_REGISTER_LDTBASE = 6,
+ EFI_MM_SAVE_STATE_REGISTER_GDTLIMIT = 7,
+ EFI_MM_SAVE_STATE_REGISTER_IDTLIMIT = 8,
+ EFI_MM_SAVE_STATE_REGISTER_LDTLIMIT = 9,
+ EFI_MM_SAVE_STATE_REGISTER_LDTINFO = 10,
+ EFI_MM_SAVE_STATE_REGISTER_ES = 20,
+ EFI_MM_SAVE_STATE_REGISTER_CS = 21,
+ EFI_MM_SAVE_STATE_REGISTER_SS = 22,
+ EFI_MM_SAVE_STATE_REGISTER_DS = 23,
+ EFI_MM_SAVE_STATE_REGISTER_FS = 24,
+ EFI_MM_SAVE_STATE_REGISTER_GS = 25,
+ EFI_MM_SAVE_STATE_REGISTER_LDTR_SEL = 26,
+ EFI_MM_SAVE_STATE_REGISTER_TR_SEL = 27,
+ EFI_MM_SAVE_STATE_REGISTER_DR7 = 28,
+ EFI_MM_SAVE_STATE_REGISTER_DR6 = 29,
+ EFI_MM_SAVE_STATE_REGISTER_R8 = 30,
+ EFI_MM_SAVE_STATE_REGISTER_R9 = 31,
+ EFI_MM_SAVE_STATE_REGISTER_R10 = 32,
+ EFI_MM_SAVE_STATE_REGISTER_R11 = 33,
+ EFI_MM_SAVE_STATE_REGISTER_R12 = 34,
+ EFI_MM_SAVE_STATE_REGISTER_R13 = 35,
+ EFI_MM_SAVE_STATE_REGISTER_R14 = 36,
+ EFI_MM_SAVE_STATE_REGISTER_R15 = 37,
+ EFI_MM_SAVE_STATE_REGISTER_RAX = 38,
+ EFI_MM_SAVE_STATE_REGISTER_RBX = 39,
+ EFI_MM_SAVE_STATE_REGISTER_RCX = 40,
+ EFI_MM_SAVE_STATE_REGISTER_RDX = 41,
+ EFI_MM_SAVE_STATE_REGISTER_RSP = 42,
+ EFI_MM_SAVE_STATE_REGISTER_RBP = 43,
+ EFI_MM_SAVE_STATE_REGISTER_RSI = 44,
+ EFI_MM_SAVE_STATE_REGISTER_RDI = 45,
+ EFI_MM_SAVE_STATE_REGISTER_RIP = 46,
+ EFI_MM_SAVE_STATE_REGISTER_RFLAGS = 51,
+ EFI_MM_SAVE_STATE_REGISTER_CR0 = 52,
+ EFI_MM_SAVE_STATE_REGISTER_CR3 = 53,
+ EFI_MM_SAVE_STATE_REGISTER_CR4 = 54,
+ EFI_MM_SAVE_STATE_REGISTER_FCW = 256,
+ EFI_MM_SAVE_STATE_REGISTER_FSW = 257,
+ EFI_MM_SAVE_STATE_REGISTER_FTW = 258,
+ EFI_MM_SAVE_STATE_REGISTER_OPCODE = 259,
+ EFI_MM_SAVE_STATE_REGISTER_FP_EIP = 260,
+ EFI_MM_SAVE_STATE_REGISTER_FP_CS = 261,
+ EFI_MM_SAVE_STATE_REGISTER_DATAOFFSET = 262,
+ EFI_MM_SAVE_STATE_REGISTER_FP_DS = 263,
+ EFI_MM_SAVE_STATE_REGISTER_MM0 = 264,
+ EFI_MM_SAVE_STATE_REGISTER_MM1 = 265,
+ EFI_MM_SAVE_STATE_REGISTER_MM2 = 266,
+ EFI_MM_SAVE_STATE_REGISTER_MM3 = 267,
+ EFI_MM_SAVE_STATE_REGISTER_MM4 = 268,
+ EFI_MM_SAVE_STATE_REGISTER_MM5 = 269,
+ EFI_MM_SAVE_STATE_REGISTER_MM6 = 270,
+ EFI_MM_SAVE_STATE_REGISTER_MM7 = 271,
+ EFI_MM_SAVE_STATE_REGISTER_XMM0 = 272,
+ EFI_MM_SAVE_STATE_REGISTER_XMM1 = 273,
+ EFI_MM_SAVE_STATE_REGISTER_XMM2 = 274,
+ EFI_MM_SAVE_STATE_REGISTER_XMM3 = 275,
+ EFI_MM_SAVE_STATE_REGISTER_XMM4 = 276,
+ EFI_MM_SAVE_STATE_REGISTER_XMM5 = 277,
+ EFI_MM_SAVE_STATE_REGISTER_XMM6 = 278,
+ EFI_MM_SAVE_STATE_REGISTER_XMM7 = 279,
+ EFI_MM_SAVE_STATE_REGISTER_XMM8 = 280,
+ EFI_MM_SAVE_STATE_REGISTER_XMM9 = 281,
+ EFI_MM_SAVE_STATE_REGISTER_XMM10 = 282,
+ EFI_MM_SAVE_STATE_REGISTER_XMM11 = 283,
+ EFI_MM_SAVE_STATE_REGISTER_XMM12 = 284,
+ EFI_MM_SAVE_STATE_REGISTER_XMM13 = 285,
+ EFI_MM_SAVE_STATE_REGISTER_XMM14 = 286,
+ EFI_MM_SAVE_STATE_REGISTER_XMM15 = 287,
+ ///
+ /// Pseudo-Registers
+ ///
+ EFI_MM_SAVE_STATE_REGISTER_IO = 512,
+ EFI_MM_SAVE_STATE_REGISTER_LMA = 513,
+ EFI_MM_SAVE_STATE_REGISTER_PROCESSOR_ID = 514
+} EFI_MM_SAVE_STATE_REGISTER;
+
+///
+/// The EFI_MM_SAVE_STATE_REGISTER_LMA pseudo-register values
+/// If the processor acts in 32-bit mode at the time the MMI occurred, the pseudo register value
+/// EFI_MM_SAVE_STATE_REGISTER_LMA_32BIT is returned in Buffer. Otherwise,
+/// EFI_MM_SAVE_STATE_REGISTER_LMA_64BIT is returned in Buffer.
+///
+#define EFI_MM_SAVE_STATE_REGISTER_LMA_32BIT 32
+#define EFI_MM_SAVE_STATE_REGISTER_LMA_64BIT 64
+
+///
+/// Size width of I/O instruction
+///
+typedef enum {
+ EFI_MM_SAVE_STATE_IO_WIDTH_UINT8 = 0,
+ EFI_MM_SAVE_STATE_IO_WIDTH_UINT16 = 1,
+ EFI_MM_SAVE_STATE_IO_WIDTH_UINT32 = 2,
+ EFI_MM_SAVE_STATE_IO_WIDTH_UINT64 = 3
+} EFI_MM_SAVE_STATE_IO_WIDTH;
+
+///
+/// Types of I/O instruction
+///
+typedef enum {
+ EFI_MM_SAVE_STATE_IO_TYPE_INPUT = 1,
+ EFI_MM_SAVE_STATE_IO_TYPE_OUTPUT = 2,
+ EFI_MM_SAVE_STATE_IO_TYPE_STRING = 4,
+ EFI_MM_SAVE_STATE_IO_TYPE_REP_PREFIX = 8
+} EFI_MM_SAVE_STATE_IO_TYPE;
+
+///
+/// Structure of the data which is returned when ReadSaveState() is called with
+/// EFI_MM_SAVE_STATE_REGISTER_IO. If there was no I/O then ReadSaveState() will
+/// return EFI_NOT_FOUND.
+///
+/// This structure describes the I/O operation which was in process when the MMI was generated.
+///
+typedef struct _EFI_MM_SAVE_STATE_IO_INFO {
+ ///
+ /// For input instruction (IN, INS), this is data read before the MMI occurred. For output
+ /// instructions (OUT, OUTS) this is data that was written before the MMI occurred. The
+ /// width of the data is specified by IoWidth.
+ ///
+ UINT64 IoData;
+ ///
+ /// The I/O port that was being accessed when the MMI was triggered.
+ ///
+ UINT16 IoPort;
+ ///
+ /// Defines the size width (UINT8, UINT16, UINT32, UINT64) for IoData.
+ ///
+ EFI_MM_SAVE_STATE_IO_WIDTH IoWidth;
+ ///
+ /// Defines type of I/O instruction.
+ ///
+ EFI_MM_SAVE_STATE_IO_TYPE IoType;
+} EFI_MM_SAVE_STATE_IO_INFO;
+
+typedef struct _EFI_MM_CPU_PROTOCOL EFI_MM_CPU_PROTOCOL;
+
+/**
+ Read data from the CPU save state.
+
+ This function is used to read the specified number of bytes of the specified register from the CPU
+ save state of the specified CPU and place the value into the buffer. If the CPU does not support the
+ specified register Register, then EFI_NOT_FOUND should be returned. If the CPU does not
+ support the specified register width Width, then EFI_INVALID_PARAMETER is returned.
+
+ @param[in] This The EFI_MM_CPU_PROTOCOL instance.
+ @param[in] Width The number of bytes to read from the CPU save state.
+ @param[in] Register Specifies the CPU register to read form the save state.
+ @param[in] CpuIndex Specifies the zero-based index of the CPU save state.
+ @param[out] Buffer Upon return, this holds the CPU register value read from the save state.
+
+ @retval EFI_SUCCESS The register was read from Save State.
+ @retval EFI_NOT_FOUND The register is not defined for the Save State of Processor.
+ @retval EFI_INVALID_PARAMETER Input parameters are not valid, for example, Processor No or register width
+ is not correct.This or Buffer is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_READ_SAVE_STATE)(
+ IN CONST EFI_MM_CPU_PROTOCOL *This,
+ IN UINTN Width,
+ IN EFI_MM_SAVE_STATE_REGISTER Register,
+ IN UINTN CpuIndex,
+ OUT VOID *Buffer
+ );
+
+
+/**
+ Write data to the CPU save state.
+
+ This function is used to write the specified number of bytes of the specified register to the CPU save
+ state of the specified CPU and place the value into the buffer. If the CPU does not support the
+ specified register Register, then EFI_UNSUPPORTED should be returned. If the CPU does not
+ support the specified register width Width, then EFI_INVALID_PARAMETER is returned.
+
+ @param[in] This The EFI_MM_CPU_PROTOCOL instance.
+ @param[in] Width The number of bytes to write to the CPU save state.
+ @param[in] Register Specifies the CPU register to write to the save state.
+ @param[in] CpuIndex Specifies the zero-based index of the CPU save state.
+ @param[in] Buffer Upon entry, this holds the new CPU register value.
+
+ @retval EFI_SUCCESS The register was written to Save State.
+ @retval EFI_NOT_FOUND The register is not defined for the Save State of Processor.
+ @retval EFI_INVALID_PARAMETER Input parameters are not valid. For example:
+ ProcessorIndex or Width is not correct.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_WRITE_SAVE_STATE)(
+ IN CONST EFI_MM_CPU_PROTOCOL *This,
+ IN UINTN Width,
+ IN EFI_MM_SAVE_STATE_REGISTER Register,
+ IN UINTN CpuIndex,
+ IN CONST VOID *Buffer
+ );
+
+///
+/// EFI MM CPU Protocol provides access to CPU-related information while in MM.
+///
+/// This protocol allows MM drivers to access architecture-standard registers from any of the CPU
+/// save state areas. In some cases, difference processors provide the same information in the save state,
+/// but not in the same format. These so-called pseudo-registers provide this information in a standard
+/// format.
+///
+struct _EFI_MM_CPU_PROTOCOL {
+ EFI_MM_READ_SAVE_STATE ReadSaveState;
+ EFI_MM_WRITE_SAVE_STATE WriteSaveState;
+};
+
+extern EFI_GUID gEfiMmCpuProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmCpuIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmCpuIo.h
new file mode 100644
index 0000000000..4298cf4b50
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmCpuIo.h
@@ -0,0 +1,96 @@
+/** @file
+ MM CPU I/O 2 protocol as defined in the PI 1.5 specification.
+
+ This protocol provides CPU I/O and memory access within MM.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MM_CPU_IO_H_
+#define _MM_CPU_IO_H_
+
+#define EFI_MM_CPU_IO_PROTOCOL_GUID \
+ { \
+ 0x3242A9D8, 0xCE70, 0x4AA0, { 0x95, 0x5D, 0x5E, 0x7B, 0x14, 0x0D, 0xE4, 0xD2 } \
+ }
+
+typedef struct _EFI_MM_CPU_IO_PROTOCOL EFI_MM_CPU_IO_PROTOCOL;
+
+///
+/// Width of the MM CPU I/O operations
+///
+typedef enum {
+ MM_IO_UINT8 = 0,
+ MM_IO_UINT16 = 1,
+ MM_IO_UINT32 = 2,
+ MM_IO_UINT64 = 3
+} EFI_MM_IO_WIDTH;
+
+/**
+ Provides the basic memory and I/O interfaces used toabstract accesses to devices.
+
+ The I/O operations are carried out exactly as requested. The caller is
+ responsible for any alignment and I/O width issues that the bus, device,
+ platform, or type of I/O might require.
+
+ @param[in] This The EFI_MM_CPU_IO_PROTOCOL instance.
+ @param[in] Width Signifies the width of the I/O operations.
+ @param[in] Address The base address of the I/O operations. The caller is
+ responsible for aligning the Address if required.
+ @param[in] Count The number of I/O operations to perform.
+ @param[in,out] Buffer For read operations, the destination buffer to store
+ the results. For write operations, the source buffer
+ from which to write data.
+
+ @retval EFI_SUCCESS The data was read from or written to the device.
+ @retval EFI_UNSUPPORTED The Address is not valid for this system.
+ @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack
+ of resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_CPU_IO)(
+ IN CONST EFI_MM_CPU_IO_PROTOCOL *This,
+ IN EFI_MM_IO_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+ );
+
+typedef struct {
+ ///
+ /// This service provides the various modalities of memory and I/O read.
+ ///
+ EFI_MM_CPU_IO Read;
+ ///
+ /// This service provides the various modalities of memory and I/O write.
+ ///
+ EFI_MM_CPU_IO Write;
+} EFI_MM_IO_ACCESS;
+
+///
+/// MM CPU I/O Protocol provides CPU I/O and memory access within MM.
+///
+struct _EFI_MM_CPU_IO_PROTOCOL {
+ ///
+ /// Allows reads and writes to memory-mapped I/O space.
+ ///
+ EFI_MM_IO_ACCESS Mem;
+ ///
+ /// Allows reads and writes to I/O space.
+ ///
+ EFI_MM_IO_ACCESS Io;
+};
+
+extern EFI_GUID gEfiMmCpuIoProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmEndOfDxe.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmEndOfDxe.h
new file mode 100644
index 0000000000..743eea36bb
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmEndOfDxe.h
@@ -0,0 +1,30 @@
+/** @file
+ MM End Of Dxe protocol introduced in the PI 1.5 specification.
+
+ This protocol is a mandatory protocol published by MM Foundation code.
+ This protocol is an MM counterpart of the End of DXE Event.
+ This protocol prorogates End of DXE notification into MM environment.
+ This protocol is installed prior to installation of the MM Ready to Lock Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MM_END_OF_DXE_H_
+#define _MM_END_OF_DXE_H_
+
+#define EFI_MM_END_OF_DXE_PROTOCOL_GUID \
+ { \
+ 0x24e70042, 0xd5c5, 0x4260, { 0x8c, 0x39, 0xa, 0xd3, 0xaa, 0x32, 0xe9, 0x3d } \
+ }
+
+extern EFI_GUID gEfiMmEndOfDxeProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmGpiDispatch.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmGpiDispatch.h
new file mode 100644
index 0000000000..9a4307249b
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmGpiDispatch.h
@@ -0,0 +1,125 @@
+/** @file
+ MM General Purpose Input (GPI) Dispatch Protocol as defined in PI 1.5 Specification
+ Volume 4 Management Mode Core Interface.
+
+ This protocol provides the parent dispatch service for the General Purpose Input
+ (GPI) MMI source generator.
+
+ The EFI_MM_GPI_DISPATCH_PROTOCOL provides the ability to install child handlers for the
+ given event types. Several inputs can be enabled. This purpose of this interface is to generate an
+ MMI in response to any of these inputs having a true value provided.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.5.
+
+**/
+
+#ifndef _MM_GPI_DISPATCH_H_
+#define _MM_GPI_DISPATCH_H_
+
+#include <Pi/PiMmCis.h>
+
+#define EFI_MM_GPI_DISPATCH_PROTOCOL_GUID \
+ { \
+ 0x25566b03, 0xb577, 0x4cbf, {0x95, 0x8c, 0xed, 0x66, 0x3e, 0xa2, 0x43, 0x80 } \
+ }
+
+///
+/// The dispatch function's context.
+///
+typedef struct {
+ ///
+ /// A number from one of 2^64 possible GPIs that can generate an MMI. A
+ /// 0 corresponds to logical GPI[0]; 1 corresponds to logical GPI[1]; and
+ /// GpiNum of N corresponds to GPI[N], where N can span from 0 to 2^64-1.
+ ///
+ UINT64 GpiNum;
+} EFI_MM_GPI_REGISTER_CONTEXT;
+
+typedef struct _EFI_MM_GPI_DISPATCH_PROTOCOL EFI_MM_GPI_DISPATCH_PROTOCOL;
+
+/**
+ Registers a child MMI source dispatch function with a parent MM driver.
+
+ This service registers a function (DispatchFunction) which will be called when an MMI is
+ generated because of one or more of the GPIs specified by RegisterContext. On return,
+ DispatchHandle contains a unique handle which may be used later to unregister the function
+ using UnRegister().
+ The DispatchFunction will be called with Context set to the same value as was passed into
+ this function in RegisterContext and with CommBuffer pointing to another instance of
+ EFI_MM_GPI_REGISTER_CONTEXT describing the GPIs which actually caused the MMI and
+ CommBufferSize pointing to the size of the structure.
+
+ @param[in] This Pointer to the EFI_MM_GPI_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchFunction Function to register for handler when the specified GPI causes an MMI.
+ @param[in] RegisterContext Pointer to the dispatch function's context.
+ The caller fills this context in before calling
+ the register function to indicate to the register
+ function the GPI(s) for which the dispatch function
+ should be invoked.
+ @param[out] DispatchHandle Handle generated by the dispatcher to track the
+ function instance.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully
+ registered and the MMI source has been enabled.
+ @retval EFI_DEVICE_ERROR The driver was unable to enable the MMI source.
+ @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The GPI input value
+ is not within valid range.
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this child.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_GPI_REGISTER)(
+ IN CONST EFI_MM_GPI_DISPATCH_PROTOCOL *This,
+ IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,
+ IN CONST EFI_MM_GPI_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+ );
+
+/**
+ Unregisters a General Purpose Input (GPI) service.
+
+ This service removes the handler associated with DispatchHandle so that it will no longer be
+ called when the GPI triggers an MMI.
+
+ @param[in] This Pointer to the EFI_MM_GPI_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchHandle Handle of the service to remove.
+
+ @retval EFI_SUCCESS Handle of the service to remove.
+ @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_GPI_UNREGISTER)(
+ IN CONST EFI_MM_GPI_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+ );
+
+///
+/// Interface structure for the MM GPI MMI Dispatch Protocol
+///
+/// The MM GPI MMI Dispatch Protocol provides the parent dispatch service
+/// for the General Purpose Input (GPI) MMI source generator.
+///
+struct _EFI_MM_GPI_DISPATCH_PROTOCOL {
+ EFI_MM_GPI_REGISTER Register;
+ EFI_MM_GPI_UNREGISTER UnRegister;
+ ///
+ /// Denotes the maximum value of inputs that can have handlers attached.
+ ///
+ UINTN NumSupportedGpis;
+};
+
+extern EFI_GUID gEfiMmGpiDispatchProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmIoTrapDispatch.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmIoTrapDispatch.h
new file mode 100644
index 0000000000..dec60bf4c6
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmIoTrapDispatch.h
@@ -0,0 +1,136 @@
+/** @file
+ MM IO Trap Dispatch Protocol as defined in PI 1.5 Specification
+ Volume 4 Management Mode Core Interface.
+
+ This protocol provides a parent dispatch service for IO trap MMI sources.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.5.
+
+**/
+
+#ifndef _MM_IO_TRAP_DISPATCH_H_
+#define _MM_IO_TRAP_DISPATCH_H_
+
+#include <Pi/PiMmCis.h>
+
+#define EFI_MM_IO_TRAP_DISPATCH_PROTOCOL_GUID \
+ { \
+ 0x58dc368d, 0x7bfa, 0x4e77, {0xab, 0xbc, 0xe, 0x29, 0x41, 0x8d, 0xf9, 0x30 } \
+ }
+
+///
+/// IO Trap valid types
+///
+typedef enum {
+ WriteTrap,
+ ReadTrap,
+ ReadWriteTrap,
+ IoTrapTypeMaximum
+} EFI_MM_IO_TRAP_DISPATCH_TYPE;
+
+///
+/// IO Trap context structure containing information about the
+/// IO trap event that should invoke the handler
+///
+typedef struct {
+ UINT16 Address;
+ UINT16 Length;
+ EFI_MM_IO_TRAP_DISPATCH_TYPE Type;
+} EFI_MM_IO_TRAP_REGISTER_CONTEXT;
+
+///
+/// IO Trap context structure containing information about the IO trap that occurred
+///
+typedef struct {
+ UINT32 WriteData;
+} EFI_MM_IO_TRAP_CONTEXT;
+
+typedef struct _EFI_MM_IO_TRAP_DISPATCH_PROTOCOL EFI_MM_IO_TRAP_DISPATCH_PROTOCOL;
+
+/**
+ Register an IO trap MMI child handler for a specified MMI.
+
+ This service registers a function (DispatchFunction) which will be called when an MMI is
+ generated because of an access to an I/O port specified by RegisterContext. On return,
+ DispatchHandle contains a unique handle which may be used later to unregister the function
+ using UnRegister(). If the base of the I/O range specified is zero, then an I/O range with the
+ specified length and characteristics will be allocated and the Address field in RegisterContext
+ updated. If no range could be allocated, then EFI_OUT_OF_RESOURCES will be returned.
+
+ The service will not perform GCD allocation if the base address is non-zero or
+ EFI_MM_READY_TO_LOCK has been installed. In this case, the caller is responsible for the
+ existence and allocation of the specific IO range.
+ An error may be returned if some or all of the requested resources conflict with an existing IO trap
+ child handler.
+
+ It is not required that implementations will allow multiple children for a single IO trap MMI source.
+ Some implementations may support multiple children.
+ The DispatchFunction will be called with Context updated to contain information
+ concerning the I/O action that actually happened and is passed in RegisterContext, with
+ CommBuffer pointing to the data actually written and CommBufferSize pointing to the size of
+ the data in CommBuffer.
+
+ @param[in] This Pointer to the EFI_MM_IO_TRAP_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchFunction Function to register for handler when I/O trap location is accessed.
+ @param[in] RegisterContext Pointer to the dispatch function's context. The caller fills this
+ context in before calling the register function to indicate to the register
+ function the IO trap MMI source for which the dispatch function should be invoked.
+ @param[out] DispatchHandle Handle of the dispatch function, for when interfacing with the parent MM driver.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully registered.
+ @retval EFI_DEVICE_ERROR The driver was unable to complete due to hardware error.
+ @retval EFI_OUT_OF_RESOURCES Insufficient resources are available to fulfill the IO trap range request.
+ @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The input value is not within a valid range.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_IO_TRAP_DISPATCH_REGISTER)(
+ IN CONST EFI_MM_IO_TRAP_DISPATCH_PROTOCOL *This,
+ IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,
+ IN OUT EFI_MM_IO_TRAP_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+ );
+
+/**
+ Unregister a child MMI source dispatch function with a parent MM driver.
+
+ This service removes a previously installed child dispatch handler. This does not guarantee that the
+ system resources will be freed from the GCD.
+
+ @param[in] This Pointer to the EFI_MM_IO_TRAP_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchHandle Handle of the child service to remove.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully unregistered.
+ @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_IO_TRAP_DISPATCH_UNREGISTER)(
+ IN CONST EFI_MM_IO_TRAP_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+ );
+
+///
+/// Interface structure for the MM IO Trap Dispatch Protocol.
+///
+/// This protocol provides a parent dispatch service for IO trap MMI sources.
+///
+struct _EFI_MM_IO_TRAP_DISPATCH_PROTOCOL {
+ EFI_MM_IO_TRAP_DISPATCH_REGISTER Register;
+ EFI_MM_IO_TRAP_DISPATCH_UNREGISTER UnRegister;
+};
+
+extern EFI_GUID gEfiMmIoTrapDispatchProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmPciRootBridgeIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmPciRootBridgeIo.h
new file mode 100644
index 0000000000..fef33a2c60
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmPciRootBridgeIo.h
@@ -0,0 +1,37 @@
+/** @file
+ MM PCI Root Bridge IO protocol as defined in the PI 1.5 specification.
+
+ This protocol provides PCI I/O and memory access within MM.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MM_PCI_ROOT_BRIDGE_IO_H_
+#define _MM_PCI_ROOT_BRIDGE_IO_H_
+
+#include <Protocol/PciRootBridgeIo.h>
+
+#define EFI_MM_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \
+ { \
+ 0x8bc1714d, 0xffcb, 0x41c3, { 0x89, 0xdc, 0x6c, 0x74, 0xd0, 0x6d, 0x98, 0xea } \
+ }
+
+///
+/// This protocol provides the same functionality as the PCI Root Bridge I/O Protocol defined in the
+/// UEFI 2.1 Specifcation, section 13.2, except that the functions for Map() and Unmap() may return
+/// EFI_UNSUPPORTED.
+///
+typedef EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL EFI_MM_PCI_ROOT_BRIDGE_IO_PROTOCOL;
+
+extern EFI_GUID gEfiMmPciRootBridgeIoProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmPeriodicTimerDispatch.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmPeriodicTimerDispatch.h
new file mode 100644
index 0000000000..49820219f8
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmPeriodicTimerDispatch.h
@@ -0,0 +1,170 @@
+/** @file
+ MM Periodic Timer Dispatch Protocol as defined in PI 1.5 Specification
+ Volume 4 Management Mode Core Interface.
+
+ This protocol provides the parent dispatch service for the periodical timer MMI source generator.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.5.
+
+**/
+
+#ifndef _MM_PERIODIC_TIMER_DISPATCH_H_
+#define _MM_PERIODIC_TIMER_DISPATCH_H_
+
+#include <Pi/PiMmCis.h>
+
+#define EFI_MM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID \
+ { \
+ 0x4cec368e, 0x8e8e, 0x4d71, {0x8b, 0xe1, 0x95, 0x8c, 0x45, 0xfc, 0x8a, 0x53 } \
+ }
+
+///
+/// Example: A chipset supports periodic MMIs on every 64ms or 2 seconds.
+/// A child wishes schedule a period MMI to fire on a period of 3 seconds, there
+/// are several ways to approach the problem:
+/// 1. The child may accept a 4 second periodic rate, in which case it registers with
+/// Period = 40000
+/// MmiTickInterval = 20000
+/// The resulting MMI will occur every 2 seconds with the child called back on
+/// every 2nd MMI.
+/// NOTE: the same result would occur if the child set MmiTickInterval = 0.
+/// 2. The child may choose the finer granularity MMI (64ms):
+/// Period = 30000
+/// MmiTickInterval = 640
+/// The resulting MMI will occur every 64ms with the child called back on
+/// every 47th MMI.
+/// NOTE: the child driver should be aware that this will result in more
+/// MMIs occuring during system runtime which can negatively impact system
+/// performance.
+///
+typedef struct {
+ ///
+ /// The minimum period of time in 100 nanosecond units that the child gets called. The
+ /// child will be called back after a time greater than the time Period.
+ ///
+ UINT64 Period;
+ ///
+ /// The period of time interval between MMIs. Children of this interface should use this
+ /// field when registering for periodic timer intervals when a finer granularity periodic
+ /// MMI is desired.
+ ///
+ UINT64 MmiTickInterval;
+} EFI_MM_PERIODIC_TIMER_REGISTER_CONTEXT;
+
+///
+/// The DispatchFunction will be called with Context set to the same value as was passed into
+/// Register() in RegisterContext and with CommBuffer pointing to an instance of
+/// EFI_MM_PERIODIC_TIMER_CONTEXT and CommBufferSize pointing to its size.
+///
+typedef struct {
+ ///
+ /// ElapsedTime is the actual time in 100 nanosecond units elapsed since last called, a
+ /// value of 0 indicates an unknown amount of time.
+ ///
+ UINT64 ElapsedTime;
+} EFI_MM_PERIODIC_TIMER_CONTEXT;
+
+typedef struct _EFI_MM_PERIODIC_TIMER_DISPATCH_PROTOCOL EFI_MM_PERIODIC_TIMER_DISPATCH_PROTOCOL;
+
+/**
+ Register a child MMI source dispatch function for MM periodic timer.
+
+ This service registers a function (DispatchFunction) which will be called when at least the
+ amount of time specified by RegisterContext has elapsed. On return, DispatchHandle
+ contains a unique handle which may be used later to unregister the function using UnRegister().
+ The DispatchFunction will be called with Context set to the same value as was passed into
+ this function in RegisterContext and with CommBuffer pointing to an instance of
+ EFI_MM_PERIODIC_TIMER_CONTEXT and CommBufferSize pointing to its size.
+
+ @param[in] This Pointer to the EFI_MM_PERIODIC_TIMER_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchFunction Function to register for handler when at least the specified amount
+ of time has elapsed.
+ @param[in] RegisterContext Pointer to the dispatch function's context.
+ The caller fills this context in before calling
+ the register function to indicate to the register
+ function the period at which the dispatch function
+ should be invoked.
+ @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully
+ registered and the MMI source has been enabled.
+ @retval EFI_DEVICE_ERROR The driver was unable to enable the MMI source.
+ @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The period input value
+ is not within valid range.
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this child.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_PERIODIC_TIMER_REGISTER)(
+ IN CONST EFI_MM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,
+ IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,
+ IN CONST EFI_MM_PERIODIC_TIMER_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+ );
+
+/**
+ Unregisters a periodic timer service.
+
+ This service removes the handler associated with DispatchHandle so that it will no longer be
+ called when the time has elapsed.
+
+ @param[in] This Pointer to the EFI_MM_PERIODIC_TIMER_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchHandle Handle of the service to remove.
+
+ @retval EFI_SUCCESS The service has been successfully removed.
+ @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_PERIODIC_TIMER_UNREGISTER)(
+ IN CONST EFI_MM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+ );
+
+/**
+ Returns the next MMI tick period supported by the chipset.
+
+ The order returned is from longest to shortest interval period.
+
+ @param[in] This Pointer to the EFI_MM_PERIODIC_TIMER_DISPATCH_PROTOCOL instance.
+ @param[in,out] MmiTickInterval Pointer to pointer of next shorter MMI interval
+ period supported by the child. This parameter works as a get-first,
+ get-next field.The first time this function is called, *MmiTickInterval
+ should be set to NULL to get the longest MMI interval.The returned
+ *MmiTickInterval should be passed in on subsequent calls to get the
+ next shorter interval period until *MmiTickInterval = NULL.
+
+ @retval EFI_SUCCESS The service returned successfully.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_PERIODIC_TIMER_INTERVAL)(
+ IN CONST EFI_MM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,
+ IN OUT UINT64 **MmiTickInterval
+ );
+
+///
+/// Interface structure for the MM Periodic Timer Dispatch Protocol
+///
+/// This protocol provides the parent dispatch service for the periodical timer MMI source generator.
+///
+struct _EFI_MM_PERIODIC_TIMER_DISPATCH_PROTOCOL {
+ EFI_MM_PERIODIC_TIMER_REGISTER Register;
+ EFI_MM_PERIODIC_TIMER_UNREGISTER UnRegister;
+ EFI_MM_PERIODIC_TIMER_INTERVAL GetNextShorterInterval;
+};
+
+extern EFI_GUID gEfiMmPeriodicTimerDispatchProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmPowerButtonDispatch.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmPowerButtonDispatch.h
new file mode 100644
index 0000000000..ecadd90b18
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmPowerButtonDispatch.h
@@ -0,0 +1,117 @@
+/** @file
+ MM Power Button Dispatch Protocol as defined in PI 1.5 Specification
+ Volume 4 Management Mode Core Interface.
+
+ This protocol provides the parent dispatch service for the power button MMI source generator.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.5.
+
+**/
+
+#ifndef _MM_POWER_BUTTON_DISPATCH_H_
+#define _MM_POWER_BUTTON_DISPATCH_H_
+
+#include <Pi/PiMmCis.h>
+
+#define EFI_MM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID \
+ { \
+ 0x1b1183fa, 0x1823, 0x46a7, {0x88, 0x72, 0x9c, 0x57, 0x87, 0x55, 0x40, 0x9d } \
+ }
+
+///
+/// Power Button phases.
+///
+typedef enum {
+ EfiPowerButtonEntry,
+ EfiPowerButtonExit,
+ EfiPowerButtonMax
+} EFI_POWER_BUTTON_PHASE;
+
+///
+/// The dispatch function's context.
+///
+typedef struct {
+ ///
+ /// Designates whether this handler should be invoked upon entry or exit.
+ ///
+ EFI_POWER_BUTTON_PHASE Phase;
+} EFI_MM_POWER_BUTTON_REGISTER_CONTEXT;
+
+typedef struct _EFI_MM_POWER_BUTTON_DISPATCH_PROTOCOL EFI_MM_POWER_BUTTON_DISPATCH_PROTOCOL;
+
+/**
+ Provides the parent dispatch service for a power button event.
+
+ This service registers a function (DispatchFunction) which will be called when an MMI is
+ generated because the power button was pressed or released, as specified by RegisterContext.
+ On return, DispatchHandle contains a unique handle which may be used later to unregister the
+ function using UnRegister().
+ The DispatchFunction will be called with Context set to the same value as was passed into
+ this function in RegisterContext and with CommBuffer and CommBufferSize set to NULL.
+
+ @param[in] This Pointer to the EFI_MM_POWER_BUTTON_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchFunction Function to register for handler when power button is pressed or released.
+ @param[in] RegisterContext Pointer to the dispatch function's context. The caller fills in this context
+ before calling the Register() function to indicate to the Register() function
+ the power button MMI phase for which the dispatch function should be invoked.
+ @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully
+ registered and the MMI source has been enabled.
+ @retval EFI_DEVICE_ERROR The driver was unable to enable the MMI source.
+ @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The power button input value
+ is not within valid range.
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this child.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_POWER_BUTTON_REGISTER)(
+ IN CONST EFI_MM_POWER_BUTTON_DISPATCH_PROTOCOL *This,
+ IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,
+ IN EFI_MM_POWER_BUTTON_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+ );
+
+/**
+ Unregisters a power-button service.
+
+ This service removes the handler associated with DispatchHandle so that it will no longer be
+ called when the standby button is pressed or released.
+
+ @param[in] This Pointer to the EFI_MM_POWER_BUTTON_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchHandle Handle of the service to remove.
+
+ @retval EFI_SUCCESS The service has been successfully removed.
+ @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_POWER_BUTTON_UNREGISTER)(
+ IN CONST EFI_MM_POWER_BUTTON_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+ );
+
+///
+/// Interface structure for the MM Power Button Dispatch Protocol.
+///
+/// This protocol provides the parent dispatch service for the power button MMI source generator.
+///
+struct _EFI_MM_POWER_BUTTON_DISPATCH_PROTOCOL {
+ EFI_MM_POWER_BUTTON_REGISTER Register;
+ EFI_MM_POWER_BUTTON_UNREGISTER UnRegister;
+};
+
+extern EFI_GUID gEfiMmPowerButtonDispatchProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmReadyToLock.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmReadyToLock.h
new file mode 100644
index 0000000000..ce5c55957d
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmReadyToLock.h
@@ -0,0 +1,32 @@
+/** @file
+ MM Ready To Lock protocol introduced in the PI 1.5 specification.
+
+ This protocol is a mandatory protocol published by the MM Foundation
+ code when the system is preparing to lock certain resources and interfaces
+ in anticipation of the invocation of 3rd party extensible modules.
+ This protocol is an MM counterpart of the DXE MM Ready to Lock Protocol.
+ This protocol prorogates resource locking notification into MM environment.
+ This protocol is installed after installation of the MM End of DXE Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MM_READY_TO_LOCK_H_
+#define _MM_READY_TO_LOCK_H_
+
+#define EFI_MM_READY_TO_LOCK_PROTOCOL_GUID \
+ { \
+ 0x47b7fa8c, 0xf4bd, 0x4af6, { 0x82, 0x00, 0x33, 0x30, 0x86, 0xf0, 0xd2, 0xc8 } \
+ }
+
+extern EFI_GUID gEfiMmReadyToLockProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmReportStatusCodeHandler.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmReportStatusCodeHandler.h
new file mode 100644
index 0000000000..7e9ec43ea7
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmReportStatusCodeHandler.h
@@ -0,0 +1,81 @@
+/** @file
+ This protocol provides registering and unregistering services to status code consumers while in DXE MM.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __MM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
+#define __MM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
+
+#define EFI_MM_RSC_HANDLER_PROTOCOL_GUID \
+ { \
+ 0x2ff29fa7, 0x5e80, 0x4ed9, {0xb3, 0x80, 0x1, 0x7d, 0x3c, 0x55, 0x4f, 0xf4} \
+ }
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_RSC_HANDLER_CALLBACK)(
+ IN EFI_STATUS_CODE_TYPE CodeType,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN EFI_GUID *CallerId,
+ IN EFI_STATUS_CODE_DATA *Data
+);
+
+/**
+ Register the callback function for ReportStatusCode() notification.
+
+ When this function is called the function pointer is added to an internal list and any future calls to
+ ReportStatusCode() will be forwarded to the Callback function.
+
+ @param[in] Callback A pointer to a function of type EFI_MM_RSC_HANDLER_CALLBACK that is
+ called when a call to ReportStatusCode() occurs.
+
+ @retval EFI_SUCCESS Function was successfully registered.
+ @retval EFI_INVALID_PARAMETER The callback function was NULL.
+ @retval EFI_OUT_OF_RESOURCES The internal buffer ran out of space. No more functions can be
+ registered.
+ @retval EFI_ALREADY_STARTED The function was already registered. It can't be registered again.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_RSC_HANDLER_REGISTER)(
+ IN EFI_MM_RSC_HANDLER_CALLBACK Callback
+);
+
+/**
+ Remove a previously registered callback function from the notification list.
+
+ A callback function must be unregistered before it is deallocated. It is important that any registered
+ callbacks that are not runtime complaint be unregistered when ExitBootServices() is called.
+
+ @param[in] Callback A pointer to a function of type EFI_MM_RSC_HANDLER_CALLBACK that is to be
+ unregistered.
+
+ @retval EFI_SUCCESS The function was successfully unregistered.
+ @retval EFI_INVALID_PARAMETER The callback function was NULL.
+ @retval EFI_NOT_FOUND The callback function was not found to be unregistered.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_RSC_HANDLER_UNREGISTER)(
+ IN EFI_MM_RSC_HANDLER_CALLBACK Callback
+);
+
+typedef struct _EFI_MM_RSC_HANDLER_PROTOCOL {
+ EFI_MM_RSC_HANDLER_REGISTER Register;
+ EFI_MM_RSC_HANDLER_UNREGISTER Unregister;
+} EFI_MM_RSC_HANDLER_PROTOCOL;
+
+extern EFI_GUID gEfiMmRscHandlerProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmStandbyButtonDispatch.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmStandbyButtonDispatch.h
new file mode 100644
index 0000000000..c0a2ff92d2
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmStandbyButtonDispatch.h
@@ -0,0 +1,119 @@
+/** @file
+ MM Standby Button Dispatch Protocol as defined in PI 1.5 Specification
+ Volume 4 Management Mode Core Interface.
+
+ This protocol provides the parent dispatch service for the standby button MMI source generator.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.5.
+
+**/
+
+#ifndef _MM_STANDBY_BUTTON_DISPATCH_H_
+#define _MM_STANDBY_BUTTON_DISPATCH_H_
+
+#include <Pi/PiMmCis.h>
+
+#define EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID \
+ { \
+ 0x7300c4a1, 0x43f2, 0x4017, {0xa5, 0x1b, 0xc8, 0x1a, 0x7f, 0x40, 0x58, 0x5b } \
+ }
+
+///
+/// Standby Button phases
+///
+typedef enum {
+ EfiStandbyButtonEntry,
+ EfiStandbyButtonExit,
+ EfiStandbyButtonMax
+} EFI_STANDBY_BUTTON_PHASE;
+
+///
+/// The dispatch function's context.
+///
+typedef struct {
+ ///
+ /// Describes whether the child handler should be invoked upon the entry to the button
+ /// activation or upon exit.
+ ///
+ EFI_STANDBY_BUTTON_PHASE Phase;
+} EFI_MM_STANDBY_BUTTON_REGISTER_CONTEXT;
+
+typedef struct _EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL;
+
+/**
+ Provides the parent dispatch service for a standby button event.
+
+ This service registers a function (DispatchFunction) which will be called when an MMI is
+ generated because the standby button was pressed or released, as specified by
+ RegisterContext. On return, DispatchHandle contains a unique handle which may be used
+ later to unregister the function using UnRegister().
+ The DispatchFunction will be called with Context set to the same value as was passed into
+ this function in RegisterContext and with CommBuffer and CommBufferSize set to NULL.
+
+ @param[in] This Pointer to the EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchFunction Function to register for handler when the standby button is pressed or released.
+ @param[in] RegisterContext Pointer to the dispatch function's context. The caller fills in this context
+ before calling the register function to indicate to the register function the
+ standby button MMI source for which the dispatch function should be invoked.
+ @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully
+ registered and the MMI source has been enabled.
+ @retval EFI_DEVICE_ERROR The driver was unable to enable the MMI source.
+ @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The standby button input value
+ is not within valid range.
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this child.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_STANDBY_BUTTON_REGISTER)(
+ IN CONST EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
+ IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,
+ IN EFI_MM_STANDBY_BUTTON_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+ );
+
+/**
+ Unregisters a child MMI source dispatch function with a parent MM driver.
+
+ This service removes the handler associated with DispatchHandle so that it will no longer be
+ called when the standby button is pressed or released.
+
+ @param[in] This Pointer to the EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchHandle Handle of the service to remove.
+
+ @retval EFI_SUCCESS The service has been successfully removed.
+ @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_STANDBY_BUTTON_UNREGISTER)(
+ IN CONST EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+ );
+
+///
+/// Interface structure for the MM Standby Button Dispatch Protocol.
+///
+/// This protocol provides the parent dispatch service for the standby
+/// button MMI source generator.
+///
+struct _EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL {
+ EFI_MM_STANDBY_BUTTON_REGISTER Register;
+ EFI_MM_STANDBY_BUTTON_UNREGISTER UnRegister;
+};
+
+extern EFI_GUID gEfiMmStandbyButtonDispatchProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmStatusCode.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmStatusCode.h
new file mode 100644
index 0000000000..33eda7ad04
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmStatusCode.h
@@ -0,0 +1,65 @@
+/** @file
+ EFI MM Status Code Protocol as defined in the PI 1.5 specification.
+
+ This protocol provides the basic status code services while in MM.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MM_STATUS_CODE_H__
+#define _MM_STATUS_CODE_H__
+
+
+#define EFI_MM_STATUS_CODE_PROTOCOL_GUID \
+ { \
+ 0x6afd2b77, 0x98c1, 0x4acd, {0xa6, 0xf9, 0x8a, 0x94, 0x39, 0xde, 0xf, 0xb1} \
+ }
+
+typedef struct _EFI_MM_STATUS_CODE_PROTOCOL EFI_MM_STATUS_CODE_PROTOCOL;
+
+/**
+ Service to emit the status code in MM.
+
+ The EFI_MM_STATUS_CODE_PROTOCOL.ReportStatusCode() function enables a driver
+ to emit a status code while in MM. The reason that there is a separate protocol definition from the
+ DXE variant of this service is that the publisher of this protocol will provide a service that is
+ capability of coexisting with a foreground operational environment, such as an operating system
+ after the termination of boot services.
+
+ @param[in] This Points to this instance of the EFI_MM_STATUS_CODE_PROTOCOL.
+ @param[in] CodeType DIndicates the type of status code being reported.
+ @param[in] Value Describes the current status of a hardware or software entity.
+ @param[in] Instance The enumeration of a hardware or software entity within the system.
+ @param[in] CallerId This optional parameter may be used to identify the caller.
+ @param[in] Data This optional parameter may be used to pass additional data.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_INVALID_PARAMETER The function should not be completed due to a device error.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_REPORT_STATUS_CODE)(
+ IN CONST EFI_MM_STATUS_CODE_PROTOCOL *This,
+ IN EFI_STATUS_CODE_TYPE CodeType,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN CONST EFI_GUID *CallerId,
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL
+ );
+
+struct _EFI_MM_STATUS_CODE_PROTOCOL {
+ EFI_MM_REPORT_STATUS_CODE ReportStatusCode;
+};
+
+extern EFI_GUID gEfiMmStatusCodeProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmSwDispatch.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmSwDispatch.h
new file mode 100644
index 0000000000..9ecb9a8297
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmSwDispatch.h
@@ -0,0 +1,136 @@
+/** @file
+ MM Software Dispatch Protocol introduced from PI 1.5 Specification
+ Volume 4 Management Mode Core Interface.
+
+ This protocol provides the parent dispatch service for a given MMI source generator.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MM_SW_DISPATCH2_H_
+#define _MM_SW_DISPATCH2_H_
+
+#include <Pi/PiMmCis.h>
+
+#define EFI_MM_SW_DISPATCH_PROTOCOL_GUID \
+ { \
+ 0x18a3c6dc, 0x5eea, 0x48c8, {0xa1, 0xc1, 0xb5, 0x33, 0x89, 0xf9, 0x89, 0x99 } \
+ }
+
+///
+/// A particular chipset may not support all possible software MMI input values.
+/// For example, the ICH supports only values 00h to 0FFh. The parent only allows a single
+/// child registration for each SwMmiInputValue.
+///
+typedef struct {
+ UINTN SwMmiInputValue;
+} EFI_MM_SW_REGISTER_CONTEXT;
+
+///
+/// The DispatchFunction will be called with Context set to the same value as was passed into
+/// this function in RegisterContext and with CommBuffer (and CommBufferSize) pointing
+/// to an instance of EFI_MM_SW_CONTEXT indicating the index of the CPU which generated the
+/// software MMI.
+///
+typedef struct {
+ ///
+ /// The 0-based index of the CPU which generated the software MMI.
+ ///
+ UINTN SwMmiCpuIndex;
+ ///
+ /// This value corresponds directly to the CommandPort parameter used in the call to Trigger().
+ ///
+ UINT8 CommandPort;
+ ///
+ /// This value corresponds directly to the DataPort parameter used in the call to Trigger().
+ ///
+ UINT8 DataPort;
+} EFI_MM_SW_CONTEXT;
+
+typedef struct _EFI_MM_SW_DISPATCH_PROTOCOL EFI_MM_SW_DISPATCH_PROTOCOL;
+
+/**
+ Register a child MMI source dispatch function for the specified software MMI.
+
+ This service registers a function (DispatchFunction) which will be called when the software
+ MMI source specified by RegisterContext->SwMmiCpuIndex is detected. On return,
+ DispatchHandle contains a unique handle which may be used later to unregister the function
+ using UnRegister().
+
+ @param[in] This Pointer to the EFI_MM_SW_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchFunction Function to register for handler when the specified software
+ MMI is generated.
+ @param[in, out] RegisterContext Pointer to the dispatch function's context.
+ The caller fills this context in before calling
+ the register function to indicate to the register
+ function which Software MMI input value the
+ dispatch function should be invoked for.
+ @param[out] DispatchHandle Handle generated by the dispatcher to track the
+ function instance.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully
+ registered and the MMI source has been enabled.
+ @retval EFI_DEVICE_ERROR The SW driver was unable to enable the MMI source.
+ @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The SW MMI input value
+ is not within a valid range or is already in use.
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this
+ child.
+ @retval EFI_OUT_OF_RESOURCES A unique software MMI value could not be assigned
+ for this dispatch.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_SW_REGISTER)(
+ IN CONST EFI_MM_SW_DISPATCH_PROTOCOL *This,
+ IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,
+ IN OUT EFI_MM_SW_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+ );
+
+/**
+ Unregister a child MMI source dispatch function for the specified software MMI.
+
+ This service removes the handler associated with DispatchHandle so that it will no longer be
+ called in response to a software MMI.
+
+ @param[in] This Pointer to the EFI_MM_SW_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchHandle Handle of dispatch function to deregister.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully unregistered.
+ @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_SW_UNREGISTER)(
+ IN CONST EFI_MM_SW_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+///
+/// Interface structure for the MM Software MMI Dispatch Protocol.
+///
+/// The EFI_MM_SW_DISPATCH2_PROTOCOL provides the ability to install child handlers for the
+/// given software. These handlers will respond to software interrupts, and the maximum software
+/// interrupt in the EFI_MM_SW_REGISTER_CONTEXT is denoted by MaximumSwiValue.
+///
+struct _EFI_MM_SW_DISPATCH_PROTOCOL {
+ EFI_MM_SW_REGISTER Register;
+ EFI_MM_SW_UNREGISTER UnRegister;
+ ///
+ /// A read-only field that describes the maximum value that can be used in the
+ /// EFI_MM_SW_DISPATCH_PROTOCOL.Register() service.
+ ///
+ UINTN MaximumSwiValue;
+};
+
+extern EFI_GUID gEfiMmSwDispatchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmSxDispatch.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmSxDispatch.h
new file mode 100644
index 0000000000..99b757d113
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmSxDispatch.h
@@ -0,0 +1,135 @@
+/** @file
+ MM Sx Dispatch Protocol as defined in PI 1.5 Specification
+ Volume 4 Management Mode Core Interface.
+
+ Provides the parent dispatch service for a given Sx-state source generator.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MM_SX_DISPATCH_H_
+#define _MM_SX_DISPATCH_H_
+
+#include <Pi/PiMmCis.h>
+
+#define EFI_MM_SX_DISPATCH_PROTOCOL_GUID \
+ { \
+ 0x456d2859, 0xa84b, 0x4e47, {0xa2, 0xee, 0x32, 0x76, 0xd8, 0x86, 0x99, 0x7d } \
+ }
+
+///
+/// Sleep states S0-S5
+///
+typedef enum {
+ SxS0,
+ SxS1,
+ SxS2,
+ SxS3,
+ SxS4,
+ SxS5,
+ EfiMaximumSleepType
+} EFI_SLEEP_TYPE;
+
+///
+/// Sleep state phase: entry or exit
+///
+typedef enum {
+ SxEntry,
+ SxExit,
+ EfiMaximumPhase
+} EFI_SLEEP_PHASE;
+
+///
+/// The dispatch function's context
+///
+typedef struct {
+ EFI_SLEEP_TYPE Type;
+ EFI_SLEEP_PHASE Phase;
+} EFI_MM_SX_REGISTER_CONTEXT;
+
+typedef struct _EFI_MM_SX_DISPATCH_PROTOCOL EFI_MM_SX_DISPATCH_PROTOCOL;
+
+/**
+ Provides the parent dispatch service for a given Sx source generator.
+
+ This service registers a function (DispatchFunction) which will be called when the sleep state
+ event specified by RegisterContext is detected. On return, DispatchHandle contains a
+ unique handle which may be used later to unregister the function using UnRegister().
+ The DispatchFunction will be called with Context set to the same value as was passed into
+ this function in RegisterContext and with CommBuffer and CommBufferSize set to
+ NULL and 0 respectively.
+
+ @param[in] This Pointer to the EFI_MM_SX_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchFunction Function to register for handler when the specified sleep state event occurs.
+ @param[in] RegisterContext Pointer to the dispatch function's context.
+ The caller fills this context in before calling
+ the register function to indicate to the register
+ function which Sx state type and phase the caller
+ wishes to be called back on. For this intertace,
+ the Sx driver will call the registered handlers for
+ all Sx type and phases, so the Sx state handler(s)
+ must check the Type and Phase field of the Dispatch
+ context and act accordingly.
+ @param[out] DispatchHandle Handle of dispatch function, for when interfacing
+ with the parent Sx state MM driver.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully
+ registered and the MMI source has been enabled.
+ @retval EFI_UNSUPPORTED The Sx driver or hardware does not support that
+ Sx Type/Phase.
+ @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the MMI source.
+ @retval EFI_INVALID_PARAMETER RegisterContext is invalid. Type & Phase are not
+ within valid range.
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this
+ child.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_SX_REGISTER)(
+ IN CONST EFI_MM_SX_DISPATCH_PROTOCOL *This,
+ IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,
+ IN CONST EFI_MM_SX_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+ );
+
+/**
+ Unregisters an Sx-state service.
+
+ This service removes the handler associated with DispatchHandle so that it will no longer be
+ called in response to sleep event.
+
+ @param[in] This Pointer to the EFI_MM_SX_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchHandle Handle of the service to remove.
+
+ @retval EFI_SUCCESS The service has been successfully removed.
+ @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_SX_UNREGISTER)(
+ IN CONST EFI_MM_SX_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+ );
+
+///
+/// Interface structure for the MM Sx Dispatch Protocol
+///
+/// The EFI_MM_SX_DISPATCH_PROTOCOL provides the ability to install child handlers to
+/// respond to sleep state related events.
+///
+struct _EFI_MM_SX_DISPATCH_PROTOCOL {
+ EFI_MM_SX_REGISTER Register;
+ EFI_MM_SX_UNREGISTER UnRegister;
+};
+
+extern EFI_GUID gEfiMmSxDispatchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmUsbDispatch.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmUsbDispatch.h
new file mode 100644
index 0000000000..cf6c22acf9
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MmUsbDispatch.h
@@ -0,0 +1,130 @@
+/** @file
+ MM USB Dispatch Protocol as defined in PI 1.5 Specification
+ Volume 4 Management Mode Core Interface.
+
+ Provides the parent dispatch service for the USB MMI source generator.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.5.
+
+**/
+
+#ifndef _MM_USB_DISPATCH_H_
+#define _MM_USB_DISPATCH_H_
+
+#include <Pi/PiMmCis.h>
+
+#define EFI_MM_USB_DISPATCH_PROTOCOL_GUID \
+ { \
+ 0xee9b8d90, 0xc5a6, 0x40a2, {0xbd, 0xe2, 0x52, 0x55, 0x8d, 0x33, 0xcc, 0xa1 } \
+ }
+
+///
+/// USB MMI event types
+///
+typedef enum {
+ UsbLegacy,
+ UsbWake
+} EFI_USB_MMI_TYPE;
+
+///
+/// The dispatch function's context.
+///
+typedef struct {
+ ///
+ /// Describes whether this child handler will be invoked in response to a USB legacy
+ /// emulation event, such as port-trap on the PS/2* keyboard control registers, or to a
+ /// USB wake event, such as resumption from a sleep state.
+ ///
+ EFI_USB_MMI_TYPE Type;
+ ///
+ /// The device path is part of the context structure and describes the location of the
+ /// particular USB host controller in the system for which this register event will occur.
+ /// This location is important because of the possible integration of several USB host
+ /// controllers in a system.
+ ///
+ EFI_DEVICE_PATH_PROTOCOL *Device;
+} EFI_MM_USB_REGISTER_CONTEXT;
+
+typedef struct _EFI_MM_USB_DISPATCH_PROTOCOL EFI_MM_USB_DISPATCH_PROTOCOL;
+
+/**
+ Provides the parent dispatch service for the USB MMI source generator.
+
+ This service registers a function (DispatchFunction) which will be called when the USB-
+ related MMI specified by RegisterContext has occurred. On return, DispatchHandle
+ contains a unique handle which may be used later to unregister the function using UnRegister().
+ The DispatchFunction will be called with Context set to the same value as was passed into
+ this function in RegisterContext and with CommBuffer containing NULL and
+ CommBufferSize containing zero.
+
+ @param[in] This Pointer to the EFI_MM_USB_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchFunction Function to register for handler when a USB-related MMI occurs.
+ @param[in] RegisterContext Pointer to the dispatch function's context.
+ The caller fills this context in before calling
+ the register function to indicate to the register
+ function the USB MMI types for which the dispatch
+ function should be invoked.
+ @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully
+ registered and the MMI source has been enabled.
+ @retval EFI_DEVICE_ERROR The driver was unable to enable the MMI source.
+ @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The USB MMI type
+ is not within valid range.
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this child.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_USB_REGISTER)(
+ IN CONST EFI_MM_USB_DISPATCH_PROTOCOL *This,
+ IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,
+ IN CONST EFI_MM_USB_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+ );
+
+/**
+ Unregisters a USB service.
+
+ This service removes the handler associated with DispatchHandle so that it will no longer be
+ called when the USB event occurs.
+
+ @param[in] This Pointer to the EFI_MM_USB_DISPATCH_PROTOCOL instance.
+ @param[in] DispatchHandle Handle of the service to remove.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully
+ unregistered and the MMI source has been disabled
+ if there are no other registered child dispatch
+ functions for this MMI source.
+ @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_USB_UNREGISTER)(
+ IN CONST EFI_MM_USB_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+ );
+
+///
+/// Interface structure for the MM USB MMI Dispatch Protocol
+///
+/// This protocol provides the parent dispatch service for the USB MMI source generator.
+///
+struct _EFI_MM_USB_DISPATCH_PROTOCOL {
+ EFI_MM_USB_REGISTER Register;
+ EFI_MM_USB_UNREGISTER UnRegister;
+};
+
+extern EFI_GUID gEfiMmUsbDispatchProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MonotonicCounter.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MonotonicCounter.h
new file mode 100644
index 0000000000..1409be2e5f
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MonotonicCounter.h
@@ -0,0 +1,28 @@
+/** @file
+ Monotonic Counter Architectural Protocol as defined in PI SPEC VOLUME 2 DXE
+
+ This code provides the services required to access the system's monotonic counter
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARCH_PROTOCOL_MONTONIC_COUNTER_H__
+#define __ARCH_PROTOCOL_MONTONIC_COUNTER_H__
+
+///
+/// Global ID for the Monotonic Counter Architectural Protocol.
+///
+#define EFI_MONOTONIC_COUNTER_ARCH_PROTOCOL_GUID \
+ {0x1da97072, 0xbddc, 0x4b30, {0x99, 0xf1, 0x72, 0xa0, 0xb5, 0x6f, 0xff, 0x2a} }
+
+extern EFI_GUID gEfiMonotonicCounterArchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MpService.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MpService.h
new file mode 100644
index 0000000000..ac1d12caa1
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/MpService.h
@@ -0,0 +1,632 @@
+/** @file
+ When installed, the MP Services Protocol produces a collection of services
+ that are needed for MP management.
+
+ The MP Services Protocol provides a generalized way of performing following tasks:
+ - Retrieving information of multi-processor environment and MP-related status of
+ specific processors.
+ - Dispatching user-provided function to APs.
+ - Maintain MP-related processor status.
+
+ The MP Services Protocol must be produced on any system with more than one logical
+ processor.
+
+ The Protocol is available only during boot time.
+
+ MP Services Protocol is hardware-independent. Most of the logic of this protocol
+ is architecturally neutral. It abstracts the multi-processor environment and
+ status of processors, and provides interfaces to retrieve information, maintain,
+ and dispatch.
+
+ MP Services Protocol may be consumed by ACPI module. The ACPI module may use this
+ protocol to retrieve data that are needed for an MP platform and report them to OS.
+ MP Services Protocol may also be used to program and configure processors, such
+ as MTRR synchronization for memory space attributes setting in DXE Services.
+ MP Services Protocol may be used by non-CPU DXE drivers to speed up platform boot
+ by taking advantage of the processing capabilities of the APs, for example, using
+ APs to help test system memory in parallel with other device initialization.
+ Diagnostics applications may also use this protocol for multi-processor.
+
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is defined in the UEFI Platform Initialization Specification 1.2,
+ Volume 2:Driver Execution Environment Core Interface.
+
+**/
+
+#ifndef _MP_SERVICE_PROTOCOL_H_
+#define _MP_SERVICE_PROTOCOL_H_
+
+///
+/// Global ID for the EFI_MP_SERVICES_PROTOCOL.
+///
+#define EFI_MP_SERVICES_PROTOCOL_GUID \
+ { \
+ 0x3fdda605, 0xa76e, 0x4f46, {0xad, 0x29, 0x12, 0xf4, 0x53, 0x1b, 0x3d, 0x08} \
+ }
+
+///
+/// Forward declaration for the EFI_MP_SERVICES_PROTOCOL.
+///
+typedef struct _EFI_MP_SERVICES_PROTOCOL EFI_MP_SERVICES_PROTOCOL;
+
+///
+/// Terminator for a list of failed CPUs returned by StartAllAPs().
+///
+#define END_OF_CPU_LIST 0xffffffff
+
+///
+/// This bit is used in the StatusFlag field of EFI_PROCESSOR_INFORMATION and
+/// indicates whether the processor is playing the role of BSP. If the bit is 1,
+/// then the processor is BSP. Otherwise, it is AP.
+///
+#define PROCESSOR_AS_BSP_BIT 0x00000001
+
+///
+/// This bit is used in the StatusFlag field of EFI_PROCESSOR_INFORMATION and
+/// indicates whether the processor is enabled. If the bit is 1, then the
+/// processor is enabled. Otherwise, it is disabled.
+///
+#define PROCESSOR_ENABLED_BIT 0x00000002
+
+///
+/// This bit is used in the StatusFlag field of EFI_PROCESSOR_INFORMATION and
+/// indicates whether the processor is healthy. If the bit is 1, then the
+/// processor is healthy. Otherwise, some fault has been detected for the processor.
+///
+#define PROCESSOR_HEALTH_STATUS_BIT 0x00000004
+
+///
+/// Structure that describes the pyhiscal location of a logical CPU.
+///
+typedef struct {
+ ///
+ /// Zero-based physical package number that identifies the cartridge of the processor.
+ ///
+ UINT32 Package;
+ ///
+ /// Zero-based physical core number within package of the processor.
+ ///
+ UINT32 Core;
+ ///
+ /// Zero-based logical thread number within core of the processor.
+ ///
+ UINT32 Thread;
+} EFI_CPU_PHYSICAL_LOCATION;
+
+///
+/// Structure that describes information about a logical CPU.
+///
+typedef struct {
+ ///
+ /// The unique processor ID determined by system hardware. For IA32 and X64,
+ /// the processor ID is the same as the Local APIC ID. Only the lower 8 bits
+ /// are used, and higher bits are reserved. For IPF, the lower 16 bits contains
+ /// id/eid, and higher bits are reserved.
+ ///
+ UINT64 ProcessorId;
+ ///
+ /// Flags indicating if the processor is BSP or AP, if the processor is enabled
+ /// or disabled, and if the processor is healthy. Bits 3..31 are reserved and
+ /// must be 0.
+ ///
+ /// <pre>
+ /// BSP ENABLED HEALTH Description
+ /// === ======= ====== ===================================================
+ /// 0 0 0 Unhealthy Disabled AP.
+ /// 0 0 1 Healthy Disabled AP.
+ /// 0 1 0 Unhealthy Enabled AP.
+ /// 0 1 1 Healthy Enabled AP.
+ /// 1 0 0 Invalid. The BSP can never be in the disabled state.
+ /// 1 0 1 Invalid. The BSP can never be in the disabled state.
+ /// 1 1 0 Unhealthy Enabled BSP.
+ /// 1 1 1 Healthy Enabled BSP.
+ /// </pre>
+ ///
+ UINT32 StatusFlag;
+ ///
+ /// The physical location of the processor, including the physical package number
+ /// that identifies the cartridge, the physical core number within package, and
+ /// logical thread number within core.
+ ///
+ EFI_CPU_PHYSICAL_LOCATION Location;
+} EFI_PROCESSOR_INFORMATION;
+
+/**
+ This service retrieves the number of logical processor in the platform
+ and the number of those logical processors that are enabled on this boot.
+ This service may only be called from the BSP.
+
+ This function is used to retrieve the following information:
+ - The number of logical processors that are present in the system.
+ - The number of enabled logical processors in the system at the instant
+ this call is made.
+
+ Because MP Service Protocol provides services to enable and disable processors
+ dynamically, the number of enabled logical processors may vary during the
+ course of a boot session.
+
+ If this service is called from an AP, then EFI_DEVICE_ERROR is returned.
+ If NumberOfProcessors or NumberOfEnabledProcessors is NULL, then
+ EFI_INVALID_PARAMETER is returned. Otherwise, the total number of processors
+ is returned in NumberOfProcessors, the number of currently enabled processor
+ is returned in NumberOfEnabledProcessors, and EFI_SUCCESS is returned.
+
+ @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL
+ instance.
+ @param[out] NumberOfProcessors Pointer to the total number of logical
+ processors in the system, including the BSP
+ and disabled APs.
+ @param[out] NumberOfEnabledProcessors Pointer to the number of enabled logical
+ processors that exist in system, including
+ the BSP.
+
+ @retval EFI_SUCCESS The number of logical processors and enabled
+ logical processors was retrieved.
+ @retval EFI_DEVICE_ERROR The calling processor is an AP.
+ @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL.
+ @retval EFI_INVALID_PARAMETER NumberOfEnabledProcessors is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ OUT UINTN *NumberOfProcessors,
+ OUT UINTN *NumberOfEnabledProcessors
+ );
+
+/**
+ Gets detailed MP-related information on the requested processor at the
+ instant this call is made. This service may only be called from the BSP.
+
+ This service retrieves detailed MP-related information about any processor
+ on the platform. Note the following:
+ - The processor information may change during the course of a boot session.
+ - The information presented here is entirely MP related.
+
+ Information regarding the number of caches and their sizes, frequency of operation,
+ slot numbers is all considered platform-related information and is not provided
+ by this service.
+
+ @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL
+ instance.
+ @param[in] ProcessorNumber The handle number of processor.
+ @param[out] ProcessorInfoBuffer A pointer to the buffer where information for
+ the requested processor is deposited.
+
+ @retval EFI_SUCCESS Processor information was returned.
+ @retval EFI_DEVICE_ERROR The calling processor is an AP.
+ @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL.
+ @retval EFI_NOT_FOUND The processor with the handle specified by
+ ProcessorNumber does not exist in the platform.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_GET_PROCESSOR_INFO)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer
+ );
+
+/**
+ This service executes a caller provided function on all enabled APs. APs can
+ run either simultaneously or one at a time in sequence. This service supports
+ both blocking and non-blocking requests. The non-blocking requests use EFI
+ events so the BSP can detect when the APs have finished. This service may only
+ be called from the BSP.
+
+ This function is used to dispatch all the enabled APs to the function specified
+ by Procedure. If any enabled AP is busy, then EFI_NOT_READY is returned
+ immediately and Procedure is not started on any AP.
+
+ If SingleThread is TRUE, all the enabled APs execute the function specified by
+ Procedure one by one, in ascending order of processor handle number. Otherwise,
+ all the enabled APs execute the function specified by Procedure simultaneously.
+
+ If WaitEvent is NULL, execution is in blocking mode. The BSP waits until all
+ APs finish or TimeoutInMicroSecs expires. Otherwise, execution is in non-blocking
+ mode, and the BSP returns from this service without waiting for APs. If a
+ non-blocking mode is requested after the UEFI Event EFI_EVENT_GROUP_READY_TO_BOOT
+ is signaled, then EFI_UNSUPPORTED must be returned.
+
+ If the timeout specified by TimeoutInMicroseconds expires before all APs return
+ from Procedure, then Procedure on the failed APs is terminated. All enabled APs
+ are always available for further calls to EFI_MP_SERVICES_PROTOCOL.StartupAllAPs()
+ and EFI_MP_SERVICES_PROTOCOL.StartupThisAP(). If FailedCpuList is not NULL, its
+ content points to the list of processor handle numbers in which Procedure was
+ terminated.
+
+ Note: It is the responsibility of the consumer of the EFI_MP_SERVICES_PROTOCOL.StartupAllAPs()
+ to make sure that the nature of the code that is executed on the BSP and the
+ dispatched APs is well controlled. The MP Services Protocol does not guarantee
+ that the Procedure function is MP-safe. Hence, the tasks that can be run in
+ parallel are limited to certain independent tasks and well-controlled exclusive
+ code. EFI services and protocols may not be called by APs unless otherwise
+ specified.
+
+ In blocking execution mode, BSP waits until all APs finish or
+ TimeoutInMicroSeconds expires.
+
+ In non-blocking execution mode, BSP is freed to return to the caller and then
+ proceed to the next task without having to wait for APs. The following
+ sequence needs to occur in a non-blocking execution mode:
+
+ -# The caller that intends to use this MP Services Protocol in non-blocking
+ mode creates WaitEvent by calling the EFI CreateEvent() service. The caller
+ invokes EFI_MP_SERVICES_PROTOCOL.StartupAllAPs(). If the parameter WaitEvent
+ is not NULL, then StartupAllAPs() executes in non-blocking mode. It requests
+ the function specified by Procedure to be started on all the enabled APs,
+ and releases the BSP to continue with other tasks.
+ -# The caller can use the CheckEvent() and WaitForEvent() services to check
+ the state of the WaitEvent created in step 1.
+ -# When the APs complete their task or TimeoutInMicroSecondss expires, the MP
+ Service signals WaitEvent by calling the EFI SignalEvent() function. If
+ FailedCpuList is not NULL, its content is available when WaitEvent is
+ signaled. If all APs returned from Procedure prior to the timeout, then
+ FailedCpuList is set to NULL. If not all APs return from Procedure before
+ the timeout, then FailedCpuList is filled in with the list of the failed
+ APs. The buffer is allocated by MP Service Protocol using AllocatePool().
+ It is the caller's responsibility to free the buffer with FreePool() service.
+ -# This invocation of SignalEvent() function informs the caller that invoked
+ EFI_MP_SERVICES_PROTOCOL.StartupAllAPs() that either all the APs completed
+ the specified task or a timeout occurred. The contents of FailedCpuList
+ can be examined to determine which APs did not complete the specified task
+ prior to the timeout.
+
+ @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL
+ instance.
+ @param[in] Procedure A pointer to the function to be run on
+ enabled APs of the system. See type
+ EFI_AP_PROCEDURE.
+ @param[in] SingleThread If TRUE, then all the enabled APs execute
+ the function specified by Procedure one by
+ one, in ascending order of processor handle
+ number. If FALSE, then all the enabled APs
+ execute the function specified by Procedure
+ simultaneously.
+ @param[in] WaitEvent The event created by the caller with CreateEvent()
+ service. If it is NULL, then execute in
+ blocking mode. BSP waits until all APs finish
+ or TimeoutInMicroSeconds expires. If it's
+ not NULL, then execute in non-blocking mode.
+ BSP requests the function specified by
+ Procedure to be started on all the enabled
+ APs, and go on executing immediately. If
+ all return from Procedure, or TimeoutInMicroSeconds
+ expires, this event is signaled. The BSP
+ can use the CheckEvent() or WaitForEvent()
+ services to check the state of event. Type
+ EFI_EVENT is defined in CreateEvent() in
+ the Unified Extensible Firmware Interface
+ Specification.
+ @param[in] TimeoutInMicrosecsond Indicates the time limit in microseconds for
+ APs to return from Procedure, either for
+ blocking or non-blocking mode. Zero means
+ infinity. If the timeout expires before
+ all APs return from Procedure, then Procedure
+ on the failed APs is terminated. All enabled
+ APs are available for next function assigned
+ by EFI_MP_SERVICES_PROTOCOL.StartupAllAPs()
+ or EFI_MP_SERVICES_PROTOCOL.StartupThisAP().
+ If the timeout expires in blocking mode,
+ BSP returns EFI_TIMEOUT. If the timeout
+ expires in non-blocking mode, WaitEvent
+ is signaled with SignalEvent().
+ @param[in] ProcedureArgument The parameter passed into Procedure for
+ all APs.
+ @param[out] FailedCpuList If NULL, this parameter is ignored. Otherwise,
+ if all APs finish successfully, then its
+ content is set to NULL. If not all APs
+ finish before timeout expires, then its
+ content is set to address of the buffer
+ holding handle numbers of the failed APs.
+ The buffer is allocated by MP Service Protocol,
+ and it's the caller's responsibility to
+ free the buffer with FreePool() service.
+ In blocking mode, it is ready for consumption
+ when the call returns. In non-blocking mode,
+ it is ready when WaitEvent is signaled. The
+ list of failed CPU is terminated by
+ END_OF_CPU_LIST.
+
+ @retval EFI_SUCCESS In blocking mode, all APs have finished before
+ the timeout expired.
+ @retval EFI_SUCCESS In non-blocking mode, function has been dispatched
+ to all enabled APs.
+ @retval EFI_UNSUPPORTED A non-blocking mode request was made after the
+ UEFI event EFI_EVENT_GROUP_READY_TO_BOOT was
+ signaled.
+ @retval EFI_DEVICE_ERROR Caller processor is AP.
+ @retval EFI_NOT_STARTED No enabled APs exist in the system.
+ @retval EFI_NOT_READY Any enabled APs are busy.
+ @retval EFI_TIMEOUT In blocking mode, the timeout expired before
+ all enabled APs have finished.
+ @retval EFI_INVALID_PARAMETER Procedure is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_STARTUP_ALL_APS)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN EFI_AP_PROCEDURE Procedure,
+ IN BOOLEAN SingleThread,
+ IN EFI_EVENT WaitEvent OPTIONAL,
+ IN UINTN TimeoutInMicroSeconds,
+ IN VOID *ProcedureArgument OPTIONAL,
+ OUT UINTN **FailedCpuList OPTIONAL
+ );
+
+/**
+ This service lets the caller get one enabled AP to execute a caller-provided
+ function. The caller can request the BSP to either wait for the completion
+ of the AP or just proceed with the next task by using the EFI event mechanism.
+ See EFI_MP_SERVICES_PROTOCOL.StartupAllAPs() for more details on non-blocking
+ execution support. This service may only be called from the BSP.
+
+ This function is used to dispatch one enabled AP to the function specified by
+ Procedure passing in the argument specified by ProcedureArgument. If WaitEvent
+ is NULL, execution is in blocking mode. The BSP waits until the AP finishes or
+ TimeoutInMicroSecondss expires. Otherwise, execution is in non-blocking mode.
+ BSP proceeds to the next task without waiting for the AP. If a non-blocking mode
+ is requested after the UEFI Event EFI_EVENT_GROUP_READY_TO_BOOT is signaled,
+ then EFI_UNSUPPORTED must be returned.
+
+ If the timeout specified by TimeoutInMicroseconds expires before the AP returns
+ from Procedure, then execution of Procedure by the AP is terminated. The AP is
+ available for subsequent calls to EFI_MP_SERVICES_PROTOCOL.StartupAllAPs() and
+ EFI_MP_SERVICES_PROTOCOL.StartupThisAP().
+
+ @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL
+ instance.
+ @param[in] Procedure A pointer to the function to be run on the
+ designated AP of the system. See type
+ EFI_AP_PROCEDURE.
+ @param[in] ProcessorNumber The handle number of the AP. The range is
+ from 0 to the total number of logical
+ processors minus 1. The total number of
+ logical processors can be retrieved by
+ EFI_MP_SERVICES_PROTOCOL.GetNumberOfProcessors().
+ @param[in] WaitEvent The event created by the caller with CreateEvent()
+ service. If it is NULL, then execute in
+ blocking mode. BSP waits until this AP finish
+ or TimeoutInMicroSeconds expires. If it's
+ not NULL, then execute in non-blocking mode.
+ BSP requests the function specified by
+ Procedure to be started on this AP,
+ and go on executing immediately. If this AP
+ return from Procedure or TimeoutInMicroSeconds
+ expires, this event is signaled. The BSP
+ can use the CheckEvent() or WaitForEvent()
+ services to check the state of event. Type
+ EFI_EVENT is defined in CreateEvent() in
+ the Unified Extensible Firmware Interface
+ Specification.
+ @param[in] TimeoutInMicrosecsond Indicates the time limit in microseconds for
+ this AP to finish this Procedure, either for
+ blocking or non-blocking mode. Zero means
+ infinity. If the timeout expires before
+ this AP returns from Procedure, then Procedure
+ on the AP is terminated. The
+ AP is available for next function assigned
+ by EFI_MP_SERVICES_PROTOCOL.StartupAllAPs()
+ or EFI_MP_SERVICES_PROTOCOL.StartupThisAP().
+ If the timeout expires in blocking mode,
+ BSP returns EFI_TIMEOUT. If the timeout
+ expires in non-blocking mode, WaitEvent
+ is signaled with SignalEvent().
+ @param[in] ProcedureArgument The parameter passed into Procedure on the
+ specified AP.
+ @param[out] Finished If NULL, this parameter is ignored. In
+ blocking mode, this parameter is ignored.
+ In non-blocking mode, if AP returns from
+ Procedure before the timeout expires, its
+ content is set to TRUE. Otherwise, the
+ value is set to FALSE. The caller can
+ determine if the AP returned from Procedure
+ by evaluating this value.
+
+ @retval EFI_SUCCESS In blocking mode, specified AP finished before
+ the timeout expires.
+ @retval EFI_SUCCESS In non-blocking mode, the function has been
+ dispatched to specified AP.
+ @retval EFI_UNSUPPORTED A non-blocking mode request was made after the
+ UEFI event EFI_EVENT_GROUP_READY_TO_BOOT was
+ signaled.
+ @retval EFI_DEVICE_ERROR The calling processor is an AP.
+ @retval EFI_TIMEOUT In blocking mode, the timeout expired before
+ the specified AP has finished.
+ @retval EFI_NOT_READY The specified AP is busy.
+ @retval EFI_NOT_FOUND The processor with the handle specified by
+ ProcessorNumber does not exist.
+ @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP or disabled AP.
+ @retval EFI_INVALID_PARAMETER Procedure is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_STARTUP_THIS_AP)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN EFI_AP_PROCEDURE Procedure,
+ IN UINTN ProcessorNumber,
+ IN EFI_EVENT WaitEvent OPTIONAL,
+ IN UINTN TimeoutInMicroseconds,
+ IN VOID *ProcedureArgument OPTIONAL,
+ OUT BOOLEAN *Finished OPTIONAL
+ );
+
+/**
+ This service switches the requested AP to be the BSP from that point onward.
+ This service changes the BSP for all purposes. This call can only be performed
+ by the current BSP.
+
+ This service switches the requested AP to be the BSP from that point onward.
+ This service changes the BSP for all purposes. The new BSP can take over the
+ execution of the old BSP and continue seamlessly from where the old one left
+ off. This service may not be supported after the UEFI Event EFI_EVENT_GROUP_READY_TO_BOOT
+ is signaled.
+
+ If the BSP cannot be switched prior to the return from this service, then
+ EFI_UNSUPPORTED must be returned.
+
+ @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL instance.
+ @param[in] ProcessorNumber The handle number of AP that is to become the new
+ BSP. The range is from 0 to the total number of
+ logical processors minus 1. The total number of
+ logical processors can be retrieved by
+ EFI_MP_SERVICES_PROTOCOL.GetNumberOfProcessors().
+ @param[in] EnableOldBSP If TRUE, then the old BSP will be listed as an
+ enabled AP. Otherwise, it will be disabled.
+
+ @retval EFI_SUCCESS BSP successfully switched.
+ @retval EFI_UNSUPPORTED Switching the BSP cannot be completed prior to
+ this service returning.
+ @retval EFI_UNSUPPORTED Switching the BSP is not supported.
+ @retval EFI_DEVICE_ERROR The calling processor is an AP.
+ @retval EFI_NOT_FOUND The processor with the handle specified by
+ ProcessorNumber does not exist.
+ @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the current BSP or
+ a disabled AP.
+ @retval EFI_NOT_READY The specified AP is busy.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_SWITCH_BSP)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ IN BOOLEAN EnableOldBSP
+ );
+
+/**
+ This service lets the caller enable or disable an AP from this point onward.
+ This service may only be called from the BSP.
+
+ This service allows the caller enable or disable an AP from this point onward.
+ The caller can optionally specify the health status of the AP by Health. If
+ an AP is being disabled, then the state of the disabled AP is implementation
+ dependent. If an AP is enabled, then the implementation must guarantee that a
+ complete initialization sequence is performed on the AP, so the AP is in a state
+ that is compatible with an MP operating system. This service may not be supported
+ after the UEFI Event EFI_EVENT_GROUP_READY_TO_BOOT is signaled.
+
+ If the enable or disable AP operation cannot be completed prior to the return
+ from this service, then EFI_UNSUPPORTED must be returned.
+
+ @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL instance.
+ @param[in] ProcessorNumber The handle number of AP.
+ The range is from 0 to the total number of
+ logical processors minus 1. The total number of
+ logical processors can be retrieved by
+ EFI_MP_SERVICES_PROTOCOL.GetNumberOfProcessors().
+ @param[in] EnableAP Specifies the new state for the processor for
+ enabled, FALSE for disabled.
+ @param[in] HealthFlag If not NULL, a pointer to a value that specifies
+ the new health status of the AP. This flag
+ corresponds to StatusFlag defined in
+ EFI_MP_SERVICES_PROTOCOL.GetProcessorInfo(). Only
+ the PROCESSOR_HEALTH_STATUS_BIT is used. All other
+ bits are ignored. If it is NULL, this parameter
+ is ignored.
+
+ @retval EFI_SUCCESS The specified AP was enabled or disabled successfully.
+ @retval EFI_UNSUPPORTED Enabling or disabling an AP cannot be completed
+ prior to this service returning.
+ @retval EFI_UNSUPPORTED Enabling or disabling an AP is not supported.
+ @retval EFI_DEVICE_ERROR The calling processor is an AP.
+ @retval EFI_NOT_FOUND Processor with the handle specified by ProcessorNumber
+ does not exist.
+ @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_ENABLEDISABLEAP)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ IN BOOLEAN EnableAP,
+ IN UINT32 *HealthFlag OPTIONAL
+ );
+
+/**
+ This return the handle number for the calling processor. This service may be
+ called from the BSP and APs.
+
+ This service returns the processor handle number for the calling processor.
+ The returned value is in the range from 0 to the total number of logical
+ processors minus 1. The total number of logical processors can be retrieved
+ with EFI_MP_SERVICES_PROTOCOL.GetNumberOfProcessors(). This service may be
+ called from the BSP and APs. If ProcessorNumber is NULL, then EFI_INVALID_PARAMETER
+ is returned. Otherwise, the current processors handle number is returned in
+ ProcessorNumber, and EFI_SUCCESS is returned.
+
+ @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL instance.
+ @param[in] ProcessorNumber Pointer to the handle number of AP.
+ The range is from 0 to the total number of
+ logical processors minus 1. The total number of
+ logical processors can be retrieved by
+ EFI_MP_SERVICES_PROTOCOL.GetNumberOfProcessors().
+
+ @retval EFI_SUCCESS The current processor handle number was returned
+ in ProcessorNumber.
+ @retval EFI_INVALID_PARAMETER ProcessorNumber is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_WHOAMI)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ OUT UINTN *ProcessorNumber
+ );
+
+///
+/// When installed, the MP Services Protocol produces a collection of services
+/// that are needed for MP management.
+///
+/// Before the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled, the module
+/// that produces this protocol is required to place all APs into an idle state
+/// whenever the APs are disabled or the APs are not executing code as requested
+/// through the StartupAllAPs() or StartupThisAP() services. The idle state of
+/// an AP before the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled is
+/// implementation dependent.
+///
+/// After the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled, all the APs
+/// must be placed in the OS compatible CPU state as defined by the UEFI
+/// Specification. Implementations of this protocol may use the UEFI event
+/// EFI_EVENT_GROUP_READY_TO_BOOT to force APs into the OS compatible state as
+/// defined by the UEFI Specification. Modules that use this protocol must
+/// guarantee that all non-blocking mode requests on all APs have been completed
+/// before the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled. Since the
+/// order that event notification functions in the same event group are executed
+/// is not deterministic, an event of type EFI_EVENT_GROUP_READY_TO_BOOT cannot
+/// be used to guarantee that APs have completed their non-blocking mode requests.
+///
+/// When the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled, the StartAllAPs()
+/// and StartupThisAp() services must no longer support non-blocking mode requests.
+/// The support for SwitchBSP() and EnableDisableAP() may no longer be supported
+/// after this event is signaled. Since UEFI Applications and UEFI OS Loaders
+/// execute after the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled, these
+/// UEFI images must be aware that the functionality of this protocol may be reduced.
+///
+struct _EFI_MP_SERVICES_PROTOCOL {
+ EFI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS GetNumberOfProcessors;
+ EFI_MP_SERVICES_GET_PROCESSOR_INFO GetProcessorInfo;
+ EFI_MP_SERVICES_STARTUP_ALL_APS StartupAllAPs;
+ EFI_MP_SERVICES_STARTUP_THIS_AP StartupThisAP;
+ EFI_MP_SERVICES_SWITCH_BSP SwitchBSP;
+ EFI_MP_SERVICES_ENABLEDISABLEAP EnableDisableAP;
+ EFI_MP_SERVICES_WHOAMI WhoAmI;
+};
+
+extern EFI_GUID gEfiMpServiceProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Mtftp4.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Mtftp4.h
new file mode 100644
index 0000000000..e24751dd5a
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Mtftp4.h
@@ -0,0 +1,593 @@
+/** @file
+ EFI Multicast Trivial File Transfer Protocol Definition
+
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.0
+
+**/
+
+#ifndef __EFI_MTFTP4_PROTOCOL_H__
+#define __EFI_MTFTP4_PROTOCOL_H__
+
+#define EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0x2FE800BE, 0x8F01, 0x4aa6, {0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F } \
+ }
+
+#define EFI_MTFTP4_PROTOCOL_GUID \
+ { \
+ 0x78247c57, 0x63db, 0x4708, {0x99, 0xc2, 0xa8, 0xb4, 0xa9, 0xa6, 0x1f, 0x6b } \
+ }
+
+typedef struct _EFI_MTFTP4_PROTOCOL EFI_MTFTP4_PROTOCOL;
+typedef struct _EFI_MTFTP4_TOKEN EFI_MTFTP4_TOKEN;
+
+//
+//MTFTP4 packet opcode definition
+//
+#define EFI_MTFTP4_OPCODE_RRQ 1
+#define EFI_MTFTP4_OPCODE_WRQ 2
+#define EFI_MTFTP4_OPCODE_DATA 3
+#define EFI_MTFTP4_OPCODE_ACK 4
+#define EFI_MTFTP4_OPCODE_ERROR 5
+#define EFI_MTFTP4_OPCODE_OACK 6
+#define EFI_MTFTP4_OPCODE_DIR 7
+#define EFI_MTFTP4_OPCODE_DATA8 8
+#define EFI_MTFTP4_OPCODE_ACK8 9
+
+//
+// MTFTP4 error code definition
+//
+#define EFI_MTFTP4_ERRORCODE_NOT_DEFINED 0
+#define EFI_MTFTP4_ERRORCODE_FILE_NOT_FOUND 1
+#define EFI_MTFTP4_ERRORCODE_ACCESS_VIOLATION 2
+#define EFI_MTFTP4_ERRORCODE_DISK_FULL 3
+#define EFI_MTFTP4_ERRORCODE_ILLEGAL_OPERATION 4
+#define EFI_MTFTP4_ERRORCODE_UNKNOWN_TRANSFER_ID 5
+#define EFI_MTFTP4_ERRORCODE_FILE_ALREADY_EXISTS 6
+#define EFI_MTFTP4_ERRORCODE_NO_SUCH_USER 7
+#define EFI_MTFTP4_ERRORCODE_REQUEST_DENIED 8
+
+//
+// MTFTP4 pacekt definitions
+//
+#pragma pack(1)
+
+typedef struct {
+ UINT16 OpCode;
+ UINT8 Filename[1];
+} EFI_MTFTP4_REQ_HEADER;
+
+typedef struct {
+ UINT16 OpCode;
+ UINT8 Data[1];
+} EFI_MTFTP4_OACK_HEADER;
+
+typedef struct {
+ UINT16 OpCode;
+ UINT16 Block;
+ UINT8 Data[1];
+} EFI_MTFTP4_DATA_HEADER;
+
+typedef struct {
+ UINT16 OpCode;
+ UINT16 Block[1];
+} EFI_MTFTP4_ACK_HEADER;
+
+typedef struct {
+ UINT16 OpCode;
+ UINT64 Block;
+ UINT8 Data[1];
+} EFI_MTFTP4_DATA8_HEADER;
+
+typedef struct {
+ UINT16 OpCode;
+ UINT64 Block[1];
+} EFI_MTFTP4_ACK8_HEADER;
+
+typedef struct {
+ UINT16 OpCode;
+ UINT16 ErrorCode;
+ UINT8 ErrorMessage[1];
+} EFI_MTFTP4_ERROR_HEADER;
+
+typedef union {
+ ///
+ /// Type of packets as defined by the MTFTPv4 packet opcodes.
+ ///
+ UINT16 OpCode;
+ ///
+ /// Read request packet header.
+ ///
+ EFI_MTFTP4_REQ_HEADER Rrq;
+ ///
+ /// Write request packet header.
+ ///
+ EFI_MTFTP4_REQ_HEADER Wrq;
+ ///
+ /// Option acknowledge packet header.
+ ///
+ EFI_MTFTP4_OACK_HEADER Oack;
+ ///
+ /// Data packet header.
+ ///
+ EFI_MTFTP4_DATA_HEADER Data;
+ ///
+ /// Acknowledgement packet header.
+ ///
+ EFI_MTFTP4_ACK_HEADER Ack;
+ ///
+ /// Data packet header with big block number.
+ ///
+ EFI_MTFTP4_DATA8_HEADER Data8;
+ ///
+ /// Acknowledgement header with big block num.
+ ///
+ EFI_MTFTP4_ACK8_HEADER Ack8;
+ ///
+ /// Error packet header.
+ ///
+ EFI_MTFTP4_ERROR_HEADER Error;
+} EFI_MTFTP4_PACKET;
+
+#pragma pack()
+
+///
+/// MTFTP4 option definition.
+///
+typedef struct {
+ UINT8 *OptionStr;
+ UINT8 *ValueStr;
+} EFI_MTFTP4_OPTION;
+
+
+typedef struct {
+ BOOLEAN UseDefaultSetting;
+ EFI_IPv4_ADDRESS StationIp;
+ EFI_IPv4_ADDRESS SubnetMask;
+ UINT16 LocalPort;
+ EFI_IPv4_ADDRESS GatewayIp;
+ EFI_IPv4_ADDRESS ServerIp;
+ UINT16 InitialServerPort;
+ UINT16 TryCount;
+ UINT16 TimeoutValue;
+} EFI_MTFTP4_CONFIG_DATA;
+
+
+typedef struct {
+ EFI_MTFTP4_CONFIG_DATA ConfigData;
+ UINT8 SupportedOptionCount;
+ UINT8 **SupportedOptoins;
+ UINT8 UnsupportedOptionCount;
+ UINT8 **UnsupportedOptoins;
+} EFI_MTFTP4_MODE_DATA;
+
+
+typedef struct {
+ EFI_IPv4_ADDRESS GatewayIp;
+ EFI_IPv4_ADDRESS ServerIp;
+ UINT16 ServerPort;
+ UINT16 TryCount;
+ UINT16 TimeoutValue;
+} EFI_MTFTP4_OVERRIDE_DATA;
+
+//
+// Protocol interfaces definition
+//
+
+/**
+ A callback function that is provided by the caller to intercept
+ the EFI_MTFTP4_OPCODE_DATA or EFI_MTFTP4_OPCODE_DATA8 packets processed in the
+ EFI_MTFTP4_PROTOCOL.ReadFile() function, and alternatively to intercept
+ EFI_MTFTP4_OPCODE_OACK or EFI_MTFTP4_OPCODE_ERROR packets during a call to
+ EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile() or ReadDirectory().
+
+ @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
+ @param Token The token that the caller provided in the
+ EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile()
+ or ReadDirectory() function.
+ @param PacketLen Indicates the length of the packet.
+ @param Packet The pointer to an MTFTPv4 packet.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval Others Aborts the transfer process.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP4_CHECK_PACKET)(
+ IN EFI_MTFTP4_PROTOCOL *This,
+ IN EFI_MTFTP4_TOKEN *Token,
+ IN UINT16 PacketLen,
+ IN EFI_MTFTP4_PACKET *Paket
+ );
+
+/**
+ Timeout callback function.
+
+ @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
+ @param Token The token that is provided in the
+ EFI_MTFTP4_PROTOCOL.ReadFile() or
+ EFI_MTFTP4_PROTOCOL.WriteFile() or
+ EFI_MTFTP4_PROTOCOL.ReadDirectory() functions
+ by the caller.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval Others Aborts download process.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP4_TIMEOUT_CALLBACK)(
+ IN EFI_MTFTP4_PROTOCOL *This,
+ IN EFI_MTFTP4_TOKEN *Token
+ );
+
+/**
+ A callback function that the caller provides to feed data to the
+ EFI_MTFTP4_PROTOCOL.WriteFile() function.
+
+ @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
+ @param Token The token provided in the
+ EFI_MTFTP4_PROTOCOL.WriteFile() by the caller.
+ @param Length Indicates the length of the raw data wanted on input, and the
+ length the data available on output.
+ @param Buffer The pointer to the buffer where the data is stored.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval Others Aborts session.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP4_PACKET_NEEDED)(
+ IN EFI_MTFTP4_PROTOCOL *This,
+ IN EFI_MTFTP4_TOKEN *Token,
+ IN OUT UINT16 *Length,
+ OUT VOID **Buffer
+ );
+
+
+/**
+ Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
+
+ @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
+ @param ModeData The pointer to storage for the EFI MTFTPv4 Protocol driver mode data.
+
+ @retval EFI_SUCCESS The configuration data was successfully returned.
+ @retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated.
+ @retval EFI_INVALID_PARAMETER This is NULL or ModeData is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP4_GET_MODE_DATA)(
+ IN EFI_MTFTP4_PROTOCOL *This,
+ OUT EFI_MTFTP4_MODE_DATA *ModeData
+ );
+
+
+/**
+ Initializes, changes, or resets the default operational setting for this
+ EFI MTFTPv4 Protocol driver instance.
+
+ @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
+ @param MtftpConfigData The pointer to the configuration data structure.
+
+ @retval EFI_SUCCESS The EFI MTFTPv4 Protocol driver was configured successfully.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_ACCESS_DENIED The EFI configuration could not be changed at this time because
+ there is one MTFTP background operation in progress.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) has not finished yet.
+ @retval EFI_UNSUPPORTED A configuration protocol (DHCP, BOOTP, RARP, etc.) could not
+ be located when clients choose to use the default address
+ settings.
+ @retval EFI_OUT_OF_RESOURCES The EFI MTFTPv4 Protocol driver instance data could not be
+ allocated.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI
+ MTFTPv4 Protocol driver instance is not configured.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP4_CONFIGURE)(
+ IN EFI_MTFTP4_PROTOCOL *This,
+ IN EFI_MTFTP4_CONFIG_DATA *MtftpConfigData OPTIONAL
+ );
+
+
+/**
+ Gets information about a file from an MTFTPv4 server.
+
+ @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
+ @param OverrideData Data that is used to override the existing parameters. If NULL,
+ the default parameters that were set in the
+ EFI_MTFTP4_PROTOCOL.Configure() function are used.
+ @param Filename The pointer to null-terminated ASCII file name string.
+ @param ModeStr The pointer to null-terminated ASCII mode string. If NULL, "octet" will be used.
+ @param OptionCount Number of option/value string pairs in OptionList.
+ @param OptionList The pointer to array of option/value string pairs. Ignored if
+ OptionCount is zero.
+ @param PacketLength The number of bytes in the returned packet.
+ @param Packet The pointer to the received packet. This buffer must be freed by
+ the caller.
+
+ @retval EFI_SUCCESS An MTFTPv4 OACK packet was received and is in the Packet.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - Filename is NULL.
+ - OptionCount is not zero and OptionList is NULL.
+ - One or more options in OptionList have wrong format.
+ - PacketLength is NULL.
+ - One or more IPv4 addresses in OverrideData are not valid
+ unicast IPv4 addresses if OverrideData is not NULL.
+ @retval EFI_UNSUPPORTED One or more options in the OptionList are in the
+ unsupported list of structure EFI_MTFTP4_MODE_DATA.
+ @retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) has not finished yet.
+ @retval EFI_ACCESS_DENIED The previous operation has not completed yet.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_TFTP_ERROR An MTFTPv4 ERROR packet was received and is in the Packet.
+ @retval EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received and the Packet is set to NULL.
+ @retval EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received and the Packet is set to NULL.
+ @retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received and the Packet is set to NULL.
+ @retval EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received and the Packet is set to NULL.
+ @retval EFI_ICMP_ERROR Some other ICMP ERROR packet was received and is in the Buffer.
+ @retval EFI_PROTOCOL_ERROR An unexpected MTFTPv4 packet was received and is in the Packet.
+ @retval EFI_TIMEOUT No responses were received from the MTFTPv4 server.
+ @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
+ @retval EFI_NO_MEDIA There was a media error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP4_GET_INFO)(
+ IN EFI_MTFTP4_PROTOCOL *This,
+ IN EFI_MTFTP4_OVERRIDE_DATA *OverrideData OPTIONAL,
+ IN UINT8 *Filename,
+ IN UINT8 *ModeStr OPTIONAL,
+ IN UINT8 OptionCount,
+ IN EFI_MTFTP4_OPTION *OptionList,
+ OUT UINT32 *PacketLength,
+ OUT EFI_MTFTP4_PACKET **Packet OPTIONAL
+ );
+
+/**
+ Parses the options in an MTFTPv4 OACK packet.
+
+ @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
+ @param PacketLen Length of the OACK packet to be parsed.
+ @param Packet The pointer to the OACK packet to be parsed.
+ @param OptionCount The pointer to the number of options in following OptionList.
+ @param OptionList The pointer to EFI_MTFTP4_OPTION storage. Call the EFI Boot
+ Service FreePool() to release the OptionList if the options
+ in this OptionList are not needed any more.
+
+ @retval EFI_SUCCESS The OACK packet was valid and the OptionCount and
+ OptionList parameters have been updated.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - PacketLen is 0.
+ - Packet is NULL or Packet is not a valid MTFTPv4 packet.
+ - OptionCount is NULL.
+ @retval EFI_NOT_FOUND No options were found in the OACK packet.
+ @retval EFI_OUT_OF_RESOURCES Storage for the OptionList array cannot be allocated.
+ @retval EFI_PROTOCOL_ERROR One or more of the option fields is invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP4_PARSE_OPTIONS)(
+ IN EFI_MTFTP4_PROTOCOL *This,
+ IN UINT32 PacketLen,
+ IN EFI_MTFTP4_PACKET *Packet,
+ OUT UINT32 *OptionCount,
+ OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL
+ );
+
+
+/**
+ Downloads a file from an MTFTPv4 server.
+
+ @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
+ @param Token The pointer to the token structure to provide the parameters that are
+ used in this operation.
+
+ @retval EFI_SUCCESS The data file has been transferred successfully.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_BUFFER_TOO_SMALL BufferSize is not zero but not large enough to hold the
+ downloaded data in downloading process.
+ @retval EFI_ABORTED Current operation is aborted by user.
+ @retval EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received.
+ @retval EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received.
+ @retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received.
+ @retval EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received.
+ @retval EFI_ICMP_ERROR Some other ICMP ERROR packet was received.
+ @retval EFI_TIMEOUT No responses were received from the MTFTPv4 server.
+ @retval EFI_TFTP_ERROR An MTFTPv4 ERROR packet was received.
+ @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
+ @retval EFI_NO_MEDIA There was a media error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP4_READ_FILE)(
+ IN EFI_MTFTP4_PROTOCOL *This,
+ IN EFI_MTFTP4_TOKEN *Token
+ );
+
+
+
+/**
+ Sends a file to an MTFTPv4 server.
+
+ @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
+ @param Token The pointer to the token structure to provide the parameters that are
+ used in this operation.
+
+ @retval EFI_SUCCESS The upload session has started.
+ @retval EFI_UNSUPPORTED The operation is not supported by this implementation.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_UNSUPPORTED One or more options in the Token.OptionList are in
+ the unsupported list of structure EFI_MTFTP4_MODE_DATA.
+ @retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv4 session.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_ACCESS_DENIED The previous operation has not completed yet.
+ @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP4_WRITE_FILE)(
+ IN EFI_MTFTP4_PROTOCOL *This,
+ IN EFI_MTFTP4_TOKEN *Token
+ );
+
+
+/**
+ Downloads a data file "directory" from an MTFTPv4 server. May be unsupported in some EFI
+ implementations.
+
+ @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
+ @param Token The pointer to the token structure to provide the parameters that are
+ used in this operation.
+
+ @retval EFI_SUCCESS The MTFTPv4 related file "directory" has been downloaded.
+ @retval EFI_UNSUPPORTED The operation is not supported by this implementation.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_UNSUPPORTED One or more options in the Token.OptionList are in
+ the unsupported list of structure EFI_MTFTP4_MODE_DATA.
+ @retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv4 session.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_ACCESS_DENIED The previous operation has not completed yet.
+ @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP4_READ_DIRECTORY)(
+ IN EFI_MTFTP4_PROTOCOL *This,
+ IN EFI_MTFTP4_TOKEN *Token
+ );
+
+/**
+ Polls for incoming data packets and processes outgoing data packets.
+
+ @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_NOT_STARTED This EFI MTFTPv4 Protocol instance has not been started.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
+ Consider increasing the polling rate.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP4_POLL)(
+ IN EFI_MTFTP4_PROTOCOL *This
+ );
+
+///
+/// The EFI_MTFTP4_PROTOCOL is designed to be used by UEFI drivers and applications
+/// to transmit and receive data files. The EFI MTFTPv4 Protocol driver uses
+/// the underlying EFI UDPv4 Protocol driver and EFI IPv4 Protocol driver.
+///
+struct _EFI_MTFTP4_PROTOCOL {
+ EFI_MTFTP4_GET_MODE_DATA GetModeData;
+ EFI_MTFTP4_CONFIGURE Configure;
+ EFI_MTFTP4_GET_INFO GetInfo;
+ EFI_MTFTP4_PARSE_OPTIONS ParseOptions;
+ EFI_MTFTP4_READ_FILE ReadFile;
+ EFI_MTFTP4_WRITE_FILE WriteFile;
+ EFI_MTFTP4_READ_DIRECTORY ReadDirectory;
+ EFI_MTFTP4_POLL Poll;
+};
+
+struct _EFI_MTFTP4_TOKEN {
+ ///
+ /// The status that is returned to the caller at the end of the operation
+ /// to indicate whether this operation completed successfully.
+ ///
+ EFI_STATUS Status;
+ ///
+ /// The event that will be signaled when the operation completes. If
+ /// set to NULL, the corresponding function will wait until the read or
+ /// write operation finishes. The type of Event must be
+ /// EVT_NOTIFY_SIGNAL. The Task Priority Level (TPL) of
+ /// Event must be lower than or equal to TPL_CALLBACK.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// If not NULL, the data that will be used to override the existing configure data.
+ ///
+ EFI_MTFTP4_OVERRIDE_DATA *OverrideData;
+ ///
+ /// The pointer to the null-terminated ASCII file name string.
+ ///
+ UINT8 *Filename;
+ ///
+ /// The pointer to the null-terminated ASCII mode string. If NULL, "octet" is used.
+ ///
+ UINT8 *ModeStr;
+ ///
+ /// Number of option/value string pairs.
+ ///
+ UINT32 OptionCount;
+ ///
+ /// The pointer to an array of option/value string pairs. Ignored if OptionCount is zero.
+ ///
+ EFI_MTFTP4_OPTION *OptionList;
+ ///
+ /// The size of the data buffer.
+ ///
+ UINT64 BufferSize;
+ ///
+ /// The pointer to the data buffer. Data that is downloaded from the
+ /// MTFTPv4 server is stored here. Data that is uploaded to the
+ /// MTFTPv4 server is read from here. Ignored if BufferSize is zero.
+ ///
+ VOID *Buffer;
+ ///
+ /// The pointer to the context that will be used by CheckPacket,
+ /// TimeoutCallback and PacketNeeded.
+ ///
+ VOID *Context;
+ ///
+ /// The pointer to the callback function to check the contents of the received packet.
+ ///
+ EFI_MTFTP4_CHECK_PACKET CheckPacket;
+ ///
+ /// The pointer to the function to be called when a timeout occurs.
+ ///
+ EFI_MTFTP4_TIMEOUT_CALLBACK TimeoutCallback;
+ ///
+ /// The pointer to the function to provide the needed packet contents.
+ ///
+ EFI_MTFTP4_PACKET_NEEDED PacketNeeded;
+};
+
+extern EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid;
+extern EFI_GUID gEfiMtftp4ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Mtftp6.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Mtftp6.h
new file mode 100644
index 0000000000..3273550e33
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Mtftp6.h
@@ -0,0 +1,826 @@
+/** @file
+ UEFI Multicast Trivial File Transfer Protocol v6 Definition, which is built upon
+ the EFI UDPv6 Protocol and provides basic services for client-side unicast and/or
+ multicast TFTP operations.
+
+ Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>
+ (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.2
+
+**/
+
+#ifndef __EFI_MTFTP6_PROTOCOL_H__
+#define __EFI_MTFTP6_PROTOCOL_H__
+
+
+#define EFI_MTFTP6_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0xd9760ff3, 0x3cca, 0x4267, {0x80, 0xf9, 0x75, 0x27, 0xfa, 0xfa, 0x42, 0x23 } \
+ }
+
+#define EFI_MTFTP6_PROTOCOL_GUID \
+ { \
+ 0xbf0a78ba, 0xec29, 0x49cf, {0xa1, 0xc9, 0x7a, 0xe5, 0x4e, 0xab, 0x6a, 0x51 } \
+ }
+
+typedef struct _EFI_MTFTP6_PROTOCOL EFI_MTFTP6_PROTOCOL;
+typedef struct _EFI_MTFTP6_TOKEN EFI_MTFTP6_TOKEN;
+
+///
+/// MTFTP Packet OpCodes
+///@{
+#define EFI_MTFTP6_OPCODE_RRQ 1 ///< The MTFTPv6 packet is a read request.
+#define EFI_MTFTP6_OPCODE_WRQ 2 ///< The MTFTPv6 packet is a write request.
+#define EFI_MTFTP6_OPCODE_DATA 3 ///< The MTFTPv6 packet is a data packet.
+#define EFI_MTFTP6_OPCODE_ACK 4 ///< The MTFTPv6 packet is an acknowledgement packet.
+#define EFI_MTFTP6_OPCODE_ERROR 5 ///< The MTFTPv6 packet is an error packet.
+#define EFI_MTFTP6_OPCODE_OACK 6 ///< The MTFTPv6 packet is an option acknowledgement packet.
+#define EFI_MTFTP6_OPCODE_DIR 7 ///< The MTFTPv6 packet is a directory query packet.
+#define EFI_MTFTP6_OPCODE_DATA8 8 ///< The MTFTPv6 packet is a data packet with a big block number.
+#define EFI_MTFTP6_OPCODE_ACK8 9 ///< The MTFTPv6 packet is an acknowledgement packet with a big block number.
+///@}
+
+///
+/// MTFTP ERROR Packet ErrorCodes
+///@{
+///
+/// The error code is not defined. See the error message in the packet (if any) for details.
+///
+#define EFI_MTFTP6_ERRORCODE_NOT_DEFINED 0
+///
+/// The file was not found.
+///
+#define EFI_MTFTP6_ERRORCODE_FILE_NOT_FOUND 1
+///
+/// There was an access violation.
+///
+#define EFI_MTFTP6_ERRORCODE_ACCESS_VIOLATION 2
+///
+/// The disk was full or its allocation was exceeded.
+///
+#define EFI_MTFTP6_ERRORCODE_DISK_FULL 3
+///
+/// The MTFTPv6 operation was illegal.
+///
+#define EFI_MTFTP6_ERRORCODE_ILLEGAL_OPERATION 4
+///
+/// The transfer ID is unknown.
+///
+#define EFI_MTFTP6_ERRORCODE_UNKNOWN_TRANSFER_ID 5
+///
+/// The file already exists.
+///
+#define EFI_MTFTP6_ERRORCODE_FILE_ALREADY_EXISTS 6
+///
+/// There is no such user.
+///
+#define EFI_MTFTP6_ERRORCODE_NO_SUCH_USER 7
+///
+/// The request has been denied due to option negotiation.
+///
+#define EFI_MTFTP6_ERRORCODE_REQUEST_DENIED 8
+///@}
+
+#pragma pack(1)
+
+///
+/// EFI_MTFTP6_REQ_HEADER
+///
+typedef struct {
+ ///
+ /// For this packet type, OpCode = EFI_MTFTP6_OPCODE_RRQ for a read request
+ /// or OpCode = EFI_MTFTP6_OPCODE_WRQ for a write request.
+ ///
+ UINT16 OpCode;
+ ///
+ /// The file name to be downloaded or uploaded.
+ ///
+ UINT8 Filename[1];
+} EFI_MTFTP6_REQ_HEADER;
+
+///
+/// EFI_MTFTP6_OACK_HEADER
+///
+typedef struct {
+ ///
+ /// For this packet type, OpCode = EFI_MTFTP6_OPCODE_OACK.
+ ///
+ UINT16 OpCode;
+ ///
+ /// The option strings in the option acknowledgement packet.
+ ///
+ UINT8 Data[1];
+} EFI_MTFTP6_OACK_HEADER;
+
+///
+/// EFI_MTFTP6_DATA_HEADER
+///
+typedef struct {
+ ///
+ /// For this packet type, OpCode = EFI_MTFTP6_OPCODE_DATA.
+ ///
+ UINT16 OpCode;
+ ///
+ /// Block number of this data packet.
+ ///
+ UINT16 Block;
+ ///
+ /// The content of this data packet.
+ ///
+ UINT8 Data[1];
+} EFI_MTFTP6_DATA_HEADER;
+
+///
+/// EFI_MTFTP6_ACK_HEADER
+///
+typedef struct {
+ ///
+ /// For this packet type, OpCode = EFI_MTFTP6_OPCODE_ACK.
+ ///
+ UINT16 OpCode;
+ ///
+ /// The block number of the data packet that is being acknowledged.
+ ///
+ UINT16 Block[1];
+} EFI_MTFTP6_ACK_HEADER;
+
+///
+/// EFI_MTFTP6_DATA8_HEADER
+///
+typedef struct {
+ ///
+ /// For this packet type, OpCode = EFI_MTFTP6_OPCODE_DATA8.
+ ///
+ UINT16 OpCode;
+ ///
+ /// The block number of data packet.
+ ///
+ UINT64 Block;
+ ///
+ /// The content of this data packet.
+ ///
+ UINT8 Data[1];
+} EFI_MTFTP6_DATA8_HEADER;
+
+///
+/// EFI_MTFTP6_ACK8_HEADER
+///
+typedef struct {
+ ///
+ /// For this packet type, OpCode = EFI_MTFTP6_OPCODE_ACK8.
+ ///
+ UINT16 OpCode;
+ ///
+ /// The block number of the data packet that is being acknowledged.
+ ///
+ UINT64 Block[1];
+} EFI_MTFTP6_ACK8_HEADER;
+
+///
+/// EFI_MTFTP6_ERROR_HEADER
+///
+typedef struct {
+ ///
+ /// For this packet type, OpCode = EFI_MTFTP6_OPCODE_ERROR.
+ ///
+ UINT16 OpCode;
+ ///
+ /// The error number as defined by the MTFTPv6 packet error codes.
+ ///
+ UINT16 ErrorCode;
+ ///
+ /// Error message string.
+ ///
+ UINT8 ErrorMessage[1];
+} EFI_MTFTP6_ERROR_HEADER;
+
+///
+/// EFI_MTFTP6_PACKET
+///
+typedef union {
+ UINT16 OpCode; ///< Type of packets as defined by the MTFTPv6 packet opcodes.
+ EFI_MTFTP6_REQ_HEADER Rrq; ///< Read request packet header.
+ EFI_MTFTP6_REQ_HEADER Wrq; ///< write request packet header.
+ EFI_MTFTP6_OACK_HEADER Oack; ///< Option acknowledge packet header.
+ EFI_MTFTP6_DATA_HEADER Data; ///< Data packet header.
+ EFI_MTFTP6_ACK_HEADER Ack; ///< Acknowledgement packet header.
+ EFI_MTFTP6_DATA8_HEADER Data8; ///< Data packet header with big block number.
+ EFI_MTFTP6_ACK8_HEADER Ack8; ///< Acknowledgement header with big block number.
+ EFI_MTFTP6_ERROR_HEADER Error; ///< Error packet header.
+} EFI_MTFTP6_PACKET;
+
+#pragma pack()
+
+///
+/// EFI_MTFTP6_CONFIG_DATA
+///
+typedef struct {
+ ///
+ /// The local IP address to use. Set to zero to let the underlying IPv6
+ /// driver choose a source address. If not zero it must be one of the
+ /// configured IP addresses in the underlying IPv6 driver.
+ ///
+ EFI_IPv6_ADDRESS StationIp;
+ ///
+ /// Local port number. Set to zero to use the automatically assigned port number.
+ ///
+ UINT16 LocalPort;
+ ///
+ /// The IP address of the MTFTPv6 server.
+ ///
+ EFI_IPv6_ADDRESS ServerIp;
+ ///
+ /// The initial MTFTPv6 server port number. Request packets are
+ /// sent to this port. This number is almost always 69 and using zero
+ /// defaults to 69.
+ UINT16 InitialServerPort;
+ ///
+ /// The number of times to transmit MTFTPv6 request packets and wait for a response.
+ ///
+ UINT16 TryCount;
+ ///
+ /// The number of seconds to wait for a response after sending the MTFTPv6 request packet.
+ ///
+ UINT16 TimeoutValue;
+} EFI_MTFTP6_CONFIG_DATA;
+
+///
+/// EFI_MTFTP6_MODE_DATA
+///
+typedef struct {
+ ///
+ /// The configuration data of this instance.
+ ///
+ EFI_MTFTP6_CONFIG_DATA ConfigData;
+ ///
+ /// The number of option strings in the following SupportedOptions array.
+ ///
+ UINT8 SupportedOptionCount;
+ ///
+ /// An array of null-terminated ASCII option strings that are recognized and supported by
+ /// this EFI MTFTPv6 Protocol driver implementation. The buffer is
+ /// read only to the caller and the caller should NOT free the buffer.
+ ///
+ UINT8 **SupportedOptions;
+} EFI_MTFTP6_MODE_DATA;
+
+///
+/// EFI_MTFTP_OVERRIDE_DATA
+///
+typedef struct {
+ ///
+ /// IP address of the MTFTPv6 server. If set to all zero, the value that
+ /// was set by the EFI_MTFTP6_PROTOCOL.Configure() function will be used.
+ ///
+ EFI_IPv6_ADDRESS ServerIp;
+ ///
+ /// MTFTPv6 server port number. If set to zero, it will use the value
+ /// that was set by the EFI_MTFTP6_PROTOCOL.Configure() function.
+ ///
+ UINT16 ServerPort;
+ ///
+ /// Number of times to transmit MTFTPv6 request packets and wait
+ /// for a response. If set to zero, the value that was set by
+ /// theEFI_MTFTP6_PROTOCOL.Configure() function will be used.
+ ///
+ UINT16 TryCount;
+ ///
+ /// Number of seconds to wait for a response after sending the
+ /// MTFTPv6 request packet. If set to zero, the value that was set by
+ /// the EFI_MTFTP6_PROTOCOL.Configure() function will be used.
+ ///
+ UINT16 TimeoutValue;
+} EFI_MTFTP6_OVERRIDE_DATA;
+
+///
+/// EFI_MTFTP6_OPTION
+///
+typedef struct {
+ UINT8 *OptionStr; ///< Pointer to the null-terminated ASCII MTFTPv6 option string.
+ UINT8 *ValueStr; ///< Pointer to the null-terminated ASCII MTFTPv6 value string.
+} EFI_MTFTP6_OPTION;
+
+/**
+ EFI_MTFTP6_TIMEOUT_CALLBACK is a callback function that the caller provides to capture the
+ timeout event in the EFI_MTFTP6_PROTOCOL.ReadFile(), EFI_MTFTP6_PROTOCOL.WriteFile() or
+ EFI_MTFTP6_PROTOCOL.ReadDirectory() functions.
+
+ Whenever a timeout occurs, the EFI MTFTPv6 Protocol driver will call the EFI_MTFTP6_TIMEOUT_CALLBACK
+ function to notify the caller of the timeout event. Any status code other than EFI_SUCCESS
+ that is returned from this function will abort the current download process.
+
+ @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
+ @param[in] Token The token that the caller provided in the EFI_MTFTP6_PROTOCOl.ReadFile(),
+ WriteFile() or ReadDirectory() function.
+ @param[in] PacketLen Indicates the length of the packet.
+ @param[in] Packet Pointer to an MTFTPv6 packet.
+
+ @retval EFI_SUCCESS Operation success.
+ @retval Others Aborts session.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP6_CHECK_PACKET)(
+ IN EFI_MTFTP6_PROTOCOL *This,
+ IN EFI_MTFTP6_TOKEN *Token,
+ IN UINT16 PacketLen,
+ IN EFI_MTFTP6_PACKET *Packet
+ );
+
+/**
+ EFI_MTFTP6_TIMEOUT_CALLBACK is a callback function that the caller provides to capture the
+ timeout event in the EFI_MTFTP6_PROTOCOL.ReadFile(), EFI_MTFTP6_PROTOCOL.WriteFile() or
+ EFI_MTFTP6_PROTOCOL.ReadDirectory() functions.
+
+ Whenever a timeout occurs, the EFI MTFTPv6 Protocol driver will call the EFI_MTFTP6_TIMEOUT_CALLBACK
+ function to notify the caller of the timeout event. Any status code other than EFI_SUCCESS
+ that is returned from this function will abort the current download process.
+
+ @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
+ @param[in] Token The token that is provided in the EFI_MTFTP6_PROTOCOL.ReadFile() or
+ EFI_MTFTP6_PROTOCOL.WriteFile() or EFI_MTFTP6_PROTOCOL.ReadDirectory()
+ functions by the caller.
+
+ @retval EFI_SUCCESS Operation success.
+ @retval Others Aborts session.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP6_TIMEOUT_CALLBACK)(
+ IN EFI_MTFTP6_PROTOCOL *This,
+ IN EFI_MTFTP6_TOKEN *Token
+ );
+
+/**
+ EFI_MTFTP6_PACKET_NEEDED is a callback function that the caller provides to feed data to the
+ EFI_MTFTP6_PROTOCOL.WriteFile() function.
+
+ EFI_MTFTP6_PACKET_NEEDED provides another mechanism for the caller to provide data to upload
+ other than a static buffer. The EFI MTFTP6 Protocol driver always calls EFI_MTFTP6_PACKET_NEEDED
+ to get packet data from the caller if no static buffer was given in the initial call to
+ EFI_MTFTP6_PROTOCOL.WriteFile() function. Setting *Length to zero signals the end of the session.
+ Returning a status code other than EFI_SUCCESS aborts the session.
+
+ @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
+ @param[in] Token The token provided in the EFI_MTFTP6_PROTOCOL.WriteFile() by the caller.
+ @param[in, out] Length Indicates the length of the raw data wanted on input, and the
+ length the data available on output.
+ @param[out] Buffer Pointer to the buffer where the data is stored.
+
+ @retval EFI_SUCCESS Operation success.
+ @retval Others Aborts session.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP6_PACKET_NEEDED)(
+ IN EFI_MTFTP6_PROTOCOL *This,
+ IN EFI_MTFTP6_TOKEN *Token,
+ IN OUT UINT16 *Length,
+ OUT VOID **Buffer
+ );
+
+struct _EFI_MTFTP6_TOKEN {
+ ///
+ /// The status that is returned to the caller at the end of the operation
+ /// to indicate whether this operation completed successfully.
+ /// Defined Status values are listed below.
+ ///
+ EFI_STATUS Status;
+ ///
+ /// The event that will be signaled when the operation completes. If
+ /// set to NULL, the corresponding function will wait until the read or
+ /// write operation finishes. The type of Event must be EVT_NOTIFY_SIGNAL.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// If not NULL, the data that will be used to override the existing
+ /// configure data.
+ ///
+ EFI_MTFTP6_OVERRIDE_DATA *OverrideData;
+ ///
+ /// Pointer to the null-terminated ASCII file name string.
+ ///
+ UINT8 *Filename;
+ ///
+ /// Pointer to the null-terminated ASCII mode string. If NULL, octet is used.
+ ///
+ UINT8 *ModeStr;
+ ///
+ /// Number of option/value string pairs.
+ ///
+ UINT32 OptionCount;
+ ///
+ /// Pointer to an array of option/value string pairs. Ignored if
+ /// OptionCount is zero. Both a remote server and this driver
+ /// implementation should support these options. If one or more
+ /// options are unrecognized by this implementation, it is sent to the
+ /// remote server without being changed.
+ ///
+ EFI_MTFTP6_OPTION *OptionList;
+ ///
+ /// On input, the size, in bytes, of Buffer. On output, the number
+ /// of bytes transferred.
+ ///
+ UINT64 BufferSize;
+ ///
+ /// Pointer to the data buffer. Data that is downloaded from the
+ /// MTFTPv6 server is stored here. Data that is uploaded to the
+ /// MTFTPv6 server is read from here. Ignored if BufferSize is zero.
+ ///
+ VOID *Buffer;
+ ///
+ /// Pointer to the context that will be used by CheckPacket,
+ /// TimeoutCallback and PacketNeeded.
+ ///
+ VOID *Context;
+ ///
+ /// Pointer to the callback function to check the contents of the
+ /// received packet.
+ ///
+ EFI_MTFTP6_CHECK_PACKET CheckPacket;
+ ///
+ /// Pointer to the function to be called when a timeout occurs.
+ ///
+ EFI_MTFTP6_TIMEOUT_CALLBACK TimeoutCallback;
+ ///
+ /// Pointer to the function to provide the needed packet contents.
+ /// Only used in WriteFile() operation.
+ ///
+ EFI_MTFTP6_PACKET_NEEDED PacketNeeded;
+};
+
+/**
+ Read the current operational settings.
+
+ The GetModeData() function reads the current operational settings of this EFI MTFTPv6
+ Protocol driver instance.
+
+ @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
+ @param[out] ModeData The buffer in which the EFI MTFTPv6 Protocol driver mode
+ data is returned.
+
+ @retval EFI_SUCCESS The configuration data was successfully returned.
+ @retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated.
+ @retval EFI_INVALID_PARAMETER This is NULL or ModeData is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP6_GET_MODE_DATA)(
+ IN EFI_MTFTP6_PROTOCOL *This,
+ OUT EFI_MTFTP6_MODE_DATA *ModeData
+ );
+
+/**
+ Initializes, changes, or resets the default operational setting for this EFI MTFTPv6
+ Protocol driver instance.
+
+ The Configure() function is used to set and change the configuration data for this EFI
+ MTFTPv6 Protocol driver instance. The configuration data can be reset to startup defaults by calling
+ Configure() with MtftpConfigData set to NULL. Whenever the instance is reset, any
+ pending operation is aborted. By changing the EFI MTFTPv6 Protocol driver instance configuration
+ data, the client can connect to different MTFTPv6 servers. The configuration parameters in
+ MtftpConfigData are used as the default parameters in later MTFTPv6 operations and can be
+ overridden in later operations.
+
+ @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
+ @param[in] MtftpConfigData Pointer to the configuration data structure.
+
+ @retval EFI_SUCCESS The EFI MTFTPv6 Protocol instance was configured successfully.
+ @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
+ - This is NULL.
+ - MtftpConfigData.StationIp is neither zero nor one
+ of the configured IP addresses in the underlying IPv6 driver.
+ - MtftpCofigData.ServerIp is not a valid IPv6 unicast address.
+ @retval EFI_ACCESS_DENIED - The configuration could not be changed at this time because there
+ is some MTFTP background operation in progress.
+ - MtftpCofigData.LocalPort is already in use.
+ @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source
+ address for this instance, but no source address was available for use.
+ @retval EFI_OUT_OF_RESOURCES The EFI MTFTPv6 Protocol driver instance data could not be
+ allocated.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI
+ MTFTPv6 Protocol driver instance is not configured.
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP6_CONFIGURE)(
+ IN EFI_MTFTP6_PROTOCOL *This,
+ IN EFI_MTFTP6_CONFIG_DATA *MtftpConfigData OPTIONAL
+);
+
+/**
+ Get information about a file from an MTFTPv6 server.
+
+ The GetInfo() function assembles an MTFTPv6 request packet with options, sends it to the
+ MTFTPv6 server, and may return an MTFTPv6 OACK, MTFTPv6 ERROR, or ICMP ERROR packet.
+ Retries occur only if no response packets are received from the MTFTPv6 server before the
+ timeout expires.
+
+ @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
+ @param[in] OverrideData Data that is used to override the existing parameters. If NULL, the
+ default parameters that were set in the EFI_MTFTP6_PROTOCOL.Configure()
+ function are used.
+ @param[in] Filename Pointer to null-terminated ASCII file name string.
+ @param[in] ModeStr Pointer to null-terminated ASCII mode string. If NULL, octet will be used
+ @param[in] OptionCount Number of option/value string pairs in OptionList.
+ @param[in] OptionList Pointer to array of option/value string pairs. Ignored if
+ OptionCount is zero.
+ @param[out] PacketLength The number of bytes in the returned packet.
+ @param[out] Packet The pointer to the received packet. This buffer must be freed by
+ the caller.
+
+ @retval EFI_SUCCESS An MTFTPv6 OACK packet was received and is in the Packet.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - Filename is NULL
+ - OptionCount is not zero and OptionList is NULL.
+ - One or more options in OptionList have wrong format.
+ - PacketLength is NULL.
+ - OverrideData.ServerIp is not valid unicast IPv6 addresses.
+ @retval EFI_UNSUPPORTED One or more options in the OptionList are unsupported by
+ this implementation.
+ @retval EFI_NOT_STARTED The EFI MTFTPv6 Protocol driver has not been started.
+ @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source
+ address for this instance, but no source address was available for use.
+ @retval EFI_ACCESS_DENIED The previous operation has not completed yet.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_TFTP_ERROR An MTFTPv6 ERROR packet was received and is in the Packet.
+ @retval EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received and the Packet is set to NULL.
+ @retval EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received and the Packet is set to NULL.
+ @retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received and the Packet is set to NULL.
+ @retval EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received and the Packet is set to NULL.
+ @retval EFI_ICMP_ERROR Some other ICMP ERROR packet was received and the Packet is set to NULL.
+ @retval EFI_PROTOCOL_ERROR An unexpected MTFTPv6 packet was received and is in the Packet.
+ @retval EFI_TIMEOUT No responses were received from the MTFTPv6 server.
+ @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
+ @retval EFI_NO_MEDIA There was a media error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP6_GET_INFO)(
+ IN EFI_MTFTP6_PROTOCOL *This,
+ IN EFI_MTFTP6_OVERRIDE_DATA *OverrideData OPTIONAL,
+ IN UINT8 *Filename,
+ IN UINT8 *ModeStr OPTIONAL,
+ IN UINT8 OptionCount,
+ IN EFI_MTFTP6_OPTION *OptionList OPTIONAL,
+ OUT UINT32 *PacketLength,
+ OUT EFI_MTFTP6_PACKET **Packet OPTIONAL
+);
+
+/**
+ Parse the options in an MTFTPv6 OACK packet.
+
+ The ParseOptions() function parses the option fields in an MTFTPv6 OACK packet and
+ returns the number of options that were found and optionally a list of pointers to
+ the options in the packet.
+ If one or more of the option fields are not valid, then EFI_PROTOCOL_ERROR is returned
+ and *OptionCount and *OptionList stop at the last valid option.
+
+ @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
+ @param[in] PacketLen Length of the OACK packet to be parsed.
+ @param[in] Packet Pointer to the OACK packet to be parsed.
+ @param[out] OptionCount Pointer to the number of options in the following OptionList.
+ @param[out] OptionList Pointer to EFI_MTFTP6_OPTION storage. Each pointer in the
+ OptionList points to the corresponding MTFTP option buffer
+ in the Packet. Call the EFI Boot Service FreePool() to
+ release the OptionList if the options in this OptionList
+ are not needed any more.
+
+ @retval EFI_SUCCESS The OACK packet was valid and the OptionCount and
+ OptionList parameters have been updated.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - PacketLen is 0.
+ - Packet is NULL or Packet is not a valid MTFTPv6 packet.
+ - OptionCount is NULL.
+ @retval EFI_NOT_FOUND No options were found in the OACK packet.
+ @retval EFI_OUT_OF_RESOURCES Storage for the OptionList array can not be allocated.
+ @retval EFI_PROTOCOL_ERROR One or more of the option fields is invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP6_PARSE_OPTIONS)(
+ IN EFI_MTFTP6_PROTOCOL *This,
+ IN UINT32 PacketLen,
+ IN EFI_MTFTP6_PACKET *Packet,
+ OUT UINT32 *OptionCount,
+ OUT EFI_MTFTP6_OPTION **OptionList OPTIONAL
+ );
+
+/**
+ Download a file from an MTFTPv6 server.
+
+ The ReadFile() function is used to initialize and start an MTFTPv6 download process and
+ optionally wait for completion. When the download operation completes, whether successfully or
+ not, the Token.Status field is updated by the EFI MTFTPv6 Protocol driver and then
+ Token.Event is signaled if it is not NULL.
+
+ Data can be downloaded from the MTFTPv6 server into either of the following locations:
+ - A fixed buffer that is pointed to by Token.Buffer
+ - A download service function that is pointed to by Token.CheckPacket
+
+ If both Token.Buffer and Token.CheckPacket are used, then Token.CheckPacket
+ will be called first. If the call is successful, the packet will be stored in Token.Buffer.
+
+ @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
+ @param[in] Token Pointer to the token structure to provide the parameters that are
+ used in this operation.
+
+ @retval EFI_SUCCESS The data file has been transferred successfully.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_BUFFER_TOO_SMALL BufferSize is not zero but not large enough to hold the
+ downloaded data in downloading process.
+ @retval EFI_ABORTED Current operation is aborted by user.
+ @retval EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received.
+ @retval EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received.
+ @retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received.
+ @retval EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received.
+ @retval EFI_ICMP_ERROR An ICMP ERROR packet was received.
+ @retval EFI_TIMEOUT No responses were received from the MTFTPv6 server.
+ @retval EFI_TFTP_ERROR An MTFTPv6 ERROR packet was received.
+ @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
+ @retval EFI_NO_MEDIA There was a media error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP6_READ_FILE)(
+ IN EFI_MTFTP6_PROTOCOL *This,
+ IN EFI_MTFTP6_TOKEN *Token
+ );
+
+/**
+ Send a file to an MTFTPv6 server. May be unsupported in some implementations.
+
+ The WriteFile() function is used to initialize an uploading operation with the given option list
+ and optionally wait for completion. If one or more of the options is not supported by the server, the
+ unsupported options are ignored and a standard TFTP process starts instead. When the upload
+ process completes, whether successfully or not, Token.Event is signaled, and the EFI MTFTPv6
+ Protocol driver updates Token.Status.
+
+ The caller can supply the data to be uploaded in the following two modes:
+ - Through the user-provided buffer
+ - Through a callback function
+
+ With the user-provided buffer, the Token.BufferSize field indicates the length of the buffer,
+ and the driver will upload the data in the buffer. With an EFI_MTFTP6_PACKET_NEEDED
+ callback function, the driver will call this callback function to get more data from the user to upload.
+ See the definition of EFI_MTFTP6_PACKET_NEEDED for more information. These two modes
+ cannot be used at the same time. The callback function will be ignored if the user provides the
+ buffer.
+
+ @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
+ @param[in] Token Pointer to the token structure to provide the parameters that are
+ used in this operation.
+
+ @retval EFI_SUCCESS The upload session has started.
+ @retval EFI_UNSUPPORTED The operation is not supported by this implementation.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token.Filename is NULL.
+ - Token.OptionCount is not zero and Token.OptionList is NULL.
+ - One or more options in Token.OptionList have wrong format.
+ - Token.Buffer and Token.PacketNeeded are both NULL.
+ - Token.OverrideData.ServerIp is not valid unicast IPv6 addresses.
+ @retval EFI_UNSUPPORTED One or more options in the Token.OptionList are not
+ supported by this implementation.
+ @retval EFI_NOT_STARTED The EFI MTFTPv6 Protocol driver has not been started.
+ @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source
+ address for this instance, but no source address was available for use.
+ @retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv6 session.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_ACCESS_DENIED The previous operation has not completed yet.
+ @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP6_WRITE_FILE)(
+ IN EFI_MTFTP6_PROTOCOL *This,
+ IN EFI_MTFTP6_TOKEN *Token
+ );
+
+/**
+ Download a data file directory from an MTFTPv6 server. May be unsupported in some implementations.
+
+ The ReadDirectory() function is used to return a list of files on the MTFTPv6 server that are
+ logically (or operationally) related to Token.Filename. The directory request packet that is sent
+ to the server is built with the option list that was provided by caller, if present.
+
+ The file information that the server returns is put into either of the following locations:
+ - A fixed buffer that is pointed to by Token.Buffer
+ - A download service function that is pointed to by Token.CheckPacket
+
+ If both Token.Buffer and Token.CheckPacket are used, then Token.CheckPacket
+ will be called first. If the call is successful, the packet will be stored in Token.Buffer.
+
+ The returned directory listing in the Token.Buffer or EFI_MTFTP6_PACKET consists of a list
+ of two or three variable-length ASCII strings, each terminated by a null character, for each file in the
+ directory. If the multicast option is involved, the first field of each directory entry is the static
+ multicast IP address and UDP port number that is associated with the file name. The format of the
+ field is ip:ip:ip:ip:port. If the multicast option is not involved, this field and its terminating
+ null character are not present.
+
+ The next field of each directory entry is the file name and the last field is the file information string.
+ The information string contains the file size and the create/modify timestamp. The format of the
+ information string is filesize yyyy-mm-dd hh:mm:ss:ffff. The timestamp is
+ Coordinated Universal Time (UTC; also known as Greenwich Mean Time [GMT]).
+
+ @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
+ @param[in] Token Pointer to the token structure to provide the parameters that are
+ used in this operation.
+
+ @retval EFI_SUCCESS The MTFTPv6 related file "directory" has been downloaded.
+ @retval EFI_UNSUPPORTED The EFI MTFTPv6 Protocol driver does not support this function.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token.Filename is NULL.
+ - Token.OptionCount is not zero and Token.OptionList is NULL.
+ - One or more options in Token.OptionList have wrong format.
+ - Token.Buffer and Token.CheckPacket are both NULL.
+ - Token.OverrideData.ServerIp is not valid unicast IPv6 addresses.
+ @retval EFI_UNSUPPORTED One or more options in the Token.OptionList are not
+ supported by this implementation.
+ @retval EFI_NOT_STARTED The EFI MTFTPv6 Protocol driver has not been started.
+ @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source
+ address for this instance, but no source address was available for use.
+ @retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv6 session.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+ @retval EFI_ACCESS_DENIED The previous operation has not completed yet.
+ @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP6_READ_DIRECTORY)(
+ IN EFI_MTFTP6_PROTOCOL *This,
+ IN EFI_MTFTP6_TOKEN *Token
+);
+
+/**
+ Polls for incoming data packets and processes outgoing data packets.
+
+ The Poll() function can be used by network drivers and applications to increase the rate that data
+ packets are moved between the communications device and the transmit and receive queues.
+ In some systems, the periodic timer event in the managed network driver may not poll the
+ underlying communications device fast enough to transmit and/or receive all data packets without
+ missing incoming packets or dropping outgoing packets. Drivers and applications that are
+ experiencing packet loss should try calling the Poll() function more often.
+
+ @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_NOT_STARTED This EFI MTFTPv6 Protocol instance has not been started.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
+ Consider increasing the polling rate.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MTFTP6_POLL)(
+ IN EFI_MTFTP6_PROTOCOL *This
+ );
+
+///
+/// The EFI_MTFTP6_PROTOCOL is designed to be used by UEFI drivers and applications to transmit
+/// and receive data files. The EFI MTFTPv6 Protocol driver uses the underlying EFI UDPv6 Protocol
+/// driver and EFI IPv6 Protocol driver.
+///
+struct _EFI_MTFTP6_PROTOCOL {
+ EFI_MTFTP6_GET_MODE_DATA GetModeData;
+ EFI_MTFTP6_CONFIGURE Configure;
+ EFI_MTFTP6_GET_INFO GetInfo;
+ EFI_MTFTP6_PARSE_OPTIONS ParseOptions;
+ EFI_MTFTP6_READ_FILE ReadFile;
+ EFI_MTFTP6_WRITE_FILE WriteFile;
+ EFI_MTFTP6_READ_DIRECTORY ReadDirectory;
+ EFI_MTFTP6_POLL Poll;
+};
+
+extern EFI_GUID gEfiMtftp6ServiceBindingProtocolGuid;
+extern EFI_GUID gEfiMtftp6ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/NetworkInterfaceIdentifier.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/NetworkInterfaceIdentifier.h
new file mode 100644
index 0000000000..1b7654503d
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/NetworkInterfaceIdentifier.h
@@ -0,0 +1,118 @@
+/** @file
+ EFI Network Interface Identifier Protocol.
+
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in EFI Specification 1.10.
+
+**/
+
+#ifndef __EFI_NETWORK_INTERFACE_IDENTIFER_H__
+#define __EFI_NETWORK_INTERFACE_IDENTIFER_H__
+
+//
+// GUID retired from UEFI Specification 2.1b
+//
+#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID \
+ { \
+ 0xE18541CD, 0xF755, 0x4f73, {0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29 } \
+ }
+
+//
+// GUID intruduced in UEFI Specification 2.1b
+//
+#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID_31 \
+ { \
+ 0x1ACED566, 0x76ED, 0x4218, {0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89 } \
+ }
+
+//
+// Revision defined in UEFI Specification 2.4
+//
+#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION 0x00020000
+
+
+///
+/// Revision defined in EFI1.1.
+///
+#define EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE_REVISION EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION
+
+///
+/// Forward reference for pure ANSI compatability.
+///
+typedef struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL;
+
+///
+/// Protocol defined in EFI1.1.
+///
+typedef EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE;
+
+///
+/// An optional protocol that is used to describe details about the software
+/// layer that is used to produce the Simple Network Protocol.
+///
+struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL {
+ UINT64 Revision; ///< The revision of the EFI_NETWORK_INTERFACE_IDENTIFIER protocol.
+ UINT64 Id; ///< The address of the first byte of the identifying structure for this network
+ ///< interface. This is only valid when the network interface is started
+ ///< (see Start()). When the network interface is not started, this field is set to zero.
+ UINT64 ImageAddr; ///< The address of the first byte of the identifying structure for this
+ ///< network interface. This is set to zero if there is no structure.
+ UINT32 ImageSize; ///< The size of unrelocated network interface image.
+ CHAR8 StringId[4];///< A four-character ASCII string that is sent in the class identifier field of
+ ///< option 60 in DHCP. For a Type of EfiNetworkInterfaceUndi, this field is UNDI.
+ UINT8 Type; ///< Network interface type. This will be set to one of the values
+ ///< in EFI_NETWORK_INTERFACE_TYPE.
+ UINT8 MajorVer; ///< Major version number.
+ UINT8 MinorVer; ///< Minor version number.
+ BOOLEAN Ipv6Supported; ///< TRUE if the network interface supports IPv6; otherwise FALSE.
+ UINT16 IfNum; ///< The network interface number that is being identified by this Network
+ ///< Interface Identifier Protocol. This field must be less than or
+ ///< equal to the (IFcnt | IFcntExt <<8 ) fields in the !PXE structure.
+
+};
+
+///
+///*******************************************************
+/// EFI_NETWORK_INTERFACE_TYPE
+///*******************************************************
+///
+typedef enum {
+ EfiNetworkInterfaceUndi = 1
+} EFI_NETWORK_INTERFACE_TYPE;
+
+///
+/// Forward reference for pure ANSI compatability.
+///
+typedef struct undiconfig_table UNDI_CONFIG_TABLE;
+
+///
+/// The format of the configuration table for UNDI
+///
+struct undiconfig_table {
+ UINT32 NumberOfInterfaces; ///< The number of NIC devices
+ ///< that this UNDI controls.
+ UINT32 reserved;
+ UNDI_CONFIG_TABLE *nextlink; ///< A pointer to the next UNDI
+ ///< configuration table.
+ ///
+ /// The length of this array is given in the NumberOfInterfaces field.
+ ///
+ struct {
+ VOID *NII_InterfacePointer; ///< Pointer to the NII interface structure.
+ VOID *DevicePathPointer; ///< Pointer to the device path for this NIC.
+ } NII_entry[1];
+};
+
+extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid;
+extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid_31;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/NvdimmLabel.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/NvdimmLabel.h
new file mode 100644
index 0000000000..edfeec0eb0
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/NvdimmLabel.h
@@ -0,0 +1,351 @@
+/** @file
+ EFI NVDIMM Label Protocol Definition
+
+ The EFI NVDIMM Label Protocol is used to Provides services that allow management
+ of labels contained in a Label Storage Area that are associated with a specific
+ NVDIMM Device Path.
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI Specification 2.7.
+
+**/
+
+#ifndef __EFI_NVDIMM_LABEL_PROTOCOL_H__
+#define __EFI_NVDIMM_LABEL_PROTOCOL_H__
+
+#define EFI_NVDIMM_LABEL_PROTOCOL_GUID \
+ { \
+ 0xd40b6b80, 0x97d5, 0x4282, {0xbb, 0x1d, 0x22, 0x3a, 0x16, 0x91, 0x80, 0x58 } \
+ }
+
+typedef struct _EFI_NVDIMM_LABEL_PROTOCOL EFI_NVDIMM_LABEL_PROTOCOL;
+
+#define EFI_NVDIMM_LABEL_INDEX_SIG_LEN 16
+#define EFI_NVDIMM_LABEL_INDEX_ALIGN 256
+typedef struct {
+ ///
+ /// Signature of the Index Block data structure. Must be "NAMESPACE_INDEX\0".
+ ///
+ CHAR8 Sig[EFI_NVDIMM_LABEL_INDEX_SIG_LEN];
+
+ ///
+ /// Attributes of this Label Storage Area.
+ ///
+ UINT8 Flags[3];
+
+ ///
+ /// Size of each label in bytes, 128 bytes << LabelSize.
+ /// 1 means 256 bytes, 2 means 512 bytes, etc. Shall be 1 or greater.
+ ///
+ UINT8 LabelSize;
+
+ ///
+ /// Sequence number used to identify which of the two Index Blocks is current.
+ ///
+ UINT32 Seq;
+
+ ///
+ /// The offset of this Index Block in the Label Storage Area.
+ ///
+ UINT64 MyOff;
+
+ ///
+ /// The size of this Index Block in bytes.
+ /// This field must be a multiple of the EFI_NVDIMM_LABEL_INDEX_ALIGN.
+ ///
+ UINT64 MySize;
+
+ ///
+ /// The offset of the other Index Block paired with this one.
+ ///
+ UINT64 OtherOff;
+
+ ///
+ /// The offset of the first slot where labels are stored in this Label Storage Area.
+ ///
+ UINT64 LabelOff;
+
+ ///
+ /// The total number of slots for storing labels in this Label Storage Area.
+ ///
+ UINT32 NSlot;
+
+ ///
+ /// Major version number. Value shall be 1.
+ ///
+ UINT16 Major;
+
+ ///
+ /// Minor version number. Value shall be 2.
+ ///
+ UINT16 Minor;
+
+ ///
+ /// 64-bit Fletcher64 checksum of all fields in this Index Block.
+ ///
+ UINT64 Checksum;
+
+ ///
+ /// Array of unsigned bytes implementing a bitmask that tracks which label slots are free.
+ /// A bit value of 0 indicates in use, 1 indicates free.
+ /// The size of this field is the number of bytes required to hold the bitmask with NSlot bits,
+ /// padded with additional zero bytes to make the Index Block size a multiple of EFI_NVDIMM_LABEL_INDEX_ALIGN.
+ /// Any bits allocated beyond NSlot bits must be zero.
+ ///
+ UINT8 Free[];
+} EFI_NVDIMM_LABEL_INDEX_BLOCK;
+
+#define EFI_NVDIMM_LABEL_NAME_LEN 64
+
+///
+/// The label is read-only.
+///
+#define EFI_NVDIMM_LABEL_FLAGS_ROLABEL 0x00000001
+
+///
+/// When set, the complete label set is local to a single NVDIMM Label Storage Area.
+/// When clear, the complete label set is contained on multiple NVDIMM Label Storage Areas.
+///
+#define EFI_NVDIMM_LABEL_FLAGS_LOCAL 0x00000002
+
+///
+/// This reserved flag is utilized on older implementations and has been deprecated.
+/// Do not use.
+//
+#define EFI_NVDIMM_LABEL_FLAGS_RESERVED 0x00000004
+
+///
+/// When set, the label set is being updated.
+///
+#define EFI_NVDIMM_LABEL_FLAGS_UPDATING 0x00000008
+
+typedef struct {
+ ///
+ /// Unique Label Identifier UUID per RFC 4122.
+ ///
+ EFI_GUID Uuid;
+
+ ///
+ /// NULL-terminated string using UTF-8 character formatting.
+ ///
+ CHAR8 Name[EFI_NVDIMM_LABEL_NAME_LEN];
+
+ ///
+ /// Attributes of this namespace.
+ ///
+ UINT32 Flags;
+
+ ///
+ /// Total number of labels describing this namespace.
+ ///
+ UINT16 NLabel;
+
+ ///
+ /// Position of this label in list of labels for this namespace.
+ ///
+ UINT16 Position;
+
+ ///
+ /// The SetCookie is utilized by SW to perform consistency checks on the Interleave Set to verify the current
+ /// physical device configuration matches the original physical configuration when the labels were created
+ /// for the set.The label is considered invalid if the actual label set cookie doesn't match the cookie stored here.
+ ///
+ UINT64 SetCookie;
+
+ ///
+ /// This is the default logical block size in bytes and may be superseded by a block size that is specified
+ /// in the AbstractionGuid.
+ ///
+ UINT64 LbaSize;
+
+ ///
+ /// The DPA is the DIMM Physical address where the NVM contributing to this namespace begins on this NVDIMM.
+ ///
+ UINT64 Dpa;
+
+ ///
+ /// The extent of the DPA contributed by this label.
+ ///
+ UINT64 RawSize;
+
+ ///
+ /// Current slot in the Label Storage Area where this label is stored.
+ ///
+ UINT32 Slot;
+
+ ///
+ /// Alignment hint used to advertise the preferred alignment of the data from within the namespace defined by this label.
+ ///
+ UINT8 Alignment;
+
+ ///
+ /// Shall be 0.
+ ///
+ UINT8 Reserved[3];
+
+ ///
+ /// Range Type GUID that describes the access mechanism for the specified DPA range.
+ ///
+ EFI_GUID TypeGuid;
+
+ ///
+ /// Identifies the address abstraction mechanism for this namespace. A value of 0 indicates no mechanism used.
+ ///
+ EFI_GUID AddressAbstractionGuid;
+
+ ///
+ /// Shall be 0.
+ ///
+ UINT8 Reserved1[88];
+
+ ///
+ /// 64-bit Fletcher64 checksum of all fields in this Label.
+ /// This field is considered zero when the checksum is computed.
+ ///
+ UINT64 Checksum;
+} EFI_NVDIMM_LABEL;
+
+typedef struct {
+ ///
+ /// The Region Offset field from the ACPI NFIT NVDIMM Region Mapping Structure for a given entry.
+ ///
+ UINT64 RegionOffset;
+
+ ///
+ /// The serial number of the NVDIMM, assigned by the module vendor.
+ ///
+ UINT32 SerialNumber;
+
+ ///
+ /// The identifier indicating the vendor of the NVDIMM.
+ ///
+ UINT16 VendorId;
+
+ ///
+ /// The manufacturing date of the NVDIMM, assigned by the module vendor.
+ ///
+ UINT16 ManufacturingDate;
+
+ ///
+ /// The manufacturing location from for the NVDIMM, assigned by the module vendor.
+ ///
+ UINT8 ManufacturingLocation;
+
+ ///
+ /// Shall be 0.
+ ///
+ UINT8 Reserved[31];
+} EFI_NVDIMM_LABEL_SET_COOKIE_MAP;
+
+typedef struct {
+ ///
+ /// Array size is 1 if EFI_NVDIMM_LABEL_FLAGS_LOCAL is set indicating a Local Namespaces.
+ ///
+ EFI_NVDIMM_LABEL_SET_COOKIE_MAP Mapping[0];
+} EFI_NVDIMM_LABEL_SET_COOKIE_INFO;
+
+/**
+ Retrieves the Label Storage Area size and the maximum transfer size for the LabelStorageRead and
+ LabelStorageWrite methods.
+
+ @param This A pointer to the EFI_NVDIMM_LABEL_PROTOCOL instance.
+ @param SizeOfLabelStorageArea The size of the Label Storage Area for the NVDIMM in bytes.
+ @param MaxTransferLength The maximum number of bytes that can be transferred in a single call to
+ LabelStorageRead or LabelStorageWrite.
+
+ @retval EFI_SUCCESS The size of theLabel Storage Area and maximum transfer size returned are valid.
+ @retval EFI_ACCESS_DENIED The Label Storage Area for the NVDIMM device is not currently accessible.
+ @retval EFI_DEVICE_ERROR A physical device error occurred and the data transfer failed to complete.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVDIMM_LABEL_STORAGE_INFORMATION) (
+ IN EFI_NVDIMM_LABEL_PROTOCOL *This,
+ OUT UINT32 *SizeOfLabelStorageArea,
+ OUT UINT32 *MaxTransferLength
+ );
+
+/**
+ Retrieves the label data for the requested offset and length from within the Label Storage Area for
+ the NVDIMM.
+
+ @param This A pointer to the EFI_NVDIMM_LABEL_PROTOCOL instance.
+ @param Offset The byte offset within the Label Storage Area to read from.
+ @param TransferLength Number of bytes to read from the Label Storage Area beginning at the byte
+ Offset specified. A TransferLength of 0 reads no data.
+ @param LabelData The return label data read at the requested offset and length from within
+ the Label Storage Area.
+
+ @retval EFI_SUCCESS The label data from the Label Storage Area for the NVDIMM was read successfully
+ at the specified Offset and TransferLength and LabelData contains valid data.
+ @retval EFI_INVALID_PARAMETER Any of the following are true:
+ - Offset > SizeOfLabelStorageArea reported in the LabelStorageInformation return data.
+ - Offset + TransferLength is > SizeOfLabelStorageArea reported in the
+ LabelStorageInformation return data.
+ - TransferLength is > MaxTransferLength reported in the LabelStorageInformation return
+ data.
+ @retval EFI_ACCESS_DENIED The Label Storage Area for the NVDIMM device is not currently accessible and labels
+ cannot be read at this time.
+ @retval EFI_DEVICE_ERROR A physical device error occurred and the data transfer failed to complete.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVDIMM_LABEL_STORAGE_READ) (
+ IN CONST EFI_NVDIMM_LABEL_PROTOCOL *This,
+ IN UINT32 Offset,
+ IN UINT32 TransferLength,
+ OUT UINT8 *LabelData
+ );
+
+/**
+ Writes the label data for the requested offset and length in to the Label Storage Area for the NVDIMM.
+
+ @param This A pointer to the EFI_NVDIMM_LABEL_PROTOCOL instance.
+ @param Offset The byte offset within the Label Storage Area to write to.
+ @param TransferLength Number of bytes to write to the Label Storage Area beginning at the byte
+ Offset specified. A TransferLength of 0 writes no data.
+ @param LabelData The return label data write at the requested offset and length from within
+ the Label Storage Area.
+
+ @retval EFI_SUCCESS The label data from the Label Storage Area for the NVDIMM written read successfully
+ at the specified Offset and TransferLength.
+ @retval EFI_INVALID_PARAMETER Any of the following are true:
+ - Offset > SizeOfLabelStorageArea reported in the LabelStorageInformation return data.
+ - Offset + TransferLength is > SizeOfLabelStorageArea reported in the
+ LabelStorageInformation return data.
+ - TransferLength is > MaxTransferLength reported in the LabelStorageInformation return
+ data.
+ @retval EFI_ACCESS_DENIED The Label Storage Area for the NVDIMM device is not currently accessible and labels
+ cannot be written at this time.
+ @retval EFI_DEVICE_ERROR A physical device error occurred and the data transfer failed to complete.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVDIMM_LABEL_STORAGE_WRITE) (
+ IN CONST EFI_NVDIMM_LABEL_PROTOCOL *This,
+ IN UINT32 Offset,
+ IN UINT32 TransferLength,
+ IN UINT8 *LabelData
+ );
+
+///
+/// Provides services that allow management of labels contained in a Label Storage Area.
+///
+struct _EFI_NVDIMM_LABEL_PROTOCOL {
+ EFI_NVDIMM_LABEL_STORAGE_INFORMATION LabelStorageInformation;
+ EFI_NVDIMM_LABEL_STORAGE_READ LabelStorageRead;
+ EFI_NVDIMM_LABEL_STORAGE_WRITE LabelStorageWrite;
+};
+
+extern EFI_GUID gEfiNvdimmLabelProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/NvmExpressPassthru.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/NvmExpressPassthru.h
new file mode 100644
index 0000000000..15879e578d
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/NvmExpressPassthru.h
@@ -0,0 +1,286 @@
+/** @file
+ This protocol provides services that allow NVM Express commands to be sent to an
+ NVM Express controller or to a specific namespace in a NVM Express controller.
+ This protocol interface is optimized for storage.
+
+ Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _UEFI_NVM_EXPRESS_PASS_THRU_H_
+#define _UEFI_NVM_EXPRESS_PASS_THRU_H_
+
+#define EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL_GUID \
+ { \
+ 0x52c78312, 0x8edc, 0x4233, { 0x98, 0xf2, 0x1a, 0x1a, 0xa5, 0xe3, 0x88, 0xa5 } \
+ }
+
+typedef struct _EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL;
+
+typedef struct {
+ UINT32 Attributes;
+ UINT32 IoAlign;
+ UINT32 NvmeVersion;
+} EFI_NVM_EXPRESS_PASS_THRU_MODE;
+
+//
+// If this bit is set, then the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL interface is
+// for directly addressable namespaces.
+//
+#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001
+//
+// If this bit is set, then the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL interface is
+// for a single volume logical namespace comprised of multiple namespaces.
+//
+#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002
+//
+// If this bit is set, then the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL interface
+// supports non-blocking I/O.
+//
+#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004
+//
+// If this bit is set, then the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL interface
+// supports NVM command set.
+//
+#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_CMD_SET_NVM 0x0008
+
+//
+// FusedOperation
+//
+#define NORMAL_CMD 0x00
+#define FUSED_FIRST_CMD 0x01
+#define FUSED_SECOND_CMD 0x02
+
+typedef struct {
+ UINT32 Opcode:8;
+ UINT32 FusedOperation:2;
+ UINT32 Reserved:22;
+} NVME_CDW0;
+
+//
+// Flags
+//
+#define CDW2_VALID 0x01
+#define CDW3_VALID 0x02
+#define CDW10_VALID 0x04
+#define CDW11_VALID 0x08
+#define CDW12_VALID 0x10
+#define CDW13_VALID 0x20
+#define CDW14_VALID 0x40
+#define CDW15_VALID 0x80
+
+//
+// Queue Type
+//
+#define NVME_ADMIN_QUEUE 0x00
+#define NVME_IO_QUEUE 0x01
+
+typedef struct {
+ NVME_CDW0 Cdw0;
+ UINT8 Flags;
+ UINT32 Nsid;
+ UINT32 Cdw2;
+ UINT32 Cdw3;
+ UINT32 Cdw10;
+ UINT32 Cdw11;
+ UINT32 Cdw12;
+ UINT32 Cdw13;
+ UINT32 Cdw14;
+ UINT32 Cdw15;
+} EFI_NVM_EXPRESS_COMMAND;
+
+typedef struct {
+ UINT32 DW0;
+ UINT32 DW1;
+ UINT32 DW2;
+ UINT32 DW3;
+} EFI_NVM_EXPRESS_COMPLETION;
+
+typedef struct {
+ UINT64 CommandTimeout;
+ VOID *TransferBuffer;
+ UINT32 TransferLength;
+ VOID *MetadataBuffer;
+ UINT32 MetadataLength;
+ UINT8 QueueType;
+ EFI_NVM_EXPRESS_COMMAND *NvmeCmd;
+ EFI_NVM_EXPRESS_COMPLETION *NvmeCompletion;
+} EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET;
+
+//
+// Protocol function prototypes
+//
+/**
+ Sends an NVM Express Command Packet to an NVM Express controller or namespace. This function supports
+ both blocking I/O and non-blocking I/O. The blocking I/O functionality is required, and the non-blocking
+ I/O functionality is optional.
+
+
+ @param[in] This A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance.
+ @param[in] NamespaceId A 32 bit namespace ID as defined in the NVMe specification to which the NVM Express Command
+ Packet will be sent. A value of 0 denotes the NVM Express controller, a value of all 0xFF's
+ (all bytes are 0xFF) in the namespace ID specifies that the command packet should be sent to
+ all valid namespaces.
+ @param[in,out] Packet A pointer to the NVM Express Command Packet.
+ @param[in] Event If non-blocking I/O is not supported then Event is ignored, and blocking I/O is performed.
+ If Event is NULL, then blocking I/O is performed. If Event is not NULL and non-blocking I/O
+ is supported, then non-blocking I/O is performed, and Event will be signaled when the NVM
+ Express Command Packet completes.
+
+ @retval EFI_SUCCESS The NVM Express Command Packet was sent by the host. TransferLength bytes were transferred
+ to, or from DataBuffer.
+ @retval EFI_BAD_BUFFER_SIZE The NVM Express Command Packet was not executed. The number of bytes that could be transferred
+ is returned in TransferLength.
+ @retval EFI_NOT_READY The NVM Express Command Packet could not be sent because the controller is not ready. The caller
+ may retry again later.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the NVM Express Command Packet.
+ @retval EFI_INVALID_PARAMETER NamespaceId or the contents of EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET are invalid. The NVM
+ Express Command Packet was not sent, so no additional status information is available.
+ @retval EFI_UNSUPPORTED The command described by the NVM Express Command Packet is not supported by the NVM Express
+ controller. The NVM Express Command Packet was not sent so no additional status information
+ is available.
+ @retval EFI_TIMEOUT A timeout occurred while waiting for the NVM Express Command Packet to execute.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVM_EXPRESS_PASS_THRU_PASSTHRU)(
+ IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This,
+ IN UINT32 NamespaceId,
+ IN OUT EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET *Packet,
+ IN EFI_EVENT Event OPTIONAL
+ );
+
+/**
+ Used to retrieve the next namespace ID for this NVM Express controller.
+
+ The EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.GetNextNamespace() function retrieves the next valid
+ namespace ID on this NVM Express controller.
+
+ If on input the value pointed to by NamespaceId is 0xFFFFFFFF, then the first valid namespace
+ ID defined on the NVM Express controller is returned in the location pointed to by NamespaceId
+ and a status of EFI_SUCCESS is returned.
+
+ If on input the value pointed to by NamespaceId is an invalid namespace ID other than 0xFFFFFFFF,
+ then EFI_INVALID_PARAMETER is returned.
+
+ If on input the value pointed to by NamespaceId is a valid namespace ID, then the next valid
+ namespace ID on the NVM Express controller is returned in the location pointed to by NamespaceId,
+ and EFI_SUCCESS is returned.
+
+ If the value pointed to by NamespaceId is the namespace ID of the last namespace on the NVM
+ Express controller, then EFI_NOT_FOUND is returned.
+
+ @param[in] This A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance.
+ @param[in,out] NamespaceId On input, a pointer to a legal NamespaceId for an NVM Express
+ namespace present on the NVM Express controller. On output, a
+ pointer to the next NamespaceId of an NVM Express namespace on
+ an NVM Express controller. An input value of 0xFFFFFFFF retrieves
+ the first NamespaceId for an NVM Express namespace present on an
+ NVM Express controller.
+
+ @retval EFI_SUCCESS The Namespace ID of the next Namespace was returned.
+ @retval EFI_NOT_FOUND There are no more namespaces defined on this controller.
+ @retval EFI_INVALID_PARAMETER NamespaceId is an invalid value other than 0xFFFFFFFF.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVM_EXPRESS_PASS_THRU_GET_NEXT_NAMESPACE)(
+ IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This,
+ IN OUT UINT32 *NamespaceId
+ );
+
+/**
+ Used to allocate and build a device path node for an NVM Express namespace on an NVM Express controller.
+
+ The EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.BuildDevicePath() function allocates and builds a single device
+ path node for the NVM Express namespace specified by NamespaceId.
+
+ If the NamespaceId is not valid, then EFI_NOT_FOUND is returned.
+
+ If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned.
+
+ If there are not enough resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned.
+
+ Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of DevicePath are
+ initialized to describe the NVM Express namespace specified by NamespaceId, and EFI_SUCCESS is returned.
+
+ @param[in] This A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance.
+ @param[in] NamespaceId The NVM Express namespace ID for which a device path node is to be
+ allocated and built. Caller must set the NamespaceId to zero if the
+ device path node will contain a valid UUID.
+ @param[in,out] DevicePath A pointer to a single device path node that describes the NVM Express
+ namespace specified by NamespaceId. This function is responsible for
+ allocating the buffer DevicePath with the boot service AllocatePool().
+ It is the caller's responsibility to free DevicePath when the caller
+ is finished with DevicePath.
+ @retval EFI_SUCCESS The device path node that describes the NVM Express namespace specified
+ by NamespaceId was allocated and returned in DevicePath.
+ @retval EFI_NOT_FOUND The NamespaceId is not valid.
+ @retval EFI_INVALID_PARAMETER DevicePath is NULL.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate the DevicePath node.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVM_EXPRESS_PASS_THRU_BUILD_DEVICE_PATH)(
+ IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This,
+ IN UINT32 NamespaceId,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
+ );
+
+/**
+ Used to translate a device path node to a namespace ID.
+
+ The EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.GetNamespace() function determines the namespace ID associated with the
+ namespace described by DevicePath.
+
+ If DevicePath is a device path node type that the NVM Express Pass Thru driver supports, then the NVM Express
+ Pass Thru driver will attempt to translate the contents DevicePath into a namespace ID.
+
+ If this translation is successful, then that namespace ID is returned in NamespaceId, and EFI_SUCCESS is returned
+
+ @param[in] This A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance.
+ @param[in] DevicePath A pointer to the device path node that describes an NVM Express namespace on
+ the NVM Express controller.
+ @param[out] NamespaceId The NVM Express namespace ID contained in the device path node.
+
+ @retval EFI_SUCCESS DevicePath was successfully translated to NamespaceId.
+ @retval EFI_INVALID_PARAMETER If DevicePath or NamespaceId are NULL, then EFI_INVALID_PARAMETER is returned.
+ @retval EFI_UNSUPPORTED If DevicePath is not a device path node type that the NVM Express Pass Thru driver
+ supports, then EFI_UNSUPPORTED is returned.
+ @retval EFI_NOT_FOUND If DevicePath is a device path node type that the NVM Express Pass Thru driver
+ supports, but there is not a valid translation from DevicePath to a namespace ID,
+ then EFI_NOT_FOUND is returned.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVM_EXPRESS_PASS_THRU_GET_NAMESPACE)(
+ IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ OUT UINT32 *NamespaceId
+ );
+
+//
+// Protocol Interface Structure
+//
+struct _EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL {
+ EFI_NVM_EXPRESS_PASS_THRU_MODE *Mode;
+ EFI_NVM_EXPRESS_PASS_THRU_PASSTHRU PassThru;
+ EFI_NVM_EXPRESS_PASS_THRU_GET_NEXT_NAMESPACE GetNextNamespace;
+ EFI_NVM_EXPRESS_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath;
+ EFI_NVM_EXPRESS_PASS_THRU_GET_NAMESPACE GetNamespace;
+};
+
+extern EFI_GUID gEfiNvmExpressPassThruProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PartitionInfo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PartitionInfo.h
new file mode 100644
index 0000000000..9e67748121
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PartitionInfo.h
@@ -0,0 +1,74 @@
+/** @file
+ This file defines the EFI Partition Information Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.7
+
+**/
+
+#ifndef __PARTITION_INFO_PROTOCOL_H__
+#define __PARTITION_INFO_PROTOCOL_H__
+
+#include <IndustryStandard/Mbr.h>
+#include <Uefi/UefiGpt.h>
+
+//
+// EFI Partition Information Protocol GUID value
+//
+#define EFI_PARTITION_INFO_PROTOCOL_GUID \
+ { 0x8cf2f62c, 0xbc9b, 0x4821, { 0x80, 0x8d, 0xec, 0x9e, 0xc4, 0x21, 0xa1, 0xa0 }};
+
+
+#define EFI_PARTITION_INFO_PROTOCOL_REVISION 0x0001000
+#define PARTITION_TYPE_OTHER 0x00
+#define PARTITION_TYPE_MBR 0x01
+#define PARTITION_TYPE_GPT 0x02
+
+#pragma pack(1)
+
+///
+/// Partition Information Protocol structure.
+///
+typedef struct {
+ //
+ // Set to EFI_PARTITION_INFO_PROTOCOL_REVISION.
+ //
+ UINT32 Revision;
+ //
+ // Partition info type (PARTITION_TYPE_MBR, PARTITION_TYPE_GPT, or PARTITION_TYPE_OTHER).
+ //
+ UINT32 Type;
+ //
+ // If 1, partition describes an EFI System Partition.
+ //
+ UINT8 System;
+ UINT8 Reserved[7];
+ union {
+ ///
+ /// MBR data
+ ///
+ MBR_PARTITION_RECORD Mbr;
+ ///
+ /// GPT data
+ ///
+ EFI_PARTITION_ENTRY Gpt;
+ } Info;
+} EFI_PARTITION_INFO_PROTOCOL;
+
+#pragma pack()
+
+///
+/// Partition Information Protocol GUID variable.
+///
+extern EFI_GUID gEfiPartitionInfoProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Pcd.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Pcd.h
new file mode 100644
index 0000000000..e75b4e513b
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Pcd.h
@@ -0,0 +1,864 @@
+/** @file
+ Native Platform Configuration Database (PCD) Protocol
+
+ Different with the EFI_PCD_PROTOCOL defined in PI 1.2 specification, the native
+ PCD protocol provide interfaces for dynamic and dynamic-ex type PCD.
+ The interfaces in dynamic type PCD do not require the token space guid as parameter,
+ but interfaces in dynamic-ex type PCD require token space guid as parameter.
+
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PCD_H__
+#define __PCD_H__
+
+extern EFI_GUID gPcdProtocolGuid;
+
+#define PCD_PROTOCOL_GUID \
+ { 0x11b34006, 0xd85b, 0x4d0a, { 0xa2, 0x90, 0xd5, 0xa5, 0x71, 0x31, 0xe, 0xf7 } }
+
+#define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
+
+
+/**
+ Sets the SKU value for subsequent calls to set or get PCD token values.
+
+ SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
+ SetSku() is normally called only once by the system.
+
+ For each item (token), the database can hold a single value that applies to all SKUs,
+ or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
+ SKU-specific values are called SKU enabled.
+
+ The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
+ For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
+ single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
+ last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
+ the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
+ set for that Id, the results are unpredictable.
+
+ @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
+ set values associated with a PCD token.
+
+
+**/
+typedef
+VOID
+(EFIAPI *PCD_PROTOCOL_SET_SKU)(
+ IN UINTN SkuId
+ );
+
+
+
+/**
+ Retrieves an 8-bit value for a given PCD token.
+
+ Retrieves the current byte-sized value for a PCD token number.
+ If the TokenNumber is invalid, the results are unpredictable.
+
+ @param[in] TokenNumber The PCD token number.
+
+ @return The UINT8 value.
+
+**/
+typedef
+UINT8
+(EFIAPI *PCD_PROTOCOL_GET8)(
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Retrieves a 16-bit value for a given PCD token.
+
+ Retrieves the current 16-bit value for a PCD token number.
+ If the TokenNumber is invalid, the results are unpredictable.
+
+ @param[in] TokenNumber The PCD token number.
+
+ @return The UINT16 value.
+
+**/
+typedef
+UINT16
+(EFIAPI *PCD_PROTOCOL_GET16)(
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Retrieves a 32-bit value for a given PCD token.
+
+ Retrieves the current 32-bit value for a PCD token number.
+ If the TokenNumber is invalid, the results are unpredictable.
+
+ @param[in] TokenNumber The PCD token number.
+
+ @return The UINT32 value.
+
+**/
+typedef
+UINT32
+(EFIAPI *PCD_PROTOCOL_GET32)(
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Retrieves a 64-bit value for a given PCD token.
+
+ Retrieves the current 64-bit value for a PCD token number.
+ If the TokenNumber is invalid, the results are unpredictable.
+
+ @param[in] TokenNumber The PCD token number.
+
+ @return The UINT64 value.
+
+**/
+typedef
+UINT64
+(EFIAPI *PCD_PROTOCOL_GET64)(
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Retrieves a pointer to a value for a given PCD token.
+
+ Retrieves the current pointer to the buffer for a PCD token number.
+ Do not make any assumptions about the alignment of the pointer that
+ is returned by this function call. If the TokenNumber is invalid,
+ the results are unpredictable.
+
+ @param[in] TokenNumber The PCD token number.
+
+ @return The pointer to the buffer to be retrived.
+
+**/
+typedef
+VOID *
+(EFIAPI *PCD_PROTOCOL_GET_POINTER)(
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Retrieves a Boolean value for a given PCD token.
+
+ Retrieves the current boolean value for a PCD token number.
+ Do not make any assumptions about the alignment of the pointer that
+ is returned by this function call. If the TokenNumber is invalid,
+ the results are unpredictable.
+
+ @param[in] TokenNumber The PCD token number.
+
+ @return The Boolean value.
+
+**/
+typedef
+BOOLEAN
+(EFIAPI *PCD_PROTOCOL_GET_BOOLEAN)(
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Retrieves the size of the value for a given PCD token.
+
+ Retrieves the current size of a particular PCD token.
+ If the TokenNumber is invalid, the results are unpredictable.
+
+ @param[in] TokenNumber The PCD token number.
+
+ @return The size of the value for the PCD token.
+
+**/
+typedef
+UINTN
+(EFIAPI *PCD_PROTOCOL_GET_SIZE)(
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Retrieves an 8-bit value for a given PCD token.
+
+ Retrieves the 8-bit value of a particular PCD token.
+ If the TokenNumber is invalid or the token space
+ specified by Guid does not exist, the results are
+ unpredictable.
+
+ @param[in] Guid The token space for the token number.
+ @param[in] TokenNumber The PCD token number.
+
+ @return The size 8-bit value for the PCD token.
+
+**/
+typedef
+UINT8
+(EFIAPI *PCD_PROTOCOL_GET_EX_8)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Retrieves a 16-bit value for a given PCD token.
+
+ Retrieves the 16-bit value of a particular PCD token.
+ If the TokenNumber is invalid or the token space
+ specified by Guid does not exist, the results are
+ unpredictable.
+
+ @param[in] Guid The token space for the token number.
+ @param[in] TokenNumber The PCD token number.
+
+ @return The size 16-bit value for the PCD token.
+
+**/
+typedef
+UINT16
+(EFIAPI *PCD_PROTOCOL_GET_EX_16)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Retrieves a 32-bit value for a given PCD token.
+
+ Retrieves the 32-bit value of a particular PCD token.
+ If the TokenNumber is invalid or the token space
+ specified by Guid does not exist, the results are
+ unpredictable.
+
+ @param[in] Guid The token space for the token number.
+ @param[in] TokenNumber The PCD token number.
+
+ @return The size 32-bit value for the PCD token.
+
+**/
+typedef
+UINT32
+(EFIAPI *PCD_PROTOCOL_GET_EX_32)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Retrieves an 64-bit value for a given PCD token.
+
+ Retrieves the 64-bit value of a particular PCD token.
+ If the TokenNumber is invalid or the token space
+ specified by Guid does not exist, the results are
+ unpredictable.
+
+ @param[in] Guid The token space for the token number.
+ @param[in] TokenNumber The PCD token number.
+
+ @return The size 64-bit value for the PCD token.
+
+**/
+typedef
+UINT64
+(EFIAPI *PCD_PROTOCOL_GET_EX_64)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Retrieves a pointer to a value for a given PCD token.
+
+ Retrieves the current pointer to the buffer for a PCD token number.
+ Do not make any assumptions about the alignment of the pointer that
+ is returned by this function call. If the TokenNumber is invalid,
+ the results are unpredictable.
+
+ @param[in] Guid The token space for the token number.
+ @param[in] TokenNumber The PCD token number.
+
+ @return The pointer to the buffer to be retrieved.
+
+**/
+typedef
+VOID *
+(EFIAPI *PCD_PROTOCOL_GET_EX_POINTER)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Retrieves a Boolean value for a given PCD token.
+
+ Retrieves the Boolean value of a particular PCD token.
+ If the TokenNumber is invalid or the token space
+ specified by Guid does not exist, the results are
+ unpredictable.
+
+ @param[in] Guid The token space for the token number.
+ @param[in] TokenNumber The PCD token number.
+
+ @return The size Boolean value for the PCD token.
+
+**/
+typedef
+BOOLEAN
+(EFIAPI *PCD_PROTOCOL_GET_EX_BOOLEAN)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Retrieves the size of the value for a given PCD token.
+
+ Retrieves the current size of a particular PCD token.
+ If the TokenNumber is invalid, the results are unpredictable.
+
+ @param[in] Guid The token space for the token number.
+ @param[in] TokenNumber The PCD token number.
+
+ @return The size of the value for the PCD token.
+
+**/
+typedef
+UINTN
+(EFIAPI *PCD_PROTOCOL_GET_EX_SIZE)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+ );
+
+
+
+/**
+ Sets an 8-bit value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the
+ size of the value being set is compatible with the Token's existing definition.
+ If it is not, an error will be returned.
+
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The procedure returned successfully.
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
+ being set was incompatible with a call to this function.
+ Use GetSize() to retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_SET8)(
+ IN UINTN TokenNumber,
+ IN UINT8 Value
+ );
+
+
+
+/**
+ Sets a 16-bit value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the
+ size of the value being set is compatible with the Token's existing definition.
+ If it is not, an error will be returned.
+
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The procedure returned successfully.
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
+ being set was incompatible with a call to this function.
+ Use GetSize() to retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_SET16)(
+ IN UINTN TokenNumber,
+ IN UINT16 Value
+ );
+
+
+
+/**
+ Sets a 32-bit value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the
+ size of the value being set is compatible with the Token's existing definition.
+ If it is not, an error will be returned.
+
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The procedure returned successfully.
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
+ being set was incompatible with a call to this function.
+ Use GetSize() to retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_SET32)(
+ IN UINTN TokenNumber,
+ IN UINT32 Value
+ );
+
+
+
+/**
+ Sets a 64-bit value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the
+ size of the value being set is compatible with the Token's existing definition.
+ If it is not, an error will be returned.
+
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The procedure returned successfully.
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
+ being set was incompatible with a call to this function.
+ Use GetSize() to retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_SET64)(
+ IN UINTN TokenNumber,
+ IN UINT64 Value
+ );
+
+
+
+/**
+ Sets a value of a specified size for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the
+ size of the value being set is compatible with the Token's existing definition.
+ If it is not, an error will be returned.
+
+ @param[in] TokenNumber The PCD token number.
+ @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
+ On input, if the SizeOfValue is greater than the maximum size supported
+ for this TokenNumber then the output value of SizeOfValue will reflect
+ the maximum size supported for this TokenNumber.
+ @param[in] Buffer The buffer to set for the PCD token.
+
+ @retval EFI_SUCCESS The procedure returned successfully.
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
+ being set was incompatible with a call to this function.
+ Use GetSize() to retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_SET_POINTER)(
+ IN UINTN TokenNumber,
+ IN OUT UINTN *SizeOfBuffer,
+ IN VOID *Buffer
+ );
+
+
+
+/**
+ Sets a Boolean value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the
+ size of the value being set is compatible with the Token's existing definition.
+ If it is not, an error will be returned.
+
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The procedure returned successfully.
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
+ being set was incompatible with a call to this function.
+ Use GetSize() to retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_SET_BOOLEAN)(
+ IN UINTN TokenNumber,
+ IN BOOLEAN Value
+ );
+
+
+
+/**
+ Sets an 8-bit value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the
+ size of the value being set is compatible with the Token's existing definition.
+ If it is not, an error will be returned.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The procedure returned successfully.
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
+ being set was incompatible with a call to this function.
+ Use GetSize() to retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_SET_EX_8)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ IN UINT8 Value
+ );
+
+
+
+/**
+ Sets an 16-bit value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the
+ size of the value being set is compatible with the Token's existing definition.
+ If it is not, an error will be returned.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The procedure returned successfully.
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
+ being set was incompatible with a call to this function.
+ Use GetSize() to retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_SET_EX_16)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ IN UINT16 Value
+ );
+
+
+
+/**
+ Sets a 32-bit value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the
+ size of the value being set is compatible with the Token's existing definition.
+ If it is not, an error will be returned.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The procedure returned successfully.
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
+ being set was incompatible with a call to this function.
+ Use GetSize() to retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_SET_EX_32)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ IN UINT32 Value
+ );
+
+
+
+/**
+ Sets a 64-bit value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the
+ size of the value being set is compatible with the Token's existing definition.
+ If it is not, an error will be returned.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The procedure returned successfully.
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
+ being set was incompatible with a call to this function.
+ Use GetSize() to retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_SET_EX_64)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ IN UINT64 Value
+ );
+
+
+
+/**
+ Sets a value of a specified size for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the
+ size of the value being set is compatible with the Token's existing definition.
+ If it is not, an error will be returned.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
+ On input, if the SizeOfValue is greater than the maximum size supported
+ for this TokenNumber then the output value of SizeOfValue will reflect
+ the maximum size supported for this TokenNumber.
+ @param[in] Buffer The buffer to set for the PCD token.
+
+ @retval EFI_SUCCESS The procedure returned successfully.
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
+ being set was incompatible with a call to this function.
+ Use GetSize() to retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_SET_EX_POINTER)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ IN OUT UINTN *SizeOfBuffer,
+ IN VOID *Buffer
+ );
+
+
+
+/**
+ Sets a Boolean value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the
+ size of the value being set is compatible with the Token's existing definition.
+ If it is not, an error will be returned.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The procedure returned successfully.
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
+ being set was incompatible with a call to this function.
+ Use GetSize() to retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_SET_EX_BOOLEAN)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ IN BOOLEAN Value
+ );
+
+
+
+/**
+ Callback on SET function prototype definition.
+
+ This notification function serves two purposes.
+ Firstly, it notifies the module which did the registration that the value
+ of this PCD token has been set. Secondly, it provides a mechanism for the
+ module that did the registration to intercept the set operation and override
+ the value that has been set, if necessary. After the invocation of the callback function,
+ TokenData will be used by PCD service DXE driver to modify the internal data in
+ PCD database.
+
+ @param[in] CallBackGuid The PCD token GUID being set.
+ @param[in] CallBackToken The PCD token number being set.
+ @param[in, out] TokenData A pointer to the token data being set.
+ @param[in] TokenDataSize The size, in bytes, of the data being set.
+
+ @retval VOID
+
+**/
+typedef
+VOID
+(EFIAPI *PCD_PROTOCOL_CALLBACK)(
+ IN CONST EFI_GUID *CallBackGuid, OPTIONAL
+ IN UINTN CallBackToken,
+ IN OUT VOID *TokenData,
+ IN UINTN TokenDataSize
+ );
+
+
+
+/**
+ Specifies a function to be called anytime the value of a designated token is changed.
+
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
+
+ @retval EFI_SUCCESS The PCD service has successfully established a call event
+ for the CallBackToken requested.
+ @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_CALLBACK_ONSET)(
+ IN CONST EFI_GUID *Guid, OPTIONAL
+ IN UINTN TokenNumber,
+ IN PCD_PROTOCOL_CALLBACK CallBackFunction
+ );
+
+
+
+/**
+ Cancels a previously set callback function for a particular PCD token number.
+
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
+
+ @retval EFI_SUCCESS The PCD service has successfully established a call event
+ for the CallBackToken requested.
+ @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_CANCEL_CALLBACK)(
+ IN CONST EFI_GUID *Guid, OPTIONAL
+ IN UINTN TokenNumber,
+ IN PCD_PROTOCOL_CALLBACK CallBackFunction
+ );
+
+
+
+/**
+ Retrieves the next valid token number in a given namespace.
+
+ This is useful since the PCD infrastructure contains a sparse list of token numbers,
+ and one cannot a priori know what token numbers are valid in the database.
+
+ If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.
+ If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.
+ If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.
+ If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.
+ The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.
+ If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.
+ If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.
+ If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.
+
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to retrieve the next token.
+ This is an optional parameter that may be NULL. If this parameter is NULL, then a request is
+ being made to retrieve tokens from the default token space.
+ @param[in,out] TokenNumber
+ A pointer to the PCD token number to use to find the subsequent token number.
+
+ @retval EFI_SUCCESS The PCD service has retrieved the next valid token number.
+ @retval EFI_NOT_FOUND The PCD service could not find data from the requested token number.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKEN)(
+ IN CONST EFI_GUID *Guid, OPTIONAL
+ IN OUT UINTN *TokenNumber
+ );
+
+
+
+/**
+ Retrieves the next valid PCD token namespace for a given namespace.
+
+ Gets the next valid token namespace for a given namespace. This is useful to traverse the valid
+ token namespaces on a platform.
+
+ @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates a known token namespace
+ from which the search will start. On output, it designates the next valid token
+ namespace on the platform. If *Guid is NULL, then the GUID of the first token
+ space of the current platform is returned. If the search cannot locate the next valid
+ token namespace, an error is returned and the value of *Guid is undefined.
+
+ @retval EFI_SUCCESS The PCD service retrieved the value requested.
+ @retval EFI_NOT_FOUND The PCD service could not find the next valid token namespace.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKENSPACE)(
+ IN OUT CONST EFI_GUID **Guid
+ );
+
+///
+/// This service abstracts the ability to set/get Platform Configuration Database (PCD).
+///
+typedef struct {
+ PCD_PROTOCOL_SET_SKU SetSku;
+
+ PCD_PROTOCOL_GET8 Get8;
+ PCD_PROTOCOL_GET16 Get16;
+ PCD_PROTOCOL_GET32 Get32;
+ PCD_PROTOCOL_GET64 Get64;
+ PCD_PROTOCOL_GET_POINTER GetPtr;
+ PCD_PROTOCOL_GET_BOOLEAN GetBool;
+ PCD_PROTOCOL_GET_SIZE GetSize;
+
+ PCD_PROTOCOL_GET_EX_8 Get8Ex;
+ PCD_PROTOCOL_GET_EX_16 Get16Ex;
+ PCD_PROTOCOL_GET_EX_32 Get32Ex;
+ PCD_PROTOCOL_GET_EX_64 Get64Ex;
+ PCD_PROTOCOL_GET_EX_POINTER GetPtrEx;
+ PCD_PROTOCOL_GET_EX_BOOLEAN GetBoolEx;
+ PCD_PROTOCOL_GET_EX_SIZE GetSizeEx;
+
+ PCD_PROTOCOL_SET8 Set8;
+ PCD_PROTOCOL_SET16 Set16;
+ PCD_PROTOCOL_SET32 Set32;
+ PCD_PROTOCOL_SET64 Set64;
+ PCD_PROTOCOL_SET_POINTER SetPtr;
+ PCD_PROTOCOL_SET_BOOLEAN SetBool;
+
+ PCD_PROTOCOL_SET_EX_8 Set8Ex;
+ PCD_PROTOCOL_SET_EX_16 Set16Ex;
+ PCD_PROTOCOL_SET_EX_32 Set32Ex;
+ PCD_PROTOCOL_SET_EX_64 Set64Ex;
+ PCD_PROTOCOL_SET_EX_POINTER SetPtrEx;
+ PCD_PROTOCOL_SET_EX_BOOLEAN SetBoolEx;
+
+ PCD_PROTOCOL_CALLBACK_ONSET CallbackOnSet;
+ PCD_PROTOCOL_CANCEL_CALLBACK CancelCallback;
+ PCD_PROTOCOL_GET_NEXT_TOKEN GetNextToken;
+ PCD_PROTOCOL_GET_NEXT_TOKENSPACE GetNextTokenSpace;
+} PCD_PROTOCOL;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PcdInfo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PcdInfo.h
new file mode 100644
index 0000000000..e34967e0a3
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PcdInfo.h
@@ -0,0 +1,105 @@
+/** @file
+ Native Platform Configuration Database (PCD) INFO PROTOCOL.
+
+ The protocol that provides additional information about items that reside in the PCD database.
+
+ Different with the EFI_GET_PCD_INFO_PROTOCOL defined in PI 1.2.1 specification,
+ the native PCD INFO PROTOCOL provide interfaces for dynamic and dynamic-ex type PCD.
+ The interfaces for dynamic type PCD do not require the token space guid as parameter,
+ but interfaces for dynamic-ex type PCD require token space guid as parameter.
+
+ Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PCD_INFO_H__
+#define __PCD_INFO_H__
+
+extern EFI_GUID gGetPcdInfoProtocolGuid;
+
+#define GET_PCD_INFO_PROTOCOL_GUID \
+ { 0x5be40f57, 0xfa68, 0x4610, { 0xbb, 0xbf, 0xe9, 0xc5, 0xfc, 0xda, 0xd3, 0x65 } }
+
+///
+/// The forward declaration for GET_PCD_INFO_PROTOCOL.
+///
+typedef struct _GET_PCD_INFO_PROTOCOL GET_PCD_INFO_PROTOCOL;
+
+/**
+ Retrieve additional information associated with a PCD token.
+
+ This includes information such as the type of value the TokenNumber is associated with as well as possible
+ human readable name that is associated with the token.
+
+ @param[in] TokenNumber The PCD token number.
+ @param[out] PcdInfo The returned information associated with the requested TokenNumber.
+
+ @retval EFI_SUCCESS The PCD information was returned successfully
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *GET_PCD_INFO_PROTOCOL_GET_INFO) (
+ IN UINTN TokenNumber,
+ OUT EFI_PCD_INFO *PcdInfo
+);
+
+/**
+ Retrieve additional information associated with a PCD token.
+
+ This includes information such as the type of value the TokenNumber is associated with as well as possible
+ human readable name that is associated with the token.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[out] PcdInfo The returned information associated with the requested TokenNumber.
+
+ @retval EFI_SUCCESS The PCD information was returned successfully
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *GET_PCD_INFO_PROTOCOL_GET_INFO_EX) (
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ OUT EFI_PCD_INFO *PcdInfo
+);
+
+/**
+ Retrieve the currently set SKU Id.
+
+ @return The currently set SKU Id. If the platform has not set at a SKU Id, then the
+ default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU
+ Id is returned.
+**/
+typedef
+UINTN
+(EFIAPI *GET_PCD_INFO_PROTOCOL_GET_SKU) (
+ VOID
+);
+
+///
+/// This is the PCD service to use when querying for some additional data that can be contained in the
+/// PCD database.
+///
+struct _GET_PCD_INFO_PROTOCOL {
+ ///
+ /// Retrieve additional information associated with a PCD.
+ ///
+ GET_PCD_INFO_PROTOCOL_GET_INFO GetInfo;
+ GET_PCD_INFO_PROTOCOL_GET_INFO_EX GetInfoEx;
+ ///
+ /// Retrieve the currently set SKU Id.
+ ///
+ GET_PCD_INFO_PROTOCOL_GET_SKU GetSku;
+};
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciEnumerationComplete.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciEnumerationComplete.h
new file mode 100644
index 0000000000..c817774cb3
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciEnumerationComplete.h
@@ -0,0 +1,30 @@
+/** @file
+ PCI Enumeration Complete Protocol as defined in the PI 1.1 specification.
+ This protocol indicates that pci enumeration complete
+
+ Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is defined in UEFI Platform Initialization Specification 1.2
+ Volume 5: Standards
+
+**/
+
+#ifndef _PCI_ENUMERATION_COMPLETE_H_
+#define _PCI_ENUMERATION_COMPLETE_H_
+
+#define EFI_PCI_ENUMERATION_COMPLETE_GUID \
+ { \
+ 0x30cfe3e7, 0x3de1, 0x4586, { 0xbe, 0x20, 0xde, 0xab, 0xa1, 0xb3, 0xb7, 0x93 } \
+ }
+
+extern EFI_GUID gEfiPciEnumerationCompleteProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciHostBridgeResourceAllocation.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciHostBridgeResourceAllocation.h
new file mode 100644
index 0000000000..2d41ac1529
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciHostBridgeResourceAllocation.h
@@ -0,0 +1,428 @@
+/** @file
+ This file declares PCI Host Bridge Resource Allocation Protocol which
+ provides the basic interfaces to abstract a PCI host bridge resource allocation.
+ This protocol is mandatory if the system includes PCI devices.
+
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is defined in UEFI Platform Initialization Specification 1.2
+ Volume 5: Standards.
+
+**/
+
+#ifndef _PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_H_
+#define _PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_H_
+
+//
+// This file must be included because EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
+// uses EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS
+//
+#include <Protocol/PciRootBridgeIo.h>
+
+///
+/// Global ID for the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.
+///
+#define EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GUID \
+ { \
+ 0xCF8034BE, 0x6768, 0x4d8b, {0xB7,0x39,0x7C,0xCE,0x68,0x3A,0x9F,0xBE } \
+ }
+
+///
+/// Forward declaration for EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.
+///
+typedef struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL;
+
+/// If this bit is set, then the PCI Root Bridge does not
+/// support separate windows for Non-prefetchable and Prefetchable
+/// memory. A PCI bus driver needs to include requests for Prefetchable
+/// memory in the Non-prefetchable memory pool.
+///
+#define EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM 1
+
+///
+/// If this bit is set, then the PCI Root Bridge supports
+/// 64 bit memory windows. If this bit is not set,
+/// the PCI bus driver needs to include requests for 64 bit
+/// memory address in the corresponding 32 bit memory pool.
+///
+#define EFI_PCI_HOST_BRIDGE_MEM64_DECODE 2
+
+///
+/// A UINT64 value that contains the status of a PCI resource requested
+/// in the Configuration parameter returned by GetProposedResources()
+/// The legal values are EFI_RESOURCE_SATISFIED and EFI_RESOURCE_NOT_SATISFIED
+///
+typedef UINT64 EFI_RESOURCE_ALLOCATION_STATUS;
+
+///
+/// The request of this resource type could be fulfilled. Used in the
+/// Configuration parameter returned by GetProposedResources() to identify
+/// a PCI resources request that can be satisfied.
+///
+#define EFI_RESOURCE_SATISFIED 0x0000000000000000ULL
+
+///
+/// The request of this resource type could not be fulfilled for its
+/// absence in the host bridge resource pool. Used in the Configuration parameter
+/// returned by GetProposedResources() to identify a PCI resources request that
+/// can not be satisfied.
+///
+#define EFI_RESOURCE_NOT_SATISFIED 0xFFFFFFFFFFFFFFFFULL
+
+///
+/// This enum is used to specify the phase of the PCI enumaeration process.
+///
+typedef enum {
+ ///
+ /// Reset the host bridge PCI apertures and internal data structures.
+ /// PCI enumerator should issue this notification before starting fresh
+ /// enumeration process. Enumeration cannot be restarted after sending
+ /// any other notification such as EfiPciHostBridgeBeginBusAllocation.
+ ///
+ EfiPciHostBridgeBeginEnumeration,
+
+ ///
+ /// The bus allocation phase is about to begin. No specific action
+ /// is required here. This notification can be used to perform any
+ /// chipset specific programming.
+ ///
+ EfiPciHostBridgeBeginBusAllocation,
+
+ ///
+ /// The bus allocation and bus programming phase is complete. No specific
+ /// action is required here. This notification can be used to perform any
+ /// chipset specific programming.
+ ///
+ EfiPciHostBridgeEndBusAllocation,
+
+ ///
+ /// The resource allocation phase is about to begin.No specific action is
+ /// required here. This notification can be used to perform any chipset specific programming.
+ ///
+ EfiPciHostBridgeBeginResourceAllocation,
+
+ ///
+ /// Allocate resources per previously submitted requests for all the PCI Root
+ /// Bridges. These resource settings are returned on the next call to
+ /// GetProposedResources().
+ ///
+ EfiPciHostBridgeAllocateResources,
+
+ ///
+ /// Program the Host Bridge hardware to decode previously allocated resources
+ /// (proposed resources) for all the PCI Root Bridges.
+ ///
+ EfiPciHostBridgeSetResources,
+
+ ///
+ /// De-allocate previously allocated resources previously for all the PCI
+ /// Root Bridges and reset the I/O and memory apertures to initial state.
+ ///
+ EfiPciHostBridgeFreeResources,
+
+ ///
+ /// The resource allocation phase is completed. No specific action is required
+ /// here. This notification can be used to perform any chipset specific programming.
+ ///
+ EfiPciHostBridgeEndResourceAllocation,
+
+ ///
+ /// The Host Bridge Enumeration is completed. No specific action is required here.
+ /// This notification can be used to perform any chipset specific programming.
+ ///
+ EfiPciHostBridgeEndEnumeration,
+ EfiMaxPciHostBridgeEnumerationPhase
+} EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE;
+
+///
+/// Definitions of 2 notification points.
+///
+typedef enum {
+ ///
+ /// This notification is only applicable to PCI-PCI bridges and
+ /// indicates that the PCI enumerator is about to begin enumerating
+ /// the bus behind the PCI-PCI Bridge. This notification is sent after
+ /// the primary bus number, the secondary bus number and the subordinate
+ /// bus number registers in the PCI-PCI Bridge are programmed to valid
+ /// (not necessary final) values
+ ///
+ EfiPciBeforeChildBusEnumeration,
+
+ ///
+ /// This notification is sent before the PCI enumerator probes BAR registers
+ /// for every valid PCI function.
+ ///
+ EfiPciBeforeResourceCollection
+} EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE;
+
+/**
+ These are the notifications from the PCI bus driver that it is about to enter a certain phase of the PCI
+ enumeration process.
+
+ @param[in] This The pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
+ instance.
+ @param[in] Phase The phase during enumeration.
+
+ @retval EFI_SUCCESS The notification was accepted without any errors.
+ @retval EFI_INVALID_PARAMETER The Phase is invalid.
+ @retval EFI_NOT_READY This phase cannot be entered at this time. For example, this error
+ is valid for a Phase of EfiPciHostBridgeAllocateResources if
+ SubmitResources() has not been called for one or more
+ PCI root bridges before this call.
+ @retval EFI_DEVICE_ERROR Programming failed due to a hardware error. This error is valid for
+ a Phase of EfiPciHostBridgeSetResources.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ This error is valid for a Phase of EfiPciHostBridgeAllocateResources
+ if the previously submitted resource requests cannot be fulfilled or were only
+ partially fulfilled
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase
+ );
+
+/**
+ Returns the device handle of the next PCI root bridge that is associated with this host bridge.
+
+ @param[in] This The pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
+ instance.
+ @param[in,out] RootBridgeHandle Returns the device handle of the next PCI root bridge. On input, it holds the
+ RootBridgeHandle that was returned by the most recent call to
+ GetNextRootBridge(). If RootBridgeHandle is NULL on input, the handle
+ for the first PCI root bridge is returned.
+
+ @retval EFI_SUCCESS The requested attribute information was returned.
+ @retval EFI_INVALID_PARAMETER RootBridgeHandle is not an EFI_HANDLE that was returned
+ on a previous call to GetNextRootBridge().
+ @retval EFI_NOT_FOUND There are no more PCI root bridge device handles.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN OUT EFI_HANDLE *RootBridgeHandle
+ );
+
+/**
+ Returns the allocation attributes of a PCI root bridge.
+
+ @param[in] This The pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
+ instance.
+ @param[in] RootBridgeHandle The device handle of the PCI root bridge in which the caller is interested.
+ @param[out] Attribute The pointer to attributes of the PCI root bridge.
+
+ @retval EFI_SUCCESS The requested attribute information was returned.
+ @retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
+ @retval EFI_INVALID_PARAMETER Attributes is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_HANDLE RootBridgeHandle,
+ OUT UINT64 *Attributes
+ );
+
+/**
+ Sets up the specified PCI root bridge for the bus enumeration process.
+
+ @param[in] This The pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
+ instance.
+ @param[in] RootBridgeHandle The PCI root bridge to be set up.
+ @param[out] Configuration The pointer to the pointer to the PCI bus resource descriptor.
+
+ @retval EFI_SUCCESS The PCI root bridge was set up and the bus range was returned in
+ Configuration.
+ @retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
+ @retval EFI_DEVICE_ERROR Programming failed due to a hardware error.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_HANDLE RootBridgeHandle,
+ OUT VOID **Configuration
+ );
+
+/**
+ Programs the PCI root bridge hardware so that it decodes the specified PCI bus range.
+
+ @param[in] This The pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
+ instance.
+ @param[in] RootBridgeHandle The PCI root bridge whose bus range is to be programmed.
+ @param[in] Configuration The pointer to the PCI bus resource descriptor.
+
+ @retval EFI_SUCCESS The bus range for the PCI root bridge was programmed.
+ @retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
+ @retval EFI_INVALID_PARAMETER Configuration is NULL
+ @retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI (2.0 & 3.0)
+ resource descriptor.
+ @retval EFI_INVALID_PARAMETER Configuration does not include a valid ACPI 2.0 bus resource
+ descriptor.
+ @retval EFI_INVALID_PARAMETER Configuration includes valid ACPI (2.0 & 3.0) resource
+ descriptors other than bus descriptors.
+ @retval EFI_INVALID_PARAMETER Configuration contains one or more invalid ACPI resource
+ descriptors.
+ @retval EFI_INVALID_PARAMETER "Address Range Minimum" is invalid for this root bridge.
+ @retval EFI_INVALID_PARAMETER "Address Range Length" is invalid for this root bridge.
+ @retval EFI_DEVICE_ERROR Programming failed due to a hardware error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_HANDLE RootBridgeHandle,
+ IN VOID *Configuration
+ );
+
+/**
+ Submits the I/O and memory resource requirements for the specified PCI root bridge.
+
+ @param[in] This The pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
+ instance.
+ @param[in] RootBridgeHandle The PCI root bridge whose I/O and memory resource requirements are being
+ submitted.
+ @param[in] Configuration The pointer to the PCI I/O and PCI memory resource descriptor.
+
+ @retval EFI_SUCCESS The I/O and memory resource requests for a PCI root bridge were
+ accepted.
+ @retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
+ @retval EFI_INVALID_PARAMETER Configuration is NULL.
+ @retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI (2.0 & 3.0)
+ resource descriptor.
+ @retval EFI_INVALID_PARAMETER Configuration includes requests for one or more resource
+ types that are not supported by this PCI root bridge. This error will
+ happen if the caller did not combine resources according to
+ Attributes that were returned by GetAllocAttributes().
+ @retval EFI_INVALID_PARAMETER "Address Range Maximum" is invalid.
+ @retval EFI_INVALID_PARAMETER "Address Range Length" is invalid for this PCI root bridge.
+ @retval EFI_INVALID_PARAMETER "Address Space Granularity" is invalid for this PCI root bridge.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_HANDLE RootBridgeHandle,
+ IN VOID *Configuration
+ );
+
+/**
+ Returns the proposed resource settings for the specified PCI root bridge.
+
+ @param[in] This The pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
+ instance.
+ @param[in] RootBridgeHandle The PCI root bridge handle.
+ @param[out] Configuration The pointer to the pointer to the PCI I/O and memory resource descriptor.
+
+ @retval EFI_SUCCESS The requested parameters were returned.
+ @retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
+ @retval EFI_DEVICE_ERROR Programming failed due to a hardware error.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_HANDLE RootBridgeHandle,
+ OUT VOID **Configuration
+ );
+
+/**
+ Provides the hooks from the PCI bus driver to every PCI controller (device/function) at various
+ stages of the PCI enumeration process that allow the host bridge driver to preinitialize individual
+ PCI controllers before enumeration.
+
+ @param[in] This The pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance.
+ @param[in] RootBridgeHandle The associated PCI root bridge handle.
+ @param[in] PciAddress The address of the PCI device on the PCI bus.
+ @param[in] Phase The phase of the PCI device enumeration.
+
+ @retval EFI_SUCCESS The requested parameters were returned.
+ @retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
+ @retval EFI_INVALID_PARAMETER Phase is not a valid phase that is defined in
+ EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE.
+ @retval EFI_DEVICE_ERROR Programming failed due to a hardware error. The PCI enumerator
+ should not enumerate this device, including its child devices if it is
+ a PCI-to-PCI bridge.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_HANDLE RootBridgeHandle,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress,
+ IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase
+ );
+
+///
+/// Provides the basic interfaces to abstract a PCI host bridge resource allocation.
+///
+struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL {
+ ///
+ /// The notification from the PCI bus enumerator that it is about to enter
+ /// a certain phase during the enumeration process.
+ ///
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE NotifyPhase;
+
+ ///
+ /// Retrieves the device handle for the next PCI root bridge that is produced by the
+ /// host bridge to which this instance of the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL is attached.
+ ///
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE GetNextRootBridge;
+
+ ///
+ /// Retrieves the allocation-related attributes of a PCI root bridge.
+ ///
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES GetAllocAttributes;
+
+ ///
+ /// Sets up a PCI root bridge for bus enumeration.
+ ///
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION StartBusEnumeration;
+
+ ///
+ /// Sets up the PCI root bridge so that it decodes a specific range of bus numbers.
+ ///
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS SetBusNumbers;
+
+ ///
+ /// Submits the resource requirements for the specified PCI root bridge.
+ ///
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES SubmitResources;
+
+ ///
+ /// Returns the proposed resource assignment for the specified PCI root bridges.
+ ///
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES GetProposedResources;
+
+ ///
+ /// Provides hooks from the PCI bus driver to every PCI controller
+ /// (device/function) at various stages of the PCI enumeration process that
+ /// allow the host bridge driver to preinitialize individual PCI controllers
+ /// before enumeration.
+ ///
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER PreprocessController;
+};
+
+extern EFI_GUID gEfiPciHostBridgeResourceAllocationProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciHotPlugInit.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciHotPlugInit.h
new file mode 100644
index 0000000000..6570177382
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciHotPlugInit.h
@@ -0,0 +1,278 @@
+/** @file
+ This file declares EFI PCI Hot Plug Init Protocol.
+
+ This protocol provides the necessary functionality to initialize the Hot Plug
+ Controllers (HPCs) and the buses that they control. This protocol also provides
+ information regarding resource padding.
+
+ @par Note:
+ This protocol is required only on platforms that support one or more PCI Hot
+ Plug* slots or CardBus sockets.
+
+ The EFI_PCI_HOT_PLUG_INIT_PROTOCOL provides a mechanism for the PCI bus enumerator
+ to properly initialize the HPCs and CardBus sockets that require initialization.
+ The HPC initialization takes place before the PCI enumeration process is complete.
+ There cannot be more than one instance of this protocol in a system. This protocol
+ is installed on its own separate handle.
+
+ Because the system may include multiple HPCs, one instance of this protocol
+ should represent all of them. The protocol functions use the device path of
+ the HPC to identify the HPC. When the PCI bus enumerator finds a root HPC, it
+ will call EFI_PCI_HOT_PLUG_INIT_PROTOCOL.InitializeRootHpc(). If InitializeRootHpc()
+ is unable to initialize a root HPC, the PCI enumerator will ignore that root HPC
+ and continue the enumeration process. If the HPC is not initialized, the devices
+ that it controls may not be initialized, and no resource padding will be provided.
+
+ From the standpoint of the PCI bus enumerator, HPCs are divided into the following
+ two classes:
+
+ - Root HPC:
+ These HPCs must be initialized by calling InitializeRootHpc() during the
+ enumeration process. These HPCs will also require resource padding. The
+ platform code must have a priori knowledge of these devices and must know
+ how to initialize them. There may not be any way to access their PCI
+ configuration space before the PCI enumerator programs all the upstream
+ bridges and thus enables the path to these devices. The PCI bus enumerator
+ is responsible for determining the PCI bus address of the HPC before it
+ calls InitializeRootHpc().
+ - Nonroot HPC:
+ These HPCs will not need explicit initialization during enumeration process.
+ These HPCs will require resource padding. The platform code does not have
+ to have a priori knowledge of these devices.
+
+ Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is defined in UEFI Platform Initialization Specification 1.2
+ Volume 5: Standards
+
+**/
+
+#ifndef _EFI_PCI_HOT_PLUG_INIT_H_
+#define _EFI_PCI_HOT_PLUG_INIT_H_
+
+///
+/// Global ID for the EFI_PCI_HOT_PLUG_INIT_PROTOCOL
+///
+#define EFI_PCI_HOT_PLUG_INIT_PROTOCOL_GUID \
+ { \
+ 0xaa0e8bc1, 0xdabc, 0x46b0, {0xa8, 0x44, 0x37, 0xb8, 0x16, 0x9b, 0x2b, 0xea } \
+ }
+
+///
+/// Forward declaration for EFI_PCI_HOT_PLUG_INIT_PROTOCOL
+///
+typedef struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL EFI_PCI_HOT_PLUG_INIT_PROTOCOL;
+
+///
+/// Describes the current state of an HPC
+///
+typedef UINT16 EFI_HPC_STATE;
+
+///
+/// The HPC initialization function was called and the HPC completed
+/// initialization, but it was not enabled for some reason. The HPC may be
+/// disabled in hardware, or it may be disabled due to user preferences,
+/// hardware failure, or other reasons. No resource padding is required.
+///
+#define EFI_HPC_STATE_INITIALIZED 0x01
+
+///
+/// The HPC initialization function was called, the HPC completed
+/// initialization, and it was enabled. Resource padding is required.
+///
+#define EFI_HPC_STATE_ENABLED 0x02
+
+///
+/// Location definition for PCI Hot Plug Controller
+///
+typedef struct{
+ ///
+ ///
+ /// The device path to the root HPC. An HPC cannot control its parent buses.
+ /// The PCI bus driver requires this information so that it can pass the
+ /// correct HpcPciAddress to the InitializeRootHpc() and GetResourcePadding()
+ /// functions.
+ ///
+ EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath;
+ ///
+ /// The device path to the Hot Plug Bus (HPB) that is controlled by the root
+ /// HPC. The PCI bus driver uses this information to check if a particular PCI
+ /// bus has hot-plug slots. The device path of a PCI bus is the same as the
+ /// device path of its parent. For Standard(PCI) Hot Plug Controllers (SHPCs)
+ /// and PCI Express*, HpbDevicePath is the same as HpcDevicePath.
+ ///
+ EFI_DEVICE_PATH_PROTOCOL *HpbDevicePath;
+} EFI_HPC_LOCATION;
+
+///
+/// Describes how resource padding should be applied
+///
+typedef enum {
+ ///
+ /// Apply the padding at a PCI bus level. In other words, the resources
+ /// that are allocated to the bus containing hot-plug slots are padded by
+ /// the specified amount. If the hot-plug bus is behind a PCI-to-PCI
+ /// bridge, the PCI-to-PCI bridge apertures will indicate the padding
+ ///
+ EfiPaddingPciBus,
+ ///
+ /// Apply the padding at a PCI root bridge level. If a PCI root bridge
+ /// includes more than one hot-plug bus, the resource padding requests
+ /// for these buses are added together and the resources that are
+ /// allocated to the root bridge are padded by the specified amount. This
+ /// strategy may reduce the total amount of padding, but requires
+ /// reprogramming of PCI-to-PCI bridges in a hot-add event. If the hotplug
+ /// bus is behind a PCI-to-PCI bridge, the PCI-to-PCI bridge
+ /// apertures do not indicate the padding for that bus.
+ ///
+ EfiPaddingPciRootBridge
+} EFI_HPC_PADDING_ATTRIBUTES;
+
+/**
+ Returns a list of root Hot Plug Controllers (HPCs) that require initialization
+ during the boot process.
+
+ This procedure returns a list of root HPCs. The PCI bus driver must initialize
+ these controllers during the boot process. The PCI bus driver may or may not be
+ able to detect these HPCs. If the platform includes a PCI-to-CardBus bridge, it
+ can be included in this list if it requires initialization. The HpcList must be
+ self consistent. An HPC cannot control any of its parent buses. Only one HPC can
+ control a PCI bus. Because this list includes only root HPCs, no HPC in the list
+ can be a child of another HPC. This policy must be enforced by the
+ EFI_PCI_HOT_PLUG_INIT_PROTOCOL. The PCI bus driver may not check for such
+ invalid conditions. The callee allocates the buffer HpcList
+
+ @param[in] This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.
+ @param[out] HpcCount The number of root HPCs that were returned.
+ @param[out] HpcList The list of root HPCs. HpcCount defines the number of
+ elements in this list.
+
+ @retval EFI_SUCCESS HpcList was returned.
+ @retval EFI_OUT_OF_RESOURCES HpcList was not returned due to insufficient
+ resources.
+ @retval EFI_INVALID_PARAMETER HpcCount is NULL or HpcList is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_GET_ROOT_HPC_LIST)(
+ IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,
+ OUT UINTN *HpcCount,
+ OUT EFI_HPC_LOCATION **HpcList
+ );
+
+/**
+ Initializes one root Hot Plug Controller (HPC). This process may causes
+ initialization of its subordinate buses.
+
+ This function initializes the specified HPC. At the end of initialization,
+ the hot-plug slots or sockets (controlled by this HPC) are powered and are
+ connected to the bus. All the necessary registers in the HPC are set up. For
+ a Standard (PCI) Hot Plug Controller (SHPC), the registers that must be set
+ up are defined in the PCI Standard Hot Plug Controller and Subsystem
+ Specification.
+
+ @param[in] This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.
+ @param[in] HpcDevicePath The device path to the HPC that is being initialized.
+ @param[in] HpcPciAddress The address of the HPC function on the PCI bus.
+ @param[in] Event The event that should be signaled when the HPC
+ initialization is complete. Set to NULL if the
+ caller wants to wait until the entire initialization
+ process is complete.
+ @param[out] HpcState The state of the HPC hardware. The state is
+ EFI_HPC_STATE_INITIALIZED or EFI_HPC_STATE_ENABLED.
+
+ @retval EFI_SUCCESS If Event is NULL, the specific HPC was successfully
+ initialized. If Event is not NULL, Event will be
+ signaled at a later time when initialization is complete.
+ @retval EFI_UNSUPPORTED This instance of EFI_PCI_HOT_PLUG_INIT_PROTOCOL
+ does not support the specified HPC.
+ @retval EFI_OUT_OF_RESOURCES Initialization failed due to insufficient
+ resources.
+ @retval EFI_INVALID_PARAMETER HpcState is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_INITIALIZE_ROOT_HPC)(
+ IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,
+ IN UINT64 HpcPciAddress,
+ IN EFI_EVENT Event, OPTIONAL
+ OUT EFI_HPC_STATE *HpcState
+ );
+
+/**
+ Returns the resource padding that is required by the PCI bus that is controlled
+ by the specified Hot Plug Controller (HPC).
+
+ This function returns the resource padding that is required by the PCI bus that
+ is controlled by the specified HPC. This member function is called for all the
+ root HPCs and nonroot HPCs that are detected by the PCI bus enumerator. This
+ function will be called before PCI resource allocation is completed. This function
+ must be called after all the root HPCs, with the possible exception of a
+ PCI-to-CardBus bridge, have completed initialization.
+
+ @param[in] This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.
+ @param[in] HpcDevicePath The device path to the HPC.
+ @param[in] HpcPciAddress The address of the HPC function on the PCI bus.
+ @param[in] HpcState The state of the HPC hardware.
+ @param[out] Padding The amount of resource padding that is required by the
+ PCI bus under the control of the specified HPC.
+ @param[out] Attributes Describes how padding is accounted for. The padding
+ is returned in the form of ACPI 2.0 resource descriptors.
+
+ @retval EFI_SUCCESS The resource padding was successfully returned.
+ @retval EFI_UNSUPPORTED This instance of the EFI_PCI_HOT_PLUG_INIT_PROTOCOL
+ does not support the specified HPC.
+ @retval EFI_NOT_READY This function was called before HPC initialization
+ is complete.
+ @retval EFI_INVALID_PARAMETER HpcState or Padding or Attributes is NULL.
+ @retval EFI_OUT_OF_RESOURCES ACPI 2.0 resource descriptors for Padding
+ cannot be allocated due to insufficient resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_GET_HOT_PLUG_PADDING)(
+ IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,
+ IN UINT64 HpcPciAddress,
+ OUT EFI_HPC_STATE *HpcState,
+ OUT VOID **Padding,
+ OUT EFI_HPC_PADDING_ATTRIBUTES *Attributes
+ );
+
+///
+/// This protocol provides the necessary functionality to initialize the
+/// Hot Plug Controllers (HPCs) and the buses that they control. This protocol
+/// also provides information regarding resource padding.
+///
+struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL {
+ ///
+ /// Returns a list of root HPCs and the buses that they control.
+ ///
+ EFI_GET_ROOT_HPC_LIST GetRootHpcList;
+
+ ///
+ /// Initializes the specified root HPC.
+ ///
+ EFI_INITIALIZE_ROOT_HPC InitializeRootHpc;
+
+ ///
+ /// Returns the resource padding that is required by the HPC.
+ ///
+ EFI_GET_HOT_PLUG_PADDING GetResourcePadding;
+};
+
+extern EFI_GUID gEfiPciHotPlugInitProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciHotPlugRequest.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciHotPlugRequest.h
new file mode 100644
index 0000000000..c96b789b56
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciHotPlugRequest.h
@@ -0,0 +1,170 @@
+/** @file
+ Provides services to notify the PCI bus driver that some events have happened
+ in a hot-plug controller (such as a PC Card socket, or PHPC), and to ask the
+ PCI bus driver to create or destroy handles for PCI-like devices.
+
+ A hot-plug capable PCI bus driver should produce the EFI PCI Hot Plug Request
+ protocol. When a PCI device or a PCI-like device (for example, 32-bit PC Card)
+ is installed after PCI bus does the enumeration, the PCI bus driver can be
+ notified through this protocol. For example, when a 32-bit PC Card is inserted
+ into the PC Card socket, the PC Card bus driver can call interface of this
+ protocol to notify PCI bus driver to allocate resource and create handles for
+ this PC Card.
+
+ The EFI_PCI_HOTPLUG_REQUEST_PROTOCOL is installed by the PCI bus driver on a
+ separate handle when PCI bus driver starts up. There is only one instance in
+ the system. Any driver that wants to use this protocol must locate it globally.
+ The EFI_PCI_HOTPLUG_REQUEST_PROTOCOL allows the driver of hot-plug controller,
+ for example, PC Card Bus driver, to notify PCI bus driver that an event has
+ happened in the hot-plug controller, and the PCI bus driver is requested to
+ create (add) or destroy (remove) handles for the specified PCI-like devices.
+ For example, when a 32-bit PC Card is inserted, this protocol interface will
+ be called with an add operation, and the PCI bus driver will enumerate and
+ start the devices inserted; when a 32-bit PC Card is removed, this protocol
+ interface will be called with a remove operation, and the PCI bus driver will
+ stop the devices and destroy their handles. The existence of this protocol
+ represents the capability of the PCI bus driver. If this protocol exists in
+ system, it means PCI bus driver is hot-plug capable, thus together with the
+ effort of PC Card bus driver, hot-plug of PC Card can be supported. Otherwise,
+ the hot-plug capability is not provided.
+
+ Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is defined in UEFI Platform Initialization Specification 1.2
+ Volume 5: Standards
+
+**/
+
+#ifndef __PCI_HOTPLUG_REQUEST_H_
+#define __PCI_HOTPLUG_REQUEST_H_
+
+///
+/// Global ID for EFI_PCI_HOTPLUG_REQUEST_PROTOCOL
+///
+#define EFI_PCI_HOTPLUG_REQUEST_PROTOCOL_GUID \
+ { \
+ 0x19cb87ab, 0x2cb9, 0x4665, {0x83, 0x60, 0xdd, 0xcf, 0x60, 0x54, 0xf7, 0x9d} \
+ }
+
+///
+/// Forward declaration for EFI_PCI_HOTPLUG_REQUEST_PROTOCOL
+///
+typedef struct _EFI_PCI_HOTPLUG_REQUEST_PROTOCOL EFI_PCI_HOTPLUG_REQUEST_PROTOCOL;
+
+///
+/// Enumeration of PCI hot plug operations
+///
+typedef enum {
+ ///
+ /// The PCI bus driver is requested to create handles for the specified devices.
+ /// An array of EFI_HANDLE is returned, with a NULL element marking the end of
+ /// the array.
+ ///
+ EfiPciHotPlugRequestAdd,
+
+ ///
+ /// The PCI bus driver is requested to destroy handles for the specified devices.
+ ///
+ EfiPciHotplugRequestRemove
+} EFI_PCI_HOTPLUG_OPERATION;
+
+/**
+ This function is used to notify PCI bus driver that some events happened in a
+ hot-plug controller, and the PCI bus driver is requested to start or stop
+ specified PCI-like devices.
+
+ This function allows the PCI bus driver to be notified to act as requested when
+ a hot-plug event has happened on the hot-plug controller. Currently, the
+ operations include add operation and remove operation. If it is a add operation,
+ the PCI bus driver will enumerate, allocate resources for devices behind the
+ hot-plug controller, and create handle for the device specified by RemainingDevicePath.
+ The RemainingDevicePath is an optional parameter. If it is not NULL, only the
+ specified device is started; if it is NULL, all devices behind the hot-plug
+ controller are started. The newly created handles of PC Card functions are
+ returned in the ChildHandleBuffer, together with the number of child handle in
+ NumberOfChildren. If it is a remove operation, when NumberOfChildren contains
+ a non-zero value, child handles specified in ChildHandleBuffer are stopped and
+ destroyed; otherwise, PCI bus driver is notified to stop managing the controller
+ handle.
+
+ @param[in] This A pointer to the EFI_PCI_HOTPLUG_REQUEST_PROTOCOL
+ instance.
+ @param[in] Operation The operation the PCI bus driver is requested
+ to make.
+ @param[in] Controller The handle of the hot-plug controller.
+ @param[in] RemainingDevicePath The remaining device path for the PCI-like
+ hot-plug device. It only contains device
+ path nodes behind the hot-plug controller.
+ It is an optional parameter and only valid
+ when the Operation is a add operation. If
+ it is NULL, all devices behind the PC Card
+ socket are started.
+ @param[in,out] NumberOfChildren The number of child handles. For an add
+ operation, it is an output parameter. For
+ a remove operation, it's an input parameter.
+ When it contains a non-zero value, children
+ handles specified in ChildHandleBuffer are
+ destroyed. Otherwise, PCI bus driver is
+ notified to stop managing the controller
+ handle.
+ @param[in,out] ChildHandleBuffer The buffer which contains the child handles.
+ For an add operation, it is an output
+ parameter and contains all newly created
+ child handles. For a remove operation, it
+ contains child handles to be destroyed when
+ NumberOfChildren contains a non-zero value.
+ It can be NULL when NumberOfChildren is 0.
+ It's the caller's responsibility to allocate
+ and free memory for this buffer.
+
+ @retval EFI_SUCCESS The handles for the specified device have been
+ created or destroyed as requested, and for an
+ add operation, the new handles are returned in
+ ChildHandleBuffer.
+ @retval EFI_INVALID_PARAMETER Operation is not a legal value.
+ @retval EFI_INVALID_PARAMETER Controller is NULL or not a valid handle.
+ @retval EFI_INVALID_PARAMETER NumberOfChildren is NULL.
+ @retval EFI_INVALID_PARAMETER ChildHandleBuffer is NULL while Operation is
+ remove and NumberOfChildren contains a non-zero
+ value.
+ @retval EFI_INVALID_PARAMETER ChildHandleBuffer is NULL while Operation is add.
+ @retval EFI_OUT_OF_RESOURCES There are no enough resources to start the
+ devices.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_HOTPLUG_REQUEST_NOTIFY)(
+ IN EFI_PCI_HOTPLUG_REQUEST_PROTOCOL *This,
+ IN EFI_PCI_HOTPLUG_OPERATION Operation,
+ IN EFI_HANDLE Controller,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,
+ IN OUT UINT8 *NumberOfChildren,
+ IN OUT EFI_HANDLE *ChildHandleBuffer
+ );
+
+///
+/// Provides services to notify PCI bus driver that some events have happened in
+/// a hot-plug controller (for example, PC Card socket, or PHPC), and ask PCI bus
+/// driver to create or destroy handles for the PCI-like devices.
+///
+struct _EFI_PCI_HOTPLUG_REQUEST_PROTOCOL {
+ ///
+ /// Notify the PCI bus driver that some events have happened in a hot-plug
+ /// controller (for example, PC Card socket, or PHPC), and ask PCI bus driver
+ /// to create or destroy handles for the PCI-like devices. See Section 0 for
+ /// a detailed description.
+ ///
+ EFI_PCI_HOTPLUG_REQUEST_NOTIFY Notify;
+};
+
+extern EFI_GUID gEfiPciHotPlugRequestProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciIo.h
new file mode 100644
index 0000000000..6c51e85750
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciIo.h
@@ -0,0 +1,557 @@
+/** @file
+ EFI PCI I/O Protocol provides the basic Memory, I/O, PCI configuration,
+ and DMA interfaces that a driver uses to access its PCI controller.
+
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PCI_IO_H__
+#define __PCI_IO_H__
+
+///
+/// Global ID for the PCI I/O Protocol
+///
+#define EFI_PCI_IO_PROTOCOL_GUID \
+ { \
+ 0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a } \
+ }
+
+typedef struct _EFI_PCI_IO_PROTOCOL EFI_PCI_IO_PROTOCOL;
+
+///
+/// *******************************************************
+/// EFI_PCI_IO_PROTOCOL_WIDTH
+/// *******************************************************
+///
+typedef enum {
+ EfiPciIoWidthUint8 = 0,
+ EfiPciIoWidthUint16,
+ EfiPciIoWidthUint32,
+ EfiPciIoWidthUint64,
+ EfiPciIoWidthFifoUint8,
+ EfiPciIoWidthFifoUint16,
+ EfiPciIoWidthFifoUint32,
+ EfiPciIoWidthFifoUint64,
+ EfiPciIoWidthFillUint8,
+ EfiPciIoWidthFillUint16,
+ EfiPciIoWidthFillUint32,
+ EfiPciIoWidthFillUint64,
+ EfiPciIoWidthMaximum
+} EFI_PCI_IO_PROTOCOL_WIDTH;
+
+//
+// Complete PCI address generater
+//
+#define EFI_PCI_IO_PASS_THROUGH_BAR 0xff ///< Special BAR that passes a memory or I/O cycle through unchanged
+#define EFI_PCI_IO_ATTRIBUTE_MASK 0x077f ///< All the following I/O and Memory cycles
+#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001 ///< I/O cycles 0x0000-0x00FF (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002 ///< I/O cycles 0x0100-0x03FF or greater (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004 ///< I/O cycles 0x3C6, 0x3C8, 0x3C9 (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008 ///< MEM cycles 0xA0000-0xBFFFF (24 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010 ///< I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 ///< I/O cycles 0x1F0-0x1F7, 0x3F6, 0x3F7 (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 ///< I/O cycles 0x170-0x177, 0x376, 0x377 (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 ///< Map a memory range so writes are combined
+#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100 ///< Enable the I/O decode bit in the PCI Config Header
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200 ///< Enable the Memory decode bit in the PCI Config Header
+#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400 ///< Enable the DMA bit in the PCI Config Header
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800 ///< Map a memory range so all r/w accesses are cached
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 ///< Disable a memory range
+#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000 ///< Clear for an add-in PCI Device
+#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000 ///< Clear for a physical PCI Option ROM accessed through ROM BAR
+#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 ///< Clear for PCI controllers that can not genrate a DAC
+#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000 ///< I/O cycles 0x0100-0x03FF or greater (16 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 ///< I/O cycles 0x3C6, 0x3C8, 0x3C9 (16 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000 ///< I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (16 bit decode)
+
+#define EFI_PCI_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY | EFI_PCI_IO_ATTRIBUTE_BUS_MASTER)
+#define EFI_VGA_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_IO)
+
+///
+/// *******************************************************
+/// EFI_PCI_IO_PROTOCOL_OPERATION
+/// *******************************************************
+///
+typedef enum {
+ ///
+ /// A read operation from system memory by a bus master.
+ ///
+ EfiPciIoOperationBusMasterRead,
+ ///
+ /// A write operation from system memory by a bus master.
+ ///
+ EfiPciIoOperationBusMasterWrite,
+ ///
+ /// Provides both read and write access to system memory by both the processor and a
+ /// bus master. The buffer is coherent from both the processor's and the bus master's point of view.
+ ///
+ EfiPciIoOperationBusMasterCommonBuffer,
+ EfiPciIoOperationMaximum
+} EFI_PCI_IO_PROTOCOL_OPERATION;
+
+///
+/// *******************************************************
+/// EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION
+/// *******************************************************
+///
+typedef enum {
+ ///
+ /// Retrieve the PCI controller's current attributes, and return them in Result.
+ ///
+ EfiPciIoAttributeOperationGet,
+ ///
+ /// Set the PCI controller's current attributes to Attributes.
+ ///
+ EfiPciIoAttributeOperationSet,
+ ///
+ /// Enable the attributes specified by the bits that are set in Attributes for this PCI controller.
+ ///
+ EfiPciIoAttributeOperationEnable,
+ ///
+ /// Disable the attributes specified by the bits that are set in Attributes for this PCI controller.
+ ///
+ EfiPciIoAttributeOperationDisable,
+ ///
+ /// Retrieve the PCI controller's supported attributes, and return them in Result.
+ ///
+ EfiPciIoAttributeOperationSupported,
+ EfiPciIoAttributeOperationMaximum
+} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION;
+
+/**
+ Reads from the memory space of a PCI controller. Returns either when the polling exit criteria is
+ satisfied or after a defined duration.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ @param Width Signifies the width of the memory or I/O operations.
+ @param BarIndex The BAR index of the standard PCI Configuration header to use as the
+ base address for the memory operation to perform.
+ @param Offset The offset within the selected BAR to start the memory operation.
+ @param Mask Mask used for the polling criteria.
+ @param Value The comparison value used for the polling exit criteria.
+ @param Delay The number of 100 ns units to poll.
+ @param Result Pointer to the last value read from the memory location.
+
+ @retval EFI_SUCCESS The last data returned from the access matched the poll exit criteria.
+ @retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller.
+ @retval EFI_UNSUPPORTED Offset is not valid for the BarIndex of this PCI controller.
+ @retval EFI_TIMEOUT Delay expired before a match occurred.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_POLL_IO_MEM)(
+ IN EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
+ IN UINT8 BarIndex,
+ IN UINT64 Offset,
+ IN UINT64 Mask,
+ IN UINT64 Value,
+ IN UINT64 Delay,
+ OUT UINT64 *Result
+ );
+
+/**
+ Enable a PCI driver to access PCI controller registers in the PCI memory or I/O space.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ @param Width Signifies the width of the memory or I/O operations.
+ @param BarIndex The BAR index of the standard PCI Configuration header to use as the
+ base address for the memory or I/O operation to perform.
+ @param Offset The offset within the selected BAR to start the memory or I/O operation.
+ @param Count The number of memory or I/O operations to perform.
+ @param Buffer For read operations, the destination buffer to store the results. For write
+ operations, the source buffer to write data from.
+
+ @retval EFI_SUCCESS The data was read from or written to the PCI controller.
+ @retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller.
+ @retval EFI_UNSUPPORTED The address range specified by Offset, Width, and Count is not
+ valid for the PCI BAR specified by BarIndex.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_IO_MEM)(
+ IN EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
+ IN UINT8 BarIndex,
+ IN UINT64 Offset,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+ );
+
+typedef struct {
+ ///
+ /// Read PCI controller registers in the PCI memory or I/O space.
+ ///
+ EFI_PCI_IO_PROTOCOL_IO_MEM Read;
+ ///
+ /// Write PCI controller registers in the PCI memory or I/O space.
+ ///
+ EFI_PCI_IO_PROTOCOL_IO_MEM Write;
+} EFI_PCI_IO_PROTOCOL_ACCESS;
+
+/**
+ Enable a PCI driver to access PCI controller registers in PCI configuration space.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ @param Width Signifies the width of the memory operations.
+ @param Offset The offset within the PCI configuration space for the PCI controller.
+ @param Count The number of PCI configuration operations to perform.
+ @param Buffer For read operations, the destination buffer to store the results. For write
+ operations, the source buffer to write data from.
+
+
+ @retval EFI_SUCCESS The data was read from or written to the PCI controller.
+ @retval EFI_UNSUPPORTED The address range specified by Offset, Width, and Count is not
+ valid for the PCI configuration header of the PCI controller.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER Buffer is NULL or Width is invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_CONFIG)(
+ IN EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
+ IN UINT32 Offset,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+ );
+
+typedef struct {
+ ///
+ /// Read PCI controller registers in PCI configuration space.
+ ///
+ EFI_PCI_IO_PROTOCOL_CONFIG Read;
+ ///
+ /// Write PCI controller registers in PCI configuration space.
+ ///
+ EFI_PCI_IO_PROTOCOL_CONFIG Write;
+} EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS;
+
+/**
+ Enables a PCI driver to copy one region of PCI memory space to another region of PCI
+ memory space.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ @param Width Signifies the width of the memory operations.
+ @param DestBarIndex The BAR index in the standard PCI Configuration header to use as the
+ base address for the memory operation to perform.
+ @param DestOffset The destination offset within the BAR specified by DestBarIndex to
+ start the memory writes for the copy operation.
+ @param SrcBarIndex The BAR index in the standard PCI Configuration header to use as the
+ base address for the memory operation to perform.
+ @param SrcOffset The source offset within the BAR specified by SrcBarIndex to start
+ the memory reads for the copy operation.
+ @param Count The number of memory operations to perform. Bytes moved is Width
+ size * Count, starting at DestOffset and SrcOffset.
+
+ @retval EFI_SUCCESS The data was copied from one memory region to another memory region.
+ @retval EFI_UNSUPPORTED DestBarIndex not valid for this PCI controller.
+ @retval EFI_UNSUPPORTED SrcBarIndex not valid for this PCI controller.
+ @retval EFI_UNSUPPORTED The address range specified by DestOffset, Width, and Count
+ is not valid for the PCI BAR specified by DestBarIndex.
+ @retval EFI_UNSUPPORTED The address range specified by SrcOffset, Width, and Count is
+ not valid for the PCI BAR specified by SrcBarIndex.
+ @retval EFI_INVALID_PARAMETER Width is invalid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_COPY_MEM)(
+ IN EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
+ IN UINT8 DestBarIndex,
+ IN UINT64 DestOffset,
+ IN UINT8 SrcBarIndex,
+ IN UINT64 SrcOffset,
+ IN UINTN Count
+ );
+
+/**
+ Provides the PCI controller-specific addresses needed to access system memory.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ @param Operation Indicates if the bus master is going to read or write to system memory.
+ @param HostAddress The system memory address to map to the PCI controller.
+ @param NumberOfBytes On input the number of bytes to map. On output the number of bytes
+ that were mapped.
+ @param DeviceAddress The resulting map address for the bus master PCI controller to use to
+ access the hosts HostAddress.
+ @param Mapping A resulting value to pass to Unmap().
+
+ @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
+ @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_DEVICE_ERROR The system hardware could not map the requested address.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_MAP)(
+ IN EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL_OPERATION Operation,
+ IN VOID *HostAddress,
+ IN OUT UINTN *NumberOfBytes,
+ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
+ OUT VOID **Mapping
+ );
+
+/**
+ Completes the Map() operation and releases any corresponding resources.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ @param Mapping The mapping value returned from Map().
+
+ @retval EFI_SUCCESS The range was unmapped.
+ @retval EFI_DEVICE_ERROR The data was not committed to the target system memory.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_UNMAP)(
+ IN EFI_PCI_IO_PROTOCOL *This,
+ IN VOID *Mapping
+ );
+
+/**
+ Allocates pages that are suitable for an EfiPciIoOperationBusMasterCommonBuffer
+ or EfiPciOperationBusMasterCommonBuffer64 mapping.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ @param Type This parameter is not used and must be ignored.
+ @param MemoryType The type of memory to allocate, EfiBootServicesData or
+ EfiRuntimeServicesData.
+ @param Pages The number of pages to allocate.
+ @param HostAddress A pointer to store the base system memory address of the
+ allocated range.
+ @param Attributes The requested bit mask of attributes for the allocated range.
+
+ @retval EFI_SUCCESS The requested memory pages were allocated.
+ @retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are
+ MEMORY_WRITE_COMBINE, MEMORY_CACHED and DUAL_ADDRESS_CYCLE.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER)(
+ IN EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_ALLOCATE_TYPE Type,
+ IN EFI_MEMORY_TYPE MemoryType,
+ IN UINTN Pages,
+ OUT VOID **HostAddress,
+ IN UINT64 Attributes
+ );
+
+/**
+ Frees memory that was allocated with AllocateBuffer().
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ @param Pages The number of pages to free.
+ @param HostAddress The base system memory address of the allocated range.
+
+ @retval EFI_SUCCESS The requested memory pages were freed.
+ @retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages
+ was not allocated with AllocateBuffer().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_FREE_BUFFER)(
+ IN EFI_PCI_IO_PROTOCOL *This,
+ IN UINTN Pages,
+ IN VOID *HostAddress
+ );
+
+/**
+ Flushes all PCI posted write transactions from a PCI host bridge to system memory.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The PCI posted write transactions were flushed from the PCI host
+ bridge to system memory.
+ @retval EFI_DEVICE_ERROR The PCI posted write transactions were not flushed from the PCI
+ host bridge due to a hardware error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_FLUSH)(
+ IN EFI_PCI_IO_PROTOCOL *This
+ );
+
+/**
+ Retrieves this PCI controller's current PCI bus number, device number, and function number.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ @param SegmentNumber The PCI controller's current PCI segment number.
+ @param BusNumber The PCI controller's current PCI bus number.
+ @param DeviceNumber The PCI controller's current PCI device number.
+ @param FunctionNumber The PCI controller's current PCI function number.
+
+ @retval EFI_SUCCESS The PCI controller location was returned.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_LOCATION)(
+ IN EFI_PCI_IO_PROTOCOL *This,
+ OUT UINTN *SegmentNumber,
+ OUT UINTN *BusNumber,
+ OUT UINTN *DeviceNumber,
+ OUT UINTN *FunctionNumber
+ );
+
+/**
+ Performs an operation on the attributes that this PCI controller supports. The operations include
+ getting the set of supported attributes, retrieving the current attributes, setting the current
+ attributes, enabling attributes, and disabling attributes.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ @param Operation The operation to perform on the attributes for this PCI controller.
+ @param Attributes The mask of attributes that are used for Set, Enable, and Disable
+ operations.
+ @param Result A pointer to the result mask of attributes that are returned for the Get
+ and Supported operations.
+
+ @retval EFI_SUCCESS The operation on the PCI controller's attributes was completed.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_UNSUPPORTED one or more of the bits set in
+ Attributes are not supported by this PCI controller or one of
+ its parent bridges when Operation is Set, Enable or Disable.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_ATTRIBUTES)(
+ IN EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation,
+ IN UINT64 Attributes,
+ OUT UINT64 *Result OPTIONAL
+ );
+
+/**
+ Gets the attributes that this PCI controller supports setting on a BAR using
+ SetBarAttributes(), and retrieves the list of resource descriptors for a BAR.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ @param BarIndex The BAR index of the standard PCI Configuration header to use as the
+ base address for resource range. The legal range for this field is 0..5.
+ @param Supports A pointer to the mask of attributes that this PCI controller supports
+ setting for this BAR with SetBarAttributes().
+ @param Resources A pointer to the resource descriptors that describe the current
+ configuration of this BAR of the PCI controller.
+
+ @retval EFI_SUCCESS If Supports is not NULL, then the attributes that the PCI
+ controller supports are returned in Supports. If Resources
+ is not NULL, then the resource descriptors that the PCI
+ controller is currently using are returned in Resources.
+ @retval EFI_INVALID_PARAMETER Both Supports and Attributes are NULL.
+ @retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate
+ Resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES)(
+ IN EFI_PCI_IO_PROTOCOL *This,
+ IN UINT8 BarIndex,
+ OUT UINT64 *Supports, OPTIONAL
+ OUT VOID **Resources OPTIONAL
+ );
+
+/**
+ Sets the attributes for a range of a BAR on a PCI controller.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ @param Attributes The mask of attributes to set for the resource range specified by
+ BarIndex, Offset, and Length.
+ @param BarIndex The BAR index of the standard PCI Configuration header to use as the
+ base address for resource range. The legal range for this field is 0..5.
+ @param Offset A pointer to the BAR relative base address of the resource range to be
+ modified by the attributes specified by Attributes.
+ @param Length A pointer to the length of the resource range to be modified by the
+ attributes specified by Attributes.
+
+ @retval EFI_SUCCESS The set of attributes specified by Attributes for the resource
+ range specified by BarIndex, Offset, and Length were
+ set on the PCI controller, and the actual resource range is returned
+ in Offset and Length.
+ @retval EFI_INVALID_PARAMETER Offset or Length is NULL.
+ @retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the attributes on the
+ resource range specified by BarIndex, Offset, and
+ Length.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES)(
+ IN EFI_PCI_IO_PROTOCOL *This,
+ IN UINT64 Attributes,
+ IN UINT8 BarIndex,
+ IN OUT UINT64 *Offset,
+ IN OUT UINT64 *Length
+ );
+
+///
+/// The EFI_PCI_IO_PROTOCOL provides the basic Memory, I/O, PCI configuration,
+/// and DMA interfaces used to abstract accesses to PCI controllers.
+/// There is one EFI_PCI_IO_PROTOCOL instance for each PCI controller on a PCI bus.
+/// A device driver that wishes to manage a PCI controller in a system will have to
+/// retrieve the EFI_PCI_IO_PROTOCOL instance that is associated with the PCI controller.
+///
+struct _EFI_PCI_IO_PROTOCOL {
+ EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollMem;
+ EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollIo;
+ EFI_PCI_IO_PROTOCOL_ACCESS Mem;
+ EFI_PCI_IO_PROTOCOL_ACCESS Io;
+ EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci;
+ EFI_PCI_IO_PROTOCOL_COPY_MEM CopyMem;
+ EFI_PCI_IO_PROTOCOL_MAP Map;
+ EFI_PCI_IO_PROTOCOL_UNMAP Unmap;
+ EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer;
+ EFI_PCI_IO_PROTOCOL_FREE_BUFFER FreeBuffer;
+ EFI_PCI_IO_PROTOCOL_FLUSH Flush;
+ EFI_PCI_IO_PROTOCOL_GET_LOCATION GetLocation;
+ EFI_PCI_IO_PROTOCOL_ATTRIBUTES Attributes;
+ EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes;
+ EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES SetBarAttributes;
+
+ ///
+ /// The size, in bytes, of the ROM image.
+ ///
+ UINT64 RomSize;
+
+ ///
+ /// A pointer to the in memory copy of the ROM image. The PCI Bus Driver is responsible
+ /// for allocating memory for the ROM image, and copying the contents of the ROM to memory.
+ /// The contents of this buffer are either from the PCI option ROM that can be accessed
+ /// through the ROM BAR of the PCI controller, or it is from a platform-specific location.
+ /// The Attributes() function can be used to determine from which of these two sources
+ /// the RomImage buffer was initialized.
+ ///
+ VOID *RomImage;
+};
+
+extern EFI_GUID gEfiPciIoProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciOverride.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciOverride.h
new file mode 100644
index 0000000000..c1edcc52fa
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciOverride.h
@@ -0,0 +1,46 @@
+/** @file
+ This file declares EFI PCI Override protocol which provides the interface between
+ the PCI bus driver/PCI Host Bridge Resource Allocation driver and an implementation's
+ driver to describe the unique features of a platform.
+ This protocol is optional.
+
+ Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is defined in UEFI Platform Initialization Specification 1.2
+ Volume 5: Standards
+
+**/
+
+#ifndef _PCI_OVERRIDE_H_
+#define _PCI_OVERRIDE_H_
+
+///
+/// EFI_PCI_OVERRIDE_PROTOCOL has the same structure with EFI_PCI_PLATFORM_PROTOCOL
+///
+#include <Protocol/PciPlatform.h>
+
+///
+/// Global ID for the EFI_PCI_OVERRIDE_PROTOCOL
+///
+#define EFI_PCI_OVERRIDE_GUID \
+ { \
+ 0xb5b35764, 0x460c, 0x4a06, {0x99, 0xfc, 0x77, 0xa1, 0x7c, 0x1b, 0x5c, 0xeb} \
+ }
+
+///
+/// Declaration for EFI_PCI_OVERRIDE_PROTOCOL
+///
+typedef EFI_PCI_PLATFORM_PROTOCOL EFI_PCI_OVERRIDE_PROTOCOL;
+
+
+extern EFI_GUID gEfiPciOverrideProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciPlatform.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciPlatform.h
new file mode 100644
index 0000000000..056f92b1ef
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciPlatform.h
@@ -0,0 +1,344 @@
+/** @file
+ This file declares PlatfromOpRom protocols that provide the interface between
+ the PCI bus driver/PCI Host Bridge Resource Allocation driver and a platform-specific
+ driver to describe the unique features of a platform.
+ This protocol is optional.
+
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is defined in UEFI Platform Initialization Specification 1.2
+ Volume 5: Standards
+
+**/
+
+#ifndef _PCI_PLATFORM_H_
+#define _PCI_PLATFORM_H_
+
+///
+/// This file must be included because the EFI_PCI_PLATFORM_PROTOCOL uses
+/// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE.
+///
+#include <Protocol/PciHostBridgeResourceAllocation.h>
+
+///
+/// Global ID for the EFI_PCI_PLATFORM_PROTOCOL.
+///
+#define EFI_PCI_PLATFORM_PROTOCOL_GUID \
+ { \
+ 0x7d75280, 0x27d4, 0x4d69, {0x90, 0xd0, 0x56, 0x43, 0xe2, 0x38, 0xb3, 0x41} \
+ }
+
+///
+/// Forward declaration for EFI_PCI_PLATFORM_PROTOCOL.
+///
+typedef struct _EFI_PCI_PLATFORM_PROTOCOL EFI_PCI_PLATFORM_PROTOCOL;
+
+///
+/// EFI_PCI_PLATFORM_POLICY that is a bitmask with the following legal combinations:
+/// - EFI_RESERVE_NONE_IO_ALIAS:<BR>
+/// Does not set aside either ISA or VGA I/O resources during PCI
+/// enumeration. By using this selection, the platform indicates that it does
+/// not want to support a PCI device that requires ISA or legacy VGA
+/// resources. If a PCI device driver asks for these resources, the request
+/// will be turned down.
+/// - EFI_RESERVE_ISA_IO_ALIAS | EFI_RESERVE_VGA_IO_ALIAS:<BR>
+/// Sets aside the ISA I/O range and all the aliases during PCI
+/// enumeration. VGA I/O ranges and aliases are included in ISA alias
+/// ranges. In this scheme, seventy-five percent of the I/O space remains unused.
+/// By using this selection, the platform indicates that it wants to support
+/// PCI devices that require the following, at the cost of wasted I/O space:
+/// ISA range and its aliases
+/// Legacy VGA range and its aliases
+/// The PCI bus driver will not allocate I/O addresses out of the ISA I/O
+/// range and its aliases. The following are the ISA I/O ranges:
+/// - n100..n3FF
+/// - n500..n7FF
+/// - n900..nBFF
+/// - nD00..nFFF
+///
+/// In this case, the PCI bus driver will ask the PCI host bridge driver for
+/// larger I/O ranges. The PCI host bridge driver is not aware of the ISA
+/// aliasing policy and merely attempts to allocate the requested ranges.
+/// The first device that requests the legacy VGA range will get all the
+/// legacy VGA range plus its aliased addresses forwarded to it. The first
+/// device that requests the legacy ISA range will get all the legacy ISA
+/// range, plus its aliased addresses, forwarded to it.
+/// - EFI_RESERVE_ISA_IO_NO_ALIAS | EFI_RESERVE_VGA_IO_ALIAS:<BR>
+/// Sets aside the ISA I/O range (0x100 - 0x3FF) during PCI enumeration
+/// and the aliases of the VGA I/O ranges. By using this selection, the
+/// platform indicates that it will support VGA devices that require VGA
+/// ranges, including those that require VGA aliases. The platform further
+/// wants to support non-VGA devices that ask for the ISA range (0x100 -
+/// 3FF), but not if it also asks for the ISA aliases. The PCI bus driver will
+/// not allocate I/O addresses out of the legacy ISA I/O range (0x100 -
+/// 0x3FF) range or the aliases of the VGA I/O range. If a PCI device
+/// driver asks for the ISA I/O ranges, including aliases, the request will be
+/// turned down. The first device that requests the legacy VGA range will
+/// get all the legacy VGA range plus its aliased addresses forwarded to
+/// it. When the legacy VGA device asks for legacy VGA ranges and its
+/// aliases, all the upstream PCI-to-PCI bridges must be set up to perform
+/// 10-bit decode on legacy VGA ranges. To prevent two bridges from
+/// positively decoding the same address, all PCI-to-PCI bridges that are
+/// peers to this bridge will have to be set up to not decode ISA aliased
+/// ranges. In that case, all the devices behind the peer bridges can
+/// occupy only I/O addresses that are not ISA aliases. This is a limitation
+/// of PCI-to-PCI bridges and is described in the white paper PCI-to-PCI
+/// Bridges and Card Bus Controllers on Windows 2000, Windows XP,
+/// and Windows Server 2003. The PCI enumeration process must be
+/// cognizant of this restriction.
+/// - EFI_RESERVE_ISA_IO_NO_ALIAS | EFI_RESERVE_VGA_IO_NO_ALIAS:<BR>
+/// Sets aside the ISA I/O range (0x100 - 0x3FF) during PCI enumeration.
+/// VGA I/O ranges are included in the ISA range. By using this selection,
+/// the platform indicates that it wants to support PCI devices that require
+/// the ISA range and legacy VGA range, but it does not want to support
+/// devices that require ISA alias ranges or VGA alias ranges. The PCI
+/// bus driver will not allocate I/O addresses out of the legacy ISA I/O
+/// range (0x100-0x3FF). If a PCI device driver asks for the ISA I/O
+/// ranges, including aliases, the request will be turned down. By using
+/// this selection, the platform indicates that it will support VGA devices
+/// that require VGA ranges, but it will not support VGA devices that
+/// require VGA aliases. To truly support 16-bit VGA decode, all the PCIto-
+/// PCI bridges that are upstream to a VGA device, as well as
+/// upstream to the parent PCI root bridge, must support 16-bit VGA I/O
+/// decode. See the PCI-to-PCI Bridge Architecture Specification for
+/// information regarding the 16-bit VGA decode support. This
+/// requirement must hold true for every VGA device in the system. If any
+/// of these bridges does not support 16-bit VGA decode, it will positively
+/// decode all the aliases of the VGA I/O ranges and this selection must
+/// be treated like EFI_RESERVE_ISA_IO_NO_ALIAS |
+/// EFI_RESERVE_VGA_IO_ALIAS.
+///
+typedef UINT32 EFI_PCI_PLATFORM_POLICY;
+
+///
+/// Does not set aside either ISA or VGA I/O resources during PCI
+/// enumeration.
+///
+#define EFI_RESERVE_NONE_IO_ALIAS 0x0000
+
+///
+/// Sets aside ISA I/O range and all aliases:
+/// - n100..n3FF
+/// - n500..n7FF
+/// - n900..nBFF
+/// - nD00..nFFF.
+///
+#define EFI_RESERVE_ISA_IO_ALIAS 0x0001
+
+///
+/// Sets aside ISA I/O range 0x100-0x3FF.
+///
+#define EFI_RESERVE_ISA_IO_NO_ALIAS 0x0002
+
+///
+/// Sets aside VGA I/O ranges and all aliases.
+///
+#define EFI_RESERVE_VGA_IO_ALIAS 0x0004
+
+///
+/// Sets aside VGA I/O ranges
+///
+#define EFI_RESERVE_VGA_IO_NO_ALIAS 0x0008
+
+///
+/// EFI_PCI_EXECUTION_PHASE is used to call a platform protocol and execute
+/// platform-specific code.
+///
+typedef enum {
+ ///
+ /// The phase that indicates the entry point to the PCI Bus Notify phase. This
+ /// platform hook is called before the PCI bus driver calls the
+ /// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL driver.
+ ///
+ BeforePciHostBridge = 0,
+ ///
+ /// The phase that indicates the entry point to the PCI Bus Notify phase. This
+ /// platform hook is called before the PCI bus driver calls the
+ /// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL driver.
+ ///
+ ChipsetEntry = 0,
+ ///
+ /// The phase that indicates the exit point to the Chipset Notify phase before
+ /// returning to the PCI Bus Driver Notify phase. This platform hook is called after
+ /// the PCI bus driver calls the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
+ /// driver.
+ ///
+ AfterPciHostBridge = 1,
+ ///
+ /// The phase that indicates the exit point to the Chipset Notify phase before
+ /// returning to the PCI Bus Driver Notify phase. This platform hook is called after
+ /// the PCI bus driver calls the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
+ /// driver.
+ ///
+ ChipsetExit = 1,
+ MaximumChipsetPhase
+} EFI_PCI_EXECUTION_PHASE;
+
+typedef EFI_PCI_EXECUTION_PHASE EFI_PCI_CHIPSET_EXECUTION_PHASE;
+
+/**
+ The notification from the PCI bus enumerator to the platform that it is
+ about to enter a certain phase during the enumeration process.
+
+ The PlatformNotify() function can be used to notify the platform driver so that
+ it can perform platform-specific actions. No specific actions are required.
+ Eight notification points are defined at this time. More synchronization points
+ may be added as required in the future. The PCI bus driver calls the platform driver
+ twice for every Phase-once before the PCI Host Bridge Resource Allocation Protocol
+ driver is notified, and once after the PCI Host Bridge Resource Allocation Protocol
+ driver has been notified.
+ This member function may not perform any error checking on the input parameters. It
+ also does not return any error codes. If this member function detects any error condition,
+ it needs to handle those errors on its own because there is no way to surface any
+ errors to the caller.
+
+ @param[in] This The pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.
+ @param[in] HostBridge The handle of the host bridge controller.
+ @param[in] Phase The phase of the PCI bus enumeration.
+ @param[in] ExecPhase Defines the execution phase of the PCI chipset driver.
+
+ @retval EFI_SUCCESS The function completed successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_PLATFORM_PHASE_NOTIFY)(
+ IN EFI_PCI_PLATFORM_PROTOCOL *This,
+ IN EFI_HANDLE HostBridge,
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase,
+ IN EFI_PCI_EXECUTION_PHASE ExecPhase
+ );
+
+/**
+ The notification from the PCI bus enumerator to the platform for each PCI
+ controller at several predefined points during PCI controller initialization.
+
+ The PlatformPrepController() function can be used to notify the platform driver so that
+ it can perform platform-specific actions. No specific actions are required.
+ Several notification points are defined at this time. More synchronization points may be
+ added as required in the future. The PCI bus driver calls the platform driver twice for
+ every PCI controller-once before the PCI Host Bridge Resource Allocation Protocol driver
+ is notified, and once after the PCI Host Bridge Resource Allocation Protocol driver has
+ been notified.
+ This member function may not perform any error checking on the input parameters. It also
+ does not return any error codes. If this member function detects any error condition, it
+ needs to handle those errors on its own because there is no way to surface any errors to
+ the caller.
+
+ @param[in] This The pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.
+ @param[in] HostBridge The associated PCI host bridge handle.
+ @param[in] RootBridge The associated PCI root bridge handle.
+ @param[in] PciAddress The address of the PCI device on the PCI bus.
+ @param[in] Phase The phase of the PCI controller enumeration.
+ @param[in] ExecPhase Defines the execution phase of the PCI chipset driver.
+
+ @retval EFI_SUCCESS The function completed successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER)(
+ IN EFI_PCI_PLATFORM_PROTOCOL *This,
+ IN EFI_HANDLE HostBridge,
+ IN EFI_HANDLE RootBridge,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress,
+ IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase,
+ IN EFI_PCI_EXECUTION_PHASE ExecPhase
+ );
+
+/**
+ Retrieves the platform policy regarding enumeration.
+
+ The GetPlatformPolicy() function retrieves the platform policy regarding PCI
+ enumeration. The PCI bus driver and the PCI Host Bridge Resource Allocation Protocol
+ driver can call this member function to retrieve the policy.
+
+ @param[in] This The pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.
+ @param[out] PciPolicy The platform policy with respect to VGA and ISA aliasing.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_INVALID_PARAMETER PciPolicy is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_PLATFORM_GET_PLATFORM_POLICY)(
+ IN CONST EFI_PCI_PLATFORM_PROTOCOL *This,
+ OUT EFI_PCI_PLATFORM_POLICY *PciPolicy
+ );
+
+/**
+ Gets the PCI device's option ROM from a platform-specific location.
+
+ The GetPciRom() function gets the PCI device's option ROM from a platform-specific location.
+ The option ROM will be loaded into memory. This member function is used to return an image
+ that is packaged as a PCI 2.2 option ROM. The image may contain both legacy and EFI option
+ ROMs. See the UEFI 2.0 Specification for details. This member function can be used to return
+ option ROM images for embedded controllers. Option ROMs for embedded controllers are typically
+ stored in platform-specific storage, and this member function can retrieve it from that storage
+ and return it to the PCI bus driver. The PCI bus driver will call this member function before
+ scanning the ROM that is attached to any controller, which allows a platform to specify a ROM
+ image that is different from the ROM image on a PCI card.
+
+ @param[in] This The pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.
+ @param[in] PciHandle The handle of the PCI device.
+ @param[out] RomImage If the call succeeds, the pointer to the pointer to the option ROM image.
+ Otherwise, this field is undefined. The memory for RomImage is allocated
+ by EFI_PCI_PLATFORM_PROTOCOL.GetPciRom() using the EFI Boot Service AllocatePool().
+ It is the caller's responsibility to free the memory using the EFI Boot Service
+ FreePool(), when the caller is done with the option ROM.
+ @param[out] RomSize If the call succeeds, a pointer to the size of the option ROM size. Otherwise,
+ this field is undefined.
+
+ @retval EFI_SUCCESS The option ROM was available for this device and loaded into memory.
+ @retval EFI_NOT_FOUND No option ROM was available for this device.
+ @retval EFI_OUT_OF_RESOURCES No memory was available to load the option ROM.
+ @retval EFI_DEVICE_ERROR An error occurred in obtaining the option ROM.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_PLATFORM_GET_PCI_ROM)(
+ IN CONST EFI_PCI_PLATFORM_PROTOCOL *This,
+ IN EFI_HANDLE PciHandle,
+ OUT VOID **RomImage,
+ OUT UINTN *RomSize
+ );
+
+///
+/// This protocol provides the interface between the PCI bus driver/PCI Host
+/// Bridge Resource Allocation driver and a platform-specific driver to describe
+/// the unique features of a platform.
+///
+struct _EFI_PCI_PLATFORM_PROTOCOL {
+ ///
+ /// The notification from the PCI bus enumerator to the platform that it is about to
+ /// enter a certain phase during the enumeration process.
+ ///
+ EFI_PCI_PLATFORM_PHASE_NOTIFY PlatformNotify;
+ ///
+ /// The notification from the PCI bus enumerator to the platform for each PCI
+ /// controller at several predefined points during PCI controller initialization.
+ ///
+ EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER PlatformPrepController;
+ ///
+ /// Retrieves the platform policy regarding enumeration.
+ ///
+ EFI_PCI_PLATFORM_GET_PLATFORM_POLICY GetPlatformPolicy;
+ ///
+ /// Gets the PCI device's option ROM from a platform-specific location.
+ ///
+ EFI_PCI_PLATFORM_GET_PCI_ROM GetPciRom;
+};
+
+extern EFI_GUID gEfiPciPlatformProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciRootBridgeIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciRootBridgeIo.h
new file mode 100644
index 0000000000..11ea71033f
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PciRootBridgeIo.h
@@ -0,0 +1,442 @@
+/** @file
+ PCI Root Bridge I/O protocol as defined in the UEFI 2.0 specification.
+
+ PCI Root Bridge I/O protocol is used by PCI Bus Driver to perform PCI Memory, PCI I/O,
+ and PCI Configuration cycles on a PCI Root Bridge. It also provides services to perform
+ defferent types of bus mastering DMA.
+
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PCI_ROOT_BRIDGE_IO_H__
+#define __PCI_ROOT_BRIDGE_IO_H__
+
+#include <Library/BaseLib.h>
+
+#define EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \
+ { \
+ 0x2f707ebb, 0x4a1a, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
+ }
+
+typedef struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL;
+
+///
+/// *******************************************************
+/// EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH
+/// *******************************************************
+///
+typedef enum {
+ EfiPciWidthUint8,
+ EfiPciWidthUint16,
+ EfiPciWidthUint32,
+ EfiPciWidthUint64,
+ EfiPciWidthFifoUint8,
+ EfiPciWidthFifoUint16,
+ EfiPciWidthFifoUint32,
+ EfiPciWidthFifoUint64,
+ EfiPciWidthFillUint8,
+ EfiPciWidthFillUint16,
+ EfiPciWidthFillUint32,
+ EfiPciWidthFillUint64,
+ EfiPciWidthMaximum
+} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH;
+
+///
+/// *******************************************************
+/// EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION
+/// *******************************************************
+///
+typedef enum {
+ ///
+ /// A read operation from system memory by a bus master that is not capable of producing
+ /// PCI dual address cycles.
+ ///
+ EfiPciOperationBusMasterRead,
+ ///
+ /// A write operation from system memory by a bus master that is not capable of producing
+ /// PCI dual address cycles.
+ ///
+ EfiPciOperationBusMasterWrite,
+ ///
+ /// Provides both read and write access to system memory by both the processor and a bus
+ /// master that is not capable of producing PCI dual address cycles.
+ ///
+ EfiPciOperationBusMasterCommonBuffer,
+ ///
+ /// A read operation from system memory by a bus master that is capable of producing PCI
+ /// dual address cycles.
+ ///
+ EfiPciOperationBusMasterRead64,
+ ///
+ /// A write operation to system memory by a bus master that is capable of producing PCI
+ /// dual address cycles.
+ ///
+ EfiPciOperationBusMasterWrite64,
+ ///
+ /// Provides both read and write access to system memory by both the processor and a bus
+ /// master that is capable of producing PCI dual address cycles.
+ ///
+ EfiPciOperationBusMasterCommonBuffer64,
+ EfiPciOperationMaximum
+} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION;
+
+#define EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001
+#define EFI_PCI_ATTRIBUTE_ISA_IO 0x0002
+#define EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO 0x0004
+#define EFI_PCI_ATTRIBUTE_VGA_MEMORY 0x0008
+#define EFI_PCI_ATTRIBUTE_VGA_IO 0x0010
+#define EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO 0x0020
+#define EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO 0x0040
+#define EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080
+#define EFI_PCI_ATTRIBUTE_MEMORY_CACHED 0x0800
+#define EFI_PCI_ATTRIBUTE_MEMORY_DISABLE 0x1000
+#define EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000
+#define EFI_PCI_ATTRIBUTE_ISA_IO_16 0x10000
+#define EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000
+#define EFI_PCI_ATTRIBUTE_VGA_IO_16 0x40000
+
+#define EFI_PCI_ATTRIBUTE_VALID_FOR_ALLOCATE_BUFFER (EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE | EFI_PCI_ATTRIBUTE_MEMORY_CACHED | EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE)
+
+#define EFI_PCI_ATTRIBUTE_INVALID_FOR_ALLOCATE_BUFFER (~EFI_PCI_ATTRIBUTE_VALID_FOR_ALLOCATE_BUFFER)
+
+#define EFI_PCI_ADDRESS(bus, dev, func, reg) \
+ (UINT64) ( \
+ (((UINTN) bus) << 24) | \
+ (((UINTN) dev) << 16) | \
+ (((UINTN) func) << 8) | \
+ (((UINTN) (reg)) < 256 ? ((UINTN) (reg)) : (UINT64) (LShiftU64 ((UINT64) (reg), 32))))
+
+typedef struct {
+ UINT8 Register;
+ UINT8 Function;
+ UINT8 Device;
+ UINT8 Bus;
+ UINT32 ExtendedRegister;
+} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS;
+
+/**
+ Reads from the I/O space of a PCI Root Bridge. Returns when either the polling exit criteria is
+ satisfied or after a defined duration.
+
+ @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
+ @param Width Signifies the width of the memory or I/O operations.
+ @param Address The base address of the memory or I/O operations.
+ @param Mask Mask used for the polling criteria.
+ @param Value The comparison value used for the polling exit criteria.
+ @param Delay The number of 100 ns units to poll.
+ @param Result Pointer to the last value read from the memory location.
+
+ @retval EFI_SUCCESS The last data returned from the access matched the poll exit criteria.
+ @retval EFI_TIMEOUT Delay expired before a match occurred.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM)(
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 Address,
+ IN UINT64 Mask,
+ IN UINT64 Value,
+ IN UINT64 Delay,
+ OUT UINT64 *Result
+ );
+
+/**
+ Enables a PCI driver to access PCI controller registers in the PCI root bridge memory space.
+
+ @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
+ @param Width Signifies the width of the memory operations.
+ @param Address The base address of the memory operations.
+ @param Count The number of memory operations to perform.
+ @param Buffer For read operations, the destination buffer to store the results. For write
+ operations, the source buffer to write data from.
+
+ @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM)(
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+ );
+
+typedef struct {
+ ///
+ /// Read PCI controller registers in the PCI root bridge memory space.
+ ///
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Read;
+ ///
+ /// Write PCI controller registers in the PCI root bridge memory space.
+ ///
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Write;
+} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS;
+
+/**
+ Enables a PCI driver to copy one region of PCI root bridge memory space to another region of PCI
+ root bridge memory space.
+
+ @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.
+ @param Width Signifies the width of the memory operations.
+ @param DestAddress The destination address of the memory operation.
+ @param SrcAddress The source address of the memory operation.
+ @param Count The number of memory operations to perform.
+
+ @retval EFI_SUCCESS The data was copied from one memory region to another memory region.
+ @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM)(
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 DestAddress,
+ IN UINT64 SrcAddress,
+ IN UINTN Count
+ );
+
+/**
+ Provides the PCI controller-specific addresses required to access system memory from a
+ DMA bus master.
+
+ @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
+ @param Operation Indicates if the bus master is going to read or write to system memory.
+ @param HostAddress The system memory address to map to the PCI controller.
+ @param NumberOfBytes On input the number of bytes to map. On output the number of bytes
+ that were mapped.
+ @param DeviceAddress The resulting map address for the bus master PCI controller to use to
+ access the hosts HostAddress.
+ @param Mapping A resulting value to pass to Unmap().
+
+ @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
+ @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_DEVICE_ERROR The system hardware could not map the requested address.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP)(
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION Operation,
+ IN VOID *HostAddress,
+ IN OUT UINTN *NumberOfBytes,
+ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
+ OUT VOID **Mapping
+ );
+
+/**
+ Completes the Map() operation and releases any corresponding resources.
+
+ @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
+ @param Mapping The mapping value returned from Map().
+
+ @retval EFI_SUCCESS The range was unmapped.
+ @retval EFI_INVALID_PARAMETER Mapping is not a value that was returned by Map().
+ @retval EFI_DEVICE_ERROR The data was not committed to the target system memory.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP)(
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN VOID *Mapping
+ );
+
+/**
+ Allocates pages that are suitable for an EfiPciOperationBusMasterCommonBuffer or
+ EfiPciOperationBusMasterCommonBuffer64 mapping.
+
+ @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
+ @param Type This parameter is not used and must be ignored.
+ @param MemoryType The type of memory to allocate, EfiBootServicesData or
+ EfiRuntimeServicesData.
+ @param Pages The number of pages to allocate.
+ @param HostAddress A pointer to store the base system memory address of the
+ allocated range.
+ @param Attributes The requested bit mask of attributes for the allocated range.
+
+ @retval EFI_SUCCESS The requested memory pages were allocated.
+ @retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are
+ MEMORY_WRITE_COMBINE and MEMORY_CACHED.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER)(
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_ALLOCATE_TYPE Type,
+ IN EFI_MEMORY_TYPE MemoryType,
+ IN UINTN Pages,
+ IN OUT VOID **HostAddress,
+ IN UINT64 Attributes
+ );
+
+/**
+ Frees memory that was allocated with AllocateBuffer().
+
+ @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
+ @param Pages The number of pages to free.
+ @param HostAddress The base system memory address of the allocated range.
+
+ @retval EFI_SUCCESS The requested memory pages were freed.
+ @retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages
+ was not allocated with AllocateBuffer().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER)(
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN UINTN Pages,
+ IN VOID *HostAddress
+ );
+
+/**
+ Flushes all PCI posted write transactions from a PCI host bridge to system memory.
+
+ @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
+
+ @retval EFI_SUCCESS The PCI posted write transactions were flushed from the PCI host
+ bridge to system memory.
+ @retval EFI_DEVICE_ERROR The PCI posted write transactions were not flushed from the PCI
+ host bridge due to a hardware error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH)(
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This
+ );
+
+/**
+ Gets the attributes that a PCI root bridge supports setting with SetAttributes(), and the
+ attributes that a PCI root bridge is currently using.
+
+ @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
+ @param Supports A pointer to the mask of attributes that this PCI root bridge supports
+ setting with SetAttributes().
+ @param Attributes A pointer to the mask of attributes that this PCI root bridge is currently
+ using.
+
+ @retval EFI_SUCCESS If Supports is not NULL, then the attributes that the PCI root
+ bridge supports is returned in Supports. If Attributes is
+ not NULL, then the attributes that the PCI root bridge is currently
+ using is returned in Attributes.
+ @retval EFI_INVALID_PARAMETER Both Supports and Attributes are NULL.
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES)(
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ OUT UINT64 *Supports,
+ OUT UINT64 *Attributes
+ );
+
+/**
+ Sets attributes for a resource range on a PCI root bridge.
+
+ @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
+ @param Attributes The mask of attributes to set.
+ @param ResourceBase A pointer to the base address of the resource range to be modified by the
+ attributes specified by Attributes.
+ @param ResourceLength A pointer to the length of the resource range to be modified by the
+ attributes specified by Attributes.
+
+ @retval EFI_SUCCESS The set of attributes specified by Attributes for the resource
+ range specified by ResourceBase and ResourceLength
+ were set on the PCI root bridge, and the actual resource range is
+ returned in ResuourceBase and ResourceLength.
+ @retval EFI_UNSUPPORTED A bit is set in Attributes that is not supported by the PCI Root
+ Bridge.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the attributes on the
+ resource range specified by BaseAddress and Length.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES)(
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN UINT64 Attributes,
+ IN OUT UINT64 *ResourceBase,
+ IN OUT UINT64 *ResourceLength
+ );
+
+/**
+ Retrieves the current resource settings of this PCI root bridge in the form of a set of ACPI
+ resource descriptors.
+
+ @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
+ @param Resources A pointer to the resource descriptors that describe the current
+ configuration of this PCI root bridge.
+
+ @retval EFI_SUCCESS The current configuration of this PCI root bridge was returned in
+ Resources.
+ @retval EFI_UNSUPPORTED The current configuration of this PCI root bridge could not be
+ retrieved.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION)(
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ OUT VOID **Resources
+ );
+
+///
+/// Provides the basic Memory, I/O, PCI configuration, and DMA interfaces that are
+/// used to abstract accesses to PCI controllers behind a PCI Root Bridge Controller.
+///
+struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL {
+ ///
+ /// The EFI_HANDLE of the PCI Host Bridge of which this PCI Root Bridge is a member.
+ ///
+ EFI_HANDLE ParentHandle;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM PollMem;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM PollIo;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Mem;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Io;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Pci;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM CopyMem;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP Map;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP Unmap;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER FreeBuffer;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH Flush;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES GetAttributes;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES SetAttributes;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION Configuration;
+
+ ///
+ /// The segment number that this PCI root bridge resides.
+ ///
+ UINT32 SegmentNumber;
+};
+
+extern EFI_GUID gEfiPciRootBridgeIoProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PiPcd.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PiPcd.h
new file mode 100644
index 0000000000..84d2aa444b
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PiPcd.h
@@ -0,0 +1,424 @@
+/** @file
+ Platform Configuration Database (PCD) Protocol defined in PI 1.2 Vol3
+
+ A platform database that contains a variety of current platform settings or
+ directives that can be accessed by a driver or application.
+ PI PCD protocol only provide the accessing interfaces for Dynamic-Ex type PCD.
+
+ Callers to this protocol must be at a TPL_APPLICATION task priority level.
+ This is the base PCD service API that provides an abstraction for accessing configuration content in
+ the platform. It a seamless mechanism for extracting information regardless of where the
+ information is stored (such as in Read-only data, or an EFI Variable).
+ This protocol allows access to data through size-granular APIs and provides a mechanism for a
+ firmware component to monitor specific settings and be alerted when a setting is changed.
+
+ Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ PI Version 1.2 Vol 3.
+**/
+
+#ifndef __PI_PCD_H__
+#define __PI_PCD_H__
+
+extern EFI_GUID gEfiPcdProtocolGuid;
+
+#define EFI_PCD_PROTOCOL_GUID \
+ { 0x13a3f0f6, 0x264a, 0x3ef0, { 0xf2, 0xe0, 0xde, 0xc5, 0x12, 0x34, 0x2f, 0x34 } }
+
+#define EFI_PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
+
+/**
+ SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values. SetSku() is
+ normally called only once by the system.
+ For each item (token), the database can hold a single value that applies to all SKUs, or multiple
+ values, where each value is associated with a specific SKU Id. Items with multiple, SKU-specific
+ values are called SKU enabled.
+ The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255. For tokens that are
+ not SKU enabled, the system ignores any set SKU Id and works with the single value for that token.
+ For SKU-enabled tokens, the system will use the SKU Id set by the last call to SetSku(). If no SKU
+ Id is set or the currently set SKU Id isn't valid for the specified token, the system uses the default
+ SKU Id. If the system attempts to use the default SKU Id and no value has been set for that Id, the
+ results are unpredictable.
+
+ @param[in] SkuId The SKU value to set.
+**/
+typedef
+VOID
+(EFIAPI *EFI_PCD_PROTOCOL_SET_SKU)(
+ IN UINTN SkuId
+);
+
+/**
+ Retrieves an 8-bit value for a given PCD token.
+ If the TokenNumber is invalid, the results are unpredictable.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+
+ @return 8-bit value for a given PCD token.
+**/
+typedef
+UINT8
+(EFIAPI *EFI_PCD_PROTOCOL_GET_8)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+);
+
+/**
+ Retrieves the current word-sized value for a PCD token number.
+ If the TokenNumber is invalid, the results are unpredictable.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+
+ @return word-sized value for a given PCD token.
+**/
+typedef
+UINT16
+(EFIAPI *EFI_PCD_PROTOCOL_GET_16)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+);
+
+/**
+ Retrieves the current 32-bit sized value for a PCD token number.
+ If the TokenNumber is invalid, the results are unpredictable.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+
+ @return 32-bit value for a given PCD token.
+**/
+typedef
+UINT32
+(EFIAPI *EFI_PCD_PROTOCOL_GET_32)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+);
+
+/**
+ Retrieves the 64-bit sized value for a PCD token number.
+ If the TokenNumber is invalid, the results are unpredictable.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+
+ @return 64-bit value for a given PCD token.
+
+**/
+typedef
+UINT64
+(EFIAPI *EFI_PCD_PROTOCOL_GET_64)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+);
+
+/**
+ Retrieves the current pointer to the value for a PCD token number. Do not make any assumptions
+ about the alignment of the pointer that is returned by this function call. If the TokenNumber is
+ invalid, the results are unpredictable.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+
+ @return pointer to a value for a given PCD token.
+**/
+typedef
+VOID *
+(EFIAPI *EFI_PCD_PROTOCOL_GET_POINTER)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+);
+
+/**
+ Retrieves the current BOOLEAN-sized value for a PCD token number. If the TokenNumber is
+ invalid, the results are unpredictable.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+
+ @return Boolean value for a given PCD token.
+**/
+typedef
+BOOLEAN
+(EFIAPI *EFI_PCD_PROTOCOL_GET_BOOLEAN)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+);
+
+/**
+ Retrieves the current size of a particular PCD token. If the TokenNumber is invalid, the results are
+ unpredictable.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+
+ @return the size of the value for a given PCD token.
+**/
+typedef
+UINTN
+(EFIAPI *EFI_PCD_PROTOCOL_GET_SIZE)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber
+);
+
+/**
+ Sets an 8-bit value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the size of the value being set is
+ compatible with the Token's existing definition. If it is not, an error will be returned.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The PCD service has set the value requested
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
+ incompatible with a call to this function. Use GetSizeEx() to
+ retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCD_PROTOCOL_SET_8)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ IN UINT8 Value
+);
+
+/**
+ Sets an 16-bit value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the size of the value being set is
+ compatible with the Token's existing definition. If it is not, an error will be returned.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The PCD service has set the value requested
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
+ incompatible with a call to this function. Use GetSizeEx() to
+ retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCD_PROTOCOL_SET_16)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ IN UINT16 Value
+);
+
+/**
+ Sets an 32-bit value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the size of the value being set is
+ compatible with the Token's existing definition. If it is not, an error will be returned.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The PCD service has set the value requested
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
+ incompatible with a call to this function. Use GetSizeEx() to
+ retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCD_PROTOCOL_SET_32)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ IN UINT32 Value
+);
+
+/**
+ Sets an 64-bit value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the size of the value being set is
+ compatible with the Token's existing definition. If it is not, an error will be returned.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The PCD service has set the value requested
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
+ incompatible with a call to this function. Use GetSizeEx() to
+ retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCD_PROTOCOL_SET_64)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ IN UINT64 Value
+);
+
+/**
+ Sets a value of a specified size for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the size of the value being set is
+ compatible with the Token's existing definition. If it is not, an error will be returned.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[in] SizeOfValue The length of the value being set for the PCD token. If too large of a length is
+ specified, upon return from this function the value of SizeOfValue will
+ reflect the maximum size for the PCD token.
+ @param[in] Buffer A pointer to the buffer containing the value to set for the PCD token.
+
+ @retval EFI_SUCCESS The PCD service has set the value requested
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
+ incompatible with a call to this function. Use GetSizeEx() to
+ retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCD_PROTOCOL_SET_POINTER)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ IN OUT UINTN *SizeOfValue,
+ IN VOID *Buffer
+);
+
+/**
+ Sets a Boolean value for a given PCD token.
+
+ When the PCD service sets a value, it will check to ensure that the size of the value being set is
+ compatible with the Token's existing definition. If it is not, an error will be returned.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[in] Value The value to set for the PCD token.
+
+ @retval EFI_SUCCESS The PCD service has set the value requested
+ @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
+ incompatible with a call to this function. Use GetSizeEx() to
+ retrieve the size of the target data.
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCD_PROTOCOL_SET_BOOLEAN)(
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ IN BOOLEAN Value
+);
+
+typedef
+VOID
+(EFIAPI *EFI_PCD_PROTOCOL_CALLBACK)(
+ IN EFI_GUID *Guid OPTIONAL,
+ IN UINTN CallBackToken,
+ IN OUT VOID *TokenData,
+ IN UINTN TokenDataSize
+);
+
+/**
+ Specifies a function to be called anytime the value of a designated token is changed.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] CallBackToken The PCD token number to monitor.
+ @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
+
+ @retval EFI_SUCCESS The PCD service has successfully established a call event for the CallBackToken requested.
+ @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCD_PROTOCOL_CALLBACK_ON_SET)(
+ IN CONST EFI_GUID *Guid OPTIONAL,
+ IN UINTN CallBackToken,
+ IN EFI_PCD_PROTOCOL_CALLBACK CallBackFunction
+);
+
+/**
+ Cancels a callback function that was set through a previous call to the CallBackOnSet function.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] CallBackToken The PCD token number to monitor.
+ @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
+
+ @retval EFI_SUCCESS The PCD service has successfully established a call event for the CallBackToken requested.
+ @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCD_PROTOCOL_CANCEL_CALLBACK)(
+ IN CONST EFI_GUID *Guid OPTIONAL,
+ IN UINTN CallBackToken,
+ IN EFI_PCD_PROTOCOL_CALLBACK CallBackFunction
+);
+
+/**
+ Gets the next valid token number in a given namespace. This is useful since the PCD infrastructure
+ contains a sparse list of token numbers, and one cannot a priori know what token numbers are valid
+ in the database.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to retrieve the next token.
+ @param[in] TokenNumber A pointer to the PCD token number to use to find the subsequent token number. To
+ retrieve the "first" token, have the pointer reference a TokenNumber value of 0.
+ @retval EFI_SUCCESS The PCD service has retrieved the value requested
+ @retval EFI_NOT_FOUND The PCD service could not find data from the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCD_PROTOCOL_GET_NEXT_TOKEN)(
+ IN CONST EFI_GUID *Guid, OPTIONAL
+ IN UINTN *TokenNumber
+);
+
+/**
+ Gets the next valid token namespace for a given namespace. This is useful to traverse the valid
+ token namespaces on a platform.
+
+ @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates a known token namespace
+ from which the search will start. On output, it designates the next valid token
+ namespace on the platform. If *Guid is NULL, then the GUID of the first token
+ space of the current platform is returned. If the search cannot locate the next valid
+ token namespace, an error is returned and the value of *Guid is undefined.
+
+ @retval EFI_SUCCESS The PCD service retrieved the value requested.
+ @retval EFI_NOT_FOUND The PCD service could not find the next valid token namespace.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCD_PROTOCOL_GET_NEXT_TOKEN_SPACE)(
+ IN OUT CONST EFI_GUID **Guid
+);
+
+typedef struct _EFI_PCD_PROTOCOL {
+ EFI_PCD_PROTOCOL_SET_SKU SetSku;
+ EFI_PCD_PROTOCOL_GET_8 Get8;
+ EFI_PCD_PROTOCOL_GET_16 Get16;
+ EFI_PCD_PROTOCOL_GET_32 Get32;
+ EFI_PCD_PROTOCOL_GET_64 Get64;
+ EFI_PCD_PROTOCOL_GET_POINTER GetPtr;
+ EFI_PCD_PROTOCOL_GET_BOOLEAN GetBool;
+ EFI_PCD_PROTOCOL_GET_SIZE GetSize;
+ EFI_PCD_PROTOCOL_SET_8 Set8;
+ EFI_PCD_PROTOCOL_SET_16 Set16;
+ EFI_PCD_PROTOCOL_SET_32 Set32;
+ EFI_PCD_PROTOCOL_SET_64 Set64;
+ EFI_PCD_PROTOCOL_SET_POINTER SetPtr;
+ EFI_PCD_PROTOCOL_SET_BOOLEAN SetBool;
+ EFI_PCD_PROTOCOL_CALLBACK_ON_SET CallbackOnSet;
+ EFI_PCD_PROTOCOL_CANCEL_CALLBACK CancelCallback;
+ EFI_PCD_PROTOCOL_GET_NEXT_TOKEN GetNextToken;
+ EFI_PCD_PROTOCOL_GET_NEXT_TOKEN_SPACE GetNextTokenSpace;
+} EFI_PCD_PROTOCOL;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PiPcdInfo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PiPcdInfo.h
new file mode 100644
index 0000000000..1b39f0de52
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PiPcdInfo.h
@@ -0,0 +1,83 @@
+/** @file
+ Platform Configuration Database (PCD) Info Protocol defined in PI 1.2.1 Vol3.
+
+ The protocol that provides additional information about items that reside in the PCD database.
+
+ Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ PI Version 1.2.1 Vol 3.
+**/
+
+#ifndef __PI_PCD_INFO_H__
+#define __PI_PCD_INFO_H__
+
+extern EFI_GUID gEfiGetPcdInfoProtocolGuid;
+
+#define EFI_GET_PCD_INFO_PROTOCOL_GUID \
+ { 0xfd0f4478, 0xefd, 0x461d, { 0xba, 0x2d, 0xe5, 0x8c, 0x45, 0xfd, 0x5f, 0x5e } }
+
+///
+/// The forward declaration for EFI_GET_PCD_INFO_PROTOCOL.
+///
+typedef struct _EFI_GET_PCD_INFO_PROTOCOL EFI_GET_PCD_INFO_PROTOCOL;
+
+/**
+ Retrieve additional information associated with a PCD token.
+
+ This includes information such as the type of value the TokenNumber is associated with as well as possible
+ human readable name that is associated with the token.
+
+ @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
+ @param[in] TokenNumber The PCD token number.
+ @param[out] PcdInfo The returned information associated with the requested TokenNumber.
+
+ @retval EFI_SUCCESS The PCD information was returned successfully
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_GET_PCD_INFO_PROTOCOL_GET_INFO) (
+ IN CONST EFI_GUID *Guid,
+ IN UINTN TokenNumber,
+ OUT EFI_PCD_INFO *PcdInfo
+);
+
+/**
+ Retrieve the currently set SKU Id.
+
+ @return The currently set SKU Id. If the platform has not set at a SKU Id, then the
+ default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU
+ Id is returned.
+**/
+typedef
+UINTN
+(EFIAPI *EFI_GET_PCD_INFO_PROTOCOL_GET_SKU) (
+ VOID
+);
+
+///
+/// Callers to this protocol must be at a TPL_APPLICATION task priority level.
+/// This is the PCD service to use when querying for some additional data that can be contained in the
+/// PCD database.
+///
+struct _EFI_GET_PCD_INFO_PROTOCOL {
+ ///
+ /// Retrieve additional information associated with a PCD.
+ ///
+ EFI_GET_PCD_INFO_PROTOCOL_GET_INFO GetInfo;
+ ///
+ /// Retrieve the currently set SKU Id.
+ ///
+ EFI_GET_PCD_INFO_PROTOCOL_GET_SKU GetSku;
+};
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Pkcs7Verify.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Pkcs7Verify.h
new file mode 100644
index 0000000000..d6751d0686
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Pkcs7Verify.h
@@ -0,0 +1,229 @@
+/** @file
+ EFI_PKCS7_VERIFY_PROTOCOL as defined in UEFI 2.5.
+ The EFI_PKCS7_VERIFY_PROTOCOL is used to verify data signed using PKCS#7
+ formatted authentication. The PKCS#7 data to be verified must be binary
+ DER encoded.
+ PKCS#7 is a general-purpose cryptographic standard (defined by RFC2315,
+ available at http://tools.ietf.org/html/rfc2315).
+
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_PKCS7_VERIFY_PROTOCOL_H__
+#define __EFI_PKCS7_VERIFY_PROTOCOL_H__
+
+#include <Guid/ImageAuthentication.h>
+
+///
+/// Global ID for the PKCS7 Verification Protocol
+///
+#define EFI_PKCS7_VERIFY_PROTOCOL_GUID \
+ { \
+ 0x47889fb2, 0xd671, 0x4fab, {0xa0, 0xca, 0xdf, 0x0e, 0x44, 0xdf, 0x70, 0xd6 } \
+ }
+
+typedef struct _EFI_PKCS7_VERIFY_PROTOCOL EFI_PKCS7_VERIFY_PROTOCOL;
+
+
+/**
+ Processes a buffer containing binary DER-encoded PKCS7 signature.
+ The signed data content may be embedded within the buffer or separated. Funtion
+ verifies the signature of the content is valid and signing certificate was not
+ revoked and is contained within a list of trusted signers.
+
+ @param[in] This Pointer to EFI_PKCS7_VERIFY_PROTOCOL instance.
+ @param[in] SignedData Points to buffer containing ASN.1 DER-encoded PKCS7
+ signature.
+ @param[in] SignedDataSize The size of SignedData buffer in bytes.
+ @param[in] InData In case of detached signature, InData points to
+ buffer containing the raw message data previously
+ signed and to be verified by function. In case of
+ SignedData containing embedded data, InData must be
+ NULL.
+ @param[in] InDataSize When InData is used, the size of InData buffer in
+ bytes. When InData is NULL. This parameter must be
+ 0.
+ @param[in] AllowedDb Pointer to a list of pointers to EFI_SIGNATURE_LIST
+ structures. The list is terminated by a null
+ pointer. The EFI_SIGNATURE_LIST structures contain
+ lists of X.509 certificates of approved signers.
+ Function recognizes signer certificates of type
+ EFI_CERT_X509_GUID. Any hash certificate in AllowedDb
+ list is ignored by this function. Function returns
+ success if signer of the buffer is within this list
+ (and not within RevokedDb). This parameter is
+ required.
+ @param[in] RevokedDb Optional pointer to a list of pointers to
+ EFI_SIGNATURE_LIST structures. The list is terminated
+ by a null pointer. List of X.509 certificates of
+ revoked signers and revoked file hashes. Except as
+ noted in description of TimeStampDb signature
+ verification will always fail if the signer of the
+ file or the hash of the data component of the buffer
+ is in RevokedDb list. This list is optional and
+ caller may pass Null or pointer to NULL if not
+ required.
+ @param[in] TimeStampDb Optional pointer to a list of pointers to
+ EFI_SIGNATURE_LIST structures. The list is terminated
+ by a null pointer. This parameter can be used to pass
+ a list of X.509 certificates of trusted time stamp
+ signers. This list is optional and caller must pass
+ Null or pointer to NULL if not required.
+ @param[out] Content On input, points to an optional caller-allocated
+ buffer into which the function will copy the content
+ portion of the file after verification succeeds.
+ This parameter is optional and if NULL, no copy of
+ content from file is performed.
+ @param[in,out] ContentSize On input, points to the size in bytes of the optional
+ buffer Content previously allocated by caller. On
+ output, if the verification succeeds, the value
+ referenced by ContentSize will contain the actual
+ size of the content from signed file. If ContentSize
+ indicates the caller-allocated buffer is too small
+ to contain content, an error is returned, and
+ ContentSize will be updated with the required size.
+ This parameter must be 0 if Content is Null.
+
+ @retval EFI_SUCCESS Content signature was verified against hash of
+ content, the signer's certificate was not found in
+ RevokedDb, and was found in AllowedDb or if in signer
+ is found in both AllowedDb and RevokedDb, the
+ signing was allowed by reference to TimeStampDb as
+ described above, and no hash matching content hash
+ was found in RevokedDb.
+ @retval EFI_SECURITY_VIOLATION The SignedData buffer was correctly formatted but
+ signer was in RevokedDb or not in AllowedDb. Also
+ returned if matching content hash found in RevokedDb.
+ @retval EFI_COMPROMISED_DATA Calculated hash differs from signed hash.
+ @retval EFI_INVALID_PARAMETER SignedData is NULL or SignedDataSize is zero.
+ AllowedDb is NULL.
+ @retval EFI_INVALID_PARAMETER Content is not NULL and ContentSize is NULL.
+ @retval EFI_ABORTED Unsupported or invalid format in TimeStampDb,
+ RevokedDb or AllowedDb list contents was detected.
+ @retval EFI_NOT_FOUND Content not found because InData is NULL and no
+ content embedded in SignedData.
+ @retval EFI_UNSUPPORTED The SignedData buffer was not correctly formatted
+ for processing by the function.
+ @retval EFI_UNSUPPORTED Signed data embedded in SignedData but InData is not
+ NULL.
+ @retval EFI_BUFFER_TOO_SMALL The size of buffer indicated by ContentSize is too
+ small to hold the content. ContentSize updated to
+ required size.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PKCS7_VERIFY_BUFFER) (
+ IN EFI_PKCS7_VERIFY_PROTOCOL *This,
+ IN VOID *SignedData,
+ IN UINTN SignedDataSize,
+ IN VOID *InData OPTIONAL,
+ IN UINTN InDataSize,
+ IN EFI_SIGNATURE_LIST **AllowedDb,
+ IN EFI_SIGNATURE_LIST **RevokedDb OPTIONAL,
+ IN EFI_SIGNATURE_LIST **TimeStampDb OPTIONAL,
+ OUT VOID *Content OPTIONAL,
+ IN OUT UINTN *ContentSize
+ );
+
+/**
+ Processes a buffer containing binary DER-encoded detached PKCS7 signature.
+ The hash of the signed data content is calculated and passed by the caller. Function
+ verifies the signature of the content is valid and signing certificate was not revoked
+ and is contained within a list of trusted signers.
+
+ Note: because this function uses hashes and the specification contains a variety of
+ hash choices, you should be aware that the check against the RevokedDb list
+ will improperly succeed if the signature is revoked using a different hash
+ algorithm. For this reason, you should either cycle through all UEFI supported
+ hashes to see if one is forbidden, or rely on a single hash choice only if the
+ UEFI signature authority only signs and revokes with a single hash (at time
+ of writing, this hash choice is SHA256).
+
+ @param[in] This Pointer to EFI_PKCS7_VERIFY_PROTOCOL instance.
+ @param[in] Signature Points to buffer containing ASN.1 DER-encoded PKCS
+ detached signature.
+ @param[in] SignatureSize The size of Signature buffer in bytes.
+ @param[in] InHash InHash points to buffer containing the caller
+ calculated hash of the data. The parameter may not
+ be NULL.
+ @param[in] InHashSize The size in bytes of InHash buffer.
+ @param[in] AllowedDb Pointer to a list of pointers to EFI_SIGNATURE_LIST
+ structures. The list is terminated by a null
+ pointer. The EFI_SIGNATURE_LIST structures contain
+ lists of X.509 certificates of approved signers.
+ Function recognizes signer certificates of type
+ EFI_CERT_X509_GUID. Any hash certificate in AllowedDb
+ list is ignored by this function. Function returns
+ success if signer of the buffer is within this list
+ (and not within RevokedDb). This parameter is
+ required.
+ @param[in] RevokedDb Optional pointer to a list of pointers to
+ EFI_SIGNATURE_LIST structures. The list is terminated
+ by a null pointer. List of X.509 certificates of
+ revoked signers and revoked file hashes. Signature
+ verification will always fail if the signer of the
+ file or the hash of the data component of the buffer
+ is in RevokedDb list. This parameter is optional
+ and caller may pass Null if not required.
+ @param[in] TimeStampDb Optional pointer to a list of pointers to
+ EFI_SIGNATURE_LIST structures. The list is terminated
+ by a null pointer. This parameter can be used to pass
+ a list of X.509 certificates of trusted time stamp
+ counter-signers.
+
+ @retval EFI_SUCCESS Signed hash was verified against caller-provided
+ hash of content, the signer's certificate was not
+ found in RevokedDb, and was found in AllowedDb or
+ if in signer is found in both AllowedDb and
+ RevokedDb, the signing was allowed by reference to
+ TimeStampDb as described above, and no hash matching
+ content hash was found in RevokedDb.
+ @retval EFI_SECURITY_VIOLATION The SignedData buffer was correctly formatted but
+ signer was in RevokedDb or not in AllowedDb. Also
+ returned if matching content hash found in RevokedDb.
+ @retval EFI_COMPROMISED_DATA Caller provided hash differs from signed hash. Or,
+ caller and encrypted hash are different sizes.
+ @retval EFI_INVALID_PARAMETER Signature is NULL or SignatureSize is zero. InHash
+ is NULL or InHashSize is zero. AllowedDb is NULL.
+ @retval EFI_ABORTED Unsupported or invalid format in TimeStampDb,
+ RevokedDb or AllowedDb list contents was detected.
+ @retval EFI_UNSUPPORTED The Signature buffer was not correctly formatted
+ for processing by the function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PKCS7_VERIFY_SIGNATURE) (
+ IN EFI_PKCS7_VERIFY_PROTOCOL *This,
+ IN VOID *Signature,
+ IN UINTN SignatureSize,
+ IN VOID *InHash,
+ IN UINTN InHashSize,
+ IN EFI_SIGNATURE_LIST **AllowedDb,
+ IN EFI_SIGNATURE_LIST **RevokedDb OPTIONAL,
+ IN EFI_SIGNATURE_LIST **TimeStampDb OPTIONAL
+ );
+
+///
+/// The EFI_PKCS7_VERIFY_PROTOCOL is used to verify data signed using PKCS7
+/// structure. The PKCS7 data to be verified must be ASN.1 (DER) encoded.
+/// SHA256 must be supported as digest algorithm with RSA digest encryption.
+/// Support of other hash algorithms is optional.
+///
+struct _EFI_PKCS7_VERIFY_PROTOCOL {
+ EFI_PKCS7_VERIFY_BUFFER VerifyBuffer;
+ EFI_PKCS7_VERIFY_SIGNATURE VerifySignature;
+};
+
+extern EFI_GUID gEfiPkcs7VerifyProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PlatformDriverOverride.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PlatformDriverOverride.h
new file mode 100644
index 0000000000..c84d12d1f0
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PlatformDriverOverride.h
@@ -0,0 +1,140 @@
+/** @file
+ Platform Driver Override protocol as defined in the UEFI 2.1 specification.
+
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_H__
+#define __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_H__
+
+///
+/// Global ID for the Platform Driver Override Protocol
+///
+#define EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID \
+ { \
+ 0x6b30c738, 0xa391, 0x11d4, {0x9a, 0x3b, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
+ }
+
+typedef struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL;
+
+//
+// Prototypes for the Platform Driver Override Protocol
+//
+
+/**
+ Retrieves the image handle of the platform override driver for a controller in the system.
+
+ @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_
+ PROTOCOL instance.
+ @param ControllerHandle The device handle of the controller to check if a driver override
+ exists.
+ @param DriverImageHandle On input, a pointer to the previous driver image handle returned
+ by GetDriver(). On output, a pointer to the next driver
+ image handle.
+
+ @retval EFI_SUCCESS The driver override for ControllerHandle was returned in
+ DriverImageHandle.
+ @retval EFI_NOT_FOUND A driver override for ControllerHandle was not found.
+ @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is NULL.
+ @retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a
+ previous call to GetDriver().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER)(
+ IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN OUT EFI_HANDLE *DriverImageHandle
+ );
+
+/**
+ Retrieves the device path of the platform override driver for a controller in the system.
+
+ @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL instance.
+ @param ControllerHandle The device handle of the controller to check if a driver override
+ exists.
+ @param DriverImagePath On input, a pointer to the previous driver device path returned by
+ GetDriverPath(). On output, a pointer to the next driver
+ device path. Passing in a pointer to NULL will return the first
+ driver device path for ControllerHandle.
+
+ @retval EFI_SUCCESS The driver override for ControllerHandle was returned in
+ DriverImageHandle.
+ @retval EFI_UNSUPPORTED The operation is not supported.
+ @retval EFI_NOT_FOUND A driver override for ControllerHandle was not found.
+ @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is NULL.
+ @retval EFI_INVALID_PARAMETER DriverImagePath is not a device path that was returned on a
+ previous call to GetDriverPath().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH)(
+ IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DriverImagePath
+ );
+
+/**
+ Used to associate a driver image handle with a device path that was returned on a prior call to the
+ GetDriverPath() service. This driver image handle will then be available through the
+ GetDriver() service.
+
+ @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_
+ PROTOCOL instance.
+ @param ControllerHandle The device handle of the controller.
+ @param DriverImagePath A pointer to the driver device path that was returned in a prior
+ call to GetDriverPath().
+ @param DriverImageHandle The driver image handle that was returned by LoadImage()
+ when the driver specified by DriverImagePath was loaded
+ into memory.
+
+ @retval EFI_SUCCESS The association between DriverImagePath and
+ DriverImageHandle was established for the controller specified
+ by ControllerHandle.
+ @retval EFI_UNSUPPORTED The operation is not supported.
+ @retval EFI_NOT_FOUND DriverImagePath is not a device path that was returned on a prior
+ call to GetDriverPath() for the controller specified by
+ ControllerHandle.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
+ @retval EFI_INVALID_PARAMETER DriverImagePath is not a valid device path.
+ @retval EFI_INVALID_PARAMETER DriverImageHandle is not a valid image handle.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED)(
+ IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *DriverImagePath,
+ IN EFI_HANDLE DriverImageHandle
+ );
+
+///
+/// This protocol matches one or more drivers to a controller. A platform driver
+/// produces this protocol, and it is installed on a separate handle. This protocol
+/// is used by the ConnectController() boot service to select the best driver
+/// for a controller. All of the drivers returned by this protocol have a higher
+/// precedence than drivers found from an EFI Bus Specific Driver Override Protocol
+/// or drivers found from the general UEFI driver Binding search algorithm. If more
+/// than one driver is returned by this protocol, then the drivers are returned in
+/// order from highest precedence to lowest precedence.
+///
+struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL {
+ EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER GetDriver;
+ EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH GetDriverPath;
+ EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED DriverLoaded;
+};
+
+extern EFI_GUID gEfiPlatformDriverOverrideProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PlatformToDriverConfiguration.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PlatformToDriverConfiguration.h
new file mode 100644
index 0000000000..8343cb8bea
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PlatformToDriverConfiguration.h
@@ -0,0 +1,355 @@
+/** @file
+ UEFI Platform to Driver Configuration Protocol is defined in UEFI specification.
+
+ This is a protocol that is optionally produced by the platform and optionally consumed
+ by a UEFI Driver in its Start() function. This protocol allows the driver to receive
+ configuration information as part of being started.
+
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PLATFORM_TO_DRIVER_CONFIGUARTION_H__
+#define __PLATFORM_TO_DRIVER_CONFIGUARTION_H__
+
+#define EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL_GUID \
+ { 0x642cd590, 0x8059, 0x4c0a, { 0xa9, 0x58, 0xc5, 0xec, 0x7, 0xd2, 0x3c, 0x4b } }
+
+
+typedef struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL;
+
+
+/**
+ The UEFI driver must call Query early in the Start() function
+ before any time consuming operations are performed. If
+ ChildHandle is NULL the driver is requesting information from
+ the platform about the ControllerHandle that is being started.
+ Information returned from Query may lead to the drivers Start()
+ function failing.
+ If the UEFI driver is a bus driver and producing a ChildHandle,
+ the driver must call Query after the child handle has been created
+ and an EFI_DEVICE_PATH_PROTOCOL has been placed on that handle,
+ but before any time consuming operation is performed. If information
+ return by Query may lead the driver to decide to not create the
+ ChildHandle. The driver must then cleanup and remove the ChildHandle
+ from the system.
+ The UEFI driver repeatedly calls Query, processes the information
+ returned by the platform, and calls Response passing in the
+ arguments returned from Query. The Instance value passed into
+ Response must be the same value passed into the corresponding
+ call to Query. The UEFI driver must continuously call Query and
+ Response until EFI_NOT_FOUND is returned by Query.
+ If the UEFI driver does not recognize the ParameterTypeGuid, it
+ calls Response with a ConfigurationAction of
+ EfiPlatformConfigurationActionUnsupportedGuid. The UEFI driver
+ must then continue calling Query and Response until EFI_NOT_FOUND
+ is returned by Query. This gives the platform an opportunity to
+ pass additional configuration settings using a different
+ ParameterTypeGuid that may be supported by the driver.
+ An Instance value of zero means return the first ParameterBlock
+ in the set of unprocessed parameter blocks. The driver should
+ increment the Instance value by one for each successive call to Query.
+
+ @param This A pointer to the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL instance.
+
+ @param ControllerHandle The handle the platform will return
+ configuration information about.
+
+ @param ChildHandle The handle of the child controller to
+ return information on. This is an optional
+ parameter that may be NULL. It will be
+ NULL for device drivers and for bus
+ drivers that attempt to get options for
+ the bus controller. It will not be NULL
+ for a bus driver that attempts to get
+ options for one of its child controllers.
+
+
+ @param Instance Pointer to the Instance value. Zero means
+ return the first query data. The caller should
+ increment this value by one each time to retrieve
+ successive data.
+
+ @param ParameterTypeGuid An EFI_GUID that defines the contents
+ of ParameterBlock. UEFI drivers must
+ use the ParameterTypeGuid to determine
+ how to parse the ParameterBlock. The caller
+ should not attempt to free ParameterTypeGuid.
+
+ @param ParameterBlock The platform returns a pointer to the
+ ParameterBlock structure which
+ contains details about the
+ configuration parameters specific to
+ the ParameterTypeGuid. This structure
+ is defined based on the protocol and
+ may be different for different
+ protocols. UEFI driver decodes this
+ structure and its contents based on
+ ParameterTypeGuid. ParameterBlock is
+ allocated by the platform and the
+ platform is responsible for freeing
+ the ParameterBlock after Result is
+ called.
+
+ @param ParameterBlockSize The platform returns the size of
+ the ParameterBlock in bytes.
+
+
+ @retval EFI_SUCCESS The platform return parameter
+ information for ControllerHandle.
+
+ @retval EFI_NOT_FOUND No more unread Instance exists.
+
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
+
+ @retval EFI_INVALID_PARAMETER Instance is NULL.
+
+ @retval EFI_DEVICE_ERROR A device error occurred while
+ attempting to return parameter block
+ information for the controller
+ specified by ControllerHandle and
+ ChildHandle.
+
+ @retval EFI_OUT_RESOURCES There are not enough resources
+ available to set the configuration
+ options for the controller specified
+ by ControllerHandle and ChildHandle.
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PLATFORM_TO_DRIVER_CONFIGURATION_QUERY)(
+ IN CONST EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL *This,
+ IN CONST EFI_HANDLE ControllerHandle,
+ IN CONST EFI_HANDLE ChildHandle OPTIONAL,
+ IN CONST UINTN *Instance,
+ OUT EFI_GUID **ParameterTypeGuid,
+ OUT VOID **ParameterBlock,
+ OUT UINTN *ParameterBlockSize
+);
+
+typedef enum {
+ ///
+ /// The controller specified by ControllerHandle is still
+ /// in a usable state, and its configuration has been updated
+ /// via parsing the ParameterBlock. If required by the
+ /// parameter block, and the module supports an NVRAM store,
+ /// the configuration information from PB was successfully
+ /// saved to the NVRAM. No actions are required before
+ /// this controller can be used again with the updated
+ /// configuration settings.
+ ///
+ EfiPlatformConfigurationActionNone = 0,
+
+ ///
+ /// The driver has detected that the controller specified
+ /// by ControllerHandle is not in a usable state and
+ /// needs to be stopped. The calling agent can use the
+ /// DisconnectControservice to perform this operation, and
+ /// it should be performed as soon as possible.
+ ///
+ EfiPlatformConfigurationActionStopController = 1,
+
+ ///
+ /// This controller specified by ControllerHandle needs to
+ /// be stopped and restarted before it can be used again.
+ /// The calling agent can use the DisconnectController()
+ /// and ConnectController() services to perform this
+ /// operation. The restart operation can be delayed until
+ /// all of the configuration options have been set.
+ ///
+ EfiPlatformConfigurationActionRestartController = 2,
+
+ ///
+ /// A configuration change has been made that requires the
+ /// platform to be restarted before the controller
+ /// specified by ControllerHandle can be used again. The
+ /// calling agent can use the ResetSystem() services to
+ /// perform this operation. The restart operation can be
+ /// delayed until all of the configuration options have
+ /// been set.
+ ///
+ EfiPlatformConfigurationActionRestartPlatform = 3,
+
+ ///
+ /// The controller specified by ControllerHandle is still
+ /// in a usable state; its configuration has been updated
+ /// via parsing the ParameterBlock. The driver tried to
+ /// update the driver's private NVRAM store with
+ /// information from ParameterBlock and failed. No actions
+ /// are required before this controller can be used again
+ /// with the updated configuration settings, but these
+ /// configuration settings are not guaranteed to persist
+ /// after ControllerHandle is stopped.
+ ///
+ EfiPlatformConfigurationActionNvramFailed = 4,
+
+ ///
+ /// The controller specified by ControllerHandle is still
+ /// in a usable state; its configuration has not been updated
+ /// via parsing the ParameterBlock. The driver did not support
+ /// the ParameterBlock format identified by ParameterTypeGuid.
+ /// No actions are required before this controller can be used
+ /// again. On additional Query calls from this ControllerHandle,
+ /// the platform should stop returning a ParameterBlock
+ /// qualified by this same ParameterTypeGuid. If no other
+ /// ParameterTypeGuid is supported by the platform, Query
+ /// should return EFI_NOT_FOUND.
+ ///
+ EfiPlatformConfigurationActionUnsupportedGuid = 5,
+ EfiPlatformConfigurationActionMaximum
+} EFI_PLATFORM_CONFIGURATION_ACTION;
+
+
+/**
+ The UEFI driver repeatedly calls Query, processes the
+ information returned by the platform, and calls Response passing
+ in the arguments returned from Query. The UEFI driver must
+ continuously call Query until EFI_NOT_FOUND is returned. For
+ every call to Query that returns EFI_SUCCESS a corrisponding
+ call to Response is required passing in the same
+ ContollerHandle, ChildHandle, Instance, ParameterTypeGuid,
+ ParameterBlock, and ParameterBlockSize. The UEFI driver may
+ update values in ParameterBlock based on rules defined by
+ ParameterTypeGuid. The platform is responsible for freeing
+ ParameterBlock and the UEFI driver must not try to free it.
+
+ @param This A pointer to the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL instance.
+
+ @param ControllerHandle The handle the driver is returning
+ configuration information about.
+
+ @param ChildHandle The handle of the child controller to
+ return information on. This is an optional
+ parameter that may be NULL. It will be
+ NULL for device drivers, and for bus
+ drivers that attempt to get options for
+ the bus controller. It will not be NULL
+ for a bus driver that attempts to get
+ options for one of its child controllers.
+ Instance Instance data returned from
+ Query().
+
+ @param Instance Instance data passed to Query().
+
+ @param ParameterTypeGuid ParameterTypeGuid returned from Query.
+
+ @param ParameterBlock ParameterBlock returned from Query.
+
+ @param ParameterBlockSize The ParameterBlock size returned from Query.
+
+ @param ConfigurationAction The driver tells the platform what
+ action is required for ParameterBlock to
+ take effect.
+
+
+ @retval EFI_SUCCESS The platform return parameter information
+ for ControllerHandle.
+
+ @retval EFI_NOT_FOUND Instance was not found.
+
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
+
+ @retval EFI_INVALID_PARAMETER Instance is zero.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PLATFORM_TO_DRIVER_CONFIGURATION_RESPONSE)(
+ IN CONST EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL *This,
+ IN CONST EFI_HANDLE ControllerHandle,
+ IN CONST EFI_HANDLE ChildHandle OPTIONAL,
+ IN CONST UINTN *Instance,
+ IN CONST EFI_GUID *ParameterTypeGuid,
+ IN CONST VOID *ParameterBlock,
+ IN CONST UINTN ParameterBlockSize ,
+ IN CONST EFI_PLATFORM_CONFIGURATION_ACTION ConfigurationAction
+);
+
+
+///
+/// The EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL is used by the
+/// UEFI driver to query the platform for configuration information.
+/// The UEFI driver calls Query() multiple times to get
+/// configuration information from the platform. For every call to
+/// Query() there must be a matching call to Response() so the
+/// UEFI driver can inform the platform how it used the
+/// information passed in from Query(). It's legal for a UEFI
+/// driver to use Response() to inform the platform it does not
+/// understand the data returned via Query() and thus no action was
+/// taken.
+///
+struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL {
+ EFI_PLATFORM_TO_DRIVER_CONFIGURATION_QUERY Query;
+ EFI_PLATFORM_TO_DRIVER_CONFIGURATION_RESPONSE Response;
+};
+
+
+
+#define EFI_PLATFORM_TO_DRIVER_CONFIGURATION_CLP_GUID \
+ {0x345ecc0e, 0xcb6, 0x4b75, { 0xbb, 0x57, 0x1b, 0x12, 0x9c, 0x47, 0x33,0x3e } }
+
+/**
+
+ ParameterTypeGuid provides the support for parameters
+ communicated through the DMTF SM CLP Specification 1.0 Final
+ Standard to be used to configure the UEFI driver. In this
+ section the producer of the
+ EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL is platform
+ firmware and the consumer is the UEFI driver. Note: if future
+ versions of the DMTF SM CLP Specification require changes to the
+ parameter block definition, a newer ParameterTypeGuid will be
+ used.
+**/
+typedef struct {
+ CHAR8 *CLPCommand; ///< A pointer to the null-terminated UTF-8 string that specifies the DMTF SM CLP command
+ ///< line that the driver is required to parse and process when this function is called.
+ ///< See the DMTF SM CLP Specification 1.0 Final Standard for details on the
+ ///< format and syntax of the CLP command line string. CLPCommand buffer
+ ///< is allocated by the producer of the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOOL.
+ UINT32 CLPCommandLength; ///< The length of the CLP Command in bytes.
+ CHAR8 *CLPReturnString; ///< A pointer to the null-terminated UTF-8 string that indicates the CLP return status
+ ///< that the driver is required to provide to the calling agent.
+ ///< The calling agent may parse and/ or pass
+ ///< this for processing and user feedback. The SM CLP Command Response string
+ ///< buffer is filled in by the UEFI driver in the "keyword=value" format
+ ///< described in the SM CLP Specification, unless otherwise requested via the SM
+ ///< CLP Coutput option in the Command Line string buffer. UEFI driver's support
+ ///< for this default "keyword=value" output format is required if the UEFI
+ ///< driver supports this protocol, while support for other SM CLP output
+ ///< formats is optional (the UEFI Driver should return an EFI_UNSUPPORTED if
+ ///< the SM CLP Coutput option requested by the caller is not supported by the
+ ///< UEFI Driver). CLPReturnString buffer is allocated by the consumer of the
+ ///< EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC OL and undefined prior to the call to
+ ///< Response().
+ UINT32 CLPReturnStringLength; ///< The length of the CLP return status string in bytes.
+ UINT8 CLPCmdStatus; ///< SM CLP Command Status (see DMTF SM CLP Specification 1.0 Final Standard -
+ ///< Table 4) CLPErrorValue SM CLP Processing Error Value (see DMTF SM
+ ///< CLP Specification 1.0 Final Standard - Table 6). This field is filled in by
+ ///< the consumer of the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC
+ ///< OL and undefined prior to the call to Response().
+ UINT8 CLPErrorValue; ///< SM CLP Processing Error Value (see DMTF SM CLP Specification 1.0 Final Standard - Table 6).
+ ///< This field is filled in by the consumer of the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL and undefined prior to the call to Response().
+ UINT16 CLPMsgCode; ///< Bit 15: OEM Message Code Flag 0 = Message Code is an SM CLP Probable
+ ///< Cause Value. (see SM CLP Specification Table 11) 1 = Message Code is OEM
+ ///< Specific Bits 14-0: Message Code This field is filled in by the consumer of
+ ///< the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC OL and undefined prior to the call to
+ ///< Response().
+
+} EFI_CONFIGURE_CLP_PARAMETER_BLK;
+
+
+
+extern EFI_GUID gEfiPlatformToDriverConfigurationClpGuid;
+
+extern EFI_GUID gEfiPlatformToDriverConfigurationProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PxeBaseCode.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PxeBaseCode.h
new file mode 100644
index 0000000000..497d972047
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PxeBaseCode.h
@@ -0,0 +1,934 @@
+/** @file
+ EFI PXE Base Code Protocol definitions, which is used to access PXE-compatible
+ devices for network access and network booting.
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in EFI Specification 1.10.
+
+**/
+#ifndef __PXE_BASE_CODE_PROTOCOL_H__
+#define __PXE_BASE_CODE_PROTOCOL_H__
+
+///
+/// PXE Base Code protocol.
+///
+#define EFI_PXE_BASE_CODE_PROTOCOL_GUID \
+ { \
+ 0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
+ }
+
+typedef struct _EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE_PROTOCOL;
+
+///
+/// Protocol defined in EFI1.1.
+///
+typedef EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE;
+
+///
+/// Default IP TTL and ToS.
+///
+#define DEFAULT_TTL 16
+#define DEFAULT_ToS 0
+
+///
+/// ICMP error format.
+///
+typedef struct {
+ UINT8 Type;
+ UINT8 Code;
+ UINT16 Checksum;
+ union {
+ UINT32 reserved;
+ UINT32 Mtu;
+ UINT32 Pointer;
+ struct {
+ UINT16 Identifier;
+ UINT16 Sequence;
+ } Echo;
+ } u;
+ UINT8 Data[494];
+} EFI_PXE_BASE_CODE_ICMP_ERROR;
+
+///
+/// TFTP error format.
+///
+typedef struct {
+ UINT8 ErrorCode;
+ CHAR8 ErrorString[127];
+} EFI_PXE_BASE_CODE_TFTP_ERROR;
+
+///
+/// IP Receive Filter definitions.
+///
+#define EFI_PXE_BASE_CODE_MAX_IPCNT 8
+
+///
+/// IP Receive Filter structure.
+///
+typedef struct {
+ UINT8 Filters;
+ UINT8 IpCnt;
+ UINT16 reserved;
+ EFI_IP_ADDRESS IpList[EFI_PXE_BASE_CODE_MAX_IPCNT];
+} EFI_PXE_BASE_CODE_IP_FILTER;
+
+#define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP 0x0001
+#define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST 0x0002
+#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS 0x0004
+#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008
+
+///
+/// ARP cache entries.
+///
+typedef struct {
+ EFI_IP_ADDRESS IpAddr;
+ EFI_MAC_ADDRESS MacAddr;
+} EFI_PXE_BASE_CODE_ARP_ENTRY;
+
+///
+/// ARP route table entries.
+///
+typedef struct {
+ EFI_IP_ADDRESS IpAddr;
+ EFI_IP_ADDRESS SubnetMask;
+ EFI_IP_ADDRESS GwAddr;
+} EFI_PXE_BASE_CODE_ROUTE_ENTRY;
+
+//
+// UDP definitions
+//
+typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT;
+
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP 0x0001
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT 0x0002
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP 0x0004
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT 0x0008
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER 0x0010
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT 0x0020
+
+//
+// Discover() definitions
+//
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO 4
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD 5
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM 6
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG 7
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW 8
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9 9
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10 10
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11 11
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12 12
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL 13
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT 14
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO 15
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT 16
+//
+// 17 through 32767 are reserved
+// 32768 through 65279 are for vendor use
+// 65280 through 65534 are reserved
+//
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST 65535
+
+#define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK 0x7FFF
+#define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL 0x0000
+
+//
+// PXE Tag definition that identifies the processor
+// and programming environment of the client system.
+// These identifiers are defined by IETF:
+// http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml
+//
+#if defined (MDE_CPU_IA32)
+#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0006
+#elif defined (MDE_CPU_IPF)
+#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0002
+#elif defined (MDE_CPU_X64)
+#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0007
+#elif defined (MDE_CPU_ARM)
+#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x000A
+#elif defined (MDE_CPU_AARCH64)
+#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x000B
+#endif
+
+
+///
+/// Discover() server list structure.
+///
+typedef struct {
+ UINT16 Type;
+ BOOLEAN AcceptAnyResponse;
+ UINT8 Reserved;
+ EFI_IP_ADDRESS IpAddr;
+} EFI_PXE_BASE_CODE_SRVLIST;
+
+///
+/// Discover() information override structure.
+///
+typedef struct {
+ BOOLEAN UseMCast;
+ BOOLEAN UseBCast;
+ BOOLEAN UseUCast;
+ BOOLEAN MustUseList;
+ EFI_IP_ADDRESS ServerMCastIp;
+ UINT16 IpCnt;
+ EFI_PXE_BASE_CODE_SRVLIST SrvList[1];
+} EFI_PXE_BASE_CODE_DISCOVER_INFO;
+
+///
+/// TFTP opcode definitions.
+///
+typedef enum {
+ EFI_PXE_BASE_CODE_TFTP_FIRST,
+ EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE,
+ EFI_PXE_BASE_CODE_TFTP_READ_FILE,
+ EFI_PXE_BASE_CODE_TFTP_WRITE_FILE,
+ EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY,
+ EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE,
+ EFI_PXE_BASE_CODE_MTFTP_READ_FILE,
+ EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY,
+ EFI_PXE_BASE_CODE_MTFTP_LAST
+} EFI_PXE_BASE_CODE_TFTP_OPCODE;
+
+///
+/// MTFTP information. This information is required
+/// to start or join a multicast TFTP session. It is also required to
+/// perform the "get file size" and "read directory" operations of MTFTP.
+///
+typedef struct {
+ EFI_IP_ADDRESS MCastIp;
+ EFI_PXE_BASE_CODE_UDP_PORT CPort;
+ EFI_PXE_BASE_CODE_UDP_PORT SPort;
+ UINT16 ListenTimeout;
+ UINT16 TransmitTimeout;
+} EFI_PXE_BASE_CODE_MTFTP_INFO;
+
+///
+/// DHCPV4 Packet structure.
+///
+typedef struct {
+ UINT8 BootpOpcode;
+ UINT8 BootpHwType;
+ UINT8 BootpHwAddrLen;
+ UINT8 BootpGateHops;
+ UINT32 BootpIdent;
+ UINT16 BootpSeconds;
+ UINT16 BootpFlags;
+ UINT8 BootpCiAddr[4];
+ UINT8 BootpYiAddr[4];
+ UINT8 BootpSiAddr[4];
+ UINT8 BootpGiAddr[4];
+ UINT8 BootpHwAddr[16];
+ UINT8 BootpSrvName[64];
+ UINT8 BootpBootFile[128];
+ UINT32 DhcpMagik;
+ UINT8 DhcpOptions[56];
+} EFI_PXE_BASE_CODE_DHCPV4_PACKET;
+
+///
+/// DHCPV6 Packet structure.
+///
+typedef struct {
+ UINT32 MessageType:8;
+ UINT32 TransactionId:24;
+ UINT8 DhcpOptions[1024];
+} EFI_PXE_BASE_CODE_DHCPV6_PACKET;
+
+///
+/// Packet structure.
+///
+typedef union {
+ UINT8 Raw[1472];
+ EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4;
+ EFI_PXE_BASE_CODE_DHCPV6_PACKET Dhcpv6;
+} EFI_PXE_BASE_CODE_PACKET;
+
+//
+// PXE Base Code Mode structure
+//
+#define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8
+#define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8
+
+///
+/// EFI_PXE_BASE_CODE_MODE.
+/// The data values in this structure are read-only and
+/// are updated by the code that produces the
+/// EFI_PXE_BASE_CODE_PROTOCOL functions.
+///
+typedef struct {
+ BOOLEAN Started;
+ BOOLEAN Ipv6Available;
+ BOOLEAN Ipv6Supported;
+ BOOLEAN UsingIpv6;
+ BOOLEAN BisSupported;
+ BOOLEAN BisDetected;
+ BOOLEAN AutoArp;
+ BOOLEAN SendGUID;
+ BOOLEAN DhcpDiscoverValid;
+ BOOLEAN DhcpAckReceived;
+ BOOLEAN ProxyOfferReceived;
+ BOOLEAN PxeDiscoverValid;
+ BOOLEAN PxeReplyReceived;
+ BOOLEAN PxeBisReplyReceived;
+ BOOLEAN IcmpErrorReceived;
+ BOOLEAN TftpErrorReceived;
+ BOOLEAN MakeCallbacks;
+ UINT8 TTL;
+ UINT8 ToS;
+ EFI_IP_ADDRESS StationIp;
+ EFI_IP_ADDRESS SubnetMask;
+ EFI_PXE_BASE_CODE_PACKET DhcpDiscover;
+ EFI_PXE_BASE_CODE_PACKET DhcpAck;
+ EFI_PXE_BASE_CODE_PACKET ProxyOffer;
+ EFI_PXE_BASE_CODE_PACKET PxeDiscover;
+ EFI_PXE_BASE_CODE_PACKET PxeReply;
+ EFI_PXE_BASE_CODE_PACKET PxeBisReply;
+ EFI_PXE_BASE_CODE_IP_FILTER IpFilter;
+ UINT32 ArpCacheEntries;
+ EFI_PXE_BASE_CODE_ARP_ENTRY ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];
+ UINT32 RouteTableEntries;
+ EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];
+ EFI_PXE_BASE_CODE_ICMP_ERROR IcmpError;
+ EFI_PXE_BASE_CODE_TFTP_ERROR TftpError;
+} EFI_PXE_BASE_CODE_MODE;
+
+//
+// PXE Base Code Interface Function definitions
+//
+
+/**
+ Enables the use of the PXE Base Code Protocol functions.
+
+ This function enables the use of the PXE Base Code Protocol functions. If the
+ Started field of the EFI_PXE_BASE_CODE_MODE structure is already TRUE, then
+ EFI_ALREADY_STARTED will be returned. If UseIpv6 is TRUE, then IPv6 formatted
+ addresses will be used in this session. If UseIpv6 is FALSE, then IPv4 formatted
+ addresses will be used in this session. If UseIpv6 is TRUE, and the Ipv6Supported
+ field of the EFI_PXE_BASE_CODE_MODE structure is FALSE, then EFI_UNSUPPORTED will
+ be returned. If there is not enough memory or other resources to start the PXE
+ Base Code Protocol, then EFI_OUT_OF_RESOURCES will be returned. Otherwise, the
+ PXE Base Code Protocol will be started, and all of the fields of the EFI_PXE_BASE_CODE_MODE
+ structure will be initialized as follows:
+ StartedSet to TRUE.
+ Ipv6SupportedUnchanged.
+ Ipv6AvailableUnchanged.
+ UsingIpv6Set to UseIpv6.
+ BisSupportedUnchanged.
+ BisDetectedUnchanged.
+ AutoArpSet to TRUE.
+ SendGUIDSet to FALSE.
+ TTLSet to DEFAULT_TTL.
+ ToSSet to DEFAULT_ToS.
+ DhcpCompletedSet to FALSE.
+ ProxyOfferReceivedSet to FALSE.
+ StationIpSet to an address of all zeros.
+ SubnetMaskSet to a subnet mask of all zeros.
+ DhcpDiscoverZero-filled.
+ DhcpAckZero-filled.
+ ProxyOfferZero-filled.
+ PxeDiscoverValidSet to FALSE.
+ PxeDiscoverZero-filled.
+ PxeReplyValidSet to FALSE.
+ PxeReplyZero-filled.
+ PxeBisReplyValidSet to FALSE.
+ PxeBisReplyZero-filled.
+ IpFilterSet the Filters field to 0 and the IpCnt field to 0.
+ ArpCacheEntriesSet to 0.
+ ArpCacheZero-filled.
+ RouteTableEntriesSet to 0.
+ RouteTableZero-filled.
+ IcmpErrorReceivedSet to FALSE.
+ IcmpErrorZero-filled.
+ TftpErroReceivedSet to FALSE.
+ TftpErrorZero-filled.
+ MakeCallbacksSet to TRUE if the PXE Base Code Callback Protocol is available.
+ Set to FALSE if the PXE Base Code Callback Protocol is not available.
+
+ @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
+ @param UseIpv6 Specifies the type of IP addresses that are to be used during the session
+ that is being started. Set to TRUE for IPv6 addresses, and FALSE for
+ IPv4 addresses.
+
+ @retval EFI_SUCCESS The PXE Base Code Protocol was started.
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this oper
+ @retval EFI_UNSUPPORTED UseIpv6 is TRUE, but the Ipv6Supported field of the
+ EFI_PXE_BASE_CODE_MODE structure is FALSE.
+ @retval EFI_ALREADY_STARTED The PXE Base Code Protocol is already in the started state.
+ @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid
+ EFI_PXE_BASE_CODE_PROTOCOL structure.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory or other resources to start the
+ PXE Base Code Protocol.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PXE_BASE_CODE_START)(
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,
+ IN BOOLEAN UseIpv6
+ );
+
+/**
+ Disables the use of the PXE Base Code Protocol functions.
+
+ This function stops all activity on the network device. All the resources allocated
+ in Start() are released, the Started field of the EFI_PXE_BASE_CODE_MODE structure is
+ set to FALSE and EFI_SUCCESS is returned. If the Started field of the EFI_PXE_BASE_CODE_MODE
+ structure is already FALSE, then EFI_NOT_STARTED will be returned.
+
+ @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The PXE Base Code Protocol was stopped.
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is already in the stopped state.
+ @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid
+ EFI_PXE_BASE_CODE_PROTOCOL structure.
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PXE_BASE_CODE_STOP)(
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This
+ );
+
+/**
+ Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6
+ S.A.R.R (solicit / advertise / request / reply) sequence.
+
+ This function attempts to complete the DHCP sequence. If this sequence is completed,
+ then EFI_SUCCESS is returned, and the DhcpCompleted, ProxyOfferReceived, StationIp,
+ SubnetMask, DhcpDiscover, DhcpAck, and ProxyOffer fields of the EFI_PXE_BASE_CODE_MODE
+ structure are filled in.
+ If SortOffers is TRUE, then the cached DHCP offer packets will be sorted before
+ they are tried. If SortOffers is FALSE, then the cached DHCP offer packets will
+ be tried in the order in which they are received. Please see the Preboot Execution
+ Environment (PXE) Specification for additional details on the implementation of DHCP.
+ This function can take at least 31 seconds to timeout and return control to the
+ caller. If the DHCP sequence does not complete, then EFI_TIMEOUT will be returned.
+ If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
+ then the DHCP sequence will be stopped and EFI_ABORTED will be returned.
+
+ @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
+ @param SortOffers TRUE if the offers received should be sorted. Set to FALSE to try the
+ offers in the order that they are received.
+
+ @retval EFI_SUCCESS Valid DHCP has completed.
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
+ @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid
+ EFI_PXE_BASE_CODE_PROTOCOL structure.
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete the DHCP Protocol.
+ @retval EFI_ABORTED The callback function aborted the DHCP Protocol.
+ @retval EFI_TIMEOUT The DHCP Protocol timed out.
+ @retval EFI_ICMP_ERROR An ICMP error packet was received during the DHCP session.
+ @retval EFI_NO_RESPONSE Valid PXE offer was not received.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PXE_BASE_CODE_DHCP)(
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,
+ IN BOOLEAN SortOffers
+ );
+
+/**
+ Attempts to complete the PXE Boot Server and/or boot image discovery sequence.
+
+ This function attempts to complete the PXE Boot Server and/or boot image discovery
+ sequence. If this sequence is completed, then EFI_SUCCESS is returned, and the
+ PxeDiscoverValid, PxeDiscover, PxeReplyReceived, and PxeReply fields of the
+ EFI_PXE_BASE_CODE_MODE structure are filled in. If UseBis is TRUE, then the
+ PxeBisReplyReceived and PxeBisReply fields of the EFI_PXE_BASE_CODE_MODE structure
+ will also be filled in. If UseBis is FALSE, then PxeBisReplyValid will be set to FALSE.
+ In the structure referenced by parameter Info, the PXE Boot Server list, SrvList[],
+ has two uses: It is the Boot Server IP address list used for unicast discovery
+ (if the UseUCast field is TRUE), and it is the list used for Boot Server verification
+ (if the MustUseList field is TRUE). Also, if the MustUseList field in that structure
+ is TRUE and the AcceptAnyResponse field in the SrvList[] array is TRUE, any Boot
+ Server reply of that type will be accepted. If the AcceptAnyResponse field is
+ FALSE, only responses from Boot Servers with matching IP addresses will be accepted.
+ This function can take at least 10 seconds to timeout and return control to the
+ caller. If the Discovery sequence does not complete, then EFI_TIMEOUT will be
+ returned. Please see the Preboot Execution Environment (PXE) Specification for
+ additional details on the implementation of the Discovery sequence.
+ If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
+ then the Discovery sequence is stopped and EFI_ABORTED will be returned.
+
+ @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
+ @param Type The type of bootstrap to perform.
+ @param Layer The pointer to the boot server layer number to discover, which must be
+ PXE_BOOT_LAYER_INITIAL when a new server type is being
+ discovered.
+ @param UseBis TRUE if Boot Integrity Services are to be used. FALSE otherwise.
+ @param Info The pointer to a data structure that contains additional information on the
+ type of discovery operation that is to be performed.
+
+ @retval EFI_SUCCESS The Discovery sequence has been completed.
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete Discovery.
+ @retval EFI_ABORTED The callback function aborted the Discovery sequence.
+ @retval EFI_TIMEOUT The Discovery sequence timed out.
+ @retval EFI_ICMP_ERROR An ICMP error packet was received during the PXE discovery
+ session.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PXE_BASE_CODE_DISCOVER)(
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,
+ IN UINT16 Type,
+ IN UINT16 *Layer,
+ IN BOOLEAN UseBis,
+ IN EFI_PXE_BASE_CODE_DISCOVER_INFO *Info OPTIONAL
+ );
+
+/**
+ Used to perform TFTP and MTFTP services.
+
+ This function is used to perform TFTP and MTFTP services. This includes the
+ TFTP operations to get the size of a file, read a directory, read a file, and
+ write a file. It also includes the MTFTP operations to get the size of a file,
+ read a directory, and read a file. The type of operation is specified by Operation.
+ If the callback function that is invoked during the TFTP/MTFTP operation does
+ not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will
+ be returned.
+ For read operations, the return data will be placed in the buffer specified by
+ BufferPtr. If BufferSize is too small to contain the entire downloaded file,
+ then EFI_BUFFER_TOO_SMALL will be returned and BufferSize will be set to zero
+ or the size of the requested file (the size of the requested file is only returned
+ if the TFTP server supports TFTP options). If BufferSize is large enough for the
+ read operation, then BufferSize will be set to the size of the downloaded file,
+ and EFI_SUCCESS will be returned. Applications using the PxeBc.Mtftp() services
+ should use the get-file-size operations to determine the size of the downloaded
+ file prior to using the read-file operations--especially when downloading large
+ (greater than 64 MB) files--instead of making two calls to the read-file operation.
+ Following this recommendation will save time if the file is larger than expected
+ and the TFTP server does not support TFTP option extensions. Without TFTP option
+ extension support, the client has to download the entire file, counting and discarding
+ the received packets, to determine the file size.
+ For write operations, the data to be sent is in the buffer specified by BufferPtr.
+ BufferSize specifies the number of bytes to send. If the write operation completes
+ successfully, then EFI_SUCCESS will be returned.
+ For TFTP "get file size" operations, the size of the requested file or directory
+ is returned in BufferSize, and EFI_SUCCESS will be returned. If the TFTP server
+ does not support options, the file will be downloaded into a bit bucket and the
+ length of the downloaded file will be returned. For MTFTP "get file size" operations,
+ if the MTFTP server does not support the "get file size" option, EFI_UNSUPPORTED
+ will be returned.
+ This function can take up to 10 seconds to timeout and return control to the caller.
+ If the TFTP sequence does not complete, EFI_TIMEOUT will be returned.
+ If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
+ then the TFTP sequence is stopped and EFI_ABORTED will be returned.
+ The format of the data returned from a TFTP read directory operation is a null-terminated
+ filename followed by a null-terminated information string, of the form
+ "size year-month-day hour:minute:second" (i.e. %d %d-%d-%d %d:%d:%f - note that
+ the seconds field can be a decimal number), where the date and time are UTC. For
+ an MTFTP read directory command, there is additionally a null-terminated multicast
+ IP address preceding the filename of the form %d.%d.%d.%d for IP v4. The final
+ entry is itself null-terminated, so that the final information string is terminated
+ with two null octets.
+
+ @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
+ @param Operation The type of operation to perform.
+ @param BufferPtr A pointer to the data buffer.
+ @param Overwrite Only used on write file operations. TRUE if a file on a remote server can
+ be overwritten.
+ @param BufferSize For get-file-size operations, *BufferSize returns the size of the
+ requested file.
+ @param BlockSize The requested block size to be used during a TFTP transfer.
+ @param ServerIp The TFTP / MTFTP server IP address.
+ @param Filename A Null-terminated ASCII string that specifies a directory name or a file
+ name.
+ @param Info The pointer to the MTFTP information.
+ @param DontUseBuffer Set to FALSE for normal TFTP and MTFTP read file operation.
+
+ @retval EFI_SUCCESS The TFTP/MTFTP operation was completed.
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
+ @retval EFI_BUFFER_TOO_SMALL The buffer is not large enough to complete the read operation.
+ @retval EFI_ABORTED The callback function aborted the TFTP/MTFTP operation.
+ @retval EFI_TIMEOUT The TFTP/MTFTP operation timed out.
+ @retval EFI_ICMP_ERROR An ICMP error packet was received during the MTFTP session.
+ @retval EFI_TFTP_ERROR A TFTP error packet was received during the MTFTP session.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PXE_BASE_CODE_MTFTP)(
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,
+ IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation,
+ IN OUT VOID *BufferPtr OPTIONAL,
+ IN BOOLEAN Overwrite,
+ IN OUT UINT64 *BufferSize,
+ IN UINTN *BlockSize OPTIONAL,
+ IN EFI_IP_ADDRESS *ServerIp,
+ IN UINT8 *Filename OPTIONAL,
+ IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL,
+ IN BOOLEAN DontUseBuffer
+ );
+
+/**
+ Writes a UDP packet to the network interface.
+
+ This function writes a UDP packet specified by the (optional HeaderPtr and)
+ BufferPtr parameters to the network interface. The UDP header is automatically
+ built by this routine. It uses the parameters OpFlags, DestIp, DestPort, GatewayIp,
+ SrcIp, and SrcPort to build this header. If the packet is successfully built and
+ transmitted through the network interface, then EFI_SUCCESS will be returned.
+ If a timeout occurs during the transmission of the packet, then EFI_TIMEOUT will
+ be returned. If an ICMP error occurs during the transmission of the packet, then
+ the IcmpErrorReceived field is set to TRUE, the IcmpError field is filled in and
+ EFI_ICMP_ERROR will be returned. If the Callback Protocol does not return
+ EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will be returned.
+
+ @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
+ @param OpFlags The UDP operation flags.
+ @param DestIp The destination IP address.
+ @param DestPort The destination UDP port number.
+ @param GatewayIp The gateway IP address.
+ @param SrcIp The source IP address.
+ @param SrcPort The source UDP port number.
+ @param HeaderSize An optional field which may be set to the length of a header at
+ HeaderPtr to be prefixed to the data at BufferPtr.
+ @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the
+ data at BufferPtr.
+ @param BufferSize A pointer to the size of the data at BufferPtr.
+ @param BufferPtr A pointer to the data to be written.
+
+ @retval EFI_SUCCESS The UDP Write operation was completed.
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_BAD_BUFFER_SIZE The buffer is too long to be transmitted.
+ @retval EFI_ABORTED The callback function aborted the UDP Write operation.
+ @retval EFI_TIMEOUT The UDP Write operation timed out.
+ @retval EFI_ICMP_ERROR An ICMP error packet was received during the UDP write session.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE)(
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,
+ IN UINT16 OpFlags,
+ IN EFI_IP_ADDRESS *DestIp,
+ IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort,
+ IN EFI_IP_ADDRESS *GatewayIp, OPTIONAL
+ IN EFI_IP_ADDRESS *SrcIp, OPTIONAL
+ IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL
+ IN UINTN *HeaderSize, OPTIONAL
+ IN VOID *HeaderPtr, OPTIONAL
+ IN UINTN *BufferSize,
+ IN VOID *BufferPtr
+ );
+
+/**
+ Reads a UDP packet from the network interface.
+
+ This function reads a UDP packet from a network interface. The data contents
+ are returned in (the optional HeaderPtr and) BufferPtr, and the size of the
+ buffer received is returned in BufferSize. If the input BufferSize is smaller
+ than the UDP packet received (less optional HeaderSize), it will be set to the
+ required size, and EFI_BUFFER_TOO_SMALL will be returned. In this case, the
+ contents of BufferPtr are undefined, and the packet is lost. If a UDP packet is
+ successfully received, then EFI_SUCCESS will be returned, and the information
+ from the UDP header will be returned in DestIp, DestPort, SrcIp, and SrcPort if
+ they are not NULL.
+ Depending on the values of OpFlags and the DestIp, DestPort, SrcIp, and SrcPort
+ input values, different types of UDP packet receive filtering will be performed.
+ The following tables summarize these receive filter operations.
+
+ @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
+ @param OpFlags The UDP operation flags.
+ @param DestIp The destination IP address.
+ @param DestPort The destination UDP port number.
+ @param SrcIp The source IP address.
+ @param SrcPort The source UDP port number.
+ @param HeaderSize An optional field which may be set to the length of a header at
+ HeaderPtr to be prefixed to the data at BufferPtr.
+ @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the
+ data at BufferPtr.
+ @param BufferSize A pointer to the size of the data at BufferPtr.
+ @param BufferPtr A pointer to the data to be read.
+
+ @retval EFI_SUCCESS The UDP Read operation was completed.
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
+ @retval EFI_BUFFER_TOO_SMALL The packet is larger than Buffer can hold.
+ @retval EFI_ABORTED The callback function aborted the UDP Read operation.
+ @retval EFI_TIMEOUT The UDP Read operation timed out.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PXE_BASE_CODE_UDP_READ)(
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,
+ IN UINT16 OpFlags,
+ IN OUT EFI_IP_ADDRESS *DestIp, OPTIONAL
+ IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort, OPTIONAL
+ IN OUT EFI_IP_ADDRESS *SrcIp, OPTIONAL
+ IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL
+ IN UINTN *HeaderSize, OPTIONAL
+ IN VOID *HeaderPtr, OPTIONAL
+ IN OUT UINTN *BufferSize,
+ IN VOID *BufferPtr
+ );
+
+/**
+ Updates the IP receive filters of a network device and enables software filtering.
+
+ The NewFilter field is used to modify the network device's current IP receive
+ filter settings and to enable a software filter. This function updates the IpFilter
+ field of the EFI_PXE_BASE_CODE_MODE structure with the contents of NewIpFilter.
+ The software filter is used when the USE_FILTER in OpFlags is set to UdpRead().
+ The current hardware filter remains in effect no matter what the settings of OpFlags
+ are, so that the meaning of ANY_DEST_IP set in OpFlags to UdpRead() is from those
+ packets whose reception is enabled in hardware - physical NIC address (unicast),
+ broadcast address, logical address or addresses (multicast), or all (promiscuous).
+ UdpRead() does not modify the IP filter settings.
+ Dhcp(), Discover(), and Mtftp() set the IP filter, and return with the IP receive
+ filter list emptied and the filter set to EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP.
+ If an application or driver wishes to preserve the IP receive filter settings,
+ it will have to preserve the IP receive filter settings before these calls, and
+ use SetIpFilter() to restore them after the calls. If incompatible filtering is
+ requested (for example, PROMISCUOUS with anything else), or if the device does not
+ support a requested filter setting and it cannot be accommodated in software
+ (for example, PROMISCUOUS not supported), EFI_INVALID_PARAMETER will be returned.
+ The IPlist field is used to enable IPs other than the StationIP. They may be
+ multicast or unicast. If IPcnt is set as well as EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP,
+ then both the StationIP and the IPs from the IPlist will be used.
+
+ @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
+ @param NewFilter The pointer to the new set of IP receive filters.
+
+ @retval EFI_SUCCESS The IP receive filter settings were updated.
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER)(
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,
+ IN EFI_PXE_BASE_CODE_IP_FILTER *NewFilter
+ );
+
+/**
+ Uses the ARP protocol to resolve a MAC address.
+
+ This function uses the ARP protocol to resolve a MAC address. The UsingIpv6 field
+ of the EFI_PXE_BASE_CODE_MODE structure is used to determine if IPv4 or IPv6
+ addresses are being used. The IP address specified by IpAddr is used to resolve
+ a MAC address. If the ARP protocol succeeds in resolving the specified address,
+ then the ArpCacheEntries and ArpCache fields of the EFI_PXE_BASE_CODE_MODE structure
+ are updated, and EFI_SUCCESS is returned. If MacAddr is not NULL, the resolved
+ MAC address is placed there as well.
+ If the PXE Base Code protocol is in the stopped state, then EFI_NOT_STARTED is
+ returned. If the ARP protocol encounters a timeout condition while attempting
+ to resolve an address, then EFI_TIMEOUT is returned. If the Callback Protocol
+ does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED is
+ returned.
+
+ @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
+ @param IpAddr The pointer to the IP address that is used to resolve a MAC address.
+ @param MacAddr If not NULL, a pointer to the MAC address that was resolved with the
+ ARP protocol.
+
+ @retval EFI_SUCCESS The IP or MAC address was resolved.
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
+ @retval EFI_ABORTED The callback function aborted the ARP Protocol.
+ @retval EFI_TIMEOUT The ARP Protocol encountered a timeout condition.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PXE_BASE_CODE_ARP)(
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,
+ IN EFI_IP_ADDRESS *IpAddr,
+ IN EFI_MAC_ADDRESS *MacAddr OPTIONAL
+ );
+
+/**
+ Updates the parameters that affect the operation of the PXE Base Code Protocol.
+
+ This function sets parameters that affect the operation of the PXE Base Code Protocol.
+ The parameter specified by NewAutoArp is used to control the generation of ARP
+ protocol packets. If NewAutoArp is TRUE, then ARP Protocol packets will be generated
+ as required by the PXE Base Code Protocol. If NewAutoArp is FALSE, then no ARP
+ Protocol packets will be generated. In this case, the only mappings that are
+ available are those stored in the ArpCache of the EFI_PXE_BASE_CODE_MODE structure.
+ If there are not enough mappings in the ArpCache to perform a PXE Base Code Protocol
+ service, then the service will fail. This function updates the AutoArp field of
+ the EFI_PXE_BASE_CODE_MODE structure to NewAutoArp.
+ The SetParameters() call must be invoked after a Callback Protocol is installed
+ to enable the use of callbacks.
+
+ @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
+ @param NewAutoArp If not NULL, a pointer to a value that specifies whether to replace the
+ current value of AutoARP.
+ @param NewSendGUID If not NULL, a pointer to a value that specifies whether to replace the
+ current value of SendGUID.
+ @param NewTTL If not NULL, a pointer to be used in place of the current value of TTL,
+ the "time to live" field of the IP header.
+ @param NewToS If not NULL, a pointer to be used in place of the current value of ToS,
+ the "type of service" field of the IP header.
+ @param NewMakeCallback If not NULL, a pointer to a value that specifies whether to replace the
+ current value of the MakeCallback field of the Mode structure.
+
+ @retval EFI_SUCCESS The new parameters values were updated.
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS)(
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,
+ IN BOOLEAN *NewAutoArp, OPTIONAL
+ IN BOOLEAN *NewSendGUID, OPTIONAL
+ IN UINT8 *NewTTL, OPTIONAL
+ IN UINT8 *NewToS, OPTIONAL
+ IN BOOLEAN *NewMakeCallback OPTIONAL
+ );
+
+/**
+ Updates the station IP address and/or subnet mask values of a network device.
+
+ This function updates the station IP address and/or subnet mask values of a network
+ device.
+ The NewStationIp field is used to modify the network device's current IP address.
+ If NewStationIP is NULL, then the current IP address will not be modified. Otherwise,
+ this function updates the StationIp field of the EFI_PXE_BASE_CODE_MODE structure
+ with NewStationIp.
+ The NewSubnetMask field is used to modify the network device's current subnet
+ mask. If NewSubnetMask is NULL, then the current subnet mask will not be modified.
+ Otherwise, this function updates the SubnetMask field of the EFI_PXE_BASE_CODE_MODE
+ structure with NewSubnetMask.
+
+ @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
+ @param NewStationIp The pointer to the new IP address to be used by the network device.
+ @param NewSubnetMask The pointer to the new subnet mask to be used by the network device.
+
+ @retval EFI_SUCCESS The new station IP address and/or subnet mask were updated.
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP)(
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,
+ IN EFI_IP_ADDRESS *NewStationIp, OPTIONAL
+ IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL
+ );
+
+/**
+ Updates the contents of the cached DHCP and Discover packets.
+
+ The pointers to the new packets are used to update the contents of the cached
+ packets in the EFI_PXE_BASE_CODE_MODE structure.
+
+ @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
+ @param NewDhcpDiscoverValid The pointer to a value that will replace the current
+ DhcpDiscoverValid field.
+ @param NewDhcpAckReceived The pointer to a value that will replace the current
+ DhcpAckReceived field.
+ @param NewProxyOfferReceived The pointer to a value that will replace the current
+ ProxyOfferReceived field.
+ @param NewPxeDiscoverValid The pointer to a value that will replace the current
+ ProxyOfferReceived field.
+ @param NewPxeReplyReceived The pointer to a value that will replace the current
+ PxeReplyReceived field.
+ @param NewPxeBisReplyReceived The pointer to a value that will replace the current
+ PxeBisReplyReceived field.
+ @param NewDhcpDiscover The pointer to the new cached DHCP Discover packet contents.
+ @param NewDhcpAck The pointer to the new cached DHCP Ack packet contents.
+ @param NewProxyOffer The pointer to the new cached Proxy Offer packet contents.
+ @param NewPxeDiscover The pointer to the new cached PXE Discover packet contents.
+ @param NewPxeReply The pointer to the new cached PXE Reply packet contents.
+ @param NewPxeBisReply The pointer to the new cached PXE BIS Reply packet contents.
+
+ @retval EFI_SUCCESS The cached packet contents were updated.
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
+ @retval EFI_INVALID_PARAMETER This is NULL or not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS)(
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,
+ BOOLEAN *NewDhcpDiscoverValid, OPTIONAL
+ BOOLEAN *NewDhcpAckReceived, OPTIONAL
+ BOOLEAN *NewProxyOfferReceived, OPTIONAL
+ BOOLEAN *NewPxeDiscoverValid, OPTIONAL
+ BOOLEAN *NewPxeReplyReceived, OPTIONAL
+ BOOLEAN *NewPxeBisReplyReceived, OPTIONAL
+ IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover, OPTIONAL
+ IN EFI_PXE_BASE_CODE_PACKET *NewDhcpAck, OPTIONAL
+ IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer, OPTIONAL
+ IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover, OPTIONAL
+ IN EFI_PXE_BASE_CODE_PACKET *NewPxeReply, OPTIONAL
+ IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply OPTIONAL
+ );
+
+//
+// PXE Base Code Protocol structure
+//
+#define EFI_PXE_BASE_CODE_PROTOCOL_REVISION 0x00010000
+
+//
+// Revision defined in EFI1.1
+//
+#define EFI_PXE_BASE_CODE_INTERFACE_REVISION EFI_PXE_BASE_CODE_PROTOCOL_REVISION
+
+///
+/// The EFI_PXE_BASE_CODE_PROTOCOL is used to control PXE-compatible devices.
+/// An EFI_PXE_BASE_CODE_PROTOCOL will be layered on top of an
+/// EFI_MANAGED_NETWORK_PROTOCOL protocol in order to perform packet level transactions.
+/// The EFI_PXE_BASE_CODE_PROTOCOL handle also supports the
+/// EFI_LOAD_FILE_PROTOCOL protocol. This provides a clean way to obtain control from the
+/// boot manager if the boot path is from the remote device.
+///
+struct _EFI_PXE_BASE_CODE_PROTOCOL {
+ ///
+ /// The revision of the EFI_PXE_BASE_CODE_PROTOCOL. All future revisions must
+ /// be backwards compatible. If a future version is not backwards compatible
+ /// it is not the same GUID.
+ ///
+ UINT64 Revision;
+ EFI_PXE_BASE_CODE_START Start;
+ EFI_PXE_BASE_CODE_STOP Stop;
+ EFI_PXE_BASE_CODE_DHCP Dhcp;
+ EFI_PXE_BASE_CODE_DISCOVER Discover;
+ EFI_PXE_BASE_CODE_MTFTP Mtftp;
+ EFI_PXE_BASE_CODE_UDP_WRITE UdpWrite;
+ EFI_PXE_BASE_CODE_UDP_READ UdpRead;
+ EFI_PXE_BASE_CODE_SET_IP_FILTER SetIpFilter;
+ EFI_PXE_BASE_CODE_ARP Arp;
+ EFI_PXE_BASE_CODE_SET_PARAMETERS SetParameters;
+ EFI_PXE_BASE_CODE_SET_STATION_IP SetStationIp;
+ EFI_PXE_BASE_CODE_SET_PACKETS SetPackets;
+ ///
+ /// The pointer to the EFI_PXE_BASE_CODE_MODE data for this device.
+ ///
+ EFI_PXE_BASE_CODE_MODE *Mode;
+};
+
+extern EFI_GUID gEfiPxeBaseCodeProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PxeBaseCodeCallBack.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PxeBaseCodeCallBack.h
new file mode 100644
index 0000000000..f653fdf7ff
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/PxeBaseCodeCallBack.h
@@ -0,0 +1,130 @@
+/** @file
+ It is invoked when the PXE Base Code Protocol is about to transmit, has received,
+ or is waiting to receive a packet.
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in EFI Specification 1.10
+
+**/
+
+#ifndef _PXE_BASE_CODE_CALLBACK_H_
+#define _PXE_BASE_CODE_CALLBACK_H_
+
+///
+/// Call Back Definitions.
+///
+#define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_GUID \
+ { \
+ 0x245dca21, 0xfb7b, 0x11d3, {0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+ }
+
+///
+/// UEFI Revision Number Definition.
+///
+#define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION 0x00010000
+
+///
+/// EFI 1.1 Revision Number defintion.
+///
+#define EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION \
+ EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION
+
+///
+/// UEFI Protocol name.
+///
+typedef struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL;
+
+///
+/// EFI1.1 Protocol name.
+///
+typedef EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL EFI_PXE_BASE_CODE_CALLBACK;
+
+///
+/// Event type list for PXE Base Code Protocol function.
+///
+typedef enum {
+ EFI_PXE_BASE_CODE_FUNCTION_FIRST,
+ EFI_PXE_BASE_CODE_FUNCTION_DHCP,
+ EFI_PXE_BASE_CODE_FUNCTION_DISCOVER,
+ EFI_PXE_BASE_CODE_FUNCTION_MTFTP,
+ EFI_PXE_BASE_CODE_FUNCTION_UDP_WRITE,
+ EFI_PXE_BASE_CODE_FUNCTION_UDP_READ,
+ EFI_PXE_BASE_CODE_FUNCTION_ARP,
+ EFI_PXE_BASE_CODE_FUNCTION_IGMP,
+ EFI_PXE_BASE_CODE_PXE_FUNCTION_LAST
+} EFI_PXE_BASE_CODE_FUNCTION;
+
+///
+/// Callback status type.
+///
+typedef enum {
+ EFI_PXE_BASE_CODE_CALLBACK_STATUS_FIRST,
+ EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
+ EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT,
+ EFI_PXE_BASE_CODE_CALLBACK_STATUS_LAST
+} EFI_PXE_BASE_CODE_CALLBACK_STATUS;
+
+/**
+ Callback function that is invoked when the PXE Base Code Protocol is about to transmit, has
+ received, or is waiting to receive a packet.
+
+ This function is invoked when the PXE Base Code Protocol is about to transmit, has received,
+ or is waiting to receive a packet. Parameters Function and Received specify the type of event.
+ Parameters PacketLen and Packet specify the packet that generated the event. If these fields
+ are zero and NULL respectively, then this is a status update callback. If the operation specified
+ by Function is to continue, then CALLBACK_STATUS_CONTINUE should be returned. If the operation
+ specified by Function should be aborted, then CALLBACK_STATUS_ABORT should be returned. Due to
+ the polling nature of UEFI device drivers, a callback function should not execute for more than 5 ms.
+ The SetParameters() function must be called after a Callback Protocol is installed to enable the
+ use of callbacks.
+
+ @param This The pointer to the EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL instance.
+ @param Function The PXE Base Code Protocol function that is waiting for an event.
+ @param Received TRUE if the callback is being invoked due to a receive event. FALSE if
+ the callback is being invoked due to a transmit event.
+ @param PacketLen The length, in bytes, of Packet. This field will have a value of zero if
+ this is a wait for receive event.
+ @param Packet If Received is TRUE, a pointer to the packet that was just received;
+ otherwise a pointer to the packet that is about to be transmitted.
+
+ @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE if Function specifies a continue operation
+ @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT if Function specifies an abort operation
+
+**/
+typedef
+EFI_PXE_BASE_CODE_CALLBACK_STATUS
+(EFIAPI *EFI_PXE_CALLBACK)(
+ IN EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *This,
+ IN EFI_PXE_BASE_CODE_FUNCTION Function,
+ IN BOOLEAN Received,
+ IN UINT32 PacketLen,
+ IN EFI_PXE_BASE_CODE_PACKET *Packet OPTIONAL
+ );
+
+///
+/// Protocol that is invoked when the PXE Base Code Protocol is about
+/// to transmit, has received, or is waiting to receive a packet.
+///
+struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL {
+ ///
+ /// The revision of the EFI_PXE_BASE_CODE_PROTOCOL. All future revisions must
+ /// be backwards compatible. If a future version is not backwards compatible
+ /// it is not the same GUID.
+ ///
+ UINT64 Revision;
+ EFI_PXE_CALLBACK Callback;
+};
+
+extern EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/RamDisk.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/RamDisk.h
new file mode 100644
index 0000000000..61353fbbd7
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/RamDisk.h
@@ -0,0 +1,106 @@
+/** @file
+ This file defines the EFI RAM Disk Protocol.
+
+ Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.6
+
+**/
+
+#ifndef __RAM_DISK_PROTOCOL_H__
+#define __RAM_DISK_PROTOCOL_H__
+
+//
+// EFI RAM Disk Protocol GUID value
+//
+#define EFI_RAM_DISK_PROTOCOL_GUID \
+ { 0xab38a0df, 0x6873, 0x44a9, { 0x87, 0xe6, 0xd4, 0xeb, 0x56, 0x14, 0x84, 0x49 }};
+
+//
+// Forward reference for pure ANSI compatability
+//
+typedef struct _EFI_RAM_DISK_PROTOCOL EFI_RAM_DISK_PROTOCOL;
+
+/**
+ Register a RAM disk with specified address, size and type.
+
+ @param[in] RamDiskBase The base address of registered RAM disk.
+ @param[in] RamDiskSize The size of registered RAM disk.
+ @param[in] RamDiskType The type of registered RAM disk. The GUID can be
+ any of the values defined in section 9.3.6.9, or a
+ vendor defined GUID.
+ @param[in] ParentDevicePath
+ Pointer to the parent device path. If there is no
+ parent device path then ParentDevicePath is NULL.
+ @param[out] DevicePath On return, points to a pointer to the device path
+ of the RAM disk device.
+ If ParentDevicePath is not NULL, the returned
+ DevicePath is created by appending a RAM disk node
+ to the parent device path. If ParentDevicePath is
+ NULL, the returned DevicePath is a RAM disk device
+ path without appending. This function is
+ responsible for allocating the buffer DevicePath
+ with the boot service AllocatePool().
+
+ @retval EFI_SUCCESS The RAM disk is registered successfully.
+ @retval EFI_INVALID_PARAMETER DevicePath or RamDiskType is NULL.
+ RamDiskSize is 0.
+ @retval EFI_ALREADY_STARTED A Device Path Protocol instance to be created
+ is already present in the handle database.
+ @retval EFI_OUT_OF_RESOURCES The RAM disk register operation fails due to
+ resource limitation.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_RAM_DISK_REGISTER_RAMDISK) (
+ IN UINT64 RamDiskBase,
+ IN UINT64 RamDiskSize,
+ IN EFI_GUID *RamDiskType,
+ IN EFI_DEVICE_PATH *ParentDevicePath OPTIONAL,
+ OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
+ );
+
+/**
+ Unregister a RAM disk specified by DevicePath.
+
+ @param[in] DevicePath A pointer to the device path that describes a RAM
+ Disk device.
+
+ @retval EFI_SUCCESS The RAM disk is unregistered successfully.
+ @retval EFI_INVALID_PARAMETER DevicePath is NULL.
+ @retval EFI_UNSUPPORTED The device specified by DevicePath is not a
+ valid ramdisk device path and not supported
+ by the driver.
+ @retval EFI_NOT_FOUND The RAM disk pointed by DevicePath doesn't
+ exist.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_RAM_DISK_UNREGISTER_RAMDISK) (
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ );
+
+///
+/// RAM Disk Protocol structure.
+///
+struct _EFI_RAM_DISK_PROTOCOL {
+ EFI_RAM_DISK_REGISTER_RAMDISK Register;
+ EFI_RAM_DISK_UNREGISTER_RAMDISK Unregister;
+};
+
+///
+/// RAM Disk Protocol GUID variable.
+///
+extern EFI_GUID gEfiRamDiskProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/RealTimeClock.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/RealTimeClock.h
new file mode 100644
index 0000000000..7a70ae37a5
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/RealTimeClock.h
@@ -0,0 +1,36 @@
+/** @file
+ Real Time clock Architectural Protocol as defined in PI Specification VOLUME 2 DXE
+
+ This code abstracts time and data functions. Used to provide
+ Time and date related EFI runtime services.
+
+ The GetTime (), SetTime (), GetWakeupTime (), and SetWakeupTime () UEFI 2.0
+ services are added to the EFI system table and the
+ EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL_GUID protocol is registered with a NULL
+ pointer.
+
+ No CRC of the EFI system table is required, since that is done in the DXE core.
+
+ Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARCH_PROTOCOL_REAL_TIME_CLOCK_H__
+#define __ARCH_PROTOCOL_REAL_TIME_CLOCK_H__
+
+///
+/// Global ID for the Real Time Clock Architectural Protocol
+///
+#define EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL_GUID \
+ { 0x27CFAC87, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }
+
+extern EFI_GUID gEfiRealTimeClockArchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/RegularExpressionProtocol.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/RegularExpressionProtocol.h
new file mode 100644
index 0000000000..5582e12d36
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/RegularExpressionProtocol.h
@@ -0,0 +1,178 @@
+/** @file
+ This section defines the Regular Expression Protocol. This protocol isused to match
+ Unicode strings against Regular Expression patterns.
+
+Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __REGULAR_EXPRESSION_PROTOCOL_H__
+#define __REGULAR_EXPRESSION_PROTOCOL_H__
+
+#define EFI_REGULAR_EXPRESSION_PROTOCOL_GUID \
+ { \
+ 0xB3F79D9A, 0x436C, 0xDC11, {0xB0, 0x52, 0xCD, 0x85, 0xDF, 0x52, 0x4C, 0xE6 } \
+ }
+
+#define EFI_REGEX_SYNTAX_TYPE_POSIX_EXTENDED_GUID \
+ { \
+ 0x5F05B20F, 0x4A56, 0xC231, {0xFA, 0x0B, 0xA7, 0xB1, 0xF1, 0x10, 0x04, 0x1D } \
+ }
+
+#define EFI_REGEX_SYNTAX_TYPE_PERL_GUID \
+ { \
+ 0x63E60A51, 0x497D, 0xD427, {0xC4, 0xA5, 0xB8, 0xAB, 0xDC, 0x3A, 0xAE, 0xB6 } \
+ }
+
+#define EFI_REGEX_SYNTAX_TYPE_ECMA_262_GUID \
+ { \
+ 0x9A473A4A, 0x4CEB, 0xB95A, {0x41, 0x5E, 0x5B, 0xA0, 0xBC, 0x63, 0x9B, 0x2E } \
+ }
+
+typedef struct _EFI_REGULAR_EXPRESSION_PROTOCOL EFI_REGULAR_EXPRESSION_PROTOCOL;
+
+
+typedef struct {
+ CONST CHAR16 *CapturePtr; // Pointer to the start of the captured sub-expression
+ // within matched String.
+
+ UINTN Length; // Length of captured sub-expression.
+} EFI_REGEX_CAPTURE;
+
+typedef EFI_GUID EFI_REGEX_SYNTAX_TYPE;
+
+//
+// Protocol member functions
+//
+/**
+ Returns information about the regular expression syntax types supported
+ by the implementation.
+
+ This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL
+ instance.
+
+ RegExSyntaxTypeListSize On input, the size in bytes of RegExSyntaxTypeList.
+ On output with a return code of EFI_SUCCESS, the
+ size in bytes of the data returned in
+ RegExSyntaxTypeList. On output with a return code
+ of EFI_BUFFER_TOO_SMALL, the size of
+ RegExSyntaxTypeListrequired to obtain the list.
+
+ RegExSyntaxTypeList A caller-allocated memory buffer filled by the
+ driver with one EFI_REGEX_SYNTAX_TYPEelement
+ for each supported Regular expression syntax
+ type. The list must not change across multiple
+ calls to the same driver. The first syntax
+ type in the list is the default type for the
+ driver.
+
+ @retval EFI_SUCCESS The regular expression syntax types list
+ was returned successfully.
+ @retval EFI_UNSUPPORTED The service is not supported by this driver.
+ @retval EFI_DEVICE_ERROR The list of syntax types could not be
+ retrieved due to a hardware or firmware error.
+ @retval EFI_BUFFER_TOO_SMALL The buffer RegExSyntaxTypeList is too small
+ to hold the result.
+ @retval EFI_INVALID_PARAMETER RegExSyntaxTypeListSize is NULL
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_REGULAR_EXPRESSION_GET_INFO) (
+ IN EFI_REGULAR_EXPRESSION_PROTOCOL *This,
+ IN OUT UINTN *RegExSyntaxTypeListSize,
+ OUT EFI_REGEX_SYNTAX_TYPE *RegExSyntaxTypeList
+ );
+
+/**
+ Checks if the input string matches to the regular expression pattern.
+
+ This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL instance.
+ Type EFI_REGULAR_EXPRESSION_PROTOCOL is defined in Section
+ XYZ.
+
+ String A pointer to a NULL terminated string to match against the
+ regular expression string specified by Pattern.
+
+ Pattern A pointer to a NULL terminated string that represents the
+ regular expression.
+
+ SyntaxType A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the
+ regular expression syntax type to use. May be NULL in which
+ case the function will use its default regular expression
+ syntax type.
+
+ Result On return, points to TRUE if String fully matches against
+ the regular expression Pattern using the regular expression
+ SyntaxType. Otherwise, points to FALSE.
+
+ Captures A Pointer to an array of EFI_REGEX_CAPTURE objects to receive
+ the captured groups in the event of a match. The full
+ sub-string match is put in Captures[0], and the results of N
+ capturing groups are put in Captures[1:N]. If Captures is
+ NULL, then this function doesn't allocate the memory for the
+ array and does not build up the elements. It only returns the
+ number of matching patterns in CapturesCount. If Captures is
+ not NULL, this function returns a pointer to an array and
+ builds up the elements in the array. CapturesCount is also
+ updated to the number of matching patterns found. It is the
+ caller's responsibility to free the memory pool in Captures
+ and in each CapturePtr in the array elements.
+
+ CapturesCount On output, CapturesCount is the number of matching patterns
+ found in String. Zero means no matching patterns were found
+ in the string.
+
+ @retval EFI_SUCCESS The regular expression string matching
+ completed successfully.
+ @retval EFI_UNSUPPORTED The regular expression syntax specified by
+ SyntaxTypeis not supported by this driver.
+ @retval EFI_DEVICE_ERROR The regular expression string matching
+ failed due to a hardware or firmware error.
+ @retval EFI_INVALID_PARAMETER String, Pattern, Result, or CapturesCountis
+ NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_REGULAR_EXPRESSION_MATCH) (
+ IN EFI_REGULAR_EXPRESSION_PROTOCOL *This,
+ IN CHAR16 *String,
+ IN CHAR16 *Pattern,
+ IN EFI_REGEX_SYNTAX_TYPE *SyntaxType, OPTIONAL
+ OUT BOOLEAN *Result,
+ OUT EFI_REGEX_CAPTURE **Captures, OPTIONAL
+ OUT UINTN *CapturesCount
+ );
+
+struct _EFI_REGULAR_EXPRESSION_PROTOCOL {
+ EFI_REGULAR_EXPRESSION_MATCH MatchString;
+ EFI_REGULAR_EXPRESSION_GET_INFO GetInfo;
+} ;
+
+extern EFI_GUID gEfiRegularExpressionProtocolGuid;
+
+//
+// For regular expression rules specified in the POSIX Extended Regular
+// Expression (ERE) Syntax:
+//
+extern EFI_GUID gEfiRegexSyntaxTypePosixExtendedGuid;
+
+//
+// For regular expression rules specifiedin the ECMA 262 Specification
+//
+extern EFI_GUID gEfiRegexSyntaxTypeEcma262Guid;
+
+//
+// For regular expression rules specified in the Perl standard:
+//
+extern EFI_GUID gEfiRegexSyntaxTypePerlGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ReportStatusCodeHandler.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ReportStatusCodeHandler.h
new file mode 100644
index 0000000000..5926e551d8
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ReportStatusCodeHandler.h
@@ -0,0 +1,94 @@
+/** @file
+ This protocol provide registering and unregistering services to status code
+ consumers while in DXE.
+
+ Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
+#define __REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
+
+#define EFI_RSC_HANDLER_PROTOCOL_GUID \
+ { \
+ 0x86212936, 0xe76, 0x41c8, {0xa0, 0x3a, 0x2a, 0xf2, 0xfc, 0x1c, 0x39, 0xe2} \
+ }
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_RSC_HANDLER_CALLBACK)(
+ IN EFI_STATUS_CODE_TYPE CodeType,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN EFI_GUID *CallerId,
+ IN EFI_STATUS_CODE_DATA *Data
+);
+
+/**
+ Register the callback function for ReportStatusCode() notification.
+
+ When this function is called the function pointer is added to an internal list and any future calls to
+ ReportStatusCode() will be forwarded to the Callback function. During the bootservices,
+ this is the callback for which this service can be invoked. The report status code router
+ will create an event such that the callback function is only invoked at the TPL for which it was
+ registered. The entity that registers for the callback should also register for an event upon
+ generation of exit boot services and invoke the unregister service.
+ If the handler does not have a TPL dependency, it should register for a callback at TPL high. The
+ router infrastructure will support making callbacks at runtime, but the caller for runtime invocation
+ must meet the following criteria:
+ 1. must be a runtime driver type so that its memory is not reclaimed
+ 2. not unregister at exit boot services so that the router will still have its callback address
+ 3. the caller must be self-contained (eg. Not call out into any boot-service interfaces) and be
+ runtime safe, in general.
+
+ @param[in] Callback A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is called when
+ a call to ReportStatusCode() occurs.
+ @param[in] Tpl TPL at which callback can be safely invoked.
+
+ @retval EFI_SUCCESS Function was successfully registered.
+ @retval EFI_INVALID_PARAMETER The callback function was NULL.
+ @retval EFI_OUT_OF_RESOURCES The internal buffer ran out of space. No more functions can be
+ registered.
+ @retval EFI_ALREADY_STARTED The function was already registered. It can't be registered again.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_RSC_HANDLER_REGISTER)(
+ IN EFI_RSC_HANDLER_CALLBACK Callback,
+ IN EFI_TPL Tpl
+);
+
+/**
+ Remove a previously registered callback function from the notification list.
+
+ A callback function must be unregistered before it is deallocated. It is important that any registered
+ callbacks that are not runtime complaint be unregistered when ExitBootServices() is called.
+
+ @param[in] Callback A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is to be
+ unregistered.
+
+ @retval EFI_SUCCESS The function was successfully unregistered.
+ @retval EFI_INVALID_PARAMETER The callback function was NULL.
+ @retval EFI_NOT_FOUND The callback function was not found to be unregistered.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_RSC_HANDLER_UNREGISTER)(
+ IN EFI_RSC_HANDLER_CALLBACK Callback
+);
+
+typedef struct {
+ EFI_RSC_HANDLER_REGISTER Register;
+ EFI_RSC_HANDLER_UNREGISTER Unregister;
+} EFI_RSC_HANDLER_PROTOCOL;
+
+extern EFI_GUID gEfiRscHandlerProtocolGuid;
+
+#endif // __REPORT_STATUS_CODE_HANDLER_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Reset.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Reset.h
new file mode 100644
index 0000000000..bcd9329ba0
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Reset.h
@@ -0,0 +1,31 @@
+/** @file
+ Reset Architectural Protocol as defined in PI Specification VOLUME 2 DXE
+
+ Used to provide ResetSystem runtime services
+
+ The ResetSystem () UEFI 2.0 service is added to the EFI system table and the
+ EFI_RESET_ARCH_PROTOCOL_GUID protocol is registered with a NULL pointer.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARCH_PROTOCOL_RESET_H__
+#define __ARCH_PROTOCOL_RESET_H__
+
+///
+/// Global ID for the Reset Architectural Protocol
+///
+#define EFI_RESET_ARCH_PROTOCOL_GUID \
+ { 0x27CFAC88, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }
+
+extern EFI_GUID gEfiResetArchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ResetNotification.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ResetNotification.h
new file mode 100644
index 0000000000..dac8717e04
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ResetNotification.h
@@ -0,0 +1,86 @@
+/** @file
+ EFI Reset Notification Protocol as defined in UEFI 2.7.
+ This protocol provides services to register for a notification when ResetSystem is called.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.7
+
+**/
+
+#ifndef __EFI_RESET_NOTIFICATION_H__
+#define __EFI_RESET_NOTIFICATION_H__
+
+#define EFI_RESET_NOTIFICATION_PROTOCOL_GUID \
+ { 0x9da34ae0, 0xeaf9, 0x4bbf, { 0x8e, 0xc3, 0xfd, 0x60, 0x22, 0x6c, 0x44, 0xbe } }
+
+typedef struct _EFI_RESET_NOTIFICATION_PROTOCOL EFI_RESET_NOTIFICATION_PROTOCOL;
+
+/**
+ Register a notification function to be called when ResetSystem() is called.
+
+ The RegisterResetNotify() function registers a notification function that is called when
+ ResetSystem()is called and prior to completing the reset of the platform.
+ The registered functions must not perform a platform reset themselves. These
+ notifications are intended only for the notification of components which may need some
+ special-purpose maintenance prior to the platform resetting.
+ The list of registered reset notification functions are processed if ResetSystem()is called
+ before ExitBootServices(). The list of registered reset notification functions is ignored if
+ ResetSystem()is called after ExitBootServices().
+
+ @param[in] This A pointer to the EFI_RESET_NOTIFICATION_PROTOCOL instance.
+ @param[in] ResetFunction Points to the function to be called when a ResetSystem() is executed.
+
+ @retval EFI_SUCCESS The reset notification function was successfully registered.
+ @retval EFI_INVALID_PARAMETER ResetFunction is NULL.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to register the reset notification function.
+ @retval EFI_ALREADY_STARTED The reset notification function specified by ResetFunction has already been registered.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_REGISTER_RESET_NOTIFY) (
+ IN EFI_RESET_NOTIFICATION_PROTOCOL *This,
+ IN EFI_RESET_SYSTEM ResetFunction
+);
+
+/**
+ Unregister a notification function.
+
+ The UnregisterResetNotify() function removes the previously registered
+ notification using RegisterResetNotify().
+
+ @param[in] This A pointer to the EFI_RESET_NOTIFICATION_PROTOCOL instance.
+ @param[in] ResetFunction The pointer to the ResetFunction being unregistered.
+
+ @retval EFI_SUCCESS The reset notification function was unregistered.
+ @retval EFI_INVALID_PARAMETER ResetFunction is NULL.
+ @retval EFI_INVALID_PARAMETER The reset notification function specified by ResetFunction was not previously
+ registered using RegisterResetNotify().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UNREGISTER_RESET_NOTIFY) (
+ IN EFI_RESET_NOTIFICATION_PROTOCOL *This,
+ IN EFI_RESET_SYSTEM ResetFunction
+);
+
+typedef struct _EFI_RESET_NOTIFICATION_PROTOCOL {
+ EFI_REGISTER_RESET_NOTIFY RegisterResetNotify;
+ EFI_UNREGISTER_RESET_NOTIFY UnregisterResetNotify;
+} EFI_RESET_NOTIFICATION_PROTOCOL;
+
+
+extern EFI_GUID gEfiResetNotificationProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Rest.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Rest.h
new file mode 100644
index 0000000000..512dd08ec2
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Rest.h
@@ -0,0 +1,94 @@
+/** @file
+ This file defines the EFI REST Protocol interface.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_REST_PROTOCOL_H__
+#define __EFI_REST_PROTOCOL_H__
+
+#include <Protocol/Http.h>
+
+#define EFI_REST_PROTOCOL_GUID \
+ { \
+ 0x0db48a36, 0x4e54, 0xea9c, {0x9b, 0x09, 0x1e, 0xa5, 0xbe, 0x3a, 0x66, 0x0b } \
+ }
+
+typedef struct _EFI_REST_PROTOCOL EFI_REST_PROTOCOL;
+
+/**
+ Provides a simple HTTP-like interface to send and receive resources from a REST
+ service.
+
+ The SendReceive() function sends an HTTP request to this REST service, and returns a
+ response when the data is retrieved from the service. RequestMessage contains the HTTP
+ request to the REST resource identified by RequestMessage.Request.Url. The
+ ResponseMessage is the returned HTTP response for that request, including any HTTP
+ status.
+
+ @param[in] This Pointer to EFI_REST_PROTOCOL instance for a particular
+ REST service.
+ @param[in] RequestMessage Pointer to the HTTP request data for this resource.
+ @param[out] ResponseMessage Pointer to the HTTP response data obtained for this
+ requested.
+
+ @retval EFI_SUCCESS Operation succeeded.
+ @retval EFI_INVALID_PARAMETER This, RequestMessage, or ResponseMessage are NULL.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_REST_SEND_RECEIVE) (
+ IN EFI_REST_PROTOCOL *This,
+ IN EFI_HTTP_MESSAGE *RequestMessage,
+ OUT EFI_HTTP_MESSAGE *ResponseMessage
+ );
+
+/**
+ The GetServiceTime() function is an optional interface to obtain the current time from
+ this REST service instance. If this REST service does not support retrieving the time,
+ this function returns EFI_UNSUPPORTED.
+
+ @param[in] This Pointer to EFI_REST_PROTOCOL instance.
+ @param[out] Time A pointer to storage to receive a snapshot of the
+ current time of the REST service.
+
+ @retval EFI_SUCCESS Operation succeeded
+ @retval EFI_INVALID_PARAMETER This or Time are NULL.
+ @retval EFI_UNSUPPORTED The RESTful service does not support returning the
+ time.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_REST_GET_TIME) (
+ IN EFI_REST_PROTOCOL *This,
+ OUT EFI_TIME *Time
+ );
+
+///
+/// The EFI REST protocol is designed to be used by EFI drivers and applications to send
+/// and receive resources from a RESTful service. This protocol abstracts REST
+/// (Representational State Transfer) client functionality. This EFI protocol could be
+/// implemented to use an underlying EFI HTTP protocol, or it could rely on other
+/// interfaces that abstract HTTP access to the resources.
+///
+struct _EFI_REST_PROTOCOL {
+ EFI_REST_SEND_RECEIVE SendReceive;
+ EFI_REST_GET_TIME GetServiceTime;
+};
+
+extern EFI_GUID gEfiRestProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Rng.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Rng.h
new file mode 100644
index 0000000000..95cfdc95d7
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Rng.h
@@ -0,0 +1,156 @@
+/** @file
+ EFI_RNG_PROTOCOL as defined in UEFI 2.4.
+ The UEFI Random Number Generator Protocol is used to provide random bits for use
+ in applications, or entropy for seeding other random number generators.
+
+Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_RNG_PROTOCOL_H__
+#define __EFI_RNG_PROTOCOL_H__
+
+///
+/// Global ID for the Random Number Generator Protocol
+///
+#define EFI_RNG_PROTOCOL_GUID \
+ { \
+ 0x3152bca5, 0xeade, 0x433d, {0x86, 0x2e, 0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44 } \
+ }
+
+typedef struct _EFI_RNG_PROTOCOL EFI_RNG_PROTOCOL;
+
+///
+/// A selection of EFI_RNG_PROTOCOL algorithms.
+/// The algorithms listed are optional, not meant to be exhaustive and be argmented by
+/// vendors or other industry standards.
+///
+
+typedef EFI_GUID EFI_RNG_ALGORITHM;
+
+///
+/// The algorithms corresponds to SP800-90 as defined in
+/// NIST SP 800-90, "Recommendation for Random Number Generation Using Deterministic Random
+/// Bit Generators", March 2007.
+///
+#define EFI_RNG_ALGORITHM_SP800_90_HASH_256_GUID \
+ { \
+ 0xa7af67cb, 0x603b, 0x4d42, {0xba, 0x21, 0x70, 0xbf, 0xb6, 0x29, 0x3f, 0x96 } \
+ }
+#define EFI_RNG_ALGORITHM_SP800_90_HMAC_256_GUID \
+ { \
+ 0xc5149b43, 0xae85, 0x4f53, {0x99, 0x82, 0xb9, 0x43, 0x35, 0xd3, 0xa9, 0xe7 } \
+ }
+#define EFI_RNG_ALGORITHM_SP800_90_CTR_256_GUID \
+ { \
+ 0x44f0de6e, 0x4d8c, 0x4045, {0xa8, 0xc7, 0x4d, 0xd1, 0x68, 0x85, 0x6b, 0x9e } \
+ }
+///
+/// The algorithms correspond to X9.31 as defined in
+/// NIST, "Recommended Random Number Generator Based on ANSI X9.31 Appendix A.2.4 Using
+/// the 3-Key Triple DES and AES Algorithm", January 2005.
+///
+#define EFI_RNG_ALGORITHM_X9_31_3DES_GUID \
+ { \
+ 0x63c4785a, 0xca34, 0x4012, {0xa3, 0xc8, 0x0b, 0x6a, 0x32, 0x4f, 0x55, 0x46 } \
+ }
+#define EFI_RNG_ALGORITHM_X9_31_AES_GUID \
+ { \
+ 0xacd03321, 0x777e, 0x4d3d, {0xb1, 0xc8, 0x20, 0xcf, 0xd8, 0x88, 0x20, 0xc9 } \
+ }
+///
+/// The "raw" algorithm, when supported, is intended to provide entropy directly from
+/// the source, without it going through some deterministic random bit generator.
+///
+#define EFI_RNG_ALGORITHM_RAW \
+ { \
+ 0xe43176d7, 0xb6e8, 0x4827, {0xb7, 0x84, 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61 } \
+ }
+
+/**
+ Returns information about the random number generation implementation.
+
+ @param[in] This A pointer to the EFI_RNG_PROTOCOL instance.
+ @param[in,out] RNGAlgorithmListSize On input, the size in bytes of RNGAlgorithmList.
+ On output with a return code of EFI_SUCCESS, the size
+ in bytes of the data returned in RNGAlgorithmList. On output
+ with a return code of EFI_BUFFER_TOO_SMALL,
+ the size of RNGAlgorithmList required to obtain the list.
+ @param[out] RNGAlgorithmList A caller-allocated memory buffer filled by the driver
+ with one EFI_RNG_ALGORITHM element for each supported
+ RNG algorithm. The list must not change across multiple
+ calls to the same driver. The first algorithm in the list
+ is the default algorithm for the driver.
+
+ @retval EFI_SUCCESS The RNG algorithm list was returned successfully.
+ @retval EFI_UNSUPPORTED The services is not supported by this driver.
+ @retval EFI_DEVICE_ERROR The list of algorithms could not be retrieved due to a
+ hardware or firmware error.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
+ @retval EFI_BUFFER_TOO_SMALL The buffer RNGAlgorithmList is too small to hold the result.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_RNG_GET_INFO) (
+ IN EFI_RNG_PROTOCOL *This,
+ IN OUT UINTN *RNGAlgorithmListSize,
+ OUT EFI_RNG_ALGORITHM *RNGAlgorithmList
+ );
+
+/**
+ Produces and returns an RNG value using either the default or specified RNG algorithm.
+
+ @param[in] This A pointer to the EFI_RNG_PROTOCOL instance.
+ @param[in] RNGAlgorithm A pointer to the EFI_RNG_ALGORITHM that identifies the RNG
+ algorithm to use. May be NULL in which case the function will
+ use its default RNG algorithm.
+ @param[in] RNGValueLength The length in bytes of the memory buffer pointed to by
+ RNGValue. The driver shall return exactly this numbers of bytes.
+ @param[out] RNGValue A caller-allocated memory buffer filled by the driver with the
+ resulting RNG value.
+
+ @retval EFI_SUCCESS The RNG value was returned successfully.
+ @retval EFI_UNSUPPORTED The algorithm specified by RNGAlgorithm is not supported by
+ this driver.
+ @retval EFI_DEVICE_ERROR An RNG value could not be retrieved due to a hardware or
+ firmware error.
+ @retval EFI_NOT_READY There is not enough random data available to satisfy the length
+ requested by RNGValueLength.
+ @retval EFI_INVALID_PARAMETER RNGValue is NULL or RNGValueLength is zero.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_RNG_GET_RNG) (
+ IN EFI_RNG_PROTOCOL *This,
+ IN EFI_RNG_ALGORITHM *RNGAlgorithm, OPTIONAL
+ IN UINTN RNGValueLength,
+ OUT UINT8 *RNGValue
+ );
+
+///
+/// The Random Number Generator (RNG) protocol provides random bits for use in
+/// applications, or entropy for seeding other random number generators.
+///
+struct _EFI_RNG_PROTOCOL {
+ EFI_RNG_GET_INFO GetInfo;
+ EFI_RNG_GET_RNG GetRNG;
+};
+
+extern EFI_GUID gEfiRngProtocolGuid;
+extern EFI_GUID gEfiRngAlgorithmSp80090Hash256Guid;
+extern EFI_GUID gEfiRngAlgorithmSp80090Hmac256Guid;
+extern EFI_GUID gEfiRngAlgorithmSp80090Ctr256Guid;
+extern EFI_GUID gEfiRngAlgorithmX9313DesGuid;
+extern EFI_GUID gEfiRngAlgorithmX931AesGuid;
+extern EFI_GUID gEfiRngAlgorithmRaw;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Runtime.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Runtime.h
new file mode 100644
index 0000000000..21e9b75fb7
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Runtime.h
@@ -0,0 +1,128 @@
+/** @file
+ Runtime Architectural Protocol as defined in PI Specification VOLUME 2 DXE
+
+ Allows the runtime functionality of the DXE Foundation to be contained
+ in a separate driver. It also provides hooks for the DXE Foundation to
+ export information that is needed at runtime. As such, this protocol allows
+ services to the DXE Foundation to manage runtime drivers and events.
+ This protocol also implies that the runtime services required to transition
+ to virtual mode, SetVirtualAddressMap() and ConvertPointer(), have been
+ registered into the UEFI Runtime Table in the UEFI System Table. This protocol
+ must be produced by a runtime DXE driver and may only be consumed by the DXE Foundation.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARCH_PROTOCOL_RUNTIME_H__
+#define __ARCH_PROTOCOL_RUNTIME_H__
+
+///
+/// Global ID for the Runtime Architectural Protocol
+///
+#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \
+ { 0xb7dfb4e1, 0x52f, 0x449f, {0x87, 0xbe, 0x98, 0x18, 0xfc, 0x91, 0xb7, 0x33 } }
+
+typedef struct _EFI_RUNTIME_ARCH_PROTOCOL EFI_RUNTIME_ARCH_PROTOCOL;
+
+///
+/// LIST_ENTRY from BaseType
+///
+typedef LIST_ENTRY EFI_LIST_ENTRY;
+
+typedef struct _EFI_RUNTIME_IMAGE_ENTRY EFI_RUNTIME_IMAGE_ENTRY;
+
+///
+/// EFI_RUNTIME_IMAGE_ENTRY
+///
+struct _EFI_RUNTIME_IMAGE_ENTRY {
+ ///
+ /// Start of image that has been loaded in memory. It is a pointer
+ /// to either the DOS header or PE header of the image.
+ ///
+ VOID *ImageBase;
+ ///
+ /// Size in bytes of the image represented by ImageBase.
+ ///
+ UINT64 ImageSize;
+ ///
+ /// Information about the fix-ups that were performed on ImageBase when it was
+ /// loaded into memory.
+ ///
+ VOID *RelocationData;
+ ///
+ /// The ImageHandle passed into ImageBase when it was loaded.
+ ///
+ EFI_HANDLE Handle;
+ ///
+ /// Entry for this node in the EFI_RUNTIME_ARCHITECTURE_PROTOCOL.ImageHead list.
+ ///
+ EFI_LIST_ENTRY Link;
+};
+
+typedef struct _EFI_RUNTIME_EVENT_ENTRY EFI_RUNTIME_EVENT_ENTRY;
+
+///
+/// EFI_RUNTIME_EVENT_ENTRY
+///
+struct _EFI_RUNTIME_EVENT_ENTRY {
+ ///
+ /// The same as Type passed into CreateEvent().
+ ///
+ UINT32 Type;
+ ///
+ /// The same as NotifyTpl passed into CreateEvent().
+ ///
+ EFI_TPL NotifyTpl;
+ ///
+ /// The same as NotifyFunction passed into CreateEvent().
+ ///
+ EFI_EVENT_NOTIFY NotifyFunction;
+ ///
+ /// The same as NotifyContext passed into CreateEvent().
+ ///
+ VOID *NotifyContext;
+ ///
+ /// The EFI_EVENT returned by CreateEvent(). Event must be in runtime memory.
+ ///
+ EFI_EVENT *Event;
+ ///
+ /// Entry for this node in the
+ /// EFI_RUNTIME_ARCHITECTURE_PROTOCOL.EventHead list.
+ ///
+ EFI_LIST_ENTRY Link;
+};
+
+///
+/// Allows the runtime functionality of the DXE Foundation to be contained in a
+/// separate driver. It also provides hooks for the DXE Foundation to export
+/// information that is needed at runtime. As such, this protocol allows the DXE
+/// Foundation to manage runtime drivers and events. This protocol also implies
+/// that the runtime services required to transition to virtual mode,
+/// SetVirtualAddressMap() and ConvertPointer(), have been registered into the
+/// EFI Runtime Table in the EFI System Partition. This protocol must be produced
+/// by a runtime DXE driver and may only be consumed by the DXE Foundation.
+///
+struct _EFI_RUNTIME_ARCH_PROTOCOL {
+ EFI_LIST_ENTRY ImageHead; ///< A list of type EFI_RUNTIME_IMAGE_ENTRY.
+ EFI_LIST_ENTRY EventHead; ///< A list of type EFI_RUNTIME_EVENT_ENTRY.
+ UINTN MemoryDescriptorSize; ///< Size of a memory descriptor that is returned by GetMemoryMap().
+ UINT32 MemoryDesciptorVersion; ///< Version of a memory descriptor that is returned by GetMemoryMap().
+ UINTN MemoryMapSize;///< Size of the memory map in bytes contained in MemoryMapPhysical and MemoryMapVirtual.
+ EFI_MEMORY_DESCRIPTOR *MemoryMapPhysical; ///< Pointer to a runtime buffer that contains a copy of
+ ///< the memory map returned via GetMemoryMap().
+ EFI_MEMORY_DESCRIPTOR *MemoryMapVirtual; ///< Pointer to MemoryMapPhysical that is updated to virtual mode after SetVirtualAddressMap().
+ BOOLEAN VirtualMode; ///< Boolean that is TRUE if SetVirtualAddressMap() has been called.
+ BOOLEAN AtRuntime; ///< Boolean that is TRUE if ExitBootServices () has been called.
+};
+
+extern EFI_GUID gEfiRuntimeArchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/S3SaveState.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/S3SaveState.h
new file mode 100644
index 0000000000..c25e103f76
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/S3SaveState.h
@@ -0,0 +1,176 @@
+/** @file
+ S3 Save State Protocol as defined in PI1.2 Specification VOLUME 5 Standard.
+
+ This protocol is used by DXE PI module to store or record various IO operations
+ to be replayed during an S3 resume.
+ This protocol is not required for all platforms.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This PPI is defined in UEFI Platform Initialization Specification 1.2 Volume 5:
+ Standards
+
+**/
+
+#ifndef __S3_SAVE_STATE_H__
+#define __S3_SAVE_STATE_H__
+
+#define EFI_S3_SAVE_STATE_PROTOCOL_GUID \
+ { 0xe857caf6, 0xc046, 0x45dc, { 0xbe, 0x3f, 0xee, 0x7, 0x65, 0xfb, 0xa8, 0x87 }}
+
+
+typedef VOID *EFI_S3_BOOT_SCRIPT_POSITION;
+
+typedef struct _EFI_S3_SAVE_STATE_PROTOCOL EFI_S3_SAVE_STATE_PROTOCOL;
+
+/**
+ Record operations that need to be replayed during an S3 resume.
+
+ This function is used to store an OpCode to be replayed as part of the S3 resume boot path. It is
+ assumed this protocol has platform specific mechanism to store the OpCode set and replay them
+ during the S3 resume.
+
+ @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance.
+ @param[in] OpCode The operation code (opcode) number.
+ @param[in] ... Argument list that is specific to each opcode. See the following subsections for the
+ definition of each opcode.
+
+ @retval EFI_SUCCESS The operation succeeded. A record was added into the specified
+ script table.
+ @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.
+ @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_S3_SAVE_STATE_WRITE)(
+ IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This,
+ IN UINT16 OpCode,
+ ...
+);
+
+/**
+ Record operations that need to be replayed during an S3 resume.
+
+ This function is used to store an OpCode to be replayed as part of the S3 resume boot path. It is
+ assumed this protocol has platform specific mechanism to store the OpCode set and replay them
+ during the S3 resume.
+ The opcode is inserted before or after the specified position in the boot script table. If Position is
+ NULL then that position is after the last opcode in the table (BeforeOrAfter is TRUE) or before
+ the first opcode in the table (BeforeOrAfter is FALSE). The position which is pointed to by
+ Position upon return can be used for subsequent insertions.
+
+ This function has a variable parameter list. The exact parameter list depends on the OpCode that is
+ passed into the function. If an unsupported OpCode or illegal parameter list is passed in, this
+ function returns EFI_INVALID_PARAMETER.
+ If there are not enough resources available for storing more scripts, this function returns
+ EFI_OUT_OF_RESOURCES.
+ OpCode values of 0x80 - 0xFE are reserved for implementation specific functions.
+
+ @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance.
+ @param[in] BeforeOrAfter Specifies whether the opcode is stored before (TRUE) or after (FALSE) the position
+ in the boot script table specified by Position. If Position is NULL or points to
+ NULL then the new opcode is inserted at the beginning of the table (if TRUE) or end
+ of the table (if FALSE).
+ @param[in, out] Position On entry, specifies the position in the boot script table where the opcode will be
+ inserted, either before or after, depending on BeforeOrAfter. On exit, specifies
+ the position of the inserted opcode in the boot script table.
+ @param[in] OpCode The operation code (opcode) number. See "Related Definitions" in Write() for the
+ defined opcode types.
+ @param[in] ... Argument list that is specific to each opcode. See the following subsections for the
+ definition of each opcode.
+
+ @retval EFI_SUCCESS The operation succeeded. An opcode was added into the script.
+ @retval EFI_INVALID_PARAMETER The Opcode is an invalid opcode value.
+ @retval EFI_INVALID_PARAMETER The Position is not a valid position in the boot script table.
+ @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script table.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_S3_SAVE_STATE_INSERT)(
+ IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This,
+ IN BOOLEAN BeforeOrAfter,
+ IN OUT EFI_S3_BOOT_SCRIPT_POSITION *Position OPTIONAL,
+ IN UINT16 OpCode,
+ ...
+);
+
+/**
+ Find a label within the boot script table and, if not present, optionally create it.
+
+ If the label Label is already exists in the boot script table, then no new label is created, the
+ position of the Label is returned in *Position and EFI_SUCCESS is returned.
+ If the label Label does not already exist and CreateIfNotFound is TRUE, then it will be
+ created before or after the specified position and EFI_SUCCESS is returned.
+ If the label Label does not already exist and CreateIfNotFound is FALSE, then
+ EFI_NOT_FOUND is returned.
+
+ @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance.
+ @param[in] BeforeOrAfter Specifies whether the label is stored before (TRUE) or after (FALSE) the position in
+ the boot script table specified by Position. If Position is NULL or points to
+ NULL then the new label is inserted at the beginning of the table (if TRUE) or end of
+ the table (if FALSE).
+ @param[in] CreateIfNotFound Specifies whether the label will be created if the label does not exists (TRUE) or not (FALSE).
+ @param[in, out] Position On entry, specifies the position in the boot script table where the label will be inserted,
+ either before or after, depending on BeforeOrAfter. On exit, specifies the position
+ of the inserted label in the boot script table.
+ @param[in] Label Points to the label which will be inserted in the boot script table.
+
+ @retval EFI_SUCCESS The label already exists or was inserted.
+ @retval EFI_NOT_FOUND The label did not already exist and CreateifNotFound was FALSE.
+ @retval EFI_INVALID_PARAMETER The Label is NULL or points to an empty string.
+ @retval EFI_INVALID_PARAMETER The Position is not a valid position in the boot script table.
+ @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_S3_SAVE_STATE_LABEL)(
+ IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This,
+ IN BOOLEAN BeforeOrAfter,
+ IN BOOLEAN CreateIfNotFound,
+ IN OUT EFI_S3_BOOT_SCRIPT_POSITION *Position OPTIONAL,
+ IN CONST CHAR8 *Label
+);
+
+/**
+ Compare two positions in the boot script table and return their relative position.
+
+ This function compares two positions in the boot script table and returns their relative positions. If
+ Position1 is before Position2, then -1 is returned. If Position1 is equal to Position2,
+ then 0 is returned. If Position1 is after Position2, then 1 is returned.
+
+ @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance.
+ @param[in] Position1 The positions in the boot script table to compare.
+ @param[in] Position2 The positions in the boot script table to compare.
+ @param[out] RelativePosition On return, points to the result of the comparison.
+
+ @retval EFI_SUCCESS The operation succeeded.
+ @retval EFI_INVALID_PARAMETER The Position1 or Position2 is not a valid position in the boot script table.
+ @retval EFI_INVALID_PARAMETER The RelativePosition is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_S3_SAVE_STATE_COMPARE)(
+ IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This,
+ IN EFI_S3_BOOT_SCRIPT_POSITION Position1,
+ IN EFI_S3_BOOT_SCRIPT_POSITION Position2,
+ OUT UINTN *RelativePosition
+);
+
+struct _EFI_S3_SAVE_STATE_PROTOCOL {
+ EFI_S3_SAVE_STATE_WRITE Write;
+ EFI_S3_SAVE_STATE_INSERT Insert;
+ EFI_S3_SAVE_STATE_LABEL Label;
+ EFI_S3_SAVE_STATE_COMPARE Compare;
+};
+
+extern EFI_GUID gEfiS3SaveStateProtocolGuid;
+
+#endif // __S3_SAVE_STATE_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/S3SmmSaveState.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/S3SmmSaveState.h
new file mode 100644
index 0000000000..3cdfec7a17
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/S3SmmSaveState.h
@@ -0,0 +1,46 @@
+/** @file
+ S3 SMM Save State Protocol as defined in PI1.2 Specification VOLUME 5 Standard.
+
+ The EFI_S3_SMM_SAVE_STATE_PROTOCOL publishes the PI SMMboot script abstractions
+ On an S3 resume boot path the data stored via this protocol is replayed in the order it was stored.
+ The order of replay is the order either of the S3 Save State Protocol or S3 SMM Save State Protocol
+ Write() functions were called during the boot process. Insert(), Label(), and
+ Compare() operations are ordered relative other S3 SMM Save State Protocol write() operations
+ and the order relative to S3 State Save Write() operations is not defined. Due to these ordering
+ restrictions it is recommended that the S3 State Save Protocol be used during the DXE phase when
+ every possible.
+ The EFI_S3_SMM_SAVE_STATE_PROTOCOL can be called at runtime and
+ EFI_OUT_OF_RESOURCES may be returned from a runtime call. It is the responsibility of the
+ platform to ensure enough memory resource exists to save the system state. It is recommended that
+ runtime calls be minimized by the caller.
+
+ Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This PPI is defined in UEFI Platform Initialization Specification 1.2 Volume 5:
+ Standards
+
+**/
+
+#ifndef __S3_SMM_SAVE_STATE_H__
+#define __S3_SMM_SAVE_STATE_H__
+
+#include <Protocol/S3SaveState.h>
+
+#define EFI_S3_SMM_SAVE_STATE_PROTOCOL_GUID \
+ {0x320afe62, 0xe593, 0x49cb, { 0xa9, 0xf1, 0xd4, 0xc2, 0xf4, 0xaf, 0x1, 0x4c }}
+
+
+typedef EFI_S3_SAVE_STATE_PROTOCOL EFI_S3_SMM_SAVE_STATE_PROTOCOL;
+
+extern EFI_GUID gEfiS3SmmSaveStateProtocolGuid;
+
+#endif // __S3_SMM_SAVE_STATE_H__
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ScsiIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ScsiIo.h
new file mode 100644
index 0000000000..833fb1ceef
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ScsiIo.h
@@ -0,0 +1,317 @@
+/** @file
+ EFI_SCSI_IO_PROTOCOL as defined in UEFI 2.0.
+ This protocol is used by code, typically drivers, running in the EFI boot
+ services environment to access SCSI devices. In particular, functions for
+ managing devices on SCSI buses are defined here.
+
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_SCSI_IO_PROTOCOL_H__
+#define __EFI_SCSI_IO_PROTOCOL_H__
+
+#define EFI_SCSI_IO_PROTOCOL_GUID \
+ { \
+ 0x932f47e6, 0x2362, 0x4002, {0x80, 0x3e, 0x3c, 0xd5, 0x4b, 0x13, 0x8f, 0x85 } \
+ }
+
+///
+/// Forward reference for pure ANSI compatability
+///
+typedef struct _EFI_SCSI_IO_PROTOCOL EFI_SCSI_IO_PROTOCOL;
+
+//
+// SCSI Device type information, defined in the SCSI Primary Commands standard (e.g., SPC-4)
+//
+#define EFI_SCSI_IO_TYPE_DISK 0x00 ///< Disk device
+#define EFI_SCSI_IO_TYPE_TAPE 0x01 ///< Tape device
+#define EFI_SCSI_IO_TYPE_PRINTER 0x02 ///< Printer
+#define EFI_SCSI_IO_TYPE_PROCESSOR 0x03 ///< Processor
+#define EFI_SCSI_IO_TYPE_WORM 0x04 ///< Write-once read-multiple
+#define EFI_SCSI_IO_TYPE_CDROM 0x05 ///< CD or DVD device
+#define EFI_SCSI_IO_TYPE_SCANNER 0x06 ///< Scanner device
+#define EFI_SCSI_IO_TYPE_OPTICAL 0x07 ///< Optical memory device
+#define EFI_SCSI_IO_TYPE_MEDIUMCHANGER 0x08 ///< Medium Changer device
+#define EFI_SCSI_IO_TYPE_COMMUNICATION 0x09 ///< Communications device
+#define MFI_SCSI_IO_TYPE_A 0x0A ///< Obsolete
+#define MFI_SCSI_IO_TYPE_B 0x0B ///< Obsolete
+#define MFI_SCSI_IO_TYPE_RAID 0x0C ///< Storage array controller device (e.g., RAID)
+#define MFI_SCSI_IO_TYPE_SES 0x0D ///< Enclosure services device
+#define MFI_SCSI_IO_TYPE_RBC 0x0E ///< Simplified direct-access device (e.g., magnetic disk)
+#define MFI_SCSI_IO_TYPE_OCRW 0x0F ///< Optical card reader/writer device
+#define MFI_SCSI_IO_TYPE_BRIDGE 0x10 ///< Bridge Controller Commands
+#define MFI_SCSI_IO_TYPE_OSD 0x11 ///< Object-based Storage Device
+#define EFI_SCSI_IO_TYPE_RESERVED_LOW 0x12 ///< Reserved (low)
+#define EFI_SCSI_IO_TYPE_RESERVED_HIGH 0x1E ///< Reserved (high)
+#define EFI_SCSI_IO_TYPE_UNKNOWN 0x1F ///< Unknown no device type
+
+//
+// SCSI Data Direction definition
+//
+#define EFI_SCSI_IO_DATA_DIRECTION_READ 0
+#define EFI_SCSI_IO_DATA_DIRECTION_WRITE 1
+#define EFI_SCSI_IO_DATA_DIRECTION_BIDIRECTIONAL 2
+
+//
+// SCSI Host Adapter Status definition
+//
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_OK 0x00
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND 0x09 ///< timeout when processing the command
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_TIMEOUT 0x0b ///< timeout when waiting for the command processing
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_MESSAGE_REJECT 0x0d ///< a message reject was received when processing command
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_BUS_RESET 0x0e ///< a bus reset was detected
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_PARITY_ERROR 0x0f
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED 0x10 ///< the adapter failed in issuing request sense command
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT 0x11 ///< selection timeout
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN 0x12 ///< data overrun or data underrun
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_BUS_FREE 0x13 ///< Unexepected bus free
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_PHASE_ERROR 0x14 ///< Target bus phase sequence failure
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_OTHER 0x7f
+
+
+//
+// SCSI Target Status definition
+//
+#define EFI_SCSI_IO_STATUS_TARGET_GOOD 0x00
+#define EFI_SCSI_IO_STATUS_TARGET_CHECK_CONDITION 0x02 ///< check condition
+#define EFI_SCSI_IO_STATUS_TARGET_CONDITION_MET 0x04 ///< condition met
+#define EFI_SCSI_IO_STATUS_TARGET_BUSY 0x08 ///< busy
+#define EFI_SCSI_IO_STATUS_TARGET_INTERMEDIATE 0x10 ///< intermediate
+#define EFI_SCSI_IO_STATUS_TARGET_INTERMEDIATE_CONDITION_MET 0x14 ///< intermediate-condition met
+#define EFI_SCSI_IO_STATUS_TARGET_RESERVATION_CONFLICT 0x18 ///< reservation conflict
+#define EFI_SCSI_IO_STATUS_TARGET_COMMOND_TERMINATED 0x22 ///< command terminated
+#define EFI_SCSI_IO_STATUS_TARGET_QUEUE_FULL 0x28 ///< queue full
+
+typedef struct {
+ ///
+ /// The timeout, in 100 ns units, to use for the execution of this SCSI
+ /// Request Packet. A Timeout value of 0 means that this function
+ /// will wait indefinitely for the SCSI Request Packet to execute. If
+ /// Timeout is greater than zero, then this function will return
+ /// EFI_TIMEOUT if the time required to execute the SCSI Request
+ /// Packet is greater than Timeout.
+ ///
+ UINT64 Timeout;
+ ///
+ /// A pointer to the data buffer to transfer between the SCSI
+ /// controller and the SCSI device for SCSI READ command
+ ///
+ VOID *InDataBuffer;
+ ///
+ /// A pointer to the data buffer to transfer between the SCSI
+ /// controller and the SCSI device for SCSI WRITE command.
+ ///
+ VOID *OutDataBuffer;
+ ///
+ /// A pointer to the sense data that was generated by the execution of
+ /// the SCSI Request Packet.
+ ///
+ VOID *SenseData;
+ ///
+ /// A pointer to buffer that contains the Command Data Block to
+ /// send to the SCSI device.
+ ///
+ VOID *Cdb;
+ ///
+ /// On Input, the size, in bytes, of InDataBuffer. On output, the
+ /// number of bytes transferred between the SCSI controller and the SCSI device.
+ ///
+ UINT32 InTransferLength;
+ ///
+ /// On Input, the size, in bytes of OutDataBuffer. On Output, the
+ /// Number of bytes transferred between SCSI Controller and the SCSI device.
+ ///
+ UINT32 OutTransferLength;
+ ///
+ /// The length, in bytes, of the buffer Cdb. The standard values are
+ /// 6, 10, 12, and 16, but other values are possible if a variable length CDB is used.
+ ///
+ UINT8 CdbLength;
+ ///
+ /// The direction of the data transfer. 0 for reads, 1 for writes. A
+ /// value of 2 is Reserved for Bi-Directional SCSI commands.
+ ///
+ UINT8 DataDirection;
+ ///
+ /// The status of the SCSI Host Controller that produces the SCSI
+ /// bus where the SCSI device attached when the SCSI Request
+ /// Packet was executed on the SCSI Controller.
+ ///
+ UINT8 HostAdapterStatus;
+ ///
+ /// The status returned by the SCSI device when the SCSI Request
+ /// Packet was executed.
+ ///
+ UINT8 TargetStatus;
+ ///
+ /// On input, the length in bytes of the SenseData buffer. On
+ /// output, the number of bytes written to the SenseData buffer.
+ ///
+ UINT8 SenseDataLength;
+} EFI_SCSI_IO_SCSI_REQUEST_PACKET;
+
+/**
+ Retrieves the device type information of the SCSI Controller.
+
+ @param This Protocol instance pointer.
+ @param DeviceType A pointer to the device type information
+ retrieved from the SCSI Controller.
+
+ @retval EFI_SUCCESS Retrieved the device type information successfully.
+ @retval EFI_INVALID_PARAMETER The DeviceType is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SCSI_IO_PROTOCOL_GET_DEVICE_TYPE)(
+ IN EFI_SCSI_IO_PROTOCOL *This,
+ OUT UINT8 *DeviceType
+ );
+
+/**
+ Retrieves the device location in the SCSI channel.
+
+ @param This Protocol instance pointer.
+ @param Target A pointer to the Target ID of a SCSI device
+ on the SCSI channel.
+ @param Lun A pointer to the LUN of the SCSI device on
+ the SCSI channel.
+
+ @retval EFI_SUCCESS Retrieves the device location successfully.
+ @retval EFI_INVALID_PARAMETER The Target or Lun is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SCSI_IO_PROTOCOL_GET_DEVICE_LOCATION)(
+ IN EFI_SCSI_IO_PROTOCOL *This,
+ IN OUT UINT8 **Target,
+ OUT UINT64 *Lun
+ );
+
+/**
+ Resets the SCSI Bus that the SCSI Controller is attached to.
+
+ @param This Protocol instance pointer.
+
+ @retval EFI_SUCCESS The SCSI bus is reset successfully.
+ @retval EFI_DEVICE_ERROR Errors encountered when resetting the SCSI bus.
+ @retval EFI_UNSUPPORTED The bus reset operation is not supported by the
+ SCSI Host Controller.
+ @retval EFI_TIMEOUT A timeout occurred while attempting to reset
+ the SCSI bus.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SCSI_IO_PROTOCOL_RESET_BUS)(
+ IN EFI_SCSI_IO_PROTOCOL *This
+ );
+
+/**
+ Resets the SCSI Controller that the device handle specifies.
+
+ @param This Protocol instance pointer.
+
+ @retval EFI_SUCCESS Reset the SCSI controller successfully.
+ @retval EFI_DEVICE_ERROR Errors were encountered when resetting the
+ SCSI Controller.
+ @retval EFI_UNSUPPORTED The SCSI bus does not support a device
+ reset operation.
+ @retval EFI_TIMEOUT A timeout occurred while attempting to
+ reset the SCSI Controller.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SCSI_IO_PROTOCOL_RESET_DEVICE)(
+ IN EFI_SCSI_IO_PROTOCOL *This
+ );
+
+
+/**
+ Sends a SCSI Request Packet to the SCSI Controller for execution.
+
+ @param This Protocol instance pointer.
+ @param Packet The SCSI request packet to send to the SCSI
+ Controller specified by the device handle.
+ @param Event If the SCSI bus to which the SCSI device is attached
+ does not support non-blocking I/O, then Event is
+ ignored, and blocking I/O is performed.
+ If Event is NULL, then blocking I/O is performed.
+ If Event is not NULL and non-blocking I/O is
+ supported, then non-blocking I/O is performed,
+ and Event will be signaled when the SCSI Request
+ Packet completes.
+
+ @retval EFI_SUCCESS The SCSI Request Packet was sent by the host
+ successfully, and TransferLength bytes were
+ transferred to/from DataBuffer. See
+ HostAdapterStatus, TargetStatus,
+ SenseDataLength, and SenseData in that order
+ for additional status information.
+ @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
+ but the entire DataBuffer could not be transferred.
+ The actual number of bytes transferred is returned
+ in TransferLength. See HostAdapterStatus,
+ TargetStatus, SenseDataLength, and SenseData in
+ that order for additional status information.
+ @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
+ there are too many SCSI Command Packets already
+ queued.The caller may retry again later.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to send
+ the SCSI Request Packet. See HostAdapterStatus,
+ TargetStatus, SenseDataLength, and SenseData in
+ that order for additional status information.
+ @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid.
+ The SCSI Request Packet was not sent, so no
+ additional status information is available.
+ @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
+ is not supported by the SCSI initiator(i.e., SCSI
+ Host Controller). The SCSI Request Packet was not
+ sent, so no additional status information is
+ available.
+ @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI
+ Request Packet to execute. See HostAdapterStatus,
+ TargetStatus, SenseDataLength, and SenseData in
+ that order for additional status information.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SCSI_IO_PROTOCOL_EXEC_SCSI_COMMAND)(
+ IN EFI_SCSI_IO_PROTOCOL *This,
+ IN OUT EFI_SCSI_IO_SCSI_REQUEST_PACKET *Packet,
+ IN EFI_EVENT Event OPTIONAL
+ );
+
+///
+/// Provides services to manage and communicate with SCSI devices.
+///
+struct _EFI_SCSI_IO_PROTOCOL {
+ EFI_SCSI_IO_PROTOCOL_GET_DEVICE_TYPE GetDeviceType;
+ EFI_SCSI_IO_PROTOCOL_GET_DEVICE_LOCATION GetDeviceLocation;
+ EFI_SCSI_IO_PROTOCOL_RESET_BUS ResetBus;
+ EFI_SCSI_IO_PROTOCOL_RESET_DEVICE ResetDevice;
+ EFI_SCSI_IO_PROTOCOL_EXEC_SCSI_COMMAND ExecuteScsiCommand;
+
+ ///
+ /// Supplies the alignment requirement for any buffer used in a data transfer.
+ /// IoAlign values of 0 and 1 mean that the buffer can be placed anywhere in memory.
+ /// Otherwise, IoAlign must be a power of 2, and the requirement is that the
+ /// start address of a buffer must be evenly divisible by IoAlign with no remainder.
+ ///
+ UINT32 IoAlign;
+};
+
+extern EFI_GUID gEfiScsiIoProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ScsiPassThru.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ScsiPassThru.h
new file mode 100644
index 0000000000..baf0d2bfc7
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ScsiPassThru.h
@@ -0,0 +1,383 @@
+/** @file
+ SCSI Pass Through protocol as defined in EFI 1.1.
+ This protocol allows information about a SCSI channel to be collected,
+ and allows SCSI Request Packets to be sent to any SCSI devices on a SCSI
+ channel even if those devices are not boot devices. This protocol is attached
+ to the device handle of each SCSI channel in a system that the protocol
+ supports, and can be used for diagnostics. It may also be used to build
+ a Block I/O driver for SCSI hard drives and SCSI CD-ROM or DVD drives to
+ allow those devices to become boot devices.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SCSI_PASS_THROUGH_H__
+#define __SCSI_PASS_THROUGH_H__
+
+#define EFI_SCSI_PASS_THRU_PROTOCOL_GUID \
+ { \
+ 0xa59e8fcf, 0xbda0, 0x43bb, {0x90, 0xb1, 0xd3, 0x73, 0x2e, 0xca, 0xa8, 0x77 } \
+ }
+
+///
+/// Forward reference for pure ANSI compatability
+///
+typedef struct _EFI_SCSI_PASS_THRU_PROTOCOL EFI_SCSI_PASS_THRU_PROTOCOL;
+
+#define EFI_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001
+#define EFI_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002
+#define EFI_SCSI_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004
+
+//
+// SCSI Host Adapter Status definition
+//
+#define EFI_SCSI_STATUS_HOST_ADAPTER_OK 0x00
+#define EFI_SCSI_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND 0x09 // timeout when processing the command
+#define EFI_SCSI_STATUS_HOST_ADAPTER_TIMEOUT 0x0b // timeout when waiting for the command processing
+#define EFI_SCSI_STATUS_HOST_ADAPTER_MESSAGE_REJECT 0x0d // a message reject was received when processing command
+#define EFI_SCSI_STATUS_HOST_ADAPTER_BUS_RESET 0x0e // a bus reset was detected
+#define EFI_SCSI_STATUS_HOST_ADAPTER_PARITY_ERROR 0x0f
+#define EFI_SCSI_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED 0x10 // the adapter failed in issuing request sense command
+#define EFI_SCSI_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT 0x11 // selection timeout
+#define EFI_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN 0x12 // data overrun or data underrun
+#define EFI_SCSI_STATUS_HOST_ADAPTER_BUS_FREE 0x13 // Unexepected bus free
+#define EFI_SCSI_STATUS_HOST_ADAPTER_PHASE_ERROR 0x14 // Target bus phase sequence failure
+#define EFI_SCSI_STATUS_HOST_ADAPTER_OTHER 0x7f
+
+//
+// SCSI Target Status definition
+//
+#define EFI_SCSI_STATUS_TARGET_GOOD 0x00
+#define EFI_SCSI_STATUS_TARGET_CHECK_CONDITION 0x02 // check condition
+#define EFI_SCSI_STATUS_TARGET_CONDITION_MET 0x04 // condition met
+#define EFI_SCSI_STATUS_TARGET_BUSY 0x08 // busy
+#define EFI_SCSI_STATUS_TARGET_INTERMEDIATE 0x10 // intermediate
+#define EFI_SCSI_STATUS_TARGET_INTERMEDIATE_CONDITION_MET 0x14 // intermediate-condition met
+#define EFI_SCSI_STATUS_TARGET_RESERVATION_CONFLICT 0x18 // reservation conflict
+#define EFI_SCSI_STATUS_TARGET_COMMOND_TERMINATED 0x22 // command terminated
+#define EFI_SCSI_STATUS_TARGET_QUEUE_FULL 0x28 // queue full
+
+typedef struct {
+ ///
+ /// The timeout, in 100 ns units, to use for the execution of this SCSI
+ /// Request Packet. A Timeout value of 0 means that this function
+ /// will wait indefinitely for the SCSI Request Packet to execute. If
+ /// Timeout is greater than zero, then this function will return
+ /// EFI_TIMEOUT if the time required to execute the SCSI Request
+ /// Packet is greater than Timeout.
+ ///
+ UINT64 Timeout;
+ ///
+ /// A pointer to the data buffer to transfer between the SCSI
+ /// controller and the SCSI device. Must be aligned to the boundary
+ /// specified in the IoAlign field of the
+ /// EFI_SCSI_PASS_THRU_MODE structure.
+ ///
+ VOID *DataBuffer;
+ ///
+ /// A pointer to the sense data that was generated by the execution of
+ /// the SCSI Request Packet.
+ ///
+ VOID *SenseData;
+ ///
+ /// A pointer to buffer that contains the Command Data Block to
+ /// send to the SCSI device.
+ ///
+ VOID *Cdb;
+ ///
+ /// On Input, the size, in bytes, of InDataBuffer. On output, the
+ /// number of bytes transferred between the SCSI controller and the SCSI device.
+ ///
+ UINT32 TransferLength;
+ ///
+ /// The length, in bytes, of the buffer Cdb. The standard values are
+ /// 6, 10, 12, and 16, but other values are possible if a variable length CDB is used.
+ ///
+ UINT8 CdbLength;
+ ///
+ /// The direction of the data transfer. 0 for reads, 1 for writes. A
+ /// value of 2 is Reserved for Bi-Directional SCSI commands.
+ ///
+ UINT8 DataDirection;
+ ///
+ /// The status of the SCSI Host Controller that produces the SCSI
+ /// bus where the SCSI device attached when the SCSI Request
+ /// Packet was executed on the SCSI Controller.
+ ///
+ UINT8 HostAdapterStatus;
+ ///
+ /// The status returned by the SCSI device when the SCSI Request
+ /// Packet was executed.
+ ///
+ UINT8 TargetStatus;
+ ///
+ /// On input, the length in bytes of the SenseData buffer. On
+ /// output, the number of bytes written to the SenseData buffer.
+ ///
+ UINT8 SenseDataLength;
+} EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET;
+
+typedef struct {
+ ///
+ /// A Null-terminated Unicode string that represents the printable name of the SCSI controller.
+ ///
+ CHAR16 *ControllerName;
+ ///
+ /// A Null-terminated Unicode string that represents the printable name of the SCSI channel.
+ ///
+ CHAR16 *ChannelName;
+ ///
+ /// The Target ID of the host adapter on the SCSI channel.
+ ///
+ UINT32 AdapterId;
+ ///
+ /// Additional information on the attributes of the SCSI channel.
+ ///
+ UINT32 Attributes;
+ ///
+ /// Supplies the alignment requirement for any buffer used in a data transfer.
+ ///
+ UINT32 IoAlign;
+} EFI_SCSI_PASS_THRU_MODE;
+
+/**
+ Sends a SCSI Request Packet to a SCSI device that is attached to
+ the SCSI channel. This function supports both blocking I/O and
+ non-blocking I/O. The blocking I/O functionality is required,
+ and the non-blocking I/O functionality is optional.
+
+ @param This Protocol instance pointer.
+ @param Target The Target ID of the SCSI device to
+ send the SCSI Request Packet.
+ @param Lun The LUN of the SCSI device to send the
+ SCSI Request Packet.
+ @param Packet A pointer to the SCSI Request Packet to send
+ to the SCSI device specified by Target and Lun.
+ @param Event If non-blocking I/O is not supported then Event
+ is ignored, and blocking I/O is performed.
+ If Event is NULL, then blocking I/O is performed.
+ If Event is not NULL and non blocking I/O is
+ supported, then non-blocking I/O is performed,
+ and Event will be signaled when the SCSI Request
+ Packet completes
+
+ @retval EFI_SUCCESS The SCSI Request Packet was sent by the host, and
+ TransferLength bytes were transferred to/from
+ DataBuffer. See HostAdapterStatus, TargetStatus,
+ SenseDataLength, and SenseData in that order
+ for additional status information.
+ @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the
+ entire DataBuffer could not be transferred.
+ The actual number of bytes transferred is returned
+ in TransferLength. See HostAdapterStatus,
+ TargetStatus, SenseDataLength, and SenseData in
+ that order for additional status information.
+ @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
+ there are too many SCSI Request Packets already
+ queued. The caller may retry again later.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to send
+ the SCSI Request Packet. See HostAdapterStatus,
+ TargetStatus, SenseDataLength, and SenseData in
+ that order for additional status information.
+ @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket
+ are invalid. The SCSI Request Packet was not sent,
+ so no additional status information is available.
+ @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
+ is not supported by the host adapter. The SCSI
+ Request Packet was not sent, so no additional
+ status information is available.
+ @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI
+ Request Packet to execute. See HostAdapterStatus,
+ TargetStatus, SenseDataLength, and SenseData in
+ that order for additional status information.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SCSI_PASS_THRU_PASSTHRU)(
+ IN EFI_SCSI_PASS_THRU_PROTOCOL *This,
+ IN UINT32 Target,
+ IN UINT64 Lun,
+ IN OUT EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet,
+ IN EFI_EVENT Event OPTIONAL
+ );
+
+/**
+ Used to retrieve the list of legal Target IDs for SCSI devices
+ on a SCSI channel.
+
+ @param This Protocol instance pointer.
+ @param Target On input, a pointer to the Target ID of a
+ SCSI device present on the SCSI channel.
+ On output, a pointer to the Target ID of
+ the next SCSI device present on a SCSI channel.
+ An input value of 0xFFFFFFFF retrieves the
+ Target ID of the first SCSI device present on
+ a SCSI channel.
+ @param Lun On input, a pointer to the LUN of a SCSI device
+ present on the SCSI channel. On output, a pointer
+ to the LUN of the next SCSI device present on a
+ SCSI channel.
+
+ @retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI
+ channel was returned in Target and Lun.
+ @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
+ @retval EFI_INVALID_PARAMETER Target is not 0xFFFFFFFF, and Target and Lun were
+ not returned on a previous call to GetNextDevice().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SCSI_PASS_THRU_GET_NEXT_DEVICE)(
+ IN EFI_SCSI_PASS_THRU_PROTOCOL *This,
+ IN OUT UINT32 *Target,
+ IN OUT UINT64 *Lun
+ );
+
+/**
+ Used to allocate and build a device path node for a SCSI device
+ on a SCSI channel.
+
+ @param This Protocol instance pointer.
+ @param Target The Target ID of the SCSI device for which
+ a device path node is to be allocated and built.
+ @param Lun The LUN of the SCSI device for which a device
+ path node is to be allocated and built.
+ @param DevicePath A pointer to a single device path node that
+ describes the SCSI device specified by
+ Target and Lun. This function is responsible
+ for allocating the buffer DevicePath with the boot
+ service AllocatePool(). It is the caller's
+ responsibility to free DevicePath when the caller
+ is finished with DevicePath.
+
+ @retval EFI_SUCCESS The device path node that describes the SCSI device
+ specified by Target and Lun was allocated and
+ returned in DevicePath.
+ @retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does
+ not exist on the SCSI channel.
+ @retval EFI_INVALID_PARAMETER DevicePath is NULL.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate
+ DevicePath.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SCSI_PASS_THRU_BUILD_DEVICE_PATH)(
+ IN EFI_SCSI_PASS_THRU_PROTOCOL *This,
+ IN UINT32 Target,
+ IN UINT64 Lun,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
+ );
+
+/**
+ Used to translate a device path node to a Target ID and LUN.
+
+ @param This Protocol instance pointer.
+ @param DevicePath A pointer to the device path node that
+ describes a SCSI device on the SCSI channel.
+ @param Target A pointer to the Target ID of a SCSI device
+ on the SCSI channel.
+ @param Lun A pointer to the LUN of a SCSI device on
+ the SCSI channel.
+
+ @retval EFI_SUCCESS DevicePath was successfully translated to a
+ Target ID and LUN, and they were returned
+ in Target and Lun.
+ @retval EFI_INVALID_PARAMETER DevicePath is NULL.
+ @retval EFI_INVALID_PARAMETER Target is NULL.
+ @retval EFI_INVALID_PARAMETER Lun is NULL.
+ @retval EFI_UNSUPPORTED This driver does not support the device path
+ node type in DevicePath.
+ @retval EFI_NOT_FOUND A valid translation from DevicePath to a
+ Target ID and LUN does not exist.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SCSI_PASS_THRU_GET_TARGET_LUN)(
+ IN EFI_SCSI_PASS_THRU_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ OUT UINT32 *Target,
+ OUT UINT64 *Lun
+ );
+
+/**
+ Resets a SCSI channel.This operation resets all the
+ SCSI devices connected to the SCSI channel.
+
+ @param This Protocol instance pointer.
+
+ @retval EFI_SUCCESS The SCSI channel was reset.
+ @retval EFI_UNSUPPORTED The SCSI channel does not support
+ a channel reset operation.
+ @retval EFI_DEVICE_ERROR A device error occurred while
+ attempting to reset the SCSI channel.
+ @retval EFI_TIMEOUT A timeout occurred while attempting
+ to reset the SCSI channel.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SCSI_PASS_THRU_RESET_CHANNEL)(
+ IN EFI_SCSI_PASS_THRU_PROTOCOL *This
+ );
+
+/**
+ Resets a SCSI device that is connected to a SCSI channel.
+
+ @param This Protocol instance pointer.
+ @param Target The Target ID of the SCSI device to reset.
+ @param Lun The LUN of the SCSI device to reset.
+
+ @retval EFI_SUCCESS The SCSI device specified by Target and
+ Lun was reset.
+ @retval EFI_UNSUPPORTED The SCSI channel does not support a target
+ reset operation.
+ @retval EFI_INVALID_PARAMETER Target or Lun are invalid.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting
+ to reset the SCSI device specified by Target
+ and Lun.
+ @retval EFI_TIMEOUT A timeout occurred while attempting to reset
+ the SCSI device specified by Target and Lun.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SCSI_PASS_THRU_RESET_TARGET)(
+ IN EFI_SCSI_PASS_THRU_PROTOCOL *This,
+ IN UINT32 Target,
+ IN UINT64 Lun
+ );
+
+///
+/// The EFI_SCSI_PASS_THRU_PROTOCOL provides information about a SCSI channel and
+/// the ability to send SCSI Request Packets to any SCSI device attached to that SCSI channel. The
+/// information includes the Target ID of the host controller on the SCSI channel, the attributes of
+/// the SCSI channel, the printable name for the SCSI controller, and the printable name of the
+/// SCSI channel.
+///
+struct _EFI_SCSI_PASS_THRU_PROTOCOL {
+ ///
+ /// A pointer to the EFI_SCSI_PASS_THRU_MODE data for this SCSI channel.
+ ///
+ EFI_SCSI_PASS_THRU_MODE *Mode;
+ EFI_SCSI_PASS_THRU_PASSTHRU PassThru;
+ EFI_SCSI_PASS_THRU_GET_NEXT_DEVICE GetNextDevice;
+ EFI_SCSI_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath;
+ EFI_SCSI_PASS_THRU_GET_TARGET_LUN GetTargetLun;
+ EFI_SCSI_PASS_THRU_RESET_CHANNEL ResetChannel;
+ EFI_SCSI_PASS_THRU_RESET_TARGET ResetTarget;
+};
+
+extern EFI_GUID gEfiScsiPassThruProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ScsiPassThruExt.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ScsiPassThruExt.h
new file mode 100644
index 0000000000..a9d4047e0e
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ScsiPassThruExt.h
@@ -0,0 +1,394 @@
+/** @file
+ EFI_EXT_SCSI_PASS_THRU_PROTOCOL as defined in UEFI 2.0.
+ This protocol provides services that allow SCSI Pass Thru commands
+ to be sent to SCSI devices attached to a SCSI channel.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__
+#define __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__
+
+#define EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID \
+ { \
+ 0x143b7632, 0xb81b, 0x4cb7, {0xab, 0xd3, 0xb6, 0x25, 0xa5, 0xb9, 0xbf, 0xfe } \
+ }
+
+typedef struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL EFI_EXT_SCSI_PASS_THRU_PROTOCOL;
+
+#define TARGET_MAX_BYTES 0x10
+
+#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001
+#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002
+#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004
+
+//
+// DataDirection
+//
+#define EFI_EXT_SCSI_DATA_DIRECTION_READ 0
+#define EFI_EXT_SCSI_DATA_DIRECTION_WRITE 1
+#define EFI_EXT_SCSI_DATA_DIRECTION_BIDIRECTIONAL 2
+//
+// HostAdapterStatus
+//
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OK 0x00
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND 0x09
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT 0x0b
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_MESSAGE_REJECT 0x0d
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_RESET 0x0e
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PARITY_ERROR 0x0f
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED 0x10
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT 0x11
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN 0x12
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_FREE 0x13
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PHASE_ERROR 0x14
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OTHER 0x7f
+//
+// TargetStatus
+//
+#define EFI_EXT_SCSI_STATUS_TARGET_GOOD 0x00
+#define EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION 0x02
+#define EFI_EXT_SCSI_STATUS_TARGET_CONDITION_MET 0x04
+#define EFI_EXT_SCSI_STATUS_TARGET_BUSY 0x08
+#define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE 0x10
+#define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE_CONDITION_MET 0x14
+#define EFI_EXT_SCSI_STATUS_TARGET_RESERVATION_CONFLICT 0x18
+#define EFI_EXT_SCSI_STATUS_TARGET_TASK_SET_FULL 0x28
+#define EFI_EXT_SCSI_STATUS_TARGET_ACA_ACTIVE 0x30
+#define EFI_EXT_SCSI_STATUS_TARGET_TASK_ABORTED 0x40
+
+typedef struct {
+ ///
+ /// The Target ID of the host adapter on the SCSI channel.
+ ///
+ UINT32 AdapterId;
+ ///
+ /// Additional information on the attributes of the SCSI channel.
+ ///
+ UINT32 Attributes;
+ ///
+ /// Supplies the alignment requirement for any buffer used in a data transfer.
+ ///
+ UINT32 IoAlign;
+} EFI_EXT_SCSI_PASS_THRU_MODE;
+
+typedef struct {
+ ///
+ /// The timeout, in 100 ns units, to use for the execution of this SCSI
+ /// Request Packet. A Timeout value of 0 means that this function
+ /// will wait indefinitely for the SCSI Request Packet to execute. If
+ /// Timeout is greater than zero, then this function will return
+ /// EFI_TIMEOUT if the time required to execute the SCSI
+ /// Request Packet is greater than Timeout.
+ ///
+ UINT64 Timeout;
+ ///
+ /// A pointer to the data buffer to transfer between the SCSI
+ /// controller and the SCSI device for read and bidirectional commands.
+ ///
+ VOID *InDataBuffer;
+ ///
+ /// A pointer to the data buffer to transfer between the SCSI
+ /// controller and the SCSI device for write or bidirectional commands.
+ ///
+ VOID *OutDataBuffer;
+ ///
+ /// A pointer to the sense data that was generated by the execution of
+ /// the SCSI Request Packet.
+ ///
+ VOID *SenseData;
+ ///
+ /// A pointer to buffer that contains the Command Data Block to
+ /// send to the SCSI device specified by Target and Lun.
+ ///
+ VOID *Cdb;
+ ///
+ /// On Input, the size, in bytes, of InDataBuffer. On output, the
+ /// number of bytes transferred between the SCSI controller and the SCSI device.
+ ///
+ UINT32 InTransferLength;
+ ///
+ /// On Input, the size, in bytes of OutDataBuffer. On Output, the
+ /// Number of bytes transferred between SCSI Controller and the SCSI device.
+ ///
+ UINT32 OutTransferLength;
+ ///
+ /// The length, in bytes, of the buffer Cdb. The standard values are 6,
+ /// 10, 12, and 16, but other values are possible if a variable length CDB is used.
+ ///
+ UINT8 CdbLength;
+ ///
+ /// The direction of the data transfer. 0 for reads, 1 for writes. A
+ /// value of 2 is Reserved for Bi-Directional SCSI commands.
+ ///
+ UINT8 DataDirection;
+ ///
+ /// The status of the host adapter specified by This when the SCSI
+ /// Request Packet was executed on the target device.
+ ///
+ UINT8 HostAdapterStatus;
+ ///
+ /// The status returned by the device specified by Target and Lun
+ /// when the SCSI Request Packet was executed.
+ ///
+ UINT8 TargetStatus;
+ ///
+ /// On input, the length in bytes of the SenseData buffer. On
+ /// output, the number of bytes written to the SenseData buffer.
+ ///
+ UINT8 SenseDataLength;
+} EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET;
+
+/**
+ Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel. This function
+ supports both blocking I/O and nonblocking I/O. The blocking I/O functionality is required, and the
+ nonblocking I/O functionality is optional.
+
+ @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
+ @param Target The Target is an array of size TARGET_MAX_BYTES and it represents
+ the id of the SCSI device to send the SCSI Request Packet. Each
+ transport driver may choose to utilize a subset of this size to suit the needs
+ of transport target representation. For example, a Fibre Channel driver
+ may use only 8 bytes (WWN) to represent an FC target.
+ @param Lun The LUN of the SCSI device to send the SCSI Request Packet.
+ @param Packet A pointer to the SCSI Request Packet to send to the SCSI device
+ specified by Target and Lun.
+ @param Event If nonblocking I/O is not supported then Event is ignored, and blocking
+ I/O is performed. If Event is NULL, then blocking I/O is performed. If
+ Event is not NULL and non blocking I/O is supported, then
+ nonblocking I/O is performed, and Event will be signaled when the
+ SCSI Request Packet completes.
+
+ @retval EFI_SUCCESS The SCSI Request Packet was sent by the host. For bi-directional
+ commands, InTransferLength bytes were transferred from
+ InDataBuffer. For write and bi-directional commands,
+ OutTransferLength bytes were transferred by
+ OutDataBuffer.
+ @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was not executed. The number of bytes that
+ could be transferred is returned in InTransferLength. For write
+ and bi-directional commands, OutTransferLength bytes were
+ transferred by OutDataBuffer.
+ @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
+ SCSI Request Packets already queued. The caller may retry again later.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SCSI Request
+ Packet.
+ @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket are invalid.
+ @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported
+ by the host adapter. This includes the case of Bi-directional SCSI
+ commands not supported by the implementation. The SCSI Request
+ Packet was not sent, so no additional status information is available.
+ @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_PASSTHRU)(
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
+ IN UINT8 *Target,
+ IN UINT64 Lun,
+ IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet,
+ IN EFI_EVENT Event OPTIONAL
+ );
+
+/**
+ Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on a SCSI channel. These
+ can either be the list SCSI devices that are actually present on the SCSI channel, or the list of legal
+ Target Ids and LUNs for the SCSI channel. Regardless, the caller of this function must probe the
+ Target ID and LUN returned to see if a SCSI device is actually present at that location on the SCSI
+ channel.
+
+ @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
+ @param Target On input, a pointer to the Target ID (an array of size
+ TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
+ On output, a pointer to the Target ID (an array of
+ TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
+ channel. An input value of 0xF(all bytes in the array are 0xF) in the
+ Target array retrieves the Target ID of the first SCSI device present on a
+ SCSI channel.
+ @param Lun On input, a pointer to the LUN of a SCSI device present on the SCSI
+ channel. On output, a pointer to the LUN of the next SCSI device present
+ on a SCSI channel.
+
+ @retval EFI_SUCCESS The Target ID and LUN of the next SCSI device on the SCSI
+ channel was returned in Target and Lun.
+ @retval EFI_INVALID_PARAMETER Target array is not all 0xF, and Target and Lun were
+ not returned on a previous call to GetNextTargetLun().
+ @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN)(
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
+ IN OUT UINT8 **Target,
+ IN OUT UINT64 *Lun
+ );
+
+/**
+ Used to allocate and build a device path node for a SCSI device on a SCSI channel.
+
+ @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
+ @param Target The Target is an array of size TARGET_MAX_BYTES and it specifies the
+ Target ID of the SCSI device for which a device path node is to be
+ allocated and built. Transport drivers may chose to utilize a subset of
+ this size to suit the representation of targets. For example, a Fibre
+ Channel driver may use only 8 bytes (WWN) in the array to represent a
+ FC target.
+ @param Lun The LUN of the SCSI device for which a device path node is to be
+ allocated and built.
+ @param DevicePath A pointer to a single device path node that describes the SCSI device
+ specified by Target and Lun. This function is responsible for
+ allocating the buffer DevicePath with the boot service
+ AllocatePool(). It is the caller's responsibility to free
+ DevicePath when the caller is finished with DevicePath.
+
+ @retval EFI_SUCCESS The device path node that describes the SCSI device specified by
+ Target and Lun was allocated and returned in
+ DevicePath.
+ @retval EFI_INVALID_PARAMETER DevicePath is NULL.
+ @retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does not exist
+ on the SCSI channel.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH)(
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
+ IN UINT8 *Target,
+ IN UINT64 Lun,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
+ );
+
+/**
+ Used to translate a device path node to a Target ID and LUN.
+
+ @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
+ @param DevicePath A pointer to a single device path node that describes the SCSI device
+ on the SCSI channel.
+ @param Target A pointer to the Target Array which represents the ID of a SCSI device
+ on the SCSI channel.
+ @param Lun A pointer to the LUN of a SCSI device on the SCSI channel.
+
+ @retval EFI_SUCCESS DevicePath was successfully translated to a Target ID and
+ LUN, and they were returned in Target and Lun.
+ @retval EFI_INVALID_PARAMETER DevicePath or Target or Lun is NULL.
+ @retval EFI_NOT_FOUND A valid translation from DevicePath to a Target ID and LUN
+ does not exist.
+ @retval EFI_UNSUPPORTED This driver does not support the device path node type in
+ DevicePath.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN)(
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ OUT UINT8 **Target,
+ OUT UINT64 *Lun
+ );
+
+/**
+ Resets a SCSI channel. This operation resets all the SCSI devices connected to the SCSI channel.
+
+ @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The SCSI channel was reset.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI channel.
+ @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI channel.
+ @retval EFI_UNSUPPORTED The SCSI channel does not support a channel reset operation.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL)(
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This
+ );
+
+/**
+ Resets a SCSI logical unit that is connected to a SCSI channel.
+
+ @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
+ @param Target The Target is an array of size TARGET_MAX_BYTE and it represents the
+ target port ID of the SCSI device containing the SCSI logical unit to
+ reset. Transport drivers may chose to utilize a subset of this array to suit
+ the representation of their targets.
+ @param Lun The LUN of the SCSI device to reset.
+
+ @retval EFI_SUCCESS The SCSI device specified by Target and Lun was reset.
+ @retval EFI_INVALID_PARAMETER Target or Lun is NULL.
+ @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI device
+ specified by Target and Lun.
+ @retval EFI_UNSUPPORTED The SCSI channel does not support a target reset operation.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI device
+ specified by Target and Lun.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN)(
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
+ IN UINT8 *Target,
+ IN UINT64 Lun
+ );
+
+/**
+ Used to retrieve the list of legal Target IDs for SCSI devices on a SCSI channel. These can either
+ be the list SCSI devices that are actually present on the SCSI channel, or the list of legal Target IDs
+ for the SCSI channel. Regardless, the caller of this function must probe the Target ID returned to
+ see if a SCSI device is actually present at that location on the SCSI channel.
+
+ @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
+ @param Target (TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
+ On output, a pointer to the Target ID (an array of
+ TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
+ channel. An input value of 0xF(all bytes in the array are 0xF) in the
+ Target array retrieves the Target ID of the first SCSI device present on a
+ SCSI channel.
+
+ @retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI
+ channel was returned in Target.
+ @retval EFI_INVALID_PARAMETER Target or Lun is NULL.
+ @retval EFI_TIMEOUT Target array is not all 0xF, and Target was not
+ returned on a previous call to GetNextTarget().
+ @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET)(
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
+ IN OUT UINT8 **Target
+ );
+
+///
+/// The EFI_EXT_SCSI_PASS_THRU_PROTOCOL provides information about a SCSI channel
+/// and the ability to send SCI Request Packets to any SCSI device attached to
+/// that SCSI channel. The information includes the Target ID of the host controller
+/// on the SCSI channel and the attributes of the SCSI channel.
+///
+struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL {
+ ///
+ /// A pointer to the EFI_EXT_SCSI_PASS_THRU_MODE data for this SCSI channel.
+ ///
+ EFI_EXT_SCSI_PASS_THRU_MODE *Mode;
+ EFI_EXT_SCSI_PASS_THRU_PASSTHRU PassThru;
+ EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN GetNextTargetLun;
+ EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath;
+ EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN GetTargetLun;
+ EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL ResetChannel;
+ EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN ResetTargetLun;
+ EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET GetNextTarget;
+};
+
+extern EFI_GUID gEfiExtScsiPassThruProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SdMmcPassThru.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SdMmcPassThru.h
new file mode 100644
index 0000000000..ddbf45632c
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SdMmcPassThru.h
@@ -0,0 +1,264 @@
+/** @file
+ The EFI_SD_MMC_PASS_THRU_PROTOCOL provides the ability to send SD/MMC Commands
+ to any SD/MMC device attached to the SD compatible pci host controller.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SD_MMC_PASS_THRU_H__
+#define __SD_MMC_PASS_THRU_H__
+
+#define EFI_SD_MMC_PASS_THRU_PROTOCOL_GUID \
+ { \
+ 0x716ef0d9, 0xff83, 0x4f69, {0x81, 0xe9, 0x51, 0x8b, 0xd3, 0x9a, 0x8e, 0x70 } \
+ }
+
+typedef struct _EFI_SD_MMC_PASS_THRU_PROTOCOL EFI_SD_MMC_PASS_THRU_PROTOCOL;
+
+typedef enum {
+ SdMmcCommandTypeBc, // Broadcast commands, no response
+ SdMmcCommandTypeBcr, // Broadcast commands with response
+ SdMmcCommandTypeAc, // Addressed(point-to-point) commands
+ SdMmcCommandTypeAdtc // Addressed(point-to-point) data transfer commands
+} EFI_SD_MMC_COMMAND_TYPE;
+
+typedef enum {
+ SdMmcResponseTypeR1,
+ SdMmcResponseTypeR1b,
+ SdMmcResponseTypeR2,
+ SdMmcResponseTypeR3,
+ SdMmcResponseTypeR4,
+ SdMmcResponseTypeR5,
+ SdMmcResponseTypeR5b,
+ SdMmcResponseTypeR6,
+ SdMmcResponseTypeR7
+} EFI_SD_MMC_RESPONSE_TYPE;
+
+typedef struct _EFI_SD_MMC_COMMAND_BLOCK {
+ UINT16 CommandIndex;
+ UINT32 CommandArgument;
+ UINT32 CommandType; // One of the EFI_SD_MMC_COMMAND_TYPE values
+ UINT32 ResponseType; // One of the EFI_SD_MMC_RESPONSE_TYPE values
+} EFI_SD_MMC_COMMAND_BLOCK;
+
+typedef struct _EFI_SD_MMC_STATUS_BLOCK {
+ UINT32 Resp0;
+ UINT32 Resp1;
+ UINT32 Resp2;
+ UINT32 Resp3;
+} EFI_SD_MMC_STATUS_BLOCK;
+
+typedef struct _EFI_SD_MMC_PASS_THRU_COMMAND_PACKET {
+ UINT64 Timeout;
+ EFI_SD_MMC_COMMAND_BLOCK *SdMmcCmdBlk;
+ EFI_SD_MMC_STATUS_BLOCK *SdMmcStatusBlk;
+ VOID *InDataBuffer;
+ VOID *OutDataBuffer;
+ UINT32 InTransferLength;
+ UINT32 OutTransferLength;
+ EFI_STATUS TransactionStatus;
+} EFI_SD_MMC_PASS_THRU_COMMAND_PACKET;
+
+/**
+ Sends SD command to an SD card that is attached to the SD controller.
+
+ The PassThru() function sends the SD command specified by Packet to the SD card
+ specified by Slot.
+
+ If Packet is successfully sent to the SD card, then EFI_SUCCESS is returned.
+
+ If a device error occurs while sending the Packet, then EFI_DEVICE_ERROR is returned.
+
+ If Slot is not in a valid range for the SD controller, then EFI_INVALID_PARAMETER
+ is returned.
+
+ If Packet defines a data command but both InDataBuffer and OutDataBuffer are NULL,
+ EFI_INVALID_PARAMETER is returned.
+
+ @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
+ @param[in] Slot The slot number of the SD card to send the command to.
+ @param[in,out] Packet A pointer to the SD command data structure.
+ @param[in] Event If Event is NULL, blocking I/O is performed. If Event is
+ not NULL, then nonblocking I/O is performed, and Event
+ will be signaled when the Packet completes.
+
+ @retval EFI_SUCCESS The SD Command Packet was sent by the host.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SD
+ command Packet.
+ @retval EFI_INVALID_PARAMETER Packet, Slot, or the contents of the Packet is invalid.
+ @retval EFI_INVALID_PARAMETER Packet defines a data command but both InDataBuffer and
+ OutDataBuffer are NULL.
+ @retval EFI_NO_MEDIA SD Device not present in the Slot.
+ @retval EFI_UNSUPPORTED The command described by the SD Command Packet is not
+ supported by the host controller.
+ @retval EFI_BAD_BUFFER_SIZE The InTransferLength or OutTransferLength exceeds the
+ limit supported by SD card ( i.e. if the number of bytes
+ exceed the Last LBA).
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SD_MMC_PASS_THRU_PASSTHRU) (
+ IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This,
+ IN UINT8 Slot,
+ IN OUT EFI_SD_MMC_PASS_THRU_COMMAND_PACKET *Packet,
+ IN EFI_EVENT Event OPTIONAL
+);
+
+/**
+ Used to retrieve next slot numbers supported by the SD controller. The function
+ returns information about all available slots (populated or not-populated).
+
+ The GetNextSlot() function retrieves the next slot number on an SD controller.
+ If on input Slot is 0xFF, then the slot number of the first slot on the SD controller
+ is returned.
+
+ If Slot is a slot number that was returned on a previous call to GetNextSlot(), then
+ the slot number of the next slot on the SD controller is returned.
+
+ If Slot is not 0xFF and Slot was not returned on a previous call to GetNextSlot(),
+ EFI_INVALID_PARAMETER is returned.
+
+ If Slot is the slot number of the last slot on the SD controller, then EFI_NOT_FOUND
+ is returned.
+
+ @param[in] This A pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
+ @param[in,out] Slot On input, a pointer to a slot number on the SD controller.
+ On output, a pointer to the next slot number on the SD controller.
+ An input value of 0xFF retrieves the first slot number on the SD
+ controller.
+
+ @retval EFI_SUCCESS The next slot number on the SD controller was returned in Slot.
+ @retval EFI_NOT_FOUND There are no more slots on this SD controller.
+ @retval EFI_INVALID_PARAMETER Slot is not 0xFF and Slot was not returned on a previous call
+ to GetNextSlot().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SD_MMC_PASS_THRU_GET_NEXT_SLOT) (
+ IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This,
+ IN OUT UINT8 *Slot
+);
+
+/**
+ Used to allocate and build a device path node for an SD card on the SD controller.
+
+ The BuildDevicePath() function allocates and builds a single device node for the SD
+ card specified by Slot.
+
+ If the SD card specified by Slot is not present on the SD controller, then EFI_NOT_FOUND
+ is returned.
+
+ If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned.
+
+ If there are not enough resources to allocate the device path node, then EFI_OUT_OF_RESOURCES
+ is returned.
+
+ Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of
+ DevicePath are initialized to describe the SD card specified by Slot, and EFI_SUCCESS is
+ returned.
+
+ @param[in] This A pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
+ @param[in] Slot Specifies the slot number of the SD card for which a device
+ path node is to be allocated and built.
+ @param[in,out] DevicePath A pointer to a single device path node that describes the SD
+ card specified by Slot. This function is responsible for
+ allocating the buffer DevicePath with the boot service
+ AllocatePool(). It is the caller's responsibility to free
+ DevicePath when the caller is finished with DevicePath.
+
+ @retval EFI_SUCCESS The device path node that describes the SD card specified by
+ Slot was allocated and returned in DevicePath.
+ @retval EFI_NOT_FOUND The SD card specified by Slot does not exist on the SD controller.
+ @retval EFI_INVALID_PARAMETER DevicePath is NULL.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SD_MMC_PASS_THRU_BUILD_DEVICE_PATH) (
+ IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This,
+ IN UINT8 Slot,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
+);
+
+/**
+ This function retrieves an SD card slot number based on the input device path.
+
+ The GetSlotNumber() function retrieves slot number for the SD card specified by
+ the DevicePath node. If DevicePath is NULL, EFI_INVALID_PARAMETER is returned.
+
+ If DevicePath is not a device path node type that the SD Pass Thru driver supports,
+ EFI_UNSUPPORTED is returned.
+
+ @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
+ @param[in] DevicePath A pointer to the device path node that describes a SD
+ card on the SD controller.
+ @param[out] Slot On return, points to the slot number of an SD card on
+ the SD controller.
+
+ @retval EFI_SUCCESS SD card slot number is returned in Slot.
+ @retval EFI_INVALID_PARAMETER Slot or DevicePath is NULL.
+ @retval EFI_UNSUPPORTED DevicePath is not a device path node type that the SD
+ Pass Thru driver supports.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SD_MMC_PASS_THRU_GET_SLOT_NUMBER) (
+ IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ OUT UINT8 *Slot
+);
+
+/**
+ Resets an SD card that is connected to the SD controller.
+
+ The ResetDevice() function resets the SD card specified by Slot.
+
+ If this SD controller does not support a device reset operation, EFI_UNSUPPORTED is
+ returned.
+
+ If Slot is not in a valid slot number for this SD controller, EFI_INVALID_PARAMETER
+ is returned.
+
+ If the device reset operation is completed, EFI_SUCCESS is returned.
+
+ @param[in] This A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
+ @param[in] Slot Specifies the slot number of the SD card to be reset.
+
+ @retval EFI_SUCCESS The SD card specified by Slot was reset.
+ @retval EFI_UNSUPPORTED The SD controller does not support a device reset operation.
+ @retval EFI_INVALID_PARAMETER Slot number is invalid.
+ @retval EFI_NO_MEDIA SD Device not present in the Slot.
+ @retval EFI_DEVICE_ERROR The reset command failed due to a device error
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SD_MMC_PASS_THRU_RESET_DEVICE) (
+ IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This,
+ IN UINT8 Slot
+);
+
+struct _EFI_SD_MMC_PASS_THRU_PROTOCOL {
+ UINT32 IoAlign;
+ EFI_SD_MMC_PASS_THRU_PASSTHRU PassThru;
+ EFI_SD_MMC_PASS_THRU_GET_NEXT_SLOT GetNextSlot;
+ EFI_SD_MMC_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath;
+ EFI_SD_MMC_PASS_THRU_GET_SLOT_NUMBER GetSlotNumber;
+ EFI_SD_MMC_PASS_THRU_RESET_DEVICE ResetDevice;
+};
+
+extern EFI_GUID gEfiSdMmcPassThruProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Security.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Security.h
new file mode 100644
index 0000000000..54c51fa432
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Security.h
@@ -0,0 +1,103 @@
+/** @file
+ Security Architectural Protocol as defined in PI Specification VOLUME 2 DXE
+
+ Used to provide Security services. Specifically, dependening upon the
+ authentication state of a discovered driver in a Firmware Volume, the
+ portable DXE Core Dispatcher will call into the Security Architectural
+ Protocol (SAP) with the authentication state of the driver.
+
+ This call-out allows for OEM-specific policy decisions to be made, such
+ as event logging for attested boots, locking flash in response to discovering
+ an unsigned driver or failed signature check, or other exception response.
+
+ The SAP can also change system behavior by having the DXE core put a driver
+ in the Schedule-On-Request (SOR) state. This will allow for later disposition
+ of the driver by platform agent, such as Platform BDS.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARCH_PROTOCOL_SECURITY_H__
+#define __ARCH_PROTOCOL_SECURITY_H__
+
+///
+/// Global ID for the Security Code Architectural Protocol
+///
+#define EFI_SECURITY_ARCH_PROTOCOL_GUID \
+ { 0xA46423E3, 0x4617, 0x49f1, {0xB9, 0xFF, 0xD1, 0xBF, 0xA9, 0x11, 0x58, 0x39 } }
+
+typedef struct _EFI_SECURITY_ARCH_PROTOCOL EFI_SECURITY_ARCH_PROTOCOL;
+
+/**
+ The EFI_SECURITY_ARCH_PROTOCOL (SAP) is used to abstract platform-specific
+ policy from the DXE core response to an attempt to use a file that returns a
+ given status for the authentication check from the section extraction protocol.
+
+ The possible responses in a given SAP implementation may include locking
+ flash upon failure to authenticate, attestation logging for all signed drivers,
+ and other exception operations. The File parameter allows for possible logging
+ within the SAP of the driver.
+
+ If File is NULL, then EFI_INVALID_PARAMETER is returned.
+
+ If the file specified by File with an authentication status specified by
+ AuthenticationStatus is safe for the DXE Core to use, then EFI_SUCCESS is returned.
+
+ If the file specified by File with an authentication status specified by
+ AuthenticationStatus is not safe for the DXE Core to use under any circumstances,
+ then EFI_ACCESS_DENIED is returned.
+
+ If the file specified by File with an authentication status specified by
+ AuthenticationStatus is not safe for the DXE Core to use right now, but it
+ might be possible to use it at a future time, then EFI_SECURITY_VIOLATION is
+ returned.
+
+ @param This The EFI_SECURITY_ARCH_PROTOCOL instance.
+ @param AuthenticationStatus
+ This is the authentication type returned from the Section
+ Extraction protocol. See the Section Extraction Protocol
+ Specification for details on this type.
+ @param File This is a pointer to the device path of the file that is
+ being dispatched. This will optionally be used for logging.
+
+ @retval EFI_SUCCESS The file specified by File did authenticate, and the
+ platform policy dictates that the DXE Core may use File.
+ @retval EFI_INVALID_PARAMETER Driver is NULL.
+ @retval EFI_SECURITY_VIOLATION The file specified by File did not authenticate, and
+ the platform policy dictates that File should be placed
+ in the untrusted state. A file may be promoted from
+ the untrusted to the trusted state at a future time
+ with a call to the Trust() DXE Service.
+ @retval EFI_ACCESS_DENIED The file specified by File did not authenticate, and
+ the platform policy dictates that File should not be
+ used for any purpose.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SECURITY_FILE_AUTHENTICATION_STATE)(
+ IN CONST EFI_SECURITY_ARCH_PROTOCOL *This,
+ IN UINT32 AuthenticationStatus,
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *File
+ );
+
+///
+/// The EFI_SECURITY_ARCH_PROTOCOL is used to abstract platform-specific policy
+/// from the DXE core. This includes locking flash upon failure to authenticate,
+/// attestation logging, and other exception operations.
+///
+struct _EFI_SECURITY_ARCH_PROTOCOL {
+ EFI_SECURITY_FILE_AUTHENTICATION_STATE FileAuthenticationState;
+};
+
+extern EFI_GUID gEfiSecurityArchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Security2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Security2.h
new file mode 100644
index 0000000000..a8d7915690
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Security2.h
@@ -0,0 +1,107 @@
+/** @file
+ Security2 Architectural Protocol as defined in PI Specification1.2.1 VOLUME 2 DXE
+
+ Abstracts security-specific functions from the DXE Foundation of UEFI Image Verification,
+ Trusted Computing Group (TCG) measured boot, and User Identity policy for image loading and
+ consoles. This protocol must be produced by a boot service or runtime DXE driver.
+
+ This protocol is optional and must be published prior to the EFI_SECURITY_ARCH_PROTOCOL.
+ As a result, the same driver must publish both of these interfaces.
+
+ When both Security and Security2 Architectural Protocols are published, LoadImage must use
+ them in accordance with the following rules:
+ The Security2 protocol must be used on every image being loaded.
+ The Security protocol must be used after the Securiy2 protocol and only on images that
+ have been read using Firmware Volume protocol.
+
+ When only Security architectural protocol is published, LoadImage must use it on every image
+ being loaded.
+
+ Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARCH_PROTOCOL_SECURITY2_H__
+#define __ARCH_PROTOCOL_SECURITY2_H__
+
+///
+/// Global ID for the Security2 Code Architectural Protocol
+///
+#define EFI_SECURITY2_ARCH_PROTOCOL_GUID \
+ { 0x94ab2f58, 0x1438, 0x4ef1, {0x91, 0x52, 0x18, 0x94, 0x1a, 0x3a, 0x0e, 0x68 } }
+
+typedef struct _EFI_SECURITY2_ARCH_PROTOCOL EFI_SECURITY2_ARCH_PROTOCOL;
+
+/**
+ The DXE Foundation uses this service to measure and/or verify a UEFI image.
+
+ This service abstracts the invocation of Trusted Computing Group (TCG) measured boot, UEFI
+ Secure boot, and UEFI User Identity infrastructure. For the former two, the DXE Foundation
+ invokes the FileAuthentication() with a DevicePath and corresponding image in
+ FileBuffer memory. The TCG measurement code will record the FileBuffer contents into the
+ appropriate PCR. The image verification logic will confirm the integrity and provenance of the
+ image in FileBuffer of length FileSize . The origin of the image will be DevicePath in
+ these cases.
+ If the FileBuffer is NULL, the interface will determine if the DevicePath can be connected
+ in order to support the User Identification policy.
+
+ @param This The EFI_SECURITY2_ARCH_PROTOCOL instance.
+ @param File A pointer to the device path of the file that is
+ being dispatched. This will optionally be used for logging.
+ @param FileBuffer A pointer to the buffer with the UEFI file image.
+ @param FileSize The size of the file.
+ @param BootPolicy A boot policy that was used to call LoadImage() UEFI service. If
+ FileAuthentication() is invoked not from the LoadImage(),
+ BootPolicy must be set to FALSE.
+
+ @retval EFI_SUCCESS The file specified by DevicePath and non-NULL
+ FileBuffer did authenticate, and the platform policy dictates
+ that the DXE Foundation may use the file.
+ @retval EFI_SUCCESS The device path specified by NULL device path DevicePath
+ and non-NULL FileBuffer did authenticate, and the platform
+ policy dictates that the DXE Foundation may execute the image in
+ FileBuffer.
+ @retval EFI_SUCCESS FileBuffer is NULL and current user has permission to start
+ UEFI device drivers on the device path specified by DevicePath.
+ @retval EFI_SECURITY_VIOLATION The file specified by DevicePath and FileBuffer did not
+ authenticate, and the platform policy dictates that the file should be
+ placed in the untrusted state. The image has been added to the file
+ execution table.
+ @retval EFI_ACCESS_DENIED The file specified by File and FileBuffer did not
+ authenticate, and the platform policy dictates that the DXE
+ Foundation may not use File.
+ @retval EFI_SECURITY_VIOLATION FileBuffer is NULL and the user has no
+ permission to start UEFI device drivers on the device path specified
+ by DevicePath.
+ @retval EFI_SECURITY_VIOLATION FileBuffer is not NULL and the user has no permission to load
+ drivers from the device path specified by DevicePath. The
+ image has been added into the list of the deferred images.
+**/
+typedef EFI_STATUS (EFIAPI *EFI_SECURITY2_FILE_AUTHENTICATION) (
+ IN CONST EFI_SECURITY2_ARCH_PROTOCOL *This,
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN VOID *FileBuffer,
+ IN UINTN FileSize,
+ IN BOOLEAN BootPolicy
+);
+
+///
+/// The EFI_SECURITY2_ARCH_PROTOCOL is used to abstract platform-specific policy from the
+/// DXE Foundation. This includes measuring the PE/COFF image prior to invoking, comparing the
+/// image against a policy (whether a white-list/black-list of public image verification keys
+/// or registered hashes).
+///
+struct _EFI_SECURITY2_ARCH_PROTOCOL {
+ EFI_SECURITY2_FILE_AUTHENTICATION FileAuthentication;
+};
+
+extern EFI_GUID gEfiSecurity2ArchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SecurityPolicy.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SecurityPolicy.h
new file mode 100644
index 0000000000..ceff5ac227
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SecurityPolicy.h
@@ -0,0 +1,26 @@
+/** @file
+ Security Policy protocol as defined in PI Specification VOLUME 2 DXE
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SECURITY_POLICY_H_
+#define _SECURITY_POLICY_H_
+
+///
+/// Security policy protocol GUID definition
+///
+#define EFI_SECURITY_POLICY_PROTOCOL_GUID \
+ {0x78E4D245, 0xCD4D, 0x4a05, {0xA2, 0xBA, 0x47, 0x43, 0xE8, 0x6C, 0xFC, 0xAB} }
+
+extern EFI_GUID gEfiSecurityPolicyProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SerialIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SerialIo.h
new file mode 100644
index 0000000000..873e209b01
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SerialIo.h
@@ -0,0 +1,300 @@
+/** @file
+ Serial IO protocol as defined in the UEFI 2.0 specification.
+
+ Abstraction of a basic serial device. Targeted at 16550 UART, but
+ could be much more generic.
+
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SERIAL_IO_PROTOCOL_H__
+#define __SERIAL_IO_PROTOCOL_H__
+
+#define EFI_SERIAL_IO_PROTOCOL_GUID \
+ { \
+ 0xBB25CF6F, 0xF1D4, 0x11D2, {0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD } \
+ }
+
+///
+/// Protocol GUID defined in EFI1.1.
+///
+#define SERIAL_IO_PROTOCOL EFI_SERIAL_IO_PROTOCOL_GUID
+
+typedef struct _EFI_SERIAL_IO_PROTOCOL EFI_SERIAL_IO_PROTOCOL;
+
+
+///
+/// Backward-compatible with EFI1.1.
+///
+typedef EFI_SERIAL_IO_PROTOCOL SERIAL_IO_INTERFACE;
+
+///
+/// Parity type that is computed or checked as each character is transmitted or received. If the
+/// device does not support parity, the value is the default parity value.
+///
+typedef enum {
+ DefaultParity,
+ NoParity,
+ EvenParity,
+ OddParity,
+ MarkParity,
+ SpaceParity
+} EFI_PARITY_TYPE;
+
+///
+/// Stop bits type
+///
+typedef enum {
+ DefaultStopBits,
+ OneStopBit,
+ OneFiveStopBits,
+ TwoStopBits
+} EFI_STOP_BITS_TYPE;
+
+//
+// define for Control bits, grouped by read only, write only, and read write
+//
+//
+// Read Only
+//
+#define EFI_SERIAL_CLEAR_TO_SEND 0x00000010
+#define EFI_SERIAL_DATA_SET_READY 0x00000020
+#define EFI_SERIAL_RING_INDICATE 0x00000040
+#define EFI_SERIAL_CARRIER_DETECT 0x00000080
+#define EFI_SERIAL_INPUT_BUFFER_EMPTY 0x00000100
+#define EFI_SERIAL_OUTPUT_BUFFER_EMPTY 0x00000200
+
+//
+// Write Only
+//
+#define EFI_SERIAL_REQUEST_TO_SEND 0x00000002
+#define EFI_SERIAL_DATA_TERMINAL_READY 0x00000001
+
+//
+// Read Write
+//
+#define EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE 0x00001000
+#define EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE 0x00002000
+#define EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE 0x00004000
+
+//
+// Serial IO Member Functions
+//
+/**
+ Reset the serial device.
+
+ @param This Protocol instance pointer.
+
+ @retval EFI_SUCCESS The device was reset.
+ @retval EFI_DEVICE_ERROR The serial device could not be reset.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SERIAL_RESET)(
+ IN EFI_SERIAL_IO_PROTOCOL *This
+ );
+
+/**
+ Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,
+ data bits, and stop bits on a serial device.
+
+ @param This Protocol instance pointer.
+ @param BaudRate The requested baud rate. A BaudRate value of 0 will use the
+ device's default interface speed.
+ @param ReveiveFifoDepth The requested depth of the FIFO on the receive side of the
+ serial interface. A ReceiveFifoDepth value of 0 will use
+ the device's default FIFO depth.
+ @param Timeout The requested time out for a single character in microseconds.
+ This timeout applies to both the transmit and receive side of the
+ interface. A Timeout value of 0 will use the device's default time
+ out value.
+ @param Parity The type of parity to use on this serial device. A Parity value of
+ DefaultParity will use the device's default parity value.
+ @param DataBits The number of data bits to use on the serial device. A DataBits
+ vaule of 0 will use the device's default data bit setting.
+ @param StopBits The number of stop bits to use on this serial device. A StopBits
+ value of DefaultStopBits will use the device's default number of
+ stop bits.
+
+ @retval EFI_SUCCESS The device was reset.
+ @retval EFI_INVALID_PARAMETER One or more attributes has an unsupported value.
+ @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SERIAL_SET_ATTRIBUTES)(
+ IN EFI_SERIAL_IO_PROTOCOL *This,
+ IN UINT64 BaudRate,
+ IN UINT32 ReceiveFifoDepth,
+ IN UINT32 Timeout,
+ IN EFI_PARITY_TYPE Parity,
+ IN UINT8 DataBits,
+ IN EFI_STOP_BITS_TYPE StopBits
+ );
+
+/**
+ Set the control bits on a serial device
+
+ @param This Protocol instance pointer.
+ @param Control Set the bits of Control that are settable.
+
+ @retval EFI_SUCCESS The new control bits were set on the serial device.
+ @retval EFI_UNSUPPORTED The serial device does not support this operation.
+ @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SERIAL_SET_CONTROL_BITS)(
+ IN EFI_SERIAL_IO_PROTOCOL *This,
+ IN UINT32 Control
+ );
+
+/**
+ Retrieves the status of thecontrol bits on a serial device
+
+ @param This Protocol instance pointer.
+ @param Control A pointer to return the current Control signals from the serial device.
+
+ @retval EFI_SUCCESS The control bits were read from the serial device.
+ @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SERIAL_GET_CONTROL_BITS)(
+ IN EFI_SERIAL_IO_PROTOCOL *This,
+ OUT UINT32 *Control
+ );
+
+/**
+ Writes data to a serial device.
+
+ @param This Protocol instance pointer.
+ @param BufferSize On input, the size of the Buffer. On output, the amount of
+ data actually written.
+ @param Buffer The buffer of data to write
+
+ @retval EFI_SUCCESS The data was written.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_TIMEOUT The data write was stopped due to a timeout.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SERIAL_WRITE)(
+ IN EFI_SERIAL_IO_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer
+ );
+
+/**
+ Writes data to a serial device.
+
+ @param This Protocol instance pointer.
+ @param BufferSize On input, the size of the Buffer. On output, the amount of
+ data returned in Buffer.
+ @param Buffer The buffer to return the data into.
+
+ @retval EFI_SUCCESS The data was read.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_TIMEOUT The data write was stopped due to a timeout.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SERIAL_READ)(
+ IN EFI_SERIAL_IO_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+ );
+
+/**
+ @par Data Structure Description:
+ The data values in SERIAL_IO_MODE are read-only and are updated by the code
+ that produces the SERIAL_IO_PROTOCOL member functions.
+
+ @param ControlMask
+ A mask for the Control bits that the device supports. The device
+ must always support the Input Buffer Empty control bit.
+
+ @param TimeOut
+ If applicable, the number of microseconds to wait before timing out
+ a Read or Write operation.
+
+ @param BaudRate
+ If applicable, the current baud rate setting of the device; otherwise,
+ baud rate has the value of zero to indicate that device runs at the
+ device's designed speed.
+
+ @param ReceiveFifoDepth
+ The number of characters the device will buffer on input
+
+ @param DataBits
+ The number of characters the device will buffer on input
+
+ @param Parity
+ If applicable, this is the EFI_PARITY_TYPE that is computed or
+ checked as each character is transmitted or reveived. If the device
+ does not support parity the value is the default parity value.
+
+ @param StopBits
+ If applicable, the EFI_STOP_BITS_TYPE number of stop bits per
+ character. If the device does not support stop bits the value is
+ the default stop bit values.
+
+**/
+typedef struct {
+ UINT32 ControlMask;
+
+ //
+ // current Attributes
+ //
+ UINT32 Timeout;
+ UINT64 BaudRate;
+ UINT32 ReceiveFifoDepth;
+ UINT32 DataBits;
+ UINT32 Parity;
+ UINT32 StopBits;
+} EFI_SERIAL_IO_MODE;
+
+#define EFI_SERIAL_IO_PROTOCOL_REVISION 0x00010000
+#define SERIAL_IO_INTERFACE_REVISION EFI_SERIAL_IO_PROTOCOL_REVISION
+
+///
+/// The Serial I/O protocol is used to communicate with UART-style serial devices.
+/// These can be standard UART serial ports in PC-AT systems, serial ports attached
+/// to a USB interface, or potentially any character-based I/O device.
+///
+struct _EFI_SERIAL_IO_PROTOCOL {
+ ///
+ /// The revision to which the EFI_SERIAL_IO_PROTOCOL adheres. All future revisions
+ /// must be backwards compatible. If a future version is not backwards compatible,
+ /// it is not the same GUID.
+ ///
+ UINT32 Revision;
+ EFI_SERIAL_RESET Reset;
+ EFI_SERIAL_SET_ATTRIBUTES SetAttributes;
+ EFI_SERIAL_SET_CONTROL_BITS SetControl;
+ EFI_SERIAL_GET_CONTROL_BITS GetControl;
+ EFI_SERIAL_WRITE Write;
+ EFI_SERIAL_READ Read;
+ ///
+ /// Pointer to SERIAL_IO_MODE data.
+ ///
+ EFI_SERIAL_IO_MODE *Mode;
+};
+
+extern EFI_GUID gEfiSerialIoProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ServiceBinding.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ServiceBinding.h
new file mode 100644
index 0000000000..546a0d0973
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ServiceBinding.h
@@ -0,0 +1,94 @@
+/** @file
+ UEFI Service Binding Protocol is defined in UEFI specification.
+
+ The file defines the generic Service Binding Protocol functions.
+ It provides services that are required to create and destroy child
+ handles that support a given set of protocols.
+
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_SERVICE_BINDING_H__
+#define __EFI_SERVICE_BINDING_H__
+
+///
+/// Forward reference for pure ANSI compatability
+///
+typedef struct _EFI_SERVICE_BINDING_PROTOCOL EFI_SERVICE_BINDING_PROTOCOL;
+
+/**
+ Creates a child handle and installs a protocol.
+
+ The CreateChild() function installs a protocol on ChildHandle.
+ If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
+ If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
+
+ @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
+ @param ChildHandle Pointer to the handle of the child to create. If it is NULL,
+ then a new handle is created. If it is a pointer to an existing UEFI handle,
+ then the protocol is added to the existing UEFI handle.
+
+ @retval EFI_SUCCES The protocol was added to ChildHandle.
+ @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create
+ the child
+ @retval other The child handle was not created
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD)(
+ IN EFI_SERVICE_BINDING_PROTOCOL *This,
+ IN OUT EFI_HANDLE *ChildHandle
+ );
+
+/**
+ Destroys a child handle with a protocol installed on it.
+
+ The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
+ that was installed by CreateChild() from ChildHandle. If the removed protocol is the
+ last protocol on ChildHandle, then ChildHandle is destroyed.
+
+ @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
+ @param ChildHandle Handle of the child to destroy
+
+ @retval EFI_SUCCES The protocol was removed from ChildHandle.
+ @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
+ @retval EFI_INVALID_PARAMETER Child handle is NULL.
+ @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
+ because its services are being used.
+ @retval other The child handle was not destroyed
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD)(
+ IN EFI_SERVICE_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ChildHandle
+ );
+
+///
+/// The EFI_SERVICE_BINDING_PROTOCOL provides member functions to create and destroy
+/// child handles. A driver is responsible for adding protocols to the child handle
+/// in CreateChild() and removing protocols in DestroyChild(). It is also required
+/// that the CreateChild() function opens the parent protocol BY_CHILD_CONTROLLER
+/// to establish the parent-child relationship, and closes the protocol in DestroyChild().
+/// The pseudo code for CreateChild() and DestroyChild() is provided to specify the
+/// required behavior, not to specify the required implementation. Each consumer of
+/// a software protocol is responsible for calling CreateChild() when it requires the
+/// protocol and calling DestroyChild() when it is finished with that protocol.
+///
+struct _EFI_SERVICE_BINDING_PROTOCOL {
+ EFI_SERVICE_BINDING_CREATE_CHILD CreateChild;
+ EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild;
+};
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Shell.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Shell.h
new file mode 100644
index 0000000000..c54e901714
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Shell.h
@@ -0,0 +1,1268 @@
+/** @file
+ EFI Shell protocol as defined in the UEFI Shell 2.0 specification including errata.
+
+ (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_SHELL_PROTOCOL_H__
+#define __EFI_SHELL_PROTOCOL_H__
+
+#include <Guid/FileInfo.h>
+
+#define EFI_SHELL_PROTOCOL_GUID \
+ { \
+ 0x6302d008, 0x7f9b, 0x4f30, { 0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e } \
+ }
+typedef VOID *SHELL_FILE_HANDLE;
+
+typedef enum {
+ ///
+ /// The operation completed successfully.
+ ///
+ SHELL_SUCCESS = 0,
+
+ ///
+ /// The image failed to load.
+ ///
+ SHELL_LOAD_ERROR = 1,
+
+ ///
+ /// The parameter was incorrect.
+ ///
+ SHELL_INVALID_PARAMETER = 2,
+
+ ///
+ /// The operation is not supported.
+ ///
+ SHELL_UNSUPPORTED = 3,
+
+ ///
+ /// The buffer was not the proper size for the request.
+ ///
+ SHELL_BAD_BUFFER_SIZE = 4,
+
+ ///
+ /// The buffer was not large enough to hold the requested data.
+ /// The required buffer size is returned in the appropriate
+ /// parameter when this error occurs.
+ ///
+ SHELL_BUFFER_TOO_SMALL = 5,
+
+ ///
+ /// There is no data pending upon return.
+ ///
+ SHELL_NOT_READY = 6,
+
+ ///
+ /// The physical device reported an error while attempting the
+ /// operation.
+ ///
+ SHELL_DEVICE_ERROR = 7,
+
+ ///
+ /// The device cannot be written to.
+ ///
+ SHELL_WRITE_PROTECTED = 8,
+
+ ///
+ /// The resource has run out.
+ ///
+ SHELL_OUT_OF_RESOURCES = 9,
+
+ ///
+ /// An inconsistency was detected on the file system causing the
+ /// operation to fail.
+ ///
+ SHELL_VOLUME_CORRUPTED = 10,
+
+ ///
+ /// There is no more space on the file system.
+ ///
+ SHELL_VOLUME_FULL = 11,
+
+ ///
+ /// The device does not contain any medium to perform the
+ /// operation.
+ ///
+ SHELL_NO_MEDIA = 12,
+
+ ///
+ /// The medium in the device has changed since the last
+ /// access.
+ ///
+ SHELL_MEDIA_CHANGED = 13,
+
+ ///
+ /// The item was not found.
+ ///
+ SHELL_NOT_FOUND = 14,
+
+ ///
+ /// Access was denied.
+ ///
+ SHELL_ACCESS_DENIED = 15,
+
+ // note the skipping of 16 and 17
+
+ ///
+ /// A timeout time expired.
+ ///
+ SHELL_TIMEOUT = 18,
+
+ ///
+ /// The protocol has not been started.
+ ///
+ SHELL_NOT_STARTED = 19,
+
+ ///
+ /// The protocol has already been started.
+ ///
+ SHELL_ALREADY_STARTED = 20,
+
+ ///
+ /// The operation was aborted.
+ ///
+ SHELL_ABORTED = 21,
+
+ // note the skipping of 22, 23, and 24
+
+ ///
+ /// A function encountered an internal version that was
+ /// incompatible with a version requested by the caller.
+ ///
+ SHELL_INCOMPATIBLE_VERSION = 25,
+
+ ///
+ /// The function was not performed due to a security violation.
+ ///
+ SHELL_SECURITY_VIOLATION = 26,
+
+ ///
+ /// The function was performed and resulted in an unequal
+ /// comparison..
+ ///
+ SHELL_NOT_EQUAL = 27
+} SHELL_STATUS;
+
+
+// replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.
+// they are identical outside of the name.
+typedef struct {
+ LIST_ENTRY Link; ///< Linked list members.
+ EFI_STATUS Status; ///< Status of opening the file. Valid only if Handle != NULL.
+ CONST CHAR16 *FullName; ///< Fully qualified filename.
+ CONST CHAR16 *FileName; ///< name of this file.
+ SHELL_FILE_HANDLE Handle; ///< Handle for interacting with the opened file or NULL if closed.
+ EFI_FILE_INFO *Info; ///< Pointer to the FileInfo struct for this file or NULL.
+} EFI_SHELL_FILE_INFO;
+
+/**
+ Returns whether any script files are currently being processed.
+
+ @retval TRUE There is at least one script file active.
+ @retval FALSE No script files are active now.
+
+**/
+typedef
+BOOLEAN
+(EFIAPI *EFI_SHELL_BATCH_IS_ACTIVE) (
+ VOID
+ );
+
+/**
+ Closes the file handle.
+
+ This function closes a specified file handle. All 'dirty' cached file data is
+ flushed to the device, and the file is closed. In all cases, the handle is
+ closed.
+
+ @param[in] FileHandle The file handle to be closed.
+
+ @retval EFI_SUCCESS The file closed sucessfully.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_CLOSE_FILE)(
+ IN SHELL_FILE_HANDLE FileHandle
+ );
+
+/**
+ Creates a file or directory by name.
+
+ This function creates an empty new file or directory with the specified attributes and
+ returns the new file's handle. If the file already exists and is read-only, then
+ EFI_INVALID_PARAMETER will be returned.
+
+ If the file already existed, it is truncated and its attributes updated. If the file is
+ created successfully, the FileHandle is the file's handle, else, the FileHandle is NULL.
+
+ If the file name begins with >v, then the file handle which is returned refers to the
+ shell environment variable with the specified name. If the shell environment variable
+ already exists and is non-volatile then EFI_INVALID_PARAMETER is returned.
+
+ @param[in] FileName Pointer to NULL-terminated file path.
+ @param[in] FileAttribs The new file's attrbiutes. The different attributes are
+ described in EFI_FILE_PROTOCOL.Open().
+ @param[out] FileHandle On return, points to the created file handle or directory's handle.
+
+ @retval EFI_SUCCESS The file was opened. FileHandle points to the new file's handle.
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
+ @retval EFI_UNSUPPORTED The file path could not be opened.
+ @retval EFI_NOT_FOUND The specified file could not be found on the device, or could not
+ file the file system on the device.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
+ longer supported.
+ @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
+ the DirName.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
+ when the media is write-protected.
+ @retval EFI_ACCESS_DENIED The service denied access to the file.
+ @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
+ @retval EFI_VOLUME_FULL The volume is full.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_CREATE_FILE)(
+ IN CONST CHAR16 *FileName,
+ IN UINT64 FileAttribs,
+ OUT SHELL_FILE_HANDLE *FileHandle
+ );
+
+/**
+ Deletes the file specified by the file handle.
+
+ This function closes and deletes a file. In all cases, the file handle is closed. If the file
+ cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is returned, but the
+ handle is still closed.
+
+ @param[in] FileHandle The file handle to delete.
+
+ @retval EFI_SUCCESS The file was closed and deleted and the handle was closed.
+ @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_DELETE_FILE)(
+ IN SHELL_FILE_HANDLE FileHandle
+ );
+
+/**
+ Deletes the file specified by the file name.
+
+ This function deletes a file.
+
+ @param[in] FileName Points to the NULL-terminated file name.
+
+ @retval EFI_SUCCESS The file was deleted.
+ @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_DELETE_FILE_BY_NAME)(
+ IN CONST CHAR16 *FileName
+ );
+
+/**
+ Disables the page break output mode.
+**/
+typedef
+VOID
+(EFIAPI *EFI_SHELL_DISABLE_PAGE_BREAK) (
+ VOID
+ );
+
+/**
+ Enables the page break output mode.
+**/
+typedef
+VOID
+(EFIAPI *EFI_SHELL_ENABLE_PAGE_BREAK) (
+ VOID
+ );
+
+/**
+ Execute the command line.
+
+ This function creates a nested instance of the shell and executes the specified
+ command (CommandLine) with the specified environment (Environment). Upon return,
+ the status code returned by the specified command is placed in StatusCode.
+
+ If Environment is NULL, then the current environment is used and all changes made
+ by the commands executed will be reflected in the current environment. If the
+ Environment is non-NULL, then the changes made will be discarded.
+
+ The CommandLine is executed from the current working directory on the current
+ device.
+
+ @param[in] ParentImageHandle A handle of the image that is executing the specified
+ command line.
+ @param[in] CommandLine Points to the NULL-terminated UCS-2 encoded string
+ containing the command line. If NULL then the command-
+ line will be empty.
+ @param[in] Environment Points to a NULL-terminated array of environment
+ variables with the format 'x=y', where x is the
+ environment variable name and y is the value. If this
+ is NULL, then the current shell environment is used.
+ @param[out] ErrorCode Points to the status code returned by the command.
+
+ @retval EFI_SUCCESS The command executed successfully. The status code
+ returned by the command is pointed to by StatusCode.
+ @retval EFI_INVALID_PARAMETER The parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES Out of resources.
+ @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_EXECUTE) (
+ IN EFI_HANDLE *ParentImageHandle,
+ IN CHAR16 *CommandLine OPTIONAL,
+ IN CHAR16 **Environment OPTIONAL,
+ OUT EFI_STATUS *StatusCode OPTIONAL
+ );
+
+/**
+ Find files that match a specified pattern.
+
+ This function searches for all files and directories that match the specified
+ FilePattern. The FilePattern can contain wild-card characters. The resulting file
+ information is placed in the file list FileList.
+
+ The files in the file list are not opened. The OpenMode field is set to 0 and the FileInfo
+ field is set to NULL.
+
+ @param[in] FilePattern Points to a NULL-terminated shell file path, including wildcards.
+ @param[out] FileList On return, points to the start of a file list containing the names
+ of all matching files or else points to NULL if no matching files
+ were found.
+
+ @retval EFI_SUCCESS Files found.
+ @retval EFI_NOT_FOUND No files found.
+ @retval EFI_NO_MEDIA The device has no media.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_FIND_FILES)(
+ IN CONST CHAR16 *FilePattern,
+ OUT EFI_SHELL_FILE_INFO **FileList
+ );
+
+/**
+ Find all files in a specified directory.
+
+ @param[in] FileDirHandle Handle of the directory to search.
+ @param[out] FileList On return, points to the list of files in the directory
+ or NULL if there are no files in the directory.
+
+ @retval EFI_SUCCESS File information was returned successfully.
+ @retval EFI_VOLUME_CORRUPTED The file system structures have been corrupted.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_NO_MEDIA The device media is not present.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_FIND_FILES_IN_DIR)(
+IN SHELL_FILE_HANDLE FileDirHandle,
+OUT EFI_SHELL_FILE_INFO **FileList
+);
+
+/**
+ Flushes data back to a device.
+
+ This function flushes all modified data associated with a file to a device.
+
+ @param[in] FileHandle The handle of the file to flush.
+
+ @retval EFI_SUCCESS The data was flushed.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
+ @retval EFI_ACCESS_DENIED The file was opened read-only.
+ @retval EFI_VOLUME_FULL The volume is full.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_FLUSH_FILE)(
+ IN SHELL_FILE_HANDLE FileHandle
+ );
+
+/**
+ Frees the file list.
+
+ This function cleans up the file list and any related data structures. It has no
+ impact on the files themselves.
+
+ @param[in] FileList The file list to free. Type EFI_SHELL_FILE_INFO is
+ defined in OpenFileList().
+
+ @retval EFI_SUCCESS Free the file list successfully.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_FREE_FILE_LIST) (
+ IN EFI_SHELL_FILE_INFO **FileList
+ );
+
+/**
+ Returns the current directory on the specified device.
+
+ If FileSystemMapping is NULL, it returns the current working directory. If the
+ FileSystemMapping is not NULL, it returns the current directory associated with the
+ FileSystemMapping. In both cases, the returned name includes the file system
+ mapping (i.e. fs0:\current-dir).
+
+ Note that the current directory string should exclude the tailing backslash character.
+
+ @param[in] FileSystemMapping A pointer to the file system mapping. If NULL,
+ then the current working directory is returned.
+
+ @retval !=NULL The current directory.
+ @retval NULL Current directory does not exist.
+**/
+typedef
+CONST CHAR16 *
+(EFIAPI *EFI_SHELL_GET_CUR_DIR) (
+ IN CONST CHAR16 *FileSystemMapping OPTIONAL
+ );
+
+typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
+#define EFI_DEVICE_NAME_USE_COMPONENT_NAME 0x00000001
+#define EFI_DEVICE_NAME_USE_DEVICE_PATH 0x00000002
+
+/**
+ Gets the name of the device specified by the device handle.
+
+ This function gets the user-readable name of the device specified by the device
+ handle. If no user-readable name could be generated, then *BestDeviceName will be
+ NULL and EFI_NOT_FOUND will be returned.
+
+ If EFI_DEVICE_NAME_USE_COMPONENT_NAME is set, then the function will return the
+ device's name using the EFI_COMPONENT_NAME2_PROTOCOL, if present on
+ DeviceHandle.
+
+ If EFI_DEVICE_NAME_USE_DEVICE_PATH is set, then the function will return the
+ device's name using the EFI_DEVICE_PATH_PROTOCOL, if present on DeviceHandle.
+ If both EFI_DEVICE_NAME_USE_COMPONENT_NAME and
+ EFI_DEVICE_NAME_USE_DEVICE_PATH are set, then
+ EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.
+
+ @param[in] DeviceHandle The handle of the device.
+ @param[in] Flags Determines the possible sources of component names.
+ @param[in] Language A pointer to the language specified for the device
+ name, in the same format as described in the UEFI
+ specification, Appendix M.
+ @param[out] BestDeviceName On return, points to the callee-allocated NULL-
+ terminated name of the device. If no device name
+ could be found, points to NULL. The name must be
+ freed by the caller...
+
+ @retval EFI_SUCCESS Get the name successfully.
+ @retval EFI_NOT_FOUND Fail to get the device name.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_GET_DEVICE_NAME) (
+ IN EFI_HANDLE DeviceHandle,
+ IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,
+ IN CHAR8 *Language,
+ OUT CHAR16 **BestDeviceName
+ );
+
+/**
+ Gets the device path from the mapping.
+
+ This function gets the device path associated with a mapping.
+
+ @param[in] Mapping A pointer to the mapping
+
+ @retval !=NULL Pointer to the device path that corresponds to the
+ device mapping. The returned pointer does not need
+ to be freed.
+ @retval NULL There is no device path associated with the
+ specified mapping.
+**/
+typedef
+CONST EFI_DEVICE_PATH_PROTOCOL *
+(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_MAP) (
+ IN CONST CHAR16 *Mapping
+ );
+
+/**
+ Converts a file system style name to a device path.
+
+ This function converts a file system style name to a device path, by replacing any
+ mapping references to the associated device path.
+
+ @param[in] Path The pointer to the path.
+
+ @return The pointer of the file path. The file path is callee
+ allocated and should be freed by the caller.
+**/
+typedef
+EFI_DEVICE_PATH_PROTOCOL *
+(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH) (
+ IN CONST CHAR16 *Path
+ );
+
+/**
+ Gets either a single or list of environment variables.
+
+ If name is not NULL then this function returns the current value of the specified
+ environment variable.
+
+ If Name is NULL than a list of all environment variable names is returned. Each a
+ NULL terminated string with a double NULL terminating the list.
+
+ @param[in] Name A pointer to the environment variable name. If
+ Name is NULL, then the function will return all
+ of the defined shell environment variables. In
+ the case where multiple environment variables are
+ being returned, each variable will be terminated by
+ a NULL, and the list will be terminated by a double
+ NULL.
+
+ @return A pointer to the returned string.
+ The returned pointer does not need to be freed by the caller.
+
+ @retval NULL The environment variable doesn't exist or there are
+ no environment variables.
+**/
+typedef
+CONST CHAR16 *
+(EFIAPI *EFI_SHELL_GET_ENV) (
+ IN CONST CHAR16 *Name OPTIONAL
+ );
+
+/**
+ Gets the environment variable and Attributes, or list of environment variables. Can be
+ used instead of GetEnv().
+
+ This function returns the current value of the specified environment variable and
+ the Attributes. If no variable name was specified, then all of the known
+ variables will be returned.
+
+ @param[in] Name A pointer to the environment variable name. If Name is NULL,
+ then the function will return all of the defined shell
+ environment variables. In the case where multiple environment
+ variables are being returned, each variable will be terminated
+ by a NULL, and the list will be terminated by a double NULL.
+ @param[out] Attributes If not NULL, a pointer to the returned attributes bitmask for
+ the environment variable. In the case where Name is NULL, and
+ multiple environment variables are being returned, Attributes
+ is undefined.
+
+ @retval NULL The environment variable doesn't exist.
+ @return The environment variable's value. The returned pointer does not
+ need to be freed by the caller.
+**/
+typedef
+CONST CHAR16 *
+(EFIAPI *EFI_SHELL_GET_ENV_EX) (
+ IN CONST CHAR16 *Name,
+ OUT UINT32 *Attributes OPTIONAL
+ );
+
+/**
+ Gets the file information from an open file handle.
+
+ This function allocates a buffer to store the file's information. It's the caller's
+ responsibility to free the buffer.
+
+ @param[in] FileHandle A File Handle.
+
+ @retval NULL Cannot get the file info.
+ @return A pointer to a buffer with file information.
+**/
+typedef
+EFI_FILE_INFO *
+(EFIAPI *EFI_SHELL_GET_FILE_INFO)(
+ IN SHELL_FILE_HANDLE FileHandle
+ );
+
+/**
+ Converts a device path to a file system-style path.
+
+ This function converts a device path to a file system path by replacing part, or all, of
+ the device path with the file-system mapping. If there are more than one application
+ file system mappings, the one that most closely matches Path will be used.
+
+ @param[in] Path The pointer to the device path.
+
+ @return The pointer of the NULL-terminated file path. The path
+ is callee-allocated and should be freed by the caller.
+**/
+typedef
+CHAR16 *
+(EFIAPI *EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH) (
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *Path
+ );
+
+/**
+ Gets a file's current position.
+
+ This function returns the current file position for the file handle. For directories, the
+ current file position has no meaning outside of the file system driver and as such, the
+ operation is not supported.
+
+ @param[in] FileHandle The file handle on which to get the current position.
+ @param[out] Position Byte position from the start of the file.
+
+ @retval EFI_SUCCESS Data was accessed.
+ @retval EFI_UNSUPPORTED The request is not valid on open directories.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_GET_FILE_POSITION)(
+ IN SHELL_FILE_HANDLE FileHandle,
+ OUT UINT64 *Position
+ );
+
+/**
+ Gets the size of a file.
+
+ This function returns the size of the file specified by FileHandle.
+
+ @param[in] FileHandle The handle of the file.
+ @param[out] Size The size of this file.
+
+ @retval EFI_SUCCESS Get the file's size.
+ @retval EFI_DEVICE_ERROR Can't access the file.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_GET_FILE_SIZE)(
+ IN SHELL_FILE_HANDLE FileHandle,
+ OUT UINT64 *Size
+ );
+
+/**
+ Get the GUID value from a human readable name.
+
+ If GuidName is a known GUID name, then update Guid to have the correct value for
+ that GUID.
+
+ This function is only available when the major and minor versions in the
+ EfiShellProtocol are greater than or equal to 2 and 1, respectively.
+
+ @param[in] GuidName A pointer to the localized name for the GUID being queried.
+ @param[out] Guid A pointer to the GUID structure to be filled in.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_INVALID_PARAMETER Guid was NULL.
+ @retval EFI_INVALID_PARAMETER GuidName was NULL.
+ @retval EFI_NOT_FOUND GuidName is not a known GUID Name.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_GET_GUID_FROM_NAME)(
+ IN CONST CHAR16 *GuidName,
+ OUT EFI_GUID *Guid
+ );
+
+/**
+ Get the human readable name for a GUID from the value.
+
+ If Guid is assigned a name, then update *GuidName to point to the name. The callee
+ should not modify the value.
+
+ This function is only available when the major and minor versions in the
+ EfiShellProtocol are greater than or equal to 2 and 1, respectively.
+
+ @param[in] Guid A pointer to the GUID being queried.
+ @param[out] GuidName A pointer to a pointer the localized to name for the GUID being requested
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_INVALID_PARAMETER Guid was NULL.
+ @retval EFI_INVALID_PARAMETER GuidName was NULL.
+ @retval EFI_NOT_FOUND Guid is not assigned a name.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_GET_GUID_NAME)(
+ IN CONST EFI_GUID *Guid,
+ OUT CONST CHAR16 **GuidName
+ );
+
+/**
+ Return help information about a specific command.
+
+ This function returns the help information for the specified command. The help text
+ can be internal to the shell or can be from a UEFI Shell manual page.
+
+ If Sections is specified, then each section name listed will be compared in a casesensitive
+ manner, to the section names described in Appendix B. If the section exists,
+ it will be appended to the returned help text. If the section does not exist, no
+ information will be returned. If Sections is NULL, then all help text information
+ available will be returned.
+
+ @param[in] Command Points to the NULL-terminated UEFI Shell command name.
+ @param[in] Sections Points to the NULL-terminated comma-delimited
+ section names to return. If NULL, then all
+ sections will be returned.
+ @param[out] HelpText On return, points to a callee-allocated buffer
+ containing all specified help text.
+
+ @retval EFI_SUCCESS The help text was returned.
+ @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be allocated to hold the
+ returned help text.
+ @retval EFI_INVALID_PARAMETER HelpText is NULL.
+ @retval EFI_NOT_FOUND There is no help text available for Command.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_GET_HELP_TEXT) (
+ IN CONST CHAR16 *Command,
+ IN CONST CHAR16 *Sections OPTIONAL,
+ OUT CHAR16 **HelpText
+ );
+
+/**
+ Gets the mapping(s) that most closely matches the device path.
+
+ This function gets the mapping which corresponds to the device path *DevicePath. If
+ there is no exact match, then the mapping which most closely matches *DevicePath
+ is returned, and *DevicePath is updated to point to the remaining portion of the
+ device path. If there is an exact match, the mapping is returned and *DevicePath
+ points to the end-of-device-path node.
+
+ If there are multiple map names they will be semi-colon seperated in the
+ NULL-terminated string.
+
+ @param[in, out] DevicePath On entry, points to a device path pointer. On
+ exit, updates the pointer to point to the
+ portion of the device path after the mapping.
+
+ @retval NULL No mapping was found.
+ @retval !=NULL Pointer to NULL-terminated mapping. The buffer
+ is callee allocated and should be freed by the caller.
+**/
+typedef
+CONST CHAR16 *
+(EFIAPI *EFI_SHELL_GET_MAP_FROM_DEVICE_PATH) (
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
+ );
+
+/**
+ Gets the enable status of the page break output mode.
+
+ User can use this function to determine current page break mode.
+
+ @retval TRUE The page break output mode is enabled.
+ @retval FALSE The page break output mode is disabled.
+**/
+typedef
+BOOLEAN
+(EFIAPI *EFI_SHELL_GET_PAGE_BREAK) (
+ VOID
+ );
+
+/**
+ Judges whether the active shell is the root shell.
+
+ This function makes the user to know that whether the active Shell is the root shell.
+
+ @retval TRUE The active Shell is the root Shell.
+ @retval FALSE The active Shell is NOT the root Shell.
+**/
+typedef
+BOOLEAN
+(EFIAPI *EFI_SHELL_IS_ROOT_SHELL) (
+VOID
+);
+
+/**
+ Opens a file or a directory by file name.
+
+ This function opens the specified file in the specified OpenMode and returns a file
+ handle.
+ If the file name begins with '>v', then the file handle which is returned refers to the
+ shell environment variable with the specified name. If the shell environment variable
+ exists, is non-volatile and the OpenMode indicates EFI_FILE_MODE_WRITE, then
+ EFI_INVALID_PARAMETER is returned.
+
+ If the file name is '>i', then the file handle which is returned refers to the standard
+ input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then EFI_INVALID_PARAMETER
+ is returned.
+
+ If the file name is '>o', then the file handle which is returned refers to the standard
+ output. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
+ is returned.
+
+ If the file name is '>e', then the file handle which is returned refers to the standard
+ error. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
+ is returned.
+
+ If the file name is 'NUL', then the file handle that is returned refers to the standard NUL
+ file. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER is
+ returned.
+
+ If return EFI_SUCCESS, the FileHandle is the opened file's handle, else, the
+ FileHandle is NULL.
+
+ @param[in] FileName Points to the NULL-terminated UCS-2 encoded file name.
+ @param[out] FileHandle On return, points to the file handle.
+ @param[in] OpenMode File open mode. Either EFI_FILE_MODE_READ or
+ EFI_FILE_MODE_WRITE from section 12.4 of the UEFI
+ Specification.
+ @retval EFI_SUCCESS The file was opened. FileHandle has the opened file's handle.
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value. FileHandle is NULL.
+ @retval EFI_UNSUPPORTED Could not open the file path. FileHandle is NULL.
+ @retval EFI_NOT_FOUND The specified file could not be found on the device or the file
+ system could not be found on the device. FileHandle is NULL.
+ @retval EFI_NO_MEDIA The device has no medium. FileHandle is NULL.
+ @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
+ longer supported. FileHandle is NULL.
+ @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
+ the FileName. FileHandle is NULL.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. FileHandle is NULL.
+ @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
+ when the media is write-protected. FileHandle is NULL.
+ @retval EFI_ACCESS_DENIED The service denied access to the file. FileHandle is NULL.
+ @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file. FileHandle
+ is NULL.
+ @retval EFI_VOLUME_FULL The volume is full. FileHandle is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (
+ IN CONST CHAR16 *FileName,
+ OUT SHELL_FILE_HANDLE *FileHandle,
+ IN UINT64 OpenMode
+ );
+
+/**
+ Opens the files that match the path specified.
+
+ This function opens all of the files specified by Path. Wildcards are processed
+ according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each
+ matching file has an EFI_SHELL_FILE_INFO structure created in a linked list.
+
+ @param[in] Path A pointer to the path string.
+ @param[in] OpenMode Specifies the mode used to open each file, EFI_FILE_MODE_READ or
+ EFI_FILE_MODE_WRITE.
+ @param[in, out] FileList Points to the start of a list of files opened.
+
+ @retval EFI_SUCCESS Create the file list successfully.
+ @return Can't create the file list.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_OPEN_FILE_LIST) (
+ IN CHAR16 *Path,
+ IN UINT64 OpenMode,
+ IN OUT EFI_SHELL_FILE_INFO **FileList
+ );
+
+/**
+ Opens the root directory of a device.
+
+ This function opens the root directory of a device and returns a file handle to it.
+
+ @param[in] DevicePath Points to the device path corresponding to the device where the
+ EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.
+ @param[out] FileHandle On exit, points to the file handle corresponding to the root directory on the
+ device.
+
+ @retval EFI_SUCCESS Root opened successfully.
+ @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
+ could not be opened.
+ @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
+ @retval EFI_DEVICE_ERROR The device had an error.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_OPEN_ROOT)(
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ OUT SHELL_FILE_HANDLE *FileHandle
+ );
+
+/**
+ Opens the root directory of a device on a handle.
+
+ This function opens the root directory of a device and returns a file handle to it.
+
+ @param[in] DeviceHandle The handle of the device that contains the volume.
+ @param[out] FileHandle On exit, points to the file handle corresponding to the root directory on the
+ device.
+
+ @retval EFI_SUCCESS Root opened successfully.
+ @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
+ could not be opened.
+ @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
+ @retval EFI_DEVICE_ERROR The device had an error.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(
+ IN EFI_HANDLE DeviceHandle,
+ OUT SHELL_FILE_HANDLE *FileHandle
+ );
+
+/**
+ Reads data from the file.
+
+ If FileHandle is not a directory, the function reads the requested number of bytes
+ from the file at the file's current position and returns them in Buffer. If the read goes
+ beyond the end of the file, the read length is truncated to the end of the file. The file's
+ current position is increased by the number of bytes returned.
+ If FileHandle is a directory, then an error is returned.
+
+ @param[in] FileHandle The opened file handle for read.
+ @param[in] ReadSize On input, the size of Buffer, in bytes. On output, the amount of data read.
+ @param[in, out] Buffer The buffer in which data is read.
+
+ @retval EFI_SUCCESS Data was read.
+ @retval EFI_NO_MEDIA The device has no media.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required size.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_READ_FILE) (
+ IN SHELL_FILE_HANDLE FileHandle,
+ IN OUT UINTN *ReadSize,
+ IN OUT VOID *Buffer
+ );
+
+/**
+ Register a GUID and a localized human readable name for it.
+
+ If Guid is not assigned a name, then assign GuidName to Guid. This list of GUID
+ names must be used whenever a shell command outputs GUID information.
+
+ This function is only available when the major and minor versions in the
+ EfiShellProtocol are greater than or equal to 2 and 1, respectively.
+
+ @param[in] Guid A pointer to the GUID being registered.
+ @param[in] GuidName A pointer to the localized name for the GUID being registered.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_INVALID_PARAMETER Guid was NULL.
+ @retval EFI_INVALID_PARAMETER GuidName was NULL.
+ @retval EFI_ACCESS_DENIED Guid already is assigned a name.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_REGISTER_GUID_NAME)(
+ IN CONST EFI_GUID *Guid,
+ IN CONST CHAR16 *GuidName
+ );
+
+/**
+ Deletes the duplicate file names files in the given file list.
+
+ @param[in] FileList A pointer to the first entry in the file list.
+
+ @retval EFI_SUCCESS Always success.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_REMOVE_DUP_IN_FILE_LIST) (
+ IN EFI_SHELL_FILE_INFO **FileList
+ );
+
+/**
+ Changes a shell command alias.
+
+ This function creates an alias for a shell command.
+
+ @param[in] Command Points to the NULL-terminated shell command or existing alias.
+ @param[in] Alias Points to the NULL-terminated alias for the shell command. If this is NULL, and
+ Command refers to an alias, that alias will be deleted.
+ @param[in] Replace If TRUE and the alias already exists, then the existing alias will be replaced. If
+ FALSE and the alias already exists, then the existing alias is unchanged and
+ EFI_ACCESS_DENIED is returned.
+ @param[in] Volatile if TRUE the Alias being set will be stored in a volatile fashion. if FALSE the
+ Alias being set will be stored in a non-volatile fashion.
+
+ @retval EFI_SUCCESS Alias created or deleted successfully.
+ @retval EFI_ACCESS_DENIED The alias is a built-in alias or already existed and Replace was set to
+ FALSE.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_SET_ALIAS)(
+ IN CONST CHAR16 *Command,
+ IN CONST CHAR16 *Alias,
+ IN BOOLEAN Replace,
+ IN BOOLEAN Volatile
+ );
+
+/**
+ This function returns the command associated with a alias or a list of all
+ alias'.
+
+ @param[in] Alias Points to the NULL-terminated shell alias.
+ If this parameter is NULL, then all
+ aliases will be returned in ReturnedData.
+ @param[out] Volatile Upon return of a single command if TRUE indicates
+ this is stored in a volatile fashion. FALSE otherwise.
+ @return If Alias is not NULL, it will return a pointer to
+ the NULL-terminated command for that alias.
+ If Alias is NULL, ReturnedData points to a ';'
+ delimited list of alias (e.g.
+ ReturnedData = "dir;del;copy;mfp") that is NULL-terminated.
+ @retval NULL An error ocurred.
+ @retval NULL Alias was not a valid Alias.
+**/
+typedef
+CONST CHAR16 *
+(EFIAPI *EFI_SHELL_GET_ALIAS)(
+ IN CONST CHAR16 *Alias,
+ OUT BOOLEAN *Volatile OPTIONAL
+ );
+
+/**
+ Changes the current directory on the specified device.
+
+ If the FileSystem is NULL, and the directory Dir does not contain a file system's
+ mapped name, this function changes the current working directory. If FileSystem is
+ NULL and the directory Dir contains a mapped name, then the current file system and
+ the current directory on that file system are changed.
+
+ If FileSystem is not NULL, and Dir is NULL, then this changes the current working file
+ system.
+
+ If FileSystem is not NULL and Dir is not NULL, then this function changes the current
+ directory on the specified file system.
+
+ If the current working directory or the current working file system is changed then the
+ %cwd% environment variable will be updated.
+
+ @param[in] FileSystem A pointer to the file system's mapped name. If NULL, then the current working
+ directory is changed.
+ @param[in] Dir Points to the NULL-terminated directory on the device specified by FileSystem.
+
+ @retval NULL Current directory does not exist.
+ @return The current directory.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_SET_CUR_DIR) (
+ IN CONST CHAR16 *FileSystem OPTIONAL,
+ IN CONST CHAR16 *Dir
+ );
+
+/**
+ Sets the environment variable.
+
+ This function changes the current value of the specified environment variable. If the
+ environment variable exists and the Value is an empty string, then the environment
+ variable is deleted. If the environment variable exists and the Value is not an empty
+ string, then the value of the environment variable is changed. If the environment
+ variable does not exist and the Value is an empty string, there is no action. If the
+ environment variable does not exist and the Value is a non-empty string, then the
+ environment variable is created and assigned the specified value.
+
+ For a description of volatile and non-volatile environment variables, see UEFI Shell
+ 2.0 specification section 3.6.1.
+
+ @param[in] Name Points to the NULL-terminated environment variable name.
+ @param[in] Value Points to the NULL-terminated environment variable value. If the value is an
+ empty string then the environment variable is deleted.
+ @param[in] Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
+
+ @retval EFI_SUCCESS The environment variable was successfully updated.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_SET_ENV) (
+ IN CONST CHAR16 *Name,
+ IN CONST CHAR16 *Value,
+ IN BOOLEAN Volatile
+ );
+
+/**
+ Sets the file information to an opened file handle.
+
+ This function changes file information. All file information in the EFI_FILE_INFO
+ struct will be updated to the passed in data.
+
+ @param[in] FileHandle A file handle.
+ @param[in] FileInfo Points to new file information.
+
+ @retval EFI_SUCCESS The information was set.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
+ @retval EFI_ACCESS_DENIED The file was opened read-only.
+ @retval EFI_VOLUME_FULL The volume is full.
+ @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of EFI_FILE_INFO.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_SET_FILE_INFO)(
+ IN SHELL_FILE_HANDLE FileHandle,
+ IN CONST EFI_FILE_INFO *FileInfo
+ );
+
+/**
+ Sets a file's current position.
+
+ This function sets the current file position for the handle to the position supplied. With
+ the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only absolute positioning is
+ supported, and seeking past the end of the file is allowed (a subsequent write would
+ grow the file). Seeking to position 0xFFFFFFFFFFFFFFFF causes the current position
+ to be set to the end of the file.
+
+ @param[in] FileHandle The file handle on which requested position will be set.
+ @param[in] Position Byte position from the start of the file.
+
+ @retval EFI_SUCCESS Data was written.
+ @retval EFI_UNSUPPORTED The seek request for nonzero is not valid on open directories.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_SET_FILE_POSITION)(
+ IN SHELL_FILE_HANDLE FileHandle,
+ IN UINT64 Position
+ );
+
+/**
+ This function creates a mapping for a device path.
+
+ @param[in] DevicePath Points to the device path. If this is NULL and Mapping points to a valid mapping,
+ then the mapping will be deleted.
+ @param[in] Mapping Points to the NULL-terminated mapping for the device path.
+
+ @retval EFI_SUCCESS Mapping created or deleted successfully.
+ @retval EFI_NO_MAPPING There is no handle that corresponds exactly to DevicePath. See the
+ boot service function LocateDevicePath().
+ @retval EFI_ACCESS_DENIED The mapping is a built-in alias.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_SET_MAP)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN CONST CHAR16 *Mapping
+ );
+
+/**
+ Writes data to the file.
+
+ This function writes the specified number of bytes to the file at the current file position.
+ The current file position is advanced the actual number of bytes written, which is
+ returned in BufferSize. Partial writes only occur when there has been a data error
+ during the write attempt (such as "volume space full"). The file automatically grows to
+ hold the data, if required.
+
+ Direct writes to opened directories are not supported.
+
+ @param[in] FileHandle The opened file handle for writing.
+ @param[in, out] BufferSize On input, size of Buffer.
+ @param[in] Buffer The buffer in which data to write.
+
+ @retval EFI_SUCCESS Data was written.
+ @retval EFI_UNSUPPORTED Writes to open directory are not supported.
+ @retval EFI_NO_MEDIA The device has no media.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED The device is write-protected.
+ @retval EFI_ACCESS_DENIED The file was open for read only.
+ @retval EFI_VOLUME_FULL The volume is full.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_WRITE_FILE)(
+ IN SHELL_FILE_HANDLE FileHandle,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer
+ );
+
+//
+// EFI_SHELL_PROTOCOL has been updated since UEFI Shell Spec 2.0
+// Usage of this protocol will require version checking before attempting
+// to use any new members. There is no need to check the version for
+// members that existed in UEFI Shell Spec 2.0.
+//
+// Update below for any future UEFI Shell spec changes to this protocol.
+//
+// Check EFI_SHELL_PROTOCOL MajorVersion and MinorVersion:
+// if ((2 == gEfiShellProtocol->MajorVersion) &&
+// (0 == gEfiShellProtocol->MinorVersion)) {
+// //
+// // Cannot call:
+// // RegisterGuidName - UEFI Shell 2.1
+// // GetGuidName - UEFI Shell 2.1
+// // GetGuidFromName - UEFI Shell 2.1
+// // GetEnvEx - UEFI Shell 2.1
+// //
+// } else {
+// //
+// // Can use all members
+// //
+// }
+//
+typedef struct _EFI_SHELL_PROTOCOL {
+ EFI_SHELL_EXECUTE Execute;
+ EFI_SHELL_GET_ENV GetEnv;
+ EFI_SHELL_SET_ENV SetEnv;
+ EFI_SHELL_GET_ALIAS GetAlias;
+ EFI_SHELL_SET_ALIAS SetAlias;
+ EFI_SHELL_GET_HELP_TEXT GetHelpText;
+ EFI_SHELL_GET_DEVICE_PATH_FROM_MAP GetDevicePathFromMap;
+ EFI_SHELL_GET_MAP_FROM_DEVICE_PATH GetMapFromDevicePath;
+ EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH GetDevicePathFromFilePath;
+ EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH GetFilePathFromDevicePath;
+ EFI_SHELL_SET_MAP SetMap;
+ EFI_SHELL_GET_CUR_DIR GetCurDir;
+ EFI_SHELL_SET_CUR_DIR SetCurDir;
+ EFI_SHELL_OPEN_FILE_LIST OpenFileList;
+ EFI_SHELL_FREE_FILE_LIST FreeFileList;
+ EFI_SHELL_REMOVE_DUP_IN_FILE_LIST RemoveDupInFileList;
+ EFI_SHELL_BATCH_IS_ACTIVE BatchIsActive;
+ EFI_SHELL_IS_ROOT_SHELL IsRootShell;
+ EFI_SHELL_ENABLE_PAGE_BREAK EnablePageBreak;
+ EFI_SHELL_DISABLE_PAGE_BREAK DisablePageBreak;
+ EFI_SHELL_GET_PAGE_BREAK GetPageBreak;
+ EFI_SHELL_GET_DEVICE_NAME GetDeviceName;
+ EFI_SHELL_GET_FILE_INFO GetFileInfo;
+ EFI_SHELL_SET_FILE_INFO SetFileInfo;
+ EFI_SHELL_OPEN_FILE_BY_NAME OpenFileByName;
+ EFI_SHELL_CLOSE_FILE CloseFile;
+ EFI_SHELL_CREATE_FILE CreateFile;
+ EFI_SHELL_READ_FILE ReadFile;
+ EFI_SHELL_WRITE_FILE WriteFile;
+ EFI_SHELL_DELETE_FILE DeleteFile;
+ EFI_SHELL_DELETE_FILE_BY_NAME DeleteFileByName;
+ EFI_SHELL_GET_FILE_POSITION GetFilePosition;
+ EFI_SHELL_SET_FILE_POSITION SetFilePosition;
+ EFI_SHELL_FLUSH_FILE FlushFile;
+ EFI_SHELL_FIND_FILES FindFiles;
+ EFI_SHELL_FIND_FILES_IN_DIR FindFilesInDir;
+ EFI_SHELL_GET_FILE_SIZE GetFileSize;
+ EFI_SHELL_OPEN_ROOT OpenRoot;
+ EFI_SHELL_OPEN_ROOT_BY_HANDLE OpenRootByHandle;
+ EFI_EVENT ExecutionBreak;
+ UINT32 MajorVersion;
+ UINT32 MinorVersion;
+ // Added for Shell 2.1
+ EFI_SHELL_REGISTER_GUID_NAME RegisterGuidName;
+ EFI_SHELL_GET_GUID_NAME GetGuidName;
+ EFI_SHELL_GET_GUID_FROM_NAME GetGuidFromName;
+ EFI_SHELL_GET_ENV_EX GetEnvEx;
+} EFI_SHELL_PROTOCOL;
+
+extern EFI_GUID gEfiShellProtocolGuid;
+
+enum ShellVersion {
+ SHELL_MAJOR_VERSION = 2,
+ SHELL_MINOR_VERSION = 2
+};
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ShellDynamicCommand.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ShellDynamicCommand.h
new file mode 100644
index 0000000000..da2055d2d5
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ShellDynamicCommand.h
@@ -0,0 +1,85 @@
+/** @file
+ EFI Shell Dynamic Command registration protocol
+
+ (C) Copyright 2012-2014 Hewlett-Packard Development Company, L.P.<BR>
+ Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_H__
+#define __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_H__
+
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
+
+// {3C7200E9-005F-4EA4-87DE-A3DFAC8A27C3}
+#define EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_GUID \
+ { \
+ 0x3c7200e9, 0x005f, 0x4ea4, { 0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 } \
+ }
+
+
+//
+// Define for forward reference.
+//
+typedef struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL;
+
+
+/**
+ This is the shell command handler function pointer callback type. This
+ function handles the command when it is invoked in the shell.
+
+ @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
+ @param[in] SystemTable The pointer to the system table.
+ @param[in] ShellParameters The parameters associated with the command.
+ @param[in] Shell The instance of the shell protocol used in the context
+ of processing this command.
+
+ @return EFI_SUCCESS the operation was sucessful
+ @return other the operation failed.
+**/
+typedef
+SHELL_STATUS
+(EFIAPI * SHELL_COMMAND_HANDLER)(
+ IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
+ IN EFI_SYSTEM_TABLE *SystemTable,
+ IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
+ IN EFI_SHELL_PROTOCOL *Shell
+ );
+
+/**
+ This is the command help handler function pointer callback type. This
+ function is responsible for displaying help information for the associated
+ command.
+
+ @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
+ @param[in] Language The pointer to the language string to use.
+
+ @return string Pool allocated help string, must be freed by caller
+**/
+typedef
+CHAR16*
+(EFIAPI * SHELL_COMMAND_GETHELP)(
+ IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
+ IN CONST CHAR8 *Language
+ );
+
+/// EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.
+struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL {
+
+ CONST CHAR16 *CommandName;
+ SHELL_COMMAND_HANDLER Handler;
+ SHELL_COMMAND_GETHELP GetHelp;
+
+};
+
+extern EFI_GUID gEfiShellDynamicCommandProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ShellParameters.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ShellParameters.h
new file mode 100644
index 0000000000..e9c0ee5f63
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/ShellParameters.h
@@ -0,0 +1,60 @@
+/** @file
+ EFI Shell protocol as defined in the UEFI Shell 2.0 specification.
+
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_SHELL_PARAMETERS_PROTOCOL_H__
+#define __EFI_SHELL_PARAMETERS_PROTOCOL_H__
+
+#include <Protocol/Shell.h>
+
+#define EFI_SHELL_PARAMETERS_PROTOCOL_GUID \
+ { \
+ 0x752f3136, 0x4e16, 0x4fdc, { 0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca } \
+ }
+
+typedef struct _EFI_SHELL_PARAMETERS_PROTOCOL {
+ ///
+ /// Points to an Argc-element array of points to NULL-terminated strings containing
+ /// the command-line parameters. The first entry in the array is always the full file
+ /// path of the executable. Any quotation marks that were used to preserve
+ /// whitespace have been removed.
+ ///
+ CHAR16 **Argv;
+
+ ///
+ /// The number of elements in the Argv array.
+ ///
+ UINTN Argc;
+
+ ///
+ /// The file handle for the standard input for this executable. This may be different
+ /// from the ConInHandle in EFI_SYSTEM_TABLE.
+ ///
+ SHELL_FILE_HANDLE StdIn;
+
+ ///
+ /// The file handle for the standard output for this executable. This may be different
+ /// from the ConOutHandle in EFI_SYSTEM_TABLE.
+ ///
+ SHELL_FILE_HANDLE StdOut;
+
+ ///
+ /// The file handle for the standard error output for this executable. This may be
+ /// different from the StdErrHandle in EFI_SYSTEM_TABLE.
+ ///
+ SHELL_FILE_HANDLE StdErr;
+} EFI_SHELL_PARAMETERS_PROTOCOL;
+
+extern EFI_GUID gEfiShellParametersProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleFileSystem.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleFileSystem.h
new file mode 100644
index 0000000000..cf39e83c2c
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleFileSystem.h
@@ -0,0 +1,562 @@
+/** @file
+ SimpleFileSystem protocol as defined in the UEFI 2.0 specification.
+
+ The SimpleFileSystem protocol is the programmatic access to the FAT (12,16,32)
+ file system specified in UEFI 2.0. It can also be used to abstract a file
+ system other than FAT.
+
+ UEFI 2.0 can boot from any valid EFI image contained in a SimpleFileSystem.
+
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SIMPLE_FILE_SYSTEM_H__
+#define __SIMPLE_FILE_SYSTEM_H__
+
+#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \
+ { \
+ 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+ }
+
+typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
+
+typedef struct _EFI_FILE_PROTOCOL EFI_FILE_PROTOCOL;
+typedef struct _EFI_FILE_PROTOCOL *EFI_FILE_HANDLE;
+
+///
+/// Protocol GUID name defined in EFI1.1.
+///
+#define SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID
+
+///
+/// Protocol name defined in EFI1.1.
+///
+typedef EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_FILE_IO_INTERFACE;
+typedef EFI_FILE_PROTOCOL EFI_FILE;
+
+/**
+ Open the root directory on a volume.
+
+ @param This A pointer to the volume to open the root directory.
+ @param Root A pointer to the location to return the opened file handle for the
+ root directory.
+
+ @retval EFI_SUCCESS The device was opened.
+ @retval EFI_UNSUPPORTED This volume does not support the requested file system type.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_ACCESS_DENIED The service denied access to the file.
+ @retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources.
+ @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
+ longer supported. Any existing file handles for this volume are
+ no longer valid. To access the files on the new medium, the
+ volume must be reopened with OpenVolume().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME)(
+ IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,
+ OUT EFI_FILE_PROTOCOL **Root
+ );
+
+#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION 0x00010000
+
+///
+/// Revision defined in EFI1.1
+///
+#define EFI_FILE_IO_INTERFACE_REVISION EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION
+
+struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL {
+ ///
+ /// The version of the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. The version
+ /// specified by this specification is 0x00010000. All future revisions
+ /// must be backwards compatible.
+ ///
+ UINT64 Revision;
+ EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME OpenVolume;
+};
+
+/**
+ Opens a new file relative to the source file's location.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to the source location. This would typically be an open
+ handle to a directory.
+ @param NewHandle A pointer to the location to return the opened handle for the new
+ file.
+ @param FileName The Null-terminated string of the name of the file to be opened.
+ The file name may contain the following path modifiers: "\", ".",
+ and "..".
+ @param OpenMode The mode to open the file. The only valid combinations that the
+ file may be opened with are: Read, Read/Write, or Create/Read/Write.
+ @param Attributes Only valid for EFI_FILE_MODE_CREATE, in which case these are the
+ attribute bits for the newly created file.
+
+ @retval EFI_SUCCESS The file was opened.
+ @retval EFI_NOT_FOUND The specified file could not be found on the device.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
+ longer supported.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
+ when the media is write-protected.
+ @retval EFI_ACCESS_DENIED The service denied access to the file.
+ @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
+ @retval EFI_VOLUME_FULL The volume is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_OPEN)(
+ IN EFI_FILE_PROTOCOL *This,
+ OUT EFI_FILE_PROTOCOL **NewHandle,
+ IN CHAR16 *FileName,
+ IN UINT64 OpenMode,
+ IN UINT64 Attributes
+ );
+
+//
+// Open modes
+//
+#define EFI_FILE_MODE_READ 0x0000000000000001ULL
+#define EFI_FILE_MODE_WRITE 0x0000000000000002ULL
+#define EFI_FILE_MODE_CREATE 0x8000000000000000ULL
+
+//
+// File attributes
+//
+#define EFI_FILE_READ_ONLY 0x0000000000000001ULL
+#define EFI_FILE_HIDDEN 0x0000000000000002ULL
+#define EFI_FILE_SYSTEM 0x0000000000000004ULL
+#define EFI_FILE_RESERVED 0x0000000000000008ULL
+#define EFI_FILE_DIRECTORY 0x0000000000000010ULL
+#define EFI_FILE_ARCHIVE 0x0000000000000020ULL
+#define EFI_FILE_VALID_ATTR 0x0000000000000037ULL
+
+/**
+ Closes a specified file handle.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to close.
+
+ @retval EFI_SUCCESS The file was closed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_CLOSE)(
+ IN EFI_FILE_PROTOCOL *This
+ );
+
+/**
+ Close and delete the file handle.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the
+ handle to the file to delete.
+
+ @retval EFI_SUCCESS The file was closed and deleted, and the handle was closed.
+ @retval EFI_WARN_DELETE_FAILURE The handle was closed, but the file was not deleted.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_DELETE)(
+ IN EFI_FILE_PROTOCOL *This
+ );
+
+/**
+ Reads data from a file.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to read data from.
+ @param BufferSize On input, the size of the Buffer. On output, the amount of data
+ returned in Buffer. In both cases, the size is measured in bytes.
+ @param Buffer The buffer into which the data is read.
+
+ @retval EFI_SUCCESS Data was read.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_DEVICE_ERROR An attempt was made to read from a deleted file.
+ @retval EFI_DEVICE_ERROR On entry, the current file position is beyond the end of the file.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory
+ entry. BufferSize has been updated with the size
+ needed to complete the request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_READ)(
+ IN EFI_FILE_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+ );
+
+/**
+ Writes data to a file.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to write data to.
+ @param BufferSize On input, the size of the Buffer. On output, the amount of data
+ actually written. In both cases, the size is measured in bytes.
+ @param Buffer The buffer of data to write.
+
+ @retval EFI_SUCCESS Data was written.
+ @retval EFI_UNSUPPORTED Writes to open directory files are not supported.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_DEVICE_ERROR An attempt was made to write to a deleted file.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
+ @retval EFI_ACCESS_DENIED The file was opened read only.
+ @retval EFI_VOLUME_FULL The volume is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_WRITE)(
+ IN EFI_FILE_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer
+ );
+
+/**
+ Sets a file's current position.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the
+ file handle to set the requested position on.
+ @param Position The byte position from the start of the file to set.
+
+ @retval EFI_SUCCESS The position was set.
+ @retval EFI_UNSUPPORTED The seek request for nonzero is not valid on open
+ directories.
+ @retval EFI_DEVICE_ERROR An attempt was made to set the position of a deleted file.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_SET_POSITION)(
+ IN EFI_FILE_PROTOCOL *This,
+ IN UINT64 Position
+ );
+
+/**
+ Returns a file's current position.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to get the current position on.
+ @param Position The address to return the file's current position value.
+
+ @retval EFI_SUCCESS The position was returned.
+ @retval EFI_UNSUPPORTED The request is not valid on open directories.
+ @retval EFI_DEVICE_ERROR An attempt was made to get the position from a deleted file.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_GET_POSITION)(
+ IN EFI_FILE_PROTOCOL *This,
+ OUT UINT64 *Position
+ );
+
+/**
+ Returns information about a file.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle the requested information is for.
+ @param InformationType The type identifier for the information being requested.
+ @param BufferSize On input, the size of Buffer. On output, the amount of data
+ returned in Buffer. In both cases, the size is measured in bytes.
+ @param Buffer A pointer to the data buffer to return. The buffer's type is
+ indicated by InformationType.
+
+ @retval EFI_SUCCESS The information was returned.
+ @retval EFI_UNSUPPORTED The InformationType is not known.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory entry.
+ BufferSize has been updated with the size needed to complete
+ the request.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_GET_INFO)(
+ IN EFI_FILE_PROTOCOL *This,
+ IN EFI_GUID *InformationType,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+ );
+
+/**
+ Sets information about a file.
+
+ @param File A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle the information is for.
+ @param InformationType The type identifier for the information being set.
+ @param BufferSize The size, in bytes, of Buffer.
+ @param Buffer A pointer to the data buffer to write. The buffer's type is
+ indicated by InformationType.
+
+ @retval EFI_SUCCESS The information was set.
+ @retval EFI_UNSUPPORTED The InformationType is not known.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_INFO_ID and the media is
+ read-only.
+ @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_PROTOCOL_SYSTEM_INFO_ID
+ and the media is read only.
+ @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_SYSTEM_VOLUME_LABEL_ID
+ and the media is read-only.
+ @retval EFI_ACCESS_DENIED An attempt is made to change the name of a file to a
+ file that is already present.
+ @retval EFI_ACCESS_DENIED An attempt is being made to change the EFI_FILE_DIRECTORY
+ Attribute.
+ @retval EFI_ACCESS_DENIED An attempt is being made to change the size of a directory.
+ @retval EFI_ACCESS_DENIED InformationType is EFI_FILE_INFO_ID and the file was opened
+ read-only and an attempt is being made to modify a field
+ other than Attribute.
+ @retval EFI_VOLUME_FULL The volume is full.
+ @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of the type indicated
+ by InformationType.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_SET_INFO)(
+ IN EFI_FILE_PROTOCOL *This,
+ IN EFI_GUID *InformationType,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+ );
+
+/**
+ Flushes all modified data associated with a file to a device.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to flush.
+
+ @retval EFI_SUCCESS The data was flushed.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
+ @retval EFI_ACCESS_DENIED The file was opened read-only.
+ @retval EFI_VOLUME_FULL The volume is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_FLUSH)(
+ IN EFI_FILE_PROTOCOL *This
+ );
+
+typedef struct {
+ //
+ // If Event is NULL, then blocking I/O is performed.
+ // If Event is not NULL and non-blocking I/O is supported, then non-blocking I/O is performed,
+ // and Event will be signaled when the read request is completed.
+ // The caller must be prepared to handle the case where the callback associated with Event
+ // occurs before the original asynchronous I/O request call returns.
+ //
+ EFI_EVENT Event;
+
+ //
+ // Defines whether or not the signaled event encountered an error.
+ //
+ EFI_STATUS Status;
+
+ //
+ // For OpenEx(): Not Used, ignored.
+ // For ReadEx(): On input, the size of the Buffer. On output, the amount of data returned in Buffer.
+ // In both cases, the size is measured in bytes.
+ // For WriteEx(): On input, the size of the Buffer. On output, the amount of data actually written.
+ // In both cases, the size is measured in bytes.
+ // For FlushEx(): Not used, ignored.
+ //
+ UINTN BufferSize;
+
+ //
+ // For OpenEx(): Not Used, ignored.
+ // For ReadEx(): The buffer into which the data is read.
+ // For WriteEx(): The buffer of data to write.
+ // For FlushEx(): Not Used, ignored.
+ //
+ VOID *Buffer;
+} EFI_FILE_IO_TOKEN;
+
+/**
+ Opens a new file relative to the source directory's location.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to the source location.
+ @param NewHandle A pointer to the location to return the opened handle for the new
+ file.
+ @param FileName The Null-terminated string of the name of the file to be opened.
+ The file name may contain the following path modifiers: "\", ".",
+ and "..".
+ @param OpenMode The mode to open the file. The only valid combinations that the
+ file may be opened with are: Read, Read/Write, or Create/Read/Write.
+ @param Attributes Only valid for EFI_FILE_MODE_CREATE, in which case these are the
+ attribute bits for the newly created file.
+ @param Token A pointer to the token associated with the transaction.
+
+ @retval EFI_SUCCESS If Event is NULL (blocking I/O): The data was read successfully.
+ If Event is not NULL (asynchronous I/O): The request was successfully
+ queued for processing.
+ @retval EFI_NOT_FOUND The specified file could not be found on the device.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
+ longer supported.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
+ when the media is write-protected.
+ @retval EFI_ACCESS_DENIED The service denied access to the file.
+ @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
+ @retval EFI_VOLUME_FULL The volume is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_OPEN_EX)(
+ IN EFI_FILE_PROTOCOL *This,
+ OUT EFI_FILE_PROTOCOL **NewHandle,
+ IN CHAR16 *FileName,
+ IN UINT64 OpenMode,
+ IN UINT64 Attributes,
+ IN OUT EFI_FILE_IO_TOKEN *Token
+ );
+
+
+/**
+ Reads data from a file.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file handle to read data from.
+ @param Token A pointer to the token associated with the transaction.
+
+ @retval EFI_SUCCESS If Event is NULL (blocking I/O): The data was read successfully.
+ If Event is not NULL (asynchronous I/O): The request was successfully
+ queued for processing.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_DEVICE_ERROR An attempt was made to read from a deleted file.
+ @retval EFI_DEVICE_ERROR On entry, the current file position is beyond the end of the file.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_OUT_OF_RESOURCES Unable to queue the request due to lack of resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_READ_EX) (
+ IN EFI_FILE_PROTOCOL *This,
+ IN OUT EFI_FILE_IO_TOKEN *Token
+);
+
+
+/**
+ Writes data to a file.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file handle to write data to.
+ @param Token A pointer to the token associated with the transaction.
+
+ @retval EFI_SUCCESS If Event is NULL (blocking I/O): The data was read successfully.
+ If Event is not NULL (asynchronous I/O): The request was successfully
+ queued for processing.
+ @retval EFI_UNSUPPORTED Writes to open directory files are not supported.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_DEVICE_ERROR An attempt was made to write to a deleted file.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
+ @retval EFI_ACCESS_DENIED The file was opened read only.
+ @retval EFI_VOLUME_FULL The volume is full.
+ @retval EFI_OUT_OF_RESOURCES Unable to queue the request due to lack of resources.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_WRITE_EX) (
+ IN EFI_FILE_PROTOCOL *This,
+ IN OUT EFI_FILE_IO_TOKEN *Token
+);
+
+/**
+ Flushes all modified data associated with a file to a device.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to flush.
+ @param Token A pointer to the token associated with the transaction.
+
+ @retval EFI_SUCCESS If Event is NULL (blocking I/O): The data was read successfully.
+ If Event is not NULL (asynchronous I/O): The request was successfully
+ queued for processing.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
+ @retval EFI_ACCESS_DENIED The file was opened read-only.
+ @retval EFI_VOLUME_FULL The volume is full.
+ @retval EFI_OUT_OF_RESOURCES Unable to queue the request due to lack of resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_FLUSH_EX) (
+ IN EFI_FILE_PROTOCOL *This,
+ IN OUT EFI_FILE_IO_TOKEN *Token
+ );
+
+#define EFI_FILE_PROTOCOL_REVISION 0x00010000
+#define EFI_FILE_PROTOCOL_REVISION2 0x00020000
+#define EFI_FILE_PROTOCOL_LATEST_REVISION EFI_FILE_PROTOCOL_REVISION2
+
+//
+// Revision defined in EFI1.1.
+//
+#define EFI_FILE_REVISION EFI_FILE_PROTOCOL_REVISION
+
+///
+/// The EFI_FILE_PROTOCOL provides file IO access to supported file systems.
+/// An EFI_FILE_PROTOCOL provides access to a file's or directory's contents,
+/// and is also a reference to a location in the directory tree of the file system
+/// in which the file resides. With any given file handle, other files may be opened
+/// relative to this file's location, yielding new file handles.
+///
+struct _EFI_FILE_PROTOCOL {
+ ///
+ /// The version of the EFI_FILE_PROTOCOL interface. The version specified
+ /// by this specification is EFI_FILE_PROTOCOL_LATEST_REVISION.
+ /// Future versions are required to be backward compatible to version 1.0.
+ ///
+ UINT64 Revision;
+ EFI_FILE_OPEN Open;
+ EFI_FILE_CLOSE Close;
+ EFI_FILE_DELETE Delete;
+ EFI_FILE_READ Read;
+ EFI_FILE_WRITE Write;
+ EFI_FILE_GET_POSITION GetPosition;
+ EFI_FILE_SET_POSITION SetPosition;
+ EFI_FILE_GET_INFO GetInfo;
+ EFI_FILE_SET_INFO SetInfo;
+ EFI_FILE_FLUSH Flush;
+ EFI_FILE_OPEN_EX OpenEx;
+ EFI_FILE_READ_EX ReadEx;
+ EFI_FILE_WRITE_EX WriteEx;
+ EFI_FILE_FLUSH_EX FlushEx;
+};
+
+
+extern EFI_GUID gEfiSimpleFileSystemProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleNetwork.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleNetwork.h
new file mode 100644
index 0000000000..0dda83aaaf
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleNetwork.h
@@ -0,0 +1,681 @@
+/** @file
+ The EFI_SIMPLE_NETWORK_PROTOCOL provides services to initialize a network interface,
+ transmit packets, receive packets, and close a network interface.
+
+ Basic network device abstraction.
+
+ Rx - Received
+ Tx - Transmit
+ MCast - MultiCast
+ ...
+
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in EFI Specification 1.10.
+
+**/
+
+#ifndef __SIMPLE_NETWORK_H__
+#define __SIMPLE_NETWORK_H__
+
+#define EFI_SIMPLE_NETWORK_PROTOCOL_GUID \
+ { \
+ 0xA19832B9, 0xAC25, 0x11D3, {0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } \
+ }
+
+typedef struct _EFI_SIMPLE_NETWORK_PROTOCOL EFI_SIMPLE_NETWORK_PROTOCOL;
+
+
+///
+/// Protocol defined in EFI1.1.
+///
+typedef EFI_SIMPLE_NETWORK_PROTOCOL EFI_SIMPLE_NETWORK;
+
+///
+/// Simple Network Protocol data structures.
+///
+typedef struct {
+ ///
+ /// Total number of frames received. Includes frames with errors and
+ /// dropped frames.
+ ///
+ UINT64 RxTotalFrames;
+
+ ///
+ /// Number of valid frames received and copied into receive buffers.
+ ///
+ UINT64 RxGoodFrames;
+
+ ///
+ /// Number of frames below the minimum length for the media.
+ /// This would be <64 for ethernet.
+ ///
+ UINT64 RxUndersizeFrames;
+
+ ///
+ /// Number of frames longer than the maxminum length for the
+ /// media. This would be >1500 for ethernet.
+ ///
+ UINT64 RxOversizeFrames;
+
+ ///
+ /// Valid frames that were dropped because receive buffers were full.
+ ///
+ UINT64 RxDroppedFrames;
+
+ ///
+ /// Number of valid unicast frames received and not dropped.
+ ///
+ UINT64 RxUnicastFrames;
+
+ ///
+ /// Number of valid broadcast frames received and not dropped.
+ ///
+ UINT64 RxBroadcastFrames;
+
+ ///
+ /// Number of valid mutlicast frames received and not dropped.
+ ///
+ UINT64 RxMulticastFrames;
+
+ ///
+ /// Number of frames w/ CRC or alignment errors.
+ ///
+ UINT64 RxCrcErrorFrames;
+
+ ///
+ /// Total number of bytes received. Includes frames with errors
+ /// and dropped frames.
+ //
+ UINT64 RxTotalBytes;
+
+ ///
+ /// Transmit statistics.
+ ///
+ UINT64 TxTotalFrames;
+ UINT64 TxGoodFrames;
+ UINT64 TxUndersizeFrames;
+ UINT64 TxOversizeFrames;
+ UINT64 TxDroppedFrames;
+ UINT64 TxUnicastFrames;
+ UINT64 TxBroadcastFrames;
+ UINT64 TxMulticastFrames;
+ UINT64 TxCrcErrorFrames;
+ UINT64 TxTotalBytes;
+
+ ///
+ /// Number of collisions detection on this subnet.
+ ///
+ UINT64 Collisions;
+
+ ///
+ /// Number of frames destined for unsupported protocol.
+ ///
+ UINT64 UnsupportedProtocol;
+
+ ///
+ /// Number of valid frames received that were duplicated.
+ ///
+ UINT64 RxDuplicatedFrames;
+
+ ///
+ /// Number of encrypted frames received that failed to decrypt.
+ ///
+ UINT64 RxDecryptErrorFrames;
+
+ ///
+ /// Number of frames that failed to transmit after exceeding the retry limit.
+ ///
+ UINT64 TxErrorFrames;
+
+ ///
+ /// Number of frames transmitted successfully after more than one attempt.
+ ///
+ UINT64 TxRetryFrames;
+} EFI_NETWORK_STATISTICS;
+
+///
+/// The state of the network interface.
+/// When an EFI_SIMPLE_NETWORK_PROTOCOL driver initializes a
+/// network interface, the network interface is left in the EfiSimpleNetworkStopped state.
+///
+typedef enum {
+ EfiSimpleNetworkStopped,
+ EfiSimpleNetworkStarted,
+ EfiSimpleNetworkInitialized,
+ EfiSimpleNetworkMaxState
+} EFI_SIMPLE_NETWORK_STATE;
+
+#define EFI_SIMPLE_NETWORK_RECEIVE_UNICAST 0x01
+#define EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST 0x02
+#define EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST 0x04
+#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS 0x08
+#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST 0x10
+
+#define EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT 0x01
+#define EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT 0x02
+#define EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT 0x04
+#define EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT 0x08
+
+#define MAX_MCAST_FILTER_CNT 16
+typedef struct {
+ ///
+ /// Reports the current state of the network interface.
+ ///
+ UINT32 State;
+ ///
+ /// The size, in bytes, of the network interface's HW address.
+ ///
+ UINT32 HwAddressSize;
+ ///
+ /// The size, in bytes, of the network interface's media header.
+ ///
+ UINT32 MediaHeaderSize;
+ ///
+ /// The maximum size, in bytes, of the packets supported by the network interface.
+ ///
+ UINT32 MaxPacketSize;
+ ///
+ /// The size, in bytes, of the NVRAM device attached to the network interface.
+ ///
+ UINT32 NvRamSize;
+ ///
+ /// The size that must be used for all NVRAM reads and writes. The
+ /// start address for NVRAM read and write operations and the total
+ /// length of those operations, must be a multiple of this value. The
+ /// legal values for this field are 0, 1, 2, 4, and 8.
+ ///
+ UINT32 NvRamAccessSize;
+ ///
+ /// The multicast receive filter settings supported by the network interface.
+ ///
+ UINT32 ReceiveFilterMask;
+ ///
+ /// The current multicast receive filter settings.
+ ///
+ UINT32 ReceiveFilterSetting;
+ ///
+ /// The maximum number of multicast address receive filters supported by the driver.
+ ///
+ UINT32 MaxMCastFilterCount;
+ ///
+ /// The current number of multicast address receive filters.
+ ///
+ UINT32 MCastFilterCount;
+ ///
+ /// Array containing the addresses of the current multicast address receive filters.
+ ///
+ EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT];
+ ///
+ /// The current HW MAC address for the network interface.
+ ///
+ EFI_MAC_ADDRESS CurrentAddress;
+ ///
+ /// The current HW MAC address for broadcast packets.
+ ///
+ EFI_MAC_ADDRESS BroadcastAddress;
+ ///
+ /// The permanent HW MAC address for the network interface.
+ ///
+ EFI_MAC_ADDRESS PermanentAddress;
+ ///
+ /// The interface type of the network interface.
+ ///
+ UINT8 IfType;
+ ///
+ /// TRUE if the HW MAC address can be changed.
+ ///
+ BOOLEAN MacAddressChangeable;
+ ///
+ /// TRUE if the network interface can transmit more than one packet at a time.
+ ///
+ BOOLEAN MultipleTxSupported;
+ ///
+ /// TRUE if the presence of media can be determined; otherwise FALSE.
+ ///
+ BOOLEAN MediaPresentSupported;
+ ///
+ /// TRUE if media are connected to the network interface; otherwise FALSE.
+ ///
+ BOOLEAN MediaPresent;
+} EFI_SIMPLE_NETWORK_MODE;
+
+//
+// Protocol Member Functions
+//
+/**
+ Changes the state of a network interface from "stopped" to "started".
+
+ @param This Protocol instance pointer.
+
+ @retval EFI_SUCCESS The network interface was started.
+ @retval EFI_ALREADY_STARTED The network interface is already in the started state.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
+ @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
+ @retval EFI_UNSUPPORTED This function is not supported by the network interface.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_NETWORK_START)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This
+ );
+
+/**
+ Changes the state of a network interface from "started" to "stopped".
+
+ @param This Protocol instance pointer.
+
+ @retval EFI_SUCCESS The network interface was stopped.
+ @retval EFI_ALREADY_STARTED The network interface is already in the stopped state.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
+ @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
+ @retval EFI_UNSUPPORTED This function is not supported by the network interface.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_NETWORK_STOP)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This
+ );
+
+/**
+ Resets a network adapter and allocates the transmit and receive buffers
+ required by the network interface; optionally, also requests allocation
+ of additional transmit and receive buffers.
+
+ @param This The protocol instance pointer.
+ @param ExtraRxBufferSize The size, in bytes, of the extra receive buffer space
+ that the driver should allocate for the network interface.
+ Some network interfaces will not be able to use the extra
+ buffer, and the caller will not know if it is actually
+ being used.
+ @param ExtraTxBufferSize The size, in bytes, of the extra transmit buffer space
+ that the driver should allocate for the network interface.
+ Some network interfaces will not be able to use the extra
+ buffer, and the caller will not know if it is actually
+ being used.
+
+ @retval EFI_SUCCESS The network interface was initialized.
+ @retval EFI_NOT_STARTED The network interface has not been started.
+ @retval EFI_OUT_OF_RESOURCES There was not enough memory for the transmit and
+ receive buffers.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
+ @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
+ @retval EFI_UNSUPPORTED This function is not supported by the network interface.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
+ IN UINTN ExtraRxBufferSize OPTIONAL,
+ IN UINTN ExtraTxBufferSize OPTIONAL
+ );
+
+/**
+ Resets a network adapter and re-initializes it with the parameters that were
+ provided in the previous call to Initialize().
+
+ @param This The protocol instance pointer.
+ @param ExtendedVerification Indicates that the driver may perform a more
+ exhaustive verification operation of the device
+ during reset.
+
+ @retval EFI_SUCCESS The network interface was reset.
+ @retval EFI_NOT_STARTED The network interface has not been started.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
+ @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
+ @retval EFI_UNSUPPORTED This function is not supported by the network interface.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_NETWORK_RESET)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+ );
+
+/**
+ Resets a network adapter and leaves it in a state that is safe for
+ another driver to initialize.
+
+ @param This Protocol instance pointer.
+
+ @retval EFI_SUCCESS The network interface was shutdown.
+ @retval EFI_NOT_STARTED The network interface has not been started.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
+ @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
+ @retval EFI_UNSUPPORTED This function is not supported by the network interface.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This
+ );
+
+/**
+ Manages the multicast receive filters of a network interface.
+
+ @param This The protocol instance pointer.
+ @param Enable A bit mask of receive filters to enable on the network interface.
+ @param Disable A bit mask of receive filters to disable on the network interface.
+ @param ResetMCastFilter Set to TRUE to reset the contents of the multicast receive
+ filters on the network interface to their default values.
+ @param McastFilterCnt Number of multicast HW MAC addresses in the new
+ MCastFilter list. This value must be less than or equal to
+ the MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE. This
+ field is optional if ResetMCastFilter is TRUE.
+ @param MCastFilter A pointer to a list of new multicast receive filter HW MAC
+ addresses. This list will replace any existing multicast
+ HW MAC address list. This field is optional if
+ ResetMCastFilter is TRUE.
+
+ @retval EFI_SUCCESS The multicast receive filter list was updated.
+ @retval EFI_NOT_STARTED The network interface has not been started.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
+ @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
+ @retval EFI_UNSUPPORTED This function is not supported by the network interface.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
+ IN UINT32 Enable,
+ IN UINT32 Disable,
+ IN BOOLEAN ResetMCastFilter,
+ IN UINTN MCastFilterCnt OPTIONAL,
+ IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL
+ );
+
+/**
+ Modifies or resets the current station address, if supported.
+
+ @param This The protocol instance pointer.
+ @param Reset Flag used to reset the station address to the network interfaces
+ permanent address.
+ @param New The new station address to be used for the network interface.
+
+ @retval EFI_SUCCESS The network interfaces station address was updated.
+ @retval EFI_NOT_STARTED The network interface has not been started.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
+ @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
+ @retval EFI_UNSUPPORTED This function is not supported by the network interface.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
+ IN BOOLEAN Reset,
+ IN EFI_MAC_ADDRESS *New OPTIONAL
+ );
+
+/**
+ Resets or collects the statistics on a network interface.
+
+ @param This Protocol instance pointer.
+ @param Reset Set to TRUE to reset the statistics for the network interface.
+ @param StatisticsSize On input the size, in bytes, of StatisticsTable. On
+ output the size, in bytes, of the resulting table of
+ statistics.
+ @param StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that
+ contains the statistics.
+
+ @retval EFI_SUCCESS The statistics were collected from the network interface.
+ @retval EFI_NOT_STARTED The network interface has not been started.
+ @retval EFI_BUFFER_TOO_SMALL The Statistics buffer was too small. The current buffer
+ size needed to hold the statistics is returned in
+ StatisticsSize.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
+ @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
+ @retval EFI_UNSUPPORTED This function is not supported by the network interface.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
+ IN BOOLEAN Reset,
+ IN OUT UINTN *StatisticsSize OPTIONAL,
+ OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL
+ );
+
+/**
+ Converts a multicast IP address to a multicast HW MAC address.
+
+ @param This The protocol instance pointer.
+ @param IPv6 Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set
+ to FALSE if the multicast IP address is IPv4 [RFC 791].
+ @param IP The multicast IP address that is to be converted to a multicast
+ HW MAC address.
+ @param MAC The multicast HW MAC address that is to be generated from IP.
+
+ @retval EFI_SUCCESS The multicast IP address was mapped to the multicast
+ HW MAC address.
+ @retval EFI_NOT_STARTED The network interface has not been started.
+ @retval EFI_BUFFER_TOO_SMALL The Statistics buffer was too small. The current buffer
+ size needed to hold the statistics is returned in
+ StatisticsSize.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
+ @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
+ @retval EFI_UNSUPPORTED This function is not supported by the network interface.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
+ IN BOOLEAN IPv6,
+ IN EFI_IP_ADDRESS *IP,
+ OUT EFI_MAC_ADDRESS *MAC
+ );
+
+/**
+ Performs read and write operations on the NVRAM device attached to a
+ network interface.
+
+ @param This The protocol instance pointer.
+ @param ReadWrite TRUE for read operations, FALSE for write operations.
+ @param Offset Byte offset in the NVRAM device at which to start the read or
+ write operation. This must be a multiple of NvRamAccessSize and
+ less than NvRamSize.
+ @param BufferSize The number of bytes to read or write from the NVRAM device.
+ This must also be a multiple of NvramAccessSize.
+ @param Buffer A pointer to the data buffer.
+
+ @retval EFI_SUCCESS The NVRAM access was performed.
+ @retval EFI_NOT_STARTED The network interface has not been started.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
+ @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
+ @retval EFI_UNSUPPORTED This function is not supported by the network interface.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_NETWORK_NVDATA)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
+ IN BOOLEAN ReadWrite,
+ IN UINTN Offset,
+ IN UINTN BufferSize,
+ IN OUT VOID *Buffer
+ );
+
+/**
+ Reads the current interrupt status and recycled transmit buffer status from
+ a network interface.
+
+ @param This The protocol instance pointer.
+ @param InterruptStatus A pointer to the bit mask of the currently active interrupts
+ If this is NULL, the interrupt status will not be read from
+ the device. If this is not NULL, the interrupt status will
+ be read from the device. When the interrupt status is read,
+ it will also be cleared. Clearing the transmit interrupt
+ does not empty the recycled transmit buffer array.
+ @param TxBuf Recycled transmit buffer address. The network interface will
+ not transmit if its internal recycled transmit buffer array
+ is full. Reading the transmit buffer does not clear the
+ transmit interrupt. If this is NULL, then the transmit buffer
+ status will not be read. If there are no transmit buffers to
+ recycle and TxBuf is not NULL, * TxBuf will be set to NULL.
+
+ @retval EFI_SUCCESS The status of the network interface was retrieved.
+ @retval EFI_NOT_STARTED The network interface has not been started.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
+ @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
+ @retval EFI_UNSUPPORTED This function is not supported by the network interface.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
+ OUT UINT32 *InterruptStatus OPTIONAL,
+ OUT VOID **TxBuf OPTIONAL
+ );
+
+/**
+ Places a packet in the transmit queue of a network interface.
+
+ @param This The protocol instance pointer.
+ @param HeaderSize The size, in bytes, of the media header to be filled in by
+ the Transmit() function. If HeaderSize is non-zero, then it
+ must be equal to This->Mode->MediaHeaderSize and the DestAddr
+ and Protocol parameters must not be NULL.
+ @param BufferSize The size, in bytes, of the entire packet (media header and
+ data) to be transmitted through the network interface.
+ @param Buffer A pointer to the packet (media header followed by data) to be
+ transmitted. This parameter cannot be NULL. If HeaderSize is zero,
+ then the media header in Buffer must already be filled in by the
+ caller. If HeaderSize is non-zero, then the media header will be
+ filled in by the Transmit() function.
+ @param SrcAddr The source HW MAC address. If HeaderSize is zero, then this parameter
+ is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then
+ This->Mode->CurrentAddress is used for the source HW MAC address.
+ @param DestAddr The destination HW MAC address. If HeaderSize is zero, then this
+ parameter is ignored.
+ @param Protocol The type of header to build. If HeaderSize is zero, then this
+ parameter is ignored. See RFC 1700, section "Ether Types", for
+ examples.
+
+ @retval EFI_SUCCESS The packet was placed on the transmit queue.
+ @retval EFI_NOT_STARTED The network interface has not been started.
+ @retval EFI_NOT_READY The network interface is too busy to accept this transmit request.
+ @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
+ @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
+ @retval EFI_UNSUPPORTED This function is not supported by the network interface.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
+ IN UINTN HeaderSize,
+ IN UINTN BufferSize,
+ IN VOID *Buffer,
+ IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
+ IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,
+ IN UINT16 *Protocol OPTIONAL
+ );
+
+/**
+ Receives a packet from a network interface.
+
+ @param This The protocol instance pointer.
+ @param HeaderSize The size, in bytes, of the media header received on the network
+ interface. If this parameter is NULL, then the media header size
+ will not be returned.
+ @param BufferSize On entry, the size, in bytes, of Buffer. On exit, the size, in
+ bytes, of the packet that was received on the network interface.
+ @param Buffer A pointer to the data buffer to receive both the media header and
+ the data.
+ @param SrcAddr The source HW MAC address. If this parameter is NULL, the
+ HW MAC source address will not be extracted from the media
+ header.
+ @param DestAddr The destination HW MAC address. If this parameter is NULL,
+ the HW MAC destination address will not be extracted from the
+ media header.
+ @param Protocol The media header type. If this parameter is NULL, then the
+ protocol will not be extracted from the media header. See
+ RFC 1700 section "Ether Types" for examples.
+
+ @retval EFI_SUCCESS The received data was stored in Buffer, and BufferSize has
+ been updated to the number of bytes received.
+ @retval EFI_NOT_STARTED The network interface has not been started.
+ @retval EFI_NOT_READY The network interface is too busy to accept this transmit
+ request.
+ @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
+ @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
+ @retval EFI_UNSUPPORTED This function is not supported by the network interface.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
+ OUT UINTN *HeaderSize OPTIONAL,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer,
+ OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
+ OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL,
+ OUT UINT16 *Protocol OPTIONAL
+ );
+
+#define EFI_SIMPLE_NETWORK_PROTOCOL_REVISION 0x00010000
+
+//
+// Revision defined in EFI1.1
+//
+#define EFI_SIMPLE_NETWORK_INTERFACE_REVISION EFI_SIMPLE_NETWORK_PROTOCOL_REVISION
+
+///
+/// The EFI_SIMPLE_NETWORK_PROTOCOL protocol is used to initialize access
+/// to a network adapter. Once the network adapter initializes,
+/// the EFI_SIMPLE_NETWORK_PROTOCOL protocol provides services that
+/// allow packets to be transmitted and received.
+///
+struct _EFI_SIMPLE_NETWORK_PROTOCOL {
+ ///
+ /// Revision of the EFI_SIMPLE_NETWORK_PROTOCOL. All future revisions must
+ /// be backwards compatible. If a future version is not backwards compatible
+ /// it is not the same GUID.
+ ///
+ UINT64 Revision;
+ EFI_SIMPLE_NETWORK_START Start;
+ EFI_SIMPLE_NETWORK_STOP Stop;
+ EFI_SIMPLE_NETWORK_INITIALIZE Initialize;
+ EFI_SIMPLE_NETWORK_RESET Reset;
+ EFI_SIMPLE_NETWORK_SHUTDOWN Shutdown;
+ EFI_SIMPLE_NETWORK_RECEIVE_FILTERS ReceiveFilters;
+ EFI_SIMPLE_NETWORK_STATION_ADDRESS StationAddress;
+ EFI_SIMPLE_NETWORK_STATISTICS Statistics;
+ EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC MCastIpToMac;
+ EFI_SIMPLE_NETWORK_NVDATA NvData;
+ EFI_SIMPLE_NETWORK_GET_STATUS GetStatus;
+ EFI_SIMPLE_NETWORK_TRANSMIT Transmit;
+ EFI_SIMPLE_NETWORK_RECEIVE Receive;
+ ///
+ /// Event used with WaitForEvent() to wait for a packet to be received.
+ ///
+ EFI_EVENT WaitForPacket;
+ ///
+ /// Pointer to the EFI_SIMPLE_NETWORK_MODE data for the device.
+ ///
+ EFI_SIMPLE_NETWORK_MODE *Mode;
+};
+
+extern EFI_GUID gEfiSimpleNetworkProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimplePointer.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimplePointer.h
new file mode 100644
index 0000000000..d8c0757f62
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimplePointer.h
@@ -0,0 +1,143 @@
+/** @file
+ Simple Pointer protocol from the UEFI 2.0 specification.
+
+ Abstraction of a very simple pointer device like a mouse or trackball.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SIMPLE_POINTER_H__
+#define __SIMPLE_POINTER_H__
+
+#define EFI_SIMPLE_POINTER_PROTOCOL_GUID \
+ { \
+ 0x31878c87, 0xb75, 0x11d5, {0x9a, 0x4f, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
+ }
+
+typedef struct _EFI_SIMPLE_POINTER_PROTOCOL EFI_SIMPLE_POINTER_PROTOCOL;
+
+//
+// Data structures
+//
+typedef struct {
+ ///
+ /// The signed distance in counts that the pointer device has been moved along the x-axis.
+ ///
+ INT32 RelativeMovementX;
+ ///
+ /// The signed distance in counts that the pointer device has been moved along the y-axis.
+ ///
+ INT32 RelativeMovementY;
+ ///
+ /// The signed distance in counts that the pointer device has been moved along the z-axis.
+ ///
+ INT32 RelativeMovementZ;
+ ///
+ /// If TRUE, then the left button of the pointer device is being
+ /// pressed. If FALSE, then the left button of the pointer device is not being pressed.
+ ///
+ BOOLEAN LeftButton;
+ ///
+ /// If TRUE, then the right button of the pointer device is being
+ /// pressed. If FALSE, then the right button of the pointer device is not being pressed.
+ ///
+ BOOLEAN RightButton;
+} EFI_SIMPLE_POINTER_STATE;
+
+typedef struct {
+ ///
+ /// The resolution of the pointer device on the x-axis in counts/mm.
+ /// If 0, then the pointer device does not support an x-axis.
+ ///
+ UINT64 ResolutionX;
+ ///
+ /// The resolution of the pointer device on the y-axis in counts/mm.
+ /// If 0, then the pointer device does not support an x-axis.
+ ///
+ UINT64 ResolutionY;
+ ///
+ /// The resolution of the pointer device on the z-axis in counts/mm.
+ /// If 0, then the pointer device does not support an x-axis.
+ ///
+ UINT64 ResolutionZ;
+ ///
+ /// TRUE if a left button is present on the pointer device. Otherwise FALSE.
+ ///
+ BOOLEAN LeftButton;
+ ///
+ /// TRUE if a right button is present on the pointer device. Otherwise FALSE.
+ ///
+ BOOLEAN RightButton;
+} EFI_SIMPLE_POINTER_MODE;
+
+/**
+ Resets the pointer device hardware.
+
+ @param This A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
+ instance.
+ @param ExtendedVerification Indicates that the driver may perform a more exhaustive
+ verification operation of the device during reset.
+
+ @retval EFI_SUCCESS The device was reset.
+ @retval EFI_DEVICE_ERROR The device is not functioning correctly and could not be reset.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_POINTER_RESET)(
+ IN EFI_SIMPLE_POINTER_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+ );
+
+/**
+ Retrieves the current state of a pointer device.
+
+ @param This A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
+ instance.
+ @param State A pointer to the state information on the pointer device.
+
+ @retval EFI_SUCCESS The state of the pointer device was returned in State.
+ @retval EFI_NOT_READY The state of the pointer device has not changed since the last call to
+ GetState().
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to retrieve the pointer device's
+ current state.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_POINTER_GET_STATE)(
+ IN EFI_SIMPLE_POINTER_PROTOCOL *This,
+ IN OUT EFI_SIMPLE_POINTER_STATE *State
+ );
+
+///
+/// The EFI_SIMPLE_POINTER_PROTOCOL provides a set of services for a pointer
+/// device that can use used as an input device from an application written
+/// to this specification. The services include the ability to reset the
+/// pointer device, retrieve get the state of the pointer device, and
+/// retrieve the capabilities of the pointer device.
+///
+struct _EFI_SIMPLE_POINTER_PROTOCOL {
+ EFI_SIMPLE_POINTER_RESET Reset;
+ EFI_SIMPLE_POINTER_GET_STATE GetState;
+ ///
+ /// Event to use with WaitForEvent() to wait for input from the pointer device.
+ ///
+ EFI_EVENT WaitForInput;
+ ///
+ /// Pointer to EFI_SIMPLE_POINTER_MODE data.
+ ///
+ EFI_SIMPLE_POINTER_MODE *Mode;
+};
+
+extern EFI_GUID gEfiSimplePointerProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleTextIn.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleTextIn.h
new file mode 100644
index 0000000000..d8df5537aa
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleTextIn.h
@@ -0,0 +1,133 @@
+/** @file
+ Simple Text Input protocol from the UEFI 2.0 specification.
+
+ Abstraction of a very simple input device like a keyboard or serial
+ terminal.
+
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SIMPLE_TEXT_IN_PROTOCOL_H__
+#define __SIMPLE_TEXT_IN_PROTOCOL_H__
+
+#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
+ { \
+ 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+ }
+
+typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
+
+///
+/// Protocol GUID name defined in EFI1.1.
+///
+#define SIMPLE_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID
+
+///
+/// Protocol name in EFI1.1 for backward-compatible.
+///
+typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL SIMPLE_INPUT_INTERFACE;
+
+///
+/// The keystroke information for the key that was pressed.
+///
+typedef struct {
+ UINT16 ScanCode;
+ CHAR16 UnicodeChar;
+} EFI_INPUT_KEY;
+
+//
+// Required unicode control chars
+//
+#define CHAR_BACKSPACE 0x0008
+#define CHAR_TAB 0x0009
+#define CHAR_LINEFEED 0x000A
+#define CHAR_CARRIAGE_RETURN 0x000D
+
+//
+// EFI Scan codes
+//
+#define SCAN_NULL 0x0000
+#define SCAN_UP 0x0001
+#define SCAN_DOWN 0x0002
+#define SCAN_RIGHT 0x0003
+#define SCAN_LEFT 0x0004
+#define SCAN_HOME 0x0005
+#define SCAN_END 0x0006
+#define SCAN_INSERT 0x0007
+#define SCAN_DELETE 0x0008
+#define SCAN_PAGE_UP 0x0009
+#define SCAN_PAGE_DOWN 0x000A
+#define SCAN_F1 0x000B
+#define SCAN_F2 0x000C
+#define SCAN_F3 0x000D
+#define SCAN_F4 0x000E
+#define SCAN_F5 0x000F
+#define SCAN_F6 0x0010
+#define SCAN_F7 0x0011
+#define SCAN_F8 0x0012
+#define SCAN_F9 0x0013
+#define SCAN_F10 0x0014
+#define SCAN_ESC 0x0017
+
+/**
+ Reset the input device and optionally run diagnostics
+
+ @param This Protocol instance pointer.
+ @param ExtendedVerification Driver may perform diagnostics on reset.
+
+ @retval EFI_SUCCESS The device was reset.
+ @retval EFI_DEVICE_ERROR The device is not functioning properly and could not be reset.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_INPUT_RESET)(
+ IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+ );
+
+/**
+ Reads the next keystroke from the input device. The WaitForKey Event can
+ be used to test for existence of a keystroke via WaitForEvent () call.
+
+ @param This Protocol instance pointer.
+ @param Key A pointer to a buffer that is filled in with the keystroke
+ information for the key that was pressed.
+
+ @retval EFI_SUCCESS The keystroke information was returned.
+ @retval EFI_NOT_READY There was no keystroke data available.
+ @retval EFI_DEVICE_ERROR The keystroke information was not returned due to
+ hardware errors.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_INPUT_READ_KEY)(
+ IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
+ OUT EFI_INPUT_KEY *Key
+ );
+
+///
+/// The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device.
+/// It is the minimum required protocol for ConsoleIn.
+///
+struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
+ EFI_INPUT_RESET Reset;
+ EFI_INPUT_READ_KEY ReadKeyStroke;
+ ///
+ /// Event to use with WaitForEvent() to wait for a key to be available
+ ///
+ EFI_EVENT WaitForKey;
+};
+
+extern EFI_GUID gEfiSimpleTextInProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleTextInEx.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleTextInEx.h
new file mode 100644
index 0000000000..14bd2972fe
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleTextInEx.h
@@ -0,0 +1,326 @@
+/** @file
+ Simple Text Input Ex protocol from the UEFI 2.0 specification.
+
+ This protocol defines an extension to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL
+ which exposes much more state and modifier information from the input device,
+ also allows one to register a notification for a particular keystroke.
+
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SIMPLE_TEXT_IN_EX_H__
+#define __SIMPLE_TEXT_IN_EX_H__
+
+#include <Protocol/SimpleTextIn.h>
+
+#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \
+ {0xdd9e7534, 0x7762, 0x4698, { 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa } }
+
+
+typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL;
+
+/**
+ The Reset() function resets the input device hardware. As part
+ of initialization process, the firmware/device will make a quick
+ but reasonable attempt to verify that the device is functioning.
+ If the ExtendedVerification flag is TRUE the firmware may take
+ an extended amount of time to verify the device is operating on
+ reset. Otherwise the reset operation is to occur as quickly as
+ possible. The hardware verification process is not defined by
+ this specification and is left up to the platform firmware or
+ driver to implement.
+
+ @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.
+
+ @param ExtendedVerification Indicates that the driver may
+ perform a more exhaustive
+ verification operation of the
+ device during reset.
+
+
+ @retval EFI_SUCCESS The device was reset.
+
+ @retval EFI_DEVICE_ERROR The device is not functioning
+ correctly and could not be reset.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_INPUT_RESET_EX)(
+ IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+);
+
+
+///
+/// EFI_KEY_TOGGLE_STATE. The toggle states are defined.
+/// They are: EFI_TOGGLE_STATE_VALID, EFI_SCROLL_LOCK_ACTIVE
+/// EFI_NUM_LOCK_ACTIVE, EFI_CAPS_LOCK_ACTIVE
+///
+typedef UINT8 EFI_KEY_TOGGLE_STATE;
+
+typedef struct _EFI_KEY_STATE {
+ ///
+ /// Reflects the currently pressed shift
+ /// modifiers for the input device. The
+ /// returned value is valid only if the high
+ /// order bit has been set.
+ ///
+ UINT32 KeyShiftState;
+ ///
+ /// Reflects the current internal state of
+ /// various toggled attributes. The returned
+ /// value is valid only if the high order
+ /// bit has been set.
+ ///
+ EFI_KEY_TOGGLE_STATE KeyToggleState;
+} EFI_KEY_STATE;
+
+typedef struct {
+ ///
+ /// The EFI scan code and Unicode value returned from the input device.
+ ///
+ EFI_INPUT_KEY Key;
+ ///
+ /// The current state of various toggled attributes as well as input modifier values.
+ ///
+ EFI_KEY_STATE KeyState;
+} EFI_KEY_DATA;
+
+//
+// Any Shift or Toggle State that is valid should have
+// high order bit set.
+//
+// Shift state
+//
+#define EFI_SHIFT_STATE_VALID 0x80000000
+#define EFI_RIGHT_SHIFT_PRESSED 0x00000001
+#define EFI_LEFT_SHIFT_PRESSED 0x00000002
+#define EFI_RIGHT_CONTROL_PRESSED 0x00000004
+#define EFI_LEFT_CONTROL_PRESSED 0x00000008
+#define EFI_RIGHT_ALT_PRESSED 0x00000010
+#define EFI_LEFT_ALT_PRESSED 0x00000020
+#define EFI_RIGHT_LOGO_PRESSED 0x00000040
+#define EFI_LEFT_LOGO_PRESSED 0x00000080
+#define EFI_MENU_KEY_PRESSED 0x00000100
+#define EFI_SYS_REQ_PRESSED 0x00000200
+
+//
+// Toggle state
+//
+#define EFI_TOGGLE_STATE_VALID 0x80
+#define EFI_KEY_STATE_EXPOSED 0x40
+#define EFI_SCROLL_LOCK_ACTIVE 0x01
+#define EFI_NUM_LOCK_ACTIVE 0x02
+#define EFI_CAPS_LOCK_ACTIVE 0x04
+
+//
+// EFI Scan codes
+//
+#define SCAN_F11 0x0015
+#define SCAN_F12 0x0016
+#define SCAN_PAUSE 0x0048
+#define SCAN_F13 0x0068
+#define SCAN_F14 0x0069
+#define SCAN_F15 0x006A
+#define SCAN_F16 0x006B
+#define SCAN_F17 0x006C
+#define SCAN_F18 0x006D
+#define SCAN_F19 0x006E
+#define SCAN_F20 0x006F
+#define SCAN_F21 0x0070
+#define SCAN_F22 0x0071
+#define SCAN_F23 0x0072
+#define SCAN_F24 0x0073
+#define SCAN_MUTE 0x007F
+#define SCAN_VOLUME_UP 0x0080
+#define SCAN_VOLUME_DOWN 0x0081
+#define SCAN_BRIGHTNESS_UP 0x0100
+#define SCAN_BRIGHTNESS_DOWN 0x0101
+#define SCAN_SUSPEND 0x0102
+#define SCAN_HIBERNATE 0x0103
+#define SCAN_TOGGLE_DISPLAY 0x0104
+#define SCAN_RECOVERY 0x0105
+#define SCAN_EJECT 0x0106
+
+/**
+ The function reads the next keystroke from the input device. If
+ there is no pending keystroke the function returns
+ EFI_NOT_READY. If there is a pending keystroke, then
+ KeyData.Key.ScanCode is the EFI scan code defined in Error!
+ Reference source not found. The KeyData.Key.UnicodeChar is the
+ actual printable character or is zero if the key does not
+ represent a printable character (control key, function key,
+ etc.). The KeyData.KeyState is shift state for the character
+ reflected in KeyData.Key.UnicodeChar or KeyData.Key.ScanCode .
+ When interpreting the data from this function, it should be
+ noted that if a class of printable characters that are
+ normally adjusted by shift modifiers (e.g. Shift Key + "f"
+ key) would be presented solely as a KeyData.Key.UnicodeChar
+ without the associated shift state. So in the previous example
+ of a Shift Key + "f" key being pressed, the only pertinent
+ data returned would be KeyData.Key.UnicodeChar with the value
+ of "F". This of course would not typically be the case for
+ non-printable characters such as the pressing of the Right
+ Shift Key + F10 key since the corresponding returned data
+ would be reflected both in the KeyData.KeyState.KeyShiftState
+ and KeyData.Key.ScanCode values. UEFI drivers which implement
+ the EFI_SIMPLE_TEXT_INPUT_EX protocol are required to return
+ KeyData.Key and KeyData.KeyState values. These drivers must
+ always return the most current state of
+ KeyData.KeyState.KeyShiftState and
+ KeyData.KeyState.KeyToggleState. It should also be noted that
+ certain input devices may not be able to produce shift or toggle
+ state information, and in those cases the high order bit in the
+ respective Toggle and Shift state fields should not be active.
+
+
+ @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.
+
+ @param KeyData A pointer to a buffer that is filled in with
+ the keystroke state data for the key that was
+ pressed.
+
+
+ @retval EFI_SUCCESS The keystroke information was
+ returned.
+
+ @retval EFI_NOT_READY There was no keystroke data available.
+ EFI_DEVICE_ERROR The keystroke
+ information was not returned due to
+ hardware errors.
+
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_INPUT_READ_KEY_EX)(
+ IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
+ OUT EFI_KEY_DATA *KeyData
+);
+
+/**
+ The SetState() function allows the input device hardware to
+ have state settings adjusted.
+
+ @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.
+
+ @param KeyToggleState Pointer to the EFI_KEY_TOGGLE_STATE to
+ set the state for the input device.
+
+
+ @retval EFI_SUCCESS The device state was set appropriately.
+
+ @retval EFI_DEVICE_ERROR The device is not functioning
+ correctly and could not have the
+ setting adjusted.
+
+ @retval EFI_UNSUPPORTED The device does not support the
+ ability to have its state set.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SET_STATE)(
+ IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
+ IN EFI_KEY_TOGGLE_STATE *KeyToggleState
+);
+
+///
+/// The function will be called when the key sequence is typed specified by KeyData.
+///
+typedef
+EFI_STATUS
+(EFIAPI *EFI_KEY_NOTIFY_FUNCTION)(
+ IN EFI_KEY_DATA *KeyData
+);
+
+/**
+ The RegisterKeystrokeNotify() function registers a function
+ which will be called when a specified keystroke will occur.
+
+ @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.
+
+ @param KeyData A pointer to a buffer that is filled in with
+ the keystroke information for the key that was
+ pressed. If KeyData.Key, KeyData.KeyState.KeyToggleState
+ and KeyData.KeyState.KeyShiftState are 0, then any incomplete
+ keystroke will trigger a notification of the KeyNotificationFunction.
+
+ @param KeyNotificationFunction Points to the function to be called when the key sequence
+ is typed specified by KeyData. This notification function
+ should be called at <=TPL_CALLBACK.
+
+
+ @param NotifyHandle Points to the unique handle assigned to
+ the registered notification.
+
+ @retval EFI_SUCCESS Key notify was registered successfully.
+
+ @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary
+ data structures.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY)(
+ IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
+ IN EFI_KEY_DATA *KeyData,
+ IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
+ OUT VOID **NotifyHandle
+);
+
+/**
+ The UnregisterKeystrokeNotify() function removes the
+ notification which was previously registered.
+
+ @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.
+
+ @param NotificationHandle The handle of the notification
+ function being unregistered.
+
+ @retval EFI_SUCCESS Key notify was unregistered successfully.
+
+ @retval EFI_INVALID_PARAMETER The NotificationHandle is
+ invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY)(
+ IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
+ IN VOID *NotificationHandle
+);
+
+
+///
+/// The EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL is used on the ConsoleIn
+/// device. It is an extension to the Simple Text Input protocol
+/// which allows a variety of extended shift state information to be
+/// returned.
+///
+struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL{
+ EFI_INPUT_RESET_EX Reset;
+ EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx;
+ ///
+ /// Event to use with WaitForEvent() to wait for a key to be available.
+ ///
+ EFI_EVENT WaitForKeyEx;
+ EFI_SET_STATE SetState;
+ EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify;
+ EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify;
+};
+
+
+extern EFI_GUID gEfiSimpleTextInputExProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleTextOut.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleTextOut.h
new file mode 100644
index 0000000000..4d2612c0a9
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SimpleTextOut.h
@@ -0,0 +1,415 @@
+/** @file
+ Simple Text Out protocol from the UEFI 2.0 specification.
+
+ Abstraction of a very simple text based output device like VGA text mode or
+ a serial terminal. The Simple Text Out protocol instance can represent
+ a single hardware device or a virtual device that is an aggregation
+ of multiple physical devices.
+
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SIMPLE_TEXT_OUT_H__
+#define __SIMPLE_TEXT_OUT_H__
+
+#define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \
+ { \
+ 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+ }
+
+///
+/// Protocol GUID defined in EFI1.1.
+///
+#define SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID
+
+typedef struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
+
+///
+/// Backward-compatible with EFI1.1.
+///
+typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SIMPLE_TEXT_OUTPUT_INTERFACE;
+
+//
+// Define's for required EFI Unicode Box Draw characters
+//
+#define BOXDRAW_HORIZONTAL 0x2500
+#define BOXDRAW_VERTICAL 0x2502
+#define BOXDRAW_DOWN_RIGHT 0x250c
+#define BOXDRAW_DOWN_LEFT 0x2510
+#define BOXDRAW_UP_RIGHT 0x2514
+#define BOXDRAW_UP_LEFT 0x2518
+#define BOXDRAW_VERTICAL_RIGHT 0x251c
+#define BOXDRAW_VERTICAL_LEFT 0x2524
+#define BOXDRAW_DOWN_HORIZONTAL 0x252c
+#define BOXDRAW_UP_HORIZONTAL 0x2534
+#define BOXDRAW_VERTICAL_HORIZONTAL 0x253c
+#define BOXDRAW_DOUBLE_HORIZONTAL 0x2550
+#define BOXDRAW_DOUBLE_VERTICAL 0x2551
+#define BOXDRAW_DOWN_RIGHT_DOUBLE 0x2552
+#define BOXDRAW_DOWN_DOUBLE_RIGHT 0x2553
+#define BOXDRAW_DOUBLE_DOWN_RIGHT 0x2554
+#define BOXDRAW_DOWN_LEFT_DOUBLE 0x2555
+#define BOXDRAW_DOWN_DOUBLE_LEFT 0x2556
+#define BOXDRAW_DOUBLE_DOWN_LEFT 0x2557
+#define BOXDRAW_UP_RIGHT_DOUBLE 0x2558
+#define BOXDRAW_UP_DOUBLE_RIGHT 0x2559
+#define BOXDRAW_DOUBLE_UP_RIGHT 0x255a
+#define BOXDRAW_UP_LEFT_DOUBLE 0x255b
+#define BOXDRAW_UP_DOUBLE_LEFT 0x255c
+#define BOXDRAW_DOUBLE_UP_LEFT 0x255d
+#define BOXDRAW_VERTICAL_RIGHT_DOUBLE 0x255e
+#define BOXDRAW_VERTICAL_DOUBLE_RIGHT 0x255f
+#define BOXDRAW_DOUBLE_VERTICAL_RIGHT 0x2560
+#define BOXDRAW_VERTICAL_LEFT_DOUBLE 0x2561
+#define BOXDRAW_VERTICAL_DOUBLE_LEFT 0x2562
+#define BOXDRAW_DOUBLE_VERTICAL_LEFT 0x2563
+#define BOXDRAW_DOWN_HORIZONTAL_DOUBLE 0x2564
+#define BOXDRAW_DOWN_DOUBLE_HORIZONTAL 0x2565
+#define BOXDRAW_DOUBLE_DOWN_HORIZONTAL 0x2566
+#define BOXDRAW_UP_HORIZONTAL_DOUBLE 0x2567
+#define BOXDRAW_UP_DOUBLE_HORIZONTAL 0x2568
+#define BOXDRAW_DOUBLE_UP_HORIZONTAL 0x2569
+#define BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE 0x256a
+#define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL 0x256b
+#define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL 0x256c
+
+//
+// EFI Required Block Elements Code Chart
+//
+#define BLOCKELEMENT_FULL_BLOCK 0x2588
+#define BLOCKELEMENT_LIGHT_SHADE 0x2591
+
+//
+// EFI Required Geometric Shapes Code Chart
+//
+#define GEOMETRICSHAPE_UP_TRIANGLE 0x25b2
+#define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba
+#define GEOMETRICSHAPE_DOWN_TRIANGLE 0x25bc
+#define GEOMETRICSHAPE_LEFT_TRIANGLE 0x25c4
+
+//
+// EFI Required Arrow shapes
+//
+#define ARROW_LEFT 0x2190
+#define ARROW_UP 0x2191
+#define ARROW_RIGHT 0x2192
+#define ARROW_DOWN 0x2193
+
+//
+// EFI Console Colours
+//
+#define EFI_BLACK 0x00
+#define EFI_BLUE 0x01
+#define EFI_GREEN 0x02
+#define EFI_CYAN (EFI_BLUE | EFI_GREEN)
+#define EFI_RED 0x04
+#define EFI_MAGENTA (EFI_BLUE | EFI_RED)
+#define EFI_BROWN (EFI_GREEN | EFI_RED)
+#define EFI_LIGHTGRAY (EFI_BLUE | EFI_GREEN | EFI_RED)
+#define EFI_BRIGHT 0x08
+#define EFI_DARKGRAY (EFI_BLACK | EFI_BRIGHT)
+#define EFI_LIGHTBLUE (EFI_BLUE | EFI_BRIGHT)
+#define EFI_LIGHTGREEN (EFI_GREEN | EFI_BRIGHT)
+#define EFI_LIGHTCYAN (EFI_CYAN | EFI_BRIGHT)
+#define EFI_LIGHTRED (EFI_RED | EFI_BRIGHT)
+#define EFI_LIGHTMAGENTA (EFI_MAGENTA | EFI_BRIGHT)
+#define EFI_YELLOW (EFI_BROWN | EFI_BRIGHT)
+#define EFI_WHITE (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT)
+
+//
+// Macro to accept color values in their raw form to create
+// a value that represents both a foreground and background
+// color in a single byte.
+// For Foreground, and EFI_* value is valid from EFI_BLACK(0x00) to
+// EFI_WHITE (0x0F).
+// For Background, only EFI_BLACK, EFI_BLUE, EFI_GREEN, EFI_CYAN,
+// EFI_RED, EFI_MAGENTA, EFI_BROWN, and EFI_LIGHTGRAY are acceptable
+//
+// Do not use EFI_BACKGROUND_xxx values with this macro.
+//
+#define EFI_TEXT_ATTR(Foreground,Background) ((Foreground) | ((Background) << 4))
+
+#define EFI_BACKGROUND_BLACK 0x00
+#define EFI_BACKGROUND_BLUE 0x10
+#define EFI_BACKGROUND_GREEN 0x20
+#define EFI_BACKGROUND_CYAN (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN)
+#define EFI_BACKGROUND_RED 0x40
+#define EFI_BACKGROUND_MAGENTA (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_RED)
+#define EFI_BACKGROUND_BROWN (EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)
+#define EFI_BACKGROUND_LIGHTGRAY (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)
+
+//
+// We currently define attributes from 0 - 7F for color manipulations
+// To internally handle the local display characteristics for a particular character,
+// Bit 7 signifies the local glyph representation for a character. If turned on, glyphs will be
+// pulled from the wide glyph database and will display locally as a wide character (16 X 19 versus 8 X 19)
+// If bit 7 is off, the narrow glyph database will be used. This does NOT affect information that is sent to
+// non-local displays, such as serial or LAN consoles.
+//
+#define EFI_WIDE_ATTRIBUTE 0x80
+
+/**
+ Reset the text output device hardware and optionaly run diagnostics
+
+ @param This The protocol instance pointer.
+ @param ExtendedVerification Driver may perform more exhaustive verification
+ operation of the device during reset.
+
+ @retval EFI_SUCCESS The text output device was reset.
+ @retval EFI_DEVICE_ERROR The text output device is not functioning correctly and
+ could not be reset.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_RESET)(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+ );
+
+/**
+ Write a string to the output device.
+
+ @param This The protocol instance pointer.
+ @param String The NULL-terminated string to be displayed on the output
+ device(s). All output devices must also support the Unicode
+ drawing character codes defined in this file.
+
+ @retval EFI_SUCCESS The string was output to the device.
+ @retval EFI_DEVICE_ERROR The device reported an error while attempting to output
+ the text.
+ @retval EFI_UNSUPPORTED The output device's mode is not currently in a
+ defined text mode.
+ @retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the
+ characters in the string could not be
+ rendered and were skipped.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_STRING)(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN CHAR16 *String
+ );
+
+/**
+ Verifies that all characters in a string can be output to the
+ target device.
+
+ @param This The protocol instance pointer.
+ @param String The NULL-terminated string to be examined for the output
+ device(s).
+
+ @retval EFI_SUCCESS The device(s) are capable of rendering the output string.
+ @retval EFI_UNSUPPORTED Some of the characters in the string cannot be
+ rendered by one or more of the output devices mapped
+ by the EFI handle.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_TEST_STRING)(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN CHAR16 *String
+ );
+
+/**
+ Returns information for an available text mode that the output device(s)
+ supports.
+
+ @param This The protocol instance pointer.
+ @param ModeNumber The mode number to return information on.
+ @param Columns Returns the geometry of the text output device for the
+ requested ModeNumber.
+ @param Rows Returns the geometry of the text output device for the
+ requested ModeNumber.
+
+ @retval EFI_SUCCESS The requested mode information was returned.
+ @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
+ @retval EFI_UNSUPPORTED The mode number was not valid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_QUERY_MODE)(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN UINTN ModeNumber,
+ OUT UINTN *Columns,
+ OUT UINTN *Rows
+ );
+
+/**
+ Sets the output device(s) to a specified mode.
+
+ @param This The protocol instance pointer.
+ @param ModeNumber The mode number to set.
+
+ @retval EFI_SUCCESS The requested text mode was set.
+ @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
+ @retval EFI_UNSUPPORTED The mode number was not valid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_SET_MODE)(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN UINTN ModeNumber
+ );
+
+/**
+ Sets the background and foreground colors for the OutputString () and
+ ClearScreen () functions.
+
+ @param This The protocol instance pointer.
+ @param Attribute The attribute to set. Bits 0..3 are the foreground color, and
+ bits 4..6 are the background color. All other bits are undefined
+ and must be zero. The valid Attributes are defined in this file.
+
+ @retval EFI_SUCCESS The attribute was set.
+ @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
+ @retval EFI_UNSUPPORTED The attribute requested is not defined.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_SET_ATTRIBUTE)(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN UINTN Attribute
+ );
+
+/**
+ Clears the output device(s) display to the currently selected background
+ color.
+
+ @param This The protocol instance pointer.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
+ @retval EFI_UNSUPPORTED The output device is not in a valid text mode.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_CLEAR_SCREEN)(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
+ );
+
+/**
+ Sets the current coordinates of the cursor position
+
+ @param This The protocol instance pointer.
+ @param Column The position to set the cursor to. Must be greater than or
+ equal to zero and less than the number of columns and rows
+ by QueryMode ().
+ @param Row The position to set the cursor to. Must be greater than or
+ equal to zero and less than the number of columns and rows
+ by QueryMode ().
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
+ @retval EFI_UNSUPPORTED The output device is not in a valid text mode, or the
+ cursor position is invalid for the current mode.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_SET_CURSOR_POSITION)(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN UINTN Column,
+ IN UINTN Row
+ );
+
+/**
+ Makes the cursor visible or invisible
+
+ @param This The protocol instance pointer.
+ @param Visible If TRUE, the cursor is set to be visible. If FALSE, the cursor is
+ set to be invisible.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_DEVICE_ERROR The device had an error and could not complete the
+ request, or the device does not support changing
+ the cursor mode.
+ @retval EFI_UNSUPPORTED The output device is not in a valid text mode.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_ENABLE_CURSOR)(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN BOOLEAN Visible
+ );
+
+/**
+ @par Data Structure Description:
+ Mode Structure pointed to by Simple Text Out protocol.
+**/
+typedef struct {
+ ///
+ /// The number of modes supported by QueryMode () and SetMode ().
+ ///
+ INT32 MaxMode;
+
+ //
+ // current settings
+ //
+
+ ///
+ /// The text mode of the output device(s).
+ ///
+ INT32 Mode;
+ ///
+ /// The current character output attribute.
+ ///
+ INT32 Attribute;
+ ///
+ /// The cursor's column.
+ ///
+ INT32 CursorColumn;
+ ///
+ /// The cursor's row.
+ ///
+ INT32 CursorRow;
+ ///
+ /// The cursor is currently visbile or not.
+ ///
+ BOOLEAN CursorVisible;
+} EFI_SIMPLE_TEXT_OUTPUT_MODE;
+
+///
+/// The SIMPLE_TEXT_OUTPUT protocol is used to control text-based output devices.
+/// It is the minimum required protocol for any handle supplied as the ConsoleOut
+/// or StandardError device. In addition, the minimum supported text mode of such
+/// devices is at least 80 x 25 characters.
+///
+struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {
+ EFI_TEXT_RESET Reset;
+
+ EFI_TEXT_STRING OutputString;
+ EFI_TEXT_TEST_STRING TestString;
+
+ EFI_TEXT_QUERY_MODE QueryMode;
+ EFI_TEXT_SET_MODE SetMode;
+ EFI_TEXT_SET_ATTRIBUTE SetAttribute;
+
+ EFI_TEXT_CLEAR_SCREEN ClearScreen;
+ EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition;
+ EFI_TEXT_ENABLE_CURSOR EnableCursor;
+
+ ///
+ /// Pointer to SIMPLE_TEXT_OUTPUT_MODE data.
+ ///
+ EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode;
+};
+
+extern EFI_GUID gEfiSimpleTextOutProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmartCardEdge.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmartCardEdge.h
new file mode 100644
index 0000000000..ac5095c375
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmartCardEdge.h
@@ -0,0 +1,739 @@
+/** @file
+ The Smart Card Edge Protocol provides an abstraction for device to provide Smart
+ Card support.
+
+ This protocol allows UEFI applications to interface with a Smart Card during
+ boot process for authentication or data signing/decryption, especially if the
+ application has to make use of PKI.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SMART_CARD_EDGE_H__
+#define __SMART_CARD_EDGE_H__
+
+#define EFI_SMART_CARD_EDGE_PROTOCOL_GUID \
+ { \
+ 0xd317f29b, 0xa325, 0x4712, {0x9b, 0xf1, 0xc6, 0x19, 0x54, 0xdc, 0x19, 0x8c} \
+ }
+
+typedef struct _EFI_SMART_CARD_EDGE_PROTOCOL EFI_SMART_CARD_EDGE_PROTOCOL;
+
+//
+// Maximum size for a Smart Card AID (Application IDentifier)
+//
+#define SCARD_AID_MAXSIZE 0x0010
+//
+// Size of CSN (Card Serial Number)
+//
+#define SCARD_CSN_SIZE 0x0010
+//
+// Current specification version 1.00
+//
+#define SMART_CARD_EDGE_PROTOCOL_VERSION_1 0x00000100
+//
+// Parameters type definition
+//
+typedef UINT8 SMART_CARD_AID[SCARD_AID_MAXSIZE];
+typedef UINT8 SMART_CARD_CSN[SCARD_CSN_SIZE];
+
+//
+// Type of data elements in credentials list
+//
+// value of tag field for header, the number of containers
+//
+#define SC_EDGE_TAG_HEADER 0x0000
+//
+// value of tag field for certificate
+//
+#define SC_EDGE_TAG_CERT 0x0001
+//
+// value of tag field for key index associated with certificate
+//
+#define SC_EDGE_TAG_KEY_ID 0x0002
+//
+// value of tag field for key type
+//
+#define SC_EDGE_TAG_KEY_TYPE 0x0003
+//
+// value of tag field for key size
+//
+#define SC_EDGE_TAG_KEY_SIZE 0x0004
+
+//
+// Length of L fields of TLV items
+//
+//
+// size of L field for header
+//
+#define SC_EDGE_L_SIZE_HEADER 1
+//
+// size of L field for certificate (big endian)
+//
+#define SC_EDGE_L_SIZE_CERT 2
+//
+// size of L field for key index
+//
+#define SC_EDGE_L_SIZE_KEY_ID 1
+//
+// size of L field for key type
+//
+#define SC_EDGE_L_SIZE_KEY_TYPE 1
+//
+// size of L field for key size (big endian)
+//
+#define SC_EDGE_L_SIZE_KEY_SIZE 2
+
+//
+// Some TLV items have a fixed value for L field
+//
+// value of L field for header
+//
+#define SC_EDGE_L_VALUE_HEADER 1
+//
+// value of L field for key index
+//
+#define SC_EDGE_L_VALUE_KEY_ID 1
+//
+// value of L field for key type
+//
+#define SC_EDGE_L_VALUE_KEY_TYPE 1
+//
+// value of L field for key size
+//
+#define SC_EDGE_L_VALUE_KEY_SIZE 2
+
+//
+// Possible values for key type
+//
+//
+// RSA decryption
+//
+#define SC_EDGE_RSA_EXCHANGE 0x01
+//
+// RSA signature
+//
+#define SC_EDGE_RSA_SIGNATURE 0x02
+//
+// ECDSA signature
+//
+#define SC_EDGE_ECDSA_256 0x03
+//
+// ECDSA signature
+//
+#define SC_EDGE_ECDSA_384 0x04
+//
+// ECDSA signature
+//
+#define SC_EDGE_ECDSA_521 0x05
+//
+// ECDH agreement
+//
+#define SC_EDGE_ECDH_256 0x06
+//
+// ECDH agreement
+//
+#define SC_EDGE_ECDH_384 0x07
+//
+// ECDH agreement
+//
+#define SC_EDGE_ECDH_521 0x08
+
+//
+// Padding methods GUIDs for signature
+//
+//
+// RSASSA- PKCS#1-V1.5 padding method, for signature
+//
+#define EFI_PADDING_RSASSA_PKCS1V1P5_GUID \
+ { \
+ 0x9317ec24, 0x7cb0, 0x4d0e, {0x8b, 0x32, 0x2e, 0xd9, 0x20, 0x9c, 0xd8, 0xaf} \
+ }
+
+extern EFI_GUID gEfiPaddingRsassaPkcs1V1P5Guid;
+
+//
+// RSASSA-PSS padding method, for signature
+//
+#define EFI_PADDING_RSASSA_PSS_GUID \
+ { \
+ 0x7b2349e0, 0x522d, 0x4f8e, {0xb9, 0x27, 0x69, 0xd9, 0x7c, 0x9e, 0x79, 0x5f} \
+ }
+
+extern EFI_GUID gEfiPaddingRsassaPssGuid;
+
+//
+// Padding methods GUIDs for decryption
+//
+//
+// No padding, for decryption
+//
+#define EFI_PADDING_NONE_GUID \
+ { \
+ 0x3629ddb1, 0x228c, 0x452e, {0xb6, 0x16, 0x09, 0xed, 0x31, 0x6a, 0x97, 0x00} \
+ }
+
+extern EFI_GUID gEfiPaddingNoneGuid;
+
+//
+// RSAES-PKCS#1-V1.5 padding, for decryption
+//
+#define EFI_PADDING_RSAES_PKCS1V1P5_GUID \
+ { \
+ 0xe1c1d0a9, 0x40b1, 0x4632, {0xbd, 0xcc, 0xd9, 0xd6, 0xe5, 0x29, 0x56, 0x31} \
+ }
+
+extern EFI_GUID gEfiPaddingRsaesPkcs1V1P5Guid;
+
+//
+// RSAES-OAEP padding, for decryption
+//
+#define EFI_PADDING_RSAES_OAEP_GUID \
+ { \
+ 0xc1e63ac4, 0xd0cf, 0x4ce6, {0x83, 0x5b, 0xee, 0xd0, 0xe6, 0xa8, 0xa4, 0x5b} \
+ }
+
+extern EFI_GUID gEfiPaddingRsaesOaepGuid;
+
+/**
+ This function retrieves the context driver.
+
+ The GetContextfunction returns the context of the protocol, the application
+ identifiers supported by the protocol and the number and the CSN unique identifier
+ of Smart Cards that are present and supported by protocol.
+
+ If AidTableSize, AidTable, CsnTableSize, CsnTable or VersionProtocol is NULL,
+ the function does not fail but does not fill in such variables.
+
+ In case AidTableSize indicates a buffer too small to hold all the protocol AID table,
+ only the first AidTableSize items of the table are returned in AidTable.
+
+ In case CsnTableSize indicates a buffer too small to hold the entire table of
+ Smart Card CSN present, only the first CsnTableSize items of the table are returned
+ in CsnTable.
+
+ VersionScEdgeProtocol returns the version of the EFI_SMART_CARD_EDGE_PROTOCOL this
+ driver uses. For this protocol specification value is SMART_CARD_EDGE_PROTOCOL_VERSION_1.
+
+ In case of Smart Card removal the internal CSN list is immediately updated, even if
+ a connection is opened with that Smart Card.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[out] NumberAidSupported Number of AIDs this protocol supports.
+ @param[in, out] AidTableSize On input, number of items allocated for the
+ AID table. On output, number of items returned
+ by protocol.
+ @param[out] AidTable Table of the AIDs supported by the protocol.
+ @param[out] NumberSCPresent Number of currently present Smart Cards that
+ are supported by protocol.
+ @param[in, out] CsnTableSize On input, the number of items the buffer CSN
+ table can contain. On output, the number of
+ items returned by the protocol.
+ @param[out] CsnTable Table of the CSN of the Smart Card present and
+ supported by protocol.
+ @param[out] VersionScEdgeProtocol EFI_SMART_CARD_EDGE_PROTOCOL version.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER NumberSCPresent is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_EDGE_GET_CONTEXT) (
+ IN EFI_SMART_CARD_EDGE_PROTOCOL *This,
+ OUT UINTN *NumberAidSupported,
+ IN OUT UINTN *AidTableSize OPTIONAL,
+ OUT SMART_CARD_AID *AidTable OPTIONAL,
+ OUT UINTN *NumberSCPresent,
+ IN OUT UINTN *CsnTableSize OPTIONAL,
+ OUT SMART_CARD_CSN *CsnTable OPTIONAL,
+ OUT UINT32 *VersionScEdgeProtocol OPTIONAL
+ );
+
+/**
+ This function establish a connection with a Smart Card the protocol support.
+
+ In case of success the SCardHandle can be used.
+
+ If the ScardCsn is NULL the connection is established with the first Smart Card
+ the protocol finds in its table of Smart Card present and supported. Else it
+ establish context with the Smart Card whose CSN given by ScardCsn.
+
+ If ScardAid is not NULL the function returns the Smart Card AID the protocol supports.
+ After a successful connect the SCardHandle will remain existing even in case Smart Card
+ removed from Smart Card reader, but all function invoking this SCardHandle will fail.
+ SCardHandle is released only on Disconnect.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[out] SCardHandle Handle on Smart Card connection.
+ @param[in] ScardCsn CSN of the Smart Card the connection has to be
+ established.
+ @param[out] ScardAid AID of the Smart Card the connection has been
+ established.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER SCardHandle is NULL.
+ @retval EFI_NO_MEDIA No Smart Card supported by protocol is present,
+ Smart Card with CSN ScardCsn or Reader has been
+ removed. A Disconnect should be performed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_EDGE_CONNECT) (
+ IN EFI_SMART_CARD_EDGE_PROTOCOL *This,
+ OUT EFI_HANDLE *SCardHandle,
+ IN UINT8 *ScardCsn OPTIONAL,
+ OUT UINT8 *ScardAid OPTIONAL
+ );
+
+/**
+ This function releases a connection previously established by Connect.
+
+ The Disconnect function releases the connection previously established by
+ a Connect. In case the Smart Card or the Smart Card reader has been removed
+ before this call, this function returns EFI_SUCCESS.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] SCardHandle Handle on Smart Card connection to release.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER No connection for SCardHandle value.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_EDGE_DISCONNECT) (
+ IN EFI_SMART_CARD_EDGE_PROTOCOL *This,
+ IN EFI_HANDLE SCardHandle
+ );
+
+/**
+ This function returns the Smart Card serial number.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] SCardHandle Handle on Smart Card connection.
+ @param[out] Csn The Card Serial number, 16 bytes array.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER No connection for SCardHandle value.
+ @retval EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection
+ has been removed. A Disconnect should be performed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_EDGE_GET_CSN) (
+ IN EFI_SMART_CARD_EDGE_PROTOCOL *This,
+ IN EFI_HANDLE SCardHandle,
+ OUT UINT8 Csn[SCARD_CSN_SIZE]
+ );
+
+/**
+ This function returns the name of the Smart Card reader used for this connection.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] SCardHandle Handle on Smart Card connection.
+ @param[in, out] ReaderNameLength On input, a pointer to the variable that holds
+ the maximal size, in bytes, of ReaderName.
+ On output, the required size, in bytes, for ReaderName.
+ @param[out] ReaderName A pointer to a NULL terminated string that will
+ contain the reader name.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER No connection for SCardHandle value.
+ @retval EFI_INVALID_PARAMETER ReaderNameLength is NULL.
+ @retval EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection
+ has been removed. A Disconnect should be performed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_EDGE_GET_READER_NAME) (
+ IN EFI_SMART_CARD_EDGE_PROTOCOL *This,
+ IN EFI_HANDLE SCardHandle,
+ IN OUT UINTN *ReaderNameLength,
+ OUT CHAR16 *ReaderName OPTIONAL
+ );
+
+/**
+ This function authenticates a Smart Card user by presenting a PIN code.
+
+ The VerifyPinfunction presents a PIN code to the Smart Card.
+
+ If Smart Card found the PIN code correct the user is considered authenticated
+ to current application, and the function returns TRUE.
+
+ Negative or null PinSize value rejected if PinCodeis not NULL.
+
+ A NULL PinCodebuffer means the application didn't know the PIN, in that case:
+ - If PinSize value is negative the caller only wants to know if the current
+ chain of the elements Smart Card Edge protocol, Smart Card Reader protocol
+ and Smart Card Reader supports the Secure Pin Entry PCSC V2 functionality.
+ - If PinSize value is positive or null the caller ask to perform the verify
+ PIN using the Secure PIN Entry functionality.
+
+ In PinCode buffer, the PIN value is always given in plaintext, in case of secure
+ messaging the SMART_CARD_EDGE_PROTOCOL will be in charge of all intermediate
+ treatments to build the correct Smart Card APDU.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] SCardHandle Handle on Smart Card connection.
+ @param[in] PinSize PIN code buffer size.
+ @param[in] PinCode PIN code to present to the Smart Card.
+ @param[out] PinResult Result of PIN code presentation to the Smart Card.
+ TRUE when Smard Card founds the PIN code correct.
+ @param[out] RemainingAttempts Number of attempts still possible.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_UNSUPPORTED Pinsize < 0 and Secure PIN Entry functionality not
+ supported.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER No connection for SCardHandle value.
+ @retval EFI_INVALID_PARAMETER Bad value for PinSize: value not supported by Smart
+ Card or, negative with PinCode not null.
+ @retval EFI_INVALID_PARAMETER PinResult is NULL.
+ @retval EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection
+ has been removed. A Disconnect should be performed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_EDGE_VERIFY_PIN) (
+ IN EFI_SMART_CARD_EDGE_PROTOCOL *This,
+ IN EFI_HANDLE SCardHandle,
+ IN INT32 PinSize,
+ IN UINT8 *PinCode,
+ OUT BOOLEAN *PinResult,
+ OUT UINT32 *RemainingAttempts OPTIONAL
+ );
+
+/**
+ This function gives the remaining number of attempts for PIN code presentation.
+
+ The number of attempts to present a correct PIN is limited and depends on Smart
+ Card and on PIN.
+
+ This function will retrieve the number of remaining possible attempts.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] SCardHandle Handle on Smart Card connection.
+ @param[out] RemainingAttempts Number of attempts still possible.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER No connection for SCardHandle value.
+ @retval EFI_INVALID_PARAMETER RemainingAttempts is NULL.
+ @retval EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection
+ has been removed. A Disconnect should be performed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_EDGE_GET_PIN_REMAINING) (
+ IN EFI_SMART_CARD_EDGE_PROTOCOL *This,
+ IN EFI_HANDLE SCardHandle,
+ OUT UINT32 *RemainingAttempts
+ );
+
+/**
+ This function returns a specific data from Smart Card.
+
+ The function is generic for any kind of data, but driver and application must
+ share an EFI_GUID that identify the data.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] SCardHandle Handle on Smart Card connection.
+ @param[in] DataId The type identifier of the data to get.
+ @param[in, out] DataSize On input, in bytes, the size of Data. On output,
+ in bytes, the size of buffer required to store
+ the specified data.
+ @param[out] Data The data buffer in which the data is returned.
+ The type of the data buffer is associated with
+ the DataId. Ignored if *DataSize is 0.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER No connection for SCardHandle value.
+ @retval EFI_INVALID_PARAMETER DataId is NULL.
+ @retval EFI_INVALID_PARAMETER DataSize is NULL.
+ @retval EFI_INVALID_PARAMETER Data is NULL, and *DataSize is not zero.
+ @retval EFI_NOT_FOUND DataId unknown for this driver.
+ @retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified
+ data and the required size is returned in DataSize.
+ @retval EFI_ACCESS_DENIED Operation not performed, conditions not fulfilled.
+ PIN not verified.
+ @retval EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection
+ has been removed. A Disconnect should be performed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_EDGE_GET_DATA) (
+ IN EFI_SMART_CARD_EDGE_PROTOCOL *This,
+ IN EFI_HANDLE SCardHandle,
+ IN EFI_GUID *DataId,
+ IN OUT UINTN *DataSize,
+ OUT VOID *Data OPTIONAL
+ );
+
+/**
+ This function retrieve credentials store into the Smart Card.
+
+ The function returns a series of items in TLV (Tag Length Value) format.
+
+ First TLV item is the header item that gives the number of following
+ containers (0x00, 0x01, Nb containers).
+
+ All these containers are a series of 4 TLV items:
+ - The certificate item (0x01, certificate size, certificate)
+ - The Key identifier item (0x02, 0x01, key index)
+ - The key type item (0x03, 0x01, key type)
+ - The key size item (0x04, 0x02, key size), key size in number of bits.
+ Numeric multi-bytes values are on big endian format, most significant byte first:
+ - The L field value for certificate (2 bytes)
+ - The L field value for key size (2 bytes)
+ - The value field for key size (2 bytes)
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] SCardHandle Handle on Smart Card connection.
+ @param[in, out] CredentialSize On input, in bytes, the size of buffer to store
+ the list of credential.
+ On output, in bytes, the size of buffer required
+ to store the entire list of credentials.
+
+ @param[out] CredentialList List of credentials stored into the Smart Card.
+ A list of TLV (Tag Length Value) elements organized
+ in containers array.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER No connection for SCardHandle value.
+ @retval EFI_INVALID_PARAMETER CredentialSize is NULL.
+ @retval EFI_INVALID_PARAMETER CredentialList is NULL, if CredentialSize is not zero.
+ @retval EFI_BUFFER_TOO_SMALL The size of CredentialList is too small for the
+ specified data and the required size is returned in
+ CredentialSize.
+ @retval EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection
+ has been removed. A Disconnect should be performed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_EDGE_GET_CREDENTIAL) (
+ IN EFI_SMART_CARD_EDGE_PROTOCOL *This,
+ IN EFI_HANDLE SCardHandle,
+ IN OUT UINTN *CredentialSize,
+ OUT UINT8 *CredentialList OPTIONAL
+ );
+
+/**
+ This function signs an already hashed data with a Smart Card private key.
+
+ This function signs data, actually it is the hash of these data that is given
+ to the function.
+
+ SignatureData buffer shall be big enough for signature. Signature size is
+ function key size and key type.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] SCardHandle Handle on Smart Card connection.
+ @param[in] KeyId Identifier of the key container, retrieved
+ in a key index item of credentials.
+ @param[in] KeyType The key type, retrieved in a key type item of
+ credentials.
+
+ @param[in] HashAlgorithm Hash algorithm used to hash the, one of:
+ - EFI_HASH_ALGORITHM_SHA1_GUID
+ - EFI_HASH_ALGORITHM_SHA256_GUID
+ - EFI_HASH_ALGORITHM_SHA384_GUID
+ - EFI_HASH_ALGORITHM_SHA512_GUID
+ @param[in] PaddingMethod Padding method used jointly with hash algorithm,
+ one of:
+ - EFI_PADDING_RSASSA_PKCS1V1P5_GUID
+ - EFI_PADDING_RSASSA_PSS_GUID
+ @param[in] HashedData Hash of the data to sign. Size is function of the
+ HashAlgorithm.
+
+ @param[out] SignatureData Resulting signature with private key KeyId. Size
+ is function of the KeyType and key size retrieved
+ in the associated key size item of credentials.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER No connection for SCardHandle value.
+ @retval EFI_INVALID_PARAMETER KeyId is not valid.
+ @retval EFI_INVALID_PARAMETER KeyType is not valid or not corresponding to KeyId.
+ @retval EFI_INVALID_PARAMETER HashAlgorithm is NULL.
+ @retval EFI_INVALID_PARAMETER HashAlgorithm is not valid.
+ @retval EFI_INVALID_PARAMETER PaddingMethod is NULL.
+ @retval EFI_INVALID_PARAMETER PaddingMethod is not valid.
+ @retval EFI_INVALID_PARAMETER HashedData is NULL.
+ @retval EFI_INVALID_PARAMETER SignatureData is NULL.
+ @retval EFI_ACCESS_DENIED Operation not performed, conditions not fulfilled.
+ PIN not verified.
+ @retval EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection
+ has been removed. A Disconnect should be performed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_EDGE_SIGN_DATA) (
+ IN EFI_SMART_CARD_EDGE_PROTOCOL *This,
+ IN EFI_HANDLE SCardHandle,
+ IN UINTN KeyId,
+ IN UINTN KeyType,
+ IN EFI_GUID *HashAlgorithm,
+ IN EFI_GUID *PaddingMethod,
+ IN UINT8 *HashedData,
+ OUT UINT8 *SignatureData
+ );
+
+/**
+ This function decrypts data with a PKI/RSA Smart Card private key.
+
+ The function decrypts some PKI/RSA encrypted data with private key securely
+ stored into the Smart Card.
+
+ The KeyId must reference a key of type SC_EDGE_RSA_EXCHANGE.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] SCardHandle Handle on Smart Card connection.
+ @param[in] KeyId Identifier of the key container, retrieved
+ in a key index item of credentials.
+ @param[in] HashAlgorithm Hash algorithm used to hash the, one of:
+ - EFI_HASH_ALGORITHM_SHA1_GUID
+ - EFI_HASH_ALGORITHM_SHA256_GUID
+ - EFI_HASH_ALGORITHM_SHA384_GUID
+ - EFI_HASH_ALGORITHM_SHA512_GUID
+ @param[in] PaddingMethod Padding method used jointly with hash algorithm,
+ one of:
+ - EFI_PADDING_NONE_GUID
+ - EFI_PADDING_RSAES_PKCS1V1P5_GUID
+ - EFI_PADDING_RSAES_OAEP_GUID
+ @param[in] EncryptedSize Size of data to decrypt.
+ @param[in] EncryptedData Data to decrypt
+ @param[in, out] PlaintextSize On input, in bytes, the size of buffer to store
+ the decrypted data.
+ On output, in bytes, the size of buffer required
+ to store the decrypted data.
+ @param[out] PlaintextData Buffer for decrypted data, padding removed.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER No connection for SCardHandle value.
+ @retval EFI_INVALID_PARAMETER KeyId is not valid or associated key not of type
+ SC_EDGE_RSA_EXCHANGE.
+ @retval EFI_INVALID_PARAMETER HashAlgorithm is NULL.
+ @retval EFI_INVALID_PARAMETER HashAlgorithm is not valid.
+ @retval EFI_INVALID_PARAMETER PaddingMethod is NULL.
+ @retval EFI_INVALID_PARAMETER PaddingMethod is not valid.
+ @retval EFI_INVALID_PARAMETER EncryptedSize is 0.
+ @retval EFI_INVALID_PARAMETER EncryptedData is NULL.
+ @retval EFI_INVALID_PARAMETER PlaintextSize is NULL.
+ @retval EFI_INVALID_PARAMETER PlaintextData is NULL.
+ @retval EFI_ACCESS_DENIED Operation not performed, conditions not fulfilled.
+ PIN not verified.
+ @retval EFI_BUFFER_TOO_SMALL PlaintextSize is too small for the plaintext data
+ and the required size is returned in PlaintextSize.
+ @retval EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection
+ has been removed. A Disconnect should be performed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_EDGE_DECRYPT_DATA) (
+ IN EFI_SMART_CARD_EDGE_PROTOCOL *This,
+ IN EFI_HANDLE SCardHandle,
+ IN UINTN KeyId,
+ IN EFI_GUID *HashAlgorithm,
+ IN EFI_GUID *PaddingMethod,
+ IN UINTN EncryptedSize,
+ IN UINT8 *EncryptedData,
+ IN OUT UINTN *PlaintextSize,
+ OUT UINT8 *PlaintextData
+ );
+
+/**
+ This function performs a secret Diffie Hellman agreement calculation that would
+ be used to derive a symmetric encryption / decryption key.
+
+ The function compute a DH agreement that should be diversified togenerate a symmetric
+ key to proceed encryption or decryption.
+
+ The application and the Smart Card shall agree on the diversification process.
+
+ The KeyId must reference a key of one of the types: SC_EDGE_ECDH_256, SC_EDGE_ECDH_384
+ or SC_EDGE_ECDH_521.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] SCardHandle Handle on Smart Card connection.
+ @param[in] KeyId Identifier of the key container, retrieved
+ in a key index item of credentials.
+ @param[in] dataQx Public key x coordinate. Size is the same as
+ key size for KeyId. Stored in big endian format.
+ @param[in] dataQy Public key y coordinate. Size is the same as
+ key size for KeyId. Stored in big endian format.
+ @param[out] DHAgreement Buffer for DH agreement computed. Size must be
+ bigger or equal to key size for KeyId.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER No connection for SCardHandle value.
+ @retval EFI_INVALID_PARAMETER KeyId is not valid.
+ @retval EFI_INVALID_PARAMETER dataQx is NULL.
+ @retval EFI_INVALID_PARAMETER dataQy is NULL.
+ @retval EFI_INVALID_PARAMETER DHAgreement is NULL.
+ @retval EFI_ACCESS_DENIED Operation not performed, conditions not fulfilled.
+ PIN not verified.
+ @retval EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection
+ has been removed. A Disconnect should be performed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_EDGE_BUILD_DH_AGREEMENT) (
+ IN EFI_SMART_CARD_EDGE_PROTOCOL *This,
+ IN EFI_HANDLE SCardHandle,
+ IN UINTN KeyId,
+ IN UINT8 *dataQx,
+ IN UINT8 *dataQy,
+ OUT UINT8 *DHAgreement
+ );
+
+///
+/// Smart card aware application invokes this protocol to get access to an inserted
+/// smart card in the reader or to the reader itself.
+///
+struct _EFI_SMART_CARD_EDGE_PROTOCOL {
+ EFI_SMART_CARD_EDGE_GET_CONTEXT GetContext;
+ EFI_SMART_CARD_EDGE_CONNECT Connect;
+ EFI_SMART_CARD_EDGE_DISCONNECT Disconnect;
+ EFI_SMART_CARD_EDGE_GET_CSN GetCsn;
+ EFI_SMART_CARD_EDGE_GET_READER_NAME GetReaderName;
+ EFI_SMART_CARD_EDGE_VERIFY_PIN VerifyPin;
+ EFI_SMART_CARD_EDGE_GET_PIN_REMAINING GetPinRemaining;
+ EFI_SMART_CARD_EDGE_GET_DATA GetData;
+ EFI_SMART_CARD_EDGE_GET_CREDENTIAL GetCredential;
+ EFI_SMART_CARD_EDGE_SIGN_DATA SignData;
+ EFI_SMART_CARD_EDGE_DECRYPT_DATA DecryptData;
+ EFI_SMART_CARD_EDGE_BUILD_DH_AGREEMENT BuildDHAgreement;
+};
+
+extern EFI_GUID gEfiSmartCardEdgeProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmartCardReader.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmartCardReader.h
new file mode 100644
index 0000000000..a39b379c5e
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmartCardReader.h
@@ -0,0 +1,325 @@
+/** @file
+ The UEFI Smart Card Reader Protocol provides an abstraction for device to provide
+ smart card reader support. This protocol is very close to Part 5 of PC/SC workgroup
+ specifications and provides an API to applications willing to communicate with a
+ smart card or a smart card reader.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SMART_CARD_READER_H__
+#define __SMART_CARD_READER_H__
+
+#define EFI_SMART_CARD_READER_PROTOCOL_GUID \
+ { \
+ 0x2a4d1adf, 0x21dc, 0x4b81, {0xa4, 0x2f, 0x8b, 0x8e, 0xe2, 0x38, 0x00, 0x60} \
+ }
+
+typedef struct _EFI_SMART_CARD_READER_PROTOCOL EFI_SMART_CARD_READER_PROTOCOL;
+
+//
+// Codes for access mode
+//
+#define SCARD_AM_READER 0x0001 // Exclusive access to reader
+#define SCARD_AM_CARD 0x0002 // Exclusive access to card
+//
+// Codes for card action
+//
+#define SCARD_CA_NORESET 0x0000 // Don't reset card
+#define SCARD_CA_COLDRESET 0x0001 // Perform a cold reset
+#define SCARD_CA_WARMRESET 0x0002 // Perform a warm reset
+#define SCARD_CA_UNPOWER 0x0003 // Power off the card
+#define SCARD_CA_EJECT 0x0004 // Eject the card
+//
+// Protocol types
+//
+#define SCARD_PROTOCOL_UNDEFINED 0x0000
+#define SCARD_PROTOCOL_T0 0x0001
+#define SCARD_PROTOCOL_T1 0x0002
+#define SCARD_PROTOCOL_RAW 0x0004
+//
+// Codes for state type
+//
+#define SCARD_UNKNOWN 0x0000 /* state is unknown */
+#define SCARD_ABSENT 0x0001 /* Card is absent */
+#define SCARD_INACTIVE 0x0002 /* Card is present and not powered*/
+#define SCARD_ACTIVE 0x0003 /* Card is present and powered */
+//
+// Macro to generate a ControlCode & PC/SC part 10 control code
+//
+#define SCARD_CTL_CODE(code) (0x42000000 + (code))
+#define CM_IOCTL_GET_FEATURE_REQUEST SCARD_CTL_CODE(3400)
+
+/**
+ This function requests connection to the smart card or the reader, using the
+ appropriate reset type and protocol.
+
+ The SCardConnectfunction requests access to the smart card or the reader. Upon
+ success, it is then possible to call SCardTransmit.
+
+ If AccessMode is set to SCARD_AM_READER, PreferredProtocols must be set to
+ SCARD_PROTOCOL_UNDEFINED and CardAction to SCARD_CA_NORESET else function
+ fails with EFI_INVALID_PARAMETER.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] AccessMode Codes of access mode.
+ @param[in] CardAction SCARD_CA_NORESET, SCARD_CA_COLDRESET or
+ SCARD_CA_WARMRESET.
+ @param[in] PreferredProtocols Bitmask of acceptable protocols.
+ @param[out] ActiveProtocol A flag that indicates the active protocol.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL
+ @retval EFI_INVALID_PARAMETER AccessMode is not valid.
+ @retval EFI_INVALID_PARAMETER CardAction is not valid.
+ @retval EFI_INVALID_PARAMETER Invalid combination of AccessMode/CardAction/
+ PreferredProtocols.
+ @retval EFI_NOT_READY A smart card is inserted but failed to return an ATR.
+ @retval EFI_UNSUPPORTED PreferredProtocols does not contain an available
+ protocol to use.
+ @retval EFI_NO_MEDIA AccessMode is set to SCARD_AM_CARD but there is
+ no smart card inserted.
+ @retval EFI_ACCESS_DENIED Access is already locked by a previous SCardConnectcall.
+ @retval EFI_DEVICE_ERROR Any other error condition, typically a reader removal.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_READER_CONNECT) (
+ IN EFI_SMART_CARD_READER_PROTOCOL *This,
+ IN UINT32 AccessMode,
+ IN UINT32 CardAction,
+ IN UINT32 PreferredProtocols,
+ OUT UINT32 *ActiveProtocol
+ );
+
+/**
+ This function releases a connection previously taken by SCardConnect.
+
+ The SCardDisconnect function releases the lock previously taken by SCardConnect.
+ In case the smart card has been removed before this call, thisfunction
+ returns EFI_SUCCESS. If there is no previous call to SCardConnect, this
+ function returns EFI_SUCCESS.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] CardAction Codes for card action.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL
+ @retval EFI_INVALID_PARAMETER CardAction value is unknown.
+ @retval EFI_UNSUPPORTED Reader does not support Eject card feature
+ (disconnect was not performed).
+ @retval EFI_DEVICE_ERROR Any other error condition, typically a reader removal.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_READER_DISCONNECT) (
+ IN EFI_SMART_CARD_READER_PROTOCOL *This,
+ IN UINT32 CardAction
+ );
+
+/**
+ This function retrieves some basic information about the smart card and reader.
+
+ The SCardStatusfunction retrieves basic reader and card information.
+
+ If ReaderName, State, CardProtocolor Atris NULL, the function does not fail but
+ does not fill in such variables.
+
+ If EFI_SUCCESS is not returned, ReaderName and Atr contents shall not be considered
+ as valid.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[out] ReaderName A pointer to a NULL terminated string that will
+ contain the reader name.
+ @param[in, out] ReaderNameLength On input, a pointer to the variablethat holds the
+ maximal size, in bytes,of ReaderName.
+ On output, the required size, in bytes, for ReaderName.
+ @param[out] State Current state of the smart card reader.
+ @param[out] CardProtocol Current protocol used to communicate with the smart card.
+ @param[out] Atr A pointer to retrieve the ATR of the smart card.
+ @param[in, out] AtrLength On input, a pointer to hold the maximum size, in bytes,
+ of Atr(usually 33).
+ On output, the required size, inbytes, for the smart
+ card ATR.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL
+ @retval EFI_INVALID_PARAMETER ReaderName is not NULL but ReaderNameLength is NULL
+ @retval EFI_INVALID_PARAMETER Atr is not NULL but AtrLength is NULL
+ @retval EFI_BUFFER_TOO_SMALL ReaderNameLength is not big enough to hold the reader name.
+ ReaderNameLength has been updated to the required value.
+ @retval EFI_BUFFER_TOO_SMALL AtrLength is not big enough to hold the ATR.
+ AtrLength has been updated to the required value.
+ @retval EFI_DEVICE_ERROR Any other error condition, typically a reader removal.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_READER_STATUS) (
+ IN EFI_SMART_CARD_READER_PROTOCOL *This,
+ OUT CHAR16 *ReaderName OPTIONAL,
+ IN OUT UINTN *ReaderNameLength OPTIONAL,
+ OUT UINT32 *State OPTIONAL,
+ OUT UINT32 *CardProtocol OPTIONAL,
+ OUT UINT8 *Atr OPTIONAL,
+ IN OUT UINTN *AtrLength OPTIONAL
+ );
+
+/**
+ This function sends a command to the card or reader and returns its response.
+
+ The protocol to use to communicate with the smart card has been selected through
+ SCardConnectcall.
+
+ In case RAPDULength indicates a buffer too small to holdthe response APDU, the
+ function fails with EFI_BUFFER_TOO_SMALL.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOLinstance.
+ @param[in] CAPDU A pointer to a byte array thatcontains the Command
+ APDU to send to the smart card or reader.
+ @param[in] CAPDULength Command APDU size, in bytes.
+ @param[out] RAPDU A pointer to a byte array that will contain the
+ Response APDU.
+ @param[in, out] RAPDULength On input, the maximum size, inbytes, of the Response
+ APDU.
+ On output, the size, in bytes, of the Response APDU.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER CAPDU is NULL or CAPDULength is 0.
+ @retval EFI_BUFFER_TOO_SMALL RAPDULength is not big enough to hold the response APDU.
+ RAPDULength has been updated to the required value.
+ @retval EFI_NO_MEDIA There is no card in the reader.
+ @retval EFI_NOT_READY Card is not powered.
+ @retval EFI_PROTOCOL_ERROR A protocol error has occurred.
+ @retval EFI_TIMEOUT The reader did not respond.
+ @retval EFI_ACCESS_DENIED A communication with the reader/card is already pending.
+ @retval EFI_DEVICE_ERROR Any other error condition, typically a reader removal.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_READER_TRANSMIT) (
+ IN EFI_SMART_CARD_READER_PROTOCOL *This,
+ IN UINT8 *CAPDU,
+ IN UINTN CAPDULength,
+ OUT UINT8 *RAPDU,
+ IN OUT UINTN *RAPDULength
+ );
+
+/**
+ This function provides direct access to the reader.
+
+ This function gives direct control to send commands to the driver or the reader.
+ The ControlCode to use is vendor dependant; the only standard code defined is
+ the one to get PC/SC part 10 features.
+
+ InBuffer and Outbuffer may be NULL when ControlCode operation does not require
+ them.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] ControlCode The control code for the operation to perform.
+ @param[in] InBuffer A pointer to the input parameters.
+ @param[in] InBufferLength Size, in bytes, of input parameters.
+ @param[out] OutBuffer A pointer to the output parameters.
+ @param[in, out] OutBufferLength On input, maximal size, in bytes, to store output
+ parameters.
+ On output, the size, in bytes, of output parameters.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER ControlCode requires input parameters but:
+ InBuffer is NULL or InBufferLenth is NULL or
+ InBuffer is not NULL but InBufferLenth is less than
+ expected.
+ @retval EFI_INVALID_PARAMETER OutBuffer is not NULL but OutBufferLength is NULL.
+ @retval EFI_UNSUPPORTED ControlCode is not supported.
+ @retval EFI_BUFFER_TOO_SMALL OutBufferLength is not big enough to hold the output
+ parameters.
+ OutBufferLength has been updated to the required value.
+ @retval EFI_NO_MEDIA There is no card in the reader and the control code
+ specified requires one.
+ @retval EFI_NOT_READY ControlCode requires a powered card to operate.
+ @retval EFI_PROTOCOL_ERROR A protocol error has occurred.
+ @retval EFI_TIMEOUT The reader did not respond.
+ @retval EFI_ACCESS_DENIED A communication with the reader/card is already pending.
+ @retval EFI_DEVICE_ERROR Any other error condition, typically a reader removal.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_READER_CONTROL) (
+ IN EFI_SMART_CARD_READER_PROTOCOL *This,
+ IN UINT32 ControlCode,
+ IN UINT8 *InBuffer OPTIONAL,
+ IN UINTN InBufferLength OPTIONAL,
+ OUT UINT8 *OutBuffer OPTIONAL,
+ IN OUT UINTN *OutBufferLength OPTIONAL
+ );
+
+/**
+ This function retrieves a reader or smart card attribute.
+
+ Possibly supported attrib values are listed in "PC/SC specification, Part 3:
+ Requirements for PC-Connected Interface Devices".
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] Attrib Identifier for the attribute to retrieve.
+ @param[out] OutBuffer A pointer to a buffer that will contain
+ attribute data.
+ @param[in, out] OutBufferLength On input, maximal size, in bytes, to store
+ attribute data.
+ On output, the size, in bytes, of attribute
+ data.
+
+ @retval EFI_SUCCESS The requested command completed successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER OutBuffer is NULL or OutBufferLength is 0.
+ @retval EFI_BUFFER_TOO_SMALL OutBufferLength is not big enough to hold the output
+ parameters.
+ OutBufferLength has been updated to the required value.
+ @retval EFI_UNSUPPORTED Attribis not supported
+ @retval EFI_NO_MEDIA There is no card in the reader and Attrib value
+ requires one.
+ @retval EFI_NOT_READY Attrib requires a powered card to operate.
+ @retval EFI_PROTOCOL_ERROR A protocol error has occurred.
+ @retval EFI_TIMEOUT The reader did not respond.
+ @retval EFI_DEVICE_ERROR Any other error condition, typically a reader removal.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMART_CARD_READER_GET_ATTRIB) (
+ IN EFI_SMART_CARD_READER_PROTOCOL *This,
+ IN UINT32 Attrib,
+ OUT UINT8 *OutBuffer,
+ IN OUT UINTN *OutBufferLength
+ );
+
+///
+/// Smart card aware application invokes this protocol to get access to an inserted
+/// smart card in the reader or to the reader itself.
+///
+struct _EFI_SMART_CARD_READER_PROTOCOL {
+ EFI_SMART_CARD_READER_CONNECT SCardConnect;
+ EFI_SMART_CARD_READER_DISCONNECT SCardDisconnect;
+ EFI_SMART_CARD_READER_STATUS SCardStatus;
+ EFI_SMART_CARD_READER_TRANSMIT SCardTransmit;
+ EFI_SMART_CARD_READER_CONTROL SCardControl;
+ EFI_SMART_CARD_READER_GET_ATTRIB SCardGetAttrib;
+};
+
+extern EFI_GUID gEfiSmartCardReaderProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Smbios.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Smbios.h
new file mode 100644
index 0000000000..1860ba5025
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Smbios.h
@@ -0,0 +1,213 @@
+/** @file
+ SMBIOS Protocol as defined in PI1.2 Specification VOLUME 5 Standard.
+
+ SMBIOS protocol allows consumers to log SMBIOS data records, and enables the producer
+ to create the SMBIOS tables for a platform.
+
+ This protocol provides an interface to add, remove or discover SMBIOS records. The driver which
+ produces this protocol is responsible for creating the SMBIOS data tables and installing the pointer
+ to the tables in the EFI System Configuration Table.
+ The caller is responsible for only adding SMBIOS records that are valid for the SMBIOS
+ MajorVersion and MinorVersion. When an enumerated SMBIOS field's values are
+ controlled by the DMTF, new values can be used as soon as they are defined by the DMTF without
+ requiring an update to MajorVersion and MinorVersion.
+ The SMBIOS protocol can only be called a TPL < TPL_NOTIFY.
+
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SMBIOS_PROTOCOL_H__
+#define __SMBIOS_PROTOCOL_H__
+
+#include <IndustryStandard/SmBios.h>
+
+#define EFI_SMBIOS_PROTOCOL_GUID \
+ { 0x3583ff6, 0xcb36, 0x4940, { 0x94, 0x7e, 0xb9, 0xb3, 0x9f, 0x4a, 0xfa, 0xf7 }}
+
+#define EFI_SMBIOS_TYPE_BIOS_INFORMATION SMBIOS_TYPE_BIOS_INFORMATION
+#define EFI_SMBIOS_TYPE_SYSTEM_INFORMATION SMBIOS_TYPE_SYSTEM_INFORMATION
+#define EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION SMBIOS_TYPE_BASEBOARD_INFORMATION
+#define EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE SMBIOS_TYPE_SYSTEM_ENCLOSURE
+#define EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION SMBIOS_TYPE_PROCESSOR_INFORMATION
+#define EFI_SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION
+#define EFI_SMBIOS_TYPE_MEMORY_MODULE_INFORMATON SMBIOS_TYPE_MEMORY_MODULE_INFORMATON
+#define EFI_SMBIOS_TYPE_CACHE_INFORMATION SMBIOS_TYPE_CACHE_INFORMATION
+#define EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION
+#define EFI_SMBIOS_TYPE_SYSTEM_SLOTS SMBIOS_TYPE_SYSTEM_SLOTS
+#define EFI_SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION
+#define EFI_SMBIOS_TYPE_OEM_STRINGS SMBIOS_TYPE_OEM_STRINGS
+#define EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS
+#define EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION
+#define EFI_SMBIOS_TYPE_GROUP_ASSOCIATIONS SMBIOS_TYPE_GROUP_ASSOCIATIONS
+#define EFI_SMBIOS_TYPE_SYSTEM_EVENT_LOG SMBIOS_TYPE_SYSTEM_EVENT_LOG
+#define EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY
+#define EFI_SMBIOS_TYPE_MEMORY_DEVICE SMBIOS_TYPE_MEMORY_DEVICE
+#define EFI_SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION
+#define EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS
+#define EFI_SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS
+#define EFI_SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE
+#define EFI_SMBIOS_TYPE_PORTABLE_BATTERY SMBIOS_TYPE_PORTABLE_BATTERY
+#define EFI_SMBIOS_TYPE_SYSTEM_RESET SMBIOS_TYPE_SYSTEM_RESET
+#define EFI_SMBIOS_TYPE_HARDWARE_SECURITY SMBIOS_TYPE_HARDWARE_SECURITY
+#define EFI_SMBIOS_TYPE_SYSTEM_POWER_CONTROLS SMBIOS_TYPE_SYSTEM_POWER_CONTROLS
+#define EFI_SMBIOS_TYPE_VOLTAGE_PROBE SMBIOS_TYPE_VOLTAGE_PROBE
+#define EFI_SMBIOS_TYPE_COOLING_DEVICE SMBIOS_TYPE_COOLING_DEVICE
+#define EFI_SMBIOS_TYPE_TEMPERATURE_PROBE SMBIOS_TYPE_TEMPERATURE_PROBE
+#define EFI_SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE
+#define EFI_SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS
+#define EFI_SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE
+#define EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION
+#define EFI_SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION
+#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE SMBIOS_TYPE_MANAGEMENT_DEVICE
+#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT
+#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA
+#define EFI_SMBIOS_TYPE_MEMORY_CHANNEL SMBIOS_TYPE_MEMORY_CHANNEL
+#define EFI_SMBIOS_TYPE_IPMI_DEVICE_INFORMATION SMBIOS_TYPE_IPMI_DEVICE_INFORMATION
+#define EFI_SMBIOS_TYPE_SYSTEM_POWER_SUPPLY SMBIOS_TYPE_SYSTEM_POWER_SUPPLY
+#define EFI_SMBIOS_TYPE_ADDITIONAL_INFORMATION SMBIOS_TYPE_ADDITIONAL_INFORMATION
+#define EFI_SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION
+#define EFI_SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE
+#define EFI_SMBIOS_TYPE_INACTIVE SMBIOS_TYPE_INACTIVE
+#define EFI_SMBIOS_TYPE_END_OF_TABLE SMBIOS_TYPE_END_OF_TABLE
+#define EFI_SMBIOS_OEM_BEGIN SMBIOS_OEM_BEGIN
+#define EFI_SMBIOS_OEM_END SMBIOS_OEM_END
+
+typedef SMBIOS_TABLE_STRING EFI_SMBIOS_STRING;
+typedef SMBIOS_TYPE EFI_SMBIOS_TYPE;
+typedef SMBIOS_HANDLE EFI_SMBIOS_HANDLE;
+typedef SMBIOS_STRUCTURE EFI_SMBIOS_TABLE_HEADER;
+
+typedef struct _EFI_SMBIOS_PROTOCOL EFI_SMBIOS_PROTOCOL;
+
+/**
+ Add an SMBIOS record.
+
+ This function allows any agent to add SMBIOS records. The caller is responsible for ensuring
+ Record is formatted in a way that matches the version of the SMBIOS specification as defined in
+ the MajorRevision and MinorRevision fields of the EFI_SMBIOS_PROTOCOL.
+ Record must follow the SMBIOS structure evolution and usage guidelines in the SMBIOS
+ specification. Record starts with the formatted area of the SMBIOS structure and the length is
+ defined by EFI_SMBIOS_TABLE_HEADER.Length. Each SMBIOS structure is terminated by a
+ double-null (0x0000), either directly following the formatted area (if no strings are present) or
+ directly following the last string. The number of optional strings is not defined by the formatted area,
+ but is fixed by the call to Add(). A string can be a place holder, but it must not be a NULL string as
+ two NULL strings look like the double-null that terminates the structure.
+
+ @param[in] This The EFI_SMBIOS_PROTOCOL instance.
+ @param[in] ProducerHandle The handle of the controller or driver associated with the SMBIOS information. NULL means no handle.
+ @param[in, out] SmbiosHandle On entry, the handle of the SMBIOS record to add. If FFFEh, then a unique handle
+ will be assigned to the SMBIOS record. If the SMBIOS handle is already in use,
+ EFI_ALREADY_STARTED is returned and the SMBIOS record is not updated.
+ @param[in] Record The data for the fixed portion of the SMBIOS record. The format of the record is
+ determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted
+ area is defined by EFI_SMBIOS_TABLE_HEADER.Length and either followed
+ by a double-null (0x0000) or a set of null terminated strings and a null.
+
+ @retval EFI_SUCCESS Record was added.
+ @retval EFI_OUT_OF_RESOURCES Record was not added.
+ @retval EFI_ALREADY_STARTED The SmbiosHandle passed in was already in use.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBIOS_ADD)(
+ IN CONST EFI_SMBIOS_PROTOCOL *This,
+ IN EFI_HANDLE ProducerHandle OPTIONAL,
+ IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle,
+ IN EFI_SMBIOS_TABLE_HEADER *Record
+);
+
+/**
+ Update the string associated with an existing SMBIOS record.
+
+ This function allows the update of specific SMBIOS strings. The number of valid strings for any
+ SMBIOS record is defined by how many strings were present when Add() was called.
+
+ @param[in] This The EFI_SMBIOS_PROTOCOL instance.
+ @param[in] SmbiosHandle SMBIOS Handle of structure that will have its string updated.
+ @param[in] StringNumber The non-zero string number of the string to update.
+ @param[in] String Update the StringNumber string with String.
+
+ @retval EFI_SUCCESS SmbiosHandle had its StringNumber String updated.
+ @retval EFI_INVALID_PARAMETER SmbiosHandle does not exist.
+ @retval EFI_UNSUPPORTED String was not added because it is longer than the SMBIOS Table supports.
+ @retval EFI_NOT_FOUND The StringNumber.is not valid for this SMBIOS record.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBIOS_UPDATE_STRING)(
+ IN CONST EFI_SMBIOS_PROTOCOL *This,
+ IN EFI_SMBIOS_HANDLE *SmbiosHandle,
+ IN UINTN *StringNumber,
+ IN CHAR8 *String
+);
+
+/**
+ Remove an SMBIOS record.
+
+ This function removes an SMBIOS record using the handle specified by SmbiosHandle.
+
+ @param[in] This The EFI_SMBIOS_PROTOCOL instance.
+ @param[in] SmbiosHandle The handle of the SMBIOS record to remove.
+
+ @retval EFI_SUCCESS SMBIOS record was removed.
+ @retval EFI_INVALID_PARAMETER SmbiosHandle does not specify a valid SMBIOS record.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBIOS_REMOVE)(
+ IN CONST EFI_SMBIOS_PROTOCOL *This,
+ IN EFI_SMBIOS_HANDLE SmbiosHandle
+);
+
+/**
+ Allow the caller to discover all or some of the SMBIOS records.
+
+ This function allows all of the SMBIOS records to be discovered. It's possible to find
+ only the SMBIOS records that match the optional Type argument.
+
+ @param[in] This The EFI_SMBIOS_PROTOCOL instance.
+ @param[in, out] SmbiosHandle On entry, points to the previous handle of the SMBIOS record. On exit, points to the
+ next SMBIOS record handle. If it is FFFEh on entry, then the first SMBIOS record
+ handle will be returned. If it returns FFFEh on exit, then there are no more SMBIOS records.
+ @param[in] Type On entry, it points to the type of the next SMBIOS record to return. If NULL, it
+ indicates that the next record of any type will be returned. Type is not
+ modified by the this function.
+ @param[out] Record On exit, points to a pointer to the the SMBIOS Record consisting of the formatted area
+ followed by the unformatted area. The unformatted area optionally contains text strings.
+ @param[out] ProducerHandle On exit, points to the ProducerHandle registered by Add(). If no
+ ProducerHandle was passed into Add() NULL is returned. If a NULL pointer is
+ passed in no data will be returned.
+ @retval EFI_SUCCESS SMBIOS record information was successfully returned in Record.
+ SmbiosHandle is the handle of the current SMBIOS record
+ @retval EFI_NOT_FOUND The SMBIOS record with SmbiosHandle was the last available record.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBIOS_GET_NEXT)(
+ IN CONST EFI_SMBIOS_PROTOCOL *This,
+ IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle,
+ IN EFI_SMBIOS_TYPE *Type OPTIONAL,
+ OUT EFI_SMBIOS_TABLE_HEADER **Record,
+ OUT EFI_HANDLE *ProducerHandle OPTIONAL
+);
+
+struct _EFI_SMBIOS_PROTOCOL {
+ EFI_SMBIOS_ADD Add;
+ EFI_SMBIOS_UPDATE_STRING UpdateString;
+ EFI_SMBIOS_REMOVE Remove;
+ EFI_SMBIOS_GET_NEXT GetNext;
+ UINT8 MajorVersion; ///< The major revision of the SMBIOS specification supported.
+ UINT8 MinorVersion; ///< The minor revision of the SMBIOS specification supported.
+};
+
+extern EFI_GUID gEfiSmbiosProtocolGuid;
+
+#endif // __SMBIOS_PROTOCOL_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmbusHc.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmbusHc.h
new file mode 100644
index 0000000000..d5620d7a6c
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmbusHc.h
@@ -0,0 +1,295 @@
+/** @file
+ The file provides basic SMBus host controller management
+ and basic data transactions over the SMBus.
+
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference: PI
+ Version 1.00.
+
+**/
+
+#ifndef __SMBUS_HC_H__
+#define __SMBUS_HC_H__
+
+#include <IndustryStandard/SmBus.h>
+
+#define EFI_SMBUS_HC_PROTOCOL_GUID \
+ {0xe49d33ed, 0x513d, 0x4634, { 0xb6, 0x98, 0x6f, 0x55, 0xaa, 0x75, 0x1c, 0x1b} }
+
+typedef struct _EFI_SMBUS_HC_PROTOCOL EFI_SMBUS_HC_PROTOCOL;
+
+/**
+
+ The Execute() function provides a standard way to execute an
+ operation as defined in the System Management Bus (SMBus)
+ Specification. The resulting transaction will be either that
+ the SMBus slave devices accept this transaction or that this
+ function returns with error.
+
+ @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.
+ SlaveAddress The SMBus slave address of the device
+ with which to communicate. Type
+ EFI_SMBUS_DEVICE_ADDRESS is defined in
+ EFI_PEI_SMBUS_PPI.Execute() in the Platform
+ Initialization SMBus PPI Specification.
+
+ @param Command This command is transmitted by the SMBus host
+ controller to the SMBus slave device and the
+ interpretation is SMBus slave device specific.
+ It can mean the offset to a list of functions
+ inside an SMBus slave device. Not all
+ operations or slave devices support this
+ command's registers. Type
+ EFI_SMBUS_DEVICE_COMMAND is defined in
+ EFI_PEI_SMBUS_PPI.Execute() in the Platform
+ Initialization SMBus PPI Specification.
+
+ @param Operation Signifies the particular SMBus
+ hardware protocol instance it will use to
+ execute the SMBus transactions. This SMBus
+ hardware protocol is defined by the SMBus
+ Specification and is not related to PI
+ Architecture. Type EFI_SMBUS_OPERATION is
+ defined in EFI_PEI_SMBUS_PPI.Execute() in the
+ Platform Initialization SMBus PPI
+ Specification.
+
+ @param PecCheck Defines if Packet Error Code (PEC) checking
+ is required for this operation. SMBus Host
+ Controller Code Definitions Version 1.0
+ August 21, 2006 13
+
+ @param Length Signifies the number of bytes that this operation will do.
+ The maximum number of bytes can be revision
+ specific and operation specific. This field
+ will contain the actual number of bytes that
+ are executed for this operation. Not all
+ operations require this argument.
+
+ @param Buffer Contains the value of data to execute to the
+ SMBus slave device. Not all operations require
+ this argument. The length of this buffer is
+ identified by Length.
+
+
+ @retval EFI_SUCCESS The last data that was returned from the
+ access matched the poll exit criteria.
+
+ @retval EFI_CRC_ERROR Checksum is not correct (PEC is incorrect).
+
+ @retval EFI_TIMEOUT Timeout expired before the operation was
+ completed. Timeout is determined by the
+ SMBus host controller device.
+
+ @retval EFI_OUT_OF_RESOURCES The request could not be
+ completed due to a lack of
+ resources.
+
+ @retval EFI_DEVICE_ERROR The request was not completed
+ because a failure that was reflected
+ in the Host Status Register bit.
+ Device errors are a result of a
+ transaction collision, illegal
+ command field, unclaimed cycle (host
+ initiated), or bus errors
+ (collisions).
+
+ @retval EFI_INVALID_PARAMETER Operation is not defined in
+ EFI_SMBUS_OPERATION.
+
+ @retval EFI_INVALID_PARAMETER Length/Buffer is NULL for
+ operations except for
+ EfiSmbusQuickRead and
+ EfiSmbusQuickWrite. Length is
+ outside the range of valid
+ values.
+
+ @retval EFI_UNSUPPORTED The SMBus operation or PEC is not
+ supported.
+
+ @retval EFI_BUFFER_TOO_SMALL Buffer is not sufficient for
+ this operation.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBUS_HC_EXECUTE_OPERATION)(
+ IN CONST EFI_SMBUS_HC_PROTOCOL *This,
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
+ IN EFI_SMBUS_DEVICE_COMMAND Command,
+ IN EFI_SMBUS_OPERATION Operation,
+ IN BOOLEAN PecCheck,
+ IN OUT UINTN *Length,
+ IN OUT VOID *Buffer
+);
+
+
+
+/**
+
+ The ArpDevice() function provides a standard way for a device driver to
+ enumerate the entire SMBus or specific devices on the bus.
+
+ @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.
+
+ @param ArpAll A Boolean expression that indicates if the
+ host drivers need to enumerate all the devices
+ or enumerate only the device that is
+ identified by SmbusUdid. If ArpAll is TRUE,
+ SmbusUdid and SlaveAddress are optional. If
+ ArpAll is FALSE, ArpDevice will enumerate
+ SmbusUdid and the address will be at
+ SlaveAddress.
+
+ @param SmbusUdid The Unique Device Identifier (UDID) that is
+ associated with this device. Type
+ EFI_SMBUS_UDID is defined in
+ EFI_PEI_SMBUS_PPI.ArpDevice() in the
+ Platform Initialization SMBus PPI
+ Specification.
+
+ @param SlaveAddress The SMBus slave address that is
+ associated with an SMBus UDID.
+
+ @retval EFI_SUCCESS The last data that was returned from the
+ access matched the poll exit criteria.
+
+ @retval EFI_CRC_ERROR Checksum is not correct (PEC is
+ incorrect).
+
+ @retval EFI_TIMEOUT Timeout expired before the operation was
+ completed. Timeout is determined by the
+ SMBus host controller device.
+
+ @retval EFI_OUT_OF_RESOURCES The request could not be
+ completed due to a lack of
+ resources.
+
+ @retval EFI_DEVICE_ERROR The request was not completed
+ because a failure was reflected in
+ the Host Status Register bit. Device
+ Errors are a result of a transaction
+ collision, illegal command field,
+ unclaimed cycle (host initiated), or
+ bus errors (collisions).
+
+ @retval EFI_UNSUPPORTED ArpDevice, GetArpMap, and Notify are
+ not implemented by this driver.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE)(
+ IN CONST EFI_SMBUS_HC_PROTOCOL *This,
+ IN BOOLEAN ArpAll,
+ IN EFI_SMBUS_UDID *SmbusUdid, OPTIONAL
+ IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress OPTIONAL
+);
+
+
+/**
+ The GetArpMap() function returns the mapping of all the SMBus devices
+ that were enumerated by the SMBus host driver.
+
+ @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.
+
+ @param Length Size of the buffer that contains the SMBus
+ device map.
+
+ @param SmbusDeviceMap The pointer to the device map as
+ enumerated by the SMBus controller
+ driver.
+
+ @retval EFI_SUCCESS The SMBus returned the current device map.
+
+ @retval EFI_UNSUPPORTED ArpDevice, GetArpMap, and Notify are
+ not implemented by this driver.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP)(
+ IN CONST EFI_SMBUS_HC_PROTOCOL *This,
+ IN OUT UINTN *Length,
+ IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap
+);
+
+/**
+ The notify function does some actions.
+
+ @param SlaveAddress
+ The SMBUS hardware address to which the SMBUS device is preassigned or allocated.
+
+ @param Data
+ Data of the SMBus host notify command that the caller wants to be called.
+
+ @return EFI_STATUS
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBUS_NOTIFY_FUNCTION)(
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
+ IN UINTN Data
+);
+
+
+/**
+
+ The Notify() function registers all the callback functions to
+ allow the bus driver to call these functions when the
+ SlaveAddress/Data pair happens.
+
+ @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.
+
+ @param SlaveAddress Address that the host controller detects
+ as sending a message and calls all the registered function.
+
+ @param Data Data that the host controller detects as sending
+ message and calls all the registered function.
+
+
+ @param NotifyFunction The function to call when the bus
+ driver detects the SlaveAddress and
+ Data pair.
+
+ @retval EFI_SUCCESS NotifyFunction was registered.
+
+ @retval EFI_UNSUPPORTED ArpDevice, GetArpMap, and Notify are
+ not implemented by this driver.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBUS_HC_PROTOCOL_NOTIFY)(
+ IN CONST EFI_SMBUS_HC_PROTOCOL *This,
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
+ IN UINTN Data,
+ IN EFI_SMBUS_NOTIFY_FUNCTION NotifyFunction
+);
+
+
+///
+/// The EFI_SMBUS_HC_PROTOCOL provides SMBus host controller management and basic data
+/// transactions over SMBus. There is one EFI_SMBUS_HC_PROTOCOL instance for each SMBus
+/// host controller.
+///
+struct _EFI_SMBUS_HC_PROTOCOL {
+ EFI_SMBUS_HC_EXECUTE_OPERATION Execute;
+ EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE ArpDevice;
+ EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP GetArpMap;
+ EFI_SMBUS_HC_PROTOCOL_NOTIFY Notify;
+};
+
+
+extern EFI_GUID gEfiSmbusHcProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmAccess2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmAccess2.h
new file mode 100644
index 0000000000..f202d557aa
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmAccess2.h
@@ -0,0 +1,44 @@
+/** @file
+ EFI SMM Access2 Protocol as defined in the PI 1.2 specification.
+
+ This protocol is used to control the visibility of the SMRAM on the platform.
+ It abstracts the location and characteristics of SMRAM. The expectation is
+ that the north bridge or memory controller would publish this protocol.
+
+ The principal functionality found in the memory controller includes the following:
+ - Exposing the SMRAM to all non-SMM agents, or the "open" state
+ - Shrouding the SMRAM to all but the SMM agents, or the "closed" state
+ - Preserving the system integrity, or "locking" the SMRAM, such that the settings cannot be
+ perturbed by either boot service or runtime agents
+
+ Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_ACCESS2_H_
+#define _SMM_ACCESS2_H_
+
+#include <Protocol/MmAccess.h>
+
+#define EFI_SMM_ACCESS2_PROTOCOL_GUID EFI_MM_ACCESS_PROTOCOL_GUID
+
+typedef EFI_MM_ACCESS_PROTOCOL EFI_SMM_ACCESS2_PROTOCOL;
+
+typedef EFI_MM_OPEN EFI_SMM_OPEN2;
+
+typedef EFI_MM_CLOSE EFI_SMM_CLOSE2;
+
+typedef EFI_MM_LOCK EFI_SMM_LOCK2;
+
+typedef EFI_MM_CAPABILITIES EFI_SMM_CAPABILITIES2;
+extern EFI_GUID gEfiSmmAccess2ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmBase2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmBase2.h
new file mode 100644
index 0000000000..393ce679ac
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmBase2.h
@@ -0,0 +1,85 @@
+/** @file
+ EFI SMM Base2 Protocol as defined in the PI 1.2 specification.
+
+ This protocol is utilized by all SMM drivers to locate the SMM infrastructure services and determine
+ whether the driver is being invoked inside SMRAM or outside of SMRAM.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_BASE2_H_
+#define _SMM_BASE2_H_
+
+#include <Pi/PiSmmCis.h>
+#include <Protocol/MmBase.h>
+
+#define EFI_SMM_BASE2_PROTOCOL_GUID EFI_MM_BASE_PROTOCOL_GUID
+
+typedef struct _EFI_SMM_BASE2_PROTOCOL EFI_SMM_BASE2_PROTOCOL;
+
+/**
+ Service to indicate whether the driver is currently executing in the SMM Initialization phase.
+
+ This service is used to indicate whether the driver is currently executing in the SMM Initialization
+ phase. For SMM drivers, this will return TRUE in InSmram while inside the driver's entry point and
+ otherwise FALSE. For combination SMM/DXE drivers, this will return FALSE in the DXE launch. For the
+ SMM launch, it behaves as an SMM driver.
+
+ @param[in] This The EFI_SMM_BASE2_PROTOCOL instance.
+ @param[out] InSmram Pointer to a Boolean which, on return, indicates that the driver is
+ currently executing inside of SMRAM (TRUE) or outside of SMRAM (FALSE).
+
+ @retval EFI_SUCCESS The call returned successfully.
+ @retval EFI_INVALID_PARAMETER InSmram was NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMM_INSIDE_OUT2)(
+ IN CONST EFI_SMM_BASE2_PROTOCOL *This,
+ OUT BOOLEAN *InSmram
+ )
+;
+
+/**
+ Returns the location of the System Management Service Table (SMST).
+
+ This function returns the location of the System Management Service Table (SMST). The use of the
+ API is such that a driver can discover the location of the SMST in its entry point and then cache it in
+ some driver global variable so that the SMST can be invoked in subsequent handlers.
+
+ @param[in] This The EFI_SMM_BASE2_PROTOCOL instance.
+ @param[in,out] Smst On return, points to a pointer to the System Management Service Table (SMST).
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_INVALID_PARAMETER Smst was invalid.
+ @retval EFI_UNSUPPORTED Not in SMM.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMM_GET_SMST_LOCATION2)(
+ IN CONST EFI_SMM_BASE2_PROTOCOL *This,
+ IN OUT EFI_SMM_SYSTEM_TABLE2 **Smst
+ )
+;
+
+///
+/// EFI SMM Base2 Protocol is utilized by all SMM drivers to locate the SMM infrastructure
+/// services and determine whether the driver is being invoked inside SMRAM or outside of SMRAM.
+///
+struct _EFI_SMM_BASE2_PROTOCOL {
+ EFI_SMM_INSIDE_OUT2 InSmm;
+ EFI_SMM_GET_SMST_LOCATION2 GetSmstLocation;
+};
+
+extern EFI_GUID gEfiSmmBase2ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmCommunication.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmCommunication.h
new file mode 100644
index 0000000000..189dd72f40
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmCommunication.h
@@ -0,0 +1,33 @@
+/** @file
+ EFI SMM Communication Protocol as defined in the PI 1.2 specification.
+
+ This protocol provides a means of communicating between drivers outside of SMM and SMI
+ handlers inside of SMM.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_COMMUNICATION_H_
+#define _SMM_COMMUNICATION_H_
+
+#include <Protocol/MmCommunication.h>
+
+
+typedef EFI_MM_COMMUNICATE_HEADER EFI_SMM_COMMUNICATE_HEADER;
+
+#define EFI_SMM_COMMUNICATION_PROTOCOL_GUID EFI_MM_COMMUNICATION_PROTOCOL_GUID
+
+typedef EFI_MM_COMMUNICATION_PROTOCOL EFI_SMM_COMMUNICATION_PROTOCOL;
+
+extern EFI_GUID gEfiSmmCommunicationProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmConfiguration.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmConfiguration.h
new file mode 100644
index 0000000000..e26112cca9
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmConfiguration.h
@@ -0,0 +1,84 @@
+/** @file
+ EFI SMM Configuration Protocol as defined in the PI 1.2 specification.
+
+ This protocol is used to:
+ 1) report the portions of SMRAM regions which cannot be used for the SMRAM heap.
+ 2) register the SMM Foundation entry point with the processor code. The entry
+ point will be invoked by the SMM processor entry code.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_CONFIGURATION_H_
+#define _SMM_CONFIGURATION_H_
+
+#include <Protocol/MmConfiguration.h>
+#include <Pi/PiSmmCis.h>
+
+#define EFI_SMM_CONFIGURATION_PROTOCOL_GUID EFI_MM_CONFIGURATION_PROTOCOL_GUID
+
+///
+/// Structure describing a SMRAM region which cannot be used for the SMRAM heap.
+///
+typedef struct _EFI_SMM_RESERVED_SMRAM_REGION {
+ ///
+ /// Starting address of the reserved SMRAM area, as it appears while SMRAM is open.
+ /// Ignored if SmramReservedSize is 0.
+ ///
+ EFI_PHYSICAL_ADDRESS SmramReservedStart;
+ ///
+ /// Number of bytes occupied by the reserved SMRAM area. A size of zero indicates the
+ /// last SMRAM area.
+ ///
+ UINT64 SmramReservedSize;
+} EFI_SMM_RESERVED_SMRAM_REGION;
+
+typedef struct _EFI_SMM_CONFIGURATION_PROTOCOL EFI_SMM_CONFIGURATION_PROTOCOL;
+
+/**
+ Register the SMM Foundation entry point.
+
+ This function registers the SMM Foundation entry point with the processor code. This entry point
+ will be invoked by the SMM Processor entry code.
+
+ @param[in] This The EFI_SMM_CONFIGURATION_PROTOCOL instance.
+ @param[in] SmmEntryPoint SMM Foundation entry point.
+
+ @retval EFI_SUCCESS Success to register SMM Entry Point.
+ @retval EFI_INVALID_PARAMETER SmmEntryPoint is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMM_REGISTER_SMM_ENTRY)(
+ IN CONST EFI_SMM_CONFIGURATION_PROTOCOL *This,
+ IN EFI_SMM_ENTRY_POINT SmmEntryPoint
+ );
+
+///
+/// The EFI SMM Configuration Protocol is a mandatory protocol published by a DXE CPU driver to
+/// indicate which areas within SMRAM are reserved for use by the CPU for any purpose,
+/// such as stack, save state or SMM entry point.
+///
+/// The RegisterSmmEntry() function allows the SMM IPL DXE driver to register the SMM
+/// Foundation entry point with the SMM entry vector code.
+///
+struct _EFI_SMM_CONFIGURATION_PROTOCOL {
+ ///
+ /// A pointer to an array SMRAM ranges used by the initial SMM entry code.
+ ///
+ EFI_SMM_RESERVED_SMRAM_REGION *SmramReservedRegions;
+ EFI_SMM_REGISTER_SMM_ENTRY RegisterSmmEntry;
+};
+
+extern EFI_GUID gEfiSmmConfigurationProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmControl2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmControl2.h
new file mode 100644
index 0000000000..9e558c25c3
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmControl2.h
@@ -0,0 +1,41 @@
+/** @file
+ EFI SMM Control2 Protocol as defined in the PI 1.2 specification.
+
+ This protocol is used initiate synchronous SMI activations. This protocol could be published by a
+ processor driver to abstract the SMI IPI or a driver which abstracts the ASIC that is supporting the
+ APM port. Because of the possibility of performing SMI IPI transactions, the ability to generate this
+ event from a platform chipset agent is an optional capability for both IA-32 and x64-based systems.
+
+ The EFI_SMM_CONTROL2_PROTOCOL is produced by a runtime driver. It provides an
+ abstraction of the platform hardware that generates an SMI. There are often I/O ports that, when
+ accessed, will generate the SMI. Also, the hardware optionally supports the periodic generation of
+ these signals.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_CONTROL2_H_
+#define _SMM_CONTROL2_H_
+
+#include <Protocol/MmControl.h>
+
+#define EFI_SMM_CONTROL2_PROTOCOL_GUID EFI_MM_CONTROL_PROTOCOL_GUID
+
+typedef EFI_MM_CONTROL_PROTOCOL EFI_SMM_CONTROL2_PROTOCOL;
+typedef EFI_MM_PERIOD EFI_SMM_PERIOD;
+
+typedef EFI_MM_ACTIVATE EFI_SMM_ACTIVATE2;
+
+typedef EFI_MM_DEACTIVATE EFI_SMM_DEACTIVATE2;
+extern EFI_GUID gEfiSmmControl2ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmCpu.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmCpu.h
new file mode 100644
index 0000000000..fc9fc04bca
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmCpu.h
@@ -0,0 +1,136 @@
+/** @file
+ EFI SMM CPU Protocol as defined in the PI 1.2 specification.
+
+ This protocol allows SMM drivers to access architecture-standard registers from any of the CPU
+ save state areas. In some cases, difference processors provide the same information in the save state,
+ but not in the same format. These so-called pseudo-registers provide this information in a standard
+ format.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_CPU_H_
+#define _SMM_CPU_H_
+
+#include <Protocol/MmCpu.h>
+
+#define EFI_SMM_CPU_PROTOCOL_GUID EFI_MM_CPU_PROTOCOL_GUID
+
+#define EFI_SMM_SAVE_STATE_REGISTER_GDTBASE EFI_MM_SAVE_STATE_REGISTER_GDTBASE
+#define EFI_SMM_SAVE_STATE_REGISTER_IDTBASE EFI_MM_SAVE_STATE_REGISTER_IDTBASE
+#define EFI_SMM_SAVE_STATE_REGISTER_LDTBASE EFI_MM_SAVE_STATE_REGISTER_LDTBASE
+#define EFI_SMM_SAVE_STATE_REGISTER_GDTLIMIT EFI_MM_SAVE_STATE_REGISTER_GDTLIMIT
+#define EFI_SMM_SAVE_STATE_REGISTER_IDTLIMIT EFI_MM_SAVE_STATE_REGISTER_IDTLIMIT
+#define EFI_SMM_SAVE_STATE_REGISTER_LDTLIMIT EFI_MM_SAVE_STATE_REGISTER_LDTLIMIT
+#define EFI_SMM_SAVE_STATE_REGISTER_LDTINFO EFI_MM_SAVE_STATE_REGISTER_LDTINFO
+#define EFI_SMM_SAVE_STATE_REGISTER_ES EFI_MM_SAVE_STATE_REGISTER_ES
+#define EFI_SMM_SAVE_STATE_REGISTER_CS EFI_MM_SAVE_STATE_REGISTER_CS
+#define EFI_SMM_SAVE_STATE_REGISTER_SS EFI_MM_SAVE_STATE_REGISTER_SS
+#define EFI_SMM_SAVE_STATE_REGISTER_DS EFI_MM_SAVE_STATE_REGISTER_DS
+#define EFI_SMM_SAVE_STATE_REGISTER_FS EFI_MM_SAVE_STATE_REGISTER_FS
+#define EFI_SMM_SAVE_STATE_REGISTER_GS EFI_MM_SAVE_STATE_REGISTER_GS
+#define EFI_SMM_SAVE_STATE_REGISTER_LDTR_SEL EFI_MM_SAVE_STATE_REGISTER_LDTR_SEL
+#define EFI_SMM_SAVE_STATE_REGISTER_TR_SEL EFI_MM_SAVE_STATE_REGISTER_TR_SEL
+#define EFI_SMM_SAVE_STATE_REGISTER_DR7 EFI_MM_SAVE_STATE_REGISTER_DR7
+#define EFI_SMM_SAVE_STATE_REGISTER_DR6 EFI_MM_SAVE_STATE_REGISTER_DR6
+#define EFI_SMM_SAVE_STATE_REGISTER_R8 EFI_MM_SAVE_STATE_REGISTER_R8
+#define EFI_SMM_SAVE_STATE_REGISTER_R9 EFI_MM_SAVE_STATE_REGISTER_R9
+#define EFI_SMM_SAVE_STATE_REGISTER_R10 EFI_MM_SAVE_STATE_REGISTER_R10
+#define EFI_SMM_SAVE_STATE_REGISTER_R11 EFI_MM_SAVE_STATE_REGISTER_R11
+#define EFI_SMM_SAVE_STATE_REGISTER_R12 EFI_MM_SAVE_STATE_REGISTER_R12
+#define EFI_SMM_SAVE_STATE_REGISTER_R13 EFI_MM_SAVE_STATE_REGISTER_R13
+#define EFI_SMM_SAVE_STATE_REGISTER_R14 EFI_MM_SAVE_STATE_REGISTER_R14
+#define EFI_SMM_SAVE_STATE_REGISTER_R15 EFI_MM_SAVE_STATE_REGISTER_R15
+#define EFI_SMM_SAVE_STATE_REGISTER_RAX EFI_MM_SAVE_STATE_REGISTER_RAX
+#define EFI_SMM_SAVE_STATE_REGISTER_RBX EFI_MM_SAVE_STATE_REGISTER_RBX
+#define EFI_SMM_SAVE_STATE_REGISTER_RCX EFI_MM_SAVE_STATE_REGISTER_RCX
+#define EFI_SMM_SAVE_STATE_REGISTER_RDX EFI_MM_SAVE_STATE_REGISTER_RDX
+#define EFI_SMM_SAVE_STATE_REGISTER_RSP EFI_MM_SAVE_STATE_REGISTER_RSP
+#define EFI_SMM_SAVE_STATE_REGISTER_RBP EFI_MM_SAVE_STATE_REGISTER_RBP
+#define EFI_SMM_SAVE_STATE_REGISTER_RSI EFI_MM_SAVE_STATE_REGISTER_RSI
+#define EFI_SMM_SAVE_STATE_REGISTER_RDI EFI_MM_SAVE_STATE_REGISTER_RDI
+#define EFI_SMM_SAVE_STATE_REGISTER_RIP EFI_MM_SAVE_STATE_REGISTER_RIP
+#define EFI_SMM_SAVE_STATE_REGISTER_RFLAGS EFI_MM_SAVE_STATE_REGISTER_RFLAGS
+#define EFI_SMM_SAVE_STATE_REGISTER_CR0 EFI_MM_SAVE_STATE_REGISTER_CR0
+#define EFI_SMM_SAVE_STATE_REGISTER_CR3 EFI_MM_SAVE_STATE_REGISTER_CR3
+#define EFI_SMM_SAVE_STATE_REGISTER_CR4 EFI_MM_SAVE_STATE_REGISTER_CR4
+#define EFI_SMM_SAVE_STATE_REGISTER_FCW EFI_MM_SAVE_STATE_REGISTER_FCW
+#define EFI_SMM_SAVE_STATE_REGISTER_FSW EFI_MM_SAVE_STATE_REGISTER_FSW
+#define EFI_SMM_SAVE_STATE_REGISTER_FTW EFI_MM_SAVE_STATE_REGISTER_FTW
+#define EFI_SMM_SAVE_STATE_REGISTER_OPCODE EFI_MM_SAVE_STATE_REGISTER_OPCODE
+#define EFI_SMM_SAVE_STATE_REGISTER_FP_EIP EFI_MM_SAVE_STATE_REGISTER_FP_EIP
+#define EFI_SMM_SAVE_STATE_REGISTER_FP_CS EFI_MM_SAVE_STATE_REGISTER_FP_CS
+#define EFI_SMM_SAVE_STATE_REGISTER_DATAOFFSET EFI_MM_SAVE_STATE_REGISTER_DATAOFFSET
+#define EFI_SMM_SAVE_STATE_REGISTER_FP_DS EFI_MM_SAVE_STATE_REGISTER_FP_DS
+#define EFI_SMM_SAVE_STATE_REGISTER_MM0 EFI_MM_SAVE_STATE_REGISTER_MM0
+#define EFI_SMM_SAVE_STATE_REGISTER_MM1 EFI_MM_SAVE_STATE_REGISTER_MM1
+#define EFI_SMM_SAVE_STATE_REGISTER_MM2 EFI_MM_SAVE_STATE_REGISTER_MM2
+#define EFI_SMM_SAVE_STATE_REGISTER_MM3 EFI_MM_SAVE_STATE_REGISTER_MM3
+#define EFI_SMM_SAVE_STATE_REGISTER_MM4 EFI_MM_SAVE_STATE_REGISTER_MM4
+#define EFI_SMM_SAVE_STATE_REGISTER_MM5 EFI_MM_SAVE_STATE_REGISTER_MM5
+#define EFI_SMM_SAVE_STATE_REGISTER_MM6 EFI_MM_SAVE_STATE_REGISTER_MM6
+#define EFI_SMM_SAVE_STATE_REGISTER_MM7 EFI_MM_SAVE_STATE_REGISTER_MM7
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM0 EFI_MM_SAVE_STATE_REGISTER_XMM0
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM1 EFI_MM_SAVE_STATE_REGISTER_XMM1
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM2 EFI_MM_SAVE_STATE_REGISTER_XMM2
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM3 EFI_MM_SAVE_STATE_REGISTER_XMM3
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM4 EFI_MM_SAVE_STATE_REGISTER_XMM4
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM5 EFI_MM_SAVE_STATE_REGISTER_XMM5
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM6 EFI_MM_SAVE_STATE_REGISTER_XMM6
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM7 EFI_MM_SAVE_STATE_REGISTER_XMM7
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM8 EFI_MM_SAVE_STATE_REGISTER_XMM8
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM9 EFI_MM_SAVE_STATE_REGISTER_XMM9
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM10 EFI_MM_SAVE_STATE_REGISTER_XMM10
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM11 EFI_MM_SAVE_STATE_REGISTER_XMM11
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM12 EFI_MM_SAVE_STATE_REGISTER_XMM12
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM13 EFI_MM_SAVE_STATE_REGISTER_XMM13
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM14 EFI_MM_SAVE_STATE_REGISTER_XMM14
+#define EFI_SMM_SAVE_STATE_REGISTER_XMM15 EFI_MM_SAVE_STATE_REGISTER_XMM15
+#define EFI_SMM_SAVE_STATE_REGISTER_IO EFI_MM_SAVE_STATE_REGISTER_IO
+#define EFI_SMM_SAVE_STATE_REGISTER_LMA EFI_MM_SAVE_STATE_REGISTER_LMA
+#define EFI_SMM_SAVE_STATE_REGISTER_PROCESSOR_ID EFI_MM_SAVE_STATE_REGISTER_PROCESSOR_ID
+
+typedef EFI_MM_SAVE_STATE_REGISTER EFI_SMM_SAVE_STATE_REGISTER;
+
+
+#define EFI_SMM_SAVE_STATE_REGISTER_LMA_32BIT EFI_MM_SAVE_STATE_REGISTER_LMA_32BIT
+#define EFI_SMM_SAVE_STATE_REGISTER_LMA_64BIT EFI_MM_SAVE_STATE_REGISTER_LMA_64BIT
+
+
+///
+/// Size width of I/O instruction
+///
+#define EFI_SMM_SAVE_STATE_IO_WIDTH_UINT8 EFI_MM_SAVE_STATE_IO_WIDTH_UINT8
+#define EFI_SMM_SAVE_STATE_IO_WIDTH_UINT16 EFI_MM_SAVE_STATE_IO_WIDTH_UINT16
+#define EFI_SMM_SAVE_STATE_IO_WIDTH_UINT32 EFI_MM_SAVE_STATE_IO_WIDTH_UINT32
+#define EFI_SMM_SAVE_STATE_IO_WIDTH_UINT64 EFI_MM_SAVE_STATE_IO_WIDTH_UINT64
+typedef EFI_MM_SAVE_STATE_IO_WIDTH EFI_SMM_SAVE_STATE_IO_WIDTH;
+
+///
+/// Types of I/O instruction
+///
+#define EFI_SMM_SAVE_STATE_IO_TYPE_INPUT EFI_MM_SAVE_STATE_IO_TYPE_INPUT
+#define EFI_SMM_SAVE_STATE_IO_TYPE_OUTPUT EFI_MM_SAVE_STATE_IO_TYPE_OUTPUT
+#define EFI_SMM_SAVE_STATE_IO_TYPE_STRING EFI_MM_SAVE_STATE_IO_TYPE_STRING
+#define EFI_SMM_SAVE_STATE_IO_TYPE_REP_PREFIX EFI_MM_SAVE_STATE_IO_TYPE_REP_PREFIX
+typedef EFI_MM_SAVE_STATE_IO_TYPE EFI_SMM_SAVE_STATE_IO_TYPE;
+
+typedef EFI_MM_SAVE_STATE_IO_INFO EFI_SMM_SAVE_STATE_IO_INFO;
+
+typedef EFI_MM_CPU_PROTOCOL EFI_SMM_CPU_PROTOCOL;
+
+typedef EFI_MM_READ_SAVE_STATE EFI_SMM_READ_SAVE_STATE;
+
+typedef EFI_MM_WRITE_SAVE_STATE EFI_SMM_WRITE_SAVE_STATE;
+extern EFI_GUID gEfiSmmCpuProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmCpuIo2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmCpuIo2.h
new file mode 100644
index 0000000000..cc4fa91725
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmCpuIo2.h
@@ -0,0 +1,41 @@
+/** @file
+ SMM CPU I/O 2 protocol as defined in the PI 1.2 specification.
+
+ This protocol provides CPU I/O and memory access within SMM.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_CPU_IO2_H_
+#define _SMM_CPU_IO2_H_
+
+#include <Protocol/MmCpuIo.h>
+
+#define EFI_SMM_CPU_IO2_PROTOCOL_GUID EFI_MM_CPU_IO_PROTOCOL_GUID
+
+typedef EFI_MM_CPU_IO_PROTOCOL EFI_SMM_CPU_IO2_PROTOCOL;
+
+///
+/// Width of the SMM CPU I/O operations
+///
+#define SMM_IO_UINT8 MM_IO_UINT8
+#define SMM_IO_UINT16 MM_IO_UINT16
+#define SMM_IO_UINT32 MM_IO_UINT32
+#define SMM_IO_UINT64 MM_IO_UINT64
+
+typedef EFI_MM_IO_WIDTH EFI_SMM_IO_WIDTH;
+typedef EFI_MM_CPU_IO EFI_SMM_CPU_IO2;
+
+typedef EFI_MM_IO_ACCESS EFI_SMM_IO_ACCESS2;
+
+extern EFI_GUID gEfiSmmCpuIo2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmEndOfDxe.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmEndOfDxe.h
new file mode 100644
index 0000000000..9e29ebdb4b
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmEndOfDxe.h
@@ -0,0 +1,32 @@
+/** @file
+ SMM End Of Dxe protocol introduced in the PI 1.2.1 specification.
+
+ According to PI 1.4a specification, this protocol indicates end of the
+ execution phase when all of the components are under the authority of
+ the platform manufacturer.
+ This protocol is a mandatory protocol published by SMM Foundation code.
+ This protocol is an SMM counterpart of the End of DXE Event.
+ This protocol prorogates End of DXE notification into SMM environment.
+ This protocol is installed prior to installation of the SMM Ready to Lock Protocol.
+
+ Copyright (c) 2012 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_END_OF_DXE_H_
+#define _SMM_END_OF_DXE_H_
+
+#include <Protocol/MmEndOfDxe.h>
+
+#define EFI_SMM_END_OF_DXE_PROTOCOL_GUID EFI_MM_END_OF_DXE_PROTOCOL_GUID
+
+extern EFI_GUID gEfiSmmEndOfDxeProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmGpiDispatch2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmGpiDispatch2.h
new file mode 100644
index 0000000000..7bec318662
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmGpiDispatch2.h
@@ -0,0 +1,49 @@
+/** @file
+ SMM General Purpose Input (GPI) Dispatch2 Protocol as defined in PI 1.1 Specification
+ Volume 4 System Management Mode Core Interface.
+
+ This protocol provides the parent dispatch service for the General Purpose Input
+ (GPI) SMI source generator.
+
+ The EFI_SMM_GPI_DISPATCH2_PROTOCOL provides the ability to install child handlers for the
+ given event types. Several inputs can be enabled. This purpose of this interface is to generate an
+ SMI in response to any of these inputs having a true value provided.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.1.
+
+**/
+
+#ifndef _SMM_GPI_DISPATCH2_H_
+#define _SMM_GPI_DISPATCH2_H_
+
+#include <Protocol/MmGpiDispatch.h>
+#include <Pi/PiSmmCis.h>
+
+#define EFI_SMM_GPI_DISPATCH2_PROTOCOL_GUID EFI_MM_GPI_DISPATCH_PROTOCOL_GUID
+///
+/// The dispatch function's context.
+///
+typedef EFI_MM_GPI_REGISTER_CONTEXT EFI_SMM_GPI_REGISTER_CONTEXT;
+
+typedef EFI_MM_GPI_REGISTER EFI_SMM_GPI_REGISTER2;
+
+typedef EFI_MM_GPI_UNREGISTER EFI_SMM_GPI_UNREGISTER2;
+
+typedef EFI_MM_GPI_DISPATCH_PROTOCOL EFI_SMM_GPI_DISPATCH2_PROTOCOL;
+
+
+
+extern EFI_GUID gEfiSmmGpiDispatch2ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmIoTrapDispatch2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmIoTrapDispatch2.h
new file mode 100644
index 0000000000..8fe2b33196
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmIoTrapDispatch2.h
@@ -0,0 +1,53 @@
+/** @file
+ SMM IO Trap Dispatch2 Protocol as defined in PI 1.1 Specification
+ Volume 4 System Management Mode Core Interface.
+
+ This protocol provides a parent dispatch service for IO trap SMI sources.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.1.
+
+**/
+
+#ifndef _SMM_IO_TRAP_DISPATCH2_H_
+#define _SMM_IO_TRAP_DISPATCH2_H_
+
+#include <Protocol/MmIoTrapDispatch.h>
+
+#define EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL_GUID EFI_MM_IO_TRAP_DISPATCH_PROTOCOL_GUID
+
+///
+/// IO Trap valid types
+///
+typedef EFI_MM_IO_TRAP_DISPATCH_TYPE EFI_SMM_IO_TRAP_DISPATCH_TYPE;
+
+///
+/// IO Trap context structure containing information about the
+/// IO trap event that should invoke the handler
+///
+typedef EFI_MM_IO_TRAP_REGISTER_CONTEXT EFI_SMM_IO_TRAP_REGISTER_CONTEXT;
+
+///
+/// IO Trap context structure containing information about the IO trap that occurred
+///
+typedef EFI_MM_IO_TRAP_CONTEXT EFI_SMM_IO_TRAP_CONTEXT;
+
+typedef EFI_MM_IO_TRAP_DISPATCH_PROTOCOL EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL;
+
+typedef EFI_MM_IO_TRAP_DISPATCH_REGISTER EFI_SMM_IO_TRAP_DISPATCH2_REGISTER;
+
+typedef EFI_MM_IO_TRAP_DISPATCH_UNREGISTER EFI_SMM_IO_TRAP_DISPATCH2_UNREGISTER;
+
+extern EFI_GUID gEfiSmmIoTrapDispatch2ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmPciRootBridgeIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmPciRootBridgeIo.h
new file mode 100644
index 0000000000..506befc261
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmPciRootBridgeIo.h
@@ -0,0 +1,34 @@
+/** @file
+ SMM PCI Root Bridge IO protocol as defined in the PI 1.2 specification.
+
+ This protocol provides PCI I/O and memory access within SMM.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_PCI_ROOT_BRIDGE_IO_H_
+#define _SMM_PCI_ROOT_BRIDGE_IO_H_
+
+#include <Protocol/MmPciRootBridgeIo.h>
+
+#define EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID EFI_MM_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID
+
+///
+/// This protocol provides the same functionality as the PCI Root Bridge I/O Protocol defined in the
+/// UEFI 2.1 Specifcation, section 13.2, except that the functions for Map() and Unmap() may return
+/// EFI_UNSUPPORTED.
+///
+typedef EFI_MM_PCI_ROOT_BRIDGE_IO_PROTOCOL EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL;
+
+extern EFI_GUID gEfiSmmPciRootBridgeIoProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmPeriodicTimerDispatch2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmPeriodicTimerDispatch2.h
new file mode 100644
index 0000000000..a52daa03c7
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmPeriodicTimerDispatch2.h
@@ -0,0 +1,162 @@
+/** @file
+ SMM Periodic Timer Dispatch Protocol as defined in PI 1.1 Specification
+ Volume 4 System Management Mode Core Interface.
+
+ This protocol provides the parent dispatch service for the periodical timer SMI source generator.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.1.
+
+**/
+
+#ifndef _SMM_PERIODIC_TIMER_DISPATCH2_H_
+#define _SMM_PERIODIC_TIMER_DISPATCH2_H_
+
+#include <Pi/PiSmmCis.h>
+#include <Protocol/MmPeriodicTimerDispatch.h>
+
+#define EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL_GUID EFI_MM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID
+
+///
+/// Example: A chipset supports periodic SMIs on every 64ms or 2 seconds.
+/// A child wishes schedule a period SMI to fire on a period of 3 seconds, there
+/// are several ways to approach the problem:
+/// 1. The child may accept a 4 second periodic rate, in which case it registers with
+/// Period = 40000
+/// SmiTickInterval = 20000
+/// The resulting SMI will occur every 2 seconds with the child called back on
+/// every 2nd SMI.
+/// NOTE: the same result would occur if the child set SmiTickInterval = 0.
+/// 2. The child may choose the finer granularity SMI (64ms):
+/// Period = 30000
+/// SmiTickInterval = 640
+/// The resulting SMI will occur every 64ms with the child called back on
+/// every 47th SMI.
+/// NOTE: the child driver should be aware that this will result in more
+/// SMIs occuring during system runtime which can negatively impact system
+/// performance.
+///
+typedef struct {
+ ///
+ /// The minimum period of time in 100 nanosecond units that the child gets called. The
+ /// child will be called back after a time greater than the time Period.
+ ///
+ UINT64 Period;
+ ///
+ /// The period of time interval between SMIs. Children of this interface should use this
+ /// field when registering for periodic timer intervals when a finer granularity periodic
+ /// SMI is desired.
+ ///
+ UINT64 SmiTickInterval;
+} EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT;
+
+///
+/// The DispatchFunction will be called with Context set to the same value as was passed into
+/// Register() in RegisterContext and with CommBuffer pointing to an instance of
+/// EFI_SMM_PERIODIC_TIMER_CONTEXT and CommBufferSize pointing to its size.
+///
+typedef EFI_MM_PERIODIC_TIMER_CONTEXT EFI_SMM_PERIODIC_TIMER_CONTEXT;
+
+typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL;
+
+/**
+ Register a child SMI source dispatch function for SMM periodic timer.
+
+ This service registers a function (DispatchFunction) which will be called when at least the
+ amount of time specified by RegisterContext has elapsed. On return, DispatchHandle
+ contains a unique handle which may be used later to unregister the function using UnRegister().
+ The DispatchFunction will be called with Context set to the same value as was passed into
+ this function in RegisterContext and with CommBuffer pointing to an instance of
+ EFI_SMM_PERIODIC_TIMER_CONTEXT and CommBufferSize pointing to its size.
+
+ @param[in] This Pointer to the EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL instance.
+ @param[in] DispatchFunction Function to register for handler when at least the specified amount
+ of time has elapsed.
+ @param[in] RegisterContext Pointer to the dispatch function's context.
+ The caller fills this context in before calling
+ the register function to indicate to the register
+ function the period at which the dispatch function
+ should be invoked.
+ @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully
+ registered and the SMI source has been enabled.
+ @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
+ @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The period input value
+ is not within valid range.
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this child.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_REGISTER2)(
+ IN CONST EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL *This,
+ IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,
+ IN CONST EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+ );
+
+/**
+ Unregisters a periodic timer service.
+
+ This service removes the handler associated with DispatchHandle so that it will no longer be
+ called when the time has elapsed.
+
+ @param[in] This Pointer to the EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL instance.
+ @param[in] DispatchHandle Handle of the service to remove.
+
+ @retval EFI_SUCCESS The service has been successfully removed.
+ @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_UNREGISTER2)(
+ IN CONST EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+ );
+
+/**
+ Returns the next SMI tick period supported by the chipset.
+
+ The order returned is from longest to shortest interval period.
+
+ @param[in] This Pointer to the EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL instance.
+ @param[in,out] SmiTickInterval Pointer to pointer of next shorter SMI interval
+ period supported by the child. This parameter works as a get-first,
+ get-next field.The first time this function is called, *SmiTickInterval
+ should be set to NULL to get the longest SMI interval.The returned
+ *SmiTickInterval should be passed in on subsequent calls to get the
+ next shorter interval period until *SmiTickInterval = NULL.
+
+ @retval EFI_SUCCESS The service returned successfully.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_INTERVAL2)(
+ IN CONST EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL *This,
+ IN OUT UINT64 **SmiTickInterval
+ );
+
+///
+/// Interface structure for the SMM Periodic Timer Dispatch Protocol
+///
+/// This protocol provides the parent dispatch service for the periodical timer SMI source generator.
+///
+struct _EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL {
+ EFI_SMM_PERIODIC_TIMER_REGISTER2 Register;
+ EFI_SMM_PERIODIC_TIMER_UNREGISTER2 UnRegister;
+ EFI_SMM_PERIODIC_TIMER_INTERVAL2 GetNextShorterInterval;
+};
+
+extern EFI_GUID gEfiSmmPeriodicTimerDispatch2ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmPowerButtonDispatch2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmPowerButtonDispatch2.h
new file mode 100644
index 0000000000..a21a523234
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmPowerButtonDispatch2.h
@@ -0,0 +1,42 @@
+/** @file
+ SMM Power Button Dispatch2 Protocol as defined in PI 1.1 Specification
+ Volume 4 System Management Mode Core Interface.
+
+ This protocol provides the parent dispatch service for the power button SMI source generator.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.1.
+
+**/
+
+#ifndef _SMM_POWER_BUTTON_DISPATCH2_H_
+#define _SMM_POWER_BUTTON_DISPATCH2_H_
+
+#include <Protocol/MmPowerButtonDispatch.h>
+
+#define EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_GUID EFI_MM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID
+
+///
+/// The dispatch function's context.
+///
+typedef EFI_MM_POWER_BUTTON_REGISTER_CONTEXT EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT;
+
+typedef EFI_MM_POWER_BUTTON_DISPATCH_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL;
+
+typedef EFI_MM_POWER_BUTTON_REGISTER EFI_SMM_POWER_BUTTON_REGISTER2;
+
+typedef EFI_MM_POWER_BUTTON_UNREGISTER EFI_SMM_POWER_BUTTON_UNREGISTER2;
+
+extern EFI_GUID gEfiSmmPowerButtonDispatch2ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmReadyToLock.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmReadyToLock.h
new file mode 100644
index 0000000000..9c73a9415d
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmReadyToLock.h
@@ -0,0 +1,34 @@
+/** @file
+ SMM Ready To Lock protocol introduced in the PI 1.2 specification.
+
+ According to PI 1.4a specification, this SMM protocol indicates that
+ SMM resources and services that should not be used by the third party
+ code are about to be locked.
+ This protocol is a mandatory protocol published by the SMM Foundation
+ code when the system is preparing to lock certain resources and interfaces
+ in anticipation of the invocation of 3rd party extensible modules.
+ This protocol is an SMM counterpart of the DXE SMM Ready to Lock Protocol.
+ This protocol prorogates resource locking notification into SMM environment.
+ This protocol is installed after installation of the SMM End of DXE Protocol.
+
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_READY_TO_LOCK_H_
+#define _SMM_READY_TO_LOCK_H_
+
+#include <Protocol/MmReadyToLock.h>
+
+#define EFI_SMM_READY_TO_LOCK_PROTOCOL_GUID EFI_MM_READY_TO_LOCK_PROTOCOL_GUID
+
+extern EFI_GUID gEfiSmmReadyToLockProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmReportStatusCodeHandler.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmReportStatusCodeHandler.h
new file mode 100644
index 0000000000..498954ba23
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmReportStatusCodeHandler.h
@@ -0,0 +1,32 @@
+/** @file
+ This protocol provides registering and unregistering services to status code consumers while in DXE SMM.
+
+ Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
+#define __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
+
+#include <Protocol/MmReportStatusCodeHandler.h>
+
+#define EFI_SMM_RSC_HANDLER_PROTOCOL_GUID EFI_MM_RSC_HANDLER_PROTOCOL_GUID
+
+typedef EFI_MM_RSC_HANDLER_CALLBACK EFI_SMM_RSC_HANDLER_CALLBACK;
+
+typedef EFI_MM_RSC_HANDLER_REGISTER EFI_SMM_RSC_HANDLER_REGISTER;
+
+typedef EFI_MM_RSC_HANDLER_UNREGISTER EFI_SMM_RSC_HANDLER_UNREGISTER;
+
+typedef EFI_MM_RSC_HANDLER_PROTOCOL EFI_SMM_RSC_HANDLER_PROTOCOL;
+
+extern EFI_GUID gEfiSmmRscHandlerProtocolGuid;
+
+#endif // __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmStandbyButtonDispatch2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmStandbyButtonDispatch2.h
new file mode 100644
index 0000000000..259bac8f4b
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmStandbyButtonDispatch2.h
@@ -0,0 +1,42 @@
+/** @file
+ SMM Standby Button Dispatch2 Protocol as defined in PI 1.1 Specification
+ Volume 4 System Management Mode Core Interface.
+
+ This protocol provides the parent dispatch service for the standby button SMI source generator.
+
+ Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.1.
+
+**/
+
+#ifndef _SMM_STANDBY_BUTTON_DISPATCH2_H_
+#define _SMM_STANDBY_BUTTON_DISPATCH2_H_
+
+#include <Protocol/MmStandbyButtonDispatch.h>
+
+#define EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL_GUID EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID
+
+///
+/// The dispatch function's context.
+///
+typedef EFI_MM_STANDBY_BUTTON_REGISTER_CONTEXT EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT;
+
+typedef EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL;
+
+typedef EFI_MM_STANDBY_BUTTON_REGISTER EFI_SMM_STANDBY_BUTTON_REGISTER2;
+
+typedef EFI_MM_STANDBY_BUTTON_UNREGISTER EFI_SMM_STANDBY_BUTTON_UNREGISTER2;
+
+extern EFI_GUID gEfiSmmStandbyButtonDispatch2ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmStatusCode.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmStatusCode.h
new file mode 100644
index 0000000000..6c89493c5c
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmStatusCode.h
@@ -0,0 +1,31 @@
+/** @file
+ EFI SMM Status Code Protocol as defined in the PI 1.2 specification.
+
+ This protocol provides the basic status code services while in SMM.
+
+ Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_STATUS_CODE_H__
+#define _SMM_STATUS_CODE_H__
+
+#include <Protocol/MmStatusCode.h>
+
+#define EFI_SMM_STATUS_CODE_PROTOCOL_GUID EFI_MM_STATUS_CODE_PROTOCOL_GUID
+
+typedef EFI_MM_STATUS_CODE_PROTOCOL EFI_SMM_STATUS_CODE_PROTOCOL;
+
+typedef EFI_MM_REPORT_STATUS_CODE EFI_SMM_REPORT_STATUS_CODE;
+
+extern EFI_GUID gEfiSmmStatusCodeProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmSwDispatch2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmSwDispatch2.h
new file mode 100644
index 0000000000..6018ac73da
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmSwDispatch2.h
@@ -0,0 +1,134 @@
+/** @file
+ SMM Software Dispatch Protocol introduced from PI 1.2 Specification
+ Volume 4 System Management Mode Core Interface.
+
+ This protocol provides the parent dispatch service for a given SMI source generator.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_SW_DISPATCH2_H_
+#define _SMM_SW_DISPATCH2_H_
+
+#include <Protocol/MmSwDispatch.h>
+#include <Pi/PiSmmCis.h>
+
+#define EFI_SMM_SW_DISPATCH2_PROTOCOL_GUID EFI_MM_SW_DISPATCH_PROTOCOL_GUID
+
+///
+/// A particular chipset may not support all possible software SMI input values.
+/// For example, the ICH supports only values 00h to 0FFh. The parent only allows a single
+/// child registration for each SwSmiInputValue.
+///
+typedef struct {
+ UINTN SwSmiInputValue;
+} EFI_SMM_SW_REGISTER_CONTEXT;
+
+///
+/// The DispatchFunction will be called with Context set to the same value as was passed into
+/// this function in RegisterContext and with CommBuffer (and CommBufferSize) pointing
+/// to an instance of EFI_SMM_SW_CONTEXT indicating the index of the CPU which generated the
+/// software SMI.
+///
+typedef struct {
+ ///
+ /// The 0-based index of the CPU which generated the software SMI.
+ ///
+ UINTN SwSmiCpuIndex;
+ ///
+ /// This value corresponds directly to the CommandPort parameter used in the call to Trigger().
+ ///
+ UINT8 CommandPort;
+ ///
+ /// This value corresponds directly to the DataPort parameter used in the call to Trigger().
+ ///
+ UINT8 DataPort;
+} EFI_SMM_SW_CONTEXT;
+
+typedef struct _EFI_SMM_SW_DISPATCH2_PROTOCOL EFI_SMM_SW_DISPATCH2_PROTOCOL;
+
+/**
+ Register a child SMI source dispatch function for the specified software SMI.
+
+ This service registers a function (DispatchFunction) which will be called when the software
+ SMI source specified by RegisterContext->SwSmiCpuIndex is detected. On return,
+ DispatchHandle contains a unique handle which may be used later to unregister the function
+ using UnRegister().
+
+ @param[in] This Pointer to the EFI_SMM_SW_DISPATCH2_PROTOCOL instance.
+ @param[in] DispatchFunction Function to register for handler when the specified software
+ SMI is generated.
+ @param[in, out] RegisterContext Pointer to the dispatch function's context.
+ The caller fills this context in before calling
+ the register function to indicate to the register
+ function which Software SMI input value the
+ dispatch function should be invoked for.
+ @param[out] DispatchHandle Handle generated by the dispatcher to track the
+ function instance.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully
+ registered and the SMI source has been enabled.
+ @retval EFI_DEVICE_ERROR The SW driver was unable to enable the SMI source.
+ @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The SW SMI input value
+ is not within a valid range or is already in use.
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this
+ child.
+ @retval EFI_OUT_OF_RESOURCES A unique software SMI value could not be assigned
+ for this dispatch.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMM_SW_REGISTER2)(
+ IN CONST EFI_SMM_SW_DISPATCH2_PROTOCOL *This,
+ IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,
+ IN OUT EFI_SMM_SW_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+ );
+
+/**
+ Unregister a child SMI source dispatch function for the specified software SMI.
+
+ This service removes the handler associated with DispatchHandle so that it will no longer be
+ called in response to a software SMI.
+
+ @param[in] This Pointer to the EFI_SMM_SW_DISPATCH2_PROTOCOL instance.
+ @param[in] DispatchHandle Handle of dispatch function to deregister.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully unregistered.
+ @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMM_SW_UNREGISTER2)(
+ IN CONST EFI_SMM_SW_DISPATCH2_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+///
+/// Interface structure for the SMM Software SMI Dispatch Protocol.
+///
+/// The EFI_SMM_SW_DISPATCH2_PROTOCOL provides the ability to install child handlers for the
+/// given software. These handlers will respond to software interrupts, and the maximum software
+/// interrupt in the EFI_SMM_SW_REGISTER_CONTEXT is denoted by MaximumSwiValue.
+///
+struct _EFI_SMM_SW_DISPATCH2_PROTOCOL {
+ EFI_SMM_SW_REGISTER2 Register;
+ EFI_SMM_SW_UNREGISTER2 UnRegister;
+ ///
+ /// A read-only field that describes the maximum value that can be used in the
+ /// EFI_SMM_SW_DISPATCH2_PROTOCOL.Register() service.
+ ///
+ UINTN MaximumSwiValue;
+};
+
+extern EFI_GUID gEfiSmmSwDispatch2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmSxDispatch2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmSxDispatch2.h
new file mode 100644
index 0000000000..ed8fb9cc68
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmSxDispatch2.h
@@ -0,0 +1,38 @@
+/** @file
+ SMM Sx Dispatch Protocol as defined in PI 1.2 Specification
+ Volume 4 System Management Mode Core Interface.
+
+ Provides the parent dispatch service for a given Sx-state source generator.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_SX_DISPATCH2_H_
+#define _SMM_SX_DISPATCH2_H_
+
+#include <Protocol/MmSxDispatch.h>
+
+#define EFI_SMM_SX_DISPATCH2_PROTOCOL_GUID EFI_MM_SX_DISPATCH_PROTOCOL_GUID
+
+///
+/// The dispatch function's context
+///
+typedef EFI_MM_SX_REGISTER_CONTEXT EFI_SMM_SX_REGISTER_CONTEXT;
+
+typedef EFI_MM_SX_DISPATCH_PROTOCOL EFI_SMM_SX_DISPATCH2_PROTOCOL;
+
+typedef EFI_MM_SX_REGISTER EFI_SMM_SX_REGISTER2;
+
+typedef EFI_MM_SX_UNREGISTER EFI_SMM_SX_UNREGISTER2;
+
+extern EFI_GUID gEfiSmmSxDispatch2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmUsbDispatch2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmUsbDispatch2.h
new file mode 100644
index 0000000000..e3690f4d79
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SmmUsbDispatch2.h
@@ -0,0 +1,47 @@
+/** @file
+ SMM USB Dispatch2 Protocol as defined in PI 1.1 Specification
+ Volume 4 System Management Mode Core Interface.
+
+ Provides the parent dispatch service for the USB SMI source generator.
+
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.1.
+
+**/
+
+#ifndef _SMM_USB_DISPATCH2_H_
+#define _SMM_USB_DISPATCH2_H_
+
+#include <Protocol/MmUsbDispatch.h>
+
+#define EFI_SMM_USB_DISPATCH2_PROTOCOL_GUID EFI_MM_USB_DISPATCH_PROTOCOL_GUID
+
+///
+/// USB SMI event types
+///
+typedef EFI_USB_MMI_TYPE EFI_USB_SMI_TYPE;
+
+///
+/// The dispatch function's context.
+///
+typedef EFI_MM_USB_REGISTER_CONTEXT EFI_SMM_USB_REGISTER_CONTEXT;
+
+typedef EFI_MM_USB_DISPATCH_PROTOCOL EFI_SMM_USB_DISPATCH2_PROTOCOL;
+
+typedef EFI_MM_USB_REGISTER EFI_SMM_USB_REGISTER2;
+
+typedef EFI_MM_USB_UNREGISTER EFI_SMM_USB_UNREGISTER2;
+
+extern EFI_GUID gEfiSmmUsbDispatch2ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiConfiguration.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiConfiguration.h
new file mode 100644
index 0000000000..4c5c8a16d8
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiConfiguration.h
@@ -0,0 +1,293 @@
+/** @file
+ This file defines the SPI Configuration Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD
+ License which accompanies this distribution. The full text of the license may
+ be found at http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI PI Specification 1.6.
+
+**/
+
+#ifndef __SPI_CONFIGURATION_PROTOCOL_H__
+#define __SPI_CONFIGURATION_PROTOCOL_H__
+
+///
+/// Global ID for the SPI Configuration Protocol
+///
+#define EFI_SPI_CONFIGURATION_GUID \
+ { 0x85a6d3e6, 0xb65b, 0x4afc, \
+ { 0xb3, 0x8f, 0xc6, 0xd5, 0x4a, 0xf6, 0xdd, 0xc8 }}
+
+///
+/// Macros to easily specify frequencies in hertz, kilohertz and megahertz.
+///
+#define Hz(Frequency) (Frequency)
+#define KHz(Frequency) (1000 * Hz (Frequency))
+#define MHz(Frequency) (1000 * KHz (Frequency))
+
+typedef struct _EFI_SPI_PERIPHERAL EFI_SPI_PERIPHERAL;
+
+/**
+ Manipulate the chip select for a SPI device.
+
+ This routine must be called at or below TPL_NOTIFY.
+ Update the value of the chip select line for a SPI peripheral.
+ The SPI bus layer calls this routine either in the board layer or in the SPI
+ controller to manipulate the chip select pin at the start and end of a SPI
+ transaction.
+
+ @param[in] SpiPeripheral The address of an EFI_SPI_PERIPHERAL data structure
+ describing the SPI peripheral whose chip select pin
+ is to be manipulated. The routine may access the
+ ChipSelectParameter field to gain sufficient
+ context to complete the operation.
+ @param[in] PinValue The value to be applied to the chip select line of
+ the SPI peripheral.
+
+ @retval EFI_SUCCESS The chip select was set successfully
+ @retval EFI_NOT_READY Support for the chip select is not properly
+ initialized
+ @retval EFI_INVALID_PARAMETER The SpiPeripheral->ChipSelectParameter value
+ is invalid
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SPI_CHIP_SELECT) (
+ IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral,
+ IN BOOLEAN PinValue
+ );
+
+/**
+ Set up the clock generator to produce the correct clock frequency, phase and
+ polarity for a SPI chip.
+
+ This routine must be called at or below TPL_NOTIFY.
+ This routine updates the clock generator to generate the correct frequency
+ and polarity for the SPI clock.
+
+ @param[in] SpiPeripheral Pointer to a EFI_SPI_PERIPHERAL data structure from
+ which the routine can access the ClockParameter,
+ ClockPhase and ClockPolarity fields. The routine
+ also has access to the names for the SPI bus and
+ chip which can be used during debugging.
+ @param[in] ClockHz Pointer to the requested clock frequency. The clock
+ generator will choose a supported clock frequency
+ which is less then or equal to this value.
+ Specify zero to turn the clock generator off.
+ The actual clock frequency supported by the clock
+ generator will be returned.
+
+ @retval EFI_SUCCESS The clock was set up successfully
+ @retval EFI_UNSUPPORTED The SPI controller was not able to support the
+ frequency requested by CLockHz
+
+**/
+typedef EFI_STATUS
+(EFIAPI *EFI_SPI_CLOCK) (
+ IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral,
+ IN UINT32 *ClockHz
+ );
+
+///
+/// The EFI_SPI_PART data structure provides a description of a SPI part which
+/// is independent of the use on the board. This data is available directly
+/// from the part's datasheet and may be provided by the vendor.
+///
+typedef struct _EFI_SPI_PART {
+ ///
+ /// A Unicode string specifying the SPI chip vendor.
+ ///
+ CONST CHAR16 *Vendor;
+
+ ///
+ /// A Unicode string specifying the SPI chip part number.
+ ///
+ CONST CHAR16 *PartNumber;
+
+ ///
+ /// The minimum SPI bus clock frequency used to access this chip. This value
+ /// may be specified in the chip's datasheet. If not, use the value of zero.
+ ///
+ UINT32 MinClockHz;
+
+ ///
+ /// The maximum SPI bus clock frequency used to access this chip. This value
+ /// is found in the chip's datasheet.
+ ///
+ UINT32 MaxClockHz;
+
+ ///
+ /// Specify the polarity of the chip select pin. This value can be found in
+ /// the SPI chip's datasheet. Specify TRUE when a one asserts the chip select
+ ///and FALSE when a zero asserts the chip select.
+ ///
+ BOOLEAN ChipSelectPolarity;
+} EFI_SPI_PART;
+
+///
+/// The EFI_SPI_BUS data structure provides the connection details between the
+/// physical SPI bus and the EFI_SPI_HC_PROTOCOL instance which controls that
+/// SPI bus. This data structure also describes the details of how the clock is
+/// generated for that SPI bus. Finally this data structure provides the list
+/// of physical SPI devices which are attached to the SPI bus.
+///
+typedef struct _EFI_SPI_BUS {
+ ///
+ /// A Unicode string describing the SPI bus
+ ///
+ CONST CHAR16 *FriendlyName;
+
+ ///
+ /// Address of the first EFI_SPI_PERIPHERAL data structure connected to this
+ /// bus. Specify NULL if there are no SPI peripherals connected to this bus.
+ ///
+ CONST EFI_SPI_PERIPHERAL *Peripherallist;
+
+ ///
+ /// Address of an EFI_DEVICE_PATH_PROTOCOL data structure which uniquely
+ /// describes the SPI controller.
+ ///
+ CONST EFI_DEVICE_PATH_PROTOCOL *ControllerPath;
+
+ ///
+ /// Address of the routine which controls the clock used by the SPI bus for
+ /// this SPI peripheral. The SPI host co ntroller's clock routine is called
+ /// when this value is set to NULL.
+ ///
+ EFI_SPI_CLOCK Clock;
+
+ ///
+ /// Address of a data structure containing the additional values which
+ /// describe the necessary control for the clock. When Clock is NULL,
+ /// the declaration for this data structure is provided by the vendor of the
+ /// host's SPI controller driver. When Clock is not NULL, the declaration for
+ /// this data structure is provided by the board layer.
+ ///
+ VOID *ClockParameter;
+} EFI_SPI_BUS;
+
+///
+/// The EFI_SPI_PERIPHERAL data structure describes how a specific block of
+/// logic which is connected to the SPI bus. This data structure also selects
+/// which upper level driver is used to manipulate this SPI device.
+/// The SpiPeripheraLDriverGuid is available from the vendor of the SPI
+/// peripheral driver.
+///
+struct _EFI_SPI_PERIPHERAL {
+ ///
+ /// Address of the next EFI_SPI_PERIPHERAL data structure. Specify NULL if
+ /// the current data structure is the last one on the SPI bus.
+ ///
+ CONST EFI_SPI_PERIPHERAL *NextSpiPeripheral;
+
+ ///
+ /// A unicode string describing the function of the SPI part.
+ ///
+ CONST CHAR16 *FriendlyName;
+
+ ///
+ /// Address of a GUID provided by the vendor of the SPI peripheral driver.
+ /// Instead of using a " EFI_SPI_IO_PROTOCOL" GUID, the SPI bus driver uses
+ /// this GUID to identify an EFI_SPI_IO_PROTOCOL data structure and to
+ /// provide the connection points for the SPI peripheral drivers.
+ /// This reduces the comparison logic in the SPI peripheral driver's
+ /// Supported routine.
+ ///
+ CONST GUID *SpiPeripheralDriverGuid;
+
+ ///
+ /// The address of an EFI_SPI_PART data structure which describes this chip.
+ ///
+ CONST EFI_SPI_PART *SpiPart;
+
+ ///
+ /// The maximum clock frequency is specified in the EFI_SPI_P ART. When this
+ /// this value is non-zero and less than the value in the EFI_SPI_PART then
+ /// this value is used for the maximum clock frequency for the SPI part.
+ ///
+ UINT32 MaxClockHz;
+
+ ///
+ /// Specify the idle value of the clock as found in the datasheet.
+ /// Use zero (0) if the clock'S idle value is low or one (1) if the the
+ /// clock's idle value is high.
+ ///
+ BOOLEAN ClockPolarity;
+
+ ///
+ /// Specify the clock delay after chip select. Specify zero (0) to delay an
+ /// entire clock cycle or one (1) to delay only half a clock cycle.
+ ///
+ BOOLEAN ClockPhase;
+
+ ///
+ /// SPI peripheral attributes, select zero or more of:
+ /// * SPI_PART_SUPPORTS_2_B1T_DATA_BUS_W1DTH - The SPI peripheral is wired to
+ /// support a 2-bit data bus
+ /// * SPI_PART_SUPPORTS_4_B1T_DATA_BUS_W1DTH - The SPI peripheral is wired to
+ /// support a 4-bit data bus
+ ///
+ UINT32 Attributes;
+
+ ///
+ /// Address of a vendor specific data structure containing additional board
+ /// configuration details related to the SPI chip. The SPI peripheral layer
+ /// uses this data structure when configuring the chip.
+ ///
+ CONST VOID *ConfigurationData;
+
+ ///
+ /// The address of an EFI_SPI_BUS data structure which describes the SPI bus
+ /// to which this chip is connected.
+ ///
+ CONST EFI_SPI_BUS *SpiBus;
+
+ ///
+ /// Address of the routine which controls the chip select pin for this SPI
+ /// peripheral. Call the SPI host controller's chip select routine when this
+ /// value is set to NULL.
+ ///
+ EFI_SPI_CHIP_SELECT ChipSelect;
+
+ ///
+ /// Address of a data structure containing the additional values which
+ /// describe the necessary control for the chip select. When ChipSelect is
+ /// NULL, the declaration for this data structure is provided by the vendor
+ /// of the host's SPI controller driver. The vendor's documentation specifies
+ /// the necessary values to use for the chip select pin selection and
+ /// control. When Chipselect is not NULL, the declaration for this data
+ /// structure is provided by the board layer.
+ ///
+ VOID *ChipSelectParameter;
+};
+
+///
+/// Describe the details of the board's SPI busses to the SPI driver stack.
+/// The board layer uses the EFI_SPI_CONFIGURATION_PROTOCOL to expose the data
+/// tables which describe the board's SPI busses, The SPI bus layer uses these
+/// tables to configure the clock, chip select and manage the SPI transactions
+/// on the SPI controllers.
+///
+typedef struct _EFI_SPI_CONFIGURATION_PROTOCOL {
+ ///
+ /// The number of SPI busses on the board.
+ ///
+ UINT32 BusCount;
+
+ ///
+ /// The address of an array of EFI_SPI_BUS data structure addresses.
+ ///
+ CONST EFI_SPI_BUS *CONST *CONST Buslist;
+} EFI_SPI_CONFIGURATION_PROTOCOL;
+
+extern EFI_GUID gEfiSpiConfigurationProtocolGuid;
+
+#endif // __SPI_CONFIGURATION_PROTOCOL_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiHc.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiHc.h
new file mode 100644
index 0000000000..13ad5f4522
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiHc.h
@@ -0,0 +1,194 @@
+/** @file
+ This file defines the SPI Host Controller Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD
+ License which accompanies this distribution. The full text of the license may
+ be found at http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI PI Specification 1.6.
+
+**/
+
+#ifndef __SPI_HC_PROTOCOL_H__
+#define __SPI_HC_PROTOCOL_H__
+
+#include <Protocol/SpiConfiguration.h>
+#include <Protocol/SpiIo.h>
+
+///
+/// Global ID for the SPI Host Controller Protocol
+///
+#define EFI_SPI_HOST_GUID \
+ { 0xc74e5db2, 0xfa96, 0x4ae2, \
+ { 0xb3, 0x99, 0x15, 0x97, 0x7f, 0xe3, 0x0, 0x2d }}
+
+///
+/// EDK2-style name
+///
+#define EFI_SPI_HC_PROTOCOL_GUID EFI_SPI_HOST_GUID
+
+typedef struct _EFI_SPI_HC_PROTOCOL EFI_SPI_HC_PROTOCOL;
+
+/**
+ Assert or deassert the SPI chip select.
+
+ This routine is called at TPL_NOTIFY.
+ Update the value of the chip select line for a SPI peripheral. The SPI bus
+ layer calls this routine either in the board layer or in the SPI controller
+ to manipulate the chip select pin at the start and end of a SPI transaction.
+
+ @param[in] This Pointer to an EFI_SPI_HC_PROTOCOL structure.
+ @param[in] SpiPeripheral The address of an EFI_SPI_PERIPHERAL data structure
+ describing the SPI peripheral whose chip select pin
+ is to be manipulated. The routine may access the
+ ChipSelectParameter field to gain sufficient
+ context to complete the operati on.
+ @param[in] PinValue The value to be applied to the chip select line of
+ the SPI peripheral.
+
+ @retval EFI_SUCCESS The chip select was set as requested
+ @retval EFI_NOT_READY Support for the chip select is not properly
+ initialized
+ @retval EFI_INVALID_PARAMETER The ChipSeLect value or its contents are
+ invalid
+
+**/
+typedef EFI_STATUS
+(EFIAPI *EFI_SPI_HC_PROTOCOL_CHIP_SELECT) (
+ IN CONST EFI_SPI_HC_PROTOCOL *This,
+ IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral,
+ IN BOOLEAN PinValue
+ );
+
+/**
+ Set up the clock generator to produce the correct clock frequency, phase and
+ polarity for a SPI chip.
+
+ This routine is called at TPL_NOTIFY.
+ This routine updates the clock generator to generate the correct frequency
+ and polarity for the SPI clock.
+
+ @param[in] This Pointer to an EFI_SPI_HC_PROTOCOL structure.
+ @param[in] SpiPeripheral Pointer to a EFI_SPI_PERIPHERAL data structure from
+ which the routine can access the ClockParameter,
+ ClockPhase and ClockPolarity fields. The routine
+ also has access to the names for the SPI bus and
+ chip which can be used during debugging.
+ @param[in] ClockHz Pointer to the requested clock frequency. The SPI
+ host controller will choose a supported clock
+ frequency which is less then or equal to this
+ value. Specify zero to turn the clock generator
+ off. The actual clock frequency supported by the
+ SPI host controller will be returned.
+
+ @retval EFI_SUCCESS The clock was set up successfully
+ @retval EFI_UNSUPPORTED The SPI controller was not able to support the
+ frequency requested by ClockHz
+
+**/
+typedef EFI_STATUS
+(EFIAPI *EFI_SPI_HC_PROTOCOL_CLOCK) (
+ IN CONST EFI_SPI_HC_PROTOCOL *This,
+ IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral,
+ IN UINT32 *ClockHz
+ );
+
+/**
+ Perform the SPI transaction on the SPI peripheral using the SPI host
+ controller.
+
+ This routine is called at TPL_NOTIFY.
+ This routine synchronously returns EFI_SUCCESS indicating that the
+ asynchronous SPI transaction was started. The routine then waits for
+ completion of the SPI transaction prior to returning the final transaction
+ status.
+
+ @param[in] This Pointer to an EFI_SPI_HC_PROTOCOL structure.
+ @param[in] BusTransaction Pointer to a EFI_SPI_BUS_ TRANSACTION containing
+ the description of the SPI transaction to perform.
+
+ @retval EFI_SUCCESS The transaction completed successfully
+ @retval EFI_BAD_BUFFER_SIZE The BusTransaction->WriteBytes value is invalid,
+ or the BusTransaction->ReadinBytes value is
+ invalid
+ @retval EFI_UNSUPPORTED The BusTransaction-> Transaction Type is
+ unsupported
+
+**/
+typedef EFI_STATUS
+(EFIAPI *EFI_SPI_HC_PROTOCOL_TRANSACTION) (
+ IN CONST EFI_SPI_HC_PROTOCOL *This,
+ IN EFI_SPI_BUS_TRANSACTION *BusTransaction
+ );
+
+///
+/// Support a SPI data transaction between the SPI controller and a SPI chip.
+///
+struct _EFI_SPI_HC_PROTOCOL {
+ ///
+ /// Host control attributes, may have zero or more of the following set:
+ /// * HC_SUPPORTS_WRITE_ONLY_OPERATIONS
+ /// * HC_SUPPORTS_READ_ONLY_OPERATIONS
+ /// * HC_SUPPORTS_WRITE_THEN_READ_OPERATIONS
+ /// * HC_TX_FRAME_IN_MOST_SIGNIFICANT_BITS
+ /// - The SPI host controller requires the transmit frame to be in most
+ /// significant bits instead of least significant bits.The host driver
+ /// will adjust the frames if necessary.
+ /// * HC_RX_FRAME_IN_MOST_SIGNIFICANT_BITS
+ /// - The SPI host controller places the receive frame to be in most
+ /// significant bits instead of least significant bits.The host driver
+ /// will adjust the frames to be in the least significant bits if
+ /// necessary.
+ /// * HC_SUPPORTS_2_BIT_DATA_BUS_W1DTH
+ /// - The SPI controller supports a 2 - bit data bus
+ /// * HC_SUPPORTS_4_B1T_DATA_BUS_WIDTH
+ /// - The SPI controller supports a 4 - bit data bus
+ /// * HC_TRANSFER_SIZE_INCLUDES_OPCODE
+ /// - Transfer size includes the opcode byte
+ /// * HC_TRANSFER_SIZE_INCLUDES_ADDRESS
+ /// - Transfer size includes the 3 address bytes
+ /// The SPI host controller must support full - duplex (receive while
+ /// sending) operation.The SPI host controller must support a 1 - bit bus
+ /// width.
+ ///
+ UINT32 Attributes;
+
+ ///
+ /// Mask of frame sizes which the SPI host controller supports. Frame size of
+ /// N-bits is supported when bit N-1 is set. The host controller must support
+ /// a frame size of 8-bits.
+ ///
+ UINT32 FrameSizeSupportMask;
+
+ ///
+ /// Maximum transfer size in bytes: 1 - Oxffffffff
+ ///
+ UINT32 MaximumTransferBytes;
+
+ ///
+ /// Assert or deassert the SPI chip select.
+ ///
+ EFI_SPI_HC_PROTOCOL_CHIP_SELECT ChipSelect;
+
+ ///
+ /// Set up the clock generator to produce the correct clock frequency, phase
+ /// and polarity for a SPI chip.
+ ///
+ EFI_SPI_HC_PROTOCOL_CLOCK Clock;
+
+ ///
+ /// Perform the SPI transaction on the SPI peripheral using the SPI host
+ /// controller.
+ ///
+ EFI_SPI_HC_PROTOCOL_TRANSACTION Transaction;
+};
+
+extern EFI_GUID gEfiSpiHcProtocolGuid;
+
+#endif // __SPI_HC_PROTOCOL_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiIo.h
new file mode 100644
index 0000000000..0d21b5253d
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiIo.h
@@ -0,0 +1,292 @@
+/** @file
+ This file defines the SPI I/O Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD
+ License which accompanies this distribution. The full text of the license may
+ be found at http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI PI Specification 1.6.
+
+**/
+
+#ifndef __SPI_IO_PROTOCOL_H__
+#define __SPI_IO_PROTOCOL_H__
+
+#include <Protocol/LegacySpiController.h>
+#include <Protocol/SpiConfiguration.h>
+
+typedef struct _EFI_SPI_IO_PROTOCOL EFI_SPI_IO_PROTOCOL;
+
+///
+/// Note: The UEFI PI 1.6 specification does not specify values for the
+/// members below. The order matches the specification.
+///
+typedef enum {
+ ///
+ /// Data flowing in both direction between the host and
+ /// SPI peripheral.ReadBytes must equal WriteBytes and both ReadBuffer and
+ /// WriteBuffer must be provided.
+ ///
+ SPI_TRANSACTION_FULL_DUPLEX,
+
+ ///
+ /// Data flowing from the host to the SPI peripheral.ReadBytes must be
+ /// zero.WriteBytes must be non - zero and WriteBuffer must be provided.
+ ///
+ SPI_TRANSACTION_WRITE_ONLY,
+
+ ///
+ /// Data flowing from the SPI peripheral to the host.WriteBytes must be
+ /// zero.ReadBytes must be non - zero and ReadBuffer must be provided.
+ ///
+ SPI_TRANSACTION_READ_ONLY,
+
+ ///
+ /// Data first flowing from the host to the SPI peripheral and then data
+ /// flows from the SPI peripheral to the host.These types of operations get
+ /// used for SPI flash devices when control data (opcode, address) must be
+ /// passed to the SPI peripheral to specify the data to be read.
+ ///
+ SPI_TRANSACTION_WRITE_THEN_READ
+} EFI_SPI_TRANSACTION_TYPE;
+
+/**
+ Initiate a SPI transaction between the host and a SPI peripheral.
+
+ This routine must be called at or below TPL_NOTIFY.
+ This routine works with the SPI bus layer to pass the SPI transaction to the
+ SPI controller for execution on the SPI bus. There are four types of
+ supported transactions supported by this routine:
+ * Full Duplex: WriteBuffer and ReadBuffer are the same size.
+ * Write Only: WriteBuffer contains data for SPI peripheral, ReadBytes = 0
+ * Read Only: ReadBuffer to receive data from SPI peripheral, WriteBytes = 0
+ * Write Then Read: WriteBuffer contains control data to write to SPI
+ peripheral before data is placed into the ReadBuffer.
+ Both WriteBytes and ReadBytes must be non-zero.
+
+ @param[in] This Pointer to an EFI_SPI_IO_PROTOCOL structure.
+ @param[in] TransactionType Type of SPI transaction.
+ @param[in] DebugTransaction Set TRUE only when debugging is desired.
+ Debugging may be turned on for a single SPI
+ transaction. Only this transaction will display
+ debugging messages. All other transactions with
+ this value set to FALSE will not display any
+ debugging messages.
+ @param[in] ClockHz Specify the ClockHz value as zero (0) to use
+ the maximum clock frequency supported by the
+ SPI controller and part. Specify a non-zero
+ value only when a specific SPI transaction
+ requires a reduced clock rate.
+ @param[in] BusWidth Width of the SPI bus in bits: 1, 2, 4
+ @param[in] FrameSize Frame size in bits, range: 1 - 32
+ @param[in] WriteBytes The length of the WriteBuffer in bytes.
+ Specify zero for read-only operations.
+ @param[in] WriteBuffer The buffer containing data to be sent from the
+ host to the SPI chip. Specify NULL for read
+ only operations.
+ * Frame sizes 1-8 bits: UINT8 (one byte) per
+ frame
+ * Frame sizes 7-16 bits: UINT16 (two bytes) per
+ frame
+ * Frame sizes 17-32 bits: UINT32 (four bytes)
+ per frame The transmit frame is in the least
+ significant N bits.
+ @param[in] ReadBytes The length of the ReadBuffer in bytes.
+ Specify zero for write-only operations.
+ @param[out] ReadBuffer The buffer to receeive data from the SPI chip
+ during the transaction. Specify NULL for write
+ only operations.
+ * Frame sizes 1-8 bits: UINT8 (one byte) per
+ frame
+ * Frame sizes 7-16 bits: UINT16 (two bytes) per
+ frame
+ * Frame sizes 17-32 bits: UINT32 (four bytes)
+ per frame The received frame is in the least
+ significant N bits.
+
+ @retval EFI_SUCCESS The SPI transaction completed successfully
+ @retval EFI_BAD_BUFFER_SIZE The writeBytes value was invalid
+ @retval EFI_BAD_BUFFER_SIZE The ReadBytes value was invalid
+ @retval EFI_INVALID_PARAMETER TransactionType is not valid,
+ or BusWidth not supported by SPI peripheral or
+ SPI host controller,
+ or WriteBytes non-zero and WriteBuffer is
+ NULL,
+ or ReadBytes non-zero and ReadBuffer is NULL,
+ or ReadBuffer != WriteBuffer for full-duplex
+ type,
+ or WriteBuffer was NULL,
+ or TPL is too high
+ @retval EFI_OUT_OF_RESOURCES Insufficient memory for SPI transaction
+ @retval EFI_UNSUPPORTED The FrameSize is not supported by the SPI bus
+ layer or the SPI host controller
+ @retval EFI_UNSUPPORTED The SPI controller was not able to support
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SPI_IO_PROTOCOL_TRANSACTION) (
+ IN CONST EFI_SPI_IO_PROTOCOL *This,
+ IN EFI_SPI_TRANSACTION_TYPE TransactionType,
+ IN BOOLEAN DebugTransaction,
+ IN UINT32 ClockHz OPTIONAL,
+ IN UINT32 BusWidth,
+ IN UINT32 FrameSize,
+ IN UINT32 WriteBytes,
+ IN UINT8 *WriteBuffer,
+ IN UINT32 ReadBytes,
+ OUT UINT8 *ReadBuffer
+ );
+
+/**
+ Update the SPI peripheral associated with this SPI 10 instance.
+
+ Support socketed SPI parts by allowing the SPI peripheral driver to replace
+ the SPI peripheral after the connection is made. An example use is socketed
+ SPI NOR flash parts, where the size and parameters change depending upon
+ device is in the socket.
+
+ @param[in] This Pointer to an EFI_SPI_IO_PROTOCOL structure.
+ @param[in] SpiPeripheral Pointer to an EFI_SPI_PERIPHERAL structure.
+
+ @retval EFI_SUCCESS The SPI peripheral was updated successfully
+ @retval EFI_INVALID_PARAMETER The SpiPeripheral value is NULL,
+ or the SpiPeripheral->SpiBus is NULL,
+ or the SpiP eripheral - >SpiBus pointing at
+ wrong bus,
+ or the SpiP eripheral - >SpiPart is NULL
+
+**/
+typedef EFI_STATUS
+(EFIAPI *EFI_SPI_IO_PROTOCOL_UPDATE_SPI_PERIPHERAL) (
+ IN CONST EFI_SPI_IO_PROTOCOL *This,
+ IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral
+ );
+
+///
+/// The EFI_SPI_BUS_ TRANSACTION data structure contains the description of the
+/// SPI transaction to perform on the host controller.
+///
+typedef struct _EFI_SPI_BUS_TRANSACTION {
+ ///
+ /// Pointer to the SPI peripheral being manipulated.
+ ///
+ CONST EFI_SPI_PERIPHERAL *SpiPeripheral;
+
+ ///
+ /// Type of transaction specified by one of the EFI_SPI_TRANSACTION_TYPE
+ /// values.
+ ///
+ EFI_SPI_TRANSACTION_TYPE TransactionType;
+
+ ///
+ /// TRUE if the transaction is being debugged. Debugging may be turned on for
+ /// a single SPI transaction. Only this transaction will display debugging
+ /// messages. All other transactions with this value set to FALSE will not
+ /// display any debugging messages.
+ ///
+ BOOLEAN DebugTransaction;
+
+ ///
+ /// SPI bus width in bits: 1, 2, 4
+ ///
+ UINT32 BusWidth;
+
+ ///
+ /// Frame size in bits, range: 1 - 32
+ ///
+ UINT32 FrameSize;
+
+ ///
+ /// Length of the write buffer in bytes
+ ///
+ UINT32 WriteBytes;
+
+ ///
+ /// Buffer containing data to send to the SPI peripheral
+ /// Frame sizes 1 - 8 bits: UINT8 (one byte) per frame
+ /// Frame sizes 7 - 16 bits : UINT16 (two bytes) per frame
+ ///
+ UINT8 *WriteBuffer;
+
+ ///
+ /// Length of the read buffer in bytes
+ ///
+ UINT32 ReadBytes;
+
+ ///
+ /// Buffer to receive the data from the SPI peripheral
+ /// * Frame sizes 1 - 8 bits: UINT8 (one byte) per frame
+ /// * Frame sizes 7 - 16 bits : UINT16 (two bytes) per frame
+ /// * Frame sizes 17 - 32 bits : UINT32 (four bytes) per frame
+ ///
+ UINT8 *ReadBuffer;
+} EFI_SPI_BUS_TRANSACTION;
+
+///
+/// Support managed SPI data transactions between the SPI controller and a SPI
+/// chip.
+///
+struct _EFI_SPI_IO_PROTOCOL {
+ ///
+ /// Address of an EFI_SPI_PERIPHERAL data structure associated with this
+ /// protocol instance.
+ ///
+ CONST EFI_SPI_PERIPHERAL *SpiPeripheral;
+
+ ///
+ /// Address of the original EFI_SPI_PERIPHERAL data structure associated with
+ /// this protocol instance.
+ ///
+ CONST EFI_SPI_PERIPHERAL *OriginalSpiPeripheral;
+
+ ///
+ /// Mask of frame sizes which the SPI 10 layer supports. Frame size of N-bits
+ /// is supported when bit N-1 is set. The host controller must support a
+ /// frame size of 8-bits. Frame sizes of 16, 24 and 32-bits are converted to
+ /// 8-bit frame sizes by the SPI bus layer if the frame size is not supported
+ /// by the SPI host controller.
+ ///
+ UINT32 FrameSizeSupportMask;
+
+ ///
+ /// Maximum transfer size in bytes: 1 - Oxffffffff
+ ///
+ UINT32 MaximumTransferBytes;
+
+ ///
+ /// Transaction attributes: One or more from:
+ /// * SPI_10_SUPPORTS_2_B1T_DATA_BUS_W1DTH
+ /// - The SPI host and peripheral supports a 2-bit data bus
+ /// * SPI_IO_SUPPORTS_4_BIT_DATA_BUS_W1DTH
+ /// - The SPI host and peripheral supports a 4-bit data bus
+ /// * SPI_IO_TRANSFER_SIZE_INCLUDES_OPCODE
+ /// - Transfer size includes the opcode byte
+ /// * SPI_IO_TRANSFER_SIZE_INCLUDES_ADDRESS
+ /// - Transfer size includes the 3 address bytes
+ ///
+ UINT32 Attributes;
+
+ ///
+ /// Pointer to legacy SPI controller protocol
+ ///
+ CONST EFI_LEGACY_SPI_CONTROLLER_PROTOCOL *LegacySpiProtocol;
+
+ ///
+ /// Initiate a SPI transaction between the host and a SPI peripheral.
+ ///
+ EFI_SPI_IO_PROTOCOL_TRANSACTION Transaction;
+
+ ///
+ /// Update the SPI peripheral associated with this SPI 10 instance.
+ ///
+ EFI_SPI_IO_PROTOCOL_UPDATE_SPI_PERIPHERAL UpdateSpiPeripheral;
+};
+
+#endif // __SPI_IO_PROTOCOL_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiNorFlash.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiNorFlash.h
new file mode 100644
index 0000000000..133701f59e
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiNorFlash.h
@@ -0,0 +1,262 @@
+/** @file
+ This file defines the SPI NOR Flash Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD
+ License which accompanies this distribution. The full text of the license may
+ be found at http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI PI Specification 1.6.
+
+**/
+
+#ifndef __SPI_NOR_FLASH_PROTOCOL_H__
+#define __SPI_NOR_FLASH_PROTOCOL_H__
+
+#include <Protocol/SpiConfiguration.h>
+
+///
+/// Global ID for the SPI NOR Flash Protocol
+///
+#define EFI_SPI_NOR_FLASH_PROTOCOL_GUID \
+ { 0xb57ec3fe, 0xf833, 0x4ba6, \
+ { 0x85, 0x78, 0x2a, 0x7d, 0x6a, 0x87, 0x44, 0x4b }}
+
+typedef struct _EFI_SPI_NOR_FLASH_PROTOCOL EFI_SPI_NOR_FLASH_PROTOCOL;
+
+/**
+ Read the 3 byte manufacture and device ID from the SPI flash.
+
+ This routine must be called at or below TPL_NOTIFY.
+ This routine reads the 3 byte manufacture and device ID from the flash part
+ filling the buffer provided.
+
+ @param[in] This Pointer to an EFI_SPI_NOR_FLASH_PROTOCOL data structure.
+ @param[out] Buffer Pointer to a 3 byte buffer to receive the manufacture and
+ device ID.
+
+
+
+ @retval EFI_SUCCESS The manufacture and device ID was read
+ successfully.
+ @retval EFI_INVALID_PARAMETER Buffer is NULL
+ @retval EFI_DEVICE_ERROR Invalid data received from SPI flash part.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SPI_NOR_FLASH_PROTOCOL_GET_FLASH_ID) (
+ IN CONST EFI_SPI_NOR_FLASH_PROTOCOL *This,
+ OUT UINT8 *Buffer
+ );
+
+/**
+ Read data from the SPI flash.
+
+ This routine must be called at or below TPL_NOTIFY.
+ This routine reads data from the SPI part in the buffer provided.
+
+ @param[in] This Pointer to an EFI_SPI_NOR_FLASH_PROTOCOL data
+ structure.
+ @param[in] FlashAddress Address in the flash to start reading
+ @param[in] LengthInBytes Read length in bytes
+ @param[out] Buffer Address of a buffer to receive the data
+
+ @retval EFI_SUCCESS The data was read successfully.
+ @retval EFI_INVALID_PARAMETER Buffer is NULL, or
+ FlashAddress >= This->FlashSize, or
+ LengthInBytes > This->FlashSize - FlashAddress
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SPI_NOR_FLASH_PROTOCOL_READ_DATA) (
+ IN CONST EFI_SPI_NOR_FLASH_PROTOCOL *This,
+ IN UINT32 FlashAddress,
+ IN UINT32 LengthInBytes,
+ OUT UINT8 *Buffer
+ );
+
+/**
+ Read the flash status register.
+
+ This routine must be called at or below TPL_NOTIFY.
+ This routine reads the flash part status register.
+
+ @param[in] This Pointer to an EFI_SPI_NOR_FLASH_PROTOCOL data
+ structure.
+ @param[in] LengthInBytes Number of status bytes to read.
+ @param[out] FlashStatus Pointer to a buffer to receive the flash status.
+
+ @retval EFI_SUCCESS The status register was read successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SPI_NOR_FLASH_PROTOCOL_READ_STATUS) (
+ IN CONST EFI_SPI_NOR_FLASH_PROTOCOL *This,
+ IN UINT32 LengthInBytes,
+ OUT UINT8 *FlashStatus
+ );
+
+/**
+ Write the flash status register.
+
+ This routine must be called at or below TPL_N OTIFY.
+ This routine writes the flash part status register.
+
+ @param[in] This Pointer to an EFI_SPI_NOR_FLASH_PROTOCOL data
+ structure.
+ @param[in] LengthInBytes Number of status bytes to write.
+ @param[in] FlashStatus Pointer to a buffer containing the new status.
+
+ @retval EFI_SUCCESS The status write was successful.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate the write buffer.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SPI_NOR_FLASH_PROTOCOL_WRITE_STATUS) (
+ IN CONST EFI_SPI_NOR_FLASH_PROTOCOL *This,
+ IN UINT32 LengthInBytes,
+ IN UINT8 *FlashStatus
+ );
+
+/**
+ Write data to the SPI flash.
+
+ This routine must be called at or below TPL_NOTIFY.
+ This routine breaks up the write operation as necessary to write the data to
+ the SPI part.
+
+ @param[in] This Pointer to an EFI_SPI_NOR_FLASH_PROTOCOL data
+ structure.
+ @param[in] FlashAddress Address in the flash to start writing
+ @param[in] LengthInBytes Write length in bytes
+ @param[in] Buffer Address of a buffer containing the data
+
+ @retval EFI_SUCCESS The data was written successfully.
+ @retval EFI_INVALID_PARAMETER Buffer is NULL, or
+ FlashAddress >= This->FlashSize, or
+ LengthInBytes > This->FlashSize - FlashAddress
+ @retval EFI_OUT_OF_RESOURCES Insufficient memory to copy buffer.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SPI_NOR_FLASH_PROTOCOL_WRITE_DATA) (
+ IN CONST EFI_SPI_NOR_FLASH_PROTOCOL *This,
+ IN UINT32 FlashAddress,
+ IN UINT32 LengthInBytes,
+ IN UINT8 *Buffer
+ );
+
+/**
+ Efficiently erases one or more 4KiB regions in the SPI flash.
+
+ This routine must be called at or below TPL_NOTIFY.
+ This routine uses a combination of 4 KiB and larger blocks to erase the
+ specified area.
+
+ @param[in] This Pointer to an EFI_SPI_NOR_FLASH_PROTOCOL data
+ structure.
+ @param[in] FlashAddress Address within a 4 KiB block to start erasing
+ @param[in] BlockCount Number of 4 KiB blocks to erase
+
+ @retval EFI_SUCCESS The erase was completed successfully.
+ @retval EFI_INVALID_PARAMETER FlashAddress >= This->FlashSize, or
+ BlockCount * 4 KiB
+ > This->FlashSize - FlashAddress
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SPI_NOR_FLASH_PROTOCOL_ERASE) (
+ IN CONST EFI_SPI_NOR_FLASH_PROTOCOL *This,
+ IN UINT32 FlashAddress,
+ IN UINT32 BlockCount
+ );
+
+///
+/// The EFI_SPI_NOR_FLASH_PROTOCOL exists in the SPI peripheral layer.
+/// This protocol manipulates the SPI NOR flash parts using a common set of
+/// commands. The board layer provides the interconnection and configuration
+/// details for the SPI NOR flash part. The SPI NOR flash driver uses this
+/// configuration data to expose a generic interface which provides the
+/// following APls:
+/// * Read manufacture and device ID
+/// * Read data
+/// * Read data using low frequency
+/// * Read status
+/// * Write data
+/// * Erase 4 KiB blocks
+/// * Erase 32 or 64 KiB blocks
+/// * Write status
+/// The EFI_SPI_NOR_FLASH_PROTOCOL also exposes some APls to set the security
+/// features on the legacy SPI flash controller.
+///
+struct _EFI_SPI_NOR_FLASH_PROTOCOL {
+ ///
+ /// Pointer to an EFI_SPI_PERIPHERAL data structure
+ ///
+ CONST EFI_SPI_PERIPHERAL *SpiPeripheral;
+
+ ///
+ /// Flash size in bytes
+ ///
+ UINT32 FlashSize;
+
+ ///
+ /// Manufacture and Device ID
+ ///
+ UINT8 Deviceid[3];
+
+ ///
+ /// Erase block size in bytes
+ ///
+ UINT32 EraseBlockBytes;
+
+ ///
+ /// Read the 3 byte manufacture and device ID from the SPI flash.
+ ///
+ EFI_SPI_NOR_FLASH_PROTOCOL_GET_FLASH_ID GetFlashid;
+
+ ///
+ /// Read data from the SPI flash.
+ ///
+ EFI_SPI_NOR_FLASH_PROTOCOL_READ_DATA ReadData;
+
+ ///
+ /// Low frequency read data from the SPI flash.
+ ///
+ EFI_SPI_NOR_FLASH_PROTOCOL_READ_DATA LfReadData;
+
+ ///
+ /// Read the flash status register.
+ ///
+ EFI_SPI_NOR_FLASH_PROTOCOL_READ_STATUS ReadStatus;
+
+ ///
+ /// Write the flash status register.
+ ///
+ EFI_SPI_NOR_FLASH_PROTOCOL_WRITE_STATUS WriteStatus;
+
+ ///
+ /// Write data to the SPI flash.
+ ///
+ EFI_SPI_NOR_FLASH_PROTOCOL_WRITE_DATA WriteData;
+
+ ///
+ /// Efficiently erases one or more 4KiB regions in the SPI flash.
+ ///
+ EFI_SPI_NOR_FLASH_PROTOCOL_ERASE Erase;
+};
+
+extern EFI_GUID gEfiSpiNorFlashProtocolGuid;
+
+#endif // __SPI_NOR_FLASH_PROTOCOL_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiSmmConfiguration.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiSmmConfiguration.h
new file mode 100644
index 0000000000..913d4cbb46
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiSmmConfiguration.h
@@ -0,0 +1,36 @@
+/** @file
+ This file defines the SPI SMM Configuration Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD
+ License which accompanies this distribution. The full text of the license may
+ be found at http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI PI Specification 1.6.
+
+**/
+
+#ifndef __SPI_SMM_CONFIGURATION_PROTOCOL_H__
+#define __SPI_SMM_CONFIGURATION_PROTOCOL_H__
+
+#include <Protocol/SpiConfiguration.h>
+
+///
+/// Global ID for the SPI SMM Configuration Protocol
+///
+#define EFI_SPI_SMM_CONFIGURATION_PROTOCOL_GUID \
+ { 0x995c6eca, 0x171b, 0x45fd, \
+ { 0xa3, 0xaa, 0xfd, 0x4c, 0x9c, 0x9d, 0xef, 0x59 }}
+
+typedef
+struct _EFI_SPI_CONFIGURATION_PROTOCOL
+EFI_SPI_SMM_CONFIGURATION_PROTOCOL;
+
+extern EFI_GUID gEfiSpiSmmConfigurationProtocolGuid;
+
+#endif // __SPI_SMM_CONFIGURATION_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiSmmHc.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiSmmHc.h
new file mode 100644
index 0000000000..91d2312b74
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiSmmHc.h
@@ -0,0 +1,36 @@
+/** @file
+ This file defines the SPI SMM Host Controller Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD
+ License which accompanies this distribution. The full text of the license may
+ be found at http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI PI Specification 1.6.
+
+**/
+
+#ifndef __SPI_SMM_HC_H__
+#define __SPI_SMM_HC_H__
+
+#include <Protocol/SpiHc.h>
+
+///
+/// Global ID for the SPI SMM Host Controller Protocol
+///
+#define EFI_SPI_SMM_HC_PROTOCOL_GUID \
+ { 0xe9f02217, 0x2093, 0x4470, \
+ { 0x8a, 0x54, 0x5c, 0x2c, 0xff, 0xe7, 0x3e, 0xcb }}
+
+typedef
+struct _EFI_SPI_HC_PROTOCOL
+EFI_SPI_SMM_HC_PROTOCOL;
+
+extern EFI_GUID gEfiSpiSmmHcProtocolGuid;
+
+#endif // __SPI_SMM_HC_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiSmmNorFlash.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiSmmNorFlash.h
new file mode 100644
index 0000000000..495c70f0da
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SpiSmmNorFlash.h
@@ -0,0 +1,36 @@
+/** @file
+ This file defines the SPI SMM NOR Flash Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD
+ License which accompanies this distribution. The full text of the license may
+ be found at http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol was introduced in UEFI PI Specification 1.6.
+
+**/
+
+#ifndef __SPI_SMM_NOR_FLASH_PROTOCOL_H__
+#define __SPI_SMM_NOR_FLASH_PROTOCOL_H__
+
+#include <Protocol/SpiNorFlash.h>
+
+///
+/// Global ID for the SPI SMM NOR Flash Protocol
+///
+#define EFI_SPI_SMM_NOR_FLASH_PROTOCOL_GUID \
+ { 0xaab18f19, 0xfe14, 0x4666, \
+ { 0x86, 0x04, 0x87, 0xff, 0x6d, 0x66, 0x2c, 0x9a } }
+
+typedef
+struct _EFI_SPI_NOR_FLASH_PROTOCOL
+EFI_SPI_SMM_NOR_FLASH_PROTOCOL;
+
+extern EFI_GUID gEfiSpiSmmNorFlashProtocolGuid;
+
+#endif // __SPI_SMM_NOR_FLASH_PROTOCOL_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/StatusCode.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/StatusCode.h
new file mode 100644
index 0000000000..d5c62260a0
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/StatusCode.h
@@ -0,0 +1,59 @@
+/** @file
+ Status code Runtime Protocol as defined in PI Specification 1.4a VOLUME 2 DXE
+
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __STATUS_CODE_RUNTIME_PROTOCOL_H__
+#define __STATUS_CODE_RUNTIME_PROTOCOL_H__
+
+#define EFI_STATUS_CODE_RUNTIME_PROTOCOL_GUID \
+{ 0xd2b2b828, 0x826, 0x48a7, { 0xb3, 0xdf, 0x98, 0x3c, 0x0, 0x60, 0x24, 0xf0 } }
+
+/**
+ Provides an interface that a software module can call to report a status code.
+
+ @param Type Indicates the type of status code being reported.
+ @param Value Describes the current status of a hardware or software entity.
+ This included information about the class and subclass that is used to
+ classify the entity as well as an operation.
+ @param Instance The enumeration of a hardware or software entity within
+ the system. Valid instance numbers start with 1.
+ @param CallerId This optional parameter may be used to identify the caller.
+ This parameter allows the status code driver to apply different rules to
+ different callers.
+ @param Data This optional parameter may be used to pass additional data.
+
+ @retval EFI_SUCCESS The function completed successfully
+ @retval EFI_DEVICE_ERROR The function should not be completed due to a device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_REPORT_STATUS_CODE)(
+ IN EFI_STATUS_CODE_TYPE Type,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN EFI_GUID *CallerId OPTIONAL,
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL
+ );
+
+///
+/// Provides the service required to report a status code to the platform firmware.
+/// This protocol must be produced by a runtime DXE driver.
+///
+typedef struct _EFI_STATUS_CODE_PROTOCOL {
+ EFI_REPORT_STATUS_CODE ReportStatusCode;
+} EFI_STATUS_CODE_PROTOCOL;
+
+extern EFI_GUID gEfiStatusCodeRuntimeProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/StorageSecurityCommand.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/StorageSecurityCommand.h
new file mode 100644
index 0000000000..3fa6cbcd8e
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/StorageSecurityCommand.h
@@ -0,0 +1,212 @@
+/** @file
+ EFI Storage Security Command Protocol as defined in UEFI 2.3.1 specification.
+ This protocol is used to abstract mass storage devices to allow code running in
+ the EFI boot services environment to send security protocol commands to mass
+ storage devices without specific knowledge of the type of device or controller
+ that manages the device.
+
+ Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __STORAGE_SECURITY_COMMAND_H__
+#define __STORAGE_SECURITY_COMMAND_H__
+
+#define EFI_STORAGE_SECURITY_COMMAND_PROTOCOL_GUID \
+ { \
+ 0xC88B0B6D, 0x0DFC, 0x49A7, {0x9C, 0xB4, 0x49, 0x07, 0x4B, 0x4C, 0x3A, 0x78 } \
+ }
+
+typedef struct _EFI_STORAGE_SECURITY_COMMAND_PROTOCOL EFI_STORAGE_SECURITY_COMMAND_PROTOCOL;
+
+/**
+ Send a security protocol command to a device that receives data and/or the result
+ of one or more commands sent by SendData.
+
+ The ReceiveData function sends a security protocol command to the given MediaId.
+ The security protocol command sent is defined by SecurityProtocolId and contains
+ the security protocol specific data SecurityProtocolSpecificData. The function
+ returns the data from the security protocol command in PayloadBuffer.
+
+ For devices supporting the SCSI command set, the security protocol command is sent
+ using the SECURITY PROTOCOL IN command defined in SPC-4.
+
+ For devices supporting the ATA command set, the security protocol command is sent
+ using one of the TRUSTED RECEIVE commands defined in ATA8-ACS if PayloadBufferSize
+ is non-zero.
+
+ If the PayloadBufferSize is zero, the security protocol command is sent using the
+ Trusted Non-Data command defined in ATA8-ACS.
+
+ If PayloadBufferSize is too small to store the available data from the security
+ protocol command, the function shall copy PayloadBufferSize bytes into the
+ PayloadBuffer and return EFI_WARN_BUFFER_TOO_SMALL.
+
+ If PayloadBuffer or PayloadTransferSize is NULL and PayloadBufferSize is non-zero,
+ the function shall return EFI_INVALID_PARAMETER.
+
+ If the given MediaId does not support security protocol commands, the function shall
+ return EFI_UNSUPPORTED. If there is no media in the device, the function returns
+ EFI_NO_MEDIA. If the MediaId is not the ID for the current media in the device,
+ the function returns EFI_MEDIA_CHANGED.
+
+ If the security protocol fails to complete within the Timeout period, the function
+ shall return EFI_TIMEOUT.
+
+ If the security protocol command completes without an error, the function shall
+ return EFI_SUCCESS. If the security protocol command completes with an error, the
+ function shall return EFI_DEVICE_ERROR.
+
+ @param This Indicates a pointer to the calling context.
+ @param MediaId ID of the medium to receive data from.
+ @param Timeout The timeout, in 100ns units, to use for the execution
+ of the security protocol command. A Timeout value of 0
+ means that this function will wait indefinitely for the
+ security protocol command to execute. If Timeout is greater
+ than zero, then this function will return EFI_TIMEOUT if the
+ time required to execute the receive data command is greater than Timeout.
+ @param SecurityProtocolId The value of the "Security Protocol" parameter of
+ the security protocol command to be sent.
+ @param SecurityProtocolSpecificData The value of the "Security Protocol Specific" parameter
+ of the security protocol command to be sent.
+ @param PayloadBufferSize Size in bytes of the payload data buffer.
+ @param PayloadBuffer A pointer to a destination buffer to store the security
+ protocol command specific payload data for the security
+ protocol command. The caller is responsible for having
+ either implicit or explicit ownership of the buffer.
+ @param PayloadTransferSize A pointer to a buffer to store the size in bytes of the
+ data written to the payload data buffer.
+
+ @retval EFI_SUCCESS The security protocol command completed successfully.
+ @retval EFI_WARN_BUFFER_TOO_SMALL The PayloadBufferSize was too small to store the available
+ data from the device. The PayloadBuffer contains the truncated data.
+ @retval EFI_UNSUPPORTED The given MediaId does not support security protocol commands.
+ @retval EFI_DEVICE_ERROR The security protocol command completed with an error.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
+ @retval EFI_INVALID_PARAMETER The PayloadBuffer or PayloadTransferSize is NULL and
+ PayloadBufferSize is non-zero.
+ @retval EFI_TIMEOUT A timeout occurred while waiting for the security
+ protocol command to execute.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_STORAGE_SECURITY_RECEIVE_DATA)(
+ IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN UINT64 Timeout,
+ IN UINT8 SecurityProtocolId,
+ IN UINT16 SecurityProtocolSpecificData,
+ IN UINTN PayloadBufferSize,
+ OUT VOID *PayloadBuffer,
+ OUT UINTN *PayloadTransferSize
+ );
+
+/**
+ Send a security protocol command to a device.
+
+ The SendData function sends a security protocol command containing the payload
+ PayloadBuffer to the given MediaId. The security protocol command sent is
+ defined by SecurityProtocolId and contains the security protocol specific data
+ SecurityProtocolSpecificData. If the underlying protocol command requires a
+ specific padding for the command payload, the SendData function shall add padding
+ bytes to the command payload to satisfy the padding requirements.
+
+ For devices supporting the SCSI command set, the security protocol command is sent
+ using the SECURITY PROTOCOL OUT command defined in SPC-4.
+
+ For devices supporting the ATA command set, the security protocol command is sent
+ using one of the TRUSTED SEND commands defined in ATA8-ACS if PayloadBufferSize
+ is non-zero. If the PayloadBufferSize is zero, the security protocol command is
+ sent using the Trusted Non-Data command defined in ATA8-ACS.
+
+ If PayloadBuffer is NULL and PayloadBufferSize is non-zero, the function shall
+ return EFI_INVALID_PARAMETER.
+
+ If the given MediaId does not support security protocol commands, the function
+ shall return EFI_UNSUPPORTED. If there is no media in the device, the function
+ returns EFI_NO_MEDIA. If the MediaId is not the ID for the current media in the
+ device, the function returns EFI_MEDIA_CHANGED.
+
+ If the security protocol fails to complete within the Timeout period, the function
+ shall return EFI_TIMEOUT.
+
+ If the security protocol command completes without an error, the function shall return
+ EFI_SUCCESS. If the security protocol command completes with an error, the function
+ shall return EFI_DEVICE_ERROR.
+
+ @param This Indicates a pointer to the calling context.
+ @param MediaId ID of the medium to receive data from.
+ @param Timeout The timeout, in 100ns units, to use for the execution
+ of the security protocol command. A Timeout value of 0
+ means that this function will wait indefinitely for the
+ security protocol command to execute. If Timeout is greater
+ than zero, then this function will return EFI_TIMEOUT if the
+ time required to execute the receive data command is greater than Timeout.
+ @param SecurityProtocolId The value of the "Security Protocol" parameter of
+ the security protocol command to be sent.
+ @param SecurityProtocolSpecificData The value of the "Security Protocol Specific" parameter
+ of the security protocol command to be sent.
+ @param PayloadBufferSize Size in bytes of the payload data buffer.
+ @param PayloadBuffer A pointer to a destination buffer to store the security
+ protocol command specific payload data for the security
+ protocol command.
+
+ @retval EFI_SUCCESS The security protocol command completed successfully.
+ @retval EFI_UNSUPPORTED The given MediaId does not support security protocol commands.
+ @retval EFI_DEVICE_ERROR The security protocol command completed with an error.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
+ @retval EFI_INVALID_PARAMETER The PayloadBuffer is NULL and PayloadBufferSize is non-zero.
+ @retval EFI_TIMEOUT A timeout occurred while waiting for the security
+ protocol command to execute.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_STORAGE_SECURITY_SEND_DATA) (
+ IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN UINT64 Timeout,
+ IN UINT8 SecurityProtocolId,
+ IN UINT16 SecurityProtocolSpecificData,
+ IN UINTN PayloadBufferSize,
+ IN VOID *PayloadBuffer
+);
+
+///
+/// The EFI_STORAGE_SECURITY_COMMAND_PROTOCOL is used to send security protocol
+/// commands to a mass storage device. Two types of security protocol commands
+/// are supported. SendData sends a command with data to a device. ReceiveData
+/// sends a command that receives data and/or the result of one or more commands
+/// sent by SendData.
+///
+/// The security protocol command formats supported shall be based on the definition
+/// of the SECURITY PROTOCOL IN and SECURITY PROTOCOL OUT commands defined in SPC-4.
+/// If the device uses the SCSI command set, no translation is needed in the firmware
+/// and the firmware can package the parameters into a SECURITY PROTOCOL IN or SECURITY
+/// PROTOCOL OUT command and send the command to the device. If the device uses a
+/// non-SCSI command set, the firmware shall map the command and data payload to the
+/// corresponding command and payload format defined in the non-SCSI command set
+/// (for example, TRUSTED RECEIVE and TRUSTED SEND in ATA8-ACS).
+///
+/// The firmware shall automatically add an EFI_STORAGE_SECURITY_COMMAND_PROTOCOL
+/// for any storage devices detected during system boot that support SPC-4, ATA8-ACS
+/// or their successors.
+///
+struct _EFI_STORAGE_SECURITY_COMMAND_PROTOCOL {
+ EFI_STORAGE_SECURITY_RECEIVE_DATA ReceiveData;
+ EFI_STORAGE_SECURITY_SEND_DATA SendData;
+};
+
+extern EFI_GUID gEfiStorageSecurityCommandProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SuperIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SuperIo.h
new file mode 100644
index 0000000000..f9714e2d1f
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SuperIo.h
@@ -0,0 +1,175 @@
+/** @file
+ The Super I/O Protocol is installed by the Super I/O driver. The Super I/O driver is a UEFI driver
+ model compliant driver. In the Start() routine of the Super I/O driver, a handle with an instance
+ of EFI_SIO_PROTOCOL is created for each device within the Super I/O. The device within the
+ Super I/O is powered up, enabled, and assigned with the default set of resources. In the Stop()
+ routine of the Super I/O driver, the device is disabled and Super I/O protocol is uninstalled.
+
+ Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_SUPER_IO_PROTOCOL_H__
+#define __EFI_SUPER_IO_PROTOCOL_H__
+#include <IndustryStandard/Acpi.h>
+
+#define EFI_SIO_PROTOCOL_GUID \
+ { 0x215fdd18, 0xbd50, 0x4feb, { 0x89, 0xb, 0x58, 0xca, 0xb, 0x47, 0x39, 0xe9 } }
+
+typedef union {
+ ACPI_SMALL_RESOURCE_HEADER *SmallHeader;
+ ACPI_LARGE_RESOURCE_HEADER *LargeHeader;
+} ACPI_RESOURCE_HEADER_PTR;
+
+typedef struct {
+ UINT8 Register; ///< Register number.
+ UINT8 AndMask; ///< Bitwise AND mask.
+ UINT8 OrMask; ///< Bitwise OR mask.
+} EFI_SIO_REGISTER_MODIFY;
+
+typedef struct _EFI_SIO_PROTOCOL EFI_SIO_PROTOCOL;
+
+/**
+ Provides a low level access to the registers for the Super I/O.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] Write Specifies the type of the register operation. If this parameter is TRUE, Value is
+ interpreted as an input parameter and the operation is a register write. If this parameter
+ is FALSE, Value is interpreted as an output parameter and the operation is a register
+ read.
+ @param[in] ExitCfgMode Exit Configuration Mode Indicator. If this parameter is set to TRUE, the Super I/O
+ driver will turn off configuration mode of the Super I/O prior to returning from this
+ function. If this parameter is set to FALSE, the Super I/O driver will leave Super I/O
+ in the configuration mode.
+ The Super I/O driver must track the current state of the Super I/O and enable the
+ configuration mode of Super I/O if necessary prior to register access.
+ @param[in] Register Register number.
+ @param[in, out] Value If Write is TRUE, Value is a pointer to the buffer containing the byte of data to be
+ written to the Super I/O register. If Write is FALSE, Value is a pointer to the
+ destination buffer for the byte of data to be read from the Super I/O register.
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER The Value is NULL
+ @retval EFI_INVALID_PARAMETER Invalid Register number
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIO_REGISTER_ACCESS)(
+ IN CONST EFI_SIO_PROTOCOL *This,
+ IN BOOLEAN Write,
+ IN BOOLEAN ExitCfgMode,
+ IN UINT8 Register,
+ IN OUT UINT8 *Value
+);
+
+/**
+ Provides an interface to get a list of the current resources consumed by the device in the ACPI
+ Resource Descriptor format.
+
+ GetResources() returns a list of resources currently consumed by the device. The
+ ResourceList is a pointer to the buffer containing resource descriptors for the device. The
+ descriptors are in the format of Small or Large ACPI resource descriptor as defined by ACPI
+ specification (2.0 & 3.0). The buffer of resource descriptors is terminated with the 'End tag'
+ resource descriptor.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[out] ResourceList A pointer to an ACPI resource descriptor list that defines the current resources used by
+ the device. Type ACPI_RESOURCE_HEADER_PTR is defined in the "Related
+ Definitions" below.
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER ResourceList is NULL
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIO_GET_RESOURCES)(
+ IN CONST EFI_SIO_PROTOCOL *This,
+ OUT ACPI_RESOURCE_HEADER_PTR *ResourceList
+);
+
+/**
+ Sets the resources for the device.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] ResourceList Pointer to the ACPI resource descriptor list. Type ACPI_RESOURCE_HEADER_PTR
+ is defined in the "Related Definitions" section of
+ EFI_SIO_PROTOCOL.GetResources().
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER ResourceList is invalid
+ @retval EFI_ACCESS_DENIED Some of the resources in ResourceList are in use
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIO_SET_RESOURCES)(
+ IN CONST EFI_SIO_PROTOCOL *This,
+ IN ACPI_RESOURCE_HEADER_PTR ResourceList
+);
+
+/**
+ Provides a collection of resource descriptor lists. Each resource descriptor list in the collection
+ defines a combination of resources that can potentially be used by the device.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[out] ResourceCollection Collection of the resource descriptor lists.
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER ResourceCollection is NULL
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIO_POSSIBLE_RESOURCES)(
+ IN CONST EFI_SIO_PROTOCOL *This,
+ OUT ACPI_RESOURCE_HEADER_PTR *ResourceCollection
+);
+
+/**
+ Provides an interface for a table based programming of the Super I/O registers.
+
+ The Modify() function provides an interface for table based programming of the Super I/O
+ registers. This function can be used to perform programming of multiple Super I/O registers with a
+ single function call. For each table entry, the Register is read, its content is bitwise ANDed with
+ AndMask, and then ORed with OrMask before being written back to the Register. The Super
+ I/O driver must track the current state of the Super I/O and enable the configuration mode of Super I/
+ O if necessary prior to table processing. Once the table is processed, the Super I/O device has to be
+ returned to the original state.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] Command A pointer to an array of NumberOfCommands EFI_SIO_REGISTER_MODIFY
+ structures. Each structure specifies a single Super I/O register modify operation. Type
+ EFI_SIO_REGISTER_MODIFY is defined in the "Related Definitions" below.
+ @param[in] NumberOfCommands Number of elements in the Command array.
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER Command is NULL
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIO_MODIFY)(
+ IN CONST EFI_SIO_PROTOCOL *This,
+ IN CONST EFI_SIO_REGISTER_MODIFY *Command,
+ IN UINTN NumberOfCommands
+);
+
+struct _EFI_SIO_PROTOCOL {
+ EFI_SIO_REGISTER_ACCESS RegisterAccess;
+ EFI_SIO_GET_RESOURCES GetResources;
+ EFI_SIO_SET_RESOURCES SetResources;
+ EFI_SIO_POSSIBLE_RESOURCES PossibleResources;
+ EFI_SIO_MODIFY Modify;
+};
+
+extern EFI_GUID gEfiSioProtocolGuid;
+
+#endif // __EFI_SUPER_IO_PROTOCOL_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SuperIoControl.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SuperIoControl.h
new file mode 100644
index 0000000000..0bcfb5a473
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/SuperIoControl.h
@@ -0,0 +1,92 @@
+/** @file
+ The Super I/O Control Protocol is installed by the Super I/O driver. It provides
+ the low-level services for SIO devices that enable them to be used in the UEFI
+ driver model.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This protocol is from PI Version 1.2.1.
+
+**/
+
+#ifndef __EFI_SUPER_IO_CONTROL_PROTOCOL_H__
+#define __EFI_SUPER_IO_CONTROL_PROTOCOL_H__
+
+#define EFI_SIO_CONTROL_PROTOCOL_GUID \
+ { \
+ 0xb91978df, 0x9fc1, 0x427d, { 0xbb, 0x5, 0x4c, 0x82, 0x84, 0x55, 0xca, 0x27 } \
+ }
+
+typedef struct _EFI_SIO_CONTROL_PROTOCOL EFI_SIO_CONTROL_PROTOCOL;
+typedef struct _EFI_SIO_CONTROL_PROTOCOL *PEFI_SIO_CONTROL_PROTOCOL;
+
+/**
+ Enable an ISA-style device.
+
+ This function enables a logical ISA device and, if necessary, configures it
+ to default settings, including memory, I/O, DMA and IRQ resources.
+
+ @param This A pointer to this instance of the EFI_SIO_CONTROL_PROTOCOL.
+
+ @retval EFI_SUCCESS The device is enabled successfully.
+ @retval EFI_OUT_OF_RESOURCES The device could not be enabled because there
+ were insufficient resources either for the device
+ itself or for the records needed to track the device.
+ @retval EFI_ALREADY_STARTED The device is already enabled.
+ @retval EFI_UNSUPPORTED The device cannot be enabled.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIO_CONTROL_ENABLE)(
+ IN CONST EFI_SIO_CONTROL_PROTOCOL *This
+ );
+
+/**
+ Disable a logical ISA device.
+
+ This function disables a logical ISA device so that it no longer consumes
+ system resources, such as memory, I/O, DMA and IRQ resources. Enough information
+ must be available so that subsequent Enable() calls would properly reconfigure
+ the device.
+
+ @param This A pointer to this instance of the EFI_SIO_CONTROL_PROTOCOL.
+
+ @retval EFI_SUCCESS The device is disabled successfully.
+ @retval EFI_OUT_OF_RESOURCES The device could not be disabled because there
+ were insufficient resources either for the device
+ itself or for the records needed to track the device.
+ @retval EFI_ALREADY_STARTED The device is already disabled.
+ @retval EFI_UNSUPPORTED The device cannot be disabled.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIO_CONTROL_DISABLE)(
+ IN CONST EFI_SIO_CONTROL_PROTOCOL *This
+ );
+
+struct _EFI_SIO_CONTROL_PROTOCOL {
+ ///
+ /// The version of this protocol.
+ ///
+ UINT32 Version;
+ ///
+ /// Enable a device.
+ ///
+ EFI_SIO_CONTROL_ENABLE EnableDevice;
+ ///
+ /// Disable a device.
+ ///
+ EFI_SIO_CONTROL_DISABLE DisableDevice;
+};
+
+extern EFI_GUID gEfiSioControlProtocolGuid;
+
+#endif // __EFI_SUPER_IO_CONTROL_PROTOCOL_H__
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Supplicant.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Supplicant.h
new file mode 100644
index 0000000000..1f1e2fffbf
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Supplicant.h
@@ -0,0 +1,464 @@
+/** @file
+ This file defines the EFI Supplicant Protocol.
+
+ Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.6
+
+**/
+
+#ifndef __EFI_SUPPLICANT_PROTOCOL_H__
+#define __EFI_SUPPLICANT_PROTOCOL_H__
+
+#include <Protocol/WiFi2.h>
+
+///
+/// The EFI Supplicant Service Binding Protocol is used to locate EFI
+/// Supplicant Protocol drivers to create and destroy child of the driver to
+/// communicate with other host using Supplicant protocol.
+///
+#define EFI_SUPPLICANT_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0x45bcd98e, 0x59ad, 0x4174, { 0x95, 0x46, 0x34, 0x4a, 0x7, 0x48, 0x58, 0x98 } \
+ }
+
+///
+/// The EFI Supplicant protocol provides services to process authentication and
+/// data encryption/decryption for security management.
+///
+#define EFI_SUPPLICANT_PROTOCOL_GUID \
+ { \
+ 0x54fcc43e, 0xaa89, 0x4333, { 0x9a, 0x85, 0xcd, 0xea, 0x24, 0x5, 0x1e, 0x9e } \
+ }
+
+typedef struct _EFI_SUPPLICANT_PROTOCOL EFI_SUPPLICANT_PROTOCOL;
+
+///
+/// EFI_SUPPLICANT_CRYPT_MODE
+///
+typedef enum {
+ //
+ // Encrypt data provided in the fragment buffers.
+ //
+ EfiSupplicantEncrypt,
+ //
+ // Decrypt data provided in the fragment buffers.
+ //
+ EfiSupplicantDecrypt,
+} EFI_SUPPLICANT_CRYPT_MODE;
+
+///
+/// EFI_SUPPLICANT_DATA_TYPE
+///
+typedef enum {
+ //
+ // Session Configuration
+ //
+
+ //
+ // Current authentication type in use. The corresponding Data is of type
+ // EFI_80211_AKM_SUITE_SELECTOR.
+ //
+ EfiSupplicant80211AKMSuite,
+ //
+ // Group data encryption type in use. The corresponding Data is of type
+ // EFI_SUPPLICANT_CIPHER_SUITE_SELECTOR.
+ //
+ EfiSupplicant80211GroupDataCipherSuite,
+ //
+ // Pairwise encryption type in use. The corresponding Data is of type
+ // EFI_80211_CIPHER_SUITE_SELECTOR.
+ //
+ EfiSupplicant80211PairwiseCipherSuite,
+ //
+ // PSK password. The corresponding Data is a NULL-terminated ASCII string.
+ //
+ EfiSupplicant80211PskPassword,
+ //
+ // Target SSID name. The corresponding Data is of type EFI_80211_SSID.
+ //
+ EfiSupplicant80211TargetSSIDName,
+ //
+ // Station MAC address. The corresponding Data is of type
+ // EFI_80211_MAC_ADDRESS.
+ //
+ EfiSupplicant80211StationMac,
+ //
+ // Target SSID MAC address. The corresponding Data is 6 bytes MAC address.
+ //
+ EfiSupplicant80211TargetSSIDMac,
+
+ //
+ // Session Information
+ //
+
+ //
+ // 802.11 PTK. The corresponding Data is of type EFI_SUPPLICANT_KEY.
+ //
+ EfiSupplicant80211PTK,
+ //
+ // 802.11 GTK. The corresponding Data is of type EFI_SUPPLICANT_GTK_LIST.
+ //
+ EfiSupplicant80211GTK,
+ //
+ // Supplicant state. The corresponding Data is
+ // EFI_EAPOL_SUPPLICANT_PAE_STATE.
+ //
+ EfiSupplicantState,
+ //
+ // 802.11 link state. The corresponding Data is EFI_80211_LINK_STATE.
+ //
+ EfiSupplicant80211LinkState,
+ //
+ // Flag indicates key is refreshed. The corresponding Data is
+ // EFI_SUPPLICANT_KEY_REFRESH.
+ //
+ EfiSupplicantKeyRefresh,
+
+ //
+ // Session Configuration
+ //
+
+ //
+ // Supported authentication types. The corresponding Data is of type
+ // EFI_80211_AKM_SUITE_SELECTOR.
+ //
+ EfiSupplicant80211SupportedAKMSuites,
+ //
+ // Supported software encryption types provided by supplicant driver. The
+ // corresponding Data is of type EFI_80211_CIPHER_SUITE_SELECTOR.
+ //
+ EfiSupplicant80211SupportedSoftwareCipherSuites,
+ //
+ // Supported hardware encryption types provided by wireless UNDI driver. The
+ // corresponding Data is of type EFI_80211_CIPHER_SUITE_SELECTOR.
+ //
+ EfiSupplicant80211SupportedHardwareCipherSuites,
+
+ //
+ // Session Information
+ //
+
+ //
+ // 802.11 Integrity GTK. The corresponding Data is of type
+ // EFI_SUPPLICANT_GTK_LIST.
+ //
+ EfiSupplicant80211IGTK,
+ //
+ // 802.11 PMK. The corresponding Data is 32 bytes pairwise master key.
+ //
+ EfiSupplicant80211PMK,
+ EfiSupplicantDataTypeMaximum
+} EFI_SUPPLICANT_DATA_TYPE;
+
+///
+/// EFI_80211_LINK_STATE
+///
+typedef enum {
+ //
+ // Indicates initial start state, unauthenticated, unassociated.
+ //
+ Ieee80211UnauthenticatedUnassociated,
+ //
+ // Indicates authenticated, unassociated.
+ //
+ Ieee80211AuthenticatedUnassociated,
+ //
+ // Indicates authenticated and associated, but pending RSN authentication.
+ //
+ Ieee80211PendingRSNAuthentication,
+ //
+ // Indicates authenticated and associated.
+ //
+ Ieee80211AuthenticatedAssociated
+} EFI_80211_LINK_STATE;
+
+///
+/// EFI_SUPPLICANT_KEY_TYPE (IEEE Std 802.11 Section 6.3.19.1.2)
+///
+typedef enum {
+ Group,
+ Pairwise,
+ PeerKey,
+ IGTK
+} EFI_SUPPLICANT_KEY_TYPE;
+
+///
+/// EFI_SUPPLICANT_KEY_DIRECTION (IEEE Std 802.11 Section 6.3.19.1.2)
+///
+typedef enum {
+ //
+ // Indicates that the keys are being installed for the receive direction.
+ //
+ Receive,
+ //
+ // Indicates that the keys are being installed for the transmit direction.
+ //
+ Transmit,
+ //
+ // Indicates that the keys are being installed for both the receive and
+ // transmit directions.
+ //
+ Both
+} EFI_SUPPLICANT_KEY_DIRECTION;
+
+///
+/// EFI_SUPPLICANT_KEY_REFRESH
+///
+typedef struct {
+ //
+ // If TRUE, indicates GTK is just refreshed after a successful call to
+ // EFI_SUPPLICANT_PROTOCOL.BuildResponsePacket().
+ //
+ BOOLEAN GTKRefresh;
+} EFI_SUPPLICANT_KEY_REFRESH;
+
+#define EFI_MAX_KEY_LEN 64
+
+///
+/// EFI_SUPPLICANT_KEY
+///
+typedef struct {
+ //
+ // The key value.
+ //
+ UINT8 Key[EFI_MAX_KEY_LEN];
+ //
+ // Length in bytes of the Key. Should be up to EFI_MAX_KEY_LEN.
+ //
+ UINT8 KeyLen;
+ //
+ // The key identifier.
+ //
+ UINT8 KeyId;
+ //
+ // Defines whether this key is a group key, pairwise key, PeerKey, or
+ // Integrity Group.
+ //
+ EFI_SUPPLICANT_KEY_TYPE KeyType;
+ //
+ // The value is set according to the KeyType.
+ //
+ EFI_80211_MAC_ADDRESS Addr;
+ //
+ // The Receive Sequence Count value.
+ //
+ UINT8 Rsc[8];
+ //
+ // Length in bytes of the Rsc. Should be up to 8.
+ //
+ UINT8 RscLen;
+ //
+ // Indicates whether the key is configured by the Authenticator or
+ // Supplicant. The value true indicates Authenticator.
+ //
+ BOOLEAN IsAuthenticator;
+ //
+ // The cipher suite required for this association.
+ //
+ EFI_80211_SUITE_SELECTOR CipherSuite;
+ //
+ // Indicates the direction for which the keys are to be installed.
+ //
+ EFI_SUPPLICANT_KEY_DIRECTION Direction;
+} EFI_SUPPLICANT_KEY;
+
+///
+/// EFI_SUPPLICANT_GTK_LIST
+///
+typedef struct {
+ //
+ // Indicates the number of GTKs that are contained in GTKList.
+ //
+ UINT8 GTKCount;
+ //
+ // A variable-length array of GTKs of type EFI_SUPPLICANT_KEY. The number of
+ // entries is specified by GTKCount.
+ //
+ EFI_SUPPLICANT_KEY GTKList[1];
+} EFI_SUPPLICANT_GTK_LIST;
+
+///
+/// EFI_SUPPLICANT_FRAGMENT_DATA
+///
+typedef struct {
+ //
+ // Length of data buffer in the fragment.
+ //
+ UINT32 FragmentLength;
+ //
+ // Pointer to the data buffer in the fragment.
+ //
+ VOID *FragmentBuffer;
+} EFI_SUPPLICANT_FRAGMENT_DATA;
+
+/**
+ BuildResponsePacket() is called during STA and AP authentication is in
+ progress. Supplicant derives the PTK or session keys depend on type of
+ authentication is being employed.
+
+ @param[in] This Pointer to the EFI_SUPPLICANT_PROTOCOL
+ instance.
+ @param[in] RequestBuffer Pointer to the most recently received EAPOL
+ packet. NULL means the supplicant need
+ initiate the EAP authentication session and
+ send EAPOL-Start message.
+ @param[in] RequestBufferSize
+ Packet size in bytes for the most recently
+ received EAPOL packet. 0 is only valid when
+ RequestBuffer is NULL.
+ @param[out] Buffer Pointer to the buffer to hold the built
+ packet.
+ @param[in, out] BufferSize Pointer to the buffer size in bytes. On
+ input, it is the buffer size provided by the
+ caller. On output, it is the buffer size in
+ fact needed to contain the packet.
+
+ @retval EFI_SUCCESS The required EAPOL packet is built
+ successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is
+ TRUE:
+ RequestBuffer is NULL, but RequestSize is
+ NOT 0.
+ RequestBufferSize is 0.
+ Buffer is NULL, but RequestBuffer is NOT 0.
+ BufferSize is NULL.
+ @retval EFI_BUFFER_TOO_SMALL BufferSize is too small to hold the response
+ packet.
+ @retval EFI_NOT_READY Current EAPOL session state is NOT ready to
+ build ResponsePacket.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SUPPLICANT_BUILD_RESPONSE_PACKET) (
+ IN EFI_SUPPLICANT_PROTOCOL *This,
+ IN UINT8 *RequestBuffer, OPTIONAL
+ IN UINTN RequestBufferSize, OPTIONAL
+ OUT UINT8 *Buffer,
+ IN OUT UINTN *BufferSize
+ );
+
+/**
+ ProcessPacket() is called to Supplicant driver to encrypt or decrypt the data
+ depending type of authentication type.
+
+ @param[in] This Pointer to the EFI_SUPPLICANT_PROTOCOL
+ instance.
+ @param[in, out] FragmentTable Pointer to a list of fragment. The caller
+ will take responsible to handle the original
+ FragmentTable while it may be reallocated in
+ Supplicant driver.
+ @param[in] FragmentCount Number of fragment.
+ @param[in] CryptMode Crypt mode.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is
+ TRUE:
+ FragmentTable is NULL.
+ FragmentCount is NULL.
+ CryptMode is invalid.
+ @retval EFI_NOT_READY Current supplicant state is NOT Authenticated.
+ @retval EFI_ABORTED Something wrong decryption the message.
+ @retval EFI_UNSUPPORTED This API is not supported.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SUPPLICANT_PROCESS_PACKET) (
+ IN EFI_SUPPLICANT_PROTOCOL *This,
+ IN OUT EFI_SUPPLICANT_FRAGMENT_DATA **FragmentTable,
+ IN UINT32 *FragmentCount,
+ IN EFI_SUPPLICANT_CRYPT_MODE CryptMode
+ );
+
+/**
+ Set Supplicant configuration data.
+
+ @param[in] This Pointer to the EFI_SUPPLICANT_PROTOCOL
+ instance.
+ @param[in] DataType The type of data.
+ @param[in] Data Pointer to the buffer to hold the data.
+ @param[in] DataSize Pointer to the buffer size in bytes.
+
+ @retval EFI_SUCCESS The Supplicant configuration data is set
+ successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is
+ TRUE:
+ Data is NULL.
+ DataSize is 0.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SUPPLICANT_SET_DATA) (
+ IN EFI_SUPPLICANT_PROTOCOL *This,
+ IN EFI_SUPPLICANT_DATA_TYPE DataType,
+ IN VOID *Data,
+ IN UINTN DataSize
+ );
+
+/**
+ Get Supplicant configuration data.
+
+ @param[in] This Pointer to the EFI_SUPPLICANT_PROTOCOL
+ instance.
+ @param[in] DataType The type of data.
+ @param[out] Data Pointer to the buffer to hold the data.
+ Ignored if DataSize is 0.
+ @param[in, out] DataSize Pointer to the buffer size in bytes. On
+ input, it is the buffer size provided by the
+ caller. On output, it is the buffer size in
+ fact needed to contain the packet.
+
+ @retval EFI_SUCCESS The Supplicant configuration data is got
+ successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is
+ TRUE:
+ This is NULL.
+ DataSize is NULL.
+ Data is NULL if *DataSize is not zero.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_NOT_FOUND The Supplicant configuration data is not
+ found.
+ @retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the
+ specified configuration data and the required
+ size is returned in DataSize.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SUPPLICANT_GET_DATA) (
+ IN EFI_SUPPLICANT_PROTOCOL *This,
+ IN EFI_SUPPLICANT_DATA_TYPE DataType,
+ OUT UINT8 *Data, OPTIONAL
+ IN OUT UINTN *DataSize
+ );
+
+///
+/// The EFI_SUPPLICANT_PROTOCOL is designed to provide unified place for WIFI
+/// and EAP security management. Both PSK authentication and 802.1X EAP
+/// authentication can be managed via this protocol and driver or application
+/// as a consumer can only focus on about packet transmitting or receiving.
+///
+struct _EFI_SUPPLICANT_PROTOCOL {
+ EFI_SUPPLICANT_BUILD_RESPONSE_PACKET BuildResponsePacket;
+ EFI_SUPPLICANT_PROCESS_PACKET ProcessPacket;
+ EFI_SUPPLICANT_SET_DATA SetData;
+ EFI_SUPPLICANT_GET_DATA GetData;
+};
+
+extern EFI_GUID gEfiSupplicantServiceBindingProtocolGuid;
+extern EFI_GUID gEfiSupplicantProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TapeIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TapeIo.h
new file mode 100644
index 0000000000..74c7b3f658
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TapeIo.h
@@ -0,0 +1,237 @@
+/** @file
+ EFI_TAPE_IO_PROTOCOL as defined in the UEFI 2.0.
+ Provide services to control and access a tape device.
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_TAPE_IO_PROTOCOL_H__
+#define __EFI_TAPE_IO_PROTOCOL_H__
+
+#define EFI_TAPE_IO_PROTOCOL_GUID \
+ { \
+ 0x1e93e633, 0xd65a, 0x459e, {0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } \
+ }
+
+typedef struct _EFI_TAPE_IO_PROTOCOL EFI_TAPE_IO_PROTOCOL;
+
+typedef struct _EFI_TAPE_HEADER {
+ UINT64 Signature;
+ UINT32 Revision;
+ UINT32 BootDescSize;
+ UINT32 BootDescCRC;
+ EFI_GUID TapeGUID;
+ EFI_GUID TapeType;
+ EFI_GUID TapeUnique;
+ UINT32 BLLocation;
+ UINT32 BLBlocksize;
+ UINT32 BLFilesize;
+ CHAR8 OSVersion[40];
+ CHAR8 AppVersion[40];
+ CHAR8 CreationDate[10];
+ CHAR8 CreationTime[10];
+ CHAR8 SystemName[256]; // UTF-8
+ CHAR8 TapeTitle[120]; // UTF-8
+ CHAR8 pad[468]; // pad to 1024
+} EFI_TAPE_HEADER;
+
+/**
+ Reads from the tape.
+
+ @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
+ @param BufferSize The size of the buffer in bytes pointed to by Buffer.
+ @param Buffer The pointer to the buffer for data to be read into.
+
+ @retval EFI_SUCCESS Data was successfully transferred from the media.
+ @retval EFI_END_OF_FILE A filemark was encountered which limited the data
+ transferred by the read operation or the head is positioned
+ just after a filemark.
+ @retval EFI_NO_MEDIA No media is loaded in the device.
+ @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not
+ online). The transfer may be retried at a later time.
+ @retval EFI_UNSUPPORTED The device does not support this type of transfer.
+ @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.
+ @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
+ The transfer was aborted since the current position of the
+ media may be incorrect.
+ @retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero
+ BufferSize, or the device is operating in fixed block
+ size mode and the BufferSize was not a multiple of
+ device's fixed block size
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data
+ from the media.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TAPE_READ)(
+ IN EFI_TAPE_IO_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+ );
+
+/**
+ Writes to the tape.
+
+ @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
+ @param BufferSize Size of the buffer in bytes pointed to by Buffer.
+ @param Buffer The pointer to the buffer for data to be written from.
+
+ @retval EFI_SUCCESS Data was successfully transferred to the media.
+ @retval EFI_END_OF_MEDIA The logical end of media has been reached. Data may have
+ been successfully transferred to the media.
+ @retval EFI_NO_MEDIA No media is loaded in the device.
+ @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not
+ online). The transfer may be retried at a later time.
+ @retval EFI_UNSUPPORTED The device does not support this type of transfer.
+ @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.
+ @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
+ The transfer was aborted since the current position of the
+ media may be incorrect.
+ @retval EFI_WRITE_PROTECTED The media in the device is write-protected. The transfer
+ was aborted since a write cannot be completed.
+ @retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero
+ BufferSize, or the device is operating in fixed block
+ size mode and the BufferSize was not a multiple of
+ device's fixed block size
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data
+ from the media.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TAPE_WRITE)(
+ IN EFI_TAPE_IO_PROTOCOL *This,
+ IN UINTN *BufferSize,
+ IN VOID *Buffer
+ );
+
+
+/**
+ Rewinds the tape.
+
+ @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The media was successfully repositioned.
+ @retval EFI_NO_MEDIA No media is loaded in the device.
+ @retval EFI_NOT_READY Repositioning the media failed since the device was not
+ ready (e.g. not online). The transfer may be retried at a later time.
+ @retval EFI_UNSUPPORTED The device does not support this type of media repositioning.
+ @retval EFI_TIMEOUT Repositioning of the media did not complete within the timeout specified.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to reposition the media.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TAPE_REWIND)(
+ IN EFI_TAPE_IO_PROTOCOL *This
+ );
+
+
+/**
+ Positions the tape.
+
+ @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
+ @param Direction Direction and number of data blocks or filemarks to space over on media.
+ @param Type Type of mark to space over on media.
+ The following Type marks are mandatory:
+ BLOCK type : 0
+ FILEMARK type : 1
+
+ @retval EFI_SUCCESS The media was successfully repositioned.
+ @retval EFI_END_OF_MEDIA Beginning or end of media was reached before the
+ indicated number of data blocks or filemarks were found.
+ @retval EFI_NO_MEDIA No media is loaded in the device.
+ @retval EFI_NOT_READY The reposition failed since the device was not ready (e.g. not
+ online). The reposition may be retried at a later time.
+ @retval EFI_UNSUPPORTED The device does not support this type of repositioning.
+ @retval EFI_TIMEOUT The repositioning failed to complete within the timeout specified.
+ @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
+ Repositioning the media was aborted since the current
+ position of the media may be incorrect.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to reposition the media.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TAPE_SPACE)(
+ IN EFI_TAPE_IO_PROTOCOL *This,
+ IN INTN Direction,
+ IN UINTN Type
+ );
+
+
+/**
+ Writes filemarks to the media.
+
+ @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
+ @param Count Number of filemarks to write to the media.
+
+ @retval EFI_SUCCESS Data was successfully transferred from the media.
+ @retval EFI_NO_MEDIA No media is loaded in the device.
+ @retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not
+ online). The transfer may be retried at a later time.
+ @retval EFI_UNSUPPORTED The device does not support this type of repositioning.
+ @retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.
+ @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
+ The transfer was aborted since the current position of the
+ media may be incorrect.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data from the media.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TAPE_WRITEFM)(
+ IN EFI_TAPE_IO_PROTOCOL *This,
+ IN UINTN Count
+ );
+
+
+/**
+ Resets the tape device.
+
+ @param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
+ @param ExtendedVerification Indicates whether the parent bus should also be reset.
+
+ @retval EFI_SUCCESS The bus and/or device were successfully reset.
+ @retval EFI_NO_MEDIA No media is loaded in the device.
+ @retval EFI_NOT_READY The reset failed since the device and/or bus was not ready.
+ The reset may be retried at a later time.
+ @retval EFI_UNSUPPORTED The device does not support this type of reset.
+ @retval EFI_TIMEOUT The reset did not complete within the timeout allowed.
+ @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the bus and/or device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TAPE_RESET)(
+ IN EFI_TAPE_IO_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+ );
+
+///
+/// The EFI_TAPE_IO_PROTOCOL provides basic sequential operations for tape devices.
+/// These include read, write, rewind, space, write filemarks and reset functions.
+/// Per this specification, a boot application uses the services of this protocol
+/// to load the bootloader image from tape.
+///
+struct _EFI_TAPE_IO_PROTOCOL {
+ EFI_TAPE_READ TapeRead;
+ EFI_TAPE_WRITE TapeWrite;
+ EFI_TAPE_REWIND TapeRewind;
+ EFI_TAPE_SPACE TapeSpace;
+ EFI_TAPE_WRITEFM TapeWriteFM;
+ EFI_TAPE_RESET TapeReset;
+};
+
+extern EFI_GUID gEfiTapeIoProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tcg2Protocol.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tcg2Protocol.h
new file mode 100644
index 0000000000..042bdffa1f
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tcg2Protocol.h
@@ -0,0 +1,341 @@
+/** @file
+ TPM2 Protocol as defined in TCG PC Client Platform EFI Protocol Specification Family "2.0".
+ See http://trustedcomputinggroup.org for the latest specification
+
+Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __TCG2_PROTOCOL_H__
+#define __TCG2_PROTOCOL_H__
+
+#include <IndustryStandard/UefiTcgPlatform.h>
+#include <IndustryStandard/Tpm20.h>
+
+#define EFI_TCG2_PROTOCOL_GUID \
+ {0x607f766c, 0x7455, 0x42be, { 0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f }}
+
+typedef struct tdEFI_TCG2_PROTOCOL EFI_TCG2_PROTOCOL;
+
+typedef struct tdEFI_TCG2_VERSION {
+ UINT8 Major;
+ UINT8 Minor;
+} EFI_TCG2_VERSION;
+
+typedef UINT32 EFI_TCG2_EVENT_LOG_BITMAP;
+typedef UINT32 EFI_TCG2_EVENT_LOG_FORMAT;
+typedef UINT32 EFI_TCG2_EVENT_ALGORITHM_BITMAP;
+
+#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 0x00000001
+#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_2 0x00000002
+
+typedef struct tdEFI_TCG2_BOOT_SERVICE_CAPABILITY {
+ //
+ // Allocated size of the structure
+ //
+ UINT8 Size;
+ //
+ // Version of the EFI_TCG2_BOOT_SERVICE_CAPABILITY structure itself.
+ // For this version of the protocol, the Major version shall be set to 1
+ // and the Minor version shall be set to 1.
+ //
+ EFI_TCG2_VERSION StructureVersion;
+ //
+ // Version of the EFI TCG2 protocol.
+ // For this version of the protocol, the Major version shall be set to 1
+ // and the Minor version shall be set to 1.
+ //
+ EFI_TCG2_VERSION ProtocolVersion;
+ //
+ // Supported hash algorithms (this bitmap is determined by the supported PCR
+ // banks in the TPM and the hashing algorithms supported by the firmware)
+ //
+ EFI_TCG2_EVENT_ALGORITHM_BITMAP HashAlgorithmBitmap;
+ //
+ // Bitmap of supported event log formats
+ //
+ EFI_TCG2_EVENT_LOG_BITMAP SupportedEventLogs;
+ //
+ // False = TPM not present
+ //
+ BOOLEAN TPMPresentFlag;
+ //
+ // Max size (in bytes) of a command that can be sent to the TPM
+ //
+ UINT16 MaxCommandSize;
+ //
+ // Max size (in bytes) of a response that can be provided by the TPM
+ //
+ UINT16 MaxResponseSize;
+ //
+ // 4-byte Vendor ID
+ // (see TCG Vendor ID registry, Section "TPM Capabilities Vendor ID")
+ //
+ UINT32 ManufacturerID;
+ //
+ // Maximum number of PCR banks (hashing algorithms) supported.
+ // No granularity is provided to support a specific set of algorithms.
+ // Minimum value is 1.
+ //
+ UINT32 NumberOfPCRBanks;
+ //
+ // A bitmap of currently active PCR banks (hashing algorithms).
+ // This is a subset of the supported hashing algorithms reported in HashAlgorithmBitMap.
+ // NumberOfPcrBanks defines the number of bits that are set.
+ //
+ EFI_TCG2_EVENT_ALGORITHM_BITMAP ActivePcrBanks;
+} EFI_TCG2_BOOT_SERVICE_CAPABILITY;
+
+#define EFI_TCG2_BOOT_HASH_ALG_SHA1 0x00000001
+#define EFI_TCG2_BOOT_HASH_ALG_SHA256 0x00000002
+#define EFI_TCG2_BOOT_HASH_ALG_SHA384 0x00000004
+#define EFI_TCG2_BOOT_HASH_ALG_SHA512 0x00000008
+#define EFI_TCG2_BOOT_HASH_ALG_SM3_256 0x00000010
+
+//
+// This bit is shall be set when an event shall be extended but not logged.
+//
+#define EFI_TCG2_EXTEND_ONLY 0x0000000000000001
+//
+// This bit shall be set when the intent is to measure a PE/COFF image.
+//
+#define PE_COFF_IMAGE 0x0000000000000010
+
+#define MAX_PCR_INDEX 23
+
+#pragma pack(1)
+
+#define EFI_TCG2_EVENT_HEADER_VERSION 1
+
+typedef struct {
+ //
+ // Size of the event header itself (sizeof(EFI_TCG2_EVENT_HEADER)).
+ //
+ UINT32 HeaderSize;
+ //
+ // Header version. For this version of this specification, the value shall be 1.
+ //
+ UINT16 HeaderVersion;
+ //
+ // Index of the PCR that shall be extended (0 - 23).
+ //
+ TCG_PCRINDEX PCRIndex;
+ //
+ // Type of the event that shall be extended (and optionally logged).
+ //
+ TCG_EVENTTYPE EventType;
+} EFI_TCG2_EVENT_HEADER;
+
+typedef struct tdEFI_TCG2_EVENT {
+ //
+ // Total size of the event including the Size component, the header and the Event data.
+ //
+ UINT32 Size;
+ EFI_TCG2_EVENT_HEADER Header;
+ UINT8 Event[1];
+} EFI_TCG2_EVENT;
+
+#pragma pack()
+
+/**
+ The EFI_TCG2_PROTOCOL GetCapability function call provides protocol
+ capability information and state information.
+
+ @param[in] This Indicates the calling context
+ @param[in, out] ProtocolCapability The caller allocates memory for a EFI_TCG2_BOOT_SERVICE_CAPABILITY
+ structure and sets the size field to the size of the structure allocated.
+ The callee fills in the fields with the EFI protocol capability information
+ and the current EFI TCG2 state information up to the number of fields which
+ fit within the size of the structure passed in.
+
+ @retval EFI_SUCCESS Operation completed successfully.
+ @retval EFI_DEVICE_ERROR The command was unsuccessful.
+ The ProtocolCapability variable will not be populated.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
+ The ProtocolCapability variable will not be populated.
+ @retval EFI_BUFFER_TOO_SMALL The ProtocolCapability variable is too small to hold the full response.
+ It will be partially populated (required Size field will be set).
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG2_GET_CAPABILITY) (
+ IN EFI_TCG2_PROTOCOL *This,
+ IN OUT EFI_TCG2_BOOT_SERVICE_CAPABILITY *ProtocolCapability
+ );
+
+/**
+ The EFI_TCG2_PROTOCOL Get Event Log function call allows a caller to
+ retrieve the address of a given event log and its last entry.
+
+ @param[in] This Indicates the calling context
+ @param[in] EventLogFormat The type of the event log for which the information is requested.
+ @param[out] EventLogLocation A pointer to the memory address of the event log.
+ @param[out] EventLogLastEntry If the Event Log contains more than one entry, this is a pointer to the
+ address of the start of the last entry in the event log in memory.
+ @param[out] EventLogTruncated If the Event Log is missing at least one entry because an event would
+ have exceeded the area allocated for events, this value is set to TRUE.
+ Otherwise, the value will be FALSE and the Event Log will be complete.
+
+ @retval EFI_SUCCESS Operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect
+ (e.g. asking for an event log whose format is not supported).
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG2_GET_EVENT_LOG) (
+ IN EFI_TCG2_PROTOCOL *This,
+ IN EFI_TCG2_EVENT_LOG_FORMAT EventLogFormat,
+ OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,
+ OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry,
+ OUT BOOLEAN *EventLogTruncated
+ );
+
+/**
+ The EFI_TCG2_PROTOCOL HashLogExtendEvent function call provides callers with
+ an opportunity to extend and optionally log events without requiring
+ knowledge of actual TPM commands.
+ The extend operation will occur even if this function cannot create an event
+ log entry (e.g. due to the event log being full).
+
+ @param[in] This Indicates the calling context
+ @param[in] Flags Bitmap providing additional information.
+ @param[in] DataToHash Physical address of the start of the data buffer to be hashed.
+ @param[in] DataToHashLen The length in bytes of the buffer referenced by DataToHash.
+ @param[in] EfiTcgEvent Pointer to data buffer containing information about the event.
+
+ @retval EFI_SUCCESS Operation completed successfully.
+ @retval EFI_DEVICE_ERROR The command was unsuccessful.
+ @retval EFI_VOLUME_FULL The extend operation occurred, but the event could not be written to one or more event logs.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
+ @retval EFI_UNSUPPORTED The PE/COFF image type is not supported.
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_TCG2_HASH_LOG_EXTEND_EVENT) (
+ IN EFI_TCG2_PROTOCOL *This,
+ IN UINT64 Flags,
+ IN EFI_PHYSICAL_ADDRESS DataToHash,
+ IN UINT64 DataToHashLen,
+ IN EFI_TCG2_EVENT *EfiTcgEvent
+ );
+
+/**
+ This service enables the sending of commands to the TPM.
+
+ @param[in] This Indicates the calling context
+ @param[in] InputParameterBlockSize Size of the TPM input parameter block.
+ @param[in] InputParameterBlock Pointer to the TPM input parameter block.
+ @param[in] OutputParameterBlockSize Size of the TPM output parameter block.
+ @param[in] OutputParameterBlock Pointer to the TPM output parameter block.
+
+ @retval EFI_SUCCESS The command byte stream was successfully sent to the device and a response was successfully received.
+ @retval EFI_DEVICE_ERROR The command was not successfully sent to the device or a response was not successfully received from the device.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
+ @retval EFI_BUFFER_TOO_SMALL The output parameter block is too small.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG2_SUBMIT_COMMAND) (
+ IN EFI_TCG2_PROTOCOL *This,
+ IN UINT32 InputParameterBlockSize,
+ IN UINT8 *InputParameterBlock,
+ IN UINT32 OutputParameterBlockSize,
+ IN UINT8 *OutputParameterBlock
+ );
+
+/**
+ This service returns the currently active PCR banks.
+
+ @param[in] This Indicates the calling context
+ @param[out] ActivePcrBanks Pointer to the variable receiving the bitmap of currently active PCR banks.
+
+ @retval EFI_SUCCESS The bitmap of active PCR banks was stored in the ActivePcrBanks parameter.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG2_GET_ACTIVE_PCR_BANKS) (
+ IN EFI_TCG2_PROTOCOL *This,
+ OUT UINT32 *ActivePcrBanks
+ );
+
+/**
+ This service sets the currently active PCR banks.
+
+ @param[in] This Indicates the calling context
+ @param[in] ActivePcrBanks Bitmap of the requested active PCR banks. At least one bit SHALL be set.
+
+ @retval EFI_SUCCESS The bitmap in ActivePcrBank parameter is already active.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG2_SET_ACTIVE_PCR_BANKS) (
+ IN EFI_TCG2_PROTOCOL *This,
+ IN UINT32 ActivePcrBanks
+ );
+
+/**
+ This service retrieves the result of a previous invocation of SetActivePcrBanks.
+
+ @param[in] This Indicates the calling context
+ @param[out] OperationPresent Non-zero value to indicate a SetActivePcrBank operation was invoked during the last boot.
+ @param[out] Response The response from the SetActivePcrBank request.
+
+ @retval EFI_SUCCESS The result value could be returned.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG2_GET_RESULT_OF_SET_ACTIVE_PCR_BANKS) (
+ IN EFI_TCG2_PROTOCOL *This,
+ OUT UINT32 *OperationPresent,
+ OUT UINT32 *Response
+ );
+
+struct tdEFI_TCG2_PROTOCOL {
+ EFI_TCG2_GET_CAPABILITY GetCapability;
+ EFI_TCG2_GET_EVENT_LOG GetEventLog;
+ EFI_TCG2_HASH_LOG_EXTEND_EVENT HashLogExtendEvent;
+ EFI_TCG2_SUBMIT_COMMAND SubmitCommand;
+ EFI_TCG2_GET_ACTIVE_PCR_BANKS GetActivePcrBanks;
+ EFI_TCG2_SET_ACTIVE_PCR_BANKS SetActivePcrBanks;
+ EFI_TCG2_GET_RESULT_OF_SET_ACTIVE_PCR_BANKS GetResultOfSetActivePcrBanks;
+};
+
+extern EFI_GUID gEfiTcg2ProtocolGuid;
+
+//
+// Log entries after Get Event Log service
+//
+
+#define EFI_TCG2_FINAL_EVENTS_TABLE_GUID \
+ {0x1e2ed096, 0x30e2, 0x4254, { 0xbd, 0x89, 0x86, 0x3b, 0xbe, 0xf8, 0x23, 0x25 }}
+
+extern EFI_GUID gEfiTcg2FinalEventsTableGuid;
+
+typedef struct tdEFI_TCG2_FINAL_EVENTS_TABLE {
+ //
+ // The version of this structure.
+ //
+ UINT64 Version;
+ //
+ // Number of events recorded after invocation of GetEventLog API
+ //
+ UINT64 NumberOfEvents;
+ //
+ // List of events of type TCG_PCR_EVENT2.
+ //
+//TCG_PCR_EVENT2 Event[1];
+} EFI_TCG2_FINAL_EVENTS_TABLE;
+
+#define EFI_TCG2_FINAL_EVENTS_TABLE_VERSION 1
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TcgService.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TcgService.h
new file mode 100644
index 0000000000..7e8ba0c256
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TcgService.h
@@ -0,0 +1,201 @@
+/** @file
+ TCG Service Protocol as defined in TCG_EFI_Protocol_1_22_Final
+ See http://trustedcomputinggroup.org for the latest specification
+
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _TCG_SERVICE_PROTOCOL_H_
+#define _TCG_SERVICE_PROTOCOL_H_
+
+#include <IndustryStandard/UefiTcgPlatform.h>
+
+#define EFI_TCG_PROTOCOL_GUID \
+ {0xf541796d, 0xa62e, 0x4954, { 0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd } }
+
+typedef struct _EFI_TCG_PROTOCOL EFI_TCG_PROTOCOL;
+
+typedef struct {
+ UINT8 Major;
+ UINT8 Minor;
+ UINT8 RevMajor;
+ UINT8 RevMinor;
+} TCG_VERSION;
+
+typedef struct _TCG_EFI_BOOT_SERVICE_CAPABILITY {
+ UINT8 Size; /// Size of this structure.
+ TCG_VERSION StructureVersion;
+ TCG_VERSION ProtocolSpecVersion;
+ UINT8 HashAlgorithmBitmap; /// Hash algorithms .
+ /// This protocol is capable of : 01=SHA-1.
+ BOOLEAN TPMPresentFlag; /// 00h = TPM not present.
+ BOOLEAN TPMDeactivatedFlag; /// 01h = TPM currently deactivated.
+} TCG_EFI_BOOT_SERVICE_CAPABILITY;
+
+typedef UINT32 TCG_ALGORITHM_ID;
+
+/**
+ This service provides EFI protocol capability information, state information
+ about the TPM, and Event Log state information.
+
+ @param This Indicates the calling context
+ @param ProtocolCapability The callee allocates memory for a TCG_BOOT_SERVICE_CAPABILITY
+ structure and fills in the fields with the EFI protocol
+ capability information and the current TPM state information.
+ @param TCGFeatureFlags This is a pointer to the feature flags. No feature
+ flags are currently defined so this parameter
+ MUST be set to 0. However, in the future,
+ feature flags may be defined that, for example,
+ enable hash algorithm agility.
+ @param EventLogLocation This is a pointer to the address of the event log in memory.
+ @param EventLogLastEntry If the Event Log contains more than one entry,
+ this is a pointer to the address of the start of
+ the last entry in the event log in memory.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER ProtocolCapability does not match TCG capability.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_STATUS_CHECK)(
+ IN EFI_TCG_PROTOCOL *This,
+ OUT TCG_EFI_BOOT_SERVICE_CAPABILITY
+ *ProtocolCapability,
+ OUT UINT32 *TCGFeatureFlags,
+ OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,
+ OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry
+ );
+
+/**
+ This service abstracts the capability to do a hash operation on a data buffer.
+
+ @param This Indicates the calling context.
+ @param HashData The pointer to the data buffer to be hashed.
+ @param HashDataLen The length of the data buffer to be hashed.
+ @param AlgorithmId Identification of the Algorithm to use for the hashing operation.
+ @param HashedDataLen Resultant length of the hashed data.
+ @param HashedDataResult Resultant buffer of the hashed data.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER HashDataLen is NULL.
+ @retval EFI_INVALID_PARAMETER HashDataLenResult is NULL.
+ @retval EFI_OUT_OF_RESOURCES Cannot allocate buffer of size *HashedDataLen.
+ @retval EFI_UNSUPPORTED AlgorithmId not supported.
+ @retval EFI_BUFFER_TOO_SMALL *HashedDataLen < sizeof (TCG_DIGEST).
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_HASH_ALL)(
+ IN EFI_TCG_PROTOCOL *This,
+ IN UINT8 *HashData,
+ IN UINT64 HashDataLen,
+ IN TCG_ALGORITHM_ID AlgorithmId,
+ IN OUT UINT64 *HashedDataLen,
+ IN OUT UINT8 **HashedDataResult
+ );
+
+/**
+ This service abstracts the capability to add an entry to the Event Log.
+
+ @param This Indicates the calling context
+ @param TCGLogData The pointer to the start of the data buffer containing
+ the TCG_PCR_EVENT data structure. All fields in
+ this structure are properly filled by the caller.
+ @param EventNumber The event number of the event just logged.
+ @param Flags Indicates additional flags. Only one flag has been
+ defined at this time, which is 0x01 and means the
+ extend operation should not be performed. All
+ other bits are reserved.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_OUT_OF_RESOURCES Insufficient memory in the event log to complete this action.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_LOG_EVENT)(
+ IN EFI_TCG_PROTOCOL *This,
+ IN TCG_PCR_EVENT *TCGLogData,
+ IN OUT UINT32 *EventNumber,
+ IN UINT32 Flags
+ );
+
+/**
+ This service is a proxy for commands to the TPM.
+
+ @param This Indicates the calling context.
+ @param TpmInputParameterBlockSize Size of the TPM input parameter block.
+ @param TpmInputParameterBlock The pointer to the TPM input parameter block.
+ @param TpmOutputParameterBlockSize Size of the TPM output parameter block.
+ @param TpmOutputParameterBlock The pointer to the TPM output parameter block.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER Invalid ordinal.
+ @retval EFI_UNSUPPORTED Current Task Priority Level >= EFI_TPL_CALLBACK.
+ @retval EFI_TIMEOUT The TIS timed-out.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_PASS_THROUGH_TO_TPM)(
+ IN EFI_TCG_PROTOCOL *This,
+ IN UINT32 TpmInputParameterBlockSize,
+ IN UINT8 *TpmInputParameterBlock,
+ IN UINT32 TpmOutputParameterBlockSize,
+ IN UINT8 *TpmOutputParameterBlock
+ );
+
+/**
+ This service abstracts the capability to do a hash operation on a data buffer, extend a specific TPM PCR with the hash result, and add an entry to the Event Log
+
+ @param This Indicates the calling context
+ @param HashData The physical address of the start of the data buffer
+ to be hashed, extended, and logged.
+ @param HashDataLen The length, in bytes, of the buffer referenced by HashData
+ @param AlgorithmId Identification of the Algorithm to use for the hashing operation
+ @param TCGLogData The physical address of the start of the data
+ buffer containing the TCG_PCR_EVENT data structure.
+ @param EventNumber The event number of the event just logged.
+ @param EventLogLastEntry The physical address of the first byte of the entry
+ just placed in the Event Log. If the Event Log was
+ empty when this function was called then this physical
+ address will be the same as the physical address of
+ the start of the Event Log.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_UNSUPPORTED AlgorithmId != TPM_ALG_SHA.
+ @retval EFI_UNSUPPORTED Current TPL >= EFI_TPL_CALLBACK.
+ @retval EFI_DEVICE_ERROR The command was unsuccessful.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_HASH_LOG_EXTEND_EVENT)(
+ IN EFI_TCG_PROTOCOL *This,
+ IN EFI_PHYSICAL_ADDRESS HashData,
+ IN UINT64 HashDataLen,
+ IN TCG_ALGORITHM_ID AlgorithmId,
+ IN OUT TCG_PCR_EVENT *TCGLogData,
+ IN OUT UINT32 *EventNumber,
+ OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry
+ );
+
+///
+/// The EFI_TCG Protocol abstracts TCG activity.
+///
+struct _EFI_TCG_PROTOCOL {
+ EFI_TCG_STATUS_CHECK StatusCheck;
+ EFI_TCG_HASH_ALL HashAll;
+ EFI_TCG_LOG_EVENT LogEvent;
+ EFI_TCG_PASS_THROUGH_TO_TPM PassThroughToTpm;
+ EFI_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent;
+};
+
+extern EFI_GUID gEfiTcgProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tcp4.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tcp4.h
new file mode 100644
index 0000000000..49d279b013
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tcp4.h
@@ -0,0 +1,577 @@
+/** @file
+ EFI TCPv4(Transmission Control Protocol version 4) Protocol Definition
+ The EFI TCPv4 Service Binding Protocol is used to locate EFI TCPv4 Protocol drivers to create
+ and destroy child of the driver to communicate with other host using TCP protocol.
+ The EFI TCPv4 Protocol provides services to send and receive data stream.
+
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.0.
+
+**/
+
+#ifndef __EFI_TCP4_PROTOCOL_H__
+#define __EFI_TCP4_PROTOCOL_H__
+
+#include <Protocol/Ip4.h>
+
+#define EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0x00720665, 0x67EB, 0x4a99, {0xBA, 0xF7, 0xD3, 0xC3, 0x3A, 0x1C, 0x7C, 0xC9 } \
+ }
+
+#define EFI_TCP4_PROTOCOL_GUID \
+ { \
+ 0x65530BC7, 0xA359, 0x410f, {0xB0, 0x10, 0x5A, 0xAD, 0xC7, 0xEC, 0x2B, 0x62 } \
+ }
+
+typedef struct _EFI_TCP4_PROTOCOL EFI_TCP4_PROTOCOL;
+
+///
+/// EFI_TCP4_SERVICE_POINT is deprecated in the UEFI 2.4B and should not be used any more.
+/// The definition in here is only present to provide backwards compatability.
+///
+typedef struct {
+ EFI_HANDLE InstanceHandle;
+ EFI_IPv4_ADDRESS LocalAddress;
+ UINT16 LocalPort;
+ EFI_IPv4_ADDRESS RemoteAddress;
+ UINT16 RemotePort;
+} EFI_TCP4_SERVICE_POINT;
+
+///
+/// EFI_TCP4_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more.
+/// The definition in here is only present to provide backwards compatability.
+///
+typedef struct {
+ EFI_HANDLE DriverHandle;
+ UINT32 ServiceCount;
+ EFI_TCP4_SERVICE_POINT Services[1];
+} EFI_TCP4_VARIABLE_DATA;
+
+typedef struct {
+ BOOLEAN UseDefaultAddress;
+ EFI_IPv4_ADDRESS StationAddress;
+ EFI_IPv4_ADDRESS SubnetMask;
+ UINT16 StationPort;
+ EFI_IPv4_ADDRESS RemoteAddress;
+ UINT16 RemotePort;
+ BOOLEAN ActiveFlag;
+} EFI_TCP4_ACCESS_POINT;
+
+typedef struct {
+ UINT32 ReceiveBufferSize;
+ UINT32 SendBufferSize;
+ UINT32 MaxSynBackLog;
+ UINT32 ConnectionTimeout;
+ UINT32 DataRetries;
+ UINT32 FinTimeout;
+ UINT32 TimeWaitTimeout;
+ UINT32 KeepAliveProbes;
+ UINT32 KeepAliveTime;
+ UINT32 KeepAliveInterval;
+ BOOLEAN EnableNagle;
+ BOOLEAN EnableTimeStamp;
+ BOOLEAN EnableWindowScaling;
+ BOOLEAN EnableSelectiveAck;
+ BOOLEAN EnablePathMtuDiscovery;
+} EFI_TCP4_OPTION;
+
+typedef struct {
+ //
+ // I/O parameters
+ //
+ UINT8 TypeOfService;
+ UINT8 TimeToLive;
+
+ //
+ // Access Point
+ //
+ EFI_TCP4_ACCESS_POINT AccessPoint;
+
+ //
+ // TCP Control Options
+ //
+ EFI_TCP4_OPTION *ControlOption;
+} EFI_TCP4_CONFIG_DATA;
+
+///
+/// TCP4 connnection state
+///
+typedef enum {
+ Tcp4StateClosed = 0,
+ Tcp4StateListen = 1,
+ Tcp4StateSynSent = 2,
+ Tcp4StateSynReceived = 3,
+ Tcp4StateEstablished = 4,
+ Tcp4StateFinWait1 = 5,
+ Tcp4StateFinWait2 = 6,
+ Tcp4StateClosing = 7,
+ Tcp4StateTimeWait = 8,
+ Tcp4StateCloseWait = 9,
+ Tcp4StateLastAck = 10
+} EFI_TCP4_CONNECTION_STATE;
+
+typedef struct {
+ EFI_EVENT Event;
+ EFI_STATUS Status;
+} EFI_TCP4_COMPLETION_TOKEN;
+
+typedef struct {
+ ///
+ /// The Status in the CompletionToken will be set to one of
+ /// the following values if the active open succeeds or an unexpected
+ /// error happens:
+ /// EFI_SUCCESS: The active open succeeds and the instance's
+ /// state is Tcp4StateEstablished.
+ /// EFI_CONNECTION_RESET: The connect fails because the connection is reset
+ /// either by instance itself or the communication peer.
+ /// EFI_CONNECTION_REFUSED: The connect fails because this connection is initiated with
+ /// an active open and the connection is refused.
+ /// EFI_ABORTED: The active open is aborted.
+ /// EFI_TIMEOUT: The connection establishment timer expires and
+ /// no more specific information is available.
+ /// EFI_NETWORK_UNREACHABLE: The active open fails because
+ /// an ICMP network unreachable error is received.
+ /// EFI_HOST_UNREACHABLE: The active open fails because an
+ /// ICMP host unreachable error is received.
+ /// EFI_PROTOCOL_UNREACHABLE: The active open fails
+ /// because an ICMP protocol unreachable error is received.
+ /// EFI_PORT_UNREACHABLE: The connection establishment
+ /// timer times out and an ICMP port unreachable error is received.
+ /// EFI_ICMP_ERROR: The connection establishment timer timeout and some other ICMP
+ /// error is received.
+ /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.
+ /// EFI_NO_MEDIA: There was a media error.
+ ///
+ EFI_TCP4_COMPLETION_TOKEN CompletionToken;
+} EFI_TCP4_CONNECTION_TOKEN;
+
+typedef struct {
+ EFI_TCP4_COMPLETION_TOKEN CompletionToken;
+ EFI_HANDLE NewChildHandle;
+} EFI_TCP4_LISTEN_TOKEN;
+
+typedef struct {
+ UINT32 FragmentLength;
+ VOID *FragmentBuffer;
+} EFI_TCP4_FRAGMENT_DATA;
+
+typedef struct {
+ BOOLEAN UrgentFlag;
+ UINT32 DataLength;
+ UINT32 FragmentCount;
+ EFI_TCP4_FRAGMENT_DATA FragmentTable[1];
+} EFI_TCP4_RECEIVE_DATA;
+
+typedef struct {
+ BOOLEAN Push;
+ BOOLEAN Urgent;
+ UINT32 DataLength;
+ UINT32 FragmentCount;
+ EFI_TCP4_FRAGMENT_DATA FragmentTable[1];
+} EFI_TCP4_TRANSMIT_DATA;
+
+typedef struct {
+ ///
+ /// When transmission finishes or meets any unexpected error it will
+ /// be set to one of the following values:
+ /// EFI_SUCCESS: The receiving or transmission operation
+ /// completes successfully.
+ /// EFI_CONNECTION_FIN: The receiving operation fails because the communication peer
+ /// has closed the connection and there is no more data in the
+ /// receive buffer of the instance.
+ /// EFI_CONNECTION_RESET: The receiving or transmission operation fails
+ /// because this connection is reset either by instance
+ /// itself or the communication peer.
+ /// EFI_ABORTED: The receiving or transmission is aborted.
+ /// EFI_TIMEOUT: The transmission timer expires and no more
+ /// specific information is available.
+ /// EFI_NETWORK_UNREACHABLE: The transmission fails
+ /// because an ICMP network unreachable error is received.
+ /// EFI_HOST_UNREACHABLE: The transmission fails because an
+ /// ICMP host unreachable error is received.
+ /// EFI_PROTOCOL_UNREACHABLE: The transmission fails
+ /// because an ICMP protocol unreachable error is received.
+ /// EFI_PORT_UNREACHABLE: The transmission fails and an
+ /// ICMP port unreachable error is received.
+ /// EFI_ICMP_ERROR: The transmission fails and some other
+ /// ICMP error is received.
+ /// EFI_DEVICE_ERROR: An unexpected system or network error occurs.
+ /// EFI_NO_MEDIA: There was a media error.
+ ///
+ EFI_TCP4_COMPLETION_TOKEN CompletionToken;
+ union {
+ ///
+ /// When this token is used for receiving, RxData is a pointer to EFI_TCP4_RECEIVE_DATA.
+ ///
+ EFI_TCP4_RECEIVE_DATA *RxData;
+ ///
+ /// When this token is used for transmitting, TxData is a pointer to EFI_TCP4_TRANSMIT_DATA.
+ ///
+ EFI_TCP4_TRANSMIT_DATA *TxData;
+ } Packet;
+} EFI_TCP4_IO_TOKEN;
+
+typedef struct {
+ EFI_TCP4_COMPLETION_TOKEN CompletionToken;
+ BOOLEAN AbortOnClose;
+} EFI_TCP4_CLOSE_TOKEN;
+
+//
+// Interface definition for TCP4 protocol
+//
+
+/**
+ Get the current operational status.
+
+ @param This The pointer to the EFI_TCP4_PROTOCOL instance.
+ @param Tcp4State The pointer to the buffer to receive the current TCP state.
+ @param Tcp4ConfigData The pointer to the buffer to receive the current TCP configuration.
+ @param Ip4ModeData The pointer to the buffer to receive the current IPv4 configuration
+ data used by the TCPv4 instance.
+ @param MnpConfigData The pointer to the buffer to receive the current MNP configuration
+ data used indirectly by the TCPv4 instance.
+ @param SnpModeData The pointer to the buffer to receive the current SNP configuration
+ data used indirectly by the TCPv4 instance.
+
+ @retval EFI_SUCCESS The mode data was read.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_STARTED No configuration data is available because this instance hasn't
+ been started.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP4_GET_MODE_DATA)(
+ IN EFI_TCP4_PROTOCOL *This,
+ OUT EFI_TCP4_CONNECTION_STATE *Tcp4State OPTIONAL,
+ OUT EFI_TCP4_CONFIG_DATA *Tcp4ConfigData OPTIONAL,
+ OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,
+ OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
+ OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
+ );
+
+/**
+ Initialize or brutally reset the operational parameters for this EFI TCPv4 instance.
+
+ @param This The pointer to the EFI_TCP4_PROTOCOL instance.
+ @param Tcp4ConfigData The pointer to the configure data to configure the instance.
+
+ @retval EFI_SUCCESS The operational settings are set, changed, or reset
+ successfully.
+ @retval EFI_INVALID_PARAMETER Some parameter is invalid.
+ @retval EFI_NO_MAPPING When using a default address, configuration (through
+ DHCP, BOOTP, RARP, etc.) is not finished yet.
+ @retval EFI_ACCESS_DENIED Configuring TCP instance when it is configured without
+ calling Configure() with NULL to reset it.
+ @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
+ @retval EFI_UNSUPPORTED One or more of the control options are not supported in
+ the implementation.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources when
+ executing Configure().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP4_CONFIGURE)(
+ IN EFI_TCP4_PROTOCOL *This,
+ IN EFI_TCP4_CONFIG_DATA *TcpConfigData OPTIONAL
+ );
+
+
+/**
+ Add or delete a route entry to the route table
+
+ @param This The pointer to the EFI_TCP4_PROTOCOL instance.
+ @param DeleteRoute Set it to TRUE to delete this route from the routing table. Set it to
+ FALSE to add this route to the routing table.
+ DestinationAddress and SubnetMask are used as the
+ keywords to search route entry.
+ @param SubnetAddress The destination network.
+ @param SubnetMask The subnet mask of the destination network.
+ @param GatewayAddress The gateway address for this route. It must be on the same
+ subnet with the station address unless a direct route is specified.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_NOT_STARTED The EFI TCPv4 Protocol instance has not been configured.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - SubnetAddress is NULL.
+ - SubnetMask is NULL.
+ - GatewayAddress is NULL.
+ - *SubnetAddress is not NULL a valid subnet address.
+ - *SubnetMask is not a valid subnet mask.
+ - *GatewayAddress is not a valid unicast IP address or it
+ is not in the same subnet.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough resources to add the entry to the
+ routing table.
+ @retval EFI_NOT_FOUND This route is not in the routing table.
+ @retval EFI_ACCESS_DENIED The route is already defined in the routing table.
+ @retval EFI_UNSUPPORTED The TCP driver does not support this operation.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP4_ROUTES)(
+ IN EFI_TCP4_PROTOCOL *This,
+ IN BOOLEAN DeleteRoute,
+ IN EFI_IPv4_ADDRESS *SubnetAddress,
+ IN EFI_IPv4_ADDRESS *SubnetMask,
+ IN EFI_IPv4_ADDRESS *GatewayAddress
+ );
+
+/**
+ Initiate a nonblocking TCP connection request for an active TCP instance.
+
+ @param This The pointer to the EFI_TCP4_PROTOCOL instance.
+ @param ConnectionToken The pointer to the connection token to return when the TCP three
+ way handshake finishes.
+
+ @retval EFI_SUCCESS The connection request is successfully initiated and the state
+ of this TCPv4 instance has been changed to Tcp4StateSynSent.
+ @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.
+ @retval EFI_ACCESS_DENIED One or more of the following conditions are TRUE:
+ - This instance is not configured as an active one.
+ - This instance is not in Tcp4StateClosed state.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ - ConnectionToken is NULL.
+ - ConnectionToken->CompletionToken.Event is NULL.
+ @retval EFI_OUT_OF_RESOURCES The driver can't allocate enough resource to initiate the activ eopen.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP4_CONNECT)(
+ IN EFI_TCP4_PROTOCOL *This,
+ IN EFI_TCP4_CONNECTION_TOKEN *ConnectionToken
+ );
+
+
+/**
+ Listen on the passive instance to accept an incoming connection request. This is a nonblocking operation.
+
+ @param This The pointer to the EFI_TCP4_PROTOCOL instance.
+ @param ListenToken The pointer to the listen token to return when operation finishes.
+
+ @retval EFI_SUCCESS The listen token has been queued successfully.
+ @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.
+ @retval EFI_ACCESS_DENIED One or more of the following are TRUE:
+ - This instance is not a passive instance.
+ - This instance is not in Tcp4StateListen state.
+ - The same listen token has already existed in the listen
+ token queue of this TCP instance.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ - ListenToken is NULL.
+ - ListentToken->CompletionToken.Event is NULL.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.
+ @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP4_ACCEPT)(
+ IN EFI_TCP4_PROTOCOL *This,
+ IN EFI_TCP4_LISTEN_TOKEN *ListenToken
+ );
+
+/**
+ Queues outgoing data into the transmit queue.
+
+ @param This The pointer to the EFI_TCP4_PROTOCOL instance.
+ @param Token The pointer to the completion token to queue to the transmit queue.
+
+ @retval EFI_SUCCESS The data has been queued for transmission.
+ @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token->CompletionToken.Event is NULL.
+ - Token->Packet.TxData is NULL L.
+ - Token->Packet.FragmentCount is zero.
+ - Token->Packet.DataLength is not equal to the sum of fragment lengths.
+ @retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE:
+ - A transmit completion token with the same Token->CompletionToken.Event
+ was already in the transmission queue.
+ - The current instance is in Tcp4StateClosed state.
+ - The current instance is a passive one and it is in
+ Tcp4StateListen state.
+ - User has called Close() to disconnect this connection.
+ @retval EFI_NOT_READY The completion token could not be queued because the
+ transmit queue is full.
+ @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data because of resource
+ shortage.
+ @retval EFI_NETWORK_UNREACHABLE There is no route to the destination network or address.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP4_TRANSMIT)(
+ IN EFI_TCP4_PROTOCOL *This,
+ IN EFI_TCP4_IO_TOKEN *Token
+ );
+
+
+/**
+ Places an asynchronous receive request into the receiving queue.
+
+ @param This The pointer to the EFI_TCP4_PROTOCOL instance.
+ @param Token The pointer to a token that is associated with the receive data
+ descriptor.
+
+ @retval EFI_SUCCESS The receive completion token was cached.
+ @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, RARP,
+ etc.) is not finished yet.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token->CompletionToken.Event is NULL.
+ - Token->Packet.RxData is NULL.
+ - Token->Packet.RxData->DataLength is 0.
+ - The Token->Packet.RxData->DataLength is not
+ the sum of all FragmentBuffer length in FragmentTable.
+ @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of
+ system resources (usually memory).
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE:
+ - A receive completion token with the same Token-
+ >CompletionToken.Event was already in the receive
+ queue.
+ - The current instance is in Tcp4StateClosed state.
+ - The current instance is a passive one and it is in
+ Tcp4StateListen state.
+ - User has called Close() to disconnect this connection.
+ @retval EFI_CONNECTION_FIN The communication peer has closed the connection and there is
+ no any buffered data in the receive buffer of this instance.
+ @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP4_RECEIVE)(
+ IN EFI_TCP4_PROTOCOL *This,
+ IN EFI_TCP4_IO_TOKEN *Token
+ );
+
+/**
+ Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a
+ nonblocking operation.
+
+ @param This The pointer to the EFI_TCP4_PROTOCOL instance.
+ @param CloseToken The pointer to the close token to return when operation finishes.
+
+ @retval EFI_SUCCESS The Close() is called successfully.
+ @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.
+ @retval EFI_ACCESS_DENIED One or more of the following are TRUE:
+ - Configure() has been called with
+ TcpConfigData set to NULL and this function has
+ not returned.
+ - Previous Close() call on this instance has not
+ finished.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ - CloseToken is NULL.
+ - CloseToken->CompletionToken.Event is NULL.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.
+ @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP4_CLOSE)(
+ IN EFI_TCP4_PROTOCOL *This,
+ IN EFI_TCP4_CLOSE_TOKEN *CloseToken
+ );
+
+/**
+ Abort an asynchronous connection, listen, transmission or receive request.
+
+ @param This The pointer to the EFI_TCP4_PROTOCOL instance.
+ @param Token The pointer to a token that has been issued by
+ EFI_TCP4_PROTOCOL.Connect(),
+ EFI_TCP4_PROTOCOL.Accept(),
+ EFI_TCP4_PROTOCOL.Transmit() or
+ EFI_TCP4_PROTOCOL.Receive(). If NULL, all pending
+ tokens issued by above four functions will be aborted. Type
+ EFI_TCP4_COMPLETION_TOKEN is defined in
+ EFI_TCP4_PROTOCOL.Connect().
+
+ @retval EFI_SUCCESS The asynchronous I/O request is aborted and Token->Event
+ is signaled.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_STARTED This instance hasn't been configured.
+ @retval EFI_NO_MAPPING When using the default address, configuration
+ (DHCP, BOOTP,RARP, etc.) hasn't finished yet.
+ @retval EFI_NOT_FOUND The asynchronous I/O request isn't found in the
+ transmission or receive queue. It has either
+ completed or wasn't issued by Transmit() and Receive().
+ @retval EFI_UNSUPPORTED The implementation does not support this function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP4_CANCEL)(
+ IN EFI_TCP4_PROTOCOL *This,
+ IN EFI_TCP4_COMPLETION_TOKEN *Token OPTIONAL
+ );
+
+
+/**
+ Poll to receive incoming data and transmit outgoing segments.
+
+ @param This The pointer to the EFI_TCP4_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_NOT_READY No incoming or outgoing data is processed.
+ @retval EFI_TIMEOUT Data was dropped out of the transmission or receive queue.
+ Consider increasing the polling rate.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP4_POLL)(
+ IN EFI_TCP4_PROTOCOL *This
+ );
+
+///
+/// The EFI_TCP4_PROTOCOL defines the EFI TCPv4 Protocol child to be used by
+/// any network drivers or applications to send or receive data stream.
+/// It can either listen on a specified port as a service or actively connected
+/// to remote peer as a client. Each instance has its own independent settings,
+/// such as the routing table.
+///
+struct _EFI_TCP4_PROTOCOL {
+ EFI_TCP4_GET_MODE_DATA GetModeData;
+ EFI_TCP4_CONFIGURE Configure;
+ EFI_TCP4_ROUTES Routes;
+ EFI_TCP4_CONNECT Connect;
+ EFI_TCP4_ACCEPT Accept;
+ EFI_TCP4_TRANSMIT Transmit;
+ EFI_TCP4_RECEIVE Receive;
+ EFI_TCP4_CLOSE Close;
+ EFI_TCP4_CANCEL Cancel;
+ EFI_TCP4_POLL Poll;
+};
+
+extern EFI_GUID gEfiTcp4ServiceBindingProtocolGuid;
+extern EFI_GUID gEfiTcp4ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tcp6.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tcp6.h
new file mode 100644
index 0000000000..b725391518
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tcp6.h
@@ -0,0 +1,864 @@
+/** @file
+ EFI TCPv6(Transmission Control Protocol version 6) Protocol Definition
+ The EFI TCPv6 Service Binding Protocol is used to locate EFI TCPv6 Protocol drivers to create
+ and destroy child of the driver to communicate with other host using TCP protocol.
+ The EFI TCPv6 Protocol provides services to send and receive data stream.
+
+ Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.2
+
+**/
+
+#ifndef __EFI_TCP6_PROTOCOL_H__
+#define __EFI_TCP6_PROTOCOL_H__
+
+#include <Protocol/ManagedNetwork.h>
+#include <Protocol/Ip6.h>
+
+#define EFI_TCP6_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0xec20eb79, 0x6c1a, 0x4664, {0x9a, 0x0d, 0xd2, 0xe4, 0xcc, 0x16, 0xd6, 0x64 } \
+ }
+
+#define EFI_TCP6_PROTOCOL_GUID \
+ { \
+ 0x46e44855, 0xbd60, 0x4ab7, {0xab, 0x0d, 0xa6, 0x79, 0xb9, 0x44, 0x7d, 0x77 } \
+ }
+
+
+typedef struct _EFI_TCP6_PROTOCOL EFI_TCP6_PROTOCOL;
+
+///
+/// EFI_TCP6_SERVICE_POINT is deprecated in the UEFI 2.4B and should not be used any more.
+/// The definition in here is only present to provide backwards compatability.
+///
+typedef struct {
+ ///
+ /// The EFI TCPv6 Protocol instance handle that is using this
+ /// address/port pair.
+ ///
+ EFI_HANDLE InstanceHandle;
+ ///
+ /// The local IPv6 address to which this TCP instance is bound. Set
+ /// to 0::/128, if this TCP instance is configured to listen on all
+ /// available source addresses.
+ ///
+ EFI_IPv6_ADDRESS LocalAddress;
+ ///
+ /// The local port number in host byte order.
+ ///
+ UINT16 LocalPort;
+ ///
+ /// The remote IPv6 address. It may be 0::/128 if this TCP instance is
+ /// not connected to any remote host.
+ ///
+ EFI_IPv6_ADDRESS RemoteAddress;
+ ///
+ /// The remote port number in host byte order. It may be zero if this
+ /// TCP instance is not connected to any remote host.
+ ///
+ UINT16 RemotePort;
+} EFI_TCP6_SERVICE_POINT;
+
+///
+/// EFI_TCP6_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more.
+/// The definition in here is only present to provide backwards compatability.
+///
+typedef struct {
+ EFI_HANDLE DriverHandle; ///< The handle of the driver that creates this entry.
+ UINT32 ServiceCount; ///< The number of address/port pairs following this data structure.
+ EFI_TCP6_SERVICE_POINT Services[1]; ///< List of address/port pairs that are currently in use.
+} EFI_TCP6_VARIABLE_DATA;
+
+///
+/// EFI_TCP6_ACCESS_POINT
+///
+typedef struct {
+ ///
+ /// The local IP address assigned to this TCP instance. The EFI
+ /// TCPv6 driver will only deliver incoming packets whose
+ /// destination addresses exactly match the IP address. Set to zero to
+ /// let the underlying IPv6 driver choose a source address. If not zero
+ /// it must be one of the configured IP addresses in the underlying
+ /// IPv6 driver.
+ ///
+ EFI_IPv6_ADDRESS StationAddress;
+ ///
+ /// The local port number to which this EFI TCPv6 Protocol instance
+ /// is bound. If the instance doesn't care the local port number, set
+ /// StationPort to zero to use an ephemeral port.
+ ///
+ UINT16 StationPort;
+ ///
+ /// The remote IP address to which this EFI TCPv6 Protocol instance
+ /// is connected. If ActiveFlag is FALSE (i.e. a passive TCPv6
+ /// instance), the instance only accepts connections from the
+ /// RemoteAddress. If ActiveFlag is TRUE the instance will
+ /// connect to the RemoteAddress, i.e., outgoing segments will be
+ /// sent to this address and only segments from this address will be
+ /// delivered to the application. When ActiveFlag is FALSE, it
+ /// can be set to zero and means that incoming connection requests
+ /// from any address will be accepted.
+ ///
+ EFI_IPv6_ADDRESS RemoteAddress;
+ ///
+ /// The remote port to which this EFI TCPv6 Protocol instance
+ /// connects or from which connection request will be accepted by
+ /// this EFI TCPv6 Protocol instance. If ActiveFlag is FALSE it
+ /// can be zero and means that incoming connection request from
+ /// any port will be accepted. Its value can not be zero when
+ /// ActiveFlag is TRUE.
+ ///
+ UINT16 RemotePort;
+ ///
+ /// Set it to TRUE to initiate an active open. Set it to FALSE to
+ /// initiate a passive open to act as a server.
+ ///
+ BOOLEAN ActiveFlag;
+} EFI_TCP6_ACCESS_POINT;
+
+///
+/// EFI_TCP6_OPTION
+///
+typedef struct {
+ ///
+ /// The size of the TCP receive buffer.
+ ///
+ UINT32 ReceiveBufferSize;
+ ///
+ /// The size of the TCP send buffer.
+ ///
+ UINT32 SendBufferSize;
+ ///
+ /// The length of incoming connect request queue for a passive
+ /// instance. When set to zero, the value is implementation specific.
+ ///
+ UINT32 MaxSynBackLog;
+ ///
+ /// The maximum seconds a TCP instance will wait for before a TCP
+ /// connection established. When set to zero, the value is
+ /// implementation specific.
+ ///
+ UINT32 ConnectionTimeout;
+ ///
+ ///The number of times TCP will attempt to retransmit a packet on
+ ///an established connection. When set to zero, the value is
+ ///implementation specific.
+ ///
+ UINT32 DataRetries;
+ ///
+ /// How many seconds to wait in the FIN_WAIT_2 states for a final
+ /// FIN flag before the TCP instance is closed. This timeout is in
+ /// effective only if the application has called Close() to
+ /// disconnect the connection completely. It is also called
+ /// FIN_WAIT_2 timer in other implementations. When set to zero,
+ /// it should be disabled because the FIN_WAIT_2 timer itself is
+ /// against the standard. The default value is 60.
+ ///
+ UINT32 FinTimeout;
+ ///
+ /// How many seconds to wait in TIME_WAIT state before the TCP
+ /// instance is closed. The timer is disabled completely to provide a
+ /// method to close the TCP connection quickly if it is set to zero. It
+ /// is against the related RFC documents.
+ ///
+ UINT32 TimeWaitTimeout;
+ ///
+ /// The maximum number of TCP keep-alive probes to send before
+ /// giving up and resetting the connection if no response from the
+ /// other end. Set to zero to disable keep-alive probe.
+ ///
+ UINT32 KeepAliveProbes;
+ ///
+ /// The number of seconds a connection needs to be idle before TCP
+ /// sends out periodical keep-alive probes. When set to zero, the
+ /// value is implementation specific. It should be ignored if keep-
+ /// alive probe is disabled.
+ ///
+ UINT32 KeepAliveTime;
+ ///
+ /// The number of seconds between TCP keep-alive probes after the
+ /// periodical keep-alive probe if no response. When set to zero, the
+ /// value is implementation specific. It should be ignored if keep-
+ /// alive probe is disabled.
+ ///
+ UINT32 KeepAliveInterval;
+ ///
+ /// Set it to TRUE to enable the Nagle algorithm as defined in
+ /// RFC896. Set it to FALSE to disable it.
+ ///
+ BOOLEAN EnableNagle;
+ ///
+ /// Set it to TRUE to enable TCP timestamps option as defined in
+ /// RFC1323. Set to FALSE to disable it.
+ ///
+ BOOLEAN EnableTimeStamp;
+ ///
+ /// Set it to TRUE to enable TCP window scale option as defined in
+ /// RFC1323. Set it to FALSE to disable it.
+ ///
+ BOOLEAN EnableWindowScaling;
+ ///
+ /// Set it to TRUE to enable selective acknowledge mechanism
+ /// described in RFC 2018. Set it to FALSE to disable it.
+ /// Implementation that supports SACK can optionally support
+ /// DSAK as defined in RFC 2883.
+ ///
+ BOOLEAN EnableSelectiveAck;
+ ///
+ /// Set it to TRUE to enable path MTU discovery as defined in
+ /// RFC 1191. Set to FALSE to disable it.
+ ///
+ BOOLEAN EnablePathMtuDiscovery;
+} EFI_TCP6_OPTION;
+
+///
+/// EFI_TCP6_CONFIG_DATA
+///
+typedef struct {
+ ///
+ /// TrafficClass field in transmitted IPv6 packets.
+ ///
+ UINT8 TrafficClass;
+ ///
+ /// HopLimit field in transmitted IPv6 packets.
+ ///
+ UINT8 HopLimit;
+ ///
+ /// Used to specify TCP communication end settings for a TCP instance.
+ ///
+ EFI_TCP6_ACCESS_POINT AccessPoint;
+ ///
+ /// Used to configure the advance TCP option for a connection. If set
+ /// to NULL, implementation specific options for TCP connection will be used.
+ ///
+ EFI_TCP6_OPTION *ControlOption;
+} EFI_TCP6_CONFIG_DATA;
+
+///
+/// EFI_TCP6_CONNECTION_STATE
+///
+typedef enum {
+ Tcp6StateClosed = 0,
+ Tcp6StateListen = 1,
+ Tcp6StateSynSent = 2,
+ Tcp6StateSynReceived = 3,
+ Tcp6StateEstablished = 4,
+ Tcp6StateFinWait1 = 5,
+ Tcp6StateFinWait2 = 6,
+ Tcp6StateClosing = 7,
+ Tcp6StateTimeWait = 8,
+ Tcp6StateCloseWait = 9,
+ Tcp6StateLastAck = 10
+} EFI_TCP6_CONNECTION_STATE;
+
+///
+/// EFI_TCP6_COMPLETION_TOKEN
+/// is used as a common header for various asynchronous tokens.
+///
+typedef struct {
+ ///
+ /// The Event to signal after request is finished and Status field is
+ /// updated by the EFI TCPv6 Protocol driver.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// The result of the completed operation.
+ ///
+ EFI_STATUS Status;
+} EFI_TCP6_COMPLETION_TOKEN;
+
+///
+/// EFI_TCP6_CONNECTION_TOKEN
+/// will be set if the active open succeeds or an unexpected
+/// error happens.
+///
+typedef struct {
+ ///
+ /// The Status in the CompletionToken will be set to one of
+ /// the following values if the active open succeeds or an unexpected
+ /// error happens:
+ /// EFI_SUCCESS: The active open succeeds and the instance's
+ /// state is Tcp6StateEstablished.
+ /// EFI_CONNECTION_RESET: The connect fails because the connection is reset
+ /// either by instance itself or the communication peer.
+ /// EFI_CONNECTION_REFUSED: The receiving or transmission operation fails because this
+ /// connection is refused.
+ /// EFI_ABORTED: The active open is aborted.
+ /// EFI_TIMEOUT: The connection establishment timer expires and
+ /// no more specific information is available.
+ /// EFI_NETWORK_UNREACHABLE: The active open fails because
+ /// an ICMP network unreachable error is received.
+ /// EFI_HOST_UNREACHABLE: The active open fails because an
+ /// ICMP host unreachable error is received.
+ /// EFI_PROTOCOL_UNREACHABLE: The active open fails
+ /// because an ICMP protocol unreachable error is received.
+ /// EFI_PORT_UNREACHABLE: The connection establishment
+ /// timer times out and an ICMP port unreachable error is received.
+ /// EFI_ICMP_ERROR: The connection establishment timer times
+ /// out and some other ICMP error is received.
+ /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.
+ /// EFI_SECURITY_VIOLATION: The active open was failed because of IPSec policy check.
+ /// EFI_NO_MEDIA: There was a media error.
+ ///
+ EFI_TCP6_COMPLETION_TOKEN CompletionToken;
+} EFI_TCP6_CONNECTION_TOKEN;
+
+///
+/// EFI_TCP6_LISTEN_TOKEN
+/// returns when list operation finishes.
+///
+typedef struct {
+ ///
+ /// The Status in CompletionToken will be set to the
+ /// following value if accept finishes:
+ /// EFI_SUCCESS: A remote peer has successfully established a
+ /// connection to this instance. A new TCP instance has also been
+ /// created for the connection.
+ /// EFI_CONNECTION_RESET: The accept fails because the connection is reset either
+ /// by instance itself or communication peer.
+ /// EFI_ABORTED: The accept request has been aborted.
+ /// EFI_SECURITY_VIOLATION: The accept operation was failed because of IPSec policy check.
+ ///
+ EFI_TCP6_COMPLETION_TOKEN CompletionToken;
+ EFI_HANDLE NewChildHandle;
+} EFI_TCP6_LISTEN_TOKEN;
+
+///
+/// EFI_TCP6_FRAGMENT_DATA
+/// allows multiple receive or transmit buffers to be specified. The
+/// purpose of this structure is to provide scattered read and write.
+///
+typedef struct {
+ UINT32 FragmentLength; ///< Length of data buffer in the fragment.
+ VOID *FragmentBuffer; ///< Pointer to the data buffer in the fragment.
+} EFI_TCP6_FRAGMENT_DATA;
+
+///
+/// EFI_TCP6_RECEIVE_DATA
+/// When TCPv6 driver wants to deliver received data to the application,
+/// it will pick up the first queued receiving token, update its
+/// Token->Packet.RxData then signal the Token->CompletionToken.Event.
+///
+typedef struct {
+ ///
+ /// Whether the data is urgent. When this flag is set, the instance is in
+ /// urgent mode.
+ ///
+ BOOLEAN UrgentFlag;
+ ///
+ /// When calling Receive() function, it is the byte counts of all
+ /// Fragmentbuffer in FragmentTable allocated by user.
+ /// When the token is signaled by TCPv6 driver it is the length of
+ /// received data in the fragments.
+ ///
+ UINT32 DataLength;
+ ///
+ /// Number of fragments.
+ ///
+ UINT32 FragmentCount;
+ ///
+ /// An array of fragment descriptors.
+ ///
+ EFI_TCP6_FRAGMENT_DATA FragmentTable[1];
+} EFI_TCP6_RECEIVE_DATA;
+
+///
+/// EFI_TCP6_TRANSMIT_DATA
+/// The EFI TCPv6 Protocol user must fill this data structure before sending a packet.
+/// The packet may contain multiple buffers in non-continuous memory locations.
+///
+typedef struct {
+ ///
+ /// Push If TRUE, data must be transmitted promptly, and the PUSH bit in
+ /// the last TCP segment created will be set. If FALSE, data
+ /// transmission may be delayed to combine with data from
+ /// subsequent Transmit()s for efficiency.
+ ///
+ BOOLEAN Push;
+ ///
+ /// The data in the fragment table are urgent and urgent point is in
+ /// effect if TRUE. Otherwise those data are NOT considered urgent.
+ ///
+ BOOLEAN Urgent;
+ ///
+ /// Length of the data in the fragments.
+ ///
+ UINT32 DataLength;
+ ///
+ /// Number of fragments.
+ ///
+ UINT32 FragmentCount;
+ ///
+ /// An array of fragment descriptors.
+ ///
+ EFI_TCP6_FRAGMENT_DATA FragmentTable[1];
+} EFI_TCP6_TRANSMIT_DATA;
+
+///
+/// EFI_TCP6_IO_TOKEN
+/// returns When transmission finishes or meets any unexpected error.
+///
+typedef struct {
+ ///
+ /// When transmission finishes or meets any unexpected error it will
+ /// be set to one of the following values:
+ /// EFI_SUCCESS: The receiving or transmission operation
+ /// completes successfully.
+ /// EFI_CONNECTION_FIN: The receiving operation fails because the communication peer
+ /// has closed the connection and there is no more data in the
+ /// receive buffer of the instance.
+ /// EFI_CONNECTION_RESET: The receiving or transmission operation fails
+ /// because this connection is reset either by instance
+ /// itself or the communication peer.
+ /// EFI_ABORTED: The receiving or transmission is aborted.
+ /// EFI_TIMEOUT: The transmission timer expires and no more
+ /// specific information is available.
+ /// EFI_NETWORK_UNREACHABLE: The transmission fails
+ /// because an ICMP network unreachable error is received.
+ /// EFI_HOST_UNREACHABLE: The transmission fails because an
+ /// ICMP host unreachable error is received.
+ /// EFI_PROTOCOL_UNREACHABLE: The transmission fails
+ /// because an ICMP protocol unreachable error is received.
+ /// EFI_PORT_UNREACHABLE: The transmission fails and an
+ /// ICMP port unreachable error is received.
+ /// EFI_ICMP_ERROR: The transmission fails and some other
+ /// ICMP error is received.
+ /// EFI_DEVICE_ERROR: An unexpected system or network error occurs.
+ /// EFI_SECURITY_VIOLATION: The receiving or transmission
+ /// operation was failed because of IPSec policy check
+ /// EFI_NO_MEDIA: There was a media error.
+ ///
+ EFI_TCP6_COMPLETION_TOKEN CompletionToken;
+ union {
+ ///
+ /// When this token is used for receiving, RxData is a pointer to
+ /// EFI_TCP6_RECEIVE_DATA.
+ ///
+ EFI_TCP6_RECEIVE_DATA *RxData;
+ ///
+ /// When this token is used for transmitting, TxData is a pointer to
+ /// EFI_TCP6_TRANSMIT_DATA.
+ ///
+ EFI_TCP6_TRANSMIT_DATA *TxData;
+ } Packet;
+} EFI_TCP6_IO_TOKEN;
+
+///
+/// EFI_TCP6_CLOSE_TOKEN
+/// returns when close operation finishes.
+///
+typedef struct {
+ ///
+ /// When close finishes or meets any unexpected error it will be set
+ /// to one of the following values:
+ /// EFI_SUCCESS: The close operation completes successfully.
+ /// EFI_ABORTED: User called configure with NULL without close stopping.
+ /// EFI_SECURITY_VIOLATION: The close operation was failed because of IPSec policy check.
+ ///
+ EFI_TCP6_COMPLETION_TOKEN CompletionToken;
+ ///
+ /// Abort the TCP connection on close instead of the standard TCP
+ /// close process when it is set to TRUE. This option can be used to
+ /// satisfy a fast disconnect.
+ ///
+ BOOLEAN AbortOnClose;
+} EFI_TCP6_CLOSE_TOKEN;
+
+/**
+ Get the current operational status.
+
+ The GetModeData() function copies the current operational settings of this EFI TCPv6
+ Protocol instance into user-supplied buffers. This function can also be used to retrieve
+ the operational setting of underlying drivers such as IPv6, MNP, or SNP.
+
+ @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.
+ @param[out] Tcp6State The buffer in which the current TCP state is returned.
+ @param[out] Tcp6ConfigData The buffer in which the current TCP configuration is returned.
+ @param[out] Ip6ModeData The buffer in which the current IPv6 configuration data used by
+ the TCP instance is returned.
+ @param[out] MnpConfigData The buffer in which the current MNP configuration data used
+ indirectly by the TCP instance is returned.
+ @param[out] SnpModeData The buffer in which the current SNP mode data used indirectly by
+ the TCP instance is returned.
+
+ @retval EFI_SUCCESS The mode data was read.
+ @retval EFI_NOT_STARTED No configuration data is available because this instance hasn't
+ been started.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP6_GET_MODE_DATA)(
+ IN EFI_TCP6_PROTOCOL *This,
+ OUT EFI_TCP6_CONNECTION_STATE *Tcp6State OPTIONAL,
+ OUT EFI_TCP6_CONFIG_DATA *Tcp6ConfigData OPTIONAL,
+ OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,
+ OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
+ OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
+ );
+
+/**
+ Initialize or brutally reset the operational parameters for this EFI TCPv6 instance.
+
+ The Configure() function does the following:
+ - Initialize this TCP instance, i.e., initialize the communication end settings and
+ specify active open or passive open for an instance.
+ - Reset this TCP instance brutally, i.e., cancel all pending asynchronous tokens, flush
+ transmission and receiving buffer directly without informing the communication peer.
+
+ No other TCPv6 Protocol operation except Poll() can be executed by this instance until
+ it is configured properly. For an active TCP instance, after a proper configuration it
+ may call Connect() to initiates the three-way handshake. For a passive TCP instance,
+ its state will transit to Tcp6StateListen after configuration, and Accept() may be
+ called to listen the incoming TCP connection requests. If Tcp6ConfigData is set to NULL,
+ the instance is reset. Resetting process will be done brutally, the state machine will
+ be set to Tcp6StateClosed directly, the receive queue and transmit queue will be flushed,
+ and no traffic is allowed through this instance.
+
+ @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.
+ @param[in] Tcp6ConfigData Pointer to the configure data to configure the instance.
+ If Tcp6ConfigData is set to NULL, the instance is reset.
+
+ @retval EFI_SUCCESS The operational settings are set, changed, or reset
+ successfully.
+ @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source
+ address for this instance, but no source address was available for
+ use.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions are TRUE:
+ - This is NULL.
+ - Tcp6ConfigData->AccessPoint.StationAddress is neither zero nor
+ one of the configured IP addresses in the underlying IPv6 driver.
+ - Tcp6ConfigData->AccessPoint.RemoteAddress isn't a valid unicast
+ IPv6 address.
+ - Tcp6ConfigData->AccessPoint.RemoteAddress is zero or
+ Tcp6ConfigData->AccessPoint.RemotePort is zero when
+ Tcp6ConfigData->AccessPoint.ActiveFlag is TRUE.
+ - A same access point has been configured in other TCP
+ instance properly.
+ @retval EFI_ACCESS_DENIED Configuring TCP instance when it is configured without
+ calling Configure() with NULL to reset it.
+ @retval EFI_UNSUPPORTED One or more of the control options are not supported in
+ the implementation.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources when
+ executing Configure().
+ @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP6_CONFIGURE)(
+ IN EFI_TCP6_PROTOCOL *This,
+ IN EFI_TCP6_CONFIG_DATA *Tcp6ConfigData OPTIONAL
+ );
+
+/**
+ Initiate a nonblocking TCP connection request for an active TCP instance.
+
+ The Connect() function will initiate an active open to the remote peer configured
+ in current TCP instance if it is configured active. If the connection succeeds or
+ fails due to any error, the ConnectionToken->CompletionToken.Event will be signaled
+ and ConnectionToken->CompletionToken.Status will be updated accordingly. This
+ function can only be called for the TCP instance in Tcp6StateClosed state. The
+ instance will transfer into Tcp6StateSynSent if the function returns EFI_SUCCESS.
+ If TCP three-way handshake succeeds, its state will become Tcp6StateEstablished,
+ otherwise, the state will return to Tcp6StateClosed.
+
+ @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.
+ @param[in] ConnectionToken Pointer to the connection token to return when the TCP three
+ way handshake finishes.
+
+ @retval EFI_SUCCESS The connection request is successfully initiated and the state of
+ this TCP instance has been changed to Tcp6StateSynSent.
+ @retval EFI_NOT_STARTED This EFI TCPv6 Protocol instance has not been configured.
+ @retval EFI_ACCESS_DENIED One or more of the following conditions are TRUE:
+ - This instance is not configured as an active one.
+ - This instance is not in Tcp6StateClosed state.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ - ConnectionToken is NULL.
+ - ConnectionToken->CompletionToken.Event is NULL.
+ @retval EFI_OUT_OF_RESOURCES The driver can't allocate enough resource to initiate the active open.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP6_CONNECT)(
+ IN EFI_TCP6_PROTOCOL *This,
+ IN EFI_TCP6_CONNECTION_TOKEN *ConnectionToken
+ );
+
+/**
+ Listen on the passive instance to accept an incoming connection request. This is a
+ nonblocking operation.
+
+ The Accept() function initiates an asynchronous accept request to wait for an incoming
+ connection on the passive TCP instance. If a remote peer successfully establishes a
+ connection with this instance, a new TCP instance will be created and its handle will
+ be returned in ListenToken->NewChildHandle. The newly created instance is configured
+ by inheriting the passive instance's configuration and is ready for use upon return.
+ The new instance is in the Tcp6StateEstablished state.
+
+ The ListenToken->CompletionToken.Event will be signaled when a new connection is
+ accepted, user aborts the listen or connection is reset.
+
+ This function only can be called when current TCP instance is in Tcp6StateListen state.
+
+ @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.
+ @param[in] ListenToken Pointer to the listen token to return when operation finishes.
+
+
+ @retval EFI_SUCCESS The listen token has been queued successfully.
+ @retval EFI_NOT_STARTED This EFI TCPv6 Protocol instance has not been configured.
+ @retval EFI_ACCESS_DENIED One or more of the following are TRUE:
+ - This instance is not a passive instance.
+ - This instance is not in Tcp6StateListen state.
+ - The same listen token has already existed in the listen
+ token queue of this TCP instance.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ - ListenToken is NULL.
+ - ListentToken->CompletionToken.Event is NULL.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.
+ @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP6_ACCEPT)(
+ IN EFI_TCP6_PROTOCOL *This,
+ IN EFI_TCP6_LISTEN_TOKEN *ListenToken
+ );
+
+/**
+ Queues outgoing data into the transmit queue.
+
+ The Transmit() function queues a sending request to this TCP instance along with the
+ user data. The status of the token is updated and the event in the token will be
+ signaled once the data is sent out or some error occurs.
+
+ @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.
+ @param[in] Token Pointer to the completion token to queue to the transmit queue.
+
+ @retval EFI_SUCCESS The data has been queued for transmission.
+ @retval EFI_NOT_STARTED This EFI TCPv6 Protocol instance has not been configured.
+ @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a
+ source address for this instance, but no source address was
+ available for use.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token->CompletionToken.Event is NULL.
+ - Token->Packet.TxData is NULL.
+ - Token->Packet.FragmentCount is zero.
+ - Token->Packet.DataLength is not equal to the sum of fragment lengths.
+ @retval EFI_ACCESS_DENIED One or more of the following conditions are TRUE:
+ - A transmit completion token with the same Token->
+ CompletionToken.Event was already in the
+ transmission queue.
+ - The current instance is in Tcp6StateClosed state.
+ - The current instance is a passive one and it is in
+ Tcp6StateListen state.
+ - User has called Close() to disconnect this connection.
+ @retval EFI_NOT_READY The completion token could not be queued because the
+ transmit queue is full.
+ @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data because of resource
+ shortage.
+ @retval EFI_NETWORK_UNREACHABLE There is no route to the destination network or address.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP6_TRANSMIT)(
+ IN EFI_TCP6_PROTOCOL *This,
+ IN EFI_TCP6_IO_TOKEN *Token
+ );
+
+/**
+ Places an asynchronous receive request into the receiving queue.
+
+ The Receive() function places a completion token into the receive packet queue. This
+ function is always asynchronous. The caller must allocate the Token->CompletionToken.Event
+ and the FragmentBuffer used to receive data. The caller also must fill the DataLength which
+ represents the whole length of all FragmentBuffer. When the receive operation completes, the
+ EFI TCPv6 Protocol driver updates the Token->CompletionToken.Status and Token->Packet.RxData
+ fields and the Token->CompletionToken.Event is signaled. If got data the data and its length
+ will be copied into the FragmentTable, at the same time the full length of received data will
+ be recorded in the DataLength fields. Providing a proper notification function and context
+ for the event will enable the user to receive the notification and receiving status. That
+ notification function is guaranteed to not be re-entered.
+
+ @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.
+ @param[in] Token Pointer to a token that is associated with the receive data
+ descriptor.
+
+ @retval EFI_SUCCESS The receive completion token was cached.
+ @retval EFI_NOT_STARTED This EFI TCPv6 Protocol instance has not been configured.
+ @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source
+ address for this instance, but no source address was available for use.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token->CompletionToken.Event is NULL.
+ - Token->Packet.RxData is NULL.
+ - Token->Packet.RxData->DataLength is 0.
+ - The Token->Packet.RxData->DataLength is not the
+ sum of all FragmentBuffer length in FragmentTable.
+ @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of
+ system resources (usually memory).
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ The EFI TCPv6 Protocol instance has been reset to startup defaults.
+ @retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE:
+ - A receive completion token with the same Token->CompletionToken.Event
+ was already in the receive queue.
+ - The current instance is in Tcp6StateClosed state.
+ - The current instance is a passive one and it is in
+ Tcp6StateListen state.
+ - User has called Close() to disconnect this connection.
+ @retval EFI_CONNECTION_FIN The communication peer has closed the connection and there is no
+ any buffered data in the receive buffer of this instance
+ @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP6_RECEIVE)(
+ IN EFI_TCP6_PROTOCOL *This,
+ IN EFI_TCP6_IO_TOKEN *Token
+ );
+
+/**
+ Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a
+ nonblocking operation.
+
+ Initiate an asynchronous close token to TCP driver. After Close() is called, any buffered
+ transmission data will be sent by TCP driver and the current instance will have a graceful close
+ working flow described as RFC 793 if AbortOnClose is set to FALSE, otherwise, a rest packet
+ will be sent by TCP driver to fast disconnect this connection. When the close operation completes
+ successfully the TCP instance is in Tcp6StateClosed state, all pending asynchronous
+ operations are signaled and any buffers used for TCP network traffic are flushed.
+
+ @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.
+ @param[in] CloseToken Pointer to the close token to return when operation finishes.
+
+ @retval EFI_SUCCESS The Close() is called successfully.
+ @retval EFI_NOT_STARTED This EFI TCPv6 Protocol instance has not been configured.
+ @retval EFI_ACCESS_DENIED One or more of the following are TRUE:
+ - CloseToken or CloseToken->CompletionToken.Event is already in use.
+ - Previous Close() call on this instance has not finished.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ - CloseToken is NULL.
+ - CloseToken->CompletionToken.Event is NULL.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.
+ @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP6_CLOSE)(
+ IN EFI_TCP6_PROTOCOL *This,
+ IN EFI_TCP6_CLOSE_TOKEN *CloseToken
+ );
+
+/**
+ Abort an asynchronous connection, listen, transmission or receive request.
+
+ The Cancel() function aborts a pending connection, listen, transmit or
+ receive request.
+
+ If Token is not NULL and the token is in the connection, listen, transmission
+ or receive queue when it is being cancelled, its Token->Status will be set
+ to EFI_ABORTED and then Token->Event will be signaled.
+
+ If the token is not in one of the queues, which usually means that the
+ asynchronous operation has completed, EFI_NOT_FOUND is returned.
+
+ If Token is NULL all asynchronous token issued by Connect(), Accept(),
+ Transmit() and Receive() will be aborted.
+
+ @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.
+ @param[in] Token Pointer to a token that has been issued by
+ EFI_TCP6_PROTOCOL.Connect(),
+ EFI_TCP6_PROTOCOL.Accept(),
+ EFI_TCP6_PROTOCOL.Transmit() or
+ EFI_TCP6_PROTOCOL.Receive(). If NULL, all pending
+ tokens issued by above four functions will be aborted. Type
+ EFI_TCP6_COMPLETION_TOKEN is defined in
+ EFI_TCP_PROTOCOL.Connect().
+
+ @retval EFI_SUCCESS The asynchronous I/O request is aborted and Token->Event
+ is signaled.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_STARTED This instance hasn't been configured.
+ @retval EFI_NOT_FOUND The asynchronous I/O request isn't found in the transmission or
+ receive queue. It has either completed or wasn't issued by
+ Transmit() and Receive().
+ @retval EFI_UNSUPPORTED The implementation does not support this function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP6_CANCEL)(
+ IN EFI_TCP6_PROTOCOL *This,
+ IN EFI_TCP6_COMPLETION_TOKEN *Token OPTIONAL
+ );
+
+/**
+ Poll to receive incoming data and transmit outgoing segments.
+
+ The Poll() function increases the rate that data is moved between the network
+ and application and can be called when the TCP instance is created successfully.
+ Its use is optional.
+
+ @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_NOT_READY No incoming or outgoing data is processed.
+ @retval EFI_TIMEOUT Data was dropped out of the transmission or receive queue.
+ Consider increasing the polling rate.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP6_POLL)(
+ IN EFI_TCP6_PROTOCOL *This
+ );
+
+///
+/// EFI_TCP6_PROTOCOL
+/// defines the EFI TCPv6 Protocol child to be used by any network drivers or
+/// applications to send or receive data stream. It can either listen on a
+/// specified port as a service or actively connect to remote peer as a client.
+/// Each instance has its own independent settings.
+///
+struct _EFI_TCP6_PROTOCOL {
+ EFI_TCP6_GET_MODE_DATA GetModeData;
+ EFI_TCP6_CONFIGURE Configure;
+ EFI_TCP6_CONNECT Connect;
+ EFI_TCP6_ACCEPT Accept;
+ EFI_TCP6_TRANSMIT Transmit;
+ EFI_TCP6_RECEIVE Receive;
+ EFI_TCP6_CLOSE Close;
+ EFI_TCP6_CANCEL Cancel;
+ EFI_TCP6_POLL Poll;
+};
+
+extern EFI_GUID gEfiTcp6ServiceBindingProtocolGuid;
+extern EFI_GUID gEfiTcp6ProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Timer.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Timer.h
new file mode 100644
index 0000000000..29d65215b1
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Timer.h
@@ -0,0 +1,180 @@
+/** @file
+ Timer Architectural Protocol as defined in PI Specification VOLUME 2 DXE
+
+ This code is used to provide the timer tick for the DXE core.
+
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARCH_PROTOCOL_TIMER_H__
+#define __ARCH_PROTOCOL_TIMER_H__
+
+///
+/// Global ID for the Timer Architectural Protocol
+///
+#define EFI_TIMER_ARCH_PROTOCOL_GUID \
+ { 0x26baccb3, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
+
+///
+/// Declare forward reference for the Timer Architectural Protocol
+///
+typedef struct _EFI_TIMER_ARCH_PROTOCOL EFI_TIMER_ARCH_PROTOCOL;
+
+/**
+ This function of this type is called when a timer interrupt fires. This
+ function executes at TPL_HIGH_LEVEL. The DXE Core will register a function
+ of this type to be called for the timer interrupt, so it can know how much
+ time has passed. This information is used to signal timer based events.
+
+ @param Time Time since the last timer interrupt in 100 ns units. This will
+ typically be TimerPeriod, but if a timer interrupt is missed, and the
+ EFI_TIMER_ARCH_PROTOCOL driver can detect missed interrupts, then Time
+ will contain the actual amount of time since the last interrupt.
+
+ None.
+
+**/
+typedef
+VOID
+(EFIAPI *EFI_TIMER_NOTIFY)(
+ IN UINT64 Time
+ );
+
+/**
+ This function registers the handler NotifyFunction so it is called every time
+ the timer interrupt fires. It also passes the amount of time since the last
+ handler call to the NotifyFunction. If NotifyFunction is NULL, then the
+ handler is unregistered. If the handler is registered, then EFI_SUCCESS is
+ returned. If the CPU does not support registering a timer interrupt handler,
+ then EFI_UNSUPPORTED is returned. If an attempt is made to register a handler
+ when a handler is already registered, then EFI_ALREADY_STARTED is returned.
+ If an attempt is made to unregister a handler when a handler is not registered,
+ then EFI_INVALID_PARAMETER is returned. If an error occurs attempting to
+ register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR
+ is returned.
+
+ @param This The EFI_TIMER_ARCH_PROTOCOL instance.
+ @param NotifyFunction The function to call when a timer interrupt fires. This
+ function executes at TPL_HIGH_LEVEL. The DXE Core will
+ register a handler for the timer interrupt, so it can know
+ how much time has passed. This information is used to
+ signal timer based events. NULL will unregister the handler.
+
+ @retval EFI_SUCCESS The timer handler was registered.
+ @retval EFI_UNSUPPORTED The platform does not support timer interrupts.
+ @retval EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already
+ registered.
+ @retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not
+ previously registered.
+ @retval EFI_DEVICE_ERROR The timer handler could not be registered.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TIMER_REGISTER_HANDLER)(
+ IN EFI_TIMER_ARCH_PROTOCOL *This,
+ IN EFI_TIMER_NOTIFY NotifyFunction
+);
+
+/**
+ This function adjusts the period of timer interrupts to the value specified
+ by TimerPeriod. If the timer period is updated, then the selected timer
+ period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned. If
+ the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.
+ If an error occurs while attempting to update the timer period, then the
+ timer hardware will be put back in its state prior to this call, and
+ EFI_DEVICE_ERROR is returned. If TimerPeriod is 0, then the timer interrupt
+ is disabled. This is not the same as disabling the CPU's interrupts.
+ Instead, it must either turn off the timer hardware, or it must adjust the
+ interrupt controller so that a CPU interrupt is not generated when the timer
+ interrupt fires.
+
+ @param This The EFI_TIMER_ARCH_PROTOCOL instance.
+ @param TimerPeriod The rate to program the timer interrupt in 100 nS units. If
+ the timer hardware is not programmable, then EFI_UNSUPPORTED is
+ returned. If the timer is programmable, then the timer period
+ will be rounded up to the nearest timer period that is supported
+ by the timer hardware. If TimerPeriod is set to 0, then the
+ timer interrupts will be disabled.
+
+ @retval EFI_SUCCESS The timer period was changed.
+ @retval EFI_UNSUPPORTED The platform cannot change the period of the timer interrupt.
+ @retval EFI_DEVICE_ERROR The timer period could not be changed due to a device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TIMER_SET_TIMER_PERIOD)(
+ IN EFI_TIMER_ARCH_PROTOCOL *This,
+ IN UINT64 TimerPeriod
+ );
+
+/**
+ This function retrieves the period of timer interrupts in 100 ns units,
+ returns that value in TimerPeriod, and returns EFI_SUCCESS. If TimerPeriod
+ is NULL, then EFI_INVALID_PARAMETER is returned. If a TimerPeriod of 0 is
+ returned, then the timer is currently disabled.
+
+ @param This The EFI_TIMER_ARCH_PROTOCOL instance.
+ @param TimerPeriod A pointer to the timer period to retrieve in 100 ns units. If
+ 0 is returned, then the timer is currently disabled.
+
+ @retval EFI_SUCCESS The timer period was returned in TimerPeriod.
+ @retval EFI_INVALID_PARAMETER TimerPeriod is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TIMER_GET_TIMER_PERIOD)(
+ IN EFI_TIMER_ARCH_PROTOCOL *This,
+ OUT UINT64 *TimerPeriod
+ );
+
+/**
+ This function generates a soft timer interrupt. If the platform does not support soft
+ timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned.
+ If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler()
+ service, then a soft timer interrupt will be generated. If the timer interrupt is
+ enabled when this service is called, then the registered handler will be invoked. The
+ registered handler should not be able to distinguish a hardware-generated timer
+ interrupt from a software-generated timer interrupt.
+
+ @param This The EFI_TIMER_ARCH_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The soft timer interrupt was generated.
+ @retval EFI_UNSUPPORTED The platform does not support the generation of soft timer interrupts.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TIMER_GENERATE_SOFT_INTERRUPT)(
+ IN EFI_TIMER_ARCH_PROTOCOL *This
+ );
+
+
+///
+/// This protocol provides the services to initialize a periodic timer
+/// interrupt, and to register a handler that is called each time the timer
+/// interrupt fires. It may also provide a service to adjust the rate of the
+/// periodic timer interrupt. When a timer interrupt occurs, the handler is
+/// passed the amount of time that has passed since the previous timer
+/// interrupt.
+///
+struct _EFI_TIMER_ARCH_PROTOCOL {
+ EFI_TIMER_REGISTER_HANDLER RegisterHandler;
+ EFI_TIMER_SET_TIMER_PERIOD SetTimerPeriod;
+ EFI_TIMER_GET_TIMER_PERIOD GetTimerPeriod;
+ EFI_TIMER_GENERATE_SOFT_INTERRUPT GenerateSoftInterrupt;
+};
+
+extern EFI_GUID gEfiTimerArchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Timestamp.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Timestamp.h
new file mode 100644
index 0000000000..9746903922
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Timestamp.h
@@ -0,0 +1,101 @@
+/** @file
+ EFI Timestamp Protocol as defined in UEFI2.4 Specification.
+ Used to provide a platform independent interface for retrieving a high resolution timestamp counter.
+
+ Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.4
+
+**/
+
+#ifndef __EFI_TIME_STAMP_PROTOCOL_H__
+#define __EFI_TIME_STAMP_PROTOCOL_H__
+
+
+#define EFI_TIMESTAMP_PROTOCOL_GUID \
+ { 0xafbfde41, 0x2e6e, 0x4262, {0xba, 0x65, 0x62, 0xb9, 0x23, 0x6e, 0x54, 0x95 } }
+
+///
+/// Declare forward reference for the Time Stamp Protocol
+///
+typedef struct _EFI_TIMESTAMP_PROTOCOL EFI_TIMESTAMP_PROTOCOL;
+
+///
+/// EFI_TIMESTAMP_PROPERTIES
+///
+typedef struct {
+ ///
+ /// The frequency of the timestamp counter in Hz.
+ ///
+ UINT64 Frequency;
+ ///
+ /// The value that the timestamp counter ends with immediately before it rolls over.
+ /// For example, a 64-bit free running counter would have an EndValue of 0xFFFFFFFFFFFFFFFF.
+ /// A 24-bit free running counter would have an EndValue of 0xFFFFFF.
+ ///
+ UINT64 EndValue;
+} EFI_TIMESTAMP_PROPERTIES;
+
+/**
+ Retrieves the current value of a 64-bit free running timestamp counter.
+
+ The counter shall count up in proportion to the amount of time that has passed. The counter value
+ will always roll over to zero. The properties of the counter can be retrieved from GetProperties().
+ The caller should be prepared for the function to return the same value twice across successive calls.
+ The counter value will not go backwards other than when wrapping, as defined by EndValue in GetProperties().
+ The frequency of the returned timestamp counter value must remain constant. Power management operations that
+ affect clocking must not change the returned counter frequency. The quantization of counter value updates may
+ vary as long as the value reflecting time passed remains consistent.
+
+ @param None.
+
+ @retval The current value of the free running timestamp counter.
+
+**/
+typedef
+UINT64
+(EFIAPI *TIMESTAMP_GET)(
+ VOID
+ );
+
+/**
+ Obtains timestamp counter properties including frequency and value limits.
+
+ @param[out] Properties The properties of the timestamp counter.
+
+ @retval EFI_SUCCESS The properties were successfully retrieved.
+ @retval EFI_DEVICE_ERROR An error occurred trying to retrieve the properties of the timestamp
+ counter subsystem. Properties is not pedated.
+ @retval EFI_INVALID_PARAMETER Properties is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *TIMESTAMP_GET_PROPERTIES)(
+ OUT EFI_TIMESTAMP_PROPERTIES *Properties
+ );
+
+
+
+///
+/// EFI_TIMESTAMP_PROTOCOL
+/// The protocol provides a platform independent interface for retrieving a high resolution
+/// timestamp counter.
+///
+struct _EFI_TIMESTAMP_PROTOCOL {
+ TIMESTAMP_GET GetTimestamp;
+ TIMESTAMP_GET_PROPERTIES GetProperties;
+};
+
+extern EFI_GUID gEfiTimestampProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tls.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tls.h
new file mode 100644
index 0000000000..9f478f318f
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Tls.h
@@ -0,0 +1,461 @@
+/** @file
+ EFI TLS Protocols as defined in UEFI 2.5.
+
+ The EFI TLS Service Binding Protocol is used to locate EFI TLS Protocol drivers
+ to create and destroy child of the driver to communicate with other host using
+ TLS protocol.
+ The EFI TLS Protocol provides the ability to manage TLS session.
+
+ Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_TLS_PROTOCOL_H__
+#define __EFI_TLS_PROTOCOL_H__
+
+///
+/// The EFI TLS Service Binding Protocol is used to locate EFI TLS Protocol drivers to
+/// create and destroy child of the driver to communicate with other host using TLS
+/// protocol.
+///
+#define EFI_TLS_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0x952cb795, 0xff36, 0x48cf, {0xa2, 0x49, 0x4d, 0xf4, 0x86, 0xd6, 0xab, 0x8d } \
+ }
+
+///
+/// The EFI TLS protocol provides the ability to manage TLS session.
+///
+#define EFI_TLS_PROTOCOL_GUID \
+ { \
+ 0xca959f, 0x6cfa, 0x4db1, {0x95, 0xbc, 0xe4, 0x6c, 0x47, 0x51, 0x43, 0x90 } \
+ }
+
+typedef struct _EFI_TLS_PROTOCOL EFI_TLS_PROTOCOL;
+
+///
+/// EFI_TLS_SESSION_DATA_TYPE
+///
+typedef enum {
+ ///
+ /// Session Configuration
+ ///
+
+ ///
+ /// TLS session Version. The corresponding Data is of type EFI_TLS_VERSION.
+ ///
+ EfiTlsVersion,
+ ///
+ /// TLS session as client or as server. The corresponding Data is of
+ /// EFI_TLS_CONNECTION_END.
+ ///
+ EfiTlsConnectionEnd,
+ ///
+ /// A priority list of preferred algorithms for the TLS session.
+ /// The corresponding Data is a list of EFI_TLS_CIPHER.
+ ///
+ EfiTlsCipherList,
+ ///
+ /// TLS session compression method.
+ /// The corresponding Data is of type EFI_TLS_COMPRESSION.
+ ///
+ EfiTlsCompressionMethod,
+ ///
+ /// TLS session extension data.
+ /// The corresponding Data is a list of type EFI_TLS_EXTENSION .
+ ///
+ EfiTlsExtensionData,
+ ///
+ /// TLS session verify method.
+ /// The corresponding Data is of type EFI_TLS_VERIFY.
+ ///
+ EfiTlsVerifyMethod,
+ ///
+ /// TLS session data session ID.
+ /// For SetSessionData(), it is TLS session ID used for session resumption.
+ /// For GetSessionData(), it is the TLS session ID used for current session.
+ /// The corresponding Data is of type EFI_TLS_SESSION_ID.
+ ///
+ EfiTlsSessionID,
+ ///
+ /// TLS session data session state.
+ /// The corresponding Data is of type EFI_TLS_SESSION_STATE.
+ ///
+ EfiTlsSessionState,
+
+ ///
+ /// Session information
+ ///
+
+ ///
+ /// TLS session data client random.
+ /// The corresponding Data is of type EFI_TLS_RANDOM.
+ ///
+ EfiTlsClientRandom,
+ ///
+ /// TLS session data server random.
+ /// The corresponding Data is of type EFI_TLS_RANDOM.
+ ///
+ EfiTlsServerRandom,
+ ///
+ /// TLS session data key material.
+ /// The corresponding Data is of type EFI_TLS_MASTER_SECRET.
+ ///
+ EfiTlsKeyMaterial,
+
+ EfiTlsSessionDataTypeMaximum
+
+} EFI_TLS_SESSION_DATA_TYPE;
+
+///
+/// EFI_TLS_VERSION
+/// Note: The TLS version definition is from SSL3.0 to the latest TLS (e.g. 1.2).
+/// SSL2.0 is obsolete and should not be used.
+///
+typedef struct {
+ UINT8 Major;
+ UINT8 Minor;
+} EFI_TLS_VERSION;
+
+///
+/// EFI_TLS_CONNECTION_END to define TLS session as client or server.
+///
+typedef enum {
+ EfiTlsClient,
+ EfiTlsServer,
+} EFI_TLS_CONNECTION_END;
+
+///
+/// EFI_TLS_CIPHER
+/// Note: The definition of EFI_TLS_CIPHER definition is from "RFC 5246, A.4.1.
+/// Hello Messages". The value of EFI_TLS_CIPHER is from TLS Cipher
+/// Suite Registry of IANA.
+///
+typedef struct {
+ UINT8 Data1;
+ UINT8 Data2;
+} EFI_TLS_CIPHER;
+
+///
+/// EFI_TLS_COMPRESSION
+/// Note: The value of EFI_TLS_COMPRESSION definition is from "RFC 3749".
+///
+typedef UINT8 EFI_TLS_COMPRESSION;
+
+///
+/// EFI_TLS_EXTENSION
+/// Note: The definition of EFI_TLS_EXTENSION if from "RFC 5246 A.4.1.
+/// Hello Messages".
+///
+typedef struct {
+ UINT16 ExtensionType;
+ UINT16 Length;
+ UINT8 Data[1];
+} EFI_TLS_EXTENSION;
+
+///
+/// EFI_TLS_VERIFY
+/// Use either EFI_TLS_VERIFY_NONE or EFI_TLS_VERIFY_PEER, the last two options
+/// are 'ORed' with EFI_TLS_VERIFY_PEER if they are desired.
+///
+typedef UINT32 EFI_TLS_VERIFY;
+///
+/// No certificates will be sent or the TLS/SSL handshake will be continued regardless
+/// of the certificate verification result.
+///
+#define EFI_TLS_VERIFY_NONE 0x0
+///
+/// The TLS/SSL handshake is immediately terminated with an alert message containing
+/// the reason for the certificate verification failure.
+///
+#define EFI_TLS_VERIFY_PEER 0x1
+///
+/// TLS session will fail peer certificate is absent.
+///
+#define EFI_TLS_VERIFY_FAIL_IF_NO_PEER_CERT 0x2
+///
+/// TLS session only verify client once, and doesn't request certificate during
+/// re-negotiation.
+///
+#define EFI_TLS_VERIFY_CLIENT_ONCE 0x4
+
+///
+/// EFI_TLS_RANDOM
+/// Note: The definition of EFI_TLS_RANDOM is from "RFC 5246 A.4.1.
+/// Hello Messages".
+///
+typedef struct {
+ UINT32 GmtUnixTime;
+ UINT8 RandomBytes[28];
+} EFI_TLS_RANDOM;
+
+///
+/// EFI_TLS_MASTER_SECRET
+/// Note: The definition of EFI_TLS_MASTER_SECRET is from "RFC 5246 8.1.
+/// Computing the Master Secret".
+///
+typedef struct {
+ UINT8 Data[48];
+} EFI_TLS_MASTER_SECRET;
+
+///
+/// EFI_TLS_SESSION_ID
+/// Note: The definition of EFI_TLS_SESSION_ID is from "RFC 5246 A.4.1. Hello Messages".
+///
+#define MAX_TLS_SESSION_ID_LENGTH 32
+typedef struct {
+ UINT16 Length;
+ UINT8 Data[MAX_TLS_SESSION_ID_LENGTH];
+} EFI_TLS_SESSION_ID;
+
+///
+/// EFI_TLS_SESSION_STATE
+///
+typedef enum {
+ ///
+ /// When a new child of TLS protocol is created, the initial state of TLS session
+ /// is EfiTlsSessionNotStarted.
+ ///
+ EfiTlsSessionNotStarted,
+ ///
+ /// The consumer can call BuildResponsePacket() with NULL to get ClientHello to
+ /// start the TLS session. Then the status is EfiTlsSessionHandShaking.
+ ///
+ EfiTlsSessionHandShaking,
+ ///
+ /// During handshake, the consumer need call BuildResponsePacket() with input
+ /// data from peer, then get response packet and send to peer. After handshake
+ /// finish, the TLS session status becomes EfiTlsSessionDataTransferring, and
+ /// consumer can use ProcessPacket() for data transferring.
+ ///
+ EfiTlsSessionDataTransferring,
+ ///
+ /// Finally, if consumer wants to active close TLS session, consumer need
+ /// call SetSessionData to set TLS session state to EfiTlsSessionClosing, and
+ /// call BuildResponsePacket() with NULL to get CloseNotify alert message,
+ /// and sent it out.
+ ///
+ EfiTlsSessionClosing,
+ ///
+ /// If any error happen during parsing ApplicationData content type, EFI_ABORT
+ /// will be returned by ProcessPacket(), and TLS session state will become
+ /// EfiTlsSessionError. Then consumer need call BuildResponsePacket() with
+ /// NULL to get alert message and sent it out.
+ ///
+ EfiTlsSessionError,
+
+ EfiTlsSessionStateMaximum
+
+} EFI_TLS_SESSION_STATE;
+
+///
+/// EFI_TLS_FRAGMENT_DATA
+///
+typedef struct {
+ ///
+ /// Length of data buffer in the fragment.
+ ///
+ UINT32 FragmentLength;
+ ///
+ /// Pointer to the data buffer in the fragment.
+ ///
+ VOID *FragmentBuffer;
+} EFI_TLS_FRAGMENT_DATA;
+
+///
+/// EFI_TLS_CRYPT_MODE
+///
+typedef enum {
+ ///
+ /// Encrypt data provided in the fragment buffers.
+ ///
+ EfiTlsEncrypt,
+ ///
+ /// Decrypt data provided in the fragment buffers.
+ ///
+ EfiTlsDecrypt,
+} EFI_TLS_CRYPT_MODE;
+
+/**
+ Set TLS session data.
+
+ The SetSessionData() function set data for a new TLS session. All session data should
+ be set before BuildResponsePacket() invoked.
+
+ @param[in] This Pointer to the EFI_TLS_PROTOCOL instance.
+ @param[in] DataType TLS session data type.
+ @param[in] Data Pointer to session data.
+ @param[in] DataSize Total size of session data.
+
+ @retval EFI_SUCCESS The TLS session data is set successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Data is NULL.
+ DataSize is 0.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_ACCESS_DENIED If the DataType is one of below:
+ EfiTlsClientRandom
+ EfiTlsServerRandom
+ EfiTlsKeyMaterial
+ @retval EFI_NOT_READY Current TLS session state is NOT
+ EfiTlsSessionStateNotStarted.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TLS_SET_SESSION_DATA) (
+ IN EFI_TLS_PROTOCOL *This,
+ IN EFI_TLS_SESSION_DATA_TYPE DataType,
+ IN VOID *Data,
+ IN UINTN DataSize
+ );
+
+/**
+ Get TLS session data.
+
+ The GetSessionData() function return the TLS session information.
+
+ @param[in] This Pointer to the EFI_TLS_PROTOCOL instance.
+ @param[in] DataType TLS session data type.
+ @param[in, out] Data Pointer to session data.
+ @param[in, out] DataSize Total size of session data. On input, it means
+ the size of Data buffer. On output, it means the size
+ of copied Data buffer if EFI_SUCCESS, and means the
+ size of desired Data buffer if EFI_BUFFER_TOO_SMALL.
+
+ @retval EFI_SUCCESS The TLS session data is got successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ DataSize is NULL.
+ Data is NULL if *DataSize is not zero.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_NOT_FOUND The TLS session data is not found.
+ @retval EFI_NOT_READY The DataType is not ready in current session state.
+ @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the data.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TLS_GET_SESSION_DATA) (
+ IN EFI_TLS_PROTOCOL *This,
+ IN EFI_TLS_SESSION_DATA_TYPE DataType,
+ IN OUT VOID *Data, OPTIONAL
+ IN OUT UINTN *DataSize
+ );
+
+/**
+ Build response packet according to TLS state machine. This function is only valid for
+ alert, handshake and change_cipher_spec content type.
+
+ The BuildResponsePacket() function builds TLS response packet in response to the TLS
+ request packet specified by RequestBuffer and RequestSize. If RequestBuffer is NULL and
+ RequestSize is 0, and TLS session status is EfiTlsSessionNotStarted, the TLS session
+ will be initiated and the response packet needs to be ClientHello. If RequestBuffer is
+ NULL and RequestSize is 0, and TLS session status is EfiTlsSessionClosing, the TLS
+ session will be closed and response packet needs to be CloseNotify. If RequestBuffer is
+ NULL and RequestSize is 0, and TLS session status is EfiTlsSessionError, the TLS
+ session has errors and the response packet needs to be Alert message based on error
+ type.
+
+ @param[in] This Pointer to the EFI_TLS_PROTOCOL instance.
+ @param[in] RequestBuffer Pointer to the most recently received TLS packet. NULL
+ means TLS need initiate the TLS session and response
+ packet need to be ClientHello.
+ @param[in] RequestSize Packet size in bytes for the most recently received TLS
+ packet. 0 is only valid when RequestBuffer is NULL.
+ @param[out] Buffer Pointer to the buffer to hold the built packet.
+ @param[in, out] BufferSize Pointer to the buffer size in bytes. On input, it is
+ the buffer size provided by the caller. On output, it
+ is the buffer size in fact needed to contain the
+ packet.
+
+ @retval EFI_SUCCESS The required TLS packet is built successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ RequestBuffer is NULL but RequestSize is NOT 0.
+ RequestSize is 0 but RequestBuffer is NOT NULL.
+ BufferSize is NULL.
+ Buffer is NULL if *BufferSize is not zero.
+ @retval EFI_BUFFER_TOO_SMALL BufferSize is too small to hold the response packet.
+ @retval EFI_NOT_READY Current TLS session state is NOT ready to build
+ ResponsePacket.
+ @retval EFI_ABORTED Something wrong build response packet.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TLS_BUILD_RESPONSE_PACKET) (
+ IN EFI_TLS_PROTOCOL *This,
+ IN UINT8 *RequestBuffer, OPTIONAL
+ IN UINTN RequestSize, OPTIONAL
+ OUT UINT8 *Buffer, OPTIONAL
+ IN OUT UINTN *BufferSize
+ );
+
+/**
+ Decrypt or encrypt TLS packet during session. This function is only valid after
+ session connected and for application_data content type.
+
+ The ProcessPacket () function process each inbound or outbound TLS APP packet.
+
+ @param[in] This Pointer to the EFI_TLS_PROTOCOL instance.
+ @param[in, out] FragmentTable Pointer to a list of fragment. The caller will take
+ responsible to handle the original FragmentTable while
+ it may be reallocated in TLS driver. If CryptMode is
+ EfiTlsEncrypt, on input these fragments contain the TLS
+ header and plain text TLS APP payload; on output these
+ fragments contain the TLS header and cipher text TLS
+ APP payload. If CryptMode is EfiTlsDecrypt, on input
+ these fragments contain the TLS header and cipher text
+ TLS APP payload; on output these fragments contain the
+ TLS header and plain text TLS APP payload.
+ @param[in] FragmentCount Number of fragment.
+ @param[in] CryptMode Crypt mode.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ FragmentTable is NULL.
+ FragmentCount is NULL.
+ CryptoMode is invalid.
+ @retval EFI_NOT_READY Current TLS session state is NOT
+ EfiTlsSessionDataTransferring.
+ @retval EFI_ABORTED Something wrong decryption the message. TLS session
+ status will become EfiTlsSessionError. The caller need
+ call BuildResponsePacket() to generate Error Alert
+ message and send it out.
+ @retval EFI_OUT_OF_RESOURCES No enough resource to finish the operation.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TLS_PROCESS_PACKET) (
+ IN EFI_TLS_PROTOCOL *This,
+ IN OUT EFI_TLS_FRAGMENT_DATA **FragmentTable,
+ IN UINT32 *FragmentCount,
+ IN EFI_TLS_CRYPT_MODE CryptMode
+ );
+
+///
+/// The EFI_TLS_PROTOCOL is used to create, destroy and manage TLS session.
+/// For detail of TLS, please refer to TLS related RFC.
+///
+struct _EFI_TLS_PROTOCOL {
+ EFI_TLS_SET_SESSION_DATA SetSessionData;
+ EFI_TLS_GET_SESSION_DATA GetSessionData;
+ EFI_TLS_BUILD_RESPONSE_PACKET BuildResponsePacket;
+ EFI_TLS_PROCESS_PACKET ProcessPacket;
+};
+
+extern EFI_GUID gEfiTlsServiceBindingProtocolGuid;
+extern EFI_GUID gEfiTlsProtocolGuid;
+
+#endif // __EFI_TLS_PROTOCOL_H__
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TlsConfig.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TlsConfig.h
new file mode 100644
index 0000000000..512fa3bbea
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TlsConfig.h
@@ -0,0 +1,133 @@
+/** @file
+ EFI TLS Configuration Protocol as defined in UEFI 2.5.
+ The EFI TLS Configuration Protocol provides a way to set and get TLS configuration.
+
+ Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+#ifndef __EFI_TLS_CONFIGURATION_PROTOCOL_H__
+#define __EFI_TLS_CONFIGURATION_PROTOCOL_H__
+
+///
+/// The EFI Configuration protocol provides a way to set and get TLS configuration.
+///
+#define EFI_TLS_CONFIGURATION_PROTOCOL_GUID \
+ { \
+ 0x1682fe44, 0xbd7a, 0x4407, { 0xb7, 0xc7, 0xdc, 0xa3, 0x7c, 0xa3, 0x92, 0x2d } \
+ }
+
+typedef struct _EFI_TLS_CONFIGURATION_PROTOCOL EFI_TLS_CONFIGURATION_PROTOCOL;
+
+///
+/// EFI_TLS_CONFIG_DATA_TYPE
+///
+typedef enum {
+ ///
+ /// Local host configuration data: public certificate data.
+ /// This data should be DER-encoded binary X.509 certificate
+ /// or PEM-encoded X.509 certificate.
+ ///
+ EfiTlsConfigDataTypeHostPublicCert,
+ ///
+ /// Local host configuration data: private key data.
+ ///
+ EfiTlsConfigDataTypeHostPrivateKey,
+ ///
+ /// CA certificate to verify peer. This data should be PEM-encoded
+ /// RSA or PKCS#8 private key.
+ ///
+ EfiTlsConfigDataTypeCACertificate,
+ ///
+ /// CA-supplied Certificate Revocation List data. This data should
+ /// be DER-encoded CRL data.
+ ///
+ EfiTlsConfigDataTypeCertRevocationList,
+
+ EfiTlsConfigDataTypeMaximum
+
+} EFI_TLS_CONFIG_DATA_TYPE;
+
+/**
+ Set TLS configuration data.
+
+ The SetData() function sets TLS configuration to non-volatile storage or volatile
+ storage.
+
+ @param[in] This Pointer to the EFI_TLS_CONFIGURATION_PROTOCOL instance.
+ @param[in] DataType Configuration data type.
+ @param[in] Data Pointer to configuration data.
+ @param[in] DataSize Total size of configuration data.
+
+ @retval EFI_SUCCESS The TLS configuration data is set successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Data is NULL.
+ DataSize is 0.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TLS_CONFIGURATION_SET_DATA)(
+ IN EFI_TLS_CONFIGURATION_PROTOCOL *This,
+ IN EFI_TLS_CONFIG_DATA_TYPE DataType,
+ IN VOID *Data,
+ IN UINTN DataSize
+ );
+
+/**
+ Get TLS configuration data.
+
+ The GetData() function gets TLS configuration.
+
+ @param[in] This Pointer to the EFI_TLS_CONFIGURATION_PROTOCOL instance.
+ @param[in] DataType Configuration data type.
+ @param[in, out] Data Pointer to configuration data.
+ @param[in, out] DataSize Total size of configuration data. On input, it means
+ the size of Data buffer. On output, it means the size
+ of copied Data buffer if EFI_SUCCESS, and means the
+ size of desired Data buffer if EFI_BUFFER_TOO_SMALL.
+
+ @retval EFI_SUCCESS The TLS configuration data is got successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ DataSize is NULL.
+ Data is NULL if *DataSize is not zero.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_NOT_FOUND The TLS configuration data is not found.
+ @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the data.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TLS_CONFIGURATION_GET_DATA)(
+ IN EFI_TLS_CONFIGURATION_PROTOCOL *This,
+ IN EFI_TLS_CONFIG_DATA_TYPE DataType,
+ IN OUT VOID *Data, OPTIONAL
+ IN OUT UINTN *DataSize
+ );
+
+///
+/// The EFI_TLS_CONFIGURATION_PROTOCOL is designed to provide a way to set and get
+/// TLS configuration, such as Certificate, private key data.
+///
+struct _EFI_TLS_CONFIGURATION_PROTOCOL {
+ EFI_TLS_CONFIGURATION_SET_DATA SetData;
+ EFI_TLS_CONFIGURATION_GET_DATA GetData;
+};
+
+extern EFI_GUID gEfiTlsConfigurationProtocolGuid;
+
+#endif //__EFI_TLS_CONFIGURATION_PROTOCOL_H__
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TrEEProtocol.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TrEEProtocol.h
new file mode 100644
index 0000000000..d98cedcee6
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/TrEEProtocol.h
@@ -0,0 +1,249 @@
+/** @file
+ This protocol is defined to abstract TPM2 hardware access in boot phase.
+
+Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __TREE_H__
+#define __TREE_H__
+
+#include <IndustryStandard/UefiTcgPlatform.h>
+#include <IndustryStandard/Tpm20.h>
+
+#define EFI_TREE_PROTOCOL_GUID \
+ {0x607f766c, 0x7455, 0x42be, 0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f}
+
+typedef struct _EFI_TREE_PROTOCOL EFI_TREE_PROTOCOL;
+
+typedef struct _TREE_VERSION {
+ UINT8 Major;
+ UINT8 Minor;
+} TREE_VERSION;
+
+typedef UINT32 TREE_EVENT_LOG_BITMAP;
+typedef UINT32 TREE_EVENT_LOG_FORMAT;
+
+#define TREE_EVENT_LOG_FORMAT_TCG_1_2 0x00000001
+
+typedef struct _TREE_BOOT_SERVICE_CAPABILITY {
+ //
+ // Allocated size of the structure passed in
+ //
+ UINT8 Size;
+ //
+ // Version of the TREE_BOOT_SERVICE_CAPABILITY structure itself.
+ // For this version of the protocol, the Major version shall be set to 1
+ // and the Minor version shall be set to 0.
+ //
+ TREE_VERSION StructureVersion;
+ //
+ // Version of the TrEE protocol.
+ // For this version of the protocol, the Major version shall be set to 1
+ // and the Minor version shall be set to 0.
+ //
+ TREE_VERSION ProtocolVersion;
+ //
+ // Supported hash algorithms
+ //
+ UINT32 HashAlgorithmBitmap;
+ //
+ // Bitmap of supported event log formats
+ //
+ TREE_EVENT_LOG_BITMAP SupportedEventLogs;
+ //
+ // False = TrEE not present
+ //
+ BOOLEAN TrEEPresentFlag;
+ //
+ // Max size (in bytes) of a command that can be sent to the TrEE
+ //
+ UINT16 MaxCommandSize;
+ //
+ // Max size (in bytes) of a response that can be provided by the TrEE
+ //
+ UINT16 MaxResponseSize;
+ //
+ // 4-byte Vendor ID (see Trusted Computing Group, "TCG Vendor ID Registry,"
+ // Version 1.0, Revision 0.1, August 31, 2007, "TPM Capabilities Vendor ID" section)
+ //
+ UINT32 ManufacturerID;
+} TREE_BOOT_SERVICE_CAPABILITY_1_0;
+
+typedef TREE_BOOT_SERVICE_CAPABILITY_1_0 TREE_BOOT_SERVICE_CAPABILITY;
+
+#define TREE_BOOT_HASH_ALG_SHA1 0x00000001
+#define TREE_BOOT_HASH_ALG_SHA256 0x00000002
+#define TREE_BOOT_HASH_ALG_SHA384 0x00000004
+#define TREE_BOOT_HASH_ALG_SHA512 0x00000008
+
+//
+// This bit is shall be set when an event shall be extended but not logged.
+//
+#define TREE_EXTEND_ONLY 0x0000000000000001
+//
+// This bit shall be set when the intent is to measure a PE/COFF image.
+//
+#define PE_COFF_IMAGE 0x0000000000000010
+
+typedef UINT32 TrEE_PCRINDEX;
+typedef UINT32 TrEE_EVENTTYPE;
+
+#define MAX_PCR_INDEX 23
+#define TREE_EVENT_HEADER_VERSION 1
+
+#pragma pack(1)
+
+typedef struct {
+ //
+ // Size of the event header itself (sizeof(TrEE_EVENT_HEADER)).
+ //
+ UINT32 HeaderSize;
+ //
+ // Header version. For this version of this specification, the value shall be 1.
+ //
+ UINT16 HeaderVersion;
+ //
+ // Index of the PCR that shall be extended (0 - 23).
+ //
+ TrEE_PCRINDEX PCRIndex;
+ //
+ // Type of the event that shall be extended (and optionally logged).
+ //
+ TrEE_EVENTTYPE EventType;
+} TrEE_EVENT_HEADER;
+
+typedef struct {
+ //
+ // Total size of the event including the Size component, the header and the Event data.
+ //
+ UINT32 Size;
+ TrEE_EVENT_HEADER Header;
+ UINT8 Event[1];
+} TrEE_EVENT;
+
+#pragma pack()
+
+/**
+ The EFI_TREE_PROTOCOL GetCapability function call provides protocol
+ capability information and state information about the TrEE.
+
+ @param[in] This Indicates the calling context
+ @param[out] ProtocolCapability The caller allocates memory for a TREE_BOOT_SERVICE_CAPABILITY
+ structure and sets the size field to the size of the structure allocated.
+ The callee fills in the fields with the EFI protocol capability information
+ and the current TrEE state information up to the number of fields which
+ fit within the size of the structure passed in.
+
+ @retval EFI_SUCCESS Operation completed successfully.
+ @retval EFI_DEVICE_ERROR The command was unsuccessful.
+ The ProtocolCapability variable will not be populated.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
+ The ProtocolCapability variable will not be populated.
+ @retval EFI_BUFFER_TOO_SMALL The ProtocolCapability variable is too small to hold the full response.
+ It will be partially populated (required Size field will be set).
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TREE_GET_CAPABILITY) (
+ IN EFI_TREE_PROTOCOL *This,
+ IN OUT TREE_BOOT_SERVICE_CAPABILITY *ProtocolCapability
+ );
+
+/**
+ The EFI_TREE_PROTOCOL Get Event Log function call allows a caller to
+ retrieve the address of a given event log and its last entry.
+
+ @param[in] This Indicates the calling context
+ @param[in] EventLogFormat The type of the event log for which the information is requested.
+ @param[out] EventLogLocation A pointer to the memory address of the event log.
+ @param[out] EventLogLastEntry If the Event Log contains more than one entry, this is a pointer to the
+ address of the start of the last entry in the event log in memory.
+ @param[out] EventLogTruncated If the Event Log is missing at least one entry because an event would
+ have exceeded the area allocated for events, this value is set to TRUE.
+ Otherwise, the value will be FALSE and the Event Log will be complete.
+
+ @retval EFI_SUCCESS Operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect
+ (e.g. asking for an event log whose format is not supported).
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TREE_GET_EVENT_LOG) (
+ IN EFI_TREE_PROTOCOL *This,
+ IN TREE_EVENT_LOG_FORMAT EventLogFormat,
+ OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,
+ OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry,
+ OUT BOOLEAN *EventLogTruncated
+ );
+
+/**
+ The EFI_TREE_PROTOCOL HashLogExtendEvent function call provides callers with
+ an opportunity to extend and optionally log events without requiring
+ knowledge of actual TPM commands.
+ The extend operation will occur even if this function cannot create an event
+ log entry (e.g. due to the event log being full).
+
+ @param[in] This Indicates the calling context
+ @param[in] Flags Bitmap providing additional information.
+ @param[in] DataToHash Physical address of the start of the data buffer to be hashed.
+ @param[in] DataToHashLen The length in bytes of the buffer referenced by DataToHash.
+ @param[in] Event Pointer to data buffer containing information about the event.
+
+ @retval EFI_SUCCESS Operation completed successfully.
+ @retval EFI_DEVICE_ERROR The command was unsuccessful.
+ @retval EFI_VOLUME_FULL The extend operation occurred, but the event could not be written to one or more event logs.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
+ @retval EFI_UNSUPPORTED The PE/COFF image type is not supported.
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_TREE_HASH_LOG_EXTEND_EVENT) (
+ IN EFI_TREE_PROTOCOL *This,
+ IN UINT64 Flags,
+ IN EFI_PHYSICAL_ADDRESS DataToHash,
+ IN UINT64 DataToHashLen,
+ IN TrEE_EVENT *Event
+ );
+
+/**
+ This service enables the sending of commands to the TrEE.
+
+ @param[in] This Indicates the calling context
+ @param[in] InputParameterBlockSize Size of the TrEE input parameter block.
+ @param[in] InputParameterBlock Pointer to the TrEE input parameter block.
+ @param[in] OutputParameterBlockSize Size of the TrEE output parameter block.
+ @param[in] OutputParameterBlock Pointer to the TrEE output parameter block.
+
+ @retval EFI_SUCCESS The command byte stream was successfully sent to the device and a response was successfully received.
+ @retval EFI_DEVICE_ERROR The command was not successfully sent to the device or a response was not successfully received from the device.
+ @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
+ @retval EFI_BUFFER_TOO_SMALL The output parameter block is too small.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TREE_SUBMIT_COMMAND) (
+ IN EFI_TREE_PROTOCOL *This,
+ IN UINT32 InputParameterBlockSize,
+ IN UINT8 *InputParameterBlock,
+ IN UINT32 OutputParameterBlockSize,
+ IN UINT8 *OutputParameterBlock
+ );
+
+struct _EFI_TREE_PROTOCOL {
+ EFI_TREE_GET_CAPABILITY GetCapability;
+ EFI_TREE_GET_EVENT_LOG GetEventLog;
+ EFI_TREE_HASH_LOG_EXTEND_EVENT HashLogExtendEvent;
+ EFI_TREE_SUBMIT_COMMAND SubmitCommand;
+};
+
+extern EFI_GUID gEfiTrEEProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Udp4.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Udp4.h
new file mode 100644
index 0000000000..9163866a0b
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Udp4.h
@@ -0,0 +1,445 @@
+/** @file
+ UDP4 Service Binding Protocol as defined in UEFI specification.
+
+ The EFI UDPv4 Protocol provides simple packet-oriented services
+ to transmit and receive UDP packets.
+
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.0.
+
+**/
+
+#ifndef __EFI_UDP4_PROTOCOL_H__
+#define __EFI_UDP4_PROTOCOL_H__
+
+#include <Protocol/Ip4.h>
+//
+//GUID definitions
+//
+#define EFI_UDP4_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0x83f01464, 0x99bd, 0x45e5, {0xb3, 0x83, 0xaf, 0x63, 0x05, 0xd8, 0xe9, 0xe6 } \
+ }
+
+#define EFI_UDP4_PROTOCOL_GUID \
+ { \
+ 0x3ad9df29, 0x4501, 0x478d, {0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } \
+ }
+
+typedef struct _EFI_UDP4_PROTOCOL EFI_UDP4_PROTOCOL;
+
+///
+/// EFI_UDP4_SERVICE_POINT is deprecated in the UEFI 2.4B and should not be used any more.
+/// The definition in here is only present to provide backwards compatability.
+///
+typedef struct {
+ EFI_HANDLE InstanceHandle;
+ EFI_IPv4_ADDRESS LocalAddress;
+ UINT16 LocalPort;
+ EFI_IPv4_ADDRESS RemoteAddress;
+ UINT16 RemotePort;
+} EFI_UDP4_SERVICE_POINT;
+
+///
+/// EFI_UDP4_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more.
+/// The definition in here is only present to provide backwards compatability.
+///
+typedef struct {
+ EFI_HANDLE DriverHandle;
+ UINT32 ServiceCount;
+ EFI_UDP4_SERVICE_POINT Services[1];
+} EFI_UDP4_VARIABLE_DATA;
+
+typedef struct {
+ UINT32 FragmentLength;
+ VOID *FragmentBuffer;
+} EFI_UDP4_FRAGMENT_DATA;
+
+typedef struct {
+ EFI_IPv4_ADDRESS SourceAddress;
+ UINT16 SourcePort;
+ EFI_IPv4_ADDRESS DestinationAddress;
+ UINT16 DestinationPort;
+} EFI_UDP4_SESSION_DATA;
+typedef struct {
+ //
+ // Receiving Filters
+ //
+ BOOLEAN AcceptBroadcast;
+ BOOLEAN AcceptPromiscuous;
+ BOOLEAN AcceptAnyPort;
+ BOOLEAN AllowDuplicatePort;
+ //
+ // I/O parameters
+ //
+ UINT8 TypeOfService;
+ UINT8 TimeToLive;
+ BOOLEAN DoNotFragment;
+ UINT32 ReceiveTimeout;
+ UINT32 TransmitTimeout;
+ //
+ // Access Point
+ //
+ BOOLEAN UseDefaultAddress;
+ EFI_IPv4_ADDRESS StationAddress;
+ EFI_IPv4_ADDRESS SubnetMask;
+ UINT16 StationPort;
+ EFI_IPv4_ADDRESS RemoteAddress;
+ UINT16 RemotePort;
+} EFI_UDP4_CONFIG_DATA;
+
+typedef struct {
+ EFI_UDP4_SESSION_DATA *UdpSessionData; //OPTIONAL
+ EFI_IPv4_ADDRESS *GatewayAddress; //OPTIONAL
+ UINT32 DataLength;
+ UINT32 FragmentCount;
+ EFI_UDP4_FRAGMENT_DATA FragmentTable[1];
+} EFI_UDP4_TRANSMIT_DATA;
+
+typedef struct {
+ EFI_TIME TimeStamp;
+ EFI_EVENT RecycleSignal;
+ EFI_UDP4_SESSION_DATA UdpSession;
+ UINT32 DataLength;
+ UINT32 FragmentCount;
+ EFI_UDP4_FRAGMENT_DATA FragmentTable[1];
+} EFI_UDP4_RECEIVE_DATA;
+
+
+typedef struct {
+ EFI_EVENT Event;
+ EFI_STATUS Status;
+ union {
+ EFI_UDP4_RECEIVE_DATA *RxData;
+ EFI_UDP4_TRANSMIT_DATA *TxData;
+ } Packet;
+} EFI_UDP4_COMPLETION_TOKEN;
+
+/**
+ Reads the current operational settings.
+
+ The GetModeData() function copies the current operational settings of this EFI
+ UDPv4 Protocol instance into user-supplied buffers. This function is used
+ optionally to retrieve the operational mode data of underlying networks or
+ drivers.
+
+ @param This The pointer to the EFI_UDP4_PROTOCOL instance.
+ @param Udp4ConfigData The pointer to the buffer to receive the current configuration data.
+ @param Ip4ModeData The pointer to the EFI IPv4 Protocol mode data structure.
+ @param MnpConfigData The pointer to the managed network configuration data structure.
+ @param SnpModeData The pointer to the simple network mode data structure.
+
+ @retval EFI_SUCCESS The mode data was read.
+ @retval EFI_NOT_STARTED When Udp4ConfigData is queried, no configuration data is
+ available because this instance has not been started.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP4_GET_MODE_DATA)(
+ IN EFI_UDP4_PROTOCOL *This,
+ OUT EFI_UDP4_CONFIG_DATA *Udp4ConfigData OPTIONAL,
+ OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,
+ OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
+ OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
+ );
+
+
+/**
+ Initializes, changes, or resets the operational parameters for this instance of the EFI UDPv4
+ Protocol.
+
+ The Configure() function is used to do the following:
+ * Initialize and start this instance of the EFI UDPv4 Protocol.
+ * Change the filtering rules and operational parameters.
+ * Reset this instance of the EFI UDPv4 Protocol.
+ Until these parameters are initialized, no network traffic can be sent or
+ received by this instance. This instance can be also reset by calling Configure()
+ with UdpConfigData set to NULL. Once reset, the receiving queue and transmitting
+ queue are flushed and no traffic is allowed through this instance.
+ With different parameters in UdpConfigData, Configure() can be used to bind
+ this instance to specified port.
+
+ @param This The pointer to the EFI_UDP4_PROTOCOL instance.
+ @param Udp4ConfigData The pointer to the buffer to receive the current configuration data.
+
+ @retval EFI_SUCCESS The configuration settings were set, changed, or reset successfully.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER UdpConfigData.StationAddress is not a valid unicast IPv4 address.
+ @retval EFI_INVALID_PARAMETER UdpConfigData.SubnetMask is not a valid IPv4 address mask. The subnet
+ mask must be contiguous.
+ @retval EFI_INVALID_PARAMETER UdpConfigData.RemoteAddress is not a valid unicast IPv4 address if it
+ is not zero.
+ @retval EFI_ALREADY_STARTED The EFI UDPv4 Protocol instance is already started/configured
+ and must be stopped/reset before it can be reconfigured.
+ @retval EFI_ACCESS_DENIED UdpConfigData. AllowDuplicatePort is FALSE
+ and UdpConfigData.StationPort is already used by
+ other instance.
+ @retval EFI_OUT_OF_RESOURCES The EFI UDPv4 Protocol driver cannot allocate memory for this
+ EFI UDPv4 Protocol instance.
+ @retval EFI_DEVICE_ERROR An unexpected network or system error occurred and this instance
+ was not opened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP4_CONFIGURE)(
+ IN EFI_UDP4_PROTOCOL *This,
+ IN EFI_UDP4_CONFIG_DATA *UdpConfigData OPTIONAL
+ );
+
+/**
+ Joins and leaves multicast groups.
+
+ The Groups() function is used to enable and disable the multicast group
+ filtering. If the JoinFlag is FALSE and the MulticastAddress is NULL, then all
+ currently joined groups are left.
+
+ @param This The pointer to the EFI_UDP4_PROTOCOL instance.
+ @param JoinFlag Set to TRUE to join a multicast group. Set to FALSE to leave one
+ or all multicast groups.
+ @param MulticastAddress The pointer to multicast group address to join or leave.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_NOT_STARTED The EFI UDPv4 Protocol instance has not been started.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate resources to join the group.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - JoinFlag is TRUE and MulticastAddress is NULL.
+ - JoinFlag is TRUE and *MulticastAddress is not
+ a valid multicast address.
+ @retval EFI_ALREADY_STARTED The group address is already in the group table (when
+ JoinFlag is TRUE).
+ @retval EFI_NOT_FOUND The group address is not in the group table (when JoinFlag is
+ FALSE).
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP4_GROUPS)(
+ IN EFI_UDP4_PROTOCOL *This,
+ IN BOOLEAN JoinFlag,
+ IN EFI_IPv4_ADDRESS *MulticastAddress OPTIONAL
+ );
+
+/**
+ Adds and deletes routing table entries.
+
+ The Routes() function adds a route to or deletes a route from the routing table.
+ Routes are determined by comparing the SubnetAddress with the destination IP
+ address and arithmetically AND-ing it with the SubnetMask. The gateway address
+ must be on the same subnet as the configured station address.
+ The default route is added with SubnetAddress and SubnetMask both set to 0.0.0.0.
+ The default route matches all destination IP addresses that do not match any
+ other routes.
+ A zero GatewayAddress is a nonroute. Packets are sent to the destination IP
+ address if it can be found in the Address Resolution Protocol (ARP) cache or
+ on the local subnet. One automatic nonroute entry will be inserted into the
+ routing table for outgoing packets that are addressed to a local subnet
+ (gateway address of 0.0.0.0).
+ Each instance of the EFI UDPv4 Protocol has its own independent routing table.
+ Instances of the EFI UDPv4 Protocol that use the default IP address will also
+ have copies of the routing table provided by the EFI_IP4_CONFIG_PROTOCOL. These
+ copies will be updated automatically whenever the IP driver reconfigures its
+ instances; as a result, the previous modification to these copies will be lost.
+
+ @param This The pointer to the EFI_UDP4_PROTOCOL instance.
+ @param DeleteRoute Set to TRUE to delete this route from the routing table.
+ Set to FALSE to add this route to the routing table.
+ @param SubnetAddress The destination network address that needs to be routed.
+ @param SubnetMask The subnet mask of SubnetAddress.
+ @param GatewayAddress The gateway IP address for this route.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_NOT_STARTED The EFI UDPv4 Protocol instance has not been started.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ - RARP, etc.) is not finished yet.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES Could not add the entry to the routing table.
+ @retval EFI_NOT_FOUND This route is not in the routing table.
+ @retval EFI_ACCESS_DENIED The route is already defined in the routing table.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP4_ROUTES)(
+ IN EFI_UDP4_PROTOCOL *This,
+ IN BOOLEAN DeleteRoute,
+ IN EFI_IPv4_ADDRESS *SubnetAddress,
+ IN EFI_IPv4_ADDRESS *SubnetMask,
+ IN EFI_IPv4_ADDRESS *GatewayAddress
+ );
+
+/**
+ Polls for incoming data packets and processes outgoing data packets.
+
+ The Poll() function can be used by network drivers and applications to increase
+ the rate that data packets are moved between the communications device and the
+ transmit and receive queues.
+ In some systems, the periodic timer event in the managed network driver may not
+ poll the underlying communications device fast enough to transmit and/or receive
+ all data packets without missing incoming packets or dropping outgoing packets.
+ Drivers and applications that are experiencing packet loss should try calling
+ the Poll() function more often.
+
+ @param This The pointer to the EFI_UDP4_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP4_POLL)(
+ IN EFI_UDP4_PROTOCOL *This
+ );
+
+/**
+ Places an asynchronous receive request into the receiving queue.
+
+ The Receive() function places a completion token into the receive packet queue.
+ This function is always asynchronous.
+ The caller must fill in the Token.Event field in the completion token, and this
+ field cannot be NULL. When the receive operation completes, the EFI UDPv4 Protocol
+ driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event
+ is signaled. Providing a proper notification function and context for the event
+ will enable the user to receive the notification and receiving status. That
+ notification function is guaranteed to not be re-entered.
+
+ @param This The pointer to the EFI_UDP4_PROTOCOL instance.
+ @param Token The pointer to a token that is associated with the receive data
+ descriptor.
+
+ @retval EFI_SUCCESS The receive completion token was cached.
+ @retval EFI_NOT_STARTED This EFI UDPv4 Protocol instance has not been started.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, RARP, etc.)
+ is not finished yet.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER Token is NULL.
+ @retval EFI_INVALID_PARAMETER Token.Event is NULL.
+ @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of system
+ resources (usually memory).
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_ACCESS_DENIED A receive completion token with the same Token.Event was already in
+ the receive queue.
+ @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP4_RECEIVE)(
+ IN EFI_UDP4_PROTOCOL *This,
+ IN EFI_UDP4_COMPLETION_TOKEN *Token
+ );
+
+/**
+ Queues outgoing data packets into the transmit queue.
+
+ The Transmit() function places a sending request to this instance of the EFI
+ UDPv4 Protocol, alongside the transmit data that was filled by the user. Whenever
+ the packet in the token is sent out or some errors occur, the Token.Event will
+ be signaled and Token.Status is updated. Providing a proper notification function
+ and context for the event will enable the user to receive the notification and
+ transmitting status.
+
+ @param This The pointer to the EFI_UDP4_PROTOCOL instance.
+ @param Token The pointer to the completion token that will be placed into the
+ transmit queue.
+
+ @retval EFI_SUCCESS The data has been queued for transmission.
+ @retval EFI_NOT_STARTED This EFI UDPv4 Protocol instance has not been started.
+ @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_ACCESS_DENIED The transmit completion token with the same
+ Token.Event was already in the transmit queue.
+ @retval EFI_NOT_READY The completion token could not be queued because the
+ transmit queue is full.
+ @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.
+ @retval EFI_NOT_FOUND There is no route to the destination network or address.
+ @retval EFI_BAD_BUFFER_SIZE The data length is greater than the maximum UDP packet
+ size. Or the length of the IP header + UDP header + data
+ length is greater than MTU if DoNotFragment is TRUE.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP4_TRANSMIT)(
+ IN EFI_UDP4_PROTOCOL *This,
+ IN EFI_UDP4_COMPLETION_TOKEN *Token
+ );
+
+/**
+ Aborts an asynchronous transmit or receive request.
+
+ The Cancel() function is used to abort a pending transmit or receive request.
+ If the token is in the transmit or receive request queues, after calling this
+ function, Token.Status will be set to EFI_ABORTED and then Token.Event will be
+ signaled. If the token is not in one of the queues, which usually means that
+ the asynchronous operation has completed, this function will not signal the
+ token and EFI_NOT_FOUND is returned.
+
+ @param This The pointer to the EFI_UDP4_PROTOCOL instance.
+ @param Token The pointer to a token that has been issued by
+ EFI_UDP4_PROTOCOL.Transmit() or
+ EFI_UDP4_PROTOCOL.Receive().If NULL, all pending
+ tokens are aborted.
+
+ @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event
+ was signaled. When Token is NULL, all pending requests are
+ aborted and their events are signaled.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_STARTED This instance has not been started.
+ @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
+ RARP, etc.) is not finished yet.
+ @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was
+ not found in the transmit or receive queue. It has either completed
+ or was not issued by Transmit() and Receive().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP4_CANCEL)(
+ IN EFI_UDP4_PROTOCOL *This,
+ IN EFI_UDP4_COMPLETION_TOKEN *Token OPTIONAL
+ );
+
+///
+/// The EFI_UDP4_PROTOCOL defines an EFI UDPv4 Protocol session that can be used
+/// by any network drivers, applications, or daemons to transmit or receive UDP packets.
+/// This protocol instance can either be bound to a specified port as a service or
+/// connected to some remote peer as an active client. Each instance has its own settings,
+/// such as the routing table and group table, which are independent from each other.
+///
+struct _EFI_UDP4_PROTOCOL {
+ EFI_UDP4_GET_MODE_DATA GetModeData;
+ EFI_UDP4_CONFIGURE Configure;
+ EFI_UDP4_GROUPS Groups;
+ EFI_UDP4_ROUTES Routes;
+ EFI_UDP4_TRANSMIT Transmit;
+ EFI_UDP4_RECEIVE Receive;
+ EFI_UDP4_CANCEL Cancel;
+ EFI_UDP4_POLL Poll;
+};
+
+extern EFI_GUID gEfiUdp4ServiceBindingProtocolGuid;
+extern EFI_GUID gEfiUdp4ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Udp6.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Udp6.h
new file mode 100644
index 0000000000..e1e1dc694e
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Udp6.h
@@ -0,0 +1,580 @@
+/** @file
+ The EFI UDPv6 (User Datagram Protocol version 6) Protocol Definition, which is built upon
+ the EFI IPv6 Protocol and provides simple packet-oriented services to transmit and receive
+ UDP packets.
+
+ Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.2
+
+**/
+
+#ifndef __EFI_UDP6_PROTOCOL_H__
+#define __EFI_UDP6_PROTOCOL_H__
+
+#include <Protocol/Ip6.h>
+
+#define EFI_UDP6_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0x66ed4721, 0x3c98, 0x4d3e, {0x81, 0xe3, 0xd0, 0x3d, 0xd3, 0x9a, 0x72, 0x54 } \
+ }
+
+#define EFI_UDP6_PROTOCOL_GUID \
+ { \
+ 0x4f948815, 0xb4b9, 0x43cb, {0x8a, 0x33, 0x90, 0xe0, 0x60, 0xb3, 0x49, 0x55 } \
+ }
+
+///
+/// EFI_UDP6_SERVICE_POINT is deprecated in the UEFI 2.4B and should not be used any more.
+/// The definition in here is only present to provide backwards compatability.
+///
+typedef struct {
+ ///
+ /// The EFI UDPv6 Protocol instance handle that is using this address/port pair.
+ ///
+ EFI_HANDLE InstanceHandle;
+ ///
+ /// The IPv6 address to which this instance of the EFI UDPv6 Protocol is bound.
+ /// Set to 0::/128, if this instance is used to listen all packets from any
+ /// source address.
+ ///
+ EFI_IPv6_ADDRESS LocalAddress;
+ ///
+ /// The port number in host byte order on which the service is listening.
+ ///
+ UINT16 LocalPort;
+ ///
+ /// The IPv6 address of the remote host. May be 0::/128 if it is not connected
+ /// to any remote host or connected with more than one remote host.
+ ///
+ EFI_IPv6_ADDRESS RemoteAddress;
+ ///
+ /// The port number in host byte order on which the remote host is
+ /// listening. Maybe zero if it is not connected to any remote host.
+ ///
+ UINT16 RemotePort;
+} EFI_UDP6_SERVICE_POINT;
+
+///
+/// EFI_UDP6_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more.
+/// The definition in here is only present to provide backwards compatability.
+///
+typedef struct {
+ ///
+ /// The handle of the driver that creates this entry.
+ ///
+ EFI_HANDLE DriverHandle;
+ ///
+ /// The number of address/port pairs that follow this data structure.
+ ///
+ UINT32 ServiceCount;
+ ///
+ /// List of address/port pairs that are currently in use.
+ ///
+ EFI_UDP6_SERVICE_POINT Services[1];
+} EFI_UDP6_VARIABLE_DATA;
+
+typedef struct _EFI_UDP6_PROTOCOL EFI_UDP6_PROTOCOL;
+
+///
+/// EFI_UDP6_FRAGMENT_DATA allows multiple receive or transmit buffers to be specified.
+/// The purpose of this structure is to avoid copying the same packet multiple times.
+///
+typedef struct {
+ UINT32 FragmentLength; ///< Length of the fragment data buffer.
+ VOID *FragmentBuffer; ///< Pointer to the fragment data buffer.
+} EFI_UDP6_FRAGMENT_DATA;
+
+///
+/// The EFI_UDP6_SESSION_DATA is used to retrieve the settings when receiving packets or
+/// to override the existing settings (only DestinationAddress and DestinationPort can
+/// be overridden) of this EFI UDPv6 Protocol instance when sending packets.
+///
+typedef struct {
+ ///
+ /// Address from which this packet is sent. This field should not be used when
+ /// sending packets.
+ ///
+ EFI_IPv6_ADDRESS SourceAddress;
+ ///
+ /// Port from which this packet is sent. It is in host byte order. This field should
+ /// not be used when sending packets.
+ ///
+ UINT16 SourcePort;
+ ///
+ /// Address to which this packet is sent. When sending packet, it'll be ignored
+ /// if it is zero.
+ ///
+ EFI_IPv6_ADDRESS DestinationAddress;
+ ///
+ /// Port to which this packet is sent. When sending packet, it'll be
+ /// ignored if it is zero.
+ ///
+ UINT16 DestinationPort;
+} EFI_UDP6_SESSION_DATA;
+
+typedef struct {
+ ///
+ /// Set to TRUE to accept UDP packets that are sent to any address.
+ ///
+ BOOLEAN AcceptPromiscuous;
+ ///
+ /// Set to TRUE to accept UDP packets that are sent to any port.
+ ///
+ BOOLEAN AcceptAnyPort;
+ ///
+ /// Set to TRUE to allow this EFI UDPv6 Protocol child instance to open a port number
+ /// that is already being used by another EFI UDPv6 Protocol child instance.
+ ///
+ BOOLEAN AllowDuplicatePort;
+ ///
+ /// TrafficClass field in transmitted IPv6 packets.
+ ///
+ UINT8 TrafficClass;
+ ///
+ /// HopLimit field in transmitted IPv6 packets.
+ ///
+ UINT8 HopLimit;
+ ///
+ /// The receive timeout value (number of microseconds) to be associated with each
+ /// incoming packet. Zero means do not drop incoming packets.
+ ///
+ UINT32 ReceiveTimeout;
+ ///
+ /// The transmit timeout value (number of microseconds) to be associated with each
+ /// outgoing packet. Zero means do not drop outgoing packets.
+ ///
+ UINT32 TransmitTimeout;
+ ///
+ /// The station IP address that will be assigned to this EFI UDPv6 Protocol instance.
+ /// The EFI UDPv6 and EFI IPv6 Protocol drivers will only deliver incoming packets
+ /// whose destination matches this IP address exactly. Address 0::/128 is also accepted
+ /// as a special case. Under this situation, underlying IPv6 driver is responsible for
+ /// binding a source address to this EFI IPv6 protocol instance according to source
+ /// address selection algorithm. Only incoming packet from the selected source address
+ /// is delivered. This field can be set and changed only when the EFI IPv6 driver is
+ /// transitioning from the stopped to the started states. If no address is available
+ /// for selecting, the EFI IPv6 Protocol driver will use EFI_IP6_CONFIG_PROTOCOL to
+ /// retrieve the IPv6 address.
+ EFI_IPv6_ADDRESS StationAddress;
+ ///
+ /// The port number to which this EFI UDPv6 Protocol instance is bound. If a client
+ /// of the EFI UDPv6 Protocol does not care about the port number, set StationPort
+ /// to zero. The EFI UDPv6 Protocol driver will assign a random port number to transmitted
+ /// UDP packets. Ignored it if AcceptAnyPort is TRUE.
+ ///
+ UINT16 StationPort;
+ ///
+ /// The IP address of remote host to which this EFI UDPv6 Protocol instance is connecting.
+ /// If RemoteAddress is not 0::/128, this EFI UDPv6 Protocol instance will be connected to
+ /// RemoteAddress; i.e., outgoing packets of this EFI UDPv6 Protocol instance will be sent
+ /// to this address by default and only incoming packets from this address will be delivered
+ /// to client. Ignored for incoming filtering if AcceptPromiscuous is TRUE.
+ EFI_IPv6_ADDRESS RemoteAddress;
+ ///
+ /// The port number of the remote host to which this EFI UDPv6 Protocol instance is connecting.
+ /// If it is not zero, outgoing packets of this EFI UDPv6 Protocol instance will be sent to
+ /// this port number by default and only incoming packets from this port will be delivered
+ /// to client. Ignored if RemoteAddress is 0::/128 and ignored for incoming filtering if
+ /// AcceptPromiscuous is TRUE.
+ UINT16 RemotePort;
+} EFI_UDP6_CONFIG_DATA;
+
+///
+/// The EFI UDPv6 Protocol client must fill this data structure before sending a packet.
+/// The packet may contain multiple buffers that may be not in a continuous memory location.
+///
+typedef struct {
+ ///
+ /// If not NULL, the data that is used to override the transmitting settings.Only the two
+ /// filed UdpSessionData.DestinationAddress and UdpSessionData.DestionPort can be used as
+ /// the transmitting setting filed.
+ ///
+ EFI_UDP6_SESSION_DATA *UdpSessionData;
+ ///
+ /// Sum of the fragment data length. Must not exceed the maximum UDP packet size.
+ ///
+ UINT32 DataLength;
+ ///
+ /// Number of fragments.
+ ///
+ UINT32 FragmentCount;
+ ///
+ /// Array of fragment descriptors.
+ ///
+ EFI_UDP6_FRAGMENT_DATA FragmentTable[1];
+} EFI_UDP6_TRANSMIT_DATA;
+
+///
+/// EFI_UDP6_RECEIVE_DATA is filled by the EFI UDPv6 Protocol driver when this EFI UDPv6
+/// Protocol instance receives an incoming packet. If there is a waiting token for incoming
+/// packets, the CompletionToken.Packet.RxData field is updated to this incoming packet and
+/// the CompletionToken.Event is signaled. The EFI UDPv6 Protocol client must signal the
+/// RecycleSignal after processing the packet.
+/// FragmentTable could contain multiple buffers that are not in the continuous memory locations.
+/// The EFI UDPv6 Protocol client might need to combine two or more buffers in FragmentTable to
+/// form their own protocol header.
+///
+typedef struct {
+ ///
+ /// Time when the EFI UDPv6 Protocol accepted the packet.
+ ///
+ EFI_TIME TimeStamp;
+ ///
+ /// Indicates the event to signal when the received data has been processed.
+ ///
+ EFI_EVENT RecycleSignal;
+ ///
+ /// The UDP session data including SourceAddress, SourcePort, DestinationAddress,
+ /// and DestinationPort.
+ ///
+ EFI_UDP6_SESSION_DATA UdpSession;
+ ///
+ /// The sum of the fragment data length.
+ ///
+ UINT32 DataLength;
+ ///
+ /// Number of fragments. Maybe zero.
+ ///
+ UINT32 FragmentCount;
+ ///
+ /// Array of fragment descriptors. Maybe zero.
+ ///
+ EFI_UDP6_FRAGMENT_DATA FragmentTable[1];
+} EFI_UDP6_RECEIVE_DATA;
+
+///
+/// The EFI_UDP6_COMPLETION_TOKEN structures are used for both transmit and receive operations.
+/// When used for transmitting, the Event and TxData fields must be filled in by the EFI UDPv6
+/// Protocol client. After the transmit operation completes, the Status field is updated by the
+/// EFI UDPv6 Protocol and the Event is signaled.
+/// When used for receiving, only the Event field must be filled in by the EFI UDPv6 Protocol
+/// client. After a packet is received, RxData and Status are filled in by the EFI UDPv6 Protocol
+/// and the Event is signaled.
+///
+typedef struct {
+ ///
+ /// This Event will be signaled after the Status field is updated by the EFI UDPv6 Protocol
+ /// driver. The type of Event must be EVT_NOTIFY_SIGNAL.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// Will be set to one of the following values:
+ /// - EFI_SUCCESS: The receive or transmit operation completed successfully.
+ /// - EFI_ABORTED: The receive or transmit was aborted.
+ /// - EFI_TIMEOUT: The transmit timeout expired.
+ /// - EFI_NETWORK_UNREACHABLE: The destination network is unreachable. RxData is set to
+ /// NULL in this situation.
+ /// - EFI_HOST_UNREACHABLE: The destination host is unreachable. RxData is set to NULL in
+ /// this situation.
+ /// - EFI_PROTOCOL_UNREACHABLE: The UDP protocol is unsupported in the remote system.
+ /// RxData is set to NULL in this situation.
+ /// - EFI_PORT_UNREACHABLE: No service is listening on the remote port. RxData is set to
+ /// NULL in this situation.
+ /// - EFI_ICMP_ERROR: Some other Internet Control Message Protocol (ICMP) error report was
+ /// received. For example, packets are being sent too fast for the destination to receive them
+ /// and the destination sent an ICMP source quench report. RxData is set to NULL in this situation.
+ /// - EFI_DEVICE_ERROR: An unexpected system or network error occurred.
+ /// - EFI_SECURITY_VIOLATION: The transmit or receive was failed because of IPsec policy check.
+ /// - EFI_NO_MEDIA: There was a media error.
+ ///
+ EFI_STATUS Status;
+ union {
+ ///
+ /// When this token is used for receiving, RxData is a pointer to EFI_UDP6_RECEIVE_DATA.
+ ///
+ EFI_UDP6_RECEIVE_DATA *RxData;
+ ///
+ /// When this token is used for transmitting, TxData is a pointer to EFI_UDP6_TRANSMIT_DATA.
+ ///
+ EFI_UDP6_TRANSMIT_DATA *TxData;
+ } Packet;
+} EFI_UDP6_COMPLETION_TOKEN;
+
+/**
+ Read the current operational settings.
+
+ The GetModeData() function copies the current operational settings of this EFI UDPv6 Protocol
+ instance into user-supplied buffers. This function is used optionally to retrieve the operational
+ mode data of underlying networks or drivers.
+
+ @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
+ @param[out] Udp6ConfigData The buffer in which the current UDP configuration data is returned.
+ @param[out] Ip6ModeData The buffer in which the current EFI IPv6 Protocol mode data is returned.
+ @param[out] MnpConfigData The buffer in which the current managed network configuration data is
+ returned.
+ @param[out] SnpModeData The buffer in which the simple network mode data is returned.
+
+ @retval EFI_SUCCESS The mode data was read.
+ @retval EFI_NOT_STARTED When Udp6ConfigData is queried, no configuration data is available
+ because this instance has not been started.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP6_GET_MODE_DATA)(
+ IN EFI_UDP6_PROTOCOL *This,
+ OUT EFI_UDP6_CONFIG_DATA *Udp6ConfigData OPTIONAL,
+ OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,
+ OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
+ OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
+);
+
+/**
+ Initializes, changes, or resets the operational parameters for this instance of the EFI UDPv6
+ Protocol.
+
+ The Configure() function is used to do the following:
+ - Initialize and start this instance of the EFI UDPv6 Protocol.
+ - Change the filtering rules and operational parameters.
+ - Reset this instance of the EFI UDPv6 Protocol.
+
+ Until these parameters are initialized, no network traffic can be sent or received by this instance.
+ This instance can be also reset by calling Configure() with UdpConfigData set to NULL.
+ Once reset, the receiving queue and transmitting queue are flushed and no traffic is allowed through
+ this instance.
+
+ With different parameters in UdpConfigData, Configure() can be used to bind this instance to specified
+ port.
+
+ @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
+ @param[in] UdpConfigData Pointer to the buffer contained the configuration data.
+
+ @retval EFI_SUCCESS The configuration settings were set, changed, or reset successfully.
+ @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source
+ address for this instance, but no source address was available for use.
+ @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
+ - This is NULL.
+ - UdpConfigData.StationAddress neither zero nor one of the configured IP
+ addresses in the underlying IPv6 driver.
+ - UdpConfigData.RemoteAddress is not a valid unicast IPv6 address if it
+ is not zero.
+ @retval EFI_ALREADY_STARTED The EFI UDPv6 Protocol instance is already started/configured and must be
+ stopped/reset before it can be reconfigured. Only TrafficClass, HopLimit,
+ ReceiveTimeout, and TransmitTimeout can be reconfigured without stopping
+ the current instance of the EFI UDPv6 Protocol.
+ @retval EFI_ACCESS_DENIED UdpConfigData.AllowDuplicatePort is FALSE and UdpConfigData.StationPort
+ is already used by other instance.
+ @retval EFI_OUT_OF_RESOURCES The EFI UDPv6 Protocol driver cannot allocate memory for this EFI UDPv6
+ Protocol instance.
+ @retval EFI_DEVICE_ERROR An unexpected network or system error occurred and this instance was not
+ opened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP6_CONFIGURE)(
+ IN EFI_UDP6_PROTOCOL *This,
+ IN EFI_UDP6_CONFIG_DATA *UdpConfigData OPTIONAL
+);
+
+/**
+ Joins and leaves multicast groups.
+
+ The Groups() function is used to join or leave one or more multicast group.
+ If the JoinFlag is FALSE and the MulticastAddress is NULL, then all currently joined groups are left.
+
+ @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
+ @param[in] JoinFlag Set to TRUE to join a multicast group. Set to FALSE to leave one
+ or all multicast groups.
+ @param[in] MulticastAddress Pointer to multicast group address to join or leave.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_NOT_STARTED The EFI UDPv6 Protocol instance has not been started.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate resources to join the group.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - This is NULL.
+ - JoinFlag is TRUE and MulticastAddress is NULL.
+ - JoinFlag is TRUE and *MulticastAddress is not a valid multicast address.
+ @retval EFI_ALREADY_STARTED The group address is already in the group table (when JoinFlag is TRUE).
+ @retval EFI_NOT_FOUND The group address is not in the group table (when JoinFlag is FALSE).
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP6_GROUPS)(
+ IN EFI_UDP6_PROTOCOL *This,
+ IN BOOLEAN JoinFlag,
+ IN EFI_IPv6_ADDRESS *MulticastAddress OPTIONAL
+);
+
+/**
+ Queues outgoing data packets into the transmit queue.
+
+ The Transmit() function places a sending request to this instance of the EFI UDPv6 Protocol,
+ alongside the transmit data that was filled by the user. Whenever the packet in the token is
+ sent out or some errors occur, the Token.Event will be signaled and Token.Status is updated.
+ Providing a proper notification function and context for the event will enable the user to
+ receive the notification and transmitting status.
+
+ @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
+ @param[in] Token Pointer to the completion token that will be placed into the
+ transmit queue.
+
+ @retval EFI_SUCCESS The data has been queued for transmission.
+ @retval EFI_NOT_STARTED This EFI UDPv6 Protocol instance has not been started.
+ @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source
+ address for this instance, but no source address was available
+ for use.
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token.Event is NULL.
+ - Token.Packet.TxData is NULL.
+ - Token.Packet.TxData.FragmentCount is zero.
+ - Token.Packet.TxData.DataLength is not equal to the sum of fragment
+ lengths.
+ - One or more of the Token.Packet.TxData.FragmentTable[].FragmentLength
+ fields is zero.
+ - One or more of the Token.Packet.TxData.FragmentTable[].FragmentBuffer
+ fields is NULL.
+ - Token.Packet.TxData.UdpSessionData.DestinationAddress is not zero
+ and is not valid unicast Ipv6 address if UdpSessionData is not NULL.
+ - Token.Packet.TxData.UdpSessionData is NULL and this instance's
+ UdpConfigData.RemoteAddress is unspecified.
+ - Token.Packet.TxData.UdpSessionData.DestinationAddress is non-zero
+ when DestinationAddress is configured as non-zero when doing Configure()
+ for this EFI Udp6 protocol instance.
+ - Token.Packet.TxData.UdpSesionData.DestinationAddress is zero when
+ DestinationAddress is unspecified when doing Configure() for this
+ EFI Udp6 protocol instance.
+ @retval EFI_ACCESS_DENIED The transmit completion token with the same Token.Event was already
+ in the transmit queue.
+ @retval EFI_NOT_READY The completion token could not be queued because the transmit queue
+ is full.
+ @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.
+ @retval EFI_NOT_FOUND There is no route to the destination network or address.
+ @retval EFI_BAD_BUFFER_SIZE The data length is greater than the maximum UDP packet size.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP6_TRANSMIT)(
+ IN EFI_UDP6_PROTOCOL *This,
+ IN EFI_UDP6_COMPLETION_TOKEN *Token
+);
+
+/**
+ Places an asynchronous receive request into the receiving queue.
+
+ The Receive() function places a completion token into the receive packet queue. This function is
+ always asynchronous.
+ The caller must fill in the Token.Event field in the completion token, and this field cannot be
+ NULL. When the receive operation completes, the EFI UDPv6 Protocol driver updates the Token.Status
+ and Token.Packet.RxData fields and the Token.Event is signaled.
+ Providing a proper notification function and context for the event will enable the user to receive
+ the notification and receiving status. That notification function is guaranteed to not be re-entered.
+
+ @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
+ @param[in] Token Pointer to a token that is associated with the receive data descriptor.
+
+ @retval EFI_SUCCESS The receive completion token was cached.
+ @retval EFI_NOT_STARTED This EFI UDPv6 Protocol instance has not been started.
+ @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source
+ address for this instance, but no source address was available
+ for use.
+ @retval EFI_INVALID_PARAMETER One or more of the following is TRUE:
+ - This is NULL.
+ - Token is NULL.
+ - Token.Event is NULL.
+ @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of system
+ resources (usually memory).
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI UDPv6 Protocol
+ instance has been reset to startup defaults.
+ @retval EFI_ACCESS_DENIED A receive completion token with the same Token.Event was already in
+ the receive queue.
+ @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP6_RECEIVE)(
+ IN EFI_UDP6_PROTOCOL *This,
+ IN EFI_UDP6_COMPLETION_TOKEN *Token
+);
+
+/**
+ Aborts an asynchronous transmit or receive request.
+
+ The Cancel() function is used to abort a pending transmit or receive request. If the token is in the
+ transmit or receive request queues, after calling this function, Token.Status will be set to
+ EFI_ABORTED and then Token.Event will be signaled. If the token is not in one of the queues,
+ which usually means that the asynchronous operation has completed, this function will not signal the
+ token and EFI_NOT_FOUND is returned.
+
+ @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
+ @param[in] Token Pointer to a token that has been issued by EFI_UDP6_PROTOCOL.Transmit()
+ or EFI_UDP6_PROTOCOL.Receive().If NULL, all pending tokens are aborted.
+
+ @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event was signaled.
+ When Token is NULL, all pending requests are aborted and their events
+ are signaled.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_STARTED This instance has not been started.
+ @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was not found in
+ the transmit or receive queue. It has either completed or was not issued
+ by Transmit() and Receive().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP6_CANCEL)(
+ IN EFI_UDP6_PROTOCOL *This,
+ IN EFI_UDP6_COMPLETION_TOKEN *Token OPTIONAL
+);
+
+/**
+ Polls for incoming data packets and processes outgoing data packets.
+
+ The Poll() function can be used by network drivers and applications to increase the rate that data
+ packets are moved between the communications device and the transmit and receive queues.
+ In some systems, the periodic timer event in the managed network driver may not poll the underlying
+ communications device fast enough to transmit and/or receive all data packets without missing incoming
+ packets or dropping outgoing packets. Drivers and applications that are experiencing packet loss should
+ try calling the Poll() function more often.
+
+ @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
+
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
+ Consider increasing the polling rate.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UDP6_POLL)(
+ IN EFI_UDP6_PROTOCOL *This
+);
+
+///
+/// The EFI_UDP6_PROTOCOL defines an EFI UDPv6 Protocol session that can be used by any network drivers,
+/// applications, or daemons to transmit or receive UDP packets. This protocol instance can either be
+/// bound to a specified port as a service or connected to some remote peer as an active client.
+/// Each instance has its own settings, such as group table, that are independent from each other.
+///
+struct _EFI_UDP6_PROTOCOL {
+ EFI_UDP6_GET_MODE_DATA GetModeData;
+ EFI_UDP6_CONFIGURE Configure;
+ EFI_UDP6_GROUPS Groups;
+ EFI_UDP6_TRANSMIT Transmit;
+ EFI_UDP6_RECEIVE Receive;
+ EFI_UDP6_CANCEL Cancel;
+ EFI_UDP6_POLL Poll;
+};
+
+extern EFI_GUID gEfiUdp6ServiceBindingProtocolGuid;
+extern EFI_GUID gEfiUdp6ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UfsDeviceConfig.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UfsDeviceConfig.h
new file mode 100644
index 0000000000..e1b278db76
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UfsDeviceConfig.h
@@ -0,0 +1,143 @@
+/** @file
+ This file defines the EFI UFS Device Config Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.7
+
+**/
+
+#ifndef __UFS_DEVICE_CONFIG_PROTOCOL_H__
+#define __UFS_DEVICE_CONFIG_PROTOCOL_H__
+
+//
+// EFI UFS Device Config Protocol GUID value
+//
+#define EFI_UFS_DEVICE_CONFIG_GUID \
+ { 0xb81bfab0, 0xeb3, 0x4cf9, { 0x84, 0x65, 0x7f, 0xa9, 0x86, 0x36, 0x16, 0x64 }};
+
+//
+// Forward reference for pure ANSI compatability
+//
+typedef struct _EFI_UFS_DEVICE_CONFIG_PROTOCOL EFI_UFS_DEVICE_CONFIG_PROTOCOL;
+
+/**
+ Read or write specified device descriptor of a UFS device.
+
+ The service is used to read/write UFS device descriptors. The consumer of this API is responsible
+ for allocating the data buffer pointed by Descriptor.
+
+ @param[in] This The pointer to the EFI_UFS_DEVICE_CONFIG_PROTOCOL instance.
+ @param[in] Read The boolean variable to show r/w direction.
+ @param[in] DescId The ID of device descriptor.
+ @param[in] Index The Index of device descriptor.
+ @param[in] Selector The Selector of device descriptor.
+ @param[in, out] Descriptor The buffer of device descriptor to be read or written.
+ @param[in, out] DescSize The size of device descriptor buffer. On input, the size, in bytes,
+ of the data buffer specified by Descriptor. On output, the number
+ of bytes that were actually transferred.
+
+ @retval EFI_SUCCESS The device descriptor is read/written successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL or Descriptor is NULL or DescSize is NULL.
+ DescId, Index and Selector are invalid combination to point to a
+ type of UFS device descriptor.
+ @retval EFI_DEVICE_ERROR The device descriptor is not read/written successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_DESCRIPTOR) (
+ IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This,
+ IN BOOLEAN Read,
+ IN UINT8 DescId,
+ IN UINT8 Index,
+ IN UINT8 Selector,
+ IN OUT UINT8 *Descriptor,
+ IN OUT UINT32 *DescSize
+ );
+
+/**
+ Read or write specified flag of a UFS device.
+
+ The service is used to read/write UFS flag descriptors. The consumer of this API is responsible
+ for allocating the buffer pointed by Flag. The buffer size is 1 byte as UFS flag descriptor is
+ just a single Boolean value that represents a TRUE or FALSE, '0' or '1', ON or OFF type of value.
+
+ @param[in] This The pointer to the EFI_UFS_DEVICE_CONFIG_PROTOCOL instance.
+ @param[in] Read The boolean variable to show r/w direction.
+ @param[in] FlagId The ID of flag to be read or written.
+ @param[in, out] Flag The buffer to set or clear flag.
+
+ @retval EFI_SUCCESS The flag descriptor is set/clear successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL or Flag is NULL.
+ FlagId is an invalid UFS flag ID.
+ @retval EFI_DEVICE_ERROR The flag is not set/clear successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_FLAG) (
+ IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This,
+ IN BOOLEAN Read,
+ IN UINT8 FlagId,
+ IN OUT UINT8 *Flag
+ );
+
+/**
+ Read or write specified attribute of a UFS device.
+
+ The service is used to read/write UFS attributes. The consumer of this API is responsible for
+ allocating the data buffer pointed by Attribute.
+
+ @param[in] This The pointer to the EFI_UFS_DEVICE_CONFIG_PROTOCOL instance.
+ @param[in] Read The boolean variable to show r/w direction.
+ @param[in] AttrId The ID of Attribute.
+ @param[in] Index The Index of Attribute.
+ @param[in] Selector The Selector of Attribute.
+ @param[in, out] Attribute The buffer of Attribute to be read or written.
+ @param[in, out] AttrSize The size of Attribute buffer. On input, the size, in bytes, of the
+ data buffer specified by Attribute. On output, the number of bytes
+ that were actually transferred.
+
+ @retval EFI_SUCCESS The attribute is read/written successfully.
+ @retval EFI_INVALID_PARAMETER This is NULL or Attribute is NULL or AttrSize is NULL.
+ AttrId, Index and Selector are invalid combination to point to a
+ type of UFS attribute.
+ @retval EFI_DEVICE_ERROR The attribute is not read/written successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_ATTRIBUTE) (
+ IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This,
+ IN BOOLEAN Read,
+ IN UINT8 AttrId,
+ IN UINT8 Index,
+ IN UINT8 Selector,
+ IN OUT UINT8 *Attribute,
+ IN OUT UINT32 *AttrSize
+ );
+
+///
+/// UFS Device Config Protocol structure.
+///
+struct _EFI_UFS_DEVICE_CONFIG_PROTOCOL {
+ EFI_UFS_DEVICE_CONFIG_RW_DESCRIPTOR RwUfsDescriptor;
+ EFI_UFS_DEVICE_CONFIG_RW_FLAG RwUfsFlag;
+ EFI_UFS_DEVICE_CONFIG_RW_ATTRIBUTE RwUfsAttribute;
+};
+
+///
+/// UFS Device Config Protocol GUID variable.
+///
+extern EFI_GUID gEfiUfsDeviceConfigProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UgaDraw.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UgaDraw.h
new file mode 100644
index 0000000000..f501a6c17f
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UgaDraw.h
@@ -0,0 +1,166 @@
+/** @file
+ UGA Draw protocol from the EFI 1.10 specification.
+
+ Abstraction of a very simple graphics device.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __UGA_DRAW_H__
+#define __UGA_DRAW_H__
+
+
+#define EFI_UGA_DRAW_PROTOCOL_GUID \
+ { \
+ 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
+ }
+
+typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
+
+/**
+ Return the current video mode information.
+
+ @param This The EFI_UGA_DRAW_PROTOCOL instance.
+ @param HorizontalResolution The size of video screen in pixels in the X dimension.
+ @param VerticalResolution The size of video screen in pixels in the Y dimension.
+ @param ColorDepth Number of bits per pixel, currently defined to be 32.
+ @param RefreshRate The refresh rate of the monitor in Hertz.
+
+ @retval EFI_SUCCESS Mode information returned.
+ @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
+ @retval EFI_INVALID_PARAMETER One of the input args was NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE)(
+ IN EFI_UGA_DRAW_PROTOCOL *This,
+ OUT UINT32 *HorizontalResolution,
+ OUT UINT32 *VerticalResolution,
+ OUT UINT32 *ColorDepth,
+ OUT UINT32 *RefreshRate
+ );
+
+/**
+ Set the current video mode information.
+
+ @param This The EFI_UGA_DRAW_PROTOCOL instance.
+ @param HorizontalResolution The size of video screen in pixels in the X dimension.
+ @param VerticalResolution The size of video screen in pixels in the Y dimension.
+ @param ColorDepth Number of bits per pixel, currently defined to be 32.
+ @param RefreshRate The refresh rate of the monitor in Hertz.
+
+ @retval EFI_SUCCESS Mode information returned.
+ @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE)(
+ IN EFI_UGA_DRAW_PROTOCOL *This,
+ IN UINT32 HorizontalResolution,
+ IN UINT32 VerticalResolution,
+ IN UINT32 ColorDepth,
+ IN UINT32 RefreshRate
+ );
+
+typedef struct {
+ UINT8 Blue;
+ UINT8 Green;
+ UINT8 Red;
+ UINT8 Reserved;
+} EFI_UGA_PIXEL;
+
+typedef union {
+ EFI_UGA_PIXEL Pixel;
+ UINT32 Raw;
+} EFI_UGA_PIXEL_UNION;
+
+///
+/// Enumration value for actions of Blt operations.
+///
+typedef enum {
+ EfiUgaVideoFill, ///< Write data from the BltBuffer pixel (SourceX, SourceY)
+ ///< directly to every pixel of the video display rectangle
+ ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
+ ///< Only one pixel will be used from the BltBuffer. Delta is NOT used.
+
+ EfiUgaVideoToBltBuffer, ///< Read data from the video display rectangle
+ ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
+ ///< the BltBuffer rectangle (DestinationX, DestinationY )
+ ///< (DestinationX + Width, DestinationY + Height). If DestinationX or
+ ///< DestinationY is not zero then Delta must be set to the length in bytes
+ ///< of a row in the BltBuffer.
+
+ EfiUgaBltBufferToVideo, ///< Write data from the BltBuffer rectangle
+ ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
+ ///< video display rectangle (DestinationX, DestinationY)
+ ///< (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
+ ///< not zero then Delta must be set to the length in bytes of a row in the
+ ///< BltBuffer.
+
+ EfiUgaVideoToVideo, ///< Copy from the video display rectangle (SourceX, SourceY)
+ ///< (SourceX + Width, SourceY + Height) .to the video display rectangle
+ ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
+ ///< The BltBuffer and Delta are not used in this mode.
+
+ EfiUgaBltMax ///< Maxmimum value for enumration value of Blt operation. If a Blt operation
+ ///< larger or equal to this enumration value, it is invalid.
+} EFI_UGA_BLT_OPERATION;
+
+/**
+ Blt a rectangle of pixels on the graphics screen.
+
+ @param[in] This - Protocol instance pointer.
+ @param[in] BltBuffer - Buffer containing data to blit into video buffer. This
+ buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
+ @param[in] BltOperation - Operation to perform on BlitBuffer and video memory
+ @param[in] SourceX - X coordinate of source for the BltBuffer.
+ @param[in] SourceY - Y coordinate of source for the BltBuffer.
+ @param[in] DestinationX - X coordinate of destination for the BltBuffer.
+ @param[in] DestinationY - Y coordinate of destination for the BltBuffer.
+ @param[in] Width - Width of rectangle in BltBuffer in pixels.
+ @param[in] Height - Hight of rectangle in BltBuffer in pixels.
+ @param[in] Delta - OPTIONAL
+
+ @retval EFI_SUCCESS - The Blt operation completed.
+ @retval EFI_INVALID_PARAMETER - BltOperation is not valid.
+ @retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT)(
+ IN EFI_UGA_DRAW_PROTOCOL * This,
+ IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL
+ IN EFI_UGA_BLT_OPERATION BltOperation,
+ IN UINTN SourceX,
+ IN UINTN SourceY,
+ IN UINTN DestinationX,
+ IN UINTN DestinationY,
+ IN UINTN Width,
+ IN UINTN Height,
+ IN UINTN Delta OPTIONAL
+ );
+
+///
+/// This protocol provides a basic abstraction to set video modes and
+/// copy pixels to and from the graphics controller's frame buffer.
+///
+struct _EFI_UGA_DRAW_PROTOCOL {
+ EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;
+ EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;
+ EFI_UGA_DRAW_PROTOCOL_BLT Blt;
+};
+
+extern EFI_GUID gEfiUgaDrawProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UgaIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UgaIo.h
new file mode 100644
index 0000000000..9638a72240
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UgaIo.h
@@ -0,0 +1,197 @@
+/** @file
+ UGA IO protocol from the EFI 1.10 specification.
+
+ Abstraction of a very simple graphics device.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __UGA_IO_H__
+#define __UGA_IO_H__
+
+#define EFI_UGA_IO_PROTOCOL_GUID \
+ { 0x61a4d49e, 0x6f68, 0x4f1b, { 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0xb, 0x7, 0xa2 } }
+
+typedef struct _EFI_UGA_IO_PROTOCOL EFI_UGA_IO_PROTOCOL;
+
+typedef UINT32 UGA_STATUS;
+
+typedef enum {
+ UgaDtParentBus = 1,
+ UgaDtGraphicsController,
+ UgaDtOutputController,
+ UgaDtOutputPort,
+ UgaDtOther
+} UGA_DEVICE_TYPE, *PUGA_DEVICE_TYPE;
+
+typedef UINT32 UGA_DEVICE_ID, *PUGA_DEVICE_ID;
+
+typedef struct {
+ UGA_DEVICE_TYPE deviceType;
+ UGA_DEVICE_ID deviceId;
+ UINT32 ui32DeviceContextSize;
+ UINT32 ui32SharedContextSize;
+} UGA_DEVICE_DATA, *PUGA_DEVICE_DATA;
+
+typedef struct _UGA_DEVICE {
+ VOID *pvDeviceContext;
+ VOID *pvSharedContext;
+ VOID *pvRunTimeContext;
+ struct _UGA_DEVICE *pParentDevice;
+ VOID *pvBusIoServices;
+ VOID *pvStdIoServices;
+ UGA_DEVICE_DATA deviceData;
+} UGA_DEVICE, *PUGA_DEVICE;
+
+typedef enum {
+ UgaIoGetVersion = 1,
+ UgaIoGetChildDevice,
+ UgaIoStartDevice,
+ UgaIoStopDevice,
+ UgaIoFlushDevice,
+ UgaIoResetDevice,
+ UgaIoGetDeviceState,
+ UgaIoSetDeviceState,
+ UgaIoSetPowerState,
+ UgaIoGetMemoryConfiguration,
+ UgaIoSetVideoMode,
+ UgaIoCopyRectangle,
+ UgaIoGetEdidSegment,
+ UgaIoDeviceChannelOpen,
+ UgaIoDeviceChannelClose,
+ UgaIoDeviceChannelRead,
+ UgaIoDeviceChannelWrite,
+ UgaIoGetPersistentDataSize,
+ UgaIoGetPersistentData,
+ UgaIoSetPersistentData,
+ UgaIoGetDevicePropertySize,
+ UgaIoGetDeviceProperty,
+ UgaIoBtPrivateInterface
+} UGA_IO_REQUEST_CODE, *PUGA_IO_REQUEST_CODE;
+
+typedef struct {
+ IN UGA_IO_REQUEST_CODE ioRequestCode;
+ IN VOID *pvInBuffer;
+ IN UINT64 ui64InBufferSize;
+ OUT VOID *pvOutBuffer;
+ IN UINT64 ui64OutBufferSize;
+ OUT UINT64 ui64BytesReturned;
+} UGA_IO_REQUEST, *PUGA_IO_REQUEST;
+
+
+/**
+ Dynamically allocate storage for a child UGA_DEVICE.
+
+ @param[in] This The EFI_UGA_IO_PROTOCOL instance.
+ @param[in] ParentDevice ParentDevice specifies a pointer to the parent device of Device.
+ @param[in] DeviceData A pointer to UGA_DEVICE_DATA returned from a call to DispatchService()
+ with a UGA_DEVICE of Parent and an IoRequest of type UgaIoGetChildDevice.
+ @param[in] RunTimeContext Context to associate with Device.
+ @param[out] Device The Device returns a dynamically allocated child UGA_DEVICE object
+ for ParentDevice. The caller is responsible for deleting Device.
+
+
+ @retval EFI_SUCCESS Device was returned.
+ @retval EFI_INVALID_PARAMETER One of the arguments was not valid.
+ @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UGA_IO_PROTOCOL_CREATE_DEVICE)(
+ IN EFI_UGA_IO_PROTOCOL *This,
+ IN UGA_DEVICE *ParentDevice,
+ IN UGA_DEVICE_DATA *DeviceData,
+ IN VOID *RunTimeContext,
+ OUT UGA_DEVICE **Device
+ );
+
+
+/**
+ Delete a dynamically allocated child UGA_DEVICE object that was allocated via CreateDevice().
+
+ @param[in] This The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is
+ defined in Section 10.7.
+ @param[in] Device The Device points to a UGA_DEVICE object that was dynamically
+ allocated via a CreateDevice() call.
+
+
+ @retval EFI_SUCCESS Device was returned.
+ @retval EFI_INVALID_PARAMETER The Device was not allocated via CreateDevice().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UGA_IO_PROTOCOL_DELETE_DEVICE)(
+ IN EFI_UGA_IO_PROTOCOL * This,
+ IN UGA_DEVICE * Device
+ );
+
+/**
+ This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.
+
+ @param pDevice pDevice specifies a pointer to a device object associated with a
+ device enumerated by a pIoRequest->ioRequestCode of type
+ UgaIoGetChildDevice. The root device for the EFI_UGA_IO_PROTOCOL
+ is represented by pDevice being set to NULL.
+
+ @param pIoRequest
+ pIoRequest points to a caller allocated buffer that contains data
+ defined by pIoRequest->ioRequestCode. See Related Definitions for
+ a definition of UGA_IO_REQUEST_CODE s and their associated data
+ structures.
+
+ @return UGA_STATUS
+
+**/
+typedef UGA_STATUS
+(EFIAPI *PUGA_FW_SERVICE_DISPATCH)(
+ IN PUGA_DEVICE pDevice,
+ IN OUT PUGA_IO_REQUEST pIoRequest
+ );
+
+///
+/// Provides a basic abstraction to send I/O requests to the graphics device and any of its children.
+///
+struct _EFI_UGA_IO_PROTOCOL {
+ EFI_UGA_IO_PROTOCOL_CREATE_DEVICE CreateDevice;
+ EFI_UGA_IO_PROTOCOL_DELETE_DEVICE DeleteDevice;
+ PUGA_FW_SERVICE_DISPATCH DispatchService;
+};
+
+extern EFI_GUID gEfiUgaIoProtocolGuid;
+
+//
+// Data structure that is stored in the EFI Configuration Table with the
+// EFI_UGA_IO_PROTOCOL_GUID. The option ROMs listed in this table may have
+// EBC UGA drivers.
+//
+typedef struct {
+ UINT32 Version;
+ UINT32 HeaderSize;
+ UINT32 SizeOfEntries;
+ UINT32 NumberOfEntries;
+} EFI_DRIVER_OS_HANDOFF_HEADER;
+
+typedef enum {
+ EfiUgaDriverFromPciRom,
+ EfiUgaDriverFromSystem,
+ EfiDriverHandoffMax
+} EFI_DRIVER_HANOFF_ENUM;
+
+typedef struct {
+ EFI_DRIVER_HANOFF_ENUM Type;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ VOID *PciRomImage;
+ UINT64 PciRomSize;
+} EFI_DRIVER_OS_HANDOFF;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UnicodeCollation.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UnicodeCollation.h
new file mode 100644
index 0000000000..96cff3444e
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UnicodeCollation.h
@@ -0,0 +1,192 @@
+/** @file
+ Unicode Collation protocol that follows the UEFI 2.0 specification.
+ This protocol is used to allow code running in the boot services environment
+ to perform lexical comparison functions on Unicode strings for given languages.
+
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __UNICODE_COLLATION_H__
+#define __UNICODE_COLLATION_H__
+
+#define EFI_UNICODE_COLLATION_PROTOCOL_GUID \
+ { \
+ 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
+ }
+
+#define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \
+ { \
+ 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49 } \
+ }
+
+typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL;
+
+
+///
+/// Protocol GUID name defined in EFI1.1.
+///
+#define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID
+
+///
+/// Protocol defined in EFI1.1.
+///
+typedef EFI_UNICODE_COLLATION_PROTOCOL UNICODE_COLLATION_INTERFACE;
+
+///
+/// Protocol data structures and defines
+///
+#define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)
+
+//
+// Protocol member functions
+//
+/**
+ Performs a case-insensitive comparison of two Null-terminated strings.
+
+ @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
+ @param Str1 A pointer to a Null-terminated string.
+ @param Str2 A pointer to a Null-terminated string.
+
+ @retval 0 Str1 is equivalent to Str2.
+ @retval >0 Str1 is lexically greater than Str2.
+ @retval <0 Str1 is lexically less than Str2.
+
+**/
+typedef
+INTN
+(EFIAPI *EFI_UNICODE_COLLATION_STRICOLL)(
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN CHAR16 *Str1,
+ IN CHAR16 *Str2
+ );
+
+/**
+ Performs a case-insensitive comparison of a Null-terminated
+ pattern string and a Null-terminated string.
+
+ @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
+ @param String A pointer to a Null-terminated string.
+ @param Pattern A pointer to a Null-terminated pattern string.
+
+ @retval TRUE Pattern was found in String.
+ @retval FALSE Pattern was not found in String.
+
+**/
+typedef
+BOOLEAN
+(EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH)(
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN CHAR16 *String,
+ IN CHAR16 *Pattern
+ );
+
+/**
+ Converts all the characters in a Null-terminated string to
+ lower case characters.
+
+ @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
+ @param String A pointer to a Null-terminated string.
+
+**/
+typedef
+VOID
+(EFIAPI *EFI_UNICODE_COLLATION_STRLWR)(
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN OUT CHAR16 *Str
+ );
+
+/**
+ Converts all the characters in a Null-terminated string to upper
+ case characters.
+
+ @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
+ @param String A pointer to a Null-terminated string.
+
+**/
+typedef
+VOID
+(EFIAPI *EFI_UNICODE_COLLATION_STRUPR)(
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN OUT CHAR16 *Str
+ );
+
+/**
+ Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
+ string.
+
+ @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
+ @param FatSize The size of the string Fat in bytes.
+ @param Fat A pointer to a Null-terminated string that contains an 8.3 file
+ name using an 8-bit OEM character set.
+ @param String A pointer to a Null-terminated string. The string must
+ be allocated in advance to hold FatSize characters.
+
+**/
+typedef
+VOID
+(EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR)(
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN UINTN FatSize,
+ IN CHAR8 *Fat,
+ OUT CHAR16 *String
+ );
+
+/**
+ Converts a Null-terminated string to legal characters in a FAT
+ filename using an OEM character set.
+
+ @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
+ @param String A pointer to a Null-terminated string.
+ @param FatSize The size of the string Fat in bytes.
+ @param Fat A pointer to a string that contains the converted version of
+ String using legal FAT characters from an OEM character set.
+
+ @retval TRUE One or more conversions failed and were substituted with '_'
+ @retval FALSE None of the conversions failed.
+
+**/
+typedef
+BOOLEAN
+(EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT)(
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN CHAR16 *String,
+ IN UINTN FatSize,
+ OUT CHAR8 *Fat
+ );
+
+///
+/// The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive
+/// comparisons of strings.
+///
+struct _EFI_UNICODE_COLLATION_PROTOCOL {
+ EFI_UNICODE_COLLATION_STRICOLL StriColl;
+ EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;
+ EFI_UNICODE_COLLATION_STRLWR StrLwr;
+ EFI_UNICODE_COLLATION_STRUPR StrUpr;
+
+ //
+ // for supporting fat volumes
+ //
+ EFI_UNICODE_COLLATION_FATTOSTR FatToStr;
+ EFI_UNICODE_COLLATION_STRTOFAT StrToFat;
+
+ ///
+ /// A Null-terminated ASCII string array that contains one or more language codes.
+ /// When this field is used for UnicodeCollation2, it is specified in RFC 4646 format.
+ /// When it is used for UnicodeCollation, it is specified in ISO 639-2 format.
+ ///
+ CHAR8 *SupportedLanguages;
+};
+
+extern EFI_GUID gEfiUnicodeCollationProtocolGuid;
+extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Usb2HostController.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Usb2HostController.h
new file mode 100644
index 0000000000..6a0e7be80a
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Usb2HostController.h
@@ -0,0 +1,664 @@
+/** @file
+ EFI_USB2_HC_PROTOCOL as defined in UEFI 2.0.
+ The USB Host Controller Protocol is used by code, typically USB bus drivers,
+ running in the EFI boot services environment, to perform data transactions over
+ a USB bus. In addition, it provides an abstraction for the root hub of the USB bus.
+
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _USB2_HOSTCONTROLLER_H_
+#define _USB2_HOSTCONTROLLER_H_
+
+#include <Protocol/UsbIo.h>
+
+#define EFI_USB2_HC_PROTOCOL_GUID \
+ { \
+ 0x3e745226, 0x9818, 0x45b6, {0xa2, 0xac, 0xd7, 0xcd, 0xe, 0x8b, 0xa2, 0xbc } \
+ }
+
+///
+/// Forward reference for pure ANSI compatability
+///
+typedef struct _EFI_USB2_HC_PROTOCOL EFI_USB2_HC_PROTOCOL;
+
+
+typedef struct {
+ UINT16 PortStatus; ///< Contains current port status bitmap.
+ UINT16 PortChangeStatus; ///< Contains current port status change bitmap.
+} EFI_USB_PORT_STATUS;
+
+///
+/// EFI_USB_PORT_STATUS.PortStatus bit definition
+///
+#define USB_PORT_STAT_CONNECTION 0x0001
+#define USB_PORT_STAT_ENABLE 0x0002
+#define USB_PORT_STAT_SUSPEND 0x0004
+#define USB_PORT_STAT_OVERCURRENT 0x0008
+#define USB_PORT_STAT_RESET 0x0010
+#define USB_PORT_STAT_POWER 0x0100
+#define USB_PORT_STAT_LOW_SPEED 0x0200
+#define USB_PORT_STAT_HIGH_SPEED 0x0400
+#define USB_PORT_STAT_SUPER_SPEED 0x0800
+#define USB_PORT_STAT_OWNER 0x2000
+
+///
+/// EFI_USB_PORT_STATUS.PortChangeStatus bit definition
+///
+#define USB_PORT_STAT_C_CONNECTION 0x0001
+#define USB_PORT_STAT_C_ENABLE 0x0002
+#define USB_PORT_STAT_C_SUSPEND 0x0004
+#define USB_PORT_STAT_C_OVERCURRENT 0x0008
+#define USB_PORT_STAT_C_RESET 0x0010
+
+
+///
+/// Usb port features value
+/// Each value indicates its bit index in the port status and status change bitmaps,
+/// if combines these two bitmaps into a 32-bit bitmap.
+///
+typedef enum {
+ EfiUsbPortEnable = 1,
+ EfiUsbPortSuspend = 2,
+ EfiUsbPortReset = 4,
+ EfiUsbPortPower = 8,
+ EfiUsbPortOwner = 13,
+ EfiUsbPortConnectChange = 16,
+ EfiUsbPortEnableChange = 17,
+ EfiUsbPortSuspendChange = 18,
+ EfiUsbPortOverCurrentChange = 19,
+ EfiUsbPortResetChange = 20
+} EFI_USB_PORT_FEATURE;
+
+#define EFI_USB_SPEED_FULL 0x0000 ///< 12 Mb/s, USB 1.1 OHCI and UHCI HC.
+#define EFI_USB_SPEED_LOW 0x0001 ///< 1 Mb/s, USB 1.1 OHCI and UHCI HC.
+#define EFI_USB_SPEED_HIGH 0x0002 ///< 480 Mb/s, USB 2.0 EHCI HC.
+#define EFI_USB_SPEED_SUPER 0x0003 ///< 4.8 Gb/s, USB 3.0 XHCI HC.
+
+typedef struct {
+ UINT8 TranslatorHubAddress; ///< device address
+ UINT8 TranslatorPortNumber; ///< the port number of the hub that device is connected to.
+} EFI_USB2_HC_TRANSACTION_TRANSLATOR;
+
+//
+// Protocol definitions
+//
+
+/**
+ Retrieves the Host Controller capabilities.
+
+ @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
+ @param MaxSpeed Host controller data transfer speed.
+ @param PortNumber Number of the root hub ports.
+ @param Is64BitCapable TRUE if controller supports 64-bit memory addressing,
+ FALSE otherwise.
+
+ @retval EFI_SUCCESS The host controller capabilities were retrieved successfully.
+ @retval EFI_INVALID_PARAMETER One of the input args was NULL.
+ @retval EFI_DEVICE_ERROR An error was encountered while attempting to
+ retrieve the capabilities.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_CAPABILITY)(
+ IN EFI_USB2_HC_PROTOCOL *This,
+ OUT UINT8 *MaxSpeed,
+ OUT UINT8 *PortNumber,
+ OUT UINT8 *Is64BitCapable
+ );
+
+#define EFI_USB_HC_RESET_GLOBAL 0x0001
+#define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002
+#define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004
+#define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008
+/**
+ Provides software reset for the USB host controller.
+
+ @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
+ @param Attributes A bit mask of the reset operation to perform.
+
+ @retval EFI_SUCCESS The reset operation succeeded.
+ @retval EFI_INVALID_PARAMETER Attributes is not valid.
+ @retval EFI_UNSUPPORTED The type of reset specified by Attributes is not currently
+ supported by the host controller hardware.
+ @retval EFI_ACCESS_DENIED Reset operation is rejected due to the debug port being configured
+ and active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or
+ EFI_USB_HC_RESET_HOST_WITH_DEBUG reset Attributes can be used to
+ perform reset operation for this host controller.
+ @retval EFI_DEVICE_ERROR An error was encountered while attempting to
+ retrieve the capabilities.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_RESET)(
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT16 Attributes
+ );
+
+/**
+ Enumration value for status of USB HC.
+**/
+typedef enum {
+ EfiUsbHcStateHalt, ///< The host controller is in halt
+ ///< state. No USB transactions can occur
+ ///< while in this state. The host
+ ///< controller can enter this state for
+ ///< three reasons: 1) After host
+ ///< controller hardware reset. 2)
+ ///< Explicitly set by software. 3)
+ ///< Triggered by a fatal error such as
+ ///< consistency check failure.
+
+ EfiUsbHcStateOperational, ///< The host controller is in an
+ ///< operational state. When in
+ ///< this state, the host
+ ///< controller can execute bus
+ ///< traffic. This state must be
+ ///< explicitly set to enable the
+ ///< USB bus traffic.
+
+ EfiUsbHcStateSuspend, ///< The host controller is in the
+ ///< suspend state. No USB
+ ///< transactions can occur while in
+ ///< this state. The host controller
+ ///< enters this state for the
+ ///< following reasons: 1) Explicitly
+ ///< set by software. 2) Triggered
+ ///< when there is no bus traffic for
+ ///< 3 microseconds.
+
+ EfiUsbHcStateMaximum ///< Maximum value for enumration value of HC status.
+} EFI_USB_HC_STATE;
+
+/**
+ Retrieves current state of the USB host controller.
+
+ @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
+ @param State A pointer to the EFI_USB_HC_STATE data structure that
+ indicates current state of the USB host controller.
+
+ @retval EFI_SUCCESS The state information of the host controller was returned in State.
+ @retval EFI_INVALID_PARAMETER State is NULL.
+ @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the
+ host controller's current state.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE)(
+ IN EFI_USB2_HC_PROTOCOL *This,
+ OUT EFI_USB_HC_STATE *State
+);
+
+/**
+ Sets the USB host controller to a specific state.
+
+ @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
+ @param State Indicates the state of the host controller that will be set.
+
+ @retval EFI_SUCCESS The USB host controller was successfully placed in the state
+ specified by State.
+ @retval EFI_INVALID_PARAMETER State is not valid.
+ @retval EFI_DEVICE_ERROR Failed to set the state specified by State due to device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE)(
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN EFI_USB_HC_STATE State
+ );
+
+/**
+ Submits control transfer to a target USB device.
+
+ @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
+ @param DeviceAddress Represents the address of the target device on the USB.
+ @param DeviceSpeed Indicates device speed.
+ @param MaximumPacketLength Indicates the maximum packet size that the default control transfer
+ endpoint is capable of sending or receiving.
+ @param Request A pointer to the USB device request that will be sent to the USB device.
+ @param TransferDirection Specifies the data direction for the transfer. There are three values
+ available, EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.
+ @param Data A pointer to the buffer of data that will be transmitted to USB device or
+ received from USB device.
+ @param DataLength On input, indicates the size, in bytes, of the data buffer specified by Data.
+ On output, indicates the amount of data actually transferred.
+ @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
+ allowed to complete.
+ @param Translator A pointer to the transaction translator data.
+ @param TransferResult A pointer to the detailed result information generated by this control
+ transfer.
+
+ @retval EFI_SUCCESS The control transfer was completed successfully.
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.
+ @retval EFI_TIMEOUT The control transfer failed due to timeout.
+ @retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.
+ Caller should check TransferResult for detailed error information.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER)(
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINTN MaximumPacketLength,
+ IN EFI_USB_DEVICE_REQUEST *Request,
+ IN EFI_USB_DATA_DIRECTION TransferDirection,
+ IN OUT VOID *Data OPTIONAL,
+ IN OUT UINTN *DataLength OPTIONAL,
+ IN UINTN TimeOut,
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
+ OUT UINT32 *TransferResult
+ );
+
+#define EFI_USB_MAX_BULK_BUFFER_NUM 10
+
+/**
+ Submits bulk transfer to a bulk endpoint of a USB device.
+
+ @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
+ @param DeviceAddress Represents the address of the target device on the USB.
+ @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
+ target USB device.
+ @param DeviceSpeed Indicates device speed.
+ @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
+ sending or receiving.
+ @param DataBuffersNumber Number of data buffers prepared for the transfer.
+ @param Data Array of pointers to the buffers of data that will be transmitted to USB
+ device or received from USB device.
+ @param DataLength When input, indicates the size, in bytes, of the data buffers specified by
+ Data. When output, indicates the actually transferred data size.
+ @param DataToggle A pointer to the data toggle value.
+ @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
+ allowed to complete.
+ @param Translator A pointer to the transaction translator data.
+ @param TransferResult A pointer to the detailed result information of the bulk transfer.
+
+ @retval EFI_SUCCESS The bulk transfer was completed successfully.
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be submitted due to a lack of resources.
+ @retval EFI_TIMEOUT The bulk transfer failed due to timeout.
+ @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
+ Caller should check TransferResult for detailed error information.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER)(
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINTN MaximumPacketLength,
+ IN UINT8 DataBuffersNumber,
+ IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],
+ IN OUT UINTN *DataLength,
+ IN OUT UINT8 *DataToggle,
+ IN UINTN TimeOut,
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
+ OUT UINT32 *TransferResult
+ );
+
+/**
+ Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
+ Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.
+
+ @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
+ @param DeviceAddress Represents the address of the target device on the USB.
+ @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
+ target USB device.
+ @param DeviceSpeed Indicates device speed.
+ @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
+ sending or receiving.
+ @param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host and the
+ target interrupt endpoint. If FALSE, the specified asynchronous interrupt
+ pipe is canceled. If TRUE, and an interrupt transfer exists for the target
+ end point, then EFI_INVALID_PARAMETER is returned.
+ @param DataToggle A pointer to the data toggle value.
+ @param PollingInterval Indicates the interval, in milliseconds, that the asynchronous interrupt
+ transfer is polled.
+ @param DataLength Indicates the length of data to be received at the rate specified by
+ PollingInterval from the target asynchronous interrupt endpoint.
+ @param Translator A pointr to the transaction translator data.
+ @param CallBackFunction The Callback function. This function is called at the rate specified by
+ PollingInterval.
+ @param Context The context that is passed to the CallBackFunction. This is an
+ optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully
+ submitted or canceled.
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER)(
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINTN MaxiumPacketLength,
+ IN BOOLEAN IsNewTransfer,
+ IN OUT UINT8 *DataToggle,
+ IN UINTN PollingInterval OPTIONAL,
+ IN UINTN DataLength OPTIONAL,
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator OPTIONAL,
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,
+ IN VOID *Context OPTIONAL
+ );
+
+/**
+ Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.
+ Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.
+
+ @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
+ @param DeviceAddress Represents the address of the target device on the USB.
+ @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
+ target USB device.
+ @param DeviceSpeed Indicates device speed.
+ @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
+ sending or receiving.
+ @param Data A pointer to the buffer of data that will be transmitted to USB device or
+ received from USB device.
+ @param DataLength On input, the size, in bytes, of the data buffer specified by Data. On
+ output, the number of bytes transferred.
+ @param DataToggle A pointer to the data toggle value.
+ @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
+ allowed to complete.
+ @param Translator A pointr to the transaction translator data.
+ @param TransferResult A pointer to the detailed result information from the synchronous
+ interrupt transfer.
+
+ @retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES The synchronous interrupt transfer could not be submitted due to a lack of resources.
+ @retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.
+ @retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.
+ Caller should check TransferResult for detailed error information.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER)(
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINTN MaximumPacketLength,
+ IN OUT VOID *Data,
+ IN OUT UINTN *DataLength,
+ IN OUT UINT8 *DataToggle,
+ IN UINTN TimeOut,
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
+ OUT UINT32 *TransferResult
+ );
+
+#define EFI_USB_MAX_ISO_BUFFER_NUM 7
+#define EFI_USB_MAX_ISO_BUFFER_NUM1 2
+
+/**
+ Submits isochronous transfer to an isochronous endpoint of a USB device.
+
+ This function is used to submit isochronous transfer to a target endpoint of a USB device.
+ The target endpoint is specified by DeviceAddressand EndpointAddress. Isochronous transfers are
+ used when working with isochronous date. It provides periodic, continuous communication between
+ the host and a device. Isochronous transfers can beused only by full-speed, high-speed, and
+ super-speed devices.
+
+ High-speed isochronous transfers can be performed using multiple data buffers. The number of
+ buffers that are actually prepared for the transfer is specified by DataBuffersNumber. For
+ full-speed isochronous transfers this value is ignored.
+
+ Data represents a list of pointers to the data buffers. For full-speed isochronous transfers
+ only the data pointed by Data[0]shall be used. For high-speed isochronous transfers and for
+ the split transactions depending on DataLengththere several data buffers canbe used. For the
+ high-speed isochronous transfers the total number of buffers must not exceed EFI_USB_MAX_ISO_BUFFER_NUM.
+
+ For split transactions performed on full-speed device by high-speed host controller the total
+ number of buffers is limited to EFI_USB_MAX_ISO_BUFFER_NUM1.
+ If the isochronous transfer is successful, then EFI_SUCCESSis returned. The isochronous transfer
+ is designed to be completed within one USB frame time, if it cannot be completed, EFI_TIMEOUT
+ is returned. If an error other than timeout occurs during the USB transfer, then EFI_DEVICE_ERROR
+ is returned and the detailed status code will be returned in TransferResult.
+
+ EFI_INVALID_PARAMETERis returned if one of the following conditionsis satisfied:
+ - Data is NULL.
+ - DataLength is 0.
+ - DeviceSpeed is not one of the supported values listed above.
+ - MaximumPacketLength is invalid. MaximumPacketLength must be 1023 or less for full-speed devices,
+ and 1024 or less for high-speed and super-speed devices.
+ - TransferResult is NULL.
+
+ @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
+ @param DeviceAddress Represents the address of the target device on the USB.
+ @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
+ target USB device.
+ @param DeviceSpeed Indicates device speed. The supported values are EFI_USB_SPEED_FULL,
+ EFI_USB_SPEED_HIGH, or EFI_USB_SPEED_SUPER.
+ @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
+ sending or receiving.
+ @param DataBuffersNumber Number of data buffers prepared for the transfer.
+ @param Data Array of pointers to the buffers of data that will be transmitted to USB
+ device or received from USB device.
+ @param DataLength Specifies the length, in bytes, of the data to be sent to or received from
+ the USB device.
+ @param Translator A pointer to the transaction translator data.
+ @param TransferResult A pointer to the detailed result information of the isochronous transfer.
+
+ @retval EFI_SUCCESS The isochronous transfer was completed successfully.
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES The isochronous transfer could not be submitted due to a lack of resources.
+ @retval EFI_TIMEOUT The isochronous transfer cannot be completed within the one USB frame time.
+ @retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.
+ Caller should check TransferResult for detailed error information.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER)(
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINTN MaximumPacketLength,
+ IN UINT8 DataBuffersNumber,
+ IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
+ IN UINTN DataLength,
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
+ OUT UINT32 *TransferResult
+ );
+
+/**
+ Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.
+
+ This is an asynchronous type of USB isochronous transfer. If the caller submits a USB
+ isochronous transfer request through this function, this function will return immediately.
+
+ When the isochronous transfer completes, the IsochronousCallbackfunction will be triggered,
+ the caller can know the transfer results. If the transfer is successful, the caller can get
+ the data received or sent in this callback function.
+
+ The target endpoint is specified by DeviceAddressand EndpointAddress. Isochronous transfers
+ are used when working with isochronous date. It provides periodic, continuous communication
+ between the host and a device. Isochronous transfers can be used only by full-speed, high-speed,
+ and super-speed devices.
+
+ High-speed isochronous transfers can be performed using multiple data buffers. The number of
+ buffers that are actually prepared for the transfer is specified by DataBuffersNumber. For
+ full-speed isochronous transfers this value is ignored.
+
+ Data represents a list of pointers to the data buffers. For full-speed isochronous transfers
+ only the data pointed by Data[0] shall be used. For high-speed isochronous transfers and for
+ the split transactions depending on DataLength there several data buffers can be used. For
+ the high-speed isochronous transfers the total number of buffers must not exceed EFI_USB_MAX_ISO_BUFFER_NUM.
+
+ For split transactions performed on full-speed device by high-speed host controller the total
+ number of buffers is limited to EFI_USB_MAX_ISO_BUFFER_NUM1.
+
+ EFI_INVALID_PARAMETER is returned if one of the following conditionsis satisfied:
+ - Data is NULL.
+ - DataLength is 0.
+ - DeviceSpeed is not one of the supported values listed above.
+ - MaximumPacketLength is invalid. MaximumPacketLength must be 1023 or less for full-speed
+ devices and 1024 or less for high-speed and super-speed devices.
+
+ @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
+ @param DeviceAddress Represents the address of the target device on the USB.
+ @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
+ target USB device.
+ @param DeviceSpeed Indicates device speed. The supported values are EFI_USB_SPEED_FULL,
+ EFI_USB_SPEED_HIGH, or EFI_USB_SPEED_SUPER.
+ @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
+ sending or receiving.
+ @param DataBuffersNumber Number of data buffers prepared for the transfer.
+ @param Data Array of pointers to the buffers of data that will be transmitted to USB
+ device or received from USB device.
+ @param DataLength Specifies the length, in bytes, of the data to be sent to or received from
+ the USB device.
+ @param Translator A pointer to the transaction translator data.
+ @param IsochronousCallback The Callback function. This function is called if the requested
+ isochronous transfer is completed.
+ @param Context Data passed to the IsochronousCallback function. This is an
+ optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The asynchronous isochronous transfer request has been successfully
+ submitted or canceled.
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES The asynchronous isochronous transfer could not be submitted due to
+ a lack of resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER)(
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINTN MaximumPacketLength,
+ IN UINT8 DataBuffersNumber,
+ IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
+ IN UINTN DataLength,
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
+ IN VOID *Context OPTIONAL
+ );
+
+/**
+ Retrieves the current status of a USB root hub port.
+
+ @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
+ @param PortNumber Specifies the root hub port from which the status is to be retrieved.
+ This value is zero based.
+ @param PortStatus A pointer to the current port status bits and port status change bits.
+
+ @retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber
+ was returned in PortStatus.
+ @retval EFI_INVALID_PARAMETER PortNumber is invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS)(
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 PortNumber,
+ OUT EFI_USB_PORT_STATUS *PortStatus
+ );
+
+/**
+ Sets a feature for the specified root hub port.
+
+ @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
+ @param PortNumber Specifies the root hub port whose feature is requested to be set. This
+ value is zero based.
+ @param PortFeature Indicates the feature selector associated with the feature set request.
+
+ @retval EFI_SUCCESS The feature specified by PortFeature was set for the USB
+ root hub port specified by PortNumber.
+ @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE)(
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 PortNumber,
+ IN EFI_USB_PORT_FEATURE PortFeature
+ );
+
+/**
+ Clears a feature for the specified root hub port.
+
+ @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
+ @param PortNumber Specifies the root hub port whose feature is requested to be cleared. This
+ value is zero based.
+ @param PortFeature Indicates the feature selector associated with the feature clear request.
+
+ @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB
+ root hub port specified by PortNumber.
+ @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE)(
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 PortNumber,
+ IN EFI_USB_PORT_FEATURE PortFeature
+ );
+
+///
+/// The EFI_USB2_HC_PROTOCOL provides USB host controller management, basic
+/// data transactions over a USB bus, and USB root hub access. A device driver
+/// that wishes to manage a USB bus in a system retrieves the EFI_USB2_HC_PROTOCOL
+/// instance that is associated with the USB bus to be managed. A device handle
+/// for a USB host controller will minimally contain an EFI_DEVICE_PATH_PROTOCOL
+/// instance, and an EFI_USB2_HC_PROTOCOL instance.
+///
+struct _EFI_USB2_HC_PROTOCOL {
+ EFI_USB2_HC_PROTOCOL_GET_CAPABILITY GetCapability;
+ EFI_USB2_HC_PROTOCOL_RESET Reset;
+ EFI_USB2_HC_PROTOCOL_GET_STATE GetState;
+ EFI_USB2_HC_PROTOCOL_SET_STATE SetState;
+ EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;
+ EFI_USB2_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;
+ EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;
+ EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;
+ EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;
+ EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;
+ EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;
+ EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;
+ EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;
+
+ ///
+ /// The major revision number of the USB host controller. The revision information
+ /// indicates the release of the Universal Serial Bus Specification with which the
+ /// host controller is compliant.
+ ///
+ UINT16 MajorRevision;
+
+ ///
+ /// The minor revision number of the USB host controller. The revision information
+ /// indicates the release of the Universal Serial Bus Specification with which the
+ /// host controller is compliant.
+ ///
+ UINT16 MinorRevision;
+};
+
+extern EFI_GUID gEfiUsb2HcProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UsbFunctionIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UsbFunctionIo.h
new file mode 100644
index 0000000000..4847652345
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UsbFunctionIo.h
@@ -0,0 +1,687 @@
+/** @file
+ The USB Function Protocol provides an I/O abstraction for a USB Controller
+ operating in Function mode (also commonly referred to as Device, Peripheral,
+ or Target mode) and the mechanisms by which the USB Function can communicate
+ with the USB Host. It is used by other UEFI drivers or applications to
+ perform data transactions and basic USB controller management over a USB
+ Function port.
+
+ This simple protocol only supports USB 2.0 bulk transfers on systems with a
+ single configuration and a single interface. It does not support isochronous
+ or interrupt transfers, alternate interfaces, or USB 3.0 functionality.
+ Future revisions of this protocol may support these or additional features.
+
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __USB_FUNCTION_IO_H__
+#define __USB_FUNCTION_IO_H__
+
+#include <Protocol/UsbIo.h>
+
+#define EFI_USBFN_IO_PROTOCOL_GUID \
+ { \
+ 0x32d2963a, 0xfe5d, 0x4f30, {0xb6, 0x33, 0x6e, 0x5d, 0xc5, 0x58, 0x3, 0xcc} \
+ }
+
+typedef struct _EFI_USBFN_IO_PROTOCOL EFI_USBFN_IO_PROTOCOL;
+
+#define EFI_USBFN_IO_PROTOCOL_REVISION 0x00010001
+
+typedef enum _EFI_USBFN_PORT_TYPE {
+ EfiUsbUnknownPort = 0,
+ EfiUsbStandardDownstreamPort,
+ EfiUsbChargingDownstreamPort,
+ EfiUsbDedicatedChargingPort,
+ EfiUsbInvalidDedicatedChargingPort
+} EFI_USBFN_PORT_TYPE;
+
+typedef struct {
+ EFI_USB_INTERFACE_DESCRIPTOR *InterfaceDescriptor;
+ EFI_USB_ENDPOINT_DESCRIPTOR **EndpointDescriptorTable;
+} EFI_USB_INTERFACE_INFO;
+
+typedef struct {
+ EFI_USB_CONFIG_DESCRIPTOR *ConfigDescriptor;
+ EFI_USB_INTERFACE_INFO **InterfaceInfoTable;
+} EFI_USB_CONFIG_INFO;
+
+typedef struct {
+ EFI_USB_DEVICE_DESCRIPTOR *DeviceDescriptor;
+ EFI_USB_CONFIG_INFO **ConfigInfoTable;
+} EFI_USB_DEVICE_INFO;
+
+typedef enum _EFI_USB_ENDPOINT_TYPE {
+ UsbEndpointControl = 0x00,
+ //UsbEndpointIsochronous = 0x01,
+ UsbEndpointBulk = 0x02,
+ //UsbEndpointInterrupt = 0x03
+} EFI_USB_ENDPOINT_TYPE;
+
+typedef enum _EFI_USBFN_DEVICE_INFO_ID {
+ EfiUsbDeviceInfoUnknown = 0,
+ EfiUsbDeviceInfoSerialNumber,
+ EfiUsbDeviceInfoManufacturerName,
+ EfiUsbDeviceInfoProductName
+} EFI_USBFN_DEVICE_INFO_ID;
+
+typedef enum _EFI_USBFN_ENDPOINT_DIRECTION {
+ EfiUsbEndpointDirectionHostOut = 0,
+ EfiUsbEndpointDirectionHostIn,
+ EfiUsbEndpointDirectionDeviceTx = EfiUsbEndpointDirectionHostIn,
+ EfiUsbEndpointDirectionDeviceRx = EfiUsbEndpointDirectionHostOut
+} EFI_USBFN_ENDPOINT_DIRECTION;
+
+typedef enum _EFI_USBFN_MESSAGE {
+ //
+ // Nothing
+ //
+ EfiUsbMsgNone = 0,
+ //
+ // SETUP packet is received, returned Buffer contains
+ // EFI_USB_DEVICE_REQUEST struct
+ //
+ EfiUsbMsgSetupPacket,
+ //
+ // Indicates that some of the requested data has been received from the
+ // host. It is the responsibility of the class driver to determine if it
+ // needs to wait for any remaining data. Returned Buffer contains
+ // EFI_USBFN_TRANSFER_RESULT struct containing endpoint number, transfer
+ // status and count of bytes received.
+ //
+ EfiUsbMsgEndpointStatusChangedRx,
+ //
+ // Indicates that some of the requested data has been transmitted to the
+ // host. It is the responsibility of the class driver to determine if any
+ // remaining data needs to be resent. Returned Buffer contains
+ // EFI_USBFN_TRANSFER_RESULT struct containing endpoint number, transfer
+ // status and count of bytes sent.
+ //
+ EfiUsbMsgEndpointStatusChangedTx,
+ //
+ // DETACH bus event signaled
+ //
+ EfiUsbMsgBusEventDetach,
+ //
+ // ATTACH bus event signaled
+ //
+ EfiUsbMsgBusEventAttach,
+ //
+ // RESET bus event signaled
+ //
+ EfiUsbMsgBusEventReset,
+ //
+ // SUSPEND bus event signaled
+ //
+ EfiUsbMsgBusEventSuspend,
+ //
+ // RESUME bus event signaled
+ //
+ EfiUsbMsgBusEventResume,
+ //
+ // Bus speed updated, returned buffer indicated bus speed using
+ // following enumeration named EFI_USB_BUS_SPEED
+ //
+ EfiUsbMsgBusEventSpeed
+} EFI_USBFN_MESSAGE;
+
+typedef enum _EFI_USBFN_TRANSFER_STATUS {
+ UsbTransferStatusUnknown = 0,
+ UsbTransferStatusComplete,
+ UsbTransferStatusAborted,
+ UsbTransferStatusActive,
+ UsbTransferStatusNone
+} EFI_USBFN_TRANSFER_STATUS;
+
+typedef struct _EFI_USBFN_TRANSFER_RESULT {
+ UINTN BytesTransferred;
+ EFI_USBFN_TRANSFER_STATUS TransferStatus;
+ UINT8 EndpointIndex;
+ EFI_USBFN_ENDPOINT_DIRECTION Direction;
+ VOID *Buffer;
+} EFI_USBFN_TRANSFER_RESULT;
+
+typedef enum _EFI_USB_BUS_SPEED {
+ UsbBusSpeedUnknown = 0,
+ UsbBusSpeedLow,
+ UsbBusSpeedFull,
+ UsbBusSpeedHigh,
+ UsbBusSpeedSuper,
+ UsbBusSpeedMaximum = UsbBusSpeedSuper
+} EFI_USB_BUS_SPEED;
+
+typedef union _EFI_USBFN_MESSAGE_PAYLOAD {
+ EFI_USB_DEVICE_REQUEST udr;
+ EFI_USBFN_TRANSFER_RESULT utr;
+ EFI_USB_BUS_SPEED ubs;
+} EFI_USBFN_MESSAGE_PAYLOAD;
+
+typedef enum _EFI_USBFN_POLICY_TYPE {
+ EfiUsbPolicyUndefined = 0,
+ EfiUsbPolicyMaxTransactionSize,
+ EfiUsbPolicyZeroLengthTerminationSupport,
+ EfiUsbPolicyZeroLengthTermination
+} EFI_USBFN_POLICY_TYPE;
+
+/**
+ Returns information about what USB port type was attached.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+ @param[out] PortType Returns the USB port type.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_DEVICE_ERROR The physical device reported an error.
+ @retval EFI_NOT_READY The physical device is busy or not ready to
+ process this request or there is no USB port
+ attached to the device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_DETECT_PORT) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ OUT EFI_USBFN_PORT_TYPE *PortType
+ );
+
+/**
+ Configures endpoints based on supplied device and configuration descriptors.
+
+ Assuming that the hardware has already been initialized, this function configures
+ the endpoints using the device information supplied by DeviceInfo, activates the
+ port, and starts receiving USB events.
+
+ This function must ignore the bMaxPacketSize0field of the Standard Device Descriptor
+ and the wMaxPacketSize field of the Standard Endpoint Descriptor that are made
+ available through DeviceInfo.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+ @param[out] DeviceInfo A pointer to EFI_USBFN_DEVICE_INFO instance.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_DEVICE_ERROR The physical device reported an error.
+ @retval EFI_NOT_READY The physical device is busy or not ready to process
+ this request.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to lack of
+ resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_CONFIGURE_ENABLE_ENDPOINTS) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ OUT EFI_USB_DEVICE_INFO *DeviceInfo
+ );
+
+/**
+ Returns the maximum packet size of the specified endpoint type for the supplied
+ bus speed.
+
+ If the BusSpeed is UsbBusSpeedUnknown, the maximum speed the underlying controller
+ supports is assumed.
+
+ This protocol currently does not support isochronous or interrupt transfers. Future
+ revisions of this protocol may eventually support it.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOLinstance.
+ @param[in] EndpointType Endpoint type as defined as EFI_USB_ENDPOINT_TYPE.
+ @param[in] BusSpeed Bus speed as defined as EFI_USB_BUS_SPEED.
+ @param[out] MaxPacketSize The maximum packet size, in bytes, of the specified
+ endpoint type.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_DEVICE_ERROR The physical device reported an error.
+ @retval EFI_NOT_READY The physical device is busy or not ready to process
+ this request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_GET_ENDPOINT_MAXPACKET_SIZE) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ IN EFI_USB_ENDPOINT_TYPE EndpointType,
+ IN EFI_USB_BUS_SPEED BusSpeed,
+ OUT UINT16 *MaxPacketSize
+ );
+
+/**
+ Returns device specific information based on the supplied identifier as a Unicode string.
+
+ If the supplied Buffer isn't large enough, or is NULL, the method fails with
+ EFI_BUFFER_TOO_SMALL and the required size is returned through BufferSize. All returned
+ strings are in Unicode format.
+
+ An Id of EfiUsbDeviceInfoUnknown is treated as an invalid parameter.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOLinstance.
+ @param[in] Id The requested information id.
+
+
+ @param[in] BufferSize On input, the size of the Buffer in bytes. On output, the
+ amount of data returned in Buffer in bytes.
+ @param[out] Buffer A pointer to a buffer to returnthe requested information
+ as a Unicode string.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ BufferSize is NULL.
+ *BufferSize is not 0 and Buffer is NULL.
+ Id in invalid.
+ @retval EFI_DEVICE_ERROR The physical device reported an error.
+ @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
+ *BufferSize has been updated with the size needed to hold the request string.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_GET_DEVICE_INFO) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ IN EFI_USBFN_DEVICE_INFO_ID Id,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer OPTIONAL
+);
+
+/**
+ Returns the vendor-id and product-id of the device.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+ @param[out] Vid Returned vendor-id of the device.
+ @param[out] Pid Returned product-id of the device.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_NOT_FOUND Unable to return the vendor-id or the product-id.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_GET_VENDOR_ID_PRODUCT_ID) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ OUT UINT16 *Vid,
+ OUT UINT16 *Pid
+);
+
+/**
+ Aborts the transfer on the specified endpoint.
+
+ This function should fail with EFI_INVALID_PARAMETER if the specified direction
+ is incorrect for the endpoint.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+ @param[in] EndpointIndex Indicates the endpoint on which the ongoing transfer
+ needs to be canceled.
+ @param[in] Direction Direction of the endpoint.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_DEVICE_ERROR The physical device reported an error.
+ @retval EFI_NOT_READY The physical device is busy or not ready to process
+ this request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_ABORT_TRANSFER) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ IN UINT8 EndpointIndex,
+ IN EFI_USBFN_ENDPOINT_DIRECTION Direction
+);
+
+/**
+ Returns the stall state on the specified endpoint.
+
+ This function should fail with EFI_INVALID_PARAMETER if the specified direction
+ is incorrect for the endpoint.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+ @param[in] EndpointIndex Indicates the endpoint.
+ @param[in] Direction Direction of the endpoint.
+ @param[in, out] State Boolean, true value indicates that the endpoint
+ is in a stalled state, false otherwise.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_DEVICE_ERROR The physical device reported an error.
+ @retval EFI_NOT_READY The physical device is busy or not ready to process
+ this request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_GET_ENDPOINT_STALL_STATE) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ IN UINT8 EndpointIndex,
+ IN EFI_USBFN_ENDPOINT_DIRECTION Direction,
+ IN OUT BOOLEAN *State
+);
+
+/**
+ Sets or clears the stall state on the specified endpoint.
+
+ This function should fail with EFI_INVALID_PARAMETER if the specified direction
+ is incorrect for the endpoint.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+ @param[in] EndpointIndex Indicates the endpoint.
+ @param[in] Direction Direction of the endpoint.
+ @param[in] State Requested stall state on the specified endpoint.
+ True value causes the endpoint to stall; false
+ value clears an existing stall.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_DEVICE_ERROR The physical device reported an error.
+ @retval EFI_NOT_READY The physical device is busy or not ready to process
+ this request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_SET_ENDPOINT_STALL_STATE) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ IN UINT8 EndpointIndex,
+ IN EFI_USBFN_ENDPOINT_DIRECTION Direction,
+ IN OUT BOOLEAN *State
+);
+
+/**
+ This function is called repeatedly to get information on USB bus states,
+ receive-completion and transmit-completion events on the endpoints, and
+ notification on setup packet on endpoint 0.
+
+ A class driver must call EFI_USBFN_IO_PROTOCOL.EventHandler()repeatedly
+ to receive updates on the transfer status and number of bytes transferred
+ on various endpoints.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+ @param[out] Message Indicates the event that initiated this notification.
+ @param[in, out] PayloadSize On input, the size of the memory pointed by
+ Payload. On output, the amount ofdata returned
+ in Payload.
+ @param[out] Payload A pointer to EFI_USBFN_MESSAGE_PAYLOAD instance
+ to return additional payload for current message.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_DEVICE_ERROR The physical device reported an error.
+ @retval EFI_NOT_READY The physical device is busy or not ready to process
+ this request.
+ @retval EFI_BUFFER_TOO_SMALL The Supplied buffer is not large enough to hold
+ the message payload.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_EVENTHANDLER) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ OUT EFI_USBFN_MESSAGE *Message,
+ IN OUT UINTN *PayloadSize,
+ OUT EFI_USBFN_MESSAGE_PAYLOAD *Payload
+);
+
+/**
+ This function handles transferring data to or from the host on the specified
+ endpoint, depending on the direction specified.
+
+ A class driver must call EFI_USBFN_IO_PROTOCOL.EventHandler() repeatedly to
+ receive updates on the transfer status and the number of bytes transferred on
+ various endpoints. Upon an update of the transfer status, the Buffer field of
+ the EFI_USBFN_TRANSFER_RESULT structure (as described in the function description
+ for EFI_USBFN_IO_PROTOCOL.EventHandler()) must be initialized with the Buffer
+ pointer that was supplied to this method.
+
+ The overview of the call sequence is illustrated in the Figure 54.
+
+ This function should fail with EFI_INVALID_PARAMETER if the specified direction
+ is incorrect for the endpoint.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+ @param[in] EndpointIndex Indicates the endpoint on which TX or RX transfer
+ needs to take place.
+ @param[in] Direction Direction of the endpoint.
+ @param[in, out] BufferSize If Direction is EfiUsbEndpointDirectionDeviceRx:
+ On input, the size of the Bufferin bytes.
+ On output, the amount of data returned in Buffer
+ in bytes.
+ If Direction is EfiUsbEndpointDirectionDeviceTx:
+ On input, the size of the Bufferin bytes.
+ On output, the amount of data transmitted in bytes.
+ @param[in, out] Buffer If Direction is EfiUsbEndpointDirectionDeviceRx:
+ The Buffer to return the received data.
+ If Directionis EfiUsbEndpointDirectionDeviceTx:
+ The Buffer that contains the data to be transmitted.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_DEVICE_ERROR The physical device reported an error.
+ @retval EFI_NOT_READY The physical device is busy or not ready to process
+ this request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_TRANSFER) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ IN UINT8 EndpointIndex,
+ IN EFI_USBFN_ENDPOINT_DIRECTION Direction,
+ IN OUT UINTN *BufferSize,
+ IN OUT VOID *Buffer
+);
+
+/**
+ Returns the maximum supported transfer size.
+
+ Returns the maximum number of bytes that the underlying controller can accommodate
+ in a single transfer.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+ @param[out] MaxTransferSize The maximum supported transfer size, in bytes.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_DEVICE_ERROR The physical device reported an error.
+ @retval EFI_NOT_READY The physical device is busy or not ready to process
+ this request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_GET_MAXTRANSFER_SIZE) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ OUT UINTN *MaxTransferSize
+ );
+
+/**
+ Allocates a transfer buffer of the specified sizethat satisfies the controller
+ requirements.
+
+ The AllocateTransferBuffer() function allocates a memory region of Size bytes and
+ returns the address of the allocated memory that satisfies the underlying controller
+ requirements in the location referenced by Buffer.
+
+ The allocated transfer buffer must be freed using a matching call to
+ EFI_USBFN_IO_PROTOCOL.FreeTransferBuffer()function.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+ @param[in] Size The number of bytes to allocate for the transfer buffer.
+ @param[out] Buffer A pointer to a pointer to the allocated buffer if the
+ call succeeds; undefined otherwise.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_OUT_OF_RESOURCES The requested transfer buffer could not be allocated.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_ALLOCATE_TRANSFER_BUFFER) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ IN UINTN Size,
+ OUT VOID **Buffer
+ );
+
+/**
+ Deallocates the memory allocated for the transfer buffer by the
+ EFI_USBFN_IO_PROTOCOL.AllocateTransferBuffer() function.
+
+ The EFI_USBFN_IO_PROTOCOL.FreeTransferBuffer() function deallocates the
+ memory specified by Buffer. The Buffer that is freed must have been allocated
+ by EFI_USBFN_IO_PROTOCOL.AllocateTransferBuffer().
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+ @param[in] Buffer A pointer to the transfer buffer to deallocate.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_FREE_TRANSFER_BUFFER) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ IN VOID *Buffer
+ );
+
+/**
+ This function supplies power to the USB controller if needed and initializes
+ the hardware and the internal data structures. The port must not be activated
+ by this function.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_DEVICE_ERROR The physical device reported an error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_START_CONTROLLER) (
+ IN EFI_USBFN_IO_PROTOCOL *This
+ );
+
+/**
+ This function stops the USB hardware device.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_DEVICE_ERROR The physical device reported an error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_STOP_CONTROLLER) (
+ IN EFI_USBFN_IO_PROTOCOL *This
+ );
+
+/**
+ This function sets the configuration policy for the specified non-control
+ endpoint.
+
+ This function can only be called before EFI_USBFN_IO_PROTOCOL.StartController()
+ or after EFI_USBFN_IO_PROTOCOL.StopController() has been called.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+ @param[in] EndpointIndex Indicates the non-control endpoint for which the
+ policy needs to be set.
+ @param[in] Direction Direction of the endpoint.
+ @param[in] PolicyType Policy type the user is trying to set for the
+ specified non-control endpoint.
+ @param[in] BufferSize The size of the Bufferin bytes.
+ @param[in] Buffer The new value for the policy parameter that
+ PolicyType specifies.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_DEVICE_ERROR The physical device reported an error.
+ @retval EFI_UNSUPPORTED Changing this policy value is not supported.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_SET_ENDPOINT_POLICY) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ IN UINT8 EndpointIndex,
+ IN EFI_USBFN_ENDPOINT_DIRECTION Direction,
+ IN EFI_USBFN_POLICY_TYPE PolicyType,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+ );
+
+/**
+ This function sets the configuration policy for the specified non-control
+ endpoint.
+
+ This function can only be called before EFI_USBFN_IO_PROTOCOL.StartController()
+ or after EFI_USBFN_IO_PROTOCOL.StopController() has been called.
+
+ @param[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
+ @param[in] EndpointIndex Indicates the non-control endpoint for which the
+ policy needs to be set.
+ @param[in] Direction Direction of the endpoint.
+ @param[in] PolicyType Policy type the user is trying to retrieve for
+ the specified non-control endpoint.
+ @param[in, out] BufferSize On input, the size of Bufferin bytes. On output,
+ the amount of data returned in Bufferin bytes.
+ @param[in, out] Buffer A pointer to a buffer to return requested endpoint
+ policy value.
+
+ @retval EFI_SUCCESS The function returned successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_DEVICE_ERROR The specified policy value is not supported.
+ @retval EFI_BUFFER_TOO_SMALL Supplied buffer is not large enough to hold requested
+ policy value.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USBFN_IO_GET_ENDPOINT_POLICY) (
+ IN EFI_USBFN_IO_PROTOCOL *This,
+ IN UINT8 EndpointIndex,
+ IN EFI_USBFN_ENDPOINT_DIRECTION Direction,
+ IN EFI_USBFN_POLICY_TYPE PolicyType,
+ IN OUT UINTN *BufferSize,
+ IN OUT VOID *Buffer
+ );
+
+///
+/// The EFI_USBFN_IO_PROTOCOL provides basic data transactions and basic USB
+/// controller management for a USB Function port.
+///
+struct _EFI_USBFN_IO_PROTOCOL {
+ UINT32 Revision;
+ EFI_USBFN_IO_DETECT_PORT DetectPort;
+ EFI_USBFN_IO_CONFIGURE_ENABLE_ENDPOINTS ConfigureEnableEndpoints;
+ EFI_USBFN_IO_GET_ENDPOINT_MAXPACKET_SIZE GetEndpointMaxPacketSize;
+ EFI_USBFN_IO_GET_DEVICE_INFO GetDeviceInfo;
+ EFI_USBFN_IO_GET_VENDOR_ID_PRODUCT_ID GetVendorIdProductId;
+ EFI_USBFN_IO_ABORT_TRANSFER AbortTransfer;
+ EFI_USBFN_IO_GET_ENDPOINT_STALL_STATE GetEndpointStallState;
+ EFI_USBFN_IO_SET_ENDPOINT_STALL_STATE SetEndpointStallState;
+ EFI_USBFN_IO_EVENTHANDLER EventHandler;
+ EFI_USBFN_IO_TRANSFER Transfer;
+ EFI_USBFN_IO_GET_MAXTRANSFER_SIZE GetMaxTransferSize;
+ EFI_USBFN_IO_ALLOCATE_TRANSFER_BUFFER AllocateTransferBuffer;
+ EFI_USBFN_IO_FREE_TRANSFER_BUFFER FreeTransferBuffer;
+ EFI_USBFN_IO_START_CONTROLLER StartController;
+ EFI_USBFN_IO_STOP_CONTROLLER StopController;
+ EFI_USBFN_IO_SET_ENDPOINT_POLICY SetEndpointPolicy;
+ EFI_USBFN_IO_GET_ENDPOINT_POLICY GetEndpointPolicy;
+};
+
+extern EFI_GUID gEfiUsbFunctionIoProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UsbHostController.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UsbHostController.h
new file mode 100644
index 0000000000..2196903a0f
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UsbHostController.h
@@ -0,0 +1,508 @@
+/** @file
+ EFI_USB_HC_PROTOCOL as defined in EFI 1.10.
+
+ The USB Host Controller Protocol is used by code, typically USB bus drivers,
+ running in the EFI boot services environment, to perform data transactions
+ over a USB bus. In addition, it provides an abstraction for the root hub of the USB bus.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _USB_HOSTCONTROLLER_H_
+#define _USB_HOSTCONTROLLER_H_
+
+#include <Protocol/Usb2HostController.h>
+
+#define EFI_USB_HC_PROTOCOL_GUID \
+ { \
+ 0xf5089266, 0x1aa0, 0x4953, {0x97, 0xd8, 0x56, 0x2f, 0x8a, 0x73, 0xb5, 0x19 } \
+ }
+
+///
+/// Forward reference for pure ANSI compatability
+///
+typedef struct _EFI_USB_HC_PROTOCOL EFI_USB_HC_PROTOCOL;
+
+//
+// Protocol definitions
+//
+
+/**
+ Provides software reset for the USB host controller.
+
+ @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
+ @param Attributes A bit mask of the reset operation to perform.
+
+ @retval EFI_SUCCESS The reset operation succeeded.
+ @retval EFI_UNSUPPORTED The type of reset specified by Attributes is not currently supported
+ by the host controller hardware.
+ @retval EFI_INVALID_PARAMETER Attributes is not valid.
+ @retval EFI_DEVICE_ERROR An error was encountered while attempting to perform the reset operation.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_RESET)(
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT16 Attributes
+ );
+
+/**
+ Retrieves current state of the USB host controller.
+
+ @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
+ @param State A pointer to the EFI_USB_HC_STATE data structure that
+ indicates current state of the USB host controller.
+
+ @retval EFI_SUCCESS The state information of the host controller was returned in State.
+ @retval EFI_INVALID_PARAMETER State is NULL.
+ @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the host controller's
+ current state.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_GET_STATE)(
+ IN EFI_USB_HC_PROTOCOL *This,
+ OUT EFI_USB_HC_STATE *State
+ );
+
+/**
+ Sets the USB host controller to a specific state.
+
+ @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
+ @param State Indicates the state of the host controller that will be set.
+
+ @retval EFI_SUCCESS The USB host controller was successfully placed in the state specified by
+ State.
+ @retval EFI_INVALID_PARAMETER State is NULL.
+ @retval EFI_DEVICE_ERROR Failed to set the state specified by State due to device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_SET_STATE)(
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN EFI_USB_HC_STATE State
+ );
+
+/**
+ Submits control transfer to a target USB device.
+
+ @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
+ @param DeviceAddress Represents the address of the target device on the USB, which is
+ assigned during USB enumeration.
+ @param IsSlowDevice Indicates whether the target device is slow device or full-speed
+ device.
+ @param MaximumPacketLength Indicates the maximum packet size that the default control
+ transfer endpoint is capable of sending or receiving.
+ @param Request A pointer to the USB device request that will be sent to the USB
+ device.
+ @param TransferDirection Specifies the data direction for the transfer. There are three
+ values available, EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.
+ @param Data A pointer to the buffer of data that will be transmitted to USB
+ device or received from USB device.
+ @param DataLength On input, indicates the size, in bytes, of the data buffer specified
+ by Data. On output, indicates the amount of data actually
+ transferred.
+ @param TimeOut Indicates the maximum time, in milliseconds, which the transfer
+ is allowed to complete.
+ @param TransferResult A pointer to the detailed result information generated by this
+ control transfer.
+
+ @retval EFI_SUCCESS The control transfer was completed successfully.
+ @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.
+ @retval EFI_TIMEOUT The control transfer failed due to timeout.
+ @retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER)(
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN BOOLEAN IsSlowDevice,
+ IN UINT8 MaximumPacketLength,
+ IN EFI_USB_DEVICE_REQUEST *Request,
+ IN EFI_USB_DATA_DIRECTION TransferDirection,
+ IN OUT VOID *Data OPTIONAL,
+ IN OUT UINTN *DataLength OPTIONAL,
+ IN UINTN TimeOut,
+ OUT UINT32 *TransferResult
+ );
+
+/**
+ Submits bulk transfer to a bulk endpoint of a USB device.
+
+ @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
+ @param DeviceAddress Represents the address of the target device on the USB, which is
+ assigned during USB enumeration.
+ @param EndPointAddress The combination of an endpoint number and an endpoint
+ direction of the target USB device. Each endpoint address
+ supports data transfer in one direction except the control
+ endpoint (whose default endpoint address is 0). It is the
+ caller's responsibility to make sure that the EndPointAddress
+ represents a bulk endpoint.
+ @param MaximumPacketLength Indicates the maximum packet size that the default control
+ transfer endpoint is capable of sending or receiving.
+ @param Data A pointer to the buffer of data that will be transmitted to USB
+ device or received from USB device.
+ @param DataLength On input, indicates the size, in bytes, of the data buffer specified
+ by Data. On output, indicates the amount of data actually
+ transferred.
+ @param DataToggle A pointer to the data toggle value.
+ @param TimeOut Indicates the maximum time, in milliseconds, which the transfer
+ is allowed to complete.
+ @param TransferResult A pointer to the detailed result information of the bulk transfer.
+
+ @retval EFI_SUCCESS The bulk transfer was completed successfully.
+ @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.
+ @retval EFI_TIMEOUT The bulk transfer failed due to timeout.
+ @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_BULK_TRANSFER)(
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 MaximumPacketLength,
+ IN OUT VOID *Data,
+ IN OUT UINTN *DataLength,
+ IN OUT UINT8 *DataToggle,
+ IN UINTN TimeOut,
+ OUT UINT32 *TransferResult
+ );
+
+/**
+ Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
+
+ @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
+ @param DeviceAddress Represents the address of the target device on the USB, which is
+ assigned during USB enumeration.
+ @param EndPointAddress The combination of an endpoint number and an endpoint
+ direction of the target USB device. Each endpoint address
+ supports data transfer in one direction except the control
+ endpoint (whose default endpoint address is zero). It is the
+ caller's responsibility to make sure that the
+ EndPointAddress represents an interrupt endpoint.
+ @param IsSlowDevice Indicates whether the target device is slow device or full-speed
+ device.
+ @param MaximumPacketLength Indicates the maximum packet size that the default control
+ transfer endpoint is capable of sending or receiving.
+ @param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host
+ and the target interrupt endpoint. If FALSE, the specified asynchronous
+ interrupt pipe is canceled. If TRUE, and an interrupt transfer exists
+ for the target end point, then EFI_INVALID_PARAMETER is returned.
+ @param DataToggle A pointer to the data toggle value. On input, it is valid when
+ IsNewTransfer is TRUE, and it indicates the initial data toggle
+ value the asynchronous interrupt transfer should adopt. On output,
+ it is valid when IsNewTransfer is FALSE, and it is updated to indicate
+ the data toggle value of the subsequent asynchronous interrupt transfer.
+ @param PollingInterval Indicates the interval, in milliseconds, that the asynchronous
+ interrupt transfer is polled.
+ @param DataLength Indicates the length of data to be received at the rate specified by
+ PollingInterval from the target asynchronous interrupt
+ endpoint. This parameter is only required when IsNewTransfer is TRUE.
+ @param CallBackFunction The Callback function. This function is called at the rate specified by
+ PollingInterval. This parameter is only required when IsNewTransfer is TRUE.
+ @param Context The context that is passed to the CallBackFunction.
+
+ @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully
+ submitted or canceled.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.
+ @retval EFI_TIMEOUT The bulk transfer failed due to timeout.
+ @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER)(
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN BOOLEAN IsSlowDevice,
+ IN UINT8 MaxiumPacketLength,
+ IN BOOLEAN IsNewTransfer,
+ IN OUT UINT8 *DataToggle,
+ IN UINTN PollingInterval OPTIONAL,
+ IN UINTN DataLength OPTIONAL,
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,
+ IN VOID *Context OPTIONAL
+ );
+
+/**
+ Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.
+
+ @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
+ @param DeviceAddress Represents the address of the target device on the USB, which is
+ assigned during USB enumeration.
+ @param EndPointAddress The combination of an endpoint number and an endpoint
+ direction of the target USB device. Each endpoint address
+ supports data transfer in one direction except the control
+ endpoint (whose default endpoint address is zero). It is the
+ caller's responsibility to make sure that the
+ EndPointAddress represents an interrupt endpoint.
+ @param IsSlowDevice Indicates whether the target device is slow device or full-speed
+ device.
+ @param MaximumPacketLength Indicates the maximum packet size that the default control
+ transfer endpoint is capable of sending or receiving.
+ @param Data A pointer to the buffer of data that will be transmitted to USB
+ device or received from USB device. asynchronous interrupt pipe is canceled.
+ @param DataLength On input, the size, in bytes, of the data buffer specified by Data.
+ On output, the number of bytes transferred.
+ @param DataToggle A pointer to the data toggle value. On input, it indicates the initial
+ data toggle value the synchronous interrupt transfer should adopt;
+ on output, it is updated to indicate the data toggle value of the
+ subsequent synchronous interrupt transfer.
+ @param TimeOut Indicates the maximum time, in milliseconds, which the transfer
+ is allowed to complete.
+ @param TransferResult A pointer to the detailed result information from the synchronous
+ interrupt transfer.
+
+ @retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.
+ @retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.
+ @retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER)(
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN BOOLEAN IsSlowDevice,
+ IN UINT8 MaximumPacketLength,
+ IN OUT VOID *Data,
+ IN OUT UINTN *DataLength,
+ IN OUT UINT8 *DataToggle,
+ IN UINTN TimeOut,
+ OUT UINT32 *TransferResult
+ );
+
+/**
+ Submits isochronous transfer to an isochronous endpoint of a USB device.
+
+ @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
+ @param DeviceAddress Represents the address of the target device on the USB, which is
+ assigned during USB enumeration.
+ @param EndPointAddress The combination of an endpoint number and an endpoint
+ direction of the target USB device. Each endpoint address
+ supports data transfer in one direction except the control
+ endpoint (whose default endpoint address is 0). It is the caller's
+ responsibility to make sure that the EndPointAddress
+ represents an isochronous endpoint.
+ @param MaximumPacketLength Indicates the maximum packet size that the default control
+ transfer endpoint is capable of sending or receiving.
+ @param Data A pointer to the buffer of data that will be transmitted to USB
+ device or received from USB device. asynchronous interrupt pipe is canceled.
+ @param DataLength Specifies the length, in bytes, of the data to be sent to or received
+ from the USB device.
+ @param TransferResult A pointer to the detailed result information from the isochronous
+ transfer.
+
+ @retval EFI_SUCCESS The isochronous transfer was completed successfully.
+ @retval EFI_OUT_OF_RESOURCES The isochronous could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.
+ @retval EFI_TIMEOUT The isochronous transfer failed due to timeout.
+ @retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER)(
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 MaximumPacketLength,
+ IN OUT VOID *Data,
+ IN UINTN DataLength,
+ OUT UINT32 *TransferResult
+ );
+
+/**
+ Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.
+
+ @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
+ @param DeviceAddress Represents the address of the target device on the USB, which is
+ assigned during USB enumeration.
+ @param EndPointAddress The combination of an endpoint number and an endpoint
+ direction of the target USB device. Each endpoint address
+ supports data transfer in one direction except the control
+ endpoint (whose default endpoint address is zero). It is the
+ caller's responsibility to make sure that the
+ EndPointAddress represents an isochronous endpoint.
+ @param MaximumPacketLength Indicates the maximum packet size that the default control
+ transfer endpoint is capable of sending or receiving. For isochronous
+ endpoints, this value is used to reserve the bus time in the schedule,
+ required for the perframe data payloads. The pipe may, on an ongoing basis,
+ actually use less bandwidth than that reserved.
+ @param Data A pointer to the buffer of data that will be transmitted to USB
+ device or received from USB device. asynchronous interrupt pipe is canceled.
+ @param DataLength Specifies the length, in bytes, of the data to be sent to or received
+ from the USB device.
+ @param IsochronousCallback The Callback function.This function is called if the requested
+ isochronous transfer is completed.
+ @param Context Data passed to the IsochronousCallback function. This is
+ an optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The asynchronous isochronous transfer was completed successfully.
+ @retval EFI_OUT_OF_RESOURCES The asynchronous isochronous could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER)(
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 MaximumPacketLength,
+ IN OUT VOID *Data,
+ IN UINTN DataLength,
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
+ IN VOID *Context OPTIONAL
+ );
+
+/**
+ Retrieves the number of root hub ports.
+
+ @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
+ @param PortNumber A pointer to the number of the root hub ports.
+
+ @retval EFI_SUCCESS The port number was retrieved successfully.
+ @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the port number.
+ @retval EFI_INVALID_PARAMETER PortNumber is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER)(
+ IN EFI_USB_HC_PROTOCOL *This,
+ OUT UINT8 *PortNumber
+ );
+
+/**
+ Retrieves the current status of a USB root hub port.
+
+ @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
+ @param PortNumber Specifies the root hub port from which the status is to be retrieved.
+ This value is zero based. For example, if a root hub has two ports,
+ then the first port is numbered 0, and the second port is
+ numbered 1.
+ @param PortStatus A pointer to the current port status bits and port status change bits.
+
+ @retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber
+ was returned in PortStatus.
+ @retval EFI_INVALID_PARAMETER PortNumber is invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS)(
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 PortNumber,
+ OUT EFI_USB_PORT_STATUS *PortStatus
+ );
+
+/**
+ Sets a feature for the specified root hub port.
+
+ @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
+ @param PortNumber Specifies the root hub port from which the status is to be retrieved.
+ This value is zero based. For example, if a root hub has two ports,
+ then the first port is numbered 0, and the second port is
+ numbered 1.
+ @param PortFeature Indicates the feature selector associated with the feature set
+ request.
+
+ @retval EFI_SUCCESS The feature specified by PortFeature was set for the USB
+ root hub port specified by PortNumber.
+ @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE)(
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 PortNumber,
+ IN EFI_USB_PORT_FEATURE PortFeature
+ );
+
+/**
+ Clears a feature for the specified root hub port.
+
+ @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
+ @param PortNumber Specifies the root hub port from which the status is to be retrieved.
+ This value is zero based. For example, if a root hub has two ports,
+ then the first port is numbered 0, and the second port is
+ numbered 1.
+ @param PortFeature Indicates the feature selector associated with the feature clear
+ request.
+
+ @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB
+ root hub port specified by PortNumber.
+ @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE)(
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 PortNumber,
+ IN EFI_USB_PORT_FEATURE PortFeature
+ );
+
+
+///
+/// The EFI_USB_HC_PROTOCOL provides USB host controller management, basic data transactions
+/// over a USB bus, and USB root hub access. A device driver that wishes to manage a USB bus in a
+/// system retrieves the EFI_USB_HC_PROTOCOL instance that is associated with the USB bus to be
+/// managed. A device handle for a USB host controller will minimally contain an
+/// EFI_DEVICE_PATH_PROTOCOL instance, and an EFI_USB_HC_PROTOCOL instance.
+///
+struct _EFI_USB_HC_PROTOCOL {
+ EFI_USB_HC_PROTOCOL_RESET Reset;
+ EFI_USB_HC_PROTOCOL_GET_STATE GetState;
+ EFI_USB_HC_PROTOCOL_SET_STATE SetState;
+ EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;
+ EFI_USB_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;
+ EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;
+ EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;
+ EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;
+ EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;
+ EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER GetRootHubPortNumber;
+ EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;
+ EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;
+ EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;
+ ///
+ /// The major revision number of the USB host controller. The revision information
+ /// indicates the release of the Universal Serial Bus Specification with which the
+ /// host controller is compliant.
+ ///
+ UINT16 MajorRevision;
+ ///
+ /// The minor revision number of the USB host controller. The revision information
+ /// indicates the release of the Universal Serial Bus Specification with which the
+ /// host controller is compliant.
+ ///
+ UINT16 MinorRevision;
+};
+
+extern EFI_GUID gEfiUsbHcProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UsbIo.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UsbIo.h
new file mode 100644
index 0000000000..cc7263b6aa
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UsbIo.h
@@ -0,0 +1,512 @@
+/** @file
+ EFI Usb I/O Protocol as defined in UEFI specification.
+ This protocol is used by code, typically drivers, running in the EFI
+ boot services environment to access USB devices like USB keyboards,
+ mice and mass storage devices. In particular, functions for managing devices
+ on USB buses are defined here.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __USB_IO_H__
+#define __USB_IO_H__
+
+#include <IndustryStandard/Usb.h>
+
+//
+// Global ID for the USB I/O Protocol
+//
+#define EFI_USB_IO_PROTOCOL_GUID \
+ { \
+ 0x2B2F68D6, 0x0CD2, 0x44cf, {0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 } \
+ }
+
+typedef struct _EFI_USB_IO_PROTOCOL EFI_USB_IO_PROTOCOL;
+
+//
+// Related Definition for EFI USB I/O protocol
+//
+
+//
+// USB standard descriptors and reqeust
+//
+typedef USB_DEVICE_REQUEST EFI_USB_DEVICE_REQUEST;
+typedef USB_DEVICE_DESCRIPTOR EFI_USB_DEVICE_DESCRIPTOR;
+typedef USB_CONFIG_DESCRIPTOR EFI_USB_CONFIG_DESCRIPTOR;
+typedef USB_INTERFACE_DESCRIPTOR EFI_USB_INTERFACE_DESCRIPTOR;
+typedef USB_ENDPOINT_DESCRIPTOR EFI_USB_ENDPOINT_DESCRIPTOR;
+
+///
+/// USB data transfer direction
+///
+typedef enum {
+ EfiUsbDataIn,
+ EfiUsbDataOut,
+ EfiUsbNoData
+} EFI_USB_DATA_DIRECTION;
+
+//
+// USB Transfer Results
+//
+#define EFI_USB_NOERROR 0x00
+#define EFI_USB_ERR_NOTEXECUTE 0x01
+#define EFI_USB_ERR_STALL 0x02
+#define EFI_USB_ERR_BUFFER 0x04
+#define EFI_USB_ERR_BABBLE 0x08
+#define EFI_USB_ERR_NAK 0x10
+#define EFI_USB_ERR_CRC 0x20
+#define EFI_USB_ERR_TIMEOUT 0x40
+#define EFI_USB_ERR_BITSTUFF 0x80
+#define EFI_USB_ERR_SYSTEM 0x100
+
+/**
+ Async USB transfer callback routine.
+
+ @param Data Data received or sent via the USB Asynchronous Transfer, if the
+ transfer completed successfully.
+ @param DataLength The length of Data received or sent via the Asynchronous
+ Transfer, if transfer successfully completes.
+ @param Context Data passed from UsbAsyncInterruptTransfer() request.
+ @param Status Indicates the result of the asynchronous transfer.
+
+ @retval EFI_SUCCESS The asynchronous USB transfer request has been successfully executed.
+ @retval EFI_DEVICE_ERROR The asynchronous USB transfer request failed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ASYNC_USB_TRANSFER_CALLBACK)(
+ IN VOID *Data,
+ IN UINTN DataLength,
+ IN VOID *Context,
+ IN UINT32 Status
+ );
+
+//
+// Prototype for EFI USB I/O protocol
+//
+
+
+/**
+ This function is used to manage a USB device with a control transfer pipe. A control transfer is
+ typically used to perform device initialization and configuration.
+
+ @param This A pointer to the EFI_USB_IO_PROTOCOL instance.
+ @param Request A pointer to the USB device request that will be sent to the USB
+ device.
+ @param Direction Indicates the data direction.
+ @param Timeout Indicating the transfer should be completed within this time frame.
+ The units are in milliseconds.
+ @param Data A pointer to the buffer of data that will be transmitted to USB
+ device or received from USB device.
+ @param DataLength The size, in bytes, of the data buffer specified by Data.
+ @param Status A pointer to the result of the USB transfer.
+
+ @retval EFI_SUCCESS The control transfer has been successfully executed.
+ @retval EFI_DEVICE_ERROR The transfer failed. The transfer status is returned in Status.
+ @retval EFI_INVALID_PARAMETE One or more parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_TIMEOUT The control transfer fails due to timeout.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_IO_CONTROL_TRANSFER)(
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN EFI_USB_DEVICE_REQUEST *Request,
+ IN EFI_USB_DATA_DIRECTION Direction,
+ IN UINT32 Timeout,
+ IN OUT VOID *Data OPTIONAL,
+ IN UINTN DataLength OPTIONAL,
+ OUT UINT32 *Status
+ );
+
+/**
+ This function is used to manage a USB device with the bulk transfer pipe. Bulk Transfers are
+ typically used to transfer large amounts of data to/from USB devices.
+
+ @param This A pointer to the EFI_USB_IO_PROTOCOL instance.
+ @param DeviceEndpoint The destination USB device endpoint to which the
+ device request is being sent. DeviceEndpoint must
+ be between 0x01 and 0x0F or between 0x81 and 0x8F,
+ otherwise EFI_INVALID_PARAMETER is returned. If
+ the endpoint is not a BULK endpoint, EFI_INVALID_PARAMETER
+ is returned. The MSB of this parameter indicates
+ the endpoint direction. The number "1" stands for
+ an IN endpoint, and "0" stands for an OUT endpoint.
+ @param Data A pointer to the buffer of data that will be transmitted to USB
+ device or received from USB device.
+ @param DataLength The size, in bytes, of the data buffer specified by Data.
+ On input, the size, in bytes, of the data buffer specified by Data.
+ On output, the number of bytes that were actually transferred.
+ @param Timeout Indicating the transfer should be completed within this time frame.
+ The units are in milliseconds. If Timeout is 0, then the
+ caller must wait for the function to be completed until
+ EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+ @param Status This parameter indicates the USB transfer status.
+
+ @retval EFI_SUCCESS The bulk transfer has been successfully executed.
+ @retval EFI_DEVICE_ERROR The transfer failed. The transfer status is returned in Status.
+ @retval EFI_INVALID_PARAMETE One or more parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be submitted due to a lack of resources.
+ @retval EFI_TIMEOUT The control transfer fails due to timeout.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_IO_BULK_TRANSFER)(
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT8 DeviceEndpoint,
+ IN OUT VOID *Data,
+ IN OUT UINTN *DataLength,
+ IN UINTN Timeout,
+ OUT UINT32 *Status
+ );
+
+/**
+ This function is used to manage a USB device with an interrupt transfer pipe. An Asynchronous
+ Interrupt Transfer is typically used to query a device's status at a fixed rate. For example,
+ keyboard, mouse, and hub devices use this type of transfer to query their interrupt endpoints at
+ a fixed rate.
+
+ @param This A pointer to the EFI_USB_IO_PROTOCOL instance.
+ @param DeviceEndpoint The destination USB device endpoint to which the
+ device request is being sent. DeviceEndpoint must
+ be between 0x01 and 0x0F or between 0x81 and 0x8F,
+ otherwise EFI_INVALID_PARAMETER is returned. If
+ the endpoint is not a BULK endpoint, EFI_INVALID_PARAMETER
+ is returned. The MSB of this parameter indicates
+ the endpoint direction. The number "1" stands for
+ an IN endpoint, and "0" stands for an OUT endpoint.
+ @param IsNewTransfer If TRUE, a new transfer will be submitted to USB controller. If
+ FALSE, the interrupt transfer is deleted from the device's interrupt
+ transfer queue.
+ @param PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be
+ executed.This parameter is required when IsNewTransfer is TRUE. The
+ value must be between 1 to 255, otherwise EFI_INVALID_PARAMETER is returned.
+ The units are in milliseconds.
+ @param DataLength Specifies the length, in bytes, of the data to be received from the
+ USB device. This parameter is only required when IsNewTransfer is TRUE.
+ @param InterruptCallback The Callback function. This function is called if the asynchronous
+ interrupt transfer is completed. This parameter is required
+ when IsNewTransfer is TRUE.
+ @param Context Data passed to the InterruptCallback function. This is an optional
+ parameter and may be NULL.
+
+ @retval EFI_SUCCESS The asynchronous USB transfer request transfer has been successfully executed.
+ @retval EFI_DEVICE_ERROR The asynchronous USB transfer request failed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER)(
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT8 DeviceEndpoint,
+ IN BOOLEAN IsNewTransfer,
+ IN UINTN PollingInterval OPTIONAL,
+ IN UINTN DataLength OPTIONAL,
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK InterruptCallBack OPTIONAL,
+ IN VOID *Context OPTIONAL
+ );
+
+/**
+ This function is used to manage a USB device with an interrupt transfer pipe.
+
+ @param This A pointer to the EFI_USB_IO_PROTOCOL instance.
+ @param DeviceEndpoint The destination USB device endpoint to which the
+ device request is being sent. DeviceEndpoint must
+ be between 0x01 and 0x0F or between 0x81 and 0x8F,
+ otherwise EFI_INVALID_PARAMETER is returned. If
+ the endpoint is not a BULK endpoint, EFI_INVALID_PARAMETER
+ is returned. The MSB of this parameter indicates
+ the endpoint direction. The number "1" stands for
+ an IN endpoint, and "0" stands for an OUT endpoint.
+ @param Data A pointer to the buffer of data that will be transmitted to USB
+ device or received from USB device.
+ @param DataLength On input, then size, in bytes, of the buffer Data. On output, the
+ amount of data actually transferred.
+ @param Timeout The time out, in seconds, for this transfer. If Timeout is 0,
+ then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned. If the
+ transfer is not completed in this time frame, then EFI_TIMEOUT is returned.
+ @param Status This parameter indicates the USB transfer status.
+
+ @retval EFI_SUCCESS The sync interrupt transfer has been successfully executed.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_DEVICE_ERROR The sync interrupt transfer request failed.
+ @retval EFI_OUT_OF_RESOURCES The request could not be submitted due to a lack of resources.
+ @retval EFI_TIMEOUT The transfer fails due to timeout.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_IO_SYNC_INTERRUPT_TRANSFER)(
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT8 DeviceEndpoint,
+ IN OUT VOID *Data,
+ IN OUT UINTN *DataLength,
+ IN UINTN Timeout,
+ OUT UINT32 *Status
+ );
+
+/**
+ This function is used to manage a USB device with an isochronous transfer pipe. An Isochronous
+ transfer is typically used to transfer streaming data.
+
+ @param This A pointer to the EFI_USB_IO_PROTOCOL instance.
+ @param DeviceEndpoint The destination USB device endpoint to which the
+ device request is being sent. DeviceEndpoint must
+ be between 0x01 and 0x0F or between 0x81 and 0x8F,
+ otherwise EFI_INVALID_PARAMETER is returned. If
+ the endpoint is not a BULK endpoint, EFI_INVALID_PARAMETER
+ is returned. The MSB of this parameter indicates
+ the endpoint direction. The number "1" stands for
+ an IN endpoint, and "0" stands for an OUT endpoint.
+ @param Data A pointer to the buffer of data that will be transmitted to USB
+ device or received from USB device.
+ @param DataLength The size, in bytes, of the data buffer specified by Data.
+ @param Status This parameter indicates the USB transfer status.
+
+ @retval EFI_SUCCESS The isochronous transfer has been successfully executed.
+ @retval EFI_INVALID_PARAMETER The parameter DeviceEndpoint is not valid.
+ @retval EFI_DEVICE_ERROR The transfer failed due to the reason other than timeout, The error status
+ is returned in Status.
+ @retval EFI_OUT_OF_RESOURCES The request could not be submitted due to a lack of resources.
+ @retval EFI_TIMEOUT The transfer fails due to timeout.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_IO_ISOCHRONOUS_TRANSFER)(
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT8 DeviceEndpoint,
+ IN OUT VOID *Data,
+ IN UINTN DataLength,
+ OUT UINT32 *Status
+ );
+
+/**
+ This function is used to manage a USB device with an isochronous transfer pipe. An Isochronous
+ transfer is typically used to transfer streaming data.
+
+ @param This A pointer to the EFI_USB_IO_PROTOCOL instance.
+ @param DeviceEndpoint The destination USB device endpoint to which the
+ device request is being sent. DeviceEndpoint must
+ be between 0x01 and 0x0F or between 0x81 and 0x8F,
+ otherwise EFI_INVALID_PARAMETER is returned. If
+ the endpoint is not a BULK endpoint, EFI_INVALID_PARAMETER
+ is returned. The MSB of this parameter indicates
+ the endpoint direction. The number "1" stands for
+ an IN endpoint, and "0" stands for an OUT endpoint.
+ @param Data A pointer to the buffer of data that will be transmitted to USB
+ device or received from USB device.
+ @param DataLength The size, in bytes, of the data buffer specified by Data.
+ This is an optional parameter and may be NULL.
+ @param IsochronousCallback The IsochronousCallback() function.This function is
+ called if the requested isochronous transfer is completed.
+ @param Context Data passed to the IsochronousCallback() function.
+
+ @retval EFI_SUCCESS The asynchronous isochronous transfer has been successfully submitted
+ to the system.
+ @retval EFI_INVALID_PARAMETER The parameter DeviceEndpoint is not valid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be submitted due to a lack of resources.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER)(
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT8 DeviceEndpoint,
+ IN OUT VOID *Data,
+ IN UINTN DataLength,
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
+ IN VOID *Context OPTIONAL
+ );
+
+/**
+ Resets and reconfigures the USB controller. This function will work for all USB devices except
+ USB Hub Controllers.
+
+ @param This A pointer to the EFI_USB_IO_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The USB controller was reset.
+ @retval EFI_INVALID_PARAMETER If the controller specified by This is a USB hub.
+ @retval EFI_DEVICE_ERROR An error occurred during the reconfiguration process.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_IO_PORT_RESET)(
+ IN EFI_USB_IO_PROTOCOL *This
+ );
+
+/**
+ Retrieves the USB Device Descriptor.
+
+ @param This A pointer to the EFI_USB_IO_PROTOCOL instance.
+ @param DeviceDescriptor A pointer to the caller allocated USB Device Descriptor.
+
+ @retval EFI_SUCCESS The device descriptor was retrieved successfully.
+ @retval EFI_INVALID_PARAMETER DeviceDescriptor is NULL.
+ @retval EFI_NOT_FOUND The device descriptor was not found. The device may not be configured.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_IO_GET_DEVICE_DESCRIPTOR)(
+ IN EFI_USB_IO_PROTOCOL *This,
+ OUT EFI_USB_DEVICE_DESCRIPTOR *DeviceDescriptor
+ );
+
+/**
+ Retrieves the USB Device Descriptor.
+
+ @param This A pointer to the EFI_USB_IO_PROTOCOL instance.
+ @param ConfigurationDescriptor A pointer to the caller allocated USB Active Configuration
+ Descriptor.
+ @retval EFI_SUCCESS The active configuration descriptor was retrieved successfully.
+ @retval EFI_INVALID_PARAMETER ConfigurationDescriptor is NULL.
+ @retval EFI_NOT_FOUND An active configuration descriptor cannot be found. The device may not
+ be configured.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_IO_GET_CONFIG_DESCRIPTOR)(
+ IN EFI_USB_IO_PROTOCOL *This,
+ OUT EFI_USB_CONFIG_DESCRIPTOR *ConfigurationDescriptor
+ );
+
+/**
+ Retrieves the Interface Descriptor for a USB Device Controller. As stated earlier, an interface
+ within a USB device is equivalently to a USB Controller within the current configuration.
+
+ @param This A pointer to the EFI_USB_IO_PROTOCOL instance.
+ @param InterfaceDescriptor A pointer to the caller allocated USB Interface Descriptor within
+ the configuration setting.
+ @retval EFI_SUCCESS The interface descriptor retrieved successfully.
+ @retval EFI_INVALID_PARAMETER InterfaceDescriptor is NULL.
+ @retval EFI_NOT_FOUND The interface descriptor cannot be found. The device may not be
+ correctly configured.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_IO_GET_INTERFACE_DESCRIPTOR)(
+ IN EFI_USB_IO_PROTOCOL *This,
+ OUT EFI_USB_INTERFACE_DESCRIPTOR *InterfaceDescriptor
+ );
+
+/**
+ Retrieves an Endpoint Descriptor within a USB Controller.
+
+ @param This A pointer to the EFI_USB_IO_PROTOCOL instance.
+ @param EndpointIndex Indicates which endpoint descriptor to retrieve.
+ @param EndpointDescriptor A pointer to the caller allocated USB Endpoint Descriptor of
+ a USB controller.
+
+ @retval EFI_SUCCESS The endpoint descriptor was retrieved successfully.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_NOT_FOUND The endpoint descriptor cannot be found. The device may not be
+ correctly configured.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR)(
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT8 EndpointIndex,
+ OUT EFI_USB_ENDPOINT_DESCRIPTOR *EndpointDescriptor
+ );
+
+/**
+ Retrieves a string stored in a USB Device.
+
+ @param This A pointer to the EFI_USB_IO_PROTOCOL instance.
+ @param LangID The Language ID for the string being retrieved.
+ @param StringID The ID of the string being retrieved.
+ @param String A pointer to a buffer allocated by this function with
+ AllocatePool() to store the string.If this function
+ returns EFI_SUCCESS, it stores the string the caller
+ wants to get. The caller should release the string
+ buffer with FreePool() after the string is not used any more.
+
+ @retval EFI_SUCCESS The string was retrieved successfully.
+ @retval EFI_NOT_FOUND The string specified by LangID and StringID was not found.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate the return buffer String.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_IO_GET_STRING_DESCRIPTOR)(
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT16 LangID,
+ IN UINT8 StringID,
+ OUT CHAR16 **String
+ );
+
+/**
+ Retrieves all the language ID codes that the USB device supports.
+
+ @param This A pointer to the EFI_USB_IO_PROTOCOL instance.
+ @param LangIDTable Language ID for the string the caller wants to get.
+ This is a 16-bit ID defined by Microsoft. This
+ buffer pointer is allocated and maintained by
+ the USB Bus Driver, the caller should not modify
+ its contents.
+ @param TableSize The size, in bytes, of the table LangIDTable.
+
+ @retval EFI_SUCCESS The support languages were retrieved successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_IO_GET_SUPPORTED_LANGUAGE)(
+ IN EFI_USB_IO_PROTOCOL *This,
+ OUT UINT16 **LangIDTable,
+ OUT UINT16 *TableSize
+ );
+
+///
+/// The EFI_USB_IO_PROTOCOL provides four basic transfers types described
+/// in the USB 1.1 Specification. These include control transfer, interrupt
+/// transfer, bulk transfer and isochronous transfer. The EFI_USB_IO_PROTOCOL
+/// also provides some basic USB device/controller management and configuration
+/// interfaces. A USB device driver uses the services of this protocol to manage USB devices.
+///
+struct _EFI_USB_IO_PROTOCOL {
+ //
+ // IO transfer
+ //
+ EFI_USB_IO_CONTROL_TRANSFER UsbControlTransfer;
+ EFI_USB_IO_BULK_TRANSFER UsbBulkTransfer;
+ EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER UsbAsyncInterruptTransfer;
+ EFI_USB_IO_SYNC_INTERRUPT_TRANSFER UsbSyncInterruptTransfer;
+ EFI_USB_IO_ISOCHRONOUS_TRANSFER UsbIsochronousTransfer;
+ EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER UsbAsyncIsochronousTransfer;
+
+ //
+ // Common device request
+ //
+ EFI_USB_IO_GET_DEVICE_DESCRIPTOR UsbGetDeviceDescriptor;
+ EFI_USB_IO_GET_CONFIG_DESCRIPTOR UsbGetConfigDescriptor;
+ EFI_USB_IO_GET_INTERFACE_DESCRIPTOR UsbGetInterfaceDescriptor;
+ EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR UsbGetEndpointDescriptor;
+ EFI_USB_IO_GET_STRING_DESCRIPTOR UsbGetStringDescriptor;
+ EFI_USB_IO_GET_SUPPORTED_LANGUAGE UsbGetSupportedLanguages;
+
+ //
+ // Reset controller's parent port
+ //
+ EFI_USB_IO_PORT_RESET UsbPortReset;
+};
+
+extern EFI_GUID gEfiUsbIoProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UserCredential.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UserCredential.h
new file mode 100644
index 0000000000..6dea643587
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UserCredential.h
@@ -0,0 +1,292 @@
+/** @file
+ UEFI 2.2 User Credential Protocol definition.It has been removed from UEFI 2.3.1 and replaced
+ by EFI_USER_CREDENTIAL2_PROTOCOL.
+
+ Attached to a device handle, this protocol identifies a single means of identifying the user.
+
+ Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __USER_CREDENTIAL_H__
+#define __USER_CREDENTIAL_H__
+
+#include <Protocol/UserManager.h>
+
+#define EFI_USER_CREDENTIAL_PROTOCOL_GUID \
+ { \
+ 0x71ee5e94, 0x65b9, 0x45d5, { 0x82, 0x1a, 0x3a, 0x4d, 0x86, 0xcf, 0xe6, 0xbe } \
+ }
+
+typedef struct _EFI_USER_CREDENTIAL_PROTOCOL EFI_USER_CREDENTIAL_PROTOCOL;
+
+/**
+ Enroll a user on a credential provider.
+
+ This function enrolls and deletes a user profile using this credential provider. If a user profile
+ is successfully enrolled, it calls the User Manager Protocol function Notify() to notify the user
+ manager driver that credential information has changed. If an enrolled user does exist, delete the
+ user on the credential provider.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
+ @param[in] User The user profile to enroll.
+
+ @retval EFI_SUCCESS User profile was successfully enrolled.
+ @retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the user profile
+ handle. Either the user profile cannot enroll on any user profile or
+ cannot enroll on a user profile other than the current user profile.
+ @retval EFI_UNSUPPORTED This credential provider does not support enrollment in the pre-OS.
+ @retval EFI_DEVICE_ERROR The new credential could not be created because of a device error.
+ @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_ENROLL)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User
+ );
+
+/**
+ Returns the user interface information used during user identification.
+
+ This function returns information about the form used when interacting with the user during user
+ identification. The form is the first enabled form in the form-set class
+ EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If
+ the user credential provider does not require a form to identify the user, then this function should
+ return EFI_NOT_FOUND.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
+ @param[out] Hii On return, holds the HII database handle.
+ @param[out] FormSetId On return, holds the identifier of the form set which contains
+ the form used during user identification.
+ @param[out] FormId On return, holds the identifier of the form used during user
+ identification.
+
+ @retval EFI_SUCCESS Form returned successfully.
+ @retval EFI_NOT_FOUND Form not returned.
+ @retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_FORM)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ OUT EFI_HII_HANDLE *Hii,
+ OUT EFI_GUID *FormSetId,
+ OUT EFI_FORM_ID *FormId
+ );
+
+/**
+ Returns bitmap used to describe the credential provider type.
+
+ This optional function returns a bitmap which is less than or equal to the number of pixels specified
+ by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND is returned.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
+ @param[in, out] Width On entry, points to the desired bitmap width. If NULL then no bitmap
+ information will be returned. On exit, points to the width of the
+ bitmap returned.
+ @param[in, out] Height On entry, points to the desired bitmap height. If NULL then no bitmap
+ information will be returned. On exit, points to the height of the
+ bitmap returned
+ @param[out] Hii On return, holds the HII database handle.
+ @param[out] Image On return, holds the HII image identifier.
+
+ @retval EFI_SUCCESS Image identifier returned successfully.
+ @retval EFI_NOT_FOUND Image identifier not returned.
+ @retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_TILE)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ IN OUT UINTN *Width,
+ IN OUT UINTN *Height,
+ OUT EFI_HII_HANDLE *Hii,
+ OUT EFI_IMAGE_ID *Image
+ );
+
+/**
+ Returns string used to describe the credential provider type.
+
+ This function returns a string which describes the credential provider. If no such string exists, then
+ EFI_NOT_FOUND is returned.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
+ @param[out] Hii On return, holds the HII database handle.
+ @param[out] String On return, holds the HII string identifier.
+
+ @retval EFI_SUCCESS String identifier returned successfully.
+ @retval EFI_NOT_FOUND String identifier not returned.
+ @retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_TITLE)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ OUT EFI_HII_HANDLE *Hii,
+ OUT EFI_STRING_ID *String
+ );
+
+/**
+ Return the user identifier associated with the currently authenticated user.
+
+ This function returns the user identifier of the user authenticated by this credential provider. This
+ function is called after the credential-related information has been submitted on a form OR after a
+ call to Default() has returned that this credential is ready to log on.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
+ @param[in] User The user profile handle of the user profile currently being considered
+ by the user identity manager. If NULL, then no user profile is currently
+ under consideration.
+ @param[out] Identifier On return, points to the user identifier.
+
+ @retval EFI_SUCCESS User identifier returned successfully.
+ @retval EFI_NOT_READY No user identifier can be returned.
+ @retval EFI_ACCESS_DENIED The user has been locked out of this user credential.
+ @retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be found in user
+ profile database
+ @retval EFI_INVALID_PARAMETER Identifier is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_USER)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User,
+ OUT EFI_USER_INFO_IDENTIFIER *Identifier
+ );
+
+/**
+ Indicate that user interface interaction has begun for the specified credential.
+
+ This function is called when a credential provider is selected by the user. If AutoLogon returns
+ FALSE, then the user interface will be constructed by the User Identity Manager.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
+ @param[out] AutoLogon On return, points to the credential provider's capabilities after
+ the credential provider has been selected by the user.
+
+ @retval EFI_SUCCESS Credential provider successfully selected.
+ @retval EFI_INVALID_PARAMETER AutoLogon is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_SELECT)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon
+ );
+
+/**
+ Indicate that user interface interaction has ended for the specified credential.
+
+ This function is called when a credential provider is deselected by the user.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
+
+ @retval EFI_SUCCESS Credential provider successfully deselected.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_DESELECT)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This
+ );
+
+/**
+ Return the default logon behavior for this user credential.
+
+ This function reports the default login behavior regarding this credential provider.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
+ @param[out] AutoLogon On return, holds whether the credential provider should be
+ used by default to automatically log on the user.
+
+ @retval EFI_SUCCESS Default information successfully returned.
+ @retval EFI_INVALID_PARAMETER AutoLogon is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_DEFAULT)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon
+ );
+
+/**
+ Return information attached to the credential provider.
+
+ This function returns user information.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
+ @param[in] UserInfo Handle of the user information data record.
+ @param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On exit, holds the user
+ information. If the buffer is too small to hold the information, then
+ EFI_BUFFER_TOO_SMALL is returned and InfoSize is updated to contain the
+ number of bytes actually required.
+ @param[in,out] InfoSize On entry, points to the size of Info. On return, points to the size of the user
+ information.
+
+ @retval EFI_SUCCESS Information returned successfully.
+ @retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the user
+ information. The size required is returned in *InfoSize.
+ @retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.
+ @retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_GET_INFO)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ IN EFI_USER_INFO_HANDLE UserInfo,
+ OUT EFI_USER_INFO *Info,
+ IN OUT UINTN *InfoSize
+ );
+
+/**
+ Enumerate all of the user information records on the credential provider.
+
+ This function returns the next user information record. To retrieve the first user information record
+ handle, point UserInfo at a NULL. Each subsequent call will retrieve another user information
+ record handle until there are no more, at which point UserInfo will point to NULL.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
+ @param[in,out] UserInfo On entry, points to the previous user information handle or NULL to
+ start enumeration. On exit, points to the next user information handle
+ or NULL if there is no more user information.
+
+ @retval EFI_SUCCESS User information returned.
+ @retval EFI_NOT_FOUND No more user information found.
+ @retval EFI_INVALID_PARAMETER UserInfo is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_GET_NEXT_INFO)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ IN OUT EFI_USER_INFO_HANDLE *UserInfo
+ );
+
+///
+/// This protocol provides support for a single class of credentials
+///
+struct _EFI_USER_CREDENTIAL_PROTOCOL {
+ EFI_GUID Identifier; ///< Uniquely identifies this credential provider.
+ EFI_GUID Type; ///< Identifies this class of User Credential Provider.
+ EFI_CREDENTIAL_ENROLL Enroll;
+ EFI_CREDENTIAL_FORM Form;
+ EFI_CREDENTIAL_TILE Tile;
+ EFI_CREDENTIAL_TITLE Title;
+ EFI_CREDENTIAL_USER User;
+ EFI_CREDENTIAL_SELECT Select;
+ EFI_CREDENTIAL_DESELECT Deselect;
+ EFI_CREDENTIAL_DEFAULT Default;
+ EFI_CREDENTIAL_GET_INFO GetInfo;
+ EFI_CREDENTIAL_GET_NEXT_INFO GetNextInfo;
+ EFI_CREDENTIAL_CAPABILITIES Capabilities;
+};
+
+extern EFI_GUID gEfiUserCredentialProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UserCredential2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UserCredential2.h
new file mode 100644
index 0000000000..ed3423b47f
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UserCredential2.h
@@ -0,0 +1,314 @@
+/** @file
+ UEFI 2.3.1 User Credential Protocol definition.
+
+ Attached to a device handle, this protocol identifies a single means of identifying the user.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __USER_CREDENTIAL2_H__
+#define __USER_CREDENTIAL2_H__
+
+#include <Protocol/UserManager.h>
+
+#define EFI_USER_CREDENTIAL2_PROTOCOL_GUID \
+ { \
+ 0xe98adb03, 0xb8b9, 0x4af8, { 0xba, 0x20, 0x26, 0xe9, 0x11, 0x4c, 0xbc, 0xe5 } \
+ }
+
+typedef struct _EFI_USER_CREDENTIAL2_PROTOCOL EFI_USER_CREDENTIAL2_PROTOCOL;
+
+/**
+ Enroll a user on a credential provider.
+
+ This function enrolls a user on this credential provider. If the user exists on this credential
+ provider, update the user information on this credential provider; otherwise add the user information
+ on credential provider.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
+ @param[in] User The user profile to enroll.
+
+ @retval EFI_SUCCESS User profile was successfully enrolled.
+ @retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the user profile
+ handle. Either the user profile cannot enroll on any user profile or
+ cannot enroll on a user profile other than the current user profile.
+ @retval EFI_UNSUPPORTED This credential provider does not support enrollment in the pre-OS.
+ @retval EFI_DEVICE_ERROR The new credential could not be created because of a device error.
+ @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL2_ENROLL)(
+ IN CONST EFI_USER_CREDENTIAL2_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User
+ );
+
+/**
+ Returns the user interface information used during user identification.
+
+ This function returns information about the form used when interacting with the user during user
+ identification. The form is the first enabled form in the form-set class
+ EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If
+ the user credential provider does not require a form to identify the user, then this function should
+ return EFI_NOT_FOUND.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
+ @param[out] Hii On return, holds the HII database handle.
+ @param[out] FormSetId On return, holds the identifier of the form set which contains
+ the form used during user identification.
+ @param[out] FormId On return, holds the identifier of the form used during user
+ identification.
+
+ @retval EFI_SUCCESS Form returned successfully.
+ @retval EFI_NOT_FOUND Form not returned.
+ @retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL2_FORM)(
+ IN CONST EFI_USER_CREDENTIAL2_PROTOCOL *This,
+ OUT EFI_HII_HANDLE *Hii,
+ OUT EFI_GUID *FormSetId,
+ OUT EFI_FORM_ID *FormId
+ );
+
+/**
+ Returns bitmap used to describe the credential provider type.
+
+ This optional function returns a bitmap which is less than or equal to the number of pixels specified
+ by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND is returned.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
+ @param[in, out] Width On entry, points to the desired bitmap width. If NULL then no bitmap
+ information will be returned. On exit, points to the width of the
+ bitmap returned.
+ @param[in, out] Height On entry, points to the desired bitmap height. If NULL then no bitmap
+ information will be returned. On exit, points to the height of the
+ bitmap returned
+ @param[out] Hii On return, holds the HII database handle.
+ @param[out] Image On return, holds the HII image identifier.
+
+ @retval EFI_SUCCESS Image identifier returned successfully.
+ @retval EFI_NOT_FOUND Image identifier not returned.
+ @retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL2_TILE)(
+ IN CONST EFI_USER_CREDENTIAL2_PROTOCOL *This,
+ IN OUT UINTN *Width,
+ IN OUT UINTN *Height,
+ OUT EFI_HII_HANDLE *Hii,
+ OUT EFI_IMAGE_ID *Image
+ );
+
+/**
+ Returns string used to describe the credential provider type.
+
+ This function returns a string which describes the credential provider. If no such string exists, then
+ EFI_NOT_FOUND is returned.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
+ @param[out] Hii On return, holds the HII database handle.
+ @param[out] String On return, holds the HII string identifier.
+
+ @retval EFI_SUCCESS String identifier returned successfully.
+ @retval EFI_NOT_FOUND String identifier not returned.
+ @retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL2_TITLE)(
+ IN CONST EFI_USER_CREDENTIAL2_PROTOCOL *This,
+ OUT EFI_HII_HANDLE *Hii,
+ OUT EFI_STRING_ID *String
+ );
+
+/**
+ Return the user identifier associated with the currently authenticated user.
+
+ This function returns the user identifier of the user authenticated by this credential provider. This
+ function is called after the credential-related information has been submitted on a form OR after a
+ call to Default() has returned that this credential is ready to log on.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
+ @param[in] User The user profile handle of the user profile currently being considered
+ by the user identity manager. If NULL, then no user profile is currently
+ under consideration.
+ @param[out] Identifier On return, points to the user identifier.
+
+ @retval EFI_SUCCESS User identifier returned successfully.
+ @retval EFI_NOT_READY No user identifier can be returned.
+ @retval EFI_ACCESS_DENIED The user has been locked out of this user credential.
+ @retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be found in user
+ profile database
+ @retval EFI_INVALID_PARAMETER Identifier is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL2_USER)(
+ IN CONST EFI_USER_CREDENTIAL2_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User,
+ OUT EFI_USER_INFO_IDENTIFIER *Identifier
+ );
+
+/**
+ Indicate that user interface interaction has begun for the specified credential.
+
+ This function is called when a credential provider is selected by the user. If AutoLogon returns
+ FALSE, then the user interface will be constructed by the User Identity Manager.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
+ @param[out] AutoLogon On return, points to the credential provider's capabilities after
+ the credential provider has been selected by the user.
+
+ @retval EFI_SUCCESS Credential provider successfully selected.
+ @retval EFI_INVALID_PARAMETER AutoLogon is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL2_SELECT)(
+ IN CONST EFI_USER_CREDENTIAL2_PROTOCOL *This,
+ OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon
+ );
+
+/**
+ Indicate that user interface interaction has ended for the specified credential.
+
+ This function is called when a credential provider is deselected by the user.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
+
+ @retval EFI_SUCCESS Credential provider successfully deselected.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL2_DESELECT)(
+ IN CONST EFI_USER_CREDENTIAL2_PROTOCOL *This
+ );
+
+/**
+ Return the default logon behavior for this user credential.
+
+ This function reports the default login behavior regarding this credential provider.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
+ @param[out] AutoLogon On return, holds whether the credential provider should be
+ used by default to automatically log on the user.
+
+ @retval EFI_SUCCESS Default information successfully returned.
+ @retval EFI_INVALID_PARAMETER AutoLogon is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL2_DEFAULT)(
+ IN CONST EFI_USER_CREDENTIAL2_PROTOCOL *This,
+ OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon
+ );
+
+/**
+ Return information attached to the credential provider.
+
+ This function returns user information.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
+ @param[in] UserInfo Handle of the user information data record.
+ @param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On exit, holds the user
+ information. If the buffer is too small to hold the information, then
+ EFI_BUFFER_TOO_SMALL is returned and InfoSize is updated to contain the
+ number of bytes actually required.
+ @param[in,out] InfoSize On entry, points to the size of Info. On return, points to the size of the user
+ information.
+
+ @retval EFI_SUCCESS Information returned successfully.
+ @retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the user
+ information. The size required is returned in *InfoSize.
+ @retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.
+ @retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL2_GET_INFO)(
+ IN CONST EFI_USER_CREDENTIAL2_PROTOCOL *This,
+ IN EFI_USER_INFO_HANDLE UserInfo,
+ OUT EFI_USER_INFO *Info,
+ IN OUT UINTN *InfoSize
+ );
+
+/**
+ Enumerate all of the user information records on the credential provider.
+
+ This function returns the next user information record. To retrieve the first user information record
+ handle, point UserInfo at a NULL. Each subsequent call will retrieve another user information
+ record handle until there are no more, at which point UserInfo will point to NULL.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
+ @param[in,out] UserInfo On entry, points to the previous user information handle or NULL to
+ start enumeration. On exit, points to the next user information handle
+ or NULL if there is no more user information.
+
+ @retval EFI_SUCCESS User information returned.
+ @retval EFI_NOT_FOUND No more user information found.
+ @retval EFI_INVALID_PARAMETER UserInfo is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL2_GET_NEXT_INFO)(
+ IN CONST EFI_USER_CREDENTIAL2_PROTOCOL *This,
+ IN OUT EFI_USER_INFO_HANDLE *UserInfo
+ );
+
+/**
+ Delete a user on this credential provider.
+
+ This function deletes a user on this credential provider.
+
+ @param[in] This Points to this instance of the EFI_USER_CREDENTIAL2_PROTOCOL.
+ @param[in] User The user profile handle to delete.
+
+ @retval EFI_SUCCESS User profile was successfully deleted.
+ @retval EFI_ACCESS_DENIED Current user profile does not permit deletion on the user profile handle.
+ Either the user profile cannot delete on any user profile or cannot delete
+ on a user profile other than the current user profile.
+ @retval EFI_UNSUPPORTED This credential provider does not support deletion in the pre-OS.
+ @retval EFI_DEVICE_ERROR The new credential could not be deleted because of a device error.
+ @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL2_DELETE)(
+ IN CONST EFI_USER_CREDENTIAL2_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User
+);
+
+///
+/// This protocol provides support for a single class of credentials
+///
+struct _EFI_USER_CREDENTIAL2_PROTOCOL {
+ EFI_GUID Identifier; ///< Uniquely identifies this credential provider.
+ EFI_GUID Type; ///< Identifies this class of User Credential Provider.
+ EFI_CREDENTIAL2_ENROLL Enroll;
+ EFI_CREDENTIAL2_FORM Form;
+ EFI_CREDENTIAL2_TILE Tile;
+ EFI_CREDENTIAL2_TITLE Title;
+ EFI_CREDENTIAL2_USER User;
+ EFI_CREDENTIAL2_SELECT Select;
+ EFI_CREDENTIAL2_DESELECT Deselect;
+ EFI_CREDENTIAL2_DEFAULT Default;
+ EFI_CREDENTIAL2_GET_INFO GetInfo;
+ EFI_CREDENTIAL2_GET_NEXT_INFO GetNextInfo;
+ EFI_CREDENTIAL_CAPABILITIES Capabilities;
+ EFI_CREDENTIAL2_DELETE Delete;
+};
+
+extern EFI_GUID gEfiUserCredential2ProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UserManager.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UserManager.h
new file mode 100644
index 0000000000..73fa672a59
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/UserManager.h
@@ -0,0 +1,624 @@
+/** @file
+ UEFI User Manager Protocol definition.
+
+ This protocol manages user profiles.
+
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __USER_MANAGER_H__
+#define __USER_MANAGER_H__
+
+///
+/// Global ID for the User Manager Protocol
+///
+#define EFI_USER_MANAGER_PROTOCOL_GUID \
+ { \
+ 0x6fd5b00c, 0xd426, 0x4283, { 0x98, 0x87, 0x6c, 0xf5, 0xcf, 0x1c, 0xb1, 0xfe } \
+ }
+
+#define EFI_EVENT_GROUP_USER_PROFILE_CHANGED \
+ { \
+ 0xbaf1e6de, 0x209e, 0x4adb, { 0x8d, 0x96, 0xfd, 0x8b, 0x71, 0xf3, 0xf6, 0x83 } \
+ }
+
+typedef VOID *EFI_USER_PROFILE_HANDLE;
+typedef VOID *EFI_USER_INFO_HANDLE;
+
+///
+/// The attributes of the user profile information.
+///
+typedef UINT16 EFI_USER_INFO_ATTRIBS;
+#define EFI_USER_INFO_STORAGE 0x000F
+#define EFI_USER_INFO_STORAGE_VOLATILE 0x0000
+#define EFI_USER_INFO_STORAGE_CREDENTIAL_NV 0x0001
+#define EFI_USER_INFO_STORAGE_PLATFORM_NV 0x0002
+
+#define EFI_USER_INFO_ACCESS 0x0070
+#define EFI_USER_INFO_PUBLIC 0x0010
+#define EFI_USER_INFO_PRIVATE 0x0020
+#define EFI_USER_INFO_PROTECTED 0x0030
+#define EFI_USER_INFO_EXCLUSIVE 0x0080
+
+///
+/// User information structure
+///
+typedef struct {
+ ///
+ /// The user credential identifier associated with this user information or else Nil if the
+ /// information is not associated with any specific credential.
+ ///
+ EFI_GUID Credential;
+ ///
+ /// The type of user information.
+ ///
+ UINT8 InfoType;
+ ///
+ /// Must be set to 0.
+ ///
+ UINT8 Reserved1;
+ ///
+ /// The attributes of the user profile information.
+ ///
+ EFI_USER_INFO_ATTRIBS InfoAttribs;
+ ///
+ /// The size of the user information, in bytes, including this header.
+ ///
+ UINT32 InfoSize;
+} EFI_USER_INFO;
+
+///
+/// User credential class GUIDs
+///
+#define EFI_USER_CREDENTIAL_CLASS_UNKNOWN \
+ { 0x5cf32e68, 0x7660, 0x449b, { 0x80, 0xe6, 0x7e, 0xa3, 0x6e, 0x3, 0xf6, 0xa8 } }
+#define EFI_USER_CREDENTIAL_CLASS_PASSWORD \
+ { 0xf8e5058c, 0xccb6, 0x4714, { 0xb2, 0x20, 0x3f, 0x7e, 0x3a, 0x64, 0xb, 0xd1 } }
+#define EFI_USER_CREDENTIAL_CLASS_SMART_CARD \
+ { 0x5f03ba33, 0x8c6b, 0x4c24, { 0xaa, 0x2e, 0x14, 0xa2, 0x65, 0x7b, 0xd4, 0x54 } }
+#define EFI_USER_CREDENTIAL_CLASS_FINGERPRINT \
+ { 0x32cba21f, 0xf308, 0x4cbc, { 0x9a, 0xb5, 0xf5, 0xa3, 0x69, 0x9f, 0x4, 0x4a } }
+#define EFI_USER_CREDENTIAL_CLASS_HANDPRINT \
+ { 0x5917ef16, 0xf723, 0x4bb9, { 0xa6, 0x4b, 0xd8, 0xc5, 0x32, 0xf4, 0xd8, 0xb5 } }
+#define EFI_USER_CREDENTIAL_CLASS_SECURE_CARD \
+ { 0x8a6b4a83, 0x42fe, 0x45d2, { 0xa2, 0xef, 0x46, 0xf0, 0x6c, 0x7d, 0x98, 0x52 } }
+
+typedef UINT64 EFI_CREDENTIAL_CAPABILITIES;
+#define EFI_CREDENTIAL_CAPABILITIES_ENROLL 0x0000000000000001
+
+///
+/// Credential logon flags
+///
+typedef UINT32 EFI_CREDENTIAL_LOGON_FLAGS;
+#define EFI_CREDENTIAL_LOGON_FLAG_AUTO 0x00000001
+#define EFI_CREDENTIAL_LOGON_FLAG_DEFAULT 0x00000002
+
+///
+/// User information record types
+///
+
+///
+/// No information.
+///
+#define EFI_USER_INFO_EMPTY_RECORD 0x00
+///
+/// Provide the user's name for the enrolled user.
+///
+#define EFI_USER_INFO_NAME_RECORD 0x01
+typedef CHAR16 *EFI_USER_INFO_NAME;
+///
+/// Provides the date and time when the user profile was created.
+///
+#define EFI_USER_INFO_CREATE_DATE_RECORD 0x02
+typedef EFI_TIME EFI_USER_INFO_CREATE_DATE;
+///
+/// Provides the date and time when the user profile was selected.
+///
+#define EFI_USER_INFO_USAGE_DATE_RECORD 0x03
+typedef EFI_TIME EFI_USER_INFO_USAGE_DATE;
+///
+/// Provides the number of times that the user profile has been selected.
+///
+#define EFI_USER_INFO_USAGE_COUNT_RECORD 0x04
+typedef UINT64 EFI_USER_INFO_USAGE_COUNT;
+///
+/// Provides a unique non-volatile user identifier for each enrolled user.
+///
+#define EFI_USER_INFO_IDENTIFIER_RECORD 0x05
+typedef UINT8 EFI_USER_INFO_IDENTIFIER[16];
+///
+/// Specifies the type of a particular credential associated with the user profile.
+///
+#define EFI_USER_INFO_CREDENTIAL_TYPE_RECORD 0x06
+typedef EFI_GUID EFI_USER_INFO_CREDENTIAL_TYPE;
+///
+/// Specifies the user-readable name of a particular credential type.
+///
+#define EFI_USER_INFO_CREDENTIAL_TYPE_NAME_RECORD 0x07
+typedef CHAR16 *EFI_USER_INFO_CREDENTIAL_TYPE_NAME;
+///
+/// Specifies the credential provider.
+///
+#define EFI_USER_INFO_CREDENTIAL_PROVIDER_RECORD 0x08
+typedef EFI_GUID EFI_USER_INFO_CREDENTIAL_PROVIDER;
+///
+/// Specifies the user-readable name of a particular credential's provider.
+///
+#define EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD 0x09
+typedef CHAR16 *EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME;
+///
+/// Provides PKCS#11 credential information from a smart card.
+///
+#define EFI_USER_INFO_PKCS11_RECORD 0x0A
+///
+/// Provides standard biometric information in the format specified by the ISO 19785 (Common
+/// Biometric Exchange Formats Framework) specification.
+///
+#define EFI_USER_INFO_CBEFF_RECORD 0x0B
+typedef VOID *EFI_USER_INFO_CBEFF;
+///
+/// Indicates how close of a match the fingerprint must be in order to be considered a match.
+///
+#define EFI_USER_INFO_FAR_RECORD 0x0C
+typedef UINT8 EFI_USER_INFO_FAR;
+///
+/// Indicates how many attempts the user has to with a particular credential before the system prevents
+/// further attempts.
+///
+#define EFI_USER_INFO_RETRY_RECORD 0x0D
+typedef UINT8 EFI_USER_INFO_RETRY;
+///
+/// Provides the user's pre-OS access rights.
+///
+#define EFI_USER_INFO_ACCESS_POLICY_RECORD 0x0E
+
+typedef struct {
+ UINT32 Type; ///< Specifies the type of user access control.
+ UINT32 Size; ///< Specifies the size of the user access control record, in bytes, including this header.
+} EFI_USER_INFO_ACCESS_CONTROL;
+
+typedef EFI_USER_INFO_ACCESS_CONTROL EFI_USER_INFO_ACCESS_POLICY;
+
+///
+/// User Information access types
+///
+
+///
+/// Forbids the user from booting or loading executables from the specified device path or any child
+/// device paths.
+///
+#define EFI_USER_INFO_ACCESS_FORBID_LOAD 0x00000001
+///
+/// Permits the user from booting or loading executables from the specified device path or any child
+/// device paths.
+/// Note: in-consistency between code and the UEFI 2.3 specification here.
+/// The definition EFI_USER_INFO_ACCESS_PERMIT_BOOT in the specification should be typo and wait for
+/// spec update.
+///
+#define EFI_USER_INFO_ACCESS_PERMIT_LOAD 0x00000002
+///
+/// Presence of this record indicates that a user can update enrollment information.
+///
+#define EFI_USER_INFO_ACCESS_ENROLL_SELF 0x00000003
+///
+/// Presence of this record indicates that a user can enroll new users.
+///
+#define EFI_USER_INFO_ACCESS_ENROLL_OTHERS 0x00000004
+///
+/// Presence of this record indicates that a user can update the user information of any user.
+///
+#define EFI_USER_INFO_ACCESS_MANAGE 0x00000005
+///
+/// Describes permissions usable when configuring the platform.
+///
+#define EFI_USER_INFO_ACCESS_SETUP 0x00000006
+///
+/// Standard GUIDs for access to configure the platform.
+///
+#define EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID \
+ { 0x85b75607, 0xf7ce, 0x471e, { 0xb7, 0xe4, 0x2a, 0xea, 0x5f, 0x72, 0x32, 0xee } }
+#define EFI_USER_INFO_ACCESS_SETUP_NORMAL_GUID \
+ { 0x1db29ae0, 0x9dcb, 0x43bc, { 0x8d, 0x87, 0x5d, 0xa1, 0x49, 0x64, 0xdd, 0xe2 } }
+#define EFI_USER_INFO_ACCESS_SETUP_RESTRICTED_GUID \
+ { 0xbdb38125, 0x4d63, 0x49f4, { 0x82, 0x12, 0x61, 0xcf, 0x5a, 0x19, 0xa, 0xf8 } }
+
+///
+/// Forbids UEFI drivers from being started from the specified device path(s) or any child device paths.
+///
+#define EFI_USER_INFO_ACCESS_FORBID_CONNECT 0x00000007
+///
+/// Permits UEFI drivers to be started on the specified device path(s) or any child device paths.
+///
+#define EFI_USER_INFO_ACCESS_PERMIT_CONNECT 0x00000008
+///
+/// Modifies the boot order.
+///
+#define EFI_USER_INFO_ACCESS_BOOT_ORDER 0x00000009
+typedef UINT32 EFI_USER_INFO_ACCESS_BOOT_ORDER_HDR;
+
+#define EFI_USER_INFO_ACCESS_BOOT_ORDER_MASK 0x0000000F
+///
+/// Insert new boot options at the beginning of the boot order.
+///
+#define EFI_USER_INFO_ACCESS_BOOT_ORDER_INSERT 0x00000000
+///
+/// Append new boot options to the end of the boot order.
+///
+#define EFI_USER_INFO_ACCESS_BOOT_ORDER_APPEND 0x00000001
+///
+/// Replace the entire boot order.
+///
+#define EFI_USER_INFO_ACCESS_BOOT_ORDER_REPLACE 0x00000002
+///
+/// The Boot Manager will not attempt find a default boot device
+/// when the default boot order is does not lead to a bootable device.
+///
+#define EFI_USER_INFO_ACCESS_BOOT_ORDER_NODEFAULT 0x00000010
+
+///
+/// Provides the expression which determines which credentials are required to assert user identity.
+///
+#define EFI_USER_INFO_IDENTITY_POLICY_RECORD 0x0F
+
+typedef struct {
+ UINT32 Type; ///< Specifies either an operator or a data item.
+ UINT32 Length; ///< The length of this block, in bytes, including this header.
+} EFI_USER_INFO_IDENTITY_POLICY;
+
+///
+/// User identity policy expression operators.
+///
+#define EFI_USER_INFO_IDENTITY_FALSE 0x00
+#define EFI_USER_INFO_IDENTITY_TRUE 0x01
+#define EFI_USER_INFO_IDENTITY_CREDENTIAL_TYPE 0x02
+#define EFI_USER_INFO_IDENTITY_CREDENTIAL_PROVIDER 0x03
+#define EFI_USER_INFO_IDENTITY_NOT 0x10
+#define EFI_USER_INFO_IDENTITY_AND 0x11
+#define EFI_USER_INFO_IDENTITY_OR 0x12
+
+///
+/// Provides placeholder for additional user profile information identified by a GUID.
+///
+#define EFI_USER_INFO_GUID_RECORD 0xFF
+typedef EFI_GUID EFI_USER_INFO_GUID;
+
+///
+/// User information table
+/// A collection of EFI_USER_INFO records, prefixed with this header.
+///
+typedef struct {
+ UINT64 Size; ///< Total size of the user information table, in bytes.
+} EFI_USER_INFO_TABLE;
+
+typedef struct _EFI_USER_MANAGER_PROTOCOL EFI_USER_MANAGER_PROTOCOL;
+
+/**
+ Create a new user profile.
+
+ This function creates a new user profile with only a new user identifier attached and returns its
+ handle. The user profile is non-volatile, but the handle User can change across reboots.
+
+ @param[in] This Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
+ @param[out] User On return, points to the new user profile handle.
+ The user profile handle is unique only during this boot.
+
+ @retval EFI_SUCCESS User profile was successfully created.
+ @retval EFI_ACCESS_DENIED Current user does not have sufficient permissions to create a user profile.
+ @retval EFI_UNSUPPORTED Creation of new user profiles is not supported.
+ @retval EFI_INVALID_PARAMETER The User parameter is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_CREATE)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ OUT EFI_USER_PROFILE_HANDLE *User
+ );
+
+/**
+ Delete an existing user profile.
+
+ @param[in] This Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
+ @param[in] User User profile handle.
+
+ @retval EFI_SUCCESS User profile was successfully deleted.
+ @retval EFI_ACCESS_DENIED Current user does not have sufficient permissions to delete a user
+ profile or there is only one user profile.
+ @retval EFI_UNSUPPORTED Deletion of new user profiles is not supported.
+ @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_DELETE)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User
+ );
+
+/**
+ Enumerate all of the enrolled users on the platform.
+
+ This function returns the next enrolled user profile. To retrieve the first user profile handle, point
+ User at a NULL. Each subsequent call will retrieve another user profile handle until there are no
+ more, at which point User will point to NULL.
+
+ @param[in] This Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
+ @param[in,out] User On entry, points to the previous user profile handle or NULL to
+ start enumeration. On exit, points to the next user profile handle
+ or NULL if there are no more user profiles.
+
+ @retval EFI_SUCCESS Next enrolled user profile successfully returned.
+ @retval EFI_ACCESS_DENIED Next enrolled user profile was not successfully returned.
+ @retval EFI_INVALID_PARAMETER The User parameter is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_GET_NEXT)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN OUT EFI_USER_PROFILE_HANDLE *User
+ );
+
+/**
+ Return the current user profile handle.
+
+ @param[in] This Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
+ @param[out] CurrentUser On return, points to the current user profile handle.
+
+ @retval EFI_SUCCESS Current user profile handle returned successfully.
+ @retval EFI_INVALID_PARAMETER The CurrentUser parameter is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_CURRENT)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ OUT EFI_USER_PROFILE_HANDLE *CurrentUser
+ );
+
+/**
+ Identify a user.
+
+ Identify the user and, if authenticated, returns the user handle and changes the current user profile.
+ All user information marked as private in a previously selected profile is no longer available for
+ inspection.
+ Whenever the current user profile is changed then the an event with the GUID
+ EFI_EVENT_GROUP_USER_PROFILE_CHANGED is signaled.
+
+ @param[in] This Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
+ @param[out] User On return, points to the user profile handle for the current user profile.
+
+ @retval EFI_SUCCESS User was successfully identified.
+ @retval EFI_ACCESS_DENIED User was not successfully identified.
+ @retval EFI_INVALID_PARAMETER The User parameter is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_IDENTIFY)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ OUT EFI_USER_PROFILE_HANDLE *User
+ );
+
+/**
+ Find a user using a user information record.
+
+ This function searches all user profiles for the specified user information record. The search starts
+ with the user information record handle following UserInfo and continues until either the
+ information is found or there are no more user profiles.
+ A match occurs when the Info.InfoType field matches the user information record type and the
+ user information record data matches the portion of Info.
+
+ @param[in] This Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
+ @param[in,out] User On entry, points to the previously returned user profile handle or NULL to start
+ searching with the first user profile. On return, points to the user profile handle or
+ NULL if not found.
+ @param[in,out] UserInfo On entry, points to the previously returned user information handle or NULL to start
+ searching with the first. On return, points to the user information handle of the user
+ information record or NULL if not found. Can be NULL, in which case only one user
+ information record per user can be returned.
+ @param[in] Info Points to the buffer containing the user information to be compared to the user
+ information record. If the user information record data is empty, then only the user
+ information record type is compared.
+ If InfoSize is 0, then the user information record must be empty.
+
+ @param[in] InfoSize The size of Info, in bytes.
+
+ @retval EFI_SUCCESS User information was found. User points to the user profile handle and UserInfo
+ points to the user information handle.
+ @retval EFI_NOT_FOUND User information was not found. User points to NULL and UserInfo points to NULL.
+ @retval EFI_INVALID_PARAMETER User is NULL. Or Info is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_FIND)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN OUT EFI_USER_PROFILE_HANDLE *User,
+ IN OUT EFI_USER_INFO_HANDLE *UserInfo OPTIONAL,
+ IN CONST EFI_USER_INFO *Info,
+ IN UINTN InfoSize
+ );
+
+/**
+ Called by credential provider to notify of information change.
+
+ This function allows the credential provider to notify the User Identity Manager when user status
+ has changed.
+ If the User Identity Manager doesn't support asynchronous changes in credentials, then this function
+ should return EFI_UNSUPPORTED.
+ If current user does not exist, and the credential provider can identify a user, then make the user
+ to be current user and signal the EFI_EVENT_GROUP_USER_PROFILE_CHANGED event.
+ If current user already exists, and the credential provider can identify another user, then switch
+ current user to the newly identified user, and signal the EFI_EVENT_GROUP_USER_PROFILE_CHANGED event.
+ If current user was identified by this credential provider and now the credential provider cannot identify
+ current user, then logout current user and signal the EFI_EVENT_GROUP_USER_PROFILE_CHANGED event.
+
+ @param[in] This Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
+ @param[in] Changed Handle on which is installed an instance of the
+ EFI_USER_CREDENTIAL_PROTOCOL where the user has changed.
+
+ @retval EFI_SUCCESS The User Identity Manager has handled the notification.
+ @retval EFI_NOT_READY The function was called while the specified credential provider was not selected.
+ @retval EFI_UNSUPPORTED The User Identity Manager doesn't support asynchronous notifications.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_NOTIFY)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN EFI_HANDLE Changed
+ );
+
+/**
+ Return information attached to the user.
+
+ This function returns user information. The format of the information is described in User
+ Information. The function may return EFI_ACCESS_DENIED if the information is marked private
+ and the handle specified by User is not the current user profile. The function may return
+ EFI_ACCESS_DENIED if the information is marked protected and the information is associated
+ with a credential provider for which the user has not been authenticated.
+
+ @param[in] This Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
+ @param[in] User Handle of the user whose profile will be retrieved.
+ @param[in] UserInfo Handle of the user information data record.
+ @param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On exit, holds the user
+ information. If the buffer is too small to hold the information, then
+ EFI_BUFFER_TOO_SMALL is returned and InfoSize is updated to contain the
+ number of bytes actually required.
+ @param[in,out] InfoSize On entry, points to the size of Info. On return, points to the size of the user
+ information.
+
+ @retval EFI_SUCCESS Information returned successfully.
+ @retval EFI_ACCESS_DENIED The information about the specified user cannot be accessed by the current user.
+ @retval EFI_BUFFER_TOO_SMALL The number of bytes specified by *InfoSize is too small to hold
+ the returned data. The actual size required is returned in *InfoSize.
+ @retval EFI_NOT_FOUND User does not refer to a valid user profile or UserInfo does not refer to a valid
+ user info handle.
+ @retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_GET_INFO)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User,
+ IN EFI_USER_INFO_HANDLE UserInfo,
+ OUT EFI_USER_INFO *Info,
+ IN OUT UINTN *InfoSize
+ );
+
+/**
+ Add or update user information.
+
+ This function changes user information. If NULL is pointed to by UserInfo, then a new user
+ information record is created and its handle is returned in UserInfo. Otherwise, the existing one is
+ replaced.
+ If EFI_USER_INFO_IDENTITY_POLICY_RECORD is changed, it is the caller's responsibility to keep it to
+ be synced with the information on credential providers.
+ If EFI_USER_INFO_EXCLUSIVE is specified in Info and a user information record of the same
+ type already exists in the user profile, then EFI_ACCESS_DENIED will be returned and
+ UserInfo will point to the handle of the existing record.
+
+ @param[in] This Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
+ @param[in] User Handle of the user whose profile will be retrieved.
+ @param[in,out] UserInfo Handle of the user information data record.
+ @param[in] Info On entry, points to a buffer of at least *InfoSize bytes. On exit, holds the user
+ information. If the buffer is too small to hold the information, then
+ EFI_BUFFER_TOO_SMALL is returned and InfoSize is updated to contain the
+ number of bytes actually required.
+ @param[in] InfoSize On entry, points to the size of Info. On return, points to the size of the user
+ information.
+
+ @retval EFI_SUCCESS Information returned successfully.
+ @retval EFI_ACCESS_DENIED The record is exclusive.
+ @retval EFI_SECURITY_VIOLATION The current user does not have permission to change the specified
+ user profile or user information record.
+ @retval EFI_NOT_FOUND User does not refer to a valid user profile or UserInfo does not refer to a valid
+ user info handle.
+ @retval EFI_INVALID_PARAMETER UserInfo is NULL or Info is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_SET_INFO)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User,
+ IN OUT EFI_USER_INFO_HANDLE *UserInfo,
+ IN CONST EFI_USER_INFO *Info,
+ IN UINTN InfoSize
+ );
+
+/**
+ Delete user information.
+
+ Delete the user information attached to the user profile specified by the UserInfo.
+
+ @param[in] This Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
+ @param[in] User Handle of the user whose information will be deleted.
+ @param[in] UserInfo Handle of the user information to remove.
+
+ @retval EFI_SUCCESS User information deleted successfully.
+ @retval EFI_NOT_FOUND User information record UserInfo does not exist in the user profile.
+ @retval EFI_ACCESS_DENIED The current user does not have permission to delete this user information.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_DELETE_INFO)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User,
+ IN EFI_USER_INFO_HANDLE UserInfo
+ );
+
+/**
+ Enumerate user information of all the enrolled users on the platform.
+
+ This function returns the next user information record. To retrieve the first user information record
+ handle, point UserInfo at a NULL. Each subsequent call will retrieve another user information
+ record handle until there are no more, at which point UserInfo will point to NULL.
+
+ @param[in] This Points to this instance of the EFI_USER_MANAGER_PROTOCOL.
+ @param[in] User Handle of the user whose information will be deleted.
+ @param[in,out] UserInfo Handle of the user information to remove.
+
+ @retval EFI_SUCCESS User information returned.
+ @retval EFI_NOT_FOUND No more user information found.
+ @retval EFI_INVALID_PARAMETER UserInfo is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_GET_NEXT_INFO)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User,
+ IN OUT EFI_USER_INFO_HANDLE *UserInfo
+ );
+
+///
+/// This protocol provides the services used to manage user profiles.
+///
+struct _EFI_USER_MANAGER_PROTOCOL {
+ EFI_USER_PROFILE_CREATE Create;
+ EFI_USER_PROFILE_DELETE Delete;
+ EFI_USER_PROFILE_GET_NEXT GetNext;
+ EFI_USER_PROFILE_CURRENT Current;
+ EFI_USER_PROFILE_IDENTIFY Identify;
+ EFI_USER_PROFILE_FIND Find;
+ EFI_USER_PROFILE_NOTIFY Notify;
+ EFI_USER_PROFILE_GET_INFO GetInfo;
+ EFI_USER_PROFILE_SET_INFO SetInfo;
+ EFI_USER_PROFILE_DELETE_INFO DeleteInfo;
+ EFI_USER_PROFILE_GET_NEXT_INFO GetNextInfo;
+};
+
+extern EFI_GUID gEfiUserManagerProtocolGuid;
+extern EFI_GUID gEfiEventUserProfileChangedGuid;
+extern EFI_GUID gEfiUserCredentialClassUnknownGuid;
+extern EFI_GUID gEfiUserCredentialClassPasswordGuid;
+extern EFI_GUID gEfiUserCredentialClassSmartCardGuid;
+extern EFI_GUID gEfiUserCredentialClassFingerprintGuid;
+extern EFI_GUID gEfiUserCredentialClassHandprintGuid;
+extern EFI_GUID gEfiUserCredentialClassSecureCardGuid;
+extern EFI_GUID gEfiUserInfoAccessSetupAdminGuid;
+extern EFI_GUID gEfiUserInfoAccessSetupNormalGuid;
+extern EFI_GUID gEfiUserInfoAccessSetupRestrictedGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Variable.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Variable.h
new file mode 100644
index 0000000000..c9e86026f7
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/Variable.h
@@ -0,0 +1,45 @@
+/** @file
+ Variable Architectural Protocol as defined in PI Specification VOLUME 2 DXE
+
+ This provides the services required to get and set environment variables. This
+ protocol must be produced by a runtime DXE driver and may be consumed only by
+ the DXE Foundation. The DXE driver that produces this protocol must be a runtime
+ driver. This driver is responsible for initializing the GetVariable(),
+ GetNextVariableName(), and SetVariable() fields of the UEFI Runtime Services Table.
+
+ After the three fields of the UEFI Runtime Services Table have been initialized,
+ the driver must install the EFI_VARIABLE_ARCH_PROTOCOL_GUID on a new handle with
+ a NULL interface pointer. The installation of this protocol informs the DXE Foundation
+ that the read-only and the volatile environment variable related services are
+ now available and that the DXE Foundation must update the 32-bit CRC of the UEFI
+ Runtime Services Table. The full complement of environment variable services are
+ not available until both this protocol and EFI_VARIABLE_WRITE_ARCH_PROTOCOL are
+ installed. DXE drivers that require read-only access or read/write access to volatile
+ environment variables must have this architectural protocol in their dependency
+ expressions. DXE drivers that require write access to nonvolatile environment
+ variables must have the EFI_VARIABLE_WRITE_ARCH_PROTOCOL in their dependency
+ expressions.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARCH_PROTOCOL_VARIABLE_ARCH_H__
+#define __ARCH_PROTOCOL_VARIABLE_ARCH_H__
+
+///
+/// Global ID for the Variable Architectural Protocol
+///
+#define EFI_VARIABLE_ARCH_PROTOCOL_GUID \
+ { 0x1e5668e2, 0x8481, 0x11d4, {0xbc, 0xf1, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
+
+extern EFI_GUID gEfiVariableArchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/VariableWrite.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/VariableWrite.h
new file mode 100644
index 0000000000..96971d9e85
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/VariableWrite.h
@@ -0,0 +1,45 @@
+/** @file
+ Variable Write Architectural Protocol as defined in PI Specification VOLUME 2 DXE
+
+ This provides the services required to set nonvolatile environment variables.
+ This protocol must be produced by a runtime DXE driver and may be consumed only
+ by the DXE Foundation.
+
+ The DXE driver that produces this protocol must be a runtime driver. This driver
+ may update the SetVariable() field of the UEFI Runtime Services Table.
+
+ After the UEFI Runtime Services Table has been initialized, the driver must
+ install the EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID on a new handle with a NULL
+ interface pointer. The installation of this protocol informs the DXE Foundation
+ that the write services for nonvolatile environment variables are now available
+ and that the DXE Foundation must update the 32-bit CRC of the UEFI Runtime Services
+ Table. The full complement of environment variable services are not available
+ until both this protocol and EFI_VARIABLE_ARCH_PROTOCOL are installed. DXE drivers
+ that require read-only access or read/write access to volatile environment variables
+ must have the EFI_VARIABLE_WRITE_ARCH_PROTOCOL in their dependency expressions.
+ DXE drivers that require write access to nonvolatile environment variables must
+ have this architectural protocol in their dependency expressions.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARCH_PROTOCOL_VARIABLE_WRITE_ARCH_H__
+#define __ARCH_PROTOCOL_VARIABLE_WRITE_ARCH_H__
+
+///
+/// Global ID for the Variable Write Architectural Protocol
+///
+#define EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID \
+ { 0x6441f818, 0x6362, 0x4e44, {0xb5, 0x70, 0x7d, 0xba, 0x31, 0xdd, 0x24, 0x53 } }
+
+extern EFI_GUID gEfiVariableWriteArchProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/VlanConfig.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/VlanConfig.h
new file mode 100644
index 0000000000..5d980a6421
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/VlanConfig.h
@@ -0,0 +1,143 @@
+/** @file
+ EFI VLAN Config protocol is to provide manageability interface for VLAN configuration.
+
+ Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.2
+
+**/
+
+#ifndef __EFI_VLANCONFIG_PROTOCOL_H__
+#define __EFI_VLANCONFIG_PROTOCOL_H__
+
+
+#define EFI_VLAN_CONFIG_PROTOCOL_GUID \
+ { \
+ 0x9e23d768, 0xd2f3, 0x4366, {0x9f, 0xc3, 0x3a, 0x7a, 0xba, 0x86, 0x43, 0x74 } \
+ }
+
+typedef struct _EFI_VLAN_CONFIG_PROTOCOL EFI_VLAN_CONFIG_PROTOCOL;
+
+
+///
+/// EFI_VLAN_FIND_DATA
+///
+typedef struct {
+ UINT16 VlanId; ///< Vlan Identifier.
+ UINT8 Priority; ///< Priority of this VLAN.
+} EFI_VLAN_FIND_DATA;
+
+
+/**
+ Create a VLAN device or modify the configuration parameter of an
+ already-configured VLAN.
+
+ The Set() function is used to create a new VLAN device or change the VLAN
+ configuration parameters. If the VlanId hasn't been configured in the
+ physical Ethernet device, a new VLAN device will be created. If a VLAN with
+ this VlanId is already configured, then related configuration will be updated
+ as the input parameters.
+
+ If VlanId is zero, the VLAN device will send and receive untagged frames.
+ Otherwise, the VLAN device will send and receive VLAN-tagged frames containing the VlanId.
+ If VlanId is out of scope of (0-4094), EFI_INVALID_PARAMETER is returned.
+ If Priority is out of the scope of (0-7), then EFI_INVALID_PARAMETER is returned.
+ If there is not enough system memory to perform the registration, then
+ EFI_OUT_OF_RESOURCES is returned.
+
+ @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.
+ @param[in] VlanId A unique identifier (1-4094) of the VLAN which is being created
+ or modified, or zero (0).
+ @param[in] Priority 3 bit priority in VLAN header. Priority 0 is default value. If
+ VlanId is zero (0), Priority is ignored.
+
+ @retval EFI_SUCCESS The VLAN is successfully configured.
+ @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:
+ - This is NULL.
+ - VlanId is an invalid VLAN Identifier.
+ - Priority is invalid.
+ @retval EFI_OUT_OF_RESOURCES There is not enough system memory to perform the registration.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_VLAN_CONFIG_SET)(
+ IN EFI_VLAN_CONFIG_PROTOCOL *This,
+ IN UINT16 VlanId,
+ IN UINT8 Priority
+ );
+
+/**
+ Find configuration information for specified VLAN or all configured VLANs.
+
+ The Find() function is used to find the configuration information for matching
+ VLAN and allocate a buffer into which those entries are copied.
+
+ @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.
+ @param[in] VlanId Pointer to VLAN identifier. Set to NULL to find all
+ configured VLANs.
+ @param[out] NumberOfVlan The number of VLANs which is found by the specified criteria.
+ @param[out] Entries The buffer which receive the VLAN configuration.
+
+ @retval EFI_SUCCESS The VLAN is successfully found.
+ @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:
+ - This is NULL.
+ - Specified VlanId is invalid.
+ @retval EFI_NOT_FOUND No matching VLAN is found.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_VLAN_CONFIG_FIND)(
+ IN EFI_VLAN_CONFIG_PROTOCOL *This,
+ IN UINT16 *VlanId OPTIONAL,
+ OUT UINT16 *NumberOfVlan,
+ OUT EFI_VLAN_FIND_DATA **Entries
+ );
+
+/**
+ Remove the configured VLAN device.
+
+ The Remove() function is used to remove the specified VLAN device.
+ If the VlanId is out of the scope of (0-4094), EFI_INVALID_PARAMETER is returned.
+ If specified VLAN hasn't been previously configured, EFI_NOT_FOUND is returned.
+
+ @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.
+ @param[in] VlanId Identifier (0-4094) of the VLAN to be removed.
+
+ @retval EFI_SUCCESS The VLAN is successfully removed.
+ @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:
+ - This is NULL.
+ - VlanId is an invalid parameter.
+ @retval EFI_NOT_FOUND The to-be-removed VLAN does not exist.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_VLAN_CONFIG_REMOVE)(
+ IN EFI_VLAN_CONFIG_PROTOCOL *This,
+ IN UINT16 VlanId
+ );
+
+///
+/// EFI_VLAN_CONFIG_PROTOCOL
+/// provide manageability interface for VLAN setting. The intended
+/// VLAN tagging implementation is IEEE802.1Q.
+///
+struct _EFI_VLAN_CONFIG_PROTOCOL {
+ EFI_VLAN_CONFIG_SET Set;
+ EFI_VLAN_CONFIG_FIND Find;
+ EFI_VLAN_CONFIG_REMOVE Remove;
+};
+
+extern EFI_GUID gEfiVlanConfigProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/WatchdogTimer.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/WatchdogTimer.h
new file mode 100644
index 0000000000..b48f943db2
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/WatchdogTimer.h
@@ -0,0 +1,144 @@
+/** @file
+ Watchdog Timer Architectural Protocol as defined in PI Specification VOLUME 2 DXE
+
+ Used to provide system watchdog timer services
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
+#ifndef __ARCH_PROTOCOL_WATCHDOG_TIMER_H__
+#define __ARCH_PROTOCOL_WATCHDOG_TIMER_H__
+
+///
+/// Global ID for the Watchdog Timer Architectural Protocol
+///
+#define EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID \
+ { 0x665E3FF5, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }
+
+///
+/// Declare forward reference for the Timer Architectural Protocol
+///
+typedef struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL EFI_WATCHDOG_TIMER_ARCH_PROTOCOL;
+
+/**
+ A function of this type is called when the watchdog timer fires if a
+ handler has been registered.
+
+ @param Time The time in 100 ns units that has passed since the watchdog
+ timer was armed. For the notify function to be called, this
+ must be greater than TimerPeriod.
+
+ @return None.
+
+**/
+typedef
+VOID
+(EFIAPI *EFI_WATCHDOG_TIMER_NOTIFY)(
+ IN UINT64 Time
+ );
+
+/**
+ This function registers a handler that is to be invoked when the watchdog
+ timer fires. By default, the EFI_WATCHDOG_TIMER protocol will call the
+ Runtime Service ResetSystem() when the watchdog timer fires. If a
+ NotifyFunction is registered, then the NotifyFunction will be called before
+ the Runtime Service ResetSystem() is called. If NotifyFunction is NULL, then
+ the watchdog handler is unregistered. If a watchdog handler is registered,
+ then EFI_SUCCESS is returned. If an attempt is made to register a handler
+ when a handler is already registered, then EFI_ALREADY_STARTED is returned.
+ If an attempt is made to uninstall a handler when a handler is not installed,
+ then return EFI_INVALID_PARAMETER.
+
+ @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
+ @param NotifyFunction The function to call when the watchdog timer fires. If this
+ is NULL, then the handler will be unregistered.
+
+ @retval EFI_SUCCESS The watchdog timer handler was registered or
+ unregistered.
+ @retval EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already
+ registered.
+ @retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not
+ previously registered.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WATCHDOG_TIMER_REGISTER_HANDLER)(
+ IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
+ IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction
+ );
+
+/**
+ This function sets the amount of time to wait before firing the watchdog
+ timer to TimerPeriod 100 nS units. If TimerPeriod is 0, then the watchdog
+ timer is disabled.
+
+ @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
+ @param TimerPeriod The amount of time in 100 nS units to wait before the watchdog
+ timer is fired. If TimerPeriod is zero, then the watchdog
+ timer is disabled.
+
+ @retval EFI_SUCCESS The watchdog timer has been programmed to fire in Time
+ 100 nS units.
+ @retval EFI_DEVICE_ERROR A watchdog timer could not be programmed due to a device
+ error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD)(
+ IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
+ IN UINT64 TimerPeriod
+ );
+
+/**
+ This function retrieves the amount of time the system will wait before firing
+ the watchdog timer. This period is returned in TimerPeriod, and EFI_SUCCESS
+ is returned. If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.
+
+ @param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
+ @param TimerPeriod A pointer to the amount of time in 100 nS units that the system
+ will wait before the watchdog timer is fired. If TimerPeriod of
+ zero is returned, then the watchdog timer is disabled.
+
+ @retval EFI_SUCCESS The amount of time that the system will wait before
+ firing the watchdog timer was returned in TimerPeriod.
+ @retval EFI_INVALID_PARAMETER TimerPeriod is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD)(
+ IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
+ OUT UINT64 *TimerPeriod
+ );
+
+
+///
+/// This protocol provides the services required to implement the Boot Service
+/// SetWatchdogTimer(). It provides a service to set the amount of time to wait
+/// before firing the watchdog timer, and it also provides a service to register
+/// a handler that is invoked when the watchdog timer fires. This protocol can
+/// implement the watchdog timer by using the event and timer Boot Services, or
+/// it can make use of custom hardware. When the watchdog timer fires, control
+/// will be passed to a handler if one has been registered. If no handler has
+/// been registered, or the registered handler returns, then the system will be
+/// reset by calling the Runtime Service ResetSystem().
+///
+struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL {
+ EFI_WATCHDOG_TIMER_REGISTER_HANDLER RegisterHandler;
+ EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD SetTimerPeriod;
+ EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD GetTimerPeriod;
+};
+
+extern EFI_GUID gEfiWatchdogTimerArchProtocolGuid;
+
+#endif
+
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/WiFi.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/WiFi.h
new file mode 100644
index 0000000000..cbc1a17bc6
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/WiFi.h
@@ -0,0 +1,1129 @@
+/** @file
+ This file provides management service interfaces of 802.11 MAC layer. It is used by
+ network applications (and drivers) to establish wireless connection with an access
+ point (AP).
+
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_WIFI_PROTOCOL_H__
+#define __EFI_WIFI_PROTOCOL_H__
+
+#include <Protocol/WiFi2.h>
+
+#define EFI_WIRELESS_MAC_CONNECTION_PROTOCOL_GUID \
+ { \
+ 0xda55bc9, 0x45f8, 0x4bb4, {0x87, 0x19, 0x52, 0x24, 0xf1, 0x8a, 0x4d, 0x45 } \
+ }
+
+typedef struct _EFI_WIRELESS_MAC_CONNECTION_PROTOCOL EFI_WIRELESS_MAC_CONNECTION_PROTOCOL;
+
+///
+/// EFI_80211_ACC_NET_TYPE
+///
+typedef enum {
+ IeeePrivate = 0,
+ IeeePrivatewithGuest = 1,
+ IeeeChargeablePublic = 2,
+ IeeeFreePublic = 3,
+ IeeePersonal = 4,
+ IeeeEmergencyServOnly = 5,
+ IeeeTestOrExp = 14,
+ IeeeWildcard = 15
+} EFI_80211_ACC_NET_TYPE;
+
+///
+/// EFI_80211_ASSOCIATE_RESULT_CODE
+///
+typedef enum {
+ AssociateSuccess,
+ AssociateRefusedReasonUnspecified,
+ AssociateRefusedCapsMismatch,
+ AssociateRefusedExtReason,
+ AssociateRefusedAPOutOfMemory,
+ AssociateRefusedBasicRatesMismatch,
+ AssociateRejectedEmergencyServicesNotSupported,
+ AssociateRefusedTemporarily
+} EFI_80211_ASSOCIATE_RESULT_CODE;
+
+///
+/// EFI_80211_SCAN_RESULT_CODE
+///
+typedef enum {
+ ///
+ /// The scan operation finished successfully.
+ ///
+ ScanSuccess,
+ ///
+ /// The scan operation is not supported in current implementation.
+ ///
+ ScanNotSupported
+} EFI_80211_SCAN_RESULT_CODE;
+
+///
+/// EFI_80211_REASON_CODE
+///
+typedef enum {
+ Ieee80211UnspecifiedReason = 1,
+ Ieee80211PreviousAuthenticateInvalid = 2,
+ Ieee80211DeauthenticatedSinceLeaving = 3,
+ Ieee80211DisassociatedDueToInactive = 4,
+ Ieee80211DisassociatedSinceApUnable = 5,
+ Ieee80211Class2FrameNonauthenticated = 6,
+ Ieee80211Class3FrameNonassociated = 7,
+ Ieee80211DisassociatedSinceLeaving = 8,
+ // ...
+} EFI_80211_REASON_CODE;
+
+///
+/// EFI_80211_DISASSOCIATE_RESULT_CODE
+///
+typedef enum {
+ ///
+ /// Disassociation process completed successfully.
+ ///
+ DisassociateSuccess,
+ ///
+ /// Disassociation failed due to any input parameter is invalid.
+ ///
+ DisassociateInvalidParameters
+} EFI_80211_DISASSOCIATE_RESULT_CODE;
+
+///
+/// EFI_80211_AUTHENTICATION_TYPE
+///
+typedef enum {
+ ///
+ /// Open system authentication, admits any STA to the DS.
+ ///
+ OpenSystem,
+ ///
+ /// Shared Key authentication relies on WEP to demonstrate knowledge of a WEP
+ /// encryption key.
+ ///
+ SharedKey,
+ ///
+ /// FT authentication relies on keys derived during the initial mobility domain
+ /// association to authenticate the stations.
+ ///
+ FastBSSTransition,
+ ///
+ /// SAE authentication uses finite field cryptography to prove knowledge of a shared
+ /// password.
+ ///
+ SAE
+} EFI_80211_AUTHENTICATION_TYPE;
+
+///
+/// EFI_80211_AUTHENTICATION_RESULT_CODE
+///
+typedef enum {
+ AuthenticateSuccess,
+ AuthenticateRefused,
+ AuthenticateAnticLoggingTokenRequired,
+ AuthenticateFiniteCyclicGroupNotSupported,
+ AuthenticationRejected,
+ AuthenticateInvalidParameter
+} EFI_80211_AUTHENTICATE_RESULT_CODE;
+
+///
+/// EFI_80211_ELEMENT_HEADER
+///
+typedef struct {
+ ///
+ /// A unique element ID defined in IEEE 802.11 specification.
+ ///
+ UINT8 ElementID;
+ ///
+ /// Specifies the number of octets in the element body.
+ ///
+ UINT8 Length;
+} EFI_80211_ELEMENT_HEADER;
+
+///
+/// EFI_80211_ELEMENT_REQ
+///
+typedef struct {
+ ///
+ /// Common header of an element.
+ ///
+ EFI_80211_ELEMENT_HEADER Hdr;
+ ///
+ /// Start of elements that are requested to be included in the Probe Response frame.
+ /// The elements are listed in order of increasing element ID.
+ ///
+ UINT8 RequestIDs[1];
+} EFI_80211_ELEMENT_REQ;
+
+///
+/// EFI_80211_ELEMENT_SSID
+///
+typedef struct {
+ ///
+ /// Common header of an element.
+ ///
+ EFI_80211_ELEMENT_HEADER Hdr;
+ ///
+ /// Service set identifier. If Hdr.Length is zero, this field is ignored.
+ ///
+ UINT8 SSId[32];
+} EFI_80211_ELEMENT_SSID;
+
+///
+/// EFI_80211_SCAN_DATA
+///
+typedef struct {
+ ///
+ /// Determines whether infrastructure BSS, IBSS, MBSS, or all, are included in the
+ /// scan.
+ ///
+ EFI_80211_BSS_TYPE BSSType;
+ ///
+ /// Indicates a specific or wildcard BSSID. Use all binary 1s to represent all SSIDs.
+ ///
+ EFI_80211_MAC_ADDRESS BSSId;
+ ///
+ /// Length in bytes of the SSId. If zero, ignore SSId field.
+ ///
+ UINT8 SSIdLen;
+ ///
+ /// Specifies the desired SSID or the wildcard SSID. Use NULL to represent all SSIDs.
+ ///
+ UINT8 *SSId;
+ ///
+ /// Indicates passive scanning if TRUE.
+ ///
+ BOOLEAN PassiveMode;
+ ///
+ /// The delay in microseconds to be used prior to transmitting a Probe frame during
+ /// active scanning. If zero, the value can be overridden by an
+ /// implementation-dependent default value.
+ ///
+ UINT32 ProbeDelay;
+ ///
+ /// Specifies a list of channels that are examined when scanning for a BSS. If set to
+ /// NULL, all valid channels will be scanned.
+ ///
+ UINT32 *ChannelList;
+ ///
+ /// Indicates the minimum time in TU to spend on each channel when scanning. If zero,
+ /// the value can be overridden by an implementation-dependent default value.
+ ///
+ UINT32 MinChannelTime;
+ ///
+ /// Indicates the maximum time in TU to spend on each channel when scanning. If zero,
+ /// the value can be overridden by an implementation-dependent default value.
+ ///
+ UINT32 MaxChannelTime;
+ ///
+ /// Points to an optionally present element. This is an optional parameter and may be
+ /// NULL.
+ ///
+ EFI_80211_ELEMENT_REQ *RequestInformation;
+ ///
+ /// Indicates one or more SSID elements that are optionally present. This is an
+ /// optional parameter and may be NULL.
+ ///
+ EFI_80211_ELEMENT_SSID *SSIDList;
+ ///
+ /// Specifies a desired specific access network type or the wildcard access network
+ /// type. Use 15 as wildcard access network type.
+ ///
+ EFI_80211_ACC_NET_TYPE AccessNetworkType;
+ ///
+ /// Specifies zero or more elements. This is an optional parameter and may be NULL.
+ ///
+ UINT8 *VendorSpecificInfo;
+} EFI_80211_SCAN_DATA;
+
+///
+/// EFI_80211_COUNTRY_TRIPLET_SUBBAND
+///
+typedef struct {
+ ///
+ /// Indicates the lowest channel number in the subband. It has a positive integer
+ /// value less than 201.
+ ///
+ UINT8 FirstChannelNum;
+ ///
+ /// Indicates the number of channels in the subband.
+ ///
+ UINT8 NumOfChannels;
+ ///
+ /// Indicates the maximum power in dBm allowed to be transmitted.
+ ///
+ UINT8 MaxTxPowerLevel;
+} EFI_80211_COUNTRY_TRIPLET_SUBBAND;
+
+///
+/// EFI_80211_COUNTRY_TRIPLET_OPERATE
+///
+typedef struct {
+ ///
+ /// Indicates the operating extension identifier. It has a positive integer value of
+ /// 201 or greater.
+ ///
+ UINT8 OperatingExtId;
+ ///
+ /// Index into a set of values for radio equipment set of rules.
+ ///
+ UINT8 OperatingClass;
+ ///
+ /// Specifies aAirPropagationTime characteristics used in BSS operation. Refer the
+ /// definition of aAirPropagationTime in IEEE 802.11 specification.
+ ///
+ UINT8 CoverageClass;
+} EFI_80211_COUNTRY_TRIPLET_OPERATE;
+
+///
+/// EFI_80211_COUNTRY_TRIPLET
+///
+typedef union {
+ ///
+ /// The subband triplet.
+ ///
+ EFI_80211_COUNTRY_TRIPLET_SUBBAND Subband;
+ ///
+ /// The operating triplet.
+ ///
+ EFI_80211_COUNTRY_TRIPLET_OPERATE Operating;
+} EFI_80211_COUNTRY_TRIPLET;
+
+///
+/// EFI_80211_ELEMENT_COUNTRY
+///
+typedef struct {
+ ///
+ /// Common header of an element.
+ ///
+ EFI_80211_ELEMENT_HEADER Hdr;
+ ///
+ /// Specifies country strings in 3 octets.
+ ///
+ UINT8 CountryStr[3];
+ ///
+ /// Indicates a triplet that repeated in country element. The number of triplets is
+ /// determined by the Hdr.Length field.
+ ///
+ EFI_80211_COUNTRY_TRIPLET CountryTriplet[1];
+} EFI_80211_ELEMENT_COUNTRY;
+
+///
+/// EFI_80211_ELEMENT_DATA_RSN
+///
+typedef struct {
+ ///
+ /// Indicates the version number of the RSNA protocol. Value 1 is defined in current
+ /// IEEE 802.11 specification.
+ ///
+ UINT16 Version;
+ ///
+ /// Specifies the cipher suite selector used by the BSS to protect group address frames.
+ ///
+ UINT32 GroupDataCipherSuite;
+ ///
+ /// Indicates the number of pairwise cipher suite selectors that are contained in
+ /// PairwiseCipherSuiteList.
+ ///
+//UINT16 PairwiseCipherSuiteCount;
+ ///
+ /// Contains a series of cipher suite selectors that indicate the pairwise cipher
+ /// suites contained in this element.
+ ///
+//UINT32 PairwiseCipherSuiteList[PairwiseCipherSuiteCount];
+ ///
+ /// Indicates the number of AKM suite selectors that are contained in AKMSuiteList.
+ ///
+//UINT16 AKMSuiteCount;
+ ///
+ /// Contains a series of AKM suite selectors that indicate the AKM suites contained in
+ /// this element.
+ ///
+//UINT32 AKMSuiteList[AKMSuiteCount];
+ ///
+ /// Indicates requested or advertised capabilities.
+ ///
+//UINT16 RSNCapabilities;
+ ///
+ /// Indicates the number of PKMIDs in the PMKIDList.
+ ///
+//UINT16 PMKIDCount;
+ ///
+ /// Contains zero or more PKMIDs that the STA believes to be valid for the destination
+ /// AP.
+//UINT8 PMKIDList[PMKIDCount][16];
+ ///
+ /// Specifies the cipher suite selector used by the BSS to protect group addressed
+ /// robust management frames.
+ ///
+//UINT32 GroupManagementCipherSuite;
+} EFI_80211_ELEMENT_DATA_RSN;
+
+///
+/// EFI_80211_ELEMENT_RSN
+///
+typedef struct {
+ ///
+ /// Common header of an element.
+ ///
+ EFI_80211_ELEMENT_HEADER Hdr;
+ ///
+ /// Points to RSN element. The size of a RSN element is limited to 255 octets.
+ ///
+ EFI_80211_ELEMENT_DATA_RSN *Data;
+} EFI_80211_ELEMENT_RSN;
+
+///
+/// EFI_80211_ELEMENT_EXT_CAP
+///
+typedef struct {
+ ///
+ /// Common header of an element.
+ ///
+ EFI_80211_ELEMENT_HEADER Hdr;
+ ///
+ /// Indicates the capabilities being advertised by the STA transmitting the element.
+ /// This is a bit field with variable length. Refer to IEEE 802.11 specification for
+ /// bit value.
+ ///
+ UINT8 Capabilities[1];
+} EFI_80211_ELEMENT_EXT_CAP;
+
+///
+/// EFI_80211_BSS_DESCRIPTION
+///
+typedef struct {
+ ///
+ /// Indicates a specific BSSID of the found BSS.
+ ///
+ EFI_80211_MAC_ADDRESS BSSId;
+ ///
+ /// Specifies the SSID of the found BSS. If NULL, ignore SSIdLen field.
+ ///
+ UINT8 *SSId;
+ ///
+ /// Specifies the SSID of the found BSS. If NULL, ignore SSIdLen field.
+ ///
+ UINT8 SSIdLen;
+ ///
+ /// Specifies the type of the found BSS.
+ ///
+ EFI_80211_BSS_TYPE BSSType;
+ ///
+ /// The beacon period in TU of the found BSS.
+ ///
+ UINT16 BeaconPeriod;
+ ///
+ /// The timestamp of the received frame from the found BSS.
+ ///
+ UINT64 Timestamp;
+ ///
+ /// The advertised capabilities of the BSS.
+ ///
+ UINT16 CapabilityInfo;
+ ///
+ /// The set of data rates that shall be supported by all STAs that desire to join this
+ /// BSS.
+ ///
+ UINT8 *BSSBasicRateSet;
+ ///
+ /// The set of data rates that the peer STA desires to use for communication within
+ /// the BSS.
+ ///
+ UINT8 *OperationalRateSet;
+ ///
+ /// The information required to identify the regulatory domain in which the peer STA
+ /// is located.
+ ///
+ EFI_80211_ELEMENT_COUNTRY *Country;
+ ///
+ /// The cipher suites and AKM suites supported in the BSS.
+ ///
+ EFI_80211_ELEMENT_RSN RSN;
+ ///
+ /// Specifies the RSSI of the received frame.
+ ///
+ UINT8 RSSI;
+ ///
+ /// Specifies the RCPI of the received frame.
+ ///
+ UINT8 RCPIMeasurement;
+ ///
+ /// Specifies the RSNI of the received frame.
+ ///
+ UINT8 RSNIMeasurement;
+ ///
+ /// Specifies the elements requested by the request element of the Probe Request frame.
+ /// This is an optional parameter and may be NULL.
+ ///
+ UINT8 *RequestedElements;
+ ///
+ /// Specifies the BSS membership selectors that represent the set of features that
+ /// shall be supported by all STAs to join this BSS.
+ ///
+ UINT8 *BSSMembershipSelectorSet;
+ ///
+ /// Specifies the parameters within the Extended Capabilities element that are
+ /// supported by the MAC entity. This is an optional parameter and may be NULL.
+ ///
+ EFI_80211_ELEMENT_EXT_CAP *ExtCapElement;
+} EFI_80211_BSS_DESCRIPTION;
+
+///
+/// EFI_80211_SUBELEMENT_INFO
+///
+typedef struct {
+ ///
+ /// Indicates the unique identifier within the containing element or sub-element.
+ ///
+ UINT8 SubElementID;
+ ///
+ /// Specifies the number of octets in the Data field.
+ ///
+ UINT8 Length;
+ ///
+ /// A variable length data buffer.
+ ///
+ UINT8 Data[1];
+} EFI_80211_SUBELEMENT_INFO;
+
+///
+/// EFI_80211_MULTIPLE_BSSID
+///
+typedef struct {
+ ///
+ /// Common header of an element.
+ ///
+ EFI_80211_ELEMENT_HEADER Hdr;
+ ///
+ /// Indicates the maximum number of BSSIDs in the multiple BSSID set. When Indicator
+ /// is set to n, 2n is the maximum number.
+ ///
+ UINT8 Indicator;
+ ///
+ /// Contains zero or more sub-elements.
+ ///
+ EFI_80211_SUBELEMENT_INFO SubElement[1];
+} EFI_80211_MULTIPLE_BSSID;
+
+///
+/// EFI_80211_BSS_DESP_PILOT
+///
+typedef struct {
+ ///
+ /// Indicates a specific BSSID of the found BSS.
+ ///
+ EFI_80211_MAC_ADDRESS BSSId;
+ ///
+ /// Specifies the type of the found BSS.
+ ///
+ EFI_80211_BSS_TYPE BSSType;
+ ///
+ /// One octet field to report condensed capability information.
+ ///
+ UINT8 ConCapInfo;
+ ///
+ /// Two octet's field to report condensed country string.
+ ///
+ UINT8 ConCountryStr[2];
+ ///
+ /// Indicates the operating class value for the operating channel.
+ ///
+ UINT8 OperatingClass;
+ ///
+ /// Indicates the operating channel.
+ ///
+ UINT8 Channel;
+ ///
+ /// Indicates the measurement pilot interval in TU.
+ ///
+ UINT8 Interval;
+ ///
+ /// Indicates that the BSS is within a multiple BSSID set.
+ ///
+ EFI_80211_MULTIPLE_BSSID *MultipleBSSID;
+ ///
+ /// Specifies the RCPI of the received frame.
+ ///
+ UINT8 RCPIMeasurement;
+ ///
+ /// Specifies the RSNI of the received frame.
+ ///
+ UINT8 RSNIMeasurement;
+} EFI_80211_BSS_DESP_PILOT;
+
+///
+/// EFI_80211_SCAN_RESULT
+///
+typedef struct {
+ ///
+ /// The number of EFI_80211_BSS_DESCRIPTION in BSSDespSet. If zero, BSSDespSet should
+ /// be ignored.
+ ///
+ UINTN NumOfBSSDesp;
+ ///
+ /// Points to zero or more instances of EFI_80211_BSS_DESCRIPTION.
+ ///
+ EFI_80211_BSS_DESCRIPTION **BSSDespSet;
+ ///
+ /// The number of EFI_80211_BSS_DESP_PILOT in BSSDespFromPilotSet. If zero,
+ /// BSSDespFromPilotSet should be ignored.
+ ///
+ UINTN NumofBSSDespFromPilot;
+ ///
+ /// Points to zero or more instances of EFI_80211_BSS_DESP_PILOT.
+ ///
+ EFI_80211_BSS_DESP_PILOT **BSSDespFromPilotSet;
+ ///
+ /// Specifies zero or more elements. This is an optional parameter and may be NULL.
+ ///
+ UINT8 *VendorSpecificInfo;
+} EFI_80211_SCAN_RESULT;
+
+///
+/// EFI_80211_SCAN_DATA_TOKEN
+///
+typedef struct {
+ ///
+ /// This Event will be signaled after the Status field is updated by the EFI Wireless
+ /// MAC Connection Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// Will be set to one of the following values:
+ /// EFI_SUCCESS: Scan operation completed successfully.
+ /// EFI_NOT_FOUND: Failed to find available BSS.
+ /// EFI_DEVICE_ERROR: An unexpected network or system error occurred.
+ /// EFI_ACCESS_DENIED: The scan operation is not completed due to some underlying
+ /// hardware or software state.
+ /// EFI_NOT_READY: The scan operation is started but not yet completed.
+ EFI_STATUS Status;
+ ///
+ /// Pointer to the scan data.
+ ///
+ EFI_80211_SCAN_DATA *Data;
+ ///
+ /// Indicates the scan state.
+ ///
+ EFI_80211_SCAN_RESULT_CODE ResultCode;
+ ///
+ /// Indicates the scan result. It is caller's responsibility to free this buffer.
+ ///
+ EFI_80211_SCAN_RESULT *Result;
+} EFI_80211_SCAN_DATA_TOKEN;
+
+///
+/// EFI_80211_ELEMENT_SUPP_CHANNEL_TUPLE
+///
+typedef struct {
+ ///
+ /// The first channel number in a subband of supported channels.
+ ///
+ UINT8 FirstChannelNumber;
+ ///
+ /// The number of channels in a subband of supported channels.
+ ///
+ UINT8 NumberOfChannels;
+} EFI_80211_ELEMENT_SUPP_CHANNEL_TUPLE;
+
+///
+/// EFI_80211_ELEMENT_SUPP_CHANNEL
+///
+typedef struct {
+ ///
+ /// Common header of an element.
+ ///
+ EFI_80211_ELEMENT_HEADER Hdr;
+ ///
+ /// Indicates one or more tuples of (first channel, number of channels).
+ ///
+ EFI_80211_ELEMENT_SUPP_CHANNEL_TUPLE Subband[1];
+} EFI_80211_ELEMENT_SUPP_CHANNEL;
+
+///
+/// EFI_80211_ASSOCIATE_DATA
+///
+typedef struct {
+ ///
+ /// Specifies the address of the peer MAC entity to associate with.
+ ///
+ EFI_80211_MAC_ADDRESS BSSId;
+ ///
+ /// Specifies the requested operational capabilities to the AP in 2 octets.
+ ///
+ UINT16 CapabilityInfo;
+ ///
+ /// Specifies a time limit in TU, after which the associate procedure is terminated.
+ ///
+ UINT32 FailureTimeout;
+ ///
+ /// Specifies if in power save mode, how often the STA awakes and listens for the next
+ /// beacon frame in TU.
+ ///
+ UINT32 ListenInterval;
+ ///
+ /// Indicates a list of channels in which the STA is capable of operating.
+ ///
+ EFI_80211_ELEMENT_SUPP_CHANNEL *Channels;
+ ///
+ /// The cipher suites and AKM suites selected by the STA.
+ ///
+ EFI_80211_ELEMENT_RSN RSN;
+ ///
+ /// Specifies the parameters within the Extended Capabilities element that are
+ /// supported by the MAC entity. This is an optional parameter and may be NULL.
+ ///
+ EFI_80211_ELEMENT_EXT_CAP *ExtCapElement;
+ ///
+ /// Specifies zero or more elements. This is an optional parameter and may be NULL.
+ ///
+ UINT8 *VendorSpecificInfo;
+} EFI_80211_ASSOCIATE_DATA;
+
+///
+/// EFI_80211_ELEMENT_TIMEOUT_VAL
+///
+typedef struct {
+ ///
+ /// Common header of an element.
+ ///
+ EFI_80211_ELEMENT_HEADER Hdr;
+ ///
+ /// Specifies the timeout interval type.
+ ///
+ UINT8 Type;
+ ///
+ /// Specifies the timeout interval value.
+ ///
+ UINT32 Value;
+} EFI_80211_ELEMENT_TIMEOUT_VAL;
+
+///
+/// EFI_80211_ASSOCIATE_RESULT
+///
+typedef struct {
+ ///
+ /// Specifies the address of the peer MAC entity from which the association request
+ /// was received.
+ ///
+ EFI_80211_MAC_ADDRESS BSSId;
+ ///
+ /// Specifies the operational capabilities advertised by the AP.
+ ///
+ UINT16 CapabilityInfo;
+ ///
+ /// Specifies the association ID value assigned by the AP.
+ ///
+ UINT16 AssociationID;
+ ///
+ /// Indicates the measured RCPI of the corresponding association request frame. It is
+ /// an optional parameter and is set to zero if unavailable.
+ ///
+ UINT8 RCPIValue;
+ ///
+ /// Indicates the measured RSNI at the time the corresponding association request
+ /// frame was received. It is an optional parameter and is set to zero if unavailable.
+ ///
+ UINT8 RSNIValue;
+ ///
+ /// Specifies the parameters within the Extended Capabilities element that are
+ /// supported by the MAC entity. This is an optional parameter and may be NULL.
+ ///
+ EFI_80211_ELEMENT_EXT_CAP *ExtCapElement;
+ ///
+ /// Specifies the timeout interval when the result code is AssociateRefusedTemporarily.
+ ///
+ EFI_80211_ELEMENT_TIMEOUT_VAL TimeoutInterval;
+ ///
+ /// Specifies zero or more elements. This is an optional parameter and may be NULL.
+ ///
+ UINT8 *VendorSpecificInfo;
+} EFI_80211_ASSOCIATE_RESULT;
+
+///
+/// EFI_80211_ASSOCIATE_DATA_TOKEN
+///
+typedef struct {
+ ///
+ /// This Event will be signaled after the Status field is updated by the EFI Wireless
+ /// MAC Connection Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// Will be set to one of the following values:
+ /// EFI_SUCCESS: Association operation completed successfully.
+ /// EFI_DEVICE_ERROR: An unexpected network or system error occurred.
+ ///
+ EFI_STATUS Status;
+ ///
+ /// Pointer to the association data.
+ ///
+ EFI_80211_ASSOCIATE_DATA *Data;
+ ///
+ /// Indicates the association state.
+ ///
+ EFI_80211_ASSOCIATE_RESULT_CODE ResultCode;
+ ///
+ /// Indicates the association result. It is caller's responsibility to free this
+ /// buffer.
+ ///
+ EFI_80211_ASSOCIATE_RESULT *Result;
+} EFI_80211_ASSOCIATE_DATA_TOKEN;
+
+///
+/// EFI_80211_DISASSOCIATE_DATA
+///
+typedef struct {
+ ///
+ /// Specifies the address of the peer MAC entity with which to perform the
+ /// disassociation process.
+ ///
+ EFI_80211_MAC_ADDRESS BSSId;
+ ///
+ /// Specifies the reason for initiating the disassociation process.
+ ///
+ EFI_80211_REASON_CODE ReasonCode;
+ ///
+ /// Zero or more elements, may be NULL.
+ ///
+ UINT8 *VendorSpecificInfo;
+} EFI_80211_DISASSOCIATE_DATA;
+
+///
+/// EFI_80211_DISASSOCIATE_DATA_TOKEN
+///
+typedef struct {
+ ///
+ /// This Event will be signaled after the Status field is updated by the EFI Wireless
+ /// MAC Connection Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// Will be set to one of the following values:
+ /// EFI_SUCCESS: Disassociation operation completed successfully.
+ /// EFI_DEVICE_ERROR: An unexpected network or system error occurred.
+ /// EFI_ACCESS_DENIED: The disassociation operation is not completed due to some
+ /// underlying hardware or software state.
+ /// EFI_NOT_READY: The disassociation operation is started but not yet completed.
+ ///
+ EFI_STATUS Status;
+ ///
+ /// Pointer to the disassociation data.
+ ///
+ EFI_80211_DISASSOCIATE_DATA *Data;
+ ///
+ /// Indicates the disassociation state.
+ ///
+ EFI_80211_DISASSOCIATE_RESULT_CODE ResultCode;
+} EFI_80211_DISASSOCIATE_DATA_TOKEN;
+
+///
+/// EFI_80211_AUTHENTICATION_DATA
+///
+typedef struct {
+ ///
+ /// Specifies the address of the peer MAC entity with which to perform the
+ /// authentication process.
+ ///
+ EFI_80211_MAC_ADDRESS BSSId;
+ ///
+ /// Specifies the type of authentication algorithm to use during the authentication
+ /// process.
+ ///
+ EFI_80211_AUTHENTICATION_TYPE AuthType;
+ ///
+ /// Specifies a time limit in TU after which the authentication procedure is
+ /// terminated.
+ ///
+ UINT32 FailureTimeout;
+ ///
+ /// Specifies the set of elements to be included in the first message of the FT
+ /// authentication sequence, may be NULL.
+ ///
+ UINT8 *FTContent;
+ ///
+ /// Specifies the set of elements to be included in the SAE Commit Message or SAE
+ /// Confirm Message, may be NULL.
+ ///
+ UINT8 *SAEContent;
+ ///
+ /// Zero or more elements, may be NULL.
+ ///
+ UINT8 *VendorSpecificInfo;
+} EFI_80211_AUTHENTICATE_DATA;
+
+///
+/// EFI_80211_AUTHENTICATION_RESULT
+///
+typedef struct {
+ ///
+ /// Specifies the address of the peer MAC entity from which the authentication request
+ /// was received.
+ ///
+ EFI_80211_MAC_ADDRESS BSSId;
+ ///
+ /// Specifies the set of elements to be included in the second message of the FT
+ /// authentication sequence, may be NULL.
+ ///
+ UINT8 *FTContent;
+ ///
+ /// Specifies the set of elements to be included in the SAE Commit Message or SAE
+ /// Confirm Message, may be NULL.
+ ///
+ UINT8 *SAEContent;
+ ///
+ /// Zero or more elements, may be NULL.
+ ///
+ UINT8 *VendorSpecificInfo;
+} EFI_80211_AUTHENTICATE_RESULT;
+
+///
+/// EFI_80211_AUTHENTICATE_DATA_TOKEN
+///
+typedef struct {
+ ///
+ /// This Event will be signaled after the Status field is updated by the EFI Wireless
+ /// MAC Connection Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// Will be set to one of the following values:
+ /// EFI_SUCCESS: Authentication operation completed successfully.
+ /// EFI_PROTOCOL_ERROR: Peer MAC entity rejects the authentication.
+ /// EFI_NO_RESPONSE: Peer MAC entity does not response the authentication request.
+ /// EFI_DEVICE_ERROR: An unexpected network or system error occurred.
+ /// EFI_ACCESS_DENIED: The authentication operation is not completed due to some
+ /// underlying hardware or software state.
+ /// EFI_NOT_READY: The authentication operation is started but not yet completed.
+ ///
+ EFI_STATUS Status;
+ ///
+ /// Pointer to the authentication data.
+ ///
+ EFI_80211_AUTHENTICATE_DATA *Data;
+ ///
+ /// Indicates the association state.
+ ///
+ EFI_80211_AUTHENTICATE_RESULT_CODE ResultCode;
+ ///
+ /// Indicates the association result. It is caller's responsibility to free this
+ /// buffer.
+ ///
+ EFI_80211_AUTHENTICATE_RESULT *Result;
+} EFI_80211_AUTHENTICATE_DATA_TOKEN;
+
+///
+/// EFI_80211_DEAUTHENTICATE_DATA
+///
+typedef struct {
+ ///
+ /// Specifies the address of the peer MAC entity with which to perform the
+ /// deauthentication process.
+ ///
+ EFI_80211_MAC_ADDRESS BSSId;
+ ///
+ /// Specifies the reason for initiating the deauthentication process.
+ ///
+ EFI_80211_REASON_CODE ReasonCode;
+ ///
+ /// Zero or more elements, may be NULL.
+ ///
+ UINT8 *VendorSpecificInfo;
+} EFI_80211_DEAUTHENTICATE_DATA;
+
+///
+/// EFI_80211_DEAUTHENTICATE_DATA_TOKEN
+///
+typedef struct {
+ ///
+ /// This Event will be signaled after the Status field is updated by the EFI Wireless
+ /// MAC Connection Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
+ ///
+ EFI_EVENT Event;
+ ///
+ /// Will be set to one of the following values:
+ /// EFI_SUCCESS: Deauthentication operation completed successfully.
+ /// EFI_DEVICE_ERROR: An unexpected network or system error occurred.
+ /// EFI_ACCESS_DENIED: The deauthentication operation is not completed due to some
+ /// underlying hardware or software state.
+ /// EFI_NOT_READY: The deauthentication operation is started but not yet
+ /// completed.
+ ///
+ EFI_STATUS Status;
+ ///
+ /// Pointer to the deauthentication data.
+ ///
+ EFI_80211_DEAUTHENTICATE_DATA *Data;
+} EFI_80211_DEAUTHENTICATE_DATA_TOKEN;
+
+/**
+ Request a survey of potential BSSs that administrator can later elect to try to join.
+
+ The Scan() function returns the description of the set of BSSs detected by the scan
+ process. Passive scan operation is performed by default.
+
+ @param[in] This Pointer to the EFI_WIRELESS_MAC_CONNECTION_PROTOCOL
+ instance.
+ @param[in] Data Pointer to the scan token.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Data is NULL.
+ Data->Data is NULL.
+ @retval EFI_UNSUPPORTED One or more of the input parameters are not supported
+ by this implementation.
+ @retval EFI_ALREADY_STARTED The scan operation is already started.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WIRELESS_MAC_CONNECTION_SCAN)(
+ IN EFI_WIRELESS_MAC_CONNECTION_PROTOCOL *This,
+ IN EFI_80211_SCAN_DATA_TOKEN *Data
+ );
+
+/**
+ Request an association with a specified peer MAC entity that is within an AP.
+
+ The Associate() function provides the capability for MAC layer to become associated
+ with an AP.
+
+ @param[in] This Pointer to the EFI_WIRELESS_MAC_CONNECTION_PROTOCOL
+ instance.
+ @param[in] Data Pointer to the association token.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Data is NULL.
+ Data->Data is NULL.
+ @retval EFI_UNSUPPORTED One or more of the input parameters are not supported
+ by this implementation.
+ @retval EFI_ALREADY_STARTED The association process is already started.
+ @retval EFI_NOT_READY Authentication is not performed before this association
+ process.
+ @retval EFI_NOT_FOUND The specified peer MAC entity is not found.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WIRELESS_MAC_CONNECTION_ASSOCIATE)(
+ IN EFI_WIRELESS_MAC_CONNECTION_PROTOCOL *This,
+ IN EFI_80211_ASSOCIATE_DATA_TOKEN *Data
+ );
+
+/**
+ Request a disassociation with a specified peer MAC entity.
+
+ The Disassociate() function is invoked to terminate an existing association.
+ Disassociation is a notification and cannot be refused by the receiving peer except
+ when management frame protection is negotiated and the message integrity check fails.
+
+ @param[in] This Pointer to the EFI_WIRELESS_MAC_CONNECTION_PROTOCOL
+ instance.
+ @param[in] Data Pointer to the disassociation token.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Data is NULL.
+ @retval EFI_ALREADY_STARTED The disassociation process is already started.
+ @retval EFI_NOT_READY The disassociation service is invoked to a
+ nonexistent association relationship.
+ @retval EFI_NOT_FOUND The specified peer MAC entity is not found.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WIRELESS_MAC_CONNECTION_DISASSOCIATE)(
+ IN EFI_WIRELESS_MAC_CONNECTION_PROTOCOL *This,
+ IN EFI_80211_DISASSOCIATE_DATA_TOKEN *Data
+ );
+
+/**
+ Request the process of establishing an authentication relationship with a peer MAC
+ entity.
+
+ The Authenticate() function requests authentication with a specified peer MAC entity.
+ This service might be time-consuming thus is designed to be invoked independently of
+ the association service.
+
+ @param[in] This Pointer to the EFI_WIRELESS_MAC_CONNECTION_PROTOCOL
+ instance.
+ @param[in] Data Pointer to the authentication token.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Data is NULL.
+ Data.Data is NULL.
+ @retval EFI_UNSUPPORTED One or more of the input parameters are not supported
+ by this implementation.
+ @retval EFI_ALREADY_STARTED The authentication process is already started.
+ @retval EFI_NOT_FOUND The specified peer MAC entity is not found.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WIRELESS_MAC_CONNECTION_AUTHENTICATE)(
+ IN EFI_WIRELESS_MAC_CONNECTION_PROTOCOL *This,
+ IN EFI_80211_AUTHENTICATE_DATA_TOKEN *Data
+ );
+
+/**
+ Invalidate the authentication relationship with a peer MAC entity.
+
+ The Deauthenticate() function requests that the authentication relationship with a
+ specified peer MAC entity be invalidated. Deauthentication is a notification and when
+ it is sent out the association at the transmitting station is terminated.
+
+ @param[in] This Pointer to the EFI_WIRELESS_MAC_CONNECTION_PROTOCOL
+ instance.
+ @param[in] Data Pointer to the deauthentication token.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ This is NULL.
+ Data is NULL.
+ Data.Data is NULL.
+ @retval EFI_ALREADY_STARTED The deauthentication process is already started.
+ @retval EFI_NOT_READY The deauthentication service is invoked to a
+ nonexistent association or authentication relationship.
+ @retval EFI_NOT_FOUND The specified peer MAC entity is not found.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WIRELESS_MAC_CONNECTION_DEAUTHENTICATE)(
+ IN EFI_WIRELESS_MAC_CONNECTION_PROTOCOL *This,
+ IN EFI_80211_DEAUTHENTICATE_DATA_TOKEN *Data
+ );
+
+///
+/// The EFI_WIRELESS_MAC_CONNECTION_PROTOCOL is designed to provide management service
+/// interfaces for the EFI wireless network stack to establish wireless connection with
+/// AP. An EFI Wireless MAC Connection Protocol instance will be installed on each
+/// communication device that the EFI wireless network stack runs on.
+///
+struct _EFI_WIRELESS_MAC_CONNECTION_PROTOCOL {
+ EFI_WIRELESS_MAC_CONNECTION_SCAN Scan;
+ EFI_WIRELESS_MAC_CONNECTION_ASSOCIATE Associate;
+ EFI_WIRELESS_MAC_CONNECTION_DISASSOCIATE Disassociate;
+ EFI_WIRELESS_MAC_CONNECTION_AUTHENTICATE Authenticate;
+ EFI_WIRELESS_MAC_CONNECTION_DEAUTHENTICATE Deauthenticate;
+};
+
+extern EFI_GUID gEfiWiFiProtocolGuid;
+
+#endif
diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/WiFi2.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/WiFi2.h
new file mode 100644
index 0000000000..d7cc3a1c85
--- /dev/null
+++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Protocol/WiFi2.h
@@ -0,0 +1,413 @@
+/** @file
+ This file defines the EFI Wireless MAC Connection II Protocol.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.6
+
+**/
+
+#ifndef __EFI_WIFI2_PROTOCOL_H__
+#define __EFI_WIFI2_PROTOCOL_H__
+
+#define EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL_GUID \
+ { \
+ 0x1b0fb9bf, 0x699d, 0x4fdd, { 0xa7, 0xc3, 0x25, 0x46, 0x68, 0x1b, 0xf6, 0x3b } \
+ }
+
+typedef struct _EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL;
+
+///
+/// EFI_80211_BSS_TYPE
+///
+typedef enum {
+ IeeeInfrastructureBSS,
+ IeeeIndependentBSS,
+ IeeeMeshBSS,
+ IeeeAnyBss
+} EFI_80211_BSS_TYPE;
+
+///
+/// EFI_80211_CONNECT_NETWORK_RESULT_CODE
+///
+typedef enum {
+ //
+ // The connection establishment operation finished successfully.
+ //
+ ConnectSuccess,
+ //
+ // The connection was refused by the Network.
+ //
+ ConnectRefused,
+ //
+ // The connection establishment operation failed (i.e, Network is not
+ // detected).
+ //
+ ConnectFailed,
+ //
+ // The connection establishment operation was terminated on timeout.
+ //
+ ConnectFailureTimeout,
+ //
+ // The connection establishment operation failed on other reason.
+ //
+ ConnectFailedReasonUnspecified
+} EFI_80211_CONNECT_NETWORK_RESULT_CODE;
+
+///
+/// EFI_80211_MAC_ADDRESS
+///
+typedef struct {
+ UINT8 Addr[6];
+} EFI_80211_MAC_ADDRESS;
+
+#define EFI_MAX_SSID_LEN 32
+
+///
+/// EFI_80211_SSID
+///
+typedef struct {
+ //
+ // Length in bytes of the SSId. If zero, ignore SSId field.
+ //
+ UINT8 SSIdLen;
+ //
+ // Specifies the service set identifier.
+ //
+ UINT8 SSId[EFI_MAX_SSID_LEN];
+} EFI_80211_SSID;
+
+///
+/// EFI_80211_GET_NETWORKS_DATA
+///
+typedef struct {
+ //
+ // The number of EFI_80211_SSID in SSIDList. If zero, SSIDList should be
+ // ignored.
+ //
+ UINT32 NumOfSSID;
+ //
+ // The SSIDList is a pointer to an array of EFI_80211_SSID instances. The
+ // number of entries is specified by NumOfSSID. The array should only include
+ // SSIDs of hidden networks. It is suggested that the caller inputs less than
+ // 10 elements in the SSIDList. It is the caller's responsibility to free
+ // this buffer.
+ //
+ EFI_80211_SSID SSIDList[1];
+} EFI_80211_GET_NETWORKS_DATA;
+
+///
+/// EFI_80211_SUITE_SELECTOR
+///
+typedef struct {
+ //
+ // Organization Unique Identifier, as defined in IEEE 802.11 standard,
+ // usually set to 00-0F-AC.
+ //
+ UINT8 Oui[3];
+ //
+ // Suites types, as defined in IEEE 802.11 standard.
+ //
+ UINT8 SuiteType;
+} EFI_80211_SUITE_SELECTOR;
+
+///
+/// EFI_80211_AKM_SUITE_SELECTOR
+///
+typedef struct {
+ //
+ // Indicates the number of AKM suite selectors that are contained in
+ // AKMSuiteList. If zero, the AKMSuiteList is ignored.
+ //
+ UINT16 AKMSuiteCount;
+ //
+ // A variable-length array of AKM suites, as defined in IEEE 802.11 standard,
+ // Table 8-101. The number of entries is specified by AKMSuiteCount.
+ //
+ EFI_80211_SUITE_SELECTOR AKMSuiteList[1];
+} EFI_80211_AKM_SUITE_SELECTOR;
+
+///
+/// EFI_80211_CIPHER_SUITE_SELECTOR
+///
+typedef struct {
+ //
+ // Indicates the number of cipher suites that are contained in
+ // CipherSuiteList. If zero, the CipherSuiteList is ignored.
+ //
+ UINT16 CipherSuiteCount;
+ //
+ // A variable-length array of cipher suites, as defined in IEEE 802.11
+ // standard, Table 8-99. The number of entries is specified by
+ // CipherSuiteCount.
+ //
+ EFI_80211_SUITE_SELECTOR CipherSuiteList[1];
+} EFI_80211_CIPHER_SUITE_SELECTOR;
+
+///
+/// EFI_80211_NETWORK
+///
+typedef struct {
+ //
+ // Specifies the type of the BSS.
+ //
+ EFI_80211_BSS_TYPE BSSType;
+ //
+ // Specifies the SSID of the BSS.
+ //
+ EFI_80211_SSID SSId;
+ //
+ // Pointer to the AKM suites supported in the wireless network.
+ //
+ EFI_80211_AKM_SUITE_SELECTOR *AKMSuite;
+ //
+ // Pointer to the cipher suites supported in the wireless network.
+ //
+ EFI_80211_CIPHER_SUITE_SELECTOR *CipherSuite;
+} EFI_80211_NETWORK;
+
+///
+/// EFI_80211_NETWORK_DESCRIPTION
+///
+typedef struct {
+ //
+ // Specifies the found wireless network.
+ //
+ EFI_80211_NETWORK Network;
+ //
+ // Indicates the network quality as a value between 0 to 100, where 100
+ // indicates the highest network quality.
+ //
+ UINT8 NetworkQuality;
+} EFI_80211_NETWORK_DESCRIPTION;
+
+///
+/// EFI_80211_GET_NETWORKS_RESULT
+///
+typedef struct {
+ //
+ // The number of EFI_80211_NETWORK_DESCRIPTION in NetworkDesc. If zero,
+ // NetworkDesc should be ignored.
+ //
+ UINT8 NumOfNetworkDesc;
+ //
+ // The NetworkDesc is a pointer to an array of EFI_80211_NETWORK_DESCRIPTION
+ // instances. It is caller's responsibility to free this buffer.
+ //
+ EFI_80211_NETWORK_DESCRIPTION NetworkDesc[1];
+} EFI_80211_GET_NETWORKS_RESULT;
+
+///
+/// EFI_80211_GET_NETWORKS_TOKEN
+///
+typedef struct {
+ //
+ // If the status code returned by GetNetworks() is EFI_SUCCESS, then this
+ // Event will be signaled after the Status field is updated by the EFI
+ // Wireless MAC Connection Protocol II driver. The type of Event must be
+ // EFI_NOTIFY_SIGNAL.
+ //
+ EFI_EVENT Event;
+ //
+ // Will be set to one of the following values:
+ // EFI_SUCCESS: The operation completed successfully.
+ // EFI_NOT_FOUND: Failed to find available wireless networks.
+ // EFI_DEVICE_ERROR: An unexpected network or system error occurred.
+ // EFI_ACCESS_DENIED: The operation is not completed due to some underlying
+ // hardware or software state.
+ // EFI_NOT_READY: The operation is started but not yet completed.
+ //
+ EFI_STATUS Status;
+ //
+ // Pointer to the input data for getting networks.
+ //
+ EFI_80211_GET_NETWORKS_DATA *Data;
+ //
+ // Indicates the scan result. It is caller's responsibility to free this
+ // buffer.
+ //
+ EFI_80211_GET_NETWORKS_RESULT *Result;
+} EFI_80211_GET_NETWORKS_TOKEN;
+
+///
+/// EFI_80211_CONNECT_NETWORK_DATA
+///
+typedef struct {
+ //
+ // Specifies the wireless network to connect to.
+ //
+ EFI_80211_NETWORK *Network;
+ //
+ // Specifies a time limit in seconds that is optionally present, after which
+ // the connection establishment procedure is terminated by the UNDI driver.
+ // This is an optional parameter and may be 0. Values of 5 seconds or higher
+ // are recommended.
+ //
+ UINT32 FailureTimeout;
+} EFI_80211_CONNECT_NETWORK_DATA;
+
+///
+/// EFI_80211_CONNECT_NETWORK_TOKEN
+///
+typedef struct {
+ //
+ // If the status code returned by ConnectNetwork() is EFI_SUCCESS, then this
+ // Event will be signaled after the Status field is updated by the EFI
+ // Wireless MAC Connection Protocol II driver. The type of Event must be
+ // EFI_NOTIFY_SIGNAL.
+ //
+ EFI_EVENT Event;
+ //
+ // Will be set to one of the following values:
+ // EFI_SUCCESS: The operation completed successfully.
+ // EFI_DEVICE_ERROR: An unexpected network or system error occurred.
+ // EFI_ACCESS_DENIED: The operation is not completed due to some underlying
+ // hardware or software state.
+ // EFI_NOT_READY: The operation is started but not yet completed.
+ //
+ EFI_STATUS Status;
+ //
+ // Pointer to the connection data.
+ //
+ EFI_80211_CONNECT_NETWORK_DATA *Data;
+ //
+ // Indicates the connection state.
+ //
+ EFI_80211_CONNECT_NETWORK_RESULT_CODE ResultCode;
+} EFI_80211_CONNECT_NETWORK_TOKEN;
+
+///
+/// EFI_80211_DISCONNECT_NETWORK_TOKEN
+///
+typedef struct {
+ //
+ // If the status code returned by DisconnectNetwork() is EFI_SUCCESS, then
+ // this Event will be signaled after the Status field is updated by the EFI
+ // Wireless MAC Connection Protocol II driver. The type of Event must be
+ // EFI_NOTIFY_SIGNAL.
+ //
+ EFI_EVENT Event;
+ //
+ // Will be set to one of the following values:
+ // EFI_SUCCESS: The operation completed successfully
+ // EFI_DEVICE_ERROR: An unexpected network or system error occurred.
+ // EFI_ACCESS_DENIED: The operation is not completed due to some underlying
+ // hardware or software state.
+ //
+ EFI_STATUS Status;
+} EFI_80211_DISCONNECT_NETWORK_TOKEN;
+
+/**
+ Request a survey of potential wireless networks that administrator can later
+ elect to try to join.
+
+ @param[in] This Pointer to the
+ EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL
+ instance.
+ @param[in] Token Pointer to the token for getting wireless
+ network.
+
+ @retval EFI_SUCCESS The operation started, and an event will
+ eventually be raised for the caller.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is
+ TRUE:
+ This is NULL.
+ Token is NULL.
+ @retval EFI_UNSUPPORTED One or more of the input parameters is not
+ supported by this implementation.
+ @retval EFI_ALREADY_STARTED The operation of getting wireless network is
+ already started.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be
+ allocated.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WIRELESS_MAC_CONNECTION_II_GET_NETWORKS) (
+ IN EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL *This,
+ IN EFI_80211_GET_NETWORKS_TOKEN *Token
+ );
+
+/**
+ Connect a wireless network specified by a particular SSID, BSS type and
+ Security type.
+
+ @param[in] This Pointer to the
+ EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL
+ instance.
+ @param[in] Token Pointer to the token for connecting wireless
+ network.
+
+ @retval EFI_SUCCESS The operation started successfully. Results
+ will be notified eventually.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is
+ TRUE:
+ This is NULL.
+ Token is NULL.
+ @retval EFI_UNSUPPORTED One or more of the input parameters are not
+ supported by this implementation.
+ @retval EFI_ALREADY_STARTED The connection process is already started.
+ @retval EFI_NOT_FOUND The specified wireless network is not found.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be
+ allocated.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WIRELESS_MAC_CONNECTION_II_CONNECT_NETWORK) (
+ IN EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL *This,
+ IN EFI_80211_CONNECT_NETWORK_TOKEN *Token
+ );
+
+/**
+ Request a disconnection with current connected wireless network.
+
+ @param[in] This Pointer to the
+ EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL
+ instance.
+ @param[in] Token Pointer to the token for disconnecting
+ wireless network.
+
+ @retval EFI_SUCCESS The operation started successfully. Results
+ will be notified eventually.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is
+ TRUE:
+ This is NULL.
+ Token is NULL.
+ @retval EFI_UNSUPPORTED One or more of the input parameters are not
+ supported by this implementation.
+ @retval EFI_NOT_FOUND Not connected to a wireless network.
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be
+ allocated.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WIRELESS_MAC_CONNECTION_II_DISCONNECT_NETWORK) (
+ IN EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL *This,
+ IN EFI_80211_DISCONNECT_NETWORK_TOKEN *Token
+ );
+
+///
+/// The EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL provides network management
+/// service interfaces for 802.11 network stack. It is used by network
+/// applications (and drivers) to establish wireless connection with a wireless
+/// network.
+///
+struct _EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL {
+ EFI_WIRELESS_MAC_CONNECTION_II_GET_NETWORKS GetNetworks;
+ EFI_WIRELESS_MAC_CONNECTION_II_CONNECT_NETWORK ConnectNetwork;
+ EFI_WIRELESS_MAC_CONNECTION_II_DISCONNECT_NETWORK DisconnectNetwork;
+};
+
+extern EFI_GUID gEfiWiFi2ProtocolGuid;
+
+#endif