19 #include <linux/module.h>
21 #include <linux/kernel.h>
22 #include <linux/string.h>
33 #include <asm/pgtable.h>
42 #define CUMANASCSI2_STATUS (0x0000)
43 #define STATUS_INT (1 << 0)
44 #define STATUS_DRQ (1 << 1)
45 #define STATUS_LATCHED (1 << 3)
47 #define CUMANASCSI2_ALATCH (0x0014)
48 #define ALATCH_ENA_INT (3)
49 #define ALATCH_DIS_INT (2)
50 #define ALATCH_ENA_TERM (5)
51 #define ALATCH_DIS_TERM (4)
52 #define ALATCH_ENA_BIT32 (11)
53 #define ALATCH_DIS_BIT32 (10)
54 #define ALATCH_ENA_DMA (13)
55 #define ALATCH_DIS_DMA (12)
56 #define ALATCH_DMA_OUT (15)
57 #define ALATCH_DMA_IN (14)
59 #define CUMANASCSI2_PSEUDODMA (0x0200)
61 #define CUMANASCSI2_FAS216_OFFSET (0x0300)
62 #define CUMANASCSI2_FAS216_SHIFT 2
67 #define VERSION "1.00 (13/11/2002 2.5.47)"
72 static int term[
MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 };
84 #define CSTATUS_IRQ (1 << 0)
85 #define CSTATUS_DRQ (1 << 1)
113 .irqdisable = cumanascsi_2_irqdisable,
122 cumanascsi_2_terminator_ctl(
struct Scsi_Host *
host,
int on_off)
141 cumanascsi_2_intr(
int irq,
void *
dev_id)
161 struct device *
dev = scsi_get_device(host);
168 int bufs, map_dir, dma_dir, alatch_dir;
170 bufs = copy_SCp_to_sg(&info->
sg[0], SCp,
NR_SG);
237 printk (
"PSEUDO_OUT???\n");
240 if (transfer && (transfer & 255)) {
244 if (status & STATUS_INT)
261 if (status & STATUS_INT)
300 static char string[150];
302 sprintf(
string,
"%s (%s) in slot %d v%s terminators o%s",
321 if (length >= 11 &&
strncmp(buffer,
"CUMANASCSI2", 11) == 0) {
325 if (length >= 5 &&
strncmp(buffer,
"term=", 5) == 0) {
326 if (buffer[5] ==
'1')
327 cumanascsi_2_terminator_ctl(host, 1);
328 else if (buffer[5] ==
'0')
329 cumanascsi_2_terminator_ctl(host, 0);
354 int length,
int inout)
361 return cumanascsi_2_set_proc_info(host, buffer, length);
367 p +=
sprintf(p,
"Term : o%s\n",
368 info->
terms ?
"n" :
"ff");
374 pos = p - buffer -
offset;
384 .name =
"Cumana SCSI II",
397 .proc_name =
"cumanascsi2",
431 cumanascsi_2_terminator_ctl(host, term[ec->
slot_no]);
445 info->
info.
dma.setup = cumanascsi_2_dma_setup;
446 info->
info.
dma.pseudo = cumanascsi_2_dma_pseudo;
447 info->
info.
dma.stop = cumanascsi_2_dma_stop;
461 printk(
"scsi%d: IRQ%d not free: %d\n",
468 printk(
"scsi%d: DMA%d not free, using PIO\n",
515 static const struct ecard_id cumanascsi2_cids[] = {
521 .probe = cumanascsi2_probe,
523 .id_table = cumanascsi2_cids,
525 .name =
"cumanascsi2",
529 static int __init cumanascsi2_init(
void)
534 static void __exit cumanascsi2_exit(
void)