From owner-freebsd-hackers Wed Mar 13 22:42:11 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 4426A37B419 for ; Wed, 13 Mar 2002 22:42:00 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id g2E6fxi34327; Wed, 13 Mar 2002 23:41:59 -0700 (MST) (envelope-from imp@village.org) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id g2E6fwL46929; Wed, 13 Mar 2002 23:41:58 -0700 (MST) (envelope-from imp@village.org) Date: Wed, 13 Mar 2002 23:41:39 -0700 (MST) Message-Id: <20020313.234139.40854153.imp@village.org> To: doconnor@gsoft.com.au Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: PCI read config functions From: "M. Warner Losh" In-Reply-To: <1016009035.1876.72.camel@chowder.gsoft.com.au> References: <1016009035.1876.72.camel@chowder.gsoft.com.au> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <1016009035.1876.72.camel@chowder.gsoft.com.au> "Daniel O'Connor" writes: : In the Linux driver there is stuff like -> : if ((rc = pcibios_read_config_byte(bus, dev_fn, PCI_DC_SIO_PORT, : &nport)) != PCIBIOS_SUCCESSFUL) break; : : And I think the equiv would be -> : tmp = pci_read_config(dev, PCI_DC_SIO_PORT, /*bytes*/1); : printf("pccom: number of ports - %d\n", tmp); : : : However this just ends up printing 0. : : (PCI_DC_SIO_PORT is 0x2f) Do you have the right dev? bcr = pci_read_config(sp->sc->dev, CB_PCI_BRIDGE_CTRL, 2); is what I use in the pccard bridge pci driver and it works. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message