From owner-freebsd-hackers Mon Jan 22 1:59:38 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp3.ev1.net (smtpout.ev1.net [207.218.192.47]) by hub.freebsd.org (Postfix) with ESMTP id 9108837B400; Mon, 22 Jan 2001 01:59:20 -0800 (PST) Received: from max [207.218.204.137] by smtp3.ev1.net (SMTPD32-6.05) id A48499C90110; Mon, 22 Jan 2001 03:59:32 -0600 Reply-To: From: "Steve Shoecraft" To: "'Nicolas Souchu'" , "'John Baldwin'" Cc: "'Donald J . Maddox'" , Subject: RE: more info about: odd result of pci_read_config Date: Mon, 22 Jan 2001 04:05:31 -0600 Message-ID: <001301c0845a$db047780$89ccdacf@max.home.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <20010121111903.B10148@ontario.alcove-int> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Importance: Normal Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > -----Original Message----- > From: owner-freebsd-hackers@FreeBSD.ORG > [mailto:owner-freebsd-hackers@FreeBSD.ORG]On Behalf Of Nicolas Souchu > Sent: Sunday, January 21, 2001 4:19 AM > To: John Baldwin > Cc: Donald J . Maddox; freebsd-hackers@FreeBSD.org > Subject: Re: more info about: odd result of pci_read_config > > > On Sat, Jan 20, 2001 at 04:35:11PM -0800, John Baldwin wrote: > > Look in /sys/compile/ after compiling a kernel, it > should be in pci_if.* > > It's a function that ues kobj to lookup the pci_read_config > method in the > > parent bus. Look in the PCI code to find the real > pci_read_config... > > > > >From sys/dev/pci/pci.c: > > > > DEVMETHOD(pci_read_config, pci_read_config_method), > > > > static u_int32_t > > pci_read_config_method(device_t dev, device_t child, int > reg, int width) > > { > > struct pci_devinfo *dinfo = device_get_ivars(child); > > pcicfgregs *cfg = &dinfo->cfg; > > > > return PCIB_READ_CONFIG(device_get_parent(dev), > > cfg->bus, cfg->slot, cfg->func, > > reg, width); > > } > > On -stable, it calls directly pci_cfgread() with the cfg. > > My viapm driver is a kmodule. Could it be that PCI_READ_CONFIG is not > correctly resolved and returns ENXIO which is 0x6? That's exactly whats going on here. Have you turned on BUS_DEBUG (or mebbe DEBUG_BUS) in /kern/subr_bus.c ? Also, I have a userland app that loads and runs your kernel module - it makes it alot easier to debug this kinda stuff. Even does device file I/O. If you want, you can check it out. > > I'll try to wire it in the kernel. > > Nicholas > > -- > Nicolas.Souchu@alcove.fr > Alcôve - Open Source Software Engineer - http://www.alcove.fr > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message