--- zzzz-none-000/linux-2.6.32.61/include/linux/rtnetlink.h 2013-06-10 09:43:48.000000000 +0000 +++ ar9-7330-650/linux-2.6.32.61/include/linux/rtnetlink.h 2014-08-12 13:03:17.000000000 +0000 @@ -113,6 +113,15 @@ RTM_SETDCB, #define RTM_SETDCB RTM_SETDCB + /* +++ AVM backport from 3.15 */ + RTM_NEWMDB = 84, +#define RTM_NEWMDB RTM_NEWMDB + RTM_DELMDB = 85, +#define RTM_DELMDB RTM_DELMDB + RTM_GETMDB = 86, +#define RTM_GETMDB RTM_GETMDB + /* +++ */ + __RTM_MAX, #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) }; @@ -167,6 +176,12 @@ unsigned char rtm_type; /* See below */ unsigned rtm_flags; +#ifdef CONFIG_MAPPING + unsigned char rtm_mapping; /* For mapping */ + unsigned long rtm_src_prefix; /* Mapping src prefix */ + unsigned long rtm_dst_prefix; /* Mapping dst prefix */ +#endif + }; /* rtm_type */ @@ -593,6 +608,16 @@ #define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_ROUTE, #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE + /* +++ AVM backport from 3.15 */ + RTNLGRP_DCB, +#define RTNLGRP_DCB RTNLGRP_DCB + RTNLGRP_IPV4_NETCONF, +#define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF + RTNLGRP_IPV6_NETCONF, +#define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF + RTNLGRP_MDB, +#define RTNLGRP_MDB RTNLGRP_MDB + /* +++ */ __RTNLGRP_MAX }; #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) @@ -750,11 +775,52 @@ extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); /* RTNL is used as a global lock for all changes to network configuration */ +extern void rtnl_offload_read_lock(void); +extern void rtnl_offload_read_unlock(void); +extern void rtnl_offload_write_lock(void); +extern void rtnl_offload_write_unlock(void); +extern void wait_for_link_to_offload_cpu(void); +extern void (*wait_for_link_to_offload_cpu_hook)(void); + extern void rtnl_lock(void); extern void rtnl_unlock(void); extern int rtnl_trylock(void); extern int rtnl_is_locked(void); +/* AVM: backport from 3.15. lockdep_rtnl_is_held() does not exist */ +#if 0 +#ifdef CONFIG_PROVE_LOCKING +extern int lockdep_rtnl_is_held(void); +#else +static inline int lockdep_rtnl_is_held(void) +{ + return 1; +} +#endif /* #ifdef CONFIG_PROVE_LOCKING */ +#else +static inline int lockdep_rtnl_is_held(void) { return 1; } +#endif +/** + * rcu_dereference_rtnl - rcu_dereference with debug checking + * @p: The pointer to read, prior to dereferencing + * + * Do an rcu_dereference(p), but check caller either holds rcu_read_lock() + * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference() + */ +#define rcu_dereference_rtnl(p) \ + rcu_dereference_check(p, lockdep_rtnl_is_held()) + +/** + * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL + * @p: The pointer to read, prior to dereferencing + * + * Return the value of the specified RCU-protected pointer, but omit + * both the smp_read_barrier_depends() and the ACCESS_ONCE(), because + * caller holds RTNL. + */ +#define rtnl_dereference(p) \ + rcu_dereference_protected(p, lockdep_rtnl_is_held()) + extern void rtnetlink_init(void); extern void __rtnl_unlock(void);