Commit 0655f994 authored by Thomas Falcon's avatar Thomas Falcon Committed by David S. Miller

net/ibmvnic: Update carrier state after link state change

Only set the device carrier state to on after receiving an up link
state indication from the underlying adapter. Likewise, if a down
link indication is receieved, update the carrier state accordingly.
This fix ensures that accurate carrier state is reported by the driver
following a link state update by the underlying adapter.
Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 62740e97
...@@ -1111,7 +1111,6 @@ static int ibmvnic_open(struct net_device *netdev) ...@@ -1111,7 +1111,6 @@ static int ibmvnic_open(struct net_device *netdev)
} }
rc = __ibmvnic_open(netdev); rc = __ibmvnic_open(netdev);
netif_carrier_on(netdev);
return rc; return rc;
} }
...@@ -1864,8 +1863,6 @@ static int do_reset(struct ibmvnic_adapter *adapter, ...@@ -1864,8 +1863,6 @@ static int do_reset(struct ibmvnic_adapter *adapter,
adapter->reset_reason != VNIC_RESET_CHANGE_PARAM) adapter->reset_reason != VNIC_RESET_CHANGE_PARAM)
call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev); call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev);
netif_carrier_on(netdev);
return 0; return 0;
} }
...@@ -1935,8 +1932,6 @@ static int do_hard_reset(struct ibmvnic_adapter *adapter, ...@@ -1935,8 +1932,6 @@ static int do_hard_reset(struct ibmvnic_adapter *adapter,
return 0; return 0;
} }
netif_carrier_on(netdev);
return 0; return 0;
} }
...@@ -4480,6 +4475,10 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq, ...@@ -4480,6 +4475,10 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq,
crq->link_state_indication.phys_link_state; crq->link_state_indication.phys_link_state;
adapter->logical_link_state = adapter->logical_link_state =
crq->link_state_indication.logical_link_state; crq->link_state_indication.logical_link_state;
if (adapter->phys_link_state && adapter->logical_link_state)
netif_carrier_on(netdev);
else
netif_carrier_off(netdev);
break; break;
case CHANGE_MAC_ADDR_RSP: case CHANGE_MAC_ADDR_RSP:
netdev_dbg(netdev, "Got MAC address change Response\n"); netdev_dbg(netdev, "Got MAC address change Response\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment