@@ -415,6 +415,26 @@ def _detect_sfp_type(self, sfp_type):
415
415
# in this case we treat it as the default type according to the SKU
416
416
self .sfp_type = sfp_type
417
417
418
+ def _is_qsfp_copper (self ):
419
+ # This function read the specification compliance byte and
420
+ # ext specification compliance byte to judge whether the cable is copper or not.
421
+ # It is only designed for SFF 8636 cables, SFF 8472 and CMIS cables don't apply.
422
+
423
+ # copper cables defined in SFF8024 "Extended Specification Compliance Codes"
424
+ copper_ext_specification_list = ['08' , '0b' , '0c' , '0d' , '19' , '30' , '32' , '40' ]
425
+
426
+ offset = PAGE00_HIGH_MEMORY_OFFSET
427
+ qsfp_specification_raw = self ._read_eeprom_specific_bytes (offset + XCVR_COMPLIANCE_CODE_OFFSET , 1 )
428
+ qsfp_specification = int (qsfp_specification_raw [0 ], 16 )
429
+ # The 4th bit of the specification complaince byte(131) indicate a 40GBASE-CR4 copper cable
430
+ if qsfp_specification & 0x8 :
431
+ return True
432
+
433
+ qsfp_ext_specification_raw = self ._read_eeprom_specific_bytes (offset + XCVR_EXT_SPECIFICATION_COMPLIANCE_OFFSET , XCVR_EXT_SPECIFICATION_COMPLIANCE_WIDTH )
434
+ if qsfp_ext_specification_raw [0 ] in copper_ext_specification_list :
435
+ return True
436
+
437
+ return False
418
438
419
439
def _dom_capability_detect (self ):
420
440
if not self .get_presence ():
@@ -428,6 +448,16 @@ def _dom_capability_detect(self):
428
448
return
429
449
430
450
if self .sfp_type == QSFP_TYPE :
451
+ if self ._is_qsfp_copper ():
452
+ self .dom_supported = False
453
+ self .dom_temp_supported = False
454
+ self .dom_volt_supported = False
455
+ self .dom_rx_power_supported = False
456
+ self .dom_tx_power_supported = False
457
+ self .calibration = 0
458
+ self .qsfp_page3_available = False
459
+ return
460
+
431
461
self .calibration = 1
432
462
sfpi_obj = sff8436InterfaceId ()
433
463
if sfpi_obj is None :
@@ -482,11 +512,11 @@ def _dom_capability_detect(self):
482
512
# two types of QSFP-DD cable types supported: Copper and Optical.
483
513
qsfp_dom_capability_raw = self ._read_eeprom_specific_bytes ((offset + XCVR_DOM_CAPABILITY_OFFSET_QSFP_DD ), XCVR_DOM_CAPABILITY_WIDTH_QSFP_DD )
484
514
if qsfp_dom_capability_raw is not None :
485
- self .dom_temp_supported = True
486
- self .dom_volt_supported = True
487
515
dom_capability = sfpi_obj .parse_dom_capability (qsfp_dom_capability_raw , 0 )
488
516
if dom_capability ['data' ]['Flat_MEM' ]['value' ] == 'Off' :
489
517
self .dom_supported = True
518
+ self .dom_temp_supported = True
519
+ self .dom_volt_supported = True
490
520
self .second_application_list = True
491
521
self .dom_rx_power_supported = True
492
522
self .dom_tx_power_supported = True
@@ -495,6 +525,8 @@ def _dom_capability_detect(self):
495
525
self .dom_rx_tx_power_bias_supported = True
496
526
else :
497
527
self .dom_supported = False
528
+ self .dom_temp_supported = False
529
+ self .dom_volt_supported = False
498
530
self .second_application_list = False
499
531
self .dom_rx_power_supported = False
500
532
self .dom_tx_power_supported = False
0 commit comments