X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?p=kvmfornfv.git;a=blobdiff_plain;f=kernel%2Fdrivers%2Fnet%2Fphy%2Ffixed_phy.c;h=479b93f9581c4088e784340220a4b61837e9dbde;hp=1960b46add65b3b89f122cc401c872050cebdbe4;hb=ec0a2ed6d8a5e555edef907895c041e285fdb495;hpb=342fa5dfa053559f47caad657132522496dcf1b3 diff --git a/kernel/drivers/net/phy/fixed_phy.c b/kernel/drivers/net/phy/fixed_phy.c index 1960b46ad..479b93f95 100644 --- a/kernel/drivers/net/phy/fixed_phy.c +++ b/kernel/drivers/net/phy/fixed_phy.c @@ -52,6 +52,10 @@ static int fixed_phy_update_regs(struct fixed_phy *fp) u16 lpagb = 0; u16 lpa = 0; + if (!fp->status.link) + goto done; + bmsr |= BMSR_LSTATUS | BMSR_ANEGCOMPLETE; + if (fp->status.duplex) { bmcr |= BMCR_FULLDPLX; @@ -96,15 +100,13 @@ static int fixed_phy_update_regs(struct fixed_phy *fp) } } - if (fp->status.link) - bmsr |= BMSR_LSTATUS | BMSR_ANEGCOMPLETE; - if (fp->status.pause) lpa |= LPA_PAUSE_CAP; if (fp->status.asym_pause) lpa |= LPA_PAUSE_ASYM; +done: fp->regs[MII_PHYSID1] = 0; fp->regs[MII_PHYSID2] = 0;