--- zzzz-none-000/linux-3.10.107/include/linux/netdevice.h 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/include/linux/netdevice.h 2021-11-10 11:53:56.000000000 +0000 @@ -51,6 +51,10 @@ #include #include +#ifdef CONFIG_AVM_PA +#include +#endif + struct netpoll_info; struct device; struct phy_device; @@ -547,7 +551,8 @@ #endif } ____cacheline_aligned_in_smp; -static inline int netdev_queue_numa_node_read(const struct netdev_queue *q) +static inline int netdev_queue_numa_node_read( + const struct netdev_queue *q __maybe_unused) { #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) return q->numa_node; @@ -556,7 +561,9 @@ #endif } -static inline void netdev_queue_numa_node_write(struct netdev_queue *q, int node) +static inline void netdev_queue_numa_node_write( + struct netdev_queue *q __maybe_unused, + int node __maybe_unused) { #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) q->numa_node = node; @@ -1109,6 +1116,11 @@ const struct net_device_ops *netdev_ops; const struct ethtool_ops *ethtool_ops; +#ifdef CONFIG_ETHERNET_PACKET_MANGLE + void (*eth_mangle_rx)(struct net_device *dev, struct sk_buff *skb); + struct sk_buff *(*eth_mangle_tx)(struct net_device *dev, struct sk_buff *skb); +#endif + /* Hardware header description */ const struct header_ops *header_ops; @@ -1171,7 +1183,11 @@ struct inet6_dev __rcu *ip6_ptr; /* IPv6 specific data */ void *ax25_ptr; /* AX.25 specific data */ struct wireless_dev *ieee80211_ptr; /* IEEE 802.11 specific data, + assign before registering */ +#ifdef CONFIG_ETHERNET_PACKET_MANGLE + void *phy_ptr; /* PHY device specific data */ +#endif /* * Cache lines mostly used on receive path (including eth_type_trans()) @@ -1292,6 +1308,15 @@ struct pcpu_dstats __percpu *dstats; /* dummy stats */ struct pcpu_vstats __percpu *vstats; /* veth stats */ }; + +#ifdef CONFIG_AVM_PA + union { + struct avm_pa_dev_info devinfo; + u8 buf[32]; + } avm_pa; +#define AVM_PA_DEVINFO(dev) (&(dev)->avm_pa.devinfo) +#endif + /* GARP */ struct garp_port __rcu *garp_port; /* MRP */ @@ -1418,13 +1443,14 @@ * Net namespace inlines */ static inline -struct net *dev_net(const struct net_device *dev) +struct net *dev_net(const struct net_device *dev __maybe_unused) { return read_pnet(&dev->nd_net); } static inline -void dev_net_set(struct net_device *dev, struct net *net) +void dev_net_set(struct net_device *dev __maybe_unused, + struct net *net __maybe_unused) { #ifdef CONFIG_NET_NS release_net(dev->nd_net); @@ -1432,7 +1458,7 @@ #endif } -static inline bool netdev_uses_dsa_tags(struct net_device *dev) +static inline bool netdev_uses_dsa_tags(struct net_device *dev __maybe_unused) { #ifdef CONFIG_NET_DSA_TAG_DSA if (dev->dsa_ptr != NULL) @@ -1442,7 +1468,8 @@ return 0; } -static inline bool netdev_uses_trailer_tags(struct net_device *dev) +static inline bool netdev_uses_trailer_tags(struct net_device *dev + __maybe_unused) { #ifdef CONFIG_NET_DSA_TAG_TRAILER if (dev->dsa_ptr != NULL) @@ -1546,6 +1573,17 @@ bool (*id_match)(struct packet_type *ptype, struct sock *sk); void *af_packet_priv; + +#ifdef CONFIG_AVM_ENHANCED +#ifdef CONFIG_AVM_PA + union { + struct avm_pa_dev_info devinfo; + u8 buf[32]; + } avm_pa; +#define AVM_PA_PTYPE_DEVINFO(ptype) (&(ptype)->avm_pa.devinfo) +#endif +#endif + struct list_head list; }; @@ -1824,15 +1862,15 @@ struct napi_struct backlog; }; -static inline void input_queue_head_incr(struct softnet_data *sd) +static inline void input_queue_head_incr(struct softnet_data *sd __attribute__((unused))) { #ifdef CONFIG_RPS sd->input_queue_head++; #endif } -static inline void input_queue_tail_incr_save(struct softnet_data *sd, - unsigned int *qtail) +static inline void input_queue_tail_incr_save(struct softnet_data *sd __attribute__((unused)), + unsigned int *qtail __attribute__((unused))) { #ifdef CONFIG_RPS *qtail = ++sd->input_queue_tail; @@ -2004,7 +2042,8 @@ } static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue, - unsigned int pkts, unsigned int bytes) + unsigned int pkts __maybe_unused, + unsigned int bytes) { #ifdef CONFIG_BQL if (unlikely(!bytes)) @@ -2138,9 +2177,9 @@ extern int netif_set_xps_queue(struct net_device *dev, struct cpumask *mask, u16 index); #else -static inline int netif_set_xps_queue(struct net_device *dev, - struct cpumask *mask, - u16 index) +static inline int netif_set_xps_queue(struct net_device *dev __attribute__((unused)), + struct cpumask *mask __attribute__((unused)), + u16 index __attribute__((unused))) { return 0; } @@ -2174,8 +2213,8 @@ extern int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq); #else -static inline int netif_set_real_num_rx_queues(struct net_device *dev, - unsigned int rxq) +static inline int netif_set_real_num_rx_queues(struct net_device *dev __attribute__((unused)), + unsigned int rxq __attribute__((unused))) { return 0; } @@ -2256,9 +2295,18 @@ struct netdev_queue *txq); extern int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); +/* AVM: backport from 3.15 + * + * commit 1ee481fb4cf8044632fa869bafc41345afa5957b Allow modules to use is_skb_forwardable + */ +bool is_skb_forwardable(struct net_device *dev, + struct sk_buff *skb); extern int netdev_budget; +extern int acquire_offload_lock(struct net *net, const char *name); +extern void release_offload_lock(int in_offload_lock); + /* Called by rtnetlink.c:rtnl_unlock() */ extern void netdev_run_todo(void); @@ -2427,7 +2475,7 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits) { /* use default */ - if (debug_value < 0 || debug_value >= (sizeof(u32) * 8)) + if (debug_value < 0 || debug_value >= (int)(sizeof(u32) * 8)) return default_msg_enable_bits; if (debug_value == 0) /* no output */ return 0;