xref: /netbsd/sys/arch/vax/vax/crl.h (revision 6550d01e)
1 /*	$NetBSD: crl.h,v 1.2 1999/04/12 20:57:52 pk Exp $	*/
2 /*
3  * @(#)crl.h	7.1 (Berkeley) 6/5/86
4  */
5 
6 /****************************************************************
7  *                                                              *
8  *        Licensed from Digital Equipment Corporation           *
9  *                       Copyright (c)                          *
10  *               Digital Equipment Corporation                  *
11  *                   Maynard, Massachusetts                     *
12  *                         1985, 1986                           *
13  *                    All rights reserved.                      *
14  *                                                              *
15  *        The Information in this software is subject to change *
16  *   without notice and should not be construed as a commitment *
17  *   by  Digital  Equipment  Corporation.   Digital   makes  no *
18  *   representations about the suitability of this software for *
19  *   any purpose.  It is supplied "As Is" without expressed  or *
20  *   implied  warranty.                                         *
21  *                                                              *
22  *        If the Regents of the University of California or its *
23  *   licensees modify the software in a manner creating         *
24  *   derivative copyright rights, appropriate copyright         *
25  *   legends may be placed on  the derivative work in addition  *
26  *   to that set forth above.                                   *
27  ****************************************************************/
28 
29 /*
30  * Console RL02 status of current transfer (read only)
31  */
32 #define CRL_S_XCMPLT	1		/* transaction complete */
33 #define CRL_S_XCONT	2		/* continue transaction */
34 #define CRL_S_ABORT	3		/* transation abort */
35 #define CRL_S_RETSTS	4		/* return device status */
36 #define CRL_S_HNDSHK	0x80		/* handshake err during transaction */
37 #define CRL_S_HWERR	0x81		/* hardware err during transaction */
38 
39 /*
40  * Console RL02 function codes
41  */
42 #define CRL_F_NOOP	0		/* No operation */
43 #define CRL_F_RSTSTS	2		/* reset and return device status */
44 #define CRL_F_ABORT	3		/* abort transfer */
45 #define CRL_F_RETSTS	4		/* read device status */
46 #define CRL_F_WRITE	5		/* write block data */
47 #define CRL_F_READ	6		/* read block data */
48 
49 /*
50  * Console sectoring information.
51  * The console understands the rl02 as having 512 byte sectors.
52  */
53 #define	CRLBYSEC 512			/* bytes/sector */
54 #define	MAXSEC 20480		 	/* sectors/rl02 */
55 
56 /*
57  * STXCS bit definitions
58  */
59 #define STXCS_RDY	0x00000080	/* ready bit */
60 #define STXCS_IE	0x00000040	/* interrupt enable */
61 
62 #define	CRLERRS		5	/* number of retries before quitting */
63 
64 /*
65  * The state byte is used to retain exclusivity,
66  * and contains the busy flag.
67  */
68 #define	CRL_IDLE	0
69 #define	CRL_OPEN	1
70 #define	CRL_BUSY	2
71 
72 
73 #define	CRLDS_BITS \
74 "\20\20WDE\17CHE\16WL\15SKTO\14SPE\13WGE\12VC\11DSE\
75 \10DT\7HS\6CO\5HO\4BH\3STC\2STB\1STA"
76 
77 #define	CRLCS_BITS \
78 "\20\20CE\17DE\16NXM\15DLT\14DCRC\13OPI\1DRDY"
79