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
This commit is contained in:
Anaëlle CAZUC
2026-01-27 02:36:02 +03:30
committed by Pouria Mousavizadeh Tehrani
parent d1a8f1a62f
commit 69de2b4e96
+3 -4
View File
@@ -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