+++ /dev/null
-/** @file\r
-\r
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef __EFI_PXEBC_IMPL_H__\r
-#define __EFI_PXEBC_IMPL_H__\r
-\r
-\r
-typedef struct _PXEBC_PRIVATE_DATA PXEBC_PRIVATE_DATA;\r
-\r
-#include <Uefi.h>\r
-\r
-#include <Guid/SmBios.h>\r
-#include <IndustryStandard/SmBios.h>\r
-#include <IndustryStandard/Dhcp.h>\r
-#include <Protocol/Dhcp4.h>\r
-#include <Protocol/PxeBaseCode.h>\r
-#include <Protocol/Mtftp4.h>\r
-#include <Protocol/Udp4.h>\r
-#include <Protocol/LoadFile.h>\r
-#include <Protocol/NetworkInterfaceIdentifier.h>\r
-#include <Protocol/PxeBaseCodeCallBack.h>\r
-#include <Protocol/Arp.h>\r
-#include <Protocol/Ip4.h>\r
-#include <Protocol/Ip4Config2.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/NetLib.h>\r
-#include <Library/DpcLib.h>\r
-#include <Library/PcdLib.h>\r
-\r
-#include "PxeBcDriver.h"\r
-#include "PxeBcDhcp.h"\r
-#include "PxeBcMtftp.h"\r
-#include "PxeBcSupport.h"\r
-\r
-#define PXEBC_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('P', 'X', 'E', 'P')\r
-#define PXEBC_MTFTP_TIMEOUT 4\r
-#define PXEBC_MTFTP_RETRIES 6\r
-#define PXEBC_DEFAULT_UDP_OVERHEAD_SIZE 8\r
-#define PXEBC_DEFAULT_TFTP_OVERHEAD_SIZE 4\r
-#define PXEBC_DEFAULT_PACKET_SIZE 1480\r
-#define PXEBC_DEFAULT_LIFETIME 50000 // 50ms, unit is microsecond\r
-#define PXEBC_CHECK_MEDIA_WAITING_TIME EFI_TIMER_PERIOD_SECONDS(20)\r
-\r
-struct _PXEBC_PRIVATE_DATA {\r
- UINT32 Signature;\r
- EFI_HANDLE Controller;\r
- EFI_HANDLE Image;\r
- EFI_HANDLE ArpChild;\r
- EFI_HANDLE Dhcp4Child;\r
- EFI_HANDLE Ip4Child;\r
- EFI_HANDLE Mtftp4Child;\r
- EFI_HANDLE Udp4ReadChild;\r
- EFI_HANDLE Udp4WriteChild;\r
-\r
- EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL *Nii;\r
-\r
- EFI_PXE_BASE_CODE_PROTOCOL PxeBc;\r
- EFI_LOAD_FILE_PROTOCOL LoadFile;\r
- EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL LoadFileCallback;\r
- EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *PxeBcCallback;\r
- EFI_ARP_PROTOCOL *Arp;\r
- EFI_DHCP4_PROTOCOL *Dhcp4;\r
- EFI_IP4_PROTOCOL *Ip4;\r
- EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2;\r
- EFI_IP4_CONFIG_DATA Ip4ConfigData;\r
- EFI_MTFTP4_PROTOCOL *Mtftp4;\r
- EFI_UDP4_PROTOCOL *Udp4Read;\r
- EFI_UDP4_PROTOCOL *Udp4Write;\r
- UINT16 CurrentUdpSrcPort;\r
- EFI_UDP4_CONFIG_DATA Udp4CfgData;\r
-\r
-\r
- EFI_PXE_BASE_CODE_MODE Mode;\r
- EFI_PXE_BASE_CODE_FUNCTION Function;\r
-\r
- CHAR8 *BootFileName;\r
-\r
- EFI_IP_ADDRESS StationIp;\r
- EFI_IP_ADDRESS SubnetMask;\r
- EFI_IP_ADDRESS GatewayIp;\r
- EFI_IP_ADDRESS ServerIp;\r
- BOOLEAN AddressIsOk;\r
- UINT32 Ip4MaxPacketSize;\r
- UINTN BlockSize;\r
- UINTN FileSize;\r
-\r
- UINT8 OptionBuffer[PXEBC_DHCP4_MAX_OPTION_SIZE];\r
- EFI_DHCP4_PACKET SeedPacket;\r
- EFI_MAC_ADDRESS Mac;\r
- UINT8 MacLen;\r
-\r
- BOOLEAN SortOffers;\r
- BOOLEAN GotProxyOffer;\r
- UINT32 NumOffers;\r
- UINT32 SelectedOffer;\r
- UINT32 ProxyOfferType;\r
-\r
- //\r
- // Cached packets as complements of pxe mode data\r
- //\r
- PXEBC_CACHED_DHCP4_PACKET ProxyOffer;\r
- PXEBC_CACHED_DHCP4_PACKET Dhcp4Ack;\r
- PXEBC_CACHED_DHCP4_PACKET PxeReply;\r
- PXEBC_CACHED_DHCP4_PACKET Dhcp4Offers[PXEBC_MAX_OFFER_NUM];\r
-\r
- //\r
- // Arrays for different types of offers:\r
- // ServerCount records the count of the servers we got the offers,\r
- // OfferIndex records the index of the offer sent by the server indexed by ServerCount.\r
- //\r
- UINT32 ServerCount[DHCP4_PACKET_TYPE_MAX];\r
- UINT32 OfferIndex[DHCP4_PACKET_TYPE_MAX][PXEBC_MAX_OFFER_NUM];\r
- UINT32 BootpIndex;\r
- UINT32 ProxyIndex[DHCP4_PACKET_TYPE_MAX];\r
- UINT32 BinlIndex[PXEBC_MAX_OFFER_NUM];\r
-\r
- EFI_EVENT GetArpCacheEvent;\r
- //\r
- // token and event used to get ICMP error data from IP\r
- //\r
- EFI_IP4_COMPLETION_TOKEN IcmpErrorRcvToken;\r
-};\r
-\r
-#define PXEBC_PRIVATE_DATA_FROM_PXEBC(a) CR (a, PXEBC_PRIVATE_DATA, PxeBc, PXEBC_PRIVATE_DATA_SIGNATURE)\r
-\r
-#define PXEBC_PRIVATE_DATA_FROM_LOADFILE(a) CR (a, PXEBC_PRIVATE_DATA, LoadFile, PXEBC_PRIVATE_DATA_SIGNATURE)\r
-\r
-#define PXEBC_PRIVATE_DATA_FROM_PXEBCCALLBACK(a) CR (a, PXEBC_PRIVATE_DATA, PxeBcCallback, PXEBC_PRIVATE_DATA_SIGNATURE)\r
-\r
-extern EFI_PXE_BASE_CODE_PROTOCOL mPxeBcProtocolTemplate;\r
-extern EFI_LOAD_FILE_PROTOCOL mLoadFileProtocolTemplate;\r
-\r
-/**\r
- Causes the driver to load a specified file.\r
-\r
- @param This Protocol instance pointer.\r
- @param FilePath The device specific path of the file to load.\r
- @param BootPolicy If TRUE, indicates that the request originates from the\r
- boot manager is attempting to load FilePath as a boot\r
- selection. If FALSE, then FilePath must match as exact file\r
- to be loaded.\r
- @param BufferSize On input the size of Buffer in bytes. On output with a return\r
- code of EFI_SUCCESS, the amount of data transferred to\r
- Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,\r
- the size of Buffer required to retrieve the requested file.\r
- @param Buffer The memory buffer to transfer the file to. IF Buffer is NULL,\r
- then no the size of the requested file is returned in\r
- BufferSize.\r
-\r
- @retval EFI_SUCCESS The file was loaded.\r
- @retval EFI_UNSUPPORTED The device does not support the provided BootPolicy\r
- @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or\r
- BufferSize is NULL.\r
- @retval EFI_NO_MEDIA No medium was present to load the file.\r
- @retval EFI_DEVICE_ERROR The file was not loaded due to a device error.\r
- @retval EFI_NO_RESPONSE The remote system did not respond.\r
- @retval EFI_NOT_FOUND The file was not found.\r
- @retval EFI_ABORTED The file load process was manually cancelled.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiPxeLoadFile (\r
- IN EFI_LOAD_FILE_PROTOCOL * This,\r
- IN EFI_DEVICE_PATH_PROTOCOL * FilePath,\r
- IN BOOLEAN BootPolicy,\r
- IN OUT UINTN *BufferSize,\r
- IN VOID *Buffer OPTIONAL\r
- );\r
-\r
-#endif\r