drivers/net: Call netif_carrier_off at the end of the probe
authorIvan Vecera <ivecera@redhat.com>
Tue, 15 Feb 2011 02:08:39 +0000 (02:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Feb 2011 22:09:57 +0000 (14:09 -0800)
Without calling of netif_carrier_off at the end of the probe the operstate
is unknown when the device is initially opened. By default the carrier is
on so when the device is opened and netif_carrier_on is called the link
watch event is not fired and operstate remains zero (unknown).

This patch fixes this behavior in forcedeth and r8169.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/forcedeth.c
drivers/net/r8169.c

index af09296ef0ddc974d2bb60d0c66d7cd8b75fa4cd..9c0b1bac6af627b985541f961fc935098fbdc4f4 100644 (file)
@@ -5645,6 +5645,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
                goto out_error;
        }
 
+       netif_carrier_off(dev);
+
        dev_info(&pci_dev->dev, "ifname %s, PHY OUI 0x%x @ %d, addr %pM\n",
                 dev->name, np->phy_oui, np->phyaddr, dev->dev_addr);
 
index 59ccf0c5c61009a14454e4920f3dac711d4b83c3..469ab0b7ce315bb0c5ad8c71f481fc893448e849 100644 (file)
@@ -3190,6 +3190,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (pci_dev_run_wake(pdev))
                pm_runtime_put_noidle(&pdev->dev);
 
+       netif_carrier_off(dev);
+
 out:
        return rc;