예제 #1
0
static u32 tcm_loop_get_pr_transport_id(
    struct se_portal_group *se_tpg,
    struct se_node_acl *se_nacl,
    struct t10_pr_registration *pr_reg,
    int *format_code,
    unsigned char *buf)
{
    struct tcm_loop_tpg *tl_tpg =
        (struct tcm_loop_tpg *)se_tpg->se_tpg_fabric_ptr;
    struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;

    switch (tl_hba->tl_proto_id) {
    case SCSI_PROTOCOL_SAS:
        return sas_get_pr_transport_id(se_tpg, se_nacl, pr_reg,
                                       format_code, buf);
    case SCSI_PROTOCOL_FCP:
        return fc_get_pr_transport_id(se_tpg, se_nacl, pr_reg,
                                      format_code, buf);
    case SCSI_PROTOCOL_ISCSI:
        return iscsi_get_pr_transport_id(se_tpg, se_nacl, pr_reg,
                                         format_code, buf);
    default:
        pr_err("Unknown tl_proto_id: 0x%02x, using"
               " SAS emulation\n", tl_hba->tl_proto_id);
        break;
    }

    return sas_get_pr_transport_id(se_tpg, se_nacl, pr_reg,
                                   format_code, buf);
}
예제 #2
0
int target_get_pr_transport_id(struct se_node_acl *nacl,
		struct t10_pr_registration *pr_reg, int *format_code,
		unsigned char *buf)
{
	switch (nacl->se_tpg->proto_id) {
	case SCSI_PROTOCOL_SAS:
		return sas_get_pr_transport_id(nacl, format_code, buf);
	case SCSI_PROTOCOL_SBP:
		return sbp_get_pr_transport_id(nacl, format_code, buf);
	case SCSI_PROTOCOL_SRP:
		return srp_get_pr_transport_id(nacl, format_code, buf);
	case SCSI_PROTOCOL_FCP:
		return fc_get_pr_transport_id(nacl, format_code, buf);
	case SCSI_PROTOCOL_ISCSI:
		return iscsi_get_pr_transport_id(nacl, pr_reg, format_code,
				buf);
	default:
		pr_err("Unknown proto_id: 0x%02x\n", nacl->se_tpg->proto_id);
		return -EINVAL;
	}
}