Lines Matching +full:0 +full:xe4
38 int off = 0; in target_xcopy_gen_naa_ieee()
40 buf[off++] = (0x6 << 4); in target_xcopy_gen_naa_ieee()
41 buf[off++] = 0x01; in target_xcopy_gen_naa_ieee()
42 buf[off++] = 0x40; in target_xcopy_gen_naa_ieee()
43 buf[off] = (0x5 << 4); in target_xcopy_gen_naa_ieee()
46 return 0; in target_xcopy_gen_naa_ieee()
62 return 0; in target_xcopy_locate_se_dev_e4_iter()
64 memset(&tmp_dev_wwn[0], 0, XCOPY_NAA_IEEE_REGEX_LEN); in target_xcopy_locate_se_dev_e4_iter()
65 target_xcopy_gen_naa_ieee(se_dev, &tmp_dev_wwn[0]); in target_xcopy_locate_se_dev_e4_iter()
67 rc = memcmp(&tmp_dev_wwn[0], info->dev_wwn, XCOPY_NAA_IEEE_REGEX_LEN); in target_xcopy_locate_se_dev_e4_iter()
68 if (rc != 0) in target_xcopy_locate_se_dev_e4_iter()
69 return 0; in target_xcopy_locate_se_dev_e4_iter()
72 pr_debug("XCOPY 0xe4: located se_dev: %p\n", se_dev); in target_xcopy_locate_se_dev_e4_iter()
75 if (rc != 0) { in target_xcopy_locate_se_dev_e4_iter()
92 memset(&info, 0, sizeof(info)); in target_xcopy_locate_se_dev_e4()
98 return 0; in target_xcopy_locate_se_dev_e4()
100 pr_debug_ratelimited("Unable to locate 0xe4 descriptor for EXTENDED_COPY\n"); in target_xcopy_locate_se_dev_e4()
115 pr_debug("XCOPY 0xe4: RELATIVE INITIATOR PORT IDENTIFIER: %hu\n", ript); in target_xcopy_parse_tiddesc_e4()
119 if ((desc[4] & 0x0f) != 0x1) { in target_xcopy_parse_tiddesc_e4()
120 pr_err("XCOPY 0xe4: code set of non binary type not supported\n"); in target_xcopy_parse_tiddesc_e4()
123 if ((desc[5] & 0x30) != 0x00) { in target_xcopy_parse_tiddesc_e4()
124 pr_err("XCOPY 0xe4: association other than LUN not supported\n"); in target_xcopy_parse_tiddesc_e4()
127 if ((desc[5] & 0x0f) != 0x3) { in target_xcopy_parse_tiddesc_e4()
128 pr_err("XCOPY 0xe4: designator type unsupported: 0x%02x\n", in target_xcopy_parse_tiddesc_e4()
129 (desc[5] & 0x0f)); in target_xcopy_parse_tiddesc_e4()
138 pr_err("XCOPY 0xe4: invalid desig_len: %d\n", (int)desig_len); in target_xcopy_parse_tiddesc_e4()
141 pr_debug("XCOPY 0xe4: desig_len: %d\n", (int)desig_len); in target_xcopy_parse_tiddesc_e4()
145 if ((desc[8] & 0xf0) != 0x60) { in target_xcopy_parse_tiddesc_e4()
146 pr_err("XCOPY 0xe4: Unsupported DESIGNATOR TYPE: 0x%02x\n", in target_xcopy_parse_tiddesc_e4()
147 (desc[8] & 0xf0)); in target_xcopy_parse_tiddesc_e4()
152 pr_debug("XCOPY 0xe4: ignoring CSCD entry %d - neither src nor " in target_xcopy_parse_tiddesc_e4()
154 return 0; in target_xcopy_parse_tiddesc_e4()
158 memcpy(&xop->src_tid_wwn[0], &desc[8], XCOPY_NAA_IEEE_REGEX_LEN); in target_xcopy_parse_tiddesc_e4()
162 if (!memcmp(&xop->local_dev_wwn[0], &xop->src_tid_wwn[0], in target_xcopy_parse_tiddesc_e4()
166 pr_debug("XCOPY 0xe4: Set xop->src_dev %p from source" in target_xcopy_parse_tiddesc_e4()
172 memcpy(&xop->dst_tid_wwn[0], &desc[8], XCOPY_NAA_IEEE_REGEX_LEN); in target_xcopy_parse_tiddesc_e4()
179 if (!memcmp(&xop->local_dev_wwn[0], &xop->dst_tid_wwn[0], in target_xcopy_parse_tiddesc_e4()
183 pr_debug("XCOPY 0xe4: Set xop->dst_dev: %p from destination" in target_xcopy_parse_tiddesc_e4()
188 return 0; in target_xcopy_parse_tiddesc_e4()
198 unsigned short cscd_index = 0; in target_xcopy_parse_target_descriptors()
199 unsigned short start = 0; in target_xcopy_parse_target_descriptors()
203 if (offset != 0) { in target_xcopy_parse_target_descriptors()
220 memset(&xop->local_dev_wwn[0], 0, XCOPY_NAA_IEEE_REGEX_LEN); in target_xcopy_parse_target_descriptors()
221 target_xcopy_gen_naa_ieee(local_dev, &xop->local_dev_wwn[0]); in target_xcopy_parse_target_descriptors()
225 * Check target descriptor identification with 0xE4 type, and in target_xcopy_parse_target_descriptors()
227 * the segment descriptor. Use VPD 0x83 WWPN matching .. in target_xcopy_parse_target_descriptors()
229 switch (desc[0]) { in target_xcopy_parse_target_descriptors()
230 case 0xe4: in target_xcopy_parse_target_descriptors()
232 &desc[0], cscd_index); in target_xcopy_parse_target_descriptors()
233 if (rc != 0) in target_xcopy_parse_target_descriptors()
241 " 0x%02x\n", desc[0]); in target_xcopy_parse_target_descriptors()
263 * If a matching IEEE NAA 0x83 descriptor for the requested device in target_xcopy_parse_target_descriptors()
265 * 0x0d/0x02 - COPY_TARGET_DEVICE_NOT_REACHABLE to request the in target_xcopy_parse_target_descriptors()
268 if (rc < 0) { in target_xcopy_parse_target_descriptors()
273 pr_debug("XCOPY TGT desc: Source dev: %p NAA IEEE WWN: 0x%16phN\n", in target_xcopy_parse_target_descriptors()
274 xop->src_dev, &xop->src_tid_wwn[0]); in target_xcopy_parse_target_descriptors()
275 pr_debug("XCOPY TGT desc: Dest dev: %p NAA IEEE WWN: 0x%16phN\n", in target_xcopy_parse_target_descriptors()
276 xop->dst_dev, &xop->dst_tid_wwn[0]); in target_xcopy_parse_target_descriptors()
288 int dc = (desc[1] & 0x02); in target_xcopy_parse_segdesc_02()
292 if (desc_len != 0x18) { in target_xcopy_parse_segdesc_02()
293 pr_err("XCOPY segment desc 0x02: Illegal desc_len:" in target_xcopy_parse_segdesc_02()
303 pr_err("XCOPY segment desc 0x02: unsupported CSCD ID > 0x%x; stdi: %hu dtdi: %hu\n", in target_xcopy_parse_segdesc_02()
308 pr_debug("XCOPY seg desc 0x02: desc_len: %hu stdi: %hu dtdi: %hu, DC: %d\n", in target_xcopy_parse_segdesc_02()
314 pr_debug("XCOPY seg desc 0x02: nolb: %hu src_lba: %llu dst_lba: %llu\n", in target_xcopy_parse_segdesc_02()
318 return 0; in target_xcopy_parse_segdesc_02()
326 unsigned int start = 0; in target_xcopy_parse_segment_descriptors()
327 int offset = sdll % XCOPY_SEGMENT_DESC_LEN, rc, ret = 0; in target_xcopy_parse_segment_descriptors()
331 if (offset != 0) { in target_xcopy_parse_segment_descriptors()
349 switch (desc[0]) { in target_xcopy_parse_segment_descriptors()
350 case 0x02: in target_xcopy_parse_segment_descriptors()
352 if (rc < 0) in target_xcopy_parse_segment_descriptors()
361 "type: 0x%02x\n", desc[0]); in target_xcopy_parse_segment_descriptors()
389 return 0; in xcopy_pt_get_cmd_state()
423 return 0; in xcopy_pt_check_stop_free()
428 return 0; in xcopy_pt_write_pending()
433 return 0; in xcopy_pt_queue_data_in()
438 return 0; in xcopy_pt_queue_status()
459 xcopy_wq = alloc_workqueue("xcopy_wq", WQ_MEM_RECLAIM, 0); in target_xcopy_setup_pt()
465 memset(&xcopy_pt_tpg, 0, sizeof(struct se_portal_group)); in target_xcopy_setup_pt()
471 memset(&xcopy_pt_nacl, 0, sizeof(struct se_node_acl)); in target_xcopy_setup_pt()
474 memset(&xcopy_pt_sess, 0, sizeof(struct se_session)); in target_xcopy_setup_pt()
476 if (ret < 0) in target_xcopy_setup_pt()
485 return 0; in target_xcopy_setup_pt()
539 cmd->tag = 0; in target_xcopy_setup_pt_cmd()
544 xop->xop_data_nents, NULL, 0)) in target_xcopy_setup_pt_cmd()
550 return 0; in target_xcopy_setup_pt_cmd()
567 pr_debug("target_xcopy_issue_pt_cmd(): SCSI status: 0x%02x\n", in target_xcopy_issue_pt_cmd()
570 return (se_cmd->scsi_status) ? -EINVAL : 0; in target_xcopy_issue_pt_cmd()
587 memset(&xpt_cmd, 0, sizeof(xpt_cmd)); in target_xcopy_read_source()
590 memset(&cdb[0], 0, 16); in target_xcopy_read_source()
591 cdb[0] = READ_16; in target_xcopy_read_source()
598 DMA_FROM_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0); in target_xcopy_read_source()
600 rc = target_xcopy_setup_pt_cmd(&xpt_cmd, xop, src_dev, &cdb[0], in target_xcopy_read_source()
602 if (rc < 0) { in target_xcopy_read_source()
611 if (rc < 0) in target_xcopy_read_source()
614 transport_generic_free_cmd(se_cmd, 0); in target_xcopy_read_source()
632 memset(&xpt_cmd, 0, sizeof(xpt_cmd)); in target_xcopy_write_destination()
635 memset(&cdb[0], 0, 16); in target_xcopy_write_destination()
636 cdb[0] = WRITE_16; in target_xcopy_write_destination()
643 DMA_TO_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0); in target_xcopy_write_destination()
645 rc = target_xcopy_setup_pt_cmd(&xpt_cmd, xop, dst_dev, &cdb[0], in target_xcopy_write_destination()
647 if (rc < 0) { in target_xcopy_write_destination()
653 if (rc < 0) in target_xcopy_write_destination()
656 transport_generic_free_cmd(se_cmd, 0); in target_xcopy_write_destination()
667 int rc = 0; in target_xcopy_do_work()
668 unsigned short nolb, max_nolb, copied_nolb = 0; in target_xcopy_do_work()
690 max_nolb = min_t(u16, max_sectors, ((u16)(~0U))); in target_xcopy_do_work()
711 if (rc < 0) in target_xcopy_do_work()
720 if (rc < 0) in target_xcopy_do_work()
732 if (rc < 0) in target_xcopy_do_work()
792 list_id = p[0]; in target_parse_xcopy_cmd()
793 list_id_usage = (p[1] & 0x18) >> 3; in target_parse_xcopy_cmd()
808 if (inline_dl != 0) { in target_parse_xcopy_cmd()
821 pr_debug("Processing XCOPY with list_id: 0x%02x list_id_usage: 0x%02x" in target_parse_xcopy_cmd()
833 if (rc <= 0) in target_parse_xcopy_cmd()
840 if (rc <= 0) in target_parse_xcopy_cmd()
876 sa = se_cmd->t_task_cdb[1] & 0x1f; in target_do_xcopy()
877 if (sa != 0x00) { in target_do_xcopy()
882 if (se_cmd->data_length == 0) { in target_do_xcopy()
928 p[4] = 0x1; in target_rcr_operating_parameters()
946 * MAXIMUM INLINE DATA LENGTH for SA 0x04 (NOT SUPPORTED) in target_rcr_operating_parameters()
948 put_unaligned_be32(0x0, &p[20]); in target_rcr_operating_parameters()
952 put_unaligned_be32(0x0, &p[24]); in target_rcr_operating_parameters()
956 put_unaligned_be32(0x0, &p[28]); in target_rcr_operating_parameters()
980 p[43] = 0x2; in target_rcr_operating_parameters()
984 p[44] = 0x02; /* Copy Block to Block device */ in target_rcr_operating_parameters()
985 p[45] = 0xe4; /* Identification descriptor target descriptor */ in target_rcr_operating_parameters()
990 put_unaligned_be32(42, &p[0]); in target_rcr_operating_parameters()
1000 unsigned char *cdb = &se_cmd->t_task_cdb[0]; in target_do_receive_copy_results()
1001 int sa = (cdb[1] & 0x1f), list_id = cdb[2]; in target_do_receive_copy_results()
1004 pr_debug("Entering target_do_receive_copy_results: SA: 0x%02x, List ID:" in target_do_receive_copy_results()
1005 " 0x%02x, AL: %u\n", sa, list_id, se_cmd->data_length); in target_do_receive_copy_results()
1007 if (list_id != 0) { in target_do_receive_copy_results()
1021 pr_err("Unsupported SA for receive copy results: 0x%02x\n", sa); in target_do_receive_copy_results()