17c478bd9Sstevel@tonic-gate /* 2*b449fa8aSyw161884 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 37c478bd9Sstevel@tonic-gate * Use is subject to license terms. 47c478bd9Sstevel@tonic-gate */ 57c478bd9Sstevel@tonic-gate 67c478bd9Sstevel@tonic-gate #ifndef _SYS_MPI_RAID_H 77c478bd9Sstevel@tonic-gate #define _SYS_MPI_RAID_H 87c478bd9Sstevel@tonic-gate 97c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 107c478bd9Sstevel@tonic-gate 117c478bd9Sstevel@tonic-gate #ifdef __cplusplus 127c478bd9Sstevel@tonic-gate extern "C" { 137c478bd9Sstevel@tonic-gate #endif 147c478bd9Sstevel@tonic-gate 157c478bd9Sstevel@tonic-gate /* 167c478bd9Sstevel@tonic-gate * RAID Volume Request 177c478bd9Sstevel@tonic-gate */ 187c478bd9Sstevel@tonic-gate typedef struct msg_raid_action { 197c478bd9Sstevel@tonic-gate uint8_t Action; 207c478bd9Sstevel@tonic-gate uint8_t Reserved1; 217c478bd9Sstevel@tonic-gate uint8_t ChainOffset; 227c478bd9Sstevel@tonic-gate uint8_t Function; 237c478bd9Sstevel@tonic-gate uint8_t VolumeID; 247c478bd9Sstevel@tonic-gate uint8_t VolumeBus; 257c478bd9Sstevel@tonic-gate uint8_t PhysDiskNum; 267c478bd9Sstevel@tonic-gate uint8_t MsgFlags; 277c478bd9Sstevel@tonic-gate uint32_t MsgContext; 287c478bd9Sstevel@tonic-gate uint32_t Reserved2; 297c478bd9Sstevel@tonic-gate uint32_t ActionDataWord; 307c478bd9Sstevel@tonic-gate sge_simple_union_t ActionDataSGE; 317c478bd9Sstevel@tonic-gate } msg_raid_action_t; 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gate /* RAID Volume Action values */ 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_STATUS 0x00 377c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_INDICATOR_STRUCT 0x01 387c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_CREATE_VOLUME 0x02 397c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_DELETE_VOLUME 0x03 407c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_DISABLE_VOLUME 0x04 417c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_ENABLE_VOLUME 0x05 427c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_QUIESCE_PHYS_IO 0x06 437c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_ENABLE_PHYS_IO 0x07 447c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS 0x08 457c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_PHYSDISK_OFFLINE 0x0A 467c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_PHYSDISK_ONLINE 0x0B 477c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS 0x0C 487c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_CREATE_PHYSDISK 0x0D 497c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_DELETE_PHYSDISK 0x0E 507c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_FAIL_PHYSDISK 0x0F 517c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_REPLACE_PHYSDISK 0x10 52*b449fa8aSyw161884 #define MPI_RAID_ACTION_ACTIVATE_VOLUME 0x11 53*b449fa8aSyw161884 #define MPI_RAID_ACTION_INACTIVATE_VOLUME 0x12 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC 0x00000001 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS 0x00000000 587c478bd9Sstevel@tonic-gate #define MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS 0x00000001 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate /* RAID Volume reply message */ 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gate typedef struct msg_raid_action_reply { 637c478bd9Sstevel@tonic-gate uint8_t Action; 647c478bd9Sstevel@tonic-gate uint8_t Reserved; 657c478bd9Sstevel@tonic-gate uint8_t MsgLength; 667c478bd9Sstevel@tonic-gate uint8_t Function; 677c478bd9Sstevel@tonic-gate uint8_t VolumeID; 687c478bd9Sstevel@tonic-gate uint8_t VolumeBus; 697c478bd9Sstevel@tonic-gate uint8_t PhysDiskNum; 707c478bd9Sstevel@tonic-gate uint8_t MsgFlags; 717c478bd9Sstevel@tonic-gate uint32_t MsgContext; 727c478bd9Sstevel@tonic-gate uint16_t ActionStatus; 737c478bd9Sstevel@tonic-gate uint16_t IOCStatus; 747c478bd9Sstevel@tonic-gate uint32_t IOCLogInfo; 757c478bd9Sstevel@tonic-gate uint32_t VolumeStatus; 767c478bd9Sstevel@tonic-gate uint32_t ActionData; 777c478bd9Sstevel@tonic-gate } msg_raid_action_reply_t; 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gate /* RAID Volume reply ActionStatus values */ 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate #define MPI_RAID_VOL_ASTATUS_SUCCESS 0x0000 837c478bd9Sstevel@tonic-gate #define MPI_RAID_VOL_ASTATUS_INVALID_ACTION 0x0001 847c478bd9Sstevel@tonic-gate #define MPI_RAID_VOL_ASTATUS_FAILURE 0x0002 857c478bd9Sstevel@tonic-gate #define MPI_RAID_VOL_ASTATUS_IN_PROGRESS 0x0003 867c478bd9Sstevel@tonic-gate 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate /* RAID Volume reply RAID Volume Indicator structure */ 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate typedef struct mpi_raid_vol_indicator { 917c478bd9Sstevel@tonic-gate uint64_t TotalBlocks; 927c478bd9Sstevel@tonic-gate uint64_t BlocksRemaining; 937c478bd9Sstevel@tonic-gate } mpi_raid_vol_indicator_t; 947c478bd9Sstevel@tonic-gate 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate /* 977c478bd9Sstevel@tonic-gate * SCSI IO RAID Passthrough Request 987c478bd9Sstevel@tonic-gate */ 997c478bd9Sstevel@tonic-gate typedef struct msg_scsi_io_raid_pt_request { 1007c478bd9Sstevel@tonic-gate uint8_t PhysDiskNum; 1017c478bd9Sstevel@tonic-gate uint8_t Reserved1; 1027c478bd9Sstevel@tonic-gate uint8_t ChainOffset; 1037c478bd9Sstevel@tonic-gate uint8_t Function; 1047c478bd9Sstevel@tonic-gate uint8_t CDBLength; 1057c478bd9Sstevel@tonic-gate uint8_t SenseBufferLength; 1067c478bd9Sstevel@tonic-gate uint8_t Reserved2; 1077c478bd9Sstevel@tonic-gate uint8_t MsgFlags; 1087c478bd9Sstevel@tonic-gate uint32_t MsgContext; 1097c478bd9Sstevel@tonic-gate uint8_t LUN[8]; 1107c478bd9Sstevel@tonic-gate uint32_t Control; 1117c478bd9Sstevel@tonic-gate uint8_t CDB[16]; 1127c478bd9Sstevel@tonic-gate uint32_t DataLength; 1137c478bd9Sstevel@tonic-gate uint32_t SenseBufferLowAddr; 1147c478bd9Sstevel@tonic-gate sge_io_union_t SGL; 1157c478bd9Sstevel@tonic-gate } msg_scsi_io_raid_pt_request_t; 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gate 1187c478bd9Sstevel@tonic-gate /* SCSI IO RAID Passthrough reply structure */ 1197c478bd9Sstevel@tonic-gate 1207c478bd9Sstevel@tonic-gate typedef struct msg_scsi_io_raid_pt_reply { 1217c478bd9Sstevel@tonic-gate uint8_t PhysDiskNum; 1227c478bd9Sstevel@tonic-gate uint8_t Reserved1; 1237c478bd9Sstevel@tonic-gate uint8_t MsgLength; 1247c478bd9Sstevel@tonic-gate uint8_t Function; 1257c478bd9Sstevel@tonic-gate uint8_t CDBLength; 1267c478bd9Sstevel@tonic-gate uint8_t SenseBufferLength; 1277c478bd9Sstevel@tonic-gate uint8_t Reserved2; 1287c478bd9Sstevel@tonic-gate uint8_t MsgFlags; 1297c478bd9Sstevel@tonic-gate uint32_t MsgContext; 1307c478bd9Sstevel@tonic-gate uint8_t SCSIStatus; 1317c478bd9Sstevel@tonic-gate uint8_t SCSIState; 1327c478bd9Sstevel@tonic-gate uint16_t IOCStatus; 1337c478bd9Sstevel@tonic-gate uint32_t IOCLogInfo; 1347c478bd9Sstevel@tonic-gate uint32_t TransferCount; 1357c478bd9Sstevel@tonic-gate uint32_t SenseCount; 1367c478bd9Sstevel@tonic-gate uint32_t ResponseInfo; 1377c478bd9Sstevel@tonic-gate } msg_scsi_io_raid_pt_reply_t; 1387c478bd9Sstevel@tonic-gate 1397c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1407c478bd9Sstevel@tonic-gate } 1417c478bd9Sstevel@tonic-gate #endif 1427c478bd9Sstevel@tonic-gate 1437c478bd9Sstevel@tonic-gate #endif /* _SYS_MPI_RAID_H */ 144