From owner-freebsd-hackers Thu Apr 6 13:10:10 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from auemail2.firewall.lucent.com (auemail2.lucent.com [192.11.223.163]) by hub.freebsd.org (Postfix) with ESMTP id 9F1FC37B6A1 for ; Thu, 6 Apr 2000 13:10:02 -0700 (PDT) (envelope-from gcorcoran@lucent.com) Received: from auemail2.firewall.lucent.com (localhost [127.0.0.1]) by auemail2.firewall.lucent.com (Pro-8.9.3/8.9.3) with ESMTP id QAA05029 for ; Thu, 6 Apr 2000 16:09:58 -0400 (EDT) Received: from mhmail.mh.lucent.com (h135-3-115-8.lucent.com [135.3.115.8]) by auemail2.firewall.lucent.com (Pro-8.9.3/8.9.3) with ESMTP id QAA05023; Thu, 6 Apr 2000 16:09:56 -0400 (EDT) Received: from lucent.com by mhmail.mh.lucent.com (8.8.8+Sun/EMS-1.5 sol2) id QAA21849; Thu, 6 Apr 2000 16:09:54 -0400 (EDT) Message-ID: <38ECF00B.CA0AD45B@lucent.com> Date: Thu, 06 Apr 2000 16:14:03 -0400 From: "Gary T. Corcoran" Organization: Lucent Microelectronics - Modem and Multimedia Systems X-Mailer: Mozilla 4.06 [en] (Win98; U) MIME-Version: 1.0 To: Warner Losh Cc: freebsd-hackers@freebsd.org Subject: Re: How to get multiple PCI I/O base addresses in attach()? References: <38EC3755.DA40DEC8@home.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Warner, > rid = 0x10; > res1 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, RF_ACTIVE); ... > should do the trick. Change SYS_RES_MEMORY to SYS_RES_IOPORT if it is > I/O mapped rather than memory mapped. > > In case it wasn't clear, the rid is the offset into the config space > where the BAR register that you want to use is. Multiples of 4 only > need apply. Thanks, that helps. BUT... At first I thought "res1" would be the base address I was looking for. However, it appears (boy I wish this stuff was documented!) that bus_alloc_resource returns a "struct resource *". But I looked and looked and I can't find the definition of what a "struct resource" is. So I'm still in the dark as to how to get my I/O base address from the pointer returned by the bus_alloc_resource. How do I do that? Thanks, Gary -- ========================================================= Gary Corcoran - Distinguished Member of Technical Staff Lucent Microelectronics - Client Access Broadband Systems Communications Protocol & Driver Development Group "We make the drivers that make communications work" Email: gcorcoran@lucent.com --------------------------------------------------------- There are only two kinds of machines - those that fail little by little, and those that fail all at once. ========================================================= To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message