ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / scsi / scsi.h
1 /*
2  *  scsi.h Copyright (C) 1992 Drew Eckhardt 
3  *         Copyright (C) 1993, 1994, 1995, 1998, 1999 Eric Youngdale
4  *  generic SCSI package header file by
5  *      Initial versions: Drew Eckhardt
6  *      Subsequent revisions: Eric Youngdale
7  *
8  *  <drew@colorado.edu>
9  *
10  *       Modified by Eric Youngdale eric@andante.org to
11  *       add scatter-gather, multiple outstanding request, and other
12  *       enhancements.
13  */
14
15 #ifndef _SCSI_H
16 #define _SCSI_H
17
18 #include <linux/config.h>           /* for CONFIG_SCSI_LOGGING */
19
20 #include <scsi/scsi_cmnd.h>
21 #include <scsi/scsi_device.h>
22 #include <scsi/scsi_eh.h>
23 #include <scsi/scsi_request.h>
24 #include <scsi/scsi_tcq.h>
25 #include <scsi/scsi.h>
26
27 /*
28  * Some defs, in case these are not defined elsewhere.
29  */
30 #ifndef TRUE
31 #define TRUE 1
32 #endif
33 #ifndef FALSE
34 #define FALSE 0
35 #endif
36
37 #ifdef DEBUG
38 #define SCSI_TIMEOUT (5*HZ)
39 #else
40 #define SCSI_TIMEOUT (2*HZ)
41 #endif
42
43 struct Scsi_Host;
44 struct scsi_cmnd;
45 struct scsi_device;
46 struct scsi_target;
47 struct scatterlist;
48
49 /*
50  * Prototypes for functions in constants.c
51  * Some of these used to live in constants.h
52  */
53 extern void print_Scsi_Cmnd(struct scsi_cmnd *);
54 extern void print_command(unsigned char *);
55 extern void print_sense(const char *, struct scsi_cmnd *);
56 extern void print_req_sense(const char *, struct scsi_request *);
57 extern void print_driverbyte(int scsiresult);
58 extern void print_hostbyte(int scsiresult);
59 extern void print_status(unsigned char status);
60 extern int print_msg(const unsigned char *);
61 extern const char *scsi_sense_key_string(unsigned char);
62 extern const char *scsi_extd_sense_format(unsigned char, unsigned char);
63
64 /*
65  * Legacy dma direction interfaces.
66  *
67  * This assumes the pci/sbus dma mapping flags have the same numercial
68  * values as the generic dma-mapping ones.  Currently they have but there's
69  * no way to check.  Better don't use these interfaces!
70  */
71 #define SCSI_DATA_UNKNOWN       (DMA_BIDIRECTIONAL)
72 #define SCSI_DATA_WRITE         (DMA_TO_DEVICE)
73 #define SCSI_DATA_READ          (DMA_FROM_DEVICE)
74 #define SCSI_DATA_NONE          (DMA_NONE)
75
76 #define scsi_to_pci_dma_dir(scsi_dir)   ((int)(scsi_dir))
77 #define scsi_to_sbus_dma_dir(scsi_dir)  ((int)(scsi_dir))
78
79 /*
80  * This is the crap from the old error handling code.  We have it in a special
81  * place so that we can more easily delete it later on.
82  */
83 #include "scsi_obsolete.h"
84
85 /* obsolete typedef junk. */
86 #include "scsi_typedefs.h"
87
88 #endif /* _SCSI_H */