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_TRUNK_H_
17#define _ISISC_TRUNK_H_
18
19#ifdef __cplusplus
20extern "C" {
21#endif                          /* __cplusplus */
22
23#include "fal/fal_trunk.h"
24
25    sw_error_t isisc_trunk_init(a_uint32_t dev_id);
26
27#ifdef IN_TRUNK
28#define ISISC_TRUNK_INIT(rv, dev_id) \
29    { \
30        rv = isisc_trunk_init(dev_id); \
31        SW_RTN_ON_ERROR(rv); \
32    }
33#else
34#define ISISC_TRUNK_INIT(rv, dev_id)
35#endif
36
37#ifdef HSL_STANDALONG
38
39    HSL_LOCAL sw_error_t
40    isisc_trunk_group_set(a_uint32_t dev_id, a_uint32_t trunk_id,
41                         a_bool_t enable, fal_pbmp_t member);
42
43    HSL_LOCAL sw_error_t
44    isisc_trunk_group_get(a_uint32_t dev_id, a_uint32_t trunk_id,
45                         a_bool_t * enable, fal_pbmp_t * member);
46
47    HSL_LOCAL sw_error_t
48    isisc_trunk_hash_mode_set(a_uint32_t dev_id, a_uint32_t hash_mode);
49
50    HSL_LOCAL sw_error_t
51    isisc_trunk_hash_mode_get(a_uint32_t dev_id, a_uint32_t * hash_mode);
52
53    HSL_LOCAL sw_error_t
54    isisc_trunk_manipulate_sa_set(a_uint32_t dev_id, fal_mac_addr_t * addr);
55
56    HSL_LOCAL sw_error_t
57    isisc_trunk_manipulate_sa_get(a_uint32_t dev_id, fal_mac_addr_t * addr);
58
59    HSL_LOCAL sw_error_t
60    isisc_trunk_manipulate_dp(a_uint32_t dev_id, a_uint8_t * header,
61                              a_uint32_t len, fal_pbmp_t dp_member);
62
63#endif
64
65#ifdef __cplusplus
66}
67#endif                          /* __cplusplus */
68#endif                          /* _ISISC_TRUNK_H_ */
69
70