Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/dev/pcmcia Pull up revision 1.37 (requested by haya):



details:   https://anonhg.NetBSD.org/src/rev/4d4ee4ec02eb
branches:  netbsd-1-5
changeset: 493020:4d4ee4ec02eb
user:      he <he%NetBSD.org@localhost>
date:      Thu Mar 28 22:59:30 2002 +0000

description:
Pull up revision 1.37 (requested by haya):
  Search for space to attach 3c562 correctly.

diffstat:

 sys/dev/pcmcia/if_ep_pcmcia.c |  30 ++++++++++++++++++++----------
 1 files changed, 20 insertions(+), 10 deletions(-)

diffs (49 lines):

diff -r 1517f322db17 -r 4d4ee4ec02eb sys/dev/pcmcia/if_ep_pcmcia.c
--- a/sys/dev/pcmcia/if_ep_pcmcia.c     Thu Mar 28 22:55:31 2002 +0000
+++ b/sys/dev/pcmcia/if_ep_pcmcia.c     Thu Mar 28 22:59:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ep_pcmcia.c,v 1.33 2000/05/08 13:53:32 augustss Exp $       */
+/*     $NetBSD: if_ep_pcmcia.c,v 1.33.4.1 2002/03/28 22:59:30 he Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -306,20 +306,30 @@
        }
 
        if (pa->product == PCMCIA_PRODUCT_3COM_3C562) {
-               bus_addr_t maxaddr = pa->pf->sc->iobase + pa->pf->sc->iosize;
+               /*
+                * the 3c562 can only use 0x??00-0x??7f
+                * according to the Linux driver
+                */
 
-               for (i = pa->pf->sc->iobase; i < maxaddr; i += 0x10) {
-                       /*
-                        * the 3c562 can only use 0x??00-0x??7f
-                        * according to the Linux driver
-                        */
-                       if (i & 0x80)
-                               continue;
+               /*
+                * 3c562 i/o may decodes address line not only A0-3
+                * but also A7.  Anyway, we must sweep at most
+                * [0x0000, 0x0100).  The address higher is given by a
+                * pcmcia bridge.  But pcmcia bus-space allocation
+                * function implies cards will decode 10-bit address
+                * line.  So we must search [0x0000, 0x0400).
+                *
+                * XXX: We must not check the bunch of I/O space range
+                * [0x400*n, 0x300 + 0x400*n) because they are
+                * reserved for legacy ISA devices and their alias
+                * images on PC/AT architecture.
+                */
+               for (i = 0x0300; i < 0x0380; i += 0x10) {
                        if (pcmcia_io_alloc(pa->pf, i, cfe->iospace[0].length,
                            0, &psc->sc_pcioh) == 0)
                                break;
                }
-               if (i >= maxaddr) {
+               if (i == 0x0380) {
                        printf(": can't allocate i/o space\n");
                        goto ioalloc_failed;
                }



Home | Main Index | Thread Index | Old Index