From: Ivan Boule Date: Wed, 23 Jan 2013 13:22:14 +0000 (+0100) Subject: kni: fix build with kernel < 2.6.34 X-Git-Tag: spdx-start~11286 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=64023735486350b8863490fbcf687b17eea62bf7;p=dpdk.git kni: fix build with kernel < 2.6.34 Signed-off-by: Ivan Boule Acked-by: Thomas Monjalon --- diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c index 8f13ba4f7d..bb87451603 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c @@ -190,11 +190,25 @@ static int igb_runtime_resume(struct device *dev); static int igb_runtime_idle(struct device *dev); #endif /* CONFIG_PM_RUNTIME */ static const struct dev_pm_ops igb_pm_ops = { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) + .suspend = igb_suspend, + .resume = igb_resume, + .freeze = igb_suspend, + .thaw = igb_resume, + .poweroff = igb_suspend, + .restore = igb_resume, +#ifdef CONFIG_PM_RUNTIME + .runtime_suspend = igb_runtime_suspend, + .runtime_resume = igb_runtime_resume, + .runtime_idle = igb_runtime_idle, +#endif +#else /* Linux >= 2.6.34 */ SET_SYSTEM_SLEEP_PM_OPS(igb_suspend, igb_resume) #ifdef CONFIG_PM_RUNTIME SET_RUNTIME_PM_OPS(igb_runtime_suspend, igb_runtime_resume, igb_runtime_idle) #endif /* CONFIG_PM_RUNTIME */ +#endif /* Linux version */ }; #endif /* HAVE_SYSTEM_SLEEP_PM_OPS */ #endif /* CONFIG_PM */