--- zzzz-none-000/linux-4.4.60/include/linux/netdevice.h 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-7490-727/linux-4.4.60/include/linux/netdevice.h 2021-02-04 17:41:59.000000000 +0000 @@ -52,6 +52,13 @@ #include #include +#ifdef CONFIG_AVM_PA +/* Cannot include avm_pa.h */ +struct avm_pa_dev_info; +/* transitional define to allow older avm_pa tags, to be removed */ +#define NETDEVICE_H_NO_AVM_PA_H 1 +#endif + struct netpoll_info; struct device; struct phy_device; @@ -133,7 +140,7 @@ */ #if defined(CONFIG_WLAN) || IS_ENABLED(CONFIG_AX25) -# if defined(CONFIG_MAC80211_MESH) +# if 1 || defined(CONFIG_MAC80211_MESH) # define LL_MAX_HEADER 128 # else # define LL_MAX_HEADER 96 @@ -180,7 +187,6 @@ unsigned long tx_compressed; }; - #include #include @@ -281,7 +287,6 @@ __LINK_STATE_DORMANT, }; - /* * This structure holds at boot time configured netdevice settings. They * are then used in the device probing. @@ -777,6 +782,17 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev, struct sk_buff *skb); +#ifdef CONFIG_RFS_ACCEL +typedef int (*set_rfs_filter_callback_t)(struct net_device *dev, + __be32 src, + __be32 dst, + __be16 sport, + __be16 dport, + u8 proto, + u16 rxq_index, + u32 action); +#endif + /* * This structure defines the management hooks for network devices. * The following hooks can be defined; unless noted otherwise, they are @@ -948,6 +964,15 @@ * Set hardware filter for RFS. rxq_index is the target queue index; * flow_id is a flow ID to be passed to rps_may_expire_flow() later. * Return the filter ID on success, or a negative error code. + * int (*ndo_register_rfs_filter(struct net_device *dev, + * set_rfs_filter_callback_t set_filter); + * Register callback to handle commands for low layer RFS filter engine. + * Return 0 on success, or a negative error code. + * + * Get Default VLAN tag + * int (*ndo_get_default_vlan_tag)(struct net_device *net); + * This api can be called by other modules to get + * the default vlan tag * * Slave management functions (for bridge, bonding, etc). * int (*ndo_add_slave)(struct net_device *dev, struct net_device *slave_dev); @@ -1163,6 +1188,9 @@ const struct sk_buff *skb, u16 rxq_index, u32 flow_id); + int (*ndo_register_rfs_filter)(struct net_device *dev, + set_rfs_filter_callback_t set_filter); + int (*ndo_get_default_vlan_tag)(struct net_device *net); #endif int (*ndo_add_slave)(struct net_device *dev, struct net_device *slave_dev); @@ -1297,6 +1325,13 @@ IFF_NO_QUEUE = 1<<21, IFF_OPENVSWITCH = 1<<22, IFF_L3MDEV_SLAVE = 1<<23, + IFF_NO_IP_ALIGN = 1<<24, + IFF_TUN_TAP = 1<<25, + IFF_PPP_L2TPV2 = 1<<26, + IFF_PPP_L2TPV3 = 1<<27, + IFF_PPP_PPTP = 1<<28, + IFF_GRE_V4_TAP = 1<<29, + IFF_GRE_V6_TAP = 1<<30, }; #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN @@ -1323,6 +1358,8 @@ #define IFF_NO_QUEUE IFF_NO_QUEUE #define IFF_OPENVSWITCH IFF_OPENVSWITCH #define IFF_L3MDEV_SLAVE IFF_L3MDEV_SLAVE +#define IFF_NO_IP_ALIGN IFF_NO_IP_ALIGN +#define IFF_TUN_TAP IFF_TUN_TAP /** * struct net_device - The DEVICE structure. @@ -1603,6 +1640,11 @@ const struct l3mdev_ops *l3mdev_ops; #endif +#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 + const struct header_ops *header_ops; unsigned int flags; @@ -1639,13 +1681,14 @@ struct netdev_hw_addr_list mc; struct netdev_hw_addr_list dev_addrs; + unsigned char local_addr_mask[MAX_ADDR_LEN]; + #ifdef CONFIG_SYSFS struct kset *queues_kset; #endif unsigned int promiscuity; unsigned int allmulti; - /* Protocol specific pointers */ #if IS_ENABLED(CONFIG_VLAN_8021Q) @@ -1668,6 +1711,10 @@ struct mpls_dev __rcu *mpls_ptr; #endif +#ifdef CONFIG_ETHERNET_PACKET_MANGLE + void *phy_ptr; /* PHY device specific data */ +#endif + /* * Cache lines mostly used on receive path (including eth_type_trans()) */ @@ -1676,7 +1723,6 @@ /* Interface address info used in eth_type_trans() */ unsigned char *dev_addr; - #ifdef CONFIG_SYSFS struct netdev_rx_queue *_rx; @@ -1769,6 +1815,11 @@ struct pcpu_vstats __percpu *vstats; }; +#ifdef CONFIG_AVM_PA + u8 avm_pa[32]; +#define AVM_PA_DEVINFO(dev) ((struct avm_pa_dev_info *) (dev)->avm_pa) +#endif + struct garp_port __rcu *garp_port; struct mrp_port __rcu *mrp_port; @@ -2048,6 +2099,12 @@ bool (*id_match)(struct packet_type *ptype, struct sock *sk); void *af_packet_priv; + +#ifdef CONFIG_AVM_PA + u8 avm_pa[32]; +#define AVM_PA_PTYPE_DEVINFO(ptype) ((struct avm_pa_dev_info *) (ptype)->avm_pa) +#endif + struct list_head list; }; @@ -2160,6 +2217,8 @@ #define NETDEV_CHANGEINFODATA 0x0018 #define NETDEV_BONDING_INFO 0x0019 #define NETDEV_PRECHANGEUPPER 0x001A +#define NETDEV_BR_JOIN 0x001B +#define NETDEV_BR_LEAVE 0x001C int register_netdevice_notifier(struct notifier_block *nb); int unregister_netdevice_notifier(struct notifier_block *nb); @@ -2194,7 +2253,6 @@ int call_netdevice_notifiers(unsigned long val, struct net_device *dev); - extern rwlock_t dev_base_lock; /* Device list lock */ #define for_each_netdev(net, d) \ @@ -2582,6 +2640,7 @@ */ struct softnet_data { struct list_head poll_list; + struct napi_struct *current_napi; struct sk_buff_head process_queue; /* stats */ @@ -3076,6 +3135,7 @@ gro_result_t napi_gro_frags(struct napi_struct *napi); struct packet_offload *gro_find_receive_by_type(__be16 type); struct packet_offload *gro_find_complete_by_type(__be16 type); +extern struct napi_struct *get_current_napi_context(void); static inline void napi_free_frags(struct napi_struct *napi) { @@ -3164,7 +3224,7 @@ */ static inline bool netif_carrier_ok(const struct net_device *dev) { - return !test_bit(__LINK_STATE_NOCARRIER, &dev->state); + return !test_bit(__LINK_STATE_NOCARRIER, &dev->state) || !strcmp(dev->name, "plc"); } unsigned long dev_trans_start(struct net_device *dev); @@ -3217,7 +3277,6 @@ return test_bit(__LINK_STATE_DORMANT, &dev->state); } - /** * netif_oper_up - test if device is operational * @dev: network device