From owner-cvs-all Mon Sep 20 13:40:46 1999 Delivered-To: cvs-all@freebsd.org Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (Postfix) with ESMTP id D716915AFE; Mon, 20 Sep 1999 13:40:15 -0700 (PDT) (envelope-from julian@whistle.com) Received: from current1.whistle.com (current1.whistle.com [207.76.205.22]) by alpo.whistle.com (8.9.1a/8.9.1) with SMTP id NAA82074; Mon, 20 Sep 1999 13:40:14 -0700 (PDT) Date: Mon, 20 Sep 1999 13:40:12 -0700 (PDT) From: Julian Elischer To: Poul-Henning Kamp Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: devsw registration (modules/newbus/etc.) In-Reply-To: <199909201958.MAA44112@freefall.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk 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