/* * Copyright (c) 2021 AVM GmbH . * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ //TODO: Use that... 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, }; #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",\ } #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 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);