1 /* $FreeBSD: src/sys/dev/asr/i2outil.h,v 1.1.2.1 2000/09/21 20:33:50 msmith Exp $ */ 2 /* $DragonFly: src/sys/dev/raid/asr/i2outil.h,v 1.3 2003/08/07 21:17:08 dillon Exp $ */ 3 /**************************************************************** 4 * Copyright (c) 1996-2000 Distributed Processing Technology Corporation 5 * Copyright (c) 2000 Adaptec Corporation. 6 * All rights reserved. 7 * 8 * Copyright 1999 I2O Special Interest Group (I2O SIG). All rights reserved. 9 * All rights reserved 10 * 11 * TERMS AND CONDITIONS OF USE 12 * 13 * Redistribution and use in source form, with or without modification, are 14 * permitted provided that redistributions of source code must retain the 15 * above copyright notice, this list of conditions and the following disclaimer. 16 * 17 * This software is provided `as is' by Distributed Processing Technology and 18 * any express or implied warranties, including, but not limited to, the 19 * implied warranties of merchantability and fitness for a particular purpose, 20 * are disclaimed. In no event shall Distributed Processing Technology be 21 * liable for any direct, indirect, incidental, special, exemplary or 22 * consequential damages (including, but not limited to, procurement of 23 * substitute goods or services; loss of use, data, or profits; or business 24 * interruptions) however caused and on any theory of liability, whether in 25 * contract, strict liability, or tort (including negligence or otherwise) 26 * arising in any way out of the use of this driver software, even if advised 27 * of the possibility of such damage. 28 * 29 * This header file, and any modifications of this header file, are provided 30 * contingent upon your agreement and adherence to the here-listed terms and 31 * conditions. By accepting and/or using this header file, you agree to abide 32 * by these terms and conditions and that these terms and conditions will be 33 * construed and governed in accordance with the laws of the State of California, 34 * without reference to conflict-of-law provisions. If you do not agree 35 * to these terms and conditions, please delete this file, and any copies, 36 * permanently, without making any use thereof. 37 * 38 * THIS HEADER FILE IS PROVIDED FREE OF CHARGE ON AN AS-IS BASIS WITHOUT 39 * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 40 * TO IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 41 * PURPOSE. I2O SIG DOES NOT WARRANT THAT THIS HEADER FILE WILL MEET THE 42 * USER'S REQUIREMENTS OR THAT ITS OPERATION WILL BE UNINTERRUPTED OR 43 * ERROR-FREE. 44 * 45 * I2O SIG DISCLAIMS ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF 46 * ANY PROPRIETARY RIGHTS, RELATING TO THE IMPLEMENTATION OF THE I2O 47 * SPECIFICATIONS. I2O SIG DOES NOT WARRANT OR REPRESENT THAT SUCH 48 * IMPLEMENTATIONS WILL NOT INFRINGE SUCH RIGHTS. 49 * 50 * THE USER OF THIS HEADER FILE SHALL HAVE NO RECOURSE TO I2O SIG FOR ANY 51 * ACTUAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, LOST DATA 52 * OR LOST PROFITS ARISING OUT OF THE USE OR INABILITY TO USE THIS PROGRAM. 53 * 54 * I2O SIG grants the user of this header file a license to copy, distribute, 55 * and modify it, for any purpose, under the following terms. Any copying, 56 * distribution, or modification of this header file must not delete or alter 57 * the copyright notice of I2O SIG or any of these Terms and Conditions. 58 * 59 * Any distribution of this header file must not include a charge for the 60 * header file (unless such charges are strictly for the physical acts of 61 * copying or transferring copies). However, distribution of a product in 62 * which this header file is embedded may include a charge so long as any 63 * such charge does not include any charge for the header file itself. 64 * 65 * Any modification of this header file constitutes a derivative work based 66 * on this header file. Any distribution of such derivative work: (1) must 67 * include prominent notices that the header file has been changed from the 68 * original, together with the dates of any changes; (2) automatically includes 69 * this same license to the original header file from I2O SIG, without any 70 * restriction thereon from the distributing user; and (3) must include a 71 * grant of license of the modified file under the same terms and conditions 72 * as these Terms and Conditions. 73 * 74 * The I2O SIG Web site can be found at: http://www.i2osig.org 75 * 76 * The I2O SIG encourages you to deposit derivative works based on this 77 * header file at the I2O SIG Web site. Furthermore, to become a Registered 78 * Developer of the I2O SIG, sign up at the Web site or call 415.750.8352 79 * (United States). 80 ****************************************************************/ 81 82 /********************************************************************* 83 * I2OUtil.h -- I2O Utility Class Message defintion file 84 * 85 * This file contains information presented in Chapter 6 of the I2O 86 * Specification. 87 **********************************************************************/ 88 89 #if !defined(I2O_UTILITY_HDR) 90 #define I2O_UTILITY_HDR 91 92 #define I2OUTIL_REV 1_5_4 /* I2OUtil header file revision string */ 93 94 #if ((defined(KERNEL) || defined(_KERNEL)) && defined(__FreeBSD__)) 95 # if (KERN_VERSION < 3) 96 # include "i2omsg.h" /* Include the Base Message file */ 97 # else 98 # include "i2omsg.h" 99 # endif 100 #else 101 # include "i2omsg.h" /* Include the Base Message file */ 102 #endif 103 104 105 /* 106 NOTES: 107 108 Gets, reads, receives, etc. are all even numbered functions. 109 Sets, writes, sends, etc. are all odd numbered functions. 110 Functions that both send and receive data can be either but an attempt is made 111 to use the function number that indicates the greater transfer amount. 112 Functions that do not send or receive data use odd function numbers. 113 114 Some functions are synonyms like read, receive and send, write. 115 116 All common functions will have a code of less than 0x80. 117 Unique functions to a class will start at 0x80. 118 Executive Functions start at 0xA0. 119 120 Utility Message function codes range from 0 - 0x1f 121 Base Message function codes range from 0x20 - 0xfe 122 Private Message function code is 0xff. 123 */ 124 125 PRAGMA_ALIGN_PUSH 126 127 PRAGMA_PACK_PUSH 128 129 /* Utility Message class functions. */ 130 131 #define I2O_UTIL_NOP 0x00 132 #define I2O_UTIL_ABORT 0x01 133 #define I2O_UTIL_CLAIM 0x09 134 #define I2O_UTIL_CLAIM_RELEASE 0x0B 135 #define I2O_UTIL_CONFIG_DIALOG 0x10 136 #define I2O_UTIL_DEVICE_RESERVE 0x0D 137 #define I2O_UTIL_DEVICE_RELEASE 0x0F 138 #define I2O_UTIL_EVENT_ACKNOWLEDGE 0x14 139 #define I2O_UTIL_EVENT_REGISTER 0x13 140 #define I2O_UTIL_LOCK 0x17 141 #define I2O_UTIL_LOCK_RELEASE 0x19 142 #define I2O_UTIL_PARAMS_GET 0x06 143 #define I2O_UTIL_PARAMS_SET 0x05 144 #define I2O_UTIL_REPLY_FAULT_NOTIFY 0x15 145 146 /****************************************************************************/ 147 148 /* ABORT Abort type defines. */ 149 150 #define I2O_ABORT_TYPE_EXACT_ABORT 0x00 151 #define I2O_ABORT_TYPE_FUNCTION_ABORT 0x01 152 #define I2O_ABORT_TYPE_TRANSACTION_ABORT 0x02 153 #define I2O_ABORT_TYPE_WILD_ABORT 0x03 154 #define I2O_ABORT_TYPE_CLEAN_EXACT_ABORT 0x04 155 #define I2O_ABORT_TYPE_CLEAN_FUNCTION_ABORT 0x05 156 #define I2O_ABORT_TYPE_CLEAN_TRANSACTION_ABORT 0x06 157 #define I2O_ABORT_TYPE_CLEAN_WILD_ABORT 0x07 158 159 /* UtilAbort Function Message Frame structure. */ 160 161 typedef struct _I2O_UTIL_ABORT_MESSAGE { 162 I2O_MESSAGE_FRAME StdMessageFrame; 163 I2O_TRANSACTION_CONTEXT TransactionContext; 164 # if (defined(_DPT_BIG_ENDIAN) || defined(sparc)) 165 U32 reserved; 166 # else 167 U16 reserved; 168 U8 AbortType; 169 U8 FunctionToAbort; 170 # endif 171 I2O_TRANSACTION_CONTEXT TransactionContextToAbort; 172 } I2O_UTIL_ABORT_MESSAGE, *PI2O_UTIL_ABORT_MESSAGE; 173 174 175 typedef struct _I2O_UTIL_ABORT_REPLY { 176 I2O_MESSAGE_FRAME StdMessageFrame; 177 I2O_TRANSACTION_CONTEXT TransactionContext; 178 U32 CountOfAbortedMessages; 179 } I2O_UTIL_ABORT_REPLY, *PI2O_UTIL_ABORT_REPLY; 180 181 182 /****************************************************************************/ 183 184 /* Claim Flag defines */ 185 186 #define I2O_CLAIM_FLAGS_EXCLUSIVE 0x0001 /* Reserved */ 187 #define I2O_CLAIM_FLAGS_RESET_SENSITIVE 0x0002 188 #define I2O_CLAIM_FLAGS_STATE_SENSITIVE 0x0004 189 #define I2O_CLAIM_FLAGS_CAPACITY_SENSITIVE 0x0008 190 #define I2O_CLAIM_FLAGS_PEER_SERVICE_DISABLED 0x0010 191 #define I2O_CLAIM_FLAGS_MGMT_SERVICE_DISABLED 0x0020 192 193 /* Claim Type defines */ 194 195 #define I2O_CLAIM_TYPE_PRIMARY_USER 0x01 196 #define I2O_CLAIM_TYPE_AUTHORIZED_USER 0x02 197 #define I2O_CLAIM_TYPE_SECONDARY_USER 0x03 198 #define I2O_CLAIM_TYPE_MANAGEMENT_USER 0x04 199 200 /* UtilClaim Function Message Frame structure. */ 201 202 typedef struct _I2O_UTIL_CLAIM_MESSAGE { 203 I2O_MESSAGE_FRAME StdMessageFrame; 204 I2O_TRANSACTION_CONTEXT TransactionContext; 205 U16 ClaimFlags; 206 U8 reserved; 207 U8 ClaimType; 208 } I2O_UTIL_CLAIM_MESSAGE, *PI2O_UTIL_CLAIM_MESSAGE; 209 210 211 /****************************************************************************/ 212 213 /* Claim Release Flag defines */ 214 215 #define I2O_RELEASE_FLAGS_CONDITIONAL 0x0001 216 217 /* UtilClaimRelease Function Message Frame structure. */ 218 219 typedef struct _I2O_UTIL_CLAIM_RELEASE_MESSAGE { 220 I2O_MESSAGE_FRAME StdMessageFrame; 221 I2O_TRANSACTION_CONTEXT TransactionContext; 222 U16 ReleaseFlags; 223 U8 reserved; 224 U8 ClaimType; 225 } I2O_UTIL_CLAIM_RELEASE_MESSAGE, *PI2O_UTIL_CLAIM_RELEASE_MESSAGE; 226 227 228 /****************************************************************************/ 229 230 /* UtilConfigDialog Function Message Frame structure */ 231 232 typedef struct _I2O_UTIL_CONFIG_DIALOG_MESSAGE { 233 I2O_MESSAGE_FRAME StdMessageFrame; 234 I2O_TRANSACTION_CONTEXT TransactionContext; 235 U32 PageNumber; 236 I2O_SG_ELEMENT SGL; 237 } I2O_UTIL_CONFIG_DIALOG_MESSAGE, *PI2O_UTIL_CONFIG_DIALOG_MESSAGE; 238 239 240 /****************************************************************************/ 241 242 /* Event Acknowledge Function Message Frame structure */ 243 244 typedef struct _I2O_UTIL_EVENT_ACK_MESSAGE { 245 I2O_MESSAGE_FRAME StdMessageFrame; 246 I2O_TRANSACTION_CONTEXT TransactionContext; 247 U32 EventIndicator; 248 U32 EventData[1]; 249 } I2O_UTIL_EVENT_ACK_MESSAGE, *PI2O_UTIL_EVENT_ACK_MESSAGE; 250 251 /* Event Ack Reply structure */ 252 253 typedef struct _I2O_UTIL_EVENT_ACK_REPLY { 254 I2O_MESSAGE_FRAME StdMessageFrame; 255 I2O_TRANSACTION_CONTEXT TransactionContext; 256 U32 EventIndicator; 257 U32 EventData[1]; 258 } I2O_UTIL_EVENT_ACK_REPLY, *PI2O_UTIL_EVENT_ACK_REPLY; 259 260 261 /****************************************************************************/ 262 263 /* Event Indicator Mask Flags */ 264 265 #define I2O_EVENT_IND_STATE_CHANGE 0x80000000 266 #define I2O_EVENT_IND_GENERAL_WARNING 0x40000000 267 #define I2O_EVENT_IND_CONFIGURATION_FLAG 0x20000000 268 /* #define I2O_EVENT_IND_RESERVE_RELEASE 0x10000000 */ 269 #define I2O_EVENT_IND_LOCK_RELEASE 0x10000000 270 #define I2O_EVENT_IND_CAPABILITY_CHANGE 0x08000000 271 #define I2O_EVENT_IND_DEVICE_RESET 0x04000000 272 #define I2O_EVENT_IND_EVENT_MASK_MODIFIED 0x02000000 273 #define I2O_EVENT_IND_FIELD_MODIFIED 0x01000000 274 #define I2O_EVENT_IND_VENDOR_EVENT 0x00800000 275 #define I2O_EVENT_IND_DEVICE_STATE 0x00400000 276 277 /* Event Data for generic Events */ 278 279 #define I2O_EVENT_STATE_CHANGE_NORMAL 0x00 280 #define I2O_EVENT_STATE_CHANGE_SUSPENDED 0x01 281 #define I2O_EVENT_STATE_CHANGE_RESTART 0x02 282 #define I2O_EVENT_STATE_CHANGE_NA_RECOVER 0x03 283 #define I2O_EVENT_STATE_CHANGE_NA_NO_RECOVER 0x04 284 #define I2O_EVENT_STATE_CHANGE_QUIESCE_REQUEST 0x05 285 #define I2O_EVENT_STATE_CHANGE_FAILED 0x10 286 #define I2O_EVENT_STATE_CHANGE_FAULTED 0x11 287 288 #define I2O_EVENT_GEN_WARNING_NORMAL 0x00 289 #define I2O_EVENT_GEN_WARNING_ERROR_THRESHOLD 0x01 290 #define I2O_EVENT_GEN_WARNING_MEDIA_FAULT 0x02 291 292 #define I2O_EVENT_CAPABILITY_OTHER 0x01 293 #define I2O_EVENT_CAPABILITY_CHANGED 0x02 294 295 #define I2O_EVENT_SENSOR_STATE_CHANGED 0x01 296 297 298 /* UtilEventRegister Function Message Frame structure */ 299 300 typedef struct _I2O_UTIL_EVENT_REGISTER_MESSAGE { 301 I2O_MESSAGE_FRAME StdMessageFrame; 302 I2O_TRANSACTION_CONTEXT TransactionContext; 303 U32 EventMask; 304 } I2O_UTIL_EVENT_REGISTER_MESSAGE, *PI2O_UTIL_EVENT_REGISTER_MESSAGE; 305 306 /* UtilEventRegister Reply structure */ 307 308 typedef struct _I2O_UTIL_EVENT_REGISTER_REPLY { 309 I2O_MESSAGE_FRAME StdMessageFrame; 310 I2O_TRANSACTION_CONTEXT TransactionContext; 311 U32 EventIndicator; 312 U32 EventData[1]; 313 } I2O_UTIL_EVENT_REGISTER_REPLY, *PI2O_UTIL_EVENT_REGISTER_REPLY; 314 315 316 /****************************************************************************/ 317 318 /* UtilLock Function Message Frame structure. */ 319 320 typedef struct _I2O_UTIL_LOCK_MESSAGE { 321 I2O_MESSAGE_FRAME StdMessageFrame; 322 I2O_TRANSACTION_CONTEXT TransactionContext; 323 } I2O_UTIL_LOCK_MESSAGE, *PI2O_UTIL_LOCK_MESSAGE; 324 325 /****************************************************************************/ 326 327 /* UtilLockRelease Function Message Frame structure. */ 328 329 typedef struct _I2O_UTIL_LOCK_RELEASE_MESSAGE { 330 I2O_MESSAGE_FRAME StdMessageFrame; 331 I2O_TRANSACTION_CONTEXT TransactionContext; 332 } I2O_UTIL_LOCK_RELEASE_MESSAGE, *PI2O_UTIL_LOCK_RELEASE_MESSAGE; 333 334 335 /****************************************************************************/ 336 337 /* UtilNOP Function Message Frame structure. */ 338 339 typedef struct _I2O_UTIL_NOP_MESSAGE { 340 I2O_MESSAGE_FRAME StdMessageFrame; 341 } I2O_UTIL_NOP_MESSAGE, *PI2O_UTIL_NOP_MESSAGE; 342 343 344 /****************************************************************************/ 345 346 /* UtilParamsGet Message Frame structure. */ 347 348 typedef struct _I2O_UTIL_PARAMS_GET_MESSAGE { 349 I2O_MESSAGE_FRAME StdMessageFrame; 350 I2O_TRANSACTION_CONTEXT TransactionContext; 351 U32 OperationFlags; 352 I2O_SG_ELEMENT SGL; 353 } I2O_UTIL_PARAMS_GET_MESSAGE, *PI2O_UTIL_PARAMS_GET_MESSAGE; 354 355 356 /****************************************************************************/ 357 358 /* UtilParamsSet Message Frame structure. */ 359 360 typedef struct _I2O_UTIL_PARAMS_SET_MESSAGE { 361 I2O_MESSAGE_FRAME StdMessageFrame; 362 I2O_TRANSACTION_CONTEXT TransactionContext; 363 U32 OperationFlags; 364 I2O_SG_ELEMENT SGL; 365 } I2O_UTIL_PARAMS_SET_MESSAGE, *PI2O_UTIL_PARAMS_SET_MESSAGE; 366 367 368 /****************************************************************************/ 369 370 /* UtilReplyFaultNotify Message for Message Failure. */ 371 372 typedef struct _I2O_UTIL_REPLY_FAULT_NOTIFY_MESSAGE { 373 I2O_MESSAGE_FRAME StdMessageFrame; 374 I2O_TRANSACTION_CONTEXT TransactionContext; 375 U8 LowestVersion; 376 U8 HighestVersion; 377 BF Severity:I2O_FAILCODE_SEVERITY_SZ; 378 BF FailureCode:I2O_FAILCODE_CODE_SZ; 379 BF FailingIOP_ID:I2O_IOP_ID_SZ; 380 BF reserved:I2O_RESERVED_4BITS; 381 BF FailingHostUnitID:I2O_UNIT_ID_SZ; 382 U32 AgeLimit; 383 #if I2O_64BIT_CONTEXT 384 PI2O_MESSAGE_FRAME OriginalMFA; 385 #else 386 PI2O_MESSAGE_FRAME OriginalMFALowPart; 387 U32 OriginalMFAHighPart; /* Always 0000 */ 388 #endif 389 } I2O_UTIL_REPLY_FAULT_NOTIFY_MESSAGE, *PI2O_UTIL_REPLY_FAULT_NOTIFY_MESSAGE; 390 391 392 /****************************************************************************/ 393 394 /* Device Reserve Function Message Frame structure. */ 395 /* NOTE: This was previously called the Reserve Message */ 396 397 typedef struct _I2O_UTIL_DEVICE_RESERVE_MESSAGE { 398 I2O_MESSAGE_FRAME StdMessageFrame; 399 I2O_TRANSACTION_CONTEXT TransactionContext; 400 } I2O_UTIL_DEVICE_RESERVE_MESSAGE, *PI2O_UTIL_DEVICE_RESERVE_MESSAGE; 401 402 403 /****************************************************************************/ 404 405 /* Device Release Function Message Frame structure. */ 406 /* NOTE: This was previously called the ReserveRelease Message */ 407 408 typedef struct _I2O_UTIL_DEVICE_RELEASE_MESSAGE { 409 I2O_MESSAGE_FRAME StdMessageFrame; 410 I2O_TRANSACTION_CONTEXT TransactionContext; 411 } I2O_UTIL_DEVICE_RELEASE_MESSAGE, *PI2O_UTIL_DEVICE_RELEASE_MESSAGE; 412 413 414 /****************************************************************************/ 415 416 PRAGMA_PACK_POP 417 PRAGMA_ALIGN_POP 418 419 #endif /* I2O_UTILITY_HDR */ 420