wcmod_diagnostics.h (2472B)
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-2019 Broadcom Inc. All rights reserved. 7 */ 8 #include <sal/types.h> 9 #ifndef _WCMOD_DIAGNOSTICS_H_ 10 #define _WCMOD_DIAGNOSTICS_H_ 11 12 #include "wcmod_defines.h" 13 #ifdef _SDK_WCMOD_ 14 #include <sal/types.h> 15 #endif 16 17 /*#define SPEED_CALC_FREQ 156.25 */ 18 /*#define SPEED_CALC_FREQ_UNITS "MHz" */ 19 20 #define MAX_TAP_SUM_CONSTRAINT 63 21 #define MIN_TAP_EYE_CONSTRAINT 17 22 23 /* #define BER_EXTRAP_SPD_UP */ 24 #define MAX_LOOPS 47 25 #define MIN_RUNTIME 1 26 #define INDEX_UNINITIALIZED (-1) 27 #define SPD_UP_MAX_RUNTIME 64 28 #ifdef BER_EXTRAP_SPD_UP 29 #define MAX_RUNTIME SPD_UP_MAX_RUNTIME 30 #else 31 #define MAX_RUNTIME 256 32 #endif 33 #define HI_CONFIDENCE_ERR_CNT 100 /* bit errors to determine high confidence */ 34 #define LO_CONFIDENCE_MIN_ERR_CNT 10 /* bit errors, exit condition for low confidence */ 35 #define HI_CONFIDENCE_MIN_ERR_CNT 20 /* bit errors exit condition for high confidence */ 36 #define VEYE_UNIT 1.75 37 #define HEYE_UNIT 3.125 38 #define WC_UTIL_MAX_ROUND_DIGITS (8) 39 40 /* Do not change the value, used as index */ 41 #define WC_UTIL_VEYE 0 /* vertical eye */ 42 #define WC_UTIL_VEYE_U 1 /* vertical eye up */ 43 #define WC_UTIL_VEYE_D 2 /* vertical eye down */ 44 #define WC_UTIL_HEYE_R 3 /* horizontal right eye */ 45 #define WC_UTIL_HEYE_L 4 /* horizontal left eye */ 46 47 typedef struct { 48 int total_errs[MAX_LOOPS]; 49 int total_elapsed_time[MAX_LOOPS]; 50 int mono_flags[MAX_LOOPS]; 51 int max_loops; 52 int offset_max; 53 int veye_cnt; 54 uint32 rate; /* frequency in KHZ */ 55 int first_good_ber_idx; 56 int first_small_errcnt_idx; 57 int target_ber; /* this is the target BER example, -18, representing 10^(-18) */ 58 int tolerance; /* this is the percentage specify +/- % opening/margin of the target_ber */ 59 } WCMOD_EYE_DIAG_INFOt; 60 61 extern int wcmod_diag_autoneg(wcmod_st *ws); 62 extern int wcmod_diag_general(wcmod_st *ws); 63 extern int wcmod_diag_internal_traffic(wcmod_st *ws); 64 extern int wcmod_diag_link(wcmod_st *ws); 65 extern int wcmod_diag_topology(wcmod_st *ws); 66 extern int wcmod_diag_speed(wcmod_st *ws); 67 extern int _wcmod_eye_margin_data_get(wcmod_st* ws, WCMOD_EYE_DIAG_INFOt *pInfo,int type); 68 extern int _wcmod_eye_margin_ber_cal(WCMOD_EYE_DIAG_INFOt *pInfo, int type); 69 extern int _wcmod_eye_margin_diagram_cal(WCMOD_EYE_DIAG_INFOt *pInfo, int type); 70 71 #endif 72