Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sync PRs]: Sync #327 #334 for sonic_xcvr enhancement #1

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions sonic_platform_base/sonic_xcvr/api/public/cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,11 @@ def set_lpmode(self, lpmode):
# Force module transition to LowPwr under SW control
lpmode_val = lpmode_val | (1 << CmisApi.LowPwrRequestSW)
self.xcvr_eeprom.write(consts.MODULE_LEVEL_CONTROL, lpmode_val)
time.sleep(0.1)
for retries in range(50):
if self.get_lpmode():
break
time.sleep(0.1)

return self.get_lpmode()
else:
# Force transition from LowPwr to HighPower state under SW control.
Expand All @@ -1066,7 +1070,8 @@ def set_lpmode(self, lpmode):
self.xcvr_eeprom.write(consts.MODULE_LEVEL_CONTROL, lpmode_val)
time.sleep(1)
mstate = self.get_module_state()
return True if mstate == 'ModuleReady' else False
return True if mstate == 'ModuleReady' or mstate=='ModulePwrUp' else False

return False

def get_loopback_capability(self):
Expand Down
4 changes: 2 additions & 2 deletions sonic_platform_base/sonic_xcvr/xcvr_api_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def create_xcvr_api(self):
mem_map = Sff8636MemMap(codes)
xcvr_eeprom = XcvrEeprom(self.reader, self.writer, mem_map)
api = Sff8636Api(xcvr_eeprom)
# QSFP+
elif id == 0x0D:
# QSFP+ or QSFP
elif id == 0x0D or id == 0x0C:
revision_compliance = self._get_revision_compliance()
if revision_compliance >= 3:
codes = Sff8636Codes
Expand Down