Subject: Re: about autoconf
To: Quentin Garnier <netbsd@quatriemek.com>
From: ycchang <ycchang@cirx.org>
List: tech-kern
Date: 09/09/2003 13:13:19
----- Original Message ----- 
From: "Quentin Garnier" <netbsd@quatriemek.com>
To: "anand lalgondar" <anandlalgondar@hotmail.com>
Cc: <tech-kern@NetBSD.org>
Sent: Tuesday, September 09, 2003 12:39 PM
Subject: Re: about autoconf


> Le Tue, 09 Sep 2003 09:01:35 +0530
> anand lalgondar a ecrit :
> > >config_search only searches a matching entry in the autoconf tables for
> > >a given device and related attachment information.
> > Can anyone tell which are the autoconf tables created and how they are
> > classified.
>
> Right now, they're only created by config(8). So there's only one cfdriver
> table and one cfattach table.
>
> The structures are created in ioconf.c, in the kernel build directory.
>
> > >config_found_sm also invokes config_attach, which leads to the call of
> > >the attach function of the device driver, where config_search only uses
> > >match.
> > I assume that attach functions are called only when there is a succesful
> > match for a particular device even in the case of config_found_sm.
>
> Actually, config_attach is called for the best match (the cfattch match
> function that returned the highest value).
>
   what does best match mean? if the we find several children hava the same
parent
, why we just call the attach function for the best math, and the
others?what does the
routine match for?is it relative tothe bus properties, say, PCI or ISA?


> > >isa only calls config_search because it has a very special way of
> > >initializing the attachment information for the device.
> > When is the attach function called in the case of config_search and who
> > is going to make the call.
>
> The uses of config_search I can understand (in dev/isa/ and dev/scsi/) are
> justified if some special action is required before calling the attach
> function. In any other case, config_found_sm is the way to go.
>
any rules of guide?
> config_search doesn't call the attachment function. It is up to the caller
> to do that if it's needed.
>
> --
> Quentin Garnier - cube@cubidou.net
> "Feels like I'm fiddling while Rome is burning down.
> Should I lay my fiddle down and take a rifle from the ground ?"
> Leigh Nash/Sixpence None The Richer, Paralyzed, Divine Discontents, 2002.
>