1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-02 12:20:51 +00:00

o Remove unnecessary controller reinitialization.

o Do not blindly UP controller when MTU is changed. Reinitialize
   controller only if driver is running.
 o Remove useless ti_stop() in ti_watchdog() since ti_init_locked()
   always invokes ti_stop().
This commit is contained in:
Pyun YongHyeon 2011-11-07 18:26:38 +00:00
parent bb6ebb6af8
commit 18707510b7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227312

View File

@ -3091,6 +3091,9 @@ ti_init_locked(void *xsc)
{
struct ti_softc *sc = xsc;
if (sc->ti_ifp->if_drv_flags & IFF_DRV_RUNNING)
return;
/* Cancel pending I/O and flush buffers. */
ti_stop(sc);
@ -3369,8 +3372,11 @@ ti_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = EINVAL;
else {
ifp->if_mtu = ifr->ifr_mtu;
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
ti_init_locked(sc);
}
}
TI_UNLOCK(sc);
break;
case SIOCSIFFLAGS:
@ -3783,7 +3789,7 @@ ti_watchdog(void *arg)
ifp = sc->ti_ifp;
if_printf(ifp, "watchdog timeout -- resetting\n");
ti_stop(sc);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
ti_init_locked(sc);
ifp->if_oerrors++;