diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-17 02:20:36 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-17 02:20:36 +0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/scsi/mvme16x.c | |
download | linux-1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.tar.xz |
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.c | 80 |
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 @@ +/* + * Detection routine for the NCR53c710 based MVME16x SCSI Controllers for Linux. + * + * Based on work by Alan Hourihane + */ +#include <linux/types.h> +#include <linux/mm.h> +#include <linux/blkdev.h> +#include <linux/sched.h> +#include <linux/version.h> + +#include <asm/page.h> +#include <asm/pgtable.h> +#include <asm/mvme16xhw.h> +#include <asm/irq.h> + +#include "scsi.h" +#include <scsi/scsi_host.h> +#include "53c7xx.h" +#include "mvme16x.h" + +#include<linux/stat.h> + + +int mvme16x_scsi_detect(Scsi_Host_Template *tpnt) +{ + static unsigned char called = 0; + int clock; + long long options; + + if (!MACH_IS_MVME16x) + return 0; + if (mvme16x_config & MVME16x_CONFIG_NO_SCSICHIP) { + printk ("SCSI detection disabled, SCSI chip not present\n"); + return 0; + } + if (called) + return 0; + + tpnt->proc_name = "MVME16x"; + + options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT; + + clock = 66000000; /* 66MHz SCSI Clock */ + + ncr53c7xx_init(tpnt, 0, 710, (unsigned long)0xfff47000, + 0, MVME16x_IRQ_SCSI, DMA_NONE, + options, clock); + called = 1; + return 1; +} + +static int mvme16x_scsi_release(struct Scsi_Host *shost) +{ + if (shost->irq) + free_irq(shost->irq, NULL); + if (shost->dma_channel != 0xff) + free_dma(shost->dma_channel); + if (shost->io_port && shost->n_io_port) + release_region(shost->io_port, shost->n_io_port); + scsi_unregister(shost); + return 0; +} + +static Scsi_Host_Template driver_template = { + .name = "MVME16x NCR53c710 SCSI", + .detect = mvme16x_scsi_detect, + .release = mvme16x_scsi_release, + .queuecommand = NCR53c7xx_queue_command, + .abort = NCR53c7xx_abort, + .reset = NCR53c7xx_reset, + .can_queue = 24, + .this_id = 7, + .sg_tablesize = 63, + .cmd_per_lun = 3, + .use_clustering = DISABLE_CLUSTERING +}; + + +#include "scsi_module.c" |