diff --git a/device/accton/x86_64-accton_as7712_32x-r0/plugins/sfputil.py b/device/accton/x86_64-accton_as7712_32x-r0/plugins/sfputil.py index c13eecfd17..1f2a66d64c 100644 --- a/device/accton/x86_64-accton_as7712_32x-r0/plugins/sfputil.py +++ b/device/accton/x86_64-accton_as7712_32x-r0/plugins/sfputil.py @@ -1,6 +1,7 @@ #!/usr/bin/env python try: + import time from sonic_sfp.sfputilbase import SfpUtilBase except ImportError, e: raise ImportError (str(e) + "- required module not found") @@ -59,14 +60,33 @@ class SfpUtil(SfpUtilBase): SfpUtilBase.__init__(self) def reset(self, port_num): - return True - def set_low_power_mode(self, port_nuM, lpmode): - return True - def get_low_power_mode(self, port_num): - return True + # Check for invalid port_num + if port_num < self._port_start or port_num > self._port_end: + return False -# def get_presence(self, port_num): -# return True + path = "/sys/bus/i2c/devices/{0}-0050/sfp_port_reset" + port_ps = path.format(self.port_to_i2c_mapping[port_num+1]) + + try: + reg_file = open(port_ps, 'w') + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + #toggle reset + reg_file.seek(0) + reg_file.write('1') + time.sleep(1) + reg_file.seek(0) + reg_file.write('0') + reg_file.close() + return True + + def set_low_power_mode(self, port_nuM, lpmode): + raise NotImplementedErro + + def get_low_power_mode(self, port_num): + raise NotImplementedErro def get_presence(self, port_num): # Check for invalid port_num diff --git a/platform/broadcom/sonic-platform-modules-accton b/platform/broadcom/sonic-platform-modules-accton index edfb5b2c12..7ba26ec403 160000 --- a/platform/broadcom/sonic-platform-modules-accton +++ b/platform/broadcom/sonic-platform-modules-accton @@ -1 +1 @@ -Subproject commit edfb5b2c1285cbfd30d8a662ab738aee53a80439 +Subproject commit 7ba26ec403c7f0d0acb958f794311ac3fd1af9a1