/*
 **************************************************************************
 *
 * Network driver interface for netboot bootrom
 *
 * Module:  pktdrv.i86
 * Purpose: Definitions for packet driver interface
 * Entries: None
 *
 **************************************************************************
 *
 * Copyright (C) 1995-2007 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: pktdrv.i86,v 1.5 2007/01/06 18:30:49 gkminix Exp $
 *
 */

#ifndef NETDRVR_PKTDRVR_PKTDRV_I86
#define NETDRVR_PKTDRVR_PKTDRV_I86


/*
 **************************************************************************
 *
 * Packet driver functionality levels:
 *
 */
#define	FUNC_BASIC	1		/* basic functionality */
#define	FUNC_EXTENDED	2		/* basic + extended functionality */
#define	FUNC_HIGHPERF	5		/* basic + high-performance functionality */
#define	FUNC_ALL	6		/* basic + extended + high-performance */



/*
 **************************************************************************
 *
 * Receive modes:
 *
 */
#define	MODE_RCVOFF	1		/* turn receiver off */
#define	MODE_DIRECTED	2		/* receive only directed packets */
#define	MODE_BROADCAST	3		/* mode 2 plus broadcast packets */
#define	MODE_MCASTLIM	4		/* mode 3 plus limited multicast */
#define	MODE_MCASTALL	5		/* mode 3 plus all multicast */
#define	MODE_ALL	6		/* all packets */



/*
 **************************************************************************
 *
 * Packet driver interface classes:
 *
 */
#define	CL_NONE		0
#define	CL_ETHERNET	1
#define	CL_PRONET_10	2
#define	CL_IEEE8025	3
#define	CL_OMNINET	4
#define	CL_APPLETALK	5
#define	CL_SERIAL_LINE	6
#define	CL_STARLAN	7
#define	CL_ARCNET	8
#define	CL_AX25		9
#define	CL_KISS		10
#define	CL_IEEE8023	11
#define	CL_FDDI		12
#define	CL_INTERNET_X25	13
#define	CL_LANSTAR	14
#define	CL_SLFP		15
#define	CL_NETROM	16
#define	CL_DEFAULT	CL_ETHERNET	/* default class (do not change) */



/*
 **************************************************************************
 *
 * Packet driver interface types:
 *
 */
#define	TYPE_TC500	1
#define	TYPE_PC2000	10
#define	TYPE_WD8003	14
#define	TYPE_PC8250	15
#define	TYPE_ANY	0xFFFF
#define	TYPE_DEFAULT	TYPE_ANY	/* default type (do not change) */



/*
 **************************************************************************
 *
 * Layout of statistics structure returned by packet driver:
 *
 */
			.struct	0
stat_pkt_in:		.struct	.+4	/* packets in */
stat_pkt_out:		.struct	.+4	/* packets out */
stat_bytes_in:		.struct	.+4	/* bytes in */
stat_bytes_out:		.struct	.+4	/* bytes out */
stat_err_in:		.struct	.+4	/* errors in */
stat_err_out:		.struct	.+4	/* errors out */
stat_pkt_lost:		.struct	.+4	/* packets lost */



/*
 **************************************************************************
 *
 * Packet driver error return codes:
 *
 */
#define	ERR_NO_ERROR		0
#define	ERR_BAD_HANDLE		1	/* invalid handle number */
#define	ERR_NO_CLASS		2	/* no interfaces of specified class */
#define	ERR_NO_TYPE		3	/* no interfaces of specified type */
#define	ERR_NO_NUMBER		4	/* no interfaces of specified number */
#define	ERR_BAD_TYPE		5	/* bad packet type specified */
#define	ERR_NO_MULTICAST	6	/* interface does not support mcast */
#define	ERR_CANT_TERMINATE	7	/* packet driver cannot terminate */
#define	ERR_BAD_MODE		8	/* invalid receiver mode */
#define	ERR_NO_SPACE		9	/* insufficient space */
#define	ERR_TYPE_INUSE		10	/* type not released */
#define	ERR_BAD_COMMAND		11	/* command not implemented */
#define	ERR_CANT_SEND		12	/* cant send packet (hardware error) */
#define	ERR_CANT_SET		13	/* cant change hardware address */
#define	ERR_BAD_ADDRESS		14	/* bad hardware address */
#define	ERR_CANT_RESET		15	/* couldnt reset interface */



/*
 **************************************************************************
 *
 * Packet driver function call numbers. These names and numbers are the
 * same as in Appendix B of the packet driver specification:
 *
 */
#define	DRIVER_INFO		1	/* get interface information */
#define	ACCESS_TYPE		2	/* set packet access type */
#define	RELEASE_TYPE		3	/* release packet access type */
#define	SEND_PKT		4	/* send a packet */
#define	TERMINATE		5	/* terminate packet driver */
#define	GET_ADDRESS		6	/* get hardware address */
#define	RESET_INTERFACE		7	/* reset the interface */
#define	GET_PARAMETERS		10	/* get several driver parameters */
#define	AS_SEND_PKT		11	/* send packet with upcall */
#define	SET_RCV_MODE		20	/* set receive mode */
#define	GET_RCV_MODE		21	/* get receive mode */
#define	SET_MULTICAST_LIST	22	/* set multicast address list */
#define	GET_MULTICAST_LIST	23	/* get multicast address list */
#define	GET_STATISTICS		24	/* get transfer statistics */
#define	SET_ADDRESS		25	/* set hardware address */


#endif

