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 #define AUTOPROBE_IRQ
59
60 #include <asm/system.h>
61 #include <asm/io.h>
62 #include <linux/signal.h>
63 #include <linux/sched.h>
64 #include "../block/blk.h"
65 #include "scsi.h"
66 #include "hosts.h"
67 #include "g_NCR5380.h"
68 #include "NCR5380.h"
69 #include "constants.h"
70
71 static struct override {
72 int port;
73 int irq;
74 int dma;
75 } overrides
76 #ifdef GENERIC_NCR5380_OVERRIDE
77 [] = GENERIC_NCR5380_OVERRIDE
78 #else
79 [1] = {{0,},};
80 #endif
81
82 #define NO_OVERRIDES (sizeof(overrides) / sizeof(struct override))
83
84
85
86
87
88
89
90
91
92
93
94 void generic_NCR5380_setup(char *str, int *ints) {
95 static int commandline_current = 0;
96 if (ints[0] != 2)
97 printk("generic_NCR5380_setup : usage ncr5380=port,irq,dma\n");
98 else
99 if (commandline_current < NO_OVERRIDES) {
100 overrides[commandline_current].port = ints[1];
101 overrides[commandline_current].irq = ints[2];
102 overrides[commandline_current].dma = ints[3];
103 ++commandline_current;
104 }
105 }
106
107
108
109
110
111
112
113
114
115
116
117
118
119 int generic_NCR5380_detect(Scsi_Host_Template * tpnt) {
120 static int current_override = 0;
121 int count;
122 struct Scsi_Host *instance;
123
124 for (count = 0; current_override < NO_OVERRIDES; ++current_override) {
125 if (!(overrides[current_override].port))
126 continue;
127
128 instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
129 instance->io_port = overrides[current_override].port;
130
131 NCR5380_init(instance, 0);
132
133 if (overrides[current_override].irq != IRQ_AUTO)
134 instance->irq = overrides[current_override].irq;
135 else
136 instance->irq = NCR5380_probe_irq(instance, 0xffff);
137
138 if (instance->irq != IRQ_NONE)
139 if (request_irq(instance->irq, generic_NCR5380_intr, SA_INTERRUPT, "NCR5380")) {
140 printk("scsi%d : IRQ%d not free, interrupts disabled\n",
141 instance->host_no, instance->irq);
142 instance->irq = IRQ_NONE;
143 }
144
145 if (instance->irq == IRQ_NONE) {
146 printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no);
147 printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no);
148 }
149
150 printk("scsi%d : at port %d", instance->host_no, instance->io_port);
151 if (instance->irq == IRQ_NONE)
152 printk (" interrupts disabled");
153 else
154 printk (" irq %d", instance->irq);
155 printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
156 CAN_QUEUE, CMD_PER_LUN, GENERIC_NCR5380_PUBLIC_RELEASE);
157 NCR5380_print_options(instance);
158 printk("\n");
159
160 ++current_override;
161 ++count;
162 }
163 return count;
164 }
165
166 const char * generic_NCR5380_info (void) {
167 static const char string[]="";
168 return string;
169 }
170
171 #include "NCR5380.c"