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_RATE_H_ 17#define _ISISC_RATE_H_ 18 19#ifdef __cplusplus 20extern "C" { 21#endif /* __cplusplus */ 22 23#include "fal/fal_rate.h" 24 25 sw_error_t isisc_rate_init(a_uint32_t dev_id); 26 27#ifdef IN_RATE 28#define ISISC_RATE_INIT(rv, dev_id) \ 29 { \ 30 rv = isisc_rate_init(dev_id); \ 31 SW_RTN_ON_ERROR(rv); \ 32 } 33#else 34#define ISISC_RATE_INIT(rv, dev_id) 35#endif 36 37#ifdef HSL_STANDALONG 38 39 HSL_LOCAL sw_error_t 40 isisc_rate_port_policer_set(a_uint32_t dev_id, fal_port_t port_id, 41 fal_port_policer_t * policer); 42 43 HSL_LOCAL sw_error_t 44 isisc_rate_port_policer_get(a_uint32_t dev_id, fal_port_t port_id, 45 fal_port_policer_t * policer); 46 47 HSL_LOCAL sw_error_t 48 isisc_rate_port_shaper_set(a_uint32_t dev_id, fal_port_t port_id, 49 a_bool_t enable, 50 fal_egress_shaper_t * shaper); 51 52 HSL_LOCAL sw_error_t 53 isisc_rate_port_shaper_get(a_uint32_t dev_id, fal_port_t port_id, 54 a_bool_t * enable, 55 fal_egress_shaper_t * shaper); 56 57 HSL_LOCAL sw_error_t 58 isisc_rate_queue_shaper_set(a_uint32_t dev_id, fal_port_t port_id, 59 fal_queue_t queue_id, a_bool_t enable, 60 fal_egress_shaper_t * shaper); 61 62 HSL_LOCAL sw_error_t 63 isisc_rate_queue_shaper_get(a_uint32_t dev_id, fal_port_t port_id, 64 fal_queue_t queue_id, a_bool_t * enable, 65 fal_egress_shaper_t * shaper); 66 67 HSL_LOCAL sw_error_t 68 isisc_rate_acl_policer_set(a_uint32_t dev_id, a_uint32_t policer_id, 69 fal_acl_policer_t * policer); 70 71 HSL_LOCAL sw_error_t 72 isisc_rate_acl_policer_get(a_uint32_t dev_id, a_uint32_t policer_id, 73 fal_acl_policer_t * policer); 74 75 HSL_LOCAL sw_error_t 76 isisc_rate_port_add_rate_byte_set(a_uint32_t dev_id, fal_port_t port_id, 77 a_uint32_t number); 78 79 HSL_LOCAL sw_error_t 80 isisc_rate_port_add_rate_byte_get(a_uint32_t dev_id, fal_port_t port_id, 81 a_uint32_t *number); 82 83 HSL_LOCAL sw_error_t 84 isisc_rate_port_gol_flow_en_set(a_uint32_t dev_id, fal_port_t port_id, 85 a_bool_t enable); 86 87 HSL_LOCAL sw_error_t 88 isisc_rate_port_gol_flow_en_get(a_uint32_t dev_id, fal_port_t port_id, 89 a_bool_t* enable); 90#endif 91 92#ifdef __cplusplus 93} 94#endif /* __cplusplus */ 95#endif /* _ISISC_RATE_H_ */ 96 97