From 4c190cd51e944f0c9765ff16440dc2e5258946c7 Mon Sep 17 00:00:00 2001 From: np Date: Sun, 18 Jan 2015 20:38:38 +0000 Subject: MFC r276959: cxgb: replace r273280 with a more comprehensive fix. Poll for link state when the link is down, even for interrupt capable PHYs. Allow PHYs to report a dubious "partial" link. If this state is seen 3 consecutive times (each check is ~1s apart) then reset the PHY. This is a workaround for a situation where repeatedly toggling the link from the peer gets the AEL2005 PHY into a state where it never establishes a PCS block lock even when everything is in order. --- sys/dev/cxgb/common/cxgb_aq100x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev/cxgb/common/cxgb_aq100x.c') diff --git a/sys/dev/cxgb/common/cxgb_aq100x.c b/sys/dev/cxgb/common/cxgb_aq100x.c index d36d07a..b253e67 100644 --- a/sys/dev/cxgb/common/cxgb_aq100x.c +++ b/sys/dev/cxgb/common/cxgb_aq100x.c @@ -350,7 +350,7 @@ aq100x_set_speed_duplex(struct cphy *phy, int speed, int duplex) } static int -aq100x_get_link_status(struct cphy *phy, int *link_ok, int *speed, int *duplex, +aq100x_get_link_status(struct cphy *phy, int *link_state, int *speed, int *duplex, int *fc) { int err; @@ -440,8 +440,8 @@ aq100x_get_link_status(struct cphy *phy, int *link_ok, int *speed, int *duplex, link = 1; done: - if (link_ok) - *link_ok = link; + if (link_state) + *link_state = link ? PHY_LINK_UP : PHY_LINK_DOWN; return (0); } -- cgit v1.1