Skip to content

Commit

Permalink
DellEMC: Change Platform LP mode API (#9391)
Browse files Browse the repository at this point in the history
As part of SFP refactoring, LP mode is implemented for CMIS devices.
CMIS devices has to invoke common API instead of HW pin.
  • Loading branch information
aravindmani-1 authored Dec 3, 2021
1 parent e95ba9a commit d041e60
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
except ImportError as err:
raise ImportError(str(err) + "- required module not found")

QSFP_DD_MODULE_ENC_OFFSET = 3
QSFP_DD_MODULE_ENC_WIDTH = 1
QSFP_INFO_OFFSET = 128
SFP_INFO_OFFSET = 0
QSFP_DD_PAGE0 = 0
Expand Down Expand Up @@ -205,11 +203,7 @@ def get_lpmode(self):
lpmode_state = False
try:
if self.sfp_type == 'QSFP_DD':
lpmode = self.read_eeprom(QSFP_DD_MODULE_ENC_OFFSET, QSFP_DD_MODULE_ENC_WIDTH)
if lpmode is not None:
if int(lpmode[0])>>1 == 1:
return True
return False
return SfpOptoeBase.get_lpmode(self)
else:
# Port offset starts with 0x4000
port_offset = 16384 + ((self.index-1) * 16)
Expand Down Expand Up @@ -265,12 +259,7 @@ def set_lpmode(self, lpmode):
"""
try:
if self.sfp_type == 'QSFP_DD':
if lpmode is True:
write_val = 0x10
else:
write_val = 0x0

self.write_eeprom(26, 1, bytearray([write_val]))
return SfpOptoeBase.set_lpmode(self, lpmode)
else:
# Port offset starts with 0x4000
port_offset = 16384 + ((self.index-1) * 16)
Expand Down

0 comments on commit d041e60

Please sign in to comment.