Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Move the size of the mapped bus_space region into th...



details:   https://anonhg.NetBSD.org/src/rev/4233ff371030
branches:  trunk
changeset: 485333:4233ff371030
user:      augustss <augustss%NetBSD.org@localhost>
date:      Tue Apr 25 09:20:54 2000 +0000

description:
Move the size of the mapped bus_space region into the bus independent softc.

diffstat:

 sys/dev/cardbus/ohci_cardbus.c |  11 +++++------
 sys/dev/pci/ohci_pci.c         |  15 +++++++--------
 sys/dev/pci/uhci_pci.c         |  15 +++++++--------
 sys/dev/usb/ohcivar.h          |   3 ++-
 sys/dev/usb/uhcivar.h          |   3 ++-
 5 files changed, 23 insertions(+), 24 deletions(-)

diffs (164 lines):

diff -r 54c0dad1fa3b -r 4233ff371030 sys/dev/cardbus/ohci_cardbus.c
--- a/sys/dev/cardbus/ohci_cardbus.c    Tue Apr 25 08:56:06 2000 +0000
+++ b/sys/dev/cardbus/ohci_cardbus.c    Tue Apr 25 09:20:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci_cardbus.c,v 1.5 2000/03/07 00:32:52 mycroft Exp $ */
+/*     $NetBSD: ohci_cardbus.c,v 1.6 2000/04/25 09:20:54 augustss Exp $        */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -77,7 +77,6 @@
        cardbus_chipset_tag_t   sc_cc;
        cardbus_function_tag_t  sc_cf;
        cardbus_devfunc_t       sc_ct;
-       bus_size_t              sc_size;
        void                    *sc_ih;         /* interrupt vectoring */
 };
 
@@ -130,7 +129,7 @@
 
        /* Map I/O registers */
        if (Cardbus_mapreg_map(ct, CARDBUS_CBMEM, CARDBUS_MAPREG_TYPE_MEM, 0,
-                          &sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc_size)) {
+                          &sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
                printf("%s: can't map mem space\n", devname);
                return;
        }
@@ -208,10 +207,10 @@
                cardbus_intr_disestablish(sc->sc_cc, sc->sc_cf, sc->sc_ih);
                sc->sc_ih = NULL;
        }
-       if (sc->sc_size) {
+       if (sc->sc.sc_size) {
                Cardbus_mapreg_unmap(ct, CARDBUS_CBMEM, sc->sc.iot,
-                   sc->sc.ioh, sc->sc_size);
-               sc->sc_size = 0;
+                   sc->sc.ioh, sc->sc.sc_size);
+               sc->sc.sc_size = 0;
        }
        return (0);
 }
diff -r 54c0dad1fa3b -r 4233ff371030 sys/dev/pci/ohci_pci.c
--- a/sys/dev/pci/ohci_pci.c    Tue Apr 25 08:56:06 2000 +0000
+++ b/sys/dev/pci/ohci_pci.c    Tue Apr 25 09:20:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci_pci.c,v 1.14 1999/10/12 11:21:24 augustss Exp $   */
+/*     $NetBSD: ohci_pci.c,v 1.15 2000/04/25 09:20:55 augustss Exp $   */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -70,7 +70,6 @@
 struct ohci_pci_softc {
        ohci_softc_t            sc;
        pci_chipset_tag_t       sc_pc;
-       bus_size_t              sc_size;
        void                    *sc_ih;         /* interrupt vectoring */
 };
 
@@ -117,7 +116,7 @@
 
        /* Map I/O registers */
        if (pci_mapreg_map(pa, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0,
-                          &sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc_size)) {
+                          &sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
                printf("%s: can't map mem space\n", devname);
                return;
        }
@@ -183,13 +182,13 @@
        rv = ohci_detach(&sc->sc, flags);
        if (rv)
                return (rv);
-       if (sc->sc_ih) {
+       if (sc->sc_ih != NULL) {
                pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
-               sc->sc_ih = 0;
+               sc->sc_ih = NULL;
        }
-       if (sc->sc_size) {
-               bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc_size);
-               sc->sc_size = 0;
+       if (sc->sc.sc_size) {
+               bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size);
+               sc->sc.sc_size = 0;
        }
        return (0);
 }
diff -r 54c0dad1fa3b -r 4233ff371030 sys/dev/pci/uhci_pci.c
--- a/sys/dev/pci/uhci_pci.c    Tue Apr 25 08:56:06 2000 +0000
+++ b/sys/dev/pci/uhci_pci.c    Tue Apr 25 09:20:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci_pci.c,v 1.14 2000/01/25 11:26:06 augustss Exp $   */
+/*     $NetBSD: uhci_pci.c,v 1.15 2000/04/25 09:20:55 augustss Exp $   */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -63,7 +63,6 @@
 struct uhci_pci_softc {
        uhci_softc_t            sc;
        pci_chipset_tag_t       sc_pc;
-       bus_size_t              sc_size;
        void                    *sc_ih;         /* interrupt vectoring */
 };
 
@@ -110,7 +109,7 @@
 
        /* Map I/O registers */
        if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
-                          &sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc_size)) {
+                          &sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
                printf("%s: can't map i/o space\n", devname);
                return;
        }
@@ -197,13 +196,13 @@
        rv = uhci_detach(&sc->sc, flags);
        if (rv)
                return (rv);
-       if (sc->sc_ih) {
+       if (sc->sc_ih != NULL) {
                pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
-               sc->sc_ih = 0;
+               sc->sc_ih = NULL;
        }
-       if (sc->sc_size) {
-               bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc_size);
-               sc->sc_size = 0;
+       if (sc->sc.sc_size) {
+               bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size);
+               sc->sc.sc_size = 0;
        }
        return (0);
 }
diff -r 54c0dad1fa3b -r 4233ff371030 sys/dev/usb/ohcivar.h
--- a/sys/dev/usb/ohcivar.h     Tue Apr 25 08:56:06 2000 +0000
+++ b/sys/dev/usb/ohcivar.h     Tue Apr 25 09:20:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohcivar.h,v 1.21 2000/03/29 01:46:27 augustss Exp $    */
+/*     $NetBSD: ohcivar.h,v 1.22 2000/04/25 09:20:55 augustss Exp $    */
 /*     $FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.13 1999/11/17 22:33:41 n_hibma Exp $    */
 
 /*
@@ -87,6 +87,7 @@
        struct usbd_bus sc_bus;         /* base device */
        bus_space_tag_t iot;
        bus_space_handle_t ioh;
+       bus_size_t sc_size;
 
        usb_dma_t sc_hccadma;
        struct ohci_hcca *sc_hcca;
diff -r 54c0dad1fa3b -r 4233ff371030 sys/dev/usb/uhcivar.h
--- a/sys/dev/usb/uhcivar.h     Tue Apr 25 08:56:06 2000 +0000
+++ b/sys/dev/usb/uhcivar.h     Tue Apr 25 09:20:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhcivar.h,v 1.28 2000/04/06 23:44:21 augustss Exp $    */
+/*     $NetBSD: uhcivar.h,v 1.29 2000/04/25 09:20:55 augustss Exp $    */
 /*     $FreeBSD: src/sys/dev/usb/uhcivar.h,v 1.14 1999/11/17 22:33:42 n_hibma Exp $    */
 
 /*
@@ -134,6 +134,7 @@
        struct usbd_bus sc_bus;         /* base device */
        bus_space_tag_t iot;
        bus_space_handle_t ioh;
+       bus_size_t sc_size;
 
        uhci_physaddr_t *sc_pframes;
        usb_dma_t sc_dma;



Home | Main Index | Thread Index | Old Index