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