pxe_api.h

Go to the documentation of this file.
00001 #ifndef PXE_API_H
00002 #define PXE_API_H
00003 
00004 /*
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License as
00007  * published by the Free Software Foundation; either version 2 of the
00008  * License, or any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  *
00019  * As an alternative, at your option, you may use this file under the
00020  * following terms, known as the "MIT license":
00021  *
00022  * Copyright (c) 2005-2009 Michael Brown <mbrown@fensystems.co.uk>
00023  *
00024  * Permission is hereby granted, free of charge, to any person
00025  * obtaining a copy of this software and associated documentation
00026  * files (the "Software"), to deal in the Software without
00027  * restriction, including without limitation the rights to use, copy,
00028  * modify, merge, publish, distribute, sublicense, and/or sell copies
00029  * of the Software, and to permit persons to whom the Software is
00030  * furnished to do so, subject to the following conditions:
00031  *
00032  * The above copyright notice and this permission notice shall be
00033  * included in all copies or substantial portions of the Software.
00034  *
00035  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00036  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00037  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00038  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
00039  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00040  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00041  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00042  * SOFTWARE.
00043  */
00044 
00045 /** @file
00046  *
00047  * Preboot eXecution Environment (PXE) API
00048  *
00049  */
00050 
00051 FILE_LICENCE ( GPL2_OR_LATER );
00052 
00053 #include "pxe_types.h"
00054 
00055 /** @addtogroup pxe Preboot eXecution Environment (PXE) API
00056  *  @{
00057  */
00058 
00059 /** @defgroup pxe_api_call PXE entry points
00060  *
00061  * PXE entry points and calling conventions
00062  *
00063  *  @{
00064  */
00065 
00066 /** The PXENV+ structure */
00067 struct s_PXENV {
00068         /** Signature
00069          *
00070          * Contains the bytes 'P', 'X', 'E', 'N', 'V', '+'.
00071          */
00072         UINT8_t         Signature[6];
00073         /** PXE API version
00074          *
00075          * MSB is major version number, LSB is minor version number.
00076          * If the API version number is 0x0201 or greater, the !PXE
00077          * structure pointed to by #PXEPtr should be used instead of
00078          * this data structure.
00079          */
00080         UINT16_t        Version;
00081         UINT8_t         Length;         /**< Length of this structure */
00082         /** Checksum
00083          *
00084          * The byte checksum of this structure (using the length in
00085          * #Length) must be zero.
00086          */
00087         UINT8_t         Checksum;
00088         SEGOFF16_t      RMEntry;        /**< Real-mode PXENV+ entry point */
00089         /** Protected-mode PXENV+ entry point offset
00090          *
00091          * PXE 2.1 deprecates this entry point.  For protected-mode
00092          * API calls, use the !PXE structure pointed to by #PXEPtr
00093          * instead.
00094          */
00095         UINT32_t        PMOffset;
00096         /** Protected-mode PXENV+ entry point segment selector
00097          *
00098          * PXE 2.1 deprecates this entry point.  For protected-mode
00099          * API calls, use the !PXE structure pointed to by #PXEPtr
00100          * instead.
00101          */
00102         SEGSEL_t        PMSelector;
00103         SEGSEL_t        StackSeg;       /**< Stack segment selector */
00104         UINT16_t        StackSize;      /**< Stack segment size */
00105         SEGSEL_t        BC_CodeSeg;     /**< Base-code code segment selector */
00106         UINT16_t        BC_CodeSize;    /**< Base-code code segment size */
00107         SEGSEL_t        BC_DataSeg;     /**< Base-code data segment selector */
00108         UINT16_t        BC_DataSize;    /**< Base-code data segment size */
00109         SEGSEL_t        UNDIDataSeg;    /**< UNDI data segment selector */
00110         UINT16_t        UNDIDataSize;   /**< UNDI data segment size */
00111         SEGSEL_t        UNDICodeSeg;    /**< UNDI code segment selector */
00112         UINT16_t        UNDICodeSize;   /**< UNDI code segment size */
00113         /** Address of the !PXE structure
00114          *
00115          * This field is present only if #Version is 0x0201 or
00116          * greater.  If present, it points to a struct s_PXE.
00117          */
00118         SEGOFF16_t      PXEPtr;
00119 } PACKED;
00120 
00121 typedef struct s_PXENV PXENV_t;
00122 
00123 /** The !PXE structure */
00124 struct s_PXE {
00125         /** Signature
00126          *
00127          * Contains the bytes '!', 'P', 'X', 'E'.
00128          */
00129         UINT8_t         Signature[4];
00130         UINT8_t         StructLength;   /**< Length of this structure */
00131         /** Checksum
00132          *
00133          * The byte checksum of this structure (using the length in
00134          * #StructLength) must be zero.
00135          */
00136         UINT8_t         StructCksum;
00137         /** Revision of this structure
00138          *
00139          * For PXE version 2.1, this field must be zero.
00140          */
00141         UINT8_t         StructRev;
00142         UINT8_t         reserved_1;     /**< Must be zero */
00143         /** Address of the UNDI ROM ID structure
00144          *
00145          * This is a pointer to a struct s_UNDI_ROM_ID.
00146          */
00147         SEGOFF16_t      UNDIROMID;
00148         /** Address of the Base Code ROM ID structure
00149          *
00150          * This is a pointer to a struct s_BC_ROM_ID.
00151          */
00152         SEGOFF16_t      BaseROMID;
00153         /** 16-bit !PXE entry point
00154          *
00155          * This is the entry point for either real mode, or protected
00156          * mode with a 16-bit stack segment.
00157          */
00158         SEGOFF16_t      EntryPointSP;
00159         /** 32-bit !PXE entry point
00160          *
00161          * This is the entry point for protected mode with a 32-bit
00162          * stack segment.
00163          */
00164         SEGOFF16_t      EntryPointESP;
00165         /** Status call-out function
00166          *
00167          * @v 0         (if in a time-out loop)
00168          * @v n         Number of a received TFTP packet
00169          * @ret 0       Continue operation
00170          * @ret 1       Cancel operation
00171          *
00172          * This function will be called whenever the PXE stack is in
00173          * protected mode, is waiting for an event (e.g. a DHCP reply)
00174          * and wishes to allow the user to cancel the operation.
00175          * Parameters are passed in register %ax; the return value
00176          * must also be placed in register %ax.  All other registers
00177          * and flags @b must be preserved.
00178          *
00179          * In real mode, an internal function (that checks for a
00180          * keypress) will be used.
00181          *
00182          * If this field is set to -1, no status call-out function
00183          * will be used and consequently the user will not be allowed
00184          * to interrupt operations.
00185          *
00186          * @note The PXE specification version 2.1 defines the
00187          * StatusCallout field, mentions it 11 times, but nowhere
00188          * defines what it actually does or how it gets called.
00189          * Fortunately, the WfM specification version 1.1a deigns to
00190          * inform us of such petty details.
00191          */
00192         SEGOFF16_t      StatusCallout;
00193         UINT8_t         reserved_2;     /**< Must be zero */
00194         /** Number of segment descriptors
00195          *
00196          * If this number is greater than 7, the remaining descriptors
00197          * follow immediately after #BC_CodeWrite.
00198          */
00199         UINT8_t         SegDescCnt;
00200         /** First protected-mode selector
00201          *
00202          * This is the segment selector value for the first segment
00203          * assigned to PXE.  Protected-mode selectors must be
00204          * consecutive, according to the PXE 2.1 specification, though
00205          * no reason is given.  Each #SEGDESC_t includes a field for
00206          * the segment selector, so this information is entirely
00207          * redundant.
00208          */
00209         SEGSEL_t        FirstSelector;
00210         /** Stack segment descriptor */
00211         SEGDESC_t       Stack;
00212         /** UNDI data segment descriptor */
00213         SEGDESC_t       UNDIData;
00214         /** UNDI code segment descriptor */
00215         SEGDESC_t       UNDICode;
00216         /** UNDI writable code segment descriptor */
00217         SEGDESC_t       UNDICodeWrite;
00218         /** Base-code data segment descriptor */
00219         SEGDESC_t       BC_Data;
00220         /** Base-code code segment descriptor */
00221         SEGDESC_t       BC_Code;
00222         /** Base-code writable code segment descriptor */
00223         SEGDESC_t       BC_CodeWrite;
00224 } PACKED;
00225 
00226 typedef struct s_PXE PXE_t;
00227 
00228 /** @} */ /* pxe_api_call */
00229 
00230 /** @defgroup pxe_preboot_api PXE Preboot API
00231  *
00232  * General high-level functions: #PXENV_UNLOAD_STACK, #PXENV_START_UNDI etc.
00233  *
00234  * @{
00235  */
00236 
00237 /** @defgroup pxenv_unload_stack PXENV_UNLOAD_STACK
00238  *
00239  *  UNLOAD BASE CODE STACK
00240  *
00241  *  @{
00242  */
00243 
00244 /** PXE API function code for pxenv_unload_stack() */
00245 #define PXENV_UNLOAD_STACK              0x0070
00246 
00247 /** Parameter block for pxenv_unload_stack() */
00248 struct s_PXENV_UNLOAD_STACK {
00249         PXENV_STATUS_t Status;                  /**< PXE status code */
00250         UINT8_t reserved[10];                   /**< Must be zero */
00251 } PACKED;
00252 
00253 typedef struct s_PXENV_UNLOAD_STACK PXENV_UNLOAD_STACK_t;
00254 
00255 extern PXENV_EXIT_t pxenv_unload_stack ( struct s_PXENV_UNLOAD_STACK
00256                                          *unload_stack );
00257 
00258 /** @} */ /* pxenv_unload_stack */
00259 
00260 /** @defgroup pxenv_get_cached_info PXENV_GET_CACHED_INFO
00261  *
00262  *  GET CACHED INFO
00263  *
00264  *  @{
00265  */
00266 
00267 /** PXE API function code for pxenv_get_cached_info() */
00268 #define PXENV_GET_CACHED_INFO           0x0071
00269 
00270 /** The client's DHCPDISCOVER packet */
00271 #define PXENV_PACKET_TYPE_DHCP_DISCOVER 1
00272 
00273 /** The DHCP server's DHCPACK packet */
00274 #define PXENV_PACKET_TYPE_DHCP_ACK      2
00275 
00276 /** The Boot Server's Discover Reply packet
00277  *
00278  * This packet contains DHCP option 60 set to "PXEClient", a valid
00279  * boot file name, and may or may not contain MTFTP options.
00280  */
00281 #define PXENV_PACKET_TYPE_CACHED_REPLY  3
00282 
00283 /** Parameter block for pxenv_get_cached_info() */
00284 struct s_PXENV_GET_CACHED_INFO {
00285         PXENV_STATUS_t Status;                  /**< PXE status code */
00286         /** Packet type.
00287          *
00288          * Valid values are #PXENV_PACKET_TYPE_DHCP_DISCOVER,
00289          * #PXENV_PACKET_TYPE_DHCP_ACK or #PXENV_PACKET_TYPE_CACHED_REPLY
00290          */
00291         UINT16_t PacketType;
00292         UINT16_t BufferSize;                    /**< Buffer size */
00293         SEGOFF16_t Buffer;                      /**< Buffer address */
00294         UINT16_t BufferLimit;                   /**< Maximum buffer size */
00295 } PACKED;
00296 
00297 typedef struct s_PXENV_GET_CACHED_INFO PXENV_GET_CACHED_INFO_t;
00298 
00299 #define BOOTP_REQ       1       /**< A BOOTP request packet */
00300 #define BOOTP_REP       2       /**< A BOOTP reply packet */
00301 
00302 /** DHCP broadcast flag
00303  *
00304  * Request a broadcast response (DHCPOFFER or DHCPACK) from the DHCP
00305  * server.
00306  */
00307 #define BOOTP_BCAST     0x8000
00308 
00309 #define VM_RFC1048      0x63825363L     /**< DHCP magic cookie */
00310 
00311 /** Maximum length of DHCP options */
00312 #define BOOTP_DHCPVEND  1024
00313 
00314 /** Format of buffer filled in by pxenv_get_cached_info()
00315  *
00316  * This somewhat convoluted data structure simply describes the layout
00317  * of a DHCP packet.  Refer to RFC2131 section 2 for a full
00318  * description.
00319  */
00320 struct bootph {
00321         /** Message opcode.
00322          *
00323          * Valid values are #BOOTP_REQ and #BOOTP_REP.
00324          */
00325         UINT8_t opcode;
00326         /** NIC hardware type.
00327          *
00328          * Valid values are as for s_PXENV_UNDI_GET_INFORMATION::HwType.
00329          */
00330         UINT8_t Hardware;
00331         UINT8_t Hardlen;                /**< MAC address length */
00332         /** Gateway hops
00333          *
00334          * Zero in packets sent by the client.  May be non-zero in
00335          * replies from the DHCP server, if the reply comes via a DHCP
00336          * relay agent.
00337          */
00338         UINT8_t Gatehops;
00339         UINT32_t ident;                 /**< DHCP transaction id (xid) */
00340         /** Elapsed time
00341          *
00342          * Number of seconds since the client began the DHCP
00343          * transaction.
00344          */
00345         UINT16_t seconds;
00346         /** Flags
00347          *
00348          * This is the bitwise-OR of any of the following values:
00349          * #BOOTP_BCAST.
00350          */
00351         UINT16_t Flags;
00352         /** Client IP address
00353          *
00354          * Set only if the client already has an IP address.
00355          */
00356         IP4_t cip;
00357         /** Your IP address
00358          *
00359          * This is the IP address that the server assigns to the
00360          * client.
00361          */
00362         IP4_t yip;
00363         /** Server IP address
00364          *
00365          * This is the IP address of the BOOTP/DHCP server.
00366          */
00367         IP4_t sip;
00368         /** Gateway IP address
00369          *
00370          * This is the IP address of the BOOTP/DHCP relay agent, if
00371          * any.  It is @b not (necessarily) the address of the default
00372          * gateway for routing purposes.
00373          */
00374         IP4_t gip;
00375         MAC_ADDR_t CAddr;               /**< Client MAC address */
00376         UINT8_t Sname[64];              /**< Server host name */
00377         UINT8_t bootfile[128];          /**< Boot file name */
00378         /** DHCP options
00379          *
00380          * Don't ask.  Just laugh.  Then burn a copy of the PXE
00381          * specification and send Intel an e-mail asking them if
00382          * they've figured out what a "union" does in C yet.
00383          */
00384         union bootph_vendor {
00385                 UINT8_t d[BOOTP_DHCPVEND]; /**< DHCP options */
00386                 /** DHCP options */
00387                 struct bootph_vendor_v {
00388                         /** DHCP magic cookie
00389                          *
00390                          * Should have the value #VM_RFC1048.
00391                          */
00392                         UINT8_t magic[4];
00393                         UINT32_t flags; /**< BOOTP flags/opcodes */
00394                         /** "End of BOOTP vendor extensions"
00395                          *
00396                          * Abandon hope, all ye who consider the
00397                          * purpose of this field.
00398                          */
00399                         UINT8_t pad[56];
00400                 } v;
00401         } vendor;
00402 } PACKED;
00403 
00404 typedef struct bootph BOOTPLAYER_t;
00405 
00406 extern PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO
00407                                             *get_cached_info );
00408 
00409 /** @} */ /* pxenv_get_cached_info */
00410 
00411 /** @defgroup pxenv_restart_tftp PXENV_RESTART_TFTP
00412  *
00413  *  RESTART TFTP
00414  *
00415  *  @{
00416  */
00417 
00418 /** PXE API function code for pxenv_restart_tftp() */
00419 #define PXENV_RESTART_TFTP              0x0073
00420 
00421 /** Parameter block for pxenv_restart_tftp() */
00422 struct s_PXENV_TFTP_READ_FILE;
00423 
00424 typedef struct s_PXENV_RESTART_TFTP PXENV_RESTART_TFTP_t;
00425 
00426 extern PXENV_EXIT_t pxenv_restart_tftp ( struct s_PXENV_TFTP_READ_FILE
00427                                          *restart_tftp );
00428 
00429 /** @} */ /* pxenv_restart_tftp */
00430 
00431 /** @defgroup pxenv_start_undi PXENV_START_UNDI
00432  *
00433  *  START UNDI
00434  *
00435  *  @{
00436  */
00437 
00438 /** PXE API function code for pxenv_start_undi() */
00439 #define PXENV_START_UNDI                0x0000
00440 
00441 /** Parameter block for pxenv_start_undi() */
00442 struct s_PXENV_START_UNDI {
00443         PXENV_STATUS_t Status;                  /**< PXE status code */
00444         /** %ax register as passed to the Option ROM initialisation routine.
00445          *
00446          * For a PCI device, this should contain the bus:dev:fn value
00447          * that uniquely identifies the PCI device in the system.  For
00448          * a non-PCI device, this field is not defined.
00449          */
00450         UINT16_t AX;
00451         /** %bx register as passed to the Option ROM initialisation routine.
00452          *
00453          * For an ISAPnP device, this should contain the Card Select
00454          * Number assigned to the ISAPnP card.  For non-ISAPnP
00455          * devices, this should contain 0xffff.
00456          */
00457         UINT16_t BX;
00458         /** %dx register as passed to the Option ROM initialisation routine.
00459          *
00460          * For an ISAPnP device, this should contain the ISAPnP Read
00461          * Port address as currently set in all ISAPnP cards.  If
00462          * there are no ISAPnP cards, this should contain 0xffff.  (If
00463          * this is a non-ISAPnP device, but there are ISAPnP cards in
00464          * the system, this value is not well defined.)
00465          */
00466         UINT16_t DX;
00467         /** %di register as passed to the Option ROM initialisation routine.
00468          *
00469          * This contains the #OFF16_t portion of a struct #s_SEGOFF16
00470          * that points to the System BIOS Plug and Play Installation
00471          * Check Structure.  (Refer to section 4.4 of the Plug and
00472          * Play BIOS specification for a description of this
00473          * structure.)
00474          *
00475          * @note The PXE specification defines the type of this field
00476          * as #UINT16_t.  For x86, #OFF16_t and #UINT16_t are
00477          * equivalent anyway; for other architectures #OFF16_t makes
00478          * more sense.
00479          */
00480         OFF16_t DI;
00481         /** %es register as passed to the Option ROM initialisation routine.
00482          *
00483          * This contains the #SEGSEL_t portion of a struct #s_SEGOFF16
00484          * that points to the System BIOS Plug and Play Installation
00485          * Check Structure.  (Refer to section 4.4 of the Plug and
00486          * Play BIOS specification for a description of this
00487          * structure.)
00488          *
00489          * @note The PXE specification defines the type of this field
00490          * as #UINT16_t.  For x86, #SEGSEL_t and #UINT16_t are
00491          * equivalent anyway; for other architectures #SEGSEL_t makes
00492          * more sense.
00493          */
00494         SEGSEL_t ES;
00495 } PACKED;
00496 
00497 typedef struct s_PXENV_START_UNDI PXENV_START_UNDI_t;
00498 
00499 extern PXENV_EXIT_t pxenv_start_undi ( struct s_PXENV_START_UNDI *start_undi );
00500 
00501 /** @} */ /* pxenv_start_undi */
00502 
00503 /** @defgroup pxenv_stop_undi PXENV_STOP_UNDI
00504  *
00505  *  STOP UNDI
00506  *
00507  *  @{
00508  */
00509 
00510 /** PXE API function code for pxenv_stop_undi() */
00511 #define PXENV_STOP_UNDI                 0x0015
00512 
00513 /** Parameter block for pxenv_stop_undi() */
00514 struct s_PXENV_STOP_UNDI {
00515         PXENV_STATUS_t Status;                  /**< PXE status code */
00516 } PACKED;
00517 
00518 typedef struct s_PXENV_STOP_UNDI PXENV_STOP_UNDI_t;
00519 
00520 extern PXENV_EXIT_t pxenv_stop_undi ( struct s_PXENV_STOP_UNDI *stop_undi );
00521 
00522 /** @} */ /* pxenv_stop_undi */
00523 
00524 /** @defgroup pxenv_start_base PXENV_START_BASE
00525  *
00526  *  START BASE
00527  *
00528  *  @{
00529  */
00530 
00531 /** PXE API function code for pxenv_start_base() */
00532 #define PXENV_START_BASE                0x0075
00533 
00534 /** Parameter block for pxenv_start_base() */
00535 struct s_PXENV_START_BASE {
00536         PXENV_STATUS_t Status;                  /**< PXE status code */
00537 } PACKED;
00538 
00539 typedef struct s_PXENV_START_BASE PXENV_START_BASE_t;
00540 
00541 extern PXENV_EXIT_t pxenv_start_base ( struct s_PXENV_START_BASE *start_base );
00542 
00543 /** @} */ /* pxenv_start_base */
00544 
00545 /** @defgroup pxenv_stop_base PXENV_STOP_BASE
00546  *
00547  *  STOP BASE
00548  *
00549  *  @{
00550  */
00551 
00552 /** PXE API function code for pxenv_stop_base() */
00553 #define PXENV_STOP_BASE                 0x0076
00554 
00555 /** Parameter block for pxenv_stop_base() */
00556 struct s_PXENV_STOP_BASE {
00557         PXENV_STATUS_t Status;                  /**< PXE status code */
00558 } PACKED;
00559 
00560 typedef struct s_PXENV_STOP_BASE PXENV_STOP_BASE_t;
00561 
00562 extern PXENV_EXIT_t pxenv_stop_base ( struct s_PXENV_STOP_BASE *stop_base );
00563 
00564 /** @} */ /* pxenv_stop_base */
00565 
00566 /** @} */ /* pxe_preboot_api */
00567 
00568 /** @defgroup pxe_tftp_api PXE TFTP API
00569  *
00570  * Download files via TFTP or MTFTP
00571  *
00572  * @{
00573  */
00574 
00575 /** @defgroup pxenv_tftp_open PXENV_TFTP_OPEN
00576  *
00577  *  TFTP OPEN
00578  *
00579  *  @{
00580  */
00581 
00582 /** PXE API function code for pxenv_tftp_open() */
00583 #define PXENV_TFTP_OPEN                 0x0020
00584 
00585 /** Parameter block for pxenv_tftp_open() */
00586 struct s_PXENV_TFTP_OPEN {
00587         PXENV_STATUS_t Status;                  /**< PXE status code */
00588         IP4_t ServerIPAddress;                  /**< TFTP server IP address */
00589         IP4_t GatewayIPAddress;                 /**< Relay agent IP address */
00590         UINT8_t FileName[128];                  /**< File name */
00591         UDP_PORT_t TFTPPort;                    /**< TFTP server UDP port */
00592         /** Requested size of TFTP packets
00593          *
00594          * This is the TFTP "blksize" option.  This must be at least
00595          * 512, since servers that do not support TFTP options cannot
00596          * negotiate blocksizes smaller than this.
00597          */
00598         UINT16_t PacketSize;
00599 } PACKED;
00600 
00601 typedef struct s_PXENV_TFTP_OPEN PXENV_TFTP_OPEN_t;
00602 
00603 extern PXENV_EXIT_t pxenv_tftp_open ( struct s_PXENV_TFTP_OPEN *tftp_open );
00604 
00605 /** @} */ /* pxenv_tftp_open */
00606 
00607 /** @defgroup pxenv_tftp_close PXENV_TFTP_CLOSE
00608  *
00609  *  TFTP CLOSE
00610  *
00611  *  @{
00612  */
00613 
00614 /** PXE API function code for pxenv_tftp_close() */
00615 #define PXENV_TFTP_CLOSE                0x0021
00616 
00617 /** Parameter block for pxenv_tftp_close() */
00618 struct s_PXENV_TFTP_CLOSE {
00619         PXENV_STATUS_t Status;                  /**< PXE status code */
00620 } PACKED;
00621 
00622 typedef struct s_PXENV_TFTP_CLOSE PXENV_TFTP_CLOSE_t;
00623 
00624 extern PXENV_EXIT_t pxenv_tftp_close ( struct s_PXENV_TFTP_CLOSE *tftp_close );
00625 
00626 /** @} */ /* pxenv_tftp_close */
00627 
00628 /** @defgroup pxenv_tftp_read PXENV_TFTP_READ
00629  *
00630  *  TFTP READ
00631  *
00632  *  @{
00633  */
00634 
00635 /** PXE API function code for pxenv_tftp_read() */
00636 #define PXENV_TFTP_READ                 0x0022
00637 
00638 /** Parameter block for pxenv_tftp_read() */
00639 struct s_PXENV_TFTP_READ {
00640         PXENV_STATUS_t Status;                  /**< PXE status code */
00641         UINT16_t PacketNumber;                  /**< TFTP packet number */
00642         UINT16_t BufferSize;                    /**< Size of data buffer */
00643         SEGOFF16_t Buffer;                      /**< Address of data buffer */
00644 } PACKED;
00645 
00646 typedef struct s_PXENV_TFTP_READ PXENV_TFTP_READ_t;
00647 
00648 extern PXENV_EXIT_t pxenv_tftp_read ( struct s_PXENV_TFTP_READ *tftp_read );
00649 
00650 /** @} */ /* pxenv_tftp_read */
00651 
00652 /** @defgroup pxenv_tftp_read_file PXENV_TFTP_READ_FILE
00653  *
00654  *  TFTP/MTFTP READ FILE
00655  *
00656  *  @{
00657  */
00658 
00659 /** PXE API function code for pxenv_tftp_read_file() */
00660 #define PXENV_TFTP_READ_FILE            0x0023
00661 
00662 /** Parameter block for pxenv_tftp_read_file() */
00663 struct s_PXENV_TFTP_READ_FILE {
00664         PXENV_STATUS_t Status;                  /**< PXE status code */
00665         UINT8_t FileName[128];                  /**< File name */
00666         UINT32_t BufferSize;                    /**< Size of data buffer */
00667         ADDR32_t Buffer;                        /**< Address of data buffer */
00668         IP4_t ServerIPAddress;                  /**< TFTP server IP address */
00669         IP4_t GatewayIPAddress;                 /**< Relay agent IP address */
00670         /** File multicast IP address */
00671         IP4_t McastIPAddress;
00672         /** Client multicast listening port */
00673         UDP_PORT_t TFTPClntPort;
00674         /** Server multicast listening port */
00675         UDP_PORT_t TFTPSrvPort;
00676         /** TFTP open timeout.
00677          *
00678          * This is the timeout for receiving the first DATA or ACK
00679          * packets during the MTFTP Listen phase.
00680          */
00681         UINT16_t TFTPOpenTimeOut;
00682         /** TFTP reopen timeout.
00683          *
00684          * This is the timeout for receiving an ACK packet while in
00685          * the MTFTP Listen phase (when at least one ACK packet has
00686          * already been seen).
00687          */
00688         UINT16_t TFTPReopenDelay;
00689 } PACKED;
00690 
00691 typedef struct s_PXENV_TFTP_READ_FILE PXENV_TFTP_READ_FILE_t;
00692 
00693 extern PXENV_EXIT_t pxenv_tftp_read_file ( struct s_PXENV_TFTP_READ_FILE
00694                                            *tftp_read_file );
00695 
00696 /** @} */ /* pxenv_tftp_read_file */
00697 
00698 /** @defgroup pxenv_tftp_get_fsize PXENV_TFTP_GET_FSIZE
00699  *
00700  *  TFTP GET FILE SIZE
00701  *
00702  *  @{
00703  */
00704 
00705 /** PXE API function code for pxenv_tftp_get_fsize() */
00706 #define PXENV_TFTP_GET_FSIZE            0x0025
00707 
00708 /** Parameter block for pxenv_tftp_get_fsize() */
00709 struct s_PXENV_TFTP_GET_FSIZE {
00710         PXENV_STATUS_t Status;                  /**< PXE status code */
00711         IP4_t ServerIPAddress;                  /**< TFTP server IP address */
00712         IP4_t GatewayIPAddress;                 /**< Relay agent IP address */
00713         UINT8_t FileName[128];                  /**< File name */
00714         UINT32_t FileSize;                      /**< Size of the file */
00715 } PACKED;
00716 
00717 typedef struct s_PXENV_TFTP_GET_FSIZE PXENV_TFTP_GET_FSIZE_t;
00718 
00719 extern PXENV_EXIT_t pxenv_tftp_get_fsize ( struct s_PXENV_TFTP_GET_FSIZE
00720                                            *get_fsize );
00721 
00722 /** @} */ /* pxenv_tftp_get_fsize */
00723 
00724 /** @} */ /* pxe_tftp_api */
00725 
00726 /** @defgroup pxe_udp_api PXE UDP API
00727  *
00728  * Transmit and receive UDP packets
00729  *
00730  * @{
00731  */
00732 
00733 /** @defgroup pxenv_udp_open PXENV_UDP_OPEN
00734  *
00735  *  UDP OPEN
00736  *
00737  *  @{
00738  */
00739 
00740 /** PXE API function code for pxenv_udp_open() */
00741 #define PXENV_UDP_OPEN                  0x0030
00742 
00743 /** Parameter block for pxenv_udp_open() */
00744 struct s_PXENV_UDP_OPEN {
00745         PXENV_STATUS_t  Status;         /**< PXE status code */
00746         IP4_t           src_ip;         /**< IP address of this station */
00747 } PACKED;
00748 
00749 typedef struct s_PXENV_UDP_OPEN PXENV_UDP_OPEN_t;
00750 
00751 extern PXENV_EXIT_t pxenv_udp_open ( struct s_PXENV_UDP_OPEN *udp_open );
00752 
00753 /** @} */ /* pxenv_udp_open */
00754 
00755 /** @defgroup pxenv_udp_close PXENV_UDP_CLOSE
00756  *
00757  *  UDP CLOSE
00758  *
00759  *  @{
00760  */
00761 
00762 /** PXE API function code for pxenv_udp_close() */
00763 #define PXENV_UDP_CLOSE                 0x0031
00764 
00765 /** Parameter block for pxenv_udp_close() */
00766 struct s_PXENV_UDP_CLOSE {
00767         PXENV_STATUS_t  Status;         /**< PXE status code */
00768 } PACKED;
00769 
00770 typedef struct s_PXENV_UDP_CLOSE PXENV_UDP_CLOSE_t;
00771 
00772 extern PXENV_EXIT_t pxenv_udp_close ( struct s_PXENV_UDP_CLOSE *udp_close );
00773 
00774 /** @} */ /* pxenv_udp_close */
00775 
00776 /** @defgroup pxenv_udp_write PXENV_UDP_WRITE
00777  *
00778  *  UDP WRITE
00779  *
00780  *  @{
00781  */
00782 
00783 /** PXE API function code for pxenv_udp_write() */
00784 #define PXENV_UDP_WRITE                 0x0033
00785 
00786 /** Parameter block for pxenv_udp_write() */
00787 struct s_PXENV_UDP_WRITE {
00788         PXENV_STATUS_t  Status;         /**< PXE status code */
00789         IP4_t           ip;             /**< Destination IP address */
00790         IP4_t           gw;             /**< Relay agent IP address */
00791         UDP_PORT_t      src_port;       /**< Source UDP port */
00792         UDP_PORT_t      dst_port;       /**< Destination UDP port */
00793         UINT16_t        buffer_size;    /**< UDP payload buffer size */
00794         SEGOFF16_t      buffer;         /**< UDP payload buffer address */
00795 } PACKED;
00796 
00797 typedef struct s_PXENV_UDP_WRITE PXENV_UDP_WRITE_t;
00798 
00799 extern PXENV_EXIT_t pxenv_udp_write ( struct s_PXENV_UDP_WRITE *udp_write );
00800 
00801 /** @} */ /* pxenv_udp_write */
00802 
00803 /** @defgroup pxenv_udp_read PXENV_UDP_READ
00804  *
00805  *  UDP READ
00806  *
00807  *  @{
00808  */
00809 
00810 /** PXE API function code for pxenv_udp_read() */
00811 #define PXENV_UDP_READ                  0x0032
00812 
00813 /** Parameter block for pxenv_udp_read() */
00814 struct s_PXENV_UDP_READ {
00815         PXENV_STATUS_t  Status;         /**< PXE status code */
00816         IP4_t           src_ip;         /**< Source IP address */
00817         IP4_t           dest_ip;        /**< Destination IP address */
00818         UDP_PORT_t      s_port;         /**< Source UDP port */
00819         UDP_PORT_t      d_port;         /**< Destination UDP port */
00820         UINT16_t        buffer_size;    /**< UDP payload buffer size */
00821         SEGOFF16_t      buffer;         /**< UDP payload buffer address */
00822 } PACKED;
00823 
00824 typedef struct s_PXENV_UDP_READ PXENV_UDP_READ_t;
00825 
00826 extern PXENV_EXIT_t pxenv_udp_read ( struct s_PXENV_UDP_READ *udp_read );
00827 
00828 /** @} */ /* pxenv_udp_read */
00829 
00830 /** @} */ /* pxe_udp_api */
00831 
00832 /** @defgroup pxe_undi_api PXE UNDI API
00833  *
00834  * Direct control of the network interface card
00835  *
00836  * @{
00837  */
00838 
00839 /** @defgroup pxenv_undi_startup PXENV_UNDI_STARTUP
00840  *
00841  *  UNDI STARTUP
00842  *
00843  *  @{
00844  */
00845 
00846 /** PXE API function code for pxenv_undi_startup() */
00847 #define PXENV_UNDI_STARTUP              0x0001
00848 
00849 #define PXENV_BUS_ISA           0       /**< ISA bus type */
00850 #define PXENV_BUS_EISA          1       /**< EISA bus type */
00851 #define PXENV_BUS_MCA           2       /**< MCA bus type */
00852 #define PXENV_BUS_PCI           3       /**< PCI bus type */
00853 #define PXENV_BUS_VESA          4       /**< VESA bus type */
00854 #define PXENV_BUS_PCMCIA        5       /**< PCMCIA bus type */
00855 
00856 /** Parameter block for pxenv_undi_startup() */
00857 struct s_PXENV_UNDI_STARTUP {
00858         PXENV_STATUS_t  Status;         /**< PXE status code */
00859 } PACKED;
00860 
00861 typedef struct s_PXENV_UNDI_STARTUP PXENV_UNDI_STARTUP_t;
00862 
00863 extern PXENV_EXIT_t pxenv_undi_startup ( struct s_PXENV_UNDI_STARTUP
00864                                          *undi_startup );
00865 
00866 /** @} */ /* pxenv_undi_startup */
00867 
00868 /** @defgroup pxenv_undi_cleanup PXENV_UNDI_CLEANUP
00869  *
00870  *  UNDI CLEANUP
00871  *
00872  *  @{
00873  */
00874 
00875 /** PXE API function code for pxenv_undi_cleanup() */
00876 #define PXENV_UNDI_CLEANUP              0x0002
00877 
00878 /** Parameter block for pxenv_undi_cleanup() */
00879 struct s_PXENV_UNDI_CLEANUP {
00880         PXENV_STATUS_t  Status;         /**< PXE status code */
00881 } PACKED;
00882 
00883 typedef struct s_PXENV_UNDI_CLEANUP PXENV_UNDI_CLEANUP_t;
00884 
00885 extern PXENV_EXIT_t pxenv_undi_cleanup ( struct s_PXENV_UNDI_CLEANUP
00886                                          *undi_cleanup );
00887 
00888 /** @} */ /* pxenv_undi_cleanup */
00889 
00890 /** @defgroup pxenv_undi_initialize PXENV_UNDI_INITIALIZE
00891  *
00892  *  UNDI INITIALIZE
00893  *
00894  *  @{
00895  */
00896 
00897 /** PXE API function code for pxenv_undi_initialize() */
00898 #define PXENV_UNDI_INITIALIZE           0x0003
00899 
00900 /** Parameter block for pxenv_undi_initialize() */
00901 struct s_PXENV_UNDI_INITIALIZE {
00902         PXENV_STATUS_t  Status;         /**< PXE status code */
00903         /** NDIS 2.0 configuration information, or NULL
00904          *
00905          * This is a pointer to the data structure returned by the
00906          * NDIS 2.0 GetProtocolManagerInfo() API call.  The data
00907          * structure is documented, in a rather haphazard way, in
00908          * section 4-17 of the NDIS 2.0 specification.
00909          */
00910         ADDR32_t ProtocolIni;
00911         UINT8_t reserved[8];            /**< Must be zero */
00912 } PACKED;
00913 
00914 typedef struct s_PXENV_UNDI_INITIALIZE PXENV_UNDI_INITIALIZE_t;
00915 
00916 extern PXENV_EXIT_t pxenv_undi_initialize ( struct s_PXENV_UNDI_INITIALIZE
00917                                             *undi_initialize );
00918 
00919 /** @} */ /* pxenv_undi_initialize */
00920 
00921 /** @defgroup pxenv_undi_reset_adapter PXENV_UNDI_RESET_ADAPTER
00922  *
00923  *  UNDI RESET ADAPTER
00924  *
00925  *  @{
00926  */
00927 
00928 /** PXE API function code for pxenv_undi_reset_adapter() */
00929 #define PXENV_UNDI_RESET_ADAPTER        0x0004
00930 
00931 /** Maximum number of multicast MAC addresses */
00932 #define MAXNUM_MCADDR   8
00933 
00934 /** List of multicast MAC addresses */
00935 struct s_PXENV_UNDI_MCAST_ADDRESS {
00936         /** Number of multicast MAC addresses */
00937         UINT16_t MCastAddrCount;
00938         /** List of up to #MAXNUM_MCADDR multicast MAC addresses */
00939         MAC_ADDR_t McastAddr[MAXNUM_MCADDR];
00940 } PACKED;
00941 
00942 typedef struct s_PXENV_UNDI_MCAST_ADDRESS PXENV_UNDI_MCAST_ADDRESS_t;
00943 
00944 /** Parameter block for pxenv_undi_reset_adapter() */
00945 struct s_PXENV_UNDI_RESET {
00946         PXENV_STATUS_t  Status;         /**< PXE status code */
00947         /** Multicast MAC addresses */
00948         struct s_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf;
00949 } PACKED;
00950 
00951 typedef struct s_PXENV_UNDI_RESET PXENV_UNDI_RESET_t;
00952 
00953 extern PXENV_EXIT_t pxenv_undi_reset_adapter ( struct s_PXENV_UNDI_RESET
00954                                                *undi_reset_adapter );
00955 
00956 /** @} */ /* pxenv_undi_reset_adapter */
00957 
00958 /** @defgroup pxenv_undi_shutdown PXENV_UNDI_SHUTDOWN
00959  *
00960  *  UNDI SHUTDOWN
00961  *
00962  *  @{
00963  */
00964 
00965 /** PXE API function code for pxenv_undi_shutdown() */
00966 #define PXENV_UNDI_SHUTDOWN             0x0005
00967 
00968 /** Parameter block for pxenv_undi_shutdown() */
00969 struct s_PXENV_UNDI_SHUTDOWN {
00970         PXENV_STATUS_t  Status;         /**< PXE status code */
00971 } PACKED;
00972 
00973 typedef struct s_PXENV_UNDI_SHUTDOWN PXENV_UNDI_SHUTDOWN_t;
00974 
00975 extern PXENV_EXIT_t pxenv_undi_shutdown ( struct s_PXENV_UNDI_SHUTDOWN
00976                                           *undi_shutdown );
00977 
00978 /** @} */ /* pxenv_undi_shutdown */
00979 
00980 /** @defgroup pxenv_undi_open PXENV_UNDI_OPEN
00981  *
00982  *  UNDI OPEN
00983  *
00984  *  @{
00985  */
00986 
00987 /** PXE API function code for pxenv_undi_open() */
00988 #define PXENV_UNDI_OPEN                 0x0006
00989 
00990 /** Accept "directed" packets
00991  *
00992  * These are packets addresses to either this adapter's MAC address or
00993  * to any of the configured multicast MAC addresses (see
00994  * #s_PXENV_UNDI_MCAST_ADDRESS).
00995  */
00996 #define FLTR_DIRECTED   0x0001
00997 /** Accept broadcast packets */
00998 #define FLTR_BRDCST     0x0002
00999 /** Accept all packets; listen in promiscuous mode */
01000 #define FLTR_PRMSCS     0x0004
01001 /** Accept source-routed packets */
01002 #define FLTR_SRC_RTG    0x0008
01003 
01004 /** Parameter block for pxenv_undi_open() */
01005 struct s_PXENV_UNDI_OPEN {
01006         PXENV_STATUS_t  Status;         /**< PXE status code */
01007         /** Open flags as defined in NDIS 2.0
01008          *
01009          * This is the OpenOptions field as passed to the NDIS 2.0
01010          * OpenAdapter() API call.  It is defined to be "adapter
01011          * specific", though 0 is guaranteed to be a valid value.
01012          */
01013         UINT16_t OpenFlag;
01014         /** Receive packet filter
01015          *
01016          * This is the bitwise-OR of any of the following flags:
01017          * #FLTR_DIRECTED, #FLTR_BRDCST, #FLTR_PRMSCS and
01018          * #FLTR_SRC_RTG.
01019          */
01020         UINT16_t PktFilter;
01021         /** Multicast MAC addresses */
01022         struct s_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf;
01023 } PACKED;
01024 
01025 typedef struct s_PXENV_UNDI_OPEN PXENV_UNDI_OPEN_t;
01026 
01027 extern PXENV_EXIT_t pxenv_undi_open ( struct s_PXENV_UNDI_OPEN *undi_open );
01028 
01029 /** @} */ /* pxenv_undi_open */
01030 
01031 /** @defgroup pxenv_undi_close PXENV_UNDI_CLOSE
01032  *
01033  *  UNDI CLOSE
01034  *
01035  *  @{
01036  */
01037 
01038 /** PXE API function code for pxenv_undi_close() */
01039 #define PXENV_UNDI_CLOSE                0x0007
01040 
01041 /** Parameter block for pxenv_undi_close() */
01042 struct s_PXENV_UNDI_CLOSE {
01043         PXENV_STATUS_t  Status;         /**< PXE status code */
01044 } PACKED;
01045 
01046 typedef struct s_PXENV_UNDI_CLOSE PXENV_UNDI_CLOSE_t;
01047 
01048 extern PXENV_EXIT_t pxenv_undi_close ( struct s_PXENV_UNDI_CLOSE *undi_close );
01049 
01050 /** @} */ /* pxenv_undi_close */
01051 
01052 /** @defgroup pxenv_undi_transmit PXENV_UNDI_TRANSMIT
01053  *
01054  *  UNDI TRANSMIT PACKET
01055  *
01056  *  @{
01057  */
01058 
01059 /** PXE API function code for pxenv_undi_transmit() */
01060 #define PXENV_UNDI_TRANSMIT             0x0008
01061 
01062 #define P_UNKNOWN       0               /**< Media header already filled in */
01063 #define P_IP            1               /**< IP protocol */
01064 #define P_ARP           2               /**< ARP protocol */
01065 #define P_RARP          3               /**< RARP protocol */
01066 #define P_OTHER         4               /**< Other protocol */
01067 
01068 #define XMT_DESTADDR    0x0000          /**< Unicast packet */
01069 #define XMT_BROADCAST   0x0001          /**< Broadcast packet */
01070 
01071 /** Maximum number of data blocks in a transmit buffer descriptor */
01072 #define MAX_DATA_BLKS   8
01073 
01074 /** A transmit buffer descriptor, as pointed to by s_PXENV_UNDI_TRANSMIT::TBD
01075  */
01076 struct s_PXENV_UNDI_TBD {
01077         UINT16_t ImmedLength;           /**< Length of the transmit buffer */
01078         SEGOFF16_t Xmit;                /**< Address of the transmit buffer */
01079         UINT16_t DataBlkCount;
01080         /** Array of up to #MAX_DATA_BLKS additional transmit buffers */
01081         struct DataBlk {
01082                 /** Always 1
01083                  *
01084                  * A value of 0 would indicate that #TDDataPtr were an
01085                  * #ADDR32_t rather than a #SEGOFF16_t.  The PXE
01086                  * specification version 2.1 explicitly states that
01087                  * this is not supported; #TDDataPtr will always be a
01088                  * #SEGOFF16_t.
01089                  */
01090                 UINT8_t TDPtrType;
01091                 UINT8_t TDRsvdByte;     /**< Must be zero */
01092                 UINT16_t TDDataLen;     /**< Length of this transmit buffer */
01093                 SEGOFF16_t TDDataPtr;   /**< Address of this transmit buffer */
01094         } DataBlock[MAX_DATA_BLKS];
01095 } PACKED;
01096 
01097 typedef struct s_PXENV_UNDI_TBD PXENV_UNDI_TBD_t;
01098 
01099 /** Parameter block for pxenv_undi_transmit() */
01100 struct s_PXENV_UNDI_TRANSMIT {
01101         PXENV_STATUS_t  Status;         /**< PXE status code */
01102         /** Protocol
01103          *
01104          * Valid values are #P_UNKNOWN, #P_IP, #P_ARP or #P_RARP.  If
01105          * the caller has already filled in the media header, this
01106          * field must be set to #P_UNKNOWN.
01107          */
01108         UINT8_t Protocol;
01109         /** Unicast/broadcast flag
01110          *
01111          * Valid values are #XMT_DESTADDR or #XMT_BROADCAST.
01112          */
01113         UINT8_t XmitFlag;
01114         SEGOFF16_t DestAddr;            /**< Destination MAC address */
01115         /** Address of the Transmit Buffer Descriptor
01116          *
01117          * This is a pointer to a struct s_PXENV_UNDI_TBD.
01118          */
01119         SEGOFF16_t TBD;
01120         UINT32_t Reserved[2];           /**< Must be zero */
01121 } PACKED;
01122 
01123 typedef struct s_PXENV_UNDI_TRANSMIT PXENV_UNDI_TRANSMIT_t;
01124 
01125 extern PXENV_EXIT_t pxenv_undi_transmit ( struct s_PXENV_UNDI_TRANSMIT
01126                                           *undi_transmit );
01127 
01128 /** @} */ /* pxenv_undi_transmit */
01129 
01130 /** @defgroup pxenv_undi_set_mcast_address PXENV_UNDI_SET_MCAST_ADDRESS
01131  *
01132  *  UNDI SET MULTICAST ADDRESS
01133  *
01134  *  @{
01135  */
01136 
01137 /** PXE API function code for pxenv_undi_set_mcast_address() */
01138 #define PXENV_UNDI_SET_MCAST_ADDRESS    0x0009
01139 
01140 /** Parameter block for pxenv_undi_set_mcast_address() */
01141 struct s_PXENV_UNDI_SET_MCAST_ADDRESS {
01142         PXENV_STATUS_t  Status;         /**< PXE status code */
01143         /** List of multicast addresses */
01144         struct s_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf;
01145 } PACKED;
01146 
01147 typedef struct s_PXENV_UNDI_SET_MCAST_ADDRESS PXENV_UNDI_SET_MCAST_ADDRESS_t;
01148 
01149 extern PXENV_EXIT_t pxenv_undi_set_mcast_address (
01150                struct s_PXENV_UNDI_SET_MCAST_ADDRESS *undi_set_mcast_address );
01151 
01152 /** @} */ /* pxenv_undi_set_mcast_address */
01153 
01154 /** @defgroup pxenv_undi_set_station_address PXENV_UNDI_SET_STATION_ADDRESS
01155  *
01156  *  UNDI SET STATION ADDRESS
01157  *
01158  *  @{
01159  */
01160 
01161 /** PXE API function code for pxenv_undi_set_station_address() */
01162 #define PXENV_UNDI_SET_STATION_ADDRESS  0x000a
01163 
01164 /** Parameter block for pxenv_undi_set_station_address() */
01165 struct s_PXENV_UNDI_SET_STATION_ADDRESS {
01166         PXENV_STATUS_t  Status;         /**< PXE status code */
01167         MAC_ADDR_t StationAddress;      /**< Station MAC address */
01168 } PACKED;
01169 
01170 typedef struct s_PXENV_UNDI_SET_STATION_ADDRESS PXENV_UNDI_SET_STATION_ADDRESS_t;
01171 
01172 extern PXENV_EXIT_t pxenv_undi_set_station_address (
01173            struct s_PXENV_UNDI_SET_STATION_ADDRESS *undi_set_station_address );
01174 
01175 /** @} */ /* pxenv_undi_set_station_address */
01176 
01177 /** @defgroup pxenv_undi_set_packet_filter PXENV_UNDI_SET_PACKET_FILTER
01178  *
01179  *  UNDI SET PACKET FILTER
01180  *
01181  *  @{
01182  */
01183 
01184 /** PXE API function code for pxenv_undi_set_packet_filter() */
01185 #define PXENV_UNDI_SET_PACKET_FILTER    0x000b
01186 
01187 /** Parameter block for pxenv_undi_set_packet_filter() */
01188 struct s_PXENV_UNDI_SET_PACKET_FILTER {
01189         PXENV_STATUS_t  Status;         /**< PXE status code */
01190         /** Receive packet filter
01191          *
01192          * This field takes the same values as
01193          * s_PXENV_UNDI_OPEN::PktFilter.
01194          *
01195          * @note Yes, this field is a different size to
01196          * s_PXENV_UNDI_OPEN::PktFilter.  Blame "the managers at Intel
01197          * who apparently let a consultant come up with the spec
01198          * without any kind of adult supervision" (quote from hpa).
01199          */
01200         UINT8_t filter;
01201 } PACKED;
01202 
01203 typedef struct s_PXENV_UNDI_SET_PACKET_FILTER PXENV_UNDI_SET_PACKET_FILTER_t;
01204 
01205 extern PXENV_EXIT_t pxenv_undi_set_packet_filter (
01206                struct s_PXENV_UNDI_SET_PACKET_FILTER *undi_set_packet_filter );
01207 
01208 /** @} */ /* pxenv_undi_set_packet_filter */
01209 
01210 /** @defgroup pxenv_undi_get_information PXENV_UNDI_GET_INFORMATION
01211  *
01212  *  UNDI GET INFORMATION
01213  *
01214  *  @{
01215  */
01216 
01217 /** PXE API function code for pxenv_undi_get_information() */
01218 #define PXENV_UNDI_GET_INFORMATION      0x000c
01219 
01220 #define ETHER_TYPE              1       /**< Ethernet (10Mb) */
01221 #define EXP_ETHER_TYPE          2       /**< Experimental Ethernet (3Mb) */
01222 #define AX25_TYPE               3       /**< Amateur Radio AX.25 */
01223 #define TOKEN_RING_TYPE         4       /**< Proteon ProNET Token Ring */
01224 #define CHAOS_TYPE              5       /**< Chaos */
01225 #define IEEE_TYPE               6       /**< IEEE 802 Networks */
01226 #define ARCNET_TYPE             7       /**< ARCNET */
01227 
01228 /** Parameter block for pxenv_undi_get_information() */
01229 struct s_PXENV_UNDI_GET_INFORMATION {
01230         PXENV_STATUS_t  Status;         /**< PXE status code */
01231         UINT16_t BaseIo;                /**< I/O base address */
01232         UINT16_t IntNumber;             /**< IRQ number */
01233         UINT16_t MaxTranUnit;           /**< Adapter MTU */
01234         /** Hardware type
01235          *
01236          * Valid values are defined in RFC1010 ("Assigned numbers"),
01237          * and are #ETHER_TYPE, #EXP_ETHER_TYPE, #AX25_TYPE,
01238          * #TOKEN_RING_TYPE, #CHAOS_TYPE, #IEEE_TYPE or #ARCNET_TYPE.
01239          */
01240         UINT16_t HwType;
01241         UINT16_t HwAddrLen;             /**< MAC address length */
01242         MAC_ADDR_t CurrentNodeAddress;  /**< Current MAC address */
01243         MAC_ADDR_t PermNodeAddress;     /**< Permanent (EEPROM) MAC address */
01244         SEGSEL_t ROMAddress;            /**< Real-mode ROM segment address */
01245         UINT16_t RxBufCt;               /**< Receive queue length */
01246         UINT16_t TxBufCt;               /**< Transmit queue length */
01247 } PACKED;
01248 
01249 typedef struct s_PXENV_UNDI_GET_INFORMATION PXENV_UNDI_GET_INFORMATION_t;
01250 
01251 extern PXENV_EXIT_t pxenv_undi_get_information (
01252                    struct s_PXENV_UNDI_GET_INFORMATION *undi_get_information );
01253 
01254 /** @} */ /* pxenv_undi_get_information */
01255 
01256 /** @defgroup pxenv_undi_get_statistics PXENV_UNDI_GET_STATISTICS
01257  *
01258  *  UNDI GET STATISTICS
01259  *
01260  *  @{
01261  */
01262 
01263 /** PXE API function code for pxenv_undi_get_statistics() */
01264 #define PXENV_UNDI_GET_STATISTICS       0x000d
01265 
01266 /** Parameter block for pxenv_undi_get_statistics() */
01267 struct s_PXENV_UNDI_GET_STATISTICS {
01268         PXENV_STATUS_t  Status;         /**< PXE status code */
01269         UINT32_t XmtGoodFrames;         /**< Successful transmission count */
01270         UINT32_t RcvGoodFrames;         /**< Successful reception count */
01271         UINT32_t RcvCRCErrors;          /**< Receive CRC error count */
01272         UINT32_t RcvResourceErrors;     /**< Receive queue overflow count */
01273 } PACKED;
01274 
01275 typedef struct s_PXENV_UNDI_GET_STATISTICS PXENV_UNDI_GET_STATISTICS_t;
01276 
01277 extern PXENV_EXIT_t pxenv_undi_get_statistics (
01278                      struct s_PXENV_UNDI_GET_STATISTICS *undi_get_statistics );
01279 
01280 /** @} */ /* pxenv_undi_get_statistics */
01281 
01282 /** @defgroup pxenv_undi_clear_statistics PXENV_UNDI_CLEAR_STATISTICS
01283  *
01284  *  UNDI CLEAR STATISTICS
01285  *
01286  *  @{
01287  */
01288 
01289 /** PXE API function code for pxenv_undi_clear_statistics() */
01290 #define PXENV_UNDI_CLEAR_STATISTICS     0x000e
01291 
01292 /** Parameter block for pxenv_undi_clear_statistics() */
01293 struct s_PXENV_UNDI_CLEAR_STATISTICS {
01294         PXENV_STATUS_t  Status;         /**< PXE status code */
01295 } PACKED;
01296 
01297 typedef struct s_PXENV_UNDI_CLEAR_STATISTICS PXENV_UNDI_CLEAR_STATISTICS_t;
01298 
01299 extern PXENV_EXIT_t pxenv_undi_clear_statistics (
01300                  struct s_PXENV_UNDI_CLEAR_STATISTICS *undi_clear_statistics );
01301 
01302 /** @} */ /* pxenv_undi_clear_statistics */
01303 
01304 /** @defgroup pxenv_undi_initiate_diags PXENV_UNDI_INITIATE_DIAGS
01305  *
01306  *  UNDI INITIATE DIAGS
01307  *
01308  *  @{
01309  */
01310 
01311 /** PXE API function code for pxenv_undi_initiate_diags() */
01312 #define PXENV_UNDI_INITIATE_DIAGS       0x000f
01313 
01314 /** Parameter block for pxenv_undi_initiate_diags() */
01315 struct s_PXENV_UNDI_INITIATE_DIAGS {
01316         PXENV_STATUS_t  Status;         /**< PXE status code */
01317 } PACKED;
01318 
01319 typedef struct s_PXENV_UNDI_INITIATE_DIAGS PXENV_UNDI_INITIATE_DIAGS_t;
01320 
01321 extern PXENV_EXIT_t pxenv_undi_initiate_diags (
01322                      struct s_PXENV_UNDI_INITIATE_DIAGS *undi_initiate_diags );
01323 
01324 /** @} */ /* pxenv_undi_initiate_diags */
01325 
01326 /** @defgroup pxenv_undi_force_interrupt PXENV_UNDI_FORCE_INTERRUPT
01327  *
01328  *  UNDI FORCE INTERRUPT
01329  *
01330  *  @{
01331  */
01332 
01333 /** PXE API function code for pxenv_undi_force_interrupt() */
01334 #define PXENV_UNDI_FORCE_INTERRUPT      0x0010
01335 
01336 /** Parameter block for pxenv_undi_force_interrupt() */
01337 struct s_PXENV_UNDI_FORCE_INTERRUPT {
01338         PXENV_STATUS_t  Status;         /**< PXE status code */
01339 } PACKED;
01340 
01341 typedef struct s_PXENV_UNDI_FORCE_INTERRUPT PXENV_UNDI_FORCE_INTERRUPT_t;
01342 
01343 extern PXENV_EXIT_t pxenv_undi_force_interrupt (
01344                    struct s_PXENV_UNDI_FORCE_INTERRUPT *undi_force_interrupt );
01345 
01346 /** @} */ /* pxenv_undi_force_interrupt */
01347 
01348 /** @defgroup pxenv_undi_get_mcast_address PXENV_UNDI_GET_MCAST_ADDRESS
01349  *
01350  *  UNDI GET MULTICAST ADDRESS
01351  *
01352  *  @{
01353  */
01354 
01355 /** PXE API function code for pxenv_undi_get_mcast_address() */
01356 #define PXENV_UNDI_GET_MCAST_ADDRESS    0x0011
01357 
01358 /** Parameter block for pxenv_undi_get_mcast_address() */
01359 struct s_PXENV_UNDI_GET_MCAST_ADDRESS {
01360         PXENV_STATUS_t  Status;         /**< PXE status code */
01361         IP4_t InetAddr;                 /**< Multicast IP address */
01362         MAC_ADDR_t MediaAddr;           /**< Multicast MAC address */
01363 } PACKED;
01364 
01365 typedef struct s_PXENV_UNDI_GET_MCAST_ADDRESS PXENV_UNDI_GET_MCAST_ADDRESS_t;
01366 
01367 extern PXENV_EXIT_t pxenv_undi_get_mcast_address (
01368                struct s_PXENV_UNDI_GET_MCAST_ADDRESS *undi_get_mcast_address );
01369 
01370 /** @} */ /* pxenv_undi_get_mcast_address */
01371 
01372 /** @defgroup pxenv_undi_get_nic_type PXENV_UNDI_GET_NIC_TYPE
01373  *
01374  *  UNDI GET NIC TYPE
01375  *
01376  *  @{
01377  */
01378 
01379 /** PXE API function code for pxenv_undi_get_nic_type() */
01380 #define PXENV_UNDI_GET_NIC_TYPE         0x0012
01381 
01382 #define PCI_NIC         2               /**< PCI network card */
01383 #define PnP_NIC         3               /**< ISAPnP network card */
01384 #define CardBus_NIC     4               /**< CardBus network card */
01385 
01386 /** Information for a PCI or equivalent NIC */
01387 struct pci_nic_info {
01388         UINT16_t Vendor_ID;             /**< PCI vendor ID */
01389         UINT16_t Dev_ID;                /**< PCI device ID */
01390         UINT8_t Base_Class;             /**< PCI base class */
01391         UINT8_t Sub_Class;              /**< PCI sub class */
01392         UINT8_t Prog_Intf;              /**< PCI programming interface */
01393         UINT8_t Rev;                    /**< PCI revision */
01394         UINT16_t BusDevFunc;            /**< PCI bus:dev:fn address */
01395         UINT16_t SubVendor_ID;          /**< PCI subvendor ID */
01396         UINT16_t SubDevice_ID;          /**< PCI subdevice ID */
01397 } PACKED;
01398  
01399 /** Information for an ISAPnP or equivalent NIC */
01400 struct pnp_nic_info {
01401         UINT32_t EISA_Dev_ID;           /**< EISA device ID */
01402         UINT8_t Base_Class;             /**< Base class */
01403         UINT8_t Sub_Class;              /**< Sub class */
01404         UINT8_t Prog_Intf;              /**< Programming interface */
01405         /** Card Select Number assigned to card */
01406         UINT16_t CardSelNum;
01407 } PACKED;
01408 
01409 /** Parameter block for pxenv_undi_get_nic_type() */
01410 struct s_PXENV_UNDI_GET_NIC_TYPE {
01411         PXENV_STATUS_t  Status;         /**< PXE status code */
01412         /** NIC type
01413          *
01414          * Valid values are #PCI_NIC, #PnP_NIC or #CardBus_NIC.
01415          */
01416         UINT8_t NicType;
01417         /** NIC information */
01418         union nic_type_info {
01419                 /** NIC information (if #NicType==#PCI_NIC) */
01420                 struct pci_nic_info pci;
01421                 /** NIC information (if #NicType==#CardBus_NIC) */
01422                 struct pci_nic_info cardbus;
01423                 /** NIC information (if #NicType==#PnP_NIC) */
01424                 struct pnp_nic_info pnp;
01425         } info;
01426 } PACKED;
01427 
01428 typedef struct s_PXENV_UNDI_GET_NIC_TYPE PXENV_UNDI_GET_NIC_TYPE_t;
01429 
01430 extern PXENV_EXIT_t pxenv_undi_get_nic_type ( 
01431                          struct s_PXENV_UNDI_GET_NIC_TYPE *undi_get_nic_type );
01432 
01433 /** @} */ /* pxenv_undi_get_nic_type */
01434 
01435 /** @defgroup pxenv_undi_get_iface_info PXENV_UNDI_GET_IFACE_INFO
01436  *
01437  *  UNDI GET IFACE INFO
01438  *
01439  *  @{
01440  */
01441 
01442 /** PXE API function code for pxenv_undi_get_iface_info() */
01443 #define PXENV_UNDI_GET_IFACE_INFO       0x0013
01444 
01445 /** Broadcast supported */
01446 #define SUPPORTED_BROADCAST             0x0001
01447 /** Multicast supported */
01448 #define SUPPORTED_MULTICAST             0x0002
01449 /** Functional/group addressing supported */
01450 #define SUPPORTED_GROUP                 0x0004
01451 /** Promiscuous mode supported */
01452 #define SUPPORTED_PROMISCUOUS           0x0008
01453 /** Software settable station address */
01454 #define SUPPORTED_SET_STATION_ADDRESS   0x0010
01455 /** InitiateDiagnostics supported */
01456 #define SUPPORTED_DIAGNOSTICS           0x0040
01457 /** Reset MAC supported */
01458 #define SUPPORTED_RESET                 0x0400
01459 /** Open / Close Adapter supported */
01460 #define SUPPORTED_OPEN_CLOSE            0x0800
01461 /** Interrupt Request supported */
01462 #define SUPPORTED_IRQ                   0x1000
01463 
01464 /** Parameter block for pxenv_undi_get_iface_info() */
01465 struct s_PXENV_UNDI_GET_IFACE_INFO {
01466         PXENV_STATUS_t  Status;         /**< PXE status code */
01467         /** Interface type
01468          *
01469          * This is defined in the NDIS 2.0 specification to be one of
01470          * the strings "802.3", "802.4", "802.5", "802.6", "DIX",
01471          * "DIX+802.3", "APPLETALK", "ARCNET", "FDDI", "SDLC", "BSC",
01472          * "HDLC", or "ISDN".
01473          *
01474          * "Normal" Ethernet, for various historical reasons, is
01475          * "DIX+802.3".
01476          */
01477         UINT8_t IfaceType[16];
01478         UINT32_t LinkSpeed;             /**< Link speed, in bits per second */
01479         /** Service flags
01480          *
01481          * These are the "service flags" defined in the "MAC
01482          * Service-Specific Characteristics" table in the NDIS 2.0
01483          * specification.  Almost all of them are irrelevant to PXE.
01484          */
01485         UINT32_t ServiceFlags;
01486         UINT32_t Reserved[4];           /**< Must be zero */
01487 } PACKED;
01488 
01489 typedef struct s_PXENV_UNDI_GET_IFACE_INFO PXENV_UNDI_GET_IFACE_INFO_t;
01490 
01491 extern PXENV_EXIT_t pxenv_undi_get_iface_info (
01492                      struct s_PXENV_UNDI_GET_IFACE_INFO *undi_get_iface_info );
01493 
01494 /** @} */ /* pxenv_undi_get_iface_info */
01495 
01496 /** @defgroup pxenv_undi_get_state PXENV_UNDI_GET_STATE
01497  *
01498  *  UNDI GET STATE
01499  *
01500  *  @{
01501  */
01502 
01503 /** PXE API function code for pxenv_undi_get_state() */
01504 #define PXENV_UNDI_GET_STATE            0x0015
01505 
01506 /** pxenv_start_undi() has been called */
01507 #define PXE_UNDI_GET_STATE_STARTED      1
01508 /** pxenv_undi_initialize() has been called */
01509 #define PXE_UNDI_GET_STATE_INITIALIZED  2
01510 /** pxenv_undi_open() has been called */
01511 #define PXE_UNDI_GET_STATE_OPENED       3
01512 
01513 /** Parameter block for pxenv_undi_get_state() */
01514 struct s_PXENV_UNDI_GET_STATE {
01515         PXENV_STATUS_t  Status;         /**< PXE status code */
01516         /** Current state of the UNDI driver
01517          *
01518          * Valid values are #PXE_UNDI_GET_STATE_STARTED,
01519          * #PXE_UNDI_GET_STATE_INITIALIZED or
01520          * #PXE_UNDI_GET_STATE_OPENED.
01521          */
01522         UINT8_t UNDIstate;
01523 } PACKED;
01524 
01525 typedef struct s_PXENV_UNDI_GET_STATE PXENV_UNDI_GET_STATE_t;
01526 
01527 extern PXENV_EXIT_t pxenv_undi_get_state ( struct s_PXENV_UNDI_GET_STATE
01528                                            *undi_get_state );
01529 
01530 /** @} */ /* pxenv_undi_get_state */
01531 
01532 /** @defgroup pxenv_undi_isr PXENV_UNDI_ISR
01533  *
01534  *  UNDI ISR
01535  *
01536  *  @{
01537  */
01538 
01539 /** PXE API function code for pxenv_undi_isr() */
01540 #define PXENV_UNDI_ISR                  0x0014
01541 
01542 /** Determine whether or not this is our interrupt */
01543 #define PXENV_UNDI_ISR_IN_START         1
01544 /** Start processing interrupt */
01545 #define PXENV_UNDI_ISR_IN_PROCESS       2
01546 /** Continue processing interrupt */
01547 #define PXENV_UNDI_ISR_IN_GET_NEXT      3
01548 /** This interrupt was ours */
01549 #define PXENV_UNDI_ISR_OUT_OURS         0
01550 /** This interrupt was not ours */
01551 #define PXENV_UNDI_ISR_OUT_NOT_OURS     1
01552 /** Finished processing interrupt */
01553 #define PXENV_UNDI_ISR_OUT_DONE         0
01554 /** A packet transmission has completed */
01555 #define PXENV_UNDI_ISR_OUT_TRANSMIT     2
01556 /** A packet has been received */
01557 #define PXENV_UNDI_ISR_OUT_RECEIVE      3
01558 /** We are already in the middle of processing an interrupt */
01559 #define PXENV_UNDI_ISR_OUT_BUSY         4
01560 
01561 /** Unicast packet (or packet captured in promiscuous mode) */
01562 #define P_DIRECTED      0
01563 /** Broadcast packet */
01564 #define P_BROADCAST     1
01565 /** Multicast packet */
01566 #define P_MULTICAST     2
01567 
01568 /** Parameter block for pxenv_undi_isr() */
01569 struct s_PXENV_UNDI_ISR {
01570         PXENV_STATUS_t  Status;         /**< PXE status code */
01571         /** Function flag
01572          *
01573          * Valid values are #PXENV_UNDI_ISR_IN_START,
01574          * #PXENV_UNDI_ISR_IN_PROCESS, #PXENV_UNDI_ISR_IN_GET_NEXT,
01575          * #PXENV_UNDI_ISR_OUT_OURS, #PXENV_UNDI_ISR_OUT_NOT_OURS,
01576          * #PXENV_UNDI_ISR_OUT_DONE, #PXENV_UNDI_ISR_OUT_TRANSMIT,
01577          * #PXENV_UNDI_ISR_OUT_RECEIVE or #PXENV_UNDI_ISR_OUT_BUSY.
01578          */
01579         UINT16_t FuncFlag;
01580         UINT16_t BufferLength;          /**< Data buffer length */
01581         UINT16_t FrameLength;           /**< Total frame length */
01582         UINT16_t FrameHeaderLength;     /**< Frame header length */
01583         SEGOFF16_t Frame;               /**< Data buffer address */
01584         /** Protocol type
01585          *
01586          * Valid values are #P_IP, #P_ARP, #P_RARP or #P_OTHER.
01587          */
01588         UINT8_t ProtType;
01589         /** Packet type
01590          *
01591          * Valid values are #P_DIRECTED, #P_BROADCAST or #P_MULTICAST.
01592          */
01593         UINT8_t PktType;
01594 } PACKED;
01595 
01596 typedef struct s_PXENV_UNDI_ISR PXENV_UNDI_ISR_t;
01597 
01598 extern PXENV_EXIT_t pxenv_undi_isr ( struct s_PXENV_UNDI_ISR *undi_isr );
01599 
01600 /** @} */ /* pxenv_undi_isr */
01601 
01602 /** @} */ /* pxe_undi_api */
01603 
01604 /** @defgroup pxe_file_api PXE FILE API
01605  *
01606  * POSIX-like file operations
01607  *
01608  * @{
01609  */
01610 
01611 /** @defgroup pxenv_file_open PXENV_FILE_OPEN
01612  *
01613  * FILE OPEN
01614  *
01615  * @{
01616  */
01617 
01618 /** PXE API function code for pxenv_file_open() */
01619 #define PXENV_FILE_OPEN                 0x00e0
01620 
01621 /** Parameter block for pxenv_file_open() */
01622 struct s_PXENV_FILE_OPEN {
01623         PXENV_STATUS_t Status;          /**< PXE status code */
01624         UINT16_t FileHandle;            /**< File handle */
01625         SEGOFF16_t FileName;            /**< File URL */
01626         UINT32_t Reserved;              /**< Reserved */
01627 } PACKED;
01628 
01629 typedef struct s_PXENV_FILE_OPEN PXENV_FILE_OPEN_t;
01630 
01631 extern PXENV_EXIT_t pxenv_file_open ( struct s_PXENV_FILE_OPEN *file_open );
01632 
01633 /** @} */ /* pxenv_file_open */
01634 
01635 /** @defgroup pxenv_file_close PXENV_FILE_CLOSE
01636  *
01637  * FILE CLOSE
01638  *
01639  * @{
01640  */
01641 
01642 /** PXE API function code for pxenv_file_close() */
01643 #define PXENV_FILE_CLOSE                0x00e1
01644 
01645 /** Parameter block for pxenv_file_close() */
01646 struct s_PXENV_FILE_CLOSE {
01647         PXENV_STATUS_t Status;          /**< PXE status code */
01648         UINT16_t FileHandle;            /**< File handle */
01649 } PACKED;
01650 
01651 typedef struct s_PXENV_FILE_CLOSE PXENV_FILE_CLOSE_t;
01652 
01653 extern PXENV_EXIT_t pxenv_file_close ( struct s_PXENV_FILE_CLOSE
01654                                        *file_close );
01655 
01656 /** @} */ /* pxenv_file_close */
01657 
01658 /** @defgroup pxenv_file_select PXENV_FILE_SELECT
01659  *
01660  * FILE SELECT
01661  *
01662  * @{
01663  */
01664 
01665 /** PXE API function code for pxenv_file_select() */
01666 #define PXENV_FILE_SELECT               0x00e2
01667 
01668 /** File is ready for reading */
01669 #define RDY_READ                        0x0001
01670 
01671 /** Parameter block for pxenv_file_select() */
01672 struct s_PXENV_FILE_SELECT {
01673         PXENV_STATUS_t Status;          /**< PXE status code */
01674         UINT16_t FileHandle;            /**< File handle */
01675         UINT16_t Ready;                 /**< Indication of readiness */
01676 } PACKED;
01677 
01678 typedef struct s_PXENV_FILE_SELECT PXENV_FILE_SELECT_t;
01679 
01680 extern PXENV_EXIT_t pxenv_file_select ( struct s_PXENV_FILE_SELECT
01681                                         *file_select );
01682 
01683 /** @} */ /* pxenv_file_select */
01684 
01685 /** @defgroup pxenv_file_read PXENV_FILE_READ
01686  *
01687  * FILE READ
01688  *
01689  * @{
01690  */
01691 
01692 /** PXE API function code for pxenv_file_read() */
01693 #define PXENV_FILE_READ         0x00e3
01694 
01695 /** Parameter block for pxenv_file_read() */
01696 struct s_PXENV_FILE_READ {
01697         PXENV_STATUS_t Status;          /**< PXE status code */
01698         UINT16_t FileHandle;            /**< File handle */
01699         UINT16_t BufferSize;            /**< Data buffer size */
01700         SEGOFF16_t Buffer;              /**< Data buffer */
01701 } PACKED;
01702 
01703 typedef struct s_PXENV_FILE_READ PXENV_FILE_READ_t;
01704 
01705 extern PXENV_EXIT_t pxenv_file_read ( struct s_PXENV_FILE_READ *file_read );
01706 
01707 /** @} */ /* pxenv_file_read */
01708 
01709 /** @defgroup pxenv_get_file_size PXENV_GET_FILE_SIZE
01710  *
01711  * GET FILE SIZE
01712  *
01713  * @{
01714  */
01715 
01716 /** PXE API function code for pxenv_get_file_size() */
01717 #define PXENV_GET_FILE_SIZE             0x00e4
01718 
01719 /** Parameter block for pxenv_get_file_size() */
01720 struct s_PXENV_GET_FILE_SIZE {
01721         PXENV_STATUS_t Status;          /**< PXE status code */
01722         UINT16_t FileHandle;            /**< File handle */
01723         UINT32_t FileSize;              /**< File size */
01724 } PACKED;
01725 
01726 typedef struct s_PXENV_GET_FILE_SIZE PXENV_GET_FILE_SIZE_t;
01727 
01728 extern PXENV_EXIT_t pxenv_get_file_size ( struct s_PXENV_GET_FILE_SIZE
01729                                           *get_file_size );
01730 
01731 /** @} */ /* pxenv_get_file_size */
01732 
01733 /** @defgroup pxenv_file_exec PXENV_FILE_EXEC
01734  *
01735  * FILE EXEC
01736  *
01737  * @{
01738  */
01739 
01740 /** PXE API function code for pxenv_file_exec() */
01741 #define PXENV_FILE_EXEC                 0x00e5
01742 
01743 /** Parameter block for pxenv_file_exec() */
01744 struct s_PXENV_FILE_EXEC {
01745         PXENV_STATUS_t Status;          /**< PXE status code */
01746         SEGOFF16_t Command;             /**< Command to execute */
01747 } PACKED;
01748 
01749 typedef struct s_PXENV_FILE_EXEC PXENV_FILE_EXEC_t;
01750 
01751 extern PXENV_EXIT_t pxenv_file_exec ( struct s_PXENV_FILE_EXEC *file_exec );
01752 
01753 /** @} */ /* pxenv_file_exec */
01754 
01755 /** @defgroup pxenv_file_api_check PXENV_FILE_API_CHECK
01756  *
01757  * FILE API CHECK
01758  *
01759  * @{
01760  */
01761 
01762 /** PXE API function code for pxenv_file_api_check() */
01763 #define PXENV_FILE_API_CHECK            0x00e6
01764 
01765 /** Parameter block for pxenv_file_api_check() */
01766 struct s_PXENV_FILE_API_CHECK {
01767         PXENV_STATUS_t Status;          /**< PXE status code */
01768         UINT16_t Size;                  /**< Size of structure  */
01769         UINT32_t Magic;                 /**< Magic number */
01770         UINT32_t Provider;              /**< Implementation identifier */
01771         UINT32_t APIMask;               /**< Supported API functions */
01772         UINT32_t Flags;                 /**< Reserved for the future */
01773 } PACKED;
01774 
01775 typedef struct s_PXENV_FILE_API_CHECK PXENV_FILE_API_CHECK_t;
01776 
01777 extern PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK *file_api_check );
01778 
01779 /** @} */ /* pxenv_file_api_check */
01780 
01781 /** @defgroup pxenv_file_exit_hook PXENV_FILE_EXIT_HOOK
01782  *
01783  * FILE EXIT HOOK
01784  *
01785  * @{
01786  */
01787 
01788 /** PXE API function code for pxenv_file_exit_hook() */
01789 #define PXENV_FILE_EXIT_HOOK                    0x00e7
01790 
01791 /** Parameter block for pxenv_file_exit_hook() */
01792 struct s_PXENV_FILE_EXIT_HOOK {
01793         PXENV_STATUS_t Status;          /**< PXE status code */
01794         SEGOFF16_t Hook;                /**< SEG16:OFF16 to jump to */
01795 } PACKED;
01796 
01797 typedef struct s_PXENV_FILE_EXIT_HOOK PXENV_FILE_EXIT_HOOK_t;
01798 
01799 extern PXENV_EXIT_t pxenv_file_exit_hook ( struct s_PXENV_FILE_EXIT_HOOK *file_exit_hook );
01800 
01801 /** @} */ /* pxenv_file_exit_hook */
01802 
01803 /** @} */ /* pxe_file_api */
01804 
01805 /** @defgroup pxe_loader_api PXE Loader API
01806  *
01807  * The UNDI ROM loader API
01808  *
01809  * @{
01810  */
01811 
01812 /** Parameter block for undi_loader() */
01813 struct s_UNDI_LOADER {
01814         /** PXE status code */
01815         PXENV_STATUS_t Status;
01816         /** %ax register as for PXENV_START_UNDI */
01817         UINT16_t AX;
01818         /** %bx register as for PXENV_START_UNDI */
01819         UINT16_t BX;
01820         /** %dx register as for PXENV_START_UNDI */
01821         UINT16_t DX;
01822         /** %di register as for PXENV_START_UNDI */
01823         OFF16_t DI;
01824         /** %es register as for PXENV_START_UNDI */
01825         SEGSEL_t ES;
01826         /** UNDI data segment
01827          *
01828          * @note The PXE specification defines the type of this field
01829          * as #UINT16_t.  For x86, #SEGSEL_t and #UINT16_t are
01830          * equivalent anyway; for other architectures #SEGSEL_t makes
01831          * more sense.
01832          */
01833         SEGSEL_t UNDI_DS;
01834         /** UNDI code segment
01835          *
01836          * @note The PXE specification defines the type of this field
01837          * as #UINT16_t.  For x86, #SEGSEL_t and #UINT16_t are
01838          * equivalent anyway; for other architectures #SEGSEL_t makes
01839          * more sense.
01840          */
01841         SEGSEL_t UNDI_CS;
01842         /** Address of the !PXE structure (a struct s_PXE) */
01843         SEGOFF16_t PXEptr;
01844         /** Address of the PXENV+ structure (a struct s_PXENV) */
01845         SEGOFF16_t PXENVptr;
01846 } PACKED;
01847 
01848 typedef struct s_UNDI_LOADER UNDI_LOADER_t;
01849 
01850 extern PXENV_EXIT_t undi_loader ( struct s_UNDI_LOADER *undi_loader );
01851 
01852 /** @} */ /* pxe_loader_api */
01853 
01854 /** @} */ /* pxe */
01855 
01856 /** @page pxe_notes Etherboot PXE implementation notes
01857 
01858 @section pxe_routing IP routing
01859 
01860 Several PXE API calls (e.g. pxenv_tftp_open() and pxenv_udp_write())
01861 allow for the caller to specify a "relay agent IP address", often in a
01862 field called "gateway" or similar.  The PXE specification states that
01863 "The IP layer should provide space for a minimum of four routing
01864 entries obtained from the default router and static route DHCP option
01865 tags in the DHCPACK message, plus any non-zero giaddr field from the
01866 DHCPOFFER message(s) accepted by the client".
01867 
01868 The DHCP static route option ("option static-routes" in dhcpd.conf)
01869 works only for classed IP routing (i.e. it provides no way to specify
01870 a subnet mask).  Since virtually everything now uses classless IP
01871 routing, the DHCP static route option is almost totally useless, and
01872 is (according to the dhcp-options man page) not implemented by any of
01873 the popular DHCP clients.
01874 
01875 This leaves the caller-specified "relay agent IP address", the giaddr
01876 field from the DHCPOFFER message(s) and the default gateway(s)
01877 provided via the routers option ("option routers" in dhcpd.conf) in
01878 the DHCPACK message.  Each of these is a default gateway address.
01879 It's a fair bet that the routers option should take priority over the
01880 giaddr field, since the routers option has to be explicitly specified
01881 by the DHCP server operator.  Similarly, it's fair to assume that the
01882 caller-specified "relay agent IP address", if present, should take
01883 priority over any other routing table entries.
01884 
01885 @bug Etherboot currently ignores all potential sources of routing
01886 information other than the first router provided to it by a DHCP
01887 routers option.
01888 
01889 @section pxe_x86_modes x86 processor mode restrictions
01890 
01891 On the x86 platform, different PXE API calls have different
01892 restrictions on the processor modes (real or protected) that can be
01893 used.  See the individual API call descriptions for the restrictions
01894 that apply to any particular call.
01895 
01896 @subsection pxe_x86_pmode16 Real mode, or protected-mode with 16-bit stack
01897 
01898 The PXE specification states that the API function can be called in
01899 protected mode only if the s_PXE::StatusCallout field is set to a
01900 non-zero value, and that the API function cannot be called with a
01901 32-bit stack segment.
01902 
01903 Etherboot does not enforce either of these restrictions; they seem (as
01904 with so much of the PXE specification) to be artifacts of the Intel
01905 implementation.
01906 
01907 */
01908 
01909 #endif /* PXE_API_H */

Generated on Tue Apr 6 20:00:50 2010 for gPXE by  doxygen 1.5.7.1