]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Add nvme security specific field
authorKeith Busch <keith.busch@intel.com>
Thu, 3 Mar 2016 18:37:57 +0000 (11:37 -0700)
committerKeith Busch <keith.busch@intel.com>
Fri, 4 Mar 2016 22:35:46 +0000 (15:35 -0700)
Signed-off-by: Keith Busch <keith.busch@intel.com>
Documentation/nvme-security-recv.1
Documentation/nvme-security-recv.html
Documentation/nvme-security-recv.txt
Documentation/nvme-security-send.1
Documentation/nvme-security-send.html
Documentation/nvme-security-send.txt
nvme.c

index 1355bd59d805b75f86e089931788881d86ca9324..f08ad6353c07b2d7f7f860773a61b9a43ae2193d 100644 (file)
@@ -35,6 +35,7 @@ nvme-security-recv \- Security Recv command
 \fInvme security\-recv\fR [<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]
@@ -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>, \-\-nssf=<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>, \-\-size=<size>
 .RS 4
 Size of buffer to allocate\&. One success it will be printed to STDOUT\&.
index 5f681294730e89c652b053e98cbb1930247cc7c0..6794e1517e1f7b71fb3bc955a37dfb49f0d760bf 100644 (file)
@@ -755,6 +755,7 @@ nvme-security-recv(1) Manual Page
 <pre class="content"><em>nvme security-recv</em> [&lt;device&gt;] [--size=&lt;size&gt; | -x &lt;size&gt;]\r
                     [--secp=&lt;security-protocol&gt; | -p &lt;security-protocol&gt;]\r
                     [--spsp=&lt;protocol-specific&gt; | -s &lt;protocol-specific&gt;]\r
+                    [--nssf=&lt;nvme-specific&gt; | -N &lt;nvme-specific&gt;]\r
                     [--tl=&lt;transfer-length&gt; | -t &lt;transfer-length&gt;]\r
                     [--namespace-id=&lt;nsid&gt; | -n &lt;nsid&gt;]\r
                     [-b | --raw-binary]</pre>\r
@@ -795,6 +796,19 @@ controller reset occurs.</p></div>
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
+-N &lt;nssf&gt;\r
+</dt>\r
+<dt class="hdlist1">\r
+--nssf=&lt;nssf&gt;\r
+</dt>\r
+<dd>\r
+<p>\r
+        NVMe Security Specific field. If using security protocol EAh\r
+        assigned for NVMe use, the NVMe security specific field indicates\r
+        which reply memory buffer target.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
 -x &lt;size&gt;\r
 </dt>\r
 <dt class="hdlist1">\r
@@ -874,7 +888,7 @@ controller reset occurs.</p></div>
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Last updated 2016-03-03 11:13:26 MST\r
+Last updated 2016-03-03 11:36:23 MST\r
 </div>\r
 </div>\r
 </body>\r
index f58872c4578a646e14459223dff95a5c1fbfb2cc..56f876a09bcdef530b9476e3ecc784548a974a14 100644 (file)
@@ -11,6 +11,7 @@ SYNOPSIS
 '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]
@@ -38,6 +39,12 @@ OPTIONS
 --namespace-id=<nsid>::
        Target a specific namespace for this security command.
 
+-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>::
 --size=<size>::
        Size of buffer to allocate. One success it will be printed
index 2a968dd179e32c737282a62c9375fcd19b1214ba..b97cb220f15bf16ab62de91ae294e8fcf311c427 100644 (file)
@@ -36,6 +36,7 @@ nvme-security-send \- Security Send command
                     [\-\-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>]
 .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>, \-\-nssf=<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>, \-\-file=<file>
 .RS 4
 Path to file used as the security protocol\(cqs payload\&. Required argument\&.
index fef597a06f5cb1a0cc3cc2c608994a924658a6c2..064a7ac398adc47e51604e8755d57db7c11c0cb8 100644 (file)
@@ -756,6 +756,7 @@ nvme-security-send(1) Manual Page
                     [--secp=&lt;security-protocol&gt; | -p &lt;security-protocol&gt;]\r
                     [--spsp=&lt;protocol-specific&gt; | -s &lt;protocol-specific&gt;]\r
                     [--tl=&lt;transfer-length&gt; | -t &lt;transfer-length&gt;]\r
+                    [--nssf=&lt;nvme-specific&gt; | -N &lt;nvme-specific&gt;]\r
                     [--namespace-id=&lt;nsid&gt; | -n &lt;nsid&gt;]</pre>\r
 <div class="attribution">\r
 </div></div>\r
@@ -792,6 +793,19 @@ Receive command is Security Protocol field dependent as defined in SPC-4.</p></d
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
+-N &lt;nssf&gt;\r
+</dt>\r
+<dt class="hdlist1">\r
+--nssf=&lt;nssf&gt;\r
+</dt>\r
+<dd>\r
+<p>\r
+        NVMe Security Specific field. If using security protocol EAh\r
+        assigned for NVMe use, the NVMe security specific field indicates\r
+        which reply memory buffer target.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
 -f &lt;file&gt;\r
 </dt>\r
 <dt class="hdlist1">\r
@@ -860,7 +874,7 @@ Receive command is Security Protocol field dependent as defined in SPC-4.</p></d
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Last updated 2016-03-03 11:13:55 MST\r
+Last updated 2016-03-03 11:36:48 MST\r
 </div>\r
 </div>\r
 </body>\r
index 6e3f832a0007486fc1aa74b56255ea9d216dc5a5..183bc8e1ed29cc89fd42edcc96464823d248dfeb 100644 (file)
@@ -12,6 +12,7 @@ SYNOPSIS
                    [--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>]
 
 DESCRIPTION
@@ -34,6 +35,12 @@ OPTIONS
 --namespace-id=<nsid>::
        Target a specific namespace for this security command.
 
+-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>::
 --file=<file>::
        Path to file used as the security protocol's payload. Required
diff --git a/nvme.c b/nvme.c
index 04b6d31be005bb8fd85d4a4322fd05266f79df40..dddc5662f707b039d3e8285e2807c6dc5380a74e 100644 (file)
--- 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)