req->tc = tgt_cmnd_create(conn->session->ts, req_hdr->cdb, req_hdr->lun, sizeof(req_hdr->lun));
req->tc = proto->create_cmnd(conn->session->ts, req_hdr->cdb, req_hdr->lun, sizeof(req_hdr->lun));
static void scsi_cmnd_start(struct iscsi_conn *conn, struct iscsi_cmnd *req){	struct iscsi_cmd *req_hdr = cmnd_hdr(req);	dprintk(D_GENERIC, "scsi command: %02x\n", req_hdr->cdb[0]);	eprintk("scsi command: %02x\n", req_hdr->cdb[0]);	req->tc = tgt_cmnd_create(conn->session->ts, req_hdr->cdb,				   req_hdr->lun,				   sizeof(req_hdr->lun));	assert(req->tc);	switch (req_hdr->cdb[0]) {	case SERVICE_ACTION_IN:		if ((req_hdr->cdb[1] & 0x1f) != 0x10)			goto error;	case INQUIRY:	case REPORT_LUNS:	case TEST_UNIT_READY:	case SYNCHRONIZE_CACHE:	case VERIFY:	case VERIFY_16:	case START_STOP:	case READ_CAPACITY:	case MODE_SENSE:	case REQUEST_SENSE:	case RESERVE:	case RELEASE:	case RESERVE_10:	case RELEASE_10:	{		if (!(req_hdr->flags & ISCSI_FLAG_CMD_FINAL) ||		      req->pdu.datasize) {			/* unexpected unsolicited data */			eprintk("%x %x\n", cmnd_itt(req), req_hdr->cdb[0]);			create_sense_rsp(req, ABORTED_COMMAND, 0xc, 0xc);			cmnd_skip_data(req);		}		break;	}	case READ_6:	case READ_10:	case READ_16:	{		if (!(req_hdr->flags & ISCSI_FLAG_CMD_FINAL) ||		      req->pdu.datasize) {			/* unexpected unsolicited data */			eprintk("%x %x\n", cmnd_itt(req), req_hdr->cdb[0]);			create_sense_rsp(req, ABORTED_COMMAND, 0xc, 0xc);			cmnd_skip_data(req);		}		tgt_cmnd_alloc_buffer(req->tc, NULL);		break;	}	case WRITE_6:	case WRITE_10:	case WRITE_16:	case WRITE_VERIFY:	{		struct iscsi_sess_param *param = &conn->session->param;		req->r2t_length = be32_to_cpu(req_hdr->data_length) - req->pdu.datasize;		req->is_unsolicited_data = !(req_hdr->flags &						ISCSI_FLAG_CMD_FINAL);		req->target_task_tag = get_next_ttt(conn->session);		if (!param->immediate_data && req->pdu.datasize)			eprintk("%x %x\n", cmnd_itt(req), req_hdr->cdb[0]);		if (param->initial_r2t &&		    !(req_hdr->flags & ISCSI_FLAG_CMD_FINAL))			eprintk("%x %x\n", cmnd_itt(req), req_hdr->cdb[0]);		if (req_hdr->cdb[0] == WRITE_VERIFY && req_hdr->cdb[1] & 0x02)			eprintk("Verification is ignored %x\n", cmnd_itt(req));		tgt_cmnd_alloc_buffer(req->tc, NULL);		if (req->pdu.datasize) {			if (cmnd_recv_pdu(conn, req->tc, 0, req->pdu.datasize) < 0)				assert(0);		}		break;	}	error:	default:		eprintk("Unsupported %x\n", req_hdr->cdb[0]);		create_sense_rsp(req, ILLEGAL_REQUEST, 0x20, 0x0);		cmnd_skip_data(req);		break;	}	return;}