Commit Graph

8 Commits

Author SHA1 Message Date
Jim Harris
08c29873bf Ensure controller or namespace node name is specified before trying to
access it.

While here, also fix the identify usage message to show the -v and -x
parameters.

Sponsored by:	Intel
MFC after:	3 days
2013-07-09 21:33:12 +00:00
Jim Harris
9c0871b260 Condense the output for displaying LBA formats.
Sponsored by:	Intel
MFC after:	3 days
2013-07-09 21:31:58 +00:00
Jim Harris
2528d6a326 Send per-namespace logpage commands to the controller devnode, so they
are processed as admin commands, not I/O commands.

As part of this change, pull out the code for parsing a namespace node
string into a separate function, since it is used for both identify and
logpage commands.

Sponsored by:	Intel
MFC after:	3 days
2013-07-09 21:31:21 +00:00
Jim Harris
821ef73ca6 Incorporate feedback from bde@ based on r252672 changes:
* Use 0/1 instead of sysexits.  Man pages are confusing on this topic,
  but 0/1 is sufficient for nvmecontrol.
* Use err function family where possible instead of fprintf/exit.
* Fix some typing errors.
* Clean up some error message inconsistencies.

Sponsored by:	Intel
Submitted by:	bde (parts of firmware.c changes)
MFC after:	3 days
2013-07-09 21:14:15 +00:00
Jim Harris
e83c9e35a7 Add generalized helper functions for printing hex data as part of
nvmecontrol commands.

Submitted by:	Joe Golio <joseph.golio@emc.com>
Obtained from:	EMC / Isilon Storage Division
MFC after:	3 days
2013-06-26 23:46:31 +00:00
Jim Harris
d2cdb28b6f Ensure that a device node is specified when invoking the identify or reset
commands.

Also improve the checking of device node names, so that better error
messages are displayed when incorrect names are specified.

Sponsored by:	Intel
MFC after:	3 days
2013-06-26 23:41:07 +00:00
Jim Harris
6420873cd6 Create #defines for NVME_CTRLR_PREFIX and NVME_NS_PREFIX for the "nvme"
and "ns" strings, rather than hardcoding the string values throughout the
nvmecontrol code base.

Sponsored by:	Intel
MFC after:	3 days
2013-06-26 23:20:08 +00:00
Jim Harris
6f0823e45d Break out code related to the identify command into a separate source file.
Sponsored by:	Intel
MFC after:	3 days
2013-06-26 23:00:42 +00:00