Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci if_iwm use unified establish API.



details:   https://anonhg.NetBSD.org/src/rev/1544b5d19906
branches:  trunk
changeset: 338228:1544b5d19906
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Fri May 15 08:44:15 2015 +0000

description:
if_iwm use unified establish API.

diffstat:

 sys/dev/pci/if_iwm.c    |  23 +++++------------------
 sys/dev/pci/if_iwmvar.h |   8 +-------
 2 files changed, 6 insertions(+), 25 deletions(-)

diffs (83 lines):

diff -r 4eaf916a2785 -r 1544b5d19906 sys/dev/pci/if_iwm.c
--- a/sys/dev/pci/if_iwm.c      Fri May 15 08:39:14 2015 +0000
+++ b/sys/dev/pci/if_iwm.c      Fri May 15 08:44:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iwm.c,v 1.32 2015/04/29 03:35:09 nonaka Exp $       */
+/*     $NetBSD: if_iwm.c,v 1.33 2015/05/15 08:44:15 knakahara Exp $    */
 /*     OpenBSD: if_iwm.c,v 1.39 2015/03/23 00:35:19 jsg Exp    */
 
 /*
@@ -105,7 +105,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.32 2015/04/29 03:35:09 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.33 2015/05/15 08:44:15 knakahara Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -6679,14 +6679,10 @@
        }
 
        /* Install interrupt handler. */
-       sc->sc_intr_type = IWM_INTR_INTX;
 #ifdef __HAVE_PCI_MSI_MSIX
        error = ENODEV;
-       if (pci_msi_count(pa) > 0) {
+       if (pci_msi_count(pa) > 0)
                error = pci_msi_alloc_exact(pa, &sc->sc_pihp, 1);
-               if (error == 0)
-                       sc->sc_intr_type = IWM_INTR_MSI;
-       }
        if (error != 0) {
                if (pci_intx_alloc(pa, &sc->sc_pihp)) {
                        aprint_error_dev(self, "can't map interrupt\n");
@@ -6704,17 +6700,8 @@
 #ifdef __HAVE_PCI_MSI_MSIX
        intrstr = pci_intr_string(sc->sc_pct, sc->sc_pihp[0], intrbuf,
            sizeof(intrbuf));
-       switch (sc->sc_intr_type) {
-       case IWM_INTR_MSI:
-               sc->sc_ih = pci_msi_establish(sc->sc_pct, sc->sc_pihp[0],
-                   IPL_NET, iwm_intr, sc);
-               break;
-
-       case IWM_INTR_INTX:
-               sc->sc_ih = pci_intr_establish(sc->sc_pct, sc->sc_pihp[0],
-                   IPL_NET, iwm_intr, sc);
-               break;
-       }
+       sc->sc_ih = pci_intr_establish(sc->sc_pct, sc->sc_pihp[0], IPL_NET,
+           iwm_intr, sc);
 #else  /* !__HAVE_PCI_MSI_MSIX */
        intrstr = pci_intr_string(sc->sc_pct, ih, intrbuf, sizeof(intrbuf));
        sc->sc_ih = pci_intr_establish(sc->sc_pct, ih, IPL_NET, iwm_intr, sc);
diff -r 4eaf916a2785 -r 1544b5d19906 sys/dev/pci/if_iwmvar.h
--- a/sys/dev/pci/if_iwmvar.h   Fri May 15 08:39:14 2015 +0000
+++ b/sys/dev/pci/if_iwmvar.h   Fri May 15 08:44:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iwmvar.h,v 1.6 2015/04/28 15:38:02 nonaka Exp $     */
+/*     $NetBSD: if_iwmvar.h,v 1.7 2015/05/15 08:44:15 knakahara Exp $  */
 /*     OpenBSD: if_iwmvar.h,v 1.7 2015/03/02 13:51:10 jsg Exp  */
 
 /*
@@ -363,11 +363,6 @@
        int last_cqm_event;
 };
 
-enum iwm_intr_type {
-       IWM_INTR_INTX,
-       IWM_INTR_MSI
-};
-
 struct iwm_softc {
        device_t sc_dev;
        struct ethercom sc_ec;
@@ -381,7 +376,6 @@
 
        bus_space_tag_t sc_st;
        bus_space_handle_t sc_sh;
-       enum iwm_intr_type sc_intr_type;
 #ifdef __HAVE_PCI_MSI_MSIX
        pci_intr_handle_t *sc_pihp;
 #endif



Home | Main Index | Thread Index | Old Index