scivar.h revision 1.1 1 1.1 chopps /*
2 1.1 chopps * Copyright (c) 1990 The Regents of the University of California.
3 1.1 chopps * All rights reserved.
4 1.1 chopps *
5 1.1 chopps * This code is derived from software contributed to Berkeley by
6 1.1 chopps * Van Jacobson of Lawrence Berkeley Laboratory.
7 1.1 chopps *
8 1.1 chopps * Redistribution and use in source and binary forms, with or without
9 1.1 chopps * modification, are permitted provided that the following conditions
10 1.1 chopps * are met:
11 1.1 chopps * 1. Redistributions of source code must retain the above copyright
12 1.1 chopps * notice, this list of conditions and the following disclaimer.
13 1.1 chopps * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 chopps * notice, this list of conditions and the following disclaimer in the
15 1.1 chopps * documentation and/or other materials provided with the distribution.
16 1.1 chopps * 3. All advertising materials mentioning features or use of this software
17 1.1 chopps * must display the following acknowledgement:
18 1.1 chopps * This product includes software developed by the University of
19 1.1 chopps * California, Berkeley and its contributors.
20 1.1 chopps * 4. Neither the name of the University nor the names of its contributors
21 1.1 chopps * may be used to endorse or promote products derived from this software
22 1.1 chopps * without specific prior written permission.
23 1.1 chopps *
24 1.1 chopps * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 1.1 chopps * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 1.1 chopps * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 1.1 chopps * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 1.1 chopps * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 1.1 chopps * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 1.1 chopps * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 1.1 chopps * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 1.1 chopps * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 1.1 chopps * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 1.1 chopps * SUCH DAMAGE.
35 1.1 chopps *
36 1.1 chopps * @(#)scivar.h 7.1 (Berkeley) 5/8/90
37 1.1 chopps * $Id: scivar.h,v 1.1 1994/02/28 06:06:25 chopps Exp $
38 1.1 chopps */
39 1.1 chopps
40 1.1 chopps struct sci_softc {
41 1.1 chopps struct amiga_ctlr *sc_ac;
42 1.1 chopps struct devqueue sc_dq;
43 1.1 chopps struct devqueue sc_sq;
44 1.1 chopps
45 1.1 chopps volatile u_char *sci_data; /* r: Current data */
46 1.1 chopps volatile u_char *sci_odata; /* w: Out data */
47 1.1 chopps volatile u_char *sci_icmd; /* rw: Initiator command */
48 1.1 chopps volatile u_char *sci_mode; /* rw: Mode */
49 1.1 chopps volatile u_char *sci_tcmd; /* rw: Target command */
50 1.1 chopps volatile u_char *sci_bus_csr; /* r: Bus Status */
51 1.1 chopps volatile u_char *sci_sel_enb; /* w: Select enable */
52 1.1 chopps volatile u_char *sci_csr; /* r: Status */
53 1.1 chopps volatile u_char *sci_dma_send; /* w: Start dma send data */
54 1.1 chopps volatile u_char *sci_idata; /* r: Input data */
55 1.1 chopps volatile u_char *sci_trecv; /* w: Start dma receive, target */
56 1.1 chopps volatile u_char *sci_iack; /* r: Interrupt Acknowledge */
57 1.1 chopps volatile u_char *sci_irecv; /* w: Start dma receive, initiator */
58 1.1 chopps
59 1.1 chopps int (*dma_xfer_in)(); /* psuedo DMA transfer */
60 1.1 chopps int (*dma_xfer_out)(); /* psuedo DMA transfer */
61 1.1 chopps int (*dma_intr)(); /* board-specific interrupt */
62 1.1 chopps u_char sc_flags;
63 1.1 chopps u_char sc_lun;
64 1.1 chopps /* one for each target */
65 1.1 chopps struct syncpar {
66 1.1 chopps u_char state;
67 1.1 chopps u_char period, offset;
68 1.1 chopps } sc_sync[8];
69 1.1 chopps u_char sc_slave;
70 1.1 chopps u_char sc_scsi_addr;
71 1.1 chopps u_char sc_stat[2];
72 1.1 chopps u_char sc_msg[8];
73 1.1 chopps };
74 1.1 chopps
75 1.1 chopps /* sc_flags */
76 1.1 chopps #define SCI_IO 0x80 /* DMA I/O in progress */
77 1.1 chopps #define SCI_ALIVE 0x01 /* controller initialized */
78 1.1 chopps #define SCI_SELECTED 0x04 /* bus is in selected state. Needed for
79 1.1 chopps correct abort procedure. */
80 1.1 chopps
81 1.1 chopps /* sync states */
82 1.1 chopps #define SYNC_START 0 /* no sync handshake started */
83 1.1 chopps #define SYNC_SENT 1 /* we sent sync request, no answer yet */
84 1.1 chopps #define SYNC_DONE 2 /* target accepted our (or inferior) settings,
85 1.1 chopps or it rejected the request and we stay async *
86