Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make is_flat_memory more robust #491

Merged
merged 2 commits into from
Sep 3, 2024
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
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_xcvr/api/public/cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def get_voltage(self):
return float("{:.3f}".format(voltage))

def is_flat_memory(self):
return self.xcvr_eeprom.read(consts.FLAT_MEM_FIELD)
return self.xcvr_eeprom.read(consts.FLAT_MEM_FIELD) is not False

def get_temperature_support(self):
return not self.is_flat_memory()
Expand Down
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_xcvr/api/public/sff8436.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def set_power_override(self, power_override, power_set):
return ret

def is_flat_memory(self):
return self.xcvr_eeprom.read(consts.FLAT_MEM_FIELD)
return self.xcvr_eeprom.read(consts.FLAT_MEM_FIELD) is not False

def get_tx_power_support(self):
return False
Expand Down
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_xcvr/api/public/sff8472.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def tx_disable_channel(self, channel, disable):
return self.tx_disable(disable) if channel != 0 else True

def is_flat_memory(self):
return not self.xcvr_eeprom.read(consts.PAGING_SUPPORT_FIELD)
return not self.xcvr_eeprom.read(consts.PAGING_SUPPORT_FIELD) is not False

def get_temperature_support(self):
return self.xcvr_eeprom.read(consts.DDM_SUPPORT_FIELD)
Expand Down
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_xcvr/api/public/sff8636.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def set_power_override(self, power_override, power_set):
return ret

def is_flat_memory(self):
return self.xcvr_eeprom.read(consts.FLAT_MEM_FIELD)
return self.xcvr_eeprom.read(consts.FLAT_MEM_FIELD) is not False

def get_tx_power_support(self):
if self.is_copper():
Expand Down
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_xcvr/api/xcvr_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def is_flat_memory(self):
Returns:
A Boolean, True if flat memory, False if paging is implemented
If there is an issue with reading the xcvr, None should be returned.
If there is an issue with reading the xcvr, True should be returned.
"""
raise NotImplementedError

Expand Down
Loading