These changes are the raw update to qemu-2.6.
[kvmfornfv.git] / qemu / roms / ipxe / src / arch / i386 / include / pxe_api.h
1 #ifndef PXE_API_H
2 #define PXE_API_H
3
4 /*
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of the
8  * License, or any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  * 02110-1301, USA.
19  *
20  * You can also choose to distribute this program under the terms of
21  * the Unmodified Binary Distribution Licence (as given in the file
22  * COPYING.UBDL), provided that you have satisfied its requirements.
23  *
24  * As an alternative, at your option, you may use this file under the
25  * following terms, known as the "MIT license":
26  *
27  * Copyright (c) 2005-2009 Michael Brown <mbrown@fensystems.co.uk>
28  *
29  * Permission is hereby granted, free of charge, to any person
30  * obtaining a copy of this software and associated documentation
31  * files (the "Software"), to deal in the Software without
32  * restriction, including without limitation the rights to use, copy,
33  * modify, merge, publish, distribute, sublicense, and/or sell copies
34  * of the Software, and to permit persons to whom the Software is
35  * furnished to do so, subject to the following conditions:
36  *
37  * The above copyright notice and this permission notice shall be
38  * included in all copies or substantial portions of the Software.
39  *
40  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
41  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
42  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
43  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
44  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
45  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
46  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47  * SOFTWARE.
48  */
49
50 /** @file
51  *
52  * Preboot eXecution Environment (PXE) API
53  *
54  */
55
56 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
57
58 #include "pxe_types.h"
59
60 /** @addtogroup pxe Preboot eXecution Environment (PXE) API
61  *  @{
62  */
63
64 /** @defgroup pxe_api_call PXE entry points
65  *
66  * PXE entry points and calling conventions
67  *
68  *  @{
69  */
70
71 /** The PXENV+ structure */
72 struct s_PXENV {
73         /** Signature
74          *
75          * Contains the bytes 'P', 'X', 'E', 'N', 'V', '+'.
76          */
77         UINT8_t         Signature[6];
78         /** PXE API version
79          *
80          * MSB is major version number, LSB is minor version number.
81          * If the API version number is 0x0201 or greater, the !PXE
82          * structure pointed to by #PXEPtr should be used instead of
83          * this data structure.
84          */
85         UINT16_t        Version;
86         UINT8_t         Length;         /**< Length of this structure */
87         /** Checksum
88          *
89          * The byte checksum of this structure (using the length in
90          * #Length) must be zero.
91          */
92         UINT8_t         Checksum;
93         SEGOFF16_t      RMEntry;        /**< Real-mode PXENV+ entry point */
94         /** Protected-mode PXENV+ entry point offset
95          *
96          * PXE 2.1 deprecates this entry point.  For protected-mode
97          * API calls, use the !PXE structure pointed to by #PXEPtr
98          * instead.
99          */
100         UINT32_t        PMOffset;
101         /** Protected-mode PXENV+ entry point segment selector
102          *
103          * PXE 2.1 deprecates this entry point.  For protected-mode
104          * API calls, use the !PXE structure pointed to by #PXEPtr
105          * instead.
106          */
107         SEGSEL_t        PMSelector;
108         SEGSEL_t        StackSeg;       /**< Stack segment selector */
109         UINT16_t        StackSize;      /**< Stack segment size */
110         SEGSEL_t        BC_CodeSeg;     /**< Base-code code segment selector */
111         UINT16_t        BC_CodeSize;    /**< Base-code code segment size */
112         SEGSEL_t        BC_DataSeg;     /**< Base-code data segment selector */
113         UINT16_t        BC_DataSize;    /**< Base-code data segment size */
114         SEGSEL_t        UNDIDataSeg;    /**< UNDI data segment selector */
115         UINT16_t        UNDIDataSize;   /**< UNDI data segment size */
116         SEGSEL_t        UNDICodeSeg;    /**< UNDI code segment selector */
117         UINT16_t        UNDICodeSize;   /**< UNDI code segment size */
118         /** Address of the !PXE structure
119          *
120          * This field is present only if #Version is 0x0201 or
121          * greater.  If present, it points to a struct s_PXE.
122          */
123         SEGOFF16_t      PXEPtr;
124 } __attribute__ (( packed ));
125
126 typedef struct s_PXENV PXENV_t;
127
128 /** The !PXE structure */
129 struct s_PXE {
130         /** Signature
131          *
132          * Contains the bytes '!', 'P', 'X', 'E'.
133          */
134         UINT8_t         Signature[4];
135         UINT8_t         StructLength;   /**< Length of this structure */
136         /** Checksum
137          *
138          * The byte checksum of this structure (using the length in
139          * #StructLength) must be zero.
140          */
141         UINT8_t         StructCksum;
142         /** Revision of this structure
143          *
144          * For PXE version 2.1, this field must be zero.
145          */
146         UINT8_t         StructRev;
147         UINT8_t         reserved_1;     /**< Must be zero */
148         /** Address of the UNDI ROM ID structure
149          *
150          * This is a pointer to a struct s_UNDI_ROM_ID.
151          */
152         SEGOFF16_t      UNDIROMID;
153         /** Address of the Base Code ROM ID structure
154          *
155          * This is a pointer to a struct s_BC_ROM_ID.
156          */
157         SEGOFF16_t      BaseROMID;
158         /** 16-bit !PXE entry point
159          *
160          * This is the entry point for either real mode, or protected
161          * mode with a 16-bit stack segment.
162          */
163         SEGOFF16_t      EntryPointSP;
164         /** 32-bit !PXE entry point
165          *
166          * This is the entry point for protected mode with a 32-bit
167          * stack segment.
168          */
169         SEGOFF16_t      EntryPointESP;
170         /** Status call-out function
171          *
172          * @v 0         (if in a time-out loop)
173          * @v n         Number of a received TFTP packet
174          * @ret 0       Continue operation
175          * @ret 1       Cancel operation
176          *
177          * This function will be called whenever the PXE stack is in
178          * protected mode, is waiting for an event (e.g. a DHCP reply)
179          * and wishes to allow the user to cancel the operation.
180          * Parameters are passed in register %ax; the return value
181          * must also be placed in register %ax.  All other registers
182          * and flags @b must be preserved.
183          *
184          * In real mode, an internal function (that checks for a
185          * keypress) will be used.
186          *
187          * If this field is set to -1, no status call-out function
188          * will be used and consequently the user will not be allowed
189          * to interrupt operations.
190          *
191          * @note The PXE specification version 2.1 defines the
192          * StatusCallout field, mentions it 11 times, but nowhere
193          * defines what it actually does or how it gets called.
194          * Fortunately, the WfM specification version 1.1a deigns to
195          * inform us of such petty details.
196          */
197         SEGOFF16_t      StatusCallout;
198         UINT8_t         reserved_2;     /**< Must be zero */
199         /** Number of segment descriptors
200          *
201          * If this number is greater than 7, the remaining descriptors
202          * follow immediately after #BC_CodeWrite.
203          */
204         UINT8_t         SegDescCnt;
205         /** First protected-mode selector
206          *
207          * This is the segment selector value for the first segment
208          * assigned to PXE.  Protected-mode selectors must be
209          * consecutive, according to the PXE 2.1 specification, though
210          * no reason is given.  Each #SEGDESC_t includes a field for
211          * the segment selector, so this information is entirely
212          * redundant.
213          */
214         SEGSEL_t        FirstSelector;
215         /** Stack segment descriptor */
216         SEGDESC_t       Stack;
217         /** UNDI data segment descriptor */
218         SEGDESC_t       UNDIData;
219         /** UNDI code segment descriptor */
220         SEGDESC_t       UNDICode;
221         /** UNDI writable code segment descriptor */
222         SEGDESC_t       UNDICodeWrite;
223         /** Base-code data segment descriptor */
224         SEGDESC_t       BC_Data;
225         /** Base-code code segment descriptor */
226         SEGDESC_t       BC_Code;
227         /** Base-code writable code segment descriptor */
228         SEGDESC_t       BC_CodeWrite;
229 } __attribute__ (( packed ));
230
231 typedef struct s_PXE PXE_t;
232
233 /** @} */ /* pxe_api_call */
234
235 /** @defgroup pxe_preboot_api PXE Preboot API
236  *
237  * General high-level functions: #PXENV_UNLOAD_STACK, #PXENV_START_UNDI etc.
238  *
239  * @{
240  */
241
242 /** @defgroup pxenv_unload_stack PXENV_UNLOAD_STACK
243  *
244  *  UNLOAD BASE CODE STACK
245  *
246  *  @{
247  */
248
249 /** PXE API function code for pxenv_unload_stack() */
250 #define PXENV_UNLOAD_STACK              0x0070
251
252 /** Parameter block for pxenv_unload_stack() */
253 struct s_PXENV_UNLOAD_STACK {
254         PXENV_STATUS_t Status;                  /**< PXE status code */
255         UINT8_t reserved[10];                   /**< Must be zero */
256 } __attribute__ (( packed ));
257
258 typedef struct s_PXENV_UNLOAD_STACK PXENV_UNLOAD_STACK_t;
259
260 /** @} */ /* pxenv_unload_stack */
261
262 /** @defgroup pxenv_get_cached_info PXENV_GET_CACHED_INFO
263  *
264  *  GET CACHED INFO
265  *
266  *  @{
267  */
268
269 /** PXE API function code for pxenv_get_cached_info() */
270 #define PXENV_GET_CACHED_INFO           0x0071
271
272 /** The client's DHCPDISCOVER packet */
273 #define PXENV_PACKET_TYPE_DHCP_DISCOVER 1
274
275 /** The DHCP server's DHCPACK packet */
276 #define PXENV_PACKET_TYPE_DHCP_ACK      2
277
278 /** The Boot Server's Discover Reply packet
279  *
280  * This packet contains DHCP option 60 set to "PXEClient", a valid
281  * boot file name, and may or may not contain MTFTP options.
282  */
283 #define PXENV_PACKET_TYPE_CACHED_REPLY  3
284
285 /** Parameter block for pxenv_get_cached_info() */
286 struct s_PXENV_GET_CACHED_INFO {
287         PXENV_STATUS_t Status;                  /**< PXE status code */
288         /** Packet type.
289          *
290          * Valid values are #PXENV_PACKET_TYPE_DHCP_DISCOVER,
291          * #PXENV_PACKET_TYPE_DHCP_ACK or #PXENV_PACKET_TYPE_CACHED_REPLY
292          */
293         UINT16_t PacketType;
294         UINT16_t BufferSize;                    /**< Buffer size */
295         SEGOFF16_t Buffer;                      /**< Buffer address */
296         UINT16_t BufferLimit;                   /**< Maximum buffer size */
297 } __attribute__ (( packed ));
298
299 typedef struct s_PXENV_GET_CACHED_INFO PXENV_GET_CACHED_INFO_t;
300
301 #define BOOTP_REQ       1       /**< A BOOTP request packet */
302 #define BOOTP_REP       2       /**< A BOOTP reply packet */
303
304 /** DHCP broadcast flag
305  *
306  * Request a broadcast response (DHCPOFFER or DHCPACK) from the DHCP
307  * server.
308  */
309 #define BOOTP_BCAST     0x8000
310
311 #define VM_RFC1048      0x63825363L     /**< DHCP magic cookie */
312
313 /** Maximum length of DHCP options */
314 #define BOOTP_DHCPVEND  1024
315
316 /** Format of buffer filled in by pxenv_get_cached_info()
317  *
318  * This somewhat convoluted data structure simply describes the layout
319  * of a DHCP packet.  Refer to RFC2131 section 2 for a full
320  * description.
321  */
322 struct bootph {
323         /** Message opcode.
324          *
325          * Valid values are #BOOTP_REQ and #BOOTP_REP.
326          */
327         UINT8_t opcode;
328         /** NIC hardware type.
329          *
330          * Valid values are as for s_PXENV_UNDI_GET_INFORMATION::HwType.
331          */
332         UINT8_t Hardware;
333         UINT8_t Hardlen;                /**< MAC address length */
334         /** Gateway hops
335          *
336          * Zero in packets sent by the client.  May be non-zero in
337          * replies from the DHCP server, if the reply comes via a DHCP
338          * relay agent.
339          */
340         UINT8_t Gatehops;
341         UINT32_t ident;                 /**< DHCP transaction id (xid) */
342         /** Elapsed time
343          *
344          * Number of seconds since the client began the DHCP
345          * transaction.
346          */
347         UINT16_t seconds;
348         /** Flags
349          *
350          * This is the bitwise-OR of any of the following values:
351          * #BOOTP_BCAST.
352          */
353         UINT16_t Flags;
354         /** Client IP address
355          *
356          * Set only if the client already has an IP address.
357          */
358         IP4_t cip;
359         /** Your IP address
360          *
361          * This is the IP address that the server assigns to the
362          * client.
363          */
364         IP4_t yip;
365         /** Server IP address
366          *
367          * This is the IP address of the BOOTP/DHCP server.
368          */
369         IP4_t sip;
370         /** Gateway IP address
371          *
372          * This is the IP address of the BOOTP/DHCP relay agent, if
373          * any.  It is @b not (necessarily) the address of the default
374          * gateway for routing purposes.
375          */
376         IP4_t gip;
377         MAC_ADDR_t CAddr;               /**< Client MAC address */
378         UINT8_t Sname[64];              /**< Server host name */
379         UINT8_t bootfile[128];          /**< Boot file name */
380         /** DHCP options
381          *
382          * Don't ask.  Just laugh.  Then burn a copy of the PXE
383          * specification and send Intel an e-mail asking them if
384          * they've figured out what a "union" does in C yet.
385          */
386         union bootph_vendor {
387                 UINT8_t d[BOOTP_DHCPVEND]; /**< DHCP options */
388                 /** DHCP options */
389                 struct bootph_vendor_v {
390                         /** DHCP magic cookie
391                          *
392                          * Should have the value #VM_RFC1048.
393                          */
394                         UINT8_t magic[4];
395                         UINT32_t flags; /**< BOOTP flags/opcodes */
396                         /** "End of BOOTP vendor extensions"
397                          *
398                          * Abandon hope, all ye who consider the
399                          * purpose of this field.
400                          */
401                         UINT8_t pad[56];
402                 } v;
403         } vendor;
404 } __attribute__ (( packed ));
405
406 typedef struct bootph BOOTPLAYER_t;
407
408 /** @} */ /* pxenv_get_cached_info */
409
410 /** @defgroup pxenv_restart_tftp PXENV_RESTART_TFTP
411  *
412  *  RESTART TFTP
413  *
414  *  @{
415  */
416
417 /** PXE API function code for pxenv_restart_tftp() */
418 #define PXENV_RESTART_TFTP              0x0073
419
420 /** Parameter block for pxenv_restart_tftp() */
421 struct s_PXENV_TFTP_READ_FILE;
422
423 typedef struct s_PXENV_RESTART_TFTP PXENV_RESTART_TFTP_t;
424
425 /** @} */ /* pxenv_restart_tftp */
426
427 /** @defgroup pxenv_start_undi PXENV_START_UNDI
428  *
429  *  START UNDI
430  *
431  *  @{
432  */
433
434 /** PXE API function code for pxenv_start_undi() */
435 #define PXENV_START_UNDI                0x0000
436
437 /** Parameter block for pxenv_start_undi() */
438 struct s_PXENV_START_UNDI {
439         PXENV_STATUS_t Status;                  /**< PXE status code */
440         /** %ax register as passed to the Option ROM initialisation routine.
441          *
442          * For a PCI device, this should contain the bus:dev:fn value
443          * that uniquely identifies the PCI device in the system.  For
444          * a non-PCI device, this field is not defined.
445          */
446         UINT16_t AX;
447         /** %bx register as passed to the Option ROM initialisation routine.
448          *
449          * For an ISAPnP device, this should contain the Card Select
450          * Number assigned to the ISAPnP card.  For non-ISAPnP
451          * devices, this should contain 0xffff.
452          */
453         UINT16_t BX;
454         /** %dx register as passed to the Option ROM initialisation routine.
455          *
456          * For an ISAPnP device, this should contain the ISAPnP Read
457          * Port address as currently set in all ISAPnP cards.  If
458          * there are no ISAPnP cards, this should contain 0xffff.  (If
459          * this is a non-ISAPnP device, but there are ISAPnP cards in
460          * the system, this value is not well defined.)
461          */
462         UINT16_t DX;
463         /** %di register as passed to the Option ROM initialisation routine.
464          *
465          * This contains the #OFF16_t portion of a struct #s_SEGOFF16
466          * that points to the System BIOS Plug and Play Installation
467          * Check Structure.  (Refer to section 4.4 of the Plug and
468          * Play BIOS specification for a description of this
469          * structure.)
470          *
471          * @note The PXE specification defines the type of this field
472          * as #UINT16_t.  For x86, #OFF16_t and #UINT16_t are
473          * equivalent anyway; for other architectures #OFF16_t makes
474          * more sense.
475          */
476         OFF16_t DI;
477         /** %es register as passed to the Option ROM initialisation routine.
478          *
479          * This contains the #SEGSEL_t portion of a struct #s_SEGOFF16
480          * that points to the System BIOS Plug and Play Installation
481          * Check Structure.  (Refer to section 4.4 of the Plug and
482          * Play BIOS specification for a description of this
483          * structure.)
484          *
485          * @note The PXE specification defines the type of this field
486          * as #UINT16_t.  For x86, #SEGSEL_t and #UINT16_t are
487          * equivalent anyway; for other architectures #SEGSEL_t makes
488          * more sense.
489          */
490         SEGSEL_t ES;
491 } __attribute__ (( packed ));
492
493 typedef struct s_PXENV_START_UNDI PXENV_START_UNDI_t;
494
495 /** @} */ /* pxenv_start_undi */
496
497 /** @defgroup pxenv_stop_undi PXENV_STOP_UNDI
498  *
499  *  STOP UNDI
500  *
501  *  @{
502  */
503
504 /** PXE API function code for pxenv_stop_undi() */
505 #define PXENV_STOP_UNDI                 0x0015
506
507 /** Parameter block for pxenv_stop_undi() */
508 struct s_PXENV_STOP_UNDI {
509         PXENV_STATUS_t Status;                  /**< PXE status code */
510 } __attribute__ (( packed ));
511
512 typedef struct s_PXENV_STOP_UNDI PXENV_STOP_UNDI_t;
513
514 /** @} */ /* pxenv_stop_undi */
515
516 /** @defgroup pxenv_start_base PXENV_START_BASE
517  *
518  *  START BASE
519  *
520  *  @{
521  */
522
523 /** PXE API function code for pxenv_start_base() */
524 #define PXENV_START_BASE                0x0075
525
526 /** Parameter block for pxenv_start_base() */
527 struct s_PXENV_START_BASE {
528         PXENV_STATUS_t Status;                  /**< PXE status code */
529 } __attribute__ (( packed ));
530
531 typedef struct s_PXENV_START_BASE PXENV_START_BASE_t;
532
533 /** @} */ /* pxenv_start_base */
534
535 /** @defgroup pxenv_stop_base PXENV_STOP_BASE
536  *
537  *  STOP BASE
538  *
539  *  @{
540  */
541
542 /** PXE API function code for pxenv_stop_base() */
543 #define PXENV_STOP_BASE                 0x0076
544
545 /** Parameter block for pxenv_stop_base() */
546 struct s_PXENV_STOP_BASE {
547         PXENV_STATUS_t Status;                  /**< PXE status code */
548 } __attribute__ (( packed ));
549
550 typedef struct s_PXENV_STOP_BASE PXENV_STOP_BASE_t;
551
552 /** @} */ /* pxenv_stop_base */
553
554 /** @} */ /* pxe_preboot_api */
555
556 /** @defgroup pxe_tftp_api PXE TFTP API
557  *
558  * Download files via TFTP or MTFTP
559  *
560  * @{
561  */
562
563 /** @defgroup pxenv_tftp_open PXENV_TFTP_OPEN
564  *
565  *  TFTP OPEN
566  *
567  *  @{
568  */
569
570 /** PXE API function code for pxenv_tftp_open() */
571 #define PXENV_TFTP_OPEN                 0x0020
572
573 /** Parameter block for pxenv_tftp_open() */
574 struct s_PXENV_TFTP_OPEN {
575         PXENV_STATUS_t Status;                  /**< PXE status code */
576         IP4_t ServerIPAddress;                  /**< TFTP server IP address */
577         IP4_t GatewayIPAddress;                 /**< Relay agent IP address */
578         UINT8_t FileName[128];                  /**< File name */
579         UDP_PORT_t TFTPPort;                    /**< TFTP server UDP port */
580         /** Requested size of TFTP packets
581          *
582          * This is the TFTP "blksize" option.  This must be at least
583          * 512, since servers that do not support TFTP options cannot
584          * negotiate blocksizes smaller than this.
585          */
586         UINT16_t PacketSize;
587 } __attribute__ (( packed ));
588
589 typedef struct s_PXENV_TFTP_OPEN PXENV_TFTP_OPEN_t;
590
591 /** @} */ /* pxenv_tftp_open */
592
593 /** @defgroup pxenv_tftp_close PXENV_TFTP_CLOSE
594  *
595  *  TFTP CLOSE
596  *
597  *  @{
598  */
599
600 /** PXE API function code for pxenv_tftp_close() */
601 #define PXENV_TFTP_CLOSE                0x0021
602
603 /** Parameter block for pxenv_tftp_close() */
604 struct s_PXENV_TFTP_CLOSE {
605         PXENV_STATUS_t Status;                  /**< PXE status code */
606 } __attribute__ (( packed ));
607
608 typedef struct s_PXENV_TFTP_CLOSE PXENV_TFTP_CLOSE_t;
609
610 /** @} */ /* pxenv_tftp_close */
611
612 /** @defgroup pxenv_tftp_read PXENV_TFTP_READ
613  *
614  *  TFTP READ
615  *
616  *  @{
617  */
618
619 /** PXE API function code for pxenv_tftp_read() */
620 #define PXENV_TFTP_READ                 0x0022
621
622 /** Parameter block for pxenv_tftp_read() */
623 struct s_PXENV_TFTP_READ {
624         PXENV_STATUS_t Status;                  /**< PXE status code */
625         UINT16_t PacketNumber;                  /**< TFTP packet number */
626         UINT16_t BufferSize;                    /**< Size of data buffer */
627         SEGOFF16_t Buffer;                      /**< Address of data buffer */
628 } __attribute__ (( packed ));
629
630 typedef struct s_PXENV_TFTP_READ PXENV_TFTP_READ_t;
631
632 /** @} */ /* pxenv_tftp_read */
633
634 /** @defgroup pxenv_tftp_read_file PXENV_TFTP_READ_FILE
635  *
636  *  TFTP/MTFTP READ FILE
637  *
638  *  @{
639  */
640
641 /** PXE API function code for pxenv_tftp_read_file() */
642 #define PXENV_TFTP_READ_FILE            0x0023
643
644 /** Parameter block for pxenv_tftp_read_file() */
645 struct s_PXENV_TFTP_READ_FILE {
646         PXENV_STATUS_t Status;                  /**< PXE status code */
647         UINT8_t FileName[128];                  /**< File name */
648         UINT32_t BufferSize;                    /**< Size of data buffer */
649         ADDR32_t Buffer;                        /**< Address of data buffer */
650         IP4_t ServerIPAddress;                  /**< TFTP server IP address */
651         IP4_t GatewayIPAddress;                 /**< Relay agent IP address */
652         /** File multicast IP address */
653         IP4_t McastIPAddress;
654         /** Client multicast listening port */
655         UDP_PORT_t TFTPClntPort;
656         /** Server multicast listening port */
657         UDP_PORT_t TFTPSrvPort;
658         /** TFTP open timeout.
659          *
660          * This is the timeout for receiving the first DATA or ACK
661          * packets during the MTFTP Listen phase.
662          */
663         UINT16_t TFTPOpenTimeOut;
664         /** TFTP reopen timeout.
665          *
666          * This is the timeout for receiving an ACK packet while in
667          * the MTFTP Listen phase (when at least one ACK packet has
668          * already been seen).
669          */
670         UINT16_t TFTPReopenDelay;
671 } __attribute__ (( packed ));
672
673 typedef struct s_PXENV_TFTP_READ_FILE PXENV_TFTP_READ_FILE_t;
674
675 /** @} */ /* pxenv_tftp_read_file */
676
677 /** @defgroup pxenv_tftp_get_fsize PXENV_TFTP_GET_FSIZE
678  *
679  *  TFTP GET FILE SIZE
680  *
681  *  @{
682  */
683
684 /** PXE API function code for pxenv_tftp_get_fsize() */
685 #define PXENV_TFTP_GET_FSIZE            0x0025
686
687 /** Parameter block for pxenv_tftp_get_fsize() */
688 struct s_PXENV_TFTP_GET_FSIZE {
689         PXENV_STATUS_t Status;                  /**< PXE status code */
690         IP4_t ServerIPAddress;                  /**< TFTP server IP address */
691         IP4_t GatewayIPAddress;                 /**< Relay agent IP address */
692         UINT8_t FileName[128];                  /**< File name */
693         UINT32_t FileSize;                      /**< Size of the file */
694 } __attribute__ (( packed ));
695
696 typedef struct s_PXENV_TFTP_GET_FSIZE PXENV_TFTP_GET_FSIZE_t;
697
698 /** @} */ /* pxenv_tftp_get_fsize */
699
700 /** @} */ /* pxe_tftp_api */
701
702 /** @defgroup pxe_udp_api PXE UDP API
703  *
704  * Transmit and receive UDP packets
705  *
706  * @{
707  */
708
709 /** @defgroup pxenv_udp_open PXENV_UDP_OPEN
710  *
711  *  UDP OPEN
712  *
713  *  @{
714  */
715
716 /** PXE API function code for pxenv_udp_open() */
717 #define PXENV_UDP_OPEN                  0x0030
718
719 /** Parameter block for pxenv_udp_open() */
720 struct s_PXENV_UDP_OPEN {
721         PXENV_STATUS_t  Status;         /**< PXE status code */
722         IP4_t           src_ip;         /**< IP address of this station */
723 } __attribute__ (( packed ));
724
725 typedef struct s_PXENV_UDP_OPEN PXENV_UDP_OPEN_t;
726
727 /** @} */ /* pxenv_udp_open */
728
729 /** @defgroup pxenv_udp_close PXENV_UDP_CLOSE
730  *
731  *  UDP CLOSE
732  *
733  *  @{
734  */
735
736 /** PXE API function code for pxenv_udp_close() */
737 #define PXENV_UDP_CLOSE                 0x0031
738
739 /** Parameter block for pxenv_udp_close() */
740 struct s_PXENV_UDP_CLOSE {
741         PXENV_STATUS_t  Status;         /**< PXE status code */
742 } __attribute__ (( packed ));
743
744 typedef struct s_PXENV_UDP_CLOSE PXENV_UDP_CLOSE_t;
745
746 /** @} */ /* pxenv_udp_close */
747
748 /** @defgroup pxenv_udp_write PXENV_UDP_WRITE
749  *
750  *  UDP WRITE
751  *
752  *  @{
753  */
754
755 /** PXE API function code for pxenv_udp_write() */
756 #define PXENV_UDP_WRITE                 0x0033
757
758 /** Parameter block for pxenv_udp_write() */
759 struct s_PXENV_UDP_WRITE {
760         PXENV_STATUS_t  Status;         /**< PXE status code */
761         IP4_t           ip;             /**< Destination IP address */
762         IP4_t           gw;             /**< Relay agent IP address */
763         UDP_PORT_t      src_port;       /**< Source UDP port */
764         UDP_PORT_t      dst_port;       /**< Destination UDP port */
765         UINT16_t        buffer_size;    /**< UDP payload buffer size */
766         SEGOFF16_t      buffer;         /**< UDP payload buffer address */
767 } __attribute__ (( packed ));
768
769 typedef struct s_PXENV_UDP_WRITE PXENV_UDP_WRITE_t;
770
771 /** @} */ /* pxenv_udp_write */
772
773 /** @defgroup pxenv_udp_read PXENV_UDP_READ
774  *
775  *  UDP READ
776  *
777  *  @{
778  */
779
780 /** PXE API function code for pxenv_udp_read() */
781 #define PXENV_UDP_READ                  0x0032
782
783 /** Parameter block for pxenv_udp_read() */
784 struct s_PXENV_UDP_READ {
785         PXENV_STATUS_t  Status;         /**< PXE status code */
786         IP4_t           src_ip;         /**< Source IP address */
787         IP4_t           dest_ip;        /**< Destination IP address */
788         UDP_PORT_t      s_port;         /**< Source UDP port */
789         UDP_PORT_t      d_port;         /**< Destination UDP port */
790         UINT16_t        buffer_size;    /**< UDP payload buffer size */
791         SEGOFF16_t      buffer;         /**< UDP payload buffer address */
792 } __attribute__ (( packed ));
793
794 typedef struct s_PXENV_UDP_READ PXENV_UDP_READ_t;
795
796 /** @} */ /* pxenv_udp_read */
797
798 /** @} */ /* pxe_udp_api */
799
800 /** @defgroup pxe_undi_api PXE UNDI API
801  *
802  * Direct control of the network interface card
803  *
804  * @{
805  */
806
807 /** @defgroup pxenv_undi_startup PXENV_UNDI_STARTUP
808  *
809  *  UNDI STARTUP
810  *
811  *  @{
812  */
813
814 /** PXE API function code for pxenv_undi_startup() */
815 #define PXENV_UNDI_STARTUP              0x0001
816
817 #define PXENV_BUS_ISA           0       /**< ISA bus type */
818 #define PXENV_BUS_EISA          1       /**< EISA bus type */
819 #define PXENV_BUS_MCA           2       /**< MCA bus type */
820 #define PXENV_BUS_PCI           3       /**< PCI bus type */
821 #define PXENV_BUS_VESA          4       /**< VESA bus type */
822 #define PXENV_BUS_PCMCIA        5       /**< PCMCIA bus type */
823
824 /** Parameter block for pxenv_undi_startup() */
825 struct s_PXENV_UNDI_STARTUP {
826         PXENV_STATUS_t  Status;         /**< PXE status code */
827 } __attribute__ (( packed ));
828
829 typedef struct s_PXENV_UNDI_STARTUP PXENV_UNDI_STARTUP_t;
830
831 /** @} */ /* pxenv_undi_startup */
832
833 /** @defgroup pxenv_undi_cleanup PXENV_UNDI_CLEANUP
834  *
835  *  UNDI CLEANUP
836  *
837  *  @{
838  */
839
840 /** PXE API function code for pxenv_undi_cleanup() */
841 #define PXENV_UNDI_CLEANUP              0x0002
842
843 /** Parameter block for pxenv_undi_cleanup() */
844 struct s_PXENV_UNDI_CLEANUP {
845         PXENV_STATUS_t  Status;         /**< PXE status code */
846 } __attribute__ (( packed ));
847
848 typedef struct s_PXENV_UNDI_CLEANUP PXENV_UNDI_CLEANUP_t;
849
850 /** @} */ /* pxenv_undi_cleanup */
851
852 /** @defgroup pxenv_undi_initialize PXENV_UNDI_INITIALIZE
853  *
854  *  UNDI INITIALIZE
855  *
856  *  @{
857  */
858
859 /** PXE API function code for pxenv_undi_initialize() */
860 #define PXENV_UNDI_INITIALIZE           0x0003
861
862 /** Parameter block for pxenv_undi_initialize() */
863 struct s_PXENV_UNDI_INITIALIZE {
864         PXENV_STATUS_t  Status;         /**< PXE status code */
865         /** NDIS 2.0 configuration information, or NULL
866          *
867          * This is a pointer to the data structure returned by the
868          * NDIS 2.0 GetProtocolManagerInfo() API call.  The data
869          * structure is documented, in a rather haphazard way, in
870          * section 4-17 of the NDIS 2.0 specification.
871          */
872         ADDR32_t ProtocolIni;
873         UINT8_t reserved[8];            /**< Must be zero */
874 } __attribute__ (( packed ));
875
876 typedef struct s_PXENV_UNDI_INITIALIZE PXENV_UNDI_INITIALIZE_t;
877
878 /** @} */ /* pxenv_undi_initialize */
879
880 /** @defgroup pxenv_undi_reset_adapter PXENV_UNDI_RESET_ADAPTER
881  *
882  *  UNDI RESET ADAPTER
883  *
884  *  @{
885  */
886
887 /** PXE API function code for pxenv_undi_reset_adapter() */
888 #define PXENV_UNDI_RESET_ADAPTER        0x0004
889
890 /** Maximum number of multicast MAC addresses */
891 #define MAXNUM_MCADDR   8
892
893 /** List of multicast MAC addresses */
894 struct s_PXENV_UNDI_MCAST_ADDRESS {
895         /** Number of multicast MAC addresses */
896         UINT16_t MCastAddrCount;
897         /** List of up to #MAXNUM_MCADDR multicast MAC addresses */
898         MAC_ADDR_t McastAddr[MAXNUM_MCADDR];
899 } __attribute__ (( packed ));
900
901 typedef struct s_PXENV_UNDI_MCAST_ADDRESS PXENV_UNDI_MCAST_ADDRESS_t;
902
903 /** Parameter block for pxenv_undi_reset_adapter() */
904 struct s_PXENV_UNDI_RESET {
905         PXENV_STATUS_t  Status;         /**< PXE status code */
906         /** Multicast MAC addresses */
907         struct s_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf;
908 } __attribute__ (( packed ));
909
910 typedef struct s_PXENV_UNDI_RESET PXENV_UNDI_RESET_t;
911
912 /** @} */ /* pxenv_undi_reset_adapter */
913
914 /** @defgroup pxenv_undi_shutdown PXENV_UNDI_SHUTDOWN
915  *
916  *  UNDI SHUTDOWN
917  *
918  *  @{
919  */
920
921 /** PXE API function code for pxenv_undi_shutdown() */
922 #define PXENV_UNDI_SHUTDOWN             0x0005
923
924 /** Parameter block for pxenv_undi_shutdown() */
925 struct s_PXENV_UNDI_SHUTDOWN {
926         PXENV_STATUS_t  Status;         /**< PXE status code */
927 } __attribute__ (( packed ));
928
929 typedef struct s_PXENV_UNDI_SHUTDOWN PXENV_UNDI_SHUTDOWN_t;
930
931 /** @} */ /* pxenv_undi_shutdown */
932
933 /** @defgroup pxenv_undi_open PXENV_UNDI_OPEN
934  *
935  *  UNDI OPEN
936  *
937  *  @{
938  */
939
940 /** PXE API function code for pxenv_undi_open() */
941 #define PXENV_UNDI_OPEN                 0x0006
942
943 /** Accept "directed" packets
944  *
945  * These are packets addresses to either this adapter's MAC address or
946  * to any of the configured multicast MAC addresses (see
947  * #s_PXENV_UNDI_MCAST_ADDRESS).
948  */
949 #define FLTR_DIRECTED   0x0001
950 /** Accept broadcast packets */
951 #define FLTR_BRDCST     0x0002
952 /** Accept all packets; listen in promiscuous mode */
953 #define FLTR_PRMSCS     0x0004
954 /** Accept source-routed packets */
955 #define FLTR_SRC_RTG    0x0008
956
957 /** Parameter block for pxenv_undi_open() */
958 struct s_PXENV_UNDI_OPEN {
959         PXENV_STATUS_t  Status;         /**< PXE status code */
960         /** Open flags as defined in NDIS 2.0
961          *
962          * This is the OpenOptions field as passed to the NDIS 2.0
963          * OpenAdapter() API call.  It is defined to be "adapter
964          * specific", though 0 is guaranteed to be a valid value.
965          */
966         UINT16_t OpenFlag;
967         /** Receive packet filter
968          *
969          * This is the bitwise-OR of any of the following flags:
970          * #FLTR_DIRECTED, #FLTR_BRDCST, #FLTR_PRMSCS and
971          * #FLTR_SRC_RTG.
972          */
973         UINT16_t PktFilter;
974         /** Multicast MAC addresses */
975         struct s_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf;
976 } __attribute__ (( packed ));
977
978 typedef struct s_PXENV_UNDI_OPEN PXENV_UNDI_OPEN_t;
979
980 /** @} */ /* pxenv_undi_open */
981
982 /** @defgroup pxenv_undi_close PXENV_UNDI_CLOSE
983  *
984  *  UNDI CLOSE
985  *
986  *  @{
987  */
988
989 /** PXE API function code for pxenv_undi_close() */
990 #define PXENV_UNDI_CLOSE                0x0007
991
992 /** Parameter block for pxenv_undi_close() */
993 struct s_PXENV_UNDI_CLOSE {
994         PXENV_STATUS_t  Status;         /**< PXE status code */
995 } __attribute__ (( packed ));
996
997 typedef struct s_PXENV_UNDI_CLOSE PXENV_UNDI_CLOSE_t;
998
999 /** @} */ /* pxenv_undi_close */
1000
1001 /** @defgroup pxenv_undi_transmit PXENV_UNDI_TRANSMIT
1002  *
1003  *  UNDI TRANSMIT PACKET
1004  *
1005  *  @{
1006  */
1007
1008 /** PXE API function code for pxenv_undi_transmit() */
1009 #define PXENV_UNDI_TRANSMIT             0x0008
1010
1011 #define P_UNKNOWN       0               /**< Media header already filled in */
1012 #define P_IP            1               /**< IP protocol */
1013 #define P_ARP           2               /**< ARP protocol */
1014 #define P_RARP          3               /**< RARP protocol */
1015 #define P_OTHER         4               /**< Other protocol */
1016
1017 #define XMT_DESTADDR    0x0000          /**< Unicast packet */
1018 #define XMT_BROADCAST   0x0001          /**< Broadcast packet */
1019
1020 /** Maximum number of data blocks in a transmit buffer descriptor */
1021 #define MAX_DATA_BLKS   8
1022
1023 /** A transmit buffer descriptor, as pointed to by s_PXENV_UNDI_TRANSMIT::TBD
1024  */
1025 struct s_PXENV_UNDI_TBD {
1026         UINT16_t ImmedLength;           /**< Length of the transmit buffer */
1027         SEGOFF16_t Xmit;                /**< Address of the transmit buffer */
1028         UINT16_t DataBlkCount;
1029         /** Array of up to #MAX_DATA_BLKS additional transmit buffers */
1030         struct DataBlk {
1031                 /** Always 1
1032                  *
1033                  * A value of 0 would indicate that #TDDataPtr were an
1034                  * #ADDR32_t rather than a #SEGOFF16_t.  The PXE
1035                  * specification version 2.1 explicitly states that
1036                  * this is not supported; #TDDataPtr will always be a
1037                  * #SEGOFF16_t.
1038                  */
1039                 UINT8_t TDPtrType;
1040                 UINT8_t TDRsvdByte;     /**< Must be zero */
1041                 UINT16_t TDDataLen;     /**< Length of this transmit buffer */
1042                 SEGOFF16_t TDDataPtr;   /**< Address of this transmit buffer */
1043         } DataBlock[MAX_DATA_BLKS];
1044 } __attribute__ (( packed ));
1045
1046 typedef struct s_PXENV_UNDI_TBD PXENV_UNDI_TBD_t;
1047
1048 /** Parameter block for pxenv_undi_transmit() */
1049 struct s_PXENV_UNDI_TRANSMIT {
1050         PXENV_STATUS_t  Status;         /**< PXE status code */
1051         /** Protocol
1052          *
1053          * Valid values are #P_UNKNOWN, #P_IP, #P_ARP or #P_RARP.  If
1054          * the caller has already filled in the media header, this
1055          * field must be set to #P_UNKNOWN.
1056          */
1057         UINT8_t Protocol;
1058         /** Unicast/broadcast flag
1059          *
1060          * Valid values are #XMT_DESTADDR or #XMT_BROADCAST.
1061          */
1062         UINT8_t XmitFlag;
1063         SEGOFF16_t DestAddr;            /**< Destination MAC address */
1064         /** Address of the Transmit Buffer Descriptor
1065          *
1066          * This is a pointer to a struct s_PXENV_UNDI_TBD.
1067          */
1068         SEGOFF16_t TBD;
1069         UINT32_t Reserved[2];           /**< Must be zero */
1070 } __attribute__ (( packed ));
1071
1072 typedef struct s_PXENV_UNDI_TRANSMIT PXENV_UNDI_TRANSMIT_t;
1073
1074 /** @} */ /* pxenv_undi_transmit */
1075
1076 /** @defgroup pxenv_undi_set_mcast_address PXENV_UNDI_SET_MCAST_ADDRESS
1077  *
1078  *  UNDI SET MULTICAST ADDRESS
1079  *
1080  *  @{
1081  */
1082
1083 /** PXE API function code for pxenv_undi_set_mcast_address() */
1084 #define PXENV_UNDI_SET_MCAST_ADDRESS    0x0009
1085
1086 /** Parameter block for pxenv_undi_set_mcast_address() */
1087 struct s_PXENV_UNDI_SET_MCAST_ADDRESS {
1088         PXENV_STATUS_t  Status;         /**< PXE status code */
1089         /** List of multicast addresses */
1090         struct s_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf;
1091 } __attribute__ (( packed ));
1092
1093 typedef struct s_PXENV_UNDI_SET_MCAST_ADDRESS PXENV_UNDI_SET_MCAST_ADDRESS_t;
1094
1095 /** @} */ /* pxenv_undi_set_mcast_address */
1096
1097 /** @defgroup pxenv_undi_set_station_address PXENV_UNDI_SET_STATION_ADDRESS
1098  *
1099  *  UNDI SET STATION ADDRESS
1100  *
1101  *  @{
1102  */
1103
1104 /** PXE API function code for pxenv_undi_set_station_address() */
1105 #define PXENV_UNDI_SET_STATION_ADDRESS  0x000a
1106
1107 /** Parameter block for pxenv_undi_set_station_address() */
1108 struct s_PXENV_UNDI_SET_STATION_ADDRESS {
1109         PXENV_STATUS_t  Status;         /**< PXE status code */
1110         MAC_ADDR_t StationAddress;      /**< Station MAC address */
1111 } __attribute__ (( packed ));
1112
1113 typedef struct s_PXENV_UNDI_SET_STATION_ADDRESS PXENV_UNDI_SET_STATION_ADDRESS_t;
1114
1115 /** @} */ /* pxenv_undi_set_station_address */
1116
1117 /** @defgroup pxenv_undi_set_packet_filter PXENV_UNDI_SET_PACKET_FILTER
1118  *
1119  *  UNDI SET PACKET FILTER
1120  *
1121  *  @{
1122  */
1123
1124 /** PXE API function code for pxenv_undi_set_packet_filter() */
1125 #define PXENV_UNDI_SET_PACKET_FILTER    0x000b
1126
1127 /** Parameter block for pxenv_undi_set_packet_filter() */
1128 struct s_PXENV_UNDI_SET_PACKET_FILTER {
1129         PXENV_STATUS_t  Status;         /**< PXE status code */
1130         /** Receive packet filter
1131          *
1132          * This field takes the same values as
1133          * s_PXENV_UNDI_OPEN::PktFilter.
1134          *
1135          * @note Yes, this field is a different size to
1136          * s_PXENV_UNDI_OPEN::PktFilter.  Blame "the managers at Intel
1137          * who apparently let a consultant come up with the spec
1138          * without any kind of adult supervision" (quote from hpa).
1139          */
1140         UINT8_t filter;
1141 } __attribute__ (( packed ));
1142
1143 typedef struct s_PXENV_UNDI_SET_PACKET_FILTER PXENV_UNDI_SET_PACKET_FILTER_t;
1144
1145 /** @} */ /* pxenv_undi_set_packet_filter */
1146
1147 /** @defgroup pxenv_undi_get_information PXENV_UNDI_GET_INFORMATION
1148  *
1149  *  UNDI GET INFORMATION
1150  *
1151  *  @{
1152  */
1153
1154 /** PXE API function code for pxenv_undi_get_information() */
1155 #define PXENV_UNDI_GET_INFORMATION      0x000c
1156
1157 #define ETHER_TYPE              1       /**< Ethernet (10Mb) */
1158 #define EXP_ETHER_TYPE          2       /**< Experimental Ethernet (3Mb) */
1159 #define AX25_TYPE               3       /**< Amateur Radio AX.25 */
1160 #define TOKEN_RING_TYPE         4       /**< Proteon ProNET Token Ring */
1161 #define CHAOS_TYPE              5       /**< Chaos */
1162 #define IEEE_TYPE               6       /**< IEEE 802 Networks */
1163 #define ARCNET_TYPE             7       /**< ARCNET */
1164
1165 /** Parameter block for pxenv_undi_get_information() */
1166 struct s_PXENV_UNDI_GET_INFORMATION {
1167         PXENV_STATUS_t  Status;         /**< PXE status code */
1168         UINT16_t BaseIo;                /**< I/O base address */
1169         UINT16_t IntNumber;             /**< IRQ number */
1170         UINT16_t MaxTranUnit;           /**< Adapter MTU */
1171         /** Hardware type
1172          *
1173          * Valid values are defined in RFC1010 ("Assigned numbers"),
1174          * and are #ETHER_TYPE, #EXP_ETHER_TYPE, #AX25_TYPE,
1175          * #TOKEN_RING_TYPE, #CHAOS_TYPE, #IEEE_TYPE or #ARCNET_TYPE.
1176          */
1177         UINT16_t HwType;
1178         UINT16_t HwAddrLen;             /**< MAC address length */
1179         MAC_ADDR_t CurrentNodeAddress;  /**< Current MAC address */
1180         MAC_ADDR_t PermNodeAddress;     /**< Permanent (EEPROM) MAC address */
1181         SEGSEL_t ROMAddress;            /**< Real-mode ROM segment address */
1182         UINT16_t RxBufCt;               /**< Receive queue length */
1183         UINT16_t TxBufCt;               /**< Transmit queue length */
1184 } __attribute__ (( packed ));
1185
1186 typedef struct s_PXENV_UNDI_GET_INFORMATION PXENV_UNDI_GET_INFORMATION_t;
1187
1188 /** @} */ /* pxenv_undi_get_information */
1189
1190 /** @defgroup pxenv_undi_get_statistics PXENV_UNDI_GET_STATISTICS
1191  *
1192  *  UNDI GET STATISTICS
1193  *
1194  *  @{
1195  */
1196
1197 /** PXE API function code for pxenv_undi_get_statistics() */
1198 #define PXENV_UNDI_GET_STATISTICS       0x000d
1199
1200 /** Parameter block for pxenv_undi_get_statistics() */
1201 struct s_PXENV_UNDI_GET_STATISTICS {
1202         PXENV_STATUS_t  Status;         /**< PXE status code */
1203         UINT32_t XmtGoodFrames;         /**< Successful transmission count */
1204         UINT32_t RcvGoodFrames;         /**< Successful reception count */
1205         UINT32_t RcvCRCErrors;          /**< Receive CRC error count */
1206         UINT32_t RcvResourceErrors;     /**< Receive queue overflow count */
1207 } __attribute__ (( packed ));
1208
1209 typedef struct s_PXENV_UNDI_GET_STATISTICS PXENV_UNDI_GET_STATISTICS_t;
1210
1211 /** @} */ /* pxenv_undi_get_statistics */
1212
1213 /** @defgroup pxenv_undi_clear_statistics PXENV_UNDI_CLEAR_STATISTICS
1214  *
1215  *  UNDI CLEAR STATISTICS
1216  *
1217  *  @{
1218  */
1219
1220 /** PXE API function code for pxenv_undi_clear_statistics() */
1221 #define PXENV_UNDI_CLEAR_STATISTICS     0x000e
1222
1223 /** Parameter block for pxenv_undi_clear_statistics() */
1224 struct s_PXENV_UNDI_CLEAR_STATISTICS {
1225         PXENV_STATUS_t  Status;         /**< PXE status code */
1226 } __attribute__ (( packed ));
1227
1228 typedef struct s_PXENV_UNDI_CLEAR_STATISTICS PXENV_UNDI_CLEAR_STATISTICS_t;
1229
1230 /** @} */ /* pxenv_undi_clear_statistics */
1231
1232 /** @defgroup pxenv_undi_initiate_diags PXENV_UNDI_INITIATE_DIAGS
1233  *
1234  *  UNDI INITIATE DIAGS
1235  *
1236  *  @{
1237  */
1238
1239 /** PXE API function code for pxenv_undi_initiate_diags() */
1240 #define PXENV_UNDI_INITIATE_DIAGS       0x000f
1241
1242 /** Parameter block for pxenv_undi_initiate_diags() */
1243 struct s_PXENV_UNDI_INITIATE_DIAGS {
1244         PXENV_STATUS_t  Status;         /**< PXE status code */
1245 } __attribute__ (( packed ));
1246
1247 typedef struct s_PXENV_UNDI_INITIATE_DIAGS PXENV_UNDI_INITIATE_DIAGS_t;
1248
1249 /** @} */ /* pxenv_undi_initiate_diags */
1250
1251 /** @defgroup pxenv_undi_force_interrupt PXENV_UNDI_FORCE_INTERRUPT
1252  *
1253  *  UNDI FORCE INTERRUPT
1254  *
1255  *  @{
1256  */
1257
1258 /** PXE API function code for pxenv_undi_force_interrupt() */
1259 #define PXENV_UNDI_FORCE_INTERRUPT      0x0010
1260
1261 /** Parameter block for pxenv_undi_force_interrupt() */
1262 struct s_PXENV_UNDI_FORCE_INTERRUPT {
1263         PXENV_STATUS_t  Status;         /**< PXE status code */
1264 } __attribute__ (( packed ));
1265
1266 typedef struct s_PXENV_UNDI_FORCE_INTERRUPT PXENV_UNDI_FORCE_INTERRUPT_t;
1267
1268 /** @} */ /* pxenv_undi_force_interrupt */
1269
1270 /** @defgroup pxenv_undi_get_mcast_address PXENV_UNDI_GET_MCAST_ADDRESS
1271  *
1272  *  UNDI GET MULTICAST ADDRESS
1273  *
1274  *  @{
1275  */
1276
1277 /** PXE API function code for pxenv_undi_get_mcast_address() */
1278 #define PXENV_UNDI_GET_MCAST_ADDRESS    0x0011
1279
1280 /** Parameter block for pxenv_undi_get_mcast_address() */
1281 struct s_PXENV_UNDI_GET_MCAST_ADDRESS {
1282         PXENV_STATUS_t  Status;         /**< PXE status code */
1283         IP4_t InetAddr;                 /**< Multicast IP address */
1284         MAC_ADDR_t MediaAddr;           /**< Multicast MAC address */
1285 } __attribute__ (( packed ));
1286
1287 typedef struct s_PXENV_UNDI_GET_MCAST_ADDRESS PXENV_UNDI_GET_MCAST_ADDRESS_t;
1288
1289 /** @} */ /* pxenv_undi_get_mcast_address */
1290
1291 /** @defgroup pxenv_undi_get_nic_type PXENV_UNDI_GET_NIC_TYPE
1292  *
1293  *  UNDI GET NIC TYPE
1294  *
1295  *  @{
1296  */
1297
1298 /** PXE API function code for pxenv_undi_get_nic_type() */
1299 #define PXENV_UNDI_GET_NIC_TYPE         0x0012
1300
1301 #define PCI_NIC         2               /**< PCI network card */
1302 #define PnP_NIC         3               /**< ISAPnP network card */
1303 #define CardBus_NIC     4               /**< CardBus network card */
1304
1305 /** Information for a PCI or equivalent NIC */
1306 struct pci_nic_info {
1307         UINT16_t Vendor_ID;             /**< PCI vendor ID */
1308         UINT16_t Dev_ID;                /**< PCI device ID */
1309         UINT8_t Base_Class;             /**< PCI base class */
1310         UINT8_t Sub_Class;              /**< PCI sub class */
1311         UINT8_t Prog_Intf;              /**< PCI programming interface */
1312         UINT8_t Rev;                    /**< PCI revision */
1313         UINT16_t BusDevFunc;            /**< PCI bus:dev:fn address */
1314         UINT16_t SubVendor_ID;          /**< PCI subvendor ID */
1315         UINT16_t SubDevice_ID;          /**< PCI subdevice ID */
1316 } __attribute__ (( packed ));
1317  
1318 /** Information for an ISAPnP or equivalent NIC */
1319 struct pnp_nic_info {
1320         UINT32_t EISA_Dev_ID;           /**< EISA device ID */
1321         UINT8_t Base_Class;             /**< Base class */
1322         UINT8_t Sub_Class;              /**< Sub class */
1323         UINT8_t Prog_Intf;              /**< Programming interface */
1324         /** Card Select Number assigned to card */
1325         UINT16_t CardSelNum;
1326 } __attribute__ (( packed ));
1327
1328 /** Parameter block for pxenv_undi_get_nic_type() */
1329 struct s_PXENV_UNDI_GET_NIC_TYPE {
1330         PXENV_STATUS_t  Status;         /**< PXE status code */
1331         /** NIC type
1332          *
1333          * Valid values are #PCI_NIC, #PnP_NIC or #CardBus_NIC.
1334          */
1335         UINT8_t NicType;
1336         /** NIC information */
1337         union nic_type_info {
1338                 /** NIC information (if #NicType==#PCI_NIC) */
1339                 struct pci_nic_info pci;
1340                 /** NIC information (if #NicType==#CardBus_NIC) */
1341                 struct pci_nic_info cardbus;
1342                 /** NIC information (if #NicType==#PnP_NIC) */
1343                 struct pnp_nic_info pnp;
1344         } info;
1345 } __attribute__ (( packed ));
1346
1347 typedef struct s_PXENV_UNDI_GET_NIC_TYPE PXENV_UNDI_GET_NIC_TYPE_t;
1348
1349 /** @} */ /* pxenv_undi_get_nic_type */
1350
1351 /** @defgroup pxenv_undi_get_iface_info PXENV_UNDI_GET_IFACE_INFO
1352  *
1353  *  UNDI GET IFACE INFO
1354  *
1355  *  @{
1356  */
1357
1358 /** PXE API function code for pxenv_undi_get_iface_info() */
1359 #define PXENV_UNDI_GET_IFACE_INFO       0x0013
1360
1361 /** Broadcast supported */
1362 #define SUPPORTED_BROADCAST             0x0001
1363 /** Multicast supported */
1364 #define SUPPORTED_MULTICAST             0x0002
1365 /** Functional/group addressing supported */
1366 #define SUPPORTED_GROUP                 0x0004
1367 /** Promiscuous mode supported */
1368 #define SUPPORTED_PROMISCUOUS           0x0008
1369 /** Software settable station address */
1370 #define SUPPORTED_SET_STATION_ADDRESS   0x0010
1371 /** InitiateDiagnostics supported */
1372 #define SUPPORTED_DIAGNOSTICS           0x0040
1373 /** Reset MAC supported */
1374 #define SUPPORTED_RESET                 0x0400
1375 /** Open / Close Adapter supported */
1376 #define SUPPORTED_OPEN_CLOSE            0x0800
1377 /** Interrupt Request supported */
1378 #define SUPPORTED_IRQ                   0x1000
1379
1380 /** Parameter block for pxenv_undi_get_iface_info() */
1381 struct s_PXENV_UNDI_GET_IFACE_INFO {
1382         PXENV_STATUS_t  Status;         /**< PXE status code */
1383         /** Interface type
1384          *
1385          * This is defined in the NDIS 2.0 specification to be one of
1386          * the strings "802.3", "802.4", "802.5", "802.6", "DIX",
1387          * "DIX+802.3", "APPLETALK", "ARCNET", "FDDI", "SDLC", "BSC",
1388          * "HDLC", or "ISDN".
1389          *
1390          * "Normal" Ethernet, for various historical reasons, is
1391          * "DIX+802.3".
1392          */
1393         UINT8_t IfaceType[16];
1394         UINT32_t LinkSpeed;             /**< Link speed, in bits per second */
1395         /** Service flags
1396          *
1397          * These are the "service flags" defined in the "MAC
1398          * Service-Specific Characteristics" table in the NDIS 2.0
1399          * specification.  Almost all of them are irrelevant to PXE.
1400          */
1401         UINT32_t ServiceFlags;
1402         UINT32_t Reserved[4];           /**< Must be zero */
1403 } __attribute__ (( packed ));
1404
1405 typedef struct s_PXENV_UNDI_GET_IFACE_INFO PXENV_UNDI_GET_IFACE_INFO_t;
1406
1407 /** @} */ /* pxenv_undi_get_iface_info */
1408
1409 /** @defgroup pxenv_undi_get_state PXENV_UNDI_GET_STATE
1410  *
1411  *  UNDI GET STATE
1412  *
1413  *  @{
1414  */
1415
1416 /** PXE API function code for pxenv_undi_get_state() */
1417 #define PXENV_UNDI_GET_STATE            0x0015
1418
1419 /** pxenv_start_undi() has been called */
1420 #define PXE_UNDI_GET_STATE_STARTED      1
1421 /** pxenv_undi_initialize() has been called */
1422 #define PXE_UNDI_GET_STATE_INITIALIZED  2
1423 /** pxenv_undi_open() has been called */
1424 #define PXE_UNDI_GET_STATE_OPENED       3
1425
1426 /** Parameter block for pxenv_undi_get_state() */
1427 struct s_PXENV_UNDI_GET_STATE {
1428         PXENV_STATUS_t  Status;         /**< PXE status code */
1429         /** Current state of the UNDI driver
1430          *
1431          * Valid values are #PXE_UNDI_GET_STATE_STARTED,
1432          * #PXE_UNDI_GET_STATE_INITIALIZED or
1433          * #PXE_UNDI_GET_STATE_OPENED.
1434          */
1435         UINT8_t UNDIstate;
1436 } __attribute__ (( packed ));
1437
1438 typedef struct s_PXENV_UNDI_GET_STATE PXENV_UNDI_GET_STATE_t;
1439
1440 /** @} */ /* pxenv_undi_get_state */
1441
1442 /** @defgroup pxenv_undi_isr PXENV_UNDI_ISR
1443  *
1444  *  UNDI ISR
1445  *
1446  *  @{
1447  */
1448
1449 /** PXE API function code for pxenv_undi_isr() */
1450 #define PXENV_UNDI_ISR                  0x0014
1451
1452 /** Determine whether or not this is our interrupt */
1453 #define PXENV_UNDI_ISR_IN_START         1
1454 /** Start processing interrupt */
1455 #define PXENV_UNDI_ISR_IN_PROCESS       2
1456 /** Continue processing interrupt */
1457 #define PXENV_UNDI_ISR_IN_GET_NEXT      3
1458 /** This interrupt was ours */
1459 #define PXENV_UNDI_ISR_OUT_OURS         0
1460 /** This interrupt was not ours */
1461 #define PXENV_UNDI_ISR_OUT_NOT_OURS     1
1462 /** Finished processing interrupt */
1463 #define PXENV_UNDI_ISR_OUT_DONE         0
1464 /** A packet transmission has completed */
1465 #define PXENV_UNDI_ISR_OUT_TRANSMIT     2
1466 /** A packet has been received */
1467 #define PXENV_UNDI_ISR_OUT_RECEIVE      3
1468 /** We are already in the middle of processing an interrupt */
1469 #define PXENV_UNDI_ISR_OUT_BUSY         4
1470
1471 /** Unicast packet (or packet captured in promiscuous mode) */
1472 #define P_DIRECTED      0
1473 /** Broadcast packet */
1474 #define P_BROADCAST     1
1475 /** Multicast packet */
1476 #define P_MULTICAST     2
1477
1478 /** Parameter block for pxenv_undi_isr() */
1479 struct s_PXENV_UNDI_ISR {
1480         PXENV_STATUS_t  Status;         /**< PXE status code */
1481         /** Function flag
1482          *
1483          * Valid values are #PXENV_UNDI_ISR_IN_START,
1484          * #PXENV_UNDI_ISR_IN_PROCESS, #PXENV_UNDI_ISR_IN_GET_NEXT,
1485          * #PXENV_UNDI_ISR_OUT_OURS, #PXENV_UNDI_ISR_OUT_NOT_OURS,
1486          * #PXENV_UNDI_ISR_OUT_DONE, #PXENV_UNDI_ISR_OUT_TRANSMIT,
1487          * #PXENV_UNDI_ISR_OUT_RECEIVE or #PXENV_UNDI_ISR_OUT_BUSY.
1488          */
1489         UINT16_t FuncFlag;
1490         UINT16_t BufferLength;          /**< Data buffer length */
1491         UINT16_t FrameLength;           /**< Total frame length */
1492         UINT16_t FrameHeaderLength;     /**< Frame header length */
1493         SEGOFF16_t Frame;               /**< Data buffer address */
1494         /** Protocol type
1495          *
1496          * Valid values are #P_IP, #P_ARP, #P_RARP or #P_OTHER.
1497          */
1498         UINT8_t ProtType;
1499         /** Packet type
1500          *
1501          * Valid values are #P_DIRECTED, #P_BROADCAST or #P_MULTICAST.
1502          */
1503         UINT8_t PktType;
1504 } __attribute__ (( packed ));
1505
1506 typedef struct s_PXENV_UNDI_ISR PXENV_UNDI_ISR_t;
1507
1508 /** @} */ /* pxenv_undi_isr */
1509
1510 /** @} */ /* pxe_undi_api */
1511
1512 /** @defgroup pxe_file_api PXE FILE API
1513  *
1514  * POSIX-like file operations
1515  *
1516  * @{
1517  */
1518
1519 /** Minimum possible opcode used within PXE FILE API */
1520 #define PXENV_FILE_MIN 0x00e0
1521
1522 /** Minimum possible opcode used within PXE FILE API */
1523 #define PXENV_FILE_MAX 0x00ef
1524
1525 /** @defgroup pxenv_file_open PXENV_FILE_OPEN
1526  *
1527  * FILE OPEN
1528  *
1529  * @{
1530  */
1531
1532 /** PXE API function code for pxenv_file_open() */
1533 #define PXENV_FILE_OPEN                 0x00e0
1534
1535 /** Parameter block for pxenv_file_open() */
1536 struct s_PXENV_FILE_OPEN {
1537         PXENV_STATUS_t Status;          /**< PXE status code */
1538         UINT16_t FileHandle;            /**< File handle */
1539         SEGOFF16_t FileName;            /**< File URL */
1540         UINT32_t Reserved;              /**< Reserved */
1541 } __attribute__ (( packed ));
1542
1543 typedef struct s_PXENV_FILE_OPEN PXENV_FILE_OPEN_t;
1544
1545 /** @} */ /* pxenv_file_open */
1546
1547 /** @defgroup pxenv_file_close PXENV_FILE_CLOSE
1548  *
1549  * FILE CLOSE
1550  *
1551  * @{
1552  */
1553
1554 /** PXE API function code for pxenv_file_close() */
1555 #define PXENV_FILE_CLOSE                0x00e1
1556
1557 /** Parameter block for pxenv_file_close() */
1558 struct s_PXENV_FILE_CLOSE {
1559         PXENV_STATUS_t Status;          /**< PXE status code */
1560         UINT16_t FileHandle;            /**< File handle */
1561 } __attribute__ (( packed ));
1562
1563 typedef struct s_PXENV_FILE_CLOSE PXENV_FILE_CLOSE_t;
1564
1565 /** @} */ /* pxenv_file_close */
1566
1567 /** @defgroup pxenv_file_select PXENV_FILE_SELECT
1568  *
1569  * FILE SELECT
1570  *
1571  * @{
1572  */
1573
1574 /** PXE API function code for pxenv_file_select() */
1575 #define PXENV_FILE_SELECT               0x00e2
1576
1577 /** File is ready for reading */
1578 #define RDY_READ                        0x0001
1579
1580 /** Parameter block for pxenv_file_select() */
1581 struct s_PXENV_FILE_SELECT {
1582         PXENV_STATUS_t Status;          /**< PXE status code */
1583         UINT16_t FileHandle;            /**< File handle */
1584         UINT16_t Ready;                 /**< Indication of readiness */
1585 } __attribute__ (( packed ));
1586
1587 typedef struct s_PXENV_FILE_SELECT PXENV_FILE_SELECT_t;
1588
1589 /** @} */ /* pxenv_file_select */
1590
1591 /** @defgroup pxenv_file_read PXENV_FILE_READ
1592  *
1593  * FILE READ
1594  *
1595  * @{
1596  */
1597
1598 /** PXE API function code for pxenv_file_read() */
1599 #define PXENV_FILE_READ         0x00e3
1600
1601 /** Parameter block for pxenv_file_read() */
1602 struct s_PXENV_FILE_READ {
1603         PXENV_STATUS_t Status;          /**< PXE status code */
1604         UINT16_t FileHandle;            /**< File handle */
1605         UINT16_t BufferSize;            /**< Data buffer size */
1606         SEGOFF16_t Buffer;              /**< Data buffer */
1607 } __attribute__ (( packed ));
1608
1609 typedef struct s_PXENV_FILE_READ PXENV_FILE_READ_t;
1610
1611 /** @} */ /* pxenv_file_read */
1612
1613 /** @defgroup pxenv_get_file_size PXENV_GET_FILE_SIZE
1614  *
1615  * GET FILE SIZE
1616  *
1617  * @{
1618  */
1619
1620 /** PXE API function code for pxenv_get_file_size() */
1621 #define PXENV_GET_FILE_SIZE             0x00e4
1622
1623 /** Parameter block for pxenv_get_file_size() */
1624 struct s_PXENV_GET_FILE_SIZE {
1625         PXENV_STATUS_t Status;          /**< PXE status code */
1626         UINT16_t FileHandle;            /**< File handle */
1627         UINT32_t FileSize;              /**< File size */
1628 } __attribute__ (( packed ));
1629
1630 typedef struct s_PXENV_GET_FILE_SIZE PXENV_GET_FILE_SIZE_t;
1631
1632 /** @} */ /* pxenv_get_file_size */
1633
1634 /** @defgroup pxenv_file_exec PXENV_FILE_EXEC
1635  *
1636  * FILE EXEC
1637  *
1638  * @{
1639  */
1640
1641 /** PXE API function code for pxenv_file_exec() */
1642 #define PXENV_FILE_EXEC                 0x00e5
1643
1644 /** Parameter block for pxenv_file_exec() */
1645 struct s_PXENV_FILE_EXEC {
1646         PXENV_STATUS_t Status;          /**< PXE status code */
1647         SEGOFF16_t Command;             /**< Command to execute */
1648 } __attribute__ (( packed ));
1649
1650 typedef struct s_PXENV_FILE_EXEC PXENV_FILE_EXEC_t;
1651
1652 /** @} */ /* pxenv_file_exec */
1653
1654 /** @defgroup pxenv_file_api_check PXENV_FILE_API_CHECK
1655  *
1656  * FILE API CHECK
1657  *
1658  * @{
1659  */
1660
1661 /** PXE API function code for pxenv_file_api_check() */
1662 #define PXENV_FILE_API_CHECK            0x00e6
1663
1664 /** Parameter block for pxenv_file_api_check() */
1665 struct s_PXENV_FILE_API_CHECK {
1666         PXENV_STATUS_t Status;          /**< PXE status code */
1667         UINT16_t Size;                  /**< Size of structure  */
1668         UINT32_t Magic;                 /**< Magic number */
1669         UINT32_t Provider;              /**< Implementation identifier */
1670         UINT32_t APIMask;               /**< Supported API functions */
1671         UINT32_t Flags;                 /**< Reserved for the future */
1672 } __attribute__ (( packed ));
1673
1674 typedef struct s_PXENV_FILE_API_CHECK PXENV_FILE_API_CHECK_t;
1675
1676 /** @} */ /* pxenv_file_api_check */
1677
1678 /** @defgroup pxenv_file_exit_hook PXENV_FILE_EXIT_HOOK
1679  *
1680  * FILE EXIT HOOK
1681  *
1682  * @{
1683  */
1684
1685 /** PXE API function code for pxenv_file_exit_hook() */
1686 #define PXENV_FILE_EXIT_HOOK                    0x00e7
1687
1688 /** Parameter block for pxenv_file_exit_hook() */
1689 struct s_PXENV_FILE_EXIT_HOOK {
1690         PXENV_STATUS_t Status;          /**< PXE status code */
1691         SEGOFF16_t Hook;                /**< SEG16:OFF16 to jump to */
1692 } __attribute__ (( packed ));
1693
1694 typedef struct s_PXENV_FILE_EXIT_HOOK PXENV_FILE_EXIT_HOOK_t;
1695
1696 /** @} */ /* pxenv_file_exit_hook */
1697
1698 /** @defgroup pxenv_file_cmdline PXENV_FILE_CMDLINE
1699  *
1700  * FILE CMDLINE
1701  *
1702  * @{
1703  */
1704
1705 /** PXE API function code for pxenv_file_cmdline() */
1706 #define PXENV_FILE_CMDLINE                      0x00e8
1707
1708 /** Parameter block for pxenv_file_cmdline() */
1709 struct s_PXENV_FILE_CMDLINE {
1710         PXENV_STATUS_t Status;          /**< PXE status code */
1711         UINT16_t BufferSize;            /**< Data buffer size */
1712         SEGOFF16_t Buffer;              /**< Data buffer */
1713 } __attribute__ (( packed ));
1714
1715 typedef struct s_PXENV_FILE_CMDLINE PXENV_FILE_CMDLINE_t;
1716
1717 /** @} */ /* pxe_file_cmdline */
1718
1719 /** @} */ /* pxe_file_api */
1720
1721 /** @defgroup pxe_loader_api PXE Loader API
1722  *
1723  * The UNDI ROM loader API
1724  *
1725  * @{
1726  */
1727
1728 /** Parameter block for undi_loader() */
1729 struct s_UNDI_LOADER {
1730         /** PXE status code */
1731         PXENV_STATUS_t Status;
1732         /** %ax register as for PXENV_START_UNDI */
1733         UINT16_t AX;
1734         /** %bx register as for PXENV_START_UNDI */
1735         UINT16_t BX;
1736         /** %dx register as for PXENV_START_UNDI */
1737         UINT16_t DX;
1738         /** %di register as for PXENV_START_UNDI */
1739         OFF16_t DI;
1740         /** %es register as for PXENV_START_UNDI */
1741         SEGSEL_t ES;
1742         /** UNDI data segment
1743          *
1744          * @note The PXE specification defines the type of this field
1745          * as #UINT16_t.  For x86, #SEGSEL_t and #UINT16_t are
1746          * equivalent anyway; for other architectures #SEGSEL_t makes
1747          * more sense.
1748          */
1749         SEGSEL_t UNDI_DS;
1750         /** UNDI code segment
1751          *
1752          * @note The PXE specification defines the type of this field
1753          * as #UINT16_t.  For x86, #SEGSEL_t and #UINT16_t are
1754          * equivalent anyway; for other architectures #SEGSEL_t makes
1755          * more sense.
1756          */
1757         SEGSEL_t UNDI_CS;
1758         /** Address of the !PXE structure (a struct s_PXE) */
1759         SEGOFF16_t PXEptr;
1760         /** Address of the PXENV+ structure (a struct s_PXENV) */
1761         SEGOFF16_t PXENVptr;
1762 } __attribute__ (( packed ));
1763
1764 typedef struct s_UNDI_LOADER UNDI_LOADER_t;
1765
1766 /** @} */ /* pxe_loader_api */
1767
1768 /** @} */ /* pxe */
1769
1770 /** @page pxe_notes Etherboot PXE implementation notes
1771
1772 @section pxe_routing IP routing
1773
1774 Several PXE API calls (e.g. pxenv_tftp_open() and pxenv_udp_write())
1775 allow for the caller to specify a "relay agent IP address", often in a
1776 field called "gateway" or similar.  The PXE specification states that
1777 "The IP layer should provide space for a minimum of four routing
1778 entries obtained from the default router and static route DHCP option
1779 tags in the DHCPACK message, plus any non-zero giaddr field from the
1780 DHCPOFFER message(s) accepted by the client".
1781
1782 The DHCP static route option ("option static-routes" in dhcpd.conf)
1783 works only for classed IP routing (i.e. it provides no way to specify
1784 a subnet mask).  Since virtually everything now uses classless IP
1785 routing, the DHCP static route option is almost totally useless, and
1786 is (according to the dhcp-options man page) not implemented by any of
1787 the popular DHCP clients.
1788
1789 This leaves the caller-specified "relay agent IP address", the giaddr
1790 field from the DHCPOFFER message(s) and the default gateway(s)
1791 provided via the routers option ("option routers" in dhcpd.conf) in
1792 the DHCPACK message.  Each of these is a default gateway address.
1793 It's a fair bet that the routers option should take priority over the
1794 giaddr field, since the routers option has to be explicitly specified
1795 by the DHCP server operator.  Similarly, it's fair to assume that the
1796 caller-specified "relay agent IP address", if present, should take
1797 priority over any other routing table entries.
1798
1799 @bug Etherboot currently ignores all potential sources of routing
1800 information other than the first router provided to it by a DHCP
1801 routers option.
1802
1803 @section pxe_x86_modes x86 processor mode restrictions
1804
1805 On the x86 platform, different PXE API calls have different
1806 restrictions on the processor modes (real or protected) that can be
1807 used.  See the individual API call descriptions for the restrictions
1808 that apply to any particular call.
1809
1810 @subsection pxe_x86_pmode16 Real mode, or protected-mode with 16-bit stack
1811
1812 The PXE specification states that the API function can be called in
1813 protected mode only if the s_PXE::StatusCallout field is set to a
1814 non-zero value, and that the API function cannot be called with a
1815 32-bit stack segment.
1816
1817 Etherboot does not enforce either of these restrictions; they seem (as
1818 with so much of the PXE specification) to be artifacts of the Intel
1819 implementation.
1820
1821 */
1822
1823 #endif /* PXE_API_H */