mtio.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 1983-1989 by AT&T.
* All rights reserved.
*/
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
* under license from the Regents of the University of California.
*/
#ifndef _SYS_MTIO_H
#define _SYS_MTIO_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Structures and definitions for mag tape io control commands
*/
/*
* structure for MTIOCTOP - mag tape op command
*/
struct mtop {
short mt_op; /* operations defined below */
};
#if defined(_SYSCALL32)
struct mtop32 {
short mt_op; /* operations defined below */
};
#endif /* _SYSCALL32 */
/*
* values for mt_op
*/
#define MTWEOF 0 /* write an end-of-file record */
/* the tape device) */
/*
* structure for MTIOCGET - mag tape get status command
*/
struct mtget {
short mt_type; /* type of magtape device */
/* the following two registers are grossly device dependent */
short mt_dsreg; /* ``drive status'' register */
short mt_erreg; /* ``error'' register */
/* optional error info. */
short mt_bf; /* optimum blocking factor */
};
#if defined(_SYSCALL32)
struct mtget32 {
short mt_type; /* type of magtape device */
/* the following two registers are grossly device dependent */
short mt_dsreg; /* ``drive status'' register */
short mt_erreg; /* ``error'' register */
/* optional error info. */
short mt_bf; /* optimum blocking factor */
};
#endif /* _SYSCALL32 */
#define MT_NDENSITIES 4
#define MT_NSPEEDS 4
/*
* struct for MTIOCGETDRIVETYPE - get tape config data
*/
struct mtdrivetype {
char type; /* Drive type for driver */
int bsize; /* Block size */
int options; /* Drive options */
int max_rretries; /* Max read retries */
int max_wretries; /* Max write retries */
};
struct mtdrivetype_request {
int size;
struct mtdrivetype *mtdtp;
};
#if defined(_SYSCALL32)
struct mtdrivetype_request32 {
int size;
};
#endif /* _SYSCALL32 */
/*
* values for mt_flags
*/
#define MTF_SCSI 0x01
#define MTF_REEL 0x02
#define MTF_ASF 0x04
#define MTF_TAPE_HEAD_DIRTY 0x08
#define MTF_TAPE_CLN_SUPPORTED 0x10
/*
* Constants for mt_type byte (these are somewhat obsolete)
*/
/*
* these are recommended
*/
/* more Sun devices */
/*
* Device table structure and data for looking tape name from
* tape id number. Used by mt.c.
*/
struct mt_tape_info {
short t_type; /* type of magtape device */
char *t_name; /* printing name */
char *t_dsbits; /* "drive status" register */
char *t_erbits; /* "error" register */
};
/*
* this table is now obsolete, use MTIOCGETDRIVETYPE ioctl
*
* WARNING: this table will be eliminated in some future release
*/
#define MT_TAPE_INFO {\
{ MT_ISSYSGEN11, "Sysgen QIC-11", 0, 0 }, \
{ MT_ISSYSGEN, "Sysgen QIC-24", 0, 0 }, \
{ MT_ISMT02, "Emulex MT-02 QIC-24", 0, 0 }, \
{ MT_ISVIPER1, "Archive QIC-150", 0, 0 }, \
{ MT_ISWANGTEK1, "Wangtek QIC-150", 0, 0 }, \
{ MT_ISKENNEDY, "Kennedy 9612 1/2-inch", 0, 0 }, \
{ MT_ISANRITSU, "Anritsu 1/2-inch", 0, 0 }, \
{ MT_ISHP, "HP 88780 1/2-inch", 0, 0 }, \
{ MT_ISEXABYTE, "Exabyte EXB-8200 8mm", 0, 0 }, \
{ MT_ISEXB8500, "Exabyte EXB-8500 8mm", 0, 0 }, \
{ MT_ISWANGDAT, "WangDAT 3.81mm", 0, 0 }, \
{ MT_ISWANGTHS, "Wangtek 4mm RDAT", 0, 0 }, \
{ MT_ISPYTHON, "Archive Python 4mm Helical Scan", 0, 0 }, \
{ MT_ISSTC, "STC 1/2\" Cartridge", 0, 0}, \
{ MT_ISTAND25G, "Tandberg 2.5 Gig QIC", 0, 0}, \
{ MT_ISQIC, "QIC", 0, 0}, \
{ MT_ISREEL, "REEL", 0, 0}, \
{ MT_ISDAT, "DAT", 0, 0}, \
{ MT_IS8MM, "8mm", 0, 0}, \
{ MT_ISOTHER, "Other", 0, 0}, \
{ 0 } \
}
/* mag tape io control commands */
/*
* This state enum is the argument passed to the MTIOCSTATE ioctl.
*/
#ifndef KERNEL
/*
* don't use DEFTAPE.
*/
#endif
/*
* Layout of minor device byte
* 15 - 8 7 6 5 4 3 2 1 0
* --------------------------------------------
* | | | | | | | | |----| Unit #. lower 2 bits
* | | | | | | | |---------- No rewind on close bit....
* | | | | | |----|--------------- Density Select
* | | | | |------------------------- Resrvd.(add. campus dens. bit)
* | | | |------------------------------ BSD behavior
* |----|----|----------------------------------- Unit # bit 2-6
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_MTIO_H */