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