1/*
2 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
3 * Permission to use, copy, modify, and/or distribute this software for
4 * any purpose with or without fee is hereby granted, provided that the
5 * above copyright notice and this permission notice appear in all copies.
6 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
11 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
12 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13 */
14
15
16#ifndef _ISISC_VLAN_H_
17#define _ISISC_VLAN_H_
18
19#ifdef __cplusplus
20extern "C" {
21#endif /* __cplusplus */
22
23#include "fal/fal_vlan.h"
24
25    sw_error_t
26    isisc_vlan_init(a_uint32_t dev_id);
27
28#ifdef IN_VLAN
29#define ISISC_VLAN_INIT(rv, dev_id) \
30    { \
31        rv = isisc_vlan_init(dev_id); \
32        SW_RTN_ON_ERROR(rv); \
33    }
34#else
35#define ISISC_VLAN_INIT(rv, dev_id)
36#endif
37
38#ifdef HSL_STANDALONG
39
40
41    HSL_LOCAL sw_error_t
42    isisc_vlan_entry_append(a_uint32_t dev_id, const fal_vlan_t * vlan_entry);
43
44
45    HSL_LOCAL sw_error_t
46    isisc_vlan_create(a_uint32_t dev_id, a_uint32_t vlan_id);
47
48
49    HSL_LOCAL sw_error_t
50    isisc_vlan_next(a_uint32_t dev_id, a_uint32_t vlan_id, fal_vlan_t * p_vlan);
51
52
53    HSL_LOCAL sw_error_t
54    isisc_vlan_find(a_uint32_t dev_id, a_uint32_t vlan_id, fal_vlan_t * p_vlan);
55
56
57    HSL_LOCAL sw_error_t
58    isisc_vlan_delete(a_uint32_t dev_id, a_uint32_t vlan_id);
59
60
61    HSL_LOCAL sw_error_t
62    isisc_vlan_flush(a_uint32_t dev_id);
63
64
65    HSL_LOCAL sw_error_t
66    isisc_vlan_fid_set(a_uint32_t dev_id, a_uint32_t vlan_id, a_uint32_t fid);
67
68
69    HSL_LOCAL sw_error_t
70    isisc_vlan_fid_get(a_uint32_t dev_id, a_uint32_t vlan_id, a_uint32_t * fid);
71
72
73    HSL_LOCAL sw_error_t
74    isisc_vlan_member_add(a_uint32_t dev_id, a_uint32_t vlan_id,
75                         fal_port_t port_id, fal_pt_1q_egmode_t port_info);
76
77
78    HSL_LOCAL sw_error_t
79    isisc_vlan_member_del(a_uint32_t dev_id, a_uint32_t vlan_id, fal_port_t port_id);
80
81
82    HSL_LOCAL sw_error_t
83    isisc_vlan_learning_state_set(a_uint32_t dev_id, a_uint32_t vlan_id,
84                                 a_bool_t enable);
85
86
87    HSL_LOCAL sw_error_t
88    isisc_vlan_learning_state_get(a_uint32_t dev_id, a_uint32_t vlan_id,
89                                 a_bool_t * enable);
90
91
92#endif
93
94#ifdef __cplusplus
95}
96#endif /* __cplusplus */
97
98#endif /* _ISISC_VLAN_H_ */
99
100