#ifndef COMPAT_FIX_H
#define COMPAT_FIX_H

#include "../../compat/config.h"

#ifdef CONFIG_MLX5_ESWITCH
#ifdef CONFIG_COMPAT_CLS_FLOWER_MOD
#ifndef CONFIG_NET_SCHED_NEW
#define HAVE_UNSUPPORTED_NDO_SETUP_TC 1
#endif
#endif

#ifdef CONFIG_COMPAT_TCF_TUNNEL_KEY_MOD
#define HAVE_NET_TC_ACT_TC_TUNNEL_KEY_H 1
#define HAVE_TCF_TUNNEL_INFO 1
#endif

#ifdef CONFIG_COMPAT_TCF_VLAN_MOD
#define HAVE_IS_TCF_VLAN 1
#endif
#else /* CONFIG_MLX5_ESWITCH */
#undef CONFIG_COMPAT_IP_TUNNELS
#undef CONFIG_COMPAT_TCF_GACT
#undef CONFIG_COMPAT_FLOW_DISSECTOR
#undef CONFIG_COMPAT_CLS_FLOWER_MOD
#undef CONFIG_COMPAT_TCF_TUNNEL_KEY_MOD
#undef CONFIG_COMPAT_TCF_VLAN_MOD
#endif

#ifdef CONFIG_COMPAT_TCF_PEDIT_MOD
#define HAVE_TCF_PEDIT_TCFP_KEYS_EX 1
#endif

#if defined(HAVE_TC_CLS_OFFLOAD_HANDLE) && defined(CONFIG_COMPAT_RHEL_JD)
#define CONFIG_COMPAT_SKIP_OFFLOAD_HANDLE 1
#endif

#ifdef HAVE_FLOW_CLS_OFFLOAD
#define HAVE_TC_CLS_OFFLOAD_EXTACK 1
#define HAVE_TC_CLSFLOWER_STATS 1
#define HAVE_TC_CLS_FLOWER_OFFLOAD_HAS_STATS_FIELD 1
#define HAVE_TC_CLS_FLOWER_OFFLOAD_COMMON 1
#endif

#if defined(HAVE_TC_CLS_FLOWER_OFFLOAD_COMMON) && \
    defined(HAVE_IS_TCF_GACT_GOTO_CHAIN) && \
    defined(HAVE_FLOWER_MULTI_MASK)
#define CONFIG_COMPAT_PRIO_CHAIN_SUPPORT 1
#endif

#ifdef HAVE_TC_SETUP_FLOW_ACTION_WITH_RTNL_HELD
#define HAVE_TC_SETUP_FLOW_ACTION 1
#endif

#if defined(HAVE___TC_INDR_BLOCK_CB_REGISTER) || defined(HAVE___FLOW_INDR_BLOCK_CB_REGISTER) || defined(HAVE_FLOW_BLOCK_CB)
#define HAVE_TC_INDR_API 1
#endif

#endif /* COMPAT_FIX_H */
