|
8 | 8 |
|
9 | 9 | try:
|
10 | 10 | from sonic_platform_base.chassis_base import ChassisBase
|
| 11 | + from sonic_platform_base.sfp_base import SfpBase |
11 | 12 | from arista.core import thermal_control
|
12 | 13 | from arista.core.card import Card
|
13 | 14 | from arista.core.cause import getReloadCauseManager
|
@@ -214,6 +215,34 @@ def get_thermal_manager(self):
|
214 | 215 | def getThermalControl(self):
|
215 | 216 | return thermal_control
|
216 | 217 |
|
| 218 | + def get_port_or_cage_type(self, index): |
| 219 | + portLayout = self._platform.PORTS |
| 220 | + |
| 221 | + if not hasattr( SfpBase, 'SFP_PORT_TYPE_BIT_RJ45' ): |
| 222 | + raise NotImplementedError |
| 223 | + |
| 224 | + if index in portLayout.ethernetRange: |
| 225 | + return SfpBase.SFP_PORT_TYPE_BIT_RJ45 |
| 226 | + |
| 227 | + if index in portLayout.sfpRange: |
| 228 | + return ( SfpBase.SFP_PORT_TYPE_BIT_SFP | |
| 229 | + SfpBase.SFP_PORT_TYPE_BIT_SFP_PLUS | |
| 230 | + SfpBase.SFP_PORT_TYPE_BIT_SFP28 | |
| 231 | + SfpBase.SFP_PORT_TYPE_BIT_SFP_DD ) |
| 232 | + |
| 233 | + if index in portLayout.qsfpRange: |
| 234 | + return ( SfpBase.SFP_PORT_TYPE_BIT_QSFP | |
| 235 | + SfpBase.SFP_PORT_TYPE_BIT_QSFP_PLUS | |
| 236 | + SfpBase.SFP_PORT_TYPE_BIT_QSFP28 | |
| 237 | + SfpBase.SFP_PORT_TYPE_BIT_QSFP56 | |
| 238 | + SfpBase.SFP_PORT_TYPE_BIT_QSFPDD ) |
| 239 | + |
| 240 | + if index in portLayout.osfpRange: |
| 241 | + return ( SfpBase.SFP_PORT_TYPE_BIT_OSFP | |
| 242 | + SfpBase.SFP_PORT_TYPE_BIT_QSFPDD ) |
| 243 | + |
| 244 | + return 0x00000000 |
| 245 | + |
217 | 246 | def get_position_in_parent(self):
|
218 | 247 | return -1
|
219 | 248 |
|
|
0 commit comments