100-iegbe_netdev_ops.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --- a/Embedded/src/GbE/iegbe_main.c
  2. +++ b/Embedded/src/GbE/iegbe_main.c
  3. @@ -724,6 +724,26 @@ static void iegbe_dump_eeprom(struct ieg
  4. kfree(data);
  5. }
  6. +static const struct net_device_ops iegbe_netdev_ops = {
  7. + .ndo_open = iegbe_open,
  8. + .ndo_stop = iegbe_close,
  9. + .ndo_start_xmit = iegbe_xmit_frame,
  10. + .ndo_get_stats = iegbe_get_stats,
  11. + .ndo_set_rx_mode = iegbe_set_rx_mode,
  12. + .ndo_set_mac_address = iegbe_set_mac,
  13. + .ndo_tx_timeout = iegbe_tx_timeout,
  14. + .ndo_change_mtu = iegbe_change_mtu,
  15. + .ndo_do_ioctl = iegbe_ioctl,
  16. + .ndo_validate_addr = eth_validate_addr,
  17. +
  18. + .ndo_vlan_rx_register = iegbe_vlan_rx_register,
  19. + .ndo_vlan_rx_add_vid = iegbe_vlan_rx_add_vid,
  20. + .ndo_vlan_rx_kill_vid = iegbe_vlan_rx_kill_vid,
  21. +#ifdef CONFIG_NET_POLL_CONTROLLER
  22. + .ndo_poll_controller = iegbe_netpoll,
  23. +#endif
  24. +};
  25. +
  26. /**
  27. * iegbe_probe - Device Initialization Routine
  28. * @pdev: PCI device information struct
  29. @@ -800,24 +820,11 @@ static int __devinit iegbe_probe(struct
  30. if (!hw->hw_addr)
  31. goto err_ioremap;
  32. - netdev->open = &iegbe_open;
  33. - netdev->stop = &iegbe_close;
  34. - netdev->hard_start_xmit = &iegbe_xmit_frame;
  35. - netdev->get_stats = &iegbe_get_stats;
  36. - netdev->set_rx_mode = &iegbe_set_rx_mode;
  37. - netdev->set_mac_address = &iegbe_set_mac;
  38. - netdev->change_mtu = &iegbe_change_mtu;
  39. - netdev->do_ioctl = &iegbe_ioctl;
  40. + netdev->netdev_ops = &iegbe_netdev_ops;
  41. set_ethtool_ops(netdev);
  42. - netdev->tx_timeout = &iegbe_tx_timeout;
  43. netdev->watchdog_timeo = 5 * HZ;
  44. netif_napi_add(netdev, &adapter->napi, iegbe_clean, 64);
  45. - netdev->vlan_rx_register = iegbe_vlan_rx_register;
  46. - netdev->vlan_rx_add_vid = iegbe_vlan_rx_add_vid;
  47. - netdev->vlan_rx_kill_vid = iegbe_vlan_rx_kill_vid;
  48. -#ifdef CONFIG_NET_POLL_CONTROLLER
  49. - netdev->poll_controller = iegbe_netpoll;
  50. -#endif
  51. +
  52. strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);