Skip to content

Commit

Permalink
datapath: Remove net_device_ops compatibility code.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Pravin B Shelar <[email protected]>
  • Loading branch information
jessegross committed Sep 18, 2013
1 parent b826639 commit efa0521
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions datapath/vport-internal_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
#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;
};
Expand Down Expand Up @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit efa0521

Please sign in to comment.