[PATCH] update copyright and licensing
[linux-2.6/history.git] / drivers / scsi / mvme16x.c
blobfd17e403799d2a1dbadbe6f187111cfd7e054b24
1 /*
2 * Detection routine for the NCR53c710 based MVME16x SCSI Controllers for Linux.
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>
12 #include <asm/page.h>
13 #include <asm/pgtable.h>
14 #include <asm/mvme16xhw.h>
15 #include <asm/irq.h>
17 #include "scsi.h"
18 #include "hosts.h"
19 #include "53c7xx.h"
20 #include "mvme16x.h"
22 #include<linux/stat.h>
24 extern int ncr53c7xx_init(Scsi_Host_Template *tpnt, int board, int chip,
25 unsigned long base, int io_port, int irq, int dma,
26 long long options, int clock);
28 int mvme16x_scsi_detect(Scsi_Host_Template *tpnt)
30 static unsigned char called = 0;
31 int clock;
32 long long options;
34 if (!MACH_IS_MVME16x)
35 return 0;
36 if (mvme16x_config & MVME16x_CONFIG_NO_SCSICHIP) {
37 printk ("SCSI detection disabled, SCSI chip not present\n");
38 return 0;
40 if (called)
41 return 0;
43 tpnt->proc_name = "MVME16x";
45 options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;
47 clock = 66000000; /* 66MHz SCSI Clock */
49 ncr53c7xx_init(tpnt, 0, 710, (unsigned long)0xfff47000,
50 0, MVME16x_IRQ_SCSI, DMA_NONE,
51 options, clock);
52 called = 1;
53 return 1;
56 static int mvme16x_scsi_release(struct Scsi_Host *shost)
58 if (shost->irq)
59 free_irq(shost->irq, NULL);
60 if (shost->dma_channel != 0xff)
61 free_dma(shost->dma_channel);
62 if (shost->io_port && shost->n_io_port)
63 release_region(shost->io_port, shost->n_io_port);
64 scsi_unregister(shost);
65 return 0;
68 static Scsi_Host_Template driver_template = {
69 .name = "MVME16x NCR53c710 SCSI",
70 .detect = mvme16x_scsi_detect,
71 .release = mvme16x_scsi_release,
72 .queuecommand = NCR53c7xx_queue_command,
73 .abort = NCR53c7xx_abort,
74 .reset = NCR53c7xx_reset,
75 .can_queue = 24,
76 .this_id = 7,
77 .sg_tablesize = 63,
78 .cmd_per_lun = 3,
79 .use_clustering = DISABLE_CLUSTERING
83 #include "scsi_module.c"