Skip to content
Merged
Changes from 2 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
10 changes: 9 additions & 1 deletion device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
except ImportError as e:
raise ImportError("%s - required module not found" % str(e))

#sfp supports dom
XCVR_DOM_CAPABILITY_DOM_SUPPORT_BIT = 0x40

# parameters for DB connection
REDIS_HOSTNAME = "localhost"
REDIS_PORT = 6379
Expand Down Expand Up @@ -517,10 +520,15 @@ def get_transceiver_dom_info_dict(self, port_num):
offset = 256

eeprom_raw = ['0'] * 256
eeprom_raw[92:92+16] = self._read_eeprom_specific_bytes_via_ethtool(port_num, 92, 16)
eeprom_raw[XCVR_DOM_CAPABILITY_OFFSET : XCVR_DOM_CAPABILITY_OFFSET + XCVR_DOM_CAPABILITY_WIDTH] = \
self._read_eeprom_specific_bytes_via_ethtool(port_num, XCVR_DOM_CAPABILITY_OFFSET, XCVR_DOM_CAPABILITY_WIDTH)
sfp_obj = sff8472InterfaceId()
calibration_type = sfp_obj._get_calibration_type(eeprom_raw)

dom_supported = (int(eeprom_raw[XCVR_DOM_CAPABILITY_OFFSET], 16) & XCVR_DOM_CAPABILITY_DOM_SUPPORT_BIT != 0)
if not dom_supported:
return transceiver_dom_info_dict

eeprom_domraw = self._read_eeprom_specific_bytes_via_ethtool(port_num, offset, 256)
if eeprom_domraw is None:
return transceiver_dom_info_dict
Expand Down