]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h
sync alignment issue on IPF.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / UefiPxeBcDxe / PxeBcImpl.h
CommitLineData
dc361cc5 1/** @file
2
3Copyright (c) 2007, Intel Corporation
4All rights reserved. This program and the accompanying materials
5are licensed and made available under the terms and conditions of the BSD License
6which accompanies this distribution. The full text of the license may be found at
7http://opensource.org/licenses/bsd-license.php
8
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12Module Name:
13
14 PxeBcImpl.h
15
16Abstract:
17
18
19**/
20
21#ifndef __EFI_PXEBC_IMPL_H__
22#define __EFI_PXEBC_IMPL_H__
23
24
25typedef struct _PXEBC_PRIVATE_DATA PXEBC_PRIVATE_DATA;
26
34417785 27#include <PiDxe.h>
28
29#include <Guid/SmBios.h>
30#include <IndustryStandard/SmBios.h>
31#include <Protocol/Dhcp4.h>
32#include <Protocol/PxeBaseCode.h>
33#include <Protocol/Mtftp4.h>
34#include <Protocol/Udp4.h>
35#include <Protocol/LoadFile.h>
36#include <Protocol/NetworkInterfaceIdentifier.h>
37#include <Protocol/PxeBaseCodeCallBack.h>
8d285ec0 38#include <Protocol/Arp.h>
982a9eae 39#include <Protocol/Ip4.h>
34417785 40
41#include <Library/DebugLib.h>
42#include <Library/BaseMemoryLib.h>
43#include <Library/UefiDriverEntryPoint.h>
44#include <Library/UefiBootServicesTableLib.h>
45#include <Library/UefiLib.h>
46#include <Library/BaseLib.h>
dc361cc5 47#include <Library/NetLib.h>
48
49#include "PxeBcDriver.h"
50#include "PxeArch.h"
51#include "PxeBcDhcp.h"
52#include "PxeBcMtftp.h"
53#include "PxeBcSupport.h"
54
55#define PXEBC_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('P', 'X', 'E', 'P')
56#define PXEBC_MTFTP_TIMEOUT 4
57#define PXEBC_MTFTP_RETRIES 6
58
59struct _PXEBC_PRIVATE_DATA {
60 UINT32 Signature;
61 EFI_HANDLE Controller;
62 EFI_HANDLE Image;
8d285ec0 63 EFI_HANDLE ArpChild;
dc361cc5 64 EFI_HANDLE Dhcp4Child;
982a9eae 65 EFI_HANDLE Ip4Child;
dc361cc5 66 EFI_HANDLE Mtftp4Child;
67 EFI_HANDLE Udp4Child;
68
982a9eae 69
dc361cc5 70 EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL *Nii;
71
72 EFI_PXE_BASE_CODE_PROTOCOL PxeBc;
73 EFI_LOAD_FILE_PROTOCOL LoadFile;
74 EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL LoadFileCallback;
75 EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *PxeBcCallback;
8d285ec0 76 EFI_ARP_PROTOCOL *Arp;
dc361cc5 77 EFI_DHCP4_PROTOCOL *Dhcp4;
982a9eae 78 EFI_IP4_PROTOCOL *Ip4;
79 EFI_IP4_CONFIG_DATA Ip4ConfigData;
dc361cc5 80 EFI_MTFTP4_PROTOCOL *Mtftp4;
81 EFI_UDP4_PROTOCOL *Udp4;
82 EFI_UDP4_CONFIG_DATA Udp4CfgData;
83
982a9eae 84
dc361cc5 85 EFI_PXE_BASE_CODE_MODE Mode;
86 EFI_PXE_BASE_CODE_FUNCTION Function;
87
88 CHAR8 *BootFileName;
89
90 EFI_IP_ADDRESS StationIp;
91 EFI_IP_ADDRESS SubnetMask;
92 EFI_IP_ADDRESS GatewayIp;
93 EFI_IP_ADDRESS ServerIp;
94 BOOLEAN AddressIsOk;
95
96 UINTN FileSize;
97
98 UINT8 OptionBuffer[PXEBC_DHCP4_MAX_OPTION_SIZE];
99 EFI_DHCP4_PACKET SeedPacket;
982a9eae 100 EFI_MAC_ADDRESS Mac;
101 UINT8 MacLen;
dc361cc5 102
103 BOOLEAN SortOffers;
104 UINT32 NumOffers;
105 UINT32 SelectedOffer;
106 UINT32 ProxyOfferType;
107
108 //
109 // Cached packets as complements of pxe mode data
110 //
111 PXEBC_CACHED_DHCP4_PACKET ProxyOffer;
112 PXEBC_CACHED_DHCP4_PACKET Dhcp4Ack;
113 PXEBC_CACHED_DHCP4_PACKET PxeReply;
114 PXEBC_CACHED_DHCP4_PACKET Dhcp4Offers[PXEBC_MAX_OFFER_NUM];
115
116 //
117 // Arrays for different types of offers:
118 // ServerCount records the count of the servers we got the offers,
119 // OfferIndex records the index of the offer sent by the server indexed by ServerCount.
120 //
121 UINT32 ServerCount[DHCP4_PACKET_TYPE_MAX];
122 UINT32 OfferIndex[DHCP4_PACKET_TYPE_MAX][PXEBC_MAX_OFFER_NUM];
123 UINT32 BootpIndex;
124 UINT32 ProxyIndex[DHCP4_PACKET_TYPE_MAX];
125 UINT32 BinlIndex[PXEBC_MAX_OFFER_NUM];
982a9eae 126
127 EFI_EVENT GetArpCacheEvent;
128 //\r
129 // token and event used to get ICMP error data from IP\r
130 //\r
131 EFI_IP4_COMPLETION_TOKEN IcmpErrorRcvToken;
dc361cc5 132};
133
134#define PXEBC_PRIVATE_DATA_FROM_PXEBC(a) CR (a, PXEBC_PRIVATE_DATA, PxeBc, PXEBC_PRIVATE_DATA_SIGNATURE)
135
136#define PXEBC_PRIVATE_DATA_FROM_LOADFILE(a) CR (a, PXEBC_PRIVATE_DATA, LoadFile, PXEBC_PRIVATE_DATA_SIGNATURE)
137
138#define PXEBC_PRIVATE_DATA_FROM_PXEBCCALLBACK(a) CR (a, PXEBC_PRIVATE_DATA, PxeBcCallback, PXEBC_PRIVATE_DATA_SIGNATURE)
139
140extern EFI_PXE_BASE_CODE_PROTOCOL mPxeBcProtocolTemplate;
141extern EFI_LOAD_FILE_PROTOCOL mLoadFileProtocolTemplate;
142
143#endif