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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to