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_LEAKY_H_
17#define _ISISC_LEAKY_H_
18
19#ifdef __cplusplus
20extern "C" {
21#endif                          /* __cplusplus */
22
23#include "fal/fal_leaky.h"
24
25    sw_error_t isisc_leaky_init(a_uint32_t dev_id);
26
27#ifdef IN_LEAKY
28#define ISISC_LEAKY_INIT(rv, dev_id) \
29    { \
30        rv = isisc_leaky_init(dev_id); \
31        SW_RTN_ON_ERROR(rv); \
32    }
33#else
34#define ISISC_LEAKY_INIT(rv, dev_id)
35#endif
36
37#ifdef HSL_STANDALONG
38
39
40    HSL_LOCAL sw_error_t
41    isisc_uc_leaky_mode_set(a_uint32_t dev_id,
42                           fal_leaky_ctrl_mode_t ctrl_mode);
43
44
45    HSL_LOCAL sw_error_t
46    isisc_uc_leaky_mode_get(a_uint32_t dev_id,
47                           fal_leaky_ctrl_mode_t * ctrl_mode);
48
49
50    HSL_LOCAL sw_error_t
51    isisc_mc_leaky_mode_set(a_uint32_t dev_id,
52                           fal_leaky_ctrl_mode_t ctrl_mode);
53
54
55    HSL_LOCAL sw_error_t
56    isisc_mc_leaky_mode_get(a_uint32_t dev_id,
57                           fal_leaky_ctrl_mode_t * ctrl_mode);
58
59
60    HSL_LOCAL sw_error_t
61    isisc_port_arp_leaky_set(a_uint32_t dev_id, fal_port_t port_id,
62                            a_bool_t enable);
63
64
65    HSL_LOCAL sw_error_t
66    isisc_port_arp_leaky_get(a_uint32_t dev_id, fal_port_t port_id,
67                            a_bool_t * enable);
68
69
70    HSL_LOCAL sw_error_t
71    isisc_port_uc_leaky_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    isisc_port_uc_leaky_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    isisc_port_mc_leaky_set(a_uint32_t dev_id, fal_port_t port_id,
82                           a_bool_t enable);
83
84
85    HSL_LOCAL sw_error_t
86    isisc_port_mc_leaky_get(a_uint32_t dev_id, fal_port_t port_id,
87                           a_bool_t * enable);
88#endif
89
90#ifdef __cplusplus
91}
92#endif                          /* __cplusplus */
93#endif                          /* _ISISC_LEAKY_H_ */
94
95