diff options
| author | Sebastien Bini <sebastien.bini@stormshield.eu> | 2022-03-22 15:44:09 +0000 |
|---|---|---|
| committer | Marcin Wojtas <mw@FreeBSD.org> | 2022-03-29 22:24:56 +0000 |
| commit | 992e326cd8ccd6e1a8ec696db7902efd3021f7ae (patch) | |
| tree | 77a1e58ee5fe77756df20338c2454d38ac926427 | |
| parent | 817556add33643b10c06827eb17ea1c1421b7969 (diff) | |
neta: split fixed and in-band link status configuration
Fixed-link mode requires different handling than the in-band
managed connection. Update interrupt, link-up/down and
autonegotiation settings for the former.
Reviewed by: mw
MFC after: 1 week
Obtained from: Stormshield
Differential Revision: https://reviews.freebsd.org/D34394
(cherry picked from commit 231237bbb0e803f9047c235cd6b5878f70e6c5eb)
| -rw-r--r-- | sys/dev/neta/if_mvneta.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c index 8b9135419736..6035609976a6 100644 --- a/sys/dev/neta/if_mvneta.c +++ b/sys/dev/neta/if_mvneta.c @@ -1688,7 +1688,7 @@ mvneta_enable_intr(struct mvneta_softc *sc) reg |= MVNETA_PRXTXTI_PMISCICSUMMARY; MVNETA_WRITE(sc, MVNETA_PRXTXTIM, reg); - if (sc->use_inband_status) { + if (!sc->phy_attached || sc->use_inband_status) { /* Enable Port MISC Intr. (via RXTX_TH_Summary bit) */ MVNETA_WRITE(sc, MVNETA_PMIM, MVNETA_PMI_PHYSTATUSCHNG | MVNETA_PMI_LINKCHANGE | MVNETA_PMI_PSCSYNCCHANGE); @@ -1720,7 +1720,7 @@ mvneta_rxtxth_intr(void *arg) /* Ack maintance interrupt first */ if (__predict_false((ic & MVNETA_PRXTXTI_PMISCICSUMMARY) && - sc->use_inband_status)) { + (!sc->phy_attached || sc->use_inband_status))) { mvneta_sc_lock(sc); mvneta_misc_intr(sc); mvneta_sc_unlock(sc); @@ -2475,7 +2475,7 @@ mvneta_update_media(struct mvneta_softc *sc, int media) sc->autoneg = (IFM_SUBTYPE(media) == IFM_AUTO); - if (sc->use_inband_status) + if (!sc->phy_attached || sc->use_inband_status) mvneta_update_autoneg(sc, IFM_SUBTYPE(media) == IFM_AUTO); mvneta_update_eee(sc); @@ -2638,7 +2638,7 @@ mvneta_linkup(struct mvneta_softc *sc) KASSERT_SC_MTX(sc); - if (!sc->use_inband_status) { + if (!sc->phy_attached || !sc->use_inband_status) { reg = MVNETA_READ(sc, MVNETA_PANC); reg |= MVNETA_PANC_FORCELINKPASS; reg &= ~MVNETA_PANC_FORCELINKFAIL; @@ -2658,7 +2658,7 @@ mvneta_linkdown(struct mvneta_softc *sc) KASSERT_SC_MTX(sc); - if (!sc->use_inband_status) { + if (!sc->phy_attached || !sc->use_inband_status) { reg = MVNETA_READ(sc, MVNETA_PANC); reg &= ~MVNETA_PANC_FORCELINKPASS; reg |= MVNETA_PANC_FORCELINKFAIL; |
