10 #include <linux/module.h>
12 #include <linux/kernel.h>
13 #include <linux/string.h>
24 #include <asm/pgtable.h>
33 #define POWERTEC_FAS216_OFFSET 0x3000
34 #define POWERTEC_FAS216_SHIFT 6
36 #define POWERTEC_INTR_STATUS 0x2000
37 #define POWERTEC_INTR_BIT 0x80
39 #define POWERTEC_RESET_CONTROL 0x1018
40 #define POWERTEC_RESET_BIT 1
42 #define POWERTEC_TERM_CONTROL 0x2018
43 #define POWERTEC_TERM_ENABLE 1
45 #define POWERTEC_INTR_CONTROL 0x101c
46 #define POWERTEC_INTR_ENABLE 1
47 #define POWERTEC_INTR_DISABLE 0
49 #define VERSION "1.10 (19/01/2003 2.5.59)"
55 static int term[
MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 };
93 .irqdisable = powertecscsi_irqdisable,
102 powertecscsi_terminator_ctl(
struct Scsi_Host *
host,
int on_off)
135 struct device *
dev = scsi_get_device(host);
140 int bufs, map_dir, dma_dir;
142 bufs = copy_SCp_to_sg(&info->
sg[0], SCp,
NR_SG);
188 static char string[150];
190 sprintf(
string,
"%s (%s) in slot %d v%s terminators o%s",
209 if (length >= 12 &&
strncmp(buffer,
"POWERTECSCSI", 12) == 0) {
213 if (length >= 5 &&
strncmp(buffer,
"term=", 5) == 0) {
214 if (buffer[5] ==
'1')
215 powertecscsi_terminator_ctl(host, 1);
216 else if (buffer[5] ==
'0')
217 powertecscsi_terminator_ctl(host, 0);
241 int length,
int inout)
248 return powertecscsi_set_proc_info(host, buffer, length);
254 p +=
sprintf(p,
"Term : o%s\n",
261 pos = p - buffer -
offset;
284 powertecscsi_terminator_ctl(host, buf[0] !=
'0');
290 powertecscsi_show_term, powertecscsi_store_term);
295 .name =
"PowerTec SCSI",
309 .proc_name =
"powertec",
341 powertecscsi_terminator_ctl(host, term[ec->
slot_no]);
356 info->
info.
dma.setup = powertecscsi_dma_setup;
358 info->
info.
dma.stop = powertecscsi_dma_stop;
374 printk(
"scsi%d: IRQ%d not free: %d\n",
381 printk(
"scsi%d: DMA%d not free, using PIO\n",
431 static const struct ecard_id powertecscsi_cids[] = {
437 .probe = powertecscsi_probe,
439 .id_table = powertecscsi_cids,
441 .name =
"powertecscsi",
445 static int __init powertecscsi_init(
void)
450 static void __exit powertecscsi_exit(
void)