srp.h revision 1bdd6c0e3710e91cb1f31aa78de33cb638494480
/*
* 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 _SRP_H
#define _SRP_H
/*
* General SCSI RDMA Protocol generic defines
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* The following defines and structures are based on revision 16A of
* the T10 Project 1415-D SRP Protocol specification.
*/
/* Protocol revsion information */
enum {
SRP_PROTOCOL = 0x0108,
SRP_PROTOCOL_VERSION = 0x0001,
SRP_REV_16A_IO_CLASS = 0x0100,
SRP_IO_SUBCLASS = 0x690E
};
/* SRP memory descriptors; direct and indirect formats */
typedef struct srp_direct_desc_s {
#pragma pack(1)
typedef struct srp_indirect_desc_s {
#pragma pack()
enum {
};
/* General constants */
enum {
SRP_CDB_SIZE = 16,
SRP_LUN_SIZE = 8,
SRP_PORT_ID_LEN = 16,
SRP_MIN_IU_SIZE = 64
};
/* SRP IU types */
enum {
SRP_IU_LOGIN_REQ = 0x00,
SRP_IU_TASK_MGMT = 0x01,
SRP_IU_CMD = 0x02,
SRP_IU_I_LOGOUT = 0x03,
SRP_IU_LOGIN_RSP = 0xC0,
SRP_IU_RSP = 0xC1,
SRP_IU_LOGIN_REJ = 0xC2,
SRP_IU_T_LOGOUT = 0x80,
SRP_IU_CRED_REQ = 0x81,
SRP_IU_AER_REQ = 0x82,
SRP_IU_CRED_RSP = 0x41,
SRP_IU_AER_RSP = 0x42
};
/* SRP Initiator Login IU, 64 bytes */
enum {
SRP_LOGIN_MULTI_CH_MASK = 0x03,
};
typedef struct srp_login_req_s {
/* SRP Task Management IU, 64 bytes. */
enum {
};
enum {
};
enum {
SRP_TSK_MGMT_CLEAR_ACA = 0x40
};
typedef struct srp_tsk_mgmt_s {
/* SRP Command Request IU, 48 bytes minimum */
enum {
SRP_DATA_DESC_NONE = 0,
SRP_DATA_DESC_DIRECT = 1,
};
#pragma pack(1)
typedef struct srp_cmd_req_s {
#pragma pack()
/* SRP Initiator Logout IU, 16 bytes */
typedef struct srp_i_logout_s {
/* SRP Login Response IU, 52 bytes */
enum {
};
#define SRP_LOGIN_RSP_SIZE 52
typedef struct srp_login_rsp_s {
/* SRP Response IU, 36 byte minimum */
enum {
};
enum {
SRP_RSP_VALID = 1,
};
/* Additional response data used for task mgmt responses */
enum {
SRP_TM_SUCCESS = 0,
SRP_TM_REQ_INVALID = 2,
SRP_TM_NOT_SUPPORTED = 4,
SRP_TM_FAILED = 5
};
typedef struct srp_rsp_data_s {
#define SRP_RSP_SIZE 36
typedef struct srp_rsp_s {
} srp_rsp_t;
/* SRP Login Reject IU, 32 bytes */
enum {
SRP_LOGIN_REJ_NO_REASON = 0x00010000,
SRP_LOGIN_REJ_INSUFFICIENT_CH_RESOURCES = 0x00010001,
SRP_LOGIN_REJ_REQ_IT_IU_LENGTH_TOO_LARGE = 0x00010002,
SRP_LOGIN_REJ_UNABLE_TO_ASSOCIATE_I_T_NEXUS = 0x00010003,
SRP_LOGIN_REJ_REQ_BUF_FORMAT_NOT_SUPPORTED = 0x00010004,
SRP_LOGIN_REJ_MULTI_CH_NOT_SUPPORTED = 0x00010005,
SRP_LOGIN_REJ_INIT_CH_LIMIT = 0x00010006
};
typedef struct srp_login_rej_s {
/* SRP Target Logout IU, 16 bytes */
enum {
};
typedef struct srp_t_logout_s {
#ifdef __cplusplus
}
#endif
#endif /* _SRP_H */