Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Prefer memory mapping over io mapping for this c...



details:   https://anonhg.NetBSD.org/src/rev/83b1d7467fbd
branches:  trunk
changeset: 502031:83b1d7467fbd
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Jan 10 21:41:36 2001 +0000

description:
Prefer memory mapping over io mapping for this card too,
although it doesn't have a chance to work on a no-io system because
of an io based BAR lacking a mem counterpart.

diffstat:

 sys/dev/pci/i4b_elsa_qs1p.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (37 lines):

diff -r 200c5dba018b -r 83b1d7467fbd sys/dev/pci/i4b_elsa_qs1p.c
--- a/sys/dev/pci/i4b_elsa_qs1p.c       Wed Jan 10 21:33:13 2001 +0000
+++ b/sys/dev/pci/i4b_elsa_qs1p.c       Wed Jan 10 21:41:36 2001 +0000
@@ -27,7 +27,7 @@
  *     isic - I4B Siemens ISDN Chipset Driver for ELSA Quickstep 1000pro PCI
  *     =====================================================================
  *
- *     $Id: i4b_elsa_qs1p.c,v 1.1.1.1 2001/01/05 12:50:18 martin Exp $
+ *     $Id: i4b_elsa_qs1p.c,v 1.2 2001/01/10 21:41:36 martin Exp $
  *
  *      last edit-date: [Fri Jan  5 11:38:58 2001]
  *
@@ -103,7 +103,8 @@
 #define ELSA_OFF_ALE           0x00
 #define ELSA_OFF_RW            0x01
 
-#define ELSA_PORT0_MAPOFF      PCI_MAPREG_START+4
+#define ELSA_PORT0_MEM_MAPOFF  PCI_MAPREG_START
+#define ELSA_PORT0_IO_MAPOFF   PCI_MAPREG_START+4
 #define ELSA_PORT1_MAPOFF      PCI_MAPREG_START+12
 
 /*---------------------------------------------------------------------------*
@@ -406,9 +407,11 @@
        sc->sc_num_mappings = 2;
        MALLOC_MAPS(sc);
        sc->sc_maps[0].size = 0;
-       if (pci_mapreg_map(pa, ELSA_PORT0_MAPOFF, PCI_MAPREG_TYPE_IO, 0,
-           &sc->sc_maps[0].t, &sc->sc_maps[0].h, NULL, NULL)) {
-               printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
+       if (pci_mapreg_map(pa, ELSA_PORT0_MEM_MAPOFF, PCI_MAPREG_TYPE_MEM, 0,
+           &sc->sc_maps[0].t, &sc->sc_maps[0].h, NULL, NULL) != 0
+          && pci_mapreg_map(pa, ELSA_PORT0_IO_MAPOFF, PCI_MAPREG_TYPE_IO, 0,
+           &sc->sc_maps[0].t, &sc->sc_maps[0].h, NULL, NULL) != 0) {
+               printf("%s: can't map card registers\n", sc->sc_dev.dv_xname);
                return;
        }
        sc->sc_maps[1].size = 0;



Home | Main Index | Thread Index | Old Index