From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 28 17:33:02 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E377C16A4CE for ; Thu, 28 Apr 2005 17:33:02 +0000 (GMT) Received: from kalypso.opteqint.net (kalypso.opteqint.net [160.124.112.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id D424D43D60 for ; Thu, 28 Apr 2005 17:33:00 +0000 (GMT) (envelope-from cole@opteqint.net) Received: from rrba-165-36-21.telkomadsl.co.za ([165.165.36.21] helo=deadmind) by kalypso.opteqint.net with esmtpsa (TLSv1:RC4-MD5:128) (Exim 4.43 (FreeBSD)) id 1DRCsf-000K2s-B1 for freebsd-hackers@freebsd.org; Thu, 28 Apr 2005 19:32:59 +0200 Message-ID: <000901c54c19$3dba2570$4206000a@deadmind> From: "Cole" To: Date: Thu, 28 Apr 2005 19:39:33 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4922.1500 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4939.300 X-Spam-Score: -100.0 (---------------------------------------------------) X-Spam-Report: Spam detection software, running on the system "kalypso.opteqint.net", hasmessagelabel similar future email. If you have any questions, see the administrator of that system for details.driver to FreeBSD code. But im running into a problem. Its using a function that I cant seem to find the equivalent of for FreeBSD. Heres the function up to the point where im getting stuck. [...] Content analysis details: (-100.0 points, 4.2 required) pts rule name description -------------------------------------------------- -100 USER_IN_WHITELIST From: address is in the user's white-list Subject: PCI Programming X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Cole List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2005 17:33:03 -0000 Hey Im currently trying to port some linux pci driver to FreeBSD code. But im running into a problem. Its using a function that I cant seem to find the equivalent of for FreeBSD. Heres the function up to the point where im getting stuck. int FindDevice( void ) { static struct pci_dev *pciptr; int pci_info_index = 0; U16 wDev; unsigned int tmp_addr; /*-----------------------------------------*/ #ifdef CONFIG_PCI // find the specified device and its configuration if( pcibios_present() ){ pci_for_each_dev( pciptr ){ if ((pciptr->vendor == VENDOR_ID) && \ (pciptr->device == DEVICE_ID) && \ (pciptr->subsystem_vendor == SUBSYSTEM_VID) && \ (pciptr->subsystem_device == SUBSYSTEM_DID) && \ (PCI_FUNC(pciptr->devfn) == 0) ) { DevExtension[pci_info_index].wBus= pciptr->bus->number; DevExtension[pci_info_index].wDevFunc= pciptr->devfn; DevExtension[pci_info_index].wCard = pci_info_index; tmp_addr = pci_resource_start( pciptr, 4 ); DevExtension[pci_info_index].func0_bar = (tmp_addr & ~0x03); now the function im getting stuck at, is the "tmp_addr = pci_resource_start(pciptr, 4). I was wondering if anyone knows of an equivalent under FreeBSD. Or if there is a way to obtain that value with some other method in FreeBSD. I am pretty much fine up until that point. If anyone has any sample code or anything that I could read to proceed any further, it would be greatly appreciated. Regards /Cole