xref: /original-bsd/sys/news3400/hbdev/scsic.h (revision 3705696b)
1 /*
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
7  *
8  * %sccs.include.redist.c%
9  *
10  * from: $Hdr: scsic.h,v 4.300 91/06/09 06:22:24 root Rel41 $ SONY
11  *
12  *	@(#)scsic.h	8.1 (Berkeley) 06/11/93
13  */
14 
15 /*
16  * Copyright (c) 1987- by SONY Corporation.
17  */
18 
19 /*
20  *	scsic.h	ver 1.1
21  *
22  *		Header file for scsi.c.
23  */
24 
25 #define SCSI_NOTWAIT	0x2		/* don't wait cmd completion */
26 
27 #define	splhi		spl7		/* IPL 7  Be careful to use this.*/
28 
29 /*
30  * Delay units are in microseconds.
31  *
32  *	1ms = 1000  on news800
33  *	so 1ms = 1500 on 25MHz
34  */
35 #define HDELAY(n)				\
36 	{					\
37 		register int N = (n)*1500 ;	\
38 		while(--N > 0);			\
39 	}
40 
41 struct scsi_stat {
42 	int	wbc;	/* # of channel that is waiting for scsi bus free */
43 	int	wrc;	/* # of channel that is waiting for reselection */
44 	struct sc_chan_stat *ip;
45 			/* In progress channel. Same as ISTAT.IP */
46 	int	ipc;		/* number of in progress channel. */
47 	int	dma_stat;	/* OFF = DMAC is not used */
48 #define SC_DMAC_RD	1
49 #define SC_DMAC_WR	2
50 };
51 
52 #undef VOLATILE
53 #ifdef mips
54 #define VOLATILE volatile
55 #else
56 #define VOLATILE
57 #endif
58 
59 struct sc_chan_stat {
60 	struct scsi	*sc ;		/* scsi struct address */
61 	u_char		comflg;		/* flag for save comand pointer */
62 	u_int		stcnt;		/* save transfer count */
63 	u_char		*spoint;	/* save transfer point */
64 	u_int		stag;		/* save tag register */
65 	u_int		soffset;	/* save offset register */
66 	u_char		intr_flg;	/* interrupt flag. SCSI_INTEN/INTDIS */
67 	int		chan_num;	/* channel NO. */
68 	VOLATILE struct sc_chan_stat *wb_next;	/* wait bus channel queue */
69 };
70 
71 #undef VOLATILE
72 
73 extern struct scintsw scintsw[];
74 
75 extern struct scsi_stat scsi_stat;
76