1 // SPDX-License-Identifier: GPL-2.0+
3 #include "lan966x_main.h"
4 #include "vcap_api_client.h"
6 int lan966x_goto_port_add(struct lan966x_port *port,
7 int from_cid, int to_cid,
9 struct netlink_ext_ack *extack)
11 struct lan966x *lan966x = port->lan966x;
14 err = vcap_enable_lookups(lan966x->vcap_ctrl, port->dev,
15 from_cid, to_cid, goto_id,
18 NL_SET_ERR_MSG_MOD(extack, "Unsupported goto chain");
22 if (err == -EADDRINUSE) {
23 NL_SET_ERR_MSG_MOD(extack, "VCAP already enabled");
28 NL_SET_ERR_MSG_MOD(extack, "Could not enable VCAP lookups");
35 int lan966x_goto_port_del(struct lan966x_port *port,
36 unsigned long goto_id,
37 struct netlink_ext_ack *extack)
39 struct lan966x *lan966x = port->lan966x;
42 err = vcap_enable_lookups(lan966x->vcap_ctrl, port->dev, 0, 0,
45 NL_SET_ERR_MSG_MOD(extack, "Could not disable VCAP lookups");