From owner-freebsd-hackers Mon May 8 13:31:54 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 9D3ED37B822 for ; Mon, 8 May 2000 13:31:46 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id OAA45537; Mon, 8 May 2000 14:31:42 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id OAA79569; Mon, 8 May 2000 14:31:27 -0600 (MDT) Message-Id: <200005082031.OAA79569@harmony.village.org> To: Duncan Barclay Subject: Re: Getting an aligned IO port Cc: freebsd-hackers@FreeBSD.ORG In-reply-to: Your message of "Mon, 08 May 2000 18:31:32 BST." References: Date: Mon, 08 May 2000 14:31:27 -0600 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message Duncan Barclay writes: : How can get a 16byte aligned ISA IO port from the resource allocator? I need : this to get if_xe working for Realport cards. : : This aspect of the driver is nothing to do with Warner's changes to PCCard. I'm going to have to commit the byte alignment stuff that was posted a while ago committed. Until then, you request 16 bytes from the system for the ioports. Since this is pccard, you'll likely want to map it in the 0x100 - 0x3ff range: start = 0x100; end = 0x3ff; rid = 1; /* 0 is managed by pccardd */ do { res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, start, end, 16, RF_ACTIVE); if (res == 0) break; /* we failed */ if ((rman_get_start(res) & 0xf) == 0) break; /* good */ start = (rman_get_start(res) + 15) & ~0xf; } while (1); Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message