aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mvme16x.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/scsi/mvme16x.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/scsi/mvme16x.c')
-rw-r--r--drivers/scsi/mvme16x.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/drivers/scsi/mvme16x.c b/drivers/scsi/mvme16x.c
new file mode 100644
index 000000000000..b2d8d8ea1604
--- /dev/null
+++ b/drivers/scsi/mvme16x.c
@@ -0,0 +1,80 @@
1/*
2 * Detection routine for the NCR53c710 based MVME16x SCSI Controllers for Linux.
3 *
4 * Based on work by Alan Hourihane
5 */
6#include <linux/types.h>
7#include <linux/mm.h>
8#include <linux/blkdev.h>
9#include <linux/sched.h>
10#include <linux/version.h>
11
12#include <asm/page.h>
13#include <asm/pgtable.h>
14#include <asm/mvme16xhw.h>
15#include <asm/irq.h>
16
17#include "scsi.h"
18#include <scsi/scsi_host.h>
19#include "53c7xx.h"
20#include "mvme16x.h"
21
22#include<linux/stat.h>
23
24
25int mvme16x_scsi_detect(Scsi_Host_Template *tpnt)
26{
27 static unsigned char called = 0;
28 int clock;
29 long long options;
30
31 if (!MACH_IS_MVME16x)
32 return 0;
33 if (mvme16x_config & MVME16x_CONFIG_NO_SCSICHIP) {
34 printk ("SCSI detection disabled, SCSI chip not present\n");
35 return 0;
36 }
37 if (called)
38 return 0;
39
40 tpnt->proc_name = "MVME16x";
41
42 options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;
43
44 clock = 66000000; /* 66MHz SCSI Clock */
45
46 ncr53c7xx_init(tpnt, 0, 710, (unsigned long)0xfff47000,
47 0, MVME16x_IRQ_SCSI, DMA_NONE,
48 options, clock);
49 called = 1;
50 return 1;
51}
52
53static int mvme16x_scsi_release(struct Scsi_Host *shost)
54{
55 if (shost->irq)
56 free_irq(shost->irq, NULL);
57 if (shost->dma_channel != 0xff)
58 free_dma(shost->dma_channel);
59 if (shost->io_port && shost->n_io_port)
60 release_region(shost->io_port, shost->n_io_port);
61 scsi_unregister(shost);
62 return 0;
63}
64
65static Scsi_Host_Template driver_template = {
66 .name = "MVME16x NCR53c710 SCSI",
67 .detect = mvme16x_scsi_detect,
68 .release = mvme16x_scsi_release,
69 .queuecommand = NCR53c7xx_queue_command,
70 .abort = NCR53c7xx_abort,
71 .reset = NCR53c7xx_reset,
72 .can_queue = 24,
73 .this_id = 7,
74 .sg_tablesize = 63,
75 .cmd_per_lun = 3,
76 .use_clustering = DISABLE_CLUSTERING
77};
78
79
80#include "scsi_module.c"