siopvar.h revision 1.2 1 1.1 mw /*
2 1.1 mw * Copyright (c) 1990 The Regents of the University of California.
3 1.1 mw * All rights reserved.
4 1.1 mw *
5 1.1 mw * This code is derived from software contributed to Berkeley by
6 1.1 mw * Van Jacobson of Lawrence Berkeley Laboratory.
7 1.1 mw *
8 1.1 mw * Redistribution and use in source and binary forms, with or without
9 1.1 mw * modification, are permitted provided that the following conditions
10 1.1 mw * are met:
11 1.1 mw * 1. Redistributions of source code must retain the above copyright
12 1.1 mw * notice, this list of conditions and the following disclaimer.
13 1.1 mw * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 mw * notice, this list of conditions and the following disclaimer in the
15 1.1 mw * documentation and/or other materials provided with the distribution.
16 1.1 mw * 3. All advertising materials mentioning features or use of this software
17 1.1 mw * must display the following acknowledgement:
18 1.1 mw * This product includes software developed by the University of
19 1.1 mw * California, Berkeley and its contributors.
20 1.1 mw * 4. Neither the name of the University nor the names of its contributors
21 1.1 mw * may be used to endorse or promote products derived from this software
22 1.1 mw * without specific prior written permission.
23 1.1 mw *
24 1.1 mw * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 1.1 mw * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 1.1 mw * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 1.1 mw * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 1.1 mw * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 1.1 mw * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 1.1 mw * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 1.1 mw * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 1.1 mw * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 1.1 mw * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 1.1 mw * SUCH DAMAGE.
35 1.1 mw *
36 1.1 mw * @(#)siopvar.h 7.1 (Berkeley) 5/8/90
37 1.2 chopps * $Id: siopvar.h,v 1.2 1994/02/11 07:02:20 chopps Exp $
38 1.1 mw */
39 1.1 mw
40 1.1 mw struct siop_ds { /* Data Structure */
41 1.1 mw long scsi_addr; /* SCSI ID & sync */
42 1.1 mw long idlen; /* Identify message */
43 1.1 mw char *idbuf;
44 1.1 mw long cmdlen; /* SCSI command */
45 1.1 mw char *cmdbuf;
46 1.1 mw long stslen; /* Status */
47 1.1 mw char *stsbuf;
48 1.1 mw long msglen; /* Message */
49 1.1 mw char *msgbuf;
50 1.1 mw long sdtrolen; /* Sync Data Transfer Request out */
51 1.1 mw char *sdtrobuf;
52 1.1 mw long sdtrilen; /* Sync Data Transfer Request in */
53 1.1 mw char *sdtribuf;
54 1.1 mw struct {
55 1.1 mw long datalen;
56 1.1 mw char *databuf;
57 1.1 mw } chain[MAXPHYS/NBPG+1];
58 1.1 mw };
59 1.1 mw
60 1.1 mw struct siop_softc {
61 1.1 mw struct amiga_ctlr *sc_ac;
62 1.1 mw struct devqueue sc_dq;
63 1.1 mw struct devqueue sc_sq;
64 1.1 mw
65 1.1 mw /* should have one for each target? */
66 1.1 mw u_char sc_istat;
67 1.1 mw u_char sc_dstat;
68 1.1 mw u_char sc_sstat0;
69 1.1 mw u_char sc_sstat1;
70 1.1 mw struct siop_ds sc_ds;
71 1.1 mw u_char sc_flags;
72 1.1 mw u_char sc_lun;
73 1.1 mw u_long sc_clock_freq;
74 1.1 mw /* one for each target */
75 1.1 mw struct syncpar {
76 1.1 mw u_char state;
77 1.1 mw u_char period, offset;
78 1.1 mw } sc_sync[8];
79 1.1 mw u_char sc_slave;
80 1.1 mw u_char sc_scsi_addr;
81 1.1 mw u_char sc_stat[2];
82 1.1 mw u_char sc_msg[8];
83 1.1 mw };
84 1.1 mw
85 1.1 mw /* sc_flags */
86 1.1 mw #define SIOP_DMA 0x80 /* DMA I/O in progress */
87 1.1 mw #define SIOP_ALIVE 0x01 /* controller initialized */
88 1.1 mw #define SIOP_SELECTED 0x04 /* bus is in selected state. Needed for
89 1.1 mw correct abort procedure. */
90 1.1 mw
91 1.1 mw /* sync states */
92 1.1 mw #define SYNC_START 0 /* no sync handshake started */
93 1.1 mw #define SYNC_SENT 1 /* we sent sync request, no answer yet */
94 1.1 mw #define SYNC_DONE 2 /* target accepted our (or inferior) settings,
95 1.1 mw or it rejected the request and we stay async */
96