1 /* 2 History: 3 Started: Aug 9 by Lawrence Foard (entropy@world.std.com), to allow user 4 process control of SCSI devices. 5 Development Sponsored by Killy Corp. NY NY 6 */ 7 8 #ifndef _SCSI_GENERIC_H 9 #define _SCSI_GENERIC_H 10 11 /* 12 An SG device is accessed by writing "packets" to it, the replies 13 are then read using the read call. The same header is used for 14 reply, just ignore reply_len field. 15 */ 16 17 struct sg_header 18 { 19 int pack_len; /* length of incoming packet <4096 (including header) */ 20 int reply_len; /* maximum length <4096 of expected reply */ 21 int pack_id; /* id number of packet */ 22 int result; /* 0==ok, otherwise refer to errno codes */ 23 unsigned int twelve_byte:1; /* Force 12 byte command length for group 6 & 7 commands */ 24 unsigned int other_flags:31; /* for future use */ 25 unsigned char sense_buffer[16]; /* used only by reads */ 26 /* command follows then data for command */ 27 }; 28 29 /* ioctl's */ 30 #define SG_SET_TIMEOUT 0x2201 /* set timeout *(int *)arg==timeout */ 31 #define SG_GET_TIMEOUT 0x2202 /* get timeout return timeout */ 32 33 #define SG_DEFAULT_TIMEOUT (60*HZ) /* 1 minute timeout */ 34 #define SG_DEFAULT_RETRIES 1 35 36 #define SG_MAX_QUEUE 4 /* maximum outstanding request, arbitrary, may be 37 changed if sufficient DMA buffer room available */ 38 39 #define SG_BIG_BUFF 32768 40 41 #endif