/* SPDX-License-Identifier: GPL-2.0+ */ enum hwpa_backend_rv { HWPA_BACKEND_SUCCESS, /* required */ HWPA_BACKEND_ERR_INTERNAL, HWPA_BACKEND_ERR_TRACKER_LIMIT, HWPA_BACKEND_UNSUPPORTED_L4_PROTOCOL, HWPA_BACKEND_UNSUPPORTED_SESS_TYPE, HWPA_BACKEND_ERR_SUBSYS, HWPA_BACKEND_ERR_BAD_NET_DEV, HWPA_BACKEND_ERR_MEMORY, HWPA_BACKEND_ERR_SESS_CREATE, HWPA_BACKEND_ERR_CACHE, HWPA_BACKEND_ERR_SESS_REM, HWPA_BACKEND_ERR_BAD_HANDLE, HWPA_BACKEND_ERR_SYNC, HWPA_BACKEND_ERR_NO_NSS, HWPA_BACKEND_ERR_INVALID_SYNC, HWPA_BACKEND_ERR_MAGIC, HWPA_BACKEND_ERR_BAD_VLAN, HWPA_BACKEND_ERR_HW_WRITE, HWPA_BACKEND_ERR_BAD_PPPOE, HWPA_BACKEND_ERR_BAD_HIERARCHY, HWPA_BACKEND_ERR_BAD_NAT_MODE, HWPA_BACKEND_ERR_PROBE_FAILED, HWPA_BACKEND_ERR_FLUSHED_BY_AVM_PA, HWPA_BACKEND_ERR_HW_ACTIVATION, HWPA_BACKEND_ERR_BAD_MATCH, HWPA_BACKEND_ERR_BAD_OFFLOAD_STATE, }; #define HWPA_BACKEND_RV_DESC_INITIALIZER \ {\ [HWPA_BACKEND_SUCCESS] = "success",\ \ [HWPA_BACKEND_ERR_INTERNAL] = "internal error",\ [HWPA_BACKEND_ERR_TRACKER_LIMIT] = "NSS subsystem offloading limit reached",\ [HWPA_BACKEND_UNSUPPORTED_L4_PROTOCOL] = "unsupported L4 protocol",\ [HWPA_BACKEND_UNSUPPORTED_SESS_TYPE] = "unsupported session type",\ [HWPA_BACKEND_ERR_SUBSYS] = "subsystem or offloader could not be obtained",\ [HWPA_BACKEND_ERR_BAD_NET_DEV] = "bad net_device",\ [HWPA_BACKEND_ERR_MEMORY] = "memory error",\ [HWPA_BACKEND_ERR_SESS_CREATE] = "NSS offloading error",\ [HWPA_BACKEND_ERR_CACHE] = "kmem cache error",\ [HWPA_BACKEND_ERR_SESS_REM] = "NSS offloading removal error",\ [HWPA_BACKEND_ERR_BAD_HANDLE] = "bad hwpa handle",\ [HWPA_BACKEND_ERR_SYNC] = "sync error",\ [HWPA_BACKEND_ERR_NO_NSS] = "no nss",\ [HWPA_BACKEND_ERR_INVALID_SYNC] = "sync session not found",\ [HWPA_BACKEND_ERR_MAGIC] = "bad magic",\ [HWPA_BACKEND_ERR_HW_WRITE] = "failed to write rule to hw",\ [HWPA_BACKEND_ERR_BAD_PPPOE] = "unsupported or bad pppoe",\ [HWPA_BACKEND_ERR_BAD_HIERARCHY] = "bad hierarchy",\ [HWPA_BACKEND_ERR_BAD_NAT_MODE] = "bad nat mode",\ [HWPA_BACKEND_ERR_PROBE_FAILED] = "failed probe",\ [HWPA_BACKEND_ERR_FLUSHED_BY_AVM_PA] = "flushed by avm_pa",\ [HWPA_BACKEND_ERR_HW_ACTIVATION] = "failed to activate HW",\ [HWPA_BACKEND_ERR_BAD_MATCH] = "bad or unsupported match",\ [HWPA_BACKEND_ERR_BAD_OFFLOAD_STATE] = "bad offload state",\ } #define HWPA_VALID_L2 \ { { .type = AVM_PA_NUM_MATCH_TYPES } }, \ \ { { .type = AVM_PA_ETH }, { .type = AVM_PA_NUM_MATCH_TYPES } }, \ \ { { .type = AVM_PA_ETH }, \ { .type = AVM_PA_VLAN }, \ { .type = AVM_PA_NUM_MATCH_TYPES } }, \ \ { { .type = AVM_PA_ETH }, \ { .type = AVM_PA_PPPOE }, \ { .type = AVM_PA_PPP }, \ { .type = AVM_PA_NUM_MATCH_TYPES } }, \ \ { { .type = AVM_PA_ETH }, \ { .type = AVM_PA_VLAN }, \ { .type = AVM_PA_PPPOE }, \ { .type = AVM_PA_PPP }, \ { .type = AVM_PA_NUM_MATCH_TYPES } }, \ #define HWPA_VALID_L3 \ { { .type = AVM_PA_IPV4 }, \ { .type = AVM_PA_PORTS }, \ { .type = AVM_PA_NUM_MATCH_TYPES }, }, \ \ { { .type = AVM_PA_IPV6 }, \ { .type = AVM_PA_PORTS }, \ { .type = AVM_PA_NUM_MATCH_TYPES }, }, \ /* No encapsulation yet */ #define HWPA_VALID_L3_L2ENCAP #define HWPA_VALID_L3_L3ENCAP #define HWPA_BESSIONS_ALLOWED 1 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); int try_to_accelerate(avm_pid_handle pid_handle, struct sk_buff *skb);