diff --git a/device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/sfputil.py b/device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/sfputil.py index 3d0982f7eb2e..a64483cc2e1e 100755 --- a/device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/sfputil.py +++ b/device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/sfputil.py @@ -154,3 +154,31 @@ def reset(self, port_num): reg_file.close() return True + + def get_transceiver_change_event(self, timeout=0): + """ + TBD + """ + return NotImplementedError + + def tx_disable(self, port_num, disable): + """ + @param port_num index of physical port + @param disable, True -- disable port tx signal + False -- enable port tx signal + @return True when operation success, False on failure. + """ + if port_num not in range(self.port_start, self.port_end + 1) or type(disable) != bool: + return False + + try: + disable = hex(1) if disable else hex(0) + port_name = self.get_port_name(port_num) + reg_file = open( + "/".join([self.PORT_INFO_PATH, port_name, "sfp_txdisable"]), "w") + reg_file.write(disable) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + return True diff --git a/device/alibaba/x86_64-alibaba_as13-48f8h-cl-r0/plugins/sfputil.py b/device/alibaba/x86_64-alibaba_as13-48f8h-cl-r0/plugins/sfputil.py index 44fa92c5718e..bc4ded2b9121 100755 --- a/device/alibaba/x86_64-alibaba_as13-48f8h-cl-r0/plugins/sfputil.py +++ b/device/alibaba/x86_64-alibaba_as13-48f8h-cl-r0/plugins/sfputil.py @@ -154,3 +154,31 @@ def reset(self, port_num): reg_file.close() return True + + def get_transceiver_change_event(self, timeout=0): + """ + TBD + """ + return NotImplementedError + + def tx_disable(self, port_num, disable): + """ + @param port_num index of physical port + @param disable, True -- disable port tx signal + False -- enable port tx signal + @return True when operation success, False on failure. + """ + if port_num not in range(self.port_start, self.port_end + 1) or type(disable) != bool: + return False + + try: + disable = hex(1) if disable else hex(0) + port_name = self.get_port_name(port_num) + reg_file = open( + "/".join([self.PORT_INFO_PATH, port_name, "sfp_txdisable"]), "w") + reg_file.write(disable) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + return True diff --git a/device/alibaba/x86_64-alibaba_as23-128h-cl-r0/plugins/sfputil.py b/device/alibaba/x86_64-alibaba_as23-128h-cl-r0/plugins/sfputil.py index 88c300685e0b..82e4584b720d 100755 --- a/device/alibaba/x86_64-alibaba_as23-128h-cl-r0/plugins/sfputil.py +++ b/device/alibaba/x86_64-alibaba_as23-128h-cl-r0/plugins/sfputil.py @@ -154,3 +154,31 @@ def reset(self, port_num): reg_file.close() return True + + def get_transceiver_change_event(self, timeout=0): + """ + TBD + """ + return NotImplementedError + + def tx_disable(self, port_num, disable): + """ + @param port_num index of physical port + @param disable, True -- disable port tx signal + False -- enable port tx signal + @return True when operation success, False on failure. + """ + if port_num not in range(self.port_start, self.port_end + 1) or type(disable) != bool: + return False + + try: + disable = hex(1) if disable else hex(0) + port_name = self.get_port_name(port_num) + reg_file = open( + "/".join([self.PORT_INFO_PATH, port_name, "sfp_txdisable"]), "w") + reg_file.write(disable) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + return True diff --git a/platform/broadcom/sonic-platform-modules-cel b/platform/broadcom/sonic-platform-modules-cel index 8debc179ec1a..2391914c4d3f 160000 --- a/platform/broadcom/sonic-platform-modules-cel +++ b/platform/broadcom/sonic-platform-modules-cel @@ -1 +1 @@ -Subproject commit 8debc179ec1ae9e668bd7376fa6ff77e1e6987de +Subproject commit 2391914c4d3f3de0c6d203eabc53e96d8727cfbc