Subject: Re: about autoconf
To: anand lalgondar <anandlalgondar@hotmail.com>
From: Quentin Garnier <netbsd@quatriemek.com>
List: tech-kern
Date: 09/09/2003 06:39:39
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).

> >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.

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.