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/**
17 * @defgroup shiva_fdb SHIVA_FDB
18 * @{
19 */
20#ifndef _SHIVA_FDB_H_
21#define _SHIVA_FDB_H_
22
23#ifdef __cplusplus
24extern "C" {
25#endif /* __cplusplus */
26
27#include "fal/fal_fdb.h"
28
29    sw_error_t
30    shiva_fdb_init(a_uint32_t dev_id);
31
32#ifdef IN_FDB
33#define SHIVA_FDB_INIT(rv, dev_id) \
34    { \
35        rv = shiva_fdb_init(dev_id); \
36        SW_RTN_ON_ERROR(rv); \
37    }
38#else
39#define SHIVA_FDB_INIT(rv, dev_id)
40#endif
41
42#ifdef HSL_STANDALONG
43
44
45    HSL_LOCAL sw_error_t
46    shiva_fdb_add(a_uint32_t dev_id, const fal_fdb_entry_t * entry);
47
48
49    HSL_LOCAL sw_error_t
50    shiva_fdb_del_all(a_uint32_t dev_id, a_uint32_t flag);
51
52
53    HSL_LOCAL sw_error_t
54    shiva_fdb_del_by_port(a_uint32_t dev_id, a_uint32_t port_id, a_uint32_t flag);
55
56
57    HSL_LOCAL sw_error_t
58    shiva_fdb_del_by_mac(a_uint32_t dev_id,
59                         const fal_fdb_entry_t *entry);
60
61
62    HSL_LOCAL sw_error_t
63    shiva_fdb_first(a_uint32_t dev_id, fal_fdb_entry_t * entry);
64
65
66    HSL_LOCAL sw_error_t
67    shiva_fdb_find(a_uint32_t dev_id, fal_fdb_entry_t * entry);
68
69
70    HSL_LOCAL sw_error_t
71    shiva_fdb_port_learn_set(a_uint32_t dev_id, fal_port_t port_id,
72                             a_bool_t enable);
73
74
75    HSL_LOCAL sw_error_t
76    shiva_fdb_port_learn_get(a_uint32_t dev_id, fal_port_t port_id,
77                             a_bool_t *enable);
78
79
80    HSL_LOCAL sw_error_t
81    shiva_fdb_age_ctrl_set(a_uint32_t dev_id, a_bool_t enable);
82
83
84    HSL_LOCAL sw_error_t
85    shiva_fdb_age_ctrl_get(a_uint32_t dev_id, a_bool_t *enable);
86
87
88    HSL_LOCAL sw_error_t
89    shiva_fdb_age_time_set(a_uint32_t dev_id, a_uint32_t * time);
90
91
92    HSL_LOCAL sw_error_t
93    shiva_fdb_age_time_get(a_uint32_t dev_id, a_uint32_t * time);
94
95
96    HSL_LOCAL sw_error_t
97    shiva_fdb_iterate(a_uint32_t dev_id, a_uint32_t * iterator, fal_fdb_entry_t * entry);
98
99
100#endif
101
102#ifdef __cplusplus
103}
104#endif /* __cplusplus */
105
106#endif /* _SHIVA_FDB_H_ */
107/**
108 * @}
109 */
110