Print this page
Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2000 to 2009, LSI Corporation.
  24  * All rights reserved.
  25  *
  26  * Redistribution and use in source and binary forms of all code within
  27  * this file that is exclusively owned by LSI, with or without
  28  * modification, is permitted provided that, in addition to the CDDL 1.0
  29  * License requirements, the following conditions are met:
  30  *
  31  *    Neither the name of the author nor the names of its contributors may be
  32  *    used to endorse or promote products derived from this software without
  33  *    specific prior written permission.
  34  *
  35  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  36  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  37  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  38  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  39  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  40  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  41  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  42  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  43  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  44  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  45  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  46  * DAMAGE.
  47  */
  48 
  49 /*
  50  *           Name:  mpi2_raid.h
  51  *          Title:  MPI Integrated RAID messages and structures
  52  *  Creation Date:  April 26, 2007
  53  *
  54  *    mpi2_raid.h Version:  02.00.04
  55  *
  56  *  Version History
  57  *  ---------------
  58  *
  59  *  Date      Version   Description
  60  *  --------  --------  ------------------------------------------------------
  61  *  04-30-07  02.00.00  Corresponds to Fusion-MPT MPI Specification Rev A.
  62  *  08-31-07  02.00.01  Modifications to RAID Action request and reply,
  63  *                      including the Actions and ActionData.
  64  *  02-29-08  02.00.02  Added MPI2_RAID_ACTION_ADATA_DISABL_FULL_REBUILD.
  65  *  05-21-08  02.00.03  Added MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS so that
  66  *                      the PhysDisk array in MPI2_RAID_VOLUME_CREATION_STRUCT
  67  *                      can be sized by the build environment.
  68  *  07-30-09  02.00.04  Added proper define for the Use Default Settings bit of
  69  *                      VolumeCreationFlags and marked the old one as obsolete.

  70  *  --------------------------------------------------------------------------
  71  */
  72 
  73 #ifndef MPI2_RAID_H
  74 #define MPI2_RAID_H
  75 
  76 /*****************************************************************************
  77 *
  78 *               Integrated RAID Messages
  79 *
  80 *****************************************************************************/
  81 
  82 /****************************************************************************
  83 *  RAID Action messages
  84 ****************************************************************************/
  85 
  86 /* ActionDataWord defines for use with MPI2_RAID_ACTION_DELETE_VOLUME action */
  87 #define MPI2_RAID_ACTION_ADATA_KEEP_LBA0            (0x00000000)
  88 #define MPI2_RAID_ACTION_ADATA_ZERO_LBA0            (0x00000001)
  89 


 203 
 204 #define MPI2_RAID_ACTION_INDICATOR_STRUCT           (0x01)
 205 #define MPI2_RAID_ACTION_CREATE_VOLUME              (0x02)
 206 #define MPI2_RAID_ACTION_DELETE_VOLUME              (0x03)
 207 #define MPI2_RAID_ACTION_DISABLE_ALL_VOLUMES        (0x04)
 208 #define MPI2_RAID_ACTION_ENABLE_ALL_VOLUMES         (0x05)
 209 #define MPI2_RAID_ACTION_PHYSDISK_OFFLINE           (0x0A)
 210 #define MPI2_RAID_ACTION_PHYSDISK_ONLINE            (0x0B)
 211 #define MPI2_RAID_ACTION_FAIL_PHYSDISK              (0x0F)
 212 #define MPI2_RAID_ACTION_ACTIVATE_VOLUME            (0x11)
 213 #define MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE      (0x15)
 214 #define MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE     (0x17)
 215 #define MPI2_RAID_ACTION_SET_VOLUME_NAME            (0x18)
 216 #define MPI2_RAID_ACTION_SET_RAID_FUNCTION_RATE     (0x19)
 217 #define MPI2_RAID_ACTION_ENABLE_FAILED_VOLUME       (0x1C)
 218 #define MPI2_RAID_ACTION_CREATE_HOT_SPARE           (0x1D)
 219 #define MPI2_RAID_ACTION_DELETE_HOT_SPARE           (0x1E)
 220 #define MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED  (0x20)
 221 #define MPI2_RAID_ACTION_START_RAID_FUNCTION        (0x21)
 222 #define MPI2_RAID_ACTION_STOP_RAID_FUNCTION         (0x22)
 223 
 224 
 225 /* RAID Volume Creation Structure */
 226 
 227 /*
 228  * The following define can be customized for the targeted product.
 229  */
 230 #ifndef MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS
 231 #define MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS        (1)
 232 #endif
 233 
 234 typedef struct _MPI2_RAID_VOLUME_PHYSDISK
 235 {
 236     U8                      RAIDSetNum;                     /* 0x00 */
 237     U8                      PhysDiskMap;                    /* 0x01 */
 238     U16                     PhysDiskDevHandle;              /* 0x02 */
 239 } MPI2_RAID_VOLUME_PHYSDISK, MPI2_POINTER PTR_MPI2_RAID_VOLUME_PHYSDISK,
 240   Mpi2RaidVolumePhysDisk_t, MPI2_POINTER pMpi2RaidVolumePhysDisk_t;
 241 
 242 /* defines for the PhysDiskMap field */
 243 #define MPI2_RAIDACTION_PHYSDISK_PRIMARY            (0x01)


 288   Mpi2RaidOnlineCapacityExpansion_t,
 289   MPI2_POINTER pMpi2RaidOnlineCapacityExpansion_t;
 290 
 291 
 292 /* RAID Volume Indicator Structure */
 293 
 294 typedef struct _MPI2_RAID_VOL_INDICATOR
 295 {
 296     U64                     TotalBlocks;                    /* 0x00 */
 297     U64                     BlocksRemaining;                /* 0x08 */
 298     U32                     Flags;                          /* 0x10 */
 299 } MPI2_RAID_VOL_INDICATOR, MPI2_POINTER PTR_MPI2_RAID_VOL_INDICATOR,
 300   Mpi2RaidVolIndicator_t, MPI2_POINTER pMpi2RaidVolIndicator_t;
 301 
 302 /* defines for RAID Volume Indicator Flags field */
 303 #define MPI2_RAID_VOL_FLAGS_OP_MASK                 (0x0000000F)
 304 #define MPI2_RAID_VOL_FLAGS_OP_BACKGROUND_INIT      (0x00000000)
 305 #define MPI2_RAID_VOL_FLAGS_OP_ONLINE_CAP_EXPANSION (0x00000001)
 306 #define MPI2_RAID_VOL_FLAGS_OP_CONSISTENCY_CHECK    (0x00000002)
 307 #define MPI2_RAID_VOL_FLAGS_OP_RESYNC               (0x00000003)

 308 
 309 
 310 /* RAID Action Reply ActionData union */
 311 typedef union _MPI2_RAID_ACTION_REPLY_DATA
 312 {
 313     U32                     Word[5];
 314     MPI2_RAID_VOL_INDICATOR RaidVolumeIndicator;
 315     U16                     VolDevHandle;
 316     U8                      VolumeState;
 317     U8                      PhysDiskNum;
 318 } MPI2_RAID_ACTION_REPLY_DATA, MPI2_POINTER PTR_MPI2_RAID_ACTION_REPLY_DATA,
 319   Mpi2RaidActionReplyData_t, MPI2_POINTER pMpi2RaidActionReplyData_t;
 320 
 321 /* use MPI2_RAIDVOL0_SETTING_ defines from mpi2_cnfg.h for MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE action */
 322 
 323 
 324 /* RAID Action Reply Message */
 325 typedef struct _MPI2_RAID_ACTION_REPLY
 326 {
 327     U8                          Action;                     /* 0x00 */


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  *  Copyright (c) 2000-2012 LSI Corporation.

  24  *
  25  * Redistribution and use in source and binary forms of all code within
  26  * this file that is exclusively owned by LSI, with or without
  27  * modification, is permitted provided that, in addition to the CDDL 1.0
  28  * License requirements, the following conditions are met:
  29  *
  30  *    Neither the name of the author nor the names of its contributors may be
  31  *    used to endorse or promote products derived from this software without
  32  *    specific prior written permission.
  33  *
  34  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  35  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  36  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  37  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  38  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  39  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  40  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  41  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  42  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  43  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  44  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  45  * DAMAGE.
  46  */
  47 
  48 /*
  49  *           Name:  mpi2_raid.h
  50  *          Title:  MPI Integrated RAID messages and structures
  51  *  Creation Date:  April 26, 2007
  52  *
  53  *    mpi2_raid.h Version:  02.00.05
  54  *
  55  *  Version History
  56  *  ---------------
  57  *
  58  *  Date      Version   Description
  59  *  --------  --------  ------------------------------------------------------
  60  *  04-30-07  02.00.00  Corresponds to Fusion-MPT MPI Specification Rev A.
  61  *  08-31-07  02.00.01  Modifications to RAID Action request and reply,
  62  *                      including the Actions and ActionData.
  63  *  02-29-08  02.00.02  Added MPI2_RAID_ACTION_ADATA_DISABL_FULL_REBUILD.
  64  *  05-21-08  02.00.03  Added MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS so that
  65  *                      the PhysDisk array in MPI2_RAID_VOLUME_CREATION_STRUCT
  66  *                      can be sized by the build environment.
  67  *  07-30-09  02.00.04  Added proper define for the Use Default Settings bit of
  68  *                      VolumeCreationFlags and marked the old one as obsolete.
  69  *  05-12-10  02.00.05  Added MPI2_RAID_VOL_FLAGS_OP_MDC define.
  70  *  --------------------------------------------------------------------------
  71  */
  72 
  73 #ifndef MPI2_RAID_H
  74 #define MPI2_RAID_H
  75 
  76 /*****************************************************************************
  77 *
  78 *               Integrated RAID Messages
  79 *
  80 *****************************************************************************/
  81 
  82 /****************************************************************************
  83 *  RAID Action messages
  84 ****************************************************************************/
  85 
  86 /* ActionDataWord defines for use with MPI2_RAID_ACTION_DELETE_VOLUME action */
  87 #define MPI2_RAID_ACTION_ADATA_KEEP_LBA0            (0x00000000)
  88 #define MPI2_RAID_ACTION_ADATA_ZERO_LBA0            (0x00000001)
  89 


 203 
 204 #define MPI2_RAID_ACTION_INDICATOR_STRUCT           (0x01)
 205 #define MPI2_RAID_ACTION_CREATE_VOLUME              (0x02)
 206 #define MPI2_RAID_ACTION_DELETE_VOLUME              (0x03)
 207 #define MPI2_RAID_ACTION_DISABLE_ALL_VOLUMES        (0x04)
 208 #define MPI2_RAID_ACTION_ENABLE_ALL_VOLUMES         (0x05)
 209 #define MPI2_RAID_ACTION_PHYSDISK_OFFLINE           (0x0A)
 210 #define MPI2_RAID_ACTION_PHYSDISK_ONLINE            (0x0B)
 211 #define MPI2_RAID_ACTION_FAIL_PHYSDISK              (0x0F)
 212 #define MPI2_RAID_ACTION_ACTIVATE_VOLUME            (0x11)
 213 #define MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE      (0x15)
 214 #define MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE     (0x17)
 215 #define MPI2_RAID_ACTION_SET_VOLUME_NAME            (0x18)
 216 #define MPI2_RAID_ACTION_SET_RAID_FUNCTION_RATE     (0x19)
 217 #define MPI2_RAID_ACTION_ENABLE_FAILED_VOLUME       (0x1C)
 218 #define MPI2_RAID_ACTION_CREATE_HOT_SPARE           (0x1D)
 219 #define MPI2_RAID_ACTION_DELETE_HOT_SPARE           (0x1E)
 220 #define MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED  (0x20)
 221 #define MPI2_RAID_ACTION_START_RAID_FUNCTION        (0x21)
 222 #define MPI2_RAID_ACTION_STOP_RAID_FUNCTION         (0x22)
 223 #define MPI2_RAID_ACTION_FAST_PATH_PERMITTED        (0x24)
 224 
 225 /* RAID Volume Creation Structure */
 226 
 227 /*
 228  * The following define can be customized for the targeted product.
 229  */
 230 #ifndef MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS
 231 #define MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS        (1)
 232 #endif
 233 
 234 typedef struct _MPI2_RAID_VOLUME_PHYSDISK
 235 {
 236     U8                      RAIDSetNum;                     /* 0x00 */
 237     U8                      PhysDiskMap;                    /* 0x01 */
 238     U16                     PhysDiskDevHandle;              /* 0x02 */
 239 } MPI2_RAID_VOLUME_PHYSDISK, MPI2_POINTER PTR_MPI2_RAID_VOLUME_PHYSDISK,
 240   Mpi2RaidVolumePhysDisk_t, MPI2_POINTER pMpi2RaidVolumePhysDisk_t;
 241 
 242 /* defines for the PhysDiskMap field */
 243 #define MPI2_RAIDACTION_PHYSDISK_PRIMARY            (0x01)


 288   Mpi2RaidOnlineCapacityExpansion_t,
 289   MPI2_POINTER pMpi2RaidOnlineCapacityExpansion_t;
 290 
 291 
 292 /* RAID Volume Indicator Structure */
 293 
 294 typedef struct _MPI2_RAID_VOL_INDICATOR
 295 {
 296     U64                     TotalBlocks;                    /* 0x00 */
 297     U64                     BlocksRemaining;                /* 0x08 */
 298     U32                     Flags;                          /* 0x10 */
 299 } MPI2_RAID_VOL_INDICATOR, MPI2_POINTER PTR_MPI2_RAID_VOL_INDICATOR,
 300   Mpi2RaidVolIndicator_t, MPI2_POINTER pMpi2RaidVolIndicator_t;
 301 
 302 /* defines for RAID Volume Indicator Flags field */
 303 #define MPI2_RAID_VOL_FLAGS_OP_MASK                 (0x0000000F)
 304 #define MPI2_RAID_VOL_FLAGS_OP_BACKGROUND_INIT      (0x00000000)
 305 #define MPI2_RAID_VOL_FLAGS_OP_ONLINE_CAP_EXPANSION (0x00000001)
 306 #define MPI2_RAID_VOL_FLAGS_OP_CONSISTENCY_CHECK    (0x00000002)
 307 #define MPI2_RAID_VOL_FLAGS_OP_RESYNC               (0x00000003)
 308 #define MPI2_RAID_VOL_FLAGS_OP_MDC                  (0x00000004)
 309 
 310 
 311 /* RAID Action Reply ActionData union */
 312 typedef union _MPI2_RAID_ACTION_REPLY_DATA
 313 {
 314     U32                     Word[5];
 315     MPI2_RAID_VOL_INDICATOR RaidVolumeIndicator;
 316     U16                     VolDevHandle;
 317     U8                      VolumeState;
 318     U8                      PhysDiskNum;
 319 } MPI2_RAID_ACTION_REPLY_DATA, MPI2_POINTER PTR_MPI2_RAID_ACTION_REPLY_DATA,
 320   Mpi2RaidActionReplyData_t, MPI2_POINTER pMpi2RaidActionReplyData_t;
 321 
 322 /* use MPI2_RAIDVOL0_SETTING_ defines from mpi2_cnfg.h for MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE action */
 323 
 324 
 325 /* RAID Action Reply Message */
 326 typedef struct _MPI2_RAID_ACTION_REPLY
 327 {
 328     U8                          Action;                     /* 0x00 */