Commit fbfcfa5f authored by li hongming's avatar li hongming Committed by Adam Wujek

fix the large PPS skew bug which is introduced by crazy run of bitslide module.

    The bitslide module won't be reset when replugging the SFP and fiber, which may lead to
the wrong bitslide.
parent aed1a0fa
......@@ -101,7 +101,8 @@ static void wrn_update_link_status(struct net_device *dev)
{
struct wrn_ep *ep = netdev_priv(dev);
u32 ecr, bmsr, bmcr, lpa;
uint32_t value;
bmsr = wrn_phy_read(dev, 0, MII_BMSR);
bmcr = wrn_phy_read(dev, 0, MII_BMCR);
......@@ -112,6 +113,9 @@ static void wrn_update_link_status(struct net_device *dev)
if (!mii_link_ok(&ep->mii)) {
if(netif_carrier_ok(dev)) {
netif_carrier_off(dev);
/* Reset SFP */
value = wrn_phy_read(dev, 0, MII_BMCR);
wrn_phy_write(dev, 0, MII_BMCR, value | BMCR_RESET);
clear_bit(WRN_EP_UP, &ep->ep_flags);
printk(KERN_INFO "%s: Link down.\n", dev->name);
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment