136c5fee3Smcneal /* 236c5fee3Smcneal * CDDL HEADER START 336c5fee3Smcneal * 436c5fee3Smcneal * The contents of this file are subject to the terms of the 536c5fee3Smcneal * Common Development and Distribution License (the "License"). 636c5fee3Smcneal * You may not use this file except in compliance with the License. 736c5fee3Smcneal * 836c5fee3Smcneal * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 936c5fee3Smcneal * or http://www.opensolaris.org/os/licensing. 1036c5fee3Smcneal * See the License for the specific language governing permissions 1136c5fee3Smcneal * and limitations under the License. 1236c5fee3Smcneal * 1336c5fee3Smcneal * When distributing Covered Code, include this CDDL HEADER in each 1436c5fee3Smcneal * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1536c5fee3Smcneal * If applicable, add the following below this CDDL HEADER, with the 1636c5fee3Smcneal * fields enclosed by brackets "[]" replaced with your own identifying 1736c5fee3Smcneal * information: Portions Copyright [yyyy] [name of copyright owner] 1836c5fee3Smcneal * 1936c5fee3Smcneal * CDDL HEADER END 2036c5fee3Smcneal */ 2136c5fee3Smcneal /* 22*a6d42e7dSPeter Dunlap * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2336c5fee3Smcneal * Use is subject to license terms. 2436c5fee3Smcneal */ 2536c5fee3Smcneal 2636c5fee3Smcneal #ifndef _ISCSI_PROTOCOL_H 2736c5fee3Smcneal #define _ISCSI_PROTOCOL_H 2836c5fee3Smcneal 2936c5fee3Smcneal #ifdef __cplusplus 3036c5fee3Smcneal extern "C" { 3136c5fee3Smcneal #endif 3236c5fee3Smcneal 3336c5fee3Smcneal /* 3436c5fee3Smcneal * iSCSI connection daemon 3536c5fee3Smcneal * Copyright (C) 2001 Cisco Systems, Inc. 3636c5fee3Smcneal * All rights reserved. 3736c5fee3Smcneal * 3836c5fee3Smcneal * This file sets up definitions of messages and constants used by the 3936c5fee3Smcneal * iSCSI protocol. 4036c5fee3Smcneal * 4136c5fee3Smcneal */ 4236c5fee3Smcneal 4336c5fee3Smcneal #include <sys/types.h> 4436c5fee3Smcneal #include <sys/isa_defs.h> 4536c5fee3Smcneal 4636c5fee3Smcneal #define ISCSI_MAX_NAME_LEN 224 4736c5fee3Smcneal 4836c5fee3Smcneal /* prototypes for iscsi_crc.c */ 4936c5fee3Smcneal uint32_t iscsi_crc32c(void *address, unsigned long length); 5036c5fee3Smcneal uint32_t iscsi_crc32c_continued(void *address, unsigned long length, 5136c5fee3Smcneal uint32_t crc); 5236c5fee3Smcneal 5336c5fee3Smcneal /* iSCSI listen port for incoming connections */ 5436c5fee3Smcneal #define ISCSI_LISTEN_PORT 3260 5536c5fee3Smcneal 5636c5fee3Smcneal /* assumes a pointer to a 3-byte array */ 5736c5fee3Smcneal #define ntoh24(p) (((p)[0] << 16) | ((p)[1] << 8) | ((p)[2])) 5836c5fee3Smcneal 5936c5fee3Smcneal /* assumes a pointer to a 3 byte array, and an integer value */ 6036c5fee3Smcneal #define hton24(p, v) {\ 6136c5fee3Smcneal p[0] = (((v) >> 16) & 0xFF); \ 6236c5fee3Smcneal p[1] = (((v) >> 8) & 0xFF); \ 6336c5fee3Smcneal p[2] = ((v) & 0xFF); \ 6436c5fee3Smcneal } 6536c5fee3Smcneal 6636c5fee3Smcneal 6736c5fee3Smcneal /* for Login min, max, active version fields */ 6836c5fee3Smcneal #define ISCSI_MIN_VERSION 0x00 6936c5fee3Smcneal #define ISCSI_DRAFT8_VERSION 0x02 7036c5fee3Smcneal #define ISCSI_DRAFT20_VERSION 0x00 7136c5fee3Smcneal #define ISCSI_MAX_VERSION 0x02 7236c5fee3Smcneal 7336c5fee3Smcneal /* Min. and Max. length of a PDU we can support */ 7436c5fee3Smcneal #define ISCSI_MIN_PDU_LENGTH (8 << 9) /* 4KB */ 7536c5fee3Smcneal #define ISCSI_MAX_PDU_LENGTH (0xffffffff) /* Huge */ 7636c5fee3Smcneal 7736c5fee3Smcneal /* Padding word length */ 7836c5fee3Smcneal #define ISCSI_PAD_WORD_LEN 4 7936c5fee3Smcneal 8036c5fee3Smcneal /* Max. number of Key=Value pairs in a text message */ 8136c5fee3Smcneal #define ISCSI_MAX_KEY_VALUE_PAIRS 8192 8236c5fee3Smcneal 8336c5fee3Smcneal /* text separtor between key value pairs exhanged in login */ 8436c5fee3Smcneal #define ISCSI_TEXT_SEPARATOR '=' 8536c5fee3Smcneal 86*a6d42e7dSPeter Dunlap /* reserved text constants for Text Mode Negotiation */ 87*a6d42e7dSPeter Dunlap #define ISCSI_TEXT_NONE "None" 88*a6d42e7dSPeter Dunlap #define ISCSI_TEXT_REJECT "Reject" 89*a6d42e7dSPeter Dunlap #define ISCSI_TEXT_IRRELEVANT "Irrelevant" 90*a6d42e7dSPeter Dunlap #define ISCSI_TEXT_NOTUNDERSTOOD "NotUnderstood" 91*a6d42e7dSPeter Dunlap 9236c5fee3Smcneal /* Sun's initiator session ID */ 9336c5fee3Smcneal #define ISCSI_SUN_ISID_0 0x40 /* ISID - EN format */ 9436c5fee3Smcneal #define ISCSI_SUN_ISID_1 0x00 /* Sec B */ 9536c5fee3Smcneal #define ISCSI_SUN_ISID_2 0x00 /* Sec B */ 9636c5fee3Smcneal #define ISCSI_SUN_ISID_3 0x2A /* Sec C - 42 = Sun's EN */ 9736c5fee3Smcneal 9836c5fee3Smcneal /* Reserved value for initiator/target task tag */ 9936c5fee3Smcneal #define ISCSI_RSVD_TASK_TAG 0xffffffff 10036c5fee3Smcneal 10136c5fee3Smcneal /* maximum length for text keys/values */ 10236c5fee3Smcneal #define KEY_MAXLEN 64 10336c5fee3Smcneal #define VALUE_MAXLEN 255 10436c5fee3Smcneal #define TARGET_NAME_MAXLEN VALUE_MAXLEN 10536c5fee3Smcneal 10636c5fee3Smcneal #define ISCSI_DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH 8192 10736c5fee3Smcneal 10836c5fee3Smcneal /* most PDU types have a final bit */ 10936c5fee3Smcneal #define ISCSI_FLAG_FINAL 0x80 11036c5fee3Smcneal 11136c5fee3Smcneal /* 11236c5fee3Smcneal * Strings used during SendTargets requests 11336c5fee3Smcneal */ 11436c5fee3Smcneal #define ISCSI_TEXT_SEPARATOR '=' 11536c5fee3Smcneal #define TARGETNAME "TargetName=" 11636c5fee3Smcneal #define TARGETADDRESS "TargetAddress=" 11736c5fee3Smcneal 11836c5fee3Smcneal /* iSCSI Template Message Header */ 11936c5fee3Smcneal typedef struct _iscsi_hdr { 12036c5fee3Smcneal uint8_t opcode; 12136c5fee3Smcneal uint8_t flags; /* Final bit */ 12236c5fee3Smcneal uint8_t rsvd2[2]; 12336c5fee3Smcneal uint8_t hlength; /* AHSs total length */ 12436c5fee3Smcneal uint8_t dlength[3]; /* Data length */ 12536c5fee3Smcneal uint8_t lun[8]; 12636c5fee3Smcneal uint32_t itt; /* Initiator Task Tag */ 12736c5fee3Smcneal uint8_t rsvd3[8]; 12836c5fee3Smcneal uint32_t expstatsn; 12936c5fee3Smcneal uint8_t other[16]; 13036c5fee3Smcneal } iscsi_hdr_t; 13136c5fee3Smcneal 13236c5fee3Smcneal typedef struct _iscsi_rsp_hdr { 13336c5fee3Smcneal uint8_t opcode; 13436c5fee3Smcneal uint8_t flags; 13536c5fee3Smcneal uint8_t rsvd1[3]; 13636c5fee3Smcneal uint8_t dlength[3]; 13736c5fee3Smcneal uint8_t rsvd2[8]; 13836c5fee3Smcneal uint32_t itt; 13936c5fee3Smcneal uint8_t rsvd3[4]; 14036c5fee3Smcneal uint32_t statsn; 14136c5fee3Smcneal uint32_t expcmdsn; 14236c5fee3Smcneal uint32_t maxcmdsn; 14336c5fee3Smcneal uint8_t rsvd4[12]; 14436c5fee3Smcneal } iscsi_rsp_hdr_t; 14536c5fee3Smcneal 14636c5fee3Smcneal /* Opcode encoding bits */ 14736c5fee3Smcneal #define ISCSI_OP_RETRY 0x80 14836c5fee3Smcneal #define ISCSI_OP_IMMEDIATE 0x40 14936c5fee3Smcneal #define ISCSI_OPCODE_MASK 0x3F 15036c5fee3Smcneal 15136c5fee3Smcneal /* Client to Server Message Opcode values */ 15236c5fee3Smcneal #define ISCSI_OP_NOOP_OUT 0x00 15336c5fee3Smcneal #define ISCSI_OP_SCSI_CMD 0x01 15436c5fee3Smcneal #define ISCSI_OP_SCSI_TASK_MGT_MSG 0x02 15536c5fee3Smcneal #define ISCSI_OP_LOGIN_CMD 0x03 15636c5fee3Smcneal #define ISCSI_OP_TEXT_CMD 0x04 15736c5fee3Smcneal #define ISCSI_OP_SCSI_DATA 0x05 15836c5fee3Smcneal #define ISCSI_OP_LOGOUT_CMD 0x06 15936c5fee3Smcneal #define ISCSI_OP_SNACK_CMD 0x10 16036c5fee3Smcneal 16136c5fee3Smcneal /* Server to Client Message Opcode values */ 16236c5fee3Smcneal #define ISCSI_OP_NOOP_IN 0x20 16336c5fee3Smcneal #define ISCSI_OP_SCSI_RSP 0x21 16436c5fee3Smcneal #define ISCSI_OP_SCSI_TASK_MGT_RSP 0x22 16536c5fee3Smcneal #define ISCSI_OP_LOGIN_RSP 0x23 16636c5fee3Smcneal #define ISCSI_OP_TEXT_RSP 0x24 16736c5fee3Smcneal #define ISCSI_OP_SCSI_DATA_RSP 0x25 16836c5fee3Smcneal #define ISCSI_OP_LOGOUT_RSP 0x26 16936c5fee3Smcneal #define ISCSI_OP_RTT_RSP 0x31 17036c5fee3Smcneal #define ISCSI_OP_ASYNC_EVENT 0x32 17136c5fee3Smcneal #define ISCSI_OP_REJECT_MSG 0x3f 17236c5fee3Smcneal 17336c5fee3Smcneal 17436c5fee3Smcneal /* SCSI Command Header */ 17536c5fee3Smcneal typedef struct _iscsi_scsi_cmd_hdr { 17636c5fee3Smcneal uint8_t opcode; 17736c5fee3Smcneal uint8_t flags; 17836c5fee3Smcneal uint8_t rsvd[2]; 17936c5fee3Smcneal uint8_t hlength; 18036c5fee3Smcneal uint8_t dlength[3]; 18136c5fee3Smcneal uint8_t lun[8]; 18236c5fee3Smcneal uint32_t itt; /* Initiator Task Tag */ 18336c5fee3Smcneal uint32_t data_length; 18436c5fee3Smcneal uint32_t cmdsn; 18536c5fee3Smcneal uint32_t expstatsn; 18636c5fee3Smcneal uint8_t scb[16]; /* SCSI Command Block */ 18736c5fee3Smcneal /* 18836c5fee3Smcneal * Additional Data (Command Dependent) 18936c5fee3Smcneal */ 19036c5fee3Smcneal } iscsi_scsi_cmd_hdr_t; 19136c5fee3Smcneal 19236c5fee3Smcneal /* Command PDU flags */ 19336c5fee3Smcneal #define ISCSI_FLAG_CMD_READ 0x40 19436c5fee3Smcneal #define ISCSI_FLAG_CMD_WRITE 0x20 19536c5fee3Smcneal #define ISCSI_FLAG_CMD_ATTR_MASK 0x07 /* 3 bits */ 19636c5fee3Smcneal 19736c5fee3Smcneal /* SCSI Command Attribute values */ 19836c5fee3Smcneal #define ISCSI_ATTR_UNTAGGED 0 19936c5fee3Smcneal #define ISCSI_ATTR_SIMPLE 1 20036c5fee3Smcneal #define ISCSI_ATTR_ORDERED 2 20136c5fee3Smcneal #define ISCSI_ATTR_HEAD_OF_QUEUE 3 20236c5fee3Smcneal #define ISCSI_ATTR_ACA 4 20336c5fee3Smcneal 20436c5fee3Smcneal 20536c5fee3Smcneal /* SCSI Response Header */ 20636c5fee3Smcneal typedef struct _iscsi_scsi_rsp_hdr { 20736c5fee3Smcneal uint8_t opcode; 20836c5fee3Smcneal uint8_t flags; 20936c5fee3Smcneal uint8_t response; 21036c5fee3Smcneal uint8_t cmd_status; 21136c5fee3Smcneal uint8_t hlength; 21236c5fee3Smcneal uint8_t dlength[3]; 21336c5fee3Smcneal uint8_t rsvd[8]; 21436c5fee3Smcneal uint32_t itt; /* Initiator Task Tag */ 21536c5fee3Smcneal uint32_t rsvd1; 21636c5fee3Smcneal uint32_t statsn; 21736c5fee3Smcneal uint32_t expcmdsn; 21836c5fee3Smcneal uint32_t maxcmdsn; 21936c5fee3Smcneal uint32_t expdatasn; 22036c5fee3Smcneal uint32_t bi_residual_count; 22136c5fee3Smcneal uint32_t residual_count; 22236c5fee3Smcneal /* 22336c5fee3Smcneal * Response or Sense Data (optional) 22436c5fee3Smcneal */ 22536c5fee3Smcneal } iscsi_scsi_rsp_hdr_t; 22636c5fee3Smcneal 22736c5fee3Smcneal /* 10.2.2.3 - Extended CDB Additional Header Segment */ 22836c5fee3Smcneal 22936c5fee3Smcneal typedef struct _iscsi_addl_hdr { 23036c5fee3Smcneal iscsi_scsi_cmd_hdr_t ahs_isch; 23136c5fee3Smcneal uint8_t ahs_hlen_hi; 23236c5fee3Smcneal uint8_t ahs_hlen_lo; 23336c5fee3Smcneal uint8_t ahs_key; 23436c5fee3Smcneal uint8_t ahs_resv; 23536c5fee3Smcneal uint8_t ahs_extscb[4]; 23636c5fee3Smcneal } iscsi_addl_hdr_t; 23736c5fee3Smcneal 23836c5fee3Smcneal /* Command Response PDU flags */ 23936c5fee3Smcneal #define ISCSI_FLAG_CMD_BIDI_OVERFLOW 0x10 24036c5fee3Smcneal #define ISCSI_FLAG_CMD_BIDI_UNDERFLOW 0x08 24136c5fee3Smcneal #define ISCSI_FLAG_CMD_OVERFLOW 0x04 24236c5fee3Smcneal #define ISCSI_FLAG_CMD_UNDERFLOW 0x02 24336c5fee3Smcneal 24436c5fee3Smcneal /* iSCSI Status values. Valid if Rsp Selector bit is not set */ 24536c5fee3Smcneal #define ISCSI_STATUS_CMD_COMPLETED 0 24636c5fee3Smcneal #define ISCSI_STATUS_TARGET_FAILURE 1 24736c5fee3Smcneal #define ISCSI_STATUS_SUBSYS_FAILURE 2 24836c5fee3Smcneal 24936c5fee3Smcneal 25036c5fee3Smcneal /* Asynchronous Event Header */ 25136c5fee3Smcneal typedef struct _iscsi_async_evt_hdr { 25236c5fee3Smcneal uint8_t opcode; 25336c5fee3Smcneal uint8_t flags; 25436c5fee3Smcneal uint8_t rsvd2[2]; 25536c5fee3Smcneal uint8_t rsvd3; 25636c5fee3Smcneal uint8_t dlength[3]; 25736c5fee3Smcneal uint8_t lun[8]; 25836c5fee3Smcneal uint8_t rsvd4[8]; 25936c5fee3Smcneal uint32_t statsn; 26036c5fee3Smcneal uint32_t expcmdsn; 26136c5fee3Smcneal uint32_t maxcmdsn; 26236c5fee3Smcneal uint8_t async_event; 26336c5fee3Smcneal uint8_t async_vcode; 26436c5fee3Smcneal uint16_t param1; 26536c5fee3Smcneal uint16_t param2; 26636c5fee3Smcneal uint16_t param3; 26736c5fee3Smcneal uint8_t rsvd5[4]; 26836c5fee3Smcneal } iscsi_async_evt_hdr_t; 26936c5fee3Smcneal 27036c5fee3Smcneal /* iSCSI Event Indicator values */ 27136c5fee3Smcneal #define ISCSI_ASYNC_EVENT_SCSI_EVENT 0 27236c5fee3Smcneal #define ISCSI_ASYNC_EVENT_REQUEST_LOGOUT 1 27336c5fee3Smcneal #define ISCSI_ASYNC_EVENT_DROPPING_CONNECTION 2 27436c5fee3Smcneal #define ISCSI_ASYNC_EVENT_DROPPING_ALL_CONNECTIONS 3 27536c5fee3Smcneal #define ISCSI_ASYNC_EVENT_PARAM_NEGOTIATION 4 27636c5fee3Smcneal #define ISCSI_ASYNC_EVENT_VENDOR_SPECIFIC 255 27736c5fee3Smcneal 27836c5fee3Smcneal 27936c5fee3Smcneal /* NOP-Out Message */ 28036c5fee3Smcneal typedef struct _iscsi_nop_out_hdr { 28136c5fee3Smcneal uint8_t opcode; 28236c5fee3Smcneal uint8_t flags; 28336c5fee3Smcneal uint16_t rsvd2; 28436c5fee3Smcneal uint8_t rsvd3; 28536c5fee3Smcneal uint8_t dlength[3]; 28636c5fee3Smcneal uint8_t lun[8]; 28736c5fee3Smcneal uint32_t itt; /* Initiator Task Tag */ 28836c5fee3Smcneal uint32_t ttt; /* Target Transfer Tag */ 28936c5fee3Smcneal uint32_t cmdsn; 29036c5fee3Smcneal uint32_t expstatsn; 29136c5fee3Smcneal uint8_t rsvd4[16]; 29236c5fee3Smcneal } iscsi_nop_out_hdr_t; 29336c5fee3Smcneal 29436c5fee3Smcneal 29536c5fee3Smcneal /* NOP-In Message */ 29636c5fee3Smcneal typedef struct _iscsi_nop_in_hdr { 29736c5fee3Smcneal uint8_t opcode; 29836c5fee3Smcneal uint8_t flags; 29936c5fee3Smcneal uint16_t rsvd2; 30036c5fee3Smcneal uint8_t rsvd3; 30136c5fee3Smcneal uint8_t dlength[3]; 30236c5fee3Smcneal uint8_t lun[8]; 30336c5fee3Smcneal uint32_t itt; /* Initiator Task Tag */ 30436c5fee3Smcneal uint32_t ttt; /* Target Transfer Tag */ 30536c5fee3Smcneal uint32_t statsn; 30636c5fee3Smcneal uint32_t expcmdsn; 30736c5fee3Smcneal uint32_t maxcmdsn; 30836c5fee3Smcneal uint8_t rsvd4[12]; 30936c5fee3Smcneal } iscsi_nop_in_hdr_t; 31036c5fee3Smcneal 31136c5fee3Smcneal /* SCSI Task Management Message Header */ 31236c5fee3Smcneal typedef struct _iscsi_scsi_task_mgt_hdr { 31336c5fee3Smcneal uint8_t opcode; 31436c5fee3Smcneal uint8_t function; 31536c5fee3Smcneal uint8_t rsvd1[2]; 31636c5fee3Smcneal uint8_t hlength; 31736c5fee3Smcneal uint8_t dlength[3]; 31836c5fee3Smcneal uint8_t lun[8]; 31936c5fee3Smcneal uint32_t itt; /* Initiator Task Tag */ 32036c5fee3Smcneal uint32_t rtt; /* Reference Task Tag */ 32136c5fee3Smcneal uint32_t cmdsn; 32236c5fee3Smcneal uint32_t expstatsn; 32336c5fee3Smcneal uint32_t refcmdsn; 32436c5fee3Smcneal uint32_t expdatasn; 32536c5fee3Smcneal uint8_t rsvd2[8]; 32636c5fee3Smcneal } iscsi_scsi_task_mgt_hdr_t; 32736c5fee3Smcneal 32836c5fee3Smcneal #define ISCSI_FLAG_TASK_MGMT_FUNCTION_MASK 0x7F 32936c5fee3Smcneal 33036c5fee3Smcneal /* Function values */ 33136c5fee3Smcneal #define ISCSI_TM_FUNC_ABORT_TASK 1 33236c5fee3Smcneal #define ISCSI_TM_FUNC_ABORT_TASK_SET 2 33336c5fee3Smcneal #define ISCSI_TM_FUNC_CLEAR_ACA 3 33436c5fee3Smcneal #define ISCSI_TM_FUNC_CLEAR_TASK_SET 4 33536c5fee3Smcneal #define ISCSI_TM_FUNC_LOGICAL_UNIT_RESET 5 33636c5fee3Smcneal #define ISCSI_TM_FUNC_TARGET_WARM_RESET 6 33736c5fee3Smcneal #define ISCSI_TM_FUNC_TARGET_COLD_RESET 7 33836c5fee3Smcneal #define ISCSI_TM_FUNC_TASK_REASSIGN 8 33936c5fee3Smcneal 34036c5fee3Smcneal 34136c5fee3Smcneal /* SCSI Task Management Response Header */ 34236c5fee3Smcneal typedef struct _iscsi_scsi_task_mgt_rsp_hdr { 34336c5fee3Smcneal uint8_t opcode; 34436c5fee3Smcneal uint8_t flags; 34536c5fee3Smcneal uint8_t response; /* see Response values below */ 34636c5fee3Smcneal uint8_t qualifier; 34736c5fee3Smcneal uint8_t hlength; 34836c5fee3Smcneal uint8_t dlength[3]; 34936c5fee3Smcneal uint8_t rsvd2[8]; 35036c5fee3Smcneal uint32_t itt; /* Initiator Task Tag */ 35136c5fee3Smcneal uint32_t rtt; /* Reference Task Tag */ 35236c5fee3Smcneal uint32_t statsn; 35336c5fee3Smcneal uint32_t expcmdsn; 35436c5fee3Smcneal uint32_t maxcmdsn; 35536c5fee3Smcneal uint8_t rsvd3[12]; 35636c5fee3Smcneal } iscsi_scsi_task_mgt_rsp_hdr_t; 35736c5fee3Smcneal 35836c5fee3Smcneal 35936c5fee3Smcneal /* Response values */ 36036c5fee3Smcneal #define SCSI_TCP_TM_RESP_COMPLETE 0x00 36136c5fee3Smcneal #define SCSI_TCP_TM_RESP_NO_TASK 0x01 36236c5fee3Smcneal #define SCSI_TCP_TM_RESP_NO_LUN 0x02 36336c5fee3Smcneal #define SCSI_TCP_TM_RESP_TASK_ALLEGIANT 0x03 364*a6d42e7dSPeter Dunlap #define SCSI_TCP_TM_RESP_NO_ALLG_REASSN 0x04 365*a6d42e7dSPeter Dunlap #define SCSI_TCP_TM_RESP_FUNC_NOT_SUPP 0x05 366*a6d42e7dSPeter Dunlap #define SCSI_TCP_TM_RESP_FUNC_AUTH_FAIL 0x06 36736c5fee3Smcneal #define SCSI_TCP_TM_RESP_REJECTED 0xff 36836c5fee3Smcneal 369*a6d42e7dSPeter Dunlap /* 370*a6d42e7dSPeter Dunlap * Maintained for backward compatibility. 371*a6d42e7dSPeter Dunlap */ 372*a6d42e7dSPeter Dunlap 373*a6d42e7dSPeter Dunlap #define SCSI_TCP_TM_RESP_NO_FAILOVER SCSI_TCP_TM_RESP_NO_ALLG_REASSN 374*a6d42e7dSPeter Dunlap #define SCSI_TCP_TM_RESP_IN_PRGRESS SCSI_TCP_TM_RESP_FUNC_NOT_SUPP 375*a6d42e7dSPeter Dunlap 37636c5fee3Smcneal /* Ready To Transfer Header */ 37736c5fee3Smcneal typedef struct _iscsi_rtt_hdr { 37836c5fee3Smcneal uint8_t opcode; 37936c5fee3Smcneal uint8_t flags; 38036c5fee3Smcneal uint8_t rsvd2[2]; 38136c5fee3Smcneal uint8_t rsvd3[12]; 38236c5fee3Smcneal uint32_t itt; /* Initiator Task Tag */ 38336c5fee3Smcneal uint32_t ttt; /* Target Transfer Tag */ 38436c5fee3Smcneal uint32_t statsn; 38536c5fee3Smcneal uint32_t expcmdsn; 38636c5fee3Smcneal uint32_t maxcmdsn; 38736c5fee3Smcneal uint32_t rttsn; 38836c5fee3Smcneal uint32_t data_offset; 38936c5fee3Smcneal uint32_t data_length; 39036c5fee3Smcneal } iscsi_rtt_hdr_t; 39136c5fee3Smcneal 39236c5fee3Smcneal 39336c5fee3Smcneal /* SCSI Data Hdr */ 39436c5fee3Smcneal typedef struct _iscsi_data_hdr { 39536c5fee3Smcneal uint8_t opcode; 39636c5fee3Smcneal uint8_t flags; 39736c5fee3Smcneal uint8_t rsvd2[2]; 39836c5fee3Smcneal uint8_t rsvd3; 39936c5fee3Smcneal uint8_t dlength[3]; 40036c5fee3Smcneal uint8_t lun[8]; 40136c5fee3Smcneal uint32_t itt; 40236c5fee3Smcneal uint32_t ttt; 40336c5fee3Smcneal uint32_t rsvd4; 40436c5fee3Smcneal uint32_t expstatsn; 40536c5fee3Smcneal uint32_t rsvd5; 40636c5fee3Smcneal uint32_t datasn; 40736c5fee3Smcneal uint32_t offset; 40836c5fee3Smcneal uint32_t rsvd6; 40936c5fee3Smcneal /* 41036c5fee3Smcneal * Payload 41136c5fee3Smcneal */ 41236c5fee3Smcneal } iscsi_data_hdr_t; 41336c5fee3Smcneal 41436c5fee3Smcneal /* SCSI Data Response Hdr */ 41536c5fee3Smcneal typedef struct _iscsi_data_rsp_hdr { 41636c5fee3Smcneal uint8_t opcode; 41736c5fee3Smcneal uint8_t flags; 41836c5fee3Smcneal uint8_t rsvd2; 41936c5fee3Smcneal uint8_t cmd_status; 42036c5fee3Smcneal uint8_t hlength; 42136c5fee3Smcneal uint8_t dlength[3]; 42236c5fee3Smcneal uint8_t lun[8]; 42336c5fee3Smcneal uint32_t itt; 42436c5fee3Smcneal uint32_t ttt; 42536c5fee3Smcneal uint32_t statsn; 42636c5fee3Smcneal uint32_t expcmdsn; 42736c5fee3Smcneal uint32_t maxcmdsn; 42836c5fee3Smcneal uint32_t datasn; 42936c5fee3Smcneal uint32_t offset; 43036c5fee3Smcneal uint32_t residual_count; 43136c5fee3Smcneal } iscsi_data_rsp_hdr_t; 43236c5fee3Smcneal 43336c5fee3Smcneal /* Data Response PDU flags */ 43436c5fee3Smcneal #define ISCSI_FLAG_DATA_ACK 0x40 43536c5fee3Smcneal #define ISCSI_FLAG_DATA_OVERFLOW 0x04 43636c5fee3Smcneal #define ISCSI_FLAG_DATA_UNDERFLOW 0x02 43736c5fee3Smcneal #define ISCSI_FLAG_DATA_STATUS 0x01 43836c5fee3Smcneal 43936c5fee3Smcneal 44036c5fee3Smcneal /* Text Header */ 44136c5fee3Smcneal typedef struct _iscsi_text_hdr { 44236c5fee3Smcneal uint8_t opcode; 44336c5fee3Smcneal uint8_t flags; 44436c5fee3Smcneal uint8_t rsvd2[2]; 44536c5fee3Smcneal uint8_t hlength; 44636c5fee3Smcneal uint8_t dlength[3]; 44736c5fee3Smcneal uint8_t rsvd4[8]; 44836c5fee3Smcneal uint32_t itt; 44936c5fee3Smcneal uint32_t ttt; 45036c5fee3Smcneal uint32_t cmdsn; 45136c5fee3Smcneal uint32_t expstatsn; 45236c5fee3Smcneal uint8_t rsvd5[16]; 45336c5fee3Smcneal /* 45436c5fee3Smcneal * Text - key=value pairs 45536c5fee3Smcneal */ 45636c5fee3Smcneal } iscsi_text_hdr_t; 45736c5fee3Smcneal 45836c5fee3Smcneal #define ISCSI_FLAG_TEXT_CONTINUE 0x40 45936c5fee3Smcneal 46036c5fee3Smcneal /* Text Response Header */ 46136c5fee3Smcneal typedef struct _iscsi_text_rsp_hdr { 46236c5fee3Smcneal uint8_t opcode; 46336c5fee3Smcneal uint8_t flags; 46436c5fee3Smcneal uint8_t rsvd2[2]; 46536c5fee3Smcneal uint8_t hlength; 46636c5fee3Smcneal uint8_t dlength[3]; 46736c5fee3Smcneal uint8_t rsvd4[8]; 46836c5fee3Smcneal uint32_t itt; 46936c5fee3Smcneal uint32_t ttt; 47036c5fee3Smcneal uint32_t statsn; 47136c5fee3Smcneal uint32_t expcmdsn; 47236c5fee3Smcneal uint32_t maxcmdsn; 47336c5fee3Smcneal uint8_t rsvd5[12]; 47436c5fee3Smcneal /* 47536c5fee3Smcneal * Text Response - key:value pairs 47636c5fee3Smcneal */ 47736c5fee3Smcneal } iscsi_text_rsp_hdr_t; 47836c5fee3Smcneal 479*a6d42e7dSPeter Dunlap #define ISCSI_ISID_LEN 6 480*a6d42e7dSPeter Dunlap 48136c5fee3Smcneal /* Login Header */ 48236c5fee3Smcneal typedef struct _iscsi_login_hdr { 48336c5fee3Smcneal uint8_t opcode; 48436c5fee3Smcneal uint8_t flags; 48536c5fee3Smcneal uint8_t max_version; /* Max. version supported */ 48636c5fee3Smcneal uint8_t min_version; /* Min. version supported */ 48736c5fee3Smcneal uint8_t hlength; 48836c5fee3Smcneal uint8_t dlength[3]; 489*a6d42e7dSPeter Dunlap uint8_t isid[ISCSI_ISID_LEN]; /* Initiator Session ID */ 49036c5fee3Smcneal uint16_t tsid; /* Target Session ID */ 49136c5fee3Smcneal uint32_t itt; /* Initiator Task Tag */ 49236c5fee3Smcneal uint16_t cid; 49336c5fee3Smcneal uint16_t rsvd3; 49436c5fee3Smcneal uint32_t cmdsn; 49536c5fee3Smcneal uint32_t expstatsn; 49636c5fee3Smcneal uint8_t rsvd5[16]; 49736c5fee3Smcneal } iscsi_login_hdr_t; 49836c5fee3Smcneal 49936c5fee3Smcneal /* Login PDU flags */ 50036c5fee3Smcneal #define ISCSI_FLAG_LOGIN_TRANSIT 0x80 50136c5fee3Smcneal #define ISCSI_FLAG_LOGIN_CONTINUE 0x40 50236c5fee3Smcneal #define ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK 0x0C /* 2 bits */ 50336c5fee3Smcneal #define ISCSI_FLAG_LOGIN_NEXT_STAGE_MASK 0x03 /* 2 bits */ 50436c5fee3Smcneal 50536c5fee3Smcneal #define ISCSI_LOGIN_CURRENT_STAGE(flags) \ 50636c5fee3Smcneal ((flags & ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK) >> 2) 50736c5fee3Smcneal #define ISCSI_LOGIN_NEXT_STAGE(flags) \ 50836c5fee3Smcneal (flags & ISCSI_FLAG_LOGIN_NEXT_STAGE_MASK) 50936c5fee3Smcneal 51036c5fee3Smcneal 51136c5fee3Smcneal /* Login Response Header */ 51236c5fee3Smcneal typedef struct _iscsi_login_rsp_hdr { 51336c5fee3Smcneal uint8_t opcode; 51436c5fee3Smcneal uint8_t flags; 51536c5fee3Smcneal uint8_t max_version; /* Max. version supported */ 51636c5fee3Smcneal uint8_t active_version; /* Active version */ 51736c5fee3Smcneal uint8_t hlength; 51836c5fee3Smcneal uint8_t dlength[3]; 519*a6d42e7dSPeter Dunlap uint8_t isid[ISCSI_ISID_LEN]; /* Initiator Session ID */ 52036c5fee3Smcneal uint16_t tsid; /* Target Session ID */ 52136c5fee3Smcneal uint32_t itt; /* Initiator Task Tag */ 52236c5fee3Smcneal uint32_t rsvd3; 52336c5fee3Smcneal uint32_t statsn; 52436c5fee3Smcneal uint32_t expcmdsn; 52536c5fee3Smcneal uint32_t maxcmdsn; 52636c5fee3Smcneal uint8_t status_class; /* see Login RSP ststus classes below */ 52736c5fee3Smcneal uint8_t status_detail; /* see Login RSP Status details below */ 52836c5fee3Smcneal uint8_t rsvd4[10]; 52936c5fee3Smcneal } iscsi_login_rsp_hdr_t; 53036c5fee3Smcneal 53136c5fee3Smcneal /* Login stage (phase) codes for CSG, NSG */ 53236c5fee3Smcneal #define ISCSI_SECURITY_NEGOTIATION_STAGE 0 53336c5fee3Smcneal #define ISCSI_OP_PARMS_NEGOTIATION_STAGE 1 53436c5fee3Smcneal #define ISCSI_FULL_FEATURE_PHASE 3 53536c5fee3Smcneal 53636c5fee3Smcneal /* Login Status response classes */ 53736c5fee3Smcneal #define ISCSI_STATUS_CLASS_SUCCESS 0x00 53836c5fee3Smcneal #define ISCSI_STATUS_CLASS_REDIRECT 0x01 53936c5fee3Smcneal #define ISCSI_STATUS_CLASS_INITIATOR_ERR 0x02 54036c5fee3Smcneal #define ISCSI_STATUS_CLASS_TARGET_ERR 0x03 54136c5fee3Smcneal 54236c5fee3Smcneal /* Login Status response detail codes */ 54336c5fee3Smcneal /* Class-0 (Success) */ 54436c5fee3Smcneal #define ISCSI_LOGIN_STATUS_ACCEPT 0x00 54536c5fee3Smcneal 54636c5fee3Smcneal /* Class-1 (Redirection) */ 54736c5fee3Smcneal #define ISCSI_LOGIN_STATUS_TGT_MOVED_TEMP 0x01 54836c5fee3Smcneal #define ISCSI_LOGIN_STATUS_TGT_MOVED_PERM 0x02 54936c5fee3Smcneal 55036c5fee3Smcneal /* Class-2 (Initiator Error) */ 55136c5fee3Smcneal #define ISCSI_LOGIN_STATUS_INIT_ERR 0x00 55236c5fee3Smcneal #define ISCSI_LOGIN_STATUS_AUTH_FAILED 0x01 55336c5fee3Smcneal #define ISCSI_LOGIN_STATUS_TGT_FORBIDDEN 0x02 55436c5fee3Smcneal #define ISCSI_LOGIN_STATUS_TGT_NOT_FOUND 0x03 55536c5fee3Smcneal #define ISCSI_LOGIN_STATUS_TGT_REMOVED 0x04 55636c5fee3Smcneal #define ISCSI_LOGIN_STATUS_NO_VERSION 0x05 55736c5fee3Smcneal #define ISCSI_LOGIN_STATUS_ISID_ERROR 0x06 55836c5fee3Smcneal #define ISCSI_LOGIN_STATUS_MISSING_FIELDS 0x07 55936c5fee3Smcneal #define ISCSI_LOGIN_STATUS_CONN_ADD_FAILED 0x08 56036c5fee3Smcneal #define ISCSI_LOGIN_STATUS_NO_SESSION_TYPE 0x09 56136c5fee3Smcneal #define ISCSI_LOGIN_STATUS_NO_SESSION 0x0a 56236c5fee3Smcneal #define ISCSI_LOGIN_STATUS_INVALID_REQUEST 0x0b 56336c5fee3Smcneal 56436c5fee3Smcneal /* Class-3 (Target Error) */ 56536c5fee3Smcneal #define ISCSI_LOGIN_STATUS_TARGET_ERROR 0x00 56636c5fee3Smcneal #define ISCSI_LOGIN_STATUS_SVC_UNAVAILABLE 0x01 56736c5fee3Smcneal #define ISCSI_LOGIN_STATUS_NO_RESOURCES 0x02 56836c5fee3Smcneal 56936c5fee3Smcneal /* Logout Header */ 57036c5fee3Smcneal typedef struct _iscsi_logout_hdr { 57136c5fee3Smcneal uint8_t opcode; 57236c5fee3Smcneal uint8_t flags; 57336c5fee3Smcneal uint8_t rsvd1[2]; 57436c5fee3Smcneal uint8_t hlength; 57536c5fee3Smcneal uint8_t dlength[3]; 57636c5fee3Smcneal uint8_t rsvd2[8]; 57736c5fee3Smcneal uint32_t itt; /* Initiator Task Tag */ 57836c5fee3Smcneal uint16_t cid; 57936c5fee3Smcneal uint8_t rsvd3[2]; 58036c5fee3Smcneal uint32_t cmdsn; 58136c5fee3Smcneal uint32_t expstatsn; 58236c5fee3Smcneal uint8_t rsvd4[16]; 58336c5fee3Smcneal } iscsi_logout_hdr_t; 58436c5fee3Smcneal 58536c5fee3Smcneal /* Logout PDU flags */ 58636c5fee3Smcneal #define ISCSI_FLAG_LOGOUT_REASON_MASK 0x7F 58736c5fee3Smcneal 58836c5fee3Smcneal /* logout reason_code values */ 58936c5fee3Smcneal 59036c5fee3Smcneal #define ISCSI_LOGOUT_REASON_CLOSE_SESSION 0 59136c5fee3Smcneal #define ISCSI_LOGOUT_REASON_CLOSE_CONNECTION 1 59236c5fee3Smcneal #define ISCSI_LOGOUT_REASON_RECOVERY 2 59336c5fee3Smcneal #define ISCSI_LOGOUT_REASON_AEN_REQUEST 3 59436c5fee3Smcneal 59536c5fee3Smcneal /* Logout Response Header */ 59636c5fee3Smcneal typedef struct _iscsi_logout_rsp_hdr { 59736c5fee3Smcneal uint8_t opcode; 59836c5fee3Smcneal uint8_t flags; 59936c5fee3Smcneal uint8_t response; /* see Logout response values below */ 60036c5fee3Smcneal uint8_t rsvd2; 60136c5fee3Smcneal uint8_t hlength; 60236c5fee3Smcneal uint8_t dlength[3]; 60336c5fee3Smcneal uint8_t rsvd3[8]; 60436c5fee3Smcneal uint32_t itt; /* Initiator Task Tag */ 60536c5fee3Smcneal uint32_t rsvd4; 60636c5fee3Smcneal uint32_t statsn; 60736c5fee3Smcneal uint32_t expcmdsn; 60836c5fee3Smcneal uint32_t maxcmdsn; 60936c5fee3Smcneal uint32_t rsvd5; 61036c5fee3Smcneal uint16_t t2wait; 61136c5fee3Smcneal uint16_t t2retain; 61236c5fee3Smcneal uint32_t rsvd6; 61336c5fee3Smcneal } iscsi_logout_rsp_hdr_t; 61436c5fee3Smcneal 61536c5fee3Smcneal /* logout response status values */ 61636c5fee3Smcneal 61736c5fee3Smcneal #define ISCSI_LOGOUT_SUCCESS 0 61836c5fee3Smcneal #define ISCSI_LOGOUT_CID_NOT_FOUND 1 61936c5fee3Smcneal #define ISCSI_LOGOUT_RECOVERY_UNSUPPORTED 2 62036c5fee3Smcneal #define ISCSI_LOGOUT_CLEANUP_FAILED 3 62136c5fee3Smcneal 62236c5fee3Smcneal 62336c5fee3Smcneal /* SNACK Header */ 62436c5fee3Smcneal typedef struct _iscsi_snack_hdr { 62536c5fee3Smcneal uint8_t opcode; 62636c5fee3Smcneal uint8_t flags; 62736c5fee3Smcneal uint8_t rsvd2[14]; 62836c5fee3Smcneal uint32_t itt; 62936c5fee3Smcneal uint32_t begrun; 63036c5fee3Smcneal uint32_t runlength; 63136c5fee3Smcneal uint32_t expstatsn; 63236c5fee3Smcneal uint32_t rsvd3; 63336c5fee3Smcneal uint32_t expdatasn; 63436c5fee3Smcneal uint8_t rsvd6[8]; 63536c5fee3Smcneal } iscsi_snack_hdr_t; 63636c5fee3Smcneal 63736c5fee3Smcneal /* SNACK PDU flags */ 63836c5fee3Smcneal #define ISCSI_FLAG_SNACK_TYPE_MASK 0x0F /* 4 bits */ 63936c5fee3Smcneal 64036c5fee3Smcneal /* Reject Message Header */ 64136c5fee3Smcneal typedef struct _iscsi_reject_rsp_hdr { 64236c5fee3Smcneal uint8_t opcode; 64336c5fee3Smcneal uint8_t flags; 64436c5fee3Smcneal uint8_t reason; 64536c5fee3Smcneal uint8_t rsvd2; 64636c5fee3Smcneal uint8_t rsvd3; 64736c5fee3Smcneal uint8_t dlength[3]; 648*a6d42e7dSPeter Dunlap uint8_t rsvd4[8]; 649*a6d42e7dSPeter Dunlap uint8_t must_be_ff[4]; 650*a6d42e7dSPeter Dunlap uint8_t rsvd4a[4]; 65136c5fee3Smcneal uint32_t statsn; 65236c5fee3Smcneal uint32_t expcmdsn; 65336c5fee3Smcneal uint32_t maxcmdsn; 65436c5fee3Smcneal uint32_t datasn; 65536c5fee3Smcneal uint8_t rsvd5[8]; 65636c5fee3Smcneal /* 65736c5fee3Smcneal * Text - Rejected hdr 65836c5fee3Smcneal */ 65936c5fee3Smcneal } iscsi_reject_rsp_hdr_t; 66036c5fee3Smcneal 66136c5fee3Smcneal /* Reason for Reject */ 66236c5fee3Smcneal #define ISCSI_REJECT_CMD_BEFORE_LOGIN 1 66336c5fee3Smcneal #define ISCSI_REJECT_DATA_DIGEST_ERROR 2 66436c5fee3Smcneal #define ISCSI_REJECT_SNACK_REJECT 3 66536c5fee3Smcneal #define ISCSI_REJECT_PROTOCOL_ERROR 4 66636c5fee3Smcneal #define ISCSI_REJECT_CMD_NOT_SUPPORTED 5 66736c5fee3Smcneal #define ISCSI_REJECT_IMM_CMD_REJECT 6 66836c5fee3Smcneal #define ISCSI_REJECT_TASK_IN_PROGRESS 7 66936c5fee3Smcneal #define ISCSI_REJECT_INVALID_DATA_ACK 8 67036c5fee3Smcneal #define ISCSI_REJECT_INVALID_PDU_FIELD 9 67136c5fee3Smcneal #define ISCSI_REJECT_LONG_OPERATION_REJECT 10 67236c5fee3Smcneal #define ISCSI_REJECT_NEGOTIATION_RESET 11 67336c5fee3Smcneal #define ISCSI_REJECT_WAITING_FOR_LOGOUT 12 67436c5fee3Smcneal 67536c5fee3Smcneal /* Defaults as defined by the iSCSI specification */ 67636c5fee3Smcneal #define ISCSI_DEFAULT_IMMEDIATE_DATA TRUE 67736c5fee3Smcneal #define ISCSI_DEFAULT_INITIALR2T TRUE 67836c5fee3Smcneal #define ISCSI_DEFAULT_FIRST_BURST_LENGTH (64 * 1024) /* 64kbytes */ 67936c5fee3Smcneal #define ISCSI_DEFAULT_MAX_BURST_LENGTH (256 * 1024) /* 256kbytes */ 68036c5fee3Smcneal #define ISCSI_DEFAULT_DATA_PDU_IN_ORDER TRUE 68136c5fee3Smcneal #define ISCSI_DEFAULT_DATA_SEQUENCE_IN_ORDER TRUE 68236c5fee3Smcneal #define ISCSI_DEFAULT_TIME_TO_WAIT 2 /* 2 seconds */ 68336c5fee3Smcneal #define ISCSI_DEFAULT_TIME_TO_RETAIN 20 /* 20 seconds */ 68436c5fee3Smcneal #define ISCSI_DEFAULT_HEADER_DIGEST ISCSI_DIGEST_NONE 68536c5fee3Smcneal #define ISCSI_DEFAULT_DATA_DIGEST ISCSI_DIGEST_NONE 68636c5fee3Smcneal #define ISCSI_DEFAULT_MAX_RECV_SEG_LEN (64 * 1024) 68736c5fee3Smcneal #define ISCSI_DEFAULT_MAX_XMIT_SEG_LEN (8 * 1024) 68836c5fee3Smcneal #define ISCSI_DEFAULT_MAX_CONNECTIONS 1 68936c5fee3Smcneal #define ISCSI_DEFAULT_MAX_OUT_R2T 1 69036c5fee3Smcneal #define ISCSI_DEFAULT_ERROR_RECOVERY_LEVEL 0 69136c5fee3Smcneal #define ISCSI_DEFAULT_IFMARKER FALSE 69236c5fee3Smcneal #define ISCSI_DEFAULT_OFMARKER FALSE 69336c5fee3Smcneal 694*a6d42e7dSPeter Dunlap /* 695*a6d42e7dSPeter Dunlap * Minimum values from the iSCSI specification 696*a6d42e7dSPeter Dunlap */ 697*a6d42e7dSPeter Dunlap 698*a6d42e7dSPeter Dunlap #define ISCSI_MIN_TIME2RETAIN 0 699*a6d42e7dSPeter Dunlap #define ISCSI_MIN_TIME2WAIT 0 700*a6d42e7dSPeter Dunlap #define ISCSI_MIN_ERROR_RECOVERY_LEVEL 0 701*a6d42e7dSPeter Dunlap #define ISCSI_MIN_RECV_DATA_SEGMENT_LENGTH 0x200 702*a6d42e7dSPeter Dunlap #define ISCSI_MIN_FIRST_BURST_LENGTH 0x200 703*a6d42e7dSPeter Dunlap #define ISCSI_MIN_MAX_BURST_LENGTH 0x200 704*a6d42e7dSPeter Dunlap #define ISCSI_MIN_CONNECTIONS 1 705*a6d42e7dSPeter Dunlap #define ISCSI_MIN_MAX_OUTSTANDING_R2T 1 706*a6d42e7dSPeter Dunlap 70736c5fee3Smcneal /* 70836c5fee3Smcneal * Maximum values from the iSCSI specification 70936c5fee3Smcneal */ 71036c5fee3Smcneal #define ISCSI_MAX_HEADER_DIGEST 3 71136c5fee3Smcneal #define ISCSI_MAX_DATA_DIGEST 3 71236c5fee3Smcneal #define ISCSI_MAX_TIME2RETAIN 3600 71336c5fee3Smcneal #define ISCSI_MAX_TIME2WAIT 3600 71436c5fee3Smcneal #define ISCSI_MAX_ERROR_RECOVERY_LEVEL 2 71536c5fee3Smcneal #define ISCSI_MAX_FIRST_BURST_LENGTH 0xffffff 71636c5fee3Smcneal #define ISCSI_MAX_BURST_LENGTH 0xffffff 71736c5fee3Smcneal #define ISCSI_MAX_CONNECTIONS 65535 71836c5fee3Smcneal #define ISCSI_MAX_OUTSTANDING_R2T 65535 71936c5fee3Smcneal #define ISCSI_MAX_RECV_DATA_SEGMENT_LENGTH 0xffffff 72036c5fee3Smcneal #define ISCSI_MAX_TPGT_VALUE 65535 /* 16 bit numeric */ 72136c5fee3Smcneal 72236c5fee3Smcneal /* 72336c5fee3Smcneal * iqn and eui name prefixes and related defines 72436c5fee3Smcneal */ 72536c5fee3Smcneal #define ISCSI_IQN_NAME_PREFIX "iqn" 72636c5fee3Smcneal #define ISCSI_EUI_NAME_PREFIX "eui" 72736c5fee3Smcneal #define ISCSI_EUI_NAME_LEN 20 /* eui. plus 16 octets */ 72836c5fee3Smcneal 72936c5fee3Smcneal #ifdef __cplusplus 73036c5fee3Smcneal } 73136c5fee3Smcneal #endif 73236c5fee3Smcneal 73336c5fee3Smcneal #endif /* _ISCSI_PROTOCOL_H */ 734