iPXE
|
#include "pxe_types.h"
#include "pxe_error.h"
#include "pxe_api.h"
#include <ipxe/device.h>
#include <ipxe/tables.h>
Go to the source code of this file.
Data Structures | |
struct | s_PXENV_UNKNOWN |
Parameter block for pxenv_unknown() More... | |
union | u_PXENV_ANY |
struct | pxe_api_call |
A PXE API call. More... | |
struct | undi_rom_header |
An UNDI expansion ROM header. More... | |
struct | undi_rom_id |
An UNDI ROM ID structure. More... | |
struct | pcir_header |
A PCI expansion header. More... | |
Macros | |
#define | PXENV_UNKNOWN 0xffff |
PXE API invalid function code. More... | |
#define | PXE_API_CALLS __table ( struct pxe_api_call, "pxe_api_calls" ) |
PXE API call table. More... | |
#define | __pxe_api_call __table_entry ( PXE_API_CALLS, 01 ) |
Declare a PXE API call. More... | |
#define | PXE_API_CALL(_opcode, _entry, _params_type) |
Define a PXE API call. More... | |
#define | ROM_SIGNATURE 0xaa55 |
Signature for an expansion ROM. More... | |
#define | UNDI_ROM_ID_SIGNATURE ( ( 'U' << 0 ) + ( 'N' << 8 ) + ( 'D' << 16 ) + ( 'I' << 24 ) ) |
Signature for an UNDI ROM ID structure. More... | |
#define | PCIR_SIGNATURE ( ( 'P' << 0 ) + ( 'C' << 8 ) + ( 'I' << 16 ) + ( 'R' << 24 ) ) |
Signature for an UNDI ROM ID structure. More... | |
Typedefs | |
typedef struct s_PXENV_UNKNOWN | PXENV_UNKNOWN_t |
typedef union u_PXENV_ANY | PXENV_ANY_t |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
void | pxe_set_netdev (struct net_device *netdev) |
Set network device as current PXE network device. More... | |
void | pxe_fake_cached_info (void) |
Construct cached DHCP packets. More... | |
PXENV_EXIT_t | pxenv_tftp_read_file (struct s_PXENV_TFTP_READ_FILE *tftp_read_file) |
TFTP/MTFTP read file. More... | |
PXENV_EXIT_t | undi_loader (struct s_UNDI_LOADER *undi_loader) |
Variables | |
struct net_device * | pxe_netdev |
const char * | pxe_cmdline |
PXE command line. More... | |
#define PXE_API_CALLS __table ( struct pxe_api_call, "pxe_api_calls" ) |
#define __pxe_api_call __table_entry ( PXE_API_CALLS, 01 ) |
#define PXE_API_CALL | ( | _opcode, | |
_entry, | |||
_params_type | |||
) |
Define a PXE API call.
_opcode | Opcode |
_entry | Entry point |
_params_type | Type of parameter structure |
call | PXE API call |
#define UNDI_ROM_ID_SIGNATURE ( ( 'U' << 0 ) + ( 'N' << 8 ) + ( 'D' << 16 ) + ( 'I' << 24 ) ) |
#define PCIR_SIGNATURE ( ( 'P' << 0 ) + ( 'C' << 8 ) + ( 'I' << 16 ) + ( 'R' << 24 ) ) |
typedef struct s_PXENV_UNKNOWN PXENV_UNKNOWN_t |
typedef union u_PXENV_ANY PXENV_ANY_t |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
void pxe_set_netdev | ( | struct net_device * | netdev | ) |
Set network device as current PXE network device.
netdev | Network device, or NULL |
Definition at line 69 of file pxe_undi.c.
References netdev, netdev_get(), netdev_put(), netdev_rx_unfreeze(), NULL, and pxe_netdev.
Referenced by pxe_activate(), and pxe_deactivate().
void pxe_fake_cached_info | ( | void | ) |
Construct cached DHCP packets.
Definition at line 135 of file pxe_preboot.c.
References assert(), cached_info, pxe_dhcp_packet_creator::create, DBGC, info, memset(), NULL, pxe_dhcp_packet_creators, pxe_netdev, rc, and strerror().
Referenced by pxe_exec().
PXENV_EXIT_t pxenv_tftp_read_file | ( | struct s_PXENV_TFTP_READ_FILE * | tftp_read_file | ) |
TFTP/MTFTP read file.
tftp_read_file | Pointer to a struct s_PXENV_TFTP_READ_FILE |
s_PXENV_TFTP_READ_FILE::FileName | File name |
s_PXENV_TFTP_READ_FILE::BufferSize | Size of the receive buffer |
s_PXENV_TFTP_READ_FILE::Buffer | Address of the receive buffer |
s_PXENV_TFTP_READ_FILE::ServerIPAddress | TFTP server IP address |
s_PXENV_TFTP_READ_FILE::GatewayIPAddress | Relay agent IP address |
s_PXENV_TFTP_READ_FILE::McastIPAddress | File's multicast IP address |
s_PXENV_TFTP_READ_FILE::TFTPClntPort | Client multicast UDP port |
s_PXENV_TFTP_READ_FILE::TFTPSrvPort | Server multicast UDP port |
s_PXENV_TFTP_READ_FILE::TFTPOpenTimeOut | Time to wait for first packet |
s_PXENV_TFTP_READ_FILE::TFTPReopenDelay | MTFTP inactivity timeout |
PXENV_EXIT_SUCCESS | File downloaded successfully |
PXENV_EXIT_FAILURE | File not downloaded |
s_PXENV_TFTP_READ_FILE::Status | PXE status code |
s_PXENV_TFTP_READ_FILE::BufferSize | Length of downloaded file |
Downloads an entire file via either TFTP or MTFTP into the buffer pointed to by s_PXENV_TFTP_READ_FILE::Buffer.
The PXE specification does not make it clear how the caller requests that MTFTP be used rather than TFTP (or vice versa). One reasonable guess is that setting s_PXENV_TFTP_READ_FILE::McastIPAddress to 0.0.0.0 would cause TFTP to be used instead of MTFTP, though it is conceivable that some PXE stacks would interpret that as "use the DHCP-provided multicast IP address" instead. Some PXE stacks will not implement MTFTP at all, and will always use TFTP.
It is not specified whether or not s_PXENV_TFTP_READ_FILE::TFTPSrvPort will be used as the TFTP server port for TFTP (rather than MTFTP) downloads. Callers should assume that the only way to access a TFTP server on a non-standard port is to use pxenv_tftp_open() and pxenv_tftp_read().
If s_PXENV_TFTP_READ_FILE::GatewayIPAddress is 0.0.0.0, normal IP routing will take place. See the relevant implementation note for more details.
It is interesting to note that s_PXENV_TFTP_READ_FILE::Buffer is an ADDR32_t type, i.e. nominally a flat physical address. Some PXE NBPs (e.g. NTLDR) are known to call pxenv_tftp_read_file() in real mode with s_PXENV_TFTP_READ_FILE::Buffer set to an address above 1MB. This means that PXE stacks must be prepared to write to areas outside base memory. Exactly how this is to be achieved is not specified, though using INT 15,87 is as close to a standard method as any, and should probably be used. Switching to protected-mode in order to access high memory will fail if pxenv_tftp_read_file() is called in V86 mode; it is reasonably to expect that a V86 monitor would intercept the relatively well-defined INT 15,87 if it wants the PXE stack to be able to write to high memory.
Things get even more interesting if pxenv_tftp_read_file() is called in protected mode, because there is then absolutely no way for the PXE stack to write to an absolute physical address. You can't even get around the problem by creating a special "access everything" segment in the s_PXE data structure, because the #SEGDESC_t descriptors are limited to 64kB in size.
Previous versions of the PXE specification (e.g. WfM 1.1a) provide a separate API call, pxenv_tftp_read_file_pmode(), specifically to work around this problem. The s_PXENV_TFTP_READ_FILE_PMODE parameter block splits s_PXENV_TFTP_READ_FILE::Buffer into s_PXENV_TFTP_READ_FILE_PMODE::BufferSelector and s_PXENV_TFTP_READ_FILE_PMODE::BufferOffset, i.e. it provides a protected-mode segment:offset address for the data buffer. This API call is no longer present in version 2.1 of the PXE specification.
Etherboot makes the assumption that s_PXENV_TFTP_READ_FILE::Buffer is an offset relative to the caller's data segment, when pxenv_tftp_read_file() is called in protected mode.
On x86, you must set the s_PXE::StatusCallout field to a nonzero value before calling this function in protected mode. You cannot call this function with a 32-bit stack segment. (See the relevant implementation note for more details.)
Definition at line 480 of file pxe_tftp.c.
References pxe_tftp_connection::buffer, s_PXENV_TFTP_READ_FILE::Buffer, s_PXENV_TFTP_READ_FILE::BufferSize, DBG, EINPROGRESS, s_PXENV_TFTP_READ_FILE::FileName, pxe_tftp_connection::max_offset, phys_to_user(), pxe_tftp, pxe_tftp_close(), pxe_tftp_open(), PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, pxe_tftp_connection::rc, rc, s_PXENV_TFTP_READ_FILE::ServerIPAddress, pxe_tftp_connection::size, s_PXENV_TFTP_READ_FILE::Status, step(), and UNULL.
Referenced by pxenv_restart_tftp().
PXENV_EXIT_t undi_loader | ( | struct s_UNDI_LOADER * | undi_loader | ) |
Definition at line 39 of file pxe_loader.c.
References __from_text16, DBG, initialise(), ppxe, pxenv, PXENV_EXIT_SUCCESS, PXENV_STATUS_SUCCESS, rm_cs, and undi_loader().
Referenced by undi_loader().
struct net_device* pxe_netdev |
Definition at line 59 of file pxe_undi.c.
Referenced by pxe_api_call(), pxe_deactivate(), pxe_dump_mcast_list(), pxe_fake_cached_info(), pxe_netdev_close(), pxe_netdev_open(), pxe_notify(), pxe_set_netdev(), pxe_start_nbp(), pxenv_get_cached_info(), pxenv_restart_tftp(), pxenv_start_base(), pxenv_start_undi(), pxenv_stop_base(), pxenv_stop_undi(), pxenv_udp_open(), pxenv_udp_write(), pxenv_undi_cleanup(), pxenv_undi_clear_statistics(), pxenv_undi_close(), pxenv_undi_force_interrupt(), pxenv_undi_get_iface_info(), pxenv_undi_get_information(), pxenv_undi_get_mcast_address(), pxenv_undi_get_nic_type(), pxenv_undi_get_statistics(), pxenv_undi_initialize(), pxenv_undi_initiate_diags(), pxenv_undi_isr(), pxenv_undi_open(), pxenv_undi_reset_adapter(), pxenv_undi_set_mcast_address(), pxenv_undi_set_packet_filter(), pxenv_undi_set_station_address(), pxenv_undi_shutdown(), pxenv_undi_startup(), pxenv_undi_transmit(), and pxenv_unload_stack().
const char* pxe_cmdline |
PXE command line.
Definition at line 48 of file pxe_image.c.
Referenced by pxe_exec(), and pxenv_file_cmdline().