xref: /onnv-gate/usr/src/uts/common/sys/fibre-channel/ulp/fcp.h (revision 10264:1196af6129ec)
17836SJohn.Forte@Sun.COM /*
27836SJohn.Forte@Sun.COM  * CDDL HEADER START
37836SJohn.Forte@Sun.COM  *
47836SJohn.Forte@Sun.COM  * The contents of this file are subject to the terms of the
57836SJohn.Forte@Sun.COM  * Common Development and Distribution License (the "License").
67836SJohn.Forte@Sun.COM  * You may not use this file except in compliance with the License.
77836SJohn.Forte@Sun.COM  *
87836SJohn.Forte@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97836SJohn.Forte@Sun.COM  * or http://www.opensolaris.org/os/licensing.
107836SJohn.Forte@Sun.COM  * See the License for the specific language governing permissions
117836SJohn.Forte@Sun.COM  * and limitations under the License.
127836SJohn.Forte@Sun.COM  *
137836SJohn.Forte@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
147836SJohn.Forte@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157836SJohn.Forte@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
167836SJohn.Forte@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
177836SJohn.Forte@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
187836SJohn.Forte@Sun.COM  *
197836SJohn.Forte@Sun.COM  * CDDL HEADER END
207836SJohn.Forte@Sun.COM  */
217836SJohn.Forte@Sun.COM /*
22*10264SZhong.Wang@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237836SJohn.Forte@Sun.COM  * Use is subject to license terms.
247836SJohn.Forte@Sun.COM  */
257836SJohn.Forte@Sun.COM 
267836SJohn.Forte@Sun.COM #ifndef	_FCP_H
277836SJohn.Forte@Sun.COM #define	_FCP_H
287836SJohn.Forte@Sun.COM 
297836SJohn.Forte@Sun.COM /*
307836SJohn.Forte@Sun.COM  * Frame format and protocol definitions for transferring
317836SJohn.Forte@Sun.COM  * commands and data between a SCSI initiator and target
327836SJohn.Forte@Sun.COM  * using an FC4 serial link interface.
337836SJohn.Forte@Sun.COM  *
347836SJohn.Forte@Sun.COM  * this file originally taken from fc4/fcp.h
357836SJohn.Forte@Sun.COM  */
367836SJohn.Forte@Sun.COM 
377836SJohn.Forte@Sun.COM #ifdef	__cplusplus
387836SJohn.Forte@Sun.COM extern "C" {
397836SJohn.Forte@Sun.COM #endif
407836SJohn.Forte@Sun.COM 
417836SJohn.Forte@Sun.COM #include <sys/types.h>
427836SJohn.Forte@Sun.COM 
437836SJohn.Forte@Sun.COM 
447836SJohn.Forte@Sun.COM /*
457836SJohn.Forte@Sun.COM  * FCP Device Data Frame Information Categories
467836SJohn.Forte@Sun.COM  */
477836SJohn.Forte@Sun.COM #define	FCP_SCSI_DATA		0x01	/* frame contains SCSI data */
487836SJohn.Forte@Sun.COM #define	FCP_SCSI_CMD		0x02	/* frame contains SCSI command */
497836SJohn.Forte@Sun.COM #define	FCP_SCSI_RSP		0x03	/* frame contains SCSI response */
507836SJohn.Forte@Sun.COM #define	FCP_SCSI_XFER_RDY	0x05	/* frame contains xfer rdy block */
517836SJohn.Forte@Sun.COM 
527836SJohn.Forte@Sun.COM /*
537836SJohn.Forte@Sun.COM  * fcp SCSI control structure
547836SJohn.Forte@Sun.COM  */
557836SJohn.Forte@Sun.COM typedef struct fcp_cntl {
567836SJohn.Forte@Sun.COM 
577836SJohn.Forte@Sun.COM 	uchar_t	cntl_reserved_0;		/* reserved */
587836SJohn.Forte@Sun.COM 
597836SJohn.Forte@Sun.COM #if	defined(_BIT_FIELDS_HTOL)
607836SJohn.Forte@Sun.COM 
617836SJohn.Forte@Sun.COM 	uchar_t	cntl_reserved_1	: 5,		/* reserved */
627836SJohn.Forte@Sun.COM 		cntl_qtype	: 3;		/* tagged queueing type */
637836SJohn.Forte@Sun.COM 
647836SJohn.Forte@Sun.COM 	uchar_t	cntl_kill_tsk	: 1,		/* terminate task */
657836SJohn.Forte@Sun.COM 		cntl_clr_aca	: 1,		/* clear aca */
667836SJohn.Forte@Sun.COM 		cntl_reset_tgt	: 1,		/* reset target */
677836SJohn.Forte@Sun.COM 		cntl_reset_lun	: 1,		/* reset lun */
687836SJohn.Forte@Sun.COM 		cntl_reserved_2	: 1,		/* reserved */
697836SJohn.Forte@Sun.COM 		cntl_clr_tsk	: 1,		/* clear task set */
707836SJohn.Forte@Sun.COM 		cntl_abort_tsk	: 1,		/* abort task set */
717836SJohn.Forte@Sun.COM 		cntl_reserved_3	: 1;		/* reserved */
727836SJohn.Forte@Sun.COM 
737836SJohn.Forte@Sun.COM 	uchar_t	cntl_reserved_4	: 6,		/* reserved */
747836SJohn.Forte@Sun.COM 		cntl_read_data	: 1,		/* initiator read */
757836SJohn.Forte@Sun.COM 		cntl_write_data	: 1;		/* initiator write */
767836SJohn.Forte@Sun.COM 
777836SJohn.Forte@Sun.COM #elif	defined(_BIT_FIELDS_LTOH)
787836SJohn.Forte@Sun.COM 
797836SJohn.Forte@Sun.COM 	uchar_t	cntl_qtype	: 3,		/* tagged queueing type */
807836SJohn.Forte@Sun.COM 		cntl_reserved_1	: 5;		/* reserved */
817836SJohn.Forte@Sun.COM 
827836SJohn.Forte@Sun.COM 	uchar_t	cntl_reserved_3	: 1,		/* reserved */
837836SJohn.Forte@Sun.COM 		cntl_abort_tsk	: 1,		/* abort task set */
847836SJohn.Forte@Sun.COM 		cntl_clr_tsk	: 1,		/* clear task set */
857836SJohn.Forte@Sun.COM 		cntl_reserved_2	: 1,		/* reserved */
867836SJohn.Forte@Sun.COM 		cntl_reset_lun	: 1,		/* reset lun */
877836SJohn.Forte@Sun.COM 		cntl_reset_tgt	: 1,		/* reset target */
887836SJohn.Forte@Sun.COM 		cntl_clr_aca	: 1,		/* clear aca */
897836SJohn.Forte@Sun.COM 		cntl_kill_tsk	: 1;		/* terminate task */
907836SJohn.Forte@Sun.COM 
917836SJohn.Forte@Sun.COM 	uchar_t	cntl_write_data	: 1,		/* initiator write */
927836SJohn.Forte@Sun.COM 		cntl_read_data	: 1,		/* initiator read */
937836SJohn.Forte@Sun.COM 		cntl_reserved_4	: 6;		/* reserved */
947836SJohn.Forte@Sun.COM 
957836SJohn.Forte@Sun.COM #else
967836SJohn.Forte@Sun.COM #error	one of _BIT_FIELDS_HTOL or _BIT_FIELDS_LTOH must be defined
977836SJohn.Forte@Sun.COM #endif
987836SJohn.Forte@Sun.COM 
997836SJohn.Forte@Sun.COM } fcp_cntl_t;
1007836SJohn.Forte@Sun.COM 
1017836SJohn.Forte@Sun.COM /*
1027836SJohn.Forte@Sun.COM  * fcp SCSI control tagged queueing types - cntl_qtype
1037836SJohn.Forte@Sun.COM  */
1047836SJohn.Forte@Sun.COM #define	FCP_QTYPE_SIMPLE	0		/* simple queueing */
1057836SJohn.Forte@Sun.COM #define	FCP_QTYPE_HEAD_OF_Q	1		/* head of queue */
1067836SJohn.Forte@Sun.COM #define	FCP_QTYPE_ORDERED	2		/* ordered queueing */
1077836SJohn.Forte@Sun.COM #define	FCP_QTYPE_ACA_Q_TAG	4		/* ACA queueing */
1087836SJohn.Forte@Sun.COM #define	FCP_QTYPE_UNTAGGED	5		/* Untagged */
1097836SJohn.Forte@Sun.COM 
1107836SJohn.Forte@Sun.COM /*
1117836SJohn.Forte@Sun.COM  * fcp SCSI entity address
1127836SJohn.Forte@Sun.COM  *
1137836SJohn.Forte@Sun.COM  * ent_addr_0 is always the first and highest layer of
1147836SJohn.Forte@Sun.COM  * the hierarchy.  The depth of the hierarchy of addressing,
1157836SJohn.Forte@Sun.COM  * up to a maximum of four layers, is arbitrary and
1167836SJohn.Forte@Sun.COM  * device-dependent.
1177836SJohn.Forte@Sun.COM  */
1187836SJohn.Forte@Sun.COM typedef struct fcp_ent_addr {
1197836SJohn.Forte@Sun.COM 	ushort_t ent_addr_0;		/* entity address 0 */
1207836SJohn.Forte@Sun.COM 	ushort_t ent_addr_1;		/* entity address 1 */
1217836SJohn.Forte@Sun.COM 	ushort_t ent_addr_2;		/* entity address 2 */
1227836SJohn.Forte@Sun.COM 	ushort_t ent_addr_3;		/* entity address 3 */
1237836SJohn.Forte@Sun.COM } fcp_ent_addr_t;
1247836SJohn.Forte@Sun.COM 
1257836SJohn.Forte@Sun.COM /*
1267836SJohn.Forte@Sun.COM  * maximum size of SCSI cdb in fcp SCSI command
1277836SJohn.Forte@Sun.COM  */
1287836SJohn.Forte@Sun.COM #define	FCP_CDB_SIZE		16
1297836SJohn.Forte@Sun.COM #define	FCP_LUN_SIZE		8
1307836SJohn.Forte@Sun.COM #define	FCP_LUN_HEADER		8
1317836SJohn.Forte@Sun.COM 
1327836SJohn.Forte@Sun.COM /*
1337836SJohn.Forte@Sun.COM  * FCP SCSI command payload
1347836SJohn.Forte@Sun.COM  */
1357836SJohn.Forte@Sun.COM typedef struct fcp_cmd {
1367836SJohn.Forte@Sun.COM 	fcp_ent_addr_t	fcp_ent_addr;			/* entity address */
1377836SJohn.Forte@Sun.COM 	fcp_cntl_t	fcp_cntl;			/* SCSI options */
1387836SJohn.Forte@Sun.COM 	uchar_t		fcp_cdb[FCP_CDB_SIZE];		/* SCSI cdb */
1397836SJohn.Forte@Sun.COM 	int		fcp_data_len;			/* data length */
1407836SJohn.Forte@Sun.COM } fcp_cmd_t;
1417836SJohn.Forte@Sun.COM 
1427836SJohn.Forte@Sun.COM /*
1437836SJohn.Forte@Sun.COM  * fcp SCSI status
1447836SJohn.Forte@Sun.COM  */
1457836SJohn.Forte@Sun.COM typedef struct fcp_status {
1467836SJohn.Forte@Sun.COM 	ushort_t reserved_0;			/* reserved */
1477836SJohn.Forte@Sun.COM 
1487836SJohn.Forte@Sun.COM #if	defined(_BIT_FIELDS_HTOL)
1497836SJohn.Forte@Sun.COM 
1507836SJohn.Forte@Sun.COM 	uchar_t	reserved_1	: 4,		/* reserved */
1517836SJohn.Forte@Sun.COM 		resid_under	: 1,		/* resid non-zero */
1527836SJohn.Forte@Sun.COM 		resid_over	: 1,		/* resid non-zero */
1537836SJohn.Forte@Sun.COM 		sense_len_set	: 1,		/* sense_len non-zero */
1547836SJohn.Forte@Sun.COM 		rsp_len_set	: 1;		/* response_len non-zero */
1557836SJohn.Forte@Sun.COM 
1567836SJohn.Forte@Sun.COM #elif	defined(_BIT_FIELDS_LTOH)
1577836SJohn.Forte@Sun.COM 
1587836SJohn.Forte@Sun.COM 	uchar_t	rsp_len_set	: 1,		/* response_len non-zero */
1597836SJohn.Forte@Sun.COM 		sense_len_set	: 1,		/* sense_len non-zero */
1607836SJohn.Forte@Sun.COM 		resid_over	: 1,		/* resid non-zero */
1617836SJohn.Forte@Sun.COM 		resid_under	: 1,		/* resid non-zero */
1627836SJohn.Forte@Sun.COM 		reserved_1	: 4;		/* reserved */
1637836SJohn.Forte@Sun.COM 
1647836SJohn.Forte@Sun.COM #endif
1657836SJohn.Forte@Sun.COM 	uchar_t	scsi_status;			/* status of cmd */
1667836SJohn.Forte@Sun.COM } fcp_status_t;
1677836SJohn.Forte@Sun.COM 
1687836SJohn.Forte@Sun.COM /*
1697836SJohn.Forte@Sun.COM  * fcp SCSI response payload
1707836SJohn.Forte@Sun.COM  */
1717836SJohn.Forte@Sun.COM typedef struct fcp_rsp {
1727836SJohn.Forte@Sun.COM 	uint32_t	reserved_0;			/* reserved */
1737836SJohn.Forte@Sun.COM 	uint32_t	reserved_1;			/* reserved */
1747836SJohn.Forte@Sun.COM 	union {
1757836SJohn.Forte@Sun.COM 		fcp_status_t	fcp_status;		/* command status */
1767836SJohn.Forte@Sun.COM 		uint32_t	i_fcp_status;
1777836SJohn.Forte@Sun.COM 	} fcp_u;
1787836SJohn.Forte@Sun.COM 	uint32_t	fcp_resid;		/* resid of operation */
1797836SJohn.Forte@Sun.COM 	uint32_t	fcp_sense_len;		/* sense data length */
1807836SJohn.Forte@Sun.COM 	uint32_t	fcp_response_len;	/* response data length */
1817836SJohn.Forte@Sun.COM 	/*
1827836SJohn.Forte@Sun.COM 	 * 'm' bytes of scsi response info follow
1837836SJohn.Forte@Sun.COM 	 * 'n' bytes of scsi sense info follow
1847836SJohn.Forte@Sun.COM 	 */
1857836SJohn.Forte@Sun.COM } fcp_rsp_t;
1867836SJohn.Forte@Sun.COM 
1877836SJohn.Forte@Sun.COM /* MAde 256 for sonoma as it wants to give tons of sense info */
1887836SJohn.Forte@Sun.COM #define	FCP_MAX_RSP_IU_SIZE	256
1897836SJohn.Forte@Sun.COM 
1907836SJohn.Forte@Sun.COM /*
1917836SJohn.Forte@Sun.COM  * fcp rsp_info field format
1927836SJohn.Forte@Sun.COM  */
1937836SJohn.Forte@Sun.COM struct fcp_rsp_info {
1947836SJohn.Forte@Sun.COM 	uchar_t		resvd1;
1957836SJohn.Forte@Sun.COM 	uchar_t		resvd2;
1967836SJohn.Forte@Sun.COM 	uchar_t		resvd3;
1977836SJohn.Forte@Sun.COM 	uchar_t		rsp_code;
1987836SJohn.Forte@Sun.COM 	uchar_t		resvd4;
1997836SJohn.Forte@Sun.COM 	uchar_t		resvd5;
2007836SJohn.Forte@Sun.COM 	uchar_t		resvd6;
2017836SJohn.Forte@Sun.COM 	uchar_t		resvd7;
2027836SJohn.Forte@Sun.COM };
2037836SJohn.Forte@Sun.COM 
2047836SJohn.Forte@Sun.COM /*
2057836SJohn.Forte@Sun.COM  * rsp_code definitions
2067836SJohn.Forte@Sun.COM  */
2077836SJohn.Forte@Sun.COM #define		FCP_NO_FAILURE			0x0
2087836SJohn.Forte@Sun.COM #define		FCP_DL_LEN_MISMATCH		0x1
2097836SJohn.Forte@Sun.COM #define		FCP_CMND_INVALID		0x2
2107836SJohn.Forte@Sun.COM #define		FCP_DATA_RO_MISMATCH		0x3
2117836SJohn.Forte@Sun.COM #define		FCP_TASK_MGMT_NOT_SUPPTD	0x4
2127836SJohn.Forte@Sun.COM #define		FCP_TASK_MGMT_FAILED		0x5
2137836SJohn.Forte@Sun.COM 
2147836SJohn.Forte@Sun.COM #ifdef	THIS_NEEDED_YET
2157836SJohn.Forte@Sun.COM 
2167836SJohn.Forte@Sun.COM /*
2177836SJohn.Forte@Sun.COM  * fcp scsi_xfer_rdy payload
2187836SJohn.Forte@Sun.COM  */
2197836SJohn.Forte@Sun.COM typedef struct fcp_xfer_rdy {
2207836SJohn.Forte@Sun.COM 	ulong64_t	fcp_seq_offset;		/* relative offset */
2217836SJohn.Forte@Sun.COM 	ulong64_t	fcp_burst_len;		/* buffer space */
2227836SJohn.Forte@Sun.COM 	ulong64_t	reserved;		/* reserved */
2237836SJohn.Forte@Sun.COM } fcp_xfer_rdy_t;
2247836SJohn.Forte@Sun.COM 
2257836SJohn.Forte@Sun.COM #endif	/* THIS_NEEDED_YET */
2267836SJohn.Forte@Sun.COM 
2277836SJohn.Forte@Sun.COM /*
2287836SJohn.Forte@Sun.COM  * fcp PRLI payload
2297836SJohn.Forte@Sun.COM  */
2307836SJohn.Forte@Sun.COM struct fcp_prli {
2317836SJohn.Forte@Sun.COM 	uchar_t		type;
2327836SJohn.Forte@Sun.COM 	uchar_t		resvd1;			/* rsvd by std */
2337836SJohn.Forte@Sun.COM 
2347836SJohn.Forte@Sun.COM #if	defined(_BIT_FIELDS_HTOL)
2357836SJohn.Forte@Sun.COM 
2367836SJohn.Forte@Sun.COM 	uint16_t	orig_process_assoc_valid : 1,
2377836SJohn.Forte@Sun.COM 			resp_process_assoc_valid : 1,
2387836SJohn.Forte@Sun.COM 			establish_image_pair : 1,
2397836SJohn.Forte@Sun.COM 			resvd2 : 13;		/* rsvd by std */
2407836SJohn.Forte@Sun.COM 
2417836SJohn.Forte@Sun.COM #elif	defined(_BIT_FIELDS_LTOH)
2427836SJohn.Forte@Sun.COM 
2437836SJohn.Forte@Sun.COM 	uint16_t	resvd2 : 13,		/* rsvd by std */
2447836SJohn.Forte@Sun.COM 			establish_image_pair : 1,
2457836SJohn.Forte@Sun.COM 			resp_process_assoc_valid : 1,
2467836SJohn.Forte@Sun.COM 			orig_process_assoc_valid : 1;
2477836SJohn.Forte@Sun.COM 
2487836SJohn.Forte@Sun.COM #endif
2497836SJohn.Forte@Sun.COM 
2507836SJohn.Forte@Sun.COM 	uint32_t	orig_process_associator;
2517836SJohn.Forte@Sun.COM 	uint32_t	resp_process_associator;
2527836SJohn.Forte@Sun.COM 
2537836SJohn.Forte@Sun.COM #if	defined(_BIT_FIELDS_HTOL)
2547836SJohn.Forte@Sun.COM 
2557836SJohn.Forte@Sun.COM 	uint32_t	resvd3 : 23,		/* rsvd by std */
2567836SJohn.Forte@Sun.COM 			retry : 1,
2577836SJohn.Forte@Sun.COM 			confirmed_compl_allowed : 1,
2587836SJohn.Forte@Sun.COM 			data_overlay_allowed : 1,
2597836SJohn.Forte@Sun.COM 			initiator_fn : 1,
2607836SJohn.Forte@Sun.COM 			target_fn : 1,
2617836SJohn.Forte@Sun.COM 			obsolete_2 : 1,
2627836SJohn.Forte@Sun.COM 			obsolete_1 : 1,
2637836SJohn.Forte@Sun.COM 			read_xfer_rdy_disabled : 1,
2647836SJohn.Forte@Sun.COM 			write_xfer_rdy_disabled : 1;
2657836SJohn.Forte@Sun.COM 
2667836SJohn.Forte@Sun.COM #elif	defined(_BIT_FIELDS_LTOH)
2677836SJohn.Forte@Sun.COM 
2687836SJohn.Forte@Sun.COM 	uint32_t	write_xfer_rdy_disabled : 1,
2697836SJohn.Forte@Sun.COM 			read_xfer_rdy_disabled : 1,
2707836SJohn.Forte@Sun.COM 			obsolete_1 : 1,
2717836SJohn.Forte@Sun.COM 			obsolete_2 : 1,
2727836SJohn.Forte@Sun.COM 			target_fn : 1,
2737836SJohn.Forte@Sun.COM 			initiator_fn : 1,
2747836SJohn.Forte@Sun.COM 			data_overlay_allowed : 1,
2757836SJohn.Forte@Sun.COM 			confirmed_compl_allowed : 1,
2767836SJohn.Forte@Sun.COM 			retry : 1,
2777836SJohn.Forte@Sun.COM 			resvd3 : 23;		/* rsvd by std */
2787836SJohn.Forte@Sun.COM 
2797836SJohn.Forte@Sun.COM #endif
2807836SJohn.Forte@Sun.COM 
2817836SJohn.Forte@Sun.COM };
2827836SJohn.Forte@Sun.COM 
2837836SJohn.Forte@Sun.COM /*
2847836SJohn.Forte@Sun.COM  * fcp PRLI ACC payload
2857836SJohn.Forte@Sun.COM  */
2867836SJohn.Forte@Sun.COM struct fcp_prli_acc {
2877836SJohn.Forte@Sun.COM 	uchar_t		type;
288*10264SZhong.Wang@Sun.COM 	uchar_t		resvd1; /* type code extension */
2897836SJohn.Forte@Sun.COM 
290*10264SZhong.Wang@Sun.COM #if	defined(_BIT_FIELDS_HTOL)
291*10264SZhong.Wang@Sun.COM 	uint16_t	orig_process_assoc_valid : 1,
292*10264SZhong.Wang@Sun.COM 			resp_process_assoc_valid : 1,
293*10264SZhong.Wang@Sun.COM 			image_pair_established : 1,
294*10264SZhong.Wang@Sun.COM 			resvd2 : 1,
295*10264SZhong.Wang@Sun.COM 			accept_response_code : 4,
296*10264SZhong.Wang@Sun.COM 			resvd3 : 8;
297*10264SZhong.Wang@Sun.COM #elif	defined(_BIT_FIELDS_LTOH)
298*10264SZhong.Wang@Sun.COM 	uint16_t	resvd3 : 8,
299*10264SZhong.Wang@Sun.COM 			accept_response_code : 4,
300*10264SZhong.Wang@Sun.COM 			resvd2 : 1,
301*10264SZhong.Wang@Sun.COM 			image_pair_established : 1,
302*10264SZhong.Wang@Sun.COM 			resp_process_assoc_valid : 1,
303*10264SZhong.Wang@Sun.COM 			orig_process_assoc_valid : 1;
304*10264SZhong.Wang@Sun.COM #endif
305*10264SZhong.Wang@Sun.COM 
3067836SJohn.Forte@Sun.COM 	uint32_t	orig_process_associator;
3077836SJohn.Forte@Sun.COM 	uint32_t	resp_process_associator;
3087836SJohn.Forte@Sun.COM 
309*10264SZhong.Wang@Sun.COM #if	defined(_BIT_FIELDS_HTOL)
310*10264SZhong.Wang@Sun.COM 	uint32_t	resvd4 : 26,
311*10264SZhong.Wang@Sun.COM 			initiator_fn : 1,
312*10264SZhong.Wang@Sun.COM 			target_fn : 1,
313*10264SZhong.Wang@Sun.COM 			cmd_data_mixed : 1,
314*10264SZhong.Wang@Sun.COM 			data_resp_mixed : 1,
315*10264SZhong.Wang@Sun.COM 			read_xfer_rdy_disabled : 1,
316*10264SZhong.Wang@Sun.COM 			write_xfer_rdy_disabled : 1;
317*10264SZhong.Wang@Sun.COM #elif	defined(_BIT_FIELDS_LTOH)
318*10264SZhong.Wang@Sun.COM 	uint32_t	write_xfer_rdy_disabled : 1,
319*10264SZhong.Wang@Sun.COM 			read_xfer_rdy_disabled : 1,
320*10264SZhong.Wang@Sun.COM 			data_resp_mixed : 1,
321*10264SZhong.Wang@Sun.COM 			cmd_data_mixed : 1,
322*10264SZhong.Wang@Sun.COM 			target_fn : 1,
323*10264SZhong.Wang@Sun.COM 			initiator_fn : 1,
324*10264SZhong.Wang@Sun.COM 			resvd4 : 26;
325*10264SZhong.Wang@Sun.COM #endif
3267836SJohn.Forte@Sun.COM };
3277836SJohn.Forte@Sun.COM 
3287836SJohn.Forte@Sun.COM #define	FC_UB_FCP_CDB_FLAG	0x0001		/* UB has valid cdb */
3297836SJohn.Forte@Sun.COM #define	FC_UB_FCP_PORT_LOGOUT	0x0002		/* Port logout UB */
3307836SJohn.Forte@Sun.COM #define	FC_UB_FCP_ABORT_TASK	0x0004		/* Abort task UB */
3317836SJohn.Forte@Sun.COM #define	FC_UB_FCP_BUS_RESET	0x0008		/* Bus reset UB */
3327836SJohn.Forte@Sun.COM #define	FC_UB_FCP_CMD_DONE	0x8000		/* Work on this UB is done */
3337836SJohn.Forte@Sun.COM 
3347836SJohn.Forte@Sun.COM #define	FC_UB_FCP_OOB_CMD	(FC_UB_FCP_PORT_LOGOUT | FC_UB_FCP_ABORT_TASK \
3357836SJohn.Forte@Sun.COM 	| FC_UB_FCP_BUS_RESET)			/* Out-of-band traget cmds */
3367836SJohn.Forte@Sun.COM 
3377836SJohn.Forte@Sun.COM 
3387836SJohn.Forte@Sun.COM #if !defined(__lint)
3397836SJohn.Forte@Sun.COM _NOTE(SCHEME_PROTECTS_DATA("Unshared Data",
3407836SJohn.Forte@Sun.COM     fcp_cmd
3417836SJohn.Forte@Sun.COM     fcp_rsp
3427836SJohn.Forte@Sun.COM     fcp_prli))
3437836SJohn.Forte@Sun.COM #endif /* __lint */
3447836SJohn.Forte@Sun.COM 
3457836SJohn.Forte@Sun.COM /*
3467836SJohn.Forte@Sun.COM  * FC4 type setttings for Name Server registration.
3477836SJohn.Forte@Sun.COM  */
3487836SJohn.Forte@Sun.COM #define	FC4_TYPE_WORD_POS(x)	((uchar_t)(x) >> 5)
3497836SJohn.Forte@Sun.COM #define	FC4_TYPE_BIT_POS(x)	((uchar_t)(x) & 0x1F)
3507836SJohn.Forte@Sun.COM 
3517836SJohn.Forte@Sun.COM #ifdef	__cplusplus
3527836SJohn.Forte@Sun.COM }
3537836SJohn.Forte@Sun.COM #endif
3547836SJohn.Forte@Sun.COM 
3557836SJohn.Forte@Sun.COM #endif	/* _FCP_H */
356