2a551d3c60
( All device-specific files now reside under /device directory in a <vendor-name>/<platform-string>/<hardware-SKU> directory structure in repo. * Device-specific files are now packaged into a Debian package (sonic-device-data) and are now installed to /usr/share/sonic/device/<platform-string>/<hardware-SKU>/ directory on switch.
28 lines
755 B
Python
28 lines
755 B
Python
#!/usr/bin/env python
|
|
|
|
try:
|
|
from sonic_sfp.sfputilbase import sfputilbase
|
|
except ImportError, e:
|
|
raise ImportError (str(e) + "- required module not found")
|
|
|
|
|
|
class sfputil(sfputilbase):
|
|
"""Platform specific sfputil class"""
|
|
|
|
port_start = 0
|
|
port_end = 63
|
|
ports_in_block = 64
|
|
|
|
eeprom_offset = 18
|
|
|
|
port_to_eeprom_mapping = {}
|
|
|
|
_qsfp_ports = range(0, ports_in_block + 1)
|
|
|
|
def __init__(self, port_num):
|
|
# Override port_to_eeprom_mapping for class initialization
|
|
eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom'
|
|
for x in range(0, self.port_end + 1):
|
|
self.port_to_eeprom_mapping[x] = eeprom_path.format(x + self.eeprom_offset)
|
|
sfputilbase.__init__(self, port_num)
|