xref: /original-bsd/sys/hp300/dev/rdvar.h (revision 9639f1d4)
1 /*
2  * Copyright (c) 1988 University of Utah.
3  * Copyright (c) 1982, 1990, 1993
4  *	The Regents of the University of California.  All rights reserved.
5  *
6  * This code is derived from software contributed to Berkeley by
7  * the Systems Programming Group of the University of Utah Computer
8  * Science Department.
9  *
10  * %sccs.include.redist.c%
11  *
12  * from: Utah $Hdr: rdvar.h 1.1 92/12/21$
13  *
14  *	@(#)rdvar.h	8.1 (Berkeley) 06/10/93
15  */
16 
17 struct	rdidentinfo {
18 	short	ri_hwid;		/* 2 byte HW id */
19 	short	ri_maxunum;		/* maximum allowed unit number */
20 	char	*ri_desc;		/* drive type description */
21 	int	ri_nblocks;		/* DEV_BSIZE blocks on disk */
22 };
23 
24 struct	rdinfo {
25 	struct	disklabel ri_label;	/* label */
26 	int	ri_bopen;		/* mask of open block devs */
27 	int	ri_copen;		/* mask of open char devs */
28 	int	ri_open;		/* composite mask of open devs */
29 };
30 
31 struct	rd_softc {
32 	struct	hp_device *sc_hd;
33 	int	sc_flags;
34 	short	sc_type;
35 	short	sc_punit;
36 	char	*sc_addr;
37 	int	sc_resid;
38 	u_int	sc_wpms;
39 	struct	rdinfo sc_info;
40 	struct	devqueue sc_dq;
41 	struct	rd_iocmd sc_ioc;
42 	struct	rd_rscmd sc_rsc;
43 	struct	rd_stat sc_stat;
44 	struct	rd_ssmcmd sc_ssmc;
45 	struct	rd_srcmd sc_src;
46 	struct	rd_clearcmd sc_clear;
47 };
48 
49 /* sc_flags values */
50 #define	RDF_ALIVE	0x01
51 #define	RDF_SEEK	0x02
52 #define RDF_SWAIT	0x04
53 #define RDF_OPENING	0x08
54 #define RDF_CLOSING	0x10
55 #define RDF_WANTED	0x20
56 #define RDF_WLABEL	0x40
57 
58 struct rdstats {
59 	long	rdretries;
60 	long	rdresets;
61 	long	rdtimeouts;
62 	long	rdpolltries;
63 	long	rdpollwaits;
64 };
65 
66 #define	rdunit(x)	(minor(x) >> 3)
67 #define rdpart(x)	(minor(x) & 0x7)
68 #define	rdpunit(x)	((x) & 7)
69 #define rdlabdev(d)	(dev_t)(((int)(d)&~7)|2)	/* rd?c */
70 
71 #define	b_cylin		b_resid
72 
73 #define	RDRETRY		5
74 #define RDWAITC		1	/* min time for timeout in seconds */
75