diff options
author | Alexander Beregalov <a.beregalov@gmail.com> | 2009-04-09 13:27:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-11 05:53:54 -0400 |
commit | 531c6804a4299663c7fa798ebfa9dbf843e91e0e (patch) | |
tree | 390a026d13823997a6ce87ab6af5f4499fa99380 /drivers/net/arm | |
parent | fefbfb1e09cbcd5ad6fd595c52aa8f01dc4e1126 (diff) |
at91_ether: convert to net_device_ops
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/arm')
-rw-r--r-- | drivers/net/arm/at91_ether.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c index 442938d5038..7f4bc8ae546 100644 --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c | |||
@@ -577,7 +577,7 @@ static void at91ether_sethashtable(struct net_device *dev) | |||
577 | /* | 577 | /* |
578 | * Enable/Disable promiscuous and multicast modes. | 578 | * Enable/Disable promiscuous and multicast modes. |
579 | */ | 579 | */ |
580 | static void at91ether_set_rx_mode(struct net_device *dev) | 580 | static void at91ether_set_multicast_list(struct net_device *dev) |
581 | { | 581 | { |
582 | unsigned long cfg; | 582 | unsigned long cfg; |
583 | 583 | ||
@@ -808,7 +808,7 @@ static int at91ether_close(struct net_device *dev) | |||
808 | /* | 808 | /* |
809 | * Transmit packet. | 809 | * Transmit packet. |
810 | */ | 810 | */ |
811 | static int at91ether_tx(struct sk_buff *skb, struct net_device *dev) | 811 | static int at91ether_start_xmit(struct sk_buff *skb, struct net_device *dev) |
812 | { | 812 | { |
813 | struct at91_private *lp = netdev_priv(dev); | 813 | struct at91_private *lp = netdev_priv(dev); |
814 | 814 | ||
@@ -828,7 +828,7 @@ static int at91ether_tx(struct sk_buff *skb, struct net_device *dev) | |||
828 | 828 | ||
829 | dev->trans_start = jiffies; | 829 | dev->trans_start = jiffies; |
830 | } else { | 830 | } else { |
831 | printk(KERN_ERR "at91_ether.c: at91ether_tx() called, but device is busy!\n"); | 831 | printk(KERN_ERR "at91_ether.c: at91ether_start_xmit() called, but device is busy!\n"); |
832 | return 1; /* if we return anything but zero, dev.c:1055 calls kfree_skb(skb) | 832 | return 1; /* if we return anything but zero, dev.c:1055 calls kfree_skb(skb) |
833 | on this skb, he also reports -ENETDOWN and printk's, so either | 833 | on this skb, he also reports -ENETDOWN and printk's, so either |
834 | we free and return(0) or don't free and return 1 */ | 834 | we free and return(0) or don't free and return 1 */ |
@@ -965,6 +965,21 @@ static void at91ether_poll_controller(struct net_device *dev) | |||
965 | } | 965 | } |
966 | #endif | 966 | #endif |
967 | 967 | ||
968 | static const struct net_device_ops at91ether_netdev_ops = { | ||
969 | .ndo_open = at91ether_open, | ||
970 | .ndo_stop = at91ether_close, | ||
971 | .ndo_start_xmit = at91ether_start_xmit, | ||
972 | .ndo_get_stats = at91ether_stats, | ||
973 | .ndo_set_multicast_list = at91ether_set_multicast_list, | ||
974 | .ndo_set_mac_address = set_mac_address, | ||
975 | .ndo_do_ioctl = at91ether_ioctl, | ||
976 | .ndo_validate_addr = eth_validate_addr, | ||
977 | .ndo_change_mtu = eth_change_mtu, | ||
978 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
979 | .ndo_poll_controller = at91ether_poll_controller, | ||
980 | #endif | ||
981 | }; | ||
982 | |||
968 | /* | 983 | /* |
969 | * Initialize the ethernet interface | 984 | * Initialize the ethernet interface |
970 | */ | 985 | */ |
@@ -1005,17 +1020,8 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add | |||
1005 | spin_lock_init(&lp->lock); | 1020 | spin_lock_init(&lp->lock); |
1006 | 1021 | ||
1007 | ether_setup(dev); | 1022 | ether_setup(dev); |
1008 | dev->open = at91ether_open; | 1023 | dev->netdev_ops = &at91ether_netdev_ops; |
1009 | dev->stop = at91ether_close; | ||
1010 | dev->hard_start_xmit = at91ether_tx; | ||
1011 | dev->get_stats = at91ether_stats; | ||
1012 | dev->set_multicast_list = at91ether_set_rx_mode; | ||
1013 | dev->set_mac_address = set_mac_address; | ||
1014 | dev->ethtool_ops = &at91ether_ethtool_ops; | 1024 | dev->ethtool_ops = &at91ether_ethtool_ops; |
1015 | dev->do_ioctl = at91ether_ioctl; | ||
1016 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1017 | dev->poll_controller = at91ether_poll_controller; | ||
1018 | #endif | ||
1019 | 1025 | ||
1020 | SET_NETDEV_DEV(dev, &pdev->dev); | 1026 | SET_NETDEV_DEV(dev, &pdev->dev); |
1021 | 1027 | ||