/* * Process an ioctl request. This code needs some work - it looks * pretty ugly. */ static int el_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) { int error = 0; switch (command) { case SIOCSIFFLAGS: /* * If interface is marked down and it is running, then stop it */ if (((ifp->if_flags & IFF_UP) == 0) && (ifp->if_flags & IFF_RUNNING)) { el_stop(ifp->if_softc); ifp->if_flags &= ~IFF_RUNNING; } else { /* * If interface is marked up and it is stopped, then start it */ if ((ifp->if_flags & IFF_UP) && ((ifp->if_flags & IFF_RUNNING) == 0)) el_init(ifp->if_softc); } break; default: error = ether_ioctl(ifp, command, data); break; } return (error); }
/* This routine resets the interface. */ static void el_reset(void *xsc) { struct el_softc *sc = xsc; dprintf(("elreset()\n")); el_stop(sc); el_init(sc); }
/* This routine resets the interface. */ void el_reset(int unit) { int s; dprintf(("elreset()\n")); s = splimp(); el_stop(unit); el_init(unit); splx(s); }