xref: /original-bsd/sys/dev/scsi/scsi_ioctl.h (revision ae45e3e8)
1 /*
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  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  *	@(#)scsi_ioctl.h	8.1 (Berkeley) 06/10/93
17  *
18  * from: $Header: scsi_ioctl.h,v 1.3 92/12/02 03:54:19 torek Exp $ (LBL)
19  */
20 
21 /*
22  * SCSI ioctls (`format' mode).
23  *
24  * Format mode allows a privileged process to issue direct SCSI commands
25  * to a drive (it is intended primarily to allow on-line formatting).
26  * SDIOCSFORMAT sets format mode (nonzero arg => on, zero arg => off).
27  * When in format mode, only the process that issued the SDIOCSFORMAT
28  * can read or write the drive.
29  *
30  * In format mode, the process is expected to
31  *	- do SDIOCSCSICOMMAND to supply cdb for next SCSI op
32  *	- do read or write as appropriate for cdb
33  *	- if I/O error, optionally do SDIOCSENSE to get completion
34  *	  status and sense data from last SCSI operation.
35  */
36 
37 struct scsi_fmt_sense {
38 	u_int	status;		/* completion status of last op */
39 	u_char	sense[28];	/* sense data (if any) from last op */
40 };
41 
42 #define	SDIOCSFORMAT		_IOW('S', 1, int)
43 #define	SDIOCGFORMAT		_IOR('S', 2, int)
44 #define	SDIOCSCSICOMMAND	_IOW('S', 3, struct scsi_cdb)
45 #define	SDIOCSENSE		_IOR('S', 4, struct scsi_fmt_sense)
46