persist.h revision 70c284ca5360ed73476d9e94223d4905dd80b1ad
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SCSI_GENERIC_PERSIST_H
#define _SYS_SCSI_GENERIC_PERSIST_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* SCSI Persistence Data
*
* Format of data returned as a result of PERSISTENCE RESERVER { IN | OUT }
*/
/*
* SPC-3 revision 23, Section 6.11.1, Table 102
* Persistent Reservations
* Persistent Reserve In service actions
*/
/* registrations and the persistent */
/* reservations, if any */
/*
* SPC-3 revision 23, Section 6.11.3.3, Table 106
* Persistent reservation scope codes
*/
/* full logical unit */
/*
* SPC-3 revision 23, Section 6.11.3.4, Table 107
* Persistent Reservations
* Persistent reservation type codes
*/
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.11.5 PERSISTENCE RESERVE IN
* Table 111 - full status descriptor format
*/
/* Table 289 - iSCSI Initiator Device TransportID format */
#if defined(_BIT_FIELDS_LTOH)
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.11.1 PERSISTENCE RESERVE IN
* Table 101 - PERSISTENCE RESERVE IN command
*/
typedef struct scsi_cdb_prin {
resbits : 3;
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.11.2 PERSISTENCE RESERVE IN
* Table 103/104/105 - parameter data for READS KEYS
*/
typedef struct scsi_prin_rsrvdesc {
scope : 4;
typedef struct scsi_prin_readrsrv {
union {
} key_list;
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.11.4 PERSISTENCE RESERVE IN
* Table 108 - parameter data for REPORT CAPABILTIES
*/
typedef struct scsi_per_res_type {
wr_ex : 1,
resbits2 : 1,
ex_ac : 1,
resbits3 : 1,
wr_ex_ro : 1,
ex_ac_ro : 1,
wr_ex_ar : 1;
resbits4 : 7;
/*
* Refer SPC-3, Revision 23
* Section 6.11.4 REPORT CAPABILITIES service action
*/
typedef struct scsi_prin_rpt_cap {
resbits1 : 1,
atp_c : 1,
sip_c : 1,
crh : 1,
resbits2 : 3;
resbits3 : 6,
tmv : 1;
/*
* Refer SPC-3, Revision 23
* Section 7.5.4 TransportID identifiers
*/
typedef struct scsi_transport_id {
resbits : 2,
format_code : 2;
typedef struct scsi_fc_transport_id {
resbits : 2,
format_code : 2;
typedef struct iscsi_transport_id {
resbits : 2,
format_code : 2;
char iscsi_name[1];
typedef struct scsi_srp_transport_id {
resbits : 2,
format_code : 2;
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.11.5 PERSISTENCE RESERVE IN
* Table 110/111 - parameter data for READ FULL STATUS
* Table 281 - TransportId format
*/
typedef struct scsi_prin_status_t {
all_tg_pt : 1,
resbits : 6;
scope : 4;
typedef struct scsi_prin_full_status {
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.12.1 PERSISTENCE RESERVE OUT
* Table 112 - PERSISTENCE RESERVE OUT command
*/
typedef struct scsi_cdb_prout {
resbits : 3;
scope : 4;
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.12.3 PERSISTENCE RESERVE OUT
* Table 114 - PERSISTENCE RESERVE OUT parameter list
*/
typedef struct scsi_prout_plist {
resbits1 : 1,
all_tg_pt : 1,
spec_i_pt : 1,
resbits2 : 4;
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.12.4 PERSISTENCE RESERVE OUT command with REGISTER AND MOVE
* Table 117 - REGISTER and MOVE service action parameter list
*/
typedef struct scsi_prout_reg_move_plist {
unreg : 1,
resbits1 : 6;
#elif defined(_BIT_FIELDS_HTOL)
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.11.1 PERSISTENCE RESERVE IN
* Table 101 - PERSISTENCE RESERVE IN command
*/
typedef struct scsi_cdb_prin {
action : 5;
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.11.2 PERSISTENCE RESERVE IN
* Table 103/104/105 - parameter data for READS KEYS
*/
typedef struct scsi_prin_rsrvdesc {
type : 4;
typedef struct scsi_prin_readrsrv {
union {
} key_list;
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.11.4 PERSISTENCE RESERVE IN
* Table 108 - parameter data for REPORT CAPABILTIES
*/
typedef struct scsi_per_res_type {
ex_ac_ro : 1,
wr_ex_ro : 1,
resbits3 : 1,
ex_ac : 1,
resbits2 : 1,
wr_ex : 1,
resbits1 : 1;
ex_ac_ar : 1;
/*
* Refer SPC-3, Revision 23
* Section 6.11.4 REPORT CAPABILITIES service action
*/
typedef struct scsi_prin_rpt_cap {
crh : 1,
sip_c : 1,
atp_c : 1,
resbits1 : 1,
ptpl_c : 1;
resbits3 : 6,
ptpl_a : 1;
/*
* Refer SPC-3, Revision 23
* Section 7.5.4 TransportID identifiers
*/
typedef struct scsi_transport_id {
resbits : 2,
protocol_id : 4;
typedef struct scsi_fc_transport_id {
resbits : 2,
protocol_id : 4;
typedef struct iscsi_transport_id {
resbits : 2,
protocol_id : 4;
char iscsi_name[1];
typedef struct scsi_srp_transport_id {
resbits : 2,
protocol_id : 4;
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.11.5 PERSISTENCE RESERVE IN
* Table 110/111 - parameter data for READ FULL STATUS
* Table 281 - TransportId format
*/
typedef struct scsi_prin_status_t {
all_tg_pt : 1,
r_holder : 1;
type : 4;
typedef struct scsi_prin_full_status {
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.12.1 PERSISTENCE RESERVE OUT
* Table 112 - PERSISTENCE RESERVE OUT command
*/
typedef struct scsi_cdb_prout {
action : 5;
type : 4;
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.12.3 PERSISTENCE RESERVE OUT
* Table 114 - PERSISTENCE RESERVE OUT parameter list
*/
typedef struct scsi_prout_plist {
spec_i_pt : 1,
all_tg_pt : 1,
resbits2 : 1,
aptpl : 1;
/*
* Information obtained from:
* SPC-3, Revision 23
* Section 6.12.4 PERSISTENCE RESERVE OUT command with REGISTER AND MOVE
* Table 117 - REGISTER and MOVE service action parameter list
*/
typedef struct scsi_prout_reg_move_plist {
unreg : 1,
aptpl : 1;
#else
#endif /* _BIT_FIELDS_LTOH */
/*
* SPC-3 revision 23, Section 6.12.2, Table 113
* Persistent Reservations
* Persistent Reserve Out service action codes
*/
/* key with the device server */
/* having a specified SCOPE & TYPE */
/* reservation */
/* all persistent reservations */
/* aborts all tasks for all preempted */
/* I_T nexuses */
#define PR_OUT_REGISTER_AND_IGNORE_EXISTING_KEY 0x06
/* Register a reservation key with */
/* the device server, or unregister a */
/* reservation key */
/* another I_T nexus with the device */
/* server and move a persistent */
/* reservation to the I_T nexus */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SCSI_GENERIC_PERSIST_H */