rge: handle interface flags changes
Handle interface flags like other drivers do. Reviewed by: zlei, adrian Differential Revision: https://reviews.freebsd.org/D55728
This commit is contained in:
+9
-14
@@ -959,29 +959,24 @@ rge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
case SIOCSIFFLAGS:
|
||||
RGE_LOCK(sc);
|
||||
if ((if_getflags(ifp) & IFF_UP) != 0) {
|
||||
if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) {
|
||||
/*
|
||||
* TODO: handle promisc/iffmulti changing
|
||||
* without reprogramming everything.
|
||||
*/
|
||||
rge_init_locked(sc);
|
||||
} else {
|
||||
/* Reinit promisc/multi just in case */
|
||||
rge_iff_locked(sc);
|
||||
}
|
||||
} else {
|
||||
if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) {
|
||||
if (((if_getflags(ifp) ^ sc->rge_if_flags)
|
||||
& (IFF_PROMISC | IFF_ALLMULTI)) != 0)
|
||||
rge_iff_locked(sc);
|
||||
} else
|
||||
rge_init_locked(sc);
|
||||
} else {
|
||||
if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0)
|
||||
rge_stop_locked(sc);
|
||||
}
|
||||
}
|
||||
sc->rge_if_flags = if_getflags(ifp);
|
||||
RGE_UNLOCK(sc);
|
||||
break;
|
||||
case SIOCADDMULTI:
|
||||
case SIOCDELMULTI:
|
||||
RGE_LOCK(sc);
|
||||
if ((if_getflags(ifp) & IFF_DRV_RUNNING) != 0) {
|
||||
if ((if_getflags(ifp) & IFF_DRV_RUNNING) != 0)
|
||||
rge_iff_locked(sc);
|
||||
}
|
||||
RGE_UNLOCK(sc);
|
||||
break;
|
||||
case SIOCGIFMEDIA:
|
||||
|
||||
@@ -200,6 +200,8 @@ struct rge_softc {
|
||||
#define RGE_IMTYPE_SIM 1
|
||||
int sc_watchdog;
|
||||
|
||||
int rge_if_flags;
|
||||
|
||||
uint32_t sc_debug;
|
||||
|
||||
struct rge_drv_stats sc_drv_stats;
|
||||
|
||||
Reference in New Issue
Block a user