summaryrefslogtreecommitdiffstats
path: root/plugins/dera
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-14 18:28:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-16 15:12:07 +0000
commit589986012c4b3ab68e299a2eadca18f90080113b (patch)
treef29a53b04a1950cdddae69344bccb3f0146fa728 /plugins/dera
parentReleasing debian version 1.16-4. (diff)
downloadnvme-cli-589986012c4b3ab68e299a2eadca18f90080113b.tar.xz
nvme-cli-589986012c4b3ab68e299a2eadca18f90080113b.zip
Merging upstream version 2.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins/dera')
-rw-r--r--plugins/dera/dera-nvme.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/plugins/dera/dera-nvme.c b/plugins/dera/dera-nvme.c
index be78930..f36fc67 100644
--- a/plugins/dera/dera-nvme.c
+++ b/plugins/dera/dera-nvme.c
@@ -10,12 +10,10 @@
#include <sys/time.h>
#include "nvme.h"
-#include "nvme-print.h"
-#include "nvme-ioctl.h"
+#include "libnvme.h"
#include "plugin.h"
-
-#include "argconfig.h"
-#include "suffix.h"
+#include "linux/types.h"
+#include "nvme-print.h"
#define CREATE_CMD
#include "dera-nvme.h"
@@ -108,7 +106,7 @@ static int nvme_dera_get_device_status(int fd, enum dera_device_status *result)
.cdw12 = 0x104,
};
- err = nvme_submit_passthru(fd, NVME_IOCTL_ADMIN_CMD, &cmd);
+ err = nvme_submit_admin_passthru(fd, &cmd, NULL);
if (!err && result) {
*result = cmd.result;
}
@@ -131,8 +129,7 @@ static int get_status(int argc, char **argv, struct command *cmd, struct plugin
if (fd < 0)
return fd;
- err = nvme_get_log(fd, 0xffffffff, 0xc0, false, NVME_NO_LOG_LSP,
- sizeof(log), &log);
+ err = nvme_get_log_simple(fd, 0xc0, sizeof(log), &log);
if (err) {
goto exit;
}
@@ -189,7 +186,7 @@ static int get_status(int argc, char **argv, struct command *cmd, struct plugin
printf("fw_loader_version : %.*s\n", 8, log.fw_loader_version);
printf("uefi_driver_version : %.*s\n", 8, log.uefi_driver_version);
- if (log.pcie_volt_status >= 0 && log.pcie_volt_status <= sizeof(volt_status) / sizeof(const char *)){
+ if (log.pcie_volt_status <= sizeof(volt_status) / sizeof(const char *)){
printf("pcie_volt_status : %s\n", volt_status[log.pcie_volt_status]);
}
else{
@@ -205,7 +202,7 @@ static int get_status(int argc, char **argv, struct command *cmd, struct plugin
exit:
if (err > 0)
- fprintf(stderr, "\nNVMe status:%s(0x%x)\n", nvme_status_to_string(err), err);
+ nvme_show_status(err);
return err;
}