[<prev] [next>] [day] [month] [year] [list]
Message-ID: <3532474F0A1E449C8ABAC51A6F690258@realtek.com.tw>
Date: Wed, 19 Feb 2014 10:41:54 +0800
From: hayeswang <hayeswang@...ltek.com>
To: 'Florian Fainelli' <f.fainelli@...il.com>
CC: 'netdev' <netdev@...r.kernel.org>, <nic_swsd@...ltek.com>,
<linux-kernel@...r.kernel.org>,
'linux-usb' <linux-usb@...r.kernel.org>
Subject: RE: [PATCH net-next 07/14] r8152: combine PHY reset with set_speed
Florian Fainelli [mailto:f.fainelli@...il.com]
> Sent: Wednesday, February 19, 2014 1:19 AM
> To: Hayes Wang
> Cc: netdev; nic_swsd@...ltek.com;
> linux-kernel@...r.kernel.org; linux-usb
> Subject: Re: [PATCH net-next 07/14] r8152: combine PHY reset
> with set_speed
[...]
> > +static void rtl_phy_reset(struct r8152 *tp)
> > +{
> > + u16 data;
> > + int i;
> > +
> > + clear_bit(PHY_RESET, &tp->flags);
> > +
> > + data = r8152_mdio_read(tp, MII_BMCR);
> > +
> > + /* don't reset again before the previous one complete */
> > + if (data & BMCR_RESET)
> > + return;
> > +
> > + data |= BMCR_RESET;
> > + r8152_mdio_write(tp, MII_BMCR, data);
> > +
> > + for (i = 0; i < 50; i++) {
> > + msleep(20);
> > + if ((r8152_mdio_read(tp, MII_BMCR) &
> BMCR_RESET) == 0)
> > + break;
> > + }
> > +}
>
> If you implemented libphy in the driver you would not have to
> duplicate that and you could use "phy_init_hw()" or
> genphy_soft_reset() to perform the BMCR-based software reset.
Thanks for you suggestion. I would study about those.
Best Regards,
Hayes
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists