diff options
author | Lino Sanfilippo <LinoSanfilippo@gmx.de> | 2016-07-22 23:09:12 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-21 17:59:44 +0200 |
commit | da169754096c48281c75cbc5fd21e62e2cbb780b (patch) | |
tree | 109a8bdacc1dc2694ddd58c03b217e9b3c871b73 /drivers/staging/slicoss | |
parent | 7ed4eb5168325e52b5d6be277555b36877955c66 (diff) | |
download | linux-da169754096c48281c75cbc5fd21e62e2cbb780b.tar.bz2 |
staging: slicoss: notifiy network stack about change in link state
Notify the network stack about link states via netif_carrier_[off|on]().
Also set the link state off initially and when the interface is brought
down.
Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/slicoss')
-rw-r--r-- | drivers/staging/slicoss/slicoss.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c index dae07410d189..a9323a9f37d9 100644 --- a/drivers/staging/slicoss/slicoss.c +++ b/drivers/staging/slicoss/slicoss.c @@ -1016,6 +1016,7 @@ static void slic_link_upr_complete(struct adapter *adapter, u32 isr) /* link has gone from up to down */ if (linkup == LINK_DOWN) { adapter->linkstate = LINK_DOWN; + netif_carrier_off(adapter->netdev); return; } @@ -1028,6 +1029,7 @@ static void slic_link_upr_complete(struct adapter *adapter, u32 isr) slic_config_set(adapter, true); adapter->linkstate = LINK_UP; netif_start_queue(adapter->netdev); + netif_carrier_on(adapter->netdev); } } @@ -2418,6 +2420,7 @@ static int slic_entry_open(struct net_device *dev) int status; netif_stop_queue(adapter->netdev); + netif_carrier_off(dev); spin_lock_irqsave(&slic_global.driver_lock, flags); if (!adapter->activated) { @@ -2530,6 +2533,9 @@ static int slic_entry_halt(struct net_device *dev) #endif spin_unlock_irqrestore(&slic_global.driver_lock, flags); + + netif_carrier_off(dev); + return 0; } @@ -3172,6 +3178,8 @@ static int slic_entry_probe(struct pci_dev *pcidev, netdev->irq = adapter->irq; netdev->netdev_ops = &slic_netdev_ops; + netif_carrier_off(netdev); + strcpy(netdev->name, "eth%d"); err = register_netdev(netdev); if (err) { |