Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / ia64 / stand / efi / include / efipxebc.h
blob9dbd215e29d10b20dfb5240e19a80e89069d747b
1 /* $NetBSD: efipxebc.h,v 1.1 2006/04/07 14:21:29 cherry Exp $ */
2 /* $FreeBSD: src/sys/boot/efi/include/efipxebc.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ */
4 #ifndef _EFIPXEBC_H
5 #define _EFIPXEBC_H
7 /*++
9 Copyright (c) 1998 Intel Corporation
11 Module Name:
13 efipxebc.h
15 Abstract:
17 EFI PXE Base Code Protocol
21 Revision History
23 --*/
26 * PXE Base Code protocol
29 #define EFI_PXE_BASE_CODE_PROTOCOL \
30 { 0x03c4e603, 0xac28, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
32 INTERFACE_DECL(_EFI_PXE_BASE_CODE);
34 #define DEFAULT_TTL 4
35 #define DEFAULT_ToS 0
38 * Address definitions
41 typedef union {
42 UINT32 Addr[4];
43 EFI_IPv4_ADDRESS v4;
44 EFI_IPv6_ADDRESS v6;
45 } EFI_IP_ADDRESS;
47 typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT;
50 * Packet definitions
53 typedef struct {
54 UINT8 BootpOpcode;
55 UINT8 BootpHwType;
56 UINT8 BootpHwAddrLen;
57 UINT8 BootpGateHops;
58 UINT32 BootpIdent;
59 UINT16 BootpSeconds;
60 UINT16 BootpFlags;
61 UINT8 BootpCiAddr[4];
62 UINT8 BootpYiAddr[4];
63 UINT8 BootpSiAddr[4];
64 UINT8 BootpGiAddr[4];
65 UINT8 BootpHwAddr[16];
66 UINT8 BootpSrvName[64];
67 UINT8 BootpBootFile[128];
68 UINT32 DhcpMagik;
69 UINT8 DhcpOptions[56];
70 } EFI_PXE_BASE_CODE_DHCPV4_PACKET;
72 typedef union {
73 UINT8 Raw[1472];
74 EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4;
75 } EFI_PXE_BASE_CODE_PACKET;
77 typedef struct {
78 UINT8 Type;
79 UINT8 Code;
80 UINT16 Checksum;
81 union {
82 UINT32 reserved;
83 UINT32 Mtu;
84 UINT32 Pointer;
85 struct {
86 UINT16 Identifier;
87 UINT16 Sequence;
88 } Echo;
89 } u;
90 UINT8 Data[494];
91 } EFI_PXE_BASE_CODE_ICMP_ERROR;
93 typedef struct {
94 UINT8 ErrorCode;
95 CHAR8 ErrorString[127];
96 } EFI_PXE_BASE_CODE_TFTP_ERROR;
99 * IP Receive Filter definitions
101 #define EFI_PXE_BASE_CODE_MAX_IPCNT 8
102 typedef struct {
103 UINT8 Filters;
104 UINT8 IpCnt;
105 UINT16 reserved;
106 EFI_IP_ADDRESS IpList[EFI_PXE_BASE_CODE_MAX_IPCNT];
107 } EFI_PXE_BASE_CODE_IP_FILTER;
109 #define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP 0x0001
110 #define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST 0x0002
111 #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS 0x0004
112 #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008
115 * ARP Cache definitions
118 typedef struct {
119 EFI_IP_ADDRESS IpAddr;
120 EFI_MAC_ADDRESS MacAddr;
121 } EFI_PXE_BASE_CODE_ARP_ENTRY;
123 typedef struct {
124 EFI_IP_ADDRESS IpAddr;
125 EFI_IP_ADDRESS SubnetMask;
126 EFI_IP_ADDRESS GwAddr;
127 } EFI_PXE_BASE_CODE_ROUTE_ENTRY;
130 * UDP definitions
133 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP 0x0001
134 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT 0x0002
135 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP 0x0004
136 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT 0x0008
137 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER 0x0010
138 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT 0x0020
141 * Discover() definitions
144 #define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0
145 #define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1
146 #define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2
147 #define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3
148 #define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO 4
149 #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD 5
150 #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM 6
151 #define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG 7
152 #define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW 8
153 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9 9
154 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10 10
155 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11 11
156 #define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12 12
157 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL 13
158 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT 14
159 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO 15
160 #define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT 16
162 * 17 through 32767 are reserved
163 * 32768 through 65279 are for vendor use
164 * 65280 through 65534 are reserved
166 #define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST 65535
168 #define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK 0x7FFF
169 #define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL 0x0000
172 typedef struct {
173 UINT16 Type;
174 BOOLEAN AcceptAnyResponse;
175 UINT8 Reserved;
176 EFI_IP_ADDRESS IpAddr;
177 } EFI_PXE_BASE_CODE_SRVLIST;
179 typedef struct {
180 BOOLEAN UseMCast;
181 BOOLEAN UseBCast;
182 BOOLEAN UseUCast;
183 BOOLEAN MustUseList;
184 EFI_IP_ADDRESS ServerMCastIp;
185 UINT16 IpCnt;
186 EFI_PXE_BASE_CODE_SRVLIST SrvList[1];
187 } EFI_PXE_BASE_CODE_DISCOVER_INFO;
190 * Mtftp() definitions
193 typedef enum {
194 EFI_PXE_BASE_CODE_TFTP_FIRST,
195 EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE,
196 EFI_PXE_BASE_CODE_TFTP_READ_FILE,
197 EFI_PXE_BASE_CODE_TFTP_WRITE_FILE,
198 EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY,
199 EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE,
200 EFI_PXE_BASE_CODE_MTFTP_READ_FILE,
201 EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY,
202 EFI_PXE_BASE_CODE_MTFTP_LAST
203 } EFI_PXE_BASE_CODE_TFTP_OPCODE;
205 typedef struct {
206 EFI_IP_ADDRESS MCastIp;
207 EFI_PXE_BASE_CODE_UDP_PORT CPort;
208 EFI_PXE_BASE_CODE_UDP_PORT SPort;
209 UINT16 ListenTimeout;
210 UINT16 TransmitTimeout;
211 } EFI_PXE_BASE_CODE_MTFTP_INFO;
214 * PXE Base Code Mode structure
217 #define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8
218 #define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8
220 typedef struct {
221 BOOLEAN Started;
222 BOOLEAN Ipv6Available;
223 BOOLEAN Ipv6Supported;
224 BOOLEAN UsingIpv6;
225 BOOLEAN BisSupported;
226 BOOLEAN BisDetected;
227 BOOLEAN AutoArp;
228 BOOLEAN SendGUID;
229 BOOLEAN DhcpDiscoverValid;
230 BOOLEAN DhcpAckReceived;
231 BOOLEAN ProxyOfferReceived;
232 BOOLEAN PxeDiscoverValid;
233 BOOLEAN PxeReplyReceived;
234 BOOLEAN PxeBisReplyReceived;
235 BOOLEAN IcmpErrorReceived;
236 BOOLEAN TftpErrorReceived;
237 BOOLEAN MakeCallbacks;
238 UINT8 TTL;
239 UINT8 ToS;
240 EFI_IP_ADDRESS StationIp;
241 EFI_IP_ADDRESS SubnetMask;
242 EFI_PXE_BASE_CODE_PACKET DhcpDiscover;
243 EFI_PXE_BASE_CODE_PACKET DhcpAck;
244 EFI_PXE_BASE_CODE_PACKET ProxyOffer;
245 EFI_PXE_BASE_CODE_PACKET PxeDiscover;
246 EFI_PXE_BASE_CODE_PACKET PxeReply;
247 EFI_PXE_BASE_CODE_PACKET PxeBisReply;
248 EFI_PXE_BASE_CODE_IP_FILTER IpFilter;
249 UINT32 ArpCacheEntries;
250 EFI_PXE_BASE_CODE_ARP_ENTRY ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];
251 UINT32 RouteTableEntries;
252 EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];
253 EFI_PXE_BASE_CODE_ICMP_ERROR IcmpError;
254 EFI_PXE_BASE_CODE_TFTP_ERROR TftpError;
255 } EFI_PXE_BASE_CODE_MODE;
258 * PXE Base Code Interface Function definitions
261 typedef
262 EFI_STATUS
263 (EFIAPI *EFI_PXE_BASE_CODE_START) (
264 IN struct _EFI_PXE_BASE_CODE *This,
265 IN BOOLEAN UseIpv6
268 typedef
269 EFI_STATUS
270 (EFIAPI *EFI_PXE_BASE_CODE_STOP) (
271 IN struct _EFI_PXE_BASE_CODE *This
274 typedef
275 EFI_STATUS
276 (EFIAPI *EFI_PXE_BASE_CODE_DHCP) (
277 IN struct _EFI_PXE_BASE_CODE *This,
278 IN BOOLEAN SortOffers
281 typedef
282 EFI_STATUS
283 (EFIAPI *EFI_PXE_BASE_CODE_DISCOVER) (
284 IN struct _EFI_PXE_BASE_CODE *This,
285 IN UINT16 Type,
286 IN UINT16 *Layer,
287 IN BOOLEAN UseBis,
288 IN OUT EFI_PXE_BASE_CODE_DISCOVER_INFO *Info OPTIONAL
291 typedef
292 EFI_STATUS
293 (EFIAPI *EFI_PXE_BASE_CODE_MTFTP) (
294 IN struct _EFI_PXE_BASE_CODE *This,
295 IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation,
296 IN OUT VOID *BufferPtr OPTIONAL,
297 IN BOOLEAN Overwrite,
298 IN OUT UINTN *BufferSize,
299 IN UINTN *BlockSize OPTIONAL,
300 IN EFI_IP_ADDRESS *ServerIp,
301 IN UINT8 *Filename,
302 IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL,
303 IN BOOLEAN DontUseBuffer
306 typedef
307 EFI_STATUS
308 (EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE) (
309 IN struct _EFI_PXE_BASE_CODE *This,
310 IN UINT16 OpFlags,
311 IN EFI_IP_ADDRESS *DestIp,
312 IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort,
313 IN EFI_IP_ADDRESS *GatewayIp, OPTIONAL
314 IN EFI_IP_ADDRESS *SrcIp, OPTIONAL
315 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL
316 IN UINTN *HeaderSize, OPTIONAL
317 IN VOID *HeaderPtr, OPTIONAL
318 IN UINTN *BufferSize,
319 IN VOID *BufferPtr
322 typedef
323 EFI_STATUS
324 (EFIAPI *EFI_PXE_BASE_CODE_UDP_READ) (
325 IN struct _EFI_PXE_BASE_CODE *This,
326 IN UINT16 OpFlags,
327 IN OUT EFI_IP_ADDRESS *DestIp, OPTIONAL
328 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort, OPTIONAL
329 IN OUT EFI_IP_ADDRESS *SrcIp, OPTIONAL
330 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL
331 IN UINTN *HeaderSize, OPTIONAL
332 IN VOID *HeaderPtr, OPTIONAL
333 IN OUT UINTN *BufferSize,
334 IN VOID *BufferPtr
337 typedef
338 EFI_STATUS
339 (EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER) (
340 IN struct _EFI_PXE_BASE_CODE *This,
341 IN EFI_PXE_BASE_CODE_IP_FILTER *NewFilter
344 typedef
345 EFI_STATUS
346 (EFIAPI *EFI_PXE_BASE_CODE_ARP) (
347 IN struct _EFI_PXE_BASE_CODE *This,
348 IN EFI_IP_ADDRESS *IpAddr,
349 IN EFI_MAC_ADDRESS *MacAddr OPTIONAL
352 typedef
353 EFI_STATUS
354 (EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS) (
355 IN struct _EFI_PXE_BASE_CODE *This,
356 IN BOOLEAN *NewAutoArp, OPTIONAL
357 IN BOOLEAN *NewSendGUID, OPTIONAL
358 IN UINT8 *NewTTL, OPTIONAL
359 IN UINT8 *NewToS, OPTIONAL
360 IN BOOLEAN *NewMakeCallback OPTIONAL
363 typedef
364 EFI_STATUS
365 (EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP) (
366 IN struct _EFI_PXE_BASE_CODE *This,
367 IN EFI_IP_ADDRESS *NewStationIp, OPTIONAL
368 IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL
371 typedef
372 EFI_STATUS
373 (EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS) (
374 IN struct _EFI_PXE_BASE_CODE *This,
375 BOOLEAN *NewDhcpDiscoverValid, OPTIONAL
376 BOOLEAN *NewDhcpAckReceived, OPTIONAL
377 BOOLEAN *NewProxyOfferReceived, OPTIONAL
378 BOOLEAN *NewPxeDiscoverValid, OPTIONAL
379 BOOLEAN *NewPxeReplyReceived, OPTIONAL
380 BOOLEAN *NewPxeBisReplyReceived,OPTIONAL
381 IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover, OPTIONAL
382 IN EFI_PXE_BASE_CODE_PACKET *NewDhcpAck, OPTIONAL
383 IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer, OPTIONAL
384 IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover, OPTIONAL
385 IN EFI_PXE_BASE_CODE_PACKET *NewPxeReply, OPTIONAL
386 IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply OPTIONAL
390 * PXE Base Code Protocol structure
393 #define EFI_PXE_BASE_CODE_INTERFACE_REVISION 0x00010000
395 typedef struct _EFI_PXE_BASE_CODE {
396 UINT64 Revision;
397 EFI_PXE_BASE_CODE_START Start;
398 EFI_PXE_BASE_CODE_STOP Stop;
399 EFI_PXE_BASE_CODE_DHCP Dhcp;
400 EFI_PXE_BASE_CODE_DISCOVER Discover;
401 EFI_PXE_BASE_CODE_MTFTP Mtftp;
402 EFI_PXE_BASE_CODE_UDP_WRITE UdpWrite;
403 EFI_PXE_BASE_CODE_UDP_READ UdpRead;
404 EFI_PXE_BASE_CODE_SET_IP_FILTER SetIpFilter;
405 EFI_PXE_BASE_CODE_ARP Arp;
406 EFI_PXE_BASE_CODE_SET_PARAMETERS SetParameters;
407 EFI_PXE_BASE_CODE_SET_STATION_IP SetStationIp;
408 EFI_PXE_BASE_CODE_SET_PACKETS SetPackets;
409 EFI_PXE_BASE_CODE_MODE *Mode;
410 } EFI_PXE_BASE_CODE;
413 * Call Back Definitions
416 #define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL \
417 { 0x245dca21, 0xfb7b, 0x11d3, 0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
420 * Revision Number
423 #define EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION 0x00010000
425 INTERFACE_DECL(_EFI_PXE_BASE_CODE_CALLBACK);
427 typedef enum {
428 EFI_PXE_BASE_CODE_FUNCTION_FIRST,
429 EFI_PXE_BASE_CODE_FUNCTION_DHCP,
430 EFI_PXE_BASE_CODE_FUNCTION_DISCOVER,
431 EFI_PXE_BASE_CODE_FUNCTION_MTFTP,
432 EFI_PXE_BASE_CODE_FUNCTION_UDP_WRITE,
433 EFI_PXE_BASE_CODE_FUNCTION_UDP_READ,
434 EFI_PXE_BASE_CODE_FUNCTION_ARP,
435 EFI_PXE_BASE_CODE_FUNCTION_IGMP,
436 EFI_PXE_BASE_CODE_PXE_FUNCTION_LAST
437 } EFI_PXE_BASE_CODE_FUNCTION;
439 typedef enum {
440 EFI_PXE_BASE_CODE_CALLBACK_STATUS_FIRST,
441 EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
442 EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT,
443 EFI_PXE_BASE_CODE_CALLBACK_STATUS_LAST
444 } EFI_PXE_BASE_CODE_CALLBACK_STATUS;
446 typedef
447 EFI_PXE_BASE_CODE_CALLBACK_STATUS
448 (EFIAPI *EFI_PXE_CALLBACK) (
449 IN struct _EFI_PXE_BASE_CODE_CALLBACK *This,
450 IN EFI_PXE_BASE_CODE_FUNCTION Function,
451 IN BOOLEAN Received,
452 IN UINT32 PacketLen,
453 IN EFI_PXE_BASE_CODE_PACKET *Packet OPTIONAL
456 typedef struct _EFI_PXE_BASE_CODE_CALLBACK {
457 UINT64 Revision;
458 EFI_PXE_CALLBACK Callback;
459 } EFI_PXE_BASE_CODE_CALLBACK;
461 #endif /* _EFIPXEBC_H */