From 64023735486350b8863490fbcf687b17eea62bf7 Mon Sep 17 00:00:00 2001 From: Ivan Boule Date: Wed, 23 Jan 2013 14:22:14 +0100 Subject: [PATCH] kni: fix build with kernel < 2.6.34 Signed-off-by: Ivan Boule Acked-by: Thomas Monjalon --- lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 */ -- 2.20.1