sbd_impl.h revision 309bed43992ade65fbe1f15ef7a5e800545915f2
/*
* 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
*/
/*
*/
#ifndef _SBD_IMPL_H
#define _SBD_IMPL_H
#ifdef __cplusplus
extern "C" {
#endif
struct register_lu_cmd;
struct modify_lu_cmd;
struct sbd_lu_attr;
struct sbd_it_data;
/*
* sms endianess
*/
#define SMS_BIG_ENDIAN 0x00
#define SMS_LITTLE_ENDIAN 0xFF
#ifdef _BIG_ENDIAN
#define SMS_DATA_ORDER SMS_BIG_ENDIAN
#else
#define SMS_DATA_ORDER SMS_LITTLE_ENDIAN
#endif
/* Test if one of the BitOrder definitions exists */
#ifdef _BIT_FIELDS_LTOH
#elif defined(_BIT_FIELDS_HTOL)
#else
#endif
#define SBD_V0_MAGIC 0x53554e4d4943524f
#define SBD_MAGIC 0x53554e5342444c55
typedef struct sbd_v0_meta_start {
typedef struct sbd_meta_start {
typedef struct sm_v0_section_hdr {
/*
* sbd_it_flags
*/
#define SBD_IT_HAS_SCSI2_RESERVATION 0x0001
#define SBD_IT_PGR_REGISTERED 0x0002
#define SBD_IT_PGR_EXCLUSIVE_RSV_HOLDER 0x0004
#define SBD_IT_PGR_CHECK_FLAG 0x0008
/*
* PGR flags
*/
#define SBD_PGR_APTPL 0x01
#define SBD_PGR_RSVD_ONE 0x02
#define SBD_PGR_RSVD_ALL_REGISTRANTS 0x04
#define SBD_PGR_ALL_KEYS_HAS_IT 0x08
/*
* PGR key flags
*/
#define SBD_PGR_KEY_ALL_TG_PT 0x01
typedef struct sbd_pgr_key_info {
/* followed by devid_desc of target */
typedef struct sbd_pgr_info {
#ifdef _BIT_FIELDS_LTOH
#else
pgr_rsv_type:4;
#endif
typedef struct sbd_pgr_key {
struct scsi_devid_desc *pgr_key_lpt_id;
struct scsi_devid_desc *pgr_key_rpt_id;
struct sbd_it_data *pgr_key_it;
struct sbd_pgr_key *pgr_key_next;
struct sbd_pgr_key *pgr_key_prev;
typedef struct sbd_pgr {
} sbd_pgr_t;
typedef struct sbd_v0_lu_info {
typedef struct sbd_lu_info {
/*
* sl_flags
*/
#define SBD_LU_HAS_SCSI2_RESERVATION 0x0001
typedef struct sbd_cmd {
} sbd_cmd_t;
/*
* flags for sbd_cmd
*/
#define SBD_SCSI_CMD_ACTIVE 0x01
#define SBD_SCSI_CMD_ABORT_REQUESTED 0x02
#define SBD_SCSI_CMD_XFER_FAIL 0x04
#define SBD_SCSI_CMD_SYNC_WRITE 0x08
/*
* cmd types
*/
#define SBD_CMD_SCSI_READ 0x01
#define SBD_CMD_SCSI_WRITE 0x02
#define SBD_CMD_SMALL_READ 0x03
#define SBD_CMD_SMALL_WRITE 0x04
#define SBD_CMD_SCSI_PR_OUT 0x05
typedef struct sbd_it_data {
struct sbd_it_data *sbd_it_next;
typedef struct sbd_create_standby_lu {
char stlu_meta_fname[8];
/*
* Different UA conditions
*/
#define SBD_UA_POR 0x01
#define SBD_UA_CAPACITY_CHANGED 0x02
#define SBD_UA_MODE_PARAMETERS_CHANGED 0x04
#define SBD_UA_ACCESS_STATE_TRANSITION 0x08
#define SBD_UA_REGISTRATIONS_PREEMPTED 0x10
#define SBD_UA_RESERVATIONS_PREEMPTED 0x20
#define SBD_UA_RESERVATIONS_RELEASED 0x40
#define SBD_UA_ASYMMETRIC_ACCESS_CHANGED 0x80
/*
* sbd_it_flags
*/
#define SBD_IT_HAS_SCSI2_RESERVATION 0x0001
#ifdef __cplusplus
}
#endif
#endif /* _SBD_IMPL_H */