From: Kevin Lo Subject: igc: add support for reporting flow control status To: tech@openbsd.org Date: Thu, 22 Feb 2024 10:33:02 +0800 Hi, The diff below - adds support for reporting flow control status - adds missing igc_check_for_link() call; from msaitoh via NetBSD. Tested: igc0 at pci3 dev 0 function 0 "Intel I225-V" rev 0x03, msix, 4 queues, address 2c:53:4a:xx:xx:xx ok? Index: sys/dev/pci/if_igc.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_igc.c,v retrieving revision 1.17 diff -u -p -u -p -r1.17 if_igc.c --- sys/dev/pci/if_igc.c 14 Feb 2024 22:41:48 -0000 1.17 +++ sys/dev/pci/if_igc.c 22 Feb 2024 02:05:41 -0000 @@ -1491,6 +1491,23 @@ igc_media_status(struct ifnet *ifp, stru ifmr->ifm_active |= IFM_FDX; else ifmr->ifm_active |= IFM_HDX; + + switch (sc->hw.fc.current_mode) { + case igc_fc_tx_pause: + ifmr->ifm_active |= IFM_FLOW | IFM_ETH_TXPAUSE; + break; + case igc_fc_rx_pause: + ifmr->ifm_active |= IFM_FLOW | IFM_ETH_RXPAUSE; + break; + case igc_fc_full: + ifmr->ifm_active |= IFM_FLOW | IFM_ETH_RXPAUSE | + IFM_ETH_TXPAUSE; + break; + default: + ifmr->ifm_active &= ~(IFM_FLOW | IFM_ETH_RXPAUSE | + IFM_ETH_TXPAUSE); + break; + } } /********************************************************************* @@ -1590,6 +1607,9 @@ igc_update_link_status(struct igc_softc struct ifnet *ifp = &sc->sc_ac.ac_if; struct igc_hw *hw = &sc->hw; int link_state; + + if (hw->mac.get_link_status == true) + igc_check_for_link(hw); if (IGC_READ_REG(&sc->hw, IGC_STATUS) & IGC_STATUS_LU) { if (sc->link_active == 0) {