aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnaƫlle CAZUC <Anaelle.CAZUC@stormshield.eu>2026-01-26 23:06:02 +0000
committerPouria Mousavizadeh Tehrani <pouria@FreeBSD.org>2026-01-26 23:21:48 +0000
commit69de2b4e96794793f04d1b323d354fcde3c480f6 (patch)
treea13fa8f75d962a0b74ac4b13ba54b5b8355114e5
parentd1a8f1a62f31779e1902b856b44249b198178fc9 (diff)
bnxt: don't set media status if link is down
When the link is down don't set flags other than IFM_AVALID & IFM_ETHER This avoids `media: Ethernet autoselect (Unknown <full-duplex>)` on ifconfig Reviewed by: zlei, pouria Approved by: glebius (mentor) MFC after: 1 week Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D54573
-rw-r--r--sys/dev/bnxt/bnxt_en/if_bnxt.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c
index fa37d04e0884..a34bd1a7e511 100644
--- a/sys/dev/bnxt/bnxt_en/if_bnxt.c
+++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c
@@ -3280,11 +3280,10 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * ifmr)
ifmr->ifm_status = IFM_AVALID;
ifmr->ifm_active = IFM_ETHER;
- if (link_info->link_up)
- ifmr->ifm_status |= IFM_ACTIVE;
- else
- ifmr->ifm_status &= ~IFM_ACTIVE;
+ if (!link_info->link_up)
+ return;
+ ifmr->ifm_status |= IFM_ACTIVE;
if (link_info->duplex == HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL)
ifmr->ifm_active |= IFM_FDX;
else