33 #define SRP_TAG_MAGIC 0x69505845 95 #define SRP_LOGIN_REQ 0x00 98 #define SRP_LOGIN_REQ_FMT_IDBD 0x04 101 #define SRP_LOGIN_REQ_FMT_DDBD 0x02 104 #define SRP_LOGIN_REQ_FLAG_AESOLNT 0x40 107 #define SRP_LOGIN_REQ_FLAG_CRSOLNT 0x20 110 #define SRP_LOGIN_REQ_FLAG_LOSOLNT 0x10 113 #define SRP_LOGIN_REQ_MCA_MASK 0x03 116 #define SRP_LOGIN_REQ_MCA_SINGLE_CHANNEL 0x00 119 #define SRP_LOGIN_REQ_MCA_MULTIPLE_CHANNELS 0x01 163 #define SRP_LOGIN_RSP 0xc0 166 #define SRP_LOGIN_RSP_FMT_IDBD 0x04 169 #define SRP_LOGIN_RSP_FMT_DDBD 0x02 172 #define SRP_LOGIN_RSP_FLAG_SOLNTSUP 0x10 175 #define SRP_LOGIN_RSP_MCR_MASK 0x03 178 #define SRP_LOGIN_RSP_MCR_NO_EXISTING_CHANNELS 0x00 181 #define SRP_LOGIN_RSP_MCR_EXISTING_CHANNELS_TERMINATED 0x01 184 #define SRP_LOGIN_RSP_MCR_EXISTING_CHANNELS_CONTINUE 0x02 222 #define SRP_LOGIN_REJ 0xc2 225 #define SRP_LOGIN_REJ_REASON_UNKNOWN 0x00010000UL 228 #define SRP_LOGIN_REJ_REASON_INSUFFICIENT_RESOURCES 0x00010001UL 231 #define SRP_LOGIN_REJ_REASON_BAD_MAX_I_T_IU_LEN 0x00010002UL 234 #define SRP_LOGIN_REJ_REASON_CANNOT_ASSOCIATE 0x00010003UL 237 #define SRP_LOGIN_REJ_REASON_UNSUPPORTED_BUFFER_FORMAT 0x00010004UL 240 #define SRP_LOGIN_REJ_REASON_NO_MULTIPLE_CHANNELS 0x00010005UL 243 #define SRP_LOGIN_REJ_REASON_NO_MORE_CHANNELS 0x00010006UL 246 #define SRP_LOGIN_REJ_REASON_DEFINED( reason ) \ 247 ( ( (reason) & 0xfffffff0UL ) == 0x00010000UL ) 250 #define SRP_LOGIN_REJ_FMT_IDBD 0x04 253 #define SRP_LOGIN_REJ_FMT_DDBD 0x02 276 #define SRP_I_LOGOUT 0x03 310 #define SRP_T_LOGOUT 0x80 313 #define SRP_T_LOGOUT_FLAG_SOLNT 0x01 316 #define SRP_T_LOGOUT_REASON_UNKNOWN 0x00000000UL 319 #define SRP_T_LOGOUT_REASON_INACTIVE 0x00000001UL 322 #define SRP_T_LOGOUT_REASON_INVALID_TYPE 0x00000002UL 325 #define SRP_T_LOGOUT_REASON_SPURIOUS_RESPONSE 0x00000003UL 328 #define SRP_T_LOGOUT_REASON_MCA 0x00000004UL 331 #define SRP_T_LOGOUT_UNSUPPORTED_DATA_OUT_FORMAT 0x00000005UL 334 #define SRP_T_LOGOUT_UNSUPPORTED_DATA_IN_FORMAT 0x00000006UL 337 #define SRP_T_LOGOUT_INVALID_IU_LEN 0x00000008UL 383 #define SRP_TSK_MGMT 0x01 386 #define SRP_TSK_MGMT_FLAG_UCSOLNT 0x04 389 #define SRP_TSK_MGMT_FLAG_SCSOLNT 0x02 392 #define SRP_TSK_MGMT_FUNC_ABORT_TASK 0x01 395 #define SRP_TSK_MGMT_FUNC_ABORT_TASK_SET 0x02 398 #define SRP_TSK_MGMT_FUNC_CLEAR_TASK_SET 0x04 401 #define SRP_TSK_MGMT_FUNC_LOGICAL_UNIT_RESET 0x08 404 #define SRP_TSK_MGMT_FUNC_CLEAR_ACA 0x40 463 #define SRP_CMD_FLAG_UCSOLNT 0x04 466 #define SRP_CMD_FLAG_SCSOLNT 0x02 469 #define SRP_CMD_DO_FMT_MASK 0xf0 472 #define SRP_CMD_DO_FMT_DIRECT 0x10 475 #define SRP_CMD_DO_FMT_INDIRECT 0x20 478 #define SRP_CMD_DI_FMT_MASK 0x0f 481 #define SRP_CMD_DI_FMT_DIRECT 0x01 484 #define SRP_CMD_DI_FMT_INDIRECT 0x02 487 #define SRP_CMD_TASK_ATTR_SIMPLE 0x00 490 #define SRP_CMD_TASK_ATTR_QUEUE_HEAD 0x01 493 #define SRP_CMD_TASK_ATTR_ORDERED 0x02 496 #define SRP_CMD_TASK_ATTR_AUTOMATIC_CONTINGENT_ALLEGIANCE 0x08 561 #define SRP_RSP_FLAG_SOLNT 0x01 564 #define SRP_RSP_VALID_DIUNDER 0x20 567 #define SRP_RSP_VALID_DIOVER 0x10 570 #define SRP_RSP_VALID_DOUNDER 0x08 573 #define SRP_RSP_VALID_DOOVER 0x04 576 #define SRP_RSP_VALID_SNSVALID 0x02 579 #define SRP_RSP_VALID_RSPVALID 0x01 589 ( ( (
const void * )
rsp ) + sizeof ( *
rsp ) ) :
NULL );
600 ntohl (
rsp->response_data_len ) : 0 );
611 ( ( (
const void * )
rsp ) + sizeof ( *
rsp ) +
623 ntohl (
rsp->sense_data_len ) : 0 );
655 #define SRP_CRED_REQ 0x81 658 #define SRP_CRED_REQ_FLAG_SOLNT 0x01 681 #define SRP_CRED_RSP 0x41 720 #define SRP_AER_REQ 0x82 723 #define SRP_AER_REQ_FLAG_SOLNT 0x01 733 return ( ( (
void * ) aer_req ) +
sizeof ( *aer_req ) );
768 #define SRP_AER_RSP 0x42 783 #define SBFT_SIG ACPI_SIGNATURE ( 's', 'B', 'F', 'T' )
An SRP asynchronous event response.
union srp_port_id initiator
Initiator port identifier.
static __always_inline size_t srp_aer_req_sense_data_len(struct srp_aer_req *aer_req)
Get length of sense data portion of asynchronous event request.
uint8_t type
Information unit type.
uint8_t reserved0[6]
Reserved.
uint16_t supported_buffer_formats
Supported buffer formats.
SRP information unit common fields.
An SRP login request information unit.
An SRP asynchronous event request.
uint8_t reserved1[4]
Reserved.
union srp_port_id initiator
Initiator port identifier.
uint32_t max_t_i_iu_len
Maximum target to initiator IU length.
union srp_tag managed_tag
Tag of task to be managed.
uint64_t address
Virtual address.
uint32_t data_in_residual_count
Data-in residual count.
uint32_t request_limit_delta
Request limit delta.
uint8_t reserved0[7]
Reserved.
uint8_t valid
Valid fields.
uint8_t reserved0[3]
Reserved.
uint8_t reserved0[7]
Reserved.
uint8_t type
Information unit type.
uint8_t type
Information unit type.
#define SRP_RSP_VALID_SNSVALID
Sense data list length field is valid.
static const void * srp_rsp_response_data(const struct srp_rsp *rsp)
Get response data portion of SCSI response.
union srp_port_id target
Target port identifier.
uint32_t request_limit_delta
Request limit delta.
uint8_t task_attr
Task attribute.
unsigned long long uint64_t
uint32_t sense_data_len
Sense data list length.
uint8_t reserved2[4]
Reserved.
uint8_t type
Information unit type.
An SRP target logout request.
uint8_t type
Information unit type.
An SRP initiator logout request.
uint8_t type
Information unit type.
uint8_t reserved0[7]
Reserved.
Data transfer interfaces.
uint8_t reserved3[1]
Reserved.
struct acpi_header acpi
ACPI header.
uint8_t reserved2[1]
Reserved.
uint8_t reserved[6]
Reserved.
static size_t srp_rsp_sense_data_len(const struct srp_rsp *rsp)
Get length of sense data portion of SCSI response.
struct scsi_lun lun
Logical unit number.
uint8_t reserved1[2]
Reserved.
uint8_t reserved2[6]
Reserved.
uint32_t max_i_t_iu_len
Maximum initiator to target IU length.
uint8_t reserved0[2]
Reserved.
uint8_t data_out_buffer_count
Data-out buffer descriptor count.
uint8_t lun
Logical Unit Number.
uint8_t reserved0[2]
Reserved.
uint32_t handle
Memory handle.
static size_t srp_rsp_response_data_len(const struct srp_rsp *rsp)
Get length of response data portion of SCSI response.
uint8_t reserved3[1]
Reserved.
#define __always_inline
Declare a function to be always inline.
union scsi_cdb cdb
Command data block.
static __always_inline void * srp_aer_req_sense_data(struct srp_aer_req *aer_req)
Get sense data portion of asynchronous event request.
union srp_port_id target
Target port identifier.
uint16_t required_buffer_formats
Required buffer formats.
uint8_t type
Information unit type.
sbft_off_t ib_offset
Offset to IB subtable, if present.
A SCSI Command Data Block.
int srp_open(struct interface *block, struct interface *socket, union srp_port_id *initiator, union srp_port_id *target, uint32_t memory_handle, struct scsi_lun *lun)
Open SRP device.
uint32_t response_data_len
Response data list length.
uint8_t reserved0[2]
Reserved.
uint8_t type
Information unit type.
uint8_t reserved4[8]
Reserved.
uint8_t type
Information unit type.
uint8_t type
Information unit type.
uint16_t supported_buffer_formats
Supported buffer formats.
uint8_t reserved2[2]
Reserved.
sbft_off_t scsi_offset
Offset to SCSI subtable.
uint8_t block[3][8]
DES-encrypted blocks.
uint8_t additional_cdb_len
Additional CDB length.
uint8_t reserved0[7]
Reserved.
uint8_t type
Information unit type.
uint8_t reserved1[25]
Reserved.
uint8_t reserved0[3]
Reserved.
An SRP memory descriptor.
uint32_t request_limit_delta
Request limit delta.
uint32_t data_out_residual_count
Data-out residual count.
An SRP task management request.
uint8_t reserved1[4]
Reserved.
uint32_t sense_data_len
Sense data list length.
uint8_t reserved2[5]
Reserved.
uint8_t type
Information unit type.
uint8_t reserved0[3]
Reserved.
struct scsi_lun lun
Logical unit number.
uint8_t data_buffer_formats
Data buffer descriptor formats.
uint8_t reserved1[4]
Reserved.
struct scsi_lun lun
Logical unit number.
uint8_t reserved1[8]
Reserved.
uint32_t request_limit_delta
Request limit delta.
An SRP information unit tag.
uint8_t data_in_buffer_count
Data-in buffer descriptor count.
uint32_t max_i_t_iu_len
Requested maximum initiator to target IU length.
#define NULL
NULL pointer (VOID *)
sbft_off_t srp_offset
Offset to SRP subtable.
uint8_t reserved1[4]
Reserved.
uint8_t reserved0[7]
Reserved.
#define SRP_RSP_VALID_RSPVALID
Response data list length field is valid.
uint8_t reserved0[2]
Reserved.
static const void * srp_rsp_sense_data(const struct srp_rsp *rsp)
Get sense data portion of SCSI response.
uint8_t type
Information unit type.
uint16_t sbft_off_t
An offset from the start of the sBFT.