~ubuntu-branches/ubuntu/utopic/cdrdao/utopic

« back to all changes in this revision

Viewing changes to scsilib/include/mtiodefs.h

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Suffield
  • Date: 2004-06-24 22:33:16 UTC
  • Revision ID: james.westby@ubuntu.com-20040624223316-534onzugaeeyq61j
Tags: upstream-1.1.9
ImportĀ upstreamĀ versionĀ 1.1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* @(#)mtiodefs.h       1.4 02/08/26 Copyright 1995,2000-2002 J. Schilling */
 
2
/*
 
3
 *      Generic header for users of magnetic tape ioctl interface.
 
4
 *
 
5
 *      If there is no local mtio.h or equivalent, define
 
6
 *      simplified mtio definitions here in order
 
7
 *      to be able to do at least remote mtio on systems
 
8
 *      that have no local mtio
 
9
 *
 
10
 *      Copyright (c) 1995,2000-2002 J. Schilling
 
11
 */
 
12
/*
 
13
 * This program is free software; you can redistribute it and/or modify
 
14
 * it under the terms of the GNU General Public License as published by
 
15
 * the Free Software Foundation; either version 2, or (at your option)
 
16
 * any later version.
 
17
 *
 
18
 * This program is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
 * GNU General Public License for more details.
 
22
 *
 
23
 * You should have received a copy of the GNU General Public License
 
24
 * along with this program; see the file COPYING.  If not, write to
 
25
 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
26
 */
 
27
 
 
28
#ifndef _MTIODEFS_H
 
29
#define _MTIODEFS_H
 
30
 
 
31
#ifndef _MCONFIG_H
 
32
#include <mconfig.h>
 
33
#endif
 
34
 
 
35
#ifdef  HAVE_SYS_MTIO_H
 
36
 
 
37
#include <sys/mtio.h>
 
38
 
 
39
#else   /* ! HAVE_SYS_MTIO_H */
 
40
 
 
41
 
 
42
#ifdef  __cplusplus
 
43
extern "C" {
 
44
#endif
 
45
 
 
46
/*
 
47
 * Definitions for magnetic tape io control commands
 
48
 */
 
49
 
 
50
/*
 
51
 * structure for MTIOCTOP - magnetic tape operation command
 
52
 */
 
53
struct  mtop {
 
54
        short   mt_op;          /* op code (see below)                  */
 
55
        daddr_t mt_count;       /* repeat count or param                */
 
56
};
 
57
 
 
58
/*
 
59
 * op code values for mt_op
 
60
 */
 
61
#define MTWEOF          0       /* write EOF record(s)                  */
 
62
#define MTFSF           1       /* fwd space over file mark(s)          */
 
63
#define MTBSF           2       /* back space over file mark(s) (1/2" only ) */
 
64
#define MTFSR           3       /* fwd space record(s) (to inter-record gap) */
 
65
#define MTBSR           4       /* back space record(s) (to inter-record gap)*/
 
66
#define MTREW           5       /* rewind tape                          */
 
67
#define MTOFFL          6       /* rewind and put the drive offline     */
 
68
#define MTNOP           7       /* no operation (sets status ?)         */
 
69
 
 
70
/*
 
71
 * structure for MTIOCGET - magnetic tape get status command
 
72
 */
 
73
struct  mtget {
 
74
        short   mt_type;        /* type of magnetic tape device         */
 
75
                                /* the next two regs are device dependent */
 
76
        short   mt_dsreg;       /* drive status 'register'              */
 
77
        short   mt_erreg;       /* error 'register'                     */
 
78
        daddr_t mt_resid;       /* transfer residual count              */
 
79
        daddr_t mt_fileno;      /* file # for current position          */
 
80
        daddr_t mt_blkno;       /* block # for current position         */
 
81
};
 
82
 
 
83
#define HAVE_MTGET_TYPE
 
84
#define HAVE_MTGET_DSREG
 
85
#define HAVE_MTGET_ERREG
 
86
#define HAVE_MTGET_RESID
 
87
#define HAVE_MTGET_FILENO
 
88
#define HAVE_MTGET_BLKNO
 
89
 
 
90
/*
 
91
 * Define some junk here as software may assume that these two definitions
 
92
 * are always present.
 
93
 */
 
94
#define MTIOCGET        0x12340001
 
95
#define MTIOCTOP        0x12340002
 
96
 
 
97
#ifdef  __cplusplus
 
98
}
 
99
#endif
 
100
 
 
101
#endif  /* HAVE_SYS_MTIO_H */
 
102
 
 
103
#endif /* _MTIODEFS_H */