From owner-freebsd-hackers Sat Jan 20 16:35:47 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from moby.geekhouse.net (moby.geekhouse.net [64.81.6.36]) by hub.freebsd.org (Postfix) with ESMTP id 8431537B400 for ; Sat, 20 Jan 2001 16:35:24 -0800 (PST) Received: from laptop.baldwin.cx (john@dhcp150.geekhouse.net [192.168.1.150]) by moby.geekhouse.net (8.11.0/8.9.3) with ESMTP id f0L0dWs76230; Sat, 20 Jan 2001 16:39:32 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20010120192739.A2127@cae88-102-101.sc.rr.com> Date: Sat, 20 Jan 2001 16:35:11 -0800 (PST) From: John Baldwin To: "Donald J . Maddox" Subject: Re: more info about: odd result of pci_read_config Cc: freebsd-hackers@FreeBSD.org, Nicolas Souchu Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 21-Jan-01 Donald J . Maddox wrote: > Heh, this is pretty wierd :) > > I was intrigued by your little problem, so I started looking around. > In sys/dev/pci/pciar.h is: > > static __inline u_int32_t > pci_read_config(device_t dev, int reg, int width) > { > return PCI_READ_CONFIG(device_get_parent(dev), dev, reg, width); > } > > However, this is the only occurence of the string "PCI_READ_CONFIG" > that I can find in the whole damn source tree! Where is this defined? 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