From 38b7d302955b4e56010051676bcd0443a636028b Mon Sep 17 00:00:00 2001 From: brandonchuang Date: Fri, 24 Jan 2020 04:20:20 +0800 Subject: [PATCH] [device] as7326-56x: Fix the default low power mode on issue (#4047) Signed-off-by: brandon_chuang --- .../x86_64-accton_as7326_56x-r0/plugins/sfputil.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/device/accton/x86_64-accton_as7326_56x-r0/plugins/sfputil.py b/device/accton/x86_64-accton_as7326_56x-r0/plugins/sfputil.py index 0292e2d52e..b88536ecfe 100644 --- a/device/accton/x86_64-accton_as7326_56x-r0/plugins/sfputil.py +++ b/device/accton/x86_64-accton_as7326_56x-r0/plugins/sfputil.py @@ -175,12 +175,13 @@ class SfpUtil(SfpUtilBase): eeprom.seek(93) lpmode = ord(eeprom.read(1)) - if ((lpmode & 0x3) == 0x1): - return False # High Power Mode if "Power override" bit is 1 and "Power set" bit is 0 + if ((lpmode & 0x3) == 0x3): + return True # Low Power Mode if "Power override" bit is 1 and "Power set" bit is 1 else: - return True # Low Power Mode if one of the following conditions is matched: - # 1. Power override" bit is 0 - # 2. Power override" bit is 1 and "Power set" bit is 1 + return False # High Power Mode if one of the following conditions is matched: + # 1. "Power override" bit is 0 + # 2. "Power override" bit is 1 and "Power set" bit is 0 + except IOError as e: print "Error: unable to open file: %s" % str(e) return False