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:
Brad Smith
2026-03-24 18:22:52 -07:00
committed by Adrian Chadd
parent 41474e78c4
commit f7fd4e79fa
2 changed files with 11 additions and 14 deletions
+9 -14
View File
@@ -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:
+2
View File
@@ -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;