undi.h revision 99ed60835c8ee445d8d0e2cc7b574b40970a7410
/**************************************************************************
UNDI NIC driver for Etherboot - header file
This file Copyright (C) 2003 Michael Brown <mbrown@fensystems.co.uk>
of Fen Systems Ltd. (http://www.fensystems.co.uk/). All rights
reserved.
$Id: undi.h,v 1.5 2003/10/24 10:05:06 mcb30 Exp $
***************************************************************************/
/*
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2, or (at
* your option) any later version.
*/
/* Include pxe.h from FreeBSD.
* pxe.h defines PACKED, which etherboot.h has already defined.
*/
#include "pxe.h"
#include "pic8259.h"
/* __undi_call is the assembler wrapper to the real-mode UNDI calls.
* Pass it the real-mode segment:offset address of an undi_call_info_t
* structure. The parameters are only uint16_t, but GCC will push
* them on the stack as uint32_t anyway for the sake of alignment. We
* specify them here as uint32_t to remove ambiguity.
*/
typedef struct undi_call_info {
typedef uint16_t PXENV_EXIT_t;
#define PXENV_EXIT_SUCCESS 0x0000
#define PXENV_EXIT_FAILURE 0x0001
/* The UNDI loader parameter structure is not defined in pxe.h
*/
typedef struct undi_loader {
/* A union that can function as the parameter block for any UNDI API call.
*/
typedef union pxenv_structure {
for any operation */
/* UNDI status codes
*/
#define PXENV_STATUS_SUCCESS 0x0000
#define PXENV_STATUS_FAILURE 0x0001
#define PXENV_STATUS_KEEP_UNDI 0x0004
#define PXENV_STATUS_KEEP_ALL 0x0005
#define PXENV_STATUS_UNDI_MEDIATEST_FAILED 0x0061
/* BIOS PnP parameter block. We scan for this so that we can pass it
* to the UNDI driver.
*/
typedef struct pnp_bios {
} PACKED pnp_bios_t;
/* Structures within the PXE ROM.
*/
#define ROM_SIGNATURE 0xaa55
typedef struct rom {
typedef struct pcir_header {
typedef struct pnp_header {
typedef struct undi_rom_id {
/* Storage buffers that we need in base memory. We collect these into
* a single structure to make allocation simpler.
*/
typedef struct undi_base_mem_xmit_data {
typedef struct undi_base_mem_data {
char xmit_buffer[ETH_FRAME_LEN];
char irq_handler[0]; /* Must be last in structure */
/* Macros and data structures used when freeing bits of base memory
* used by the UNDI driver.
*/
#define FIRING_SQUAD_TARGET_SIZE 8
#define FIRING_SQUAD_TARGET_INDEX(x) ( (x) / FIRING_SQUAD_TARGET_SIZE )
#define FIRING_SQUAD_TARGET_BIT(x) ( (x) % FIRING_SQUAD_TARGET_SIZE )
typedef struct firing_squad_lineup {
typedef enum firing_squad_shoot {
DONTSHOOT = 0,
SHOOT = 1
/* Driver private data structure.
*/
typedef struct undi {
/* Pointers to various data structures */
/* Pointers and sizes to keep track of allocated base memory */
void *driver_code;
void *driver_data;
char *xmit_buffer;
/* Flags. We keep our own instead of trusting the UNDI driver
* to have implemented PXENV_UNDI_GET_STATE correctly. Plus
* there's the small issue of PXENV_UNDI_GET_STATE being the
* same API call as PXENV_STOP_UNDI...
*/
/* Parameters that we need to store for future reference
*/
struct pci_device pci;
} undi_t;
/* Constants
*/
#define HUNT_FOR_PIXIES 0
#define HUNT_FOR_UNDI_ROMS 1