1/**************************************************************** 2 * Copyright (c) 1996-2000 Distributed Processing Technology Corporation 3 * Copyright (c) 2000 Adaptec Corporation. 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 * --- 6 unchanged lines hidden (view full) --- 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 --- 18 unchanged lines hidden (view full) --- 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/i2obscsi.h 96554 2002-05-14 01:09:03Z obrien $ |
80 * 81 ****************************************************************/ 82 83#if !defined(I2O_BASE_SCSI_HDR) |
84#define I2O_BASE_SCSI_HDR |
85 86#if ((defined(KERNEL) || defined(_KERNEL)) && defined(__FreeBSD__)) 87# if (KERN_VERSION < 3) |
88# include "i386/pci/i2omsg.h" /* Include the Base Message file */ |
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 I2OBSCSI_REV 1_5_1 /* Header file revision string */ |
98 99 100 101/***************************************************************************** 102 * 103 * I2OBSCSI.h -- I2O Base SCSI Device Class Message defintion file 104 * |
105 * This file contains information presented in Chapter 6, Section 6 & 7 of 106 * the I2O Specification. |
107 * 108 * Revision History: (Revision History tracks the revision number of the I2O |
109 * specification) |
110 * |
111 * .92 - First marked revsion used for Proof of Concept. 112 * .93 - Change to match the rev .93 of the spec. 113 * .95 - Updated to Rev .95 of 2/5/96. |
114 * 1.00 - Checked and Updated against spec version 1.00 4/9/96. 115 * 1.xx - Updated to the 1.x version of the I2O Specification on 11/11/96. 116 * 1.xx - 11/14/96 |
117 * 1) Removed duplicate device type definitions. 118 * 2) Added "DSC" to Detailed Status Code definitions. 119 * 3) Changed SCSI-3 LUN fields from U64 to U8 array. |
120 * 1.xx 11/15/96 - Added #pragma statments for i960. 121 * 1.xx 11/20/96 - Changed duplicate Bus Scan structure to Bus Reset. 122 * 1.xx 12/05/96 - Added Auto Request Sense flag definition. 123 * 1.5d 03/06/97 - Update for spec. draft version 1.5d. |
124 * 1) Converted SCSI bus adapter class to generic in i2oadptr.h. 125 * 2) Fixed DSC reference: changed from _BUS_SCAN to _BUS_RESET. |
126 * 1.5d 03/031/97 - Made AutoSense flag definition consistent with spec. 127 * 1.5d 04/11/97 - Corrections from review cycle: |
128 * 1) Corrected typo in I2O_SCSI_PERIPHERAL_TYPE_PARALLEL. 129 * 2) Corrected typo in I2O_SCSI_PORT_CONN_UNSHIELDED_P_HD. |
130 * 1.5.1 05/02/97 - Corrections from review cycle: |
131 * 1) Remove #include for i2omstor.h. 132 * 2) Add revision string. 133 * 3) Convert tabs to spaces. 134 * 4) New disclaimer. |
135 * 136 *****************************************************************************/ 137 138/* 139 NOTES: 140 141 Gets, reads, receives, etc. are all even numbered functions. 142 Sets, writes, sends, etc. are all odd numbered functions. --- 18 unchanged lines hidden (view full) --- 161 162/* 163 SCSI Peripheral Class specific functions 164 165 Although the names are SCSI Peripheral class specific, the values 166 assigned are common with other classes when applicable. 167*/ 168 |
169#define I2O_SCSI_DEVICE_RESET 0x27 170#define I2O_SCSI_SCB_ABORT 0x83 171#define I2O_SCSI_SCB_EXEC 0x81 |
172 173/* 174 Detailed Status Codes for SCSI operations 175 176 The 16-bit Detailed Status Code field for SCSI operations is divided 177 into two separate 8-bit fields. The lower 8 bits are used to report |
178 Device Status information. The upper 8 bits are used to report 179 Adapter Status information. The definitions for these two fields, |
180 however, will be consistent with the standard reply message frame 181 structure declaration, which treats this as a single 16-bit field. 182*/ 183 184 185/* SCSI Device Completion Status Codes (defined by SCSI-2/3)*/ 186 |
187#define I2O_SCSI_DEVICE_DSC_MASK 0x00FF |
188 |
189#define I2O_SCSI_DSC_SUCCESS 0x0000 190#define I2O_SCSI_DSC_CHECK_CONDITION 0x0002 191#define I2O_SCSI_DSC_BUSY 0x0008 192#define I2O_SCSI_DSC_RESERVATION_CONFLICT 0x0018 193#define I2O_SCSI_DSC_COMMAND_TERMINATED 0x0022 194#define I2O_SCSI_DSC_TASK_SET_FULL 0x0028 195#define I2O_SCSI_DSC_ACA_ACTIVE 0x0030 |
196 197/* SCSI Adapter Status Codes (based on CAM-1) */ 198 |
199#define I2O_SCSI_HBA_DSC_MASK 0xFF00 |
200 |
201#define I2O_SCSI_HBA_DSC_SUCCESS 0x0000 |
202 |
203#define I2O_SCSI_HBA_DSC_REQUEST_ABORTED 0x0200 204#define I2O_SCSI_HBA_DSC_UNABLE_TO_ABORT 0x0300 205#define I2O_SCSI_HBA_DSC_COMPLETE_WITH_ERROR 0x0400 206#define I2O_SCSI_HBA_DSC_ADAPTER_BUSY 0x0500 207#define I2O_SCSI_HBA_DSC_REQUEST_INVALID 0x0600 208#define I2O_SCSI_HBA_DSC_PATH_INVALID 0x0700 209#define I2O_SCSI_HBA_DSC_DEVICE_NOT_PRESENT 0x0800 210#define I2O_SCSI_HBA_DSC_UNABLE_TO_TERMINATE 0x0900 211#define I2O_SCSI_HBA_DSC_SELECTION_TIMEOUT 0x0A00 212#define I2O_SCSI_HBA_DSC_COMMAND_TIMEOUT 0x0B00 |
213 |
214#define I2O_SCSI_HBA_DSC_MR_MESSAGE_RECEIVED 0x0D00 215#define I2O_SCSI_HBA_DSC_SCSI_BUS_RESET 0x0E00 216#define I2O_SCSI_HBA_DSC_PARITY_ERROR_FAILURE 0x0F00 217#define I2O_SCSI_HBA_DSC_AUTOSENSE_FAILED 0x1000 218#define I2O_SCSI_HBA_DSC_NO_ADAPTER 0x1100 219#define I2O_SCSI_HBA_DSC_DATA_OVERRUN 0x1200 220#define I2O_SCSI_HBA_DSC_UNEXPECTED_BUS_FREE 0x1300 221#define I2O_SCSI_HBA_DSC_SEQUENCE_FAILURE 0x1400 222#define I2O_SCSI_HBA_DSC_REQUEST_LENGTH_ERROR 0x1500 223#define I2O_SCSI_HBA_DSC_PROVIDE_FAILURE 0x1600 224#define I2O_SCSI_HBA_DSC_BDR_MESSAGE_SENT 0x1700 225#define I2O_SCSI_HBA_DSC_REQUEST_TERMINATED 0x1800 |
226 |
227#define I2O_SCSI_HBA_DSC_IDE_MESSAGE_SENT 0x3300 228#define I2O_SCSI_HBA_DSC_RESOURCE_UNAVAILABLE 0x3400 229#define I2O_SCSI_HBA_DSC_UNACKNOWLEDGED_EVENT 0x3500 230#define I2O_SCSI_HBA_DSC_MESSAGE_RECEIVED 0x3600 231#define I2O_SCSI_HBA_DSC_INVALID_CDB 0x3700 232#define I2O_SCSI_HBA_DSC_LUN_INVALID 0x3800 233#define I2O_SCSI_HBA_DSC_SCSI_TID_INVALID 0x3900 234#define I2O_SCSI_HBA_DSC_FUNCTION_UNAVAILABLE 0x3A00 235#define I2O_SCSI_HBA_DSC_NO_NEXUS 0x3B00 236#define I2O_SCSI_HBA_DSC_SCSI_IID_INVALID 0x3C00 237#define I2O_SCSI_HBA_DSC_CDB_RECEIVED 0x3D00 238#define I2O_SCSI_HBA_DSC_LUN_ALREADY_ENABLED 0x3E00 239#define I2O_SCSI_HBA_DSC_BUS_BUSY 0x3F00 |
240 |
241#define I2O_SCSI_HBA_DSC_QUEUE_FROZEN 0x4000 |
242 243 244/****************************************************************************/ 245 246/* SCSI Peripheral Device Parameter Groups */ 247 248/****************************************************************************/ 249 250 251/* SCSI Configuration and Operating Structures and Defines */ 252 253 |
254#define I2O_SCSI_DEVICE_INFO_GROUP_NO 0x0000 255#define I2O_SCSI_DEVICE_BUS_PORT_INFO_GROUP_NO 0x0001 |
256 257 258/* - 0000h - SCSI Device Information Parameters Group defines */ 259 260/* Device Type */ 261 |
262#define I2O_SCSI_DEVICE_TYPE_DIRECT 0x00 263#define I2O_SCSI_DEVICE_TYPE_SEQUENTIAL 0x01 264#define I2O_SCSI_DEVICE_TYPE_PRINTER 0x02 265#define I2O_SCSI_DEVICE_TYPE_PROCESSOR 0x03 266#define I2O_SCSI_DEVICE_TYPE_WORM 0x04 267#define I2O_SCSI_DEVICE_TYPE_CDROM 0x05 268#define I2O_SCSI_DEVICE_TYPE_SCANNER 0x06 269#define I2O_SCSI_DEVICE_TYPE_OPTICAL 0x07 270#define I2O_SCSI_DEVICE_TYPE_MEDIA_CHANGER 0x08 271#define I2O_SCSI_DEVICE_TYPE_COMM 0x09 272#define I2O_SCSI_DEVICE_GRAPHICS_1 0x0A 273#define I2O_SCSI_DEVICE_GRAPHICS_2 0x0B 274#define I2O_SCSI_DEVICE_TYPE_ARRAY_CONT 0x0C 275#define I2O_SCSI_DEVICE_TYPE_SES 0x0D 276#define I2O_SCSI_DEVICE_TYPE_UNKNOWN 0x1F |
277 278/* Flags */ 279 |
280#define I2O_SCSI_PERIPHERAL_TYPE_FLAG 0x01 281#define I2O_SCSI_PERIPHERAL_TYPE_PARALLEL 0x00 282#define I2O_SCSI_PERIPHERAL_TYPE_SERIAL 0x01 |
283 |
284#define I2O_SCSI_RESERVED_FLAG 0x02 |
285 |
286#define I2O_SCSI_DISCONNECT_FLAG 0x04 287#define I2O_SCSI_DISABLE_DISCONNECT 0x00 288#define I2O_SCSI_ENABLE_DISCONNECT 0x04 |
289 |
290#define I2O_SCSI_MODE_MASK 0x18 291#define I2O_SCSI_MODE_SET_DATA 0x00 292#define I2O_SCSI_MODE_SET_DEFAULT 0x08 293#define I2O_SCSI_MODE_SET_SAFEST 0x10 |
294 |
295#define I2O_SCSI_DATA_WIDTH_MASK 0x60 296#define I2O_SCSI_DATA_WIDTH_8 0x00 297#define I2O_SCSI_DATA_WIDTH_16 0x20 298#define I2O_SCSI_DATA_WIDTH_32 0x40 |
299 |
300#define I2O_SCSI_SYNC_NEGOTIATION_FLAG 0x80 301#define I2O_SCSI_DISABLE_SYNC_NEGOTIATION 0x00 302#define I2O_SCSI_ENABLE_SYNC_NEGOTIATION 0x80 |
303 304 305/* - 0001h - SCSI Device Bus Port Info Parameters Group defines */ 306 307/* Physical */ 308 |
309#define I2O_SCSI_PORT_PHYS_OTHER 0x01 310#define I2O_SCSI_PORT_PHYS_UNKNOWN 0x02 311#define I2O_SCSI_PORT_PHYS_PARALLEL 0x03 312#define I2O_SCSI_PORT_PHYS_FIBRE_CHANNEL 0x04 313#define I2O_SCSI_PORT_PHYS_SERIAL_P1394 0x05 314#define I2O_SCSI_PORT_PHYS_SERIAL_SSA 0x06 |
315 316/* Electrical */ 317 |
318#define I2O_SCSI_PORT_ELEC_OTHER 0x01 319#define I2O_SCSI_PORT_ELEC_UNKNOWN 0x02 320#define I2O_SCSI_PORT_ELEC_SINGLE_ENDED 0x03 321#define I2O_SCSI_PORT_ELEC_DIFFERENTIAL 0x04 322#define I2O_SCSI_PORT_ELEC_LOW_VOLT_DIFF 0x05 323#define I2O_SCSI_PORT_ELEC_OPTICAL 0x06 |
324 325/* Isochronous */ 326 |
327#define I2O_SCSI_PORT_ISOC_NO 0x00 328#define I2O_SCSI_PORT_ISOC_YES 0x01 329#define I2O_SCSI_PORT_ISOC_UNKNOWN 0x02 |
330 331/* Connector Type */ 332 |
333#define I2O_SCSI_PORT_CONN_OTHER 0x01 334#define I2O_SCSI_PORT_CONN_UNKNOWN 0x02 335#define I2O_SCSI_PORT_CONN_NONE 0x03 336#define I2O_SCSI_PORT_CONN_SHIELDED_A_HD 0x04 337#define I2O_SCSI_PORT_CONN_UNSHIELDED_A_HD 0x05 338#define I2O_SCSI_PORT_CONN_SHIELDED_A_LD 0x06 339#define I2O_SCSI_PORT_CONN_UNSHIELDED_A_LD 0x07 340#define I2O_SCSI_PORT_CONN_SHIELDED_P_HD 0x08 341#define I2O_SCSI_PORT_CONN_UNSHIELDED_P_HD 0x09 342#define I2O_SCSI_PORT_CONN_SCA_I 0x0A 343#define I2O_SCSI_PORT_CONN_SCA_II 0x0B 344#define I2O_SCSI_PORT_CONN_FC_DB9 0x0C 345#define I2O_SCSI_PORT_CONN_FC_FIBRE 0x0D 346#define I2O_SCSI_PORT_CONN_FC_SCA_II_40 0x0E 347#define I2O_SCSI_PORT_CONN_FC_SCA_II_20 0x0F 348#define I2O_SCSI_PORT_CONN_FC_BNC 0x10 |
349 350/* Connector Gender */ 351 |
352#define I2O_SCSI_PORT_CONN_GENDER_OTHER 0x01 353#define I2O_SCSI_PORT_CONN_GENDER_UNKOWN 0x02 354#define I2O_SCSI_PORT_CONN_GENDER_FEMALE 0x03 355#define I2O_SCSI_PORT_CONN_GENDER_MALE 0x04 |
356 357 358/* SCSI Device Group 0000h - Device Information Parameter Group */ 359 360typedef struct _I2O_SCSI_DEVICE_INFO_SCALAR { |
361 U8 DeviceType; 362 U8 Flags; 363 U16 Reserved2; 364 U32 Identifier; 365 U8 LunInfo[8]; /* SCSI-2 8-bit scalar LUN goes into offset 1 */ 366 U32 QueueDepth; 367 U8 Reserved1a; 368 U8 NegOffset; 369 U8 NegDataWidth; 370 U8 Reserved1b; 371 U64 NegSyncRate; |
372 373} I2O_SCSI_DEVICE_INFO_SCALAR, *PI2O_SCSI_DEVICE_INFO_SCALAR; 374 375 376/* SCSI Device Group 0001h - Bus Port Information Parameter Group */ 377 378typedef struct _I2O_SCSI_BUS_PORT_INFO_SCALAR { |
379 U8 PhysicalInterface; 380 U8 ElectricalInterface; 381 U8 Isochronous; 382 U8 ConnectorType; 383 U8 ConnectorGender; 384 U8 Reserved1; 385 U16 Reserved2; 386 U32 MaxNumberDevices; |
387} I2O_SCSI_BUS_PORT_INFO_SCALAR, *PI2O_SCSI_BUS_PORT_INFO_SCALAR; 388 389 390 391/****************************************************************************/ 392 393/* I2O SCSI Peripheral Event Indicator Assignment */ 394 |
395#define I2O_SCSI_EVENT_SCSI_SMART 0x00000010 |
396 397 398/****************************************************************************/ 399 400/* SCSI Peripheral Class Specific Message Definitions */ 401 402/****************************************************************************/ 403 404 405/****************************************************************************/ 406 407/* I2O SCSI Peripheral Successful Completion Reply Message Frame */ 408 409typedef struct _I2O_SCSI_SUCCESS_REPLY_MESSAGE_FRAME { 410 I2O_SINGLE_REPLY_MESSAGE_FRAME StdReplyFrame; |
411 U32 TransferCount; |
412} I2O_SCSI_SUCCESS_REPLY_MESSAGE_FRAME, *PI2O_SCSI_SUCCESS_REPLY_MESSAGE_FRAME; 413 414 415/****************************************************************************/ 416 417/* I2O SCSI Peripheral Error Report Reply Message Frame */ 418 419#ifdef _WIN64 |
420#define I2O_SCSI_SENSE_DATA_SZ 44 |
421#else |
422#define I2O_SCSI_SENSE_DATA_SZ 40 |
423#endif 424 425typedef struct _I2O_SCSI_ERROR_REPLY_MESSAGE_FRAME { 426 I2O_SINGLE_REPLY_MESSAGE_FRAME StdReplyFrame; |
427 U32 TransferCount; 428 U32 AutoSenseTransferCount; 429 U8 SenseData[I2O_SCSI_SENSE_DATA_SZ]; |
430} I2O_SCSI_ERROR_REPLY_MESSAGE_FRAME, *PI2O_SCSI_ERROR_REPLY_MESSAGE_FRAME; 431 432 433/****************************************************************************/ 434 435/* I2O SCSI Device Reset Message Frame */ 436 437typedef struct _I2O_SCSI_DEVICE_RESET_MESSAGE { |
438 I2O_MESSAGE_FRAME StdMessageFrame; |
439 I2O_TRANSACTION_CONTEXT TransactionContext; 440} I2O_SCSI_DEVICE_RESET_MESSAGE, *PI2O_SCSI_DEVICE_RESET_MESSAGE; 441 442 443/****************************************************************************/ 444 445/* I2O SCSI Control Block Abort Message Frame */ 446 447typedef struct _I2O_SCSI_SCB_ABORT_MESSAGE { |
448 I2O_MESSAGE_FRAME StdMessageFrame; |
449 I2O_TRANSACTION_CONTEXT TransactionContext; 450 I2O_TRANSACTION_CONTEXT TransactionContextToAbort; 451} I2O_SCSI_SCB_ABORT_MESSAGE, *PI2O_SCSI_SCB_ABORT_MESSAGE; 452 453 454/****************************************************************************/ 455 456/* I2O SCSI Control Block Execute Message Frame */ 457 |
458#define I2O_SCSI_CDB_LENGTH 16 |
459 |
460typedef U16 I2O_SCB_FLAGS; |
461 |
462#define I2O_SCB_FLAG_XFER_DIR_MASK 0xC000 463#define I2O_SCB_FLAG_NO_DATA_XFER 0x0000 464#define I2O_SCB_FLAG_XFER_FROM_DEVICE 0x4000 465#define I2O_SCB_FLAG_XFER_TO_DEVICE 0x8000 |
466 |
467#define I2O_SCB_FLAG_ENABLE_DISCONNECT 0x2000 |
468 |
469#define I2O_SCB_FLAG_TAG_TYPE_MASK 0x0380 470#define I2O_SCB_FLAG_NO_TAG_QUEUEING 0x0000 471#define I2O_SCB_FLAG_SIMPLE_QUEUE_TAG 0x0080 472#define I2O_SCB_FLAG_HEAD_QUEUE_TAG 0x0100 473#define I2O_SCB_FLAG_ORDERED_QUEUE_TAG 0x0180 474#define I2O_SCB_FLAG_ACA_QUEUE_TAG 0x0200 |
475 |
476#define I2O_SCB_FLAG_AUTOSENSE_MASK 0x0060 477#define I2O_SCB_FLAG_DISABLE_AUTOSENSE 0x0000 478#define I2O_SCB_FLAG_SENSE_DATA_IN_MESSAGE 0x0020 479#define I2O_SCB_FLAG_SENSE_DATA_IN_BUFFER 0x0060 |
480 481typedef struct _I2O_SCSI_SCB_EXECUTE_MESSAGE { |
482 I2O_MESSAGE_FRAME StdMessageFrame; |
483 I2O_TRANSACTION_CONTEXT TransactionContext; |
484 U8 CDBLength; 485 U8 Reserved; 486 I2O_SCB_FLAGS SCBFlags; 487 U8 CDB[I2O_SCSI_CDB_LENGTH]; 488 U32 ByteCount; 489 I2O_SG_ELEMENT SGL; |
490} I2O_SCSI_SCB_EXECUTE_MESSAGE, *PI2O_SCSI_SCB_EXECUTE_MESSAGE; 491 492 493PRAGMA_PACK_POP 494 495PRAGMA_ALIGN_POP 496 |
497#endif /* I2O_BASE_SCSI_HDR */ |