From owner-freebsd-hackers@FreeBSD.ORG Sat May 20 05:22:26 2006 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.ORG Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B8EEE16A41F for ; Sat, 20 May 2006 05:22:26 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FBED43D45 for ; Sat, 20 May 2006 05:22:26 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [IPv6:::1] (may be forged)) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k4K5K3tm017488; Fri, 19 May 2006 23:20:03 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 19 May 2006 23:20:02 -0600 (MDT) Message-Id: <20060519.232002.71106210.imp@bsdimp.com> To: avalonwallace@gmail.com From: Warner Losh In-Reply-To: <87ab37ab0605192015h363ef74aw23dcc2d97721dea9@mail.gmail.com> References: <87ab37ab0511032030o134b9316j83295dd303e4e44b@mail.gmail.com> <87ab37ab0605192015h363ef74aw23dcc2d97721dea9@mail.gmail.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: misc questions about the device&driver arch X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 May 2006 05:22:26 -0000 > about devclass_find_internal > devclass_find_internal will be called to create a new devclass in > such 2 conditions : > one is creating a new device , as : if (name) { dc = > devclass_find_internal(name, 0, TRUE); > another is in the function:devclass_add_driver. but ,if a driver 's > name is different from the name of any deviceclass in the system ,it > just create a new devclass ,and link it self into the parent > busdevice's driver link and do nothing .what is the use of the driver > at this situation? Busses create devices to represent hardware in the system. The bus then causes these devices to be probed and attached. This latter usage is for those cases. As drivers are loaded these devices are offered to the new (and old) drivers in the system. FreeBSD inherently dynamic in its device system. The hardest part of adding hotplug support is programming the bridge. Adding new devices to the tree is easy, but knowing when to add them is hard since you have to write a bridge driver... Warner