File tree 5 files changed +40
-17
lines changed
x86_64-mlnx_msn2010-r0/plugins
x86_64-mlnx_msn2100-r0/plugins
x86_64-mlnx_msn2410-r0/plugins
x86_64-mlnx_msn2700-r0/plugins
x86_64-mlnx_msn2740-r0/plugins
5 files changed +40
-17
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,14 @@ class PsuUtil(PsuBase):
20
20
21
21
def __init__ (self ):
22
22
PsuBase .__init__ (self )
23
-
24
- self .psu_path = "/bsp/module/"
25
- self .psu_presence = "psu{}_pwr_status"
26
- self .psu_oper_status = "psu{}_pwr_status"
23
+ self .psu_path = ""
24
+ for index in range (0 , 100 ):
25
+ hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/" .format (index )
26
+ if os .path .exists (hwmon_path ):
27
+ self .psu_path = hwmon_path
28
+ break
29
+ self .psu_presence = "pwr{}"
30
+ self .psu_oper_status = "pwr{}"
27
31
28
32
def get_num_psus (self ):
29
33
"""
Original file line number Diff line number Diff line change @@ -21,9 +21,14 @@ class PsuUtil(PsuBase):
21
21
def __init__ (self ):
22
22
PsuBase .__init__ (self )
23
23
24
- self .psu_path = "/bsp/module/"
25
- self .psu_presence = "psu{}_status"
26
- self .psu_oper_status = "psu{}_pwr_status"
24
+ self .psu_path = ""
25
+ for index in range (0 , 100 ):
26
+ hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/" .format (index )
27
+ if os .path .exists (hwmon_path ):
28
+ self .psu_path = hwmon_path
29
+ break
30
+ self .psu_presence = "pwr{}"
31
+ self .psu_oper_status = "pwr{}"
27
32
28
33
def get_num_psus (self ):
29
34
"""
Original file line number Diff line number Diff line change @@ -21,9 +21,14 @@ class PsuUtil(PsuBase):
21
21
def __init__ (self ):
22
22
PsuBase .__init__ (self )
23
23
24
- self .psu_path = "/bsp/module/"
25
- self .psu_presence = "psu{}_status"
26
- self .psu_oper_status = "psu{}_pwr_status"
24
+ self .psu_path = ""
25
+ for index in range (0 , 100 ):
26
+ hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/" .format (index )
27
+ if os .path .exists (hwmon_path ):
28
+ self .psu_path = hwmon_path
29
+ break
30
+ self .psu_presence = "psu{}"
31
+ self .psu_oper_status = "pwr{}"
27
32
28
33
def get_num_psus (self ):
29
34
"""
Original file line number Diff line number Diff line change @@ -21,9 +21,14 @@ class PsuUtil(PsuBase):
21
21
def __init__ (self ):
22
22
PsuBase .__init__ (self )
23
23
24
- self .psu_path = "/bsp/module/"
25
- self .psu_presence = "psu{}_status"
26
- self .psu_oper_status = "psu{}_pwr_status"
24
+ self .psu_path = ""
25
+ for index in range (0 , 100 ):
26
+ hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/" .format (index )
27
+ if os .path .exists (hwmon_path ):
28
+ self .psu_path = hwmon_path
29
+ break
30
+ self .psu_presence = "psu{}"
31
+ self .psu_oper_status = "pwr{}"
27
32
28
33
def get_num_psus (self ):
29
34
"""
Original file line number Diff line number Diff line change @@ -20,10 +20,14 @@ class PsuUtil(PsuBase):
20
20
21
21
def __init__ (self ):
22
22
PsuBase .__init__ (self )
23
-
24
- self .psu_path = "/bsp/module/"
25
- self .psu_presence = "psu{}_status"
26
- self .psu_oper_status = "psu{}_pwr_status"
23
+ self .psu_path = ""
24
+ for index in range (0 , 100 ):
25
+ hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/" .format (index )
26
+ if os .path .exists (hwmon_path ):
27
+ self .psu_path = hwmon_path
28
+ break
29
+ self .psu_presence = "psu{}"
30
+ self .psu_oper_status = "pwr{}"
27
31
28
32
def get_num_psus (self ):
29
33
"""
You can’t perform that action at this time.
0 commit comments