@@ -134,7 +134,7 @@ static unsigned int hpe1_cmd_smart_get_health(struct ndctl_cmd *cmd)
return health;
}
-static unsigned int hpe1_cmd_smart_get_temperature(struct ndctl_cmd *cmd)
+static unsigned int hpe1_cmd_smart_get_media_temperature(struct ndctl_cmd *cmd)
{
if (hpe1_smart_valid(cmd) < 0)
return UINT_MAX;
@@ -279,7 +279,8 @@ static unsigned int hpe1_cmd_smart_threshold_get_alarm_control(struct ndctl_cmd
return flags;
}
-static unsigned int hpe1_cmd_smart_threshold_get_temperature(struct ndctl_cmd *cmd)
+static unsigned int hpe1_cmd_smart_threshold_get_media_temperature(
+ struct ndctl_cmd *cmd)
{
if (hpe1_smart_threshold_valid(cmd) < 0)
return UINT_MAX;
@@ -299,7 +300,7 @@ struct ndctl_smart_ops * const hpe1_smart_ops = &(struct ndctl_smart_ops) {
.new_smart = hpe1_dimm_cmd_new_smart,
.smart_get_flags = hpe1_cmd_smart_get_flags,
.smart_get_health = hpe1_cmd_smart_get_health,
- .smart_get_temperature = hpe1_cmd_smart_get_temperature,
+ .smart_get_media_temperature = hpe1_cmd_smart_get_media_temperature,
.smart_get_spares = hpe1_cmd_smart_get_spares,
.smart_get_alarm_flags = hpe1_cmd_smart_get_alarm_flags,
.smart_get_life_used = hpe1_cmd_smart_get_life_used,
@@ -308,6 +309,7 @@ struct ndctl_smart_ops * const hpe1_smart_ops = &(struct ndctl_smart_ops) {
.smart_get_vendor_data = hpe1_cmd_smart_get_vendor_data,
.new_smart_threshold = hpe1_dimm_cmd_new_smart_threshold,
.smart_threshold_get_alarm_control = hpe1_cmd_smart_threshold_get_alarm_control,
- .smart_threshold_get_temperature = hpe1_cmd_smart_threshold_get_temperature,
+ .smart_threshold_get_media_temperature =
+ hpe1_cmd_smart_threshold_get_media_temperature,
.smart_threshold_get_spares = hpe1_cmd_smart_threshold_get_spares,
};
@@ -310,4 +310,6 @@ global:
ndctl_namespace_injection_get_next_bb;
ndctl_bb_get_block;
ndctl_bb_get_count;
+ ndctl_cmd_smart_get_media_temperature;
+ ndctl_cmd_smart_threshold_get_media_temperature;
} LIBNDCTL_13;
@@ -120,7 +120,7 @@ static unsigned int msft_cmd_smart_get_health(struct ndctl_cmd *cmd)
return health;
}
-static unsigned int msft_cmd_smart_get_temperature(struct ndctl_cmd *cmd)
+static unsigned int msft_cmd_smart_get_media_temperature(struct ndctl_cmd *cmd)
{
if (msft_smart_valid(cmd) < 0)
return UINT_MAX;
@@ -140,6 +140,6 @@ struct ndctl_smart_ops * const msft_smart_ops = &(struct ndctl_smart_ops) {
.new_smart = msft_dimm_cmd_new_smart,
.smart_get_flags = msft_cmd_smart_get_flags,
.smart_get_health = msft_cmd_smart_get_health,
- .smart_get_temperature = msft_cmd_smart_get_temperature,
+ .smart_get_media_temperature = msft_cmd_smart_get_media_temperature,
.smart_get_life_used = msft_cmd_smart_get_life_used,
};
@@ -288,7 +288,7 @@ struct ndctl_smart_ops {
struct ndctl_cmd *(*new_smart)(struct ndctl_dimm *);
unsigned int (*smart_get_flags)(struct ndctl_cmd *);
unsigned int (*smart_get_health)(struct ndctl_cmd *);
- unsigned int (*smart_get_temperature)(struct ndctl_cmd *);
+ unsigned int (*smart_get_media_temperature)(struct ndctl_cmd *);
unsigned int (*smart_get_spares)(struct ndctl_cmd *);
unsigned int (*smart_get_alarm_flags)(struct ndctl_cmd *);
unsigned int (*smart_get_life_used)(struct ndctl_cmd *);
@@ -298,7 +298,7 @@ struct ndctl_smart_ops {
unsigned char *(*smart_get_vendor_data)(struct ndctl_cmd *);
struct ndctl_cmd *(*new_smart_threshold)(struct ndctl_dimm *);
unsigned int (*smart_threshold_get_alarm_control)(struct ndctl_cmd *);
- unsigned int (*smart_threshold_get_temperature)(struct ndctl_cmd *);
+ unsigned int (*smart_threshold_get_media_temperature)(struct ndctl_cmd *);
unsigned int (*smart_threshold_get_spares)(struct ndctl_cmd *);
};
@@ -53,7 +53,8 @@ NDCTL_EXPORT rettype name(struct ndctl_cmd *cmd) \
smart_cmd_op(ndctl_cmd_smart_get_flags, smart_get_flags, unsigned int, 0)
smart_cmd_op(ndctl_cmd_smart_get_health, smart_get_health, unsigned int, 0)
-smart_cmd_op(ndctl_cmd_smart_get_temperature, smart_get_temperature, unsigned int, 0)
+smart_cmd_op(ndctl_cmd_smart_get_media_temperature, smart_get_media_temperature,
+ unsigned int, 0)
smart_cmd_op(ndctl_cmd_smart_get_spares, smart_get_spares, unsigned int, 0)
smart_cmd_op(ndctl_cmd_smart_get_alarm_flags, smart_get_alarm_flags, unsigned int, 0)
smart_cmd_op(ndctl_cmd_smart_get_life_used, smart_get_life_used, unsigned int, 0)
@@ -62,9 +63,21 @@ smart_cmd_op(ndctl_cmd_smart_get_shutdown_count, smart_get_shutdown_count, unsig
smart_cmd_op(ndctl_cmd_smart_get_vendor_size, smart_get_vendor_size, unsigned int, 0)
smart_cmd_op(ndctl_cmd_smart_get_vendor_data, smart_get_vendor_data, unsigned char *, NULL)
smart_cmd_op(ndctl_cmd_smart_threshold_get_alarm_control, smart_threshold_get_alarm_control, unsigned int, 0)
-smart_cmd_op(ndctl_cmd_smart_threshold_get_temperature, smart_threshold_get_temperature, unsigned int, 0)
+smart_cmd_op(ndctl_cmd_smart_threshold_get_media_temperature,
+ smart_threshold_get_media_temperature, unsigned int, 0)
smart_cmd_op(ndctl_cmd_smart_threshold_get_spares, smart_threshold_get_spares, unsigned int, 0)
+NDCTL_EXPORT unsigned int ndctl_cmd_smart_get_temperature(struct ndctl_cmd *cmd)
+{
+ return ndctl_cmd_smart_get_media_temperature(cmd);
+}
+
+NDCTL_EXPORT unsigned int ndctl_cmd_smart_threshold_get_temperature(
+ struct ndctl_cmd *cmd)
+{
+ return ndctl_cmd_smart_threshold_get_media_temperature(cmd);
+}
+
/*
* The following intel_dimm_*() and intel_smart_*() functions implement
* the ndctl_smart_ops for the Intel DSM family (NVDIMM_FAMILY_INTEL):
@@ -126,6 +139,12 @@ intel_smart_get_field(cmd, shutdown_state)
intel_smart_get_field(cmd, shutdown_count)
intel_smart_get_field(cmd, vendor_size)
+static unsigned int intel_cmd_smart_get_media_temperature(
+ struct ndctl_cmd *cmd)
+{
+ return intel_cmd_smart_get_temperature(cmd);
+}
+
static unsigned char *intel_cmd_smart_get_vendor_data(struct ndctl_cmd *cmd)
{
struct nd_smart_payload *smart_data;
@@ -159,6 +178,12 @@ intel_smart_threshold_get_field(cmd, alarm_control)
intel_smart_threshold_get_field(cmd, temperature)
intel_smart_threshold_get_field(cmd, spares)
+static unsigned int intel_cmd_smart_threshold_get_media_temperature(
+ struct ndctl_cmd *cmd)
+{
+ return intel_cmd_smart_threshold_get_temperature(cmd);
+}
+
static struct ndctl_cmd *intel_dimm_cmd_new_smart_threshold(
struct ndctl_dimm *dimm)
{
@@ -193,7 +218,7 @@ struct ndctl_smart_ops * const intel_smart_ops = &(struct ndctl_smart_ops) {
.new_smart = intel_dimm_cmd_new_smart,
.smart_get_flags = intel_cmd_smart_get_flags,
.smart_get_health = intel_cmd_smart_get_health,
- .smart_get_temperature = intel_cmd_smart_get_temperature,
+ .smart_get_media_temperature = intel_cmd_smart_get_media_temperature,
.smart_get_spares = intel_cmd_smart_get_spares,
.smart_get_alarm_flags = intel_cmd_smart_get_alarm_flags,
.smart_get_life_used = intel_cmd_smart_get_life_used,
@@ -203,6 +228,7 @@ struct ndctl_smart_ops * const intel_smart_ops = &(struct ndctl_smart_ops) {
.smart_get_vendor_data = intel_cmd_smart_get_vendor_data,
.new_smart_threshold = intel_dimm_cmd_new_smart_threshold,
.smart_threshold_get_alarm_control = intel_cmd_smart_threshold_get_alarm_control,
- .smart_threshold_get_temperature = intel_cmd_smart_threshold_get_temperature,
+ .smart_threshold_get_media_temperature
+ = intel_cmd_smart_threshold_get_media_temperature,
.smart_threshold_get_spares = intel_cmd_smart_threshold_get_spares,
};
@@ -275,12 +275,18 @@ static inline unsigned long long ndctl_cmd_clear_error_get_cleared(
}
#endif
+/*
+ * Note: ndctl_cmd_smart_get_temperature is an alias for
+ * ndctl_cmd_smart_get_temperature
+ */
+
#define HAS_SMART HAVE_NDCTL_SMART
#if HAS_SMART == 1
struct ndctl_cmd *ndctl_dimm_cmd_new_smart(struct ndctl_dimm *dimm);
unsigned int ndctl_cmd_smart_get_flags(struct ndctl_cmd *cmd);
unsigned int ndctl_cmd_smart_get_health(struct ndctl_cmd *cmd);
unsigned int ndctl_cmd_smart_get_temperature(struct ndctl_cmd *cmd);
+unsigned int ndctl_cmd_smart_get_media_temperature(struct ndctl_cmd *cmd);
unsigned int ndctl_cmd_smart_get_spares(struct ndctl_cmd *cmd);
unsigned int ndctl_cmd_smart_get_alarm_flags(struct ndctl_cmd *cmd);
unsigned int ndctl_cmd_smart_get_life_used(struct ndctl_cmd *cmd);
@@ -291,6 +297,7 @@ unsigned char *ndctl_cmd_smart_get_vendor_data(struct ndctl_cmd *cmd);
struct ndctl_cmd *ndctl_dimm_cmd_new_smart_threshold(struct ndctl_dimm *dimm);
unsigned int ndctl_cmd_smart_threshold_get_alarm_control(struct ndctl_cmd *cmd);
unsigned int ndctl_cmd_smart_threshold_get_temperature(struct ndctl_cmd *cmd);
+unsigned int ndctl_cmd_smart_threshold_get_media_temperature(struct ndctl_cmd *cmd);
unsigned int ndctl_cmd_smart_threshold_get_spares(struct ndctl_cmd *cmd);
#else
static inline struct ndctl_cmd *ndctl_dimm_cmd_new_smart(struct ndctl_dimm *dimm)
@@ -309,6 +316,11 @@ static inline unsigned int ndctl_cmd_smart_get_temperature(struct ndctl_cmd *cmd
{
return 0;
}
+static inline unsigned int ndctl_cmd_smart_get_media_temperature(
+ struct ndctl_cmd *cmd)
+{
+ return 0;
+}
static inline unsigned int ndctl_cmd_smart_get_spares(struct ndctl_cmd *cmd)
{
return 0;
@@ -352,6 +364,11 @@ static inline unsigned int ndctl_cmd_smart_threshold_get_temperature(
{
return 0;
}
+static inline unsigned int ndctl_cmd_smart_threshold_get_media_temperature(
+ struct ndctl_cmd *cmd)
+{
+ return 0;
+}
static inline unsigned int ndctl_cmd_smart_threshold_get_spares(
struct ndctl_cmd *cmd)
{
In preparation for adding controller temperature support rename the current ambiguous 'temperature' to 'media_temperature'. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- ndctl/lib/hpe1.c | 10 ++++++---- ndctl/lib/libndctl.sym | 2 ++ ndctl/lib/msft.c | 4 ++-- ndctl/lib/private.h | 4 ++-- ndctl/lib/smart.c | 34 ++++++++++++++++++++++++++++++---- ndctl/libndctl.h.in | 17 +++++++++++++++++ 6 files changed, 59 insertions(+), 12 deletions(-)