Skip to content

Commit

Permalink
Pass grid parameter while calling set_laser_freq (sonic-net#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
mihirpat1 authored Nov 29, 2022
1 parent ed818f8 commit f784ad7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sonic-xcvrd/xcvrd/xcvrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ def configure_tx_output_power(self, api, lport, tx_power):
self.log_error("{} configured tx power {} > maximum power {} supported".format(lport, tx_power, max_p))
return api.set_tx_power(tx_power)

def configure_laser_frequency(self, api, lport, freq):
def configure_laser_frequency(self, api, lport, freq, grid=75):
_, _, _, lowf, highf = api.get_supported_freq_config()
if freq < lowf:
self.log_error("{} configured freq:{} GHz is lower than the supported freq:{} GHz".format(lport, freq, lowf))
Expand All @@ -1304,7 +1304,7 @@ def configure_laser_frequency(self, api, lport, freq):
self.log_error("{} configured freq:{} GHz is NOT in 75GHz grid".format(lport, freq))
if api.get_tuning_in_progress():
self.log_error("{} Tuning in progress, channel selection may fail!".format(lport))
return api.set_laser_freq(freq)
return api.set_laser_freq(freq, grid)

def wait_for_port_config_done(self, namespace):
# Connect to APPL_DB and subscribe to PORT table notifications
Expand Down

0 comments on commit f784ad7

Please sign in to comment.