Don't reinitialize the hardware if only PROMISC flag was changed.

Previously whenever PROMISC mode turned on/off link renegotiation
occurs and it could resulted in network unavailability for serveral
seconds.(Depending on switch STP settings it could last several tens
seconds.)

Reported by:	Prokofiev S.P.  < proks AT logos DOT uptel DOT net >
Tested by:	Prokofiev S.P.  < proks AT logos DOT uptel DOT net >
This commit is contained in:
yongari 2007-04-18 00:40:43 +00:00
parent b85dc1755d
commit 8c9ec0ed49
2 changed files with 13 additions and 4 deletions

View File

@ -2509,10 +2509,18 @@ re_ioctl(ifp, command, data)
break; break;
case SIOCSIFFLAGS: case SIOCSIFFLAGS:
RL_LOCK(sc); RL_LOCK(sc);
if (ifp->if_flags & IFF_UP) if ((ifp->if_flags & IFF_UP) != 0) {
re_init_locked(sc); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
else if (ifp->if_drv_flags & IFF_DRV_RUNNING) if (((ifp->if_flags ^ sc->rl_if_flags)
re_stop(sc); & IFF_PROMISC) != 0)
re_setmulti(sc);
} else
re_init_locked(sc);
} else {
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
re_stop(sc);
}
sc->rl_if_flags = ifp->if_flags;
RL_UNLOCK(sc); RL_UNLOCK(sc);
break; break;
case SIOCADDMULTI: case SIOCADDMULTI:

View File

@ -728,6 +728,7 @@ struct rl_softc {
uint32_t rl_hwrev; uint32_t rl_hwrev;
uint32_t rl_rxlenmask; uint32_t rl_rxlenmask;
int rl_testmode; int rl_testmode;
int rl_if_flags;
int suspended; /* 0 = normal 1 = suspended */ int suspended; /* 0 = normal 1 = suspended */
#ifdef DEVICE_POLLING #ifdef DEVICE_POLLING
int rxcycles; int rxcycles;