ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / scsi / qla2xxx / qla_os.h
1 /******************************************************************************
2  *                  QLOGIC LINUX SOFTWARE
3  *
4  * QLogic ISP2x00 device driver for Linux 2.6.x
5  * Copyright (C) 2003-2004 QLogic Corporation
6  * (www.qlogic.com)
7  *
8  * Portions (C) Arjan van de Ven <arjanv@redhat.com> for Red Hat, Inc.
9  *
10  * This program is free software; you can redistribute it and/or modify it
11  * under the terms of the GNU General Public License as published by the
12  * Free Software Foundation; either version 2, or (at your option) any
13  * later version.
14  *
15  * This program is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * General Public License for more details.
19  *
20  ******************************************************************************/
21
22 #ifndef __QLA_OS_H
23 #define __QLA_OS_H
24
25 #include <linux/config.h>
26 #include <linux/module.h>
27 #include <linux/version.h>
28 #include <linux/init.h>
29 #include <linux/string.h>
30 #include <linux/errno.h>
31 #include <linux/kernel.h>
32 #include <linux/ioport.h>
33 #include <linux/delay.h>
34 #include <linux/timer.h>
35 #include <linux/sched.h>
36 #include <linux/pci.h>
37 #include <linux/proc_fs.h>
38 #include <linux/blkdev.h>
39 #include <linux/interrupt.h>
40 #include <linux/stat.h>
41 #include <linux/slab.h>
42 #include <linux/mempool.h>
43 #include <linux/vmalloc.h>
44 #include <linux/smp_lock.h>
45 #include <linux/bio.h>
46 #include <linux/moduleparam.h>
47 #include <linux/capability.h>
48 #include <linux/list.h>
49
50 #include <asm/system.h>
51
52 #include <asm/io.h>
53 #include <asm/irq.h>
54 #include <asm/segment.h>
55 #include <asm/byteorder.h>
56 #include <asm/pgtable.h>
57
58 #include <linux/ioctl.h>
59 #include <asm/uaccess.h>
60
61 #include "scsi.h"
62 #include "hosts.h"
63
64 #include <scsi/scsicam.h>
65 #include <scsi/scsi_ioctl.h>
66 #include <scsi/scsi_transport.h>
67 #include <scsi/scsi_transport_fc.h>
68
69 //TODO Fix this!!!
70 /*
71 * String arrays
72 */
73 #define LINESIZE    256
74 #define MAXARGS      26
75
76 /***********************************************************************
77 * We use the struct scsi_pointer structure that's included with each 
78 * command SCSI_Cmnd as a scratchpad. 
79 *
80 * SCp is defined as follows:
81 *  - SCp.ptr  -- > pointer to the SRB
82 *  - SCp.this_residual  -- > HBA completion status for ioctl code. 
83 *
84 * Cmnd->host_scribble --> Used to hold the hba actived handle (1..255).
85 ***********************************************************************/
86 #define CMD_SP(Cmnd)            ((Cmnd)->SCp.ptr)
87 #define CMD_COMPL_STATUS(Cmnd)  ((Cmnd)->SCp.this_residual)
88 /* Additional fields used by ioctl passthru */
89 #define CMD_RESID_LEN(Cmnd)     ((Cmnd)->SCp.buffers_residual)
90 #define CMD_SCSI_STATUS(Cmnd)   ((Cmnd)->SCp.Status)
91 #define CMD_ACTUAL_SNSLEN(Cmnd) ((Cmnd)->SCp.Message)
92 #define CMD_ENTRY_STATUS(Cmnd)  ((Cmnd)->SCp.have_data_in)
93
94 #endif