xref: /onnv-gate/usr/src/uts/common/sys/mtio.h (revision 4549:d81fb2ced00e)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
52083Szl149053  * Common Development and Distribution License (the "License").
62083Szl149053  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*4549Srralphs  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  *
250Sstevel@tonic-gate  *	Copyright (c) 1983-1989 by AT&T.
260Sstevel@tonic-gate  *	All rights reserved.
270Sstevel@tonic-gate  */
280Sstevel@tonic-gate 
290Sstevel@tonic-gate /*
300Sstevel@tonic-gate  * Portions of this source code were derived from Berkeley 4.3 BSD
310Sstevel@tonic-gate  * under license from the Regents of the University of California.
320Sstevel@tonic-gate  */
330Sstevel@tonic-gate 
340Sstevel@tonic-gate #ifndef	_SYS_MTIO_H
350Sstevel@tonic-gate #define	_SYS_MTIO_H
360Sstevel@tonic-gate 
370Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
380Sstevel@tonic-gate 
390Sstevel@tonic-gate #include <sys/types.h>
400Sstevel@tonic-gate 
410Sstevel@tonic-gate #ifdef	__cplusplus
420Sstevel@tonic-gate extern "C" {
430Sstevel@tonic-gate #endif
440Sstevel@tonic-gate 
450Sstevel@tonic-gate /*
460Sstevel@tonic-gate  * Structures and definitions for mag tape io control commands
470Sstevel@tonic-gate  */
480Sstevel@tonic-gate 
490Sstevel@tonic-gate /*
500Sstevel@tonic-gate  * structure for MTIOCTOP - mag tape op command
510Sstevel@tonic-gate  */
520Sstevel@tonic-gate struct mtop	{
530Sstevel@tonic-gate 	short		mt_op;		/* operations defined below */
540Sstevel@tonic-gate 	daddr_t		mt_count;	/* how many of them */
550Sstevel@tonic-gate };
560Sstevel@tonic-gate 
570Sstevel@tonic-gate #if defined(_SYSCALL32)
580Sstevel@tonic-gate struct mtop32	{
590Sstevel@tonic-gate 	short		mt_op;		/* operations defined below */
600Sstevel@tonic-gate 	daddr32_t	mt_count;	/* how many of them */
610Sstevel@tonic-gate };
620Sstevel@tonic-gate #endif /* _SYSCALL32 */
630Sstevel@tonic-gate 
64*4549Srralphs /*
65*4549Srralphs  * structure for MTIOCLTOP - mag tape op command
66*4549Srralphs  */
67*4549Srralphs struct mtlop	{
68*4549Srralphs 	short		mt_op;
69*4549Srralphs 	short		pad[3];
70*4549Srralphs 	int64_t		mt_count;
71*4549Srralphs };
720Sstevel@tonic-gate 
730Sstevel@tonic-gate /*
740Sstevel@tonic-gate  * values for mt_op
750Sstevel@tonic-gate  */
760Sstevel@tonic-gate #define	MTWEOF		0	/* write an end-of-file record */
770Sstevel@tonic-gate #define	MTFSF		1	/* forward space over file mark */
780Sstevel@tonic-gate #define	MTBSF		2	/* backward space over file mark (1/2" only ) */
790Sstevel@tonic-gate #define	MTFSR		3	/* forward space to inter-record gap */
800Sstevel@tonic-gate #define	MTBSR		4	/* backward space to inter-record gap */
810Sstevel@tonic-gate #define	MTREW		5	/* rewind */
820Sstevel@tonic-gate #define	MTOFFL		6	/* rewind and put the drive offline */
830Sstevel@tonic-gate #define	MTNOP		7	/* no operation, sets status only */
840Sstevel@tonic-gate #define	MTRETEN		8	/* retension the tape (cartridge tape only) */
850Sstevel@tonic-gate #define	MTERASE		9	/* erase the entire tape */
860Sstevel@tonic-gate #define	MTEOM		10	/* position to end of media */
870Sstevel@tonic-gate #define	MTNBSF		11	/* backward space file to BOF */
880Sstevel@tonic-gate #define	MTSRSZ		12	/* set record size */
890Sstevel@tonic-gate #define	MTGRSZ		13	/* get record size */
900Sstevel@tonic-gate #define	MTLOAD		14	/* for loading a tape (use o_delay to open */
910Sstevel@tonic-gate 				/* the tape device) */
92*4549Srralphs #define	MTBSSF		15	/* Backward space to x sequential filemarks */
93*4549Srralphs #define	MTFSSF		16	/* Forward space to x sequential filemarks */
94*4549Srralphs #define	MTTELL		17	/* get current logical block position */
95*4549Srralphs #define	MTSEEK		18	/* position to logical block position */
96*4549Srralphs #define	MTLOCK		19	/* lock media */
97*4549Srralphs #define	MTUNLOCK	20	/* unlock media */
980Sstevel@tonic-gate 
990Sstevel@tonic-gate /*
1000Sstevel@tonic-gate  * structure for MTIOCGET - mag tape get status command
1010Sstevel@tonic-gate  */
1020Sstevel@tonic-gate struct mtget	{
1030Sstevel@tonic-gate 	short		mt_type;	/* type of magtape device */
1040Sstevel@tonic-gate 	/* the following two registers are grossly device dependent */
1050Sstevel@tonic-gate 	short		mt_dsreg;	/* ``drive status'' register */
1060Sstevel@tonic-gate 	short		mt_erreg;	/* ``error'' register */
1070Sstevel@tonic-gate 	/* optional error info. */
1080Sstevel@tonic-gate 	daddr_t		mt_resid;	/* residual count */
1090Sstevel@tonic-gate 	daddr_t		mt_fileno;	/* file number of current position */
1100Sstevel@tonic-gate 	daddr_t		mt_blkno;	/* block number of current position */
1110Sstevel@tonic-gate 	ushort_t	mt_flags;
1120Sstevel@tonic-gate 	short		mt_bf;		/* optimum blocking factor */
1130Sstevel@tonic-gate };
1140Sstevel@tonic-gate 
1150Sstevel@tonic-gate #if defined(_SYSCALL32)
1160Sstevel@tonic-gate struct mtget32	{
1170Sstevel@tonic-gate 	short		mt_type;	/* type of magtape device */
1180Sstevel@tonic-gate 	/* the following two registers are grossly device dependent */
1190Sstevel@tonic-gate 	short		mt_dsreg;	/* ``drive status'' register */
1200Sstevel@tonic-gate 	short		mt_erreg;	/* ``error'' register */
1210Sstevel@tonic-gate 	/* optional error info. */
1220Sstevel@tonic-gate 	daddr32_t	mt_resid;	/* residual count */
1230Sstevel@tonic-gate 	daddr32_t	mt_fileno;	/* file number of current position */
1240Sstevel@tonic-gate 	daddr32_t	mt_blkno;	/* block number of current position */
1250Sstevel@tonic-gate 	ushort_t	mt_flags;
1260Sstevel@tonic-gate 	short		mt_bf;		/* optimum blocking factor */
1270Sstevel@tonic-gate };
1280Sstevel@tonic-gate #endif /* _SYSCALL32 */
1290Sstevel@tonic-gate 
1300Sstevel@tonic-gate #define	MT_NDENSITIES	4
1310Sstevel@tonic-gate #define	MT_NSPEEDS	4
1320Sstevel@tonic-gate 
1330Sstevel@tonic-gate /*
1340Sstevel@tonic-gate  * struct for MTIOCGETDRIVETYPE - get tape config data
1350Sstevel@tonic-gate  */
1360Sstevel@tonic-gate struct mtdrivetype {
1370Sstevel@tonic-gate 	char    name[64];		/* Name, for debug */
1380Sstevel@tonic-gate 	char    vid[25];		/* Vendor id and model (product) id */
1390Sstevel@tonic-gate 	char    type;			/* Drive type for driver */
1400Sstevel@tonic-gate 	int	bsize;			/* Block size */
1410Sstevel@tonic-gate 	int	options;		/* Drive options */
1420Sstevel@tonic-gate 	int	max_rretries;		/* Max read retries */
1430Sstevel@tonic-gate 	int	max_wretries;		/* Max write retries */
1440Sstevel@tonic-gate 	uchar_t densities[MT_NDENSITIES];	/* density codes, low->hi */
1450Sstevel@tonic-gate 	uchar_t	default_density;	/* Default density chosen */
1460Sstevel@tonic-gate 	uchar_t speeds[MT_NSPEEDS];	/* speed codes, low->hi */
1470Sstevel@tonic-gate 	ushort_t non_motion_timeout;    /* Inquiry type commands */
1480Sstevel@tonic-gate 	ushort_t io_timeout;		/* io timeout. seconds */
1490Sstevel@tonic-gate 	ushort_t rewind_timeout;	/* rewind timeout. seconds */
1500Sstevel@tonic-gate 	ushort_t space_timeout;		/* space cmd timeout. seconds */
1510Sstevel@tonic-gate 	ushort_t load_timeout;		/* load tape time in seconds */
1520Sstevel@tonic-gate 	ushort_t unload_timeout;	/* Unload tape time in scounds */
1530Sstevel@tonic-gate 	ushort_t erase_timeout;		/* erase timeout. seconds */
1540Sstevel@tonic-gate };
1550Sstevel@tonic-gate 
1560Sstevel@tonic-gate 
1570Sstevel@tonic-gate struct mtdrivetype_request {
1580Sstevel@tonic-gate 	int	size;
1590Sstevel@tonic-gate 	struct  mtdrivetype *mtdtp;
1600Sstevel@tonic-gate };
1610Sstevel@tonic-gate 
1620Sstevel@tonic-gate #if defined(_SYSCALL32)
1630Sstevel@tonic-gate struct mtdrivetype_request32 {
1640Sstevel@tonic-gate 	int		size;
1650Sstevel@tonic-gate 	caddr32_t	mtdtp;
1660Sstevel@tonic-gate };
1670Sstevel@tonic-gate #endif /* _SYSCALL32 */
1680Sstevel@tonic-gate 
1690Sstevel@tonic-gate 
1700Sstevel@tonic-gate /*
1710Sstevel@tonic-gate  * values for mt_flags
1720Sstevel@tonic-gate  */
173*4549Srralphs #define	MTF_SCSI		0x01
174*4549Srralphs #define	MTF_REEL		0x02
175*4549Srralphs #define	MTF_ASF			0x04
1760Sstevel@tonic-gate 
1770Sstevel@tonic-gate #define	MTF_TAPE_HEAD_DIRTY	0x08
1780Sstevel@tonic-gate #define	MTF_TAPE_CLN_SUPPORTED	0x10
1792537Srralphs #define	MTF_WORM_MEDIA		0x20
180*4549Srralphs #define	MTF_LOGICAL_BLOCK	0x40
1810Sstevel@tonic-gate 
1820Sstevel@tonic-gate /*
1830Sstevel@tonic-gate  * Constants for mt_type byte (these are somewhat obsolete)
1840Sstevel@tonic-gate  */
1850Sstevel@tonic-gate #define	MT_ISTS		0x01		/* vax: unibus ts-11 */
1860Sstevel@tonic-gate #define	MT_ISHT		0x02		/* vax: massbus tu77, etc */
1870Sstevel@tonic-gate #define	MT_ISTM		0x03		/* vax: unibus tm-11 */
1880Sstevel@tonic-gate #define	MT_ISMT		0x04		/* vax: massbus tu78 */
1890Sstevel@tonic-gate #define	MT_ISUT		0x05		/* vax: unibus gcr */
1900Sstevel@tonic-gate #define	MT_ISCPC	0x06		/* sun: multibus cpc */
1910Sstevel@tonic-gate #define	MT_ISAR		0x07		/* sun: multibus archive */
1920Sstevel@tonic-gate #define	MT_ISSC		0x08		/* sun: SCSI archive */
1930Sstevel@tonic-gate #define	MT_ISSYSGEN11	0x10		/* sun: SCSI Sysgen, QIC-11 only */
1940Sstevel@tonic-gate #define	MT_ISSYSGEN	0x11		/* sun: SCSI Sysgen QIC-24/11 */
1950Sstevel@tonic-gate #define	MT_ISDEFAULT	0x12		/* sun: SCSI default CCS */
1960Sstevel@tonic-gate #define	MT_ISCCS3	0x13		/* sun: SCSI generic (unknown) CCS */
1970Sstevel@tonic-gate #define	MT_ISMT02	0x14		/* sun: SCSI Emulex MT02 */
1980Sstevel@tonic-gate #define	MT_ISVIPER1	0x15		/* sun: SCSI Archive QIC-150 Viper */
1990Sstevel@tonic-gate #define	MT_ISWANGTEK1	0x16		/* sun: SCSI Wangtek QIC-150 */
2000Sstevel@tonic-gate #define	MT_ISCCS7	0x17		/* sun: SCSI generic (unknown) CCS */
2010Sstevel@tonic-gate #define	MT_ISCCS8	0x18		/* sun: SCSI generic (unknown) CCS */
2020Sstevel@tonic-gate #define	MT_ISCCS9	0x19		/* sun: SCSI generic (unknown) CCS */
2030Sstevel@tonic-gate #define	MT_ISCCS11	0x1a		/* sun: SCSI generic (unknown) CCS */
2040Sstevel@tonic-gate #define	MT_ISCCS12	0x1b		/* sun: SCSI generic (unknown) CCS */
2050Sstevel@tonic-gate #define	MT_ISCCS13	0x1c		/* sun: SCSI generic (unknown) CCS */
2060Sstevel@tonic-gate #define	MT_ISCCS14	0x1d		/* sun: SCSI generic (unknown) CCS */
2070Sstevel@tonic-gate #define	MT_ISCCS15	0x1e		/* sun: SCSI generic (unknown) CCS */
2080Sstevel@tonic-gate #define	MT_ISCCS16	0x1f		/* sun: SCSI generic (unknown) CCS */
2090Sstevel@tonic-gate #define	MT_ISCDC	0x20		/* sun: SCSI CDC 1/2" cartridge */
2100Sstevel@tonic-gate #define	MT_ISFUJI	0x21		/* sun: SCSI Fujitsu 1/2" cartridge */
2110Sstevel@tonic-gate #define	MT_ISKENNEDY	0x22		/* sun: SCSI Kennedy 1/2" reel */
2120Sstevel@tonic-gate #define	MT_ISHP		0x23		/* sun: SCSI HP 1/2" reel */
2130Sstevel@tonic-gate #define	MT_ISSTC	0x24		/* sun: SCSI IBM STC 3490 */
2140Sstevel@tonic-gate #define	MT_ISANRITSU	0x25		/* nihon sun: Anritsu 1/2" reel */
2150Sstevel@tonic-gate #define	MT_ISCCS23	0x26		/* sun: SCSI generic  1/2" */
2160Sstevel@tonic-gate #define	MT_ISCCS24	0x27		/* sun: SCSI generic  1/2" */
2170Sstevel@tonic-gate #define	MT_ISEXABYTE	0x28		/* sun: SCSI Exabyte 8mm cartridge */
2180Sstevel@tonic-gate #define	MT_ISEXB8500	0x29		/* sun: SCSI Exabyte 8500 8mm cart */
2190Sstevel@tonic-gate #define	MT_ISWANGTHS	0x2a		/* sun: SCSI Wangtek 6130HS RDAT */
2200Sstevel@tonic-gate #define	MT_ISWANGDAT	0x2b		/* sun: SCSI WangDAT */
2210Sstevel@tonic-gate #define	MT_ISPYTHON	0x2c		/* sun: SCSI Archive Python DAT  */
2220Sstevel@tonic-gate #define	MT_ISCCS28	0x2d		/* sun: SCSI generic DAT CCS */
2230Sstevel@tonic-gate #define	MT_ISCCS29	0x2e		/* sun: SCSI generic (unknown) CCS */
2240Sstevel@tonic-gate #define	MT_ISCCS30	0x2f		/* sun: SCSI generic (unknown) CCS */
2250Sstevel@tonic-gate #define	MT_ISCCS31	0x30		/* sun: SCSI generic (unknown) CCS */
2260Sstevel@tonic-gate #define	MT_ISCCS32	0x31		/* sun: SCSI generic (unknown) CCS */
2270Sstevel@tonic-gate 
2280Sstevel@tonic-gate 
2290Sstevel@tonic-gate /*
2300Sstevel@tonic-gate  * these are recommended
2310Sstevel@tonic-gate  */
2320Sstevel@tonic-gate #define	MT_ISQIC	0x32		/* generic QIC tape drive */
2330Sstevel@tonic-gate #define	MT_ISREEL	0x33		/* generic reel tape drive */
2340Sstevel@tonic-gate #define	MT_ISDAT	0x34		/* generic DAT tape drive */
2350Sstevel@tonic-gate #define	MT_IS8MM	0x35		/* generic 8mm tape drive */
2360Sstevel@tonic-gate #define	MT_ISOTHER	0x36		/* generic other type of tape drive */
2370Sstevel@tonic-gate 
2380Sstevel@tonic-gate /* more Sun devices */
2390Sstevel@tonic-gate #define	MT_ISTAND25G	0x37		/* sun: SCSI Tandberg 2.5 Gig QIC */
2400Sstevel@tonic-gate #define	MT_ISDLT	0x38		/* sun: SCSI DLT tape drive */
2410Sstevel@tonic-gate #define	MT_ISSTK9840	0x39		/* sun: STK 9840, 9940, 9840B */
2420Sstevel@tonic-gate #define	MT_ISBMDLT1	0x3a		/* sun: Benchmark DLT1 */
2430Sstevel@tonic-gate #define	MT_LTO		0x3b		/* sun: LTO,s by Hp, Seagate, IBM .. */
2442537Srralphs #define	MT_ISAIT	0x3c		/* Sony: AIT I II III and SAIT */
2450Sstevel@tonic-gate 
2460Sstevel@tonic-gate /*
2470Sstevel@tonic-gate  * Device table structure and data for looking tape name from
2480Sstevel@tonic-gate  * tape id number.  Used by mt.c.
2490Sstevel@tonic-gate  */
2500Sstevel@tonic-gate struct mt_tape_info {
2510Sstevel@tonic-gate 	short	t_type;		/* type of magtape device */
2520Sstevel@tonic-gate 	char	*t_name;	/* printing name */
2530Sstevel@tonic-gate 	char	*t_dsbits;	/* "drive status" register */
2540Sstevel@tonic-gate 	char	*t_erbits;	/* "error" register */
2550Sstevel@tonic-gate };
2560Sstevel@tonic-gate 
2570Sstevel@tonic-gate 
2580Sstevel@tonic-gate /* mag tape io control commands */
2590Sstevel@tonic-gate #define	MTIOC			('m'<<8)
2600Sstevel@tonic-gate #define	MTIOCTOP		(MTIOC|1)	/* do a mag tape op */
2610Sstevel@tonic-gate #define	MTIOCGET		(MTIOC|2)	/* get tape status */
2620Sstevel@tonic-gate #define	MTIOCGETDRIVETYPE	(MTIOC|3)	/* get tape config data */
2630Sstevel@tonic-gate #define	MTIOCPERSISTENT		(MTIOC|4)	/* turn on persistent errors */
2640Sstevel@tonic-gate #define	MTIOCPERSISTENTSTATUS	(MTIOC|5)	/* query persis. err status */
2650Sstevel@tonic-gate #define	MTIOCLRERR		(MTIOC|6)	/* clear a persitent error */
2660Sstevel@tonic-gate #define	MTIOCGUARANTEEDORDER	(MTIOC|7)	/* check for guaranteed order */
2670Sstevel@tonic-gate #define	MTIOCRESERVE		(MTIOC|8)	/* preserve reserve */
2680Sstevel@tonic-gate #define	MTIOCRELEASE		(MTIOC|9)	/* turnoff preserve reserve */
2690Sstevel@tonic-gate #define	MTIOCFORCERESERVE	(MTIOC|10)	/* break reservation drive */
2700Sstevel@tonic-gate 
2710Sstevel@tonic-gate #define	MTIOCSTATE		(MTIOC|13)	/* Inquire insert/eject state */
2720Sstevel@tonic-gate 
2730Sstevel@tonic-gate #define	MTIOCREADIGNOREILI  	(MTIOC|14)	/* Enable/Disable ILI */
2740Sstevel@tonic-gate #define	MTIOCREADIGNOREEOFS 	(MTIOC|15)	/* Enable/Disable Ignore EOF */
2750Sstevel@tonic-gate #define	MTIOCSHORTFMK		(MTIOC|16)	/* Enable/Disable Short FMK */
276*4549Srralphs #define	MTIOCGETPOS		(MTIOC|17)	/* Get drive position */
277*4549Srralphs #define	MTIOCRESTPOS		(MTIOC|18)	/* Go back to position */
278*4549Srralphs #define	MTIOCLTOP		(MTIOC|19)	/* do a mag tape op */
2790Sstevel@tonic-gate 
2800Sstevel@tonic-gate /*
2810Sstevel@tonic-gate  * This state enum is the argument passed to the MTIOCSTATE ioctl.
2820Sstevel@tonic-gate  */
2830Sstevel@tonic-gate enum mtio_state { MTIO_NONE, MTIO_EJECTED, MTIO_INSERTED };
2840Sstevel@tonic-gate 
2850Sstevel@tonic-gate #ifndef KERNEL
2860Sstevel@tonic-gate /*
2870Sstevel@tonic-gate  * don't use DEFTAPE.
2880Sstevel@tonic-gate  */
2890Sstevel@tonic-gate #define	DEFTAPE	"/dev/rmt/0"
2900Sstevel@tonic-gate #endif
2910Sstevel@tonic-gate 
2920Sstevel@tonic-gate /*
2930Sstevel@tonic-gate  * Layout of minor device byte
2940Sstevel@tonic-gate  * 15 - 8    7    6    5    4    3    2    1    0
2950Sstevel@tonic-gate  * --------------------------------------------
2960Sstevel@tonic-gate  * |    |    |    |    |    |    |    |    |----| Unit #. lower 2 bits
2970Sstevel@tonic-gate  * |    |    |    |    |    |    |    |---------- No rewind on close bit....
2980Sstevel@tonic-gate  * |    |    |    |    |    |----|--------------- Density Select
2990Sstevel@tonic-gate  * |    |    |    |    |------------------------- Resrvd.(add. campus dens. bit)
3000Sstevel@tonic-gate  * |    |    |    |------------------------------ BSD behavior
3010Sstevel@tonic-gate  * |----|----|----------------------------------- Unit #  bit 2-6
3020Sstevel@tonic-gate  */
3030Sstevel@tonic-gate 
3040Sstevel@tonic-gate #define	MTUNIT(dev)	(((getminor(dev) & 0xff80) >> 5) + \
3050Sstevel@tonic-gate 			    (getminor(dev) & 0x3))
3060Sstevel@tonic-gate #define	MT_NOREWIND	(1 <<2)
3070Sstevel@tonic-gate #define	MT_DENSITY_MASK	(3 <<3)
3080Sstevel@tonic-gate #define	MT_DENSITY1	(0 <<3)		/* Lowest density/format */
3090Sstevel@tonic-gate #define	MT_DENSITY2	(1 <<3)
3100Sstevel@tonic-gate #define	MT_DENSITY3	(2 <<3)
3110Sstevel@tonic-gate #define	MT_DENSITY4	(3 <<3)		/* Highest density/format */
3122083Szl149053 #define	MTMINOR(unit)	((((unit) & 0x7fc) << 5) + ((unit) & 0x3))
3130Sstevel@tonic-gate #define	MT_BSD		(1 <<6)		/* BSD behavior on close */
3140Sstevel@tonic-gate #define	MT_DENSITY(dev) ((getminor(dev) & MT_DENSITY_MASK) >> 3)
3150Sstevel@tonic-gate 
3160Sstevel@tonic-gate 
3170Sstevel@tonic-gate #ifdef	__cplusplus
3180Sstevel@tonic-gate }
3190Sstevel@tonic-gate #endif
3200Sstevel@tonic-gate 
3210Sstevel@tonic-gate #endif /* _SYS_MTIO_H */
322