From owner-freebsd-hackers Sat Jan 20 16:40:46 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail5.sc.rr.com (fe5.southeast.rr.com [24.93.67.52]) by hub.freebsd.org (Postfix) with ESMTP id 91F3937B402; Sat, 20 Jan 2001 16:40:28 -0800 (PST) Received: from sc.rr.com ([24.88.102.101]) by mail5.sc.rr.com with Microsoft SMTPSVC(5.5.1877.537.53); Sat, 20 Jan 2001 19:40:21 -0500 Received: (from dmaddox@localhost) by sc.rr.com (8.11.1/8.11.1) id f0L0fJ704370; Sat, 20 Jan 2001 19:41:19 -0500 (EST) (envelope-from dmaddox) Date: Sat, 20 Jan 2001 19:41:19 -0500 From: "Donald J . Maddox" To: John Baldwin Cc: "Donald J . Maddox" , freebsd-hackers@FreeBSD.org, Nicolas Souchu Subject: Re: more info about: odd result of pci_read_config Message-ID: <20010120194119.A2547@cae88-102-101.sc.rr.com> Reply-To: dmaddox@sc.rr.com Mail-Followup-To: John Baldwin , "Donald J . Maddox" , freebsd-hackers@FreeBSD.org, Nicolas Souchu References: <20010120192739.A2127@cae88-102-101.sc.rr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from jhb@FreeBSD.org on Sat, Jan 20, 2001 at 04:35:11PM -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Thanks for clearing that one up :) I feel a lot better now :) Now - do you understand why Nicolas' code always returns 0x6? ;-) 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); > } > > This calls pcib_read_config in the PCI bus driver: > > DEVMETHOD(pcib_read_config, nexus_pcib_read_config), > > nexus_pcib_read_config(device_t dev, int bus, int slot, int func, > int reg, int bytes) > { > return(pci_cfgregread(bus, slot, func, reg, bytes)); > } > > -- > > John Baldwin -- http://www.FreeBSD.org/~jhb/ > PGP Key: http://www.baldwin.cx/~john/pgpkey.asc > "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message