|
|
1.1 root 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: * Digital Equipment Corp.
7: *
8: * Redistribution is only permitted until one year after the first shipment
9: * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and
10: * binary forms are permitted provided that: (1) source distributions retain
11: * this entire copyright notice and comment, and (2) distributions including
12: * binaries display the following acknowledgement: This product includes
13: * software developed by the University of California, Berkeley and its
14: * contributors'' in the documentation or other materials provided with the
15: * distribution and in all advertising materials mentioning features or use
16: * of this software. Neither the name of the University nor the names of
17: * its contributors may be used to endorse or promote products derived from
18: * this software without specific prior written permission.
19: * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
20: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
21: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22: *
23: * @(#)if_qereg.h 7.3 (Berkeley) 6/28/90
24: */
25:
26: /* @(#)if_qereg.h 1.2 (ULTRIX) 1/3/85 */
27:
28: /****************************************************************
29: * *
30: * Licensed from Digital Equipment Corporation *
31: * Copyright (c) *
32: * Digital Equipment Corporation *
33: * Maynard, Massachusetts *
34: * 1985, 1986 *
35: * All rights reserved. *
36: * *
37: * The Information in this software is subject to change *
38: * without notice and should not be construed as a commitment *
39: * by Digital Equipment Corporation. Digital makes no *
40: * representations about the suitability of this software for *
41: * any purpose. It is supplied "As Is" without expressed or *
42: * implied warranty. *
43: * *
44: * If the Regents of the University of California or its *
45: * licensees modify the software in a manner creating *
46: * diriviative copyright rights, appropriate copyright *
47: * legends may be placed on the drivative work in addition *
48: * to that set forth above. *
49: * *
50: ****************************************************************/
51: /* ---------------------------------------------------------------------
52: * Modification History
53: *
54: * 13 Feb. 84 -- rjl
55: *
56: * Initial version of driver. derived from IL driver.
57: *
58: * ---------------------------------------------------------------------
59: */
60:
61: /*
62: * Digital Q-BUS to NI Adapter
63: */
64: struct qedevice {
65: u_short qe_sta_addr[2]; /* Station address (actually 6 */
66: u_short qe_rcvlist_lo; /* Receive list lo address */
67: u_short qe_rcvlist_hi; /* Receive list hi address */
68: u_short qe_xmtlist_lo; /* Transmit list lo address */
69: u_short qe_xmtlist_hi; /* Transmit list hi address */
70: u_short qe_vector; /* Interrupt vector */
71: u_short qe_csr; /* Command and Status Register */
72: };
73:
74: /*
75: * Command and status bits (csr)
76: */
77: #define QE_RCV_ENABLE 0x0001 /* Receiver enable */
78: #define QE_RESET 0x0002 /* Software reset */
79: #define QE_NEX_MEM_INT 0x0004 /* Non existant mem interrupt */
80: #define QE_LOAD_ROM 0x0008 /* Load boot/diag from rom */
81: #define QE_XL_INVALID 0x0010 /* Transmit list invalid */
82: #define QE_RL_INVALID 0x0020 /* Receive list invalid */
83: #define QE_INT_ENABLE 0x0040 /* Interrupt enable */
84: #define QE_XMIT_INT 0x0080 /* Transmit interrupt */
85: #define QE_ILOOP 0x0100 /* Internal loopback */
86: #define QE_ELOOP 0x0200 /* External loopback */
87: #define QE_STIM_ENABLE 0x0400 /* Sanity timer enable */
88: #define QE_POWERUP 0x1000 /* Tranceiver power on */
89: #define QE_CARRIER 0x2000 /* Carrier detect */
90: #define QE_RCV_INT 0x8000 /* Receiver interrupt */
91:
92: /*
93: * Transmit and receive ring discriptor ---------------------------
94: *
95: * The QNA uses the flag, status1 and the valid bit as a handshake/semiphore
96: * mechinism.
97: *
98: * The flag word is written on ( bits 15,15 set to 1 ) when it reads the
99: * descriptor. If the valid bit is set it considers the address to be valid.
100: * When it uses the buffer pointed to by the valid address it sets status word
101: * one.
102: */
103: struct qe_ring {
104: u_short qe_flag; /* Buffer utilization flags */
105: u_short qe_addr_hi:6, /* Hi order bits of buffer addr */
106: qe_odd_begin:1, /* Odd byte begin and end (xmit)*/
107: qe_odd_end:1,
108: qe_fill1:4,
109: qe_setup:1, /* Setup packet */
110: qe_eomsg:1, /* End of message flag */
111: qe_chain:1, /* Chain address instead of buf */
112: qe_valid:1; /* Address field is valid */
113: u_short qe_addr_lo; /* Low order bits of address */
114: short qe_buf_len; /* Negative buffer length */
115: u_short qe_status1; /* Status word one */
116: u_short qe_status2; /* Status word two */
117: };
118:
119: /*
120: * Status word definations (receive)
121: * word1
122: */
123: #define QE_OVF 0x0001 /* Receiver overflow */
124: #define QE_CRCERR 0x0002 /* CRC error */
125: #define QE_FRAME 0x0004 /* Framing alignment error */
126: #define QE_SHORT 0x0008 /* Packet size < 10 bytes */
127: #define QE_RBL_HI 0x0700 /* Hi bits of receive len */
128: #define QE_RUNT 0x0800 /* Runt packet */
129: #define QE_DISCARD 0x1000 /* Discard the packet */
130: #define QE_ESETUP 0x2000 /* Looped back setup or eloop */
131: #define QE_ERROR 0x4000 /* Receiver error */
132: #define QE_LASTNOT 0x8000 /* Not the last in the packet */
133: /* word2 */
134: #define QE_RBL_LO 0x00ff /* Low bits of receive len */
135:
136: /*
137: * Status word definations (transmit)
138: * word1
139: */
140: #define QE_CCNT 0x00f0 /* Collision count this packet */
141: #define QE_FAIL 0x0100 /* Heart beat check failure */
142: #define QE_ABORT 0x0200 /* Transmission abort */
143: #define QE_STE16 0x0400 /* Sanity timer default on */
144: #define QE_NOCAR 0x0800 /* No carrier */
145: #define QE_LOSS 0x1000 /* Loss of carrier while xmit */
146: /* word2 */
147: #define QE_TDR 0x3fff /* Time domain reflectometry */
148:
149: /*
150: * General constant definations
151: */
152: #define QEALLOC 0 /* Allocate an mbuf */
153: #define QENOALLOC 1 /* No mbuf allocation */
154: #define QEDEALLOC 2 /* Release an mbuf chain */
155:
156: #define QE_NOTYET 0x8000 /* Descriptor not in use yet */
157: #define QE_INUSE 0x4000 /* Descriptor being used by QNA */
158: #define QE_MASK 0xc000 /* Lastnot/error/used mask */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.