9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: jmk@plan9.bell-labs.com jmk@plan9.bell-labs.com
Subject: [9fans] NCR SCSI drivers
Date: Wed, 21 Oct 1998 09:42:37 -0400	[thread overview]
Message-ID: <19981021134237.e5KRSaHf9ozExXrYQ0wnkOZwl_5BrGqq8BuykbAHGTY@z> (raw)

	>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




             reply	other threads:[~1998-10-21 13:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-21 13:42 jmk [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-10-21  9:29 James
1998-10-20 20:47 James
1998-10-19 22:03 ngr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19981021134237.e5KRSaHf9ozExXrYQ0wnkOZwl_5BrGqq8BuykbAHGTY@z \
    --to=jmk@plan9.bell-labs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).