diff --git a/device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/fwmgrutil.py b/device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/fwmgrutil.py index 16b97f6a143b..1259297fc25b 100644 --- a/device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/fwmgrutil.py +++ b/device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/fwmgrutil.py @@ -101,8 +101,8 @@ def get_cpld_version(self): int(CPLD_3[2], 16), int(CPLD_3[3], 16)) CPLD_4 = 'None' if CPLD_4 is 'None' else "{}.{}".format( int(CPLD_4[2], 16), int(CPLD_4[3], 16)) - FAN_CPLD = 'None' if CPLD_4 is None else "{:.1f}".format( - float(fan_cpld)) + FAN_CPLD = 'None' if CPLD_4 is None else "{}.{}".format( + int(fan_cpld[0], 16), int(fan_cpld[1], 16)) cpld_version_dict = {} cpld_version_dict.update({'CPLD_B': CPLD_B}) @@ -224,8 +224,7 @@ def firmware_upgrade(self, fw_type, fw_path, fw_extra=None): print("Installing BMC as master mode...") json_data["flash"] = "master" r = requests.post(self.bmc_info_url, json=json_data) - return_data = r.json() - if r.status_code != 200 or 'success' not in return_data.get('result'): + if r.status_code != 200 or 'success' not in r.json().get('result'): print("Failed") return False print("Done") @@ -233,8 +232,7 @@ def firmware_upgrade(self, fw_type, fw_path, fw_extra=None): print("Installing BMC as %s mode..." % json_data["flash"]) r = requests.post(self.bmc_info_url, json=json_data) - return_data = r.json() - if r.status_code == 200 and 'success' in return_data.get('result'): + if r.status_code == 200 and 'success' in r.json().get('result'): print("Done, Rebooting BMC.....") reboot_dict = dict() reboot_dict["reboot"] = "yes" diff --git a/device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/sensorutil.py b/device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/sensorutil.py index 4bf14ce6310b..796949126ccc 100644 --- a/device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/sensorutil.py +++ b/device/alibaba/x86_64-alibaba_as13-32h-cl-r0/plugins/sensorutil.py @@ -68,6 +68,12 @@ def input_name_selector(self, sensor_name, input_name): "tmp75-i2c-39-48": "BTF_INLET_RIGHT", "tmp75-i2c-39-49": "BTF_INLET_LEFT" }.get(sensor_name, input_name) + if self.get_sys_airflow() == "FTOB" and sensor_name == "tmp75-i2c-7-4d": + input_name = "INLET_TEMP" + + if self.get_sys_airflow() == "BTOF" and sensor_name == "tmp75-i2c-39-48": + input_name = "INLET_TEMP" + self.sensor_name = "TEMPERATURE" elif 'fancpld' in sensor_name: 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 a08c3170455c..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 @@ -160,3 +160,25 @@ 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/fwmgrutil.py b/device/alibaba/x86_64-alibaba_as13-48f8h-cl-r0/plugins/fwmgrutil.py index a84ed4a5946f..2b367fef3de6 100644 --- a/device/alibaba/x86_64-alibaba_as13-48f8h-cl-r0/plugins/fwmgrutil.py +++ b/device/alibaba/x86_64-alibaba_as13-48f8h-cl-r0/plugins/fwmgrutil.py @@ -101,8 +101,8 @@ def get_cpld_version(self): int(CPLD_3[2], 16), int(CPLD_3[3], 16)) CPLD_4 = 'None' if CPLD_4 is 'None' else "{}.{}".format( int(CPLD_4[2], 16), int(CPLD_4[3], 16)) - FAN_CPLD = 'None' if CPLD_4 is None else "{:.1f}".format( - float(fan_cpld)) + FAN_CPLD = 'None' if CPLD_4 is None else "{}.{}".format( + int(fan_cpld[0], 16), int(fan_cpld[1], 16)) cpld_version_dict = {} cpld_version_dict.update({'CPLD_B': CPLD_B}) @@ -224,8 +224,7 @@ def firmware_upgrade(self, fw_type, fw_path, fw_extra=None): print("Installing BMC as master mode...") json_data["flash"] = "master" r = requests.post(self.bmc_info_url, json=json_data) - return_data = r.json() - if r.status_code != 200 or 'success' not in return_data.get('result'): + if r.status_code != 200 or 'success' not in r.json().get('result'): print("Failed") return False print("Done") @@ -233,8 +232,7 @@ def firmware_upgrade(self, fw_type, fw_path, fw_extra=None): print("Installing BMC as %s mode..." % json_data["flash"]) r = requests.post(self.bmc_info_url, json=json_data) - return_data = r.json() - if r.status_code == 200 and 'success' in return_data.get('result'): + if r.status_code == 200 and 'success' in r.json().get('result'): print("Done, Rebooting BMC.....") reboot_dict = dict() reboot_dict["reboot"] = "yes" diff --git a/device/alibaba/x86_64-alibaba_as13-48f8h-cl-r0/plugins/sensorutil.py b/device/alibaba/x86_64-alibaba_as13-48f8h-cl-r0/plugins/sensorutil.py index 4bf14ce6310b..44e48e743b57 100644 --- a/device/alibaba/x86_64-alibaba_as13-48f8h-cl-r0/plugins/sensorutil.py +++ b/device/alibaba/x86_64-alibaba_as13-48f8h-cl-r0/plugins/sensorutil.py @@ -68,6 +68,12 @@ def input_name_selector(self, sensor_name, input_name): "tmp75-i2c-39-48": "BTF_INLET_RIGHT", "tmp75-i2c-39-49": "BTF_INLET_LEFT" }.get(sensor_name, input_name) + if self.get_sys_airflow() == "FTOB" and sensor_name == "tmp75-i2c-7-4d": + input_name = "INLET_TEMP" + + if self.get_sys_airflow() == "BTOF" and sensor_name == "tmp75-i2c-39-48": + input_name = "INLET_TEMP" + self.sensor_name = "TEMPERATURE" elif 'fancpld' in sensor_name: @@ -326,6 +332,7 @@ def get_all(self): # Set sensor data. sensor_dict = dict() + for k, v in sensor_info.items(): sensor_i_dict = dict() sensor_data_str = v.split() 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 18cdf6807faa..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 @@ -160,3 +160,25 @@ 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/fwmgrutil.py b/device/alibaba/x86_64-alibaba_as23-128h-cl-r0/plugins/fwmgrutil.py index 230f652cd639..58193c208c4a 100644 --- a/device/alibaba/x86_64-alibaba_as23-128h-cl-r0/plugins/fwmgrutil.py +++ b/device/alibaba/x86_64-alibaba_as23-128h-cl-r0/plugins/fwmgrutil.py @@ -101,8 +101,8 @@ def get_cpld_version(self): int(CPLD_3[2], 16), int(CPLD_3[3], 16)) CPLD_4 = 'None' if CPLD_4 is 'None' else "{}.{}".format( int(CPLD_4[2], 16), int(CPLD_4[3], 16)) - FAN_CPLD = 'None' if CPLD_4 is None else "{:.1f}".format( - float(fan_cpld)) + FAN_CPLD = 'None' if CPLD_4 is None else "{}.{}".format( + int(fan_cpld[0], 16), int(fan_cpld[1], 16)) cpld_version_dict = {} cpld_version_dict.update({'CPLD_B': CPLD_B}) @@ -224,8 +224,7 @@ def firmware_upgrade(self, fw_type, fw_path, fw_extra=None): print("Installing BMC as master mode...") json_data["flash"] = "master" r = requests.post(self.bmc_info_url, json=json_data) - return_data = r.json() - if r.status_code != 200 or 'success' not in return_data.get('result'): + if r.status_code != 200 or 'success' not in r.json().get('result'): print("Failed") return False print("Done") @@ -233,8 +232,7 @@ def firmware_upgrade(self, fw_type, fw_path, fw_extra=None): print("Installing BMC as %s mode..." % json_data["flash"]) r = requests.post(self.bmc_info_url, json=json_data) - return_data = r.json() - if r.status_code == 200 and 'success' in return_data.get('result'): + if r.status_code == 200 and 'success' in r.json().get('result'): print("Done, Rebooting BMC.....") reboot_dict = dict() reboot_dict["reboot"] = "yes" diff --git a/device/alibaba/x86_64-alibaba_as23-128h-cl-r0/plugins/sensorutil.py b/device/alibaba/x86_64-alibaba_as23-128h-cl-r0/plugins/sensorutil.py index fc437dc8c8b7..29f56e8578e6 100644 --- a/device/alibaba/x86_64-alibaba_as23-128h-cl-r0/plugins/sensorutil.py +++ b/device/alibaba/x86_64-alibaba_as23-128h-cl-r0/plugins/sensorutil.py @@ -79,7 +79,7 @@ def input_name_selector(self, sensor_name, input_name): "tmp75-i2c-7-4e": "BASEBOARD_INLET_CENTER", "tmp75-i2c-7-4d": "SWITCH_OUTLET", "tmp75-i2c-31-48": "PSU_INLET_LEFT", - "tmp75-i2c-31-49": "PSU_INLET_RIGHT", + "tmp75-i2c-31-49": "INLET_TEMP", "tmp75-i2c-39-48": "FANBOARD_LEFT", "tmp75-i2c-39-49": "FANBOARD_RIGHT", "tmp75-i2c-42-48": "LINECARD_TOP_RIGHT", 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 fbca46b9f158..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 @@ -160,3 +160,25 @@ 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 ce69bbbb9a01..706dc7d2e25a 160000 --- a/platform/broadcom/sonic-platform-modules-cel +++ b/platform/broadcom/sonic-platform-modules-cel @@ -1 +1 @@ -Subproject commit ce69bbbb9a01b6de6951656779f8066b8f129848 +Subproject commit 706dc7d2e25a10c67c59a24d7158e99c5320a5d9