diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-07-10 00:25:24 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-07-10 00:25:24 +0000 |
commit | 5c60d32f68daf0858f957d2c226ccb70809c76dd (patch) | |
tree | 3f6ea392c6b346745e0aa23f4869693dbc6a40a0 /sys/dev | |
parent | ff19685e6b215b7f0266b53e4155019b1d2fa35f (diff) |
Fully initialize the softc structure before enabling interrupt.
Copied from drahn@'s commit to if_em.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_ixgb.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/pci/if_ixgb.c b/sys/dev/pci/if_ixgb.c index 21dfa64dc07..a51de7496a0 100644 --- a/sys/dev/pci/if_ixgb.c +++ b/sys/dev/pci/if_ixgb.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_ixgb.c,v 1.20 2006/06/22 04:57:28 brad Exp $ */ +/* $OpenBSD: if_ixgb.c,v 1.21 2006/07/10 00:25:23 brad Exp $ */ #include <dev/pci/if_ixgb.h> @@ -955,6 +955,8 @@ ixgb_allocate_pci_resources(struct ixgb_softc *sc) return (ENXIO); } + sc->hw.back = &sc->osdep; + intrstr = pci_intr_string(pc, ih); sc->sc_intrhand = pci_intr_establish(pc, ih, IPL_NET, ixgb_intr, sc, sc->sc_dv.dv_xname); @@ -967,8 +969,6 @@ ixgb_allocate_pci_resources(struct ixgb_softc *sc) } printf(": %s", intrstr); - sc->hw.back = &sc->osdep; - return(0); } @@ -978,11 +978,11 @@ ixgb_free_pci_resources(struct ixgb_softc *sc) struct pci_attach_args *pa = &sc->osdep.ixgb_pa; pci_chipset_tag_t pc = pa->pa_pc; - if(sc->sc_intrhand) + if (sc->sc_intrhand) pci_intr_disestablish(pc, sc->sc_intrhand); sc->sc_intrhand = 0; - if(sc->osdep.ixgb_membase) + if (sc->osdep.ixgb_membase) bus_space_unmap(sc->osdep.mem_bus_space_tag, sc->osdep.mem_bus_space_handle, sc->osdep.ixgb_memsize); sc->osdep.ixgb_membase = 0; |