/* SPDX-License-Identifier: GPL-2.0+ */ #pragma once #include /* Struct for platform specific hwardware_pa configuration */ struct hwpa_backend_config { unsigned long flags; #define HWPA_PLATFORM_SPECIFIC_FLAGS_MASK AVM_HW_F_NO_BSESSION int (*alloc_rx_channel)(avm_pid_handle pid_handle); int (*alloc_tx_channel)(avm_pid_handle pid_handle); int (*free_rx_channel)(avm_pid_handle pid_handle); int (*free_tx_channel)(avm_pid_handle pid_handle); }; #define HWPA_BACKEND_HAS_SESSION_CHECK 0x10 #if HWPA_BACKEND_HAS_SESSION_CHECK & AVM_HW_F_ALL #error Flag is used by avm pa #endif enum { hw_handle_zero = 0, hw_handle_invalid = ~0, }; /* utilities */ int hwpa_pktcmp(const struct sk_buff *skb1,const struct sk_buff *skb2); const void *hwpa_get_hdr(const struct avm_pa_pkt_match *match, unsigned char type); struct sk_buff *hwpa_pkt_push_tcp(struct sk_buff *skb); struct sk_buff *hwpa_pkt_push_udp(struct sk_buff *skb); struct sk_buff *hwpa_pkt_push_ipv4(struct sk_buff *skb); struct sk_buff *hwpa_pkt_push_ipv6(struct sk_buff *skb); struct sk_buff *hwpa_pkt_push_pppoe(struct sk_buff *skb); struct sk_buff *hwpa_pkt_push_vlan(struct sk_buff *skb); struct sk_buff *hwpa_pkt_push_eth(struct sk_buff *skb); struct sk_buff *hwpa_pkt_alloc(unsigned int payload); struct net_device *hwpa_get_netdev(avm_pid_handle pid); struct net_device *hwpa_get_and_hold_dev_master(struct net_device *dev); uint32_t hwpa_ipv4_gen_session_hash_raw(uint32_t flow_ip, uint32_t flow_ident, uint32_t return_ip_xlate, uint32_t return_ident_xlate, uint8_t protocol); uint32_t hwpa_ipv6_gen_session_hash_raw(uint32_t *flow_ip, uint32_t flow_ident, uint32_t *return_ip, uint32_t return_ident, uint8_t protocol); uint32_t hwpa_l2_gen_session_hash_raw(const uint8_t *smac, const uint8_t *dmac, const uint16_t vlan_tci);