MFC r252262:

  For ATA_PASSTHROUGH commands, pretend isci(4) supports multiword DMA
  by treating it as UDMA.

  This fixes a problem introduced in r249933/r249939, where CAM sends
  ATA_DSM_TRIM to SATA devices using ATA_PASSTHROUGH_16.  scsi_ata_trim()
  sets protocol as DMA (not UDMA) which is for multi-word DMA, even
  though no such mode is selected for the device.  isci(4) would fail
  these commands which is the correct behavior but not consistent with
  other HBAs, namely LSI's.

  smh@ did some further testing on an LSI controller, which rejected
  ATA_PASSTHROUGH_16 commands with mode=UDMA_OUT, even though only
  a UDMA mode was selected on the device.  So this precludes adding
  any kind of mode detection in CAM to determine which mode to use on
  a per-device basis.

Sponsored by: Intel
MFC r252263:

  Add an open_dev() helper function to be used in the various places
  where nvmecontrol needs to open a handle to a controller or namespace
  device node.

Sponsored by: Intel
MFC r252264:

  Add separate *_usage() functions for each nvmecontrol command.

Sponsored by: Intel
MFC r252265:

  Break out code related to the devlist command into a separate source file.

Sponsored by:	Intel
MFC r252266:

  Break out code related to the identify command into a separate source file.

Sponsored by: Intel
MFC r252267:

  Break out code related to the perftest command into a separate file.

Sponsored by: Intel
MFC r252268:

  Break out code related to the reset command into a separate source file.

Sponsored by: Intel
MFC r252269:

  Add an nvme_function structure array, defining the name, C function and
  usage message for each nvmecontrol command.  This helps reduce some code
  clutter both now and for future commits which will add logpage and
  firmware support to nvmecontrol(8).

  Also move helper function prototypes to the end of the header file, after
  the per-command functions.

Also add missing static keyword that glebius@ fixed as part of r252302.

Sponsored by: Intel
MFC r252270:

  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 r252271:

  Use MAXPHYS to specify the maximum I/O size for nvme(4).

  Also allow admin commands to transfer up to this maximum I/O size, rather
  than the artificial limit previously imposed.  The larger I/O size is very
  beneficial for upcoming firmware download support.  This has the added
  benefit of simplifying the code since both admin and I/O commands now use
  the same maximum I/O size.

Sponsored by: Intel
MFC r252272:

  Fail any passthrough command whose transfer size exceeds the controller's
  max transfer size.  This guards against rogue commands coming in from
  userspace.

  Also add KASSERTS for the virtual address and unmapped bio cases, if the
  transfer size exceeds the controller's max transfer size.

Sponsored by: Intel
MFC r252273:

  Remove remaining uio-related code.

  The nvme_physio() function was removed quite a while ago, which was the
  only user of this uio-related code.

Sponsored by: Intel
MFC r252274:

  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 r252275:

  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 r252277:

  Add log page support to nvmecontrol(8) through a new logpage command.

  This includes pretty printers for all of the standard NVMe log pages
  (Error, SMART/Health, Firmware), as well as hex output for non-standard
  or vendor-specific log pages.

Also add missing static keyword that glebius@ fixed as part of r252302.

Submitted by:	Joe Golio <joseph.golio@emc.com>
Obtained from:	EMC / Isilon Storage Division
MFC r252278:

  Add firmware replacement and activation support to nvmecontrol(8) through
  a new firmware command.

  NVMe controllers may support up to 7 firmware slots for storing of
  different firmware revisions.  This new firmware command supports
  firmware replacement (i.e. firmware download) with or without immediate
  activation, or activation of a previously stored firmware image.  It
  also supports selection of the firmware slot during replacement
  operations, using IDENTIFY information from the controller to
  check that the specified slot is valid.

  Newly activated firmware does not take effect until the new controller
  reset, either via a reboot or separate 'nvmecontrol reset' command to the
  same controller.

Submitted by:	Joe Golio <joseph.golio@emc.com>
Obtained from:	EMC / Isilon Storage Division