9
9
try :
10
10
import time
11
11
from ctypes import c_char
12
- from sonic_platform_base .sfp_base import SfpBase
12
+ from sonic_platform_base .sonic_xcvr . sfp_optoe_base import SfpOptoeBase
13
13
from sonic_platform_base .sonic_sfp .sff8472 import sff8472InterfaceId
14
14
from sonic_platform_base .sonic_sfp .sff8472 import sff8472Dom
15
15
from sonic_platform_base .sonic_sfp .sff8436 import sff8436InterfaceId
157
157
PORT_END = 55
158
158
159
159
160
- class Sfp (SfpBase ):
160
+ class Sfp (SfpOptoeBase ):
161
161
"""Platform-specific Sfp class"""
162
162
163
163
# Port I2C number
@@ -172,7 +172,7 @@ class Sfp(SfpBase):
172
172
PRS_PATH = "/sys/devices/platform/e1031.smc/SFP/sfp_modabs"
173
173
174
174
def __init__ (self , sfp_index , sfp_name ):
175
- SfpBase .__init__ (self )
175
+ SfpOptoeBase .__init__ (self )
176
176
177
177
# Init common function
178
178
self ._api_common = Common ()
@@ -235,7 +235,7 @@ def _read_eeprom_specific_bytes(self, offset, num_bytes):
235
235
for i in range (0 , num_bytes ):
236
236
eeprom_raw .append ("0x00" )
237
237
238
- sysfs_sfp_i2c_client_eeprom_path = self .port_to_eeprom_mapping [ self . port_num ]
238
+ sysfs_sfp_i2c_client_eeprom_path = self .get_eeprom_path ()
239
239
try :
240
240
sysfsfile_eeprom = open (
241
241
sysfs_sfp_i2c_client_eeprom_path , mode = "rb" , buffering = 0 )
@@ -355,6 +355,9 @@ def _dom_capability_detect(self):
355
355
self .dom_rx_power_supported = False
356
356
self .dom_tx_power_supported = False
357
357
358
+ def get_eeprom_path (self ):
359
+ return self .port_to_eeprom_mapping [self .port_num ]
360
+
358
361
def get_transceiver_info (self ):
359
362
"""
360
363
Retrieves transceiver info of this SFP
@@ -1176,7 +1179,7 @@ def tx_disable(self, tx_disable):
1176
1179
if self .dom_tx_disable_supported :
1177
1180
# SFP status/control register at address A2h, byte 110
1178
1181
offset = 256
1179
- sysfs_sfp_i2c_client_eeprom_path = self .port_to_eeprom_mapping [ self . port_num ]
1182
+ sysfs_sfp_i2c_client_eeprom_path = self .get_eeprom_path ()
1180
1183
status_control_raw = self ._read_eeprom_specific_bytes (
1181
1184
(offset + SFP_STATUS_CONTROL_OFFSET ), SFP_STATUS_CONTROL_WIDTH )
1182
1185
if status_control_raw is not None :
0 commit comments