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#ifndef _DESS_API_H_
18#define _DESS_API_H_
19
20#ifdef __cplusplus
21extern "C" {
22#endif                          /* __cplusplus */
23
24#ifdef IN_PORTCONTROL
25#define PORTCONTROL_API \
26    SW_API_DEF(SW_API_PT_DUPLEX_GET, dess_port_duplex_get), \
27    SW_API_DEF(SW_API_PT_DUPLEX_SET, dess_port_duplex_set), \
28    SW_API_DEF(SW_API_PT_SPEED_GET, dess_port_speed_get), \
29    SW_API_DEF(SW_API_PT_SPEED_SET, dess_port_speed_set), \
30    SW_API_DEF(SW_API_PT_AN_GET, dess_port_autoneg_status_get), \
31    SW_API_DEF(SW_API_PT_AN_ENABLE, dess_port_autoneg_enable), \
32    SW_API_DEF(SW_API_PT_AN_RESTART, dess_port_autoneg_restart), \
33    SW_API_DEF(SW_API_PT_AN_ADV_GET, dess_port_autoneg_adv_get), \
34    SW_API_DEF(SW_API_PT_AN_ADV_SET, dess_port_autoneg_adv_set), \
35    SW_API_DEF(SW_API_PT_FLOWCTRL_SET, dess_port_flowctrl_set), \
36    SW_API_DEF(SW_API_PT_FLOWCTRL_GET, dess_port_flowctrl_get), \
37    SW_API_DEF(SW_API_PT_FLOWCTRL_MODE_SET, dess_port_flowctrl_forcemode_set), \
38    SW_API_DEF(SW_API_PT_FLOWCTRL_MODE_GET, dess_port_flowctrl_forcemode_get), \
39    SW_API_DEF(SW_API_PT_POWERSAVE_SET, dess_port_powersave_set), \
40    SW_API_DEF(SW_API_PT_POWERSAVE_GET, dess_port_powersave_get), \
41    SW_API_DEF(SW_API_PT_HIBERNATE_SET, dess_port_hibernate_set), \
42    SW_API_DEF(SW_API_PT_HIBERNATE_GET, dess_port_hibernate_get), \
43    SW_API_DEF(SW_API_PT_CDT, dess_port_cdt), \
44    SW_API_DEF(SW_API_PT_TXHDR_SET, dess_port_txhdr_mode_set), \
45    SW_API_DEF(SW_API_PT_TXHDR_GET, dess_port_txhdr_mode_get), \
46    SW_API_DEF(SW_API_PT_RXHDR_SET, dess_port_rxhdr_mode_set), \
47    SW_API_DEF(SW_API_PT_RXHDR_GET, dess_port_rxhdr_mode_get), \
48    SW_API_DEF(SW_API_HEADER_TYPE_SET, dess_header_type_set),  \
49    SW_API_DEF(SW_API_HEADER_TYPE_GET, dess_header_type_get), \
50    SW_API_DEF(SW_API_TXMAC_STATUS_SET, dess_port_txmac_status_set), \
51    SW_API_DEF(SW_API_TXMAC_STATUS_GET, dess_port_txmac_status_get), \
52    SW_API_DEF(SW_API_RXMAC_STATUS_SET, dess_port_rxmac_status_set), \
53    SW_API_DEF(SW_API_RXMAC_STATUS_GET, dess_port_rxmac_status_get), \
54    SW_API_DEF(SW_API_TXFC_STATUS_SET, dess_port_txfc_status_set),   \
55    SW_API_DEF(SW_API_TXFC_STATUS_GET, dess_port_txfc_status_get),   \
56    SW_API_DEF(SW_API_RXFC_STATUS_SET, dess_port_rxfc_status_set),   \
57    SW_API_DEF(SW_API_RXFC_STATUS_GET, dess_port_rxfc_status_get),   \
58    SW_API_DEF(SW_API_BP_STATUS_SET, dess_port_bp_status_set),   \
59    SW_API_DEF(SW_API_BP_STATUS_GET, dess_port_bp_status_get),   \
60    SW_API_DEF(SW_API_PT_LINK_MODE_SET, dess_port_link_forcemode_set),   \
61    SW_API_DEF(SW_API_PT_LINK_MODE_GET, dess_port_link_forcemode_get), \
62    SW_API_DEF(SW_API_PT_LINK_STATUS_GET, dess_port_link_status_get), \
63    SW_API_DEF(SW_API_PT_MAC_LOOPBACK_SET, dess_port_mac_loopback_set), \
64    SW_API_DEF(SW_API_PT_MAC_LOOPBACK_GET, dess_port_mac_loopback_get), \
65    SW_API_DEF(SW_API_PT_CONGESTION_DROP_SET, dess_port_congestion_drop_set), \
66    SW_API_DEF(SW_API_PT_CONGESTION_DROP_GET, dess_port_congestion_drop_get), \
67    SW_API_DEF(SW_API_PT_RING_FLOW_CTRL_THRES_SET, dess_ring_flow_ctrl_thres_set), \
68    SW_API_DEF(SW_API_PT_RING_FLOW_CTRL_THRES_GET, dess_ring_flow_ctrl_thres_get),\
69    SW_API_DEF(SW_API_PT_8023AZ_SET, dess_port_8023az_set), \
70    SW_API_DEF(SW_API_PT_8023AZ_GET, dess_port_8023az_get), \
71    SW_API_DEF(SW_API_PT_MDIX_SET, dess_port_mdix_set), \
72    SW_API_DEF(SW_API_PT_MDIX_GET, dess_port_mdix_get), \
73    SW_API_DEF(SW_API_PT_MDIX_STATUS_GET, dess_port_mdix_status_get), \
74    SW_API_DEF(SW_API_PT_COMBO_PREFER_MEDIUM_SET, dess_port_combo_prefer_medium_set), \
75    SW_API_DEF(SW_API_PT_COMBO_PREFER_MEDIUM_GET, dess_port_combo_prefer_medium_get), \
76    SW_API_DEF(SW_API_PT_COMBO_MEDIUM_STATUS_GET, dess_port_combo_medium_status_get), \
77    SW_API_DEF(SW_API_PT_COMBO_FIBER_MODE_SET, dess_port_combo_fiber_mode_set), \
78    SW_API_DEF(SW_API_PT_COMBO_FIBER_MODE_GET, dess_port_combo_fiber_mode_get), \
79    SW_API_DEF(SW_API_PT_LOCAL_LOOPBACK_SET, dess_port_local_loopback_set), \
80    SW_API_DEF(SW_API_PT_LOCAL_LOOPBACK_GET, dess_port_local_loopback_get), \
81    SW_API_DEF(SW_API_PT_REMOTE_LOOPBACK_SET, dess_port_remote_loopback_set), \
82    SW_API_DEF(SW_API_PT_REMOTE_LOOPBACK_GET, dess_port_remote_loopback_get), \
83    SW_API_DEF(SW_API_PT_RESET, dess_port_reset), \
84    SW_API_DEF(SW_API_PT_POWER_OFF, dess_port_power_off), \
85    SW_API_DEF(SW_API_PT_POWER_ON, dess_port_power_on),
86
87#define PORTCONTROL_API_PARAM \
88    SW_API_DESC(SW_API_PT_DUPLEX_GET) \
89    SW_API_DESC(SW_API_PT_DUPLEX_SET) \
90    SW_API_DESC(SW_API_PT_SPEED_GET)  \
91    SW_API_DESC(SW_API_PT_SPEED_SET)  \
92    SW_API_DESC(SW_API_PT_AN_GET)  \
93    SW_API_DESC(SW_API_PT_AN_ENABLE)   \
94    SW_API_DESC(SW_API_PT_AN_RESTART)  \
95    SW_API_DESC(SW_API_PT_AN_ADV_GET)  \
96    SW_API_DESC(SW_API_PT_AN_ADV_SET)  \
97    SW_API_DESC(SW_API_PT_FLOWCTRL_SET)  \
98    SW_API_DESC(SW_API_PT_FLOWCTRL_GET)  \
99    SW_API_DESC(SW_API_PT_FLOWCTRL_MODE_SET)  \
100    SW_API_DESC(SW_API_PT_FLOWCTRL_MODE_GET) \
101    SW_API_DESC(SW_API_PT_POWERSAVE_SET) \
102    SW_API_DESC(SW_API_PT_POWERSAVE_GET) \
103    SW_API_DESC(SW_API_PT_HIBERNATE_SET) \
104    SW_API_DESC(SW_API_PT_HIBERNATE_GET) \
105    SW_API_DESC(SW_API_PT_CDT) \
106    SW_API_DESC(SW_API_PT_TXHDR_SET) \
107    SW_API_DESC(SW_API_PT_TXHDR_GET) \
108    SW_API_DESC(SW_API_PT_RXHDR_SET) \
109    SW_API_DESC(SW_API_PT_RXHDR_GET) \
110    SW_API_DESC(SW_API_HEADER_TYPE_SET) \
111    SW_API_DESC(SW_API_HEADER_TYPE_GET) \
112    SW_API_DESC(SW_API_TXMAC_STATUS_SET) \
113    SW_API_DESC(SW_API_TXMAC_STATUS_GET) \
114    SW_API_DESC(SW_API_RXMAC_STATUS_SET) \
115    SW_API_DESC(SW_API_RXMAC_STATUS_GET) \
116    SW_API_DESC(SW_API_TXFC_STATUS_SET) \
117    SW_API_DESC(SW_API_TXFC_STATUS_GET) \
118    SW_API_DESC(SW_API_RXFC_STATUS_SET) \
119    SW_API_DESC(SW_API_RXFC_STATUS_GET) \
120    SW_API_DESC(SW_API_BP_STATUS_SET) \
121    SW_API_DESC(SW_API_BP_STATUS_GET) \
122    SW_API_DESC(SW_API_PT_LINK_MODE_SET) \
123    SW_API_DESC(SW_API_PT_LINK_MODE_GET) \
124    SW_API_DESC(SW_API_PT_LINK_STATUS_GET) \
125    SW_API_DESC(SW_API_PT_MAC_LOOPBACK_SET) \
126    SW_API_DESC(SW_API_PT_MAC_LOOPBACK_GET) \
127    SW_API_DESC(SW_API_PT_CONGESTION_DROP_SET) \
128    SW_API_DESC(SW_API_PT_CONGESTION_DROP_GET) \
129    SW_API_DESC(SW_API_PT_RING_FLOW_CTRL_THRES_SET) \
130    SW_API_DESC(SW_API_PT_RING_FLOW_CTRL_THRES_GET)\
131    SW_API_DESC(SW_API_PT_8023AZ_SET) \
132    SW_API_DESC(SW_API_PT_8023AZ_GET) \
133    SW_API_DESC(SW_API_PT_MDIX_SET) \
134    SW_API_DESC(SW_API_PT_MDIX_GET) \
135    SW_API_DESC(SW_API_PT_MDIX_STATUS_GET) \
136    SW_API_DESC(SW_API_PT_COMBO_PREFER_MEDIUM_SET) \
137    SW_API_DESC(SW_API_PT_COMBO_PREFER_MEDIUM_GET) \
138    SW_API_DESC(SW_API_PT_COMBO_MEDIUM_STATUS_GET) \
139    SW_API_DESC(SW_API_PT_COMBO_FIBER_MODE_SET) \
140    SW_API_DESC(SW_API_PT_COMBO_FIBER_MODE_GET) \
141    SW_API_DESC(SW_API_PT_LOCAL_LOOPBACK_SET) \
142    SW_API_DESC(SW_API_PT_LOCAL_LOOPBACK_GET) \
143    SW_API_DESC(SW_API_PT_REMOTE_LOOPBACK_SET) \
144    SW_API_DESC(SW_API_PT_REMOTE_LOOPBACK_GET) \
145    SW_API_DESC(SW_API_PT_RESET) \
146    SW_API_DESC(SW_API_PT_POWER_OFF) \
147    SW_API_DESC(SW_API_PT_POWER_ON)
148
149#else
150#define PORTCONTROL_API
151#define PORTCONTROL_API_PARAM
152#endif
153
154#ifdef IN_VLAN
155#define VLAN_API \
156    SW_API_DEF(SW_API_VLAN_ADD, dess_vlan_create), \
157    SW_API_DEF(SW_API_VLAN_DEL, dess_vlan_delete), \
158    SW_API_DEF(SW_API_VLAN_FIND, dess_vlan_find), \
159    SW_API_DEF(SW_API_VLAN_NEXT, dess_vlan_next), \
160    SW_API_DEF(SW_API_VLAN_APPEND, dess_vlan_entry_append), \
161    SW_API_DEF(SW_API_VLAN_FLUSH, dess_vlan_flush), \
162    SW_API_DEF(SW_API_VLAN_FID_SET, dess_vlan_fid_set), \
163    SW_API_DEF(SW_API_VLAN_FID_GET, dess_vlan_fid_get), \
164    SW_API_DEF(SW_API_VLAN_MEMBER_ADD, dess_vlan_member_add), \
165    SW_API_DEF(SW_API_VLAN_MEMBER_DEL, dess_vlan_member_del), \
166    SW_API_DEF(SW_API_VLAN_LEARN_STATE_SET, dess_vlan_learning_state_set), \
167    SW_API_DEF(SW_API_VLAN_LEARN_STATE_GET, dess_vlan_learning_state_get),
168
169#define VLAN_API_PARAM \
170    SW_API_DESC(SW_API_VLAN_ADD)     \
171    SW_API_DESC(SW_API_VLAN_DEL)     \
172    SW_API_DESC(SW_API_VLAN_FIND)    \
173    SW_API_DESC(SW_API_VLAN_NEXT)    \
174    SW_API_DESC(SW_API_VLAN_APPEND)  \
175    SW_API_DESC(SW_API_VLAN_FLUSH)   \
176    SW_API_DESC(SW_API_VLAN_FID_SET) \
177    SW_API_DESC(SW_API_VLAN_FID_GET) \
178    SW_API_DESC(SW_API_VLAN_MEMBER_ADD) \
179    SW_API_DESC(SW_API_VLAN_MEMBER_DEL) \
180    SW_API_DESC(SW_API_VLAN_LEARN_STATE_SET) \
181    SW_API_DESC(SW_API_VLAN_LEARN_STATE_GET)
182#else
183#define VLAN_API
184#define VLAN_API_PARAM
185#endif
186
187#ifdef IN_PORTVLAN
188#define PORTVLAN_API \
189    SW_API_DEF(SW_API_PT_ING_MODE_GET, dess_port_1qmode_get), \
190    SW_API_DEF(SW_API_PT_ING_MODE_SET, dess_port_1qmode_set), \
191    SW_API_DEF(SW_API_PT_EG_MODE_GET, dess_port_egvlanmode_get), \
192    SW_API_DEF(SW_API_PT_EG_MODE_SET, dess_port_egvlanmode_set), \
193    SW_API_DEF(SW_API_PT_VLAN_MEM_ADD, dess_portvlan_member_add), \
194    SW_API_DEF(SW_API_PT_VLAN_MEM_DEL, dess_portvlan_member_del), \
195    SW_API_DEF(SW_API_PT_VLAN_MEM_UPDATE, dess_portvlan_member_update), \
196    SW_API_DEF(SW_API_PT_VLAN_MEM_GET, dess_portvlan_member_get), \
197    SW_API_DEF(SW_API_PT_FORCE_DEF_VID_SET, dess_port_force_default_vid_set), \
198    SW_API_DEF(SW_API_PT_FORCE_DEF_VID_GET, dess_port_force_default_vid_get), \
199    SW_API_DEF(SW_API_PT_FORCE_PORTVLAN_SET, dess_port_force_portvlan_set), \
200    SW_API_DEF(SW_API_PT_FORCE_PORTVLAN_GET, dess_port_force_portvlan_get), \
201    SW_API_DEF(SW_API_NESTVLAN_TPID_SET, dess_nestvlan_tpid_set), \
202    SW_API_DEF(SW_API_NESTVLAN_TPID_GET, dess_nestvlan_tpid_get), \
203    SW_API_DEF(SW_API_PT_IN_VLAN_MODE_SET, dess_port_invlan_mode_set), \
204    SW_API_DEF(SW_API_PT_IN_VLAN_MODE_GET, dess_port_invlan_mode_get), \
205    SW_API_DEF(SW_API_PT_TLS_SET, dess_port_tls_set), \
206    SW_API_DEF(SW_API_PT_TLS_GET, dess_port_tls_get), \
207    SW_API_DEF(SW_API_PT_PRI_PROPAGATION_SET, dess_port_pri_propagation_set), \
208    SW_API_DEF(SW_API_PT_PRI_PROPAGATION_GET, dess_port_pri_propagation_get), \
209    SW_API_DEF(SW_API_PT_DEF_SVID_SET, dess_port_default_svid_set), \
210    SW_API_DEF(SW_API_PT_DEF_SVID_GET, dess_port_default_svid_get), \
211    SW_API_DEF(SW_API_PT_DEF_CVID_SET, dess_port_default_cvid_set), \
212    SW_API_DEF(SW_API_PT_DEF_CVID_GET, dess_port_default_cvid_get), \
213    SW_API_DEF(SW_API_PT_VLAN_PROPAGATION_SET, dess_port_vlan_propagation_set), \
214    SW_API_DEF(SW_API_PT_VLAN_PROPAGATION_GET, dess_port_vlan_propagation_get), \
215    SW_API_DEF(SW_API_PT_VLAN_TRANS_ADD, dess_port_vlan_trans_add), \
216    SW_API_DEF(SW_API_PT_VLAN_TRANS_DEL, dess_port_vlan_trans_del), \
217    SW_API_DEF(SW_API_PT_VLAN_TRANS_GET, dess_port_vlan_trans_get), \
218    SW_API_DEF(SW_API_QINQ_MODE_SET, dess_qinq_mode_set), \
219    SW_API_DEF(SW_API_QINQ_MODE_GET, dess_qinq_mode_get), \
220    SW_API_DEF(SW_API_PT_QINQ_ROLE_SET, dess_port_qinq_role_set), \
221    SW_API_DEF(SW_API_PT_QINQ_ROLE_GET, dess_port_qinq_role_get), \
222    SW_API_DEF(SW_API_PT_VLAN_TRANS_ITERATE, dess_port_vlan_trans_iterate), \
223    SW_API_DEF(SW_API_PT_MAC_VLAN_XLT_SET, dess_port_mac_vlan_xlt_set), \
224    SW_API_DEF(SW_API_PT_MAC_VLAN_XLT_GET, dess_port_mac_vlan_xlt_get), \
225    SW_API_DEF(SW_API_NETISOLATE_SET, dess_netisolate_set), \
226    SW_API_DEF(SW_API_NETISOLATE_GET, dess_netisolate_get),\
227    SW_API_DEF(SW_API_EG_FLTR_BYPASS_EN_SET, dess_eg_trans_filter_bypass_en_set), \
228    SW_API_DEF(SW_API_EG_FLTR_BYPASS_EN_GET, dess_eg_trans_filter_bypass_en_get),
229
230
231#define PORTVLAN_API_PARAM \
232    SW_API_DESC(SW_API_PT_ING_MODE_GET)  \
233    SW_API_DESC(SW_API_PT_ING_MODE_SET)  \
234    SW_API_DESC(SW_API_PT_EG_MODE_GET)  \
235    SW_API_DESC(SW_API_PT_EG_MODE_SET)  \
236    SW_API_DESC(SW_API_PT_VLAN_MEM_ADD) \
237    SW_API_DESC(SW_API_PT_VLAN_MEM_DEL) \
238    SW_API_DESC(SW_API_PT_VLAN_MEM_UPDATE)  \
239    SW_API_DESC(SW_API_PT_VLAN_MEM_GET)     \
240    SW_API_DESC(SW_API_PT_FORCE_DEF_VID_SET)    \
241    SW_API_DESC(SW_API_PT_FORCE_DEF_VID_GET)    \
242    SW_API_DESC(SW_API_PT_FORCE_PORTVLAN_SET)   \
243    SW_API_DESC(SW_API_PT_FORCE_PORTVLAN_GET)   \
244    SW_API_DESC(SW_API_NESTVLAN_TPID_SET)    \
245    SW_API_DESC(SW_API_NESTVLAN_TPID_GET)    \
246    SW_API_DESC(SW_API_PT_IN_VLAN_MODE_SET)    \
247    SW_API_DESC(SW_API_PT_IN_VLAN_MODE_GET)    \
248    SW_API_DESC(SW_API_PT_TLS_SET)    \
249    SW_API_DESC(SW_API_PT_TLS_GET)    \
250    SW_API_DESC(SW_API_PT_PRI_PROPAGATION_SET)    \
251    SW_API_DESC(SW_API_PT_PRI_PROPAGATION_GET)    \
252    SW_API_DESC(SW_API_PT_DEF_SVID_SET)    \
253    SW_API_DESC(SW_API_PT_DEF_SVID_GET)    \
254    SW_API_DESC(SW_API_PT_DEF_CVID_SET)    \
255    SW_API_DESC(SW_API_PT_DEF_CVID_GET)    \
256    SW_API_DESC(SW_API_PT_VLAN_PROPAGATION_SET)    \
257    SW_API_DESC(SW_API_PT_VLAN_PROPAGATION_GET)    \
258    SW_API_DESC(SW_API_PT_VLAN_TRANS_ADD)  \
259    SW_API_DESC(SW_API_PT_VLAN_TRANS_DEL)  \
260    SW_API_DESC(SW_API_PT_VLAN_TRANS_GET)  \
261    SW_API_DESC(SW_API_QINQ_MODE_SET)      \
262    SW_API_DESC(SW_API_QINQ_MODE_GET)      \
263    SW_API_DESC(SW_API_PT_QINQ_ROLE_SET)   \
264    SW_API_DESC(SW_API_PT_QINQ_ROLE_GET)   \
265    SW_API_DESC(SW_API_PT_VLAN_TRANS_ITERATE) \
266    SW_API_DESC(SW_API_PT_MAC_VLAN_XLT_SET)   \
267    SW_API_DESC(SW_API_PT_MAC_VLAN_XLT_GET)  \
268    SW_API_DESC(SW_API_NETISOLATE_SET)   \
269    SW_API_DESC(SW_API_NETISOLATE_GET)   \
270    SW_API_DESC(SW_API_EG_FLTR_BYPASS_EN_SET) \
271    SW_API_DESC(SW_API_EG_FLTR_BYPASS_EN_GET)
272
273#else
274#define PORTVLAN_API
275#define PORTVLAN_API_PARAM
276#endif
277
278#ifdef IN_FDB
279#define FDB_API \
280    SW_API_DEF(SW_API_FDB_ADD, dess_fdb_add), \
281    SW_API_DEF(SW_API_FDB_DELALL, dess_fdb_del_all), \
282    SW_API_DEF(SW_API_FDB_DELPORT,dess_fdb_del_by_port), \
283    SW_API_DEF(SW_API_FDB_DELMAC, dess_fdb_del_by_mac), \
284    SW_API_DEF(SW_API_FDB_FIND,   dess_fdb_find), \
285    SW_API_DEF(SW_API_FDB_EXTEND_NEXT,    dess_fdb_extend_next),  \
286    SW_API_DEF(SW_API_FDB_EXTEND_FIRST,   dess_fdb_extend_first),  \
287    SW_API_DEF(SW_API_FDB_TRANSFER,       dess_fdb_transfer),  \
288    SW_API_DEF(SW_API_FDB_PT_LEARN_SET,   dess_fdb_port_learn_set), \
289    SW_API_DEF(SW_API_FDB_PT_LEARN_GET,   dess_fdb_port_learn_get), \
290    SW_API_DEF(SW_API_FDB_AGE_CTRL_SET,   dess_fdb_age_ctrl_set), \
291    SW_API_DEF(SW_API_FDB_AGE_CTRL_GET,   dess_fdb_age_ctrl_get), \
292    SW_API_DEF(SW_API_FDB_VLAN_IVL_SVL_SET, dess_fdb_vlan_ivl_svl_set),\
293    SW_API_DEF(SW_API_FDB_VLAN_IVL_SVL_GET, dess_fdb_vlan_ivl_svl_get),\
294    SW_API_DEF(SW_API_FDB_AGE_TIME_SET,   dess_fdb_age_time_set), \
295    SW_API_DEF(SW_API_FDB_AGE_TIME_GET,   dess_fdb_age_time_get), \
296    SW_API_DEF(SW_API_PT_FDB_LEARN_LIMIT_SET,    dess_port_fdb_learn_limit_set),  \
297    SW_API_DEF(SW_API_PT_FDB_LEARN_LIMIT_GET,    dess_port_fdb_learn_limit_get),  \
298    SW_API_DEF(SW_API_PT_FDB_LEARN_EXCEED_CMD_SET,    dess_port_fdb_learn_exceed_cmd_set),  \
299    SW_API_DEF(SW_API_PT_FDB_LEARN_EXCEED_CMD_GET,    dess_port_fdb_learn_exceed_cmd_get), \
300    SW_API_DEF(SW_API_FDB_LEARN_LIMIT_SET,    dess_fdb_learn_limit_set),  \
301    SW_API_DEF(SW_API_FDB_LEARN_LIMIT_GET,    dess_fdb_learn_limit_get),  \
302    SW_API_DEF(SW_API_FDB_LEARN_EXCEED_CMD_SET,    dess_fdb_learn_exceed_cmd_set),  \
303    SW_API_DEF(SW_API_FDB_LEARN_EXCEED_CMD_GET,    dess_fdb_learn_exceed_cmd_get),  \
304    SW_API_DEF(SW_API_FDB_RESV_ADD, dess_fdb_resv_add), \
305    SW_API_DEF(SW_API_FDB_RESV_DEL, dess_fdb_resv_del), \
306    SW_API_DEF(SW_API_FDB_RESV_FIND, dess_fdb_resv_find), \
307    SW_API_DEF(SW_API_FDB_RESV_ITERATE, dess_fdb_resv_iterate), \
308    SW_API_DEF(SW_API_FDB_PT_LEARN_STATIC_SET,   dess_fdb_port_learn_static_set), \
309    SW_API_DEF(SW_API_FDB_PT_LEARN_STATIC_GET,   dess_fdb_port_learn_static_get), \
310    SW_API_DEF(SW_API_FDB_PORT_ADD,   dess_fdb_port_add), \
311    SW_API_DEF(SW_API_FDB_PORT_DEL,   dess_fdb_port_del),
312
313#define FDB_API_PARAM \
314    SW_API_DESC(SW_API_FDB_ADD) \
315    SW_API_DESC(SW_API_FDB_DELALL)  \
316    SW_API_DESC(SW_API_FDB_DELPORT) \
317    SW_API_DESC(SW_API_FDB_DELMAC) \
318    SW_API_DESC(SW_API_FDB_FIND) \
319    SW_API_DESC(SW_API_FDB_EXTEND_NEXT)  \
320    SW_API_DESC(SW_API_FDB_EXTEND_FIRST) \
321    SW_API_DESC(SW_API_FDB_TRANSFER) \
322    SW_API_DESC(SW_API_FDB_PT_LEARN_SET) \
323    SW_API_DESC(SW_API_FDB_PT_LEARN_GET) \
324    SW_API_DESC(SW_API_FDB_AGE_CTRL_SET) \
325    SW_API_DESC(SW_API_FDB_AGE_CTRL_GET) \
326    SW_API_DESC(SW_API_FDB_VLAN_IVL_SVL_SET) \
327    SW_API_DESC(SW_API_FDB_VLAN_IVL_SVL_GET) \
328    SW_API_DESC(SW_API_FDB_AGE_TIME_SET) \
329    SW_API_DESC(SW_API_FDB_AGE_TIME_GET) \
330    SW_API_DESC(SW_API_PT_FDB_LEARN_LIMIT_SET)  \
331    SW_API_DESC(SW_API_PT_FDB_LEARN_LIMIT_GET)  \
332    SW_API_DESC(SW_API_PT_FDB_LEARN_EXCEED_CMD_SET)  \
333    SW_API_DESC(SW_API_PT_FDB_LEARN_EXCEED_CMD_GET)  \
334    SW_API_DESC(SW_API_FDB_LEARN_LIMIT_SET)  \
335    SW_API_DESC(SW_API_FDB_LEARN_LIMIT_GET)  \
336    SW_API_DESC(SW_API_FDB_LEARN_EXCEED_CMD_SET)  \
337    SW_API_DESC(SW_API_FDB_LEARN_EXCEED_CMD_GET)  \
338    SW_API_DESC(SW_API_FDB_RESV_ADD)  \
339    SW_API_DESC(SW_API_FDB_RESV_DEL)  \
340    SW_API_DESC(SW_API_FDB_RESV_FIND) \
341    SW_API_DESC(SW_API_FDB_RESV_ITERATE) \
342    SW_API_DESC(SW_API_FDB_PT_LEARN_STATIC_SET) \
343    SW_API_DESC(SW_API_FDB_PT_LEARN_STATIC_GET) \
344    SW_API_DESC(SW_API_FDB_PORT_ADD)  \
345    SW_API_DESC(SW_API_FDB_PORT_DEL)
346
347#else
348#define FDB_API
349#define FDB_API_PARAM
350#endif
351
352
353#ifdef IN_ACL
354#define ACL_API \
355    SW_API_DEF(SW_API_ACL_LIST_CREAT, dess_acl_list_creat), \
356    SW_API_DEF(SW_API_ACL_LIST_DESTROY, dess_acl_list_destroy), \
357    SW_API_DEF(SW_API_ACL_RULE_ADD, dess_acl_rule_add), \
358    SW_API_DEF(SW_API_ACL_RULE_DELETE, dess_acl_rule_delete), \
359    SW_API_DEF(SW_API_ACL_RULE_QUERY, dess_acl_rule_query), \
360    SW_API_DEF(SW_API_ACL_LIST_BIND, dess_acl_list_bind), \
361    SW_API_DEF(SW_API_ACL_LIST_UNBIND, dess_acl_list_unbind), \
362    SW_API_DEF(SW_API_ACL_STATUS_SET, dess_acl_status_set), \
363    SW_API_DEF(SW_API_ACL_STATUS_GET, dess_acl_status_get), \
364    SW_API_DEF(SW_API_ACL_LIST_DUMP, dess_acl_list_dump), \
365    SW_API_DEF(SW_API_ACL_RULE_DUMP, dess_acl_rule_dump), \
366    SW_API_DEF(SW_API_ACL_PT_UDF_PROFILE_SET, dessort_udf_profile_set), \
367    SW_API_DEF(SW_API_ACL_PT_UDF_PROFILE_GET, dess_acl_port_udf_profile_get), \
368    SW_API_DEF(SW_API_ACL_RULE_ACTIVE, dess_acl_rule_active), \
369    SW_API_DEF(SW_API_ACL_RULE_DEACTIVE, dess_acl_rule_deactive),\
370    SW_API_DEF(SW_API_ACL_RULE_SRC_FILTER_STS_SET, dess_acl_rule_src_filter_sts_set),\
371    SW_API_DEF(SW_API_ACL_RULE_SRC_FILTER_STS_GET, dess_acl_rule_src_filter_sts_get), \
372    SW_API_DEF(SW_API_ACL_RULE_GET_OFFSET, dess_acl_rule_get_offset),
373
374#define ACL_API_PARAM \
375    SW_API_DESC(SW_API_ACL_LIST_CREAT)   \
376    SW_API_DESC(SW_API_ACL_LIST_DESTROY) \
377    SW_API_DESC(SW_API_ACL_RULE_ADD)     \
378    SW_API_DESC(SW_API_ACL_RULE_DELETE)  \
379    SW_API_DESC(SW_API_ACL_RULE_QUERY)   \
380    SW_API_DESC(SW_API_ACL_LIST_BIND)    \
381    SW_API_DESC(SW_API_ACL_LIST_UNBIND)  \
382    SW_API_DESC(SW_API_ACL_STATUS_SET)   \
383    SW_API_DESC(SW_API_ACL_STATUS_GET)   \
384    SW_API_DESC(SW_API_ACL_LIST_DUMP)    \
385    SW_API_DESC(SW_API_ACL_RULE_DUMP)    \
386    SW_API_DESC(SW_API_ACL_PT_UDF_PROFILE_SET)    \
387    SW_API_DESC(SW_API_ACL_PT_UDF_PROFILE_GET)    \
388    SW_API_DESC(SW_API_ACL_RULE_ACTIVE)    \
389    SW_API_DESC(SW_API_ACL_RULE_DEACTIVE) \
390    SW_API_DESC(SW_API_ACL_RULE_SRC_FILTER_STS_SET) \
391    SW_API_DESC(SW_API_ACL_RULE_SRC_FILTER_STS_GET)
392#else
393#define ACL_API
394#define ACL_API_PARAM
395#endif
396
397
398#ifdef IN_QOS
399#define QOS_API \
400    SW_API_DEF(SW_API_QOS_QU_TX_BUF_ST_SET, dess_qos_queue_tx_buf_status_set), \
401    SW_API_DEF(SW_API_QOS_QU_TX_BUF_ST_GET, dess_qos_queue_tx_buf_status_get), \
402    SW_API_DEF(SW_API_QOS_QU_TX_BUF_NR_SET, dess_qos_queue_tx_buf_nr_set), \
403    SW_API_DEF(SW_API_QOS_QU_TX_BUF_NR_GET, dess_qos_queue_tx_buf_nr_get), \
404    SW_API_DEF(SW_API_QOS_PT_TX_BUF_ST_SET, dess_qos_port_tx_buf_status_set), \
405    SW_API_DEF(SW_API_QOS_PT_TX_BUF_ST_GET, dess_qos_port_tx_buf_status_get), \
406    SW_API_DEF(SW_API_QOS_PT_RED_EN_SET, dess_qos_port_red_en_set),\
407    SW_API_DEF(SW_API_QOS_PT_RED_EN_GET, dess_qos_port_red_en_get),\
408    SW_API_DEF(SW_API_QOS_PT_TX_BUF_NR_SET, dess_qos_port_tx_buf_nr_set), \
409    SW_API_DEF(SW_API_QOS_PT_TX_BUF_NR_GET, dess_qos_port_tx_buf_nr_get), \
410    SW_API_DEF(SW_API_QOS_PT_RX_BUF_NR_SET, dess_qos_port_rx_buf_nr_set), \
411    SW_API_DEF(SW_API_QOS_PT_RX_BUF_NR_GET, dess_qos_port_rx_buf_nr_get), \
412    SW_API_DEF(SW_API_QOS_PT_MODE_SET, dess_qos_port_mode_set), \
413    SW_API_DEF(SW_API_QOS_PT_MODE_GET, dess_qos_port_mode_get), \
414    SW_API_DEF(SW_API_QOS_PT_MODE_PRI_SET, dess_qos_port_mode_pri_set), \
415    SW_API_DEF(SW_API_QOS_PT_MODE_PRI_GET, dess_qos_port_mode_pri_get), \
416    SW_API_DEF(SW_API_QOS_PORT_SCH_MODE_SET, dess_qos_port_sch_mode_set), \
417    SW_API_DEF(SW_API_QOS_PORT_SCH_MODE_GET, dess_qos_port_sch_mode_get), \
418    SW_API_DEF(SW_API_QOS_PT_DEF_SPRI_SET, dess_qos_port_default_spri_set), \
419    SW_API_DEF(SW_API_QOS_PT_DEF_SPRI_GET, dess_qos_port_default_spri_get), \
420    SW_API_DEF(SW_API_QOS_PT_DEF_CPRI_SET, dess_qos_port_default_cpri_set), \
421    SW_API_DEF(SW_API_QOS_PT_DEF_CPRI_GET, dess_qos_port_default_cpri_get), \
422    SW_API_DEF(SW_API_QOS_PT_FORCE_SPRI_ST_SET, dess_qos_port_force_spri_status_set), \
423    SW_API_DEF(SW_API_QOS_PT_FORCE_SPRI_ST_GET, dess_qos_port_force_spri_status_get), \
424    SW_API_DEF(SW_API_QOS_PT_FORCE_CPRI_ST_SET, dess_qos_port_force_cpri_status_set), \
425    SW_API_DEF(SW_API_QOS_PT_FORCE_CPRI_ST_GET, dess_qos_port_force_cpri_status_get), \
426    SW_API_DEF(SW_API_QOS_QUEUE_REMARK_SET, dess_qos_queue_remark_table_set), \
427    SW_API_DEF(SW_API_QOS_QUEUE_REMARK_GET, dess_qos_queue_remark_table_get),
428
429
430#define QOS_API_PARAM \
431    SW_API_DESC(SW_API_QOS_QU_TX_BUF_ST_SET) \
432    SW_API_DESC(SW_API_QOS_QU_TX_BUF_ST_GET) \
433    SW_API_DESC(SW_API_QOS_QU_TX_BUF_NR_SET) \
434    SW_API_DESC(SW_API_QOS_QU_TX_BUF_NR_GET) \
435    SW_API_DESC(SW_API_QOS_PT_TX_BUF_ST_SET) \
436    SW_API_DESC(SW_API_QOS_PT_TX_BUF_ST_GET) \
437    SW_API_DESC(SW_API_QOS_PT_RED_EN_SET) \
438    SW_API_DESC(SW_API_QOS_PT_RED_EN_GET) \
439    SW_API_DESC(SW_API_QOS_PT_TX_BUF_NR_SET) \
440    SW_API_DESC(SW_API_QOS_PT_TX_BUF_NR_GET) \
441    SW_API_DESC(SW_API_QOS_PT_RX_BUF_NR_SET) \
442    SW_API_DESC(SW_API_QOS_PT_RX_BUF_NR_GET) \
443    SW_API_DESC(SW_API_QOS_PT_MODE_SET) \
444    SW_API_DESC(SW_API_QOS_PT_MODE_GET) \
445    SW_API_DESC(SW_API_QOS_PT_MODE_PRI_SET) \
446    SW_API_DESC(SW_API_QOS_PT_MODE_PRI_GET) \
447    SW_API_DESC(SW_API_QOS_PORT_DEF_UP_SET) \
448    SW_API_DESC(SW_API_QOS_PORT_DEF_UP_GET) \
449    SW_API_DESC(SW_API_QOS_PORT_SCH_MODE_SET) \
450    SW_API_DESC(SW_API_QOS_PORT_SCH_MODE_GET) \
451    SW_API_DESC(SW_API_QOS_PT_DEF_SPRI_SET)  \
452    SW_API_DESC(SW_API_QOS_PT_DEF_SPRI_GET)  \
453    SW_API_DESC(SW_API_QOS_PT_DEF_CPRI_SET)  \
454    SW_API_DESC(SW_API_QOS_PT_DEF_CPRI_GET)  \
455    SW_API_DESC(SW_API_QOS_PT_FORCE_SPRI_ST_SET)  \
456    SW_API_DESC(SW_API_QOS_PT_FORCE_SPRI_ST_GET)  \
457    SW_API_DESC(SW_API_QOS_PT_FORCE_CPRI_ST_SET)  \
458    SW_API_DESC(SW_API_QOS_PT_FORCE_CPRI_ST_GET)  \
459    SW_API_DESC(SW_API_QOS_QUEUE_REMARK_SET) \
460    SW_API_DESC(SW_API_QOS_QUEUE_REMARK_GET)
461#else
462#define QOS_API
463#define QOS_API_PARAM
464#endif
465
466
467#ifdef IN_IGMP
468#define IGMP_API \
469    SW_API_DEF(SW_API_PT_IGMPS_MODE_SET, dess_port_igmps_status_set), \
470    SW_API_DEF(SW_API_PT_IGMPS_MODE_GET, dess_port_igmps_status_get), \
471    SW_API_DEF(SW_API_IGMP_MLD_CMD_SET, dess_igmp_mld_cmd_set), \
472    SW_API_DEF(SW_API_IGMP_MLD_CMD_GET, dess_igmp_mld_cmd_get), \
473    SW_API_DEF(SW_API_IGMP_PT_JOIN_SET, dess_port_igmp_mld_join_set), \
474    SW_API_DEF(SW_API_IGMP_PT_JOIN_GET, dess_port_igmp_mld_join_get), \
475    SW_API_DEF(SW_API_IGMP_PT_LEAVE_SET, dess_port_igmp_mld_leave_set), \
476    SW_API_DEF(SW_API_IGMP_PT_LEAVE_GET, dess_port_igmp_mld_leave_get), \
477    SW_API_DEF(SW_API_IGMP_RP_SET, dess_igmp_mld_rp_set), \
478    SW_API_DEF(SW_API_IGMP_RP_GET, dess_igmp_mld_rp_get), \
479    SW_API_DEF(SW_API_IGMP_ENTRY_CREAT_SET, dess_igmp_mld_entry_creat_set), \
480    SW_API_DEF(SW_API_IGMP_ENTRY_CREAT_GET, dess_igmp_mld_entry_creat_get), \
481    SW_API_DEF(SW_API_IGMP_ENTRY_STATIC_SET, dess_igmp_mld_entry_static_set), \
482    SW_API_DEF(SW_API_IGMP_ENTRY_STATIC_GET, dess_igmp_mld_entry_static_get), \
483    SW_API_DEF(SW_API_IGMP_ENTRY_LEAKY_SET, dess_igmp_mld_entry_leaky_set), \
484    SW_API_DEF(SW_API_IGMP_ENTRY_LEAKY_GET, dess_igmp_mld_entry_leaky_get), \
485    SW_API_DEF(SW_API_IGMP_ENTRY_V3_SET, dess_igmp_mld_entry_v3_set), \
486    SW_API_DEF(SW_API_IGMP_ENTRY_V3_GET, dess_igmp_mld_entry_v3_get), \
487    SW_API_DEF(SW_API_IGMP_ENTRY_QUEUE_SET, dess_igmp_mld_entry_queue_set), \
488    SW_API_DEF(SW_API_IGMP_ENTRY_QUEUE_GET, dess_igmp_mld_entry_queue_get), \
489    SW_API_DEF(SW_API_PT_IGMP_LEARN_LIMIT_SET,    dess_port_igmp_mld_learn_limit_set),  \
490    SW_API_DEF(SW_API_PT_IGMP_LEARN_LIMIT_GET,    dess_port_igmp_mld_learn_limit_get),  \
491    SW_API_DEF(SW_API_PT_IGMP_LEARN_EXCEED_CMD_SET,    dess_port_igmp_mld_learn_exceed_cmd_set),  \
492    SW_API_DEF(SW_API_PT_IGMP_LEARN_EXCEED_CMD_GET,    dess_port_igmp_mld_learn_exceed_cmd_get), \
493    SW_API_DEF(SW_API_IGMP_SG_ENTRY_SET,    dess_igmp_sg_entry_set),  \
494    SW_API_DEF(SW_API_IGMP_SG_ENTRY_CLEAR,    dess_igmp_sg_entry_clear),  \
495    SW_API_DEF(SW_API_IGMP_SG_ENTRY_SHOW,    dess_igmp_sg_entry_show),
496
497#define IGMP_API_PARAM \
498    SW_API_DESC(SW_API_PT_IGMPS_MODE_SET) \
499    SW_API_DESC(SW_API_PT_IGMPS_MODE_GET) \
500    SW_API_DESC(SW_API_IGMP_MLD_CMD_SET)  \
501    SW_API_DESC(SW_API_IGMP_MLD_CMD_GET)  \
502    SW_API_DESC(SW_API_IGMP_PT_JOIN_SET)  \
503    SW_API_DESC(SW_API_IGMP_PT_JOIN_GET)  \
504    SW_API_DESC(SW_API_IGMP_PT_LEAVE_SET) \
505    SW_API_DESC(SW_API_IGMP_PT_LEAVE_GET) \
506    SW_API_DESC(SW_API_IGMP_RP_SET)  \
507    SW_API_DESC(SW_API_IGMP_RP_GET)  \
508    SW_API_DESC(SW_API_IGMP_ENTRY_CREAT_SET)  \
509    SW_API_DESC(SW_API_IGMP_ENTRY_CREAT_GET)  \
510    SW_API_DESC(SW_API_IGMP_ENTRY_STATIC_SET) \
511    SW_API_DESC(SW_API_IGMP_ENTRY_STATIC_GET) \
512    SW_API_DESC(SW_API_IGMP_ENTRY_LEAKY_SET)  \
513    SW_API_DESC(SW_API_IGMP_ENTRY_LEAKY_GET)  \
514    SW_API_DESC(SW_API_IGMP_ENTRY_V3_SET)  \
515    SW_API_DESC(SW_API_IGMP_ENTRY_V3_GET)  \
516    SW_API_DESC(SW_API_IGMP_ENTRY_QUEUE_SET)  \
517    SW_API_DESC(SW_API_IGMP_ENTRY_QUEUE_GET) \
518    SW_API_DESC(SW_API_PT_IGMP_LEARN_LIMIT_SET) \
519    SW_API_DESC(SW_API_PT_IGMP_LEARN_LIMIT_GET) \
520    SW_API_DESC(SW_API_PT_IGMP_LEARN_EXCEED_CMD_SET) \
521    SW_API_DESC(SW_API_PT_IGMP_LEARN_EXCEED_CMD_GET) \
522    SW_API_DESC(SW_API_IGMP_SG_ENTRY_SET) \
523    SW_API_DESC(SW_API_IGMP_SG_ENTRY_CLEAR) \
524    SW_API_DESC(SW_API_IGMP_SG_ENTRY_SHOW)
525#else
526#define IGMP_API
527#define IGMP_API_PARAM
528#endif
529
530
531#ifdef IN_LEAKY
532#define LEAKY_API \
533    SW_API_DEF(SW_API_UC_LEAKY_MODE_SET, dess_uc_leaky_mode_set), \
534    SW_API_DEF(SW_API_UC_LEAKY_MODE_GET, dess_uc_leaky_mode_get), \
535    SW_API_DEF(SW_API_MC_LEAKY_MODE_SET, dess_mc_leaky_mode_set), \
536    SW_API_DEF(SW_API_MC_LEAKY_MODE_GET, dess_mc_leaky_mode_get), \
537    SW_API_DEF(SW_API_ARP_LEAKY_MODE_SET, dess_port_arp_leaky_set), \
538    SW_API_DEF(SW_API_ARP_LEAKY_MODE_GET, dess_port_arp_leaky_get), \
539    SW_API_DEF(SW_API_PT_UC_LEAKY_MODE_SET, dess_port_uc_leaky_set), \
540    SW_API_DEF(SW_API_PT_UC_LEAKY_MODE_GET, dess_port_uc_leaky_get), \
541    SW_API_DEF(SW_API_PT_MC_LEAKY_MODE_SET, dess_port_mc_leaky_set), \
542    SW_API_DEF(SW_API_PT_MC_LEAKY_MODE_GET, dess_port_mc_leaky_get),
543
544#define LEAKY_API_PARAM \
545    SW_API_DESC(SW_API_UC_LEAKY_MODE_SET)  \
546    SW_API_DESC(SW_API_UC_LEAKY_MODE_GET)  \
547    SW_API_DESC(SW_API_MC_LEAKY_MODE_SET)  \
548    SW_API_DESC(SW_API_MC_LEAKY_MODE_GET)  \
549    SW_API_DESC(SW_API_ARP_LEAKY_MODE_SET) \
550    SW_API_DESC(SW_API_ARP_LEAKY_MODE_GET) \
551    SW_API_DESC(SW_API_PT_UC_LEAKY_MODE_SET)  \
552    SW_API_DESC(SW_API_PT_UC_LEAKY_MODE_GET)  \
553    SW_API_DESC(SW_API_PT_MC_LEAKY_MODE_SET)  \
554    SW_API_DESC(SW_API_PT_MC_LEAKY_MODE_GET)
555#else
556#define LEAKY_API
557#define LEAKY_API_PARAM
558#endif
559
560
561#ifdef IN_MIRROR
562#define MIRROR_API \
563    SW_API_DEF(SW_API_MIRROR_ANALY_PT_SET, dess_mirr_analysis_port_set), \
564    SW_API_DEF(SW_API_MIRROR_ANALY_PT_GET, dess_mirr_analysis_port_get), \
565    SW_API_DEF(SW_API_MIRROR_IN_PT_SET, dess_mirr_port_in_set), \
566    SW_API_DEF(SW_API_MIRROR_IN_PT_GET, dess_mirr_port_in_get), \
567    SW_API_DEF(SW_API_MIRROR_EG_PT_SET, dess_mirr_port_eg_set), \
568    SW_API_DEF(SW_API_MIRROR_EG_PT_GET, dess_mirr_port_eg_get),
569
570#define MIRROR_API_PARAM \
571    SW_API_DESC(SW_API_MIRROR_ANALY_PT_SET)  \
572    SW_API_DESC(SW_API_MIRROR_ANALY_PT_GET)  \
573    SW_API_DESC(SW_API_MIRROR_IN_PT_SET)  \
574    SW_API_DESC(SW_API_MIRROR_IN_PT_GET)  \
575    SW_API_DESC(SW_API_MIRROR_EG_PT_SET)  \
576    SW_API_DESC(SW_API_MIRROR_EG_PT_GET)
577#else
578#define MIRROR_API
579#define MIRROR_API_PARAM
580#endif
581
582
583#ifdef IN_RATE
584#define RATE_API \
585    SW_API_DEF(SW_API_RATE_PORT_POLICER_SET, dess_rate_port_policer_set), \
586    SW_API_DEF(SW_API_RATE_PORT_POLICER_GET, dess_rate_port_policer_get), \
587    SW_API_DEF(SW_API_RATE_PORT_SHAPER_SET, dess_rate_port_shaper_set), \
588    SW_API_DEF(SW_API_RATE_PORT_SHAPER_GET, dess_rate_port_shaper_get), \
589    SW_API_DEF(SW_API_RATE_QUEUE_SHAPER_SET, dess_rate_queue_shaper_set), \
590    SW_API_DEF(SW_API_RATE_QUEUE_SHAPER_GET, dess_rate_queue_shaper_get), \
591    SW_API_DEF(SW_API_RATE_ACL_POLICER_SET, dess_rate_acl_policer_set), \
592    SW_API_DEF(SW_API_RATE_ACL_POLICER_GET, dess_rate_acl_policer_get), \
593    SW_API_DEF(SW_API_RATE_PT_ADDRATEBYTE_SET, dess_rate_port_add_rate_byte_set), \
594    SW_API_DEF(SW_API_RATE_PT_ADDRATEBYTE_GET, dess_rate_port_add_rate_byte_get), \
595    SW_API_DEF(SW_API_RATE_PT_GOL_FLOW_EN_SET, dess_rate_port_gol_flow_en_set), \
596    SW_API_DEF(SW_API_RATE_PT_GOL_FLOW_EN_GET, dess_rate_port_gol_flow_en_get),
597
598#define RATE_API_PARAM \
599    SW_API_DESC(SW_API_RATE_PORT_POLICER_SET) \
600    SW_API_DESC(SW_API_RATE_PORT_POLICER_GET) \
601    SW_API_DESC(SW_API_RATE_PORT_SHAPER_SET) \
602    SW_API_DESC(SW_API_RATE_PORT_SHAPER_GET) \
603    SW_API_DESC(SW_API_RATE_QUEUE_SHAPER_SET) \
604    SW_API_DESC(SW_API_RATE_QUEUE_SHAPER_GET) \
605    SW_API_DESC(SW_API_RATE_ACL_POLICER_SET) \
606    SW_API_DESC(SW_API_RATE_ACL_POLICER_GET) \
607    SW_API_DESC(SW_API_RATE_PT_ADDRATEBYTE_SET) \
608    SW_API_DESC(SW_API_RATE_PT_ADDRATEBYTE_GET) \
609    SW_API_DESC(SW_API_RATE_PT_GOL_FLOW_EN_SET) \
610    SW_API_DESC(SW_API_RATE_PT_GOL_FLOW_EN_GET)
611#else
612#define RATE_API
613#define RATE_API_PARAM
614#endif
615
616
617#ifdef IN_STP
618#define STP_API \
619    SW_API_DEF(SW_API_STP_PT_STATE_SET, dess_stp_port_state_set), \
620    SW_API_DEF(SW_API_STP_PT_STATE_GET, dess_stp_port_state_get),
621
622#define STP_API_PARAM \
623    SW_API_DESC(SW_API_STP_PT_STATE_SET) \
624    SW_API_DESC(SW_API_STP_PT_STATE_GET)
625#else
626#define STP_API
627#define STP_API_PARAM
628#endif
629
630
631#ifdef IN_MIB
632#define MIB_API \
633    SW_API_DEF(SW_API_PT_MIB_GET, dess_get_mib_info), \
634    SW_API_DEF(SW_API_MIB_STATUS_SET, dess_mib_status_set), \
635    SW_API_DEF(SW_API_MIB_STATUS_GET, dess_mib_status_get), \
636    SW_API_DEF(SW_API_PT_MIB_FLUSH_COUNTERS, dess_mib_port_flush_counters), \
637    SW_API_DEF(SW_API_MIB_CPU_KEEP_SET, dess_mib_cpukeep_set), \
638    SW_API_DEF(SW_API_MIB_CPU_KEEP_GET, dess_mib_cpukeep_get),
639
640
641#define MIB_API_PARAM \
642    SW_API_DESC(SW_API_PT_MIB_GET)  \
643    SW_API_DESC(SW_API_MIB_STATUS_SET) \
644    SW_API_DESC(SW_API_MIB_STATUS_GET)\
645    SW_API_DESC(SW_API_PT_MIB_FLUSH_COUNTERS) \
646    SW_API_DESC(SW_API_MIB_CPU_KEEP_SET) \
647    SW_API_DESC(SW_API_MIB_CPU_KEEP_GET)
648#else
649#define MIB_API
650#define MIB_API_PARAM
651#endif
652
653
654#ifdef IN_MISC
655#define MISC_API \
656    SW_API_DEF(SW_API_FRAME_MAX_SIZE_SET, dess_frame_max_size_set), \
657    SW_API_DEF(SW_API_FRAME_MAX_SIZE_GET, dess_frame_max_size_get), \
658    SW_API_DEF(SW_API_PT_UNK_UC_FILTER_SET, dess_port_unk_uc_filter_set), \
659    SW_API_DEF(SW_API_PT_UNK_UC_FILTER_GET, dess_port_unk_uc_filter_get), \
660    SW_API_DEF(SW_API_PT_UNK_MC_FILTER_SET, dess_port_unk_mc_filter_set), \
661    SW_API_DEF(SW_API_PT_UNK_MC_FILTER_GET, dess_port_unk_mc_filter_get), \
662    SW_API_DEF(SW_API_PT_BC_FILTER_SET, dess_port_bc_filter_set), \
663    SW_API_DEF(SW_API_PT_BC_FILTER_GET, dess_port_bc_filter_get), \
664    SW_API_DEF(SW_API_CPU_PORT_STATUS_SET, dess_cpu_port_status_set), \
665    SW_API_DEF(SW_API_CPU_PORT_STATUS_GET, dess_cpu_port_status_get), \
666    SW_API_DEF(SW_API_PPPOE_CMD_SET, dess_pppoe_cmd_set), \
667    SW_API_DEF(SW_API_PPPOE_CMD_GET, dess_pppoe_cmd_get), \
668    SW_API_DEF(SW_API_PPPOE_STATUS_SET, dess_pppoe_status_set), \
669    SW_API_DEF(SW_API_PPPOE_STATUS_GET, dess_pppoe_status_get), \
670    SW_API_DEF(SW_API_PT_DHCP_SET, dess_port_dhcp_set), \
671    SW_API_DEF(SW_API_PT_DHCP_GET, dess_port_dhcp_get), \
672    SW_API_DEF(SW_API_ARP_CMD_SET, dess_arp_cmd_set), \
673    SW_API_DEF(SW_API_ARP_CMD_GET, dess_arp_cmd_get), \
674    SW_API_DEF(SW_API_EAPOL_CMD_SET, dess_eapol_cmd_set), \
675    SW_API_DEF(SW_API_EAPOL_CMD_GET, dess_eapol_cmd_get), \
676    SW_API_DEF(SW_API_EAPOL_STATUS_SET, dess_eapol_status_set), \
677    SW_API_DEF(SW_API_EAPOL_STATUS_GET, dess_eapol_status_get), \
678    SW_API_DEF(SW_API_RIPV1_STATUS_SET, dess_ripv1_status_set), \
679    SW_API_DEF(SW_API_RIPV1_STATUS_GET, dess_ripv1_status_get), \
680    SW_API_DEF(SW_API_PT_ARP_REQ_STATUS_SET, dess_port_arp_req_status_set), \
681    SW_API_DEF(SW_API_PT_ARP_REQ_STATUS_GET, dess_port_arp_req_status_get), \
682    SW_API_DEF(SW_API_PT_ARP_ACK_STATUS_SET, dess_port_arp_ack_status_set), \
683    SW_API_DEF(SW_API_PT_ARP_ACK_STATUS_GET, dess_port_arp_ack_status_get), \
684    SW_API_DEF(SW_API_PPPOE_SESSION_TABLE_ADD, dess_pppoe_session_table_add), \
685    SW_API_DEF(SW_API_PPPOE_SESSION_TABLE_DEL, dess_pppoe_session_table_del), \
686    SW_API_DEF(SW_API_PPPOE_SESSION_TABLE_GET, dess_pppoe_session_table_get), \
687    SW_API_DEF(SW_API_PPPOE_SESSION_ID_SET, dess_pppoe_session_id_set), \
688    SW_API_DEF(SW_API_PPPOE_SESSION_ID_GET, dess_pppoe_session_id_get), \
689    SW_API_DEF(SW_API_INTR_MASK_SET, dess_intr_mask_set), \
690    SW_API_DEF(SW_API_INTR_MASK_GET, dess_intr_mask_get), \
691    SW_API_DEF(SW_API_INTR_STATUS_GET, dess_intr_status_get),   \
692    SW_API_DEF(SW_API_INTR_STATUS_CLEAR, dess_intr_status_clear), \
693    SW_API_DEF(SW_API_INTR_PORT_LINK_MASK_SET, dess_intr_port_link_mask_set), \
694    SW_API_DEF(SW_API_INTR_PORT_LINK_MASK_GET, dess_intr_port_link_mask_get), \
695    SW_API_DEF(SW_API_INTR_PORT_LINK_STATUS_GET, dess_intr_port_link_status_get),\
696    SW_API_DEF(SW_API_INTR_MASK_MAC_LINKCHG_SET, dess_intr_mask_mac_linkchg_set), \
697    SW_API_DEF(SW_API_INTR_MASK_MAC_LINKCHG_GET, dess_intr_mask_mac_linkchg_get), \
698    SW_API_DEF(SW_API_INTR_STATUS_MAC_LINKCHG_GET, dess_intr_status_mac_linkchg_get), \
699        SW_API_DEF(SW_API_INTR_STATUS_MAC_LINKCHG_CLEAR, dess_intr_status_mac_linkchg_clear), \
700    SW_API_DEF(SW_API_CPU_VID_EN_SET, dess_cpu_vid_en_set), \
701    SW_API_DEF(SW_API_CPU_VID_EN_GET, dess_cpu_vid_en_get), \
702    SW_API_DEF(SW_API_RTD_PPPOE_EN_SET, dess_rtd_pppoe_en_set), \
703    SW_API_DEF(SW_API_RTD_PPPOE_EN_GET, dess_rtd_pppoe_en_get), \
704	SW_API_DEF(SW_API_GLOBAL_MACADDR_SET, dess_global_macaddr_set), \
705    SW_API_DEF(SW_API_GLOBAL_MACADDR_GET, dess_global_macaddr_get), \
706    SW_API_DEF(SW_API_LLDP_STATUS_SET, dess_lldp_status_set), \
707    SW_API_DEF(SW_API_LLDP_STATUS_GET, dess_lldp_status_get), \
708    SW_API_DEF(SW_API_FRAME_CRC_RESERVE_SET, dess_frame_crc_reserve_set), \
709    SW_API_DEF(SW_API_FRAME_CRC_RESERVE_GET, dess_frame_crc_reserve_get),
710
711#define MISC_API_PARAM \
712    SW_API_DESC(SW_API_FRAME_MAX_SIZE_SET)  \
713    SW_API_DESC(SW_API_FRAME_MAX_SIZE_GET)  \
714    SW_API_DESC(SW_API_PT_UNK_UC_FILTER_SET)  \
715    SW_API_DESC(SW_API_PT_UNK_UC_FILTER_GET)  \
716    SW_API_DESC(SW_API_PT_UNK_MC_FILTER_SET)  \
717    SW_API_DESC(SW_API_PT_UNK_MC_FILTER_GET)  \
718    SW_API_DESC(SW_API_PT_BC_FILTER_SET)  \
719    SW_API_DESC(SW_API_PT_BC_FILTER_GET)  \
720    SW_API_DESC(SW_API_CPU_PORT_STATUS_SET)  \
721    SW_API_DESC(SW_API_CPU_PORT_STATUS_GET)  \
722    SW_API_DESC(SW_API_PPPOE_CMD_SET)  \
723    SW_API_DESC(SW_API_PPPOE_CMD_GET)  \
724    SW_API_DESC(SW_API_PPPOE_STATUS_SET)  \
725    SW_API_DESC(SW_API_PPPOE_STATUS_GET)  \
726    SW_API_DESC(SW_API_PT_DHCP_SET)  \
727    SW_API_DESC(SW_API_PT_DHCP_GET)  \
728    SW_API_DESC(SW_API_ARP_CMD_SET)  \
729    SW_API_DESC(SW_API_ARP_CMD_GET)  \
730    SW_API_DESC(SW_API_EAPOL_CMD_SET) \
731    SW_API_DESC(SW_API_EAPOL_CMD_GET) \
732    SW_API_DESC(SW_API_PPPOE_SESSION_ADD)  \
733    SW_API_DESC(SW_API_PPPOE_SESSION_DEL)  \
734    SW_API_DESC(SW_API_PPPOE_SESSION_GET)  \
735    SW_API_DESC(SW_API_EAPOL_STATUS_SET)  \
736    SW_API_DESC(SW_API_EAPOL_STATUS_GET)  \
737    SW_API_DESC(SW_API_RIPV1_STATUS_SET)  \
738    SW_API_DESC(SW_API_RIPV1_STATUS_GET) \
739    SW_API_DESC(SW_API_PT_ARP_REQ_STATUS_SET) \
740    SW_API_DESC(SW_API_PT_ARP_REQ_STATUS_GET) \
741    SW_API_DESC(SW_API_PT_ARP_ACK_STATUS_SET) \
742    SW_API_DESC(SW_API_PT_ARP_ACK_STATUS_GET) \
743    SW_API_DESC(SW_API_PPPOE_SESSION_TABLE_ADD) \
744    SW_API_DESC(SW_API_PPPOE_SESSION_TABLE_DEL) \
745    SW_API_DESC(SW_API_PPPOE_SESSION_TABLE_GET) \
746    SW_API_DESC(SW_API_PPPOE_SESSION_ID_SET) \
747    SW_API_DESC(SW_API_PPPOE_SESSION_ID_GET) \
748    SW_API_DESC(SW_API_INTR_MASK_SET) \
749    SW_API_DESC(SW_API_INTR_MASK_GET) \
750    SW_API_DESC(SW_API_INTR_STATUS_GET)   \
751    SW_API_DESC(SW_API_INTR_STATUS_CLEAR) \
752    SW_API_DESC(SW_API_INTR_PORT_LINK_MASK_SET) \
753    SW_API_DESC(SW_API_INTR_PORT_LINK_MASK_GET) \
754    SW_API_DESC(SW_API_INTR_PORT_LINK_STATUS_GET) \
755     SW_API_DESC(SW_API_INTR_MASK_MAC_LINKCHG_SET) \
756    SW_API_DESC(SW_API_INTR_MASK_MAC_LINKCHG_GET) \
757    SW_API_DESC(SW_API_INTR_STATUS_MAC_LINKCHG_GET) \
758    SW_API_DESC(SW_API_INTR_STATUS_MAC_LINKCHG_CLEAR) \
759    SW_API_DESC(SW_API_CPU_VID_EN_SET)  \
760    SW_API_DESC(SW_API_CPU_VID_EN_GET)  \
761    SW_API_DESC(SW_API_RTD_PPPOE_EN_SET)  \
762    SW_API_DESC(SW_API_RTD_PPPOE_EN_GET) \
763    SW_API_DESC(SW_API_GLOBAL_MACADDR_SET)  \
764    SW_API_DESC(SW_API_GLOBAL_MACADDR_GET) \
765    SW_API_DESC(SW_API_LLDP_STATUS_SET)  \
766    SW_API_DESC(SW_API_LLDP_STATUS_GET)  \
767    SW_API_DESC(SW_API_FRAME_CRC_RESERVE_SET)  \
768    SW_API_DESC(SW_API_FRAME_CRC_RESERVE_GET)
769
770#else
771#define MISC_API
772#define MISC_API_PARAM
773#endif
774
775
776#ifdef IN_LED
777#define LED_API \
778    SW_API_DEF(SW_API_LED_PATTERN_SET, dess_led_ctrl_pattern_set), \
779    SW_API_DEF(SW_API_LED_PATTERN_GET, dess_led_ctrl_pattern_get),
780
781#define LED_API_PARAM \
782    SW_API_DESC(SW_API_LED_PATTERN_SET) \
783    SW_API_DESC(SW_API_LED_PATTERN_GET)
784#else
785#define LED_API
786#define LED_API_PARAM
787#endif
788
789#ifdef IN_COSMAP
790#define COSMAP_API \
791    SW_API_DEF(SW_API_COSMAP_DSCP_TO_PRI_SET, dess_cosmap_dscp_to_pri_set), \
792    SW_API_DEF(SW_API_COSMAP_DSCP_TO_PRI_GET, dess_cosmap_dscp_to_pri_get), \
793    SW_API_DEF(SW_API_COSMAP_DSCP_TO_DP_SET, dess_cosmap_dscp_to_dp_set), \
794    SW_API_DEF(SW_API_COSMAP_DSCP_TO_DP_GET, dess_cosmap_dscp_to_dp_get), \
795    SW_API_DEF(SW_API_COSMAP_UP_TO_PRI_SET, dess_cosmap_up_to_pri_set), \
796    SW_API_DEF(SW_API_COSMAP_UP_TO_PRI_GET, dess_cosmap_up_to_pri_get), \
797    SW_API_DEF(SW_API_COSMAP_UP_TO_DP_SET, dess_cosmap_up_to_dp_set), \
798    SW_API_DEF(SW_API_COSMAP_UP_TO_DP_GET, dess_cosmap_up_to_dp_get), \
799    SW_API_DEF(SW_API_COSMAP_PRI_TO_QU_SET, dess_cosmap_pri_to_queue_set), \
800    SW_API_DEF(SW_API_COSMAP_PRI_TO_QU_GET, dess_cosmap_pri_to_queue_get), \
801    SW_API_DEF(SW_API_COSMAP_PRI_TO_EHQU_SET, dess_cosmap_pri_to_ehqueue_set), \
802    SW_API_DEF(SW_API_COSMAP_PRI_TO_EHQU_GET, dess_cosmap_pri_to_ehqueue_get), \
803    SW_API_DEF(SW_API_COSMAP_EG_REMARK_SET, dess_cosmap_egress_remark_set), \
804    SW_API_DEF(SW_API_COSMAP_EG_REMARK_GET, dess_cosmap_egress_remark_get),
805
806#define COSMAP_API_PARAM \
807    SW_API_DESC(SW_API_COSMAP_DSCP_TO_PRI_SET)  \
808    SW_API_DESC(SW_API_COSMAP_DSCP_TO_PRI_GET)  \
809    SW_API_DESC(SW_API_COSMAP_DSCP_TO_DP_SET)  \
810    SW_API_DESC(SW_API_COSMAP_DSCP_TO_DP_GET)  \
811    SW_API_DESC(SW_API_COSMAP_UP_TO_PRI_SET)  \
812    SW_API_DESC(SW_API_COSMAP_UP_TO_PRI_GET)  \
813    SW_API_DESC(SW_API_COSMAP_UP_TO_DP_SET)  \
814    SW_API_DESC(SW_API_COSMAP_UP_TO_DP_GET)  \
815    SW_API_DESC(SW_API_COSMAP_PRI_TO_QU_SET)  \
816    SW_API_DESC(SW_API_COSMAP_PRI_TO_QU_GET)  \
817    SW_API_DESC(SW_API_COSMAP_PRI_TO_EHQU_SET) \
818    SW_API_DESC(SW_API_COSMAP_PRI_TO_EHQU_GET) \
819    SW_API_DESC(SW_API_COSMAP_EG_REMARK_SET) \
820    SW_API_DESC(SW_API_COSMAP_EG_REMARK_GET)
821#else
822#define COSMAP_API
823#define COSMAP_API_PARAM
824#endif
825
826#ifdef IN_SEC
827#define SEC_API \
828    SW_API_DEF(SW_API_SEC_NORM_SET, dess_sec_norm_item_set), \
829    SW_API_DEF(SW_API_SEC_NORM_GET, dess_sec_norm_item_get), \
830    SW_API_DEF(SW_API_SEC_MAC_SET, dess_sec_norm_item_set), \
831    SW_API_DEF(SW_API_SEC_MAC_GET, dess_sec_norm_item_get), \
832    SW_API_DEF(SW_API_SEC_IP_SET, dess_sec_norm_item_set), \
833    SW_API_DEF(SW_API_SEC_IP_GET, dess_sec_norm_item_get), \
834    SW_API_DEF(SW_API_SEC_IP4_SET, dess_sec_norm_item_set), \
835    SW_API_DEF(SW_API_SEC_IP4_GET, dess_sec_norm_item_get), \
836    SW_API_DEF(SW_API_SEC_IP6_SET, dess_sec_norm_item_set), \
837    SW_API_DEF(SW_API_SEC_IP6_GET, dess_sec_norm_item_get), \
838    SW_API_DEF(SW_API_SEC_TCP_SET, dess_sec_norm_item_set), \
839    SW_API_DEF(SW_API_SEC_TCP_GET, dess_sec_norm_item_get), \
840    SW_API_DEF(SW_API_SEC_UDP_SET, dess_sec_norm_item_set), \
841    SW_API_DEF(SW_API_SEC_UDP_GET, dess_sec_norm_item_get), \
842    SW_API_DEF(SW_API_SEC_ICMP4_SET, dess_sec_norm_item_set), \
843    SW_API_DEF(SW_API_SEC_ICMP4_GET, dess_sec_norm_item_get), \
844    SW_API_DEF(SW_API_SEC_ICMP6_SET, dess_sec_norm_item_set), \
845    SW_API_DEF(SW_API_SEC_ICMP6_GET, dess_sec_norm_item_get),
846
847#define SEC_API_PARAM \
848    SW_API_DESC(SW_API_SEC_NORM_SET) \
849    SW_API_DESC(SW_API_SEC_NORM_GET) \
850    SW_API_DESC(SW_API_SEC_MAC_SET) \
851    SW_API_DESC(SW_API_SEC_MAC_GET) \
852    SW_API_DESC(SW_API_SEC_IP_SET) \
853    SW_API_DESC(SW_API_SEC_IP_GET) \
854    SW_API_DESC(SW_API_SEC_IP4_SET) \
855    SW_API_DESC(SW_API_SEC_IP4_GET) \
856    SW_API_DESC(SW_API_SEC_IP6_SET) \
857    SW_API_DESC(SW_API_SEC_IP6_GET) \
858    SW_API_DESC(SW_API_SEC_TCP_SET) \
859    SW_API_DESC(SW_API_SEC_TCP_GET) \
860    SW_API_DESC(SW_API_SEC_UDP_SET) \
861    SW_API_DESC(SW_API_SEC_UDP_GET) \
862    SW_API_DESC(SW_API_SEC_ICMP4_SET) \
863    SW_API_DESC(SW_API_SEC_ICMP4_GET) \
864    SW_API_DESC(SW_API_SEC_ICMP6_SET) \
865    SW_API_DESC(SW_API_SEC_ICMP6_GET)
866#else
867#define SEC_API
868#define SEC_API_PARAM
869#endif
870
871#ifdef IN_IP
872#define IP_API \
873    SW_API_DEF(SW_API_IP_HOST_ADD, dess_ip_host_add), \
874    SW_API_DEF(SW_API_IP_HOST_DEL, dess_ip_host_del), \
875    SW_API_DEF(SW_API_IP_HOST_GET, dess_ip_host_get), \
876    SW_API_DEF(SW_API_IP_HOST_NEXT, dess_ip_host_next), \
877    SW_API_DEF(SW_API_IP_HOST_COUNTER_BIND, dess_ip_host_counter_bind), \
878    SW_API_DEF(SW_API_IP_HOST_PPPOE_BIND, dess_ip_host_pppoe_bind), \
879    SW_API_DEF(SW_API_IP_PT_ARP_LEARN_SET, dess_ip_pt_arp_learn_set), \
880    SW_API_DEF(SW_API_IP_PT_ARP_LEARN_GET, dess_ip_pt_arp_learn_get), \
881    SW_API_DEF(SW_API_IP_ARP_LEARN_SET, dess_ip_arp_learn_set), \
882    SW_API_DEF(SW_API_IP_ARP_LEARN_GET, dess_ip_arp_learn_get), \
883    SW_API_DEF(SW_API_IP_SOURCE_GUARD_SET, dess_ip_source_guard_set), \
884    SW_API_DEF(SW_API_IP_SOURCE_GUARD_GET, dess_ip_source_guard_get), \
885    SW_API_DEF(SW_API_IP_ARP_GUARD_SET, dess_ip_arp_guard_set), \
886    SW_API_DEF(SW_API_IP_ARP_GUARD_GET, dess_ip_arp_guard_get), \
887    SW_API_DEF(SW_API_IP_ROUTE_STATUS_SET, dess_ip_route_status_set), \
888    SW_API_DEF(SW_API_IP_ROUTE_STATUS_GET, dess_ip_route_status_get), \
889    SW_API_DEF(SW_API_IP_INTF_ENTRY_ADD, dess_ip_intf_entry_add), \
890    SW_API_DEF(SW_API_IP_INTF_ENTRY_DEL, dess_ip_intf_entry_del), \
891    SW_API_DEF(SW_API_IP_INTF_ENTRY_NEXT, dess_ip_intf_entry_next), \
892    SW_API_DEF(SW_API_IP_UNK_SOURCE_CMD_SET, dess_ip_unk_source_cmd_set),  \
893    SW_API_DEF(SW_API_IP_UNK_SOURCE_CMD_GET, dess_ip_unk_source_cmd_get), \
894    SW_API_DEF(SW_API_ARP_UNK_SOURCE_CMD_SET, dess_arp_unk_source_cmd_set), \
895    SW_API_DEF(SW_API_ARP_UNK_SOURCE_CMD_GET, dess_arp_unk_source_cmd_get), \
896    SW_API_DEF(SW_API_IP_AGE_TIME_SET, dess_ip_age_time_set), \
897    SW_API_DEF(SW_API_IP_AGE_TIME_GET, dess_ip_age_time_get), \
898    SW_API_DEF(SW_API_WCMP_HASH_MODE_SET, dess_ip_wcmp_hash_mode_set), \
899    SW_API_DEF(SW_API_WCMP_HASH_MODE_GET, dess_ip_wcmp_hash_mode_get), \
900    SW_API_DEF(SW_API_IP_DEFAULT_FLOW_CMD_SET, dess_default_flow_cmd_set), \
901    SW_API_DEF(SW_API_IP_DEFAULT_FLOW_CMD_GET, dess_default_flow_cmd_get), \
902    SW_API_DEF(SW_API_IP_DEFAULT_RT_FLOW_CMD_SET, dess_default_rt_flow_cmd_set), \
903    SW_API_DEF(SW_API_IP_DEFAULT_RT_FLOW_CMD_GET, dess_default_rt_flow_cmd_get),
904
905#define IP_API_PARAM \
906    SW_API_DESC(SW_API_IP_HOST_ADD) \
907    SW_API_DESC(SW_API_IP_HOST_DEL) \
908    SW_API_DESC(SW_API_IP_HOST_GET) \
909    SW_API_DESC(SW_API_IP_HOST_NEXT) \
910    SW_API_DESC(SW_API_IP_HOST_COUNTER_BIND) \
911    SW_API_DESC(SW_API_IP_HOST_PPPOE_BIND) \
912    SW_API_DESC(SW_API_IP_PT_ARP_LEARN_SET) \
913    SW_API_DESC(SW_API_IP_PT_ARP_LEARN_GET) \
914    SW_API_DESC(SW_API_IP_ARP_LEARN_SET) \
915    SW_API_DESC(SW_API_IP_ARP_LEARN_GET) \
916    SW_API_DESC(SW_API_IP_SOURCE_GUARD_SET) \
917    SW_API_DESC(SW_API_IP_SOURCE_GUARD_GET) \
918    SW_API_DESC(SW_API_IP_ARP_GUARD_SET) \
919    SW_API_DESC(SW_API_IP_ARP_GUARD_GET) \
920    SW_API_DESC(SW_API_IP_ROUTE_STATUS_SET) \
921    SW_API_DESC(SW_API_IP_ROUTE_STATUS_GET) \
922    SW_API_DESC(SW_API_IP_INTF_ENTRY_ADD)  \
923    SW_API_DESC(SW_API_IP_INTF_ENTRY_DEL)  \
924    SW_API_DESC(SW_API_IP_INTF_ENTRY_NEXT) \
925    SW_API_DESC(SW_API_IP_UNK_SOURCE_CMD_SET)  \
926    SW_API_DESC(SW_API_IP_UNK_SOURCE_CMD_GET)  \
927    SW_API_DESC(SW_API_ARP_UNK_SOURCE_CMD_SET) \
928    SW_API_DESC(SW_API_ARP_UNK_SOURCE_CMD_GET) \
929    SW_API_DESC(SW_API_IP_AGE_TIME_SET) \
930    SW_API_DESC(SW_API_IP_AGE_TIME_GET) \
931    SW_API_DESC(SW_API_WCMP_HASH_MODE_SET) \
932    SW_API_DESC(SW_API_WCMP_HASH_MODE_GET) \
933    SW_API_DESC(SW_API_IP_DEFAULT_FLOW_CMD_SET) \
934    SW_API_DESC(SW_API_IP_DEFAULT_FLOW_CMD_GET) \
935    SW_API_DESC(SW_API_IP_DEFAULT_RT_FLOW_CMD_SET) \
936    SW_API_DESC(SW_API_IP_DEFAULT_RT_FLOW_CMD_GET)
937
938#else
939#define IP_API
940#define IP_API_PARAM
941#endif
942
943#ifdef IN_NAT
944#define NAT_API \
945    SW_API_DEF(SW_API_NAT_ADD, dess_nat_add), \
946    SW_API_DEF(SW_API_NAT_DEL, dess_nat_del), \
947    SW_API_DEF(SW_API_NAT_GET, dess_nat_get), \
948    SW_API_DEF(SW_API_NAT_NEXT, dess_nat_next), \
949    SW_API_DEF(SW_API_NAT_COUNTER_BIND, dess_nat_counter_bind), \
950    SW_API_DEF(SW_API_NAPT_ADD, dess_napt_add), \
951    SW_API_DEF(SW_API_NAPT_DEL, dess_napt_del), \
952    SW_API_DEF(SW_API_NAPT_GET, dess_napt_get), \
953    SW_API_DEF(SW_API_NAPT_NEXT, dess_napt_next), \
954    SW_API_DEF(SW_API_NAPT_COUNTER_BIND, dess_napt_counter_bind), \
955    SW_API_DEF(SW_API_FLOW_ADD, dess_flow_add), \
956    SW_API_DEF(SW_API_FLOW_DEL, dess_flow_del), \
957    SW_API_DEF(SW_API_FLOW_GET, dess_flow_get), \
958    SW_API_DEF(SW_API_FLOW_NEXT, dess_flow_next), \
959    SW_API_DEF(SW_API_FLOW_COUNTER_BIND, dess_flow_counter_bind), \
960    SW_API_DEF(SW_API_NAT_STATUS_SET, dess_nat_status_set), \
961    SW_API_DEF(SW_API_NAT_STATUS_GET, dess_nat_status_get), \
962    SW_API_DEF(SW_API_NAT_HASH_MODE_SET, dess_nat_hash_mode_set), \
963    SW_API_DEF(SW_API_NAT_HASH_MODE_GET, dess_nat_hash_mode_get), \
964    SW_API_DEF(SW_API_NAPT_STATUS_SET, dess_napt_status_set), \
965    SW_API_DEF(SW_API_NAPT_STATUS_GET, dess_napt_status_get), \
966    SW_API_DEF(SW_API_NAPT_MODE_SET, dess_napt_mode_set), \
967    SW_API_DEF(SW_API_NAPT_MODE_GET, dess_napt_mode_get), \
968    SW_API_DEF(SW_API_PRV_BASE_ADDR_SET, dess_nat_prv_base_addr_set), \
969    SW_API_DEF(SW_API_PRV_BASE_ADDR_GET, dess_nat_prv_base_addr_get), \
970    SW_API_DEF(SW_API_PUB_ADDR_ENTRY_ADD, dess_nat_pub_addr_add), \
971    SW_API_DEF(SW_API_PUB_ADDR_ENTRY_DEL, dess_nat_pub_addr_del), \
972    SW_API_DEF(SW_API_PUB_ADDR_ENTRY_NEXT, dess_nat_pub_addr_next), \
973    SW_API_DEF(SW_API_NAT_UNK_SESSION_CMD_SET, dess_nat_unk_session_cmd_set), \
974    SW_API_DEF(SW_API_NAT_UNK_SESSION_CMD_GET, dess_nat_unk_session_cmd_get), \
975    SW_API_DEF(SW_API_PRV_BASE_MASK_SET, dess_nat_prv_base_mask_set), \
976    SW_API_DEF(SW_API_PRV_BASE_MASK_GET, dess_nat_prv_base_mask_get), \
977    SW_API_DEF(SW_API_NAT_GLOBAL_SET, dess_nat_global_set),
978
979#define NAT_API_PARAM \
980    SW_API_DESC(SW_API_NAT_ADD) \
981    SW_API_DESC(SW_API_NAT_DEL) \
982    SW_API_DESC(SW_API_NAT_GET) \
983    SW_API_DESC(SW_API_NAT_NEXT) \
984    SW_API_DESC(SW_API_NAT_COUNTER_BIND) \
985    SW_API_DESC(SW_API_NAPT_ADD) \
986    SW_API_DESC(SW_API_NAPT_DEL) \
987    SW_API_DESC(SW_API_NAPT_GET) \
988    SW_API_DESC(SW_API_NAPT_NEXT) \
989    SW_API_DESC(SW_API_NAPT_COUNTER_BIND) \
990    SW_API_DESC(SW_API_FLOW_ADD) \
991    SW_API_DESC(SW_API_FLOW_DEL) \
992    SW_API_DESC(SW_API_FLOW_GET) \
993    SW_API_DESC(SW_API_FLOW_NEXT) \
994    SW_API_DESC(SW_API_FLOW_COUNTER_BIND) \
995    SW_API_DESC(SW_API_NAT_STATUS_SET) \
996    SW_API_DESC(SW_API_NAT_STATUS_GET) \
997    SW_API_DESC(SW_API_NAT_HASH_MODE_SET) \
998    SW_API_DESC(SW_API_NAT_HASH_MODE_GET) \
999    SW_API_DESC(SW_API_NAPT_STATUS_SET) \
1000    SW_API_DESC(SW_API_NAPT_STATUS_GET) \
1001    SW_API_DESC(SW_API_NAPT_MODE_SET) \
1002    SW_API_DESC(SW_API_NAPT_MODE_GET) \
1003    SW_API_DESC(SW_API_PRV_BASE_ADDR_SET) \
1004    SW_API_DESC(SW_API_PRV_BASE_ADDR_GET) \
1005    SW_API_DESC(SW_API_PUB_ADDR_ENTRY_ADD) \
1006    SW_API_DESC(SW_API_PUB_ADDR_ENTRY_DEL) \
1007    SW_API_DESC(SW_API_PUB_ADDR_ENTRY_NEXT) \
1008    SW_API_DESC(SW_API_NAT_UNK_SESSION_CMD_SET) \
1009    SW_API_DESC(SW_API_NAT_UNK_SESSION_CMD_GET) \
1010    SW_API_DESC(SW_API_PRV_BASE_MASK_SET) \
1011    SW_API_DESC(SW_API_PRV_BASE_MASK_GET) \
1012    SW_API_DESC(SW_API_NAT_GLOBAL_SET)
1013#else
1014#define NAT_API
1015#define NAT_API_PARAM
1016#endif
1017
1018#ifdef IN_TRUNK
1019#define TRUNK_API \
1020    SW_API_DEF(SW_API_TRUNK_GROUP_SET, dess_trunk_group_set), \
1021    SW_API_DEF(SW_API_TRUNK_GROUP_GET, dess_trunk_group_get), \
1022    SW_API_DEF(SW_API_TRUNK_HASH_SET, dess_trunk_hash_mode_set), \
1023    SW_API_DEF(SW_API_TRUNK_HASH_GET, dess_trunk_hash_mode_get), \
1024    SW_API_DEF(SW_API_TRUNK_MAN_SA_SET, dess_trunk_manipulate_sa_set), \
1025    SW_API_DEF(SW_API_TRUNK_MAN_SA_GET, dess_trunk_manipulate_sa_get),
1026
1027#define TRUNK_API_PARAM \
1028    SW_API_DESC(SW_API_TRUNK_GROUP_SET) \
1029    SW_API_DESC(SW_API_TRUNK_GROUP_GET) \
1030    SW_API_DESC(SW_API_TRUNK_HASH_SET)  \
1031    SW_API_DESC(SW_API_TRUNK_HASH_GET)  \
1032    SW_API_DESC(SW_API_TRUNK_MAN_SA_SET)\
1033    SW_API_DESC(SW_API_TRUNK_MAN_SA_GET)
1034#else
1035#define TRUNK_API
1036#define TRUNK_API_PARAM
1037#endif
1038
1039#ifdef IN_INTERFACECONTROL
1040#define INTERFACECTRL_API \
1041    SW_API_DEF(SW_API_MAC_MODE_SET, dess_interface_mac_mode_set), \
1042    SW_API_DEF(SW_API_MAC_MODE_GET, dess_interface_mac_mode_get), \
1043    SW_API_DEF(SW_API_PORT_3AZ_STATUS_SET, dess_port_3az_status_set), \
1044    SW_API_DEF(SW_API_PORT_3AZ_STATUS_GET, dess_port_3az_status_get), \
1045    SW_API_DEF(SW_API_PHY_MODE_SET, dess_interface_phy_mode_set), \
1046    SW_API_DEF(SW_API_PHY_MODE_GET, dess_interface_phy_mode_get), \
1047    SW_API_DEF(SW_API_FX100_CTRL_SET, dess_interface_fx100_ctrl_set), \
1048    SW_API_DEF(SW_API_FX100_CTRL_GET, dess_interface_fx100_ctrl_get), \
1049    SW_API_DEF(SW_API_FX100_STATUS_GET, dess_interface_fx100_status_get), \
1050    SW_API_DEF(SW_API_MAC06_EXCH_SET, dess_interface_mac06_exch_set), \
1051    SW_API_DEF(SW_API_MAC06_EXCH_GET, dess_interface_mac06_exch_get),
1052
1053#define INTERFACECTRL_API_PARAM \
1054    SW_API_DESC(SW_API_MAC_MODE_SET)  \
1055    SW_API_DESC(SW_API_MAC_MODE_GET)  \
1056    SW_API_DESC(SW_API_PORT_3AZ_STATUS_SET)  \
1057    SW_API_DESC(SW_API_PORT_3AZ_STATUS_GET)  \
1058    SW_API_DESC(SW_API_PHY_MODE_SET)  \
1059    SW_API_DESC(SW_API_PHY_MODE_GET)  \
1060    SW_API_DESC(SW_API_FX100_CTRL_SET)  \
1061    SW_API_DESC(SW_API_FX100_CTRL_GET)  \
1062    SW_API_DESC(SW_API_FX100_STATUS_GET) \
1063    SW_API_DESC(SW_API_MAC06_EXCH_SET) \
1064    SW_API_DESC(SW_API_MAC06_EXCH_GET)
1065
1066#else
1067#define INTERFACECTRL_API
1068#define INTERFACECTRL_API_PARAM
1069#endif
1070
1071#define REG_API \
1072    SW_API_DEF(SW_API_PHY_GET, dess_phy_get), \
1073    SW_API_DEF(SW_API_PHY_SET, dess_phy_set), \
1074    SW_API_DEF(SW_API_REG_GET, dess_reg_get), \
1075    SW_API_DEF(SW_API_PSGMII_REG_SET, dess_psgmii_reg_set), \
1076    SW_API_DEF(SW_API_PSGMII_REG_GET, dess_psgmii_reg_get), \
1077    SW_API_DEF(SW_API_REG_SET, dess_reg_set), \
1078    SW_API_DEF(SW_API_REG_FIELD_GET, dess_reg_field_get), \
1079    SW_API_DEF(SW_API_REG_FIELD_SET, dess_reg_field_set), \
1080    SW_API_DEF(SW_API_REG_DUMP, dess_regsiter_dump), \
1081    SW_API_DEF(SW_API_DBG_REG_DUMP, dess_debug_regsiter_dump),
1082
1083
1084#define REG_API_PARAM \
1085    SW_API_DESC(SW_API_PHY_GET) \
1086    SW_API_DESC(SW_API_PHY_SET) \
1087    SW_API_DESC(SW_API_REG_GET) \
1088    SW_API_DESC(SW_API_REG_SET) \
1089    SW_API_DESC(SW_API_PSGMII_REG_GET) \
1090    SW_API_DESC(SW_API_PSGMII_REG_SET) \
1091    SW_API_DESC(SW_API_REG_FIELD_GET) \
1092    SW_API_DESC(SW_API_REG_FIELD_SET) \
1093    SW_API_DESC(SW_API_REG_DUMP)  \
1094    SW_API_DESC(SW_API_DBG_REG_DUMP)
1095
1096
1097#define SSDK_API \
1098    SW_API_DEF(SW_API_SWITCH_RESET, dess_reset), \
1099    SW_API_DEF(SW_API_SSDK_CFG, hsl_ssdk_cfg), \
1100    PORTCONTROL_API \
1101    VLAN_API \
1102    PORTVLAN_API \
1103    FDB_API    \
1104    ACL_API    \
1105    QOS_API    \
1106    IGMP_API   \
1107    LEAKY_API  \
1108    MIRROR_API \
1109    RATE_API \
1110    STP_API  \
1111    MIB_API  \
1112    MISC_API \
1113    LED_API  \
1114    COSMAP_API \
1115    SEC_API  \
1116    IP_API \
1117    NAT_API \
1118    TRUNK_API \
1119    INTERFACECTRL_API \
1120    REG_API  \
1121    SW_API_DEF(SW_API_MAX, NULL),
1122
1123
1124#define SSDK_PARAM  \
1125    SW_PARAM_DEF(SW_API_SWITCH_RESET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \
1126    SW_PARAM_DEF(SW_API_SSDK_CFG, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \
1127    SW_PARAM_DEF(SW_API_SSDK_CFG, SW_SSDK_CFG, sizeof(ssdk_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, "ssdk configuration"), \
1128    MIB_API_PARAM    \
1129    LEAKY_API_PARAM  \
1130    MISC_API_PARAM   \
1131    IGMP_API_PARAM   \
1132    MIRROR_API_PARAM \
1133    PORTCONTROL_API_PARAM \
1134    PORTVLAN_API_PARAM    \
1135    VLAN_API_PARAM \
1136    FDB_API_PARAM  \
1137    QOS_API_PARAM  \
1138    RATE_API_PARAM \
1139    STP_API_PARAM  \
1140    ACL_API_PARAM  \
1141    LED_API_PARAM  \
1142    COSMAP_API_PARAM \
1143    SEC_API_PARAM  \
1144    IP_API_PARAM \
1145    NAT_API_PARAM \
1146    TRUNK_API_PARAM \
1147    INTERFACECTRL_API_PARAM \
1148    REG_API_PARAM  \
1149    SW_PARAM_DEF(SW_API_MAX, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),
1150
1151#if (defined(USER_MODE) && defined(KERNEL_MODULE))
1152#undef SSDK_API
1153#undef SSDK_PARAM
1154
1155#define SSDK_API \
1156    REG_API \
1157    SW_API_DEF(SW_API_MAX, NULL),
1158
1159#define SSDK_PARAM  \
1160    REG_API_PARAM \
1161    SW_PARAM_DEF(SW_API_MAX, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),
1162#endif
1163
1164#ifdef __cplusplus
1165}
1166#endif                          /* __cplusplus */
1167
1168#endif                          /* _DESS_API_H_ */
1169_ */
1170