static bool sft9001_link_ok(struct efx_nic *efx, struct ethtool_cmd *ecmd) { int phy_id = efx->mii.phy_id; u32 reg; if (efx_phy_mode_disabled(efx->phy_mode)) return false; else if (efx->loopback_mode == LOOPBACK_GPHY) return true; else if (efx->loopback_mode) return mdio_clause45_links_ok(efx, MDIO_MMDREG_DEVS_PMAPMD | MDIO_MMDREG_DEVS_PHYXS); /* We must use the same definition of link state as LASI, * otherwise we can miss a link state transition */ if (ecmd->speed == 10000) { reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PCS, PCS_10GBASET_STAT1); return reg & (1 << PCS_10GBASET_BLKLK_LBN); } else { reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_C22EXT, C22EXT_STATUS_REG); return reg & (1 << C22EXT_STATUS_LINK_LBN); } }
static bool sfx7101_link_ok(struct efx_nic *efx) { return mdio_clause45_links_ok(efx, MDIO_MMDREG_DEVS_PMAPMD | MDIO_MMDREG_DEVS_PCS | MDIO_MMDREG_DEVS_PHYXS); }
static int xfp_link_ok(struct efx_nic *efx) { return mdio_clause45_links_ok(efx, XFP_REQUIRED_DEVS); }