xref: /original-bsd/sys/vax/vax/rx50reg.h (revision 05bc5180)
1 /*
2  * Copyright (c) 1988 Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Chris Torek.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)rx50reg.h	7.2 (Berkeley) 06/28/90
11  */
12 
13 /*
14  * RX50 registers.
15  */
16 
17 /*
18  * The names below do not quite match the DEC documentation simply because
19  * the names in the documentation are so bad.
20  */
21 struct rx50device {
22 	u_short	rxid;		/* identification */
23 	u_short	reserved;
24 	u_short	rxcmd;		/* command function reg */
25 	u_short	rxtrk;		/* track */
26 	u_short	rxsec;		/* sector */
27 	u_short	rxcsc;		/* current sector */
28 	u_short	rxict;		/* incorrect track (???) */
29 	u_short	rxext;		/* extend command register */
30 	u_short	rxedb;		/* empty data buffer (read) */
31 	u_short	rxrda;		/* reset data address */
32 	u_short	rxgo;		/* read to start current cmd */
33 	u_short	rxfdb;		/* fill data buffer (write) */
34 };
35 
36 #define	RX50SEC		10	/* sectors per track */
37 #define	RX50MAXSEC	800	/* 10 sectors times 80 tracks */
38 
39 /*
40  * Do the sector skew given the sector and track
41  * number (it depends on both!).
42  */
43 /*			(((((s) / 5) + 2 * ((s) + (t))) % 10) + 1) */
44 #define	RX50SKEW(s, t)	(((s) / 5) + "\1\3\5\7\11\1\3\5\7"[((s) + (t)) % 5])
45 
46 /*
47  * Values in the command function register.
48  */
49 #define	RXCMD_ERROR	0x80	/* error bit (composite?) */
50 #define	RXCMD_READ	0x40	/* read command */
51 #define	RXCMD_WRITE	0x70	/* write command */
52 #define	RXCMD_RESET	0x20	/* reset command */
53 #define	RXCMD_DONE	0x08	/* operation done (status) */
54 #define	RXCMD_DRIVE0	0x00	/* select drive 0 (csa1) */
55 #define	RXCMD_DRIVE1	0x02	/* select drive 1 (csa2) */
56