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

Fix sfp and BIOS review comments #46

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
11 changes: 5 additions & 6 deletions platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,13 @@ def initialize_components(self):
return
if not self._component_list:
# Initialize component list
from .component import ComponentONIE, ComponentSSD, ComponentBIOS, ComponentCPLD, ComponentBIOSSN2201
from .component import ComponentONIE, ComponentSSD, ComponentBIOS, ComponentCPLD
self._component_list.append(ComponentONIE())
self._component_list.append(ComponentSSD())
# Upgrading BIOS is not supported on SN2201
if DeviceDataManager.get_platform_name() not in ['x86_64-nvidia_sn2201-r0']:
self._component_list.append(ComponentBIOS())
else:
self._component_list.append(ComponentBIOSSN2201())
biosComponent = DeviceDataManager.get_bios_component()
if not biosComponent:
biosComponent = ComponentBIOS()
self._component_list.append(biosComponent)
self._component_list.extend(ComponentCPLD.get_component_list())

def get_num_components(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,12 @@ def get_linecard_max_port_count(cls):
if not sfp_data:
return 0
return sfp_data.get('max_port_per_line_card', 0)

@classmethod
def get_bios_component(cls):
if cls.get_platform_name() in ['x86_64-nvidia_sn2201-r0']:
from .component import ComponentBIOSSN2201
# For SN2201, special chass is required for handle BIOS
# Currently, only fetching BIOS version is supported
return ComponentBIOSSN2201()
return None
33 changes: 16 additions & 17 deletions platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2424,24 +2424,23 @@ def get_transceiver_info(self):
application_advertisement |1*255VCHAR |supported applications advertisement
================================================================================
"""
transceiver_info_dict = {}

transceiver_info_keys = ['manufacturer',
'model',
'vendor_rev',
'serial',
'vendor_oui',
'vendor_date',
'connector',
'encoding',
'ext_identifier',
'ext_rateselect_compliance',
'cable_type',
'cable_length',
'specification_compliance',
'nominal_bit_rate',
'application_advertisement']
transceiver_info_dict = dict.fromkeys(transceiver_info_keys, 'N/A')
transceiver_info_dict['type'] = self.sfp_type
transceiver_info_dict['manufacturer'] = 'N/A'
transceiver_info_dict['model'] = 'N/A'
transceiver_info_dict['vendor_rev'] = 'N/A'
transceiver_info_dict['serial'] = 'N/A'
transceiver_info_dict['vendor_oui'] = 'N/A'
transceiver_info_dict['vendor_date'] = 'N/A'
transceiver_info_dict['connector'] = 'N/A'
transceiver_info_dict['encoding'] = 'N/A'
transceiver_info_dict['ext_identifier'] = 'N/A'
transceiver_info_dict['ext_rateselect_compliance'] = 'N/A'
transceiver_info_dict['cable_type'] = 'N/A'
transceiver_info_dict['cable_length'] = 'N/A'
transceiver_info_dict['specification_compliance'] = 'N/A'
transceiver_info_dict['nominal_bit_rate'] = 'N/A'
transceiver_info_dict['application_advertisement'] = 'N/A'

return transceiver_info_dict

Expand Down