1 /* $NetBSD: a12dcreg.h,v 1.1 1998/09/23 21:14:02 ross Exp $ */
3 /* [Notice revision 2.2]
4 * Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright and
13 * author notice, this list of conditions, and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of Avalon Computer Systems, Inc. nor the names of
18 * its contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 * 4. This copyright will be assigned to The NetBSD Foundation on
21 * 1/1/2000 unless these terms (including possibly the assignment
22 * date) are updated in writing by Avalon prior to the latest specified
25 * THIS SOFTWARE IS PROVIDED BY AVALON COMPUTER SYSTEMS, INC. AND CONTRIBUTORS
26 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AVALON OR THE CONTRIBUTORS
29 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
38 #define A12DCREG() /* Generate ctags(1) key */
40 /* Id: a12backdriver.h,v 1.1.1.1 1997/12/04 04:33:31 ross Exp */
42 #define A12C_TXRDY 0x8000
43 #define A12C_TXACK 0x4000
46 #define MCQ_SLOTNO 0x81
48 #define MSP(n) (a12_mstate+(n))
50 #define CHANNEL_KDATA 1
51 #define CHANNEL_KMARK 2
52 #define CHANNEL_MULTI 3
53 #define CHANNEL_MONITOR 4
54 #define CHANNEL_SROM_A 5
55 #define CHANNEL_SROM_D 6
56 #define CHANNEL_CONSOLE 7
58 /* detached console commands > to detached console */
60 #define CPX_GEO 129 /* >return geographical address (card #)*/
61 #define CPX_LOGMC 130 /* >return multi channel log level */
62 #define CPX_PANIC 131 /* >process has entered panic() */
63 #define CPX_READY 132 /* >fw kernel can accept CPX_GO command */
64 #define CPX_GO 133 /* <fw kernel should proceed with boot */
66 #define MAX_EVENTS 1000
71 #define mcgetput(mn,chan,byte) msgetput(&a12_mstate[mn],(chan),(byte))
73 typedef unsigned char a12uchar
;
76 tx_idle
, /* transmitter idle */
77 tx_braaw
/* transmitter byte ready assert ack wait */
81 rx_idle
, /* receiver idle */
82 rx_busy
/* receiver byte is ready */
85 typedef volatile long mmreg_t
;
87 typedef struct mstate_struct
{
88 mmreg_t
*xcdr
; /* address of CDR */
89 unsigned short cbvsr
, /* software copy */
90 cdr
; /* software copy */
91 unsigned short txsv
, rxsv
; /* transmitter and receiver states */
101 int txrdy_out
, txrdy_in
, /* current polarity of interlocks */
103 char lastr
, lastrc
, /* last received char. and channel */
104 lastt
, lasttc
; /* last transmitted char. and channel */
105 unsigned int rx_busy_wait
, /* receive busy ticks */
106 rx_busy_cnt
, /* receive busy start count */
107 tx_busy_wait
, /* transmit busy ticks */
108 tx_busy_cnt
; /* transmit busy start count */
109 unsigned int tbytes
, /* bytes not in block send */
110 tblkbytes
, /* bytes in block send */
111 tblks
; /* total blocks */
112 unsigned int blwobe
, /* blocks sent without retry */
113 blwbe
; /* blocks sent with retry */
114 unsigned int max_blkretry
; /* max. retries to send block */
115 unsigned int max_blktime
, /* max. time to send block */
116 max_blktimesz
; /* size of max. time block */
117 unsigned int avg_blksz
, /* avg. size block */
118 avg_blktime
; /* avg. time to send block */
119 unsigned int retry_time
; /* time spent sending re-try blocks */
125 BS
,BE
,BL
,READ0
,READ1
,WRITE0
,WRITE1
,R360
,W360
,CL1
,CL2
,IDL1
,IDL2
131 char m
; /* module # */
138 /* EVENT TRACKING END */
140 mstate_type a12_mstate
[MAX_MODULES
];
142 int a12console_last_unexpected_error
;
144 int a12dccnattach(void);