blob: 43ddd93a1a9b4326fc7524f00d5b2ffbbb3fe93a [file] [log] [blame]
Shad Ansari2f7f9be2017-06-07 13:34:53 -07001/******************************************************************************
2 *
3 * <:copyright-BRCM:2016:DUAL/GPL:standard
4 *
5 * Copyright (c) 2016 Broadcom
6 * All Rights Reserved
7 *
8 * Unless you and Broadcom execute a separate written software license
9 * agreement governing use of this software, this software is licensed
10 * to you under the terms of the GNU General Public License version 2
11 * (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
12 * with the following added to such license:
13 *
14 * As a special exception, the copyright holders of this software give
15 * you permission to link this software with independent modules, and
16 * to copy and distribute the resulting executable under terms of your
17 * choice, provided that you also meet, for each linked independent
18 * module, the terms and conditions of the license of that module.
19 * An independent module is a module which is not derived from this
20 * software. The special exception does not apply to any modifications
21 * of the software.
22 *
23 * Not withstanding the above, under no circumstances may you combine
24 * this software in any way with any other Broadcom software provided
25 * under a license other than the GPL, without Broadcom's express prior
26 * written consent.
27 *
28 * :>
29 *
30 *****************************************************************************/
31
32 /**
33 * @file bal_dpp_vswitch.h
34 * @brief BAL Switch util helper functions prototype
35 * @addtogroup sw_util
36 */
37#ifndef _BAL_DPP_VSWITCH_H_
38#define _BAL_DPP_VSWITCH_H_
39
40#include "bal_switch_flow.h"
41
42/* DPP multicast group offsets - use vsi as base */
43/* The mc group should not overlap, so the following setting limit system to 0x1000 vsi */
44#define BAL_DPP_US_FLOOD_OFFSET 0x0
45#define BAL_DPP_DS_FLOOD_OFFSET 0x1000
46#define BAL_DPP_MC_OFFSET 0x2000
47
48#define MAX_SVC_PER_VSI 8
49
50/*@{*/
51#ifndef TEST_SW_UTIL_LOOPBACK
52
53typedef struct bal_sw_lif_port bal_sw_lif_port;
54struct bal_sw_lif_port
55{
56 uint32_t port;
57 uint32_t gport;
58 int32_t use_count;
59};
60
61typedef struct bal_sw_lif_pkt_tag bal_sw_lif_pkt_tag;
62struct bal_sw_lif_pkt_tag
63{
64 uint32_t type;
65 uint32_t o_vid;
66 uint32_t i_vid;
67 uint32_t num_port;
68 bal_sw_lif_port port[MAX_NET_PORT];
69};
70
71typedef struct bal_sw_vsi_service bal_sw_vsi_service;
72struct bal_sw_vsi_service
73{
74 uint32_t num_tag;
75 bal_sw_lif_pkt_tag pkt_tag[MAX_SVC_PER_VSI];
76 uint32_t vswitch;
77 uint32_t us_flood_grp_id;
78 uint32_t ds_flood_grp_id;
79 int32_t use_count;
80 TAILQ_ENTRY(bal_sw_vsi_service) next_service;
81};
82
83extern bcmos_errno bal_sw_util_dpp_vsi_service_port_add(int unit, bal_sw_vsi_service *p_vsi_svc, uint32_t svc_tag_indx, uint32_t port, int32_t *p_gport);
84extern bcmos_errno bal_sw_util_dpp_vsi_service_port_rem(int unit, bal_sw_vsi_service *p_vsi_svc, uint32_t svc_tag_indx, uint32_t port);
85extern bcmos_errno bal_sw_util_dpp_vsi_service_tag_add(int unit, bal_sw_vsi_service *p_vsi_svc, bcmbal_flow_cfg *p_flow, uint32_t *p_svc_tag_indx);
86extern bcmos_errno bal_sw_util_dpp_vsi_service_tag_rem(int unit, bal_sw_vsi_service *p_vsi_svc, uint32_t svc_tag_indx);
87extern bal_sw_vsi_service *bal_sw_util_dpp_vsi_service_create(int unit, bcmbal_flow_cfg *p_flow, uint32_t *p_svc_tag_indx);
88extern bcmos_errno bal_sw_util_dpp_vsi_service_destroy(int unit, bal_sw_vsi_service *p_vsi_svc);
89extern bcmos_errno bal_sw_util_vsi_list_init(void);
90
91#endif /* TEST_SW_UTIL_LOOPBACK */
92/*@}*/
93#endif