From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 21 Oct 1998 09:42:37 -0400 From: jmk@plan9.bell-labs.com jmk@plan9.bell-labs.com Subject: [9fans] NCR SCSI drivers Topicbox-Message-UUID: 84f07166-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19981021134237.e5KRSaHf9ozExXrYQ0wnkOZwl_5BrGqq8BuykbAHGTY@z> >And then > > scsi0: ncr53c8xx: port 0 irq 0 addr 0 size 0 > >and a config prompt. So it looks like it is scsi.c is calling >the ncr driver's reset, and the ncr driver thinks it succeeded. >However, I'm wondering about all the '0' values -- I don't know >if that is more of the same 'everything hidden by PCI' or not. the plan9 fs driver doesn't fill in any of the ISAConf structure in the reset routine which the calling scsireset() routine prints out. there's no reason it doesn't, just pass the isa pointer to the init() routine too and fill it in there. this is essentially what brazil does because brazil handles multiple controllers and sometimes the port value has to be used to differentiate them Scsiio ncr53c8xxreset(int ctlrno, ISAConf* isa) { int differential, o; Controller *ctlr; static int scandone; if(scandone == 0){ scanpci(); scandone = 1; } differential = 0; for (o = 0; o < isa->nopt; o++) { if (strcmp(isa->opt[o], "diff") == 0) differential = 1; } if((ctlr = xalloc(sizeof(Controller))) == 0){ print("scsi#%d: %s: controller allocation failed\n", ctlrno, isa->type); return 0; } ctlrxx[ctlrno] = ctlr; ctlr->ctlrno = ctlrno; if (init(ctlr, isa, differential)) return exec; return 0; } and init() does stuff like isa->port = (ulong)KADDR(regpa); isa->irq = pcidev->intl; before returning, leading to a message like scsi#0: ncr53c8xx: port 0xE4000000 irq 9 at boot. it's also worth mentioning that in brazil the reset() and exec() routines are the same for both the fileserver and normal kernel, a small victory for maintainability. --jim