r8169: remove rtl8169_set_speed_xmii
authorHeiner Kallweit <hkallweit1@gmail.com>
Tue, 17 Jul 2018 20:52:03 +0000 (22:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Jul 2018 00:46:32 +0000 (09:46 +0900)
We can remove rtl8169_set_speed_xmii() now that phylib handles all this.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/r8169.c

index 775e5d6dace482a3f67de7ef65d2b5311772ca2e..0924396c523566f247aac36c2425ced8a407723f 100644 (file)
@@ -1663,89 +1663,6 @@ static int rtl8169_get_regs_len(struct net_device *dev)
        return R8169_REGS_SIZE;
 }
 
-static int rtl8169_set_speed_xmii(struct net_device *dev,
-                                 u8 autoneg, u16 speed, u8 duplex, u32 adv)
-{
-       struct rtl8169_private *tp = netdev_priv(dev);
-       int giga_ctrl, bmcr;
-       int rc = -EINVAL;
-
-       rtl_writephy(tp, 0x1f, 0x0000);
-
-       if (autoneg == AUTONEG_ENABLE) {
-               int auto_nego;
-
-               auto_nego = rtl_readphy(tp, MII_ADVERTISE);
-               auto_nego &= ~(ADVERTISE_10HALF | ADVERTISE_10FULL |
-                               ADVERTISE_100HALF | ADVERTISE_100FULL);
-
-               if (adv & ADVERTISED_10baseT_Half)
-                       auto_nego |= ADVERTISE_10HALF;
-               if (adv & ADVERTISED_10baseT_Full)
-                       auto_nego |= ADVERTISE_10FULL;
-               if (adv & ADVERTISED_100baseT_Half)
-                       auto_nego |= ADVERTISE_100HALF;
-               if (adv & ADVERTISED_100baseT_Full)
-                       auto_nego |= ADVERTISE_100FULL;
-
-               auto_nego |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
-
-               giga_ctrl = rtl_readphy(tp, MII_CTRL1000);
-               giga_ctrl &= ~(ADVERTISE_1000FULL | ADVERTISE_1000HALF);
-
-               /* The 8100e/8101e/8102e do Fast Ethernet only. */
-               if (tp->mii.supports_gmii) {
-                       if (adv & ADVERTISED_1000baseT_Half)
-                               giga_ctrl |= ADVERTISE_1000HALF;
-                       if (adv & ADVERTISED_1000baseT_Full)
-                               giga_ctrl |= ADVERTISE_1000FULL;
-               } else if (adv & (ADVERTISED_1000baseT_Half |
-                                 ADVERTISED_1000baseT_Full)) {
-                       netif_info(tp, link, dev,
-                                  "PHY does not support 1000Mbps\n");
-                       goto out;
-               }
-
-               bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
-
-               rtl_writephy(tp, MII_ADVERTISE, auto_nego);
-               rtl_writephy(tp, MII_CTRL1000, giga_ctrl);
-       } else {
-               if (speed == SPEED_10)
-                       bmcr = 0;
-               else if (speed == SPEED_100)
-                       bmcr = BMCR_SPEED100;
-               else
-                       goto out;
-
-               if (duplex == DUPLEX_FULL)
-                       bmcr |= BMCR_FULLDPLX;
-       }
-
-       rtl_writephy(tp, MII_BMCR, bmcr);
-
-       if (tp->mac_version == RTL_GIGA_MAC_VER_02 ||
-           tp->mac_version == RTL_GIGA_MAC_VER_03) {
-               if ((speed == SPEED_100) && (autoneg != AUTONEG_ENABLE)) {
-                       rtl_writephy(tp, 0x17, 0x2138);
-                       rtl_writephy(tp, 0x0e, 0x0260);
-               } else {
-                       rtl_writephy(tp, 0x17, 0x2108);
-                       rtl_writephy(tp, 0x0e, 0x0000);
-               }
-       }
-
-       rc = 0;
-out:
-       return rc;
-}
-
-static int rtl8169_set_speed(struct net_device *dev,
-                            u8 autoneg, u16 speed, u8 duplex, u32 advertising)
-{
-       return rtl8169_set_speed_xmii(dev, autoneg, speed, duplex, advertising);
-}
-
 static netdev_features_t rtl8169_fix_features(struct net_device *dev,
        netdev_features_t features)
 {
@@ -4237,13 +4154,6 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
        phy_speed_up(dev->phydev);
 
        genphy_soft_reset(dev->phydev);
-
-       rtl8169_set_speed(dev, AUTONEG_ENABLE, SPEED_1000, DUPLEX_FULL,
-                         ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full |
-                         ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full |
-                         (tp->mii.supports_gmii ?
-                          ADVERTISED_1000baseT_Half |
-                          ADVERTISED_1000baseT_Full : 0));
 }
 
 static void rtl_rar_set(struct rtl8169_private *tp, u8 *addr)