eesox.c 17 KB

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