sesto_diagnostics.c (5698B)
1 /* 2 * 3 * 4 * 5 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 6 * 7 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 8 */ 9 10 #include <phymod/phymod.h> 11 #include <phymod/phymod_diagnostics.h> 12 #include <phymod/phymod_diagnostics_dispatch.h> 13 14 #ifdef PHYMOD_SESTO_SUPPORT 15 #include "../tier1/sesto_cfg_seq.h" 16 #include "../tier1/sesto_diag_seq.h" 17 18 int sesto_phy_rx_slicer_position_set(const phymod_phy_access_t* phy, uint32_t flags, const phymod_slicer_position_t* position) 19 { 20 21 22 /* Place your code here */ 23 24 25 return PHYMOD_E_UNAVAIL; 26 27 } 28 29 int sesto_phy_rx_slicer_position_get(const phymod_phy_access_t* phy, uint32_t flags, phymod_slicer_position_t* position) 30 { 31 32 33 /* Place your code here */ 34 35 36 return PHYMOD_E_UNAVAIL; 37 38 } 39 40 41 int sesto_phy_rx_slicer_position_max_get(const phymod_phy_access_t* phy, uint32_t flags, const phymod_slicer_position_t* position_min, const phymod_slicer_position_t* position_max) 42 { 43 44 45 /* Place your code here */ 46 47 48 return PHYMOD_E_UNAVAIL; 49 50 } 51 52 53 int sesto_phy_prbs_config_set(const phymod_phy_access_t* phy, uint32_t flags , const phymod_prbs_t* prbs) 54 { 55 return (_sesto_phy_prbs_config_set (phy, flags, prbs)); 56 } 57 58 int sesto_phy_prbs_config_get(const phymod_phy_access_t* phy, uint32_t flags , phymod_prbs_t* prbs) 59 { 60 return (_sesto_phy_prbs_config_get(phy, flags, prbs)); 61 } 62 63 64 int sesto_phy_prbs_enable_set(const phymod_phy_access_t* phy, uint32_t flags , uint32_t enable) 65 { 66 return _sesto_phy_prbs_enable_set(phy, flags, enable); 67 } 68 69 int sesto_phy_prbs_enable_get(const phymod_phy_access_t* phy, uint32_t flags , uint32_t* enable) 70 { 71 return _sesto_phy_prbs_enable_get(phy, flags, enable); 72 } 73 74 75 int sesto_phy_prbs_status_get(const phymod_phy_access_t* phy, uint32_t flags, phymod_prbs_status_t* prbs_status) 76 { 77 return _sesto_phy_prbs_status_get(phy, flags, prbs_status); 78 } 79 80 81 int sesto_phy_pattern_config_set(const phymod_phy_access_t* phy, const phymod_pattern_t* pattern) 82 { 83 84 85 /* Place your code here */ 86 87 88 return PHYMOD_E_UNAVAIL; 89 90 } 91 92 int sesto_phy_pattern_config_get(const phymod_phy_access_t* phy, phymod_pattern_t* pattern) 93 { 94 95 96 /* Place your code here */ 97 98 99 return PHYMOD_E_UNAVAIL; 100 101 } 102 103 104 int sesto_phy_pattern_enable_set(const phymod_phy_access_t* phy, uint32_t enable, const phymod_pattern_t* pattern) 105 { 106 107 108 /* Place your code here */ 109 110 111 return PHYMOD_E_UNAVAIL; 112 113 } 114 115 int sesto_phy_pattern_enable_get(const phymod_phy_access_t* phy, uint32_t* enable) 116 { 117 118 119 /* Place your code here */ 120 121 122 return PHYMOD_E_UNAVAIL; 123 124 } 125 126 127 int sesto_core_diagnostics_get(const phymod_core_access_t* core, phymod_core_diagnostics_t* diag) 128 { 129 return _sesto_core_diagnostics_get(core, diag); 130 } 131 132 133 int sesto_phy_diagnostics_get(const phymod_phy_access_t* phy, phymod_phy_diagnostics_t* diag) 134 { 135 return _sesto_phy_diagnostics_get(phy, diag); 136 } 137 138 int sesto_phy_eyescan_run (const phymod_phy_access_t* phy, uint32_t flags, phymod_eyescan_mode_t mode, const phymod_phy_eyescan_options_t* eyescan_options) 139 { 140 141 if (PHYMOD_EYESCAN_F_DONE_GET(flags)) { 142 switch(mode) { 143 case phymodEyescanModeFast: 144 return _sesto_phy_display_eyescan(phy); 145 case phymodEyescanModeBERProj: 146 return _sesto_ber_proj(phy, eyescan_options); 147 default: 148 return _sesto_phy_display_eyescan(phy); 149 break; 150 } 151 } else { 152 return PHYMOD_E_NONE; 153 } 154 155 } 156 157 /** FC/PCS checker enable set 158 * This function is used to enable or disable FC/PCS checker 159 * 160 * @param phy Pointer to phymod phy access structure 161 * @param fcpcs_chkr_mode FC/PCS checker mode 162 * @param enable Enable or disable 163 * 1 - enable 164 * 0 - disable 165 * 166 * @return PHYMOD_E_NONE successful function execution 167 */ 168 int sesto_phy_link_mon_enable_set(const phymod_phy_access_t* phy, phymod_link_monitor_mode_t fcpcs_chkr_mode, uint32_t enable) 169 { 170 return _sesto_pcs_link_monitor_enable_set(phy, enable); 171 } 172 /** FC/PCS checker enable get 173 * This function is used to check whether or not FC/PCS checker enabled 174 * 175 * @param phy Pointer to phymod phy access structure 176 * @param fcpcs_chkr_mode FC/PCS checker mode 177 * @param enable Enable or disable 178 * 1 - enable 179 * 0 - disable 180 * 181 * @return PHYMOD_E_NONE successful function execution 182 */ 183 int sesto_phy_link_mon_enable_get(const phymod_phy_access_t* phy, phymod_link_monitor_mode_t fcpcs_chkr_mode, uint32_t *enable) 184 { 185 return _sesto_pcs_link_monitor_enable_get(phy, enable); 186 } 187 /** FC/PCS checker status get 188 * This function is used to lock, loss of lock, error count status of the FC/PCS checker 189 * 190 * @param phy Pointer to phymod phy access structure 191 * @param lock_status Live lock status 192 * 1 - Locked 193 * 0 - Not locked 194 * @param lock_lost_lh Loss of lock 195 * 1 - Loss of lock happened 196 * 0 - No Loss of lock happended 197 * @param error_count Error count 198 * 199 * @return PHYMOD_E_NONE successful function execution 200 */ 201 int sesto_phy_link_mon_status_get(const phymod_phy_access_t* phy, uint32_t* lock_status, uint32_t* lock_lost_lh, uint32_t* error_count) 202 { 203 return _sesto_get_pcs_link_status(phy, lock_status, lock_lost_lh, error_count); 204 } 205 206 int sesto_phy_pmd_info_dump(const phymod_phy_access_t* phy, const char* type) 207 { 208 return _sesto_phy_status_dump(phy); 209 } 210 211 #endif /* PHYMOD_SESTO_SUPPORT */