Home | History | Annotate | Line # | Download | only in dev
scsireg.h revision 1.1
      1  1.1  tsubai /*
      2  1.1  tsubai  * Copyright (c) 1992, 1993
      3  1.1  tsubai  *	The Regents of the University of California.  All rights reserved.
      4  1.1  tsubai  *
      5  1.1  tsubai  * This code is derived from software contributed to Berkeley by
      6  1.1  tsubai  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
      7  1.1  tsubai  *
      8  1.1  tsubai  * Redistribution and use in source and binary forms, with or without
      9  1.1  tsubai  * modification, are permitted provided that the following conditions
     10  1.1  tsubai  * are met:
     11  1.1  tsubai  * 1. Redistributions of source code must retain the above copyright
     12  1.1  tsubai  *    notice, this list of conditions and the following disclaimer.
     13  1.1  tsubai  * 2. Redistributions in binary form must reproduce the above copyright
     14  1.1  tsubai  *    notice, this list of conditions and the following disclaimer in the
     15  1.1  tsubai  *    documentation and/or other materials provided with the distribution.
     16  1.1  tsubai  * 3. All advertising materials mentioning features or use of this software
     17  1.1  tsubai  *    must display the following acknowledgement:
     18  1.1  tsubai  *	This product includes software developed by the University of
     19  1.1  tsubai  *	California, Berkeley and its contributors.
     20  1.1  tsubai  * 4. Neither the name of the University nor the names of its contributors
     21  1.1  tsubai  *    may be used to endorse or promote products derived from this software
     22  1.1  tsubai  *    without specific prior written permission.
     23  1.1  tsubai  *
     24  1.1  tsubai  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     25  1.1  tsubai  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     26  1.1  tsubai  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     27  1.1  tsubai  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     28  1.1  tsubai  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     29  1.1  tsubai  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     30  1.1  tsubai  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     31  1.1  tsubai  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     32  1.1  tsubai  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     33  1.1  tsubai  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     34  1.1  tsubai  * SUCH DAMAGE.
     35  1.1  tsubai  *
     36  1.1  tsubai  * from: $Hdr: scsireg.h,v 4.300 91/06/09 06:38:12 root Rel41 $ SONY
     37  1.1  tsubai  *
     38  1.1  tsubai  *	@(#)scsireg.h	8.1 (Berkeley) 6/11/93
     39  1.1  tsubai  */
     40  1.1  tsubai 
     41  1.1  tsubai /*
     42  1.1  tsubai  *	scsireg.h
     43  1.1  tsubai  */
     44  1.1  tsubai 
     45  1.1  tsubai #ifndef __SCSIREG__
     46  1.1  tsubai #define __SCSIREG__ 1
     47  1.1  tsubai 
     48  1.1  tsubai /*
     49  1.1  tsubai  *	initiator status byte bit image
     50  1.1  tsubai  */
     51  1.1  tsubai #define	INST_EP		0x80		/* End of Process */
     52  1.1  tsubai #define INST_WR		0x40		/* Waiting Reselection */
     53  1.1  tsubai #define	INST_IP		0x20		/* In Process */
     54  1.1  tsubai #define	INST_WAIT	0x10		/* Waiting Bus free */
     55  1.1  tsubai #define	INST_LB		0x8		/* Loss of BUSY */
     56  1.1  tsubai #define	INST_TO		0x4		/* Time Out */
     57  1.1  tsubai #define	INST_PRE	0x2		/* PaRameter Error */
     58  1.1  tsubai #define	INST_HE		0x1		/* Hard Error */
     59  1.1  tsubai 
     60  1.1  tsubai #define	INSTERMASK	0x7
     61  1.1  tsubai 
     62  1.1  tsubai 
     63  1.1  tsubai /*
     64  1.1  tsubai  *	target status byte bit image
     65  1.1  tsubai  */
     66  1.1  tsubai #define	VENDOR		0x61
     67  1.1  tsubai #define	TGSTMASK	0x1e
     68  1.1  tsubai #define	TGST_RSVCFLCT	0x18
     69  1.1  tsubai #define	TGST_INTERMED	0x10
     70  1.1  tsubai #define	TGST_BUSY	0x8
     71  1.1  tsubai #define	TGST_CC		0x2
     72  1.1  tsubai #define	TGST_GOOD	0x0
     73  1.1  tsubai 
     74  1.1  tsubai #define	TS_MAPPED_PIO	0x01		/* program I/O with map */
     75  1.1  tsubai #define	TS_CONTR_ON	0x02		/* contiguous transfer on */
     76  1.1  tsubai #define	TS_CONTR_OFF	0x04		/* contiguous transfer off */
     77  1.1  tsubai #define	TS_BYTE_DMA	0x08		/* DMA transfer(byte access) */
     78  1.1  tsubai #define	TS_LONG_DMA	0x10		/* DMA transfer(long access) */
     79  1.1  tsubai 
     80  1.1  tsubai 
     81  1.1  tsubai /*
     82  1.1  tsubai  *	message byte
     83  1.1  tsubai  */
     84  1.1  tsubai #define MSG_IDENT	0x80
     85  1.1  tsubai #define MSG_RESELEN	0x40
     86  1.1  tsubai #define MSG_CCOMP	0
     87  1.1  tsubai #define	MSG_EXTND	1
     88  1.1  tsubai #define MSG_SDP		2
     89  1.1  tsubai #define MSG_RDP		3
     90  1.1  tsubai #define MSG_DCNT	4
     91  1.1  tsubai #define MSG_IDE		5
     92  1.1  tsubai /*#define MSG_ABORT	6*/
     93  1.1  tsubai #define MSG_MREJ	7
     94  1.1  tsubai #define MSG_NOP		8
     95  1.1  tsubai #define MSG_PERROR	9
     96  1.1  tsubai 
     97  1.1  tsubai 
     98  1.1  tsubai /*
     99  1.1  tsubai  *	message identify byte bit image
    100  1.1  tsubai  */
    101  1.1  tsubai #define	IDT_DISCON	0x40
    102  1.1  tsubai #define	IDT_DRMASK	0x7
    103  1.1  tsubai 
    104  1.1  tsubai 
    105  1.1  tsubai /*
    106  1.1  tsubai  *	scsi command opcodes
    107  1.1  tsubai  */
    108  1.1  tsubai #define SCOP_TST	0x00
    109  1.1  tsubai #define SCOP_REZERO	0x01
    110  1.1  tsubai #define	SCOP_REWIND	0x01
    111  1.1  tsubai #define SCOP_RSENSE	0x03
    112  1.1  tsubai #define SCOP_FMT	0x04
    113  1.1  tsubai #define SCOP_RBLIM	0x05
    114  1.1  tsubai #define SCOP_SPARAM	0x06
    115  1.1  tsubai #define SCOP_RASBLK	0x07
    116  1.1  tsubai #define SCOP_READ	0x08
    117  1.1  tsubai #define SCOP_MOERASE	0x09
    118  1.1  tsubai #define SCOP_WRITE	0x0a
    119  1.1  tsubai #define SCOP_SEEK	0x0b
    120  1.1  tsubai #define	SCOP_MERASE	0x0e
    121  1.1  tsubai #define	SCOP_WFMARK	0x10
    122  1.1  tsubai #define	SCOP_SPACE	0x11
    123  1.1  tsubai #define SCOP_INQUIRY	0x12
    124  1.1  tsubai #define	SCOP_SVERIFY	0x13
    125  1.1  tsubai #define	SCOP_RBDATA	0x14
    126  1.1  tsubai #define SCOP_MSELECT	0x15
    127  1.1  tsubai #define	SCOP_ERASE	0x19
    128  1.1  tsubai #define SCOP_MSENSE	0x1a
    129  1.1  tsubai #define SCOP_STST	0x1b
    130  1.1  tsubai #define	SCOP_LOAD	0x1b
    131  1.1  tsubai #define SCOP_RECDIAG	0x1c
    132  1.1  tsubai #define SCOP_SNDDIAG	0x1d
    133  1.1  tsubai #define	SCOP_MEDRMV	0x1e
    134  1.1  tsubai #define SCOP_RCAP	0x25
    135  1.1  tsubai #define SCOP_EREAD	0x28
    136  1.1  tsubai #define SCOP_EWRITE	0x2a
    137  1.1  tsubai #define	SCOP_BSSRCH	0x2c
    138  1.1  tsubai #define	SCOP_WSSRCH	0x2d
    139  1.1  tsubai #define	SCOP_WRTVRFY	0x2e
    140  1.1  tsubai #define SCOP_VERIFY	0x2f
    141  1.1  tsubai #define SCOP_RDL	0x37
    142  1.1  tsubai #define SCOP_WBUF	0x3b
    143  1.1  tsubai #define SCOP_RBUF	0x3c
    144  1.1  tsubai #define SCOP_EJECT	0xc0
    145  1.1  tsubai #define SCOP_EESENSE	0xc1
    146  1.1  tsubai #define SCOP_READTOC	0xc1
    147  1.1  tsubai #define SCOP_READID	0xc2
    148  1.1  tsubai #define SCOP_ADP	0xc2
    149  1.1  tsubai #define SCOP_READQ	0xc2
    150  1.1  tsubai #define SCOP_BLANKS	0xc3
    151  1.1  tsubai #define SCOP_READHEAD	0xc3
    152  1.1  tsubai #define SCOP_PBSTS	0xc4
    153  1.1  tsubai #define SCOP_RCVDISK	0xc4
    154  1.1  tsubai #define SCOP_PAUSE	0xc5
    155  1.1  tsubai #define SCOP_PLAYTRACK	0xc6
    156  1.1  tsubai #define SCOP_PLAYMSF	0xc7
    157  1.1  tsubai #define SCOP_PLAYAUDIO	0xc8
    158  1.1  tsubai #define SCOP_ERASED	0xe7
    159  1.1  tsubai #define SCOP_RESET	0xff
    160  1.1  tsubai 
    161  1.1  tsubai 
    162  1.1  tsubai /*
    163  1.1  tsubai  *	other definition
    164  1.1  tsubai  */
    165  1.1  tsubai #define	ON	1
    166  1.1  tsubai #define	OFF	0
    167  1.1  tsubai 
    168  1.1  tsubai 
    169  1.1  tsubai /*
    170  1.1  tsubai  *	scsi internal parameter block
    171  1.1  tsubai  */
    172  1.1  tsubai struct scsi {
    173  1.1  tsubai /*00*/	u_char	sc_istatus;
    174  1.1  tsubai /*01*/	u_char	sc_tstatus;
    175  1.1  tsubai /*02*/	u_char	sc_identify;
    176  1.1  tsubai /*03*/	u_char	sc_message;
    177  1.1  tsubai /*04*/	u_int	sc_mpages;
    178  1.1  tsubai /*08*/	u_int	sc_bytesec;
    179  1.1  tsubai /*0c*/	u_char	*sc_cpoint;
    180  1.1  tsubai /*10*/	u_int	sc_ctrnscnt;
    181  1.1  tsubai /*14*/	struct sc_map *sc_map;
    182  1.1  tsubai 	union {
    183  1.1  tsubai 		struct	un_type0 {
    184  1.1  tsubai /*18*/			u_int		t0_opcode : 8;
    185  1.1  tsubai /*19*/			u_int		t0_lun	  : 3;
    186  1.1  tsubai /*19*/			u_int		t0_lad    : 21;
    187  1.1  tsubai /*1c*/			u_char		t0_count;
    188  1.1  tsubai /*1d*/			u_char		t0_ctrl;
    189  1.1  tsubai /*1e*/
    190  1.1  tsubai 		} un_type0;
    191  1.1  tsubai 		struct	un_tuio {
    192  1.1  tsubai /*18*/			u_char		tu_opcode;
    193  1.1  tsubai /*19*/			u_char		tu_lun	  : 3;
    194  1.1  tsubai /*19*/			u_char		tu_resved : 3;
    195  1.1  tsubai /*19*/			u_char		tu_code	  : 2;
    196  1.1  tsubai /*1a*/			u_char		tu_count1;
    197  1.1  tsubai /*1b*/			u_char		tu_count2;
    198  1.1  tsubai /*1c*/			u_char		tu_count3;
    199  1.1  tsubai /*1d*/			u_char		tu_ctrl;
    200  1.1  tsubai /*1e*/
    201  1.1  tsubai 		} un_tuio;
    202  1.1  tsubai 		struct	un_mtio {
    203  1.1  tsubai /*18*/			u_char		mt_opcode;
    204  1.1  tsubai /*19*/			u_char		mt_lun	  : 3;
    205  1.1  tsubai /*19*/			u_char		mt_resvd  : 2;
    206  1.1  tsubai /*19*/			u_char		mt_st	  : 1;
    207  1.1  tsubai /*19*/			u_char		mt_code	  : 2;
    208  1.1  tsubai /*1a*/			u_char		mt_len1;
    209  1.1  tsubai /*1b*/			u_char		mt_len2;
    210  1.1  tsubai /*1c*/			u_char		mt_len3;
    211  1.1  tsubai /*1d*/			u_char		mt_ctrl;
    212  1.1  tsubai /*1e*/
    213  1.1  tsubai 		} un_mtio;
    214  1.1  tsubai 		struct	un_type1 {
    215  1.1  tsubai /*18*/			u_char		t1_opcode;
    216  1.1  tsubai /*19*/			u_char		t1_lun    : 3;
    217  1.1  tsubai /*19*/			u_char		t1_rsvd   : 4;
    218  1.1  tsubai /*19*/			u_char		t1_relat  : 1;
    219  1.1  tsubai /*1a*/			u_short		t1_ladhi;
    220  1.1  tsubai /*1c*/			u_short		t1_ladlo;
    221  1.1  tsubai /*1e*/			u_char		t1_p1;
    222  1.1  tsubai /*1f*/			u_char		t1_p2;
    223  1.1  tsubai /*20*/			u_char		t1_p3;
    224  1.1  tsubai /*21*/			u_char		t1_ctrl;
    225  1.1  tsubai /*22*/
    226  1.1  tsubai 		} un_type1;
    227  1.1  tsubai /*18*/		u_char	un_reserved[12];
    228  1.1  tsubai /*24*/
    229  1.1  tsubai 	} sc_cdb;
    230  1.1  tsubai /*24*/	u_char sc_param[20];
    231  1.1  tsubai /*38*/	int	sc_hbinfo;		/* Copy of the hb_ctlr->hm_hbinfo */
    232  1.1  tsubai /*3c*/	u_int	sc_ctag;
    233  1.1  tsubai /*40*/	u_int	sc_coffset;
    234  1.1  tsubai /*44*/	void	*sc_xs;
    235  1.1  tsubai /*48*/
    236  1.1  tsubai };
    237  1.1  tsubai 
    238  1.1  tsubai 
    239  1.1  tsubai #define	sc_opcode	sc_cdb.un_type0.t0_opcode
    240  1.1  tsubai #define	sc_lun		sc_cdb.un_type0.t0_lun
    241  1.1  tsubai #define	sc_lad		sc_cdb.un_type0.t0_lad
    242  1.1  tsubai #define	sc_count	sc_cdb.un_type0.t0_count
    243  1.1  tsubai #define	sc_nsect	sc_cdb.un_type0.t0_count
    244  1.1  tsubai #define	sc_switch	sc_cdb.un_type0.t0_count
    245  1.1  tsubai #define	sc_ctrl		sc_cdb.un_type0.t0_ctrl
    246  1.1  tsubai 
    247  1.1  tsubai #define	sc_tucode	sc_cdb.un_tuio.tu_code
    248  1.1  tsubai #define	sc_tucount1	sc_cdb.un_tuio.tu_count1
    249  1.1  tsubai #define	sc_tucount2	sc_cdb.un_tuio.tu_count2
    250  1.1  tsubai #define	sc_tucount3	sc_cdb.un_tuio.tu_count3
    251  1.1  tsubai #define	sc_tunsect1	sc_cdb.un_tuio.tu_count1
    252  1.1  tsubai #define	sc_tunsect2	sc_cdb.un_tuio.tu_count2
    253  1.1  tsubai #define	sc_tunsect3	sc_cdb.un_tuio.tu_count3
    254  1.1  tsubai 
    255  1.1  tsubai #define	sc_mtst		sc_cdb.un_mtio.mt_st
    256  1.1  tsubai #define	sc_mtcode	sc_cdb.un_mtio.mt_code
    257  1.1  tsubai #define	sc_mtlen1	sc_cdb.un_mtio.mt_len1
    258  1.1  tsubai #define	sc_mtlen2	sc_cdb.un_mtio.mt_len2
    259  1.1  tsubai #define	sc_mtlen3	sc_cdb.un_mtio.mt_len3
    260  1.1  tsubai #define	sc_mtcount1	sc_cdb.un_mtio.mt_len1
    261  1.1  tsubai #define	sc_mtcount2	sc_cdb.un_mtio.mt_len2
    262  1.1  tsubai #define	sc_mtcount3	sc_cdb.un_mtio.mt_len3
    263  1.1  tsubai #define	sc_mtnsect1	sc_cdb.un_mtio.mt_len1
    264  1.1  tsubai #define	sc_mtnsect2	sc_cdb.un_mtio.mt_len2
    265  1.1  tsubai #define	sc_mtnsect3	sc_cdb.un_mtio.mt_len3
    266  1.1  tsubai #define	sc_mtctrl	sc_cdb.un_mtio.mt_ctrl
    267  1.1  tsubai #define	sc_mtfxd	sc_mtcode
    268  1.1  tsubai #define	sc_mtimm	sc_mtcode
    269  1.1  tsubai #define	sc_mtlng	sc_mtcode
    270  1.1  tsubai 
    271  1.1  tsubai #define	sc_ladhi	sc_cdb.un_type1.t1_ladhi
    272  1.1  tsubai #define	sc_ladlo	sc_cdb.un_type1.t1_ladlo
    273  1.1  tsubai #define	sc_pmi		sc_cdb.un_type1.t1_p3
    274  1.1  tsubai 
    275  1.1  tsubai #define	scop_load(a,b,c,d,e)	scop_stst(a,b,c,d,e)
    276  1.1  tsubai 
    277  1.1  tsubai 
    278  1.1  tsubai /*
    279  1.1  tsubai  *	tape unit space operation code definitions
    280  1.1  tsubai  */
    281  1.1  tsubai #define	SCSC_DATA	0
    282  1.1  tsubai #define	SCSC_FM		1
    283  1.1  tsubai #define	SCSC_SQFM	2
    284  1.1  tsubai #define	SCSC_EOD	3
    285  1.1  tsubai 
    286  1.1  tsubai 
    287  1.1  tsubai /*
    288  1.1  tsubai  *	scsi map table format
    289  1.1  tsubai  */
    290  1.1  tsubai #ifdef news3400
    291  1.1  tsubai #define	NSCMAP	120
    292  1.1  tsubai #endif
    293  1.1  tsubai 
    294  1.1  tsubai #ifdef news3800
    295  1.1  tsubai #define	NSCMAP	129
    296  1.1  tsubai #endif
    297  1.1  tsubai 
    298  1.1  tsubai struct sc_map {
    299  1.1  tsubai /*000*/	unsigned	mp_offset;
    300  1.1  tsubai /*004*/	unsigned	mp_pages;
    301  1.1  tsubai /*008*/	unsigned	mp_addr[NSCMAP];
    302  1.1  tsubai };
    303  1.1  tsubai 
    304  1.1  tsubai 
    305  1.1  tsubai /*
    306  1.1  tsubai  *	scsi nonextended sense data
    307  1.1  tsubai  */
    308  1.1  tsubai struct sc_nextnd {
    309  1.1  tsubai /*00*/	u_int		scn_advalid : 1;
    310  1.1  tsubai /*00*/	u_int		scn_ecode   : 7;
    311  1.1  tsubai /*01*/	u_int		scn_resvd   : 3;
    312  1.1  tsubai /*01*/	u_int		scn_secno   : 21;
    313  1.1  tsubai /*04*/
    314  1.1  tsubai };
    315  1.1  tsubai 
    316  1.1  tsubai 
    317  1.1  tsubai /*
    318  1.1  tsubai  *	scsi extended sense data
    319  1.1  tsubai  */
    320  1.1  tsubai struct sc_extnd {
    321  1.1  tsubai /*00*/	u_char		sce_advalid : 1;
    322  1.1  tsubai /*00*/	u_char		sce_extend  : 7;
    323  1.1  tsubai /*01*/	u_char		sce_segno;
    324  1.1  tsubai /*02*/	u_char		sce_fm	    : 1;
    325  1.1  tsubai /*02*/	u_char		sce_eom	    : 1;
    326  1.1  tsubai /*02*/	u_char		sce_ili	    : 1;
    327  1.1  tsubai /*02*/	u_char		sce_resvd   : 1;
    328  1.1  tsubai /*02*/	u_char		sce_skey    : 4;
    329  1.1  tsubai /*03*/	u_char		sce_infob1;
    330  1.1  tsubai /*04*/	u_char		sce_infob2;
    331  1.1  tsubai /*05*/	u_char		sce_infob3;
    332  1.1  tsubai /*06*/	u_char		sce_infob4;
    333  1.1  tsubai /*07*/	u_char		sce_addlen;
    334  1.1  tsubai 	union {
    335  1.1  tsubai 		struct un_ehd {
    336  1.1  tsubai /*08*/			u_short		ehd_resvd1;
    337  1.1  tsubai /*0a*/			u_short		ehd_resvd2;
    338  1.1  tsubai /*0c*/			u_char		ehd_ecode;
    339  1.1  tsubai /*0d*/			u_char		ehd_resvd3;
    340  1.1  tsubai /*0e*/			u_char		ehd_fru;
    341  1.1  tsubai /*0f*/			u_char		ehd_fpv	   : 1;
    342  1.1  tsubai /*0f*/			u_char		ehd_cd	   : 1;
    343  1.1  tsubai /*0f*/			u_char		ehd_resvd4 : 2;
    344  1.1  tsubai /*0f*/			u_char		ehd_bpv	   : 1;
    345  1.1  tsubai /*0f*/			u_char		ehd_bitpnt : 3;
    346  1.1  tsubai /*10*/			u_short		ehd_fldpnt;
    347  1.1  tsubai /*12*/
    348  1.1  tsubai 		} un_ehd;
    349  1.1  tsubai 		struct un_etu {
    350  1.1  tsubai /*08*/			u_char		etu_ecode;
    351  1.1  tsubai /*09*/			u_char		etu_nerrhi;
    352  1.1  tsubai /*0a*/			u_char		etu_nerrlo;
    353  1.1  tsubai /*0b*/
    354  1.1  tsubai 		} un_etu;
    355  1.1  tsubai 		struct un_emt {
    356  1.1  tsubai /*08*/			u_short		emt_estat;
    357  1.1  tsubai /*0a*/			u_char		emt_resvd1;
    358  1.1  tsubai /*0b*/			u_char		emt_totlrtry;
    359  1.1  tsubai /*0c*/			u_short		emt_resvd2;
    360  1.1  tsubai /*0e*/			u_short		emt_resvd3;
    361  1.1  tsubai /*10*/			u_char		emt_resvd4;
    362  1.1  tsubai /*11*/			u_char		emt_ecode;
    363  1.1  tsubai /*12*/
    364  1.1  tsubai 		} un_emt;
    365  1.1  tsubai 		struct un_ewo {
    366  1.1  tsubai /*08*/			u_char		ewo_resvd1;
    367  1.1  tsubai /*09*/			u_char		ewo_resvd2;
    368  1.1  tsubai /*0a*/			u_char		ewo_resvd3;
    369  1.1  tsubai /*0b*/			u_char		ewo_sadvalid : 1;
    370  1.1  tsubai /*0b*/			u_char		ewo_secode   : 7;
    371  1.1  tsubai /*0c*/			u_char		ewo_saddr1;
    372  1.1  tsubai /*0d*/			u_char		ewo_saddr2;
    373  1.1  tsubai /*0e*/			u_char		ewo_saddr3;
    374  1.1  tsubai /*0f*/			u_char		ewo_saddr4;
    375  1.1  tsubai /*10*/			u_char		ewo_resvd4;
    376  1.1  tsubai /*11*/			u_char		ewo_dadvalid : 1;
    377  1.1  tsubai /*11*/			u_char		ewo_decode   : 7;
    378  1.1  tsubai /*12*/			u_char		ewo_daddr1;
    379  1.1  tsubai /*13*/			u_char		ewo_daddr2;
    380  1.1  tsubai /*14*/			u_char		ewo_daddr3;
    381  1.1  tsubai /*15*/			u_char		ewo_daddr4;
    382  1.1  tsubai /*16*/
    383  1.1  tsubai 		} un_ewo;
    384  1.1  tsubai 		struct un_eod {
    385  1.1  tsubai /*08*/			u_char		eod_resvd1;
    386  1.1  tsubai /*09*/			u_char		eod_resvd2;
    387  1.1  tsubai /*0a*/			u_char		eod_resvd3;
    388  1.1  tsubai /*0b*/			u_char		eod_resvd4;
    389  1.1  tsubai /*0c*/			u_char		eod_ecode;
    390  1.1  tsubai /*0d*/			u_char		eod_resvd5;
    391  1.1  tsubai /*0e*/			u_char		eod_resvd6;
    392  1.1  tsubai /*0f*/			u_char		eod_resvd7;
    393  1.1  tsubai /*10*/			u_char		eod_resvd8;
    394  1.1  tsubai /*11*/			u_char		eod_resvd9;
    395  1.1  tsubai /*12*/
    396  1.1  tsubai 		} un_eod;
    397  1.1  tsubai /*08*/		u_char un_data[24];
    398  1.1  tsubai /*20*/
    399  1.1  tsubai 	} sce_add;
    400  1.1  tsubai /*20*/
    401  1.1  tsubai };
    402  1.1  tsubai 
    403  1.1  tsubai #define	sce_hdecode	sce_add.un_ehd.ehd_ecode
    404  1.1  tsubai 
    405  1.1  tsubai #define	sce_tuecode	sce_add.un_etu.etu_ecode
    406  1.1  tsubai #define	sce_tunerrhi	sce_add.un_etu.etu_nerrhi
    407  1.1  tsubai #define	sce_tunerrlo	sce_add.un_etu.etu_nerrlo
    408  1.1  tsubai 
    409  1.1  tsubai #define	sce_mtestat	sce_add.un_emt.emt_estat
    410  1.1  tsubai #define	sce_mtecode	sce_add.un_emt.emt_ecode
    411  1.1  tsubai 
    412  1.1  tsubai #define	sce_odecode	sce_add.un_eod.eod_ecode
    413  1.1  tsubai 
    414  1.1  tsubai #define	sce_ascq	sce_add.un_ehd.ehd_resvd3
    415  1.1  tsubai #define	sce_sksv	sce_add.un_ehd.ehd_fpv
    416  1.1  tsubai #define	sce_actretry	sce_add.un_ehd.ehd_fldpnt
    417  1.1  tsubai 
    418  1.1  tsubai /*
    419  1.1  tsubai  *	scsi inquiry response data
    420  1.1  tsubai  */
    421  1.1  tsubai struct sc_inq {
    422  1.1  tsubai /*00*/	u_char		sci_devtype;
    423  1.1  tsubai /*01*/	u_char		sci_qual;
    424  1.1  tsubai /*02*/	u_char		sci_version;
    425  1.1  tsubai /*03*/	u_char		sci_resvd1;
    426  1.1  tsubai /*04*/	u_char		sci_ninfo;
    427  1.1  tsubai /*05*/	u_char		sci_drinfo;
    428  1.1  tsubai /*06*/	u_char		sci_firmrev;
    429  1.1  tsubai /*07*/	u_char		sci_ready;
    430  1.1  tsubai /*08*/	u_char		sci_vendid[8];
    431  1.1  tsubai /*10*/	u_char		sci_prodid[16];
    432  1.1  tsubai /*20*/	u_char		sci_revision[4];
    433  1.1  tsubai /*24*/
    434  1.1  tsubai };
    435  1.1  tsubai 
    436  1.1  tsubai 
    437  1.1  tsubai /*
    438  1.1  tsubai  *	scsi read capacity data
    439  1.1  tsubai  */
    440  1.1  tsubai struct sc_rcap {
    441  1.1  tsubai /*00*/	u_int		scr_nblock;
    442  1.1  tsubai /*04*/	u_int		scr_blocklen;
    443  1.1  tsubai /*08*/
    444  1.1  tsubai };
    445  1.1  tsubai 
    446  1.1  tsubai 
    447  1.1  tsubai /*
    448  1.1  tsubai  *	scsi mode sense/select data
    449  1.1  tsubai  */
    450  1.1  tsubai struct sc_mdata {
    451  1.1  tsubai /*00*/	u_char	scm_len;
    452  1.1  tsubai /*01*/	u_char	scm_type;
    453  1.1  tsubai /*02*/	u_char	scm_flags1;
    454  1.1  tsubai /*03*/	u_char	scm_dlen;
    455  1.1  tsubai /*04*/	u_int	scm_dens	: 8;
    456  1.1  tsubai /*05*/	u_int	scm_nblock	: 24;
    457  1.1  tsubai /*08*/	u_int	scm_resvd1	: 8;
    458  1.1  tsubai /*09*/	u_int	scm_bsize	: 24;
    459  1.1  tsubai /*0c*/	u_char	scm_flags2;
    460  1.1  tsubai /*0d*/	u_char	scm_resvd2;
    461  1.1  tsubai /*0e*/	u_char	scm_resvd3;
    462  1.1  tsubai /*0f*/	u_char	scm_maxrtry;
    463  1.1  tsubai /*10*/
    464  1.1  tsubai };
    465  1.1  tsubai 
    466  1.1  tsubai #define	scm_tdens	scm_flags2
    467  1.1  tsubai 
    468  1.1  tsubai 
    469  1.1  tsubai /*
    470  1.1  tsubai  *	bits of scm_flags1
    471  1.1  tsubai  */
    472  1.1  tsubai #define	SCM1_WRP	0x80
    473  1.1  tsubai #define	SCM1_BUFM	0x10
    474  1.1  tsubai #define	SCM1_SPD90	0x02
    475  1.1  tsubai 
    476  1.1  tsubai 
    477  1.1  tsubai /*
    478  1.1  tsubai  *	scm_type
    479  1.1  tsubai  */
    480  1.1  tsubai #define	SCMT_DEFAULT	0x0
    481  1.1  tsubai #define	SCMT_150_600	0x80
    482  1.1  tsubai #define	SCMT_300_450	0x81
    483  1.1  tsubai 
    484  1.1  tsubai 
    485  1.1  tsubai /*
    486  1.1  tsubai  *	scm_dens
    487  1.1  tsubai  */
    488  1.1  tsubai #define	SCMD_QIC_24_9	0x0	/* This may be 0x5 */
    489  1.1  tsubai #define	SCMD_QIC_11_4	0x4
    490  1.1  tsubai #define	SCMD_QIC_11_9	0x84
    491  1.1  tsubai #define	SCMD_QIC_120_15	0xf
    492  1.1  tsubai #define	SCMD_QIC_150_18	0x10
    493  1.1  tsubai 
    494  1.1  tsubai #define	SCMD_DEFAULT	0x00
    495  1.1  tsubai #define	SCMD_800_BPI	0x01
    496  1.1  tsubai #define	SCMD_1600_BPI	0x02
    497  1.1  tsubai #define	SCMD_6250_BPI	0x03
    498  1.1  tsubai #define	SCMD_3200_BPI	0x06
    499  1.1  tsubai #define	SCMD_NEWTAPE	0x80
    500  1.1  tsubai #define	SCMD_NOTAPE	0xff
    501  1.1  tsubai 
    502  1.1  tsubai 
    503  1.1  tsubai /*
    504  1.1  tsubai  *	bits of scm_flags2
    505  1.1  tsubai  */
    506  1.1  tsubai #define	SCM2_DEA	0x04
    507  1.1  tsubai #define	SCM2_AUI	0x02
    508  1.1  tsubai #define	SCM2_SEC	0x01
    509  1.1  tsubai 
    510  1.1  tsubai 
    511  1.1  tsubai /*
    512  1.1  tsubai  *	scsi reassign block perameter list
    513  1.1  tsubai  */
    514  1.1  tsubai struct sc_rab {
    515  1.1  tsubai /*00*/	u_short	sca_resved;
    516  1.1  tsubai /*02*/	u_short	sca_dllen;
    517  1.1  tsubai /*04*/	u_int	sca_dlad[4];
    518  1.1  tsubai /*14*/
    519  1.1  tsubai };
    520  1.1  tsubai 
    521  1.1  tsubai 
    522  1.1  tsubai #ifdef CPU_DOUBLE
    523  1.1  tsubai 
    524  1.1  tsubai # ifdef mips
    525  1.1  tsubai #  define	ipc_phys(x)	(caddr_t)K0_TT0(x)
    526  1.1  tsubai # else
    527  1.1  tsubai #  define	ipc_phys(x)	(caddr_t)((int)(x) & ~0x80000000)
    528  1.1  tsubai # endif
    529  1.1  tsubai 
    530  1.1  tsubai # ifdef news3800
    531  1.1  tsubai #  define	splsc		spl4
    532  1.1  tsubai #  define	splscon		spl3
    533  1.1  tsubai # endif
    534  1.1  tsubai 
    535  1.1  tsubai #endif /* CPU_DOUBLE */
    536  1.1  tsubai 
    537  1.1  tsubai #ifdef CPU_SINGLE
    538  1.1  tsubai # define	ipc_phys(x)	(caddr_t)(x)
    539  1.1  tsubai # ifdef news3400
    540  1.1  tsubai #  define	splsc		cpu_spl0	/* Lite2 used spl3 */
    541  1.1  tsubai #  define	splscon		spl2 XXX not used
    542  1.1  tsubai    extern int cpu_spl0 __P((void));
    543  1.1  tsubai # else
    544  1.1  tsubai #  define	splsc		spl4
    545  1.1  tsubai #  define	splscon		spl3
    546  1.1  tsubai # endif
    547  1.1  tsubai #endif /* CPU_SINGLE */
    548  1.1  tsubai 
    549  1.1  tsubai #define	SCSI_INTEN	1
    550  1.1  tsubai #define	SCSI_INTDIS	0
    551  1.1  tsubai 
    552  1.1  tsubai struct scintsw {
    553  1.1  tsubai /*00*/	int	(*sci_inthandler)();	/* pointer to interrupt handler */
    554  1.1  tsubai /*04*/	int	sci_ctlr;		/* controller number */
    555  1.1  tsubai /*08*/
    556  1.1  tsubai };
    557  1.1  tsubai 
    558  1.1  tsubai struct sc_data {
    559  1.1  tsubai /*00*/	struct scsi	*scd_scaddr;	/* pointer to struct scsi */
    560  1.1  tsubai /*04*/	vm_offset_t	scd_vaddr;	/* pointer to buffer address */
    561  1.1  tsubai /*08*/	int		scd_count;	/* buffer size */
    562  1.1  tsubai /*0c*/
    563  1.1  tsubai };
    564  1.1  tsubai 
    565  1.1  tsubai #endif /* !__SCSIREG__ */
    566