linux/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.h

/* SPDX-License-Identifier: GPL-2.0+ */
/* Microchip Sparx5 Switch driver VCAP implementation
 *
 * Copyright (c) 2022 Microchip Technology Inc. and its subsidiaries.
 *
 * The Sparx5 Chip Register Model can be browsed at this location:
 * https://github.com/microchip-ung/sparx-5_reginfo
 */

#ifndef __SPARX5_VCAP_IMPL_H__
#define __SPARX5_VCAP_IMPL_H__

#include <linux/types.h>
#include <linux/list.h>

#include "vcap_api.h"
#include "vcap_api_client.h"

#define SPARX5_VCAP_CID_IS0_L0
#define SPARX5_VCAP_CID_IS0_L1
#define SPARX5_VCAP_CID_IS0_L2
#define SPARX5_VCAP_CID_IS0_L3
#define SPARX5_VCAP_CID_IS0_L4
#define SPARX5_VCAP_CID_IS0_L5
#define SPARX5_VCAP_CID_IS0_MAX

#define SPARX5_VCAP_CID_IS2_L0
#define SPARX5_VCAP_CID_IS2_L1
#define SPARX5_VCAP_CID_IS2_L2
#define SPARX5_VCAP_CID_IS2_L3
#define SPARX5_VCAP_CID_IS2_MAX

#define SPARX5_VCAP_CID_ES0_L0
#define SPARX5_VCAP_CID_ES0_MAX

#define SPARX5_VCAP_CID_ES2_L0
#define SPARX5_VCAP_CID_ES2_L1
#define SPARX5_VCAP_CID_ES2_MAX

/* IS0 port keyset selection control */

/* IS0 ethernet, IPv4, IPv6 traffic type keyset generation */
enum vcap_is0_port_sel_etype {};

/* IS0 MPLS traffic type keyset generation */
enum vcap_is0_port_sel_mpls_uc_mc {};

/* IS0 MBLS traffic type keyset generation */
enum vcap_is0_port_sel_mlbs {};

/* IS2 port keyset selection control */

/* IS2 non-ethernet traffic type keyset generation */
enum vcap_is2_port_sel_noneth {};

/* IS2 IPv4 unicast traffic type keyset generation */
enum vcap_is2_port_sel_ipv4_uc {};

/* IS2 IPv4 multicast traffic type keyset generation */
enum vcap_is2_port_sel_ipv4_mc {};

/* IS2 IPv6 unicast traffic type keyset generation */
enum vcap_is2_port_sel_ipv6_uc {};

/* IS2 IPv6 multicast traffic type keyset generation */
enum vcap_is2_port_sel_ipv6_mc {};

/* IS2 ARP traffic type keyset generation */
enum vcap_is2_port_sel_arp {};

/* ES0 port keyset selection control */

/* ES0 Egress port traffic type classification */
enum vcap_es0_port_sel {};

/* ES2 port keyset selection control */

/* ES2 IPv4 traffic type keyset generation */
enum vcap_es2_port_sel_ipv4 {};

/* ES2 IPv6 traffic type keyset generation */
enum vcap_es2_port_sel_ipv6 {};

/* ES2 ARP traffic type keyset generation */
enum vcap_es2_port_sel_arp {};

/* Selects TPID for ES0 matching */
enum SPX5_TPID_SEL {};

/* Get the port keyset for the vcap lookup */
int sparx5_vcap_get_port_keyset(struct net_device *ndev,
				struct vcap_admin *admin,
				int cid,
				u16 l3_proto,
				struct vcap_keyset_list *kslist);

/* Change the port keyset for the lookup and protocol */
void sparx5_vcap_set_port_keyset(struct net_device *ndev,
				 struct vcap_admin *admin, int cid,
				 u16 l3_proto, enum vcap_keyfield_set keyset,
				 struct vcap_keyset_list *orig);

/* Check if the ethertype is supported by the vcap port classification */
bool sparx5_vcap_is_known_etype(struct vcap_admin *admin, u16 etype);

#endif /* __SPARX5_VCAP_IMPL_H__ */