#ifndef _structh
#define _structh

#ifndef _DEVDRVR_H_INCLUDED
#include <sys/_devdrvr.h>
#endif

#define MAX_ASYNCS 64
#define MAX_IRQS   16

struct dev_entry {
	struct dev_entry *link;
	unsigned tty;
	unsigned iobase;
	unsigned char irq;
	unsigned char busy;
	unsigned char modem_status;
	unsigned char tx_pending;
	unsigned char parity;
	unsigned char stop_bits;
	unsigned char data_bits;
	unsigned char modem_control;
	unsigned char state;
	unsigned char threshold;
	unsigned mode;
	unsigned slots;
	unsigned slot;
	long     baud;
	struct output_buffer __far *obuf;
	unsigned long rx_count;
	unsigned long tx_count;
	} ;

#define MODE_SPLIT				0x01
#define MODE_RTS				0x02
#define MODE_DTR				0x04
#define MODE_NOHUP				0x08
#define MODE_LOCKHFLOW			0x10
#define MODE_RESET_OWNER		0x20
#define MODE_RESET_PERMISSIONS	0x40
#define MODE_RESET_ATTRIBUTES	0x80
#define MODE_RESET_FLUSHES		0x100
#define MODE_PKT				0x200
#define MODE_PWR				0x400
#define MODE_AVAILABLE			0x800
#define MODE_IRQ_LINKED			0x1000

struct dev_mode {
	unsigned low;
	unsigned high;
	unsigned char raw;
	unsigned char hflow;
	unsigned char sflow;
	unsigned mode;
	} ;

/*
 * Function Prototypes
 */
int sys_msg(void *buf);
pid_t tto(struct dev_entry *, struct output_buffer far *);
pid_t async_int(int);
pid_t far async_irq0();
pid_t far async_irq1();
pid_t far async_irq2();
pid_t far async_irq3();
pid_t far async_irq4();
pid_t far async_irq5();
pid_t far async_irq6();
pid_t far async_irq7();
pid_t far async_irq8();
pid_t far async_irq9();
pid_t far async_irq10();
pid_t far async_irq11();
pid_t far async_irq12();
pid_t far async_irq13();
pid_t far async_irq14();
pid_t far async_irq15();
int reset_async(int, int);
void init(int, unsigned, unsigned, long, int);
int find_asyncs();
new_async(int, unsigned, unsigned, unsigned);
shutdown_async(int);
void init_tables();
void disable_irq(int);

#endif  /* _structh */
