diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-03-20 15:35:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-21 22:19:13 -0400 |
commit | 687c75dcf342f71329bd193af553e96a29581238 (patch) | |
tree | 44486e047227112d61c55e8597cc1e45b2e51d85 /drivers/infiniband/hw/amso1100/c2_provider.c | |
parent | dde09758557120cb71fb760cfeaed1b8e27209ef (diff) |
infiniband: convert c2 to net_device_ops
Convert this driver to new net_device_ops infrastructure.
Also use default net_device get-stats infrastructure
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/infiniband/hw/amso1100/c2_provider.c')
-rw-r--r-- | drivers/infiniband/hw/amso1100/c2_provider.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/infiniband/hw/amso1100/c2_provider.c b/drivers/infiniband/hw/amso1100/c2_provider.c index 5119d6508181..f1948fad85d7 100644 --- a/drivers/infiniband/hw/amso1100/c2_provider.c +++ b/drivers/infiniband/hw/amso1100/c2_provider.c | |||
@@ -708,26 +708,27 @@ static int c2_pseudo_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
708 | 708 | ||
709 | static int c2_pseudo_change_mtu(struct net_device *netdev, int new_mtu) | 709 | static int c2_pseudo_change_mtu(struct net_device *netdev, int new_mtu) |
710 | { | 710 | { |
711 | int ret = 0; | ||
712 | |||
713 | if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) | 711 | if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) |
714 | return -EINVAL; | 712 | return -EINVAL; |
715 | 713 | ||
716 | netdev->mtu = new_mtu; | 714 | netdev->mtu = new_mtu; |
717 | 715 | ||
718 | /* TODO: Tell rnic about new rmda interface mtu */ | 716 | /* TODO: Tell rnic about new rmda interface mtu */ |
719 | return ret; | 717 | return 0; |
720 | } | 718 | } |
721 | 719 | ||
720 | static const struct net_device_ops c2_pseudo_netdev_ops = { | ||
721 | .ndo_open = c2_pseudo_up, | ||
722 | .ndo_stop = c2_pseudo_down, | ||
723 | .ndo_start_xmit = c2_pseudo_xmit_frame, | ||
724 | .ndo_change_mtu = c2_pseudo_change_mtu, | ||
725 | .ndo_validate_addr = eth_validate_addr, | ||
726 | }; | ||
727 | |||
722 | static void setup(struct net_device *netdev) | 728 | static void setup(struct net_device *netdev) |
723 | { | 729 | { |
724 | netdev->open = c2_pseudo_up; | 730 | netdev->netdev_ops = &c2_pseudo_netdev_ops; |
725 | netdev->stop = c2_pseudo_down; | 731 | |
726 | netdev->hard_start_xmit = c2_pseudo_xmit_frame; | ||
727 | netdev->get_stats = NULL; | ||
728 | netdev->tx_timeout = NULL; | ||
729 | netdev->set_mac_address = NULL; | ||
730 | netdev->change_mtu = c2_pseudo_change_mtu; | ||
731 | netdev->watchdog_timeo = 0; | 732 | netdev->watchdog_timeo = 0; |
732 | netdev->type = ARPHRD_ETHER; | 733 | netdev->type = ARPHRD_ETHER; |
733 | netdev->mtu = 1500; | 734 | netdev->mtu = 1500; |
@@ -735,7 +736,6 @@ static void setup(struct net_device *netdev) | |||
735 | netdev->addr_len = ETH_ALEN; | 736 | netdev->addr_len = ETH_ALEN; |
736 | netdev->tx_queue_len = 0; | 737 | netdev->tx_queue_len = 0; |
737 | netdev->flags |= IFF_NOARP; | 738 | netdev->flags |= IFF_NOARP; |
738 | return; | ||
739 | } | 739 | } |
740 | 740 | ||
741 | static struct net_device *c2_pseudo_netdev_init(struct c2_dev *c2dev) | 741 | static struct net_device *c2_pseudo_netdev_init(struct c2_dev *c2dev) |