1 /******************************************************************************
2 * QLOGIC LINUX SOFTWARE
4 * QLogic ISP2x00 device driver for Linux 2.6.x
5 * Copyright (C) 2003-2004 QLogic Corporation
8 * Portions (C) Arjan van de Ven <arjanv@redhat.com> for Red Hat, Inc.
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
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.
20 ******************************************************************************/
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>
50 #include <asm/system.h>
54 #include <asm/segment.h>
55 #include <asm/byteorder.h>
56 #include <asm/pgtable.h>
58 #include <linux/ioctl.h>
59 #include <asm/uaccess.h>
64 #include <scsi/scsicam.h>
65 #include <scsi/scsi_ioctl.h>
66 #include <scsi/scsi_transport.h>
67 #include <scsi/scsi_transport_fc.h>
76 /***********************************************************************
77 * We use the struct scsi_pointer structure that's included with each
78 * command SCSI_Cmnd as a scratchpad.
80 * SCp is defined as follows:
81 * - SCp.ptr -- > pointer to the SRB
82 * - SCp.this_residual -- > HBA completion status for ioctl code.
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)