aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgb/ixgb_main.c
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2011-09-22 22:11:30 -0400
committerDavid S. Miller <davem@davemloft.net>2011-09-23 13:55:25 -0400
commitf04ea74e8aa5b95610bcd2fcb110ffa2ec665dcc (patch)
treea0739a25a187a0445f06cd49a3b50f06ddc1807c /drivers/net/ethernet/intel/ixgb/ixgb_main.c
parentac5ac789ebcf5b27e9edc231f6d33c92d722c607 (diff)
ixgb: finish conversion to ndo_fix_features
Finish conversion to unified ethtool ops: convert get_flags. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgb/ixgb_main.c')
-rw-r--r--drivers/net/ethernet/intel/ixgb/ixgb_main.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index ca3ab4a29ac4..88558b1aac07 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -325,13 +325,26 @@ ixgb_reset(struct ixgb_adapter *adapter)
325 } 325 }
326} 326}
327 327
328static u32
329ixgb_fix_features(struct net_device *netdev, u32 features)
330{
331 /*
332 * Tx VLAN insertion does not work per HW design when Rx stripping is
333 * disabled.
334 */
335 if (!(features & NETIF_F_HW_VLAN_RX))
336 features &= ~NETIF_F_HW_VLAN_TX;
337
338 return features;
339}
340
328static int 341static int
329ixgb_set_features(struct net_device *netdev, u32 features) 342ixgb_set_features(struct net_device *netdev, u32 features)
330{ 343{
331 struct ixgb_adapter *adapter = netdev_priv(netdev); 344 struct ixgb_adapter *adapter = netdev_priv(netdev);
332 u32 changed = features ^ netdev->features; 345 u32 changed = features ^ netdev->features;
333 346
334 if (!(changed & NETIF_F_RXCSUM)) 347 if (!(changed & (NETIF_F_RXCSUM|NETIF_F_HW_VLAN_RX)))
335 return 0; 348 return 0;
336 349
337 adapter->rx_csum = !!(features & NETIF_F_RXCSUM); 350 adapter->rx_csum = !!(features & NETIF_F_RXCSUM);
@@ -362,6 +375,7 @@ static const struct net_device_ops ixgb_netdev_ops = {
362#ifdef CONFIG_NET_POLL_CONTROLLER 375#ifdef CONFIG_NET_POLL_CONTROLLER
363 .ndo_poll_controller = ixgb_netpoll, 376 .ndo_poll_controller = ixgb_netpoll,
364#endif 377#endif
378 .ndo_fix_features = ixgb_fix_features,
365 .ndo_set_features = ixgb_set_features, 379 .ndo_set_features = ixgb_set_features,
366}; 380};
367 381
@@ -464,10 +478,10 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
464 478
465 netdev->hw_features = NETIF_F_SG | 479 netdev->hw_features = NETIF_F_SG |
466 NETIF_F_TSO | 480 NETIF_F_TSO |
467 NETIF_F_HW_CSUM; 481 NETIF_F_HW_CSUM |
468 netdev->features = netdev->hw_features |
469 NETIF_F_HW_VLAN_TX | 482 NETIF_F_HW_VLAN_TX |
470 NETIF_F_HW_VLAN_RX | 483 NETIF_F_HW_VLAN_RX;
484 netdev->features = netdev->hw_features |
471 NETIF_F_HW_VLAN_FILTER; 485 NETIF_F_HW_VLAN_FILTER;
472 netdev->hw_features |= NETIF_F_RXCSUM; 486 netdev->hw_features |= NETIF_F_RXCSUM;
473 487