This source file includes following definitions.
- generic_NCR5380_detect
- generic_NCR5380_info
1 #define AUTOSENSE
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58 #include <linux/config.h>
59 #if defined(CONFIG_SCSI_GENERIC_NCR5380)
60
61 #define AUTOPROBE_IRQ
62
63 #include <asm/system.h>
64 #include <asm/io.h>
65 #include <linux/signal.h>
66 #include <linux/sched.h>
67 #include "../block/blk.h"
68 #include "scsi.h"
69 #include "hosts.h"
70 #include "g_NCR5380.h"
71 #include "NCR5380.h"
72 #include "constants.h"
73
74 static struct override {
75 int port;
76 int irq;
77 int dma;
78 } overrides
79 #ifdef GENERIC_NCR5380_OVERRIDE
80 [] = GENERIC_NCR5380_OVERRIDE
81 #else
82 [1] = {{0,},};
83 #endif
84
85 #define NO_OVERRIDES (sizeof(overrides) / sizeof(struct override))
86
87
88
89
90
91
92
93
94
95
96
97 void generic_NCR5380_setup(char *str, int *ints) {
98 static int commandline_current = 0;
99 if (ints[0] != 2)
100 printk("generic_NCR5380_setup : usage ncr5380=port,irq,dma\n");
101 else
102 if (commandline_current < NO_OVERRIDES) {
103 overrides[commandline_current].port = ints[1];
104 overrides[commandline_current].irq = ints[2];
105 overrides[commandline_current].dma = ints[3];
106 ++commandline_current;
107 }
108 }
109
110 static struct sigaction sa = { generic_NCR5380_intr, 0,
111 SA_INTERRUPT , NULL };
112
113
114
115
116
117
118
119
120
121
122
123
124
125 int generic_NCR5380_detect(int hostno) {
126 static int current_override = 0;
127 int count;
128 struct Scsi_Host *instance;
129
130 for (count = 0; current_override < NO_OVERRIDES; ++current_override) {
131 if (!(overrides[current_override].port))
132 continue;
133
134 instance = scsi_register (hostno, sizeof(struct NCR5380_hostdata));
135 instance->io_port = overrides[current_override].port;
136
137 NCR5380_init(instance);
138
139 if (overrides[current_override].irq != IRQ_AUTO)
140 instance->irq = overrides[current_override].irq;
141 else
142 instance->irq = NCR5380_probe_irq(instance, 0xffff);
143
144 if (instance->irq != IRQ_NONE)
145 if (irqaction (instance->irq, &sa)) {
146 printk("scsi%d : IRQ%d not free, interrupts disabled\n",
147 hostno, instance->irq);
148 instance->irq = IRQ_NONE;
149 }
150
151 if (instance->irq == IRQ_NONE) {
152 printk("scsi%d : interrupts not enabled. for better interactive performance,\n", hostno);
153 printk("scsi%d : please jumper the board for a free IRQ.\n", hostno);
154 }
155
156 printk("scsi%d : at port %d", instance->host_no, instance->io_port);
157 if (instance->irq == IRQ_NONE)
158 printk (" interrupts disabled");
159 else
160 printk (" irq %d", instance->irq);
161 printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
162 CAN_QUEUE, CMD_PER_LUN, GENERIC_NCR5380_PUBLIC_RELEASE);
163 NCR5380_print_options(instance);
164 printk("\n");
165
166 ++current_override;
167 ++count;
168 }
169 return count;
170 }
171
172 const char * generic_NCR5380_info (void) {
173 static const char string[]="";
174 return string;
175 }
176
177 #include "NCR5380.c"
178
179 #endif