diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2007-04-01 11:21:41 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2007-04-01 11:21:41 +0000 |
commit | 15319ab5febace80d0a2e8a53ab9157923602f02 (patch) | |
tree | 3b25f477c63acf0f46e296b7e6dd1fcff141d6d3 /sys | |
parent | b4f8135868eeabf6ff5a58d91ab3149459a521a1 (diff) |
There is no need to keep the intrstr in the drivers softc struct.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/bcwvar.h | 10 | ||||
-rw-r--r-- | sys/dev/pci/if_bcw_pci.c | 23 |
2 files changed, 16 insertions, 17 deletions
diff --git a/sys/dev/ic/bcwvar.h b/sys/dev/ic/bcwvar.h index d6ca0b679b7..c8d8c5dfbcc 100644 --- a/sys/dev/ic/bcwvar.h +++ b/sys/dev/ic/bcwvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bcwvar.h,v 1.34 2007/04/01 00:08:17 mglocker Exp $ */ +/* $OpenBSD: bcwvar.h,v 1.35 2007/04/01 11:21:40 mglocker Exp $ */ /* * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org> @@ -256,10 +256,8 @@ struct bcw_softc { bus_space_handle_t sc_ioh; uint32_t sc_flags; - void *bcw_intrhand; - const char *bcw_intrstr; /* interrupt description */ void *sc_dev_softc; - uint32_t sc_phy; /* eeprom indicated phy */ + uint32_t sc_phy; /* eeprom indicated phy */ struct bcw_dma_slot *bcw_rx_ring; /* receive ring */ struct bcw_dma_slot *bcw_tx_ring; /* transmit ring */ // struct bcw_chain_data sc_cdata; /* mbufs */ @@ -277,7 +275,7 @@ struct bcw_softc { uint16_t sc_chip_id; /* Chip ID */ uint16_t sc_chip_rev; /* Chip Revision */ uint16_t sc_chip_pkg; /* Chip Package */ - uint16_t sc_prodid; /* Product ID */ + uint16_t sc_prodid; /* Product ID */ struct bcw_core sc_core[BCW_MAX_CORES]; // struct bcw_radio radio[BCW_RADIO_MAX]; uint16_t sc_using_pio:1; @@ -332,7 +330,7 @@ struct bcw_softc { uint8_t sc_idletssi; uint8_t sc_spromrev; uint16_t sc_boardflags; - uint8_t sc_sbrev; /* Sonics Backplane Revision */ + uint8_t sc_sbrev; /* Sonics Backplane Revision */ struct bcw_sprom sc_sprom; /* Core locations */ struct bcw_core *sc_core_common; diff --git a/sys/dev/pci/if_bcw_pci.c b/sys/dev/pci/if_bcw_pci.c index 694b210a843..2dca2e51bea 100644 --- a/sys/dev/pci/if_bcw_pci.c +++ b/sys/dev/pci/if_bcw_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bcw_pci.c,v 1.15 2007/03/31 09:48:02 mglocker Exp $ */ +/* $OpenBSD: if_bcw_pci.c,v 1.16 2007/04/01 11:21:40 mglocker Exp $ */ /* * Copyright (c) 2006 Jon Simola <jsimola@gmail.com> @@ -82,8 +82,7 @@ const struct pci_matchid bcw_pci_devices[] = { struct bcw_pci_softc { struct bcw_softc psc_bcw; /* Real softc */ - pci_intr_handle_t psc_ih; /* interrupt handle */ - void *psc_intrcookie; + void *psc_ih; pci_chipset_tag_t psc_pc; /* our PCI chipset */ pcitag_t psc_pcitag; /* our PCI tag */ }; @@ -112,6 +111,8 @@ bcw_pci_attach(struct device *parent, struct device *self, void *aux) struct bcw_softc *sc = &psc->psc_bcw; pci_chipset_tag_t pc = pa->pa_pc; bus_size_t memsize; + const char *intrstr = NULL; + pci_intr_handle_t ih; int error; sc->sc_dmat = pa->pa_dmat; @@ -148,23 +149,23 @@ bcw_pci_attach(struct device *parent, struct device *self, void *aux) } /* map interrupt */ - if (pci_intr_map(pa, &psc->psc_ih) != 0) { + if (pci_intr_map(pa, &ih) != 0) { printf(": couldn't map interrupt\n"); return; } /* establish interrupt */ - sc->bcw_intrstr = pci_intr_string(pc, psc->psc_ih); - psc->psc_intrcookie = pci_intr_establish(pc, psc->psc_ih, IPL_NET, - bcw_intr, sc, sc->sc_dev.dv_xname); - if (psc->psc_intrcookie == NULL) { + intrstr = pci_intr_string(pc, ih); + psc->psc_ih = pci_intr_establish(pc, ih, IPL_NET, bcw_intr, sc, + sc->sc_dev.dv_xname); + if (psc->psc_ih == NULL) { printf("%s: couldn't establish interrupt"); - if (sc->bcw_intrstr != NULL) - printf(" at %s", sc->bcw_intrstr); + if (intrstr != NULL) + printf(" at %s", intrstr); printf("\n"); return; } - printf(": %s", sc->bcw_intrstr); + printf(": %s", intrstr); /* map function pointers which we need later in the device code */ sc->sc_conf_write = bcw_pci_conf_write; |