From 5c60d32f68daf0858f957d2c226ccb70809c76dd Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Mon, 10 Jul 2006 00:25:24 +0000 Subject: Fully initialize the softc structure before enabling interrupt. Copied from drahn@'s commit to if_em. --- sys/dev/pci/if_ixgb.c | 10 +++++----- 1 file 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 @@ -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; -- cgit v1.2.3