1139749Simp/*-
2139749Simp ****************************************************************
365312Smsmith * Copyright (c) 1996-2000 Distributed Processing Technology Corporation
465312Smsmith * Copyright (c) 2000 Adaptec Corporation.
565312Smsmith * All rights reserved.
665312Smsmith *
796554Sobrien * Copyright 1999 I2O Special Interest Group (I2O SIG).	 All rights reserved.
865312Smsmith * All rights reserved
965312Smsmith *
1065312Smsmith * TERMS AND CONDITIONS OF USE
1165312Smsmith *
1265312Smsmith * Redistribution and use in source form, with or without modification, are
1365312Smsmith * permitted provided that redistributions of source code must retain the
1465312Smsmith * above copyright notice, this list of conditions and the following disclaimer.
1565312Smsmith *
1665312Smsmith * This software is provided `as is' by Distributed Processing Technology and
1765312Smsmith * any express or implied warranties, including, but not limited to, the
1865312Smsmith * implied warranties of merchantability and fitness for a particular purpose,
1965312Smsmith * are disclaimed. In no event shall Distributed Processing Technology be
2065312Smsmith * liable for any direct, indirect, incidental, special, exemplary or
2165312Smsmith * consequential damages (including, but not limited to, procurement of
2265312Smsmith * substitute goods or services; loss of use, data, or profits; or business
2365312Smsmith * interruptions) however caused and on any theory of liability, whether in
2465312Smsmith * contract, strict liability, or tort (including negligence or otherwise)
2565312Smsmith * arising in any way out of the use of this driver software, even if advised
2665312Smsmith * of the possibility of such damage.
2765312Smsmith *
2865312Smsmith * This header file, and any modifications of this header file, are provided
2965312Smsmith * contingent upon your agreement and adherence to the here-listed terms and
3096554Sobrien * conditions.	By accepting and/or using this header file, you agree to abide
3165312Smsmith * by these terms and conditions and that these terms and conditions will be
3265312Smsmith * construed and governed in accordance with the laws of the State of California,
3365312Smsmith * without reference to conflict-of-law provisions.  If you do not agree
3465312Smsmith * to these terms and conditions, please delete this file, and any copies,
3565312Smsmith * permanently, without making any use thereof.
3665312Smsmith *
3765312Smsmith * THIS HEADER FILE IS PROVIDED FREE OF CHARGE ON AN AS-IS BASIS WITHOUT
3865312Smsmith * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
3965312Smsmith * TO IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
4065312Smsmith * PURPOSE.  I2O SIG DOES NOT WARRANT THAT THIS HEADER FILE WILL MEET THE
4165312Smsmith * USER'S REQUIREMENTS OR THAT ITS OPERATION WILL BE UNINTERRUPTED OR
4265312Smsmith * ERROR-FREE.
4365312Smsmith *
4465312Smsmith * I2O SIG DISCLAIMS ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF
4565312Smsmith * ANY PROPRIETARY RIGHTS, RELATING TO THE IMPLEMENTATION OF THE I2O
4665312Smsmith * SPECIFICATIONS.  I2O SIG DOES NOT WARRANT OR REPRESENT THAT SUCH
4765312Smsmith * IMPLEMENTATIONS WILL NOT INFRINGE SUCH RIGHTS.
4865312Smsmith *
4965312Smsmith * THE USER OF THIS HEADER FILE SHALL HAVE NO RECOURSE TO I2O SIG FOR ANY
5065312Smsmith * ACTUAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, LOST DATA
5165312Smsmith * OR LOST PROFITS ARISING OUT OF THE USE OR INABILITY TO USE THIS PROGRAM.
5265312Smsmith *
5365312Smsmith * I2O SIG grants the user of this header file a license to copy, distribute,
5465312Smsmith * and modify it, for any purpose, under the following terms.  Any copying,
5565312Smsmith * distribution, or modification of this header file must not delete or alter
5665312Smsmith * the copyright notice of I2O SIG or any of these Terms and Conditions.
5765312Smsmith *
5865312Smsmith * Any distribution of this header file must not include a charge for the
5965312Smsmith * header file (unless such charges are strictly for the physical acts of
6065312Smsmith * copying or transferring copies).  However, distribution of a product in
6165312Smsmith * which this header file is embedded may include a charge so long as any
6265312Smsmith * such charge does not include any charge for the header file itself.
6365312Smsmith *
6465312Smsmith * Any modification of this header file constitutes a derivative work based
6596554Sobrien * on this header file.	 Any distribution of such derivative work: (1) must
6665312Smsmith * include prominent notices that the header file has been changed from the
6765312Smsmith * original, together with the dates of any changes; (2) automatically includes
6865312Smsmith * this same license to the original header file from I2O SIG, without any
6965312Smsmith * restriction thereon from the distributing user; and (3) must include a
7065312Smsmith * grant of license of the modified file under the same terms and conditions
7165312Smsmith * as these Terms and Conditions.
7265312Smsmith *
7365312Smsmith * The I2O SIG Web site can be found at: http://www.i2osig.org
7465312Smsmith *
7565312Smsmith * The I2O SIG encourages you to deposit derivative works based on this
7696554Sobrien * header file at the I2O SIG Web site.	 Furthermore, to become a Registered
7765312Smsmith * Developer of the I2O SIG, sign up at the Web site or call 415.750.8352
7865312Smsmith * (United States).
7987826Sobrien *
8087826Sobrien * $FreeBSD$
8187826Sobrien *
8265312Smsmith ****************************************************************/
8365312Smsmith
8465312Smsmith#if !defined(I2O_BASE_SCSI_HDR)
8596615Sobrien#define	I2O_BASE_SCSI_HDR
8665312Smsmith
8765312Smsmith#if ((defined(KERNEL) || defined(_KERNEL)) && defined(__FreeBSD__))
8865312Smsmith# if (KERN_VERSION < 3)
8996554Sobrien#  include    "i386/pci/i2omsg.h"	   /* Include the Base Message file */
9065312Smsmith# else
9165312Smsmith#  include    "dev/asr/i2omsg.h"
9265312Smsmith# endif
9365312Smsmith#else
9496554Sobrien# include    "i2omsg.h"		 /* Include the Base Message file */
9565312Smsmith#endif
9665312Smsmith
9765312Smsmith
9896615Sobrien#define	I2OBSCSI_REV 1_5_1	/* Header file revision string */
9965312Smsmith
10065312Smsmith
10165312Smsmith
10265312Smsmith/*****************************************************************************
10365312Smsmith *
10465312Smsmith *    I2OBSCSI.h -- I2O Base SCSI Device Class Message defintion file
10565312Smsmith *
10696554Sobrien *	This file contains information presented in Chapter 6, Section 6 & 7 of
10796554Sobrien *	the I2O Specification.
10865312Smsmith *
10965312Smsmith *  Revision History: (Revision History tracks the revision number of the I2O
11096554Sobrien *	    specification)
11165312Smsmith *
11296554Sobrien *	.92 - First marked revsion used for Proof of Concept.
11396554Sobrien *	.93 - Change to match the rev .93 of the spec.
11496554Sobrien *	.95 - Updated to Rev .95 of 2/5/96.
11565312Smsmith *     1.00 - Checked and Updated against spec version 1.00 4/9/96.
11665312Smsmith *     1.xx - Updated to the 1.x version of the I2O Specification on 11/11/96.
11765312Smsmith *     1.xx - 11/14/96
11896554Sobrien *	      1) Removed duplicate device type definitions.
11996554Sobrien *	      2) Added "DSC" to Detailed Status Code definitions.
12096554Sobrien *	      3) Changed SCSI-3 LUN fields from U64 to U8 array.
12165312Smsmith *     1.xx   11/15/96 - Added #pragma statments for i960.
12265312Smsmith *     1.xx   11/20/96 - Changed duplicate Bus Scan structure to Bus Reset.
12365312Smsmith *     1.xx   12/05/96 - Added Auto Request Sense flag definition.
12465312Smsmith *     1.5d   03/06/97 - Update for spec. draft version 1.5d.
12596554Sobrien *	      1) Converted SCSI bus adapter class to generic in i2oadptr.h.
12696554Sobrien *	      2) Fixed DSC reference:  changed from _BUS_SCAN to _BUS_RESET.
12765312Smsmith *     1.5d   03/031/97 - Made AutoSense flag definition consistent with spec.
12865312Smsmith *     1.5d   04/11/97 - Corrections from review cycle:
12996554Sobrien *	      1) Corrected typo in I2O_SCSI_PERIPHERAL_TYPE_PARALLEL.
13096554Sobrien *	      2) Corrected typo in I2O_SCSI_PORT_CONN_UNSHIELDED_P_HD.
13165312Smsmith *     1.5.1  05/02/97 - Corrections from review cycle:
13296554Sobrien *	      1) Remove #include for i2omstor.h.
13396554Sobrien *	      2) Add revision string.
13496554Sobrien *	      3) Convert tabs to spaces.
13596554Sobrien *	      4) New disclaimer.
13665312Smsmith *
13765312Smsmith *****************************************************************************/
13865312Smsmith
13965312Smsmith/*
14065312Smsmith    NOTES:
14165312Smsmith
14265312Smsmith    Gets, reads, receives, etc. are all even numbered functions.
14365312Smsmith    Sets, writes, sends, etc. are all odd numbered functions.
14465312Smsmith    Functions that both send and receive data can be either but an attempt is made
14565312Smsmith    to use the function number that indicates the greater transfer amount.
14665312Smsmith    Functions that do not send or receive data use odd function numbers.
14765312Smsmith
14865312Smsmith    Some functions are synonyms like read, receive and send, write.
14965312Smsmith
15065312Smsmith    All common functions will have a code of less than 0x80.
15165312Smsmith    Unique functions to a class will start at 0x80.
15265312Smsmith    Executive Functions start at 0xA0.
15365312Smsmith
15465312Smsmith    Utility Message function codes range from 0 - 0x1f
15565312Smsmith    Base Message function codes range from 0x20 - 0xfe
15665312Smsmith    Private Message function code is 0xff.
15765312Smsmith*/
15865312Smsmith
15965312SmsmithPRAGMA_ALIGN_PUSH
16065312Smsmith
16165312SmsmithPRAGMA_PACK_PUSH
16265312Smsmith
16365312Smsmith/*
16465312Smsmith    SCSI Peripheral Class specific functions
16565312Smsmith
16665312Smsmith    Although the names are SCSI Peripheral class specific, the values
16765312Smsmith    assigned are common with other classes when applicable.
16865312Smsmith*/
16965312Smsmith
17096554Sobrien#define	    I2O_SCSI_DEVICE_RESET	    0x27
17196554Sobrien#define	    I2O_SCSI_SCB_ABORT		    0x83
17296554Sobrien#define	    I2O_SCSI_SCB_EXEC		    0x81
17365312Smsmith
17465312Smsmith/*
17565312Smsmith    Detailed Status Codes for SCSI operations
17665312Smsmith
17765312Smsmith    The 16-bit Detailed Status Code field for SCSI operations is divided
17865312Smsmith    into two separate 8-bit fields.  The lower 8 bits are used to report
17996554Sobrien    Device Status information.	The upper 8 bits are used to report
18096554Sobrien    Adapter Status information.	 The definitions for these two fields,
18165312Smsmith    however, will be consistent with the standard reply message frame
18265312Smsmith    structure declaration, which treats this as a single 16-bit field.
18365312Smsmith*/
18465312Smsmith
18565312Smsmith
18665312Smsmith/*  SCSI Device Completion Status Codes (defined by SCSI-2/3)*/
18765312Smsmith
18896615Sobrien#define	I2O_SCSI_DEVICE_DSC_MASK		0x00FF
18965312Smsmith
19096615Sobrien#define	I2O_SCSI_DSC_SUCCESS			0x0000
19196615Sobrien#define	I2O_SCSI_DSC_CHECK_CONDITION		0x0002
19296615Sobrien#define	I2O_SCSI_DSC_BUSY			0x0008
19396615Sobrien#define	I2O_SCSI_DSC_RESERVATION_CONFLICT	0x0018
19496615Sobrien#define	I2O_SCSI_DSC_COMMAND_TERMINATED		0x0022
19596615Sobrien#define	I2O_SCSI_DSC_TASK_SET_FULL		0x0028
19696615Sobrien#define	I2O_SCSI_DSC_ACA_ACTIVE			0x0030
19765312Smsmith
19865312Smsmith/*  SCSI Adapter Status Codes (based on CAM-1) */
19965312Smsmith
20096615Sobrien#define	I2O_SCSI_HBA_DSC_MASK			0xFF00
20165312Smsmith
20296615Sobrien#define	I2O_SCSI_HBA_DSC_SUCCESS		0x0000
20365312Smsmith
20496615Sobrien#define	I2O_SCSI_HBA_DSC_REQUEST_ABORTED	0x0200
20596615Sobrien#define	I2O_SCSI_HBA_DSC_UNABLE_TO_ABORT	0x0300
20696615Sobrien#define	I2O_SCSI_HBA_DSC_COMPLETE_WITH_ERROR	0x0400
20796615Sobrien#define	I2O_SCSI_HBA_DSC_ADAPTER_BUSY		0x0500
20896615Sobrien#define	I2O_SCSI_HBA_DSC_REQUEST_INVALID	0x0600
20996615Sobrien#define	I2O_SCSI_HBA_DSC_PATH_INVALID		0x0700
21096615Sobrien#define	I2O_SCSI_HBA_DSC_DEVICE_NOT_PRESENT	0x0800
21196615Sobrien#define	I2O_SCSI_HBA_DSC_UNABLE_TO_TERMINATE	0x0900
21296615Sobrien#define	I2O_SCSI_HBA_DSC_SELECTION_TIMEOUT	0x0A00
21396615Sobrien#define	I2O_SCSI_HBA_DSC_COMMAND_TIMEOUT	0x0B00
21465312Smsmith
21596615Sobrien#define	I2O_SCSI_HBA_DSC_MR_MESSAGE_RECEIVED	0x0D00
21696615Sobrien#define	I2O_SCSI_HBA_DSC_SCSI_BUS_RESET		0x0E00
21796615Sobrien#define	I2O_SCSI_HBA_DSC_PARITY_ERROR_FAILURE	0x0F00
21896615Sobrien#define	I2O_SCSI_HBA_DSC_AUTOSENSE_FAILED	0x1000
21996615Sobrien#define	I2O_SCSI_HBA_DSC_NO_ADAPTER		0x1100
22096615Sobrien#define	I2O_SCSI_HBA_DSC_DATA_OVERRUN		0x1200
22196615Sobrien#define	I2O_SCSI_HBA_DSC_UNEXPECTED_BUS_FREE	0x1300
22296615Sobrien#define	I2O_SCSI_HBA_DSC_SEQUENCE_FAILURE	0x1400
22396615Sobrien#define	I2O_SCSI_HBA_DSC_REQUEST_LENGTH_ERROR	0x1500
22496615Sobrien#define	I2O_SCSI_HBA_DSC_PROVIDE_FAILURE	0x1600
22596615Sobrien#define	I2O_SCSI_HBA_DSC_BDR_MESSAGE_SENT	0x1700
22696615Sobrien#define	I2O_SCSI_HBA_DSC_REQUEST_TERMINATED	0x1800
22765312Smsmith
22896615Sobrien#define	I2O_SCSI_HBA_DSC_IDE_MESSAGE_SENT	0x3300
22996615Sobrien#define	I2O_SCSI_HBA_DSC_RESOURCE_UNAVAILABLE	0x3400
23096615Sobrien#define	I2O_SCSI_HBA_DSC_UNACKNOWLEDGED_EVENT	0x3500
23196615Sobrien#define	I2O_SCSI_HBA_DSC_MESSAGE_RECEIVED	0x3600
23296615Sobrien#define	I2O_SCSI_HBA_DSC_INVALID_CDB		0x3700
23396615Sobrien#define	I2O_SCSI_HBA_DSC_LUN_INVALID		0x3800
23496615Sobrien#define	I2O_SCSI_HBA_DSC_SCSI_TID_INVALID	0x3900
23596615Sobrien#define	I2O_SCSI_HBA_DSC_FUNCTION_UNAVAILABLE	0x3A00
23696615Sobrien#define	I2O_SCSI_HBA_DSC_NO_NEXUS		0x3B00
23796615Sobrien#define	I2O_SCSI_HBA_DSC_SCSI_IID_INVALID	0x3C00
23896615Sobrien#define	I2O_SCSI_HBA_DSC_CDB_RECEIVED		0x3D00
23996615Sobrien#define	I2O_SCSI_HBA_DSC_LUN_ALREADY_ENABLED	0x3E00
24096615Sobrien#define	I2O_SCSI_HBA_DSC_BUS_BUSY		0x3F00
24165312Smsmith
24296615Sobrien#define	I2O_SCSI_HBA_DSC_QUEUE_FROZEN		0x4000
24365312Smsmith
24465312Smsmith
24565312Smsmith/****************************************************************************/
24665312Smsmith
24765312Smsmith/* SCSI Peripheral Device Parameter Groups */
24865312Smsmith
24965312Smsmith/****************************************************************************/
25065312Smsmith
25165312Smsmith
25265312Smsmith/* SCSI Configuration and Operating Structures and Defines */
25365312Smsmith
25465312Smsmith
25596554Sobrien#define	    I2O_SCSI_DEVICE_INFO_GROUP_NO		0x0000
25696554Sobrien#define	    I2O_SCSI_DEVICE_BUS_PORT_INFO_GROUP_NO	0x0001
25765312Smsmith
25865312Smsmith
25965312Smsmith/* - 0000h - SCSI Device Information Parameters Group defines */
26065312Smsmith
26165312Smsmith/* Device Type */
26265312Smsmith
26396615Sobrien#define	I2O_SCSI_DEVICE_TYPE_DIRECT	    0x00
26496615Sobrien#define	I2O_SCSI_DEVICE_TYPE_SEQUENTIAL	    0x01
26596615Sobrien#define	I2O_SCSI_DEVICE_TYPE_PRINTER	    0x02
26696615Sobrien#define	I2O_SCSI_DEVICE_TYPE_PROCESSOR	    0x03
26796615Sobrien#define	I2O_SCSI_DEVICE_TYPE_WORM	    0x04
26896615Sobrien#define	I2O_SCSI_DEVICE_TYPE_CDROM	    0x05
26996615Sobrien#define	I2O_SCSI_DEVICE_TYPE_SCANNER	    0x06
27096615Sobrien#define	I2O_SCSI_DEVICE_TYPE_OPTICAL	    0x07
27196615Sobrien#define	I2O_SCSI_DEVICE_TYPE_MEDIA_CHANGER  0x08
27296615Sobrien#define	I2O_SCSI_DEVICE_TYPE_COMM	    0x09
27396615Sobrien#define	I2O_SCSI_DEVICE_GRAPHICS_1	    0x0A
27496615Sobrien#define	I2O_SCSI_DEVICE_GRAPHICS_2	    0x0B
27596615Sobrien#define	I2O_SCSI_DEVICE_TYPE_ARRAY_CONT	    0x0C
27696615Sobrien#define	I2O_SCSI_DEVICE_TYPE_SES	    0x0D
27796615Sobrien#define	I2O_SCSI_DEVICE_TYPE_UNKNOWN	    0x1F
27865312Smsmith
27965312Smsmith/* Flags */
28065312Smsmith
28196615Sobrien#define	I2O_SCSI_PERIPHERAL_TYPE_FLAG	    0x01
28296615Sobrien#define	I2O_SCSI_PERIPHERAL_TYPE_PARALLEL   0x00
28396615Sobrien#define	I2O_SCSI_PERIPHERAL_TYPE_SERIAL	    0x01
28465312Smsmith
28596615Sobrien#define	I2O_SCSI_RESERVED_FLAG		    0x02
28665312Smsmith
28796615Sobrien#define	I2O_SCSI_DISCONNECT_FLAG	    0x04
28896615Sobrien#define	I2O_SCSI_DISABLE_DISCONNECT	    0x00
28996615Sobrien#define	I2O_SCSI_ENABLE_DISCONNECT	    0x04
29065312Smsmith
29196615Sobrien#define	I2O_SCSI_MODE_MASK		    0x18
29296615Sobrien#define	I2O_SCSI_MODE_SET_DATA		    0x00
29396615Sobrien#define	I2O_SCSI_MODE_SET_DEFAULT	    0x08
29496615Sobrien#define	I2O_SCSI_MODE_SET_SAFEST	    0x10
29565312Smsmith
29696615Sobrien#define	I2O_SCSI_DATA_WIDTH_MASK	    0x60
29796615Sobrien#define	I2O_SCSI_DATA_WIDTH_8		    0x00
29896615Sobrien#define	I2O_SCSI_DATA_WIDTH_16		    0x20
29996615Sobrien#define	I2O_SCSI_DATA_WIDTH_32		    0x40
30065312Smsmith
30196615Sobrien#define	I2O_SCSI_SYNC_NEGOTIATION_FLAG	    0x80
30296615Sobrien#define	I2O_SCSI_DISABLE_SYNC_NEGOTIATION   0x00
30396615Sobrien#define	I2O_SCSI_ENABLE_SYNC_NEGOTIATION    0x80
30465312Smsmith
30565312Smsmith
30665312Smsmith/* - 0001h - SCSI Device Bus Port Info Parameters Group defines */
30765312Smsmith
30865312Smsmith/* Physical */
30965312Smsmith
31096615Sobrien#define	I2O_SCSI_PORT_PHYS_OTHER	    0x01
31196615Sobrien#define	I2O_SCSI_PORT_PHYS_UNKNOWN	    0x02
31296615Sobrien#define	I2O_SCSI_PORT_PHYS_PARALLEL	    0x03
31396615Sobrien#define	I2O_SCSI_PORT_PHYS_FIBRE_CHANNEL    0x04
31496615Sobrien#define	I2O_SCSI_PORT_PHYS_SERIAL_P1394	    0x05
31596615Sobrien#define	I2O_SCSI_PORT_PHYS_SERIAL_SSA	    0x06
31665312Smsmith
31765312Smsmith/* Electrical */
31865312Smsmith
31996615Sobrien#define	I2O_SCSI_PORT_ELEC_OTHER	    0x01
32096615Sobrien#define	I2O_SCSI_PORT_ELEC_UNKNOWN	    0x02
32196615Sobrien#define	I2O_SCSI_PORT_ELEC_SINGLE_ENDED	    0x03
32296615Sobrien#define	I2O_SCSI_PORT_ELEC_DIFFERENTIAL	    0x04
32396615Sobrien#define	I2O_SCSI_PORT_ELEC_LOW_VOLT_DIFF    0x05
32496615Sobrien#define	I2O_SCSI_PORT_ELEC_OPTICAL	    0x06
32565312Smsmith
32665312Smsmith/* Isochronous */
32765312Smsmith
32896615Sobrien#define	I2O_SCSI_PORT_ISOC_NO		    0x00
32996615Sobrien#define	I2O_SCSI_PORT_ISOC_YES		    0x01
33096615Sobrien#define	I2O_SCSI_PORT_ISOC_UNKNOWN	    0x02
33165312Smsmith
33265312Smsmith/* Connector Type */
33365312Smsmith
33496615Sobrien#define	I2O_SCSI_PORT_CONN_OTHER	    0x01
33596615Sobrien#define	I2O_SCSI_PORT_CONN_UNKNOWN	    0x02
33696615Sobrien#define	I2O_SCSI_PORT_CONN_NONE		    0x03
33796615Sobrien#define	I2O_SCSI_PORT_CONN_SHIELDED_A_HD    0x04
33896615Sobrien#define	I2O_SCSI_PORT_CONN_UNSHIELDED_A_HD  0x05
33996615Sobrien#define	I2O_SCSI_PORT_CONN_SHIELDED_A_LD    0x06
34096615Sobrien#define	I2O_SCSI_PORT_CONN_UNSHIELDED_A_LD  0x07
34196615Sobrien#define	I2O_SCSI_PORT_CONN_SHIELDED_P_HD    0x08
34296615Sobrien#define	I2O_SCSI_PORT_CONN_UNSHIELDED_P_HD  0x09
34396615Sobrien#define	I2O_SCSI_PORT_CONN_SCA_I	    0x0A
34496615Sobrien#define	I2O_SCSI_PORT_CONN_SCA_II	    0x0B
34596615Sobrien#define	I2O_SCSI_PORT_CONN_FC_DB9	    0x0C
34696615Sobrien#define	I2O_SCSI_PORT_CONN_FC_FIBRE	    0x0D
34796615Sobrien#define	I2O_SCSI_PORT_CONN_FC_SCA_II_40	    0x0E
34896615Sobrien#define	I2O_SCSI_PORT_CONN_FC_SCA_II_20	    0x0F
34996615Sobrien#define	I2O_SCSI_PORT_CONN_FC_BNC	    0x10
35065312Smsmith
35165312Smsmith/* Connector Gender */
35265312Smsmith
35396615Sobrien#define	I2O_SCSI_PORT_CONN_GENDER_OTHER	    0x01
35496615Sobrien#define	I2O_SCSI_PORT_CONN_GENDER_UNKOWN    0x02
35596615Sobrien#define	I2O_SCSI_PORT_CONN_GENDER_FEMALE    0x03
35696615Sobrien#define	I2O_SCSI_PORT_CONN_GENDER_MALE	    0x04
35765312Smsmith
35865312Smsmith
35965312Smsmith/* SCSI Device Group 0000h - Device Information Parameter Group */
36065312Smsmith
36165312Smsmithtypedef struct _I2O_SCSI_DEVICE_INFO_SCALAR {
36296554Sobrien    U8		DeviceType;
36396554Sobrien    U8		Flags;
36496554Sobrien    U16		Reserved2;
36596554Sobrien    U32		Identifier;
36696554Sobrien    U8		LunInfo[8]; /* SCSI-2 8-bit scalar LUN goes into offset 1 */
36796554Sobrien    U32		QueueDepth;
36896554Sobrien    U8		Reserved1a;
36996554Sobrien    U8		NegOffset;
37096554Sobrien    U8		NegDataWidth;
37196554Sobrien    U8		Reserved1b;
37296554Sobrien    U64		NegSyncRate;
37365312Smsmith
37465312Smsmith} I2O_SCSI_DEVICE_INFO_SCALAR, *PI2O_SCSI_DEVICE_INFO_SCALAR;
37565312Smsmith
37665312Smsmith
37765312Smsmith/* SCSI Device Group 0001h - Bus Port Information Parameter Group */
37865312Smsmith
37965312Smsmithtypedef struct _I2O_SCSI_BUS_PORT_INFO_SCALAR {
38096554Sobrien    U8		PhysicalInterface;
38196554Sobrien    U8		ElectricalInterface;
38296554Sobrien    U8		Isochronous;
38396554Sobrien    U8		ConnectorType;
38496554Sobrien    U8		ConnectorGender;
38596554Sobrien    U8		Reserved1;
38696554Sobrien    U16		Reserved2;
38796554Sobrien    U32		MaxNumberDevices;
38865312Smsmith} I2O_SCSI_BUS_PORT_INFO_SCALAR, *PI2O_SCSI_BUS_PORT_INFO_SCALAR;
38965312Smsmith
39065312Smsmith
39165312Smsmith
39265312Smsmith/****************************************************************************/
39365312Smsmith
39465312Smsmith/* I2O SCSI Peripheral Event Indicator Assignment */
39565312Smsmith
39696615Sobrien#define	I2O_SCSI_EVENT_SCSI_SMART		0x00000010
39765312Smsmith
39865312Smsmith
39965312Smsmith/****************************************************************************/
40065312Smsmith
40165312Smsmith/* SCSI Peripheral Class Specific Message Definitions */
40265312Smsmith
40365312Smsmith/****************************************************************************/
40465312Smsmith
40565312Smsmith
40665312Smsmith/****************************************************************************/
40765312Smsmith
40865312Smsmith/* I2O SCSI Peripheral Successful Completion Reply Message Frame */
40965312Smsmith
41065312Smsmithtypedef struct _I2O_SCSI_SUCCESS_REPLY_MESSAGE_FRAME {
41165312Smsmith    I2O_SINGLE_REPLY_MESSAGE_FRAME StdReplyFrame;
41296554Sobrien    U32			    TransferCount;
41365312Smsmith} I2O_SCSI_SUCCESS_REPLY_MESSAGE_FRAME, *PI2O_SCSI_SUCCESS_REPLY_MESSAGE_FRAME;
41465312Smsmith
41565312Smsmith
41665312Smsmith/****************************************************************************/
41765312Smsmith
41865312Smsmith/* I2O SCSI Peripheral Error Report Reply Message Frame */
41965312Smsmith
42065312Smsmith#ifdef _WIN64
42196615Sobrien#define	I2O_SCSI_SENSE_DATA_SZ	    44
42265312Smsmith#else
42396615Sobrien#define	I2O_SCSI_SENSE_DATA_SZ	    40
42465312Smsmith#endif
42565312Smsmith
42665312Smsmithtypedef struct _I2O_SCSI_ERROR_REPLY_MESSAGE_FRAME {
42765312Smsmith    I2O_SINGLE_REPLY_MESSAGE_FRAME StdReplyFrame;
42896554Sobrien    U32			    TransferCount;
42996554Sobrien    U32			    AutoSenseTransferCount;
43096554Sobrien    U8			    SenseData[I2O_SCSI_SENSE_DATA_SZ];
43165312Smsmith} I2O_SCSI_ERROR_REPLY_MESSAGE_FRAME, *PI2O_SCSI_ERROR_REPLY_MESSAGE_FRAME;
43265312Smsmith
43365312Smsmith
43465312Smsmith/****************************************************************************/
43565312Smsmith
43665312Smsmith/* I2O SCSI Device Reset Message Frame */
43765312Smsmith
43865312Smsmithtypedef struct _I2O_SCSI_DEVICE_RESET_MESSAGE {
43996554Sobrien    I2O_MESSAGE_FRAME	    StdMessageFrame;
44065312Smsmith    I2O_TRANSACTION_CONTEXT TransactionContext;
44165312Smsmith} I2O_SCSI_DEVICE_RESET_MESSAGE, *PI2O_SCSI_DEVICE_RESET_MESSAGE;
44265312Smsmith
44365312Smsmith
44465312Smsmith/****************************************************************************/
44565312Smsmith
44665312Smsmith/* I2O SCSI Control Block Abort Message Frame */
44765312Smsmith
44865312Smsmithtypedef struct _I2O_SCSI_SCB_ABORT_MESSAGE {
44996554Sobrien    I2O_MESSAGE_FRAME	    StdMessageFrame;
45065312Smsmith    I2O_TRANSACTION_CONTEXT TransactionContext;
45165312Smsmith    I2O_TRANSACTION_CONTEXT TransactionContextToAbort;
45265312Smsmith} I2O_SCSI_SCB_ABORT_MESSAGE, *PI2O_SCSI_SCB_ABORT_MESSAGE;
45365312Smsmith
45465312Smsmith
45565312Smsmith/****************************************************************************/
45665312Smsmith
45765312Smsmith/* I2O SCSI Control Block Execute Message Frame */
45865312Smsmith
45996554Sobrien#define	 I2O_SCSI_CDB_LENGTH		    16
46065312Smsmith
46196554Sobrientypedef U16	I2O_SCB_FLAGS;
46265312Smsmith
46396615Sobrien#define	I2O_SCB_FLAG_XFER_DIR_MASK	    0xC000
46496615Sobrien#define	I2O_SCB_FLAG_NO_DATA_XFER	    0x0000
46596615Sobrien#define	I2O_SCB_FLAG_XFER_FROM_DEVICE	    0x4000
46696615Sobrien#define	I2O_SCB_FLAG_XFER_TO_DEVICE	    0x8000
46765312Smsmith
46896615Sobrien#define	I2O_SCB_FLAG_ENABLE_DISCONNECT	    0x2000
46965312Smsmith
47096615Sobrien#define	I2O_SCB_FLAG_TAG_TYPE_MASK	    0x0380
47196615Sobrien#define	I2O_SCB_FLAG_NO_TAG_QUEUEING	    0x0000
47296615Sobrien#define	I2O_SCB_FLAG_SIMPLE_QUEUE_TAG	    0x0080
47396615Sobrien#define	I2O_SCB_FLAG_HEAD_QUEUE_TAG	    0x0100
47496615Sobrien#define	I2O_SCB_FLAG_ORDERED_QUEUE_TAG	    0x0180
47596615Sobrien#define	I2O_SCB_FLAG_ACA_QUEUE_TAG	    0x0200
47665312Smsmith
47796615Sobrien#define	I2O_SCB_FLAG_AUTOSENSE_MASK	    0x0060
47896615Sobrien#define	I2O_SCB_FLAG_DISABLE_AUTOSENSE	    0x0000
47996615Sobrien#define	I2O_SCB_FLAG_SENSE_DATA_IN_MESSAGE  0x0020
48096615Sobrien#define	I2O_SCB_FLAG_SENSE_DATA_IN_BUFFER   0x0060
48165312Smsmith
48265312Smsmithtypedef struct _I2O_SCSI_SCB_EXECUTE_MESSAGE {
48396554Sobrien    I2O_MESSAGE_FRAME	    StdMessageFrame;
48465312Smsmith    I2O_TRANSACTION_CONTEXT TransactionContext;
48596554Sobrien    U8			    CDBLength;
48696554Sobrien    U8			    Reserved;
48796554Sobrien    I2O_SCB_FLAGS	    SCBFlags;
48896554Sobrien    U8			    CDB[I2O_SCSI_CDB_LENGTH];
48996554Sobrien    U32			    ByteCount;
49096554Sobrien    I2O_SG_ELEMENT	    SGL;
49165312Smsmith} I2O_SCSI_SCB_EXECUTE_MESSAGE, *PI2O_SCSI_SCB_EXECUTE_MESSAGE;
49265312Smsmith
49365312Smsmith
49465312SmsmithPRAGMA_PACK_POP
49565312Smsmith
49665312SmsmithPRAGMA_ALIGN_POP
49765312Smsmith
49896554Sobrien#endif	    /* I2O_BASE_SCSI_HDR */
499