Lines Matching refs:task
116 struct sas_task *task = isci_request_access_task(ireq); in sci_request_build_sgl() local
123 if (task->num_scatter > 0) { in sci_request_build_sgl()
124 sg = task->scatter; in sci_request_build_sgl()
154 task->scatter, in sci_request_build_sgl()
155 task->total_xfer_len, in sci_request_build_sgl()
156 task->data_dir); in sci_request_build_sgl()
160 scu_sg->A.length = task->total_xfer_len; in sci_request_build_sgl()
174 struct sas_task *task = isci_request_access_task(ireq); in sci_io_request_build_ssp_command_iu() local
178 memcpy(cmd_iu->LUN, task->ssp_task.LUN, 8); in sci_io_request_build_ssp_command_iu()
184 cmd_iu->task_attr = task->ssp_task.task_attr; in sci_io_request_build_ssp_command_iu()
187 sci_swab32_cpy(&cmd_iu->cdb, task->ssp_task.cmd->cmnd, in sci_io_request_build_ssp_command_iu()
188 (task->ssp_task.cmd->cmd_len+3) / sizeof(u32)); in sci_io_request_build_ssp_command_iu()
194 struct sas_task *task = isci_request_access_task(ireq); in sci_task_request_build_ssp_task_iu() local
201 memcpy(task_iu->LUN, task->ssp_task.LUN, 8); in sci_task_request_build_ssp_task_iu()
639 struct sas_task *task; in sci_atapi_construct() local
650 task = isci_request_access_task(ireq); in sci_atapi_construct()
651 if (task->data_dir == DMA_NONE) in sci_atapi_construct()
652 task->total_xfer_len = 0; in sci_atapi_construct()
667 struct sas_task *task = isci_request_access_task(ireq); in sci_io_request_construct_sata() local
682 if (!sas_protocol_ata(task->task_proto)) { in sci_io_request_construct_sata()
686 task->task_proto); in sci_io_request_construct_sata()
693 task->ata_task.fis.command == ATA_CMD_PACKET) { in sci_io_request_construct_sata()
699 if (task->data_dir == DMA_NONE) { in sci_io_request_construct_sata()
705 if (task->ata_task.use_ncq) { in sci_io_request_construct_sata()
713 if (task->ata_task.dma_xfer) { in sci_io_request_construct_sata()
726 struct sas_task *task = isci_request_access_task(ireq); in sci_io_request_construct_basic_ssp() local
731 task->data_dir, in sci_io_request_construct_basic_ssp()
732 task->total_xfer_len); in sci_io_request_construct_basic_ssp()
759 struct sas_task *task = isci_request_access_task(ireq); in sci_io_request_construct_basic_sata() local
763 copy = (task->data_dir == DMA_NONE) ? false : true; in sci_io_request_construct_basic_sata()
766 task->total_xfer_len, in sci_io_request_construct_basic_sata()
767 task->data_dir, in sci_io_request_construct_basic_sata()
1410 struct sas_task *task; in sci_stp_request_pio_data_in_copy_data_buffer() local
1416 task = isci_request_access_task(ireq); in sci_stp_request_pio_data_in_copy_data_buffer()
1419 if (task->num_scatter > 0) { in sci_stp_request_pio_data_in_copy_data_buffer()
1420 sg = task->scatter; in sci_stp_request_pio_data_in_copy_data_buffer()
1434 BUG_ON(task->total_xfer_len < total_len); in sci_stp_request_pio_data_in_copy_data_buffer()
1435 memcpy(task->scatter, src_addr, total_len); in sci_stp_request_pio_data_in_copy_data_buffer()
1616 struct sas_task *task = isci_request_access_task(ireq); in atapi_d2h_reg_frame_handler() local
1637 if (task->data_dir == DMA_NONE) in atapi_d2h_reg_frame_handler()
1663 struct sas_task *task = isci_request_access_task(ireq); in scu_atapi_construct_task_context() local
1670 if (task->data_dir == DMA_TO_DEVICE) { in scu_atapi_construct_task_context()
1683 memcpy(&ireq->stp.cmd.lbal, task->ata_task.atapi_packet, cdb_len); in scu_atapi_construct_task_context()
1693 task_context->transfer_length_bytes = task->total_xfer_len; in scu_atapi_construct_task_context()
1766 struct sas_task *task = isci_request_access_task(ireq); in sci_io_request_frame_handler() local
1767 struct scatterlist *sg = &task->smp_task.smp_resp; in sci_io_request_frame_handler()
1889 struct sas_task *task = isci_request_access_task(ireq); in sci_io_request_frame_handler() local
1933 if (task->data_dir == DMA_FROM_DEVICE) { in sci_io_request_frame_handler()
1935 } else if (task->data_dir == DMA_TO_DEVICE) { in sci_io_request_frame_handler()
2059 struct sas_task *task = isci_request_access_task(ireq); in sci_io_request_frame_handler() local
2063 if (task->data_dir == DMA_NONE) { in sci_io_request_frame_handler()
2458 struct sas_task *task, in isci_request_process_response_iu() argument
2474 task->task_status.stat = resp_iu->status; in isci_request_process_response_iu()
2477 sas_ssp_task_response(dev, task, resp_iu); in isci_request_process_response_iu()
2494 struct sas_task *task, in isci_request_set_open_reject_status() argument
2503 task->task_status.open_rej_reason = open_rej_reason; in isci_request_set_open_reject_status()
2520 struct sas_task *task, in isci_request_handle_controller_specific_errors() argument
2549 if (task->task_proto == SAS_PROTOCOL_SMP) { in isci_request_handle_controller_specific_errors()
2610 request, task, response_ptr, status_ptr, in isci_request_handle_controller_specific_errors()
2620 request, task, response_ptr, status_ptr, in isci_request_handle_controller_specific_errors()
2627 request, task, response_ptr, status_ptr, in isci_request_handle_controller_specific_errors()
2634 request, task, response_ptr, status_ptr, in isci_request_handle_controller_specific_errors()
2641 request, task, response_ptr, status_ptr, in isci_request_handle_controller_specific_errors()
2648 request, task, response_ptr, status_ptr, in isci_request_handle_controller_specific_errors()
2655 request, task, response_ptr, status_ptr, in isci_request_handle_controller_specific_errors()
2662 request, task, response_ptr, status_ptr, in isci_request_handle_controller_specific_errors()
2669 request, task, response_ptr, status_ptr, in isci_request_handle_controller_specific_errors()
2702 if (task->task_proto == SAS_PROTOCOL_SMP) in isci_request_handle_controller_specific_errors()
2710 static void isci_process_stp_response(struct sas_task *task, struct dev_to_host_fis *fis) in isci_process_stp_response() argument
2712 struct task_status_struct *ts = &task->task_status; in isci_process_stp_response()
2732 struct sas_task *task = isci_request_access_task(request); in isci_request_io_request_complete() local
2742 __func__, request, task, task->data_dir, completion_status); in isci_request_io_request_complete()
2752 __func__, request, task); in isci_request_io_request_complete()
2754 if (sas_protocol_ata(task->task_proto)) { in isci_request_io_request_complete()
2755 isci_process_stp_response(task, &request->stp.rsp); in isci_request_io_request_complete()
2756 } else if (SAS_PROTOCOL_SSP == task->task_proto) { in isci_request_io_request_complete()
2760 isci_request_process_response_iu(task, resp_iu, in isci_request_io_request_complete()
2763 } else if (SAS_PROTOCOL_SMP == task->task_proto) { in isci_request_io_request_complete()
2778 response = task->task_status.resp; in isci_request_io_request_complete()
2779 status = task->task_status.stat; in isci_request_io_request_complete()
2797 task->task_status.residual in isci_request_io_request_complete()
2798 = task->total_xfer_len - transferred_length; in isci_request_io_request_complete()
2803 if (task->task_status.residual != 0) in isci_request_io_request_complete()
2819 __func__, request, task); in isci_request_io_request_complete()
2838 task, &response, in isci_request_io_request_complete()
2850 spin_lock_irqsave(&task->task_state_lock, task_flags); in isci_request_io_request_complete()
2851 task->task_state_flags |= SAS_TASK_NEED_DEV_RESET; in isci_request_io_request_complete()
2852 spin_unlock_irqrestore(&task->task_state_lock, task_flags); in isci_request_io_request_complete()
2892 if (SAS_PROTOCOL_SMP == task->task_proto) in isci_request_io_request_complete()
2899 switch (task->task_proto) { in isci_request_io_request_complete()
2901 if (task->data_dir == DMA_NONE) in isci_request_io_request_complete()
2903 if (task->num_scatter == 0) in isci_request_io_request_complete()
2907 task->total_xfer_len, task->data_dir); in isci_request_io_request_complete()
2909 dma_unmap_sg(&ihost->pdev->dev, task->scatter, in isci_request_io_request_complete()
2910 request->num_sg_entries, task->data_dir); in isci_request_io_request_complete()
2913 struct scatterlist *sg = &task->smp_task.smp_req; in isci_request_io_request_complete()
2930 spin_lock_irqsave(&task->task_state_lock, task_flags); in isci_request_io_request_complete()
2932 task->task_status.resp = response; in isci_request_io_request_complete()
2933 task->task_status.stat = status; in isci_request_io_request_complete()
2937 task->task_state_flags |= SAS_TASK_STATE_DONE; in isci_request_io_request_complete()
2938 task->task_state_flags &= ~SAS_TASK_STATE_PENDING; in isci_request_io_request_complete()
2940 spin_unlock_irqrestore(&task->task_state_lock, task_flags); in isci_request_io_request_complete()
2951 ireq_done(ihost, request, task); in isci_request_io_request_complete()
2959 struct sas_task *task; in sci_request_started_state_enter() local
2964 task = (test_bit(IREQ_TMF, &ireq->flags)) ? NULL : isci_request_access_task(ireq); in sci_request_started_state_enter()
2969 if (!task && dev->dev_type == SAS_END_DEVICE) { in sci_request_started_state_enter()
2971 } else if (task && task->task_proto == SAS_PROTOCOL_SMP) { in sci_request_started_state_enter()
2973 } else if (task && sas_protocol_ata(task->task_proto) && in sci_request_started_state_enter()
2974 !task->ata_task.use_ncq) { in sci_request_started_state_enter()
2976 task->ata_task.fis.command == ATA_CMD_PACKET) { in sci_request_started_state_enter()
2978 } else if (task->data_dir == DMA_NONE) { in sci_request_started_state_enter()
2980 } else if (task->ata_task.dma_xfer) { in sci_request_started_state_enter()
3146 struct sas_task *task = isci_request_access_task(ireq); in isci_request_stp_request_construct() local
3148 struct ata_queued_cmd *qc = task->uldd_task; in isci_request_stp_request_construct()
3156 memcpy(fis, &task->ata_task.fis, sizeof(struct host_to_dev_fis)); in isci_request_stp_request_construct()
3157 if (!task->ata_task.device_control_reg_update) in isci_request_stp_request_construct()
3178 struct sas_task *task) in sci_io_request_construct_smp() argument
3180 struct scatterlist *sg = &task->smp_task.smp_req; in sci_io_request_construct_smp()
3308 struct sas_task *task = isci_request_access_task(ireq); in isci_smp_request_build() local
3312 status = sci_io_request_construct_smp(dev, ireq, task); in isci_smp_request_build()
3337 struct sas_task *task = isci_request_access_task(request); in isci_io_request_build() local
3345 task->num_scatter); in isci_io_request_build()
3351 if (task->num_scatter && in isci_io_request_build()
3352 !sas_protocol_ata(task->task_proto) && in isci_io_request_build()
3353 !(SAS_PROTOCOL_SMP & task->task_proto)) { in isci_io_request_build()
3357 task->scatter, in isci_io_request_build()
3358 task->num_scatter, in isci_io_request_build()
3359 task->data_dir in isci_io_request_build()
3375 switch (task->task_proto) { in isci_io_request_build()
3410 struct sas_task *task, in isci_io_request_from_tag() argument
3416 ireq->ttype_ptr.io_task_ptr = task; in isci_io_request_from_tag()
3418 task->lldd_task = ireq; in isci_io_request_from_tag()
3437 struct sas_task *task, struct isci_request *ireq) in isci_request_execute() argument
3456 if (isci_task_is_ncq_recovery(task)) { in isci_request_execute()
3502 spin_lock_irqsave(&task->task_state_lock, flags); in isci_request_execute()
3503 task->task_state_flags |= SAS_TASK_NEED_DEV_RESET; in isci_request_execute()
3504 spin_unlock_irqrestore(&task->task_state_lock, flags); in isci_request_execute()
3509 sas_task_abort(task); in isci_request_execute()