25 #include <linux/module.h>
27 #include <linux/kernel.h>
28 #include <linux/string.h>
39 #include <asm/pgtable.h>
48 #define EESOX_FAS216_OFFSET 0x3000
49 #define EESOX_FAS216_SHIFT 5
51 #define EESOX_DMASTAT 0x2800
52 #define EESOX_STAT_INTR 0x01
53 #define EESOX_STAT_DMA 0x02
55 #define EESOX_CONTROL 0x2800
56 #define EESOX_INTR_ENABLE 0x04
57 #define EESOX_TERM_ENABLE 0x02
58 #define EESOX_RESET 0x01
60 #define EESOX_DMADATA 0x3800
62 #define VERSION "1.10 (17/01/2003 2.5.59)"
67 static int term[
MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 };
112 .irqdisable = eesoxscsi_irqdisable,
142 eesoxscsi_intr(
int irq,
void *
dev_id)
162 struct device *
dev = scsi_get_device(host);
167 int bufs, map_dir, dma_dir;
169 bufs = copy_SCp_to_sg(&info->
sg[0], SCp,
NR_SG);
199 register const unsigned long mask = 0xffff;
214 status =
readb(reg_dmastat);
230 if (((
u32)buf) & 2 && status >= 2) {
238 unsigned long l1,
l2;
241 l1 |=
readl(reg_dmadata) << 16;
243 l2 |=
readl(reg_dmadata) << 16;
256 l1 |=
readl(reg_dmadata) << 16;
272 static void eesoxscsi_buffer_out(
void *buf,
int length,
void __iomem *base)
285 if (status & STAT_INT)
291 status =
readb(reg_dmastat);
292 if (!(status & EESOX_STAT_DMA))
309 if (((
u32)buf) & 2 && status >= 2) {
317 unsigned long l1,
l2;
324 writel(l1 << 16, reg_dmadata);
326 writel(l2 << 16, reg_dmadata);
338 writel(l1 << 16, reg_dmadata);
385 static char string[150];
387 sprintf(
string,
"%s (%s) in slot %d v%s terminators o%s",
402 eesoxscsi_set_proc_info(
struct Scsi_Host *host,
char *
buffer,
int length)
406 if (length >= 9 &&
strncmp(buffer,
"EESOXSCSI", 9) == 0) {
410 if (length >= 5 &&
strncmp(buffer,
"term=", 5) == 0) {
411 if (buffer[5] ==
'1')
412 eesoxscsi_terminator_ctl(host, 1);
413 else if (buffer[5] ==
'0')
414 eesoxscsi_terminator_ctl(host, 0);
439 int length,
int inout)
446 return eesoxscsi_set_proc_info(host, buffer, length);
452 p +=
sprintf(p,
"Term : o%s\n",
459 pos = p - buffer -
offset;
497 eesoxscsi_show_term, eesoxscsi_store_term);
502 .name =
"EESOX SCSI",
515 .proc_name =
"eesox",
564 info->
info.
dma.setup = eesoxscsi_dma_setup;
565 info->
info.
dma.pseudo = eesoxscsi_dma_pseudo;
566 info->
info.
dma.stop = eesoxscsi_dma_stop;
581 printk(
"scsi%d: IRQ%d not free: %d\n",
588 printk(
"scsi%d: DMA%d not free, DMA disabled\n",
639 static const struct ecard_id eesoxscsi_cids[] = {
645 .probe = eesoxscsi_probe,
647 .id_table = eesoxscsi_cids,
653 static int __init eesox_init(
void)
658 static void __exit eesox_exit(
void)