ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / scsi / ncr53c8xx.h
1 /******************************************************************************
2 **  Device driver for the PCI-SCSI NCR538XX controller family.
3 **
4 **  Copyright (C) 1994  Wolfgang Stanglmeier
5 **
6 **  This program is free software; you can redistribute it and/or modify
7 **  it under the terms of the GNU General Public License as published by
8 **  the Free Software Foundation; either version 2 of the License, or
9 **  (at your option) any later version.
10 **
11 **  This program is distributed in the hope that it will be useful,
12 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 **  GNU General Public License for more details.
15 **
16 **  You should have received a copy of the GNU General Public License
17 **  along with this program; if not, write to the Free Software
18 **  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 **
20 **-----------------------------------------------------------------------------
21 **
22 **  This driver has been ported to Linux from the FreeBSD NCR53C8XX driver
23 **  and is currently maintained by
24 **
25 **          Gerard Roudier              <groudier@free.fr>
26 **
27 **  Being given that this driver originates from the FreeBSD version, and
28 **  in order to keep synergy on both, any suggested enhancements and corrections
29 **  received on Linux are automatically a potential candidate for the FreeBSD 
30 **  version.
31 **
32 **  The original driver has been written for 386bsd and FreeBSD by
33 **          Wolfgang Stanglmeier        <wolf@cologne.de>
34 **          Stefan Esser                <se@mi.Uni-Koeln.de>
35 **
36 **  And has been ported to NetBSD by
37 **          Charles M. Hannum           <mycroft@gnu.ai.mit.edu>
38 **
39 *******************************************************************************
40 */
41
42 #ifndef NCR53C8XX_H
43 #define NCR53C8XX_H
44
45 typedef u_long          vm_offset_t;
46
47 #include "sym53c8xx_defs.h"
48
49 /*==========================================================
50 **
51 **      Structures used by the detection routine to transmit 
52 **      device configuration to the attach function.
53 **
54 **==========================================================
55 */
56 typedef struct {
57         int     bus;
58         u_char  device_fn;
59         u_long  base;
60         u_long  base_2;
61         u_long  io_port;
62         u_long  base_c;
63         u_long  base_2_c;
64         u_long  base_v;
65         u_long  base_2_v;
66         int     irq;
67 /* port and reg fields to use INB, OUTB macros */
68         u_long  base_io;
69         volatile struct ncr_reg *reg;
70 } ncr_slot;
71
72 /*==========================================================
73 **
74 **      Structure used to store the NVRAM content.
75 **
76 **==========================================================
77 */
78 typedef struct {
79         int type;
80 #define SCSI_NCR_SYMBIOS_NVRAM  (1)
81 #define SCSI_NCR_TEKRAM_NVRAM   (2)
82 #ifdef  SCSI_NCR_NVRAM_SUPPORT
83         union {
84                 Symbios_nvram Symbios;
85                 Tekram_nvram Tekram;
86         } data;
87 #endif
88 } ncr_nvram;
89
90 /*==========================================================
91 **
92 **      Structure used by detection routine to save data on 
93 **      each detected board for attach.
94 **
95 **==========================================================
96 */
97 struct ncr_device {
98         struct device  *dev;
99         ncr_slot  slot;
100         ncr_chip  chip;
101         ncr_nvram *nvram;
102         u_char host_id;
103 #ifdef  SCSI_NCR_PQS_PDS_SUPPORT
104         u_char pqs_pds;
105 #endif
106         __u8 differential;
107         int attach_done;
108 };
109
110 extern struct Scsi_Host *ncr_attach (Scsi_Host_Template *tpnt, int unit, struct ncr_device *device);
111 extern int ncr53c8xx_release(struct Scsi_Host *host);
112 irqreturn_t ncr53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs);
113
114 #endif /* NCR53C8XX_H */