From bd90926ab3a6ee8556950b8c30f6c4693446f4e3 Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Thu, 19 Nov 2009 13:53:33 +0100 Subject: [PATCH] Use net_device_ops also for EoE devices from 2.6.29 on. --- master/ethernet.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/master/ethernet.c b/master/ethernet.c index 40235b69..b3aa30a4 100644 --- a/master/ethernet.c +++ b/master/ethernet.c @@ -81,6 +81,17 @@ struct net_device_stats *ec_eoedev_stats(struct net_device *); /*****************************************************************************/ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) +static const struct net_device_ops ec_eoedev_ops = { + .ndo_open = ec_eoedev_open, + .ndo_stop = ec_eoedev_stop, + .ndo_start_xmit = ec_eoedev_tx, + .ndo_get_stats = ec_eoedev_stats, +}; +#endif + +/*****************************************************************************/ + /** EoE constructor. * * Initializes the EoE handler, creates a net_device and registers it. @@ -138,10 +149,14 @@ int ec_eoe_init( } // initialize net_device +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) + eoe->dev->netdev_ops = &ec_eoedev_ops; +#else eoe->dev->open = ec_eoedev_open; eoe->dev->stop = ec_eoedev_stop; eoe->dev->hard_start_xmit = ec_eoedev_tx; eoe->dev->get_stats = ec_eoedev_stats; +#endif for (i = 0; i < ETH_ALEN; i++) eoe->dev->dev_addr[i] = i | (i << 4);