/* KLEENIX_ID: @(#)hpibio.h 26.1 */ #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif /* card address constants */ #define IOSTART_ADDR 0x400000 /* start of I/O space */ #define START_ADDR 0x600000 /* start for "other" cards */ #define INTERNAL_CARD 0x478000 /* INTERNAL HPIB card address */ /* card id constants */ #define NO_ID 0 #define INTERNAL_HPIB 1 #define HP98624 2 /* hpib */ #define HP98626 3 /* serial */ #define HP98625 4 /* high-speed disk interface */ #define HP98627 5 /* moon unit */ #define HP98628 6 /* hp98628 */ #define HP9816A 7 /* 9816a graphics frame buffer */ #define HP9826A 8 /* 9826a graphics frame buffer */ #define HP9836A 9 /* 9836a graphics frame buffer */ #define HP9836C 10 /* 9836c graphics frame buffer */ #define HP98644 11 /* low cost serial */ enum type_hpib_line { REN_LINE, IFC_LINE, SRQ_LINE, EOI_LINE, NRFD_LINE, NDAC_LINE, DAV_LINE, ATN_LINE }; /* transfer types */ enum TFR_type {NO_TFR, DMA_TFR, INTR_TFR, FHS_TFR, BURST_TFR, BO_END_TFR}; /* transfer requests */ enum transfer_request_type {MAX_OVERLAP, MAX_SPEED, MUST_DMA, MUST_FHS, MUST_INTR}; /* obtainable interrupts */ #define INT_SRQ 0x01 /* requested SRQ interrupt */ #define INT_PPL 0x02 /* requested parallel poll interrupt */ /* hp-ib addressing group bases */ #define LAG_BASE 0x20 /* listener address base */ #define TAG_BASE 0x40 /* talker address base */ #define SCG_BASE 0x60 /* secondary address base */ /* hp-ib command equates in odd parity */ #define GTL 0x01 /* go to local */ #define SDC 0x04 /* selective device clear */ #define PPC 0x85 /* ppoll configure */ #define GET 0x08 /* group execute trigger */ #define TCT 0x89 /* take control */ #define LLO 0x91 /* local lockout */ #define DCL 0x94 /* device clear */ #define PPU 0x15 /* ppoll unconfigure */ #define SPE 0x98 /* spoll enable */ #define SPD 0x19 /* spoll disable */ #define UNL 0xbf /* unlisten */ #define UNT 0xdf /* untalk */ #define RSV_MASK 0x40 /* SRQ is set by this guy (in spoll byte) */ /* driver declarations */ struct drv_table_type { int (*iod_init)(); int (*iod_ident)(); int (*iod_clear_wopp)(); int (*iod_clear)(); int (*iod_ifc)(); int (*iod_isr)(); int (*iod_tfr)(); int (*iod_pplset)(); int (*iod_pplclr)(); int (*iod_ppoll)(); int (*iod_spoll)(); int (*iod_preamb)(); int (*iod_postamb)(); int (*iod_mesg)(); int (*iod_hst)(); int (*iod_abort)(); }; /* ** interface driver space ** WARNING: assembly language dependency in simons.s */ struct isc_table_type { struct buf *b_actf; struct buf *b_actl; struct buf *ppoll_f; /* those waiting for ppoll */ struct buf *ppoll_l; struct buf *spoll_f; /* those waiting for spoll */ struct buf *spoll_l; char card_type; char my_isc; char my_address; char state; char active; char int_lvl; unsigned char spoll_byte; enum TFR_type transfer; struct drv_table_type *iosw; int *card_ptr; unsigned short intcopy; unsigned short intmsksav; unsigned short intmskcpy; struct dma_channel *dma_chan; unsigned char int_flags; unsigned char int_enabled; struct buf *owner; char ppoll_flag; /* info for ti9914 ppoll requests */ unsigned char ppoll_mask; unsigned char ppoll_sense; int resid; struct dma_chain *base; /* transfer information */ struct dma_chain *chain; struct dma_chain *extent; struct sw_intloc intloc; /* for software triggers */ }; /* flags for state above */ #define F_EOI 0x1 #define F_ABI 0x2 #define MINISC 0 #define EXTERNALISC 32 #define MAXISC 63 struct isc_table_type *isc_table[64]; /* message IO flags */ #define T_WRITE 0x1 #define T_EOI 0x2 #define T_PPL 0x4 #define TIMED_OUT 2 /* escape value */ #define START_POLL bp->b_queue->markstack = (int (**)())get_sp();\ if (bp->b_queue->timeflag) escape(TIMED_OUT) #define END_POLL bp->b_queue->markstack = 0 /* temporary, till we get it right */ #define SWAP_BASE 2000