mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
if_dwc: fix reinitialization with changed MAC
It was observed that on RockPro64 hardware, the dwc interface is unable to receive packets after being assigned a new MAC address. The fix is simply to call mii_mediachg() before touching any device registers in dwc_init_locked(). This is consistent with what the OpenBSD driver does. PR: 263820 MFC after: 1 week
This commit is contained in:
parent
87705c5c21
commit
6501fcdc0a
1 changed files with 6 additions and 5 deletions
|
|
@ -1166,6 +1166,12 @@ dwc_init_locked(struct dwc_softc *sc)
|
|||
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Call mii_mediachg() which will call back into dwc_miibus_statchg()
|
||||
* to set up the remaining config registers based on current media.
|
||||
*/
|
||||
mii_mediachg(sc->mii_softc);
|
||||
|
||||
dwc_setup_rxfilter(sc);
|
||||
dwc_setup_core(sc);
|
||||
dwc_enable_mac(sc, true);
|
||||
|
|
@ -1174,11 +1180,6 @@ dwc_init_locked(struct dwc_softc *sc)
|
|||
|
||||
if_setdrvflagbits(ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE);
|
||||
|
||||
/*
|
||||
* Call mii_mediachg() which will call back into dwc_miibus_statchg()
|
||||
* to set up the remaining config registers based on current media.
|
||||
*/
|
||||
mii_mediachg(sc->mii_softc);
|
||||
callout_reset(&sc->dwc_callout, hz, dwc_tick, sc);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue