.sp
.nf
\fInvme list\-ctrl\fR <device> [\-\-cntid=<cntid> | \-c <cntid>]
+ [\-\-namespace\-id=<nsid> | \-n <nsid>]
+DESCRIPTION
.fi
-.SH "DESCRIPTION"
.sp
-For the NVMe device given, sends an identify command for controller list and provides the result and returned structure\&.
-.sp
-The <device> parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1)\&. The starting controller in the list always begins with 0 unless the \*(Aq\-\-cntid\*(Aq option is given to override\&.
-.sp
-On success, the controller array is printed for each index and controller identifier\&.
-.SH "OPTIONS"
+.nf
+For the NVMe device given, sends an identify command for controller list
+and provides the result and returned structure\&. This uses either mode
+12h or 13h depending on the requested namespace identifer\&.
+
+The <device> parameter is mandatory and may be either the NVMe character
+device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1)\&.
+The starting controller in the list always begins with 0 unless the
+`\*(Aq\-\-cntid\*(Aq` option is given to override\&.
+
+On success, the controller array is printed for each index and controller
+identifier\&.
+
+OPTIONS
+.fi
.PP
\-c <cntid>, \-\-cntid=<cntid>
.RS 4
Retrieve the identify list structure starting with the given controller id\&.
.RE
+.PP
+\-n <nsid>, \-\-namespace\-id=<nsid>
+.RS 4
+If provided, will request the controllers attached to the specified namespace\&. If no namespace is given, or set to 0, the command requests the controller list for the entire subsystem, whether or not they are attached to namesapce(s)\&.
+.RE
.SH "EXAMPLES"
.sp
No examples yet\&.
<h2 id="_synopsis">SYNOPSIS</h2>\r
<div class="sectionbody">\r
<div class="verseblock">\r
-<pre class="content"><em>nvme list-ctrl</em> <device> [--cntid=<cntid> | -c <cntid>]</pre>\r
+<pre class="content"><em>nvme list-ctrl</em> <device> [--cntid=<cntid> | -c <cntid>]\r
+ [--namespace-id=<nsid> | -n <nsid>]\r
+DESCRIPTION</pre>\r
<div class="attribution">\r
</div></div>\r
-</div>\r
-</div>\r
-<div class="sect1">\r
-<h2 id="_description">DESCRIPTION</h2>\r
-<div class="sectionbody">\r
-<div class="paragraph"><p>For the NVMe device given, sends an identify command for controller list\r
-and provides the result and returned structure.</p></div>\r
-<div class="paragraph"><p>The <device> parameter is mandatory and may be either the NVMe character\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>For the NVMe device given, sends an identify command for controller list\r
+and provides the result and returned structure. This uses either mode\r
+12h or 13h depending on the requested namespace identifer.\r
+\r
+The <device> parameter is mandatory and may be either the NVMe character\r
device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).\r
The starting controller in the list always begins with 0 unless the\r
-<tt>'--cntid'</tt> option is given to override.</p></div>\r
-<div class="paragraph"><p>On success, the controller array is printed for each index and controller\r
-identifier.</p></div>\r
-</div>\r
-</div>\r
-<div class="sect1">\r
-<h2 id="_options">OPTIONS</h2>\r
-<div class="sectionbody">\r
+`'--cntid'` option is given to override.\r
+\r
+On success, the controller array is printed for each index and controller\r
+identifier.\r
+\r
+OPTIONS</tt></pre>\r
+</div></div>\r
<div class="dlist"><dl>\r
<dt class="hdlist1">\r
-c <cntid>\r
Retrieve the identify list structure starting with the given controller id.\r
</p>\r
</dd>\r
+<dt class="hdlist1">\r
+-n <nsid>\r
+</dt>\r
+<dt class="hdlist1">\r
+--namespace-id=<nsid>\r
+</dt>\r
+<dd>\r
+<p>\r
+ If provided, will request the controllers attached to the\r
+ specified namespace. If no namespace is given, or set to 0, the\r
+ command requests the controller list for the entire subsystem,\r
+ whether or not they are attached to namesapce(s).\r
+</p>\r
+</dd>\r
</dl></div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 2015-06-08 11:09:39 MDT\r
+Last updated 2015-06-08 16:59:37 MDT\r
</div>\r
</div>\r
</body>\r
--------
[verse]
'nvme list-ctrl' <device> [--cntid=<cntid> | -c <cntid>]
-
+ [--namespace-id=<nsid> | -n <nsid>]
DESCRIPTION
-----------
For the NVMe device given, sends an identify command for controller list
-and provides the result and returned structure.
+and provides the result and returned structure. This uses either mode
+12h or 13h depending on the requested namespace identifer.
The <device> parameter is mandatory and may be either the NVMe character
device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).
--cntid=<cntid>::
Retrieve the identify list structure starting with the given controller id.
+-n <nsid>::
+--namespace-id=<nsid>::
+ If provided, will request the controllers attached to the
+ specified namespace. If no namespace is given, or set to 0, the
+ command requests the controller list for the entire subsystem,
+ whether or not they are attached to namesapce(s).
+
EXAMPLES
--------
No examples yet.
struct config {
__u16 cntid;
+ __u32 namespace_id;
};
struct config cfg;
const struct argconfig_commandline_options command_line_options[] = {
{"cntid", "NUM", CFG_POSITIVE, &defaults.cntid, required_argument, NULL},
{"c", "NUM", CFG_POSITIVE, &defaults.cntid, required_argument, NULL},
+ {"namespace-id", "NUM", CFG_POSITIVE, &defaults.namespace_id, required_argument, NULL},
+ {"n", "NUM", CFG_POSITIVE, &defaults.namespace_id, required_argument, NULL},
{0}
};
argconfig_parse(argc, argv, "list_ctrl", command_line_options,
if (posix_memalign((void *)&cntlist, getpagesize(), 0x1000))
return ENOMEM;
- err = identify(0, cntlist, cfg.cntid << 16 | 0x13);
+ err = identify(cfg.namespace_id, cntlist,
+ cfg.cntid << 16 | cfg.namespace_id ? 0x12 : 0x13);
if (!err) {
for (i = 0; i < (min(cntlist->num, 2048)); i++)
printf("[%4u]:%#x\n", i, cntlist->identifier[i]);