From: Keith Busch Date: Thu, 3 Mar 2016 18:37:57 +0000 (-0700) Subject: Add nvme security specific field X-Git-Tag: v0.5~11 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=28a1789a2393b176d940ffd2d028bf26cfba6432;p=users%2Fsagi%2Fnvme-cli.git Add nvme security specific field Signed-off-by: Keith Busch --- diff --git a/Documentation/nvme-security-recv.1 b/Documentation/nvme-security-recv.1 index 1355bd59..f08ad635 100644 --- a/Documentation/nvme-security-recv.1 +++ b/Documentation/nvme-security-recv.1 @@ -35,6 +35,7 @@ nvme-security-recv \- Security Recv command \fInvme security\-recv\fR [] [\-\-size= | \-x ] [\-\-secp= | \-p ] [\-\-spsp= | \-s ] + [\-\-nssf= | \-N ] [\-\-tl= | \-t ] [\-\-namespace\-id= | \-n ] [\-b | \-\-raw\-binary] @@ -53,6 +54,11 @@ Each Security Receive command returns the appropriate data corresponding to a Se Target a specific namespace for this security command\&. .RE .PP +\-N , \-\-nssf= +.RS 4 +NVMe Security Specific field\&. If using security protocol EAh assigned for NVMe use, the NVMe security specific field indicates which reply memory buffer target\&. +.RE +.PP \-x , \-\-size= .RS 4 Size of buffer to allocate\&. One success it will be printed to STDOUT\&. diff --git a/Documentation/nvme-security-recv.html b/Documentation/nvme-security-recv.html index 5f681294..6794e151 100644 --- a/Documentation/nvme-security-recv.html +++ b/Documentation/nvme-security-recv.html @@ -755,6 +755,7 @@ nvme-security-recv(1) Manual Page
nvme security-recv [<device>] [--size=<size> | -x <size>]
                     [--secp=<security-protocol> | -p <security-protocol>]
                     [--spsp=<protocol-specific> | -s <protocol-specific>]
+                    [--nssf=<nvme-specific> | -N <nvme-specific>]
                     [--tl=<transfer-length> | -t <transfer-length>]
                     [--namespace-id=<nsid> | -n <nsid>]
                     [-b | --raw-binary]
@@ -795,6 +796,19 @@ controller reset occurs.

+-N <nssf> +
+
+--nssf=<nssf> +
+
+

+ NVMe Security Specific field. If using security protocol EAh + assigned for NVMe use, the NVMe security specific field indicates + which reply memory buffer target. +

+
+
-x <size>
@@ -874,7 +888,7 @@ controller reset occurs.


diff --git a/Documentation/nvme-security-recv.txt b/Documentation/nvme-security-recv.txt index f58872c4..56f876a0 100644 --- a/Documentation/nvme-security-recv.txt +++ b/Documentation/nvme-security-recv.txt @@ -11,6 +11,7 @@ SYNOPSIS 'nvme security-recv' [] [--size= | -x ] [--secp= | -p ] [--spsp= | -s ] + [--nssf= | -N ] [--tl= | -t ] [--namespace-id= | -n ] [-b | --raw-binary] @@ -38,6 +39,12 @@ OPTIONS --namespace-id=:: Target a specific namespace for this security command. +-N :: +--nssf=:: + NVMe Security Specific field. If using security protocol EAh + assigned for NVMe use, the NVMe security specific field indicates + which reply memory buffer target. + -x :: --size=:: Size of buffer to allocate. One success it will be printed diff --git a/Documentation/nvme-security-send.1 b/Documentation/nvme-security-send.1 index 2a968dd1..b97cb220 100644 --- a/Documentation/nvme-security-send.1 +++ b/Documentation/nvme-security-send.1 @@ -36,6 +36,7 @@ nvme-security-send \- Security Send command [\-\-secp= | \-p ] [\-\-spsp= | \-s ] [\-\-tl= | \-t ] + [\-\-nssf= | \-N ] [\-\-namespace\-id= | \-n ] .fi .SH "DESCRIPTION" @@ -50,6 +51,11 @@ The association between a Security Send command and subsequent Security Receive Target a specific namespace for this security command\&. .RE .PP +\-N , \-\-nssf= +.RS 4 +NVMe Security Specific field\&. If using security protocol EAh assigned for NVMe use, the NVMe security specific field indicates which reply memory buffer target\&. +.RE +.PP \-f , \-\-file= .RS 4 Path to file used as the security protocol\(cqs payload\&. Required argument\&. diff --git a/Documentation/nvme-security-send.html b/Documentation/nvme-security-send.html index fef597a0..064a7ac3 100644 --- a/Documentation/nvme-security-send.html +++ b/Documentation/nvme-security-send.html @@ -756,6 +756,7 @@ nvme-security-send(1) Manual Page [--secp=<security-protocol> | -p <security-protocol>] [--spsp=<protocol-specific> | -s <protocol-specific>] [--tl=<transfer-length> | -t <transfer-length>] + [--nssf=<nvme-specific> | -N <nvme-specific>] [--namespace-id=<nsid> | -n <nsid>]
@@ -792,6 +793,19 @@ Receive command is Security Protocol field dependent as defined in SPC-4.

+-N <nssf> +
+
+--nssf=<nssf> +
+
+

+ NVMe Security Specific field. If using security protocol EAh + assigned for NVMe use, the NVMe security specific field indicates + which reply memory buffer target. +

+
+
-f <file>
@@ -860,7 +874,7 @@ Receive command is Security Protocol field dependent as defined in SPC-4.


diff --git a/Documentation/nvme-security-send.txt b/Documentation/nvme-security-send.txt index 6e3f832a..183bc8e1 100644 --- a/Documentation/nvme-security-send.txt +++ b/Documentation/nvme-security-send.txt @@ -12,6 +12,7 @@ SYNOPSIS [--secp= | -p ] [--spsp= | -s ] [--tl= | -t ] + [--nssf= | -N ] [--namespace-id= | -n ] DESCRIPTION @@ -34,6 +35,12 @@ OPTIONS --namespace-id=:: Target a specific namespace for this security command. +-N :: +--nssf=:: + NVMe Security Specific field. If using security protocol EAh + assigned for NVMe use, the NVMe security specific field indicates + which reply memory buffer target. + -f :: --file=:: Path to file used as the security protocol's payload. Required diff --git a/nvme.c b/nvme.c index 04b6d31b..dddc5662 100644 --- a/nvme.c +++ b/nvme.c @@ -1485,6 +1485,7 @@ static int sec_send(int argc, char **argv) const char *spsp = "security-protocol-specific (cf. SPC-4)"; const char *tl = "transfer length (cf. SPC-4)"; const char *namespace_id = "desired namespace"; + const char *nssf = "NVMe Security Specific Field"; int err, sec_fd = -1; void *sec_buf; unsigned int sec_size; @@ -1493,6 +1494,7 @@ static int sec_send(int argc, char **argv) struct config { __u32 namespace_id; char *file; + __u8 nssf; __u8 secp; __u16 spsp; __u32 tl; @@ -1508,6 +1510,7 @@ static int sec_send(int argc, char **argv) const struct argconfig_commandline_options command_line_options[] = { {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id, required_argument, namespace_id}, {"file", 'f', "FILE", CFG_STRING, &cfg.file, required_argument, file}, + {"nssf", 'N', "NUM", CFG_BYTE, &cfg.nssf, required_argument, nssf}, {"secp", 'p', "NUM", CFG_BYTE, &cfg.secp, required_argument, secp}, {"spsp", 's', "NUM", CFG_SHORT, &cfg.spsp, required_argument, spsp}, {"tl", 't', "NUM", CFG_POSITIVE, &cfg.tl, required_argument, tl}, @@ -1536,10 +1539,8 @@ static int sec_send(int argc, char **argv) return ENOMEM; } - err = nvme_sec_send(fd, - cfg.namespace_id, - 0 /* FIXME: add nssf */, - cfg.spsp, cfg.secp, cfg.tl, sec_size, sec_buf, &result); + err = nvme_sec_send(fd, cfg.namespace_id, cfg.nssf, cfg.spsp, cfg.secp, + cfg.tl, sec_size, sec_buf, &result); if (err < 0) return errno; else if (err != 0) @@ -2328,6 +2329,7 @@ static int sec_recv(int argc, char **argv) const char *al = "allocation length (cf. SPC-4)"; const char *raw_binary = "dump output in binary format"; const char *namespace_id = "desired namespace"; + const char *nssf = "NVMe Security Specific Field"; int err; void *sec_buf = NULL; __u32 result; @@ -2336,6 +2338,7 @@ static int sec_recv(int argc, char **argv) __u32 namespace_id; __u32 size; __u8 secp; + __u8 nssf; __u16 spsp; __u32 al; __u8 raw_binary; @@ -2351,6 +2354,7 @@ static int sec_recv(int argc, char **argv) const struct argconfig_commandline_options command_line_options[] = { {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id, required_argument, namespace_id}, {"size", 'x', "NUM", CFG_POSITIVE, &cfg.size, required_argument, size}, + {"nssf", 'N', "NUM", CFG_BYTE, &cfg.nssf, required_argument, nssf}, {"secp", 'p', "NUM", CFG_BYTE, &cfg.secp, required_argument, secp}, {"spsp", 's', "NUM", CFG_SHORT, &cfg.spsp, required_argument, spsp}, {"al", 't', "NUM", CFG_POSITIVE, &cfg.al, required_argument, al}, @@ -2371,10 +2375,8 @@ static int sec_recv(int argc, char **argv) } } - err = nvme_sec_recv(fd, - cfg.namespace_id, - 0 /* FIXME: nssf */, - cfg.spsp, cfg.secp, cfg.al, cfg.size, sec_buf, &result); + err = nvme_sec_recv(fd, cfg.namespace_id, cfg.nssf, cfg.spsp, + cfg.secp, cfg.al, cfg.size, sec_buf, &result); if (err < 0) return errno; else if (err != 0)