From owner-freebsd-hackers Wed Mar 13 0:44: 4 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from cain.gsoft.com.au (genesi.lnk.telstra.net [139.130.136.161]) by hub.freebsd.org (Postfix) with ESMTP id 01F4B37B419 for ; Wed, 13 Mar 2002 00:43:58 -0800 (PST) Received: from localhost (root@localhost [127.0.0.1]) by cain.gsoft.com.au (8.12.2/8.12.2) with ESMTP id g2D8hsF7000655 for ; Wed, 13 Mar 2002 19:13:55 +1030 (CST) (envelope-from doconnor@gsoft.com.au) Subject: PCI read config functions From: "Daniel O'Connor" To: freebsd-hackers@freebsd.org Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/1.0.2 Date: 13 Mar 2002 20:13:54 +1130 Message-Id: <1016009035.1876.72.camel@chowder.gsoft.com.au> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang) 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 Hi, I'm trying to write a driver for a serial card - it is fairly simple, but I'm having trouble with some conversions from the Linux driver :) 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) --- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message