register_extension(&intel_nvme);
}
+static void intel_id_ctrl(__u8 *vs)
+{
+ char bl[9];
+ char health[21];
+
+ memcpy(bl, &vs[28], sizeof(bl));
+ memcpy(health, &vs[4], sizeof(health));
+
+ bl[sizeof(bl) - 1] = '\0';
+ health[sizeof(health) - 1] = '\0';
+
+ printf("ss : %d\n", vs[3]);
+ printf("health : %s\n", health[0] ? health : "healthy");
+ printf("bl : %s\n", bl);
+}
+
+static int id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *plugin)
+{
+ return __id_ctrl(argc, argv, cmd, plugin, intel_id_ctrl);
+}
+
static int get_additional_smart_log(int argc, char **argv, struct command *cmd, struct plugin *plugin)
{
struct nvme_additional_smart_log smart_log;
#include "cmd.h"
COMMAND_LIST(
+ ENTRY("id-ctrl", "Send NVMe Identify Controller", id_ctrl)
ENTRY("smart-log-add", "Retrieve Intel SMART Log, show it", get_additional_smart_log)
);
}
#endif
-static int id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *plugin)
+int __id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *plugin, void (*vs)(__u8 *vs))
{
const char *desc = "Send an Identify Controller command to "\
"the given device and report information about the specified "\
json_nvme_id_ctrl(&ctrl, flags);
else {
printf("NVME Identify Controller:\n");
- show_nvme_id_ctrl(&ctrl, flags);
+ __show_nvme_id_ctrl(&ctrl, flags, vs);
}
}
else if (err > 0)
return err;
}
+static int id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *plugin)
+{
+ return __id_ctrl(argc, argv, cmd, plugin, NULL);
+}
+
static int id_ns(int argc, char **argv, struct command *cmd, struct plugin *plugin)
{
const char *desc = "Send an Identify Namespace command to the "\
extern const char *devicename;
+int __id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *plugin, void (*vs)(__u8 *vs));
+
#endif /* _NVME_H */