--- //depot/vendor/freebsd/src/sys/dev/nve/if_nve.c 2005/10/27 15:40:25 +++ //depot/user/jhb/acpipci/dev/nve/if_nve.c 2005/11/17 16:28:21 @@ -481,7 +483,16 @@ sc->adapterdata.ulMediaIF = sc->media; sc->adapterdata.ulModeRegTxReadCompleteEnable = 1; sc->hwapi->pfnSetCommonData(sc->hwapi->pADCX, &sc->adapterdata); - + + /* From DragonFly: */ + /* Setup Hardware interface and allocate memory structures */ + error = sc->hwapi->pfnInit(sc->hwapi->pADCX, + 0, /* force speed */ + 0, /* force full duplex */ + 0, /* force mode */ + 0, /* force async mode */ + &sc->linkup); + /* MAC is loaded backwards into h/w reg */ sc->hwapi->pfnGetNodeAddress(sc->hwapi->pADCX, sc->original_mac_addr); for (i = 0; i < 6; i++) { @@ -649,19 +669,27 @@ /* Setup multicast filter */ nve_setmulti(sc); nve_ifmedia_upd(ifp); /* Update interface parameters */ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + /* + * Dragonfly resets these to 0 here, but I think they should already + * always be 0. + */ + if (ifp->if_timer != 0 || sc->pending_txs != 0) + if_printf(ifp, "reinit: timer %d, pending_txs %d", + ifp->if_timer, sc->pending_txs); + sc->stat_ch = timeout(nve_tick, sc, hz); DEBUGOUT(NVE_DEBUG_INIT, "nve: nve_init - exit\n"); fail: NVE_UNLOCK(sc); return; } @@ -679,12 +704,15 @@ ifp->if_timer = 0; /* Cancel tick timer */ untimeout(nve_tick, sc, sc->stat_ch); /* Stop hardware activity */ sc->hwapi->pfnDisableInterrupts(sc->hwapi->pADCX); sc->hwapi->pfnStop(sc->hwapi->pADCX, 0); + /* From Dragonfly: */ + sc->hwapi->pfnClearTxDesc(sc->hwapi->pADCX); + DEBUGOUT(NVE_DEBUG_DEINIT, "nve: do pfnDeinit\n"); /* Shutdown interface and deallocate memory buffers */ if (sc->hwapi->pfnDeinit)