Provide simulated SMART data to enable the ndctl implementation of SMART data retrieval and parsing. The payload is defined here, "Section 4.1 SMART and Health Info (Function Index 1)": http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf
Showing the changes to include/uapi (1 of 3 files). Show all
Unified · Split
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 2 | − * Copyright (c) 2014-2015, Intel Corporation. | |
| 2 | + * Copyright (c) 2014-2016, Intel Corporation. | |
| 3 | 3 | * |
| 4 | 4 | * This program is free software; you can redistribute it and/or modify it |
| 5 | 5 | * under the terms and conditions of the GNU Lesser General Public License, |
| @@ -20,11 +20,45 @@ struct nd_cmd_smart { · 14 unmodified lines | ||
| 20 | 20 | __u8 data[128]; |
| 21 | 21 | } __packed; |
| 22 | 22 | |
| 23 | +#define ND_SMART_HEALTH_VALID (1 << 0) | |
| 24 | +#define ND_SMART_TEMP_VALID (1 << 1) | |
| 25 | +#define ND_SMART_SPARES_VALID (1 << 2) | |
| 26 | +#define ND_SMART_ALARM_VALID (1 << 3) | |
| 27 | +#define ND_SMART_USED_VALID (1 << 4) | |
| 28 | +#define ND_SMART_SHUTDOWN_VALID (1 << 5) | |
| 29 | +#define ND_SMART_VENDOR_VALID (1 << 6) | |
| 30 | +#define ND_SMART_TEMP_TRIP (1 << 0) | |
| 31 | +#define ND_SMART_SPARE_TRIP (1 << 1) | |
| 32 | +#define ND_SMART_NON_CRITICAL_HEALTH (1 << 0) | |
| 33 | +#define ND_SMART_CRITICAL_HEALTH (1 << 1) | |
| 34 | +#define ND_SMART_FATAL_HEALTH (1 << 2) | |
| 35 | + | |
| 36 | +struct nd_smart_payload { | |
| 37 | + __u32 flags; | |
| 38 | + __u8 reserved0[4]; | |
| 39 | + __u8 health; | |
| 40 | + __u16 temperature; | |
| 41 | + __u8 spares; | |
| 42 | + __u8 alarm_flags; | |
| 43 | + __u8 life_used; | |
| 44 | + __u8 shutdown_state; | |
| 45 | + __u8 reserved1; | |
| 46 | + __u32 vendor_size; | |
| 47 | + __u8 vendor_data[108]; | |
| 48 | +} __packed; | |
| 49 | + | |
| 23 | 50 | struct nd_cmd_smart_threshold { |
| 24 | 51 | __u32 status; |
| 25 | 52 | __u8 data[8]; |
| 26 | 53 | } __packed; |
| 27 | 54 | |
| 55 | +struct nd_smart_threshold_payload { | |
| 56 | + __u16 alarm_control; | |
| 57 | + __u16 temperature; | |
| 58 | + __u8 spares; | |
| 59 | + __u8 reserved[3]; | |
| 60 | +} __packed; | |
| 61 | + | |
| 28 | 62 | struct nd_cmd_dimm_flags { |
| 29 | 63 | __u32 status; |
| 30 | 64 | __u32 flags; |