File tree 2 files changed +37
-2
lines changed
2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change 7
7
8
8
import sys
9
9
from . import device_base
10
-
10
+ from . import sfp_base
11
11
12
12
class ChassisBase (device_base .DeviceBase ):
13
13
"""
@@ -498,6 +498,27 @@ def get_sfp(self, index):
498
498
499
499
return sfp
500
500
501
+
502
+ def get_port_or_cage_type (self , index ):
503
+ """
504
+ Retrieves sfp port or cage type corresponding to physical port <index>
505
+
506
+ Args:
507
+ index: An integer (>=0), the index of the sfp to retrieve.
508
+ The index should correspond to the physical port in a chassis.
509
+ For example:-
510
+ 1 for Ethernet0, 2 for Ethernet4 and so on for one platform.
511
+ 0 for Ethernet0, 1 for Ethernet4 and so on for another platform.
512
+
513
+ Returns:
514
+ The masks of all types of port or cage that can be supported on the port
515
+ Types are defined in sfp_base.py
516
+ Eg.
517
+ Both SFP and SFP+ are supported on the port, the return value should be 0x0a
518
+ which is 0x02 | 0x08
519
+ """
520
+ raise NotImplementedError
521
+
501
522
##############################################
502
523
# System LED methods
503
524
##############################################
@@ -582,4 +603,3 @@ def get_change_event(self, timeout=0):
582
603
status='6' Bad cable.
583
604
"""
584
605
raise NotImplementedError
585
-
Original file line number Diff line number Diff line change @@ -52,6 +52,21 @@ class SfpBase(device_base.DeviceBase):
52
52
SFP_ERROR_BIT_BAD_CABLE : SFP_ERROR_DESCRIPTION_BAD_CABLE
53
53
}
54
54
55
+ SFP_PORT_TYPE_BIT_RJ45 = 0x00000001
56
+ SFP_PORT_TYPE_BIT_SFP = 0x00000002
57
+ SFP_PORT_TYPE_BIT_XFP = 0x00000004
58
+ SFP_PORT_TYPE_BIT_SFP_PLUS = 0x00000008
59
+ SFP_PORT_TYPE_BIT_QSFP = 0x00000010
60
+ SFP_PORT_TYPE_BIT_CFP = 0x00000020
61
+ SFP_PORT_TYPE_BIT_QSFP_PLUS = 0x00000040
62
+ SFP_PORT_TYPE_BIT_QSFP28 = 0x00000080
63
+ SFP_PORT_TYPE_BIT_SFP28 = 0x00000100
64
+ SFP_PORT_TYPE_BIT_CFP2 = 0x00000200
65
+ SFP_PORT_TYPE_BIT_QSFP56 = 0x00000400
66
+ SFP_PORT_TYPE_BIT_QSFPDD = 0x00000800
67
+ SFP_PORT_TYPE_BIT_OSFP = 0x00001000
68
+ SFP_PORT_TYPE_BIT_SFP_DD = 0x00002000
69
+
55
70
def __init__ (self ):
56
71
# List of ThermalBase-derived objects representing all thermals
57
72
# available on the SFP
You can’t perform that action at this time.
0 commit comments