From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 21 17:04:39 2005 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 E610616A41F for ; Mon, 21 Nov 2005 17:04:39 +0000 (GMT) (envelope-from fierykylin@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8662143D45 for ; Mon, 21 Nov 2005 17:04:39 +0000 (GMT) (envelope-from fierykylin@gmail.com) Received: by xproxy.gmail.com with SMTP id t12so765983wxc for ; Mon, 21 Nov 2005 09:04:39 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=VF1HOhK5TIDpSSDnzDnN0vtyZehEJU2g+a8i9ugHmDi9zDNrLSio/pYMIuajEOsPNO3AN9so9eJKdSDcybQnfDgGE++UfYp0/VqpUP//ZUTkBBYIyXHPL93kCdAgCRrKQrQNCCXZitvhpNDE7BrXm2n1oXAuL2wkhFQa87QLdng= Received: by 10.70.50.16 with SMTP id x16mr2157969wxx; Mon, 21 Nov 2005 08:07:10 -0800 (PST) Received: by 10.70.18.16 with HTTP; Mon, 21 Nov 2005 08:07:10 -0800 (PST) Message-ID: <87ab37ab0511210807p64282a42i657aeca9ef481e3d@mail.gmail.com> Date: Tue, 22 Nov 2005 00:07:10 +0800 From: kylin To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: sysinit how does nexus find legacy's driver? 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: Mon, 21 Nov 2005 17:04:40 -0000 The nexus_attach(device_t dev) will call int bus_generic_probe(device_t dev) { =09devclass_t dc =3D dev->devclass; =09driverlink_t dl; =09TAILQ_FOREACH(dl, &dc->drivers, link) {//here configure has point out the relation? =09=09DEVICE_IDENTIFY(dl->driver, dev);//here refer to the son's IDENTIFY,make son's device structure =09} =09return (0); } the question is in TAILQ_FOREACH(dl, &dc->drivers, link) how does nexus get legacy's driver in its devclass ? have it done in the SI_SUB_DRIVER part?of initialization? What happen during sSI_SUB_DRIVER ,does devclass for each driver initialize= d? May be the before SI_SUB_CONFIGURE, SI_SUB_DRIVER will first be implement ,and the relative drivers will connect to each other. I am sure that in autoconf.c ,the dl->link does not be add in ,so where does the nexus find legacy? In devclass_find_inernal =09TAILQ_FOREACH(dc, &devclasses, link) { =09=09if (!strcmp(dc->name, classname)) =09=09=09break; =09}found nothing , ////////////////// -- we who r about to die,salute u!