diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2006-05-23 13:29:46 -0400 |
---|---|---|
committer | Auke Kok <juke-jan.h.kok@intel.com> | 2006-05-23 13:29:46 -0400 |
commit | 4de17c8c7295d32d4e112e214aa90d8f7006972f (patch) | |
tree | a484ef4d60c9efc274dcfbcae573aecc16e53fa5 /drivers/net | |
parent | 96f9c2e277768099479fbed7c3b69c294b1fadef (diff) |
ixgb: remove duplicate code setting duplex and speed
Removed duplicate code. Create ixgb_set_speed_duplex function to contain
duplicate code.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ixgb/ixgb_ethtool.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c index d38ade5f2f4e..4db63e01a62b 100644 --- a/drivers/net/ixgb/ixgb_ethtool.c +++ b/drivers/net/ixgb/ixgb_ethtool.c | |||
@@ -117,6 +117,16 @@ ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
117 | return 0; | 117 | return 0; |
118 | } | 118 | } |
119 | 119 | ||
120 | static void ixgb_set_speed_duplex(struct net_device *netdev) | ||
121 | { | ||
122 | struct ixgb_adapter *adapter = netdev_priv(netdev); | ||
123 | /* be optimistic about our link, since we were up before */ | ||
124 | adapter->link_speed = 10000; | ||
125 | adapter->link_duplex = FULL_DUPLEX; | ||
126 | netif_carrier_on(netdev); | ||
127 | netif_wake_queue(netdev); | ||
128 | } | ||
129 | |||
120 | static int | 130 | static int |
121 | ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | 131 | ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) |
122 | { | 132 | { |
@@ -130,12 +140,7 @@ ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
130 | ixgb_down(adapter, TRUE); | 140 | ixgb_down(adapter, TRUE); |
131 | ixgb_reset(adapter); | 141 | ixgb_reset(adapter); |
132 | ixgb_up(adapter); | 142 | ixgb_up(adapter); |
133 | /* be optimistic about our link, since we were up before */ | 143 | ixgb_set_speed_duplex(netdev); |
134 | adapter->link_speed = 10000; | ||
135 | adapter->link_duplex = FULL_DUPLEX; | ||
136 | netif_carrier_on(netdev); | ||
137 | netif_wake_queue(netdev); | ||
138 | |||
139 | } else | 144 | } else |
140 | ixgb_reset(adapter); | 145 | ixgb_reset(adapter); |
141 | 146 | ||
@@ -183,11 +188,7 @@ ixgb_set_pauseparam(struct net_device *netdev, | |||
183 | if(netif_running(adapter->netdev)) { | 188 | if(netif_running(adapter->netdev)) { |
184 | ixgb_down(adapter, TRUE); | 189 | ixgb_down(adapter, TRUE); |
185 | ixgb_up(adapter); | 190 | ixgb_up(adapter); |
186 | /* be optimistic about our link, since we were up before */ | 191 | ixgb_set_speed_duplex(netdev); |
187 | adapter->link_speed = 10000; | ||
188 | adapter->link_duplex = FULL_DUPLEX; | ||
189 | netif_carrier_on(netdev); | ||
190 | netif_wake_queue(netdev); | ||
191 | } else | 192 | } else |
192 | ixgb_reset(adapter); | 193 | ixgb_reset(adapter); |
193 | 194 | ||
@@ -212,11 +213,7 @@ ixgb_set_rx_csum(struct net_device *netdev, uint32_t data) | |||
212 | if(netif_running(netdev)) { | 213 | if(netif_running(netdev)) { |
213 | ixgb_down(adapter,TRUE); | 214 | ixgb_down(adapter,TRUE); |
214 | ixgb_up(adapter); | 215 | ixgb_up(adapter); |
215 | /* be optimistic about our link, since we were up before */ | 216 | ixgb_set_speed_duplex(netdev); |
216 | adapter->link_speed = 10000; | ||
217 | adapter->link_duplex = FULL_DUPLEX; | ||
218 | netif_carrier_on(netdev); | ||
219 | netif_wake_queue(netdev); | ||
220 | } else | 217 | } else |
221 | ixgb_reset(adapter); | 218 | ixgb_reset(adapter); |
222 | return 0; | 219 | return 0; |
@@ -593,11 +590,7 @@ ixgb_set_ringparam(struct net_device *netdev, | |||
593 | adapter->tx_ring = tx_new; | 590 | adapter->tx_ring = tx_new; |
594 | if((err = ixgb_up(adapter))) | 591 | if((err = ixgb_up(adapter))) |
595 | return err; | 592 | return err; |
596 | /* be optimistic about our link, since we were up before */ | 593 | ixgb_set_speed_duplex(netdev); |
597 | adapter->link_speed = 10000; | ||
598 | adapter->link_duplex = FULL_DUPLEX; | ||
599 | netif_carrier_on(netdev); | ||
600 | netif_wake_queue(netdev); | ||
601 | } | 594 | } |
602 | 595 | ||
603 | return 0; | 596 | return 0; |