xref: /netbsd-src/sys/compat/linux/common/linux_mtio.h (revision 95e1ffb15694e54f29f8baaa4232152b703c2a5a)
1 /* $NetBSD: linux_mtio.h,v 1.2 2005/12/11 12:20:19 christos Exp $ */
2 
3 /*
4  * Copyright (c) 2005 Soren S. Jorvang.  All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions, and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  */
27 
28 #ifndef _LINUX_MTIO_H
29 #define _LINUX_MTIO_H
30 
31 #define LINUX_MTIOCTOP		_LINUX_IOW('m', 1, struct linux_mtop)
32 #define LINUX_MTIOCGET		_LINUX_IOR('m', 2, struct linux_mtget)
33 #define LINUX_MTIOCPOS		_LINUX_IOR('m', 3, struct linux_mtpos)
34 
35 struct	linux_mtop {
36 	short	mt_op;
37 	int	mt_count;
38 };
39 
40 #define LINUX_MTRESET		0
41 #define LINUX_MTFSF		1
42 #define LINUX_MTBSF		2
43 #define LINUX_MTFSR		3
44 #define LINUX_MTBSR		4
45 #define LINUX_MTWEOF		5
46 #define LINUX_MTREW		6
47 #define LINUX_MTOFFL		7
48 #define LINUX_MTNOP		8
49 #define LINUX_MTRETEN		9
50 #define LINUX_MTBSFM		10
51 #define LINUX_MTFSFM		11
52 #define LINUX_MTEOM		12
53 #define LINUX_MTERASE		13
54 #define LINUX_MTRAS1		14
55 #define LINUX_MTRAS2		15
56 #define LINUX_MTRAS3		16
57 #define LINUX_MTSETBLK		20
58 #define LINUX_MTSETDENSITY	21
59 #define LINUX_MTSEEK		22
60 #define LINUX_MTTELL		23
61 #define LINUX_MTSETDRVBUFFER	24
62 #define LINUX_MTFSS		25
63 #define LINUX_MTBSS		26
64 #define LINUX_MTWSM		27
65 #define LINUX_MTLOCK		28
66 #define LINUX_MTUNLOCK		29
67 #define LINUX_MTLOAD		30
68 #define LINUX_MTUNLOAD		31
69 #define LINUX_MTCOMPRESSION	32
70 #define LINUX_MTSETPART		33
71 #define LINUX_MTMKPART		34
72 
73 struct	linux_mtget {
74 #define LINUX_MT_ISUNKNOWN	0x01
75 	long	mt_type;
76 	long	mt_resid;
77 	long	mt_dsreg;
78 	long	mt_gstat;
79 	long	mt_erreg;
80 	daddr_t mt_fileno;
81 	daddr_t mt_blkno;
82 };
83 
84 struct linux_mtpos {
85 	long	mt_blkno;
86 };
87 
88 #endif /* !_LINUX_MTIO_H */
89