Skip to content

Commit 69443d7

Browse files
dflynn-Nokiaqiluo-msft
authored andcommitted
[Nokia ixs7215] Add support for SFP eeprom type_abbrv_name attribute (#8772)
1 parent 7732fa9 commit 69443d7

File tree

2 files changed

+52
-21
lines changed

2 files changed

+52
-21
lines changed

platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/fan_drawer.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,25 @@ def get_direction(self):
5454
return 'intake'
5555

5656
def set_status_led(self, color):
57+
"""
58+
Sets the state of the fan drawer status LED
59+
60+
Args:
61+
color: A string representing the color with which to set the
62+
fan drawer status LED
63+
64+
Returns:
65+
bool: True if status LED state is set successfully, False if not
66+
"""
5767
return self._fan_list[0].set_status_led(color)
5868

59-
def get_status_led(self, color):
69+
def get_status_led(self):
70+
"""
71+
Gets the state of the fan drawer LED
72+
73+
Returns:
74+
A string, one of the predefined STATUS_LED_COLOR_* strings
75+
"""
6076
return self._fan_list[0].get_status_led()
6177

6278
def is_replaceable(self):

platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def __init__(self, index, sfp_type, eeprom_path, port_i2c_map):
143143
'model', 'connector', 'encoding', 'ext_identifier',
144144
'ext_rateselect_compliance', 'cable_type', 'cable_length',
145145
'nominal_bit_rate', 'specification_compliance',
146-
'vendor_date', 'vendor_oui']
146+
'type_abbrv_name', 'vendor_date', 'vendor_oui']
147147

148148
self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode',
149149
'tx_disable', 'tx_disable_channel', 'temperature',
@@ -274,6 +274,7 @@ def get_transceiver_info(self):
274274
cable_length |INT |cable length in m
275275
nominal_bit_rate |INT |nominal bit rate by 100Mbs
276276
specification_compliance |1*255VCHAR |specification compliance
277+
type_abbrv_name |1*255VCHAR |type of SFP (abbreviated)
277278
vendor_date |1*255VCHAR |vendor date
278279
vendor_oui |1*255VCHAR |vendor OUI
279280
application_advertisement |1*255VCHAR |supported applications advertisement
@@ -338,33 +339,47 @@ def get_transceiver_info(self):
338339
end = start + XCVR_VENDOR_DATE_WIDTH
339340
sfp_vendor_date_data = sfpi_obj.parse_vendor_date(
340341
sfp_interface_bulk_raw[start: end], 0)
341-
transceiver_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value']
342-
transceiver_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value']
343-
transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value']
344-
transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value']
345-
transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value']
346-
transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value']
347-
transceiver_info_dict['vendor_date'] = sfp_vendor_date_data[
348-
'data']['VendorDataCode(YYYY-MM-DD Lot)']['value']
349-
transceiver_info_dict['connector'] = sfp_interface_bulk_data['data']['Connector']['value']
350-
transceiver_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value']
351-
transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value']
352-
transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value']
342+
343+
transceiver_info_dict['type'] = sfp_interface_bulk_data \
344+
['data']['type']['value']
345+
transceiver_info_dict['manufacturer'] = sfp_vendor_name_data \
346+
['data']['Vendor Name']['value']
347+
transceiver_info_dict['model'] = sfp_vendor_pn_data \
348+
['data']['Vendor PN']['value']
349+
transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data \
350+
['data']['Vendor Rev']['value']
351+
transceiver_info_dict['serial'] = sfp_vendor_sn_data \
352+
['data']['Vendor SN']['value']
353+
transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data \
354+
['data']['Vendor OUI']['value']
355+
transceiver_info_dict['vendor_date'] = sfp_vendor_date_data \
356+
['data']['VendorDataCode(YYYY-MM-DD Lot)']['value']
357+
transceiver_info_dict['connector'] = sfp_interface_bulk_data \
358+
['data']['Connector']['value']
359+
transceiver_info_dict['encoding'] = sfp_interface_bulk_data \
360+
['data']['EncodingCodes']['value']
361+
transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data \
362+
['data']['Extended Identifier']['value']
363+
transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data \
364+
['data']['RateIdentifier']['value']
365+
transceiver_info_dict['type_abbrv_name'] = sfp_interface_bulk_data \
366+
['data']['type_abbrv_name']['value']
353367

354368
for key in sfp_cable_length_tup:
355369
if key in sfp_interface_bulk_data['data']:
356370
transceiver_info_dict['cable_type'] = key
357-
transceiver_info_dict['cable_length'] = str(
358-
sfp_interface_bulk_data['data'][key]['value'])
371+
transceiver_info_dict['cable_length'] = \
372+
str(sfp_interface_bulk_data['data'][key]['value'])
359373

360374
for key in sfp_compliance_code_tup:
361375
if key in sfp_interface_bulk_data['data']['Specification compliance']['value']:
362-
compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value']
363-
transceiver_info_dict['specification_compliance'] = str(
364-
compliance_code_dict)
376+
compliance_code_dict[key] = sfp_interface_bulk_data \
377+
['data']['Specification compliance']['value'][key]['value']
365378

366-
transceiver_info_dict['nominal_bit_rate'] = str(
367-
sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value'])
379+
transceiver_info_dict['specification_compliance'] = \
380+
str(compliance_code_dict)
381+
transceiver_info_dict['nominal_bit_rate'] = \
382+
str(sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value'])
368383
transceiver_info_dict['application_advertisement'] = 'N/A'
369384

370385
return transceiver_info_dict

0 commit comments

Comments
 (0)