blob: 777972e6bbf3d8cf230a0470719bd3f3e8650e8b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#include <linux/types.h>
2#include <linux/mm.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +09003#include <linux/slab.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07004#include <linux/blkdev.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#include <linux/init.h>
6#include <linux/interrupt.h>
7
8#include <asm/setup.h>
9#include <asm/page.h>
10#include <asm/pgtable.h>
11#include <asm/amigaints.h>
12#include <asm/amigahw.h>
13#include <linux/zorro.h>
14#include <asm/irq.h>
15#include <linux/spinlock.h>
16
17#include "scsi.h"
18#include <scsi/scsi_host.h>
19#include "wd33c93.h"
20#include "gvp11.h"
21
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020022#include <linux/stat.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
Linus Torvalds1da177e2005-04-16 15:20:36 -070024
Geert Uytterhoeven6869b152009-05-17 12:17:28 +020025static irqreturn_t gvp11_intr(int irq, void *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -070026{
Geert Uytterhoeven6869b152009-05-17 12:17:28 +020027 struct Scsi_Host *instance = data;
28 gvp11_scsiregs *regs = (gvp11_scsiregs *)(instance->base);
29 unsigned int status = regs->CNTR;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020030 unsigned long flags;
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020032 if (!(status & GVP11_DMAC_INT_PENDING))
33 return IRQ_NONE;
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020035 spin_lock_irqsave(instance->host_lock, flags);
36 wd33c93_intr(instance);
37 spin_unlock_irqrestore(instance->host_lock, flags);
38 return IRQ_HANDLED;
Linus Torvalds1da177e2005-04-16 15:20:36 -070039}
40
41static int gvp11_xfer_mask = 0;
42
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020043void gvp11_setup(char *str, int *ints)
Linus Torvalds1da177e2005-04-16 15:20:36 -070044{
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020045 gvp11_xfer_mask = ints[1];
Linus Torvalds1da177e2005-04-16 15:20:36 -070046}
47
Henrik Kretzschmar65396412006-09-12 23:49:33 +020048static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
Linus Torvalds1da177e2005-04-16 15:20:36 -070049{
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +020050 struct Scsi_Host *instance = cmd->device->host;
51 struct WD33C93_hostdata *hdata = shost_priv(instance);
Geert Uytterhoeven6869b152009-05-17 12:17:28 +020052 gvp11_scsiregs *regs = (gvp11_scsiregs *)(instance->base);
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020053 unsigned short cntr = GVP11_DMAC_INT_ENABLE;
54 unsigned long addr = virt_to_bus(cmd->SCp.ptr);
55 int bank_mask;
56 static int scsi_alloc_out_of_range = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020058 /* use bounce buffer if the physical address is bad */
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +020059 if (addr & hdata->dma_xfer_mask) {
60 hdata->dma_bounce_len = (cmd->SCp.this_residual + 511) & ~0x1ff;
Linus Torvalds1da177e2005-04-16 15:20:36 -070061
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020062 if (!scsi_alloc_out_of_range) {
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +020063 hdata->dma_bounce_buffer =
64 kmalloc(hdata->dma_bounce_len, GFP_KERNEL);
65 hdata->dma_buffer_pool = BUF_SCSI_ALLOCED;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020066 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020068 if (scsi_alloc_out_of_range ||
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +020069 !hdata->dma_bounce_buffer) {
70 hdata->dma_bounce_buffer =
71 amiga_chip_alloc(hdata->dma_bounce_len,
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020072 "GVP II SCSI Bounce Buffer");
73
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +020074 if (!hdata->dma_bounce_buffer) {
75 hdata->dma_bounce_len = 0;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020076 return 1;
77 }
78
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +020079 hdata->dma_buffer_pool = BUF_CHIP_ALLOCED;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020080 }
81
82 /* check if the address of the bounce buffer is OK */
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +020083 addr = virt_to_bus(hdata->dma_bounce_buffer);
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020084
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +020085 if (addr & hdata->dma_xfer_mask) {
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020086 /* fall back to Chip RAM if address out of range */
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +020087 if (hdata->dma_buffer_pool == BUF_SCSI_ALLOCED) {
88 kfree(hdata->dma_bounce_buffer);
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020089 scsi_alloc_out_of_range = 1;
90 } else {
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +020091 amiga_chip_free(hdata->dma_bounce_buffer);
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020092 }
93
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +020094 hdata->dma_bounce_buffer =
95 amiga_chip_alloc(hdata->dma_bounce_len,
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +020096 "GVP II SCSI Bounce Buffer");
97
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +020098 if (!hdata->dma_bounce_buffer) {
99 hdata->dma_bounce_len = 0;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200100 return 1;
101 }
102
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200103 addr = virt_to_bus(hdata->dma_bounce_buffer);
104 hdata->dma_buffer_pool = BUF_CHIP_ALLOCED;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200105 }
106
107 if (!dir_in) {
108 /* copy to bounce buffer for a write */
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200109 memcpy(hdata->dma_bounce_buffer, cmd->SCp.ptr,
110 cmd->SCp.this_residual);
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200111 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112 }
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200113
114 /* setup dma direction */
115 if (!dir_in)
116 cntr |= GVP11_DMAC_DIR_WRITE;
117
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200118 hdata->dma_dir = dir_in;
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200119 regs->CNTR = cntr;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200120
121 /* setup DMA *physical* address */
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200122 regs->ACR = addr;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200123
124 if (dir_in) {
125 /* invalidate any cache */
126 cache_clear(addr, cmd->SCp.this_residual);
127 } else {
128 /* push any dirty cache */
129 cache_push(addr, cmd->SCp.this_residual);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700131
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200132 bank_mask = (~hdata->dma_xfer_mask >> 18) & 0x01c0;
133 if (bank_mask)
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200134 regs->BANK = bank_mask & (addr >> 18);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200136 /* start DMA */
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200137 regs->ST_DMA = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200139 /* return success */
140 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141}
142
Henrik Kretzschmar65396412006-09-12 23:49:33 +0200143static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
144 int status)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145{
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200146 gvp11_scsiregs *regs = (gvp11_scsiregs *)(instance->base);
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200147 struct WD33C93_hostdata *hdata = shost_priv(instance);
148
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200149 /* stop DMA */
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200150 regs->SP_DMA = 1;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200151 /* remove write bit from CONTROL bits */
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200152 regs->CNTR = GVP11_DMAC_INT_ENABLE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200154 /* copy from a bounce buffer, if necessary */
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200155 if (status && hdata->dma_bounce_buffer) {
156 if (hdata->dma_dir && SCpnt)
157 memcpy(SCpnt->SCp.ptr, hdata->dma_bounce_buffer,
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200158 SCpnt->SCp.this_residual);
159
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200160 if (hdata->dma_buffer_pool == BUF_SCSI_ALLOCED)
161 kfree(hdata->dma_bounce_buffer);
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200162 else
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200163 amiga_chip_free(hdata->dma_bounce_buffer);
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200164
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200165 hdata->dma_bounce_buffer = NULL;
166 hdata->dma_bounce_len = 0;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200167 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168}
169
170#define CHECK_WD33C93
171
Christoph Hellwigd0be4a7d2005-10-31 18:31:40 +0100172int __init gvp11_detect(struct scsi_host_template *tpnt)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173{
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200174 static unsigned char called = 0;
175 struct Scsi_Host *instance;
176 unsigned long address;
177 unsigned int epc;
178 struct zorro_dev *z = NULL;
179 unsigned int default_dma_xfer_mask;
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200180 struct WD33C93_hostdata *hdata;
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200181 gvp11_scsiregs *regs;
182 wd33c93_regs wdregs;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200183 int num_gvp11 = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184#ifdef CHECK_WD33C93
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200185 volatile unsigned char *sasr_3393, *scmd_3393;
186 unsigned char save_sasr;
187 unsigned char q, qq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188#endif
189
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200190 if (!MACH_IS_AMIGA || called)
191 return 0;
192 called = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700193
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200194 tpnt->proc_name = "GVP11";
195 tpnt->proc_info = &wd33c93_proc_info;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200197 while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
198 /*
199 * This should (hopefully) be the correct way to identify
200 * all the different GVP SCSI controllers (except for the
201 * SERIES I though).
202 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700203
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200204 if (z->id == ZORRO_PROD_GVP_COMBO_030_R3_SCSI ||
205 z->id == ZORRO_PROD_GVP_SERIES_II)
206 default_dma_xfer_mask = ~0x00ffffff;
207 else if (z->id == ZORRO_PROD_GVP_GFORCE_030_SCSI ||
208 z->id == ZORRO_PROD_GVP_A530_SCSI ||
209 z->id == ZORRO_PROD_GVP_COMBO_030_R4_SCSI)
210 default_dma_xfer_mask = ~0x01ffffff;
211 else if (z->id == ZORRO_PROD_GVP_A1291 ||
212 z->id == ZORRO_PROD_GVP_GFORCE_040_SCSI_1)
213 default_dma_xfer_mask = ~0x07ffffff;
214 else
215 continue;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700216
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200217 /*
218 * Rumors state that some GVP ram boards use the same product
219 * code as the SCSI controllers. Therefore if the board-size
220 * is not 64KB we asume it is a ram board and bail out.
221 */
222 if (z->resource.end - z->resource.start != 0xffff)
223 continue;
224
225 address = z->resource.start;
226 if (!request_mem_region(address, 256, "wd33c93"))
227 continue;
228
229#ifdef CHECK_WD33C93
230
231 /*
232 * These darn GVP boards are a problem - it can be tough to tell
233 * whether or not they include a SCSI controller. This is the
234 * ultimate Yet-Another-GVP-Detection-Hack in that it actually
235 * probes for a WD33c93 chip: If we find one, it's extremely
236 * likely that this card supports SCSI, regardless of Product_
237 * Code, Board_Size, etc.
238 */
239
240 /* Get pointers to the presumed register locations and save contents */
241
242 sasr_3393 = &(((gvp11_scsiregs *)(ZTWO_VADDR(address)))->SASR);
243 scmd_3393 = &(((gvp11_scsiregs *)(ZTWO_VADDR(address)))->SCMD);
244 save_sasr = *sasr_3393;
245
246 /* First test the AuxStatus Reg */
247
248 q = *sasr_3393; /* read it */
249 if (q & 0x08) /* bit 3 should always be clear */
250 goto release;
251 *sasr_3393 = WD_AUXILIARY_STATUS; /* setup indirect address */
252 if (*sasr_3393 == WD_AUXILIARY_STATUS) { /* shouldn't retain the write */
253 *sasr_3393 = save_sasr; /* Oops - restore this byte */
254 goto release;
255 }
256 if (*sasr_3393 != q) { /* should still read the same */
257 *sasr_3393 = save_sasr; /* Oops - restore this byte */
258 goto release;
259 }
260 if (*scmd_3393 != q) /* and so should the image at 0x1f */
261 goto release;
262
263 /*
264 * Ok, we probably have a wd33c93, but let's check a few other places
265 * for good measure. Make sure that this works for both 'A and 'B
266 * chip versions.
267 */
268
269 *sasr_3393 = WD_SCSI_STATUS;
270 q = *scmd_3393;
271 *sasr_3393 = WD_SCSI_STATUS;
272 *scmd_3393 = ~q;
273 *sasr_3393 = WD_SCSI_STATUS;
274 qq = *scmd_3393;
275 *sasr_3393 = WD_SCSI_STATUS;
276 *scmd_3393 = q;
277 if (qq != q) /* should be read only */
278 goto release;
279 *sasr_3393 = 0x1e; /* this register is unimplemented */
280 q = *scmd_3393;
281 *sasr_3393 = 0x1e;
282 *scmd_3393 = ~q;
283 *sasr_3393 = 0x1e;
284 qq = *scmd_3393;
285 *sasr_3393 = 0x1e;
286 *scmd_3393 = q;
287 if (qq != q || qq != 0xff) /* should be read only, all 1's */
288 goto release;
289 *sasr_3393 = WD_TIMEOUT_PERIOD;
290 q = *scmd_3393;
291 *sasr_3393 = WD_TIMEOUT_PERIOD;
292 *scmd_3393 = ~q;
293 *sasr_3393 = WD_TIMEOUT_PERIOD;
294 qq = *scmd_3393;
295 *sasr_3393 = WD_TIMEOUT_PERIOD;
296 *scmd_3393 = q;
297 if (qq != (~q & 0xff)) /* should be read/write */
298 goto release;
299#endif
300
301 instance = scsi_register(tpnt, sizeof(struct WD33C93_hostdata));
302 if (instance == NULL)
303 goto release;
304 instance->base = ZTWO_VADDR(address);
305 instance->irq = IRQ_AMIGA_PORTS;
306 instance->unique_id = z->slotaddr;
307
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200308 hdata = shost_priv(instance);
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200309 if (gvp11_xfer_mask)
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200310 hdata->dma_xfer_mask = gvp11_xfer_mask;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200311 else
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200312 hdata->dma_xfer_mask = default_dma_xfer_mask;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200313
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200314 regs = (gvp11_scsiregs *)(instance->base);
315 regs->secret2 = 1;
316 regs->secret1 = 0;
317 regs->secret3 = 15;
318 while (regs->CNTR & GVP11_DMAC_BUSY)
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200319 ;
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200320 regs->CNTR = 0;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200321
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200322 regs->BANK = 0;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200323
324 epc = *(unsigned short *)(ZTWO_VADDR(address) + 0x8000);
325
326 /*
327 * Check for 14MHz SCSI clock
328 */
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200329 wdregs.SASR = &regs->SASR;
330 wdregs.SCMD = &regs->SCMD;
Geert Uytterhoeven52c3d8a2010-04-04 11:00:37 +0200331 hdata->no_sync = 0xff;
332 hdata->fast = 0;
333 hdata->dma_mode = CTRL_DMA;
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200334 wd33c93_init(instance, wdregs, dma_setup, dma_stop,
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200335 (epc & GVP_SCSICLKMASK) ? WD33C93_FS_8_10
336 : WD33C93_FS_12_15);
337
338 if (request_irq(IRQ_AMIGA_PORTS, gvp11_intr, IRQF_SHARED,
339 "GVP11 SCSI", instance))
340 goto unregister;
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200341 regs->CNTR = GVP11_DMAC_INT_ENABLE;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200342 num_gvp11++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343 continue;
344
Geert Uytterhoevend38f47a2009-01-02 11:41:24 +0100345unregister:
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200346 scsi_unregister(instance);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700347release:
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200348 release_mem_region(address, 256);
349 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700350
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200351 return num_gvp11;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352}
353
Henrik Kretzschmar65396412006-09-12 23:49:33 +0200354static int gvp11_bus_reset(struct scsi_cmnd *cmd)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700355{
356 /* FIXME perform bus-specific reset */
Jeff Garzik 68b3aa72005-05-28 07:56:31 -0400357
Jeff Garzik df0ae242005-05-28 07:57:14 -0400358 /* FIXME 2: shouldn't we no-op this function (return
359 FAILED), and fall back to host reset function,
360 wd33c93_host_reset ? */
361
Jeff Garzik 68b3aa72005-05-28 07:56:31 -0400362 spin_lock_irq(cmd->device->host->host_lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700363 wd33c93_host_reset(cmd);
Jeff Garzik 68b3aa72005-05-28 07:56:31 -0400364 spin_unlock_irq(cmd->device->host->host_lock);
365
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366 return SUCCESS;
367}
368
369
370#define HOSTS_C
371
372#include "gvp11.h"
373
Christoph Hellwigd0be4a7d2005-10-31 18:31:40 +0100374static struct scsi_host_template driver_template = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700375 .proc_name = "GVP11",
376 .name = "GVP Series II SCSI",
377 .detect = gvp11_detect,
378 .release = gvp11_release,
379 .queuecommand = wd33c93_queuecommand,
380 .eh_abort_handler = wd33c93_abort,
381 .eh_bus_reset_handler = gvp11_bus_reset,
382 .eh_host_reset_handler = wd33c93_host_reset,
383 .can_queue = CAN_QUEUE,
384 .this_id = 7,
385 .sg_tablesize = SG_ALL,
386 .cmd_per_lun = CMD_PER_LUN,
387 .use_clustering = DISABLE_CLUSTERING
388};
389
390
391#include "scsi_module.c"
392
393int gvp11_release(struct Scsi_Host *instance)
394{
395#ifdef MODULE
Geert Uytterhoeven6869b152009-05-17 12:17:28 +0200396 gvp11_scsiregs *regs = (gvp11_scsiregs *)(instance->base);
397
398 regs->CNTR = 0;
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200399 release_mem_region(ZTWO_PADDR(instance->base), 256);
400 free_irq(IRQ_AMIGA_PORTS, instance);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401#endif
Geert Uytterhoevenbb17b782010-04-04 11:00:33 +0200402 return 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403}
404
405MODULE_LICENSE("GPL");