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>
#include "vport-internal_dev.h"
#include "vport-netdev.h"
#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;
};
struct internal_dev {
struct vport *vport;
};
-#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,
static const struct net_device_ops internal_dev_netdev_ops = {
.ndo_open = internal_dev_open,
.ndo_stop = internal_dev_stop,
.ndo_get_stats = internal_dev_sys_stats,
#endif
};
.ndo_get_stats = internal_dev_sys_stats,
#endif
};
static void do_setup(struct net_device *netdev)
{
ether_setup(netdev);
static void do_setup(struct net_device *netdev)
{
ether_setup(netdev);
-#ifdef HAVE_NET_DEVICE_OPS
netdev->netdev_ops = &internal_dev_netdev_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;
netdev->priv_flags &= ~IFF_TX_SKB_SHARING;
netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
int ovs_is_internal_dev(const struct net_device *netdev)
{
int ovs_is_internal_dev(const struct net_device *netdev)
{
-#ifdef HAVE_NET_DEVICE_OPS
return netdev->netdev_ops == &internal_dev_netdev_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)
}
struct vport *ovs_internal_dev_get_vport(struct net_device *netdev)