/* vim: set filetype=c:
 *
 * undi.h86  -  Definitions for UNDI PXE API services
 *
 * Copyright (C) 2003-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: undi.h86,v 1.10 2007/01/06 18:31:05 gkminix Exp $
 */

#ifndef PXE_UNDI_H86
#define PXE_UNDI_H86


/*
 * This file can only get included into target C or assembler source files.
 */
#define GCC_INCLUDE
#include <compiler.h>



/*
 **************************************************************************
 *
 * This file contains the Universal Network Driver Interface definitions
 * as per Intels PXE specification version 2.1.
 *
 **************************************************************************
 *
 * UNDI opcodes:
 */
#define UNDI_START_UNDI		0x0000
#define UNDI_STARTUP		0x0001
#define UNDI_CLEANUP		0x0002
#define UNDI_INITIALIZE		0x0003
#define UNDI_RESET_NIC		0x0004
#define UNDI_SHUTDOWN		0x0005
#define UNDI_OPEN		0x0006
#define UNDI_CLOSE		0x0007
#define UNDI_TRANSMIT		0x0008
#define UNDI_SET_MCAST_ADDR	0x0009
#define UNDI_SET_STATION_ADDR	0x000A
#define UNDI_SET_PACKET_FILTER	0x000B
#define UNDI_GET_INFORMATION	0x000C
#define UNDI_GET_STATISTICS	0x000D
#define UNDI_CLEAR_STATISTICS	0x000E
#define UNDI_INITIATE_DIAGS	0x000F
#define UNDI_FORCE_INTERRUPT	0x0010
#define UNDI_GET_MCAST_ADDR	0x0011
#define UNDI_GET_NIC_TYPE	0x0012
#define UNDI_GET_IFACE_INFO	0x0013
#define UNDI_ISR		0x0014
#define UNDI_STOP_UNDI		0x0015
#define UNDI_GET_STATE		0x0016

#define UNDI_MINNUM		0x0000
#define UNDI_MAXNUM		0x0016



/*
 **************************************************************************
 *
 * We need the definition of the IP address type
 */
#ifndef _ASSEMBLY_
# include <common.h86>
# include <net/in.h86>
#endif



/*
 **************************************************************************
 *
 * Various UNDI-related definitions
 */

/* Misc. definitions */
#define UNDI_ADDR_LEN		16		/* max. hardware addr length */
#define UNDI_MAXNUM_MCADDR	8		/* max. no. multicast addrs */
#define UNDI_MAX_PARAM_SIZE	140		/* max size of any UNDI param */

/* Type of hardware protocol */
#define UNDI_TYPE_ETHER		1
#define UNDI_TYPE_EXP_ETHER	2
#define UNDI_TYPE_AX25		3
#define UNDI_TYPE_IEEE		6
#define UNDI_TYPE_ARCNET	7
#define UNDI_TYPE_APPLETALK	8

/* Protocol identifiers */
#define UNDI_PROT_UNKNOWN	0
#define UNDI_PROT_IP		1
#define UNDI_PROT_ARP		2
#define UNDI_PROT_RARP		3
#define UNDI_PROT_OTHERS	4

/* Packet type identifier */
#define UNDI_PKT_DIRECTED	0
#define UNDI_PKT_BROADCAST	1
#define UNDI_PKT_MULTICAST	2

/* Packet filter values */
#define UNDI_FLTR_DIRECTED	0x0001		/* directed/multicast */
#define UNDI_FLTR_BROADCAST	0x0002		/* broadcast */
#define UNDI_FLTR_PROMISC	0x0004		/* any packet on LAN */
#define UNDI_FLTR_SRC_ROUTE	0x0008		/* source routing packet */



/*
 **************************************************************************
 *
 * Definition of multicast address structure:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_mcast_addr {
	__u16 count;			/* In: number of multicast addrs */
	__u8  addrs[UNDI_MAXNUM_MCADDR][UNDI_ADDR_LEN];	/* In: */
					/* list of multicast addresses */
} t_undi_mcast_addr;

#else

			.struct	0
o_uma_count:		.struct	.+2	/* number of multicast addresses */
o_uma_addrs:		.struct	.+128	/* list of multicast addresses */

#define mcast_addr_size		130	/* size of multicast address struct */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_START_UNDI function:
 */
#ifndef _ASSEMBLY_

typedef struct s_start_undi {
	__u16 status;			/* Out: function status */
	__u16 AX;			/* In: AX register from BIOS */
	__u16 BX;			/* In: BX register from BIOS */
	__u16 DX;			/* In: DX register from BIOS */
	__u16 DI;			/* In: DI register from BIOS */
	__u16 ES;			/* In: ES register from BIOS */
} t_start_undi;

#else

			.struct	0
o_su_status:		.struct	.+2	/* Out: status */
o_su_reg_ax:		.struct	.+2	/* In: AX register from BIOS */
o_su_reg_bx:		.struct	.+2	/* In: BX register from BIOS */
o_su_reg_dx:		.struct	.+2	/* In: DX register from BIOS */
o_su_reg_di:		.struct	.+2	/* In: DI register from BIOS */
o_su_reg_es:		.struct	.+2	/* In: ES register from BIOS */

#define start_undi_size		12	/* size of function structure */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_STARTUP function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_startup {
	__u16 status;			/* Out: function status */
} t_undi_startup;

#else

			.struct	0
o_us_status:		.struct	.+2	/* Out: status */

#define startup_size		2	/* size of function structure */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_CLEANUP function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_cleanup {
	__u16 status;			/* Out: function status */
} t_undi_cleanup;

#else

			.struct	0
o_uc_status:		.struct	.+2	/* Out: status */

#define cleanup_size		2	/* size of function structure */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_INITIALIZE function:
 *
 * protocolini:
 *   This is an input parameter and is a 32-bit physical address of a memory
 *   copy of the driver module in the protocol.ini file obtained from the
 *   Protocol Manager driver (refer to NDIS 2.0 specification). For further
 *   information see the PXE specification document.
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_initialize {
	__u16  status;			/* Out: function status */
	__lptr protocolini;		/* In: see above */
	__u8   resvd[8];
} t_undi_initialize;

#else

			.struct	0
o_ui_status:		.struct	.+2	/* Out: status */
o_ui_protocolini:	.struct	.+4	/* In: see above */

#define initialize_size		14	/* size of function structure */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_RESET function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_reset {
	__u16             status;	/* Out: function status */
	t_undi_mcast_addr mcastbuf;	/* In: multicast address list */
} t_undi_reset;

#else

			.struct	0
o_ur_status:		.struct	.+2			/* Out: status */
o_ur_mcastbuf:		.struct	.+mcast_addr_size	/* In: mcast addrs */

#define reset_size		(2 + mcast_addr_size)

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_SHUTDOWN function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_shutdown {
	__u16 status;			/* Out: function status */
} t_undi_shutdown;

#else

			.struct	0
o_ud_status:		.struct	.+2	/* Out: status */

#define shutdown_size		2	/* size of function structure */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_OPEN function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_open {
	__u16             status;	/* Out: function status */
	__u16             openflag;	/* In: adapter specific */
	__u16             pktfilter;	/* In: packet filter for receiving */
	t_undi_mcast_addr mcastbuf;	/* In: multicast address list */
} t_undi_open;

#else

			.struct	0
o_uo_status:		.struct	.+2	/* Out: status */
o_uo_openflag:		.struct	.+2	/* In: adapter specific flags */
o_uo_pktfilter:		.struct	.+2	/* In: packet filter for receiving */
o_uo_mcastbuf:		.struct	.+mcast_addr_size	/* In: mcast addrs */

#define open_size		(6 + mcast_addr_size)

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_CLOSE function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_close {
	__u16 status;			/* Out: function status */
} t_undi_close;

#else

			.struct	0
o_ux_status:		.struct	.+2	/* Out: status */

#define close_size		2	/* size of function structure */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_TRANSMIT function:
 */
#define UNDI_MAX_DATA_BLKS	8

#ifndef _ASSEMBLY_

typedef struct s_undi_tbd {
	__u16  xmtlength;		/* In: data buffer length in bytes */
	__fptr xmtbuffer;		/* In: far ptr to transmit buffer */
	__u16  blocks;			/* In: number of data blocks */
	struct {
	  __u8   tdptrtype;		/* In: type of data block address */
	  __u8   tdresvd;		/* reserved */
	  __u16  tdlength;		/* In: data block length in bytes */
	  __fptr tdaddr;		/* In: ptr to data block */
	} datablock[UNDI_MAX_DATA_BLKS];
} t_undi_tbd;

#else

			.struct	0
o_tbd_tdptrtype:	.struct	.+1	/* In: type of data block address */
o_tbd_tdresvd:		.struct	.+1	/* reserved */
o_tbd_tdlength:		.struct	.+2	/* In: data block length in bytes */
o_tbd_tdaddr:		.struct	.+4	/* In: pointer to data block */

#define datablk_size		8


			.struct	0
o_tbd_xmtlength:	.struct	.+2	/* In: data buffer length in bytes */
o_tbd_xmtbuffer:	.struct	.+4	/* In: far ptr to transmit buffer */
o_tbd_blocks:		.struct	.+2	/* In: number of data blocks */
o_tbd_datablock:	.struct	.+(datablk_size * UNDI_MAX_DATA_BLKS)

#define tbd_size		(8 + (datablk_size * UNDI_MAX_DATA_BLKS))

#endif

/* Data pointer types */
#define UNDI_XMT_TD_LINEAR		0
#define UNDI_XMT_TD_SEGOFS		1



#ifndef _ASSEMBLY_

typedef struct s_undi_transmit {
	__u16  status;			/* Out: function status */
	__u8   protocol;		/* In: protocol of upper layer */
	__u8   xmtflag;			/* In: type of destination address */
	__fptr dest_addr;		/* In: far ptr to destination address */
	__fptr tbd;			/* In: far ptr to transmit data block */
	__u32  reserved[2];		/* reserved */
} t_undi_transmit;

#else

			.struct	0
o_ut_status:		.struct	.+2	/* Out: status */
o_ut_protocol:		.struct	.+1	/* In: protocol of upper layer */
o_ut_xmtflag:		.struct	.+1	/* In: type of destination address */
o_ut_dest_addr:		.struct	.+4	/* In: far ptr to destination address */
o_ut_tbd:		.struct	.+4	/* In: far ptr to transmit data block */

#define transmit_size		20	/* size of function structure */

#endif

/* Destination address flags */
#define UNDI_XMT_DESTADDR	0
#define UNDI_XMT_BROADCAST	1



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_SET_MCAST_ADDR function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_set_mcast_addr {
	__u16             status;	/* Out: function status */
	t_undi_mcast_addr mcastbuf;	/* In: multicast address list */
} t_undi_set_mcast_addr;

#else

			.struct	0
o_usma_status:		.struct	.+2			/* Out: status */
o_usma_mcastbuf:	.struct	.+mcast_addr_size	/* In: mcast addrs */

#define setmcast_size		(2 + mcast_addr_size)

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_SET_STATION_ADDR function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_set_station_addr {
	__u16 status;			/* Out: function status */
	__u8  addr[UNDI_ADDR_LEN];
} t_undi_set_station_addr;

#else

			.struct	0
o_ussa_status:		.struct	.+2		/* Out: status */
o_ussa_addr:		.struct	.+UNDI_ADDR_LEN	/* In: station hardware addr */

#define setstation_size		(2 + UNDI_ADDR_LEN)

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_SET_PACKET_FILTER function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_set_packet_filter {
	__u16 status;			/* Out: function status */
	__u8  filter;			/* In: receive filter value */
} t_undi_set_packet_filter;

#else

			.struct	0
o_uspf_status:		.struct	.+2	/* Out: status */
o_uspf_filter:		.struct	.+1	/* In: receive filter value */

#define setfilter_size		4	/* size of function structure */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_GET_INFORMATION function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_get_information {
	__u16 status;			/* Out: function status */
	__u16 baseio;			/* Out: adapters base I/O address */
	__u16 intnumber;		/* Out: IRQ number */
	__u16 MTU;			/* Out: MTU */
	__u16 hwtype;			/* Out: type of hardware protocol */
	__u16 hwaddrlen;		/* Out: length of hardware address */
	__u8  currentaddr[UNDI_ADDR_LEN];	/* Out: current addr */
	__u8  permaddr[UNDI_ADDR_LEN];		/* Out: perm addr */
	__u16 romaddr;			/* Out: ROM address */
	__u16 rxbufcnt;			/* Out: receive queue length */
	__u16 txbufcnt;			/* Out: transmit queue length */
} t_undi_get_information;

#else

			.struct	0
o_ugi_status:		.struct	.+2	/* Out: status */
o_ugi_baseio:		.struct	.+2	/* Out: adapters base I/O address */
o_ugi_intnumber:	.struct	.+2	/* Out: IRQ number */
o_ugi_mtu:		.struct	.+2	/* Out: MTU */
o_ugi_hwtype:		.struct	.+2	/* Out: type of hardware protocol */
o_ugi_hwaddrlen:	.struct	.+2	/* Out: length of hardware address */
o_ugi_currentaddr:	.struct	.+UNDI_ADDR_LEN	/* Out: current hw addr */
o_ugi_permaddr:		.struct	.+UNDI_ADDR_LEN	/* Out: permanent hw addr */
o_ugi_romaddr:		.struct	.+2	/* Out: ROM address */
o_ugi_rxbufcnt:		.struct	.+2	/* Out: receive queue length */
o_ugi_txbufcnt:		.struct	.+2	/* Out: transmit queue length */

#define getinfo_size		34	/* size of function structure */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_GET_STATISTICS function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_get_statistics {
	__u16 status;			/* Out: function status */
	__u32 xmtgood;			/* Out: no. successful transmissions */
	__u32 rcvgood;			/* Out: no. of good frames received */
	__u32 rcvcrcerr;		/* Out: no. of frames with CRC errors */
	__u32 rcvreserr;		/* Out: no. of frames discarded */
} t_undi_get_statistics;

#else

			.struct	0
o_ugs_status:		.struct	.+2	/* Out: status */
o_ugs_xmtgood:		.struct	.+4	/* Out: no. successful transmissions */
o_ugs_rcvgood:		.struct	.+4	/* Out: no. good frames received */
o_ugs_rcvcrcerr:	.struct	.+4	/* Out: no. of frames with CRC errors */
o_ugs_rcvreserr:	.struct	.+4	/* Out: no. of frames discarded */

#define getstat_size		18	/* size of function structure */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_CLEAR_STATISTICS function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_clear_statistics {
	__u16 status;			/* Out: function status */
} t_undi_clear_statistics;

#else

			.struct	0
o_ucs_status:		.struct	.+2	/* Out: status */

#define clearstat_size		2	/* size of function structure */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_INITIATE_DIAGS function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_initiate_diags {
	__u16 status;			/* Out: function status */
} t_undi_initiate_diags;

#else

			.struct	0
o_uid_status:		.struct	.+2	/* Out: status */

#define initdiag_size		2	/* size of function structure */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_FORCE_INTERRUPT function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_force_interrupt {
	__u16 status;			/* Out: function status */
} t_undi_force_interrupt;

#else

			.struct	0
o_ufi_status:		.struct	.+2	/* Out: status */

#define forceint_size		2	/* size of function structure */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_GET_MCAST_ADDR function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_get_mcast_addr {
	__u16    status;		/* Out: function status */
	t_ipaddr inetaddr;		/* In: IP multicast address */
	__u8     hwaddr[UNDI_ADDR_LEN];	/* Out: corresponding HW addr */
} t_undi_get_mcast_addr;

#else

			.struct	0
o_ugma_status:		.struct	.+2	/* Out: status */
o_ugma_inetaddr:	.struct	.+4	/* In: IP multicast address */
o_ugma_hwaddr:		.struct	.+UNDI_ADDR_LEN	/* Out: corresponding addr */

#define getmcast_size		(6 + UNDI_ADDR_LEN)

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_GET_NIC_TYPE function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_get_nic_type {
	__u16 status;		/* Out: function status */
	__u8  nictype;		/* Out: type of NIC */
	union {
	  struct {
	    __u16 vendorid;
	    __u16 devid;
	    __u8  baseclass;
	    __u8  subclass;
	    __u8  progint;
	    __u8  revision;
	    __u16 busdevfunc;
	    __u16 subvendorid;
	    __u16 subdevid;
	  } pci, cardbus;
	  struct {
	    __u32 eisa_devid;
	    __u8  baseclass;
	    __u8  subclass;
	    __u8  progint;
	    __u16 cardselnum;
	  } pnp;
	} info;
} t_undi_get_nic_type;

#else

			.struct	0
o_ugnt_status:		.struct	.+2	/* Out: status */
o_ugnt_nictype:		.struct	.+1	/* Out: NIC type */

			.struct	0x0003
o_ugnt_pci_vendid:	.struct	.+2
o_ugnt_pci_devid:	.struct	.+2
o_ugnt_pci_baseclass:	.struct	.+1
o_ugnt_pci_subclass:	.struct	.+1
o_ugnt_pci_progint:	.struct	.+1
o_ugnt_pci_revision:	.struct	.+1
o_ugnt_pci_busdevfunc:	.struct	.+2
o_ugnt_pci_subvendid:	.struct	.+2
o_ugnt_pci_subdevid:	.struct	.+2

			.struct	0x0003
o_ugnt_pnp_eisa_devid:	.struct	.+4
o_ugnt_pnp_baseclass:	.struct	.+1
o_ugnt_pnp_subclass:	.struct	.+1
o_ugnt_pnp_progint:	.struct	.+1
o_ugnt_pnp_cardselnum:	.struct	.+2

#define getnic_size		18	/* size of function structure */

#endif

/* NIC types */
#define UNDI_NIC_PCI	2		/* PCI NIC */
#define UNDI_NIC_PNP	3		/* PnP NIC */
#define UNDI_NIC_CB	4		/* CardBus NIC */



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_GET_IFACE_INFO function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_get_iface_info {
	__u16 status;			/* Out: function status */
	__u8  ifacetype[16];		/* Out: name of MAC in ASCIZ format */
	__u32 linkspeed;		/* Out: link speed as per NDIS2 */
	__u32 serviceflags;		/* Out: flags as defined in NDIS2 */
	__u32 resvd[4];
} t_undi_get_iface_info;

#else

#define o_ugii_ifacelen		16

			.struct	0
o_ugii_status:		.struct	.+2			/* Out: status */
o_ugii_ifacetype:	.struct	.+o_ugii_ifacelen	/* Out: name of MAC */
o_ugii_linkspeed:	.struct	.+4	/* Out: link speed as per NDIS2 */
o_ugii_serviceflags:	.struct	.+4	/* Out: flags as defined in NDIS2 */

#define getiface_size		(26 + o_ugii_ifacelen)

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_ISR function:
 *
 * Interupt service routine operation:
 *
 * In this design the UNDI does not hook the interrupt for the network
 * interface. Instead, the application or the protocol driver hooks the
 * interrupt and calls UNDI with the UNDI_ISR API call for different
 * levels of interrupt processing.
 *
 * When the network interface hardware generates an interrupt the protocol
 * stack interrupt service routine gets control and takes care of the
 * interrupt processing at the PIC level. The ISR then calls the UNDI using
 * the UNDI_ISR API with the value UNDI_ISR_IN_START for the FuncFlag
 * parameter. At this time UNDI must disable the interrupts at the network
 * interface level and read any status values required to further process
 * the interrupt. UNDI must return as quickly as possible with one of the
 * two values, UNDI_ISR_OUT_OURS or UNDI_ISR_OUT_NOT_OURS, for the
 * parameter FuncFlag depending on whether the interrupt was generated
 * by this particular network interface or not.
 *
 * If the value returned in FuncFlag is UNDI_ISR_OUT_OURS, the protocol
 * driver must call UNDI using the same API call with FuncFlag equal to
 * UNDI_ISR_IN_PROCESS. At this time UNDI must find the cause of this
 * interrupt and return the status in the FuncFlag. It first checks if
 * there is a frame received and if so it returns the first buffer pointer
 * of that frame in the parameter block.
 *
 * The protocol stack calls UNDI repeatedly with the FuncFlag equal to
 * UNDI_ISR_IN_GET_NEXT to get all the buffers in a frame and also all the
 * received frames in the queue. On this call, UNDI must remember the
 * previous buffer given to the protocol and remove it from the receive
 * queue and recycle. In case of a multi buffered frame if the previous
 * buffer is not the last buffer in the frame it must return the next buffer
 * in the frame in the parameter block. Otherwise it must return the first
 * buffer in the next frame.
 *
 * If there is no received frame pending to be processed, UNDI processes
 * the transmit buffers, and if there is no other interrupt status to be
 * processed, UNDI re-enables the interrupt at the network interface
 * level and returns UNID_ISR_OUT_DONE in the FuncFlag.
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_isr {
	__u16  status;			/* Out: function status */
	__u16  funcflag;		/* In/Out: function flag */
	__u16  buflength;		/* Out: length of data in buffer */
	__u16  framelength;		/* Out: length of data in frame */
	__u16  headerlength;		/* Out: length of MAC header */
	__fptr frame;			/* Out: far ptr to frame buffer */
	__u8   prottype;		/* Out: protocol identifier */
	__u8   pkttype;			/* Out: type of received frame */
} t_undi_isr;

#else

			.struct	0
o_uisr_status:		.struct	.+2	/* Out: status */
o_uisr_funcflag:	.struct	.+2	/* In/Out: function flag */
o_uisr_buflength:	.struct	.+2	/* Out: length of data in buffer */
o_uisr_framelength:	.struct	.+2	/* Out: length of data in frame */
o_uisr_headerlength:	.struct	.+2	/* Out: length of MAC header */
o_uisr_frame:		.struct	.+4	/* Out: far ptr to frame buffer */
o_uisr_prottype:	.struct	.+1	/* Out: protocol identifier */
o_uisr_pkttype:		.struct	.+1	/* Out: type of received frame */

#define isr_size		16	/* size of function structure */

#endif

/* FuncFlag values */
#define UNDI_ISR_IN_START	1
#define UNDI_ISR_IN_PROCESS	2
#define UNDI_ISR_IN_GET_NEXT	3

#define UNDI_ISR_OUT_OURS	0
#define UNDI_ISR_OUT_NOT_OURS	1

#define UNDI_ISR_OUT_DONE	0
#define UNDI_ISR_OUT_TRANSMIT	2
#define UNDI_ISR_OUT_RECEIVE	3
#define UNDI_ISR_OUT_BUSY	4



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_STOP_UNDI function:
 */
#ifndef _ASSEMBLY_

typedef struct s_undi_stop {
	__u16 status;			/* Out: function status */
} t_undi_stop;

#else

			.struct	0
o_xu_status:		.struct	.+2	/* Out: status */

#define stop_undi_size		2	/* size of function structure */

#endif



/*
 **************************************************************************
 *
 * Definition of structure for UNDI_GET_STATE function:
 */
#ifndef _ASSEMBLY_

typedef struct s_get_state {
	__u16 status;			/* Out: function status */
	__u8  state;			/* Out: UNDI state */
} t_undi_get_state;

#else

			.struct	0
o_ugs_status:		.struct	.+2	/* Out: status */
o_ugs_state:		.struct	.+1	/* Out: UNDI state */

#define get_state_size		4	/* size of function structure */

#endif

/* State values */
#define UNDI_STATE_STARTED	1
#define UNDI_STATE_INITIALIZED	2
#define UNDI_STATE_OPENED	3


#endif

