Subject: about autoconf
To: None <tech-kern@netbsd.org>
From: ycchang <ycchang@cirx.org>
List: tech-kern
Date: 09/09/2003 03:49:00
This is a multi-part message in MIME format.

------=_NextPart_000_0208_01C37685.4DB4FA60
Content-Type: text/plain;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

hi!

I am a newbie to NetBSD device driver. I have read the "NetBSD Device =
Driver Writing Guide" from the web site,=20
among which it talks about the autoconfiguration framework  relative to =
device driver.
 My question is what the differences between config_found_sm() and =
config_search(), although it says=20
that there are two cases when integrating a device on a bus : direct =
configuration and indirect configuration,
the former often uses config_found_sm() to find child devices, and =
conversely the later uses config_search(). When I
traced the code in subr_autoconf.c , I found that config_search() is =
just indirecly called by config_found_sm() and it=20
looks likely the same to config_search() .Can anyone  tell me what the =
exact differences between the two functions relative=20
to some common buses ,say, PCI or ISA with the following pseudo device =
tree ?
                                      =20
                                 a
                                 |
                                b
                           /    |    \=20
                         c     d     e
                                       |
                                       f


                                                                         =
                                                               Regards,
                                                                         =
                                                                   =
ycchang
------=_NextPart_000_0208_01C37685.4DB4FA60
Content-Type: text/html;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dbig5">
<META content=3D"MSHTML 6.00.2800.1226" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>
<DIV><FONT size=3D2>hi!</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>I am a newbie to NetBSD device driver. I have read =
the "NetBSD=20
Device Driver Writing Guide" from the web site, </FONT></DIV>
<DIV><FONT size=3D2>among which it talks about&nbsp;the=20
autoconfiguration&nbsp;framework&nbsp;&nbsp;relative to device=20
driver.</FONT></DIV>
<DIV><FONT size=3D2>&nbsp;My question is what the differences between=20
config_found_sm() and config_search(), although it says </FONT></DIV>
<DIV><FONT size=3D2>that there are two cases when integrating a device =
on a bus :=20
direct configuration and indirect configuration,</FONT></DIV>
<DIV><FONT size=3D2>the former often uses config_found_sm() to find =
child devices,=20
and conversely the later uses config_search(). When I</FONT></DIV>
<DIV><FONT size=3D2>traced the code in subr_autoconf.c , I found that=20
config_search() is just indirecly called by config_found_sm() and it=20
</FONT></DIV>
<DIV><FONT size=3D2>looks likely the same to config_search() .Can=20
anyone&nbsp;&nbsp;</FONT><FONT size=3D2>tell me what the exact =
differences between=20
the two functions relative </FONT></DIV>
<DIV><FONT size=3D2>to some common buses ,say, PCI or ISA with the =
following=20
</FONT><FONT size=3D2>pseudo device tree ?</FONT></DIV>
<DIV><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;=20
</FONT></DIV>
<DIV><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
a</FONT></DIV>
<DIV><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;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