/*
 * Generic serial driver interface.
 *
 * The operating system dependent code must
 * provide the four functions detailed below.
 * All functions should error() rather than returning
 * an error condition.
 *
 * eiaopenport(n, omode):
 *	open port #n for omode.
 *	return a pointer to an Eiaport p.
 * eiacloseport(p):
 *	close the device returned by eiaopenport.
 *	note that there may be multiple connections
 *	to a given port at any time, so some
 *	reference counting may be needed here.
 *	eiacloseport must not error.
 * eiardwr(p, a, n, iswrite):
 *	read or write n bytes of data at a on port p.
 *	if iswrite!=0, the call is a write.
 * eiactl(p, ctl):
 *	process the control message ctl.
 *	messages are typically a single letter 
 *	immediate followed by a number, e.g. b9600.
 *	messages are case-insensitive, so B9600 and b9600 
 *	mean the same thing.
 *	the following are messages supported by native Plan 9:
 *		b# - set baud rate to #.
 *		l# - set byte size to # bits/byte (5, 6, 7, or 8).
 *		d# - set dtr if # is non-zero; else clear it.
 *		k# - send a # millisecond break.
 *		r# - set rts if # is non-zero; else clear it.
 *		m# - obey cts signal if # is non-zero; else don't.
 *		i# - enable input fifo if # is non-zero; else disable.
 *		pc - set parity odd if c is 'o', even if c is 'e',
 *			else no parity.
 *		s# - set stop bits to # (1 or 2).
 *	the b and l messages are the most important.  the others
 * 	can safely go unimplemented for most uses.
 */

typedef struct Eiaport Eiaport;

extern Eiaport *eiaopenport(int, int);
extern void eiacloseport(Eiaport*);
extern long eiardwr(Eiaport*, void*, long, int);
extern void eiactl(Eiaport*, char*);
