Skip to content
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
8 changes: 8 additions & 0 deletions sonic_platform_base/sonic_xcvr/api/public/cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions sonic_platform_base/sonic_xcvr/fields/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="<H"
),
NumberRegField(consts.TX_FLAGS_ADVT_FIELD, self.getaddr(0x1, 157),
Expand Down
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_xcvr/xcvr_api_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def create_xcvr_api(self):
xcvr_eeprom = XcvrEeprom(self.reader, self.writer, mem_map)
api = CmisApi(xcvr_eeprom)

if api.is_coherent_module():
if api.is_tx_tunable():
mem_map = CCmisMemMap(codes)
xcvr_eeprom = XcvrEeprom(self.reader, self.writer, mem_map)
api = CCmisApi(xcvr_eeprom)
Expand Down