From 4d0a47d8996c946ff49386cd26f640ec020dea41 Mon Sep 17 00:00:00 2001 From: chiourung_huang Date: Tue, 25 Nov 2025 06:39:46 +0000 Subject: [PATCH] JIRA-SONIC-13444: [CMIS] [LUMENTUM] Support OSFP-ZR The api is_coherent_module can't determeter the OSFP-ZR correctly. Use the proper CMIS-compliant method to define whether frequency tuning is supported. --- sonic_platform_base/sonic_xcvr/api/public/cmis.py | 8 ++++++++ sonic_platform_base/sonic_xcvr/fields/consts.py | 1 + sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py | 1 + sonic_platform_base/sonic_xcvr/xcvr_api_factory.py | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sonic_platform_base/sonic_xcvr/api/public/cmis.py b/sonic_platform_base/sonic_xcvr/api/public/cmis.py index a550b22..621b557 100644 --- a/sonic_platform_base/sonic_xcvr/api/public/cmis.py +++ b/sonic_platform_base/sonic_xcvr/api/public/cmis.py @@ -779,6 +779,14 @@ def get_module_pwr_down_duration(self): duration = self.xcvr_eeprom.read(consts.MODULE_PWRDN_DURATION) return float(duration) if duration is not None else 0 + def is_tx_tunable(self): + ''' + Returns True if transmitter is tunable(Page04h and 12h supported) + ''' + if self.is_flat_memory(): + return False + return self.xcvr_eeprom.read(consts.TX_TUNABLE_SUPPORT_FIELD) + def get_host_lane_count(self): ''' This function returns number of host lanes for default application diff --git a/sonic_platform_base/sonic_xcvr/fields/consts.py b/sonic_platform_base/sonic_xcvr/fields/consts.py index 68ff4b2..c5573dc 100644 --- a/sonic_platform_base/sonic_xcvr/fields/consts.py +++ b/sonic_platform_base/sonic_xcvr/fields/consts.py @@ -55,6 +55,7 @@ TX_FAULT_SUPPORT_FIELD = "TxFaultSupported" TX_DISABLE_FIELD = "TxDisable" TX_DISABLE_SUPPORT_FIELD = "TxDisableSupported" +TX_TUNABLE_SUPPORT_FIELD = "TxTunableSupported" TX_POWER_FIELD = "TxPower" TX_POWER_SUPPORT_FIELD = "TxPowerSupported" 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 8702e76..b6bb219 100644 --- a/sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py +++ b/sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py @@ -213,6 +213,7 @@ def __init__(self, codes): ), NumberRegField(consts.CTRLS_ADVT_FIELD, self.getaddr(0x1, 155), RegBitField(consts.TX_DISABLE_SUPPORT_FIELD, 1), + RegBitField(consts.TX_TUNABLE_SUPPORT_FIELD, 6), size=2, format="