23 #define ISCSI_PORT 3260 26 #define ISCSI_FIRST_BURST_LEN 65536 29 #define ISCSI_MAX_BURST_LEN 262144 32 #define ISCSI_MAX_RECV_DATA_SEG_LEN 8192 57 #define ISCSI_AHS_LEN( segment_lengths ) \ 58 ( (segment_lengths).bytes.ahs_len ) 61 #define ISCSI_DATA_LEN( segment_lengths ) \ 62 ( ntohl ( (segment_lengths).ahs_and_data_len ) & 0xffffff ) 65 #define ISCSI_DATA_PAD_LEN( segment_lengths ) \ 66 ( ( 0 - (segment_lengths).bytes.data_len[2] ) & 0x03 ) 69 #define ISCSI_SET_LENGTHS( segment_lengths, ahs_len, data_len ) do { \ 70 (segment_lengths).ahs_and_data_len = \ 71 htonl ( data_len | ( ahs_len << 24 ) ); \ 96 #define ISCSI_OPCODE_MASK 0x3f 99 #define ISCSI_FLAG_IMMEDIATE 0x40 102 #define ISCSI_FLAG_FINAL 0x80 105 #define ISCSI_TAG_MAGIC 0x18ae0000 108 #define ISCSI_TAG_RESERVED 0xffffffff 173 #define ISCSI_OPCODE_LOGIN_REQUEST 0x03 176 #define ISCSI_LOGIN_FLAG_TRANSITION 0x80 179 #define ISCSI_LOGIN_FLAG_CONTINUE 0x40 182 #define ISCSI_LOGIN_CSG_MASK 0x0c 183 #define ISCSI_LOGIN_CSG_SECURITY_NEGOTIATION 0x00 184 #define ISCSI_LOGIN_CSG_OPERATIONAL_NEGOTIATION 0x04 185 #define ISCSI_LOGIN_CSG_FULL_FEATURE_PHASE 0x0c 188 #define ISCSI_LOGIN_NSG_MASK 0x03 189 #define ISCSI_LOGIN_NSG_SECURITY_NEGOTIATION 0x00 190 #define ISCSI_LOGIN_NSG_OPERATIONAL_NEGOTIATION 0x01 191 #define ISCSI_LOGIN_NSG_FULL_FEATURE_PHASE 0x03 194 #define ISCSI_ISID_IANA 0x40000000 201 #define IANA_EN_FEN_SYSTEMS 10019 243 #define ISCSI_OPCODE_LOGIN_RESPONSE 0x23 246 #define ISCSI_STATUS_SUCCESS 0x00 247 #define ISCSI_STATUS_REDIRECT 0x01 248 #define ISCSI_STATUS_INITIATOR_ERROR 0x02 249 #define ISCSI_STATUS_INITIATOR_ERROR_AUTHENTICATION 0x01 250 #define ISCSI_STATUS_INITIATOR_ERROR_AUTHORISATION 0x02 251 #define ISCSI_STATUS_INITIATOR_ERROR_NOT_FOUND 0x03 252 #define ISCSI_STATUS_INITIATOR_ERROR_REMOVED 0x04 253 #define ISCSI_STATUS_TARGET_ERROR 0x03 254 #define ISCSI_STATUS_TARGET_ERROR_UNAVAILABLE 0x01 255 #define ISCSI_STATUS_TARGET_ERROR_NO_RESOURCES 0x02 285 #define ISCSI_OPCODE_SCSI_COMMAND 0x01 288 #define ISCSI_COMMAND_FLAG_READ 0x40 291 #define ISCSI_COMMAND_FLAG_WRITE 0x20 294 #define ISCSI_COMMAND_ATTR_UNTAGGED 0x00 295 #define ISCSI_COMMAND_ATTR_SIMPLE 0x01 296 #define ISCSI_COMMAND_ATTR_ORDERED 0x02 297 #define ISCSI_COMMAND_ATTR_HEAD_OF_QUEUE 0x03 298 #define ISCSI_COMMAND_ATTR_ACA 0x04 336 #define ISCSI_OPCODE_SCSI_RESPONSE 0x21 339 #define ISCSI_RESPONSE_COMMAND_COMPLETE 0x00 342 #define ISCSI_RESPONSE_TARGET_FAILURE 0x01 345 #define ISCSI_RESPONSE_FLAG_OVERFLOW 0x20 348 #define ISCSI_RESPONSE_FLAG_UNDERFLOW 0x40 386 #define ISCSI_OPCODE_DATA_IN 0x25 389 #define ISCSI_DATA_FLAG_ACKNOWLEDGE 0x40 392 #define ISCSI_DATA_FLAG_OVERFLOW 0x04 395 #define ISCSI_DATA_FLAG_UNDERFLOW 0x02 398 #define ISCSI_DATA_FLAG_STATUS 0x01 434 #define ISCSI_OPCODE_DATA_OUT 0x05 470 #define ISCSI_OPCODE_R2T 0x31 500 #define ISCSI_OPCODE_NOP_IN 0x20 669 #define ISCSI_STATUS_SECURITY_NEGOTIATION_PHASE \ 670 ( ISCSI_LOGIN_CSG_SECURITY_NEGOTIATION | \ 671 ISCSI_LOGIN_NSG_OPERATIONAL_NEGOTIATION ) 676 #define ISCSI_STATUS_OPERATIONAL_NEGOTIATION_PHASE \ 677 ( ISCSI_LOGIN_CSG_OPERATIONAL_NEGOTIATION | \ 678 ISCSI_LOGIN_NSG_FULL_FEATURE_PHASE ) 681 #define ISCSI_STATUS_FULL_FEATURE_PHASE ISCSI_LOGIN_CSG_FULL_FEATURE_PHASE 684 #define ISCSI_STATUS_PHASE_MASK ( ISCSI_LOGIN_CSG_MASK | ISCSI_LOGIN_NSG_MASK ) 687 #define ISCSI_STATUS_STRINGS_SECURITY 0x0100 690 #define ISCSI_STATUS_STRINGS_CHAP_ALGORITHM 0x0200 693 #define ISCSI_STATUS_STRINGS_CHAP_RESPONSE 0x0400 696 #define ISCSI_STATUS_STRINGS_CHAP_CHALLENGE 0x0800 699 #define ISCSI_STATUS_STRINGS_OPERATIONAL 0x1000 702 #define ISCSI_STATUS_STRINGS_MASK 0xff00 705 #define ISCSI_STATUS_AUTH_FORWARD_REQUIRED 0x00010000 708 #define ISCSI_STATUS_AUTH_REVERSE_REQUIRED 0x00020000 711 #define ISCSI_STATUS_AUTH_REVERSE_OK 0x00040000 714 #define ISCSI_DEFAULT_IQN_PREFIX "iqn.2010-04.org.ipxe" uint32_t isid_iana_en
Initiator session ID (IANA format) enterprise number and flags.
uint16_t isid_iana_qual
Initiator session ID (IANA format) qualifier.
iscsi_tx_state
State of an iSCSI TX engine.
iSCSI data-in basic header segment
iSCSI NOP-In basic header segment
uint32_t expcmdsn
Expected command sequence number.
struct iscsi_bhs_login_request login_request
#define SETTING_SANBOOT_EXTRA
SAN boot additional settings.
uint8_t reserved_a[8]
Reserved.
uint32_t expcmdsn
Expected command sequence number.
char * initiator_username
Initiator username (if any)
struct iscsi_bhs_common common
struct sockaddr target_sockaddr
Target socket address (for boot firmware table)
uint32_t ttt
Target transfer tag.
uint32_t residual_count
Residual count.
union iscsi_segment_lengths lengths
Segment lengths.
uint8_t other_b[8]
Fields specific to the PDU type.
uint32_t maxcmdsn
Maximum command sequence number.
Receiving the data segment.
uint16_t cid
Connection ID.
union iscsi_segment_lengths lengths
Segment lengths.
struct interface socket
Transport-layer socket.
union iscsi_segment_lengths lengths
Segment lengths.
uint32_t offset
Buffer offset.
uint32_t itt
Initiator Task Tag.
uint32_t itt
Initiator Task Tag.
uint16_t reserved_a
Reserved.
iSCSI login request basic header segment
struct iscsi_bhs_data_out data_out
struct iscsi_bhs_common_response common_response
uint32_t r2tsn
R2T sequence number.
uint32_t itt
Initiator Task Tag.
uint32_t maxcmdsn
Maximum command sequence number.
uint32_t statsn
Status sequence number.
uint32_t expstatsn
Expected status sequence number.
struct scsi_lun lun
Logical Unit Number.
uint8_t other_c[28]
Fields specific to the PDU type.
uint32_t maxcmdsn
Maximum command sequence number.
size_t rx_len
Length of the current RX state.
uint16_t tsih
Target session identifying handle.
iscsi_rx_state
State of an iSCSI RX engine.
uint8_t response
Response code.
struct scsi_lun lun
Logical Unit Number.
uint32_t expcmdsn
Expected command sequence number.
uint32_t expcmdsn
Expected command sequence number.
uint32_t statsn
Status sequence number.
uint32_t maxcmdsn
Maximum command sequence number.
void * rx_buffer
Buffer for received data (not always used)
uint8_t status
SCSI status code.
uint16_t reserved_a
Reserved.
iSCSI SCSI command basic header segment
uint8_t status
SCSI status code.
uint8_t version_min
Minimum supported version number.
uint32_t statsn
Status sequence number.
Data transfer interfaces.
unsigned int target_port
Target port.
struct scsi_lun lun
Logical Unit Number.
char * initiator_password
Initiator password (if any)
uint8_t status_detail
Status detail.
uint32_t ttt
Target Transfer Tag.
uint8_t reserved_b[12]
Reserved.
size_t rx_offset
Byte offset within the current RX state.
unsigned char bytes[sizeof(struct iscsi_bhs_common)]
uint32_t reserved_a
Reserved.
uint32_t expcmdsn
Expected command sequence number.
uint8_t version_min
Minimum supported version number.
struct interface control
SCSI command-issuing interface.
uint8_t reserved_a
Reserved.
uint16_t tsih
Target session identifying handle.
uint8_t other_c[4]
Fields specific to the PDU type.
uint8_t data_len[3]
The data length (measured in bytes), in network byte order.
uint32_t itt
Initiator task tag.
uint32_t datasn
Data sequence number.
uint16_t reserved_a
Reserved.
union iscsi_segment_lengths lengths
Segment lengths.
Receiving the data segment padding.
uint8_t status_class
Status class.
uint32_t itt
Initiator Task Tag.
int status
Session status.
union iscsi_segment_lengths lengths
Segment lengths.
uint8_t other_d[16]
Fields specific to the PDU type.
uint8_t reserved_b[10]
Reserved.
uint32_t itt
Initiator Task Tag.
uint32_t ttt
Target Transfer Tag.
struct acpi_descriptor desc
ACPI descriptor.
union iscsi_bhs tx_bhs
Basic header segment for current TX PDU.
iSCSI basic header segment common request fields
uint32_t reserved_b
Reserved.
uint32_t itt
Initiator Task Tag.
uint32_t statsn
Status sequence number.
union scsi_cdb cdb
SCSI Command Descriptor Block (CDB)
Generalized socket address structure.
Receiving the additional header segment.
uint32_t offset
Buffer offset.
iSCSI basic header segment common fields
struct scsi_lun lun
SCSI LUN (for boot firmware table)
uint32_t itt
Initiator Task Tag.
union iscsi_segment_lengths lengths
Segment lengths.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
enum iscsi_rx_state rx_state
State of the RX engine.
uint32_t offset
Buffer offset.
uint32_t itt
Initiator Task Tag.
uint8_t version_max
Maximum supported version number.
const struct setting initiator_iqn_setting __setting(SETTING_SANBOOT_EXTRA, initiator-iqn)
iSCSI request to transfer basic header segment
char * target_address
Target address.
iSCSI login response basic header segment
struct chap_response chap
CHAP response (used for both initiator and target auth)
uint32_t expdatasn
Expected data sequence number.
struct scsi_lun lun
SCSI Logical Unit Number.
Sending the additional header segment.
uint8_t ahs_len
The AHS length (measured in dwords)
uint32_t statsn
Status sequence number.
struct iscsi_segment_lengths::@625 bytes
struct interface data
SCSI command interface.
uint32_t expstatsn
Expected status sequence number.
uint16_t isid_iana_qual
Initiator session ID (IANA format) qualifier.
uint32_t datasn
Data sequence number.
union iscsi_segment_lengths lengths
Segment lengths.
uint32_t len
Desired data transfer length.
unsigned char chap_challenge[17]
CHAP challenge (for target auth only)
size_t max_burst_len
Maximum burst length.
union iscsi_segment_lengths lengths
Segment lengths.
A SCSI Command Data Block.
union iscsi_segment_lengths lengths
Segment lengths.
uint32_t transfer_offset
Transfer offset.
A SCSI command information unit.
uint8_t reserved_b[16]
Reserved.
An ACPI descriptor (used to construct ACPI tables)
iSCSI data-out basic header segment
char * target_iqn
Target IQN.
uint32_t expstatsn
Expected status sequence number.
uint32_t transfer_len
Transfer length.
struct iscsi_nop_in nop_in
An iSCSI basic header segment.
uint32_t ahs_and_data_len
The data length (measured in bytes), in network byte order, with ahs_len as the first byte.
struct iscsi_bhs_login_response login_response
uint32_t cmdsn
Command sequence number.
uint8_t other_b[8]
Fields specific to the PDU type.
uint8_t version_max
Maximum supported version number.
uint32_t bidi_residual_count
Bidirectional read residual count.
uint32_t statsn
Status sequence number.
uint32_t cmdsn
Command sequence number.
uint32_t itt
Initiator Task Tag.
uint8_t reserved_a[3]
Reserved.
uint16_t reserved_a
Reserved.
uint32_t ttt
Target Transfer Tag.
uint32_t reserved_c
Reserved.
uint32_t residual_count
Residual count.
iSCSI SCSI response basic header segment
uint8_t other_a[2]
Fields specific to the PDU type.
union iscsi_bhs rx_bhs
Basic header segment for current RX PDU.
char * initiator_iqn
Initiator IQN.
Sending the data segment.
uint32_t expcmdsn
Expected command sequence number.
struct iscsi_bhs_scsi_response scsi_response
char * target_password
Target password (if any)
struct scsi_cmd * command
Current SCSI command, if any.
uint32_t isid_iana_en
Initiator session ID (IANA format) enterprise number and flags.
char * target_username
Target username (if any)
Sending the basic header segment.
Receiving the basic header segment.
uint32_t ttt
Target Transfer Tag.
uint32_t statsn
Status sequence number.
uint16_t isid_iana_qual
Initiator session ID (IANA format) qualifier.
struct iscsi_bhs_data_in data_in
uint32_t itt
Initiator Task Tag.
uint32_t maxcmdsn
Maximum command sequence number.
uint32_t exp_len
Expected data transfer length.
struct scsi_lun lun
Logical Unit Number.
uint32_t reserved_d
Reserved.
enum iscsi_tx_state tx_state
State of the TX engine.
union iscsi_segment_lengths lengths
Segment lengths.
uint8_t other_a[2]
Fields specific to the PDU type.
uint32_t cmdsn
Command sequence number.