Module Name: src
Committed By: nonaka
Date: Fri Nov 6 14:22:17 UTC 2015
Modified Files:
src/sys/dev/pci: if_iwm.c if_iwmvar.h if_rtwn.c if_rtwnreg.h rtsx_pci.c
Log Message:
Always use pci_intr_alloc(9)/pci_intr_release(9).
To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pci/if_iwm.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/if_iwmvar.h
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/if_rtwn.c \
src/sys/dev/pci/if_rtwnreg.h
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/rtsx_pci.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/if_iwm.c
diff -u src/sys/dev/pci/if_iwm.c:1.38 src/sys/dev/pci/if_iwm.c:1.39
--- src/sys/dev/pci/if_iwm.c:1.38 Wed Oct 14 02:16:51 2015
+++ src/sys/dev/pci/if_iwm.c Fri Nov 6 14:22:17 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iwm.c,v 1.38 2015/10/14 02:16:51 ozaki-r Exp $ */
+/* $NetBSD: if_iwm.c,v 1.39 2015/11/06 14:22:17 nonaka Exp $ */
/* OpenBSD: if_iwm.c,v 1.41 2015/05/22 06:50:54 kettenis Exp */
/*
@@ -105,7 +105,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.38 2015/10/14 02:16:51 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.39 2015/11/06 14:22:17 nonaka Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -6603,9 +6603,6 @@ iwm_attach(device_t parent, device_t sel
struct pci_attach_args *pa = aux;
struct ieee80211com *ic = &sc->sc_ic;
struct ifnet *ifp = &sc->sc_ec.ec_if;
-#ifndef __HAVE_PCI_MSI_MSIX
- pci_intr_handle_t ih;
-#endif
pcireg_t reg, memtype;
char intrbuf[PCI_INTRSTR_LEN];
const char *intrstr;
@@ -6655,7 +6652,6 @@ iwm_attach(device_t parent, device_t sel
}
/* Install interrupt handler. */
-#ifdef __HAVE_PCI_MSI_MSIX
error = pci_intr_alloc(pa, &sc->sc_pihp, NULL, 0);
if (error != 0) {
aprint_error_dev(self, "can't allocate interrupt\n");
@@ -6665,14 +6661,6 @@ iwm_attach(device_t parent, device_t sel
sizeof(intrbuf));
sc->sc_ih = pci_intr_establish(sc->sc_pct, sc->sc_pihp[0], IPL_NET,
iwm_intr, sc);
-#else /* !__HAVE_PCI_MSI_MSIX */
- if (pci_intr_map(pa, &ih)) {
- aprint_error_dev(self, "can't map interrupt\n");
- return;
- }
- 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);
-#endif /* __HAVE_PCI_MSI_MSIX */
if (sc->sc_ih == NULL) {
aprint_error_dev(self, "can't establish interrupt");
if (intrstr != NULL)
Index: src/sys/dev/pci/if_iwmvar.h
diff -u src/sys/dev/pci/if_iwmvar.h:1.8 src/sys/dev/pci/if_iwmvar.h:1.9
--- src/sys/dev/pci/if_iwmvar.h:1.8 Wed Jul 22 15:18:01 2015
+++ src/sys/dev/pci/if_iwmvar.h Fri Nov 6 14:22:17 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iwmvar.h,v 1.8 2015/07/22 15:18:01 nonaka Exp $ */
+/* $NetBSD: if_iwmvar.h,v 1.9 2015/11/06 14:22:17 nonaka Exp $ */
/* OpenBSD: if_iwmvar.h,v 1.7 2015/03/02 13:51:10 jsg Exp */
/*
@@ -377,9 +377,7 @@ struct iwm_softc {
bus_space_tag_t sc_st;
bus_space_handle_t sc_sh;
-#ifdef __HAVE_PCI_MSI_MSIX
pci_intr_handle_t *sc_pihp;
-#endif
bus_size_t sc_sz;
bus_dma_tag_t sc_dmat;
Index: src/sys/dev/pci/if_rtwn.c
diff -u src/sys/dev/pci/if_rtwn.c:1.1 src/sys/dev/pci/if_rtwn.c:1.2
--- src/sys/dev/pci/if_rtwn.c:1.1 Thu Aug 27 14:04:08 2015
+++ src/sys/dev/pci/if_rtwn.c Fri Nov 6 14:22:17 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: if_rtwn.c,v 1.1 2015/08/27 14:04:08 nonaka Exp $ */
+/* $NetBSD: if_rtwn.c,v 1.2 2015/11/06 14:22:17 nonaka Exp $ */
/* $OpenBSD: if_rtwn.c,v 1.5 2015/06/14 08:02:47 stsp Exp $ */
#define IEEE80211_NO_HT
/*-
@@ -23,7 +23,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rtwn.c,v 1.1 2015/08/27 14:04:08 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rtwn.c,v 1.2 2015/11/06 14:22:17 nonaka Exp $");
#include <sys/param.h>
#include <sys/sockio.h>
@@ -213,9 +213,6 @@ rtwn_attach(device_t parent, device_t se
struct ifnet *ifp = GET_IFP(sc);
int i, error;
pcireg_t memtype;
-#ifndef __HAVE_PCI_MSI_MSIX
- pci_intr_handle_t ih;
-#endif
const char *intrstr;
char intrbuf[PCI_INTRSTR_LEN];
@@ -246,7 +243,6 @@ rtwn_attach(device_t parent, device_t se
}
/* Install interrupt handler. */
-#ifdef __HAVE_PCI_MSI_MSIX
if (pci_intr_alloc(pa, &sc->sc_pihp, NULL, 0)) {
aprint_error_dev(self, "can't map interrupt\n");
return;
@@ -255,14 +251,6 @@ rtwn_attach(device_t parent, device_t se
sizeof(intrbuf));
sc->sc_ih = pci_intr_establish(sc->sc_pc, sc->sc_pihp[0], IPL_NET,
rtwn_intr, sc);
-#else /* !__HAVE_PCI_MSI_MSIX */
- if (pci_intr_map(pa, &ih)) {
- aprint_error_dev(self, "can't map interrupt\n");
- return;
- }
- intrstr = pci_intr_string(sc->sc_pc, ih, intrbuf, sizeof(intrbuf));
- sc->sc_ih = pci_intr_establish(sc->sc_pc, ih, IPL_NET, rtwn_intr, sc);
-#endif /* __HAVE_PCI_MSI_MSIX */
if (sc->sc_ih == NULL) {
aprint_error_dev(self, "can't establish interrupt");
if (intrstr != NULL)
@@ -436,9 +424,7 @@ rtwn_detach(device_t self, int flags)
if (sc->sc_ih != NULL) {
pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
-#ifdef __HAVE_PCI_MSI_MSIX
pci_intr_release(sc->sc_pc, sc->sc_pihp, 1);
-#endif
}
pmf_device_deregister(self);
Index: src/sys/dev/pci/if_rtwnreg.h
diff -u src/sys/dev/pci/if_rtwnreg.h:1.1 src/sys/dev/pci/if_rtwnreg.h:1.2
--- src/sys/dev/pci/if_rtwnreg.h:1.1 Thu Aug 27 14:04:08 2015
+++ src/sys/dev/pci/if_rtwnreg.h Fri Nov 6 14:22:17 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: if_rtwnreg.h,v 1.1 2015/08/27 14:04:08 nonaka Exp $ */
+/* $NetBSD: if_rtwnreg.h,v 1.2 2015/11/06 14:22:17 nonaka Exp $ */
/* $OpenBSD: if_rtwnreg.h,v 1.3 2015/06/14 08:02:47 stsp Exp $ */
/*-
@@ -1280,9 +1280,7 @@ struct rtwn_softc {
pci_chipset_tag_t sc_pc;
pcitag_t sc_tag;
void *sc_ih;
-#ifdef __HAVE_PCI_MSI_MSIX
pci_intr_handle_t *sc_pihp;
-#endif
bus_space_tag_t sc_st;
bus_space_handle_t sc_sh;
bus_size_t sc_mapsize;
Index: src/sys/dev/pci/rtsx_pci.c
diff -u src/sys/dev/pci/rtsx_pci.c:1.4 src/sys/dev/pci/rtsx_pci.c:1.5
--- src/sys/dev/pci/rtsx_pci.c:1.4 Sat Sep 5 04:56:53 2015
+++ src/sys/dev/pci/rtsx_pci.c Fri Nov 6 14:22:17 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: rtsx_pci.c,v 1.4 2015/09/05 04:56:53 nonaka Exp $ */
+/* $NetBSD: rtsx_pci.c,v 1.5 2015/11/06 14:22:17 nonaka Exp $ */
/* $OpenBSD: rtsx_pci.c,v 1.7 2014/08/19 17:55:03 phessler Exp $ */
@@ -20,7 +20,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsx_pci.c,v 1.4 2015/09/05 04:56:53 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsx_pci.c,v 1.5 2015/11/06 14:22:17 nonaka Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -43,9 +43,7 @@ struct rtsx_pci_softc {
pci_chipset_tag_t sc_pc;
void *sc_ih;
-#ifdef __HAVE_PCI_MSI_MSIX
pci_intr_handle_t *sc_pihp;
-#endif
};
static int rtsx_pci_match(device_t , cfdata_t, void *);
@@ -96,9 +94,6 @@ rtsx_pci_attach(device_t parent, device_
struct pci_attach_args *pa = (struct pci_attach_args *)aux;
pci_chipset_tag_t pc = pa->pa_pc;
pcitag_t tag = pa->pa_tag;
-#ifndef __HAVE_PCI_MSI_MSIX
- pci_intr_handle_t ih;
-#endif
pcireg_t reg;
char const *intrstr;
bus_space_tag_t iot;
@@ -123,7 +118,6 @@ rtsx_pci_attach(device_t parent, device_
return;
}
-#ifdef __HAVE_PCI_MSI_MSIX
if (pci_intr_alloc(pa, &sc->sc_pihp, NULL, 0)) {
aprint_error_dev(self, "couldn't map interrupt\n");
return;
@@ -131,14 +125,6 @@ rtsx_pci_attach(device_t parent, device_
intrstr = pci_intr_string(pc, sc->sc_pihp[0], intrbuf, sizeof(intrbuf));
sc->sc_ih = pci_intr_establish(pc, sc->sc_pihp[0], IPL_SDMMC, rtsx_intr,
&sc->sc);
-#else /* !__HAVE_PCI_MSI_MSIX */
- if (pci_intr_map(pa, &ih)) {
- aprint_error_dev(self, "couldn't map interrupt\n");
- return;
- }
- intrstr = pci_intr_string(pc, ih, intrbuf, sizeof(intrbuf));
- sc->sc_ih = pci_intr_establish(pc, ih, IPL_SDMMC, rtsx_intr, &sc->sc);
-#endif /* __HAVE_PCI_MSI_MSIX */
if (sc->sc_ih == NULL) {
aprint_error_dev(self, "couldn't establish interrupt\n");
return;
@@ -198,9 +184,7 @@ rtsx_pci_detach(device_t self, int flags
return rv;
pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
-#ifdef __HAVE_PCI_MSI_MSIX
pci_intr_release(sc->sc_pc, sc->sc_pihp, 1);
-#endif /* __HAVE_PCI_MSI_MSIX */
return 0;
}