summaryrefslogtreecommitdiff
path: root/drivers/ipoe
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2017-12-15 11:44:33 +0300
committerDmitry Kozlov <xeb@mail.ru>2017-12-15 11:44:33 +0300
commitd423bcad1a9f321c38c707232a625de856b04bc4 (patch)
tree5ff6ccd35fda80a58bd24f972dcfc86d5da07ba9 /drivers/ipoe
parent92925bfc047b32a6bb918fa6e01b8bb7e9216722 (diff)
downloadaccel-ppp-d423bcad1a9f321c38c707232a625de856b04bc4.tar.gz
accel-ppp-d423bcad1a9f321c38c707232a625de856b04bc4.zip
ipoe, vlan_mon: implemented support for centos 3.10 kernel
Diffstat (limited to 'drivers/ipoe')
-rw-r--r--drivers/ipoe/ipoe.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
index ceab7c9b..b0cd0d67 100644
--- a/drivers/ipoe/ipoe.c
+++ b/drivers/ipoe/ipoe.c
@@ -143,22 +143,15 @@ static struct net *pick_net(struct sk_buff *skb);
static const struct net_device_ops ipoe_netdev_ops;
static struct genl_family ipoe_nl_family;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) && RHEL_MAJOR < 7
static struct genl_multicast_group ipoe_nl_mcg;
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) || RHEL_MAJOR == 7
#define u64_stats_fetch_begin_bh u64_stats_fetch_begin_irq
#define u64_stats_fetch_retry_bh u64_stats_fetch_retry_irq
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)
-#ifndef u64_stats_fetch_begin_bh
-#define u64_stats_fetch_begin_bh u64_stats_fetch_begin_irq
-#define u64_stats_fetch_retry_bh u64_stats_fetch_retry_irq
-#endif
-#endif
-
#ifndef NETIF_F_HW_VLAN_FILTER
#define NETIF_F_HW_VLAN_FILTER NETIF_F_HW_VLAN_CTAG_FILTER
#endif
@@ -593,7 +586,7 @@ static void ipoe_process_queue(struct work_struct *w)
if (!report_skb) {
report_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (report_skb)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) && RHEL_MAJOR < 7
header = genlmsg_put(report_skb, 0, ipoe_nl_mcg.id, &ipoe_nl_family, 0, IPOE_REP_PKT);
#else
header = genlmsg_put(report_skb, 0, ipoe_nl_family.mcgrp_offset, &ipoe_nl_family, 0, IPOE_REP_PKT);
@@ -622,7 +615,7 @@ static void ipoe_process_queue(struct work_struct *w)
if (nla_nest_end(report_skb, ns) >= IPOE_NLMSG_SIZE) {
genlmsg_end(report_skb, header);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) && RHEL_MAJOR < 7
genlmsg_multicast(report_skb, 0, ipoe_nl_mcg.id, GFP_KERNEL);
#else
genlmsg_multicast(&ipoe_nl_family, report_skb, 0, 0, GFP_KERNEL);
@@ -658,7 +651,7 @@ nl_err:
if (report_skb) {
genlmsg_end(report_skb, header);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) && RHEL_MAJOR < 7
genlmsg_multicast(report_skb, 0, ipoe_nl_mcg.id, GFP_KERNEL);
#else
genlmsg_multicast(&ipoe_nl_family, report_skb, 0, 0, GFP_KERNEL);
@@ -1705,7 +1698,7 @@ static struct genl_family ipoe_nl_family = {
.maxattr = IPOE_ATTR_MAX,
};
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) && RHEL_MAJOR < 7
static struct genl_multicast_group ipoe_nl_mcg = {
.name = IPOE_GENL_MCG_PKT,
};
@@ -1746,7 +1739,7 @@ static int __init ipoe_init(void)
skb_queue_head_init(&ipoe_queue);
INIT_WORK(&ipoe_queue_work, ipoe_process_queue);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) && RHEL_MAJOR < 7
err = genl_register_family_with_ops(&ipoe_nl_family, ipoe_nl_ops, ARRAY_SIZE(ipoe_nl_ops));
#else
err = genl_register_family_with_ops_groups(&ipoe_nl_family, ipoe_nl_ops, ipoe_nl_mcgs);
@@ -1756,7 +1749,7 @@ static int __init ipoe_init(void)
return err;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) && RHEL_MAJOR < 7
err = genl_register_mc_group(&ipoe_nl_family, &ipoe_nl_mcg);
if (err < 0) {
printk(KERN_INFO "ipoe: can't register netlink multicast group\n");
@@ -1775,7 +1768,7 @@ static void __exit ipoe_fini(void)
struct net_device *dev;
int i;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) && RHEL_MAJOR < 7
genl_unregister_mc_group(&ipoe_nl_family, &ipoe_nl_mcg);
#endif
genl_unregister_family(&ipoe_nl_family);