1 /* 2 * Copyright (C) 2013 Realtek Semiconductor Corp. 3 * All Rights Reserved. 4 * 5 * This program is the proprietary software of Realtek Semiconductor 6 * Corporation and/or its licensors, and only be used, duplicated, 7 * modified or distributed under the authorized license from Realtek. 8 * 9 * ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER 10 * THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. 11 * 12 * Purpose : RTL8367/RTL8367C switch high-level API 13 * 14 * Feature : The file includes Leaky module high-layer API defination 15 * 16 */ 17 18#ifndef __RTK_API_LEAKY_H__ 19#define __RTK_API_LEAKY_H__ 20 21 22typedef enum rtk_leaky_type_e 23{ 24 LEAKY_BRG_GROUP = 0, 25 LEAKY_FD_PAUSE, 26 LEAKY_SP_MCAST, 27 LEAKY_1X_PAE, 28 LEAKY_UNDEF_BRG_04, 29 LEAKY_UNDEF_BRG_05, 30 LEAKY_UNDEF_BRG_06, 31 LEAKY_UNDEF_BRG_07, 32 LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS, 33 LEAKY_UNDEF_BRG_09, 34 LEAKY_UNDEF_BRG_0A, 35 LEAKY_UNDEF_BRG_0B, 36 LEAKY_UNDEF_BRG_0C, 37 LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS, 38 LEAKY_8021AB, 39 LEAKY_UNDEF_BRG_0F, 40 LEAKY_BRG_MNGEMENT, 41 LEAKY_UNDEFINED_11, 42 LEAKY_UNDEFINED_12, 43 LEAKY_UNDEFINED_13, 44 LEAKY_UNDEFINED_14, 45 LEAKY_UNDEFINED_15, 46 LEAKY_UNDEFINED_16, 47 LEAKY_UNDEFINED_17, 48 LEAKY_UNDEFINED_18, 49 LEAKY_UNDEFINED_19, 50 LEAKY_UNDEFINED_1A, 51 LEAKY_UNDEFINED_1B, 52 LEAKY_UNDEFINED_1C, 53 LEAKY_UNDEFINED_1D, 54 LEAKY_UNDEFINED_1E, 55 LEAKY_UNDEFINED_1F, 56 LEAKY_GMRP, 57 LEAKY_GVRP, 58 LEAKY_UNDEF_GARP_22, 59 LEAKY_UNDEF_GARP_23, 60 LEAKY_UNDEF_GARP_24, 61 LEAKY_UNDEF_GARP_25, 62 LEAKY_UNDEF_GARP_26, 63 LEAKY_UNDEF_GARP_27, 64 LEAKY_UNDEF_GARP_28, 65 LEAKY_UNDEF_GARP_29, 66 LEAKY_UNDEF_GARP_2A, 67 LEAKY_UNDEF_GARP_2B, 68 LEAKY_UNDEF_GARP_2C, 69 LEAKY_UNDEF_GARP_2D, 70 LEAKY_UNDEF_GARP_2E, 71 LEAKY_UNDEF_GARP_2F, 72 LEAKY_IGMP, 73 LEAKY_IPMULTICAST, 74 LEAKY_CDP, 75 LEAKY_CSSTP, 76 LEAKY_LLDP, 77 LEAKY_END, 78}rtk_leaky_type_t; 79 80/* Function Name: 81 * rtk_leaky_vlan_set 82 * Description: 83 * Set VLAN leaky. 84 * Input: 85 * type - Packet type for VLAN leaky. 86 * enable - Leaky status. 87 * Output: 88 * None 89 * Return: 90 * RT_ERR_OK - OK 91 * RT_ERR_FAILED - Failed 92 * RT_ERR_SMI - SMI access error 93 * RT_ERR_INPUT - Invalid input parameters. 94 * RT_ERR_ENABLE - Invalid enable input 95 * Note: 96 * This API can set VLAN leaky for RMA ,IGMP/MLD, CDP, CSSTP, and LLDP packets. 97 * The leaky frame types are as following: 98 * - LEAKY_BRG_GROUP, 99 * - LEAKY_FD_PAUSE, 100 * - LEAKY_SP_MCAST, 101 * - LEAKY_1X_PAE, 102 * - LEAKY_UNDEF_BRG_04, 103 * - LEAKY_UNDEF_BRG_05, 104 * - LEAKY_UNDEF_BRG_06, 105 * - LEAKY_UNDEF_BRG_07, 106 * - LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS, 107 * - LEAKY_UNDEF_BRG_09, 108 * - LEAKY_UNDEF_BRG_0A, 109 * - LEAKY_UNDEF_BRG_0B, 110 * - LEAKY_UNDEF_BRG_0C, 111 * - LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS, 112 * - LEAKY_8021AB, 113 * - LEAKY_UNDEF_BRG_0F, 114 * - LEAKY_BRG_MNGEMENT, 115 * - LEAKY_UNDEFINED_11, 116 * - LEAKY_UNDEFINED_12, 117 * - LEAKY_UNDEFINED_13, 118 * - LEAKY_UNDEFINED_14, 119 * - LEAKY_UNDEFINED_15, 120 * - LEAKY_UNDEFINED_16, 121 * - LEAKY_UNDEFINED_17, 122 * - LEAKY_UNDEFINED_18, 123 * - LEAKY_UNDEFINED_19, 124 * - LEAKY_UNDEFINED_1A, 125 * - LEAKY_UNDEFINED_1B, 126 * - LEAKY_UNDEFINED_1C, 127 * - LEAKY_UNDEFINED_1D, 128 * - LEAKY_UNDEFINED_1E, 129 * - LEAKY_UNDEFINED_1F, 130 * - LEAKY_GMRP, 131 * - LEAKY_GVRP, 132 * - LEAKY_UNDEF_GARP_22, 133 * - LEAKY_UNDEF_GARP_23, 134 * - LEAKY_UNDEF_GARP_24, 135 * - LEAKY_UNDEF_GARP_25, 136 * - LEAKY_UNDEF_GARP_26, 137 * - LEAKY_UNDEF_GARP_27, 138 * - LEAKY_UNDEF_GARP_28, 139 * - LEAKY_UNDEF_GARP_29, 140 * - LEAKY_UNDEF_GARP_2A, 141 * - LEAKY_UNDEF_GARP_2B, 142 * - LEAKY_UNDEF_GARP_2C, 143 * - LEAKY_UNDEF_GARP_2D, 144 * - LEAKY_UNDEF_GARP_2E, 145 * - LEAKY_UNDEF_GARP_2F, 146 * - LEAKY_IGMP, 147 * - LEAKY_IPMULTICAST. 148 * - LEAKY_CDP, 149 * - LEAKY_CSSTP, 150 * - LEAKY_LLDP. 151 */ 152extern rtk_api_ret_t rtk_leaky_vlan_set(rtk_leaky_type_t type, rtk_enable_t enable); 153 154/* Function Name: 155 * rtk_leaky_vlan_get 156 * Description: 157 * Get VLAN leaky. 158 * Input: 159 * type - Packet type for VLAN leaky. 160 * Output: 161 * pEnable - Leaky status. 162 * Return: 163 * RT_ERR_OK - OK 164 * RT_ERR_FAILED - Failed 165 * RT_ERR_SMI - SMI access error 166 * RT_ERR_INPUT - Invalid input parameters. 167 * Note: 168 * This API can get VLAN leaky status for RMA ,IGMP/MLD, CDP, CSSTP, and LLDP packets. 169 * The leaky frame types are as following: 170 * - LEAKY_BRG_GROUP, 171 * - LEAKY_FD_PAUSE, 172 * - LEAKY_SP_MCAST, 173 * - LEAKY_1X_PAE, 174 * - LEAKY_UNDEF_BRG_04, 175 * - LEAKY_UNDEF_BRG_05, 176 * - LEAKY_UNDEF_BRG_06, 177 * - LEAKY_UNDEF_BRG_07, 178 * - LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS, 179 * - LEAKY_UNDEF_BRG_09, 180 * - LEAKY_UNDEF_BRG_0A, 181 * - LEAKY_UNDEF_BRG_0B, 182 * - LEAKY_UNDEF_BRG_0C, 183 * - LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS, 184 * - LEAKY_8021AB, 185 * - LEAKY_UNDEF_BRG_0F, 186 * - LEAKY_BRG_MNGEMENT, 187 * - LEAKY_UNDEFINED_11, 188 * - LEAKY_UNDEFINED_12, 189 * - LEAKY_UNDEFINED_13, 190 * - LEAKY_UNDEFINED_14, 191 * - LEAKY_UNDEFINED_15, 192 * - LEAKY_UNDEFINED_16, 193 * - LEAKY_UNDEFINED_17, 194 * - LEAKY_UNDEFINED_18, 195 * - LEAKY_UNDEFINED_19, 196 * - LEAKY_UNDEFINED_1A, 197 * - LEAKY_UNDEFINED_1B, 198 * - LEAKY_UNDEFINED_1C, 199 * - LEAKY_UNDEFINED_1D, 200 * - LEAKY_UNDEFINED_1E, 201 * - LEAKY_UNDEFINED_1F, 202 * - LEAKY_GMRP, 203 * - LEAKY_GVRP, 204 * - LEAKY_UNDEF_GARP_22, 205 * - LEAKY_UNDEF_GARP_23, 206 * - LEAKY_UNDEF_GARP_24, 207 * - LEAKY_UNDEF_GARP_25, 208 * - LEAKY_UNDEF_GARP_26, 209 * - LEAKY_UNDEF_GARP_27, 210 * - LEAKY_UNDEF_GARP_28, 211 * - LEAKY_UNDEF_GARP_29, 212 * - LEAKY_UNDEF_GARP_2A, 213 * - LEAKY_UNDEF_GARP_2B, 214 * - LEAKY_UNDEF_GARP_2C, 215 * - LEAKY_UNDEF_GARP_2D, 216 * - LEAKY_UNDEF_GARP_2E, 217 * - LEAKY_UNDEF_GARP_2F, 218 * - LEAKY_IGMP, 219 * - LEAKY_IPMULTICAST. 220 * - LEAKY_CDP, 221 * - LEAKY_CSSTP, 222 * - LEAKY_LLDP. 223 */ 224extern rtk_api_ret_t rtk_leaky_vlan_get(rtk_leaky_type_t type, rtk_enable_t *pEnable); 225 226/* Function Name: 227 * rtk_leaky_portIsolation_set 228 * Description: 229 * Set port isolation leaky. 230 * Input: 231 * type - Packet type for port isolation leaky. 232 * enable - Leaky status. 233 * Output: 234 * None 235 * Return: 236 * RT_ERR_OK - OK 237 * RT_ERR_FAILED - Failed 238 * RT_ERR_SMI - SMI access error 239 * RT_ERR_INPUT - Invalid input parameters. 240 * RT_ERR_ENABLE - Invalid enable input 241 * Note: 242 * This API can set port isolation leaky for RMA ,IGMP/MLD, CDP, CSSTP, and LLDP packets. 243 * The leaky frame types are as following: 244 * - LEAKY_BRG_GROUP, 245 * - LEAKY_FD_PAUSE, 246 * - LEAKY_SP_MCAST, 247 * - LEAKY_1X_PAE, 248 * - LEAKY_UNDEF_BRG_04, 249 * - LEAKY_UNDEF_BRG_05, 250 * - LEAKY_UNDEF_BRG_06, 251 * - LEAKY_UNDEF_BRG_07, 252 * - LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS, 253 * - LEAKY_UNDEF_BRG_09, 254 * - LEAKY_UNDEF_BRG_0A, 255 * - LEAKY_UNDEF_BRG_0B, 256 * - LEAKY_UNDEF_BRG_0C, 257 * - LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS, 258 * - LEAKY_8021AB, 259 * - LEAKY_UNDEF_BRG_0F, 260 * - LEAKY_BRG_MNGEMENT, 261 * - LEAKY_UNDEFINED_11, 262 * - LEAKY_UNDEFINED_12, 263 * - LEAKY_UNDEFINED_13, 264 * - LEAKY_UNDEFINED_14, 265 * - LEAKY_UNDEFINED_15, 266 * - LEAKY_UNDEFINED_16, 267 * - LEAKY_UNDEFINED_17, 268 * - LEAKY_UNDEFINED_18, 269 * - LEAKY_UNDEFINED_19, 270 * - LEAKY_UNDEFINED_1A, 271 * - LEAKY_UNDEFINED_1B, 272 * - LEAKY_UNDEFINED_1C, 273 * - LEAKY_UNDEFINED_1D, 274 * - LEAKY_UNDEFINED_1E, 275 * - LEAKY_UNDEFINED_1F, 276 * - LEAKY_GMRP, 277 * - LEAKY_GVRP, 278 * - LEAKY_UNDEF_GARP_22, 279 * - LEAKY_UNDEF_GARP_23, 280 * - LEAKY_UNDEF_GARP_24, 281 * - LEAKY_UNDEF_GARP_25, 282 * - LEAKY_UNDEF_GARP_26, 283 * - LEAKY_UNDEF_GARP_27, 284 * - LEAKY_UNDEF_GARP_28, 285 * - LEAKY_UNDEF_GARP_29, 286 * - LEAKY_UNDEF_GARP_2A, 287 * - LEAKY_UNDEF_GARP_2B, 288 * - LEAKY_UNDEF_GARP_2C, 289 * - LEAKY_UNDEF_GARP_2D, 290 * - LEAKY_UNDEF_GARP_2E, 291 * - LEAKY_UNDEF_GARP_2F, 292 * - LEAKY_IGMP, 293 * - LEAKY_IPMULTICAST. 294 * - LEAKY_CDP, 295 * - LEAKY_CSSTP, 296 * - LEAKY_LLDP. 297 */ 298extern rtk_api_ret_t rtk_leaky_portIsolation_set(rtk_leaky_type_t type, rtk_enable_t enable); 299 300/* Function Name: 301 * rtk_leaky_portIsolation_get 302 * Description: 303 * Get port isolation leaky. 304 * Input: 305 * type - Packet type for port isolation leaky. 306 * Output: 307 * pEnable - Leaky status. 308 * Return: 309 * RT_ERR_OK - OK 310 * RT_ERR_FAILED - Failed 311 * RT_ERR_SMI - SMI access error 312 * RT_ERR_INPUT - Invalid input parameters. 313 * Note: 314 * This API can get port isolation leaky status for RMA ,IGMP/MLD, CDP, CSSTP, and LLDP packets. 315 * The leaky frame types are as following: 316 * - LEAKY_BRG_GROUP, 317 * - LEAKY_FD_PAUSE, 318 * - LEAKY_SP_MCAST, 319 * - LEAKY_1X_PAE, 320 * - LEAKY_UNDEF_BRG_04, 321 * - LEAKY_UNDEF_BRG_05, 322 * - LEAKY_UNDEF_BRG_06, 323 * - LEAKY_UNDEF_BRG_07, 324 * - LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS, 325 * - LEAKY_UNDEF_BRG_09, 326 * - LEAKY_UNDEF_BRG_0A, 327 * - LEAKY_UNDEF_BRG_0B, 328 * - LEAKY_UNDEF_BRG_0C, 329 * - LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS, 330 * - LEAKY_8021AB, 331 * - LEAKY_UNDEF_BRG_0F, 332 * - LEAKY_BRG_MNGEMENT, 333 * - LEAKY_UNDEFINED_11, 334 * - LEAKY_UNDEFINED_12, 335 * - LEAKY_UNDEFINED_13, 336 * - LEAKY_UNDEFINED_14, 337 * - LEAKY_UNDEFINED_15, 338 * - LEAKY_UNDEFINED_16, 339 * - LEAKY_UNDEFINED_17, 340 * - LEAKY_UNDEFINED_18, 341 * - LEAKY_UNDEFINED_19, 342 * - LEAKY_UNDEFINED_1A, 343 * - LEAKY_UNDEFINED_1B, 344 * - LEAKY_UNDEFINED_1C, 345 * - LEAKY_UNDEFINED_1D, 346 * - LEAKY_UNDEFINED_1E, 347 * - LEAKY_UNDEFINED_1F, 348 * - LEAKY_GMRP, 349 * - LEAKY_GVRP, 350 * - LEAKY_UNDEF_GARP_22, 351 * - LEAKY_UNDEF_GARP_23, 352 * - LEAKY_UNDEF_GARP_24, 353 * - LEAKY_UNDEF_GARP_25, 354 * - LEAKY_UNDEF_GARP_26, 355 * - LEAKY_UNDEF_GARP_27, 356 * - LEAKY_UNDEF_GARP_28, 357 * - LEAKY_UNDEF_GARP_29, 358 * - LEAKY_UNDEF_GARP_2A, 359 * - LEAKY_UNDEF_GARP_2B, 360 * - LEAKY_UNDEF_GARP_2C, 361 * - LEAKY_UNDEF_GARP_2D, 362 * - LEAKY_UNDEF_GARP_2E, 363 * - LEAKY_UNDEF_GARP_2F, 364 * - LEAKY_IGMP, 365 * - LEAKY_IPMULTICAST. 366 * - LEAKY_CDP, 367 * - LEAKY_CSSTP, 368 * - LEAKY_LLDP. 369 */ 370extern rtk_api_ret_t rtk_leaky_portIsolation_get(rtk_leaky_type_t type, rtk_enable_t *pEnable); 371 372#endif /* __RTK_API_LEAKY_H__ */ 373 374