From owner-freebsd-current Fri Feb 18 9:18:32 2000 Delivered-To: freebsd-current@freebsd.org Received: from p2.acadia.net (p2.acadia.net [205.217.210.2]) by hub.freebsd.org (Postfix) with ESMTP id 9923A37B965 for ; Fri, 18 Feb 2000 09:18:25 -0800 (PST) (envelope-from tbuswell@acadia.net) Received: from smpbox.bogus.net (ip142167011029.acadia.net [142.167.11.29]) by p2.acadia.net (8.9.3/8.9.3) with ESMTP id MAA12690 for ; Fri, 18 Feb 2000 12:19:03 -0500 (EST) Received: (from tbuswell@localhost) by smpbox.bogus.net (8.9.3/8.9.3) id MAA07611; Fri, 18 Feb 2000 12:16:10 -0500 (EST) (envelope-from tbuswell) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 18 Feb 2000 12:16:09 -0500 (EST) To: current@freebsd.org Subject: pccardd and mapping memory descriptors X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14509.31140.445498.751403@localhost.bogus.net> From: tbuswell@acadia.net Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I'm writing a driver that talks to a card that has some SRAM. In the driver I'm trying to get a handle to the memory by doing the following: rid = 0; sc->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0ul, ~0ul, 0, RF_ACTIVE); which fails. Treking through the kernel and userland, I've decided that what's missing is that pccardd never configures the memory region using ioctl(PIOCSMEM). It never does that because the code block in assign_io() that determines that the card does have a memory descriptor, doesn't set the MEM_ASSIGNED bit in sp->flags. I believe setting MEM_ASSIGNED is the proper fix and attached is the one line patch. -Ted PS: anybody know why cardaddr is set to 16k? Index: cardd.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pccard/pccardd/cardd.c,v retrieving revision 1.46 diff -c -r1.46 cardd.c *** cardd.c 2000/01/26 17:53:59 1.46 --- cardd.c 2000/02/18 01:30:25 *************** *** 487,492 **** --- 487,493 ---- sp->config->driver->mem = sp->mem.addr; } sp->mem.cardaddr = 0x4000; + sp->flags |= MEM_ASSIGNED; if (debug_level > 0) { logmsg("Using mem addr 0x%x, size %d, card addr 0x%x\n", sp->mem.addr, sp->mem.size, sp->mem.cardaddr); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message