Subject: RE: Can pseudo-devices be parents?
To: 'Manuel Bouyer' <bouyer@antioche.lip6.fr>
From: Ferrari, Stephen <smf@pirus.com>
List: tech-kern
Date: 01/10/2001 15:53:43
Yep, I guess that would work.  Another dirty solution is what I'm doing =
now:
My pseudo-device attach routine has code like this in it:

	for (cf =3D cfdata; cf->cf_driver; cf++) {
		if (cf->cf_fstate =3D=3D FSTATE_FOUND)
			continue;
		if (cf->cf_attach =3D=3D &scsibus_ca) {
			config_attach((void *)softc, cf, &softc->link,
scsiprint);
		}=20

Definitely not pretty but it works, as long as the config has some =
other,
real device with a scsibus attached to it.
=20
I looked at the hack that I mentioned in my original mail, of making my
device a non-pseudo-device at root so it could have a child, but that =
didn't
pan out.  I see that config allows multiple "at root" devices to be
declared, but the configure() routines for all the architectures seem =
to
call config_rootfound for only hardcoded busses, mostly mainbus.  I was
hoping that they would walk through cfroots and call config_rootfound =
for
_all_ the roots, which for most configurations is probably just =
mainbus.
From my na=EFve viewpoint, that would eliminate the benefit of =
pseudo-devices
that I know about, namely that they don't need hardware to cause them =
to be
discovered.  Oh well.

Thanks for the confirmation,

	Stephen


 -----Original Message-----
From: 	Manuel Bouyer [mailto:bouyer@antioche.lip6.fr]=20
Sent:	Wednesday, January 10, 2001 2:50 PM
To:	Lennart Augustsson
Cc:	Ferrari, Stephen; 'BSD Kernel'
Subject:	Re: Can pseudo-devices be parents?

On Tue, Jan 09, 2001 at 09:11:29PM -0500, Lennart Augustsson wrote:
> I had a similar problem.  As far as I could determine a pseudo-device
> cannot be a parent.  It is indeed yucky.  I never solved my problem,
> so if you figure out a way I'm interested.

A dirty way of doing this could be to write a e.g. isa driver which =
attaches
at an address nobody uses, with a dummy match function.

--
Manuel Bouyer <bouyer@antioche.eu.org>
--