From owner-acpi-jp@jp.FreeBSD.org Wed Jan 30 02:43:10 2002
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) id g0THhAf52818;
	Wed, 30 Jan 2002 02:43:10 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from mass.dis.org (dhcp45-21.dis.org [216.240.45.21])
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) with ESMTP/inet id g0THh9652813
	for <acpi-jp@jp.FreeBSD.org>; Wed, 30 Jan 2002 02:43:09 +0900 (JST)
	(envelope-from msmith@mass.dis.org)
Received: from mass.dis.org (localhost [127.0.0.1])
	by mass.dis.org (8.11.6/8.11.6) with ESMTP id g0THhNx01383
	for <acpi-jp@jp.FreeBSD.org>; Tue, 29 Jan 2002 09:43:23 -0800 (PST)
	(envelope-from msmith@mass.dis.org)
Message-Id: <200201291743.g0THhNx01383@mass.dis.org>
X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4
To: acpi-jp@jp.FreeBSD.org
In-reply-to: Your message of "Tue, 29 Jan 2002 10:30:05 MST."
             <20020129.103005.85735280.imp@village.org> 
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Tue, 29 Jan 2002 09:43:23 -0800
From: Michael Smith <msmith@freebsd.org>
Reply-To: acpi-jp@jp.FreeBSD.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+011218
X-Sequence: acpi-jp 1569
Subject: [acpi-jp 1569] Re: What this code means? 
Errors-To: owner-acpi-jp@jp.FreeBSD.org
Sender: owner-acpi-jp@jp.FreeBSD.org
X-Originator: msmith@freebsd.org

> In message: <200201291320.WAA16180@shidahara1.planet.sci.kobe-u.ac.jp>
>             Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp> w
> rites:
> : 
> : I have a question about following code in acpi_pcib_route interrupt.
> : 
> :     /* find the bridge softc */
> :     if (devclass_get_devices(acpi_pcib_devclass, &devlist, &devcount))
> :         goto out;
> :     BUS_READ_IVAR(pcib, pcib, PCIB_IVAR_BUS, &up);
> :     bus = up;
> :     sc = NULL;
> :     for (i = 0; i < devcount; i++) {
> :         sc = device_get_softc(*(devlist + i));
> :         if (sc->ap_bus == bus)
> :             break;
> :         sc = NULL;
> :     }
> :     if (sc == NULL)                     /* not one of ours */
> :         goto out;
> :     prtp = sc->ap_prt.Pointer;
> : 
> : Are there any problem with simply device_get_softc(pcib)?
> 
> It looks like it is trying to find the softc of the parent of pcib.

I am constantly confused between "bus" and "bridge", and I have to run in 
a hurry.  If "pcib" is actually a bus and not the bridge device, then 
this makes more sense.


