--- zzzz-none-000/linux-2.6.39.4/include/linux/netdevice.h 2011-08-03 19:43:28.000000000 +0000 +++ puma6-arm-6490-729/linux-2.6.39.4/include/linux/netdevice.h 2021-11-10 13:23:10.000000000 +0000 @@ -22,6 +22,9 @@ * * Moved to /usr/include/linux for NET3 */ + /*Includes Intel Corporation's changes/modifications dated: [2/3/2014]. + Changed/modified portions - Copyright © [2014], Intel Corporation. + */ #ifndef _LINUX_NETDEVICE_H #define _LINUX_NETDEVICE_H @@ -43,8 +46,18 @@ #include #include #include + +#ifdef CONFIG_TI_PACKET_PROCESSOR +#ifdef CONFIG_ARM_AVALANCHE_PPD +#include +#endif +#endif /* CONFIG_TI_PACKET_PROCESSOR */ + + #include + + #include #include #include @@ -168,6 +181,15 @@ #define MAX_HEADER (LL_MAX_HEADER + 48) #endif +#ifdef CONFIG_TI_DEVICE_INDEX_REUSE +/* Maximum number of net devices supported. TI L2 Selective forwarder uses + * 64 bits to mark the packet to indicate the device on which the packets should + * be forwarded. Hence Max Device Index is limited to 64. + * Do not increment the number. + */ +#define TI_MAX_DEVICE_INDEX 64 +#endif /* CONFIG_TI_DEVICE_INDEX_REUSE */ + /* * Old network device statistics. Fields are native words * (unsigned long) so they can be read and written atomically. @@ -361,6 +383,10 @@ unsigned long state; int weight; + /* #ifdef CONFIG_AVM_NAPI_DRIVER_REGULATION; always compiled-in + * to avoid making out-of-tree modules incompatible on toggle. + */ + int driver_weight; int (*poll)(struct napi_struct *, int); #ifdef CONFIG_NETPOLL spinlock_t poll_lock; @@ -573,7 +599,7 @@ unsigned long trans_start; } ____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 __attribute__((unused))) { #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) return q->numa_node; @@ -582,7 +608,7 @@ #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 __attribute__((unused)), int node __attribute__((unused))) { #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) q->numa_node = node; @@ -889,6 +915,9 @@ * */ #define HAVE_NET_DEVICE_OPS + + + struct net_device_ops { int (*ndo_init)(struct net_device *dev); void (*ndo_uninit)(struct net_device *dev); @@ -1337,6 +1366,76 @@ /* n-tuple filter list attached to this device */ struct ethtool_rx_ntuple_list ethtool_ntuple_list; +#ifdef CONFIG_TI_DEVICE_PROTOCOL_HANDLING + int (*packet_handler)(struct sk_buff *skb); +#endif + +#ifdef CONFIG_INTEL_NS_DEVICE_FILTER + int (*ns_handler)(struct net_device *dev,struct in6_addr* dst_addr,unsigned char banned_flags); +#endif + +#ifdef CONFIG_TI_EGRESS_HOOK + int (*egress_hook)(struct sk_buff *skb); +#endif + +#ifdef CONFIG_TI_DOCSIS_EGRESS_HOOK + int (*docsis_egress_hook)(struct sk_buff *skb); +#endif + +#ifdef CONFIG_TI_GW_EGRESS_HOOK + int (*gw_egress_hook)(struct sk_buff *skb); +#endif + +#ifdef CONFIG_TI_PACKET_PROCESSOR + struct ti_pa_dev_info { + /* PPM Device Information. Each networking device can be considered as a VPID + * instance executing on a PID. The PID is created when the hardware associated + * with the device has been initialized; the VPID Information is initialized and + * every subsequent call to bring the interface UP and DOWN results in VPID + * creation and deletion. Virtual networking interfaces do not have a matching + * VPID. So if the PID handle is -1 then there is no VPID manipulation done on the + * device. */ + int pid_handle; + int vpid_handle; + + /* The VPID Information block which is associated with the networking device. + * This field is kept in the networking device because it gives us a convenient + * place to store all the VPID specific information. As mentioned above not all + * networking devices are a networking endpoint. In such cases the values in this + * structure are ignored. */ + #ifdef CONFIG_MACH_PUMA5 + TI_PP_VPID vpid_block; + #else + AVALANCHE_PP_VPID_INFO_t vpid_block; + #endif + + /* There QoS may be defined either for physical or virtual device + The QoS setting hooks are being triggered by PID creation. + In case there is a need in alternative QoS scheme to be created it can be + specified by setting the qos_virtual_scheme_idx to a valid non default index + This alternative scheme creation is being triggered from VPID creation. + It has to be defined by the appropriate device drived */ + #define NETDEV_PP_QOS_PROFILE_DEFAULT (-1) + int qos_virtual_scheme_idx; + + int (*qos_setup_hook) (struct net_device *dev_p); + int (*qos_shutdown_hook)(struct net_device *dev_p); + int (*qos_select_hook) (struct sk_buff *skb); + + } avalanche_pa; + + int devInstance; +#endif +#define PA_DEVINFO(dev) (&(dev)->avalanche_pa) +#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 + + /* phy device may attach itself for hardware timestamping */ struct phy_device *phydev; @@ -1421,13 +1520,13 @@ * Net namespace inlines */ static inline -struct net *dev_net(const struct net_device *dev) +struct net *dev_net(const struct net_device *dev __attribute__((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 __attribute__((unused)), struct net *net __attribute__((unused))) { #ifdef CONFIG_NET_NS release_net(dev->nd_net); @@ -1435,7 +1534,7 @@ #endif } -static inline bool netdev_uses_dsa_tags(struct net_device *dev) +static inline bool netdev_uses_dsa_tags(struct net_device *dev __attribute__((unused))) { #ifdef CONFIG_NET_DSA_TAG_DSA if (dev->dsa_ptr != NULL) @@ -1454,7 +1553,7 @@ void skb_set_dev(struct sk_buff *skb, struct net_device *dev); #endif -static inline bool netdev_uses_trailer_tags(struct net_device *dev) +static inline bool netdev_uses_trailer_tags(struct net_device *dev __attribute__((unused))) { #ifdef CONFIG_NET_DSA_TAG_TRAILER if (dev->dsa_ptr != NULL) @@ -1547,6 +1646,13 @@ int (*gro_complete)(struct sk_buff *skb); void *af_packet_priv; struct list_head list; +#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 }; #include @@ -1758,15 +1864,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; @@ -2021,8 +2127,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; } @@ -2103,7 +2209,8 @@ struct sk_buff *skb); extern int netdev_budget; - +extern int netdev_min_weight; +extern int netdev_max_weight; /* Called by rtnetlink.c:rtnl_unlock() */ extern void netdev_run_todo(void); @@ -2274,7 +2381,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; @@ -2563,7 +2670,7 @@ static inline int net_gso_ok(u32 features, int gso_type) { int feature = gso_type << NETIF_F_GSO_SHIFT; - return (features & feature) == feature; + return (int)(features & feature) == feature; } static inline int skb_gso_ok(struct sk_buff *skb, u32 features) @@ -2745,6 +2852,13 @@ }) #endif + +#ifdef CONFIG_TI_DEVICE_PROTOCOL_HANDLING +extern int ti_register_protocol_handler (struct net_device* dev, int (*packet_handler)(struct sk_buff *skb)); +extern int ti_deregister_protocol_handler (struct net_device* dev); +#endif /* CONFIG_TI_DEVICE_PROTOCOL_HANDLING */ + + #endif /* __KERNEL__ */ #endif /* _LINUX_NETDEVICE_H */