openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

rx_los_db.h (3454B)


      1 /*
      2  * 
      3  *
      4  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      5  * 
      6  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      7  *
      8  * RX LOS
      9  */
     10 
     11 #ifndef _RX_LOS_DB_H_INCLUDED_
     12 #define _RX_LOS_DB_H_INCLUDED_
     13 
     14 #include <sal/core/time.h>
     15 #include <bcm/types.h>
     16 #include <soc/types.h>
     17 #include <bcm/port.h>
     18 #include <appl/dcmn/rx_los/rx_los.h>
     19 
     20 /* the next functions require database to be locked when called */
     21 
     22 int rx_los_db_state_name_get(rx_los_state_t state, char **name);
     23 
     24 uint32 rx_los_db_long_sleep_get(void);
     25 uint32 rx_los_db_short_sleep_get(void);
     26 uint32 rx_los_db_active_sleep_get(void);
     27 uint32 rx_los_db_allowed_retries_get(void);
     28 uint32 rx_los_db_thread_priority_get(void);
     29 
     30 int rx_los_db_set_config(uint32 short_sleep_usec, uint32 long_sleep_usec, uint32 allowed_retries, uint32 priority, int link_down_count_max, int link_down_cycle_time);
     31 
     32 int rx_los_db_set_active_sleep_config(uint32 active_sleep_usec);
     33 
     34 int rx_los_db_units_pbmp_get(pbmp_t *pbmp);
     35 
     36 int rx_los_db_move_link_to_support(int unit, int port);
     37 int rx_los_db_remove_link_from_support(int unit, int port);
     38 
     39 int rx_los_db_remove_link_from_steady(int unit, int port);
     40 int rx_los_db_move_link_to_steady(int unit, int port);
     41 
     42 int rx_los_db_link_support_enable(int unit, int port, int enable);
     43 
     44 /* the next functions require database to be locked when called,
     45    and require the function rx_los_db_unit_null_check to be called and checked before they are used */
     46 int rx_los_db_not_steady_state_pbmp_get(int unit, pbmp_t *pbmp);
     47 int rx_los_db_supported_pbmp_get(int unit, pbmp_t *pbmp);
     48 
     49 rx_los_state_t rx_los_db_state_get(int unit, int port);
     50 int rx_los_db_state_set(int unit,int port, rx_los_state_t state);
     51 
     52 sal_usecs_t rx_los_db_timestamp_get(int unit, int port);
     53 void rx_los_db_timestamp_update(int unit, int port);
     54 
     55 int rx_los_db_tries_get(int unit, int port);
     56 
     57 void rx_los_db_tries_initialize(int unit, int port);
     58 void rx_los_db_tries_increment(int unit, int port);
     59 
     60 int rx_los_db_unit_null_check(int unit);
     61 
     62 /* first init of DB */
     63 void rx_los_db_init(void);
     64 
     65 int rx_los_db_unit_init(int unit, soc_pbmp_t links_pbmp);
     66 int rx_los_db_unit_deinit(int unit);
     67 
     68 /* user prints */
     69 int rx_los_db_dump(int unit);
     70 int rx_los_db_dump_port(int unit, bcm_port_t port);
     71 
     72 /*
     73  *Recurring detection 
     74  */
     75 /*link down*/
     76 int rx_los_db_link_down_cycle_get(int unit, bcm_port_t port, sal_usecs_t *cycle_start, uint32 *cycle_count);
     77 int rx_los_db_link_down_cycle_set(int unit, bcm_port_t port, sal_usecs_t cycle_start, uint32 cycle_count);
     78 
     79 int rx_los_db_link_down_cycle_config_get(int unit, bcm_port_t port, sal_usecs_t *cycle_start, uint32 *cycle_count);
     80 int rx_los_db_link_down_cycle_config_set(int unit, bcm_port_t port, sal_usecs_t cycle_start, uint32 cycle_count);
     81 /*rx seq change*/
     82 int rx_los_db_rx_seq_change_cycle_get(int unit, bcm_port_t port, sal_usecs_t *cycle_start, uint32 *cycle_count);
     83 int rx_los_db_rx_seq_change_cycle_set(int unit, bcm_port_t port, sal_usecs_t cycle_start, uint32 cycle_count);
     84 
     85 int rx_los_db_rx_seq_change_cycle_config_get(int unit, bcm_port_t port, sal_usecs_t *cycle_start, uint32 *cycle_count);
     86 int rx_los_db_rx_seq_change_cycle_config_set(int unit, bcm_port_t port, sal_usecs_t cycle_start, uint32 cycle_count);
     87 
     88 int rx_los_db_register(int unit, rx_los_callback_t callback);
     89 int rx_los_db_callback_get(int unit, rx_los_callback_t *callback);
     90 #endif /* _RX_LOS_DB_H_INCLUDED_ */
     91 
     92 
     93 
     94 
     95