--- zzzz-none-000/linux-5.15.111/include/linux/netdevice.h 2023-05-11 14:00:40.000000000 +0000 +++ puma7-arm-6670-761/linux-5.15.111/include/linux/netdevice.h 2024-02-07 09:28:07.000000000 +0000 @@ -18,9 +18,21 @@ * * Moved to /usr/include/linux for NET3 */ + /* + * Includes Maxlinear's changes dated: 2021. + * Changed portions - Copyright (c) 2021 MaxLinear, Inc. + * Includes Intel Corporation's changes dated: 2014, 2018. + * Changed portions - Copyright (c) 2014-2018, Intel Corporation. + */ + #ifndef _LINUX_NETDEVICE_H #define _LINUX_NETDEVICE_H +#ifndef CONFIG_ARM_AVALANCHE_SOC +#include +#endif + +#include #include #include #include @@ -31,6 +43,14 @@ #include #include +#ifdef CONFIG_TI_PACKET_PROCESSOR +#ifndef CONFIG_ARM_AVALANCHE_SOC +#include +#else +#include +#include +#endif +#endif /* CONFIG_TI_PACKET_PROCESSOR */ #include #include @@ -162,6 +182,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. @@ -1710,6 +1739,10 @@ ML_PRIV_CAN, }; +#ifdef CONFIG_INTEL_NS_DEVICE_FILTER +int intel_ns_handler (struct net_device *dev, const struct in6_addr* dst_addr, unsigned char banned_flags); +#endif + /** * struct net_device - The DEVICE structure. * @@ -2270,6 +2303,80 @@ #if IS_ENABLED(CONFIG_CGROUP_NET_PRIO) struct netprio_map __rcu *priomap; #endif + +#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, const 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 + /* 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; + + /* netdev_ops->ndo_get_stats / netdev_ops->ndo_get_stats64 returns + the statistics of the traffic at the slow path. + The function below adds the statistics of the fast path traffic*/ + void (*add_offload_stats)(struct net_device *dev, + struct rtnl_link_stats64 *storage); + + /* 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 + +#if PUMA7_OR_NEWER_SOC_TYPE + int (*netdev_copy_priv_hook)(struct net_device *newDev, struct net_device *origDev); + + /* For GMAC it will be set with NULL. for VLAN netdev we will set the original netdev pointer */ + struct net_device *parentDev; + + /* Hook for letting the net device set its own PSI during session creation */ + int (*netdev_set_psi_hook)(Uint32 *psi, struct sk_buff *skb, struct net_device *dev); +#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); + void (*qos_get_params_hook) (struct net_device *dev, Uint16 *egressQ, Uint32 *rate, Uint32 *shaper); + int devInstance; +#endif struct phy_device *phydev; struct sfp_bus *sfp_bus; struct lock_class_key *qdisc_tx_busylock; @@ -5459,6 +5566,12 @@ }) #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 */ + /* * The list of packet types we will receive (as opposed to discard) * and the routines to invoke.