xref: /csrg-svn/sys/dev/scsi/disktape.h (revision 54877)
1*54877Storek /*
2*54877Storek  * Copyright (c) 1992 The Regents of the University of California.
3*54877Storek  * All rights reserved.
4*54877Storek  *
5*54877Storek  * This software was developed by the Computer Systems Engineering group
6*54877Storek  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7*54877Storek  * contributed to Berkeley.
8*54877Storek  *
9*54877Storek  * %sccs.include.redist.c%
10*54877Storek  *
11*54877Storek  *	@(#)disktape.h	5.1 (Berkeley) 07/10/92
12*54877Storek  *
13*54877Storek  * from: $Header: disktape.h,v 1.2 92/05/15 11:24:00 torek Exp $ (LBL)
14*54877Storek  */
15*54877Storek 
16*54877Storek /*
17*54877Storek  * Commands common to disk and tape devices, but not other SCSI devices.
18*54877Storek  */
19*54877Storek 
20*54877Storek /*
21*54877Storek  * Structure of a MODE SENSE command (i.e., the cdb).
22*54877Storek  */
23*54877Storek struct scsi_cdb_modesense {
24*54877Storek 	u_char	cdb_cmd,	/* command */
25*54877Storek 		cdb_lun:3,	/* logical unit number */
26*54877Storek 		cdb_xxx0:5,	/* reserved */
27*54877Storek 		cdb_xxx1,	/* reserved */
28*54877Storek 		cdb_xxx2,	/* reserved */
29*54877Storek 		cdb_len,	/* allocation length */
30*54877Storek 		cdb_ctrl;	/* control byte */
31*54877Storek };
32*54877Storek 
33*54877Storek /*
34*54877Storek  * Structure of returned mode sense data.
35*54877Storek  */
36*54877Storek struct scsi_modesense {
37*54877Storek 	u_char	ms_len,		/* total sense data length */
38*54877Storek 		ms_mt,		/* medium type */
39*54877Storek 		ms_wbs,		/* write protect, buffered mode, & speed */
40*54877Storek 		ms_bdl;		/* block descriptor length */
41*54877Storek 	struct scsi_ms_bdesc {
42*54877Storek 		u_char	dc,	/* density code */
43*54877Storek 			nbh,	/* number of blocks (MSB) */
44*54877Storek 			nbm,	/* number of blocks */
45*54877Storek 			nbl,	/* number of blocks (LSB) */
46*54877Storek 			xxx,	/* reserved */
47*54877Storek 			blh,	/* block length (MSB) */
48*54877Storek 			blm,	/* block length */
49*54877Storek 			bll;	/* block length (LSB) */
50*54877Storek 	} ms_bd[1];
51*54877Storek 	/* followed by Vendor Unique bytes */
52*54877Storek };
53*54877Storek 
54*54877Storek /*
55*54877Storek  * Structure of a PREVENT/ALLOW MEDIUM REMOVAL command.
56*54877Storek  */
57*54877Storek struct scsi_cdb_pamr {
58*54877Storek 	u_char	cdb_cmd,	/* 0x1e */
59*54877Storek 		cdb_lun:3,	/* logical unit number */
60*54877Storek 		cdb_xxx0:5,	/* reserved */
61*54877Storek 		cdb_xxx1,	/* reserved */
62*54877Storek 		cdb_xxx2,	/* reserved */
63*54877Storek 		cdb_prevent,	/* 1=prevent, 0=allow */
64*54877Storek 		cdb_ctrl;
65*54877Storek };
66