iPXE
Data Structures | Macros | Enumerations | Functions | Variables
pxe_preboot.c File Reference

PXE Preboot API. More...

#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <ipxe/uaccess.h>
#include <ipxe/dhcp.h>
#include <ipxe/fakedhcp.h>
#include <ipxe/device.h>
#include <ipxe/netdevice.h>
#include <ipxe/isapnp.h>
#include <ipxe/init.h>
#include <ipxe/if_ether.h>
#include <basemem_packet.h>
#include <biosint.h>
#include <rmsetjmp.h>
#include "pxe.h"
#include "pxe_call.h"

Go to the source code of this file.

Data Structures

union  pxe_cached_info
 A cached DHCP packet. More...
 
struct  pxe_dhcp_packet_creator
 A PXE DHCP packet creator. More...
 

Macros

#define cached_info   __use_data16 ( cached_info )
 

Enumerations

enum  pxe_cached_info_indices { CACHED_INFO_DHCPDISCOVER = ( PXENV_PACKET_TYPE_DHCP_DISCOVER - 1 ), CACHED_INFO_DHCPACK = ( PXENV_PACKET_TYPE_DHCP_ACK - 1 ), CACHED_INFO_BINL = ( PXENV_PACKET_TYPE_CACHED_REPLY - 1 ), NUM_CACHED_INFOS }
 Zero-based versions of PXENV_GET_CACHED_INFO::PacketType. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static const char * pxenv_get_cached_info_name (int packet_type)
 Name PXENV_GET_CACHED_INFO packet type. More...
 
static union pxe_cached_info __bss16_array (cached_info, [NUM_CACHED_INFOS])
 
void pxe_fake_cached_info (void)
 Construct cached DHCP packets. More...
 
static PXENV_EXIT_t pxenv_unload_stack (struct s_PXENV_UNLOAD_STACK *unload_stack)
 UNLOAD BASE CODE STACK. More...
 
static PXENV_EXIT_t pxenv_get_cached_info (struct s_PXENV_GET_CACHED_INFO *get_cached_info)
 
static PXENV_EXIT_t pxenv_restart_tftp (struct s_PXENV_TFTP_READ_FILE *restart_tftp)
 
static PXENV_EXIT_t pxenv_start_undi (struct s_PXENV_START_UNDI *start_undi)
 
static PXENV_EXIT_t pxenv_stop_undi (struct s_PXENV_STOP_UNDI *stop_undi)
 
static PXENV_EXIT_t pxenv_start_base (struct s_PXENV_START_BASE *start_base)
 
static PXENV_EXIT_t pxenv_stop_base (struct s_PXENV_STOP_BASE *stop_base)
 

Variables

uint16_t isapnp_read_port
 ISAPnP Read Port address. More...
 
static struct pxe_dhcp_packet_creator pxe_dhcp_packet_creators []
 PXE DHCP packet creators. More...
 
struct pxe_api_call pxe_preboot_api [] __pxe_api_call
 PXE preboot API. More...
 

Detailed Description

PXE Preboot API.

Definition in file pxe_preboot.c.

Macro Definition Documentation

◆ cached_info

#define cached_info   __use_data16 ( cached_info )

Definition at line 129 of file pxe_preboot.c.

Enumeration Type Documentation

◆ pxe_cached_info_indices

Zero-based versions of PXENV_GET_CACHED_INFO::PacketType.

Enumerator
CACHED_INFO_DHCPDISCOVER 
CACHED_INFO_DHCPACK 
CACHED_INFO_BINL 
NUM_CACHED_INFOS 

Definition at line 54 of file pxe_preboot.c.

54  {
59 };
#define PXENV_PACKET_TYPE_DHCP_ACK
The DHCP server's DHCPACK packet.
Definition: pxe_api.h:276
#define PXENV_PACKET_TYPE_DHCP_DISCOVER
The client's DHCPDISCOVER packet.
Definition: pxe_api.h:273
#define PXENV_PACKET_TYPE_CACHED_REPLY
The Boot Server's Discover Reply packet.
Definition: pxe_api.h:283

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ pxenv_get_cached_info_name()

static const char* pxenv_get_cached_info_name ( int  packet_type)
inlinestatic

Name PXENV_GET_CACHED_INFO packet type.

Parameters
packet_typePacket type
Return values
nameName of packet type

Definition at line 104 of file pxe_preboot.c.

104  {
105  switch ( packet_type ) {
107  return "DHCPDISCOVER";
109  return "DHCPACK";
111  return "BINL";
112  default:
113  return "<INVALID>";
114  }
115 }
#define PXENV_PACKET_TYPE_DHCP_ACK
The DHCP server's DHCPACK packet.
Definition: pxe_api.h:276
#define PXENV_PACKET_TYPE_DHCP_DISCOVER
The client's DHCPDISCOVER packet.
Definition: pxe_api.h:273
#define PXENV_PACKET_TYPE_CACHED_REPLY
The Boot Server's Discover Reply packet.
Definition: pxe_api.h:283

References PXENV_PACKET_TYPE_CACHED_REPLY, PXENV_PACKET_TYPE_DHCP_ACK, and PXENV_PACKET_TYPE_DHCP_DISCOVER.

Referenced by pxenv_get_cached_info().

◆ __bss16_array()

static union pxe_cached_info __bss16_array ( cached_info  )
static

◆ pxe_fake_cached_info()

void pxe_fake_cached_info ( void  )

Construct cached DHCP packets.

Definition at line 135 of file pxe_preboot.c.

135  {
136  struct pxe_dhcp_packet_creator *creator;
137  union pxe_cached_info *info;
138  unsigned int i;
139  int rc;
140 
141  /* Sanity check */
142  assert ( pxe_netdev != NULL );
143 
144  /* Erase any stale packets */
145  memset ( cached_info, 0, sizeof ( cached_info ) );
146 
147  /* Construct all DHCP packets */
148  for ( i = 0 ; i < ( sizeof ( pxe_dhcp_packet_creators ) /
149  sizeof ( pxe_dhcp_packet_creators[0] ) ) ; i++ ) {
150 
151  /* Construct DHCP packet */
152  creator = &pxe_dhcp_packet_creators[i];
153  info = &cached_info[i];
154  if ( ( rc = creator->create ( pxe_netdev, info,
155  sizeof ( *info ) ) ) != 0 ) {
156  DBGC ( &pxe_netdev, " failed to build packet: %s\n",
157  strerror ( rc ) );
158  /* Continue constructing remaining packets */
159  }
160  }
161 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
u32 info
Definition: ar9003_mac.h:67
#define DBGC(...)
Definition: compiler.h:505
static struct pxe_dhcp_packet_creator pxe_dhcp_packet_creators[]
PXE DHCP packet creators.
Definition: pxe_preboot.c:91
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
A cached DHCP packet.
Definition: pxe_preboot.c:62
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
struct net_device * pxe_netdev
Definition: pxe_undi.c:59
#define cached_info
Definition: pxe_preboot.c:129
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
A PXE DHCP packet creator.
Definition: pxe_preboot.c:78
int(* create)(struct net_device *netdev, void *data, size_t max_len)
Create DHCP packet.
Definition: pxe_preboot.c:86
void * memset(void *dest, int character, size_t len) __nonnull

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_unload_stack()

static PXENV_EXIT_t pxenv_unload_stack ( struct s_PXENV_UNLOAD_STACK unload_stack)
static

UNLOAD BASE CODE STACK.

Parameters
None-
Return values
...

Definition at line 171 of file pxe_preboot.c.

171  {
172  DBGC ( &pxe_netdev, "PXENV_UNLOAD_STACK\n" );
173 
174  unload_stack->Status = PXENV_STATUS_SUCCESS;
175  return PXENV_EXIT_SUCCESS;
176 }
#define DBGC(...)
Definition: compiler.h:505
PXENV_STATUS_t Status
PXE status code.
Definition: pxe_api.h:254
struct net_device * pxe_netdev
Definition: pxe_undi.c:59
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
#define PXENV_STATUS_SUCCESS
Definition: pxe_error.h:19

References DBGC, pxe_netdev, PXENV_EXIT_SUCCESS, PXENV_STATUS_SUCCESS, and s_PXENV_UNLOAD_STACK::Status.

◆ pxenv_get_cached_info()

static PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO get_cached_info)
static

Definition at line 183 of file pxe_preboot.c.

183  {
184  union pxe_cached_info *info;
185  unsigned int idx;
186  size_t len;
188 
189  DBGC ( &pxe_netdev, "PXENV_GET_CACHED_INFO %s to %04x:%04x+%x",
190  pxenv_get_cached_info_name ( get_cached_info->PacketType ),
191  get_cached_info->Buffer.segment,
192  get_cached_info->Buffer.offset, get_cached_info->BufferSize );
193 
194  /* Sanity check */
195  idx = ( get_cached_info->PacketType - 1 );
196  if ( idx >= NUM_CACHED_INFOS ) {
197  DBGC ( &pxe_netdev, " bad PacketType %d\n",
198  get_cached_info->PacketType );
199  get_cached_info->Status = PXENV_STATUS_UNSUPPORTED;
200  return PXENV_EXIT_FAILURE;
201  }
202  info = &cached_info[idx];
203 
204  /* Copy packet (if applicable) */
205  len = get_cached_info->BufferSize;
206  if ( len == 0 ) {
207  /* Point client at our cached buffer.
208  *
209  * To add to the fun, Intel decided at some point in
210  * the evolution of the PXE specification to add the
211  * BufferLimit field, which we are meant to fill in
212  * with the length of our packet buffer, so that the
213  * caller can safely modify the boot server reply
214  * packet stored therein. However, this field was not
215  * present in earlier versions of the PXE spec, and
216  * there is at least one PXE NBP (Altiris) which
217  * allocates only exactly enough space for this
218  * earlier, shorter version of the structure. If we
219  * actually fill in the BufferLimit field, we
220  * therefore risk trashing random areas of the
221  * caller's memory. If we *don't* fill it in, then
222  * the caller is at liberty to assume that whatever
223  * random value happened to be in that location
224  * represents the length of the buffer we've just
225  * passed back to it.
226  *
227  * Since older PXE stacks won't fill this field in
228  * anyway, it's probably safe to assume that no
229  * callers actually rely on it, so we choose to not
230  * fill it in.
231  */
232  get_cached_info->Buffer.segment = rm_ds;
233  get_cached_info->Buffer.offset = __from_data16 ( info );
234  get_cached_info->BufferSize = sizeof ( *info );
235  DBGC ( &pxe_netdev, " using %04x:%04x+%04x['%x']",
236  get_cached_info->Buffer.segment,
237  get_cached_info->Buffer.offset,
238  get_cached_info->BufferSize,
239  get_cached_info->BufferLimit );
240  } else {
241  /* Copy packet to client buffer */
242  if ( len > sizeof ( *info ) )
243  len = sizeof ( *info );
244  if ( len < sizeof ( *info ) )
245  DBGC ( &pxe_netdev, " buffer may be too short" );
246  buffer = real_to_user ( get_cached_info->Buffer.segment,
247  get_cached_info->Buffer.offset );
248  copy_to_user ( buffer, 0, info, len );
249  get_cached_info->BufferSize = len;
250  }
251 
252  DBGC ( &pxe_netdev, "\n" );
253  get_cached_info->Status = PXENV_STATUS_SUCCESS;
254  return PXENV_EXIT_SUCCESS;
255 }
static const char * pxenv_get_cached_info_name(int packet_type)
Name PXENV_GET_CACHED_INFO packet type.
Definition: pxe_preboot.c:104
UINT16_t BufferLimit
Maximum buffer size.
Definition: pxe_api.h:296
u32 info
Definition: ar9003_mac.h:67
#define PXENV_EXIT_FAILURE
An error occurred.
Definition: pxe_types.h:46
#define DBGC(...)
Definition: compiler.h:505
UINT16_t PacketType
Packet type.
Definition: pxe_api.h:293
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Definition: netvsc.h:16
#define rm_ds
Definition: libkir.h:39
uint32_t userptr_t
A pointer to a user buffer.
Definition: libkir.h:159
PXENV_STATUS_t Status
PXE status code.
Definition: pxe_api.h:287
A cached DHCP packet.
Definition: pxe_preboot.c:62
UINT16_t BufferSize
Buffer size.
Definition: pxe_api.h:294
struct net_device * pxe_netdev
Definition: pxe_undi.c:59
static __always_inline void copy_to_user(userptr_t dest, off_t dest_off, const void *src, size_t len)
Copy data to user buffer.
Definition: uaccess.h:398
#define PXENV_STATUS_UNSUPPORTED
Definition: pxe_error.h:22
SEGOFF16_t Buffer
Buffer address.
Definition: pxe_api.h:295
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
#define __from_data16(pointer)
Definition: libkir.h:22
static __always_inline userptr_t real_to_user(unsigned int segment, unsigned int offset)
Convert segment:offset address to user buffer.
Definition: realmode.h:75
#define PXENV_STATUS_SUCCESS
Definition: pxe_error.h:19
#define cached_info
Definition: pxe_preboot.c:129
uint32_t len
Length.
Definition: ena.h:14

References __from_data16, buffer, s_PXENV_GET_CACHED_INFO::Buffer, s_PXENV_GET_CACHED_INFO::BufferLimit, s_PXENV_GET_CACHED_INFO::BufferSize, cached_info, copy_to_user(), DBGC, info, len, NUM_CACHED_INFOS, s_PXENV_GET_CACHED_INFO::PacketType, pxe_netdev, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, pxenv_get_cached_info_name(), PXENV_STATUS_SUCCESS, PXENV_STATUS_UNSUPPORTED, real_to_user(), rm_ds, and s_PXENV_GET_CACHED_INFO::Status.

◆ pxenv_restart_tftp()

static PXENV_EXIT_t pxenv_restart_tftp ( struct s_PXENV_TFTP_READ_FILE restart_tftp)
static

Definition at line 262 of file pxe_preboot.c.

262  {
263  PXENV_EXIT_t tftp_exit;
264 
265  DBGC ( &pxe_netdev, "PXENV_RESTART_TFTP\n" );
266 
267  /* Words cannot describe the complete mismatch between the PXE
268  * specification and any possible version of reality...
269  */
270  restart_tftp->Buffer = PXE_LOAD_PHYS; /* Fixed by spec, apparently */
271  restart_tftp->BufferSize = ( 0xa0000 - PXE_LOAD_PHYS ); /* Near enough */
272  tftp_exit = pxenv_tftp_read_file ( restart_tftp );
273  if ( tftp_exit != PXENV_EXIT_SUCCESS )
274  return tftp_exit;
275 
276  /* Restart NBP */
278 }
#define DBGC(...)
Definition: compiler.h:505
PXENV_EXIT_t pxenv_tftp_read_file(struct s_PXENV_TFTP_READ_FILE *tftp_read_file)
TFTP/MTFTP read file.
Definition: pxe_tftp.c:480
UINT32_t BufferSize
Size of data buffer.
Definition: pxe_api.h:648
UINT16_t PXENV_EXIT_t
A PXE exit code.
Definition: pxe_types.h:44
struct net_device * pxe_netdev
Definition: pxe_undi.c:59
#define PXENV_RESTART_TFTP
PXE API function code for pxenv_restart_tftp()
Definition: pxe_api.h:418
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
ADDR32_t Buffer
Address of data buffer.
Definition: pxe_api.h:649
#define PXE_LOAD_PHYS
PXE physical load address.
Definition: pxe_call.h:24
#define rmlongjmp(_env, _val)
Definition: rmsetjmp.h:22
rmjmp_buf pxe_restart_nbp
Jump buffer for PXENV_RESTART_TFTP.
Definition: pxe_call.c:330

References s_PXENV_TFTP_READ_FILE::Buffer, s_PXENV_TFTP_READ_FILE::BufferSize, DBGC, PXE_LOAD_PHYS, pxe_netdev, pxe_restart_nbp, PXENV_EXIT_SUCCESS, PXENV_RESTART_TFTP, pxenv_tftp_read_file(), and rmlongjmp.

◆ pxenv_start_undi()

static PXENV_EXIT_t pxenv_start_undi ( struct s_PXENV_START_UNDI start_undi)
static

Definition at line 284 of file pxe_preboot.c.

284  {
285  unsigned int bus_type;
286  unsigned int location;
287  struct net_device *netdev;
288 
289  DBGC ( &pxe_netdev, "PXENV_START_UNDI %04x:%04x:%04x\n",
290  start_undi->AX, start_undi->BX, start_undi->DX );
291 
292  /* Determine bus type and location. Use a heuristic to decide
293  * whether we are PCI or ISAPnP
294  */
295  if ( ( start_undi->DX >= ISAPNP_READ_PORT_MIN ) &&
296  ( start_undi->DX <= ISAPNP_READ_PORT_MAX ) &&
297  ( start_undi->BX >= ISAPNP_CSN_MIN ) &&
298  ( start_undi->BX <= ISAPNP_CSN_MAX ) ) {
299  bus_type = BUS_TYPE_ISAPNP;
300  location = start_undi->BX;
301  /* Record ISAPnP read port for use by isapnp.c */
302  isapnp_read_port = start_undi->DX;
303  } else {
304  bus_type = BUS_TYPE_PCI;
305  location = start_undi->AX;
306  }
307 
308  /* Probe for devices, etc. */
309  startup();
310 
311  /* Look for a matching net device */
312  netdev = find_netdev_by_location ( bus_type, location );
313  if ( ! netdev ) {
314  DBGC ( &pxe_netdev, "PXENV_START_UNDI could not find matching "
315  "net device\n" );
317  return PXENV_EXIT_FAILURE;
318  }
319  DBGC ( &pxe_netdev, "PXENV_START_UNDI found net device %s\n",
320  netdev->name );
321 
322  /* Activate PXE */
323  pxe_activate ( netdev );
324 
325  start_undi->Status = PXENV_STATUS_SUCCESS;
326  return PXENV_EXIT_SUCCESS;
327 }
void pxe_activate(struct net_device *netdev)
Activate PXE stack.
Definition: pxe_call.c:276
#define PXENV_EXIT_FAILURE
An error occurred.
Definition: pxe_types.h:46
#define DBGC(...)
Definition: compiler.h:505
#define ISAPNP_CSN_MAX
Definition: isapnp.h:76
#define ISAPNP_READ_PORT_MAX
Definition: isapnp.h:65
#define PXENV_STATUS_UNDI_CANNOT_INITIALIZE_NIC
Definition: pxe_error.h:74
#define BUS_TYPE_PCI
PCI bus type.
Definition: device.h:43
#define ISAPNP_CSN_MIN
Definition: isapnp.h:75
static struct net_device * netdev
Definition: gdbudp.c:52
UINT16_t BX
bx register as passed to the Option ROM initialisation routine.
Definition: pxe_api.h:453
struct net_device * pxe_netdev
Definition: pxe_undi.c:59
A network device.
Definition: netdevice.h:352
#define ISAPNP_READ_PORT_MIN
Definition: isapnp.h:59
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
char name[NETDEV_NAME_LEN]
Name of this network device.
Definition: netdevice.h:362
uint16_t isapnp_read_port
ISAPnP Read Port address.
Definition: pxe_preboot.c:51
#define PXENV_STATUS_SUCCESS
Definition: pxe_error.h:19
UINT16_t AX
ax register as passed to the Option ROM initialisation routine.
Definition: pxe_api.h:446
struct net_device * find_netdev_by_location(unsigned int bus_type, unsigned int location)
Get network device by PCI bus:dev.fn address.
Definition: netdevice.c:1029
PXENV_STATUS_t Status
PXE status code.
Definition: pxe_api.h:439
UINT16_t DX
dx register as passed to the Option ROM initialisation routine.
Definition: pxe_api.h:462
void startup(void)
Start up iPXE.
Definition: init.c:67
#define BUS_TYPE_ISAPNP
ISAPnP bus type.
Definition: device.h:46

References s_PXENV_START_UNDI::AX, BUS_TYPE_ISAPNP, BUS_TYPE_PCI, s_PXENV_START_UNDI::BX, DBGC, s_PXENV_START_UNDI::DX, find_netdev_by_location(), ISAPNP_CSN_MAX, ISAPNP_CSN_MIN, isapnp_read_port, ISAPNP_READ_PORT_MAX, ISAPNP_READ_PORT_MIN, net_device::name, netdev, pxe_activate(), pxe_netdev, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS_SUCCESS, PXENV_STATUS_UNDI_CANNOT_INITIALIZE_NIC, startup(), and s_PXENV_START_UNDI::Status.

◆ pxenv_stop_undi()

static PXENV_EXIT_t pxenv_stop_undi ( struct s_PXENV_STOP_UNDI stop_undi)
static

Definition at line 333 of file pxe_preboot.c.

333  {
334  DBGC ( &pxe_netdev, "PXENV_STOP_UNDI\n" );
335 
336  /* Deactivate PXE */
337  pxe_deactivate();
338 
339  /* Prepare for unload */
340  shutdown_boot();
341 
342  /* Check to see if we still have any hooked interrupts */
343  if ( hooked_bios_interrupts != 0 ) {
344  DBGC ( &pxe_netdev, "PXENV_STOP_UNDI failed: %d interrupts "
345  "still hooked\n", hooked_bios_interrupts );
346  stop_undi->Status = PXENV_STATUS_KEEP_UNDI;
347  return PXENV_EXIT_FAILURE;
348  }
349 
350  stop_undi->Status = PXENV_STATUS_SUCCESS;
351  return PXENV_EXIT_SUCCESS;
352 }
PXENV_STATUS_t Status
PXE status code.
Definition: pxe_api.h:509
#define PXENV_EXIT_FAILURE
An error occurred.
Definition: pxe_types.h:46
#define DBGC(...)
Definition: compiler.h:505
int pxe_deactivate(void)
Deactivate PXE stack.
Definition: pxe_call.c:307
#define PXENV_STATUS_KEEP_UNDI
Definition: pxe_error.h:23
#define hooked_bios_interrupts
Definition: biosint.h:25
struct net_device * pxe_netdev
Definition: pxe_undi.c:59
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
#define PXENV_STATUS_SUCCESS
Definition: pxe_error.h:19
static void shutdown_boot(void)
Shut down system for OS boot.
Definition: init.h:76

References DBGC, hooked_bios_interrupts, pxe_deactivate(), pxe_netdev, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS_KEEP_UNDI, PXENV_STATUS_SUCCESS, shutdown_boot(), and s_PXENV_STOP_UNDI::Status.

◆ pxenv_start_base()

static PXENV_EXIT_t pxenv_start_base ( struct s_PXENV_START_BASE start_base)
static

Definition at line 358 of file pxe_preboot.c.

358  {
359  DBGC ( &pxe_netdev, "PXENV_START_BASE\n" );
360 
361  start_base->Status = PXENV_STATUS_UNSUPPORTED;
362  return PXENV_EXIT_FAILURE;
363 }
#define PXENV_EXIT_FAILURE
An error occurred.
Definition: pxe_types.h:46
#define DBGC(...)
Definition: compiler.h:505
struct net_device * pxe_netdev
Definition: pxe_undi.c:59
#define PXENV_STATUS_UNSUPPORTED
Definition: pxe_error.h:22
PXENV_STATUS_t Status
PXE status code.
Definition: pxe_api.h:528

References DBGC, pxe_netdev, PXENV_EXIT_FAILURE, PXENV_STATUS_UNSUPPORTED, and s_PXENV_START_BASE::Status.

◆ pxenv_stop_base()

static PXENV_EXIT_t pxenv_stop_base ( struct s_PXENV_STOP_BASE stop_base)
static

Definition at line 369 of file pxe_preboot.c.

369  {
370  DBGC ( &pxe_netdev, "PXENV_STOP_BASE\n" );
371 
372  /* The only time we will be called is when the NBP is trying
373  * to shut down the PXE stack. There's nothing we need to do
374  * in this call.
375  */
376 
377  stop_base->Status = PXENV_STATUS_SUCCESS;
378  return PXENV_EXIT_SUCCESS;
379 }
#define DBGC(...)
Definition: compiler.h:505
PXENV_STATUS_t Status
PXE status code.
Definition: pxe_api.h:547
struct net_device * pxe_netdev
Definition: pxe_undi.c:59
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
#define PXENV_STATUS_SUCCESS
Definition: pxe_error.h:19

References DBGC, pxe_netdev, PXENV_EXIT_SUCCESS, PXENV_STATUS_SUCCESS, and s_PXENV_STOP_BASE::Status.

Variable Documentation

◆ isapnp_read_port

uint16_t isapnp_read_port

ISAPnP Read Port address.

ROM prefix may be able to set this address, which is why this is non-static.

Definition at line 51 of file pxe_preboot.c.

Referenced by pxenv_start_undi().

◆ pxe_dhcp_packet_creators

struct pxe_dhcp_packet_creator pxe_dhcp_packet_creators[]
static
Initial value:
= {
}
int create_fakedhcpack(struct net_device *netdev, void *data, size_t max_len)
Create fake DHCPACK packet.
Definition: fakedhcp.c:136
int create_fakedhcpdiscover(struct net_device *netdev, void *data, size_t max_len)
Create fake DHCPDISCOVER packet.
Definition: fakedhcp.c:109
int create_fakepxebsack(struct net_device *netdev, void *data, size_t max_len)
Create fake PXE Boot Server ACK packet.
Definition: fakedhcp.c:178

PXE DHCP packet creators.

Definition at line 91 of file pxe_preboot.c.

Referenced by pxe_fake_cached_info().

◆ __pxe_api_call

struct pxe_api_call pxe_preboot_api [] __pxe_api_call
Initial value:
= {
}
Parameter block for pxenv_stop_base()
Definition: pxe_api.h:546
static PXENV_EXIT_t pxenv_restart_tftp(struct s_PXENV_TFTP_READ_FILE *restart_tftp)
Definition: pxe_preboot.c:262
#define PXENV_START_UNDI
PXE API function code for pxenv_start_undi()
Definition: pxe_api.h:435
#define PXENV_STOP_UNDI
PXE API function code for pxenv_stop_undi()
Definition: pxe_api.h:505
Parameter block for pxenv_unload_stack()
Definition: pxe_api.h:253
static PXENV_EXIT_t pxenv_stop_undi(struct s_PXENV_STOP_UNDI *stop_undi)
Definition: pxe_preboot.c:333
Parameter block for pxenv_get_cached_info()
Definition: pxe_api.h:286
#define PXENV_START_BASE
PXE API function code for pxenv_start_base()
Definition: pxe_api.h:524
#define PXE_API_CALL(_opcode, _entry, _params_type)
Define a PXE API call.
Definition: pxe.h:108
static PXENV_EXIT_t pxenv_start_base(struct s_PXENV_START_BASE *start_base)
Definition: pxe_preboot.c:358
static PXENV_EXIT_t pxenv_unload_stack(struct s_PXENV_UNLOAD_STACK *unload_stack)
UNLOAD BASE CODE STACK.
Definition: pxe_preboot.c:171
#define PXENV_RESTART_TFTP
PXE API function code for pxenv_restart_tftp()
Definition: pxe_api.h:418
#define PXENV_UNLOAD_STACK
PXE API function code for pxenv_unload_stack()
Definition: pxe_api.h:250
static PXENV_EXIT_t pxenv_get_cached_info(struct s_PXENV_GET_CACHED_INFO *get_cached_info)
Definition: pxe_preboot.c:183
Parameter block for pxenv_start_base()
Definition: pxe_api.h:527
Parameter block for pxenv_tftp_read_file()
Definition: pxe_api.h:645
#define PXENV_GET_CACHED_INFO
PXE API function code for pxenv_get_cached_info()
Definition: pxe_api.h:270
#define PXENV_STOP_BASE
PXE API function code for pxenv_stop_base()
Definition: pxe_api.h:543
Parameter block for pxenv_start_undi()
Definition: pxe_api.h:438
Parameter block for pxenv_stop_undi()
Definition: pxe_api.h:508
static PXENV_EXIT_t pxenv_stop_base(struct s_PXENV_STOP_BASE *stop_base)
Definition: pxe_preboot.c:369
static PXENV_EXIT_t pxenv_start_undi(struct s_PXENV_START_UNDI *start_undi)
Definition: pxe_preboot.c:284

PXE preboot API.

Definition at line 382 of file pxe_preboot.c.