Skip to content

Commit adf9767

Browse files
authored
Update cmis.py
1 parent 4917b2c commit adf9767

File tree

1 file changed

+16
-16
lines changed
  • sonic_platform_base/sonic_xcvr/api/public

1 file changed

+16
-16
lines changed

sonic_platform_base/sonic_xcvr/api/public/cmis.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,16 +2244,16 @@ def stage_output_eq_pre_cursor_target_rx(self, host_lanes_mask, si_settings):
22442244
'''
22452245
This function applies RX output eq pre cursor settings
22462246
'''
2247+
rx_pre_max_val = self.get_rx_output_eq_pre_max_val()
2248+
if rx_pre_max_val is None:
2249+
return False
22472250
for lane in range(self.NUM_CHANNELS):
22482251
if ((1 << lane) & host_lanes_mask) == 0:
22492252
continue
22502253
lane = lane+1
22512254
si_key_lane = "{}{}".format(consts.OUTPUT_EQ_PRE_CURSOR_TARGET_RX, lane)
22522255
val = si_settings[si_key_lane]
2253-
if val is None:
2254-
return False
2255-
rx_pre_max_val = self.get_rx_output_eq_pre_max_val()
2256-
if rx_pre_max_val is None or val > rx_pre_max_val:
2256+
if val is None or val > rx_pre_max_val:
22572257
return False
22582258
pre_val = 0
22592259
if (lane%2) == 0:
@@ -2274,16 +2274,16 @@ def stage_output_eq_post_cursor_target_rx(self, host_lanes_mask, si_settings):
22742274
'''
22752275
This function applies RX output eq post cursor settings
22762276
'''
2277+
rx_post_max_val = self.get_rx_output_eq_post_max_val()
2278+
if rx_post_max_val is None:
2279+
return False
22772280
for lane in range(self.NUM_CHANNELS):
22782281
if ((1 << lane) & host_lanes_mask) == 0:
22792282
continue
22802283
lane = lane+1
22812284
si_key_lane = "{}{}".format(consts.OUTPUT_EQ_POST_CURSOR_TARGET_RX, lane)
22822285
val = si_settings[si_key_lane]
2283-
if val is None:
2284-
return False
2285-
rx_post_max_val = self.get_rx_output_eq_post_max_val()
2286-
if rx_post_max_val is None or val > rx_post_max_val:
2286+
if val is None or val > rx_post_max_val:
22872287
return False
22882288
pre_val = 0
22892289
if (lane%2) == 0:
@@ -2304,16 +2304,16 @@ def stage_output_amp_target_rx(self, host_lanes_mask, si_settings):
23042304
'''
23052305
This function applies RX output amp settings
23062306
'''
2307+
rx_amp_max_val = self.get_rx_output_amp_max_val()
2308+
if rx_amp_max_val is None:
2309+
return False
23072310
for lane in range(self.NUM_CHANNELS):
23082311
if ((1 << lane) & host_lanes_mask) == 0:
23092312
continue
23102313
lane = lane+1
23112314
si_key_lane = "{}{}".format(consts.OUTPUT_AMPLITUDE_TARGET_RX, lane)
23122315
val = si_settings[si_key_lane]
2313-
if val is None:
2314-
return False
2315-
rx_amp_max_val = self.get_rx_output_amp_max_val()
2316-
if rx_amp_max_val is None or val > rx_amp_max_val:
2316+
if val is None or val > rx_amp_max_val:
23172317
return False
23182318
pre_val = 0
23192319
if (lane%2) == 0:
@@ -2334,16 +2334,16 @@ def stage_fixed_input_target_tx(self, host_lanes_mask, si_settings):
23342334
'''
23352335
This function applies fixed TX input si settings
23362336
'''
2337+
tx_fixed_input = self.get_tx_input_eq_max_val()
2338+
if tx_fixed_input is None:
2339+
return False
23372340
for lane in range(self.NUM_CHANNELS):
23382341
if ((1 << lane) & host_lanes_mask) == 0:
23392342
continue
23402343
lane = lane+1
23412344
si_key_lane = "{}{}".format(consts.FIXED_INPUT_EQ_TARGET_TX, lane)
23422345
val = si_settings[si_key_lane]
2343-
if val is None:
2344-
return False
2345-
tx_fixed_input = self.get_tx_input_eq_max_val()
2346-
if tx_fixed_input is None or val > tx_fixed_input:
2346+
if val is None or val > tx_fixed_input:
23472347
return False
23482348
pre_val = 0
23492349
if (lane%2) == 0:

0 commit comments

Comments
 (0)