Shad Ansari | 2f7f9be | 2017-06-07 13:34:53 -0700 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * <:copyright-BRCM:2016:DUAL/GPL:standard |
| 4 | * |
| 5 | * Copyright (c) 2016 Broadcom |
| 6 | * All Rights Reserved |
| 7 | * |
| 8 | * Unless you and Broadcom execute a separate written software license |
| 9 | * agreement governing use of this software, this software is licensed |
| 10 | * to you under the terms of the GNU General Public License version 2 |
| 11 | * (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, |
| 12 | * with the following added to such license: |
| 13 | * |
| 14 | * As a special exception, the copyright holders of this software give |
| 15 | * you permission to link this software with independent modules, and |
| 16 | * to copy and distribute the resulting executable under terms of your |
| 17 | * choice, provided that you also meet, for each linked independent |
| 18 | * module, the terms and conditions of the license of that module. |
| 19 | * An independent module is a module which is not derived from this |
| 20 | * software. The special exception does not apply to any modifications |
| 21 | * of the software. |
| 22 | * |
| 23 | * Not withstanding the above, under no circumstances may you combine |
| 24 | * this software in any way with any other Broadcom software provided |
| 25 | * under a license other than the GPL, without Broadcom's express prior |
| 26 | * written consent. |
| 27 | * |
| 28 | * :> |
| 29 | * |
| 30 | *****************************************************************************/ |
| 31 | |
| 32 | /** |
| 33 | * @file bal_switch_acc_term.h |
| 34 | * |
| 35 | * @brief bal switch util access terminal service function header file |
| 36 | * |
| 37 | * @addtogroup sw_util |
| 38 | */ |
| 39 | |
| 40 | #ifndef _BAL_BCM_ACC_TERM_H_ |
| 41 | #define _BAL_BCM_ACC_TERM_H_ |
| 42 | |
| 43 | /*@{*/ |
| 44 | #include "bcmos_errno.h" |
| 45 | |
| 46 | #define BAL_BCM_MAX_INTF 32 |
| 47 | |
| 48 | /* structure of each entry in the port mapping table */ |
| 49 | typedef struct bal_swapp_port_t |
| 50 | { |
| 51 | uint32_t pbm_id; |
| 52 | int device_id; |
| 53 | } bal_swapp_port; |
| 54 | |
| 55 | /* Index of different tables that map core interface number to physical ports on the device |
| 56 | * for example, GPON mapping table will be table[0], EPON mapping table will be table[2] |
| 57 | */ |
| 58 | typedef enum |
| 59 | { |
| 60 | BAL_SWAPP_PORT_MAP_GPON, |
| 61 | BAL_SWAPP_PORT_MAP_GPON_V3, |
| 62 | BAL_SWAPP_PORT_MAP_EXP, |
| 63 | BAL_SWAPP_PORT_MAP_EXP2, |
| 64 | BAL_SWAPP_PORT_MAP_SVK4, |
| 65 | BAL_SWAPP_PORT_MAP_EPON_TDMA, |
| 66 | BAL_SWAPP_PORT_MAP_EPON_1G, |
| 67 | BAL_SWAPP_PORT_MAP_EPON_10G, |
| 68 | BAL_SWAPP_PORT_MAP__NUM_OF, |
| 69 | } bal_swapp_port_map_indx; |
| 70 | |
| 71 | /* |
| 72 | * @brief Packet send structures and defines |
| 73 | */ |
| 74 | enum |
| 75 | { |
| 76 | REASON_SEND_TO_NNI = 1, |
| 77 | REASON_SEND_TO_PON |
| 78 | }; |
| 79 | |
| 80 | typedef struct |
| 81 | { |
| 82 | int socket; |
| 83 | struct sockaddr_in addr; |
| 84 | } trap_target; |
| 85 | |
| 86 | extern bcmos_errno bal_bcm_acc_term_connect(void); |
| 87 | extern void bal_bcm_dft_dev_set(uint32_t id); |
| 88 | extern uint32_t bal_bcm_dft_dev_get(void); |
| 89 | extern void bal_bcm_l2_age_time_set(uint32_t time); |
| 90 | extern uint32_t bal_bcm_l2_age_time_get(void); |
| 91 | extern uint32_t bal_bcm_dev_type_get(uint32_t id); |
| 92 | extern void bal_bcm_use_rpc_set(uint32_t use_rpc); |
| 93 | extern int bal_bcm_intf_maptable_set(uint32_t intf_maptable); |
| 94 | extern uint32_t bal_bcm_net_inf_pbm_get(uint32_t net_inf_id); |
| 95 | extern uint32_t bal_bcm_pon_inf_pbm_get(uint32_t pon_inf_id); |
| 96 | extern int bal_bcm_net_inf_dev_get(uint32_t net_inf_id); |
| 97 | extern int bal_bcm_pon_inf_dev_get(uint32_t pon_inf_id); |
| 98 | extern uint32_t bal_bcm_iwf_mode_get(void); |
| 99 | extern bcmos_bool bal_bcm_use_rpc_get(void); |
| 100 | extern uint32_t bal_bcm_trap_rcv_port_get(void); |
| 101 | extern uint32_t bal_bcm_trap_rcv_port_set(uint32_t udp_port); |
| 102 | extern int bal_bcm_pon_inf_idx_get(uint32_t pon_id); |
| 103 | extern int bal_bcm_net_inf_idx_get(uint32_t nni_id); |
| 104 | extern bal_swapp_port_map_indx bal_bcm_intf_maptable_get(void); |
| 105 | extern uint32_t bal_bcm_ds_sched_mode_get(void); |
| 106 | extern uint32_t bal_bcm_ds_sched_mode_set(uint32_t sched_mode); |
| 107 | extern bcmos_errno sw_util_pkt_send(int dst_port_id, int reason, unsigned char *payload, int payload_len, int tunnel_id); |
| 108 | extern bcmos_errno sw_util_pkt_send_init(const char *pkt_send_server_ip, uint16_t pkt_send_server_listen_port); |
| 109 | extern int bal_bcm_net_inf_map_size_get(void); |
| 110 | extern int bal_bcm_pon_inf_map_size_get(void); |
| 111 | /*@}*/ |
| 112 | |
| 113 | #endif |