@@ -392,6 +392,7 @@ static int smart_inject(struct ndctl_dimm *dimm)
int rc = -EOPNOTSUPP;
send_inject_val(media_temperature)
+ send_inject_val(ctrl_temperature)
send_inject_val(spares)
send_inject_bool(fatal)
send_inject_bool(unsafe_shutdown)
@@ -375,4 +375,5 @@ global:
ndctl_dimm_get_flags;
ndctl_dimm_get_event_flags;
ndctl_dimm_is_flag_supported;
+ ndctl_cmd_smart_inject_ctrl_temperature;
} LIBNDCTL_16;
@@ -308,6 +308,7 @@ struct ndctl_dimm_ops {
int (*smart_threshold_set_spares)(struct ndctl_cmd *, unsigned int);
struct ndctl_cmd *(*new_smart_inject)(struct ndctl_dimm *);
int (*smart_inject_media_temperature)(struct ndctl_cmd *, bool, unsigned int);
+ int (*smart_inject_ctrl_temperature)(struct ndctl_cmd *, bool, unsigned int);
int (*smart_inject_spares)(struct ndctl_cmd *, bool, unsigned int);
int (*smart_inject_fatal)(struct ndctl_cmd *, bool);
int (*smart_inject_unsafe_shutdown)(struct ndctl_cmd *, bool);
@@ -146,6 +146,7 @@ NDCTL_EXPORT int ndctl_cmd_##op(struct ndctl_cmd *cmd, bool enable, unsigned int
}
smart_cmd_inject_val(smart_inject_media_temperature)
+smart_cmd_inject_val(smart_inject_ctrl_temperature)
smart_cmd_inject_val(smart_inject_spares)
#define smart_cmd_inject(op) \
@@ -285,6 +285,8 @@ int ndctl_cmd_smart_threshold_set_spares(struct ndctl_cmd *cmd,
struct ndctl_cmd *ndctl_dimm_cmd_new_smart_inject(struct ndctl_dimm *dimm);
int ndctl_cmd_smart_inject_media_temperature(struct ndctl_cmd *cmd, bool enable,
unsigned int mtemp);
+int ndctl_cmd_smart_inject_ctrl_temperature(struct ndctl_cmd *cmd, bool enable,
+ unsigned int ctemp);
int ndctl_cmd_smart_inject_spares(struct ndctl_cmd *cmd, bool enable,
unsigned int spares);
int ndctl_cmd_smart_inject_fatal(struct ndctl_cmd *cmd, bool enable);
This patch is used to add an interface to inject controller temperature. The ndctl should be supportive of injecting all possible fields. Although currently controller temperature injection is not supported by NVDIMMs, this interface can return a failure report to users. Signed-off-by: QI Fuli <qi.fuli@jp.fujitsu.com> --- ndctl/inject-smart.c | 1 + ndctl/lib/libndctl.sym | 1 + ndctl/lib/private.h | 1 + ndctl/lib/smart.c | 1 + ndctl/libndctl.h | 2 ++ 5 files changed, 6 insertions(+)