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 $ */
9 Copyright (c) 1998 Intel Corporation
17 EFI PXE Base Code Protocol
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
);
47 typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT
;
65 UINT8 BootpHwAddr
[16];
66 UINT8 BootpSrvName
[64];
67 UINT8 BootpBootFile
[128];
69 UINT8 DhcpOptions
[56];
70 } EFI_PXE_BASE_CODE_DHCPV4_PACKET
;
74 EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4
;
75 } EFI_PXE_BASE_CODE_PACKET
;
91 } EFI_PXE_BASE_CODE_ICMP_ERROR
;
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
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
119 EFI_IP_ADDRESS IpAddr
;
120 EFI_MAC_ADDRESS MacAddr
;
121 } EFI_PXE_BASE_CODE_ARP_ENTRY
;
124 EFI_IP_ADDRESS IpAddr
;
125 EFI_IP_ADDRESS SubnetMask
;
126 EFI_IP_ADDRESS GwAddr
;
127 } EFI_PXE_BASE_CODE_ROUTE_ENTRY
;
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
174 BOOLEAN AcceptAnyResponse
;
176 EFI_IP_ADDRESS IpAddr
;
177 } EFI_PXE_BASE_CODE_SRVLIST
;
184 EFI_IP_ADDRESS ServerMCastIp
;
186 EFI_PXE_BASE_CODE_SRVLIST SrvList
[1];
187 } EFI_PXE_BASE_CODE_DISCOVER_INFO
;
190 * Mtftp() definitions
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
;
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
222 BOOLEAN Ipv6Available
;
223 BOOLEAN Ipv6Supported
;
225 BOOLEAN BisSupported
;
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
;
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
263 (EFIAPI
*EFI_PXE_BASE_CODE_START
) (
264 IN
struct _EFI_PXE_BASE_CODE
*This
,
270 (EFIAPI
*EFI_PXE_BASE_CODE_STOP
) (
271 IN
struct _EFI_PXE_BASE_CODE
*This
276 (EFIAPI
*EFI_PXE_BASE_CODE_DHCP
) (
277 IN
struct _EFI_PXE_BASE_CODE
*This
,
278 IN BOOLEAN SortOffers
283 (EFIAPI
*EFI_PXE_BASE_CODE_DISCOVER
) (
284 IN
struct _EFI_PXE_BASE_CODE
*This
,
288 IN OUT EFI_PXE_BASE_CODE_DISCOVER_INFO
*Info OPTIONAL
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
,
302 IN EFI_PXE_BASE_CODE_MTFTP_INFO
*Info OPTIONAL
,
303 IN BOOLEAN DontUseBuffer
308 (EFIAPI
*EFI_PXE_BASE_CODE_UDP_WRITE
) (
309 IN
struct _EFI_PXE_BASE_CODE
*This
,
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
,
324 (EFIAPI
*EFI_PXE_BASE_CODE_UDP_READ
) (
325 IN
struct _EFI_PXE_BASE_CODE
*This
,
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
,
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
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
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
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
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
{
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
;
413 * Call Back Definitions
416 #define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL \
417 { 0x245dca21, 0xfb7b, 0x11d3, 0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
423 #define EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION 0x00010000
425 INTERFACE_DECL(_EFI_PXE_BASE_CODE_CALLBACK
);
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
;
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
;
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
,
453 IN EFI_PXE_BASE_CODE_PACKET
*Packet OPTIONAL
456 typedef struct _EFI_PXE_BASE_CODE_CALLBACK
{
458 EFI_PXE_CALLBACK Callback
;
459 } EFI_PXE_BASE_CODE_CALLBACK
;
461 #endif /* _EFIPXEBC_H */