8383QSFP_MODULE_THRESHOLD_OFFSET = 128
8484QSFP_MODULE_THRESHOLD_WIDTH = 24
8585QSFP_CHANNEL_THRESHOLD_OFFSET = 176
86- QSFP_CHANNEL_THRESHOLD_WIDTH = 16
86+ QSFP_CHANNEL_THRESHOLD_WIDTH = 24
8787
8888
8989SFP_TEMPE_OFFSET = 96
9494SFP_CHANNL_MON_WIDTH = 6
9595SFP_MODULE_THRESHOLD_OFFSET = 0
9696SFP_MODULE_THRESHOLD_WIDTH = 40
97- SFP_CHANNL_THRESHOLD_OFFSET = 112
98- SFP_CHANNL_THRESHOLD_WIDTH = 2
9997SFP_STATUS_CONTROL_OFFSET = 110
10098SFP_STATUS_CONTROL_WIDTH = 1
10199SFP_TX_DISABLE_HARD_BIT = 7
@@ -327,16 +325,16 @@ def get_transceiver_info(self):
327325 else :
328326 xcvr_info_dict ['type' ] = sfp_type_data ['data' ]['type' ]['value' ] if sfp_type_data else 'N/A'
329327 xcvr_info_dict ['type_abbrv_name' ] = sfp_type_abbrv_name ['data' ]['type_abbrv_name' ]['value' ] \
330- if sfp_type_abbrv_name else 'N/A'
328+ if sfp_type_abbrv_name else 'N/A'
331329
332330 xcvr_info_dict ['manufacturer' ] = sfp_vendor_name_data ['data' ]['Vendor Name' ]['value' ] \
333- if sfp_vendor_name_data else 'N/A'
331+ if sfp_vendor_name_data else 'N/A'
334332 xcvr_info_dict ['model' ] = sfp_vendor_pn_data ['data' ]['Vendor PN' ]['value' ] if sfp_vendor_pn_data else 'N/A'
335333 xcvr_info_dict ['hardware_rev' ] = sfp_vendor_rev_data ['data' ]['Vendor Rev' ]['value' ] \
336- if sfp_vendor_rev_data else 'N/A'
334+ if sfp_vendor_rev_data else 'N/A'
337335 xcvr_info_dict ['serial' ] = sfp_vendor_sn_data ['data' ]['Vendor SN' ]['value' ] if sfp_vendor_sn_data else 'N/A'
338336 xcvr_info_dict ['vendor_oui' ] = sfp_vendor_oui_data ['data' ]['Vendor OUI' ]['value' ] \
339- if sfp_vendor_oui_data else 'N/A'
337+ if sfp_vendor_oui_data else 'N/A'
340338 xcvr_info_dict ['vendor_date' ] = sfp_vendor_date_data ['data' ][
341339 'VendorDataCode(YYYY-MM-DD Lot)' ]['value' ] if sfp_vendor_date_data else 'N/A'
342340 xcvr_info_dict ['cable_type' ] = "Unknown"
@@ -351,7 +349,7 @@ def get_transceiver_info(self):
351349 for key in qsfp_compliance_code_tup :
352350 if key in sfp_interface_bulk_data ['data' ]['Specification compliance' ]['value' ]:
353351 compliance_code_dict [key ] = sfp_interface_bulk_data ['data' ]['Specification compliance' ][
354- 'value' ][key ]['value' ]
352+ 'value' ][key ]['value' ]
355353 xcvr_info_dict ['specification_compliance' ] = str (compliance_code_dict )
356354
357355 nkey = 'Nominal Bit Rate(100Mbs)'
@@ -371,7 +369,7 @@ def get_transceiver_info(self):
371369 for key in sfp_compliance_code_tup :
372370 if key in sfp_interface_bulk_data ['data' ]['Specification compliance' ]['value' ]:
373371 compliance_code_dict [key ] = sfp_interface_bulk_data ['data' ]['Specification compliance' ][
374- 'value' ][key ]['value' ]
372+ 'value' ][key ]['value' ]
375373 xcvr_info_dict ['specification_compliance' ] = str (compliance_code_dict )
376374
377375 xcvr_info_dict ['nominal_bit_rate' ] = str (
@@ -592,8 +590,9 @@ def get_transceiver_threshold_info(self):
592590 if sfpd_obj is None :
593591 return None
594592
595- dom_thres_raw = self .__read_eeprom_specific_bytes (QSFP_MODULE_THRESHOLD_OFFSET , QSFP_MODULE_THRESHOLD_WIDTH )
596-
593+ offset = 384
594+ dom_thres_raw = self .__read_eeprom_specific_bytes (
595+ (offset + QSFP_MODULE_THRESHOLD_OFFSET ), QSFP_MODULE_THRESHOLD_WIDTH )
597596 if dom_thres_raw :
598597 module_threshold_values = sfpd_obj .parse_module_threshold_values (
599598 dom_thres_raw , 0 )
@@ -608,8 +607,8 @@ def get_transceiver_threshold_info(self):
608607 xcvr_dom_threshold_info_dict ['vcchighwarning' ] = module_threshold_data ['VccHighWarning' ]['value' ]
609608 xcvr_dom_threshold_info_dict ['vcclowwarning' ] = module_threshold_data ['VccLowWarning' ]['value' ]
610609
611- dom_thres_raw = self .__read_eeprom_specific_bytes (
612- QSFP_CHANNEL_THRESHOLD_OFFSET , QSFP_CHANNEL_THRESHOLD_WIDTH )
610+ dom_thres_raw = self .__read_eeprom_specific_bytes (( offset + QSFP_CHANNEL_THRESHOLD_OFFSET ),
611+ QSFP_CHANNEL_THRESHOLD_WIDTH )
613612 if dom_thres_raw :
614613 channel_threshold_values = sfpd_obj .parse_channel_threshold_values (
615614 dom_thres_raw , 0 )
@@ -659,15 +658,15 @@ def get_transceiver_threshold_info(self):
659658 xcvr_dom_threshold_info_dict ['txpowerhighalarm' ] = dom_mod_th_data ['data' ]['TXPowerHighAlarm' ]['value' ]
660659 xcvr_dom_threshold_info_dict ['txpowerlowalarm' ] = dom_mod_th_data ['data' ]['TXPowerLowAlarm' ]['value' ]
661660 xcvr_dom_threshold_info_dict ['txpowerhighwarning' ] = dom_mod_th_data ['data' ]['TXPowerHighWarning' ][
662- 'value' ]
661+ 'value' ]
663662 xcvr_dom_threshold_info_dict ['txpowerlowwarning' ] = dom_mod_th_data ['data' ]['TXPowerLowWarning' ][
664- 'value' ]
663+ 'value' ]
665664 xcvr_dom_threshold_info_dict ['rxpowerhighalarm' ] = dom_mod_th_data ['data' ]['RXPowerHighAlarm' ]['value' ]
666665 xcvr_dom_threshold_info_dict ['rxpowerlowalarm' ] = dom_mod_th_data ['data' ]['RXPowerLowAlarm' ]['value' ]
667666 xcvr_dom_threshold_info_dict ['rxpowerhighwarning' ] = dom_mod_th_data ['data' ]['RXPowerHighWarning' ][
668- 'value' ]
667+ 'value' ]
669668 xcvr_dom_threshold_info_dict ['rxpowerlowwarning' ] = dom_mod_th_data ['data' ]['RXPowerLowWarning' ][
670- 'value' ]
669+ 'value' ]
671670
672671 return xcvr_dom_threshold_info_dict
673672
@@ -764,7 +763,7 @@ def get_tx_fault(self):
764763 tx_fault_list = []
765764 dom_channel_monitor_raw = self .__read_eeprom_specific_bytes (
766765 QSFP_CHANNL_TX_FAULT_STATUS_OFFSET , QSFP_CHANNL_TX_FAULT_STATUS_WIDTH ) \
767- if self .get_presence () else None
766+ if self .get_presence () else None
768767 if dom_channel_monitor_raw is not None :
769768 tx_fault_data = int (dom_channel_monitor_raw [0 ], 16 )
770769 tx_fault_list .append (tx_fault_data & 0x01 != 0 )
@@ -1040,6 +1039,28 @@ def get_tx_power(self):
10401039 else :
10411040 return None
10421041
1042+ def get_intr_status (self ):
1043+ """
1044+ Retrieves the interrupt status for this transceiver
1045+ Returns:
1046+ A Boolean, True if there is interrupt, False if not
1047+ """
1048+ intr_status = False
1049+
1050+ # Interrupt status can be checked for absent ports too
1051+ device = 'PORT{}' .format (self .port_index )
1052+ output = self .pddf_obj .get_attr_name_output (device , 'xcvr_intr_status' )
1053+
1054+ if output :
1055+ status = int (output ['status' ].rstrip ())
1056+
1057+ if status == 1 :
1058+ intr_status = True
1059+ else :
1060+ intr_status = False
1061+
1062+ return intr_status
1063+
10431064 def reset (self ):
10441065 """
10451066 Reset SFP and return all user module settings to their default srate.
@@ -1354,6 +1375,8 @@ def get_presence(self):
13541375 # if self.plugin_data doesn't specify anything regarding Transceivers
13551376 if modpres == '1' :
13561377 return True
1378+ else :
1379+ return False
13571380
13581381 def get_model (self ):
13591382 """
0 commit comments