Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jan 2001 08:34:31 -0000 (GMT)
From:      Duncan Barclay <dmlb@dmlb.org>
To:        mobile@freebsd.org, onoe@freebsd.org
Subject:   memory mapped io for Aironet driver.
Message-ID:  <XFMail.010110083431.dmlb@computer.my.domain>

next in thread | raw e-mail | index | archive | help
Hello all

Can someone with an aironet card running -current see if this patch to
/sys/dev/awi/if_awi_pccard.c works? This should enable memory mapped operation.

Duncan

Index: if_awi_pccard.c
===================================================================
RCS file: /steer/ncvs/src/sys/dev/awi/if_awi_pccard.c,v
retrieving revision 1.5
diff -u -r1.5 if_awi_pccard.c
--- if_awi_pccard.c     2000/10/15 14:18:05     1.5
+++ if_awi_pccard.c     2001/01/10 08:31:17
@@ -139,19 +139,19 @@
        }
 
        psc->sc_mem_rid = 0;
-#if 1
-       /*
-        * XXX: awi needs to access memory with 8bit,
-        * but pccardd apparently maps memory with MDF_16BITS flag.
-        * So memory mapped access is disabled and use IO port instead.
-        */
-       psc->sc_mem_res = 0;
-#else
        psc->sc_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
            &psc->sc_mem_rid, 0, ~0, 0x8000, RF_ACTIVE);
-#endif
        if (psc->sc_mem_res) {
+               error = CARD_SET_MEMORY_OFFSET(device_get_parent(sc->dev),
+                   sc->dev, sc->cm_rid, 0, NULL);
+                if (error)
+                       device_printf("awi_pccard_attach: adjusting memory offse
t failed\n");
+                error = CARD_SET_RES_FLAGS(device_get_parent(sc->dev), sc->dev,
+                    SYS_RES_MEMORY, sc->cm_rid, 2);
+                if (error)
+                       device_printf("awi_pccard_attach: setting 8bit memory fa
iled\n");
                sc->sc_chip.sc_memt = rman_get_bustag(psc->sc_mem_res);
+ 
                sc->sc_chip.sc_memh = rman_get_bushandle(psc->sc_mem_res);
                am79c930_chip_init(&sc->sc_chip, 1);
        } else

---
________________________________________________________________________
Duncan Barclay  | God smiles upon the little children,
dmlb@dmlb.org   | the alcoholics, and the permanently stoned.
dmlb@freebsd.org| Steven King


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010110083431.dmlb>