xref: /csrg-svn/sys/dev/scsi/scsi_ioctl.h (revision 63144)
154879Storek /*
2*63144Sbostic  * Copyright (c) 1992, 1993
3*63144Sbostic  *	The Regents of the University of California.  All rights reserved.
454879Storek  *
554879Storek  * This software was developed by the Computer Systems Engineering group
654879Storek  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
754879Storek  * contributed to Berkeley.
854879Storek  *
955559Storek  * All advertising materials mentioning features or use of this software
1055559Storek  * must display the following acknowledgement:
1155559Storek  *	This product includes software developed by the University of
1255559Storek  *	California, Lawrence Berkeley Laboratories.
1355559Storek  *
1454879Storek  * %sccs.include.redist.c%
1554879Storek  *
16*63144Sbostic  *	@(#)scsi_ioctl.h	8.1 (Berkeley) 06/10/93
1754879Storek  *
1857754Storek  * from: $Header: scsi_ioctl.h,v 1.3 92/12/02 03:54:19 torek Exp $ (LBL)
1954879Storek  */
2054879Storek 
2154879Storek /*
2254879Storek  * SCSI ioctls (`format' mode).
2354879Storek  *
2454879Storek  * Format mode allows a privileged process to issue direct SCSI commands
2554879Storek  * to a drive (it is intended primarily to allow on-line formatting).
2654879Storek  * SDIOCSFORMAT sets format mode (nonzero arg => on, zero arg => off).
2754879Storek  * When in format mode, only the process that issued the SDIOCSFORMAT
2854879Storek  * can read or write the drive.
2954879Storek  *
3054879Storek  * In format mode, the process is expected to
3154879Storek  *	- do SDIOCSCSICOMMAND to supply cdb for next SCSI op
3254879Storek  *	- do read or write as appropriate for cdb
3354879Storek  *	- if I/O error, optionally do SDIOCSENSE to get completion
3454879Storek  *	  status and sense data from last SCSI operation.
3554879Storek  */
3654879Storek 
3754879Storek struct scsi_fmt_sense {
3854879Storek 	u_int	status;		/* completion status of last op */
3954879Storek 	u_char	sense[28];	/* sense data (if any) from last op */
4054879Storek };
4154879Storek 
4254879Storek #define	SDIOCSFORMAT		_IOW('S', 1, int)
4354879Storek #define	SDIOCGFORMAT		_IOR('S', 2, int)
4454879Storek #define	SDIOCSCSICOMMAND	_IOW('S', 3, struct scsi_cdb)
4554879Storek #define	SDIOCSENSE		_IOR('S', 4, struct scsi_fmt_sense)
46