powerpc/papr_scm: Add support for fetching nvdimm 'fuel-gauge' metric
[linux-2.6-microblaze.git] / arch / powerpc / include / uapi / asm / papr_pdsm.h
index 9ccecc1..50ef95e 100644 (file)
 #define PAPR_PDSM_DIMM_CRITICAL      2
 #define PAPR_PDSM_DIMM_FATAL         3
 
+/* struct nd_papr_pdsm_health.extension_flags field flags */
+
+/* Indicate that the 'dimm_fuel_gauge' field is valid */
+#define PDSM_DIMM_HEALTH_RUN_GAUGE_VALID 1
+
 /*
  * Struct exchanged between kernel & ndctl in for PAPR_PDSM_HEALTH
  * Various flags indicate the health status of the dimm.
@@ -84,6 +89,7 @@
  * dimm_locked         : Contents of the dimm cant be modified until CEC reboot
  * dimm_encrypted      : Contents of dimm are encrypted.
  * dimm_health         : Dimm health indicator. One of PAPR_PDSM_DIMM_XXXX
+ * dimm_fuel_gauge     : Life remaining of DIMM as a percentage from 0-100
  */
 struct nd_papr_pdsm_health {
        union {
@@ -96,6 +102,9 @@ struct nd_papr_pdsm_health {
                        __u8 dimm_locked;
                        __u8 dimm_encrypted;
                        __u16 dimm_health;
+
+                       /* Extension flag PDSM_DIMM_HEALTH_RUN_GAUGE_VALID */
+                       __u16 dimm_fuel_gauge;
                };
                __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
        };