iPXE
pxe_api.h
Go to the documentation of this file.
1#ifndef PXE_API_H
2#define PXE_API_H
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 */
56FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
57
58#include "pxe_types.h"
59
60/** @addtogroup pxe Preboot eXecution Environment (PXE) API
61 * @{
62 */
64/** @defgroup pxe_api_call PXE entry points
65 *
66 * PXE entry points and calling conventions
67 *
68 * @{
69 */
70
71/** The PXENV+ structure */
72struct s_PXENV {
73 /** Signature
74 *
75 * Contains the bytes 'P', 'X', 'E', 'N', 'V', '+'.
76 */
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 */
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 */
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 */
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 */
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
126typedef struct s_PXENV PXENV_t;
127
128/** The !PXE structure */
129struct s_PXE {
130 /** Signature
131 *
132 * Contains the bytes '!', 'P', 'X', 'E'.
133 */
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 */
142 /** Revision of this structure
143 *
144 * For PXE version 2.1, this field must be zero.
145 */
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 */
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 */
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
231typedef 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() */
254 PXENV_STATUS_t Status; /**< PXE status code */
255 UINT8_t reserved[10]; /**< Must be zero */
256} __attribute__ (( packed ));
257
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() */
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 */
294 UINT16_t BufferSize; /**< Buffer size */
295 SEGOFF16_t Buffer; /**< Buffer address */
296 UINT16_t BufferLimit; /**< Maximum buffer size */
297} __attribute__ (( packed ));
298
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 */
322struct bootph {
323 /** Message opcode.
324 *
325 * Valid values are #BOOTP_REQ and #BOOTP_REP.
326 */
328 /** NIC hardware type.
329 *
330 * Valid values are as for s_PXENV_UNDI_GET_INFORMATION::HwType.
331 */
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 */
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 */
348 /** Flags
349 *
350 * This is the bitwise-OR of any of the following values:
351 * #BOOTP_BCAST.
352 */
354 /** Client IP address
355 *
356 * Set only if the client already has an IP address.
357 */
359 /** Your IP address
360 *
361 * This is the IP address that the server assigns to the
362 * client.
363 */
365 /** Server IP address
366 *
367 * This is the IP address of the BOOTP/DHCP server.
368 */
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 */
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 */
387 UINT8_t d[BOOTP_DHCPVEND]; /**< DHCP options */
388 /** DHCP options */
390 /** DHCP magic cookie
391 *
392 * Should have the value #VM_RFC1048.
393 */
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 */
402 } v;
404} __attribute__ (( packed ));
405
406typedef 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() */
422
423typedef 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() */
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 */
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 */
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 */
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 */
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 */
491} __attribute__ (( packed ));
492
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() */
509 PXENV_STATUS_t Status; /**< PXE status code */
510} __attribute__ (( packed ));
511
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() */
528 PXENV_STATUS_t Status; /**< PXE status code */
529} __attribute__ (( packed ));
530
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() */
547 PXENV_STATUS_t Status; /**< PXE status code */
548} __attribute__ (( packed ));
549
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() */
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 */
587} __attribute__ (( packed ));
588
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() */
605 PXENV_STATUS_t Status; /**< PXE status code */
606} __attribute__ (( packed ));
607
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() */
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
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() */
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 */
654 /** Client multicast listening port */
656 /** Server multicast listening port */
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 */
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 */
671} __attribute__ (( packed ));
672
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() */
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
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() */
721 PXENV_STATUS_t Status; /**< PXE status code */
722 IP4_t src_ip; /**< IP address of this station */
723} __attribute__ (( packed ));
724
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() */
741 PXENV_STATUS_t Status; /**< PXE status code */
742} __attribute__ (( packed ));
743
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() */
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
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() */
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
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() */
826 PXENV_STATUS_t Status; /**< PXE status code */
827} __attribute__ (( packed ));
828
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() */
845 PXENV_STATUS_t Status; /**< PXE status code */
846} __attribute__ (( packed ));
847
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() */
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 */
873 UINT8_t reserved[8]; /**< Must be zero */
874} __attribute__ (( packed ));
875
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 */
895 /** Number of multicast MAC addresses */
897 /** List of up to #MAXNUM_MCADDR multicast MAC addresses */
899} __attribute__ (( packed ));
900
902
903/** Parameter block for pxenv_undi_reset_adapter() */
905 PXENV_STATUS_t Status; /**< PXE status code */
906 /** Multicast MAC addresses */
908} __attribute__ (( packed ));
909
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() */
926 PXENV_STATUS_t Status; /**< PXE status code */
927} __attribute__ (( packed ));
928
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() */
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 */
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 */
974 /** Multicast MAC addresses */
976} __attribute__ (( packed ));
977
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() */
994 PXENV_STATUS_t Status; /**< PXE status code */
995} __attribute__ (( packed ));
996
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 */
1026 UINT16_t ImmedLength; /**< Length of the transmit buffer */
1027 SEGOFF16_t Xmit; /**< Address of the transmit buffer */
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 */
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 */
1044} __attribute__ (( packed ));
1045
1047
1048/** Parameter block for 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 */
1058 /** Unicast/broadcast flag
1059 *
1060 * Valid values are #XMT_DESTADDR or #XMT_BROADCAST.
1061 */
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
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() */
1088 PXENV_STATUS_t Status; /**< PXE status code */
1089 /** List of multicast addresses */
1091} __attribute__ (( packed ));
1092
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() */
1109 PXENV_STATUS_t Status; /**< PXE status code */
1110 MAC_ADDR_t StationAddress; /**< Station MAC address */
1111} __attribute__ (( packed ));
1112
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() */
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 */
1141} __attribute__ (( packed ));
1142
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() */
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 */
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
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() */
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
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() */
1225 PXENV_STATUS_t Status; /**< PXE status code */
1226} __attribute__ (( packed ));
1227
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() */
1244 PXENV_STATUS_t Status; /**< PXE status code */
1245} __attribute__ (( packed ));
1246
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() */
1263 PXENV_STATUS_t Status; /**< PXE status code */
1264} __attribute__ (( packed ));
1265
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() */
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
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 */
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 */
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 */
1326} __attribute__ (( packed ));
1327
1328/** Parameter block for 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 */
1336 /** NIC information */
1338 /** NIC information (if #NicType==#PCI_NIC) */
1340 /** NIC information (if #NicType==#CardBus_NIC) */
1342 /** NIC information (if #NicType==#PnP_NIC) */
1345} __attribute__ (( packed ));
1346
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() */
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 */
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 */
1402 UINT32_t Reserved[4]; /**< Must be zero */
1403} __attribute__ (( packed ));
1404
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() */
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 */
1436} __attribute__ (( packed ));
1437
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() */
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 */
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 */
1499 /** Packet type
1500 *
1501 * Valid values are #P_DIRECTED, #P_BROADCAST or #P_MULTICAST.
1502 */
1504} __attribute__ (( packed ));
1505
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() */
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
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() */
1559 PXENV_STATUS_t Status; /**< PXE status code */
1560 UINT16_t FileHandle; /**< File handle */
1561} __attribute__ (( packed ));
1562
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() */
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
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() */
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
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() */
1625 PXENV_STATUS_t Status; /**< PXE status code */
1626 UINT16_t FileHandle; /**< File handle */
1627 UINT32_t FileSize; /**< File size */
1628} __attribute__ (( packed ));
1629
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() */
1646 PXENV_STATUS_t Status; /**< PXE status code */
1647 SEGOFF16_t Command; /**< Command to execute */
1648} __attribute__ (( packed ));
1649
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() */
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
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() */
1690 PXENV_STATUS_t Status; /**< PXE status code */
1691 SEGOFF16_t Hook; /**< SEG16:OFF16 to jump to */
1692} __attribute__ (( packed ));
1693
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() */
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
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() */
1730 /** PXE status code */
1732 /** %ax register as for PXENV_START_UNDI */
1734 /** %bx register as for PXENV_START_UNDI */
1736 /** %dx register as for PXENV_START_UNDI */
1738 /** %di register as for PXENV_START_UNDI */
1740 /** %es register as for PXENV_START_UNDI */
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 */
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 */
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
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
1774Several PXE API calls (e.g. pxenv_tftp_open() and pxenv_udp_write())
1775allow for the caller to specify a "relay agent IP address", often in a
1776field called "gateway" or similar. The PXE specification states that
1777"The IP layer should provide space for a minimum of four routing
1778entries obtained from the default router and static route DHCP option
1779tags in the DHCPACK message, plus any non-zero giaddr field from the
1780DHCPOFFER message(s) accepted by the client".
1781
1782The DHCP static route option ("option static-routes" in dhcpd.conf)
1783works only for classed IP routing (i.e. it provides no way to specify
1784a subnet mask). Since virtually everything now uses classless IP
1785routing, the DHCP static route option is almost totally useless, and
1786is (according to the dhcp-options man page) not implemented by any of
1787the popular DHCP clients.
1788
1789This leaves the caller-specified "relay agent IP address", the giaddr
1790field from the DHCPOFFER message(s) and the default gateway(s)
1791provided via the routers option ("option routers" in dhcpd.conf) in
1792the DHCPACK message. Each of these is a default gateway address.
1793It's a fair bet that the routers option should take priority over the
1794giaddr field, since the routers option has to be explicitly specified
1795by the DHCP server operator. Similarly, it's fair to assume that the
1796caller-specified "relay agent IP address", if present, should take
1797priority over any other routing table entries.
1798
1799@bug Etherboot currently ignores all potential sources of routing
1800information other than the first router provided to it by a DHCP
1801routers option.
1802
1803@section pxe_x86_modes x86 processor mode restrictions
1804
1805On the x86 platform, different PXE API calls have different
1806restrictions on the processor modes (real or protected) that can be
1807used. See the individual API call descriptions for the restrictions
1808that apply to any particular call.
1809
1810@subsection pxe_x86_pmode16 Real mode, or protected-mode with 16-bit stack
1811
1812The PXE specification states that the API function can be called in
1813protected mode only if the s_PXE::StatusCallout field is set to a
1814non-zero value, and that the API function cannot be called with a
181532-bit stack segment.
1816
1817Etherboot does not enforce either of these restrictions; they seem (as
1818with so much of the PXE specification) to be artifacts of the Intel
1819implementation.
1820
1821*/
1822
1823#endif /* PXE_API_H */
u32 info
Definition ar9003_mac.h:0
static unsigned short vendor
Definition davicom.c:128
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
struct s_PXE PXE_t
Definition pxe_api.h:231
struct s_PXENV PXENV_t
Definition pxe_api.h:126
struct s_UNDI_LOADER UNDI_LOADER_t
Definition pxe_api.h:1764
UINT16_t OFF16_t
An offset within a segment identified by SEGSEL.
Definition pxe_types.h:102
uint32_t UINT32_t
A 32-bit unsigned integer.
Definition pxe_types.h:37
uint8_t UINT8_t
An 8-bit unsigned integer.
Definition pxe_types.h:31
UINT32_t IP4_t
An IPv4 address.
Definition pxe_types.h:60
UINT16_t UDP_PORT_t
A UDP port.
Definition pxe_types.h:67
UINT16_t PXENV_STATUS_t
A PXE status code.
Definition pxe_types.h:53
uint16_t UINT16_t
A 16-bit unsigned integer.
Definition pxe_types.h:34
UINT32_t ADDR32_t
A physical address.
Definition pxe_types.h:82
UINT16_t SEGSEL_t
A segment selector.
Definition pxe_types.h:93
UINT8_t MAC_ADDR_t[MAC_ADDR_LEN]
A MAC address.
Definition pxe_types.h:73
struct s_PXENV_FILE_API_CHECK PXENV_FILE_API_CHECK_t
Definition pxe_api.h:1674
struct s_PXENV_FILE_CLOSE PXENV_FILE_CLOSE_t
Definition pxe_api.h:1563
struct s_PXENV_FILE_CMDLINE PXENV_FILE_CMDLINE_t
Definition pxe_api.h:1715
struct s_PXENV_FILE_EXEC PXENV_FILE_EXEC_t
Definition pxe_api.h:1650
struct s_PXENV_FILE_EXIT_HOOK PXENV_FILE_EXIT_HOOK_t
Definition pxe_api.h:1694
struct s_PXENV_FILE_OPEN PXENV_FILE_OPEN_t
Definition pxe_api.h:1543
struct s_PXENV_FILE_READ PXENV_FILE_READ_t
Definition pxe_api.h:1609
struct s_PXENV_FILE_SELECT PXENV_FILE_SELECT_t
Definition pxe_api.h:1587
struct bootph BOOTPLAYER_t
Definition pxe_api.h:406
#define BOOTP_DHCPVEND
Maximum length of DHCP options.
Definition pxe_api.h:314
struct s_PXENV_GET_CACHED_INFO PXENV_GET_CACHED_INFO_t
Definition pxe_api.h:299
struct s_PXENV_GET_FILE_SIZE PXENV_GET_FILE_SIZE_t
Definition pxe_api.h:1630
struct s_PXENV_RESTART_TFTP PXENV_RESTART_TFTP_t
Definition pxe_api.h:423
struct s_PXENV_START_BASE PXENV_START_BASE_t
Definition pxe_api.h:531
struct s_PXENV_START_UNDI PXENV_START_UNDI_t
Definition pxe_api.h:493
struct s_PXENV_STOP_BASE PXENV_STOP_BASE_t
Definition pxe_api.h:550
struct s_PXENV_STOP_UNDI PXENV_STOP_UNDI_t
Definition pxe_api.h:512
struct s_PXENV_TFTP_CLOSE PXENV_TFTP_CLOSE_t
Definition pxe_api.h:608
struct s_PXENV_TFTP_GET_FSIZE PXENV_TFTP_GET_FSIZE_t
Definition pxe_api.h:696
struct s_PXENV_TFTP_OPEN PXENV_TFTP_OPEN_t
Definition pxe_api.h:589
struct s_PXENV_TFTP_READ_FILE PXENV_TFTP_READ_FILE_t
Definition pxe_api.h:673
struct s_PXENV_TFTP_READ PXENV_TFTP_READ_t
Definition pxe_api.h:630
struct s_PXENV_UDP_CLOSE PXENV_UDP_CLOSE_t
Definition pxe_api.h:744
struct s_PXENV_UDP_OPEN PXENV_UDP_OPEN_t
Definition pxe_api.h:725
struct s_PXENV_UDP_READ PXENV_UDP_READ_t
Definition pxe_api.h:794
struct s_PXENV_UDP_WRITE PXENV_UDP_WRITE_t
Definition pxe_api.h:769
struct s_PXENV_UNDI_CLEANUP PXENV_UNDI_CLEANUP_t
Definition pxe_api.h:848
struct s_PXENV_UNDI_CLEAR_STATISTICS PXENV_UNDI_CLEAR_STATISTICS_t
Definition pxe_api.h:1228
struct s_PXENV_UNDI_CLOSE PXENV_UNDI_CLOSE_t
Definition pxe_api.h:997
struct s_PXENV_UNDI_FORCE_INTERRUPT PXENV_UNDI_FORCE_INTERRUPT_t
Definition pxe_api.h:1266
struct s_PXENV_UNDI_GET_IFACE_INFO PXENV_UNDI_GET_IFACE_INFO_t
Definition pxe_api.h:1405
struct s_PXENV_UNDI_GET_INFORMATION PXENV_UNDI_GET_INFORMATION_t
Definition pxe_api.h:1186
struct s_PXENV_UNDI_GET_MCAST_ADDRESS PXENV_UNDI_GET_MCAST_ADDRESS_t
Definition pxe_api.h:1287
struct s_PXENV_UNDI_GET_NIC_TYPE PXENV_UNDI_GET_NIC_TYPE_t
Definition pxe_api.h:1347
struct s_PXENV_UNDI_GET_STATE PXENV_UNDI_GET_STATE_t
Definition pxe_api.h:1438
struct s_PXENV_UNDI_GET_STATISTICS PXENV_UNDI_GET_STATISTICS_t
Definition pxe_api.h:1209
struct s_PXENV_UNDI_INITIALIZE PXENV_UNDI_INITIALIZE_t
Definition pxe_api.h:876
struct s_PXENV_UNDI_INITIATE_DIAGS PXENV_UNDI_INITIATE_DIAGS_t
Definition pxe_api.h:1247
struct s_PXENV_UNDI_ISR PXENV_UNDI_ISR_t
Definition pxe_api.h:1506
struct s_PXENV_UNDI_OPEN PXENV_UNDI_OPEN_t
Definition pxe_api.h:978
struct s_PXENV_UNDI_RESET PXENV_UNDI_RESET_t
Definition pxe_api.h:910
#define MAXNUM_MCADDR
Maximum number of multicast MAC addresses.
Definition pxe_api.h:891
struct s_PXENV_UNDI_MCAST_ADDRESS PXENV_UNDI_MCAST_ADDRESS_t
Definition pxe_api.h:901
struct s_PXENV_UNDI_SET_MCAST_ADDRESS PXENV_UNDI_SET_MCAST_ADDRESS_t
Definition pxe_api.h:1093
struct s_PXENV_UNDI_SET_PACKET_FILTER PXENV_UNDI_SET_PACKET_FILTER_t
Definition pxe_api.h:1143
struct s_PXENV_UNDI_SET_STATION_ADDRESS PXENV_UNDI_SET_STATION_ADDRESS_t
Definition pxe_api.h:1113
struct s_PXENV_UNDI_SHUTDOWN PXENV_UNDI_SHUTDOWN_t
Definition pxe_api.h:929
struct s_PXENV_UNDI_STARTUP PXENV_UNDI_STARTUP_t
Definition pxe_api.h:829
struct s_PXENV_UNDI_TBD PXENV_UNDI_TBD_t
Definition pxe_api.h:1046
struct s_PXENV_UNDI_TRANSMIT PXENV_UNDI_TRANSMIT_t
Definition pxe_api.h:1072
#define MAX_DATA_BLKS
Maximum number of data blocks in a transmit buffer descriptor.
Definition pxe_api.h:1021
struct s_PXENV_UNLOAD_STACK PXENV_UNLOAD_STACK_t
Definition pxe_api.h:258
#define __attribute__(x)
Definition compiler.h:10
struct DataBlk DataBlock[MAX_DATA_BLKS]
PXE data types.
UINT8_t pad[56]
"End of BOOTP vendor extensions"
Definition pxe_api.h:401
UINT8_t magic[4]
DHCP magic cookie.
Definition pxe_api.h:394
UINT32_t flags
BOOTP flags/opcodes.
Definition pxe_api.h:395
Format of buffer filled in by pxenv_get_cached_info()
Definition pxe_api.h:322
UINT8_t Hardware
NIC hardware type.
Definition pxe_api.h:332
IP4_t cip
Client IP address.
Definition pxe_api.h:358
UINT8_t Sname[64]
Server host name.
Definition pxe_api.h:378
UINT16_t Flags
Flags.
Definition pxe_api.h:353
IP4_t gip
Gateway IP address.
Definition pxe_api.h:376
IP4_t sip
Server IP address.
Definition pxe_api.h:369
UINT16_t seconds
Elapsed time.
Definition pxe_api.h:347
IP4_t yip
Your IP address.
Definition pxe_api.h:364
UINT8_t Gatehops
Gateway hops.
Definition pxe_api.h:340
UINT8_t Hardlen
MAC address length.
Definition pxe_api.h:333
MAC_ADDR_t CAddr
Client MAC address.
Definition pxe_api.h:377
UINT8_t bootfile[128]
Boot file name.
Definition pxe_api.h:379
UINT32_t ident
DHCP transaction id (xid)
Definition pxe_api.h:341
UINT8_t opcode
Message opcode.
Definition pxe_api.h:327
Information for a PCI or equivalent NIC.
Definition pxe_api.h:1306
UINT8_t Prog_Intf
PCI programming interface.
Definition pxe_api.h:1311
UINT8_t Sub_Class
PCI sub class.
Definition pxe_api.h:1310
UINT16_t BusDevFunc
PCI bus:dev:fn address.
Definition pxe_api.h:1313
UINT16_t Dev_ID
PCI device ID.
Definition pxe_api.h:1308
UINT8_t Base_Class
PCI base class.
Definition pxe_api.h:1309
UINT16_t Vendor_ID
PCI vendor ID.
Definition pxe_api.h:1307
UINT8_t Rev
PCI revision.
Definition pxe_api.h:1312
UINT16_t SubDevice_ID
PCI subdevice ID.
Definition pxe_api.h:1315
UINT16_t SubVendor_ID
PCI subvendor ID.
Definition pxe_api.h:1314
Information for an ISAPnP or equivalent NIC.
Definition pxe_api.h:1319
UINT8_t Base_Class
Base class.
Definition pxe_api.h:1321
UINT16_t CardSelNum
Card Select Number assigned to card.
Definition pxe_api.h:1325
UINT8_t Prog_Intf
Programming interface.
Definition pxe_api.h:1323
UINT8_t Sub_Class
Sub class.
Definition pxe_api.h:1322
UINT32_t EISA_Dev_ID
EISA device ID.
Definition pxe_api.h:1320
Parameter block for pxenv_file_api_check()
Definition pxe_api.h:1665
UINT32_t Magic
Magic number.
Definition pxe_api.h:1668
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1666
UINT16_t Size
Size of structure.
Definition pxe_api.h:1667
UINT32_t APIMask
Supported API functions.
Definition pxe_api.h:1670
UINT32_t Flags
Reserved for the future.
Definition pxe_api.h:1671
UINT32_t Provider
Implementation identifier.
Definition pxe_api.h:1669
Parameter block for pxenv_file_close()
Definition pxe_api.h:1558
UINT16_t FileHandle
File handle.
Definition pxe_api.h:1560
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1559
Parameter block for pxenv_file_cmdline()
Definition pxe_api.h:1709
SEGOFF16_t Buffer
Data buffer.
Definition pxe_api.h:1712
UINT16_t BufferSize
Data buffer size.
Definition pxe_api.h:1711
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1710
Parameter block for pxenv_file_exec()
Definition pxe_api.h:1645
SEGOFF16_t Command
Command to execute.
Definition pxe_api.h:1647
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1646
Parameter block for pxenv_file_exit_hook()
Definition pxe_api.h:1689
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1690
SEGOFF16_t Hook
SEG16:OFF16 to jump to.
Definition pxe_api.h:1691
Parameter block for pxenv_file_open()
Definition pxe_api.h:1536
UINT32_t Reserved
Reserved.
Definition pxe_api.h:1540
SEGOFF16_t FileName
File URL.
Definition pxe_api.h:1539
UINT16_t FileHandle
File handle.
Definition pxe_api.h:1538
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1537
Parameter block for pxenv_file_read()
Definition pxe_api.h:1602
UINT16_t BufferSize
Data buffer size.
Definition pxe_api.h:1605
SEGOFF16_t Buffer
Data buffer.
Definition pxe_api.h:1606
UINT16_t FileHandle
File handle.
Definition pxe_api.h:1604
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1603
Parameter block for pxenv_file_select()
Definition pxe_api.h:1581
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1582
UINT16_t Ready
Indication of readiness.
Definition pxe_api.h:1584
UINT16_t FileHandle
File handle.
Definition pxe_api.h:1583
Parameter block for pxenv_get_cached_info()
Definition pxe_api.h:286
SEGOFF16_t Buffer
Buffer address.
Definition pxe_api.h:295
UINT16_t BufferLimit
Maximum buffer size.
Definition pxe_api.h:296
UINT16_t BufferSize
Buffer size.
Definition pxe_api.h:294
UINT16_t PacketType
Packet type.
Definition pxe_api.h:293
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:287
Parameter block for pxenv_get_file_size()
Definition pxe_api.h:1624
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1625
UINT16_t FileHandle
File handle.
Definition pxe_api.h:1626
UINT32_t FileSize
File size.
Definition pxe_api.h:1627
Parameter block for pxenv_start_base()
Definition pxe_api.h:527
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:528
Parameter block for pxenv_start_undi()
Definition pxe_api.h:438
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:439
SEGSEL_t ES
es register as passed to the Option ROM initialisation routine.
Definition pxe_api.h:490
UINT16_t DX
dx register as passed to the Option ROM initialisation routine.
Definition pxe_api.h:462
OFF16_t DI
di register as passed to the Option ROM initialisation routine.
Definition pxe_api.h:476
UINT16_t BX
bx register as passed to the Option ROM initialisation routine.
Definition pxe_api.h:453
UINT16_t AX
ax register as passed to the Option ROM initialisation routine.
Definition pxe_api.h:446
Parameter block for pxenv_stop_base()
Definition pxe_api.h:546
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:547
Parameter block for pxenv_stop_undi()
Definition pxe_api.h:508
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:509
Parameter block for pxenv_tftp_close()
Definition pxe_api.h:604
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:605
Parameter block for pxenv_tftp_get_fsize()
Definition pxe_api.h:688
UINT32_t FileSize
Size of the file.
Definition pxe_api.h:693
IP4_t GatewayIPAddress
Relay agent IP address.
Definition pxe_api.h:691
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:689
UINT8_t FileName[128]
File name.
Definition pxe_api.h:692
IP4_t ServerIPAddress
TFTP server IP address.
Definition pxe_api.h:690
Parameter block for pxenv_tftp_open()
Definition pxe_api.h:574
IP4_t GatewayIPAddress
Relay agent IP address.
Definition pxe_api.h:577
UINT16_t PacketSize
Requested size of TFTP packets.
Definition pxe_api.h:586
UDP_PORT_t TFTPPort
TFTP server UDP port.
Definition pxe_api.h:579
IP4_t ServerIPAddress
TFTP server IP address.
Definition pxe_api.h:576
UINT8_t FileName[128]
File name.
Definition pxe_api.h:578
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:575
Parameter block for pxenv_tftp_read_file()
Definition pxe_api.h:645
IP4_t ServerIPAddress
TFTP server IP address.
Definition pxe_api.h:650
UDP_PORT_t TFTPClntPort
Client multicast listening port.
Definition pxe_api.h:655
UINT8_t FileName[128]
File name.
Definition pxe_api.h:647
ADDR32_t Buffer
Address of data buffer.
Definition pxe_api.h:649
IP4_t McastIPAddress
File multicast IP address.
Definition pxe_api.h:653
UINT16_t TFTPReopenDelay
TFTP reopen timeout.
Definition pxe_api.h:670
UINT16_t TFTPOpenTimeOut
TFTP open timeout.
Definition pxe_api.h:663
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:646
IP4_t GatewayIPAddress
Relay agent IP address.
Definition pxe_api.h:651
UINT32_t BufferSize
Size of data buffer.
Definition pxe_api.h:648
UDP_PORT_t TFTPSrvPort
Server multicast listening port.
Definition pxe_api.h:657
Parameter block for pxenv_tftp_read()
Definition pxe_api.h:623
UINT16_t PacketNumber
TFTP packet number.
Definition pxe_api.h:625
SEGOFF16_t Buffer
Address of data buffer.
Definition pxe_api.h:627
UINT16_t BufferSize
Size of data buffer.
Definition pxe_api.h:626
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:624
Parameter block for pxenv_udp_close()
Definition pxe_api.h:740
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:741
Parameter block for pxenv_udp_open()
Definition pxe_api.h:720
IP4_t src_ip
IP address of this station.
Definition pxe_api.h:722
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:721
Parameter block for pxenv_udp_read()
Definition pxe_api.h:784
IP4_t src_ip
Source IP address.
Definition pxe_api.h:786
IP4_t dest_ip
Destination IP address.
Definition pxe_api.h:787
UDP_PORT_t d_port
Destination UDP port.
Definition pxe_api.h:789
SEGOFF16_t buffer
UDP payload buffer address.
Definition pxe_api.h:791
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:785
UINT16_t buffer_size
UDP payload buffer size.
Definition pxe_api.h:790
UDP_PORT_t s_port
Source UDP port.
Definition pxe_api.h:788
Parameter block for pxenv_udp_write()
Definition pxe_api.h:759
IP4_t ip
Destination IP address.
Definition pxe_api.h:761
UINT16_t buffer_size
UDP payload buffer size.
Definition pxe_api.h:765
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:760
SEGOFF16_t buffer
UDP payload buffer address.
Definition pxe_api.h:766
UDP_PORT_t dst_port
Destination UDP port.
Definition pxe_api.h:764
UDP_PORT_t src_port
Source UDP port.
Definition pxe_api.h:763
IP4_t gw
Relay agent IP address.
Definition pxe_api.h:762
Parameter block for pxenv_undi_cleanup()
Definition pxe_api.h:844
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:845
Parameter block for pxenv_undi_clear_statistics()
Definition pxe_api.h:1224
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1225
Parameter block for pxenv_undi_close()
Definition pxe_api.h:993
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:994
Parameter block for pxenv_undi_force_interrupt()
Definition pxe_api.h:1262
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1263
Parameter block for pxenv_undi_get_iface_info()
Definition pxe_api.h:1381
UINT32_t LinkSpeed
Link speed, in bits per second.
Definition pxe_api.h:1394
UINT32_t ServiceFlags
Service flags.
Definition pxe_api.h:1401
UINT32_t Reserved[4]
Must be zero.
Definition pxe_api.h:1402
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1382
UINT8_t IfaceType[16]
Interface type.
Definition pxe_api.h:1393
Parameter block for pxenv_undi_get_information()
Definition pxe_api.h:1166
UINT16_t RxBufCt
Receive queue length.
Definition pxe_api.h:1182
UINT16_t BaseIo
I/O base address.
Definition pxe_api.h:1168
UINT16_t HwAddrLen
MAC address length.
Definition pxe_api.h:1178
SEGSEL_t ROMAddress
Real-mode ROM segment address.
Definition pxe_api.h:1181
MAC_ADDR_t CurrentNodeAddress
Current MAC address.
Definition pxe_api.h:1179
UINT16_t TxBufCt
Transmit queue length.
Definition pxe_api.h:1183
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1167
UINT16_t MaxTranUnit
Adapter MTU.
Definition pxe_api.h:1170
MAC_ADDR_t PermNodeAddress
Permanent (EEPROM) MAC address.
Definition pxe_api.h:1180
UINT16_t HwType
Hardware type.
Definition pxe_api.h:1177
UINT16_t IntNumber
IRQ number.
Definition pxe_api.h:1169
Parameter block for pxenv_undi_get_mcast_address()
Definition pxe_api.h:1281
IP4_t InetAddr
Multicast IP address.
Definition pxe_api.h:1283
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1282
MAC_ADDR_t MediaAddr
Multicast MAC address.
Definition pxe_api.h:1284
Parameter block for pxenv_undi_get_nic_type()
Definition pxe_api.h:1329
UINT8_t NicType
NIC type.
Definition pxe_api.h:1335
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1330
Parameter block for pxenv_undi_get_state()
Definition pxe_api.h:1427
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1428
UINT8_t UNDIstate
Current state of the UNDI driver.
Definition pxe_api.h:1435
Parameter block for pxenv_undi_get_statistics()
Definition pxe_api.h:1201
UINT32_t RcvCRCErrors
Receive CRC error count.
Definition pxe_api.h:1205
UINT32_t RcvResourceErrors
Receive queue overflow count.
Definition pxe_api.h:1206
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1202
UINT32_t RcvGoodFrames
Successful reception count.
Definition pxe_api.h:1204
UINT32_t XmtGoodFrames
Successful transmission count.
Definition pxe_api.h:1203
Parameter block for pxenv_undi_initialize()
Definition pxe_api.h:863
UINT8_t reserved[8]
Must be zero.
Definition pxe_api.h:873
ADDR32_t ProtocolIni
NDIS 2.0 configuration information, or NULL.
Definition pxe_api.h:872
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:864
Parameter block for pxenv_undi_initiate_diags()
Definition pxe_api.h:1243
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1244
Parameter block for pxenv_undi_isr()
Definition pxe_api.h:1479
UINT16_t FrameHeaderLength
Frame header length.
Definition pxe_api.h:1492
UINT16_t FrameLength
Total frame length.
Definition pxe_api.h:1491
UINT16_t BufferLength
Data buffer length.
Definition pxe_api.h:1490
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1480
UINT8_t PktType
Packet type.
Definition pxe_api.h:1503
UINT8_t ProtType
Protocol type.
Definition pxe_api.h:1498
UINT16_t FuncFlag
Function flag.
Definition pxe_api.h:1489
SEGOFF16_t Frame
Data buffer address.
Definition pxe_api.h:1493
List of multicast MAC addresses.
Definition pxe_api.h:894
MAC_ADDR_t McastAddr[MAXNUM_MCADDR]
List of up to MAXNUM_MCADDR multicast MAC addresses.
Definition pxe_api.h:898
UINT16_t MCastAddrCount
Number of multicast MAC addresses.
Definition pxe_api.h:896
Parameter block for pxenv_undi_open()
Definition pxe_api.h:958
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:959
UINT16_t PktFilter
Receive packet filter.
Definition pxe_api.h:973
UINT16_t OpenFlag
Open flags as defined in NDIS 2.0.
Definition pxe_api.h:966
struct s_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf
Multicast MAC addresses.
Definition pxe_api.h:975
Parameter block for pxenv_undi_reset_adapter()
Definition pxe_api.h:904
struct s_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf
Multicast MAC addresses.
Definition pxe_api.h:907
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:905
Parameter block for pxenv_undi_set_mcast_address()
Definition pxe_api.h:1087
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1088
struct s_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf
List of multicast addresses.
Definition pxe_api.h:1090
Parameter block for pxenv_undi_set_packet_filter()
Definition pxe_api.h:1128
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1129
UINT8_t filter
Receive packet filter.
Definition pxe_api.h:1140
Parameter block for pxenv_undi_set_station_address()
Definition pxe_api.h:1108
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1109
MAC_ADDR_t StationAddress
Station MAC address.
Definition pxe_api.h:1110
Parameter block for pxenv_undi_shutdown()
Definition pxe_api.h:925
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:926
Parameter block for pxenv_undi_startup()
Definition pxe_api.h:825
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:826
Array of up to MAX_DATA_BLKS additional transmit buffers.
Definition pxe_api.h:1030
SEGOFF16_t TDDataPtr
Address of this transmit buffer.
Definition pxe_api.h:1042
UINT8_t TDRsvdByte
Must be zero.
Definition pxe_api.h:1040
UINT8_t TDPtrType
Always 1.
Definition pxe_api.h:1039
UINT16_t TDDataLen
Length of this transmit buffer.
Definition pxe_api.h:1041
A transmit buffer descriptor, as pointed to by s_PXENV_UNDI_TRANSMIT::TBD.
Definition pxe_api.h:1025
SEGOFF16_t Xmit
Address of the transmit buffer.
Definition pxe_api.h:1027
UINT16_t DataBlkCount
Definition pxe_api.h:1028
UINT16_t ImmedLength
Length of the transmit buffer.
Definition pxe_api.h:1026
Parameter block for pxenv_undi_transmit()
Definition pxe_api.h:1049
UINT8_t Protocol
Protocol.
Definition pxe_api.h:1057
SEGOFF16_t TBD
Address of the Transmit Buffer Descriptor.
Definition pxe_api.h:1068
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1050
UINT8_t XmitFlag
Unicast/broadcast flag.
Definition pxe_api.h:1062
SEGOFF16_t DestAddr
Destination MAC address.
Definition pxe_api.h:1063
UINT32_t Reserved[2]
Must be zero.
Definition pxe_api.h:1069
Parameter block for pxenv_unload_stack()
Definition pxe_api.h:253
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:254
UINT8_t reserved[10]
Must be zero.
Definition pxe_api.h:255
The PXENV+ structure.
Definition pxe_api.h:72
UINT16_t Version
PXE API version.
Definition pxe_api.h:85
UINT32_t PMOffset
Protected-mode PXENV+ entry point offset.
Definition pxe_api.h:100
SEGOFF16_t PXEPtr
Address of the !PXE structure.
Definition pxe_api.h:123
UINT16_t UNDICodeSize
UNDI code segment size.
Definition pxe_api.h:117
UINT16_t BC_DataSize
Base-code data segment size.
Definition pxe_api.h:113
UINT8_t Checksum
Checksum.
Definition pxe_api.h:92
SEGSEL_t UNDIDataSeg
UNDI data segment selector.
Definition pxe_api.h:114
UINT8_t Length
Length of this structure.
Definition pxe_api.h:86
UINT8_t Signature[6]
Signature.
Definition pxe_api.h:77
SEGSEL_t PMSelector
Protected-mode PXENV+ entry point segment selector.
Definition pxe_api.h:107
SEGSEL_t BC_CodeSeg
Base-code code segment selector.
Definition pxe_api.h:110
SEGSEL_t UNDICodeSeg
UNDI code segment selector.
Definition pxe_api.h:116
UINT16_t StackSize
Stack segment size.
Definition pxe_api.h:109
SEGOFF16_t RMEntry
Real-mode PXENV+ entry point.
Definition pxe_api.h:93
UINT16_t UNDIDataSize
UNDI data segment size.
Definition pxe_api.h:115
SEGSEL_t StackSeg
Stack segment selector.
Definition pxe_api.h:108
UINT16_t BC_CodeSize
Base-code code segment size.
Definition pxe_api.h:111
SEGSEL_t BC_DataSeg
Base-code data segment selector.
Definition pxe_api.h:112
The !PXE structure.
Definition pxe_api.h:129
SEGOFF16_t EntryPointSP
16-bit !PXE entry point
Definition pxe_api.h:163
SEGOFF16_t UNDIROMID
Address of the UNDI ROM ID structure.
Definition pxe_api.h:152
SEGDESC_t Stack
Stack segment descriptor.
Definition pxe_api.h:216
SEGOFF16_t BaseROMID
Address of the Base Code ROM ID structure.
Definition pxe_api.h:157
SEGDESC_t UNDIData
UNDI data segment descriptor.
Definition pxe_api.h:218
SEGDESC_t UNDICode
UNDI code segment descriptor.
Definition pxe_api.h:220
SEGDESC_t BC_Code
Base-code code segment descriptor.
Definition pxe_api.h:226
UINT8_t StructLength
Length of this structure.
Definition pxe_api.h:135
UINT8_t StructCksum
Checksum.
Definition pxe_api.h:141
UINT8_t SegDescCnt
Number of segment descriptors.
Definition pxe_api.h:204
SEGOFF16_t StatusCallout
Status call-out function.
Definition pxe_api.h:197
UINT8_t Signature[4]
Signature.
Definition pxe_api.h:134
SEGSEL_t FirstSelector
First protected-mode selector.
Definition pxe_api.h:214
SEGDESC_t UNDICodeWrite
UNDI writable code segment descriptor.
Definition pxe_api.h:222
UINT8_t reserved_1
Must be zero.
Definition pxe_api.h:147
SEGDESC_t BC_CodeWrite
Base-code writable code segment descriptor.
Definition pxe_api.h:228
UINT8_t reserved_2
Must be zero.
Definition pxe_api.h:198
SEGOFF16_t EntryPointESP
32-bit !PXE entry point
Definition pxe_api.h:169
SEGDESC_t BC_Data
Base-code data segment descriptor.
Definition pxe_api.h:224
UINT8_t StructRev
Revision of this structure.
Definition pxe_api.h:146
Parameter block for undi_loader()
Definition pxe_api.h:1729
OFF16_t DI
di register as for PXENV_START_UNDI
Definition pxe_api.h:1739
SEGOFF16_t PXENVptr
Address of the PXENV+ structure (a struct s_PXENV)
Definition pxe_api.h:1761
PXENV_STATUS_t Status
PXE status code.
Definition pxe_api.h:1731
SEGSEL_t ES
es register as for PXENV_START_UNDI
Definition pxe_api.h:1741
UINT16_t AX
ax register as for PXENV_START_UNDI
Definition pxe_api.h:1733
SEGSEL_t UNDI_DS
UNDI data segment.
Definition pxe_api.h:1749
SEGOFF16_t PXEptr
Address of the !PXE structure (a struct s_PXE)
Definition pxe_api.h:1759
UINT16_t BX
bx register as for PXENV_START_UNDI
Definition pxe_api.h:1735
SEGSEL_t UNDI_CS
UNDI code segment.
Definition pxe_api.h:1757
UINT16_t DX
dx register as for PXENV_START_UNDI
Definition pxe_api.h:1737
DHCP options.
Definition pxe_api.h:386
struct bootph::bootph_vendor::bootph_vendor_v v
UINT8_t d[BOOTP_DHCPVEND]
DHCP options.
Definition pxe_api.h:387
struct pci_nic_info cardbus
NIC information (if NicType==CardBus_NIC)
Definition pxe_api.h:1341
struct pci_nic_info pci
NIC information (if NicType==PCI_NIC)
Definition pxe_api.h:1339
struct pnp_nic_info pnp
NIC information (if NicType==PnP_NIC)
Definition pxe_api.h:1343