|
iPXE
|
SCSI RDMA Protocol. More...
#include <stdint.h>#include <byteswap.h>#include <ipxe/iobuf.h>#include <ipxe/xfer.h>#include <ipxe/scsi.h>#include <ipxe/acpi.h>Go to the source code of this file.
Data Structures | |
| union | srp_tag |
| An SRP information unit tag. More... | |
| union | srp_port_id |
| An SRP port ID. More... | |
| struct | srp_common |
| SRP information unit common fields. More... | |
| struct | srp_login_req |
| An SRP login request information unit. More... | |
| struct | srp_login_rsp |
| An SRP login response. More... | |
| struct | srp_login_rej |
| An SRP login rejection. More... | |
| struct | srp_i_logout |
| An SRP initiator logout request. More... | |
| struct | srp_t_logout |
| An SRP target logout request. More... | |
| struct | srp_tsk_mgmt |
| An SRP task management request. More... | |
| struct | srp_cmd |
| An SRP SCSI command. More... | |
| struct | srp_memory_descriptor |
| An SRP memory descriptor. More... | |
| struct | srp_rsp |
| An SRP SCSI response. More... | |
| struct | srp_cred_req |
| An SRP credit request. More... | |
| struct | srp_cred_rsp |
| An SRP credit response. More... | |
| struct | srp_aer_req |
| An SRP asynchronous event request. More... | |
| struct | srp_aer_rsp |
| An SRP asynchronous event response. More... | |
| struct | sbft_table |
| SRP Boot Firmware Table. More... | |
| struct | sbft_scsi_subtable |
| sBFT SCSI subtable More... | |
| struct | sbft_srp_subtable |
| sBFT SRP subtable More... | |
Macros | |
| #define | SRP_TAG_MAGIC 0x69505845 |
| SRP tag magic marker. More... | |
| #define | SRP_LOGIN_REQ 0x00 |
| Type of an SRP login request. More... | |
| #define | SRP_LOGIN_REQ_FMT_IDBD 0x04 |
| Require indirect data buffer descriptor format. More... | |
| #define | SRP_LOGIN_REQ_FMT_DDBD 0x02 |
| Require direct data buffer descriptor format. More... | |
| #define | SRP_LOGIN_REQ_FLAG_AESOLNT 0x40 |
| Use solicited notification for asynchronous events. More... | |
| #define | SRP_LOGIN_REQ_FLAG_CRSOLNT 0x20 |
| Use solicited notification for credit request. More... | |
| #define | SRP_LOGIN_REQ_FLAG_LOSOLNT 0x10 |
| Use solicited notification for logouts. More... | |
| #define | SRP_LOGIN_REQ_MCA_MASK 0x03 |
| Multi-channel action mask. More... | |
| #define | SRP_LOGIN_REQ_MCA_SINGLE_CHANNEL 0x00 |
| Single RDMA channel operation. More... | |
| #define | SRP_LOGIN_REQ_MCA_MULTIPLE_CHANNELS 0x01 |
| Multiple independent RDMA channel operation. More... | |
| #define | SRP_LOGIN_RSP 0xc0 |
| Type of an SRP login response. More... | |
| #define | SRP_LOGIN_RSP_FMT_IDBD 0x04 |
| Indirect data buffer descriptor format supported. More... | |
| #define | SRP_LOGIN_RSP_FMT_DDBD 0x02 |
| Direct data buffer descriptor format supported. More... | |
| #define | SRP_LOGIN_RSP_FLAG_SOLNTSUP 0x10 |
| Solicited notification is supported. More... | |
| #define | SRP_LOGIN_RSP_MCR_MASK 0x03 |
| Multi-channel result mask. More... | |
| #define | SRP_LOGIN_RSP_MCR_NO_EXISTING_CHANNELS 0x00 |
| No existing RDMA channels were associated with the same I_T nexus. More... | |
| #define | SRP_LOGIN_RSP_MCR_EXISTING_CHANNELS_TERMINATED 0x01 |
| One or more existing RDMA channels were terminated. More... | |
| #define | SRP_LOGIN_RSP_MCR_EXISTING_CHANNELS_CONTINUE 0x02 |
| One or more existing RDMA channels continue to operate independently. More... | |
| #define | SRP_LOGIN_REJ 0xc2 |
| Type of an SRP login rejection. More... | |
| #define | SRP_LOGIN_REJ_REASON_UNKNOWN 0x00010000UL |
| Unable to establish RDMA channel, no reason specified. More... | |
| #define | SRP_LOGIN_REJ_REASON_INSUFFICIENT_RESOURCES 0x00010001UL |
| Insufficient RDMA channel resources. More... | |
| #define | SRP_LOGIN_REJ_REASON_BAD_MAX_I_T_IU_LEN 0x00010002UL |
| Requested maximum initiator to target IU length value too large. More... | |
| #define | SRP_LOGIN_REJ_REASON_CANNOT_ASSOCIATE 0x00010003UL |
| Unable to associate RDMA channel with specified I_T nexus. More... | |
| #define | SRP_LOGIN_REJ_REASON_UNSUPPORTED_BUFFER_FORMAT 0x00010004UL |
| One or more requested data buffer descriptor formats are not supported. More... | |
| #define | SRP_LOGIN_REJ_REASON_NO_MULTIPLE_CHANNELS 0x00010005UL |
| SRP target port does not support multiple RDMA channels per I_T nexus. More... | |
| #define | SRP_LOGIN_REJ_REASON_NO_MORE_CHANNELS 0x00010006UL |
| RDMA channel limit reached for this initiator. More... | |
| #define | SRP_LOGIN_REJ_REASON_DEFINED(reason) ( ( (reason) & 0xfffffff0UL ) == 0x00010000UL ) |
| SRP login rejection reason is defined. More... | |
| #define | SRP_LOGIN_REJ_FMT_IDBD 0x04 |
| Indirect data buffer descriptor format supported. More... | |
| #define | SRP_LOGIN_REJ_FMT_DDBD 0x02 |
| Direct data buffer descriptor format supported. More... | |
| #define | SRP_I_LOGOUT 0x03 |
| Type of an SRP initiator logout request. More... | |
| #define | SRP_T_LOGOUT 0x80 |
| Type of an SRP target logout request. More... | |
| #define | SRP_T_LOGOUT_FLAG_SOLNT 0x01 |
| The initiator specified solicited notification of logouts. More... | |
| #define | SRP_T_LOGOUT_REASON_UNKNOWN 0x00000000UL |
| No reason specified. More... | |
| #define | SRP_T_LOGOUT_REASON_INACTIVE 0x00000001UL |
| Inactive RDMA channel (reclaiming resources) More... | |
| #define | SRP_T_LOGOUT_REASON_INVALID_TYPE 0x00000002UL |
| Invalid information unit type code received by SRP target port. More... | |
| #define | SRP_T_LOGOUT_REASON_SPURIOUS_RESPONSE 0x00000003UL |
| SRP initiator port sent response with no corresponding request. More... | |
| #define | SRP_T_LOGOUT_REASON_MCA 0x00000004UL |
| RDMA channel disconnected due to multi-channel action code in new login. More... | |
| #define | SRP_T_LOGOUT_UNSUPPORTED_DATA_OUT_FORMAT 0x00000005UL |
| Unsuppported format code value specified in data-out buffer descriptor. More... | |
| #define | SRP_T_LOGOUT_UNSUPPORTED_DATA_IN_FORMAT 0x00000006UL |
| Unsuppported format code value specified in data-in buffer descriptor. More... | |
| #define | SRP_T_LOGOUT_INVALID_IU_LEN 0x00000008UL |
| Invalid length for IU type. More... | |
| #define | SRP_TSK_MGMT 0x01 |
| Type of an SRP task management request. More... | |
| #define | SRP_TSK_MGMT_FLAG_UCSOLNT 0x04 |
| Use solicited notification for unsuccessful completions. More... | |
| #define | SRP_TSK_MGMT_FLAG_SCSOLNT 0x02 |
| Use solicited notification for successful completions. More... | |
| #define | SRP_TSK_MGMT_FUNC_ABORT_TASK 0x01 |
| The task manager shall perform an ABORT TASK function. More... | |
| #define | SRP_TSK_MGMT_FUNC_ABORT_TASK_SET 0x02 |
| The task manager shall perform an ABORT TASK SET function. More... | |
| #define | SRP_TSK_MGMT_FUNC_CLEAR_TASK_SET 0x04 |
| The task manager shall perform a CLEAR TASK SET function. More... | |
| #define | SRP_TSK_MGMT_FUNC_LOGICAL_UNIT_RESET 0x08 |
| The task manager shall perform a LOGICAL UNIT RESET function. More... | |
| #define | SRP_TSK_MGMT_FUNC_CLEAR_ACA 0x40 |
| The task manager shall perform a CLEAR ACA function. More... | |
| #define | SRP_CMD 0x02 |
| Type of an SRP SCSI command. More... | |
| #define | SRP_CMD_FLAG_UCSOLNT 0x04 |
| Use solicited notification for unsuccessful completions. More... | |
| #define | SRP_CMD_FLAG_SCSOLNT 0x02 |
| Use solicited notification for successful completions. More... | |
| #define | SRP_CMD_DO_FMT_MASK 0xf0 |
| Data-out buffer format mask. More... | |
| #define | SRP_CMD_DO_FMT_DIRECT 0x10 |
| Direct data-out buffer format. More... | |
| #define | SRP_CMD_DO_FMT_INDIRECT 0x20 |
| Indirect data-out buffer format. More... | |
| #define | SRP_CMD_DI_FMT_MASK 0x0f |
| Data-in buffer format mask. More... | |
| #define | SRP_CMD_DI_FMT_DIRECT 0x01 |
| Direct data-in buffer format. More... | |
| #define | SRP_CMD_DI_FMT_INDIRECT 0x02 |
| Indirect data-in buffer format. More... | |
| #define | SRP_CMD_TASK_ATTR_SIMPLE 0x00 |
| Use the rules for a simple task attribute. More... | |
| #define | SRP_CMD_TASK_ATTR_QUEUE_HEAD 0x01 |
| Use the rules for a head of queue task attribute. More... | |
| #define | SRP_CMD_TASK_ATTR_ORDERED 0x02 |
| Use the rules for an ordered task attribute. More... | |
| #define | SRP_CMD_TASK_ATTR_AUTOMATIC_CONTINGENT_ALLEGIANCE 0x08 |
| Use the rules for an automatic contingent allegiance task attribute. More... | |
| #define | SRP_RSP 0xc1 |
| Type of an SRP SCSI response. More... | |
| #define | SRP_RSP_FLAG_SOLNT 0x01 |
| The initiator specified solicited notification of this response. More... | |
| #define | SRP_RSP_VALID_DIUNDER 0x20 |
| Data-in residual count field is valid and represents an underflow. More... | |
| #define | SRP_RSP_VALID_DIOVER 0x10 |
| Data-in residual count field is valid and represents an overflow. More... | |
| #define | SRP_RSP_VALID_DOUNDER 0x08 |
| Data-out residual count field is valid and represents an underflow. More... | |
| #define | SRP_RSP_VALID_DOOVER 0x04 |
| Data-out residual count field is valid and represents an overflow. More... | |
| #define | SRP_RSP_VALID_SNSVALID 0x02 |
| Sense data list length field is valid. More... | |
| #define | SRP_RSP_VALID_RSPVALID 0x01 |
| Response data list length field is valid. More... | |
| #define | SRP_CRED_REQ 0x81 |
| Type of an SRP credit request. More... | |
| #define | SRP_CRED_REQ_FLAG_SOLNT 0x01 |
| The initiator specified solicited notification of credit requests. More... | |
| #define | SRP_CRED_RSP 0x41 |
| Type of an SRP credit response. More... | |
| #define | SRP_AER_REQ 0x82 |
| Type of an SRP asynchronous event request. More... | |
| #define | SRP_AER_REQ_FLAG_SOLNT 0x01 |
| The initiator specified solicited notification of asynchronous events. More... | |
| #define | SRP_AER_RSP 0x42 |
| Type of an SRP asynchronous event response. More... | |
| #define | SBFT_SIG ACPI_SIGNATURE ( 's', 'B', 'F', 'T' ) |
| SRP Boot Firmware Table signature. More... | |
Typedefs | |
| typedef uint16_t | sbft_off_t |
| An offset from the start of the sBFT. More... | |
Functions | |
| FILE_LICENCE (BSD2) | |
| static const void * | srp_rsp_response_data (const struct srp_rsp *rsp) |
| Get response data portion of SCSI response. More... | |
| static size_t | srp_rsp_response_data_len (const struct srp_rsp *rsp) |
| Get length of response data portion of SCSI response. More... | |
| static const void * | srp_rsp_sense_data (const struct srp_rsp *rsp) |
| Get sense data portion of SCSI response. More... | |
| static size_t | srp_rsp_sense_data_len (const struct srp_rsp *rsp) |
| Get length of sense data portion of SCSI response. More... | |
| static __always_inline void * | srp_aer_req_sense_data (struct srp_aer_req *aer_req) |
| Get sense data portion of asynchronous event request. More... | |
| 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. More... | |
| 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. More... | |
SCSI RDMA Protocol.
Definition in file srp.h.
| #define SRP_LOGIN_REQ_FMT_IDBD 0x04 |
| #define SRP_LOGIN_REQ_FMT_DDBD 0x02 |
| #define SRP_LOGIN_REQ_FLAG_AESOLNT 0x40 |
| #define SRP_LOGIN_REQ_FLAG_CRSOLNT 0x20 |
| #define SRP_LOGIN_REQ_FLAG_LOSOLNT 0x10 |
| #define SRP_LOGIN_REQ_MCA_MASK 0x03 |
| #define SRP_LOGIN_REQ_MCA_SINGLE_CHANNEL 0x00 |
| #define SRP_LOGIN_REQ_MCA_MULTIPLE_CHANNELS 0x01 |
| #define SRP_LOGIN_RSP_FMT_IDBD 0x04 |
| #define SRP_LOGIN_RSP_FMT_DDBD 0x02 |
| #define SRP_LOGIN_RSP_FLAG_SOLNTSUP 0x10 |
| #define SRP_LOGIN_RSP_MCR_MASK 0x03 |
| #define SRP_LOGIN_RSP_MCR_NO_EXISTING_CHANNELS 0x00 |
| #define SRP_LOGIN_RSP_MCR_EXISTING_CHANNELS_TERMINATED 0x01 |
| #define SRP_LOGIN_RSP_MCR_EXISTING_CHANNELS_CONTINUE 0x02 |
| #define SRP_LOGIN_REJ_REASON_UNKNOWN 0x00010000UL |
| #define SRP_LOGIN_REJ_REASON_INSUFFICIENT_RESOURCES 0x00010001UL |
| #define SRP_LOGIN_REJ_REASON_BAD_MAX_I_T_IU_LEN 0x00010002UL |
| #define SRP_LOGIN_REJ_REASON_CANNOT_ASSOCIATE 0x00010003UL |
| #define SRP_LOGIN_REJ_REASON_UNSUPPORTED_BUFFER_FORMAT 0x00010004UL |
| #define SRP_LOGIN_REJ_REASON_NO_MULTIPLE_CHANNELS 0x00010005UL |
| #define SRP_LOGIN_REJ_REASON_NO_MORE_CHANNELS 0x00010006UL |
| #define SRP_LOGIN_REJ_FMT_IDBD 0x04 |
| #define SRP_LOGIN_REJ_FMT_DDBD 0x02 |
| #define SRP_I_LOGOUT 0x03 |
| #define SRP_T_LOGOUT 0x80 |
| #define SRP_T_LOGOUT_FLAG_SOLNT 0x01 |
| #define SRP_T_LOGOUT_REASON_UNKNOWN 0x00000000UL |
| #define SRP_T_LOGOUT_REASON_INACTIVE 0x00000001UL |
| #define SRP_T_LOGOUT_REASON_INVALID_TYPE 0x00000002UL |
| #define SRP_T_LOGOUT_REASON_SPURIOUS_RESPONSE 0x00000003UL |
| #define SRP_T_LOGOUT_REASON_MCA 0x00000004UL |
| #define SRP_T_LOGOUT_UNSUPPORTED_DATA_OUT_FORMAT 0x00000005UL |
| #define SRP_T_LOGOUT_UNSUPPORTED_DATA_IN_FORMAT 0x00000006UL |
| #define SRP_T_LOGOUT_INVALID_IU_LEN 0x00000008UL |
| #define SRP_TSK_MGMT 0x01 |
| #define SRP_TSK_MGMT_FLAG_UCSOLNT 0x04 |
| #define SRP_TSK_MGMT_FLAG_SCSOLNT 0x02 |
| #define SRP_TSK_MGMT_FUNC_ABORT_TASK 0x01 |
| #define SRP_TSK_MGMT_FUNC_ABORT_TASK_SET 0x02 |
| #define SRP_TSK_MGMT_FUNC_CLEAR_TASK_SET 0x04 |
| #define SRP_TSK_MGMT_FUNC_LOGICAL_UNIT_RESET 0x08 |
| #define SRP_TSK_MGMT_FUNC_CLEAR_ACA 0x40 |
| #define SRP_CMD_FLAG_UCSOLNT 0x04 |
| #define SRP_CMD_FLAG_SCSOLNT 0x02 |
| #define SRP_CMD_DO_FMT_DIRECT 0x10 |
| #define SRP_CMD_DO_FMT_INDIRECT 0x20 |
| #define SRP_CMD_DI_FMT_DIRECT 0x01 |
| #define SRP_CMD_DI_FMT_INDIRECT 0x02 |
| #define SRP_CMD_TASK_ATTR_SIMPLE 0x00 |
| #define SRP_CMD_TASK_ATTR_QUEUE_HEAD 0x01 |
| #define SRP_CMD_TASK_ATTR_ORDERED 0x02 |
| #define SRP_CMD_TASK_ATTR_AUTOMATIC_CONTINGENT_ALLEGIANCE 0x08 |
| #define SRP_RSP_FLAG_SOLNT 0x01 |
| #define SRP_RSP_VALID_DIUNDER 0x20 |
| #define SRP_RSP_VALID_DIOVER 0x10 |
| #define SRP_RSP_VALID_DOUNDER 0x08 |
| #define SRP_RSP_VALID_DOOVER 0x04 |
| #define SRP_RSP_VALID_SNSVALID 0x02 |
| #define SRP_RSP_VALID_RSPVALID 0x01 |
| #define SRP_CRED_REQ_FLAG_SOLNT 0x01 |
| #define SRP_AER_REQ 0x82 |
| #define SRP_AER_REQ_FLAG_SOLNT 0x01 |
| #define SRP_AER_RSP 0x42 |
| #define SBFT_SIG ACPI_SIGNATURE ( 's', 'B', 'F', 'T' ) |
| typedef uint16_t sbft_off_t |
| FILE_LICENCE | ( | BSD2 | ) |
|
inlinestatic |
Get response data portion of SCSI response.
| rsp | SCSI response |
| response_data | Response data, or NULL if not present |
Definition at line 587 of file srp.h.
References NULL, rsp, and SRP_RSP_VALID_RSPVALID.
Get length of response data portion of SCSI response.
| rsp | SCSI response |
| response_data_len | Response data length |
Definition at line 598 of file srp.h.
References ntohl, rsp, and SRP_RSP_VALID_RSPVALID.
Referenced by srp_rsp(), and srp_rsp_sense_data().
|
inlinestatic |
Get sense data portion of SCSI response.
| rsp | SCSI response |
| sense_data | Sense data, or NULL if not present |
Definition at line 609 of file srp.h.
References NULL, rsp, srp_rsp_response_data_len(), and SRP_RSP_VALID_SNSVALID.
Referenced by srp_rsp().
Get length of sense data portion of SCSI response.
| rsp | SCSI response |
| sense_data_len | Sense data length |
Definition at line 621 of file srp.h.
References ntohl, rsp, and SRP_RSP_VALID_SNSVALID.
Referenced by srp_rsp().
|
inlinestatic |
|
inlinestatic |
Get length of sense data portion of asynchronous event request.
| aer_req | SRP asynchronous event request |
| sense_data_len | Sense data length |
Definition at line 743 of file srp.h.
References ntohl, and srp_aer_req::sense_data_len.
| 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.
| block | Block control interface |
| socket | Socket interface |
| initiator | Initiator port ID |
| target | Target port ID |
| memory_handle | RDMA memory handle |
| lun | SCSI LUN |
| rc | Return status code |
Definition at line 713 of file srp.c.
References assert(), block, srp_device::commands, DBGC, srp_port_id::dwords, ENOMEM, INIT_LIST_HEAD, intf_init(), intf_plug_plug(), lun, srp_device::memory_handle, ntohl, NULL, rc, ref_init, ref_put, srp_device::refcnt, srp_device::scsi, scsi_open(), srp_device::socket, srp_login(), srp_new_tag(), srpdev_close(), srpdev_scsi_desc, srpdev_socket_desc, strerror(), tag, and zalloc().
Referenced by ib_srp_open().
1.8.15