aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/ixgb')
-rw-r--r--drivers/net/ethernet/intel/ixgb/ixgb.h2
-rw-r--r--drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c59
-rw-r--r--drivers/net/ethernet/intel/ixgb/ixgb_main.c31
3 files changed, 31 insertions, 61 deletions
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb.h b/drivers/net/ethernet/intel/ixgb/ixgb.h
index 49e8408f05fc..cb23448fe2fa 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb.h
+++ b/drivers/net/ethernet/intel/ixgb/ixgb.h
@@ -204,6 +204,8 @@ extern void ixgb_set_ethtool_ops(struct net_device *netdev);
204extern char ixgb_driver_name[]; 204extern char ixgb_driver_name[];
205extern const char ixgb_driver_version[]; 205extern const char ixgb_driver_version[];
206 206
207extern void ixgb_set_speed_duplex(struct net_device *netdev);
208
207extern int ixgb_up(struct ixgb_adapter *adapter); 209extern int ixgb_up(struct ixgb_adapter *adapter);
208extern void ixgb_down(struct ixgb_adapter *adapter, bool kill_watchdog); 210extern void ixgb_down(struct ixgb_adapter *adapter, bool kill_watchdog);
209extern void ixgb_reset(struct ixgb_adapter *adapter); 211extern void ixgb_reset(struct ixgb_adapter *adapter);
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
118static void ixgb_set_speed_duplex(struct net_device *netdev) 118void 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
197static u32 197static u32
198ixgb_get_rx_csum(struct net_device *netdev)
199{
200 struct ixgb_adapter *adapter = netdev_priv(netdev);
201
202 return adapter->rx_csum;
203}
204
205static int
206ixgb_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
221static u32
222ixgb_get_tx_csum(struct net_device *netdev)
223{
224 return (netdev->features & NETIF_F_HW_CSUM) != 0;
225}
226
227static int
228ixgb_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
238static int
239ixgb_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
248static u32
249ixgb_get_msglevel(struct net_device *netdev) 198ixgb_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,
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index c8b9c9028bc0..b8fb16304598 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -325,6 +325,28 @@ ixgb_reset(struct ixgb_adapter *adapter)
325 } 325 }
326} 326}
327 327
328static int
329ixgb_set_features(struct net_device *netdev, u32 features)
330{
331 struct ixgb_adapter *adapter = netdev_priv(netdev);
332 u32 changed = features ^ netdev->features;
333
334 if (!(changed & NETIF_F_RXCSUM))
335 return 0;
336
337 adapter->rx_csum = !!(features & NETIF_F_RXCSUM);
338
339 if (netif_running(netdev)) {
340 ixgb_down(adapter, true);
341 ixgb_up(adapter);
342 ixgb_set_speed_duplex(netdev);
343 } else
344 ixgb_reset(adapter);
345
346 return 0;
347}
348
349
328static const struct net_device_ops ixgb_netdev_ops = { 350static const struct net_device_ops ixgb_netdev_ops = {
329 .ndo_open = ixgb_open, 351 .ndo_open = ixgb_open,
330 .ndo_stop = ixgb_close, 352 .ndo_stop = ixgb_close,
@@ -340,6 +362,7 @@ static const struct net_device_ops ixgb_netdev_ops = {
340#ifdef CONFIG_NET_POLL_CONTROLLER 362#ifdef CONFIG_NET_POLL_CONTROLLER
341 .ndo_poll_controller = ixgb_netpoll, 363 .ndo_poll_controller = ixgb_netpoll,
342#endif 364#endif
365 .ndo_set_features = ixgb_set_features,
343}; 366};
344 367
345/** 368/**
@@ -439,12 +462,14 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
439 if (err) 462 if (err)
440 goto err_sw_init; 463 goto err_sw_init;
441 464
442 netdev->features = NETIF_F_SG | 465 netdev->hw_features = NETIF_F_SG |
443 NETIF_F_HW_CSUM | 466 NETIF_F_TSO |
467 NETIF_F_HW_CSUM;
468 netdev->features = netdev->hw_features |
444 NETIF_F_HW_VLAN_TX | 469 NETIF_F_HW_VLAN_TX |
445 NETIF_F_HW_VLAN_RX | 470 NETIF_F_HW_VLAN_RX |
446 NETIF_F_HW_VLAN_FILTER; 471 NETIF_F_HW_VLAN_FILTER;
447 netdev->features |= NETIF_F_TSO; 472 netdev->hw_features |= NETIF_F_RXCSUM;
448 473
449 if (pci_using_dac) { 474 if (pci_using_dac) {
450 netdev->features |= NETIF_F_HIGHDMA; 475 netdev->features |= NETIF_F_HIGHDMA;