Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Sep 1999 13:40:12 -0700 (PDT)
From:      Julian Elischer <julian@whistle.com>
To:        Poul-Henning Kamp <phk@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:    devsw registration (modules/newbus/etc.)
Message-ID:  <Pine.BSF.3.95.990920133114.6309F-100000@current1.whistle.com>
In-Reply-To: <199909201958.MAA44112@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help


On Mon, 20 Sep 1999, Poul-Henning Kamp wrote:

> phk         1999/09/20 12:58:38 PDT
[...]
>   
>   Register devsw in *attach instead of a SYSINIT.


I have doubts as to whether this is the right thing to do..

I think it should be set in the inti routine that is called from the
module startup. In the case of compiled in code it's the SYSINIT code (in
fact in the case of a Module it's also the SUSINIT code come to think of
it..) 

I think that Attach() is in the wrong scope to do this without a "have we
done the devsw entry already" test.

I've noticed you doing this in several drivers and I have felt the same
whaty about them there as well. 

I put the registration of the driver in the SYSINIT code because that's
where I believe it belongs.. 

I believe we need to have a quick discussion between the kernel module
folks, and the other interested parties (e.g. new-bus people)  and make a
quick decision as to where the right place for a devide driver to register
itself is..

I'm willing to listen to reasons but at present I think this is moving in
exactly the wrong direction.. (I want more going INTO that function and
less in the attach(). Attach() is per instance, whereas the driver
init routine is once per driver instalation. 

You might also want to return errors to the user if it can't register
itself for some reason. (on module load).



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.990920133114.6309F-100000>