1/*
2 * Copyright (c) 2014, 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 fal_cosmap FAL_COSMAP
18 * @{
19 */
20#ifndef _FAL_COSMAP_H_
21#define _FAL_COSMAP_H_
22
23#ifdef __cplusplus
24extern "C" {
25#endif                          /* __cplusplus */
26
27#include "common/sw.h"
28#include "fal/fal_type.h"
29
30    typedef struct
31    {
32        a_bool_t remark_dscp;
33        a_bool_t remark_up;
34        a_bool_t remark_dei;
35        a_uint8_t g_dscp;
36        a_uint8_t y_dscp;
37        a_uint8_t g_up;
38        a_uint8_t y_up;
39        a_uint8_t g_dei;
40        a_uint8_t y_dei;
41    } fal_egress_remark_table_t;
42
43    sw_error_t
44    fal_cosmap_dscp_to_pri_set(a_uint32_t dev_id, a_uint32_t dscp,
45                               a_uint32_t pri);
46
47    sw_error_t
48    fal_cosmap_dscp_to_pri_get(a_uint32_t dev_id, a_uint32_t dscp,
49                               a_uint32_t * pri);
50
51    sw_error_t
52    fal_cosmap_dscp_to_dp_set(a_uint32_t dev_id, a_uint32_t dscp,
53                              a_uint32_t dp);
54
55    sw_error_t
56    fal_cosmap_dscp_to_dp_get(a_uint32_t dev_id, a_uint32_t dscp,
57                              a_uint32_t * dp);
58
59    sw_error_t
60    fal_cosmap_up_to_pri_set(a_uint32_t dev_id, a_uint32_t up,
61                             a_uint32_t pri);
62
63    sw_error_t
64    fal_cosmap_up_to_pri_get(a_uint32_t dev_id, a_uint32_t up,
65                             a_uint32_t * pri);
66
67    sw_error_t
68    fal_cosmap_up_to_dp_set(a_uint32_t dev_id, a_uint32_t up,
69                            a_uint32_t dp);
70
71    sw_error_t
72    fal_cosmap_up_to_dp_get(a_uint32_t dev_id, a_uint32_t up,
73                            a_uint32_t * dp);
74
75    sw_error_t
76    fal_cosmap_dscp_to_ehpri_set(a_uint32_t dev_id, a_uint32_t dscp,
77                               a_uint32_t pri);
78
79    sw_error_t
80    fal_cosmap_dscp_to_ehpri_get(a_uint32_t dev_id, a_uint32_t dscp,
81                               a_uint32_t * pri);
82
83    sw_error_t
84    fal_cosmap_dscp_to_ehdp_set(a_uint32_t dev_id, a_uint32_t dscp,
85                              a_uint32_t dp);
86
87    sw_error_t
88    fal_cosmap_dscp_to_ehdp_get(a_uint32_t dev_id, a_uint32_t dscp,
89                              a_uint32_t * dp);
90
91    sw_error_t
92    fal_cosmap_up_to_ehpri_set(a_uint32_t dev_id, a_uint32_t up,
93                             a_uint32_t pri);
94
95    sw_error_t
96    fal_cosmap_up_to_ehpri_get(a_uint32_t dev_id, a_uint32_t up,
97                             a_uint32_t * pri);
98
99    sw_error_t
100    fal_cosmap_up_to_ehdp_set(a_uint32_t dev_id, a_uint32_t up,
101                            a_uint32_t dp);
102
103    sw_error_t
104    fal_cosmap_up_to_ehdp_get(a_uint32_t dev_id, a_uint32_t up,
105                            a_uint32_t * dp);
106
107    sw_error_t
108    fal_cosmap_pri_to_queue_set(a_uint32_t dev_id, a_uint32_t pri,
109                                a_uint32_t queue);
110
111    sw_error_t
112    fal_cosmap_pri_to_queue_get(a_uint32_t dev_id, a_uint32_t pri,
113                                a_uint32_t * queue);
114
115    sw_error_t
116    fal_cosmap_pri_to_ehqueue_set(a_uint32_t dev_id, a_uint32_t pri,
117                                  a_uint32_t queue);
118
119    sw_error_t
120    fal_cosmap_pri_to_ehqueue_get(a_uint32_t dev_id, a_uint32_t pri,
121                                  a_uint32_t * queue);
122
123    sw_error_t
124    fal_cosmap_egress_remark_set(a_uint32_t dev_id, a_uint32_t tbl_id,
125                                 fal_egress_remark_table_t * tbl);
126
127    sw_error_t
128    fal_cosmap_egress_remark_get(a_uint32_t dev_id, a_uint32_t tbl_id,
129                                 fal_egress_remark_table_t * tbl);
130#ifdef __cplusplus
131}
132#endif                          /* __cplusplus */
133#endif                          /* _FAL_COSMAP_H_ */
134
135/**
136 * @}
137 */
138
139