1: /*
2: * Copyright (c) 1986 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)drreg.h 1.1 (2.10BSD Berkeley) 12/1/86
7: */
8:
9: /*
10: * Registers of the DR11-W parallel DMA interface
11: */
12: struct drdevice {
13: short wcr; /* word count register */
14: short bar; /* bus address register */
15: short csr; /* csr/eir register */
16: short dar; /* input/output data register */
17: };
18:
19: struct sg1 {
20: short word; /* pass one word of info in or out */
21: };
22:
23: struct sg2 {
24: short word1; /* pass two words of info in or out */
25: short word2;
26: };
27:
28: /* Bits of the csr */
29: #define DR_GO 0000001 /* start transfer */
30: #define DR_FN1 0000002 /* user defined function bits */
31: #define DR_FN2 0000004
32: #define DR_FN3 0000010
33: #define DR_XBA 0000060 /* Unibus extension bits */
34: #define DR_IE 0000100 /* interrupt enable */
35: #define DR_RDY 0000200 /* ready bit */
36: #define DR_CYL 0000400 /* cycle start */
37: #define DR_ST1 0001000 /* user defined status */
38: #define DR_ST2 0002000
39: #define DR_ST3 0004000
40: #define DR_MANT 0010000 /* maintenance mode bit */
41: #define DR_ATTN 0020000 /* attention bit from interface */
42: #define DR_NEX 0040000 /* non-existant memory */
43: #define DR_ERR 0100000 /* general error bit */
44:
45: #define DRCSR_BITS \
46: "\10\20ERR\17NEX\16ATTN\15MAINT\14STA\13STB\12STC\
47: \11CYCL\10RDY\7IE\6XBA17\5XBA16\4FN3\3FN2\2FN1\1GO"
48:
49: /* Bits of the EIR */
50: #define DR_FLG 0000001 /* register flag 1=EIR, 0=CSR */
51: #define DR_NCYL 0000400 /* N-cycle burst selected */
52: #define DR_BDL 0001000 /* Burst data late */
53: #define DR_PAR 0002000 /* parity error */
54: #define DR_ACLO 0004000 /* powerfailure */
55: #define DR_MRQ 0010000 /* multicycle request */
56:
57: /* All remaining bits same as CSR */
58: #define DREIR_BITS \
59: "\10\20ERR\17NEX\16ATTN\15MRQ\14ACLO\13PAR\12BDL\11NCYL\1REG"
60:
61: /*
62: * Definitions for ioctl calls for DR11-W interface
63: */
64: #define DRGTTY _IOR(d, 1, struct sg2) /* get dr11 status */
65: #define DRSTTY _IOW(d, 2, struct sg2) /* set flags & function */
66: #define DRSFUN _IOW(d, 3, struct sg1) /* set function */
67: #define DRSFLAG _IOW(d, 4, struct sg1) /* set flags */
68: #define DRGCSR _IOR(d, 5, struct sg2) /* get csr and wcr */
69: #define _IOW(d, 6, struct sg1) /* set sig for ATTN interrupt */
70: #define DRESET _IO(d, 7) /* reset DR11-W interface */
71: #define DRSTIME _IOW(d, 8, struct sg1) /* set timeout */
72: #define DRCTIME _IO(d, 9) /* set timeout inactive */
73: #define DROUTPUT _IOW(d, 10, struct sg1) /* word to output data reg */
74: #define DRINPUT _IOR(d, 11, struct sg1) /* word from input data reg */
75: #define DRITIME _IO(d, 12) /* no set error on timeout */
76:
77: /*
78: * i_flags definition
79: */
80: #define DR_ALIVE 0000001 /* unit has attatched */
81: #define DR_OPEN 0000002 /* unit has been opened */
82: #define DR_TIMEOUT 0000004 /* unit needs timeout (set by user) */
83: #define DR_TACTIVE 0000010 /* timeout active on unit */
84: #define DR_IGNORE 0000020 /* ignore timeout error */
Defined struct's
sg1
defined in line
19;
never used
sg2
defined in line
23;
never used
Defined macros
defined in line
69;
never used
DR_GO
defined in line
29; used 1 times
DR_IE
defined in line
34; used 1 times
Usage of this include