diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2011-06-08 04:39:40 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-09-16 21:26:37 -0400 |
commit | d7ccb8c2f2f73a9fcdb8fb0f3bcdd09746f3a9ef (patch) | |
tree | ef6f3869eb52d196825efd454f508537c0f26366 /drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c | |
parent | f78a5fda9116525809d088917638be912b85f838 (diff) |
ixgb: convert to ndo_fix_features
Private rx_csum flags are now duplicate of netdev->features & NETIF_F_RXCSUM.
Removing this needs deeper surgery.
Things noticed:
- ixgb has RX csum disabled by default
- HW VLAN acceleration probably can be toggled, but it's left as is
- the resets on RX csum offload change can probably be avoided
- there is A LOT of copy-and-pasted code here
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c | 59 |
1 files changed, 1 insertions, 58 deletions
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c b/drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c index 6da890b9534c..fdb30cc60173 100644 --- a/drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c +++ b/drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c | |||
@@ -115,7 +115,7 @@ ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | static void ixgb_set_speed_duplex(struct net_device *netdev) | 118 | void ixgb_set_speed_duplex(struct net_device *netdev) |
119 | { | 119 | { |
120 | struct ixgb_adapter *adapter = netdev_priv(netdev); | 120 | struct ixgb_adapter *adapter = netdev_priv(netdev); |
121 | /* be optimistic about our link, since we were up before */ | 121 | /* be optimistic about our link, since we were up before */ |
@@ -195,57 +195,6 @@ ixgb_set_pauseparam(struct net_device *netdev, | |||
195 | } | 195 | } |
196 | 196 | ||
197 | static u32 | 197 | static u32 |
198 | ixgb_get_rx_csum(struct net_device *netdev) | ||
199 | { | ||
200 | struct ixgb_adapter *adapter = netdev_priv(netdev); | ||
201 | |||
202 | return adapter->rx_csum; | ||
203 | } | ||
204 | |||
205 | static int | ||
206 | ixgb_set_rx_csum(struct net_device *netdev, u32 data) | ||
207 | { | ||
208 | struct ixgb_adapter *adapter = netdev_priv(netdev); | ||
209 | |||
210 | adapter->rx_csum = data; | ||
211 | |||
212 | if (netif_running(netdev)) { | ||
213 | ixgb_down(adapter, true); | ||
214 | ixgb_up(adapter); | ||
215 | ixgb_set_speed_duplex(netdev); | ||
216 | } else | ||
217 | ixgb_reset(adapter); | ||
218 | return 0; | ||
219 | } | ||
220 | |||
221 | static u32 | ||
222 | ixgb_get_tx_csum(struct net_device *netdev) | ||
223 | { | ||
224 | return (netdev->features & NETIF_F_HW_CSUM) != 0; | ||
225 | } | ||
226 | |||
227 | static int | ||
228 | ixgb_set_tx_csum(struct net_device *netdev, u32 data) | ||
229 | { | ||
230 | if (data) | ||
231 | netdev->features |= NETIF_F_HW_CSUM; | ||
232 | else | ||
233 | netdev->features &= ~NETIF_F_HW_CSUM; | ||
234 | |||
235 | return 0; | ||
236 | } | ||
237 | |||
238 | static int | ||
239 | ixgb_set_tso(struct net_device *netdev, u32 data) | ||
240 | { | ||
241 | if (data) | ||
242 | netdev->features |= NETIF_F_TSO; | ||
243 | else | ||
244 | netdev->features &= ~NETIF_F_TSO; | ||
245 | return 0; | ||
246 | } | ||
247 | |||
248 | static u32 | ||
249 | ixgb_get_msglevel(struct net_device *netdev) | 198 | ixgb_get_msglevel(struct net_device *netdev) |
250 | { | 199 | { |
251 | struct ixgb_adapter *adapter = netdev_priv(netdev); | 200 | struct ixgb_adapter *adapter = netdev_priv(netdev); |
@@ -736,14 +685,8 @@ static const struct ethtool_ops ixgb_ethtool_ops = { | |||
736 | .set_ringparam = ixgb_set_ringparam, | 685 | .set_ringparam = ixgb_set_ringparam, |
737 | .get_pauseparam = ixgb_get_pauseparam, | 686 | .get_pauseparam = ixgb_get_pauseparam, |
738 | .set_pauseparam = ixgb_set_pauseparam, | 687 | .set_pauseparam = ixgb_set_pauseparam, |
739 | .get_rx_csum = ixgb_get_rx_csum, | ||
740 | .set_rx_csum = ixgb_set_rx_csum, | ||
741 | .get_tx_csum = ixgb_get_tx_csum, | ||
742 | .set_tx_csum = ixgb_set_tx_csum, | ||
743 | .set_sg = ethtool_op_set_sg, | ||
744 | .get_msglevel = ixgb_get_msglevel, | 688 | .get_msglevel = ixgb_get_msglevel, |
745 | .set_msglevel = ixgb_set_msglevel, | 689 | .set_msglevel = ixgb_set_msglevel, |
746 | .set_tso = ixgb_set_tso, | ||
747 | .get_strings = ixgb_get_strings, | 690 | .get_strings = ixgb_get_strings, |
748 | .set_phys_id = ixgb_set_phys_id, | 691 | .set_phys_id = ixgb_set_phys_id, |
749 | .get_sset_count = ixgb_get_sset_count, | 692 | .get_sset_count = ixgb_get_sset_count, |