/* * Copyright (c) 2019 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 . */ #define pr_fmt(fmt) "offload_dp: " fmt #include #include #include #include /* Remember to add descriptions to offdp_rv_names */ enum offdp_rv { OFFDP_SUCCESS = 0, OFFDP_ERR_BACKEND_INIT, OFFDP_ERR_MEM, OFFDP_ERR_DEV_RESOLVE, OFFDP_ERR_CONFLICT, OFFDP_ERR_NETLINK, OFFDP_ERR_SWAPI, OFFDP_ERR_NOAVAIL, OFFDP_ERR_FAST_RCV, OFFDP_ERR_VEP_LIMIT, OFFDP_ERR_VEP_NOT_VIRTUAL, OFFDP_ERR_VEP_EXISTS, OFFDP_ERR_KOBJ, OFFDP_ERR_INPUT, }; extern struct errstat_domain *edom; #define OFFDP_IS_ERR(rv) (errstat_track(edom, (rv)) != OFFDP_SUCCESS) enum offdp_rv offdp_vep_tracepoint_hook(void); extern struct kobject *offdp_kobj; /* Backend-implemented functions */ enum offdp_rv offdp_backend_init(void); void offdp_backend_exit(void); enum offdp_rv offdp_backend_bridge_add(const struct net_device *br, struct kobject **kobj); enum offdp_rv offdp_backend_bridge_port_add(struct net_device *port, struct kobject *br_kobj, struct kobject **kobj); enum offdp_rv offdp_backend_bridge_port_isolate(struct kobject *kobj, bool isolated); enum offdp_rv offdp_backend_bridge_port_software_fwd(struct kobject *kobj, bool software_fwd); enum offdp_rv offdp_backend_bridge_port_hairpin(struct kobject *kobj, bool hairpin); enum offdp_rv offdp_backend_vep_add(const struct net_device *dev, unsigned long *vep_handle); void offdp_backend_vep_remove(unsigned long vep_handle); enum offdp_rv offdp_backend_vep_fast_rcv(unsigned long vep_handle, struct sk_buff *skb); enum offdp_rv offdp_backend_vep_fast_rcv_raw(unsigned long vep_handle, void *buf, unsigned long offset, unsigned long len); enum offdp_rv offdp_backend_ep_platform_data(const struct net_device *dev, const unsigned long *vep_handle, void *data, size_t len);