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