i2oadptr.h revision 96554
1/**************************************************************** 2 * Copyright (c) 1996-2000 Distributed Processing Technology Corporation 3 * Copyright (c) 2000 Adaptec Corproation. 4 * All rights reserved. 5 * 6 * Copyright 1999 I2O Special Interest Group (I2O SIG). All rights reserved. 7 * All rights reserved 8 * 9 * TERMS AND CONDITIONS OF USE 10 * 11 * Redistribution and use in source form, with or without modification, are 12 * permitted provided that redistributions of source code must retain the 13 * above copyright notice, this list of conditions and the following disclaimer. 14 * 15 * This software is provided `as is' by Distributed Processing Technology and 16 * any express or implied warranties, including, but not limited to, the 17 * implied warranties of merchantability and fitness for a particular purpose, 18 * are disclaimed. In no event shall Distributed Processing Technology be 19 * liable for any direct, indirect, incidental, special, exemplary or 20 * consequential damages (including, but not limited to, procurement of 21 * substitute goods or services; loss of use, data, or profits; or business 22 * interruptions) however caused and on any theory of liability, whether in 23 * contract, strict liability, or tort (including negligence or otherwise) 24 * arising in any way out of the use of this driver software, even if advised 25 * of the possibility of such damage. 26 * 27 * This header file, and any modifications of this header file, are provided 28 * contingent upon your agreement and adherence to the here-listed terms and 29 * conditions. By accepting and/or using this header file, you agree to abide 30 * by these terms and conditions and that these terms and conditions will be 31 * construed and governed in accordance with the laws of the State of California, 32 * without reference to conflict-of-law provisions. If you do not agree 33 * to these terms and conditions, please delete this file, and any copies, 34 * permanently, without making any use thereof. 35 * 36 * THIS HEADER FILE IS PROVIDED FREE OF CHARGE ON AN AS-IS BASIS WITHOUT 37 * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 38 * TO IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 39 * PURPOSE. I2O SIG DOES NOT WARRANT THAT THIS HEADER FILE WILL MEET THE 40 * USER'S REQUIREMENTS OR THAT ITS OPERATION WILL BE UNINTERRUPTED OR 41 * ERROR-FREE. 42 * 43 * I2O SIG DISCLAIMS ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF 44 * ANY PROPRIETARY RIGHTS, RELATING TO THE IMPLEMENTATION OF THE I2O 45 * SPECIFICATIONS. I2O SIG DOES NOT WARRANT OR REPRESENT THAT SUCH 46 * IMPLEMENTATIONS WILL NOT INFRINGE SUCH RIGHTS. 47 * 48 * THE USER OF THIS HEADER FILE SHALL HAVE NO RECOURSE TO I2O SIG FOR ANY 49 * ACTUAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, LOST DATA 50 * OR LOST PROFITS ARISING OUT OF THE USE OR INABILITY TO USE THIS PROGRAM. 51 * 52 * I2O SIG grants the user of this header file a license to copy, distribute, 53 * and modify it, for any purpose, under the following terms. Any copying, 54 * distribution, or modification of this header file must not delete or alter 55 * the copyright notice of I2O SIG or any of these Terms and Conditions. 56 * 57 * Any distribution of this header file must not include a charge for the 58 * header file (unless such charges are strictly for the physical acts of 59 * copying or transferring copies). However, distribution of a product in 60 * which this header file is embedded may include a charge so long as any 61 * such charge does not include any charge for the header file itself. 62 * 63 * Any modification of this header file constitutes a derivative work based 64 * on this header file. Any distribution of such derivative work: (1) must 65 * include prominent notices that the header file has been changed from the 66 * original, together with the dates of any changes; (2) automatically includes 67 * this same license to the original header file from I2O SIG, without any 68 * restriction thereon from the distributing user; and (3) must include a 69 * grant of license of the modified file under the same terms and conditions 70 * as these Terms and Conditions. 71 * 72 * The I2O SIG Web site can be found at: http://www.i2osig.org 73 * 74 * The I2O SIG encourages you to deposit derivative works based on this 75 * header file at the I2O SIG Web site. Furthermore, to become a Registered 76 * Developer of the I2O SIG, sign up at the Web site or call 415.750.8352 77 * (United States). 78 * 79 * $FreeBSD: head/sys/dev/asr/i2oadptr.h 96554 2002-05-14 01:09:03Z obrien $ 80 * 81 ****************************************************************/ 82 83#if !defined(I2O_ADPTR_HDR) 84#define I2O_ADPTR_HDR 85 86#if ((defined(KERNEL) || defined(_KERNEL)) && defined(__FreeBSD__)) 87# if (KERN_VERSION < 3) 88# include "i386/pci/i2omsg.h" 89# else 90# include "dev/asr/i2omsg.h" 91# endif 92#else 93# include "i2omsg.h" /* Include the Base Message file */ 94#endif 95 96 97#define I2OADPTR_REV 1_5_1 /* Header file revision string */ 98 99 100/***************************************************************************** 101 * 102 * i2oadptr.h -- I2O Adapter Class Message defintion file 103 * 104 * 105 * Revision History: 106 * 107 * 1.5.d 03/06/97 - First definition for spec. draft version 1.5d. 108 * 1.5.1 05/02/97 - Corrections from review cycle: 109 * 1) Remove "SCSI" from function definition comment. 110 * 2) Add revision string. 111 * 3) Convert tabs to spaces. 112 * 4) New disclaimer. 113 * 114 * 115 * 116 *****************************************************************************/ 117 118/* 119 NOTES: 120 121 Gets, reads, receives, etc. are all even numbered functions. 122 Sets, writes, sends, etc. are all odd numbered functions. 123 Functions that both send and receive data can be either but an attempt is made 124 to use the function number that indicates the greater transfer amount. 125 Functions that do not send or receive data use odd function numbers. 126 127 Some functions are synonyms like read, receive and send, write. 128 129 All common functions will have a code of less than 0x80. 130 Unique functions to a class will start at 0x80. 131 Executive Functions start at 0xA0. 132 133 Utility Message function codes range from 0 - 0x1f 134 Base Message function codes range from 0x20 - 0xfe 135 Private Message function code is 0xff. 136*/ 137 138 139PRAGMA_ALIGN_PUSH 140 141PRAGMA_PACK_PUSH 142 143/* 144 Bus Adapter Class specific functions 145*/ 146 147#define I2O_HBA_ADAPTER_RESET 0x85 148#define I2O_HBA_BUS_QUIESCE 0x8b 149#define I2O_HBA_BUS_RESET 0x87 150#define I2O_HBA_BUS_SCAN 0x89 151 152 153/* 154 Detailed Status Codes for HBA operations 155 156 Note: 157 The 16-bit Detailed Status Code field for HBA operations is divided 158 into two separate 8-bit fields. The lower 8 bits are reserved. The 159 upper 8 bits are used to report Adapter Status information. The 160 definitions for these two fields, however, will be consistent with 161 the standard reply message frame structure declaration, which treats 162 this as a single 16-bit field. In addition, the values used will be 163 consistent with the Adapter Status codes defined for the SCSI 164 Peripheral class. Theses codes are based on CAM-1. In other words, 165 these definitions are a subset of the SCSI peripheral class codes. 166 Where applicable, "SCSI" has been removed from the definition. 167*/ 168 169 170#define I2O_HBA_DSC_MASK 0xFF00 171 172#define I2O_HBA_DSC_SUCCESS 0x0000 173#define I2O_HBA_DSC_ADAPTER_BUSY 0x0500 174#define I2O_HBA_DSC_COMMAND_TIMEOUT 0x0B00 175#define I2O_HBA_DSC_COMPLETE_WITH_ERROR 0x0400 176#define I2O_HBA_DSC_FUNCTION_UNAVAILABLE 0x3A00 177#define I2O_HBA_DSC_NO_ADAPTER 0x1100 178#define I2O_HBA_DSC_PARITY_ERROR_FAILURE 0x0F00 179#define I2O_HBA_DSC_PATH_INVALID 0x0700 180#define I2O_HBA_DSC_PROVIDE_FAILURE 0x1600 181#define I2O_HBA_DSC_QUEUE_FROZEN 0x4000 182#define I2O_HBA_DSC_REQUEST_ABORTED 0x0200 183#define I2O_HBA_DSC_REQUEST_INVALID 0x0600 184#define I2O_HBA_DSC_REQUEST_LENGTH_ERROR 0x1500 185#define I2O_HBA_DSC_REQUEST_TERMINATED 0x1800 186#define I2O_HBA_DSC_RESOURCE_UNAVAILABLE 0x3400 187#define I2O_HBA_DSC_BUS_BUSY 0x3F00 188#define I2O_HBA_DSC_BUS_RESET 0x0E00 189#define I2O_HBA_DSC_ID_INVALID 0x3900 190#define I2O_HBA_DSC_SEQUENCE_FAILURE 0x1400 191#define I2O_HBA_DSC_UNABLE_TO_ABORT 0x0300 192#define I2O_HBA_DSC_UNABLE_TO_TERMINATE 0x0900 193#define I2O_HBA_DSC_UNACKNOWLEDGED_EVENT 0x3500 194#define I2O_HBA_DSC_UNEXPECTED_BUS_FREE 0x1300 195 196 197 198/****************************************************************************/ 199 200/* Bus Adapter Parameter Groups */ 201 202/****************************************************************************/ 203 204 205#define I2O_HBA_CONTROLLER_INFO_GROUP_NO 0x0000 206#define I2O_HBA_HISTORICAL_STATS_GROUP_NO 0x0100 207#define I2O_HBA_SCSI_CONTROLLER_INFO_GROUP_NO 0x0200 208#define I2O_HBA_SCSI_BUS_PORT_INFO_GROUP_NO 0x0201 209#define I2O_HBA_FCA_CONTROLLER_INFO_GROUP_NO 0x0300 210#define I2O_HBA_FCA_PORT_INFO_GROUP_NO 0x0301 211 212 213/* - 0000h - HBA Controller Information Parameter Group */ 214 215/* Bus Type */ 216 217#define I2O_HBA_BUS_TYPE_GENERIC 0x00 218#define I2O_HBA_BUS_TYPE_SCSI 0x01 219#define I2O_HBA_BUS_TYPE_FCA 0x10 220 221 222typedef struct _I2O_HBA_CONTROLLER_INFO_SCALAR { 223 U8 BusType; 224 U8 BusState; 225 U16 Reserved2; 226 U8 BusName[12]; 227} I2O_HBA_CONTROLLER_INFO_SCALAR, *PI2O_HBA_CONTROLLER_INFO_SCALAR; 228 229 230/* - 0100h - HBA Historical Stats Parameter Group */ 231 232typedef struct _I2O_HBA_HIST_STATS_SCALAR { 233 U32 TimeLastPoweredUp; 234 U32 TimeLastReset; 235} I2O_HBA_HIST_STATS_SCALAR, *PI2O_HBA_HIST_STATS_SCALAR; 236 237 238/* - 0200h - HBA SCSI Controller Information Parameter Group */ 239 240/* SCSI Type */ 241 242#define I2O_SCSI_TYPE_UNKNOWN 0x00 243#define I2O_SCSI_TYPE_SCSI_1 0x01 244#define I2O_SCSI_TYPE_SCSI_2 0x02 245#define I2O_SCSI_TYPE_SCSI_3 0x03 246 247/* Protection Management */ 248 249#define I2O_SCSI_PORT_PROT_OTHER 0x00 250#define I2O_SCSI_PORT_PROT_UNKNOWN 0x01 251#define I2O_SCSI_PORT_PROT_UNPROTECTED 0x02 252#define I2O_SCSI_PORT_PROT_PROTECTED 0x03 253#define I2O_SCSI_PORT_PROT_SCC 0x04 254 255/* Settings */ 256 257#define I2O_SCSI_PORT_PARITY_FLAG 0x01 258#define I2O_SCSI_PORT_PARITY_DISABLED 0x00 259#define I2O_SCSI_PORT_PARITY_ENABLED 0x01 260 261#define I2O_SCSI_PORT_SCAN_ORDER_FLAG 0x02 262#define I2O_SCSI_PORT_SCAN_LOW_TO_HIGH 0x00 263#define I2O_SCSI_PORT_SCAN_HIGH_TO_LOW 0x02 264 265#define I2O_SCSI_PORT_IID_FLAG 0x04 266#define I2O_SCSI_PORT_IID_DEFAULT 0x00 267#define I2O_SCSI_PORT_IID_SPECIFIED 0x04 268 269#define I2O_SCSI_PORT_SCAM_FLAG 0x08 270#define I2O_SCSI_PORT_SCAM_DISABLED 0x00 271#define I2O_SCSI_PORT_SCAM_ENABLED 0x08 272 273#define I2O_SCSI_PORT_TYPE_FLAG 0x80 274#define I2O_SCSI_PORT_TYPE_PARALLEL 0x00 275#define I2O_SCSI_PORT_TYPE_SERIAL 0x80 276 277typedef struct _I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR { 278 U8 SCSIType; 279 U8 ProtectionManagement; 280 U8 Settings; 281 U8 Reserved1; 282 U32 InitiatorID; 283 U64 ScanLun0Only; 284 U16 DisableDevice; 285 U8 MaxOffset; 286 U8 MaxDataWidth; 287 U64 MaxSyncRate; 288} I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR, *PI2O_HBA_SCSI_CONTROLLER_INFO_SCALAR; 289 290 291/* - 0201h - HBA SCSI Bus Port Information Parameter Group */ 292 293/* NOTE: Refer to the SCSI Peripheral Class Bus Port Information Parameter 294 Group field definitions for HBA SCSI Bus Port field definitions. 295 */ 296 297typedef struct _I2O_HBA_SCSI_BUS_PORT_INFO_SCALAR { 298 U8 PhysicalInterface; 299 U8 ElectricalInterface; 300 U8 Isochronous; 301 U8 ConnectorType; 302 U8 ConnectorGender; 303 U8 Reserved1; 304 U16 Reserved2; 305 U32 MaxNumberDevices; 306 U32 DeviceIdBegin; 307 U32 DeviceIdEnd; 308 U8 LunBegin[8]; 309 U8 LunEnd[8]; 310} I2O_HBA_SCSI_BUS_PORT_INFO_SCALAR, *PI2O_HBA_SCSI_BUS_PORT_INFO_SCALAR; 311 312 313/* - 0300h - HBA FCA Controller Information Parameters Group defines */ 314 315/* SCSI Type */ 316 317#define I2O_FCA_TYPE_UNKNOWN 0x00 318#define I2O_FCA_TYPE_FCAL 0x01 319 320typedef struct _I2O_HBA_FCA_CONTROLLER_INFO_SCALAR { 321 U8 FcaType; 322 U8 Reserved1; 323 U16 Reserved2; 324} I2O_HBA_FCA_CONTROLLER_INFO_SCALAR, *PI2O_HBA_FCA_CONTROLLER_INFO_SCALAR; 325 326 327/* - 0301h - HBA FCA Port Information Parameters Group defines */ 328 329typedef struct _I2O_HBA_FCA_PORT_INFO_SCALAR { 330 U32 Reserved4; 331} I2O_HBA_FCA_PORT_INFO_SCALAR, *PI2O_HBA_FCA_PORT_INFO_SCALAR; 332 333 334/****************************************************************************/ 335 336/* I2O Bus Adapter Class Specific Message Definitions */ 337 338/****************************************************************************/ 339 340 341/****************************************************************************/ 342 343/* I2O Bus Adapter Class Reply Message Frame */ 344 345typedef struct _I2O_HBA_REPLY_MESSAGE_FRAME { 346 I2O_SINGLE_REPLY_MESSAGE_FRAME StdReplyFrame; 347} I2O_HBA_REPLY_MESSAGE_FRAME, *PI2O_HBA_REPLY_MESSAGE_FRAME; 348 349 350/****************************************************************************/ 351 352/* I2O HBA Adapter Reset Message Frame */ 353 354typedef struct _I2O_HBA_ADAPTER_RESET_MESSAGE { 355 I2O_MESSAGE_FRAME StdMessageFrame; 356 I2O_TRANSACTION_CONTEXT TransactionContext; 357} I2O_HBA_ADAPTER_RESET_MESSAGE, *PI2O_HBA_ADAPTER_RESET_MESSAGE; 358 359 360/****************************************************************************/ 361 362/* I2O HBA Bus Quiesce Message Frame */ 363 364typedef U32 I2O_HBQ_FLAGS; 365 366#define I2O_HBQ_FLAG_NORMAL 0x0000 367#define I2O_HBQ_FLAG_QUIESCE 0x0001 368 369typedef struct _I2O_HBA_BUS_QUIESCE_MESSAGE { 370 I2O_MESSAGE_FRAME StdMessageFrame; 371 I2O_TRANSACTION_CONTEXT TransactionContext; 372 I2O_HBQ_FLAGS Flags; 373} I2O_HBA_BUS_QUIESCE_MESSAGE, *PI2O_HBA_BUS_QUIESCE_MESSAGE; 374 375 376/****************************************************************************/ 377 378/* I2O HBA Bus Reset Message Frame */ 379 380typedef struct _I2O_HBA_BUS_RESET_MESSAGE { 381 I2O_MESSAGE_FRAME StdMessageFrame; 382 I2O_TRANSACTION_CONTEXT TransactionContext; 383} I2O_HBA_BUS_RESET_MESSAGE, *PI2O_HBA_BUS_RESET_MESSAGE; 384 385 386/****************************************************************************/ 387 388/* I2O HBA Bus Scan Message Frame */ 389 390/* NOTE: SCSI-2 8-bit scalar LUN goes into offset 1 of Lun arrays */ 391 392typedef struct _I2O_HBA_BUS_SCAN_MESSAGE { 393 I2O_MESSAGE_FRAME StdMessageFrame; 394 I2O_TRANSACTION_CONTEXT TransactionContext; 395} I2O_HBA_BUS_SCAN_MESSAGE, *PI2O_HBA_BUS_SCAN_MESSAGE; 396 397 398PRAGMA_PACK_POP 399 400PRAGMA_ALIGN_POP 401 402#endif /* I2O_ADPTR_HDR */ 403 404 405