void bestop(struct be_softc *sc) { int n; bus_space_tag_t t = sc->sc_bustag; bus_space_handle_t br = sc->sc_br; timeout_del(&sc->sc_tick_ch); /* Down the MII. */ mii_down(&sc->sc_mii); (void)be_intphy_service(sc, &sc->sc_mii, MII_DOWN); /* Stop the transmitter */ bus_space_write_4(t, br, BE_BRI_TXCFG, 0); for (n = 32; n > 0; n--) { if (bus_space_read_4(t, br, BE_BRI_TXCFG) == 0) break; DELAY(20); } /* Stop the receiver */ bus_space_write_4(t, br, BE_BRI_RXCFG, 0); for (n = 32; n > 0; n--) { if (bus_space_read_4(t, br, BE_BRI_RXCFG) == 0) break; DELAY(20); } }
void bestop(struct ifnet *ifp, int disable) { struct be_softc *sc = ifp->if_softc; callout_stop(&sc->sc_tick_ch); /* Down the MII. */ mii_down(&sc->sc_mii); (void)be_intphy_service(sc, &sc->sc_mii, MII_DOWN); behwreset(sc); }