summaryrefslogtreecommitdiffstats
path: root/plugins/innogrit
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-30 22:38:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-30 22:38:48 +0000
commit01c4d3d32c5044d3d17055c2d94d40fee9d130e1 (patch)
tree2c213cd5436bff644fa7023b94674a9c12d2e1af /plugins/innogrit
parentAdding upstream version 2.4+really2.4. (diff)
downloadnvme-cli-01c4d3d32c5044d3d17055c2d94d40fee9d130e1.tar.xz
nvme-cli-01c4d3d32c5044d3d17055c2d94d40fee9d130e1.zip
Adding upstream version 2.5.upstream/2.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins/innogrit')
-rw-r--r--plugins/innogrit/innogrit-nvme.c31
-rw-r--r--plugins/innogrit/typedef.h1
2 files changed, 19 insertions, 13 deletions
diff --git a/plugins/innogrit/innogrit-nvme.c b/plugins/innogrit/innogrit-nvme.c
index 1771538..cd47efa 100644
--- a/plugins/innogrit/innogrit-nvme.c
+++ b/plugins/innogrit/innogrit-nvme.c
@@ -146,11 +146,13 @@ static int nvme_vucmd(int fd, unsigned char opcode, unsigned int cdw12,
memset(&cmd, 0, sizeof(cmd));
cmd.opcode = opcode;
+ cmd.cdw2 = IGVSC_SIG;
+ cmd.cdw10 = data_len / 4;
cmd.cdw12 = cdw12;
cmd.cdw13 = cdw13;
cmd.cdw14 = cdw14;
cmd.cdw15 = cdw15;
- cmd.nsid = 0;
+ cmd.nsid = 0xffffffff;
cmd.addr = (__u64)(__u64)(uintptr_t)data;
cmd.data_len = data_len;
return nvme_submit_admin_passthru(fd, &cmd, NULL);
@@ -198,8 +200,8 @@ static int innogrit_vsc_geteventlog(int argc, char **argv,
ret = nvme_vucmd(dev_fd(dev), 0xFE, 0x82, 0x03, 0x00, 0x00, (char *)data, 4096);
if (ret == -1)
return ret;
-
- if (data[0] == 0x5A)
+
+ if (data[0] == 0x5A)
ivsctype = 1;
else
ivsctype = 0;
@@ -227,8 +229,9 @@ static int innogrit_vsc_geteventlog(int argc, char **argv,
icount++;
memset(data, 0, 4096);
- if (ivsctype == 1)
- ret = nvme_vucmd(dev_fd(dev), 0xFE, 0x60, 0x00, 0x00, 0x00,(char *)data, 4096);
+ if (ivsctype == 1)
+ ret = nvme_vucmd(dev_fd(dev), 0xFE, 0x60, 0x00, 0x00, 0x00, (char *)data,
+ 4096);
else
ret = nvme_vucmd(dev_fd(dev), NVME_VSC_GET_EVENT_LOG, 0, 0,
(SRB_SIGNATURE >> 32),
@@ -345,10 +348,10 @@ static int innogrit_vsc_getcdump(int argc, char **argv, struct command *command,
ret = nvme_vucmd(dev_fd(dev), 0xFE, 0x82, 0x03, 0x00, 0x00, (char *)data, 4096);
if (ret == -1)
return ret;
-
+
if (data[0] == 0x5A) {
ivsctype = 1;
- ret = nvme_vucmd(dev_fd(dev), 0xFE, 0x82, 0x08, 0x00, 0x00,(char *)data, 4096);
+ ret = nvme_vucmd(dev_fd(dev), 0xFE, 0x82, 0x08, 0x00, 0x00, (char *)data, 4096);
} else {
ivsctype = 0;
ret = nvme_vucmd(dev_fd(dev), NVME_VSC_GET, VSC_FN_GET_CDUMP, 0x00,
@@ -403,12 +406,13 @@ static int innogrit_vsc_getcdump(int argc, char **argv, struct command *command,
for (icur = 0; icur < itotal; icur += 4096) {
memset(data, 0, 4096);
if (busevsc) {
- if (ivsctype == 1)
- ret = nvme_vucmd(dev_fd(dev), 0xFE, 0x82, 0x08, 0x00, 0x00,(char *)data, 4096);
+ if (ivsctype == 1)
+ ret = nvme_vucmd(dev_fd(dev), 0xFE, 0x82, 0x08, 0x00, 0x00,
+ (char *)data, 4096);
else
ret = nvme_vucmd(dev_fd(dev), NVME_VSC_GET, VSC_FN_GET_CDUMP, 0x00,
(SRB_SIGNATURE >> 32), (SRB_SIGNATURE & 0xFFFFFFFF),
- (char *)data, 4096);
+ (char *)data, 4096);
} else {
ret = nvme_get_nsid_log(dev_fd(dev), true,
0x07,
@@ -429,12 +433,13 @@ static int innogrit_vsc_getcdump(int argc, char **argv, struct command *command,
if (ipackindex != ipackcount) {
memset(data, 0, 4096);
if (busevsc) {
- if (ivsctype == 1)
- ret = nvme_vucmd(dev_fd(dev), 0xFE, 0x82, 0x08, 0x00, 0x00,(char *)data, 4096);
+ if (ivsctype == 1)
+ ret = nvme_vucmd(dev_fd(dev), 0xFE, 0x82, 0x08, 0x00, 0x00,
+ (char *)data, 4096);
else
ret = nvme_vucmd(dev_fd(dev), NVME_VSC_GET, VSC_FN_GET_CDUMP, 0x00,
(SRB_SIGNATURE >> 32), (SRB_SIGNATURE & 0xFFFFFFFF),
- (char *)data, 4096);
+ (char *)data, 4096);
} else {
ret = nvme_get_nsid_log(dev_fd(dev), true,
0x07,
diff --git a/plugins/innogrit/typedef.h b/plugins/innogrit/typedef.h
index a97a008..f2a59b4 100644
--- a/plugins/innogrit/typedef.h
+++ b/plugins/innogrit/typedef.h
@@ -7,6 +7,7 @@
#define NVME_VSC_GET 0xE6
#define VSC_FN_GET_CDUMP 0x08
#define EVLOG_SIG 0x65766C67
+#define IGVSC_SIG 0x69677673
#define SRB_SIGNATURE 0x544952474F4E4E49ULL
#define XCLEAN_LINE "\033[K"