]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
r8169:call "rtl8168_driver_start" "rtl8168_driver_stop" only when hardware dash funct...
authorChun-Hao Lin <hau@realtek.com>
Wed, 1 Oct 2014 15:17:21 +0000 (23:17 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Oct 2014 19:33:18 +0000 (15:33 -0400)
These two functions are used to inform dash firmware that driver is been
brought up or brought down. So call these two functions only when hardware dash
function is enabled.

Signed-off-by: Chun-Hao Lin <hau@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/r8169.c

index 305f3b48d36f192e71e84aa63be682cfa9329664..c03891be22d030717f16fccda3e9f2122ff7d627 100644 (file)
@@ -7387,9 +7387,10 @@ static void rtl_remove_one(struct pci_dev *pdev)
        struct net_device *dev = pci_get_drvdata(pdev);
        struct rtl8169_private *tp = netdev_priv(dev);
 
-       if (tp->mac_version == RTL_GIGA_MAC_VER_27 ||
-           tp->mac_version == RTL_GIGA_MAC_VER_28 ||
-           tp->mac_version == RTL_GIGA_MAC_VER_31) {
+       if ((tp->mac_version == RTL_GIGA_MAC_VER_27 ||
+            tp->mac_version == RTL_GIGA_MAC_VER_28 ||
+            tp->mac_version == RTL_GIGA_MAC_VER_31) &&
+           r8168_check_dash(tp)) {
                rtl8168_driver_stop(tp);
        }
 
@@ -7822,9 +7823,10 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
                           rtl_chip_infos[chipset].jumbo_tx_csum ? "ok" : "ko");
        }
 
-       if (tp->mac_version == RTL_GIGA_MAC_VER_27 ||
-           tp->mac_version == RTL_GIGA_MAC_VER_28 ||
-           tp->mac_version == RTL_GIGA_MAC_VER_31) {
+       if ((tp->mac_version == RTL_GIGA_MAC_VER_27 ||
+            tp->mac_version == RTL_GIGA_MAC_VER_28 ||
+            tp->mac_version == RTL_GIGA_MAC_VER_31) &&
+           r8168_check_dash(tp)) {
                rtl8168_driver_start(tp);
        }