[PATCH net-next v1 4/4] net-e1000e: Report carrier in loopback mode

From: David Decotigny
Date: Mon Nov 21 2011 - 18:20:39 EST


From: Maciej Åenczykowski <zenczykowski@xxxxxxxxx>

When interface is configured in loopback mode, force carrier check
positive. This is useful when interface does not have carrier and
test puts the interface in loopback mode.

Tested: pktgen loopback on 80003ES2LAN


Signed-off-by: David Decotigny <david.decotigny@xxxxxxxxxx>
---
drivers/net/ethernet/intel/e1000e/phy.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
index f487a7f..9476c8f 100644
--- a/drivers/net/ethernet/intel/e1000e/phy.c
+++ b/drivers/net/ethernet/intel/e1000e/phy.c
@@ -1781,6 +1781,11 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
u16 phy_reg;
int good_reads_phy_status = 0;

+ /* If loopback is enabled, we claim the link is up */
+ if ((0 == e1e_rphy(hw, PHY_CONTROL, &phy_reg))
+ && (phy_reg & MII_CR_LOOPBACK)) {
+ *success = true;
+ return 0;
}

/*
--
1.7.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/