mac_esp.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. /*
  2. * 68k mac 53c9[46] scsi driver
  3. *
  4. * copyright (c) 1998, David Weis weisd3458@uni.edu
  5. *
  6. * debugging on Quadra 800 and 660AV Michael Schmitz, Dave Kilzer 7/98
  7. *
  8. * based loosely on cyber_esp.c
  9. */
  10. /* these are unused for now */
  11. #define myreadl(addr) (*(volatile unsigned int *) (addr))
  12. #define mywritel(b, addr) ((*(volatile unsigned int *) (addr)) = (b))
  13. #include <linux/kernel.h>
  14. #include <linux/delay.h>
  15. #include <linux/types.h>
  16. #include <linux/ctype.h>
  17. #include <linux/string.h>
  18. #include <linux/slab.h>
  19. #include <linux/blkdev.h>
  20. #include <linux/proc_fs.h>
  21. #include <linux/stat.h>
  22. #include <linux/init.h>
  23. #include <linux/interrupt.h>
  24. #include "scsi.h"
  25. #include <scsi/scsi_host.h>
  26. #include "NCR53C9x.h"
  27. #include <asm/io.h>
  28. #include <asm/setup.h>
  29. #include <asm/irq.h>
  30. #include <asm/macints.h>
  31. #include <asm/machw.h>
  32. #include <asm/mac_via.h>
  33. #include <asm/pgtable.h>
  34. #include <asm/macintosh.h>
  35. /* #define DEBUG_MAC_ESP */
  36. extern void esp_handle(struct NCR_ESP *esp);
  37. extern void mac_esp_intr(int irq, void *dev_id);
  38. static int dma_bytes_sent(struct NCR_ESP * esp, int fifo_count);
  39. static int dma_can_transfer(struct NCR_ESP * esp, Scsi_Cmnd *sp);
  40. static void dma_dump_state(struct NCR_ESP * esp);
  41. static void dma_init_read(struct NCR_ESP * esp, char * vaddress, int length);
  42. static void dma_init_write(struct NCR_ESP * esp, char * vaddress, int length);
  43. static void dma_ints_off(struct NCR_ESP * esp);
  44. static void dma_ints_on(struct NCR_ESP * esp);
  45. static int dma_irq_p(struct NCR_ESP * esp);
  46. static int dma_irq_p_quick(struct NCR_ESP * esp);
  47. static void dma_led_off(struct NCR_ESP * esp);
  48. static void dma_led_on(struct NCR_ESP *esp);
  49. static int dma_ports_p(struct NCR_ESP *esp);
  50. static void dma_setup(struct NCR_ESP * esp, __u32 addr, int count, int write);
  51. static void dma_setup_quick(struct NCR_ESP * esp, __u32 addr, int count, int write);
  52. static int esp_dafb_dma_irq_p(struct NCR_ESP * espdev);
  53. static int esp_iosb_dma_irq_p(struct NCR_ESP * espdev);
  54. static volatile unsigned char cmd_buffer[16];
  55. /* This is where all commands are put
  56. * before they are transferred to the ESP chip
  57. * via PIO.
  58. */
  59. static int esp_initialized = 0;
  60. static int setup_num_esps = -1;
  61. static int setup_disconnect = -1;
  62. static int setup_nosync = -1;
  63. static int setup_can_queue = -1;
  64. static int setup_cmd_per_lun = -1;
  65. static int setup_sg_tablesize = -1;
  66. #ifdef SUPPORT_TAGS
  67. static int setup_use_tagged_queuing = -1;
  68. #endif
  69. static int setup_hostid = -1;
  70. /*
  71. * Experimental ESP inthandler; check macints.c to make sure dev_id is
  72. * set up properly!
  73. */
  74. void mac_esp_intr(int irq, void *dev_id)
  75. {
  76. struct NCR_ESP *esp = (struct NCR_ESP *) dev_id;
  77. int irq_p = 0;
  78. /* Handle the one ESP interrupt showing at this IRQ level. */
  79. if(((esp)->irq & 0xff) == irq) {
  80. /*
  81. * Debug ..
  82. */
  83. irq_p = esp->dma_irq_p(esp);
  84. printk("mac_esp: irq_p %x current %p disconnected %p\n",
  85. irq_p, esp->current_SC, esp->disconnected_SC);
  86. /*
  87. * Mac: if we're here, it's an ESP interrupt for sure!
  88. */
  89. if((esp->current_SC || esp->disconnected_SC)) {
  90. esp->dma_ints_off(esp);
  91. ESPIRQ(("I%d(", esp->esp_id));
  92. esp_handle(esp);
  93. ESPIRQ((")"));
  94. esp->dma_ints_on(esp);
  95. }
  96. }
  97. }
  98. /*
  99. * Debug hooks; use for playing with the interrupt flag testing and interrupt
  100. * acknowledge on the various machines
  101. */
  102. void scsi_esp_polled(int irq, void *dev_id)
  103. {
  104. if (esp_initialized == 0)
  105. return;
  106. mac_esp_intr(irq, dev_id);
  107. }
  108. void fake_intr(int irq, void *dev_id)
  109. {
  110. #ifdef DEBUG_MAC_ESP
  111. printk("mac_esp: got irq\n");
  112. #endif
  113. mac_esp_intr(irq, dev_id);
  114. }
  115. irqreturn_t fake_drq(int irq, void *dev_id)
  116. {
  117. printk("mac_esp: got drq\n");
  118. return IRQ_HANDLED;
  119. }
  120. #define DRIVER_SETUP
  121. /*
  122. * Function : mac_esp_setup(char *str)
  123. *
  124. * Purpose : booter command line initialization of the overrides array,
  125. *
  126. * Inputs : str - parameters, separated by commas.
  127. *
  128. * Currently unused in the new driver; need to add settable parameters to the
  129. * detect function.
  130. *
  131. */
  132. static int __init mac_esp_setup(char *str) {
  133. #ifdef DRIVER_SETUP
  134. /* Format of mac53c9x parameter is:
  135. * mac53c9x=<num_esps>,<disconnect>,<nosync>,<can_queue>,<cmd_per_lun>,<sg_tablesize>,<hostid>,<use_tags>
  136. * Negative values mean don't change.
  137. */
  138. char *this_opt;
  139. long opt;
  140. this_opt = strsep (&str, ",");
  141. if(this_opt) {
  142. opt = simple_strtol( this_opt, NULL, 0 );
  143. if (opt >= 0 && opt <= 2)
  144. setup_num_esps = opt;
  145. else if (opt > 2)
  146. printk( "mac_esp_setup: invalid number of hosts %ld !\n", opt );
  147. this_opt = strsep (&str, ",");
  148. }
  149. if(this_opt) {
  150. opt = simple_strtol( this_opt, NULL, 0 );
  151. if (opt > 0)
  152. setup_disconnect = opt;
  153. this_opt = strsep (&str, ",");
  154. }
  155. if(this_opt) {
  156. opt = simple_strtol( this_opt, NULL, 0 );
  157. if (opt >= 0)
  158. setup_nosync = opt;
  159. this_opt = strsep (&str, ",");
  160. }
  161. if(this_opt) {
  162. opt = simple_strtol( this_opt, NULL, 0 );
  163. if (opt > 0)
  164. setup_can_queue = opt;
  165. this_opt = strsep (&str, ",");
  166. }
  167. if(this_opt) {
  168. opt = simple_strtol( this_opt, NULL, 0 );
  169. if (opt > 0)
  170. setup_cmd_per_lun = opt;
  171. this_opt = strsep (&str, ",");
  172. }
  173. if(this_opt) {
  174. opt = simple_strtol( this_opt, NULL, 0 );
  175. if (opt >= 0) {
  176. setup_sg_tablesize = opt;
  177. /* Must be <= SG_ALL (255) */
  178. if (setup_sg_tablesize > SG_ALL)
  179. setup_sg_tablesize = SG_ALL;
  180. }
  181. this_opt = strsep (&str, ",");
  182. }
  183. if(this_opt) {
  184. opt = simple_strtol( this_opt, NULL, 0 );
  185. /* Must be between 0 and 7 */
  186. if (opt >= 0 && opt <= 7)
  187. setup_hostid = opt;
  188. else if (opt > 7)
  189. printk( "mac_esp_setup: invalid host ID %ld !\n", opt);
  190. this_opt = strsep (&str, ",");
  191. }
  192. #ifdef SUPPORT_TAGS
  193. if(this_opt) {
  194. opt = simple_strtol( this_opt, NULL, 0 );
  195. if (opt >= 0)
  196. setup_use_tagged_queuing = !!opt;
  197. }
  198. #endif
  199. #endif
  200. return 1;
  201. }
  202. __setup("mac53c9x=", mac_esp_setup);
  203. /*
  204. * ESP address 'detection'
  205. */
  206. unsigned long get_base(int chip_num)
  207. {
  208. /*
  209. * using the chip_num and mac model, figure out where the
  210. * chips are mapped
  211. */
  212. unsigned long io_base = 0x50f00000;
  213. unsigned int second_offset = 0x402;
  214. unsigned long scsi_loc = 0;
  215. switch (macintosh_config->scsi_type) {
  216. /* 950, 900, 700 */
  217. case MAC_SCSI_QUADRA2:
  218. scsi_loc = io_base + 0xf000 + ((chip_num == 0) ? 0 : second_offset);
  219. break;
  220. /* av's */
  221. case MAC_SCSI_QUADRA3:
  222. scsi_loc = io_base + 0x18000 + ((chip_num == 0) ? 0 : second_offset);
  223. break;
  224. /* most quadra/centris models are like this */
  225. case MAC_SCSI_QUADRA:
  226. scsi_loc = io_base + 0x10000;
  227. break;
  228. default:
  229. printk("mac_esp: get_base: hit default!\n");
  230. scsi_loc = io_base + 0x10000;
  231. break;
  232. } /* switch */
  233. printk("mac_esp: io base at 0x%lx\n", scsi_loc);
  234. return scsi_loc;
  235. }
  236. /*
  237. * Model dependent ESP setup
  238. */
  239. int mac_esp_detect(struct scsi_host_template * tpnt)
  240. {
  241. int quick = 0;
  242. int chipnum, chipspresent = 0;
  243. #if 0
  244. unsigned long timeout;
  245. #endif
  246. if (esp_initialized > 0)
  247. return -ENODEV;
  248. /* what do we have in this machine... */
  249. if (MACHW_PRESENT(MAC_SCSI_96)) {
  250. chipspresent ++;
  251. }
  252. if (MACHW_PRESENT(MAC_SCSI_96_2)) {
  253. chipspresent ++;
  254. }
  255. /* number of ESPs present ? */
  256. if (setup_num_esps >= 0) {
  257. if (chipspresent >= setup_num_esps)
  258. chipspresent = setup_num_esps;
  259. else
  260. printk("mac_esp_detect: num_hosts detected %d setup %d \n",
  261. chipspresent, setup_num_esps);
  262. }
  263. /* TODO: add disconnect / nosync flags */
  264. /* setup variables */
  265. tpnt->can_queue =
  266. (setup_can_queue > 0) ? setup_can_queue : 7;
  267. tpnt->cmd_per_lun =
  268. (setup_cmd_per_lun > 0) ? setup_cmd_per_lun : 1;
  269. tpnt->sg_tablesize =
  270. (setup_sg_tablesize >= 0) ? setup_sg_tablesize : SG_ALL;
  271. if (setup_hostid >= 0)
  272. tpnt->this_id = setup_hostid;
  273. else {
  274. /* use 7 as default */
  275. tpnt->this_id = 7;
  276. }
  277. #ifdef SUPPORT_TAGS
  278. if (setup_use_tagged_queuing < 0)
  279. setup_use_tagged_queuing = DEFAULT_USE_TAGGED_QUEUING;
  280. #endif
  281. for (chipnum = 0; chipnum < chipspresent; chipnum ++) {
  282. struct NCR_ESP * esp;
  283. esp = esp_allocate(tpnt, NULL, 0);
  284. esp->eregs = (struct ESP_regs *) get_base(chipnum);
  285. esp->dma_irq_p = &esp_dafb_dma_irq_p;
  286. if (chipnum == 0) {
  287. if (macintosh_config->scsi_type == MAC_SCSI_QUADRA) {
  288. /* most machines except those below :-) */
  289. quick = 1;
  290. esp->dma_irq_p = &esp_iosb_dma_irq_p;
  291. } else if (macintosh_config->scsi_type == MAC_SCSI_QUADRA3) {
  292. /* mostly av's */
  293. quick = 0;
  294. } else {
  295. /* q950, 900, 700 */
  296. quick = 1;
  297. out_be32(0xf9800024, 0x1d1);
  298. esp->dregs = (void *) 0xf9800024;
  299. }
  300. } else { /* chipnum */
  301. quick = 1;
  302. out_be32(0xf9800028, 0x1d1);
  303. esp->dregs = (void *) 0xf9800028;
  304. } /* chipnum == 0 */
  305. /* use pio for command bytes; pio for message/data: TBI */
  306. esp->do_pio_cmds = 1;
  307. /* Set the command buffer */
  308. esp->esp_command = (volatile unsigned char*) cmd_buffer;
  309. esp->esp_command_dvma = (__u32) cmd_buffer;
  310. /* various functions */
  311. esp->dma_bytes_sent = &dma_bytes_sent;
  312. esp->dma_can_transfer = &dma_can_transfer;
  313. esp->dma_dump_state = &dma_dump_state;
  314. esp->dma_init_read = NULL;
  315. esp->dma_init_write = NULL;
  316. esp->dma_ints_off = &dma_ints_off;
  317. esp->dma_ints_on = &dma_ints_on;
  318. esp->dma_ports_p = &dma_ports_p;
  319. /* Optional functions */
  320. esp->dma_barrier = NULL;
  321. esp->dma_drain = NULL;
  322. esp->dma_invalidate = NULL;
  323. esp->dma_irq_entry = NULL;
  324. esp->dma_irq_exit = NULL;
  325. esp->dma_led_on = NULL;
  326. esp->dma_led_off = NULL;
  327. esp->dma_poll = NULL;
  328. esp->dma_reset = NULL;
  329. /* SCSI chip speed */
  330. /* below esp->cfreq = 40000000; */
  331. if (quick) {
  332. /* 'quick' means there's handshake glue logic like in the 5380 case */
  333. esp->dma_setup = &dma_setup_quick;
  334. } else {
  335. esp->dma_setup = &dma_setup;
  336. }
  337. if (chipnum == 0) {
  338. esp->irq = IRQ_MAC_SCSI;
  339. request_irq(IRQ_MAC_SCSI, esp_intr, 0, "Mac ESP SCSI", esp->ehost);
  340. #if 0 /* conflicts with IOP ADB */
  341. request_irq(IRQ_MAC_SCSIDRQ, fake_drq, 0, "Mac ESP DRQ", esp->ehost);
  342. #endif
  343. if (macintosh_config->scsi_type == MAC_SCSI_QUADRA) {
  344. esp->cfreq = 16500000;
  345. } else {
  346. esp->cfreq = 25000000;
  347. }
  348. } else { /* chipnum == 1 */
  349. esp->irq = IRQ_MAC_SCSIDRQ;
  350. #if 0 /* conflicts with IOP ADB */
  351. request_irq(IRQ_MAC_SCSIDRQ, esp_intr, 0, "Mac ESP SCSI 2", esp->ehost);
  352. #endif
  353. esp->cfreq = 25000000;
  354. }
  355. if (quick) {
  356. printk("esp: using quick version\n");
  357. }
  358. printk("esp: addr at 0x%p\n", esp->eregs);
  359. esp->scsi_id = 7;
  360. esp->diff = 0;
  361. esp_initialize(esp);
  362. } /* for chipnum */
  363. if (chipspresent)
  364. printk("\nmac_esp: %d esp controllers found\n", chipspresent);
  365. esp_initialized = chipspresent;
  366. return chipspresent;
  367. }
  368. static int mac_esp_release(struct Scsi_Host *shost)
  369. {
  370. if (shost->irq)
  371. free_irq(shost->irq, NULL);
  372. if (shost->io_port && shost->n_io_port)
  373. release_region(shost->io_port, shost->n_io_port);
  374. scsi_unregister(shost);
  375. return 0;
  376. }
  377. /*
  378. * I've been wondering what this is supposed to do, for some time. Talking
  379. * to Allen Briggs: These machines have an extra register someplace where the
  380. * DRQ pin of the ESP can be monitored. That isn't useful for determining
  381. * anything else (such as reselect interrupt or other magic) though.
  382. * Maybe make the semantics should be changed like
  383. * if (esp->current_SC)
  384. * ... check DRQ flag ...
  385. * else
  386. * ... disconnected, check pending VIA interrupt ...
  387. *
  388. * There's a problem with using the dabf flag or mac_irq_pending() here: both
  389. * seem to return 1 even though no interrupt is currently pending, resulting
  390. * in esp_exec_cmd() holding off the next command, and possibly infinite loops
  391. * in esp_intr().
  392. * Short term fix: just use esp_status & ESP_STAT_INTR here, as long as we
  393. * use simple PIO. The DRQ status will be important when implementing pseudo
  394. * DMA mode (set up ESP transfer count, return, do a batch of bytes in PIO or
  395. * 'hardware handshake' mode upon DRQ).
  396. * If you plan on changing this (i.e. to save the esp_status register access in
  397. * favor of a VIA register access or a shadow register for the IFR), make sure
  398. * to try a debug version of this first to monitor what registers would be a good
  399. * indicator of the ESP interrupt.
  400. */
  401. static int esp_dafb_dma_irq_p(struct NCR_ESP * esp)
  402. {
  403. unsigned int ret;
  404. int sreg = esp_read(esp->eregs->esp_status);
  405. #ifdef DEBUG_MAC_ESP
  406. printk("mac_esp: esp_dafb_dma_irq_p dafb %d irq %d\n",
  407. readl(esp->dregs), mac_irq_pending(IRQ_MAC_SCSI));
  408. #endif
  409. sreg &= ESP_STAT_INTR;
  410. /*
  411. * maybe working; this is essentially what's used for iosb_dma_irq_p
  412. */
  413. if (sreg)
  414. return 1;
  415. else
  416. return 0;
  417. /*
  418. * didn't work ...
  419. */
  420. #if 0
  421. if (esp->current_SC)
  422. ret = readl(esp->dregs) & 0x200;
  423. else if (esp->disconnected_SC)
  424. ret = 1; /* sreg ?? */
  425. else
  426. ret = mac_irq_pending(IRQ_MAC_SCSI);
  427. return(ret);
  428. #endif
  429. }
  430. /*
  431. * See above: testing mac_irq_pending always returned 8 (SCSI IRQ) regardless
  432. * of the actual ESP status.
  433. */
  434. static int esp_iosb_dma_irq_p(struct NCR_ESP * esp)
  435. {
  436. int ret = mac_irq_pending(IRQ_MAC_SCSI) || mac_irq_pending(IRQ_MAC_SCSIDRQ);
  437. int sreg = esp_read(esp->eregs->esp_status);
  438. #ifdef DEBUG_MAC_ESP
  439. printk("mac_esp: dma_irq_p drq %d irq %d sreg %x curr %p disc %p\n",
  440. mac_irq_pending(IRQ_MAC_SCSIDRQ), mac_irq_pending(IRQ_MAC_SCSI),
  441. sreg, esp->current_SC, esp->disconnected_SC);
  442. #endif
  443. sreg &= ESP_STAT_INTR;
  444. if (sreg)
  445. return (sreg);
  446. else
  447. return 0;
  448. }
  449. /*
  450. * This seems to be OK for PIO at least ... usually 0 after PIO.
  451. */
  452. static int dma_bytes_sent(struct NCR_ESP * esp, int fifo_count)
  453. {
  454. #ifdef DEBUG_MAC_ESP
  455. printk("mac_esp: dma bytes sent = %x\n", fifo_count);
  456. #endif
  457. return fifo_count;
  458. }
  459. /*
  460. * dma_can_transfer is used to switch between DMA and PIO, if DMA (pseudo)
  461. * is ever implemented. Returning 0 here will use PIO.
  462. */
  463. static int dma_can_transfer(struct NCR_ESP * esp, Scsi_Cmnd * sp)
  464. {
  465. unsigned long sz = sp->SCp.this_residual;
  466. #if 0 /* no DMA yet; make conditional */
  467. if (sz > 0x10000000) {
  468. sz = 0x10000000;
  469. }
  470. printk("mac_esp: dma can transfer = 0lx%x\n", sz);
  471. #else
  472. #ifdef DEBUG_MAC_ESP
  473. printk("mac_esp: pio to transfer = %ld\n", sz);
  474. #endif
  475. sz = 0;
  476. #endif
  477. return sz;
  478. }
  479. /*
  480. * Not yet ...
  481. */
  482. static void dma_dump_state(struct NCR_ESP * esp)
  483. {
  484. #ifdef DEBUG_MAC_ESP
  485. printk("mac_esp: dma_dump_state: called\n");
  486. #endif
  487. #if 0
  488. ESPLOG(("esp%d: dma -- cond_reg<%02x>\n",
  489. esp->esp_id, ((struct mac_dma_registers *)
  490. (esp->dregs))->cond_reg));
  491. #endif
  492. }
  493. /*
  494. * DMA setup: should be used to set up the ESP transfer count for pseudo
  495. * DMA transfers; need a DRQ transfer function to do the actual transfer
  496. */
  497. static void dma_init_read(struct NCR_ESP * esp, char * vaddress, int length)
  498. {
  499. printk("mac_esp: dma_init_read\n");
  500. }
  501. static void dma_init_write(struct NCR_ESP * esp, char * vaddress, int length)
  502. {
  503. printk("mac_esp: dma_init_write\n");
  504. }
  505. static void dma_ints_off(struct NCR_ESP * esp)
  506. {
  507. disable_irq(esp->irq);
  508. }
  509. static void dma_ints_on(struct NCR_ESP * esp)
  510. {
  511. enable_irq(esp->irq);
  512. }
  513. /*
  514. * generic dma_irq_p(), unused
  515. */
  516. static int dma_irq_p(struct NCR_ESP * esp)
  517. {
  518. int i = esp_read(esp->eregs->esp_status);
  519. #ifdef DEBUG_MAC_ESP
  520. printk("mac_esp: dma_irq_p status %d\n", i);
  521. #endif
  522. return (i & ESP_STAT_INTR);
  523. }
  524. static int dma_irq_p_quick(struct NCR_ESP * esp)
  525. {
  526. /*
  527. * Copied from iosb_dma_irq_p()
  528. */
  529. int ret = mac_irq_pending(IRQ_MAC_SCSI) || mac_irq_pending(IRQ_MAC_SCSIDRQ);
  530. int sreg = esp_read(esp->eregs->esp_status);
  531. #ifdef DEBUG_MAC_ESP
  532. printk("mac_esp: dma_irq_p drq %d irq %d sreg %x curr %p disc %p\n",
  533. mac_irq_pending(IRQ_MAC_SCSIDRQ), mac_irq_pending(IRQ_MAC_SCSI),
  534. sreg, esp->current_SC, esp->disconnected_SC);
  535. #endif
  536. sreg &= ESP_STAT_INTR;
  537. if (sreg)
  538. return (sreg);
  539. else
  540. return 0;
  541. }
  542. static void dma_led_off(struct NCR_ESP * esp)
  543. {
  544. #ifdef DEBUG_MAC_ESP
  545. printk("mac_esp: dma_led_off: called\n");
  546. #endif
  547. }
  548. static void dma_led_on(struct NCR_ESP * esp)
  549. {
  550. #ifdef DEBUG_MAC_ESP
  551. printk("mac_esp: dma_led_on: called\n");
  552. #endif
  553. }
  554. static int dma_ports_p(struct NCR_ESP * esp)
  555. {
  556. return 0;
  557. }
  558. static void dma_setup(struct NCR_ESP * esp, __u32 addr, int count, int write)
  559. {
  560. #ifdef DEBUG_MAC_ESP
  561. printk("mac_esp: dma_setup\n");
  562. #endif
  563. if (write) {
  564. dma_init_read(esp, (char *) addr, count);
  565. } else {
  566. dma_init_write(esp, (char *) addr, count);
  567. }
  568. }
  569. static void dma_setup_quick(struct NCR_ESP * esp, __u32 addr, int count, int write)
  570. {
  571. #ifdef DEBUG_MAC_ESP
  572. printk("mac_esp: dma_setup_quick\n");
  573. #endif
  574. }
  575. static struct scsi_host_template driver_template = {
  576. .proc_name = "mac_esp",
  577. .name = "Mac 53C9x SCSI",
  578. .detect = mac_esp_detect,
  579. .slave_alloc = esp_slave_alloc,
  580. .slave_destroy = esp_slave_destroy,
  581. .release = mac_esp_release,
  582. .info = esp_info,
  583. .queuecommand = esp_queue,
  584. .eh_abort_handler = esp_abort,
  585. .eh_bus_reset_handler = esp_reset,
  586. .can_queue = 7,
  587. .this_id = 7,
  588. .sg_tablesize = SG_ALL,
  589. .cmd_per_lun = 1,
  590. .use_clustering = DISABLE_CLUSTERING
  591. };
  592. #include "scsi_module.c"
  593. MODULE_LICENSE("GPL");