eesox.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. /*
  2. * linux/drivers/acorn/scsi/eesox.c
  3. *
  4. * Copyright (C) 1997-2005 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * This driver is based on experimentation. Hence, it may have made
  11. * assumptions about the particular card that I have available, and
  12. * may not be reliable!
  13. *
  14. * Changelog:
  15. * 01-10-1997 RMK Created, READONLY version
  16. * 15-02-1998 RMK READ/WRITE version
  17. * added DMA support and hardware definitions
  18. * 14-03-1998 RMK Updated DMA support
  19. * Added terminator control
  20. * 15-04-1998 RMK Only do PIO if FAS216 will allow it.
  21. * 27-06-1998 RMK Changed asm/delay.h to linux/delay.h
  22. * 02-04-2000 RMK 0.0.3 Fixed NO_IRQ/NO_DMA problem, updated for new
  23. * error handling code.
  24. */
  25. #include <linux/module.h>
  26. #include <linux/blkdev.h>
  27. #include <linux/kernel.h>
  28. #include <linux/string.h>
  29. #include <linux/ioport.h>
  30. #include <linux/sched.h>
  31. #include <linux/proc_fs.h>
  32. #include <linux/delay.h>
  33. #include <linux/interrupt.h>
  34. #include <linux/init.h>
  35. #include <linux/dma-mapping.h>
  36. #include <asm/io.h>
  37. #include <asm/irq.h>
  38. #include <asm/dma.h>
  39. #include <asm/ecard.h>
  40. #include <asm/pgtable.h>
  41. #include "../scsi.h"
  42. #include <scsi/scsi_host.h>
  43. #include "fas216.h"
  44. #include "scsi.h"
  45. #include <scsi/scsicam.h>
  46. #define EESOX_FAS216_OFFSET 0x3000
  47. #define EESOX_FAS216_SHIFT 5
  48. #define EESOX_DMASTAT 0x2800
  49. #define EESOX_STAT_INTR 0x01
  50. #define EESOX_STAT_DMA 0x02
  51. #define EESOX_CONTROL 0x2800
  52. #define EESOX_INTR_ENABLE 0x04
  53. #define EESOX_TERM_ENABLE 0x02
  54. #define EESOX_RESET 0x01
  55. #define EESOX_DMADATA 0x3800
  56. #define VERSION "1.10 (17/01/2003 2.5.59)"
  57. /*
  58. * Use term=0,1,0,0,0 to turn terminators on/off
  59. */
  60. static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 };
  61. #define NR_SG 256
  62. struct eesoxscsi_info {
  63. FAS216_Info info;
  64. struct expansion_card *ec;
  65. void __iomem *base;
  66. void __iomem *ctl_port;
  67. unsigned int control;
  68. struct scatterlist sg[NR_SG]; /* Scatter DMA list */
  69. };
  70. /* Prototype: void eesoxscsi_irqenable(ec, irqnr)
  71. * Purpose : Enable interrupts on EESOX SCSI card
  72. * Params : ec - expansion card structure
  73. * : irqnr - interrupt number
  74. */
  75. static void
  76. eesoxscsi_irqenable(struct expansion_card *ec, int irqnr)
  77. {
  78. struct eesoxscsi_info *info = (struct eesoxscsi_info *)ec->irq_data;
  79. info->control |= EESOX_INTR_ENABLE;
  80. writeb(info->control, info->ctl_port);
  81. }
  82. /* Prototype: void eesoxscsi_irqdisable(ec, irqnr)
  83. * Purpose : Disable interrupts on EESOX SCSI card
  84. * Params : ec - expansion card structure
  85. * : irqnr - interrupt number
  86. */
  87. static void
  88. eesoxscsi_irqdisable(struct expansion_card *ec, int irqnr)
  89. {
  90. struct eesoxscsi_info *info = (struct eesoxscsi_info *)ec->irq_data;
  91. info->control &= ~EESOX_INTR_ENABLE;
  92. writeb(info->control, info->ctl_port);
  93. }
  94. static const expansioncard_ops_t eesoxscsi_ops = {
  95. .irqenable = eesoxscsi_irqenable,
  96. .irqdisable = eesoxscsi_irqdisable,
  97. };
  98. /* Prototype: void eesoxscsi_terminator_ctl(*host, on_off)
  99. * Purpose : Turn the EESOX SCSI terminators on or off
  100. * Params : host - card to turn on/off
  101. * : on_off - !0 to turn on, 0 to turn off
  102. */
  103. static void
  104. eesoxscsi_terminator_ctl(struct Scsi_Host *host, int on_off)
  105. {
  106. struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
  107. unsigned long flags;
  108. spin_lock_irqsave(host->host_lock, flags);
  109. if (on_off)
  110. info->control |= EESOX_TERM_ENABLE;
  111. else
  112. info->control &= ~EESOX_TERM_ENABLE;
  113. writeb(info->control, info->ctl_port);
  114. spin_unlock_irqrestore(host->host_lock, flags);
  115. }
  116. /* Prototype: void eesoxscsi_intr(irq, *dev_id, *regs)
  117. * Purpose : handle interrupts from EESOX SCSI card
  118. * Params : irq - interrupt number
  119. * dev_id - user-defined (Scsi_Host structure)
  120. * regs - processor registers at interrupt
  121. */
  122. static irqreturn_t
  123. eesoxscsi_intr(int irq, void *dev_id, struct pt_regs *regs)
  124. {
  125. struct eesoxscsi_info *info = dev_id;
  126. return fas216_intr(&info->info);
  127. }
  128. /* Prototype: fasdmatype_t eesoxscsi_dma_setup(host, SCpnt, direction, min_type)
  129. * Purpose : initialises DMA/PIO
  130. * Params : host - host
  131. * SCpnt - command
  132. * direction - DMA on to/off of card
  133. * min_type - minimum DMA support that we must have for this transfer
  134. * Returns : type of transfer to be performed
  135. */
  136. static fasdmatype_t
  137. eesoxscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
  138. fasdmadir_t direction, fasdmatype_t min_type)
  139. {
  140. struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
  141. struct device *dev = scsi_get_device(host);
  142. int dmach = info->info.scsi.dma;
  143. if (dmach != NO_DMA &&
  144. (min_type == fasdma_real_all || SCp->this_residual >= 512)) {
  145. int bufs, map_dir, dma_dir;
  146. bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG);
  147. if (direction == DMA_OUT)
  148. map_dir = DMA_TO_DEVICE,
  149. dma_dir = DMA_MODE_WRITE;
  150. else
  151. map_dir = DMA_FROM_DEVICE,
  152. dma_dir = DMA_MODE_READ;
  153. dma_map_sg(dev, info->sg, bufs + 1, map_dir);
  154. disable_dma(dmach);
  155. set_dma_sg(dmach, info->sg, bufs + 1);
  156. set_dma_mode(dmach, dma_dir);
  157. enable_dma(dmach);
  158. return fasdma_real_all;
  159. }
  160. /*
  161. * We don't do DMA, we only do slow PIO
  162. *
  163. * Some day, we will do Pseudo DMA
  164. */
  165. return fasdma_pseudo;
  166. }
  167. static void eesoxscsi_buffer_in(void *buf, int length, void __iomem *base)
  168. {
  169. const void __iomem *reg_fas = base + EESOX_FAS216_OFFSET;
  170. const void __iomem *reg_dmastat = base + EESOX_DMASTAT;
  171. const void __iomem *reg_dmadata = base + EESOX_DMADATA;
  172. const register unsigned long mask = 0xffff;
  173. do {
  174. unsigned int status;
  175. /*
  176. * Interrupt request?
  177. */
  178. status = readb(reg_fas + (REG_STAT << EESOX_FAS216_SHIFT));
  179. if (status & STAT_INT)
  180. break;
  181. /*
  182. * DMA request active?
  183. */
  184. status = readb(reg_dmastat);
  185. if (!(status & EESOX_STAT_DMA))
  186. continue;
  187. /*
  188. * Get number of bytes in FIFO
  189. */
  190. status = readb(reg_fas + (REG_CFIS << EESOX_FAS216_SHIFT)) & CFIS_CF;
  191. if (status > 16)
  192. status = 16;
  193. if (status > length)
  194. status = length;
  195. /*
  196. * Align buffer.
  197. */
  198. if (((u32)buf) & 2 && status >= 2) {
  199. *(u16 *)buf = readl(reg_dmadata);
  200. buf += 2;
  201. status -= 2;
  202. length -= 2;
  203. }
  204. if (status >= 8) {
  205. unsigned long l1, l2;
  206. l1 = readl(reg_dmadata) & mask;
  207. l1 |= readl(reg_dmadata) << 16;
  208. l2 = readl(reg_dmadata) & mask;
  209. l2 |= readl(reg_dmadata) << 16;
  210. *(u32 *)buf = l1;
  211. buf += 4;
  212. *(u32 *)buf = l2;
  213. buf += 4;
  214. length -= 8;
  215. continue;
  216. }
  217. if (status >= 4) {
  218. unsigned long l1;
  219. l1 = readl(reg_dmadata) & mask;
  220. l1 |= readl(reg_dmadata) << 16;
  221. *(u32 *)buf = l1;
  222. buf += 4;
  223. length -= 4;
  224. continue;
  225. }
  226. if (status >= 2) {
  227. *(u16 *)buf = readl(reg_dmadata);
  228. buf += 2;
  229. length -= 2;
  230. }
  231. } while (length);
  232. }
  233. static void eesoxscsi_buffer_out(void *buf, int length, void __iomem *base)
  234. {
  235. const void __iomem *reg_fas = base + EESOX_FAS216_OFFSET;
  236. const void __iomem *reg_dmastat = base + EESOX_DMASTAT;
  237. const void __iomem *reg_dmadata = base + EESOX_DMADATA;
  238. do {
  239. unsigned int status;
  240. /*
  241. * Interrupt request?
  242. */
  243. status = readb(reg_fas + (REG_STAT << EESOX_FAS216_SHIFT));
  244. if (status & STAT_INT)
  245. break;
  246. /*
  247. * DMA request active?
  248. */
  249. status = readb(reg_dmastat);
  250. if (!(status & EESOX_STAT_DMA))
  251. continue;
  252. /*
  253. * Get number of bytes in FIFO
  254. */
  255. status = readb(reg_fas + (REG_CFIS << EESOX_FAS216_SHIFT)) & CFIS_CF;
  256. if (status > 16)
  257. status = 16;
  258. status = 16 - status;
  259. if (status > length)
  260. status = length;
  261. status &= ~1;
  262. /*
  263. * Align buffer.
  264. */
  265. if (((u32)buf) & 2 && status >= 2) {
  266. writel(*(u16 *)buf << 16, reg_dmadata);
  267. buf += 2;
  268. status -= 2;
  269. length -= 2;
  270. }
  271. if (status >= 8) {
  272. unsigned long l1, l2;
  273. l1 = *(u32 *)buf;
  274. buf += 4;
  275. l2 = *(u32 *)buf;
  276. buf += 4;
  277. writel(l1 << 16, reg_dmadata);
  278. writel(l1, reg_dmadata);
  279. writel(l2 << 16, reg_dmadata);
  280. writel(l2, reg_dmadata);
  281. length -= 8;
  282. continue;
  283. }
  284. if (status >= 4) {
  285. unsigned long l1;
  286. l1 = *(u32 *)buf;
  287. buf += 4;
  288. writel(l1 << 16, reg_dmadata);
  289. writel(l1, reg_dmadata);
  290. length -= 4;
  291. continue;
  292. }
  293. if (status >= 2) {
  294. writel(*(u16 *)buf << 16, reg_dmadata);
  295. buf += 2;
  296. length -= 2;
  297. }
  298. } while (length);
  299. }
  300. static void
  301. eesoxscsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
  302. fasdmadir_t dir, int transfer_size)
  303. {
  304. struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
  305. if (dir == DMA_IN) {
  306. eesoxscsi_buffer_in(SCp->ptr, SCp->this_residual, info->base);
  307. } else {
  308. eesoxscsi_buffer_out(SCp->ptr, SCp->this_residual, info->base);
  309. }
  310. }
  311. /* Prototype: int eesoxscsi_dma_stop(host, SCpnt)
  312. * Purpose : stops DMA/PIO
  313. * Params : host - host
  314. * SCpnt - command
  315. */
  316. static void
  317. eesoxscsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp)
  318. {
  319. struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
  320. if (info->info.scsi.dma != NO_DMA)
  321. disable_dma(info->info.scsi.dma);
  322. }
  323. /* Prototype: const char *eesoxscsi_info(struct Scsi_Host * host)
  324. * Purpose : returns a descriptive string about this interface,
  325. * Params : host - driver host structure to return info for.
  326. * Returns : pointer to a static buffer containing null terminated string.
  327. */
  328. const char *eesoxscsi_info(struct Scsi_Host *host)
  329. {
  330. struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
  331. static char string[150];
  332. sprintf(string, "%s (%s) in slot %d v%s terminators o%s",
  333. host->hostt->name, info->info.scsi.type, info->ec->slot_no,
  334. VERSION, info->control & EESOX_TERM_ENABLE ? "n" : "ff");
  335. return string;
  336. }
  337. /* Prototype: int eesoxscsi_set_proc_info(struct Scsi_Host *host, char *buffer, int length)
  338. * Purpose : Set a driver specific function
  339. * Params : host - host to setup
  340. * : buffer - buffer containing string describing operation
  341. * : length - length of string
  342. * Returns : -EINVAL, or 0
  343. */
  344. static int
  345. eesoxscsi_set_proc_info(struct Scsi_Host *host, char *buffer, int length)
  346. {
  347. int ret = length;
  348. if (length >= 9 && strncmp(buffer, "EESOXSCSI", 9) == 0) {
  349. buffer += 9;
  350. length -= 9;
  351. if (length >= 5 && strncmp(buffer, "term=", 5) == 0) {
  352. if (buffer[5] == '1')
  353. eesoxscsi_terminator_ctl(host, 1);
  354. else if (buffer[5] == '0')
  355. eesoxscsi_terminator_ctl(host, 0);
  356. else
  357. ret = -EINVAL;
  358. } else
  359. ret = -EINVAL;
  360. } else
  361. ret = -EINVAL;
  362. return ret;
  363. }
  364. /* Prototype: int eesoxscsi_proc_info(char *buffer, char **start, off_t offset,
  365. * int length, int host_no, int inout)
  366. * Purpose : Return information about the driver to a user process accessing
  367. * the /proc filesystem.
  368. * Params : buffer - a buffer to write information to
  369. * start - a pointer into this buffer set by this routine to the start
  370. * of the required information.
  371. * offset - offset into information that we have read upto.
  372. * length - length of buffer
  373. * host_no - host number to return information for
  374. * inout - 0 for reading, 1 for writing.
  375. * Returns : length of data written to buffer.
  376. */
  377. int eesoxscsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,
  378. int length, int inout)
  379. {
  380. struct eesoxscsi_info *info;
  381. char *p = buffer;
  382. int pos;
  383. if (inout == 1)
  384. return eesoxscsi_set_proc_info(host, buffer, length);
  385. info = (struct eesoxscsi_info *)host->hostdata;
  386. p += sprintf(p, "EESOX SCSI driver v%s\n", VERSION);
  387. p += fas216_print_host(&info->info, p);
  388. p += sprintf(p, "Term : o%s\n",
  389. info->control & EESOX_TERM_ENABLE ? "n" : "ff");
  390. p += fas216_print_stats(&info->info, p);
  391. p += fas216_print_devices(&info->info, p);
  392. *start = buffer + offset;
  393. pos = p - buffer - offset;
  394. if (pos > length)
  395. pos = length;
  396. return pos;
  397. }
  398. static ssize_t eesoxscsi_show_term(struct device *dev, struct device_attribute *attr, char *buf)
  399. {
  400. struct expansion_card *ec = ECARD_DEV(dev);
  401. struct Scsi_Host *host = ecard_get_drvdata(ec);
  402. struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
  403. return sprintf(buf, "%d\n", info->control & EESOX_TERM_ENABLE ? 1 : 0);
  404. }
  405. static ssize_t eesoxscsi_store_term(struct device *dev, struct device_attribute *attr, const char *buf, size_t len)
  406. {
  407. struct expansion_card *ec = ECARD_DEV(dev);
  408. struct Scsi_Host *host = ecard_get_drvdata(ec);
  409. struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
  410. unsigned long flags;
  411. if (len > 1) {
  412. spin_lock_irqsave(host->host_lock, flags);
  413. if (buf[0] != '0') {
  414. info->control |= EESOX_TERM_ENABLE;
  415. } else {
  416. info->control &= ~EESOX_TERM_ENABLE;
  417. }
  418. writeb(info->control, info->ctl_port);
  419. spin_unlock_irqrestore(host->host_lock, flags);
  420. }
  421. return len;
  422. }
  423. static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR,
  424. eesoxscsi_show_term, eesoxscsi_store_term);
  425. static Scsi_Host_Template eesox_template = {
  426. .module = THIS_MODULE,
  427. .proc_info = eesoxscsi_proc_info,
  428. .name = "EESOX SCSI",
  429. .info = eesoxscsi_info,
  430. .queuecommand = fas216_queue_command,
  431. .eh_host_reset_handler = fas216_eh_host_reset,
  432. .eh_bus_reset_handler = fas216_eh_bus_reset,
  433. .eh_device_reset_handler = fas216_eh_device_reset,
  434. .eh_abort_handler = fas216_eh_abort,
  435. .can_queue = 1,
  436. .this_id = 7,
  437. .sg_tablesize = SG_ALL,
  438. .cmd_per_lun = 1,
  439. .use_clustering = DISABLE_CLUSTERING,
  440. .proc_name = "eesox",
  441. };
  442. static int __devinit
  443. eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
  444. {
  445. struct Scsi_Host *host;
  446. struct eesoxscsi_info *info;
  447. unsigned long resbase, reslen;
  448. void __iomem *base;
  449. int ret;
  450. ret = ecard_request_resources(ec);
  451. if (ret)
  452. goto out;
  453. resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST);
  454. reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST);
  455. base = ioremap(resbase, reslen);
  456. if (!base) {
  457. ret = -ENOMEM;
  458. goto out_region;
  459. }
  460. host = scsi_host_alloc(&eesox_template,
  461. sizeof(struct eesoxscsi_info));
  462. if (!host) {
  463. ret = -ENOMEM;
  464. goto out_unmap;
  465. }
  466. ecard_set_drvdata(ec, host);
  467. info = (struct eesoxscsi_info *)host->hostdata;
  468. info->ec = ec;
  469. info->base = base;
  470. info->ctl_port = base + EESOX_CONTROL;
  471. info->control = term[ec->slot_no] ? EESOX_TERM_ENABLE : 0;
  472. writeb(info->control, info->ctl_port);
  473. info->info.scsi.io_base = base + EESOX_FAS216_OFFSET;
  474. info->info.scsi.io_shift = EESOX_FAS216_SHIFT;
  475. info->info.scsi.irq = ec->irq;
  476. info->info.scsi.dma = ec->dma;
  477. info->info.ifcfg.clockrate = 40; /* MHz */
  478. info->info.ifcfg.select_timeout = 255;
  479. info->info.ifcfg.asyncperiod = 200; /* ns */
  480. info->info.ifcfg.sync_max_depth = 7;
  481. info->info.ifcfg.cntl3 = CNTL3_FASTSCSI | CNTL3_FASTCLK;
  482. info->info.ifcfg.disconnect_ok = 1;
  483. info->info.ifcfg.wide_max_size = 0;
  484. info->info.ifcfg.capabilities = FASCAP_PSEUDODMA;
  485. info->info.dma.setup = eesoxscsi_dma_setup;
  486. info->info.dma.pseudo = eesoxscsi_dma_pseudo;
  487. info->info.dma.stop = eesoxscsi_dma_stop;
  488. ec->irqaddr = base + EESOX_DMASTAT;
  489. ec->irqmask = EESOX_STAT_INTR;
  490. ec->irq_data = info;
  491. ec->ops = &eesoxscsi_ops;
  492. device_create_file(&ec->dev, &dev_attr_bus_term);
  493. ret = fas216_init(host);
  494. if (ret)
  495. goto out_free;
  496. ret = request_irq(ec->irq, eesoxscsi_intr, 0, "eesoxscsi", info);
  497. if (ret) {
  498. printk("scsi%d: IRQ%d not free: %d\n",
  499. host->host_no, ec->irq, ret);
  500. goto out_remove;
  501. }
  502. if (info->info.scsi.dma != NO_DMA) {
  503. if (request_dma(info->info.scsi.dma, "eesox")) {
  504. printk("scsi%d: DMA%d not free, DMA disabled\n",
  505. host->host_no, info->info.scsi.dma);
  506. info->info.scsi.dma = NO_DMA;
  507. } else {
  508. set_dma_speed(info->info.scsi.dma, 180);
  509. info->info.ifcfg.capabilities |= FASCAP_DMA;
  510. info->info.ifcfg.cntl3 |= CNTL3_BS8;
  511. }
  512. }
  513. ret = fas216_add(host, &ec->dev);
  514. if (ret == 0)
  515. goto out;
  516. if (info->info.scsi.dma != NO_DMA)
  517. free_dma(info->info.scsi.dma);
  518. free_irq(ec->irq, host);
  519. out_remove:
  520. fas216_remove(host);
  521. out_free:
  522. device_remove_file(&ec->dev, &dev_attr_bus_term);
  523. scsi_host_put(host);
  524. out_unmap:
  525. iounmap(base);
  526. out_region:
  527. ecard_release_resources(ec);
  528. out:
  529. return ret;
  530. }
  531. static void __devexit eesoxscsi_remove(struct expansion_card *ec)
  532. {
  533. struct Scsi_Host *host = ecard_get_drvdata(ec);
  534. struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
  535. ecard_set_drvdata(ec, NULL);
  536. fas216_remove(host);
  537. if (info->info.scsi.dma != NO_DMA)
  538. free_dma(info->info.scsi.dma);
  539. free_irq(ec->irq, info);
  540. device_remove_file(&ec->dev, &dev_attr_bus_term);
  541. iounmap(info->base);
  542. fas216_release(host);
  543. scsi_host_put(host);
  544. ecard_release_resources(ec);
  545. }
  546. static const struct ecard_id eesoxscsi_cids[] = {
  547. { MANU_EESOX, PROD_EESOX_SCSI2 },
  548. { 0xffff, 0xffff },
  549. };
  550. static struct ecard_driver eesoxscsi_driver = {
  551. .probe = eesoxscsi_probe,
  552. .remove = __devexit_p(eesoxscsi_remove),
  553. .id_table = eesoxscsi_cids,
  554. .drv = {
  555. .name = "eesoxscsi",
  556. },
  557. };
  558. static int __init eesox_init(void)
  559. {
  560. return ecard_register_driver(&eesoxscsi_driver);
  561. }
  562. static void __exit eesox_exit(void)
  563. {
  564. ecard_remove_driver(&eesoxscsi_driver);
  565. }
  566. module_init(eesox_init);
  567. module_exit(eesox_exit);
  568. MODULE_AUTHOR("Russell King");
  569. MODULE_DESCRIPTION("EESOX 'Fast' SCSI driver for Acorn machines");
  570. MODULE_PARM(term, "1-8i");
  571. MODULE_PARM_DESC(term, "SCSI bus termination");
  572. MODULE_LICENSE("GPL");