From 9f75d385791c3c0c3338bd0ced58a6fa86a68990 Mon Sep 17 00:00:00 2001 From: Prince George <45705344+prgeor@users.noreply.github.com> Date: Wed, 13 Jul 2022 15:02:50 -0700 Subject: [PATCH] Fix Cmis memmap field offset (#290) --- sonic_platform_base/sonic_xcvr/api/public/c_cmis.py | 5 ----- sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py | 10 +++++----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/sonic_platform_base/sonic_xcvr/api/public/c_cmis.py b/sonic_platform_base/sonic_xcvr/api/public/c_cmis.py index 9330e002e917..65ac4c1f350b 100644 --- a/sonic_platform_base/sonic_xcvr/api/public/c_cmis.py +++ b/sonic_platform_base/sonic_xcvr/api/public/c_cmis.py @@ -122,12 +122,7 @@ def set_laser_freq(self, freq): assert channel_number % 3 == 0 if channel_number > hi_ch_num or channel_number < low_ch_num: raise ValueError('Provisioned frequency out of range. Max Freq: 196100; Min Freq: 191300 GHz.') - self.set_lpmode(True) - time.sleep(5) status = self.xcvr_eeprom.write(consts.LASER_CONFIG_CHANNEL, channel_number) - time.sleep(1) - self.set_lpmode(False) - time.sleep(1) return status def set_tx_power(self, tx_power): diff --git a/sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py b/sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py index 5d1c6dda9d34..a11d4c6c09e1 100644 --- a/sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py +++ b/sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py @@ -123,6 +123,9 @@ def __init__(self, codes): ), RegGroupField(consts.APPLS_ADVT_FIELD_PAGE01, + *(NumberRegField("%s_%d" % (consts.MEDIA_LANE_ASSIGNMENT_OPTION, app), self.getaddr(0x1, 176 + (app - 1)), + format="B", size=1) for app in range(1, 16)), + *(CodeRegField("%s_%d" % (consts.HOST_ELECTRICAL_INTERFACE, app), self.getaddr(0x1, 223 + 4 * (app - 9)), self.codes.HOST_ELECTRICAL_INTERFACE) for app in range(9, 16)), @@ -149,11 +152,8 @@ def __init__(self, codes): *(RegBitField("Bit%d" % (bit), bit) for bit in range (4, 8)) ) for lane in range(9, 16)), - *(NumberRegField("%s_%d" % (consts.HOST_LANE_ASSIGNMENT_OPTION, app), self.getaddr(0x1, 226 + 4 * (app - 1)), - format="B", size=1) for app in range(9, 16)), - - *(NumberRegField("%s_%d" % (consts.MEDIA_LANE_ASSIGNMENT_OPTION, app), self.getaddr(0x1, 176 + (app - 1)), - format="B", size=1) for app in range(1, 16)) + *(NumberRegField("%s_%d" % (consts.HOST_LANE_ASSIGNMENT_OPTION, app), self.getaddr(0x1, 226 + 4 * (app - 9)), + format="B", size=1) for app in range(9, 16)) ) )