]> Pileus Git - ~andy/linux/blobdiff - drivers/net/ethernet/marvell/mv643xx_eth.c
Merge tag 'microblaze-3.14-rc1' of git://git.monstr.eu/linux-2.6-microblaze
[~andy/linux] / drivers / net / ethernet / marvell / mv643xx_eth.c
index 61088a6a94245144f46fa42e92fdce9eb07f1599..a2565ce22b7c9af32d6c34ac011f468e36153296 100644 (file)
@@ -33,8 +33,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -2067,23 +2066,6 @@ static inline void oom_timer_wrapper(unsigned long data)
        napi_schedule(&mp->napi);
 }
 
-static void phy_reset(struct mv643xx_eth_private *mp)
-{
-       int data;
-
-       data = phy_read(mp->phy, MII_BMCR);
-       if (data < 0)
-               return;
-
-       data |= BMCR_RESET;
-       if (phy_write(mp->phy, MII_BMCR, data) < 0)
-               return;
-
-       do {
-               data = phy_read(mp->phy, MII_BMCR);
-       } while (data >= 0 && data & BMCR_RESET);
-}
-
 static void port_start(struct mv643xx_eth_private *mp)
 {
        u32 pscr;
@@ -2096,8 +2078,9 @@ static void port_start(struct mv643xx_eth_private *mp)
                struct ethtool_cmd cmd;
 
                mv643xx_eth_get_settings(mp->dev, &cmd);
-               phy_reset(mp);
+               phy_init_hw(mp->phy);
                mv643xx_eth_set_settings(mp->dev, &cmd);
+               phy_start(mp->phy);
        }
 
        /*
@@ -2293,7 +2276,8 @@ static int mv643xx_eth_stop(struct net_device *dev)
        del_timer_sync(&mp->rx_oom);
 
        netif_carrier_off(dev);
-
+       if (mp->phy)
+               phy_stop(mp->phy);
        free_irq(dev->irq, dev);
 
        port_reset(mp);
@@ -2764,8 +2748,6 @@ static void phy_init(struct mv643xx_eth_private *mp, int speed, int duplex)
 {
        struct phy_device *phy = mp->phy;
 
-       phy_reset(mp);
-
        if (speed == 0) {
                phy->autoneg = AUTONEG_ENABLE;
                phy->speed = 0;