[PATCH] W1: w1_netlink: New init/fini netlink callbacks.
[linux-2.6/verdex.git] / drivers / scsi / bvme6000.c
blob29c7ed30c09e0b65d5e4c4d61b4959362c078e8e
1 /*
2 * Detection routine for the NCR53c710 based BVME6000 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>
11 #include <linux/zorro.h>
13 #include <asm/setup.h>
14 #include <asm/page.h>
15 #include <asm/pgtable.h>
16 #include <asm/bvme6000hw.h>
17 #include <asm/irq.h>
19 #include "scsi.h"
20 #include <scsi/scsi_host.h>
21 #include "53c7xx.h"
22 #include "bvme6000.h"
24 #include<linux/stat.h>
27 int bvme6000_scsi_detect(Scsi_Host_Template *tpnt)
29 static unsigned char called = 0;
30 int clock;
31 long long options;
33 if (called)
34 return 0;
35 if (!MACH_IS_BVME6000)
36 return 0;
38 tpnt->proc_name = "BVME6000";
40 options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;
42 clock = 40000000; /* 66MHz SCSI Clock */
44 ncr53c7xx_init(tpnt, 0, 710, (unsigned long)BVME_NCR53C710_BASE,
45 0, BVME_IRQ_SCSI, DMA_NONE,
46 options, clock);
47 called = 1;
48 return 1;
51 static int bvme6000_scsi_release(struct Scsi_Host *shost)
53 if (shost->irq)
54 free_irq(shost->irq, NULL);
55 if (shost->dma_channel != 0xff)
56 free_dma(shost->dma_channel);
57 if (shost->io_port && shost->n_io_port)
58 release_region(shost->io_port, shost->n_io_port);
59 scsi_unregister(shost);
60 return 0;
63 static Scsi_Host_Template driver_template = {
64 .name = "BVME6000 NCR53c710 SCSI",
65 .detect = bvme6000_scsi_detect,
66 .release = bvme6000_scsi_release,
67 .queuecommand = NCR53c7xx_queue_command,
68 .abort = NCR53c7xx_abort,
69 .reset = NCR53c7xx_reset,
70 .can_queue = 24,
71 .this_id = 7,
72 .sg_tablesize = 63,
73 .cmd_per_lun = 3,
74 .use_clustering = DISABLE_CLUSTERING
78 #include "scsi_module.c"