Print this page
NEX-17006 backport mpt_sas tri-mode parts support change
9044 Need support for mpt_sas tri-mode parts
9045 Clean up mpt_sas compiler warnings
9046 mptsas_handle_topo_change can return without its locks held
9047 workaround SAS3408 firmware issue
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com>
Reviewed by: Albert Lee <trisk@forkgnu.org>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Approved by: Richard Lowe <richlowe@richlowe.net>
NEX-1888 import latest mpi2 headers from LSIs FreeBSD driver

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/scsi/adapters/mpt_sas/mpi/mpi2.h
          +++ new/usr/src/uts/common/sys/scsi/adapters/mpt_sas/mpi/mpi2.h
   1    1  /*-
   2      - * Copyright (c) 2013 LSI Corp.
        2 + * Copyright (c) 2012-2015 LSI Corp.
        3 + * Copyright (c) 2013-2016 Avago Technologies
   3    4   * All rights reserved.
   4    5   *
   5    6   * Redistribution and use in source and binary forms, with or without
   6    7   * modification, are permitted provided that the following conditions
   7    8   * are met:
   8    9   * 1. Redistributions of source code must retain the above copyright
   9   10   *    notice, this list of conditions and the following disclaimer.
  10   11   * 2. Redistributions in binary form must reproduce the above copyright
  11   12   *    notice, this list of conditions and the following disclaimer in the
  12   13   *    documentation and/or other materials provided with the distribution.
↓ open down ↓ 8 lines elided ↑ open up ↑
  21   22   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22   23   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23   24   * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24   25   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25   26   * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26   27   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27   28   * SUCH DAMAGE.
  28   29   */
  29   30  
  30   31  /*
  31      - *  Copyright (c) 2000-2013 LSI Corporation.
       32 + *  Copyright (c) 2000-2015 LSI Corporation.
       33 + *  Copyright (c) 2013-2016 Avago Technologies
       34 + *  All rights reserved.
  32   35   *
  33   36   *
  34   37   *           Name:  mpi2.h
  35   38   *          Title:  MPI Message independent structures and definitions
  36   39   *                  including System Interface Register Set and
  37   40   *                  scatter/gather formats.
  38   41   *  Creation Date:  June 21, 2006
  39   42   *
  40      - *  mpi2.h Version:  02.00.33
       43 + *  mpi2.h Version:  02.00.46
  41   44   *
  42   45   *  NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
  43   46   *        prefix are for use only on MPI v2.5 products, and must not be used
  44   47   *        with MPI v2.0 products. Unless otherwise noted, names beginning with
  45   48   *        MPI2 or Mpi2 are for use with both MPI v2.0 and MPI v2.5 products.
  46   49   *
  47   50   *  Version History
  48   51   *  ---------------
  49   52   *
  50   53   *  Date      Version   Description
↓ open down ↓ 61 lines elided ↑ open up ↑
 112  115   *                      Added Hard Reset delay timings.
 113  116   *  07-10-12  02.00.26  Bumped MPI2_HEADER_VERSION_UNIT.
 114  117   *  07-26-12  02.00.27  Bumped MPI2_HEADER_VERSION_UNIT.
 115  118   *  11-27-12  02.00.28  Bumped MPI2_HEADER_VERSION_UNIT.
 116  119   *  12-20-12  02.00.29  Bumped MPI2_HEADER_VERSION_UNIT.
 117  120   *                      Added MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET.
 118  121   *  04-09-13  02.00.30  Bumped MPI2_HEADER_VERSION_UNIT.
 119  122   *  04-17-13  02.00.31  Bumped MPI2_HEADER_VERSION_UNIT.
 120  123   *  08-19-13  02.00.32  Bumped MPI2_HEADER_VERSION_UNIT.
 121  124   *  12-05-13  02.00.33  Bumped MPI2_HEADER_VERSION_UNIT.
      125 + *  01-08-14  02.00.34  Bumped MPI2_HEADER_VERSION_UNIT.
      126 + *  06-13-14  02.00.35  Bumped MPI2_HEADER_VERSION_UNIT.
      127 + *  11-18-14  02.00.36  Updated copyright information.
      128 + *                      Bumped MPI2_HEADER_VERSION_UNIT.
      129 + *  03-16-15  02.00.37  Updated for MPI v2.6.
      130 + *                      Bumped MPI2_HEADER_VERSION_UNIT.
      131 + *                      Added Scratchpad registers and
      132 + *                      AtomicRequestDescriptorPost register to
      133 + *                      MPI2_SYSTEM_INTERFACE_REGS.
      134 + *                      Added MPI2_DIAG_SBR_RELOAD.
      135 + *                      Added MPI2_IOCSTATUS_INSUFFICIENT_POWER.
      136 + *  03-19-15  02.00.38  Bumped MPI2_HEADER_VERSION_UNIT.
      137 + *  05-25-15  02.00.39  Bumped MPI2_HEADER_VERSION_UNIT
      138 + *  08-25-15  02.00.40  Bumped MPI2_HEADER_VERSION_UNIT.
      139 + *                      Added V7 HostDiagnostic register defines
      140 + *  12-15-15  02.00.41  Bumped MPI_HEADER_VERSION_UNIT
      141 + *  01-01-16  02.00.42  Bumped MPI_HEADER_VERSION_UNIT
      142 + *  04-05-16  02.00.43  Modified  MPI26_DIAG_BOOT_DEVICE_SELECT defines
      143 + *                      to be unique within first 32 characters.
      144 + *                      Removed AHCI support.
      145 + *                      Removed SOP support.
      146 + *                      Bumped MPI2_HEADER_VERSION_UNIT.
      147 + *  04-10-16  02.00.44  Bumped MPI2_HEADER_VERSION_UNIT.
      148 + *  07-06-16  02.00.45  Bumped MPI2_HEADER_VERSION_UNIT.
      149 + *  09-02-16  02.00.46  Bumped MPI2_HEADER_VERSION_UNIT.
 122  150   *  --------------------------------------------------------------------------
 123  151   */
 124  152  
 125  153  #ifndef MPI2_H
 126  154  #define MPI2_H
 127  155  
 128  156  
 129  157  /*****************************************************************************
 130  158  *
 131  159  *        MPI Version Definitions
↓ open down ↓ 15 lines elided ↑ open up ↑
 147  175  #define MPI2_VERSION_02_00                  (0x0200)
 148  176  
 149  177  
 150  178  /* minor version for MPI v2.5 compatible products */
 151  179  #define MPI25_VERSION_MINOR                 (0x05)
 152  180  #define MPI25_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) |   \
 153  181                                        MPI25_VERSION_MINOR)
 154  182  #define MPI2_VERSION_02_05                  (0x0205)
 155  183  
 156  184  
      185 +/* minor version for MPI v2.6 compatible products */
      186 +#define MPI26_VERSION_MINOR                 (0x06)
      187 +#define MPI26_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) |   \
      188 +                                      MPI26_VERSION_MINOR)
      189 +#define MPI2_VERSION_02_06                  (0x0206)
      190 +
      191 +
 157  192  /* Unit and Dev versioning for this MPI header set */
 158      -#define MPI2_HEADER_VERSION_UNIT            (0x21)
      193 +#define MPI2_HEADER_VERSION_UNIT            (0x2E)
 159  194  #define MPI2_HEADER_VERSION_DEV             (0x00)
 160  195  #define MPI2_HEADER_VERSION_UNIT_MASK       (0xFF00)
 161  196  #define MPI2_HEADER_VERSION_UNIT_SHIFT      (8)
 162  197  #define MPI2_HEADER_VERSION_DEV_MASK        (0x00FF)
 163  198  #define MPI2_HEADER_VERSION_DEV_SHIFT       (0)
 164  199  #define MPI2_HEADER_VERSION ((MPI2_HEADER_VERSION_UNIT << 8) | MPI2_HEADER_VERSION_DEV)
 165  200  
 166  201  
 167  202  /*****************************************************************************
 168  203  *
↓ open down ↓ 35 lines elided ↑ open up ↑
 204  239      U32         DCRData;                    /* 0x38 */
 205  240      U32         DCRAddress;                 /* 0x3C */
 206  241      U32         Reserved3[2];               /* 0x40 */
 207  242      U32         ReplyFreeHostIndex;         /* 0x48 */
 208  243      U32         Reserved4[8];               /* 0x4C */
 209  244      U32         ReplyPostHostIndex;         /* 0x6C */
 210  245      U32         Reserved5;                  /* 0x70 */
 211  246      U32         HCBSize;                    /* 0x74 */
 212  247      U32         HCBAddressLow;              /* 0x78 */
 213  248      U32         HCBAddressHigh;             /* 0x7C */
 214      -    U32         Reserved6[16];              /* 0x80 */
      249 +    U32         Reserved6[12];              /* 0x80 */
      250 +    U32         Scratchpad[4];              /* 0xB0 */
 215  251      U32         RequestDescriptorPostLow;   /* 0xC0 */
 216  252      U32         RequestDescriptorPostHigh;  /* 0xC4 */
 217      -    U32         Reserved7[14];              /* 0xC8 */
      253 +    U32         AtomicRequestDescriptorPost;/* 0xC8 */ /* MPI v2.6 and later; reserved in earlier versions */
      254 +    U32         Reserved7[13];              /* 0xCC */
 218  255  } MPI2_SYSTEM_INTERFACE_REGS, MPI2_POINTER PTR_MPI2_SYSTEM_INTERFACE_REGS,
 219  256    Mpi2SystemInterfaceRegs_t, MPI2_POINTER pMpi2SystemInterfaceRegs_t;
 220  257  
 221  258  /*
 222  259   * Defines for working with the Doorbell register.
 223  260   */
 224  261  #define MPI2_DOORBELL_OFFSET                    (0x00000000)
 225  262  
 226  263  /* IOC --> System values */
 227  264  #define MPI2_DOORBELL_USED                      (0x08000000)
↓ open down ↓ 20 lines elided ↑ open up ↑
 248  285  #define MPI2_WRSEQ_3RD_KEY_VALUE                (0xB)
 249  286  #define MPI2_WRSEQ_4TH_KEY_VALUE                (0x2)
 250  287  #define MPI2_WRSEQ_5TH_KEY_VALUE                (0x7)
 251  288  #define MPI2_WRSEQ_6TH_KEY_VALUE                (0xD)
 252  289  
 253  290  /*
 254  291   * Defines for the HostDiagnostic register
 255  292   */
 256  293  #define MPI2_HOST_DIAGNOSTIC_OFFSET             (0x00000008)
 257  294  
      295 +#define MPI2_DIAG_SBR_RELOAD                    (0x00002000)
      296 +
 258  297  #define MPI2_DIAG_BOOT_DEVICE_SELECT_MASK       (0x00001800)
 259  298  #define MPI2_DIAG_BOOT_DEVICE_SELECT_DEFAULT    (0x00000000)
 260  299  #define MPI2_DIAG_BOOT_DEVICE_SELECT_HCDW       (0x00000800)
 261  300  
      301 +/* Defines for V7A/V7R HostDiagnostic Register */
      302 +#define MPI26_DIAG_BOOT_DEVICE_SEL_64FLASH      (0x00000000)
      303 +#define MPI26_DIAG_BOOT_DEVICE_SEL_64HCDW       (0x00000800)
      304 +#define MPI26_DIAG_BOOT_DEVICE_SEL_32FLASH      (0x00001000)
      305 +#define MPI26_DIAG_BOOT_DEVICE_SEL_32HCDW       (0x00001800)
      306 +
 262  307  #define MPI2_DIAG_CLEAR_FLASH_BAD_SIG           (0x00000400)
 263  308  #define MPI2_DIAG_FORCE_HCB_ON_RESET            (0x00000200)
 264  309  #define MPI2_DIAG_HCB_MODE                      (0x00000100)
 265  310  #define MPI2_DIAG_DIAG_WRITE_ENABLE             (0x00000080)
 266  311  #define MPI2_DIAG_FLASH_BAD_SIG                 (0x00000040)
 267  312  #define MPI2_DIAG_RESET_HISTORY                 (0x00000020)
 268  313  #define MPI2_DIAG_DIAG_RW_ENABLE                (0x00000010)
 269  314  #define MPI2_DIAG_RESET_ADAPTER                 (0x00000004)
 270  315  #define MPI2_DIAG_HOLD_IOC_RESET                (0x00000002)
 271  316  
↓ open down ↓ 50 lines elided ↑ open up ↑
 322  367   * Defines for the HCBSize and address
 323  368   */
 324  369  #define MPI2_HCB_SIZE_OFFSET                    (0x00000074)
 325  370  #define MPI2_HCB_SIZE_SIZE_MASK                 (0xFFFFF000)
 326  371  #define MPI2_HCB_SIZE_HCB_ENABLE                (0x00000001)
 327  372  
 328  373  #define MPI2_HCB_ADDRESS_LOW_OFFSET             (0x00000078)
 329  374  #define MPI2_HCB_ADDRESS_HIGH_OFFSET            (0x0000007C)
 330  375  
 331  376  /*
 332      - * Offsets for the Request Queue
      377 + * Offsets for the Scratchpad registers
 333  378   */
      379 +#define MPI26_SCRATCHPAD0_OFFSET                (0x000000B0)
      380 +#define MPI26_SCRATCHPAD1_OFFSET                (0x000000B4)
      381 +#define MPI26_SCRATCHPAD2_OFFSET                (0x000000B8)
      382 +#define MPI26_SCRATCHPAD3_OFFSET                (0x000000BC)
      383 +
      384 +/*
      385 + * Offsets for the Request Descriptor Post Queue
      386 + */
 334  387  #define MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET     (0x000000C0)
 335  388  #define MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET    (0x000000C4)
      389 +#define MPI26_ATOMIC_REQUEST_DESCRIPTOR_POST_OFFSET (0x000000C8)
 336  390  
 337  391  
 338  392  /* Hard Reset delay timings */
 339  393  #define MPI2_HARD_RESET_PCIE_FIRST_READ_DELAY_MICRO_SEC     (50000)
 340  394  #define MPI2_HARD_RESET_PCIE_RESET_READ_WINDOW_MICRO_SEC    (255000)
 341  395  #define MPI2_HARD_RESET_PCIE_SECOND_READ_DELAY_MICRO_SEC    (256000)
 342  396  
 343  397  /*****************************************************************************
 344  398  *
 345  399  *        Message Descriptors
↓ open down ↓ 8 lines elided ↑ open up ↑
 354  408      U8              RequestFlags;               /* 0x00 */
 355  409      U8              MSIxIndex;                  /* 0x01 */
 356  410      U16             SMID;                       /* 0x02 */
 357  411      U16             LMID;                       /* 0x04 */
 358  412      U16             DescriptorTypeDependent;    /* 0x06 */
 359  413  } MPI2_DEFAULT_REQUEST_DESCRIPTOR,
 360  414    MPI2_POINTER PTR_MPI2_DEFAULT_REQUEST_DESCRIPTOR,
 361  415    Mpi2DefaultRequestDescriptor_t, MPI2_POINTER pMpi2DefaultRequestDescriptor_t;
 362  416  
 363  417  /* defines for the RequestFlags field */
 364      -#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_MASK               (0x0E)
      418 +#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_MASK               (0x1E)
      419 +#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_RSHIFT             (1)    /* use carefully; values below are pre-shifted left */
 365  420  #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO                 (0x00)
 366  421  #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_TARGET             (0x02)
 367  422  #define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY           (0x06)
 368  423  #define MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE            (0x08)
 369  424  #define MPI2_REQ_DESCRIPT_FLAGS_RAID_ACCELERATOR        (0x0A)
 370  425  #define MPI25_REQ_DESCRIPT_FLAGS_FAST_PATH_SCSI_IO      (0x0C)
      426 +#define MPI26_REQ_DESCRIPT_FLAGS_PCIE_ENCAPSULATED      (0x10)
 371  427  
 372  428  #define MPI2_REQ_DESCRIPT_FLAGS_IOC_FIFO_MARKER (0x01)
 373  429  
 374  430  
 375  431  /* High Priority Request Descriptor */
 376  432  typedef struct _MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR
 377  433  {
 378  434      U8              RequestFlags;               /* 0x00 */
 379  435      U8              MSIxIndex;                  /* 0x01 */
 380  436      U16             SMID;                       /* 0x02 */
↓ open down ↓ 47 lines elided ↑ open up ↑
 428  484  
 429  485  
 430  486  /* Fast Path SCSI IO Request Descriptor */
 431  487  typedef MPI2_SCSI_IO_REQUEST_DESCRIPTOR
 432  488      MPI25_FP_SCSI_IO_REQUEST_DESCRIPTOR,
 433  489      MPI2_POINTER PTR_MPI25_FP_SCSI_IO_REQUEST_DESCRIPTOR,
 434  490      Mpi25FastPathSCSIIORequestDescriptor_t,
 435  491      MPI2_POINTER pMpi25FastPathSCSIIORequestDescriptor_t;
 436  492  
 437  493  
      494 +/* PCIe Encapsulated Request Descriptor */
      495 +typedef MPI2_SCSI_IO_REQUEST_DESCRIPTOR
      496 +    MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR,
      497 +    MPI2_POINTER PTR_MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR,
      498 +    Mpi26PCIeEncapsulatedRequestDescriptor_t,
      499 +    MPI2_POINTER pMpi26PCIeEncapsulatedRequestDescriptor_t;
      500 +
      501 +
 438  502  /* union of Request Descriptors */
 439  503  typedef union _MPI2_REQUEST_DESCRIPTOR_UNION
 440  504  {
 441  505      MPI2_DEFAULT_REQUEST_DESCRIPTOR             Default;
 442  506      MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR       HighPriority;
 443  507      MPI2_SCSI_IO_REQUEST_DESCRIPTOR             SCSIIO;
 444  508      MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR         SCSITarget;
 445  509      MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR          RAIDAccelerator;
 446  510      MPI25_FP_SCSI_IO_REQUEST_DESCRIPTOR         FastPathSCSIIO;
      511 +    MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR  PCIeEncapsulated;
 447  512      U64                                         Words;
 448  513  } MPI2_REQUEST_DESCRIPTOR_UNION, MPI2_POINTER PTR_MPI2_REQUEST_DESCRIPTOR_UNION,
 449  514    Mpi2RequestDescriptorUnion_t, MPI2_POINTER pMpi2RequestDescriptorUnion_t;
 450  515  
 451  516  
      517 +/* Atomic Request Descriptors */
      518 +
      519 +/*
      520 + * All Atomic Request Descriptors have the same format, so the following
      521 + * structure is used for all Atomic Request Descriptors:
      522 + *      Atomic Default Request Descriptor
      523 + *      Atomic High Priority Request Descriptor
      524 + *      Atomic SCSI IO Request Descriptor
      525 + *      Atomic SCSI Target Request Descriptor
      526 + *      Atomic RAID Accelerator Request Descriptor
      527 + *      Atomic Fast Path SCSI IO Request Descriptor
      528 + *      Atomic PCIe Encapsulated Request Descriptor
      529 + */
      530 +
      531 +/* Atomic Request Descriptor */
      532 +typedef struct _MPI26_ATOMIC_REQUEST_DESCRIPTOR
      533 +{
      534 +    U8              RequestFlags;               /* 0x00 */
      535 +    U8              MSIxIndex;                  /* 0x01 */
      536 +    U16             SMID;                       /* 0x02 */
      537 +} MPI26_ATOMIC_REQUEST_DESCRIPTOR,
      538 +  MPI2_POINTER PTR_MPI26_ATOMIC_REQUEST_DESCRIPTOR,
      539 +  Mpi26AtomicRequestDescriptor_t, MPI2_POINTER pMpi26AtomicRequestDescriptor_t;
      540 +
      541 +/* for the RequestFlags field, use the same defines as MPI2_DEFAULT_REQUEST_DESCRIPTOR */
      542 +
      543 +
 452  544  /* Reply Descriptors */
 453  545  
 454  546  /* Default Reply Descriptor */
 455  547  typedef struct _MPI2_DEFAULT_REPLY_DESCRIPTOR
 456  548  {
 457  549      U8              ReplyFlags;                 /* 0x00 */
 458  550      U8              MSIxIndex;                  /* 0x01 */
 459  551      U16             DescriptorTypeDependent1;   /* 0x02 */
 460  552      U32             DescriptorTypeDependent2;   /* 0x04 */
 461  553  } MPI2_DEFAULT_REPLY_DESCRIPTOR, MPI2_POINTER PTR_MPI2_DEFAULT_REPLY_DESCRIPTOR,
 462  554    Mpi2DefaultReplyDescriptor_t, MPI2_POINTER pMpi2DefaultReplyDescriptor_t;
 463  555  
 464  556  /* defines for the ReplyFlags field */
 465  557  #define MPI2_RPY_DESCRIPT_FLAGS_TYPE_MASK                   (0x0F)
 466  558  #define MPI2_RPY_DESCRIPT_FLAGS_SCSI_IO_SUCCESS             (0x00)
 467  559  #define MPI2_RPY_DESCRIPT_FLAGS_ADDRESS_REPLY               (0x01)
 468  560  #define MPI2_RPY_DESCRIPT_FLAGS_TARGETASSIST_SUCCESS        (0x02)
 469  561  #define MPI2_RPY_DESCRIPT_FLAGS_TARGET_COMMAND_BUFFER       (0x03)
 470  562  #define MPI2_RPY_DESCRIPT_FLAGS_RAID_ACCELERATOR_SUCCESS    (0x05)
 471  563  #define MPI25_RPY_DESCRIPT_FLAGS_FAST_PATH_SCSI_IO_SUCCESS  (0x06)
      564 +#define MPI26_RPY_DESCRIPT_FLAGS_PCIE_ENCAPSULATED_SUCCESS  (0x08)
 472  565  #define MPI2_RPY_DESCRIPT_FLAGS_UNUSED                      (0x0F)
 473  566  
 474  567  /* values for marking a reply descriptor as unused */
 475  568  #define MPI2_RPY_DESCRIPT_UNUSED_WORD0_MARK             (0xFFFFFFFF)
 476  569  #define MPI2_RPY_DESCRIPT_UNUSED_WORD1_MARK             (0xFFFFFFFF)
 477  570  
 478  571  /* Address Reply Descriptor */
 479  572  typedef struct _MPI2_ADDRESS_REPLY_DESCRIPTOR
 480  573  {
 481  574      U8              ReplyFlags;                 /* 0x00 */
↓ open down ↓ 67 lines elided ↑ open up ↑
 549  642  
 550  643  
 551  644  /* Fast Path SCSI IO Success Reply Descriptor */
 552  645  typedef MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR
 553  646      MPI25_FP_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR,
 554  647      MPI2_POINTER PTR_MPI25_FP_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR,
 555  648      Mpi25FastPathSCSIIOSuccessReplyDescriptor_t,
 556  649      MPI2_POINTER pMpi25FastPathSCSIIOSuccessReplyDescriptor_t;
 557  650  
 558  651  
      652 +/* PCIe Encapsulated Success Reply Descriptor */
      653 +typedef MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR
      654 +    MPI26_PCIE_ENCAPSULATED_SUCCESS_REPLY_DESCRIPTOR,
      655 +    MPI2_POINTER PTR_MPI26_PCIE_ENCAPSULATED_SUCCESS_REPLY_DESCRIPTOR,
      656 +    Mpi26PCIeEncapsulatedSuccessReplyDescriptor_t,
      657 +    MPI2_POINTER pMpi26PCIeEncapsulatedSuccessReplyDescriptor_t;
      658 +
      659 +
 559  660  /* union of Reply Descriptors */
 560  661  typedef union _MPI2_REPLY_DESCRIPTORS_UNION
 561  662  {
 562  663      MPI2_DEFAULT_REPLY_DESCRIPTOR                   Default;
 563  664      MPI2_ADDRESS_REPLY_DESCRIPTOR                   AddressReply;
 564  665      MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR           SCSIIOSuccess;
 565  666      MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR      TargetAssistSuccess;
 566  667      MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR     TargetCommandBuffer;
 567  668      MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR  RAIDAcceleratorSuccess;
 568  669      MPI25_FP_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR       FastPathSCSIIOSuccess;
      670 +    MPI26_PCIE_ENCAPSULATED_SUCCESS_REPLY_DESCRIPTOR    PCIeEncapsulatedSuccess;
 569  671      U64                                             Words;
 570  672  } MPI2_REPLY_DESCRIPTORS_UNION, MPI2_POINTER PTR_MPI2_REPLY_DESCRIPTORS_UNION,
 571  673    Mpi2ReplyDescriptorsUnion_t, MPI2_POINTER pMpi2ReplyDescriptorsUnion_t;
 572  674  
 573  675  
 574  676  
 575  677  /*****************************************************************************
 576  678  *
 577  679  *        Message Functions
 578  680  *
↓ open down ↓ 11 lines elided ↑ open up ↑
 590  692  #define MPI2_FUNCTION_FW_DOWNLOAD                   (0x09) /* FW Download */
 591  693  #define MPI2_FUNCTION_TARGET_ASSIST                 (0x0B) /* Target Assist */
 592  694  #define MPI2_FUNCTION_TARGET_STATUS_SEND            (0x0C) /* Target Status Send */
 593  695  #define MPI2_FUNCTION_TARGET_MODE_ABORT             (0x0D) /* Target Mode Abort */
 594  696  #define MPI2_FUNCTION_FW_UPLOAD                     (0x12) /* FW Upload */
 595  697  #define MPI2_FUNCTION_RAID_ACTION                   (0x15) /* RAID Action */
 596  698  #define MPI2_FUNCTION_RAID_SCSI_IO_PASSTHROUGH      (0x16) /* SCSI IO RAID Passthrough */
 597  699  #define MPI2_FUNCTION_TOOLBOX                       (0x17) /* Toolbox */
 598  700  #define MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR      (0x18) /* SCSI Enclosure Processor */
 599  701  #define MPI2_FUNCTION_SMP_PASSTHROUGH               (0x1A) /* SMP Passthrough */
 600      -#define MPI2_FUNCTION_SAS_IO_UNIT_CONTROL           (0x1B) /* SAS IO Unit Control */
      702 +#define MPI2_FUNCTION_SAS_IO_UNIT_CONTROL           (0x1B) /* SAS IO Unit Control */ /* for MPI v2.5 and earlier */
      703 +#define MPI2_FUNCTION_IO_UNIT_CONTROL               (0x1B) /* IO Unit Control */     /* for MPI v2.6 and later */
 601  704  #define MPI2_FUNCTION_SATA_PASSTHROUGH              (0x1C) /* SATA Passthrough */
 602  705  #define MPI2_FUNCTION_DIAG_BUFFER_POST              (0x1D) /* Diagnostic Buffer Post */
 603  706  #define MPI2_FUNCTION_DIAG_RELEASE                  (0x1E) /* Diagnostic Release */
 604  707  #define MPI2_FUNCTION_TARGET_CMD_BUF_BASE_POST      (0x24) /* Target Command Buffer Post Base */
 605  708  #define MPI2_FUNCTION_TARGET_CMD_BUF_LIST_POST      (0x25) /* Target Command Buffer Post List */
 606  709  #define MPI2_FUNCTION_RAID_ACCELERATOR              (0x2C) /* RAID Accelerator */
 607  710  #define MPI2_FUNCTION_HOST_BASED_DISCOVERY_ACTION   (0x2F) /* Host Based Discovery Action */
 608  711  #define MPI2_FUNCTION_PWR_MGMT_CONTROL              (0x30) /* Power Management Control */
 609  712  #define MPI2_FUNCTION_SEND_HOST_MESSAGE             (0x31) /* Send Host Message */
      713 +#define MPI2_FUNCTION_NVME_ENCAPSULATED             (0x33) /* NVMe Encapsulated (MPI v2.6) */
 610  714  #define MPI2_FUNCTION_MIN_PRODUCT_SPECIFIC          (0xF0) /* beginning of product-specific range */
 611  715  #define MPI2_FUNCTION_MAX_PRODUCT_SPECIFIC          (0xFF) /* end of product-specific range */
 612  716  
 613  717  
 614  718  
 615  719  /* Doorbell functions */
 616  720  #define MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET        (0x40)
 617  721  #define MPI2_FUNCTION_HANDSHAKE                     (0x42)
 618  722  
 619  723  
↓ open down ↓ 13 lines elided ↑ open up ↑
 633  737  #define MPI2_IOCSTATUS_SUCCESS                      (0x0000)
 634  738  #define MPI2_IOCSTATUS_INVALID_FUNCTION             (0x0001)
 635  739  #define MPI2_IOCSTATUS_BUSY                         (0x0002)
 636  740  #define MPI2_IOCSTATUS_INVALID_SGL                  (0x0003)
 637  741  #define MPI2_IOCSTATUS_INTERNAL_ERROR               (0x0004)
 638  742  #define MPI2_IOCSTATUS_INVALID_VPID                 (0x0005)
 639  743  #define MPI2_IOCSTATUS_INSUFFICIENT_RESOURCES       (0x0006)
 640  744  #define MPI2_IOCSTATUS_INVALID_FIELD                (0x0007)
 641  745  #define MPI2_IOCSTATUS_INVALID_STATE                (0x0008)
 642  746  #define MPI2_IOCSTATUS_OP_STATE_NOT_SUPPORTED       (0x0009)
      747 +#define MPI2_IOCSTATUS_INSUFFICIENT_POWER           (0x000A) /* MPI v2.6 and later */
 643  748  
 644  749  /****************************************************************************
 645  750  *  Config IOCStatus values
 646  751  ****************************************************************************/
 647  752  
 648  753  #define MPI2_IOCSTATUS_CONFIG_INVALID_ACTION        (0x0020)
 649  754  #define MPI2_IOCSTATUS_CONFIG_INVALID_TYPE          (0x0021)
 650  755  #define MPI2_IOCSTATUS_CONFIG_INVALID_PAGE          (0x0022)
 651  756  #define MPI2_IOCSTATUS_CONFIG_INVALID_DATA          (0x0023)
 652  757  #define MPI2_IOCSTATUS_CONFIG_NO_DEFAULTS           (0x0024)
↓ open down ↓ 457 lines elided ↑ open up ↑
1110 1215  /* MPI2_IEEE_SGE_CHAIN64 is for MPI v2.0 products only */
1111 1216  typedef MPI2_IEEE_SGE_SIMPLE64  MPI2_IEEE_SGE_CHAIN64;
1112 1217  
1113 1218  typedef union _MPI2_IEEE_SGE_CHAIN_UNION
1114 1219  {
1115 1220      MPI2_IEEE_SGE_CHAIN32   Chain32;
1116 1221      MPI2_IEEE_SGE_CHAIN64   Chain64;
1117 1222  } MPI2_IEEE_SGE_CHAIN_UNION, MPI2_POINTER PTR_MPI2_IEEE_SGE_CHAIN_UNION,
1118 1223    Mpi2IeeeSgeChainUnion_t, MPI2_POINTER pMpi2IeeeSgeChainUnion_t;
1119 1224  
1120      -/* MPI25_IEEE_SGE_CHAIN64 is for MPI v2.5 products only */
     1225 +/* MPI25_IEEE_SGE_CHAIN64 is for MPI v2.5 and later */
1121 1226  typedef struct _MPI25_IEEE_SGE_CHAIN64
1122 1227  {
1123 1228      U64                     Address;
1124 1229      U32                     Length;
1125 1230      U16                     Reserved1;
1126 1231      U8                      NextChainOffset;
1127 1232      U8                      Flags;
1128 1233  } MPI25_IEEE_SGE_CHAIN64, MPI2_POINTER PTR_MPI25_IEEE_SGE_CHAIN64,
1129 1234    Mpi25IeeeSgeChain64_t, MPI2_POINTER pMpi25IeeeSgeChain64_t;
1130 1235  
↓ open down ↓ 37 lines elided ↑ open up ↑
1168 1273  
1169 1274  #define MPI2_IEEE32_SGE_FLAGS_SHIFT             (24)
1170 1275  
1171 1276  #define MPI2_IEEE32_SGE_LENGTH_MASK             (0x00FFFFFF)
1172 1277  
1173 1278  /* Element Type */
1174 1279  
1175 1280  #define MPI2_IEEE_SGE_FLAGS_SIMPLE_ELEMENT      (0x00)
1176 1281  #define MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT       (0x80)
1177 1282  
     1283 +/* Next Segment Format */
     1284 +
     1285 +#define MPI26_IEEE_SGE_FLAGS_NSF_MASK           (0x1C)
     1286 +#define MPI26_IEEE_SGE_FLAGS_NSF_MPI_IEEE       (0x00)
     1287 +#define MPI26_IEEE_SGE_FLAGS_NSF_NVME_PRP       (0x08)
     1288 +#define MPI26_IEEE_SGE_FLAGS_NSF_NVME_SGL       (0x10)
     1289 +
1178 1290  /* Data Location Address Space */
1179 1291  
1180 1292  #define MPI2_IEEE_SGE_FLAGS_ADDR_MASK           (0x03)
1181      -#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR         (0x00) /* for MPI v2.0, use in IEEE Simple Element only; for MPI v2.5, use in IEEE Simple or Chain element */
     1293 +#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR         (0x00) /* for MPI v2.0, use in IEEE Simple Element only; for MPI v2.5 and later, use in IEEE Simple or Chain element */
1182 1294  #define MPI2_IEEE_SGE_FLAGS_IOCDDR_ADDR         (0x01) /* use in IEEE Simple Element only */
1183 1295  #define MPI2_IEEE_SGE_FLAGS_IOCPLB_ADDR         (0x02)
1184 1296  #define MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR      (0x03) /* for MPI v2.0, use in IEEE Simple Element only; for MPI v2.5, use in IEEE Simple or Chain element */
1185 1297  #define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBPCI_ADDR   (0x03) /* use in MPI v2.0 IEEE Chain Element only */
1186 1298  #define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR   (MPI2_IEEE_SGE_FLAGS_SYSTEMPLBPCI_ADDR) /* typo in name */
1187 1299  
     1300 +#define MPI26_IEEE_SGE_FLAGS_IOCCTL_ADDR        (0x02) /* for MPI v2.6 only */
     1301 +
1188 1302  /****************************************************************************
1189 1303  *  IEEE SGE operation Macros
1190 1304  ****************************************************************************/
1191 1305  
1192 1306  /* SIMPLE FlagsLength manipulations... */
1193 1307  #define MPI2_IEEE32_SGE_SET_FLAGS(f)     ((U32)(f) << MPI2_IEEE32_SGE_FLAGS_SHIFT)
1194 1308  #define MPI2_IEEE32_SGE_GET_FLAGS(f)     (((f) & ~MPI2_IEEE32_SGE_LENGTH_MASK) >> MPI2_IEEE32_SGE_FLAGS_SHIFT)
1195 1309  #define MPI2_IEEE32_SGE_LENGTH(f)        ((f) & MPI2_IEEE32_SGE_LENGTH_MASK)
1196 1310  
1197 1311  #define MPI2_IEEE32_SGE_SET_FLAGS_LENGTH(f, l)      (MPI2_IEEE32_SGE_SET_FLAGS(f) | MPI2_IEEE32_SGE_LENGTH(l))
↓ open down ↓ 35 lines elided ↑ open up ↑
1233 1347  /****************************************************************************
1234 1348  *
1235 1349  *  Values for SGLFlags field, used in many request messages with an SGL
1236 1350  *
1237 1351  ****************************************************************************/
1238 1352  
1239 1353  /* values for MPI SGL Data Location Address Space subfield */
1240 1354  #define MPI2_SGLFLAGS_ADDRESS_SPACE_MASK            (0x0C)
1241 1355  #define MPI2_SGLFLAGS_SYSTEM_ADDRESS_SPACE          (0x00)
1242 1356  #define MPI2_SGLFLAGS_IOCDDR_ADDRESS_SPACE          (0x04)
1243      -#define MPI2_SGLFLAGS_IOCPLB_ADDRESS_SPACE          (0x08)
1244      -#define MPI2_SGLFLAGS_IOCPLBNTA_ADDRESS_SPACE       (0x0C)
     1357 +#define MPI2_SGLFLAGS_IOCPLB_ADDRESS_SPACE          (0x08) /* only for MPI v2.5 and earlier */
     1358 +#define MPI26_SGLFLAGS_IOCPLB_ADDRESS_SPACE         (0x08) /* only for MPI v2.6 */
     1359 +#define MPI2_SGLFLAGS_IOCPLBNTA_ADDRESS_SPACE       (0x0C) /* only for MPI v2.5 and earlier */
1245 1360  /* values for SGL Type subfield */
1246 1361  #define MPI2_SGLFLAGS_SGL_TYPE_MASK                 (0x03)
1247 1362  #define MPI2_SGLFLAGS_SGL_TYPE_MPI                  (0x00)
1248 1363  #define MPI2_SGLFLAGS_SGL_TYPE_IEEE32               (0x01) /* MPI v2.0 products only */
1249 1364  #define MPI2_SGLFLAGS_SGL_TYPE_IEEE64               (0x02)
1250 1365  
1251 1366  
1252 1367  #endif
1253 1368  
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX