datapath: Remove net_device_ops compatibility code.
authorJesse Gross <jesse@nicira.com>
Fri, 13 Sep 2013 21:16:35 +0000 (14:16 -0700)
committerJesse Gross <jesse@nicira.com>
Wed, 18 Sep 2013 04:08:40 +0000 (21:08 -0700)
The symbol HAVE_NET_DEVICE_OPS was changed in 3.1 but code the that
it was protecting dates back to before 2.6.32. Therefore, we can
just assume that net_device_ops exists in all cases and drop the
compat code.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
datapath/vport-internal_dev.c

index 8e65f71..738710e 100644 (file)
 #include "vport-internal_dev.h"
 #include "vport-netdev.h"
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)
-#define HAVE_NET_DEVICE_OPS
-#endif
-
 struct internal_dev {
        struct vport *vport;
 };
@@ -133,7 +129,6 @@ static void internal_dev_destructor(struct net_device *dev)
        free_netdev(dev);
 }
 
-#ifdef HAVE_NET_DEVICE_OPS
 static const struct net_device_ops internal_dev_netdev_ops = {
        .ndo_open = internal_dev_open,
        .ndo_stop = internal_dev_stop,
@@ -146,22 +141,12 @@ static const struct net_device_ops internal_dev_netdev_ops = {
        .ndo_get_stats = internal_dev_sys_stats,
 #endif
 };
-#endif
 
 static void do_setup(struct net_device *netdev)
 {
        ether_setup(netdev);
 
-#ifdef HAVE_NET_DEVICE_OPS
        netdev->netdev_ops = &internal_dev_netdev_ops;
-#else
-       netdev->get_stats = internal_dev_sys_stats;
-       netdev->hard_start_xmit = internal_dev_xmit;
-       netdev->open = internal_dev_open;
-       netdev->stop = internal_dev_stop;
-       netdev->set_mac_address = eth_mac_addr;
-       netdev->change_mtu = internal_dev_change_mtu;
-#endif
 
        netdev->priv_flags &= ~IFF_TX_SKB_SHARING;
        netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
@@ -293,11 +278,7 @@ const struct vport_ops ovs_internal_vport_ops = {
 
 int ovs_is_internal_dev(const struct net_device *netdev)
 {
-#ifdef HAVE_NET_DEVICE_OPS
        return netdev->netdev_ops == &internal_dev_netdev_ops;
-#else
-       return netdev->open == internal_dev_open;
-#endif
 }
 
 struct vport *ovs_internal_dev_get_vport(struct net_device *netdev)