DataMuseum.dk

Presents historical artifacts from the history of:

Regnecentalen RC-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Regnecentalen RC-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦a27d0219c⟧ TextFile

    Length: 7103 (0x1bbf)
    Types: TextFile
    Notes: UNIX file
    Names: »asy.h«

Derivation

└─⟦a6ab2eb36⟧ Bits:30004042/kconfig3.imd SW95705I 386/ix Multi-user Release 1.2
└─⟦a6ab2eb36⟧ UNIX Filesystem
    └─⟦this⟧ »kc/new/usr/include/sys/asy.h« 

TextFile

/*
 * Defines for PC AT asynchronous port driver.
 */

/*
 * Copyrighted as an unpublished work.
 * (c) Copyright 1986 INTERACTIVE Systems Corporation
 * All rights reserved.
 *
 * RESTRICTED RIGHTS
 *
 * These programs are supplied under a license.  They may be used,
 * disclosed, and/or copied only as permitted under such license
 * agreement.  Any copy must contain the above copyright notice and
 * this restricted rights notice.  Use, copying, and/or disclosure
 * of the programs is strictly prohibited unless otherwise provided
 * in the license agreement.
 */

#ident "@(#)asy.h	1.6 - 88/01/06"

/*
 * Async adapter addresses
 */
#define NUM_ASY 2
#define P_ASY0  0x03F8
#define P_ASY1  0x02F8

#ifdef AT386
/*
 * AT386 dependent interrupt vectors for async. adapters.
 */
#define ASYVECT0	0x04
#define	ASYVECT1	0x03
#endif /* AT386 */

/*
 * Definitions for INS8250 chips
 */

	/* defined as offsets from the data register */
#define DAT     0   /* receive/transmit data */
#define ICR     1   /* interrupt control register */
#define ISR     2   /* interrupt status register */
#define LCR     3   /* line control register */
#define MCR     4   /* modem control register */
#define LSR     5   /* line status register */
#define MSR     6   /* modem status register */
#define DLL     0   /* divisor latch (lsb) */
#define DLH     1   /* divisor latch (msb) */


/* ICR */

#define RIEN    0x01    /* enable receiver interrupt */
#define TIEN    0x02    /* enable transmitter interrupt */
#define SIEN    0x04    /* enable receiver line status interrupt */
#define MIEN    0x08    /* enable modem status interrupt */


/* ISR */

#define RSTATUS 0x06    /* change in receiver line status */
#define RxRDY   0x04    /* receiver data available */
#define TxRDY   0x02    /* transmitter holding register empty */
#define MSTATUS 0x00    /* change in modem status */


/* LCR 3 */

#define RXLEN   0x03    /* # of data bits per received/xmitted character */
#define STOP1   0x00
#define STOP2   0x04
#define PAREN   0x08
#define PAREVN  0x10
#define PARMARK 0x20
#define SNDBRK  0x40
#define DLAB    0x80

/* baud rate definitions */
#define ASY9600	12

/* Definitions for character length (data bits), in RXLEN field */
#define BITS5   0x00
#define BITS6   0x01
#define BITS7   0x02
#define BITS8   0x03


/* MCR */

#define DTR     0x01    /* bring up DTR */
#define RTS     0x02    /* bring up RTS */
#define OUT1    0x04
#define OUT2    0x08
#define LOOP    0x10    /* put chip into loopback state */


/* LSR */

#define RCA     0x01    /* receive char available */
#define OVRRUN  0x02    /* receive overrun */
#define PARERR  0x04    /* parity error */
#define FRMERR  0x08    /* framing/CRC error */
#define BRKDET  0x10    /* break detected (null ch + frmerr) */
#define XHRE    0x20    /* xmit holding register empty */
#define XSRE    0x40    /* xmit shift register empty */


/* MSR */

#define DCTS    0x01    /* CTS has changed state */
#define DDSR    0x02    /* DSR has changed state */
#define DRI     0x04    /* RI has changed state */
#define DDCD    0x08    /* DCD has changed state */
#define CTS     0x10    /* state of CTS */
#define DSR     0x20    /* state of DSR */
#define RI      0x40    /* state of RI */
#define DCD     0x80    /* state of DCD */
#ifdef VPIX
#define DELTAS(x) ((x)&(DCTS|DDSR|DRI|DDCD))
#define STATES(x) ((x)&(CTS|DSR|RI|DCD))
#endif /* VPIX */

#define asychan(dev)    (dev&0x0f)
#define asymajor(dev)   ((dev>>8)&0x7f)

/* asy_flags definitions */
#define XBRK	0x01            /* xmitting break in progress */
#define XFLUSH	0x02            /* must flush clist when finished */
#define	ASYHERE	0x80		/* adapter is present */
#define BRKTIME	HZ/4

/*
 * asy information structure
 */
struct asy
{
        int		asy_flags;	/* flags */
	unsigned	asy_dat;	/* xmit/rcv data register port addr. */
	unsigned	asy_icr;	/* interrupt cntrl. reg. port addr. */
	unsigned	asy_isr;	/* interrupt status reg. port addr. */
	unsigned 	asy_lcr;	/* line control reg. port addr. */
	unsigned	asy_mcr;	/* modem control reg. port addr. */
	unsigned	asy_lsr;	/* line status reg. port addr. */
	unsigned	asy_msr;	/* modem status reg. port addr. */
	int		asy_vect;	/* interrupt vector (mach. dependent) */
	dev_t		asy_dev;	/* minor device number of port */
	struct tty	*asy_tty;	/* pointer to tty struct */
	int             (*asyout)();    /* routine to output a byte */
	int             (*asyin)();     /* input a byte from a register */
	int             (*asyspl)();    /* spl level for ring buf processing*/
	int             (*asyproc)();   /* start routine for tty output */
#ifdef VPIX
	char            asy_opened;     /* open indicator */
	v86_t           *asystash;      /* saved v86proc ptr for psuedorupts*/
	int             asyintmask;     /* which pseudorupt to give */
	struct termss   asyss;          /* start stop charachters */
#endif /* VPIX */
	struct devsp    *drvr;          /* pointer to driver specific info */
};

/*
 * size of ring buffer for input characters.
 */
#define	RINGSIZ	  256

/*
 * Defines for ioctl calls
 */
#ifdef VPIX
#define AIOC    ('A'<<8)
#define AIOCINTTYPE     (AIOC|60)        /* set pseudorupt personality */
#define AIOCDOSMODE     (AIOC|61)        /* set DOSMODE */
#define AIOCNONDOSMODE  (AIOC|62)        /* reset DOSMODE */
#define AIOCSERIALOUT   (AIOC|63)        /* serial device data write */
#define AIOCSERIALIN    (AIOC|64)        /* serial device data read */
#define AIOCSETSS       (AIOC|65)        /* set start/stop chars */
#define AIOCINFO        (AIOC|66)        /* tell user what device we are */

	/* useful defines for SERIAL{IN,OUT} requests */
#define SO_DIVLLSB      1       /* Divisor Latch LSB request element */
#define SO_DIVLMSB      2       /* Divisor Latch MSB request element */
#define SO_LCR          3       /* Line Control register request element */
#define SO_MCR          4       /* Modem Control register request element */
#define SI_MSR          1       /* Modem Status Register request element */
#define SIO_MASK(elem) (1<<((elem)-1))
#endif /* VPIX */


/* Values for asy_opened field in asy struct */
#define ASY_NOT_OPEN    0
#define ASY_OPEN        1
#define ASY_EXCL_OPEN   2

/* Miscellaneous defines */
#define MODEMCTL    0x10            /* enables DCD hangups */

/* driver specific info particular to a set of devices -
   this is the primary structure that enables common code */
struct devsp {
         struct asy    *asy_tab;        /* pointer to asy structure for driver */
	 struct tty    *asy_tty;    /* ptr to tty structure for driver */
	 int           num_asy;     /* number of devices supported */
	 int           asy_opencnt; /* number of open devices for driver */
	 short	       ringbuf[RINGSIZ];  /* the drivers ring buffer */
	 short         *ringget;    /* pointer to start of buffer */
	 short         *ringput;    /* pointer to end of buffer */
	 short         ringcnt;     /* number of items in ring buffer */
	 char          asyrbsy;     /* is ring buffer being accessed? */
	 int           asyinitialized; /* has driver been initialized */
};