fcp.h revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _FCP_H
#define _FCP_H
/*
* Frame format and protocol definitions for transferring
* commands and data between a SCSI initiator and target
* using an FC4 serial link interface.
*
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* FCP Device Data Frame Information Categories
*/
/*
* fcp SCSI control structure
*/
typedef struct fcp_cntl {
#if defined(_BIT_FIELDS_HTOL)
#elif defined(_BIT_FIELDS_LTOH)
#else
#endif
} fcp_cntl_t;
/*
* fcp SCSI control tagged queueing types - cntl_qtype
*/
#define FCP_QTYPE_SIMPLE 0 /* simple queueing */
/*
* fcp SCSI entity address
*
* ent_addr_0 is always the first and highest layer of
* the hierarchy. The depth of the hierarchy of addressing,
* up to a maximum of four layers, is arbitrary and
* device-dependent.
*/
typedef struct fcp_ent_addr {
/*
* maximum size of SCSI cdb in fcp SCSI command
*/
#define FCP_CDB_SIZE 16
#define FCP_LUN_SIZE 8
#define FCP_LUN_HEADER 8
/*
* FCP SCSI command payload
*/
typedef struct fcp_cmd {
int fcp_data_len; /* data length */
} fcp_cmd_t;
/*
* fcp SCSI status
*/
typedef struct fcp_status {
#if defined(_BIT_FIELDS_HTOL)
#elif defined(_BIT_FIELDS_LTOH)
#endif
} fcp_status_t;
/*
* fcp SCSI response payload
*/
typedef struct fcp_rsp {
union {
} fcp_u;
/*
* 'm' bytes of scsi response info follow
* 'n' bytes of scsi sense info follow
*/
} fcp_rsp_t;
/* MAde 256 for sonoma as it wants to give tons of sense info */
#define FCP_MAX_RSP_IU_SIZE 256
/*
* fcp rsp_info field format
*/
struct fcp_rsp_info {
};
/*
* rsp_code definitions
*/
#define FCP_NO_FAILURE 0x0
#define FCP_DL_LEN_MISMATCH 0x1
#define FCP_CMND_INVALID 0x2
#define FCP_DATA_RO_MISMATCH 0x3
#define FCP_TASK_MGMT_NOT_SUPPTD 0x4
#define FCP_TASK_MGMT_FAILED 0x5
#ifdef THIS_NEEDED_YET
/*
* fcp scsi_xfer_rdy payload
*/
typedef struct fcp_xfer_rdy {
#endif /* THIS_NEEDED_YET */
/*
* fcp PRLI payload
*/
struct fcp_prli {
#if defined(_BIT_FIELDS_HTOL)
establish_image_pair : 1,
#elif defined(_BIT_FIELDS_LTOH)
establish_image_pair : 1,
#endif
#if defined(_BIT_FIELDS_HTOL)
retry : 1,
data_overlay_allowed : 1,
initiator_fn : 1,
target_fn : 1,
obsolete_2 : 1,
obsolete_1 : 1,
#elif defined(_BIT_FIELDS_LTOH)
obsolete_1 : 1,
obsolete_2 : 1,
target_fn : 1,
initiator_fn : 1,
data_overlay_allowed : 1,
retry : 1,
#endif
};
/*
* fcp PRLI ACC payload
*/
struct fcp_prli_acc {
};
| FC_UB_FCP_BUS_RESET) /* Out-of-band traget cmds */
#if !defined(__lint)
fcp_prli))
#endif /* __lint */
/*
* FC4 type setttings for Name Server registration.
*/
#ifdef __cplusplus
}
#endif
#endif /* _FCP_H */