/*
 **************************************************************************
 *
 * Boot-ROM-Code to load an operating system across a TCP/IP network.
 *
 * Module:  pxe/common.h
 * Purpose: General definitions for PXE API
 * Entries: None
 *
 **************************************************************************
 *
 * Copyright (C) 1998-2003 Gero Kuhlmann <gero@gkminix.han.de>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * $Id: common.h,v 1.5 2003/01/25 23:29:40 gkminix Exp $
 */

#ifndef _PXE_COMMON_H
#define _PXE_COMMON_H


/*
 **************************************************************************
 *
 * This file contains the Preboot API common definitions as
 * per Intels PXE specification version 1.0.
 *
 **************************************************************************
 *
 * Result codes returned in AX by a PXENV API service:
 */
#define PXENV_EXIT_SUCCESS	0x0000
#define PXENV_EXIT_FAILURE	0x0001


/*
 **************************************************************************
 *
 * CPU types:
 */
#define PXENV_CPU_X86		0
#define PXENV_CPU_ALPHA		1
#define PXENV_CPU_PPC		2


/*
 **************************************************************************
 *
 * Bus types:
 */
#define PXENV_BUS_ISA		0
#define PXENV_BUS_EISA		1
#define PXENV_BUS_MCA		2
#define PXENV_BUS_PCI		3
#define PXENV_BUS_VESA		4
#define PXENV_BUS_PCMCIA	5


/*
 **************************************************************************
 *
 * Status codes returned in the status word of the PXENV API parameter
 * structure:
 */

/* Generic API errors that are reported by the loader */
#define PXENV_STATUS_SUCCESS		0x00
#define PXENV_STATUS_FAILURE		0x01	/* general failure */
#define PXENV_STATUS_BAD_FUNC		0x02	/* invalid function number */
#define PXENV_STATUS_UNSUPPORTED	0x03	/* function not yet supported */
#define PXENV_STATUS_KEEP_UNDI		0x04	/* keep UNDI in memory */
#define PXENV_STATUS_KEEP_ALL		0x05	/* keep everything in memory */

/* ARP/UDP errors (0x10 to 0x1F) */
#define PXENV_STATUS_ARP_CANCELED	0x10	/* ARP canceled by keystroke */
#define PXENV_STATUS_ARP_TIMEOUT	0x11	/* ARP timeout */
#define PXENV_STATUS_UDP_CLOSED		0x18	/* UDP closed */
#define PXENV_STATUS_UDP_OPEN		0x19	/* UDP already open */
#define PXENV_STATUS_TFTP_CLOSED	0x1A	/* TFTP closed */
#define PXENV_STATUS_TFTP_OPEN		0x1B	/* TFTP already opened */

/* BIOS/system errors (0x20 to 0x2F) */
#define PXENV_STATUS_MCOPY_PROBLEM	0x20	/* unable to copy into memory */

/* TFP errors (0x30 to 0x3F) */
#define PXENV_STATUS_TFTP_CANNOT_ARP	0x30	/* TFTP ARP problem */
#define PXENV_STATUS_TFTP_OPEN_CANCELED	0x31	/* TFTP open canceled by key */
#define PXENV_STATUS_TFTP_OPEN_TIMEOUT	0x32	/* timeout during TFTP open */
#define PXENV_STATUS_TFTP_UNKNOWN_OP	0x33	/* unknown TFTP opcode */
#define PXENV_STATUS_TFTP_READ_CANCELED	0x34	/* TFTP read canceled by key */
#define PXENV_STATUS_TFTP_READ_TIMEOUT	0x35	/* timeout during TFTP read */
#define PXENV_STATUS_TFTP_ERROR_OP	0x36	/* bad TFTP opcode */
#define PXENV_STATUS_TFTP_CANNOT_OPEN	0x38	/* error during TFTP open */
#define PXENV_STATUS_TFTP_CANNOT_READ	0x39	/* error during TFTP read */
#define PXENV_STATUS_TFTP_TOO_MANY	0x3A	/* too many packages */
#define PXENV_STATUS_TFTP_INVALID_FILE	0x3B	/* file not found */
#define PXENV_STATUS_TFTP_ACCESS	0x3C	/* access violation */
#define PXENV_STATUS_TFTP_NO_MCAST	0x3D	/* no multicast address */

/* BOOTP errors (0x40 to 0x4F) */
#define PXENV_STATUS_BOOTP_CANCELED	0x40	/* BOOTP canceled by key */
#define PXENV_STATUS_BOOTP_TIMEOUT	0x41	/* timeout during BOOTP */
#define PXENV_STATUS_BOOTP_NO_FILE	0x42	/* missing bootfile name */

/* DHCP errors (0x50 to 0x5F) */
#define PXENV_STATUS_DHCP_CANCELED	0x50	/* DHCP canceled by key */
#define PXENV_STATUS_DHCP_TIMEOUT	0x51	/* timeout during DHCP */
#define PXENV_STATUS_DHCP_NO_IP_ADDR	0x52	/* missing IP address */
#define PXENV_STATUS_DHCP_NO_FILE	0x53	/* missing bootfile name */

/* Driver errors (0x60 to 0x6F) */
#define PXENV_STATUS_UNDI_INVFUNC	0x60	/* invalid UNDI function */
#define PXENV_STATUS_UNDI_MEDIATEST	0x61	/* media test failed */
#define PXENV_STATUS_UNDI_MCAST		0x62	/* cannot init for multicast */
#define PXENV_STATUS_UNDI_NIC_INIT	0x63	/* cannot init NIC */
#define PXENV_STATUS_UNDI_PHY_INIT	0x64	/* cannot init hardware */
#define PXENV_STATUS_UNDI_CONFIG_DATA	0x65	/* cannot read config data */
#define PXENV_STATUS_UNDI_INIT_DATA	0x66	/* cannot read init data */
#define PXENV_STATUS_UNDI_INV_HWADDR	0x67	/* invalid hardware address */
#define PXENV_STATUS_UNDI_EEPROM	0x68	/* invalid EEPROM checksum */
#define PXENV_STATUS_UNDI_RESOURCES	0x69	/* out of resources */
#define PXENV_STATUS_UNDI_ALREADY_INIT	0x6A	/* UNDI already initialized */
#define PXENV_STATUS_UNDI_NOT_INIT	0x6B	/* UNDI not initialized yet */
#define PXENV_STATUS_UNDI_ALREADY_OPEN	0x6C	/* UNDI already opened */
#define PXENV_STATUS_UNDI_NOT_OPEN	0x6D	/* UNDI not opened yet */

/* Bootstrap (.1) errors (0x70 to 0x7F) */

/* Environment (.2) errors (0x80 to 0x8F) */

/* MTFTP errors (0x90 to 0x9F) */
#define PXENV_STATUS_MTFTP_OPEN_CANCEL	0x91	/* MTFTP open canceled by key */
#define PXENV_STATUS_MTFTP_OPEN_TIMEOUT	0x92	/* timeout during MTFTP open */
#define PXENV_STATUS_MTFTP_UNKNOWN_OP	0x93	/* unknown TFTP opcode */
#define PXENV_STATUS_MTFTP_READ_CANCEL	0x94	/* MTFTP read canceled by key */
#define PXENV_STATUS_MTFTP_READ_TIMEOUT	0x95	/* timeout during MTFTP read */
#define PXENV_STATUS_MTFTP_ERROR_OP	0x96	/* bad TFTP opcode */
#define PXENV_STATUS_MTFTP_CANNOT_OPEN	0x98	/* error during MTFTP open */
#define PXENV_STATUS_MTFTP_CANNOT_READ	0x99	/* error during MTFTP read */
#define PXENV_STATUS_MTFTP_TOO_MANY	0x9A	/* too many packages */
#define PXENV_STATUS_MTFTP_PACK_SIZE	0x9B	/* invalid package size */

/* Misc. errors (0xA0 to 0xAF) */
#define PXENV_STATUS_BINL_CANCELED	0xA0	/* BINL canceled by key */
#define PXENV_STATUS_BINL_NO_SERVER	0xA1	/* no BINL server found */
#define PXENV_STATUS_PMODE		0xA2	/* not available in prot mode */
#define PXENV_STATUS_RMODE		0xA3	/* not available in real mode */

/* BUSD errors (0xB0 to 0xBF) */
#define PXENV_STATUS_BUSD_BUS_ENABLE	0xB0	/* BUSD services not enabled */
#define PXENV_STATUS_BUSD_DEV_ENABLE	0xB1	/* BUSD device not enabled */

/* Loader errors (0xC0 to 0xCF) */
#define PXENV_STATUS_LOADER_NO_FBM	0xC0	/* no free base memory */
#define PXENV_STATUS_LOADER_NO_BC	0xC1	/* no base code rom ID */
#define PXENV_STATUS_LOADER_BAD_BC_ID	0xC2	/* bad base code rom ID */
#define PXENV_STATUS_LOADER_BC_IMG	0xC3	/* bad base code image */
#define PXENV_STATUS_LOADER_NO_UNDI	0xC4	/* no UNDI rom ID */
#define PXENV_STATUS_LOADER_BAD_UNDI	0xC5	/* bad UNDI rom ID */
#define PXENV_STATUS_LOADER_UNDI_IMG	0xC6	/* bad UNDI runtime image */

/* Reserved errors (0xD0 to 0xFF) */
#define PXENV_STATUS_IMAGE_INVALID	0xD0	/* invalid boot image */
#define PXENV_STATUS_STOP_BASE		0xD1	/* error stopping base code */
#define PXENV_STATUS_UNLOAD_BASE	0xD2	/* error unloading base code */
#define PXENV_STATUS_STOP_UNDI		0xD3	/* error stopping UNDI */
#define PXENV_STATUS_CLEANUP_UNDI	0xD4	/* error cleaning up UNDI */

#endif				/* _PXE_COMMON_H */



syntax highlighted by Code2HTML, v. 0.9.1