diff options
author | Shreyas Bhatewara <sbhatewara@vmware.com> | 2010-07-15 17:51:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-18 17:48:17 -0400 |
commit | 4a1745fc54e22e9fa928d72f97ee0e91449c9fd0 (patch) | |
tree | 8c8c9c224ea9c4b1b6e9bcc652a9df002cab26d8 /drivers | |
parent | 36227e88c2563de73f748aa7d85fffd7afffc1fb (diff) |
net-next: vmxnet3 fixes [3/5] Initialize link state at probe time
This change initializes the state of link at the time when driver is
loaded. The ethtool output for 'link detected' and 'link speed'
is thus valid even before the interface is brought up.
Signed-off-by: Shreyas Bhatewara <sbhatewara@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/vmxnet3/vmxnet3_drv.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index 0fbfc67e0f79..57d3850cca8d 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c | |||
@@ -132,7 +132,7 @@ vmxnet3_tq_stop(struct vmxnet3_tx_queue *tq, struct vmxnet3_adapter *adapter) | |||
132 | * Check the link state. This may start or stop the tx queue. | 132 | * Check the link state. This may start or stop the tx queue. |
133 | */ | 133 | */ |
134 | static void | 134 | static void |
135 | vmxnet3_check_link(struct vmxnet3_adapter *adapter) | 135 | vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue) |
136 | { | 136 | { |
137 | u32 ret; | 137 | u32 ret; |
138 | 138 | ||
@@ -145,14 +145,16 @@ vmxnet3_check_link(struct vmxnet3_adapter *adapter) | |||
145 | if (!netif_carrier_ok(adapter->netdev)) | 145 | if (!netif_carrier_ok(adapter->netdev)) |
146 | netif_carrier_on(adapter->netdev); | 146 | netif_carrier_on(adapter->netdev); |
147 | 147 | ||
148 | vmxnet3_tq_start(&adapter->tx_queue, adapter); | 148 | if (affectTxQueue) |
149 | vmxnet3_tq_start(&adapter->tx_queue, adapter); | ||
149 | } else { | 150 | } else { |
150 | printk(KERN_INFO "%s: NIC Link is Down\n", | 151 | printk(KERN_INFO "%s: NIC Link is Down\n", |
151 | adapter->netdev->name); | 152 | adapter->netdev->name); |
152 | if (netif_carrier_ok(adapter->netdev)) | 153 | if (netif_carrier_ok(adapter->netdev)) |
153 | netif_carrier_off(adapter->netdev); | 154 | netif_carrier_off(adapter->netdev); |
154 | 155 | ||
155 | vmxnet3_tq_stop(&adapter->tx_queue, adapter); | 156 | if (affectTxQueue) |
157 | vmxnet3_tq_stop(&adapter->tx_queue, adapter); | ||
156 | } | 158 | } |
157 | } | 159 | } |
158 | 160 | ||
@@ -167,7 +169,7 @@ vmxnet3_process_events(struct vmxnet3_adapter *adapter) | |||
167 | 169 | ||
168 | /* Check if link state has changed */ | 170 | /* Check if link state has changed */ |
169 | if (events & VMXNET3_ECR_LINK) | 171 | if (events & VMXNET3_ECR_LINK) |
170 | vmxnet3_check_link(adapter); | 172 | vmxnet3_check_link(adapter, true); |
171 | 173 | ||
172 | /* Check if there is an error on xmit/recv queues */ | 174 | /* Check if there is an error on xmit/recv queues */ |
173 | if (events & (VMXNET3_ECR_TQERR | VMXNET3_ECR_RQERR)) { | 175 | if (events & (VMXNET3_ECR_TQERR | VMXNET3_ECR_RQERR)) { |
@@ -1894,7 +1896,7 @@ vmxnet3_activate_dev(struct vmxnet3_adapter *adapter) | |||
1894 | * Check link state when first activating device. It will start the | 1896 | * Check link state when first activating device. It will start the |
1895 | * tx queue if the link is up. | 1897 | * tx queue if the link is up. |
1896 | */ | 1898 | */ |
1897 | vmxnet3_check_link(adapter); | 1899 | vmxnet3_check_link(adapter, true); |
1898 | 1900 | ||
1899 | napi_enable(&adapter->napi); | 1901 | napi_enable(&adapter->napi); |
1900 | vmxnet3_enable_all_intrs(adapter); | 1902 | vmxnet3_enable_all_intrs(adapter); |
@@ -2496,6 +2498,7 @@ vmxnet3_probe_device(struct pci_dev *pdev, | |||
2496 | } | 2498 | } |
2497 | 2499 | ||
2498 | set_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state); | 2500 | set_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state); |
2501 | vmxnet3_check_link(adapter, false); | ||
2499 | atomic_inc(&devices_found); | 2502 | atomic_inc(&devices_found); |
2500 | return 0; | 2503 | return 0; |
2501 | 2504 | ||