File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
sonic_platform_base/sonic_xcvr Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -898,11 +898,18 @@ def set_lpmode(self, lpmode):
898898 if lpmode_val is not None :
899899 if lpmode is True :
900900 lpmode_val = lpmode_val | (1 << 4 )
901+ self .xcvr_eeprom .write (consts .MODULE_LEVEL_CONTROL , lpmode_val )
902+ time .sleep (0.1 )
903+ return self .get_lpmode ()
901904 else :
902905 lpmode_val = lpmode_val & ~ (1 << 4 )
903- self .xcvr_eeprom .write (consts .MODULE_LEVEL_CONTROL , lpmode_val )
904- time .sleep (0.1 )
905- return self .get_lpmode ()
906+ self .xcvr_eeprom .write (consts .MODULE_LEVEL_CONTROL , lpmode_val )
907+ time .sleep (1 )
908+ lpmode = self .xcvr_eeprom .read (consts .TRANS_MODULE_STATUS_FIELD )
909+ if lpmode is not None :
910+ if lpmode .get ('ModuleState' ) == 'ModuleReady' :
911+ return True
912+ return False
906913 return False
907914
908915 def get_loopback_capability (self ):
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ def set_lpmode(self, lpmode):
144144 vendors has to implement accordingly.
145145 """
146146 api = self .get_xcvr_api ()
147- return api .set_lp_mode (lpmode ) if api is not None else None
147+ return api .set_lpmode (lpmode ) if api is not None else None
148148
149149 def set_optoe_write_max (self , write_max ):
150150 sys_path = self .get_eeprom_path ()
You can’t perform that action at this time.
0 commit comments