This repository has been archived by the owner on Jan 27, 2023. It is now read-only.
forked from freifunk-gluon/batman-adv-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compat.c
87 lines (72 loc) · 2.32 KB
/
compat.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* Copyright (C) 2007-2013 B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
*
*
* This file contains macros for maintaining compatibility with older versions
* of the Linux kernel.
*/
#include <linux/in.h>
#include <linux/version.h>
#include "main.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
void batadv_free_rcu_gw_node(struct rcu_head *rcu)
{
struct batadv_gw_node *gw_node;
gw_node = container_of(rcu, struct batadv_gw_node, rcu);
kfree(gw_node);
}
void batadv_free_rcu_neigh_node(struct rcu_head *rcu)
{
struct batadv_neigh_node *neigh_node;
neigh_node = container_of(rcu, struct batadv_neigh_node, rcu);
kfree(neigh_node);
}
void batadv_free_rcu_tt_local_entry(struct rcu_head *rcu)
{
struct batadv_tt_common_entry *tt_common_entry;
struct batadv_tt_local_entry *tt_local_entry;
tt_common_entry = container_of(rcu, struct batadv_tt_common_entry, rcu);
tt_local_entry = container_of(tt_common_entry,
struct batadv_tt_local_entry, common);
kfree(tt_local_entry);
}
#ifdef CONFIG_BATMAN_ADV_BLA
void batadv_free_rcu_backbone_gw(struct rcu_head *rcu)
{
struct batadv_bla_backbone_gw *backbone_gw;
backbone_gw = container_of(rcu, struct batadv_bla_backbone_gw, rcu);
kfree(backbone_gw);
}
#endif
#ifdef CONFIG_BATMAN_ADV_DAT
void batadv_free_rcu_dat_entry(struct rcu_head *rcu)
{
struct batadv_dat_entry *dat_entry;
dat_entry = container_of(rcu, struct batadv_dat_entry, rcu);
kfree(dat_entry);
}
#endif
#ifdef CONFIG_BATMAN_ADV_NC
void batadv_free_rcu_nc_path(struct rcu_head *rcu)
{
struct batadv_nc_path *nc_path;
nc_path = container_of(rcu, struct batadv_nc_path, rcu);
kfree(nc_path);
}
#endif
#endif /* < KERNEL_VERSION(3, 0, 0) */