]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/scsi/sg.h
Update.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / scsi / sg.h
1 /* Copyright (C) 1997 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
18
19 /*
20 History:
21 Started: Aug 9 by Lawrence Foard (entropy@world.std.com), to allow user
22 process control of SCSI devices.
23 Development Sponsored by Killy Corp. NY NY
24 */
25
26 #ifndef _SCSI_SG_H
27 #define _SCSI_SG_H 1
28
29 /* An SG device is accessed by writing "packets" to it, the replies
30 are then read using the read call. The same header is used for
31 replies; ignore the reply_len field. */
32
33 struct sg_header
34 {
35 int pack_len; /* length of incoming packet
36 (including header). */
37 int reply_len; /* max length of expected reply. */
38 int pack_id; /* id number of packet. */
39 int result; /* 0==ok, otherwise error number. */
40 unsigned int twelve_byte:1; /* force 12 byte command length for
41 group 6 & 7 commands. */
42 unsigned int other_flags:31; /* for future use. */
43 unsigned char sense_buffer[16]; /* used only by reads. */
44 /* command follows then data for command. */
45 };
46
47 /* ioctl's */
48 #define SG_SET_TIMEOUT 0x2201 /* set timeout *(int *)arg==timeout */
49 #define SG_GET_TIMEOUT 0x2202 /* get timeout return timeout */
50
51 #define SG_DEFAULT_TIMEOUT (60*HZ) /* 1 minute timeout */
52 #define SG_DEFAULT_RETRIES 1
53
54 #define SG_MAX_QUEUE 4 /* maximum outstanding request, arbitrary, may be
55 changed if sufficient DMA buffer room available. */
56
57 #define SG_BIG_BUFF 32768
58
59 #endif /* scsi/sg.h */