diff options
author | Neil Horman <nhorman@tuxdriver.com> | 2013-01-29 16:15:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-29 16:29:22 -0500 |
commit | 6cdd20c380eb62eab757c5a6ccc90dac7ecd774b (patch) | |
tree | 547763439b122d5917fff7aae936b6a1bbcd0d0a /drivers/net/vmxnet3 | |
parent | 286003048aaef49b26bb9d93611dc69085e8982e (diff) |
vmxnet3: set carrier state properly on probe
vmxnet3 fails to set netif_carrier_off on probe, meaning that when an interface
is opened the __LINK_STATE_NOCARRIER bit is already cleared, and so
/sys/class/net/<ifname>/operstate remains in the unknown state. Correct this by
setting netif_carrier_off on probe, like other drivers do.
Also, while we're at it, lets remove the netif_carrier_ok checks from the
link_state_update function, as that check is atomically contained within the
netif_carrier_[on|off] functions anyway
Tested successfully by myself
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: "VMware, Inc." <pv-drivers@vmware.com>
CC: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vmxnet3')
-rw-r--r-- | drivers/net/vmxnet3/vmxnet3_drv.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index dc8913c6238c..12c6440d1649 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c | |||
@@ -154,8 +154,7 @@ vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue) | |||
154 | if (ret & 1) { /* Link is up. */ | 154 | if (ret & 1) { /* Link is up. */ |
155 | printk(KERN_INFO "%s: NIC Link is Up %d Mbps\n", | 155 | printk(KERN_INFO "%s: NIC Link is Up %d Mbps\n", |
156 | adapter->netdev->name, adapter->link_speed); | 156 | adapter->netdev->name, adapter->link_speed); |
157 | if (!netif_carrier_ok(adapter->netdev)) | 157 | netif_carrier_on(adapter->netdev); |
158 | netif_carrier_on(adapter->netdev); | ||
159 | 158 | ||
160 | if (affectTxQueue) { | 159 | if (affectTxQueue) { |
161 | for (i = 0; i < adapter->num_tx_queues; i++) | 160 | for (i = 0; i < adapter->num_tx_queues; i++) |
@@ -165,8 +164,7 @@ vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue) | |||
165 | } else { | 164 | } else { |
166 | printk(KERN_INFO "%s: NIC Link is Down\n", | 165 | printk(KERN_INFO "%s: NIC Link is Down\n", |
167 | adapter->netdev->name); | 166 | adapter->netdev->name); |
168 | if (netif_carrier_ok(adapter->netdev)) | 167 | netif_carrier_off(adapter->netdev); |
169 | netif_carrier_off(adapter->netdev); | ||
170 | 168 | ||
171 | if (affectTxQueue) { | 169 | if (affectTxQueue) { |
172 | for (i = 0; i < adapter->num_tx_queues; i++) | 170 | for (i = 0; i < adapter->num_tx_queues; i++) |
@@ -3061,6 +3059,7 @@ vmxnet3_probe_device(struct pci_dev *pdev, | |||
3061 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); | 3059 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); |
3062 | netif_set_real_num_rx_queues(adapter->netdev, adapter->num_rx_queues); | 3060 | netif_set_real_num_rx_queues(adapter->netdev, adapter->num_rx_queues); |
3063 | 3061 | ||
3062 | netif_carrier_off(netdev); | ||
3064 | err = register_netdev(netdev); | 3063 | err = register_netdev(netdev); |
3065 | 3064 | ||
3066 | if (err) { | 3065 | if (err) { |