42 #define EINFO_EPXENBP \ 43 __einfo_uniqify ( EINFO_EPLATFORM, 0x01, \ 44 "External PXE NBP error" ) 45 #define EPXENBP( status ) EPLATFORM ( EINFO_EPXENBP, status ) 49 #define pxe_int_1a_vector __use_text16 ( pxe_int_1a_vector ) 59 #define _text16_memsz ( ( size_t ) _text16_memsz ) 63 #define _data16_memsz ( ( size_t ) _data16_memsz ) 67 { .
name =
"pxeapi.tx" };
71 { .
name =
"pxeapi.isr" };
79 { .
name =
"pxeapi.unknown" };
83 { .
name =
"pxeapi.misc" };
128 return &pxe_api_tx_profiler;
130 return &pxe_api_isr_profiler;
132 return &pxe_api_unknown_profiler;
134 return &pxe_api_misc_profiler;
160 call = &pxenv_unknown_api;
170 ret = call->
entry ( ¶ms );
215 copy_to_user ( uparams, 0, ¶ms,
sizeof ( params ) );
248 ppxe.Stack.Physical_address = rm_ds_phys;
250 ppxe.UNDIData.Physical_address = rm_ds_phys;
252 ppxe.UNDICode.Physical_address = rm_cs_phys;
253 ppxe.UNDICodeWrite.segment_address =
rm_cs;
254 ppxe.UNDICodeWrite.Physical_address = rm_cs_phys;
296 :
"=a" ( discard_a ),
"=b" ( discard_b ),
342 DBGC ( &
pxe_netdev,
"PXE NBP starting with netdev %s, code %04x:%04zx, " 353 "movw %%cx, %%es\n\t" 357 "lcall $0, $0x7c00\n\t" 360 :
"=a" (
status ),
"=b" ( discard_b ),
void pxe_activate(struct net_device *netdev)
Activate PXE stack.
static PXENV_EXIT_t pxenv_unknown(struct s_PXENV_UNKNOWN *pxenv_unknown)
Handle an unknown PXE API call.
struct init_fn pxe_init_fn __init_fn(INIT_NORMAL)
PXE structure initialiser.
struct arbelprm_rc_send_wqe rc
uint8_t jmp
"jmp" instruction
struct i386_seg_regs segs
static void devices_put(void)
Allow devices to be removed on shutdown.
#define PXENV_EXIT_FAILURE
An error occurred.
#define __from_text16(pointer)
void pxe_int_1a(void)
INT 1A handler.
struct net_driver pxe_driver __net_driver
PXE BIOS notification driver.
static struct profiler pxe_api_tx_profiler __profiler
PXENV_UNDI_TRANSMIT API call profiler.
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
uint8_t size
Entry size (in 32-bit words)
REQUIRING_SYMBOL(pxe_api_call)
A data structure for storing profiling information.
static void profile_stop(struct profiler *profiler)
Stop profiling.
struct segoff __text16(pxe_int_1a_vector)
Vector for chaining INT 1A.
static __always_inline unsigned long virt_to_phys(volatile const void *addr)
Convert virtual address to a physical address.
Access to external ("user") memory.
A network upper-layer driver.
#define PXENV_UNKNOWN
PXE API invalid function code.
#define PXE_API_CALL(_opcode, _entry, _params_type)
Define a PXE API call.
void hook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Hook INT vector.
int unhook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Unhook INT vector.
static struct profiler * pxe_api_profiler(unsigned int opcode)
Determine applicable profiler (for debugging)
#define INIT_NORMAL
Normal initialisation.
UINT16_t PXENV_EXIT_t
A PXE exit code.
#define __asmcall
Declare a function with standard calling conventions.
uint32_t userptr_t
A pointer to a user buffer.
An initialisation function.
static int int_1a_hooked
INT 1A hooked flag.
int pxe_deactivate(void)
Deactivate PXE stack.
#define __unused
Declare a variable or data structure as unused.
static void devices_get(void)
Prevent devices from being removed on shutdown.
#define PXE_API_CALLS
PXE API call table.
#define pxe_int_1a_vector
static struct net_device * netdev
void pxe_set_netdev(struct net_device *netdev)
Set network device as current PXE network device.
static struct pxe_tftp_connection pxe_tftp
The PXE TFTP connection.
static void profile_start(struct profiler *profiler)
Start profiling.
#define PXENV_UNDI_TRANSMIT
PXE API function code for pxenv_undi_transmit()
char * strerror(int errno)
Retrieve string representation of error number.
struct net_device * pxe_netdev
int pxe_start_nbp(void)
Start PXE NBP at 0000:7c00.
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.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
__asm__ __volatile__("call *%9" :"=a"(result), "=c"(discard_ecx), "=d"(discard_edx) :"d"(0), "a"(code), "b"(0), "c"(in_phys), "D"(0), "S"(out_phys), "m"(hypercall))
#define PXENV_STATUS_UNSUPPORTED
REQUIRE_OBJECT(pxe_preboot)
__asmcall void pxe_loader_call(struct i386_all_regs *ix86)
Dispatch PXE loader call.
Network device management.
static uint8_t pxe_checksum(void *data, size_t size)
Calculate byte checksum as used by PXE.
uint16_t params_len
Length of parameters.
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
static void pxe_init_structures(void)
Initialise !PXE and PXENV+ structures.
char name[NETDEV_NAME_LEN]
Name of this network device.
int pxe_api_call_weak(struct i386_all_regs *ix86)
Dispatch weak PXE API call with PXE stack available.
static struct tlan_private * priv
Parameter block for undi_loader()
#define PXENV_UNDI_ISR
PXE API function code for pxenv_undi_isr()
static struct pxe_api_call * find_pxe_api_call(uint16_t opcode)
Locate PXE API call.
PXENV_STATUS_t Status
PXE status code.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
uint8_t data[48]
Additional event data.
static struct pxe_udp_connection pxe_udp
The PXE UDP connection.
static __always_inline userptr_t real_to_user(unsigned int segment, unsigned int offset)
Convert segment:offset address to user buffer.
PXENV_EXIT_t(* entry)(union u_PXENV_ANY *params)
Entry point.
Parameter block for pxenv_unknown()
struct pxe_api_call pxenv_unknown_api __pxe_api_call
Unknown PXE API call list.
static int pxe_notify(struct net_device *netdev, void *priv __unused)
Notify BIOS of existence of network device.
#define REAL_CODE(asm_code_str)
#define NULL
NULL pointer (VOID *)
rmjmp_buf pxe_restart_nbp
Jump buffer for PXENV_RESTART_TFTP.
A real-mode-extended jump buffer.
#define PXENV_STATUS_FAILURE
__asmcall void pxe_api_call(struct i386_all_regs *ix86)
Dispatch PXE API call.