diff options
author | Alexander Beregalov <a.beregalov@gmail.com> | 2009-04-09 11:56:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-11 05:06:45 -0400 |
commit | 15efc02b2625f1bb2b1970b1f4bc777590b9ed73 (patch) | |
tree | 1551140a5dff95f67447bb6b8982b450f1a53873 /drivers | |
parent | 8c02acd79867077508ffa5ed4eb6c8c79df73a96 (diff) |
ibm_newemac: convert to netdev_ops
Reported-by: Subrata Modak <subrata@linux.vnet.ibm.com>
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ibm_newemac/core.c | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 77e4b5b52fc8..806533c831c7 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -2686,6 +2686,32 @@ static int __devinit emac_init_config(struct emac_instance *dev) | |||
2686 | return 0; | 2686 | return 0; |
2687 | } | 2687 | } |
2688 | 2688 | ||
2689 | static const struct net_device_ops emac_netdev_ops = { | ||
2690 | .ndo_open = emac_open, | ||
2691 | .ndo_stop = emac_close, | ||
2692 | .ndo_get_stats = emac_stats, | ||
2693 | .ndo_set_multicast_list = emac_set_multicast_list, | ||
2694 | .ndo_do_ioctl = emac_ioctl, | ||
2695 | .ndo_tx_timeout = emac_tx_timeout, | ||
2696 | .ndo_validate_addr = eth_validate_addr, | ||
2697 | .ndo_set_mac_address = eth_mac_addr, | ||
2698 | .ndo_start_xmit = emac_start_xmit, | ||
2699 | .ndo_change_mtu = eth_change_mtu, | ||
2700 | }; | ||
2701 | |||
2702 | static const struct net_device_ops emac_gige_netdev_ops = { | ||
2703 | .ndo_open = emac_open, | ||
2704 | .ndo_stop = emac_close, | ||
2705 | .ndo_get_stats = emac_stats, | ||
2706 | .ndo_set_multicast_list = emac_set_multicast_list, | ||
2707 | .ndo_do_ioctl = emac_ioctl, | ||
2708 | .ndo_tx_timeout = emac_tx_timeout, | ||
2709 | .ndo_validate_addr = eth_validate_addr, | ||
2710 | .ndo_set_mac_address = eth_mac_addr, | ||
2711 | .ndo_start_xmit = emac_start_xmit_sg, | ||
2712 | .ndo_change_mtu = emac_change_mtu, | ||
2713 | }; | ||
2714 | |||
2689 | static int __devinit emac_probe(struct of_device *ofdev, | 2715 | static int __devinit emac_probe(struct of_device *ofdev, |
2690 | const struct of_device_id *match) | 2716 | const struct of_device_id *match) |
2691 | { | 2717 | { |
@@ -2827,23 +2853,14 @@ static int __devinit emac_probe(struct of_device *ofdev, | |||
2827 | if (err != 0) | 2853 | if (err != 0) |
2828 | goto err_detach_tah; | 2854 | goto err_detach_tah; |
2829 | 2855 | ||
2830 | /* Fill in the driver function table */ | ||
2831 | ndev->open = &emac_open; | ||
2832 | if (dev->tah_dev) | 2856 | if (dev->tah_dev) |
2833 | ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; | 2857 | ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; |
2834 | ndev->tx_timeout = &emac_tx_timeout; | ||
2835 | ndev->watchdog_timeo = 5 * HZ; | 2858 | ndev->watchdog_timeo = 5 * HZ; |
2836 | ndev->stop = &emac_close; | ||
2837 | ndev->get_stats = &emac_stats; | ||
2838 | ndev->set_multicast_list = &emac_set_multicast_list; | ||
2839 | ndev->do_ioctl = &emac_ioctl; | ||
2840 | if (emac_phy_supports_gige(dev->phy_mode)) { | 2859 | if (emac_phy_supports_gige(dev->phy_mode)) { |
2841 | ndev->hard_start_xmit = &emac_start_xmit_sg; | 2860 | ndev->netdev_ops = &emac_gige_netdev_ops; |
2842 | ndev->change_mtu = &emac_change_mtu; | ||
2843 | dev->commac.ops = &emac_commac_sg_ops; | 2861 | dev->commac.ops = &emac_commac_sg_ops; |
2844 | } else { | 2862 | } else |
2845 | ndev->hard_start_xmit = &emac_start_xmit; | 2863 | ndev->netdev_ops = &emac_netdev_ops; |
2846 | } | ||
2847 | SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops); | 2864 | SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops); |
2848 | 2865 | ||
2849 | netif_carrier_off(ndev); | 2866 | netif_carrier_off(ndev); |