Lines Matching defs:task
58 #include "task.h"
116 struct sas_task *task = isci_request_access_task(ireq);
123 if (task->num_scatter > 0) {
124 sg = task->scatter;
154 task->scatter,
155 task->total_xfer_len,
156 task->data_dir);
160 scu_sg->A.length = task->total_xfer_len;
174 struct sas_task *task = isci_request_access_task(ireq);
178 memcpy(cmd_iu->LUN, task->ssp_task.LUN, 8);
184 cmd_iu->task_attr = task->ssp_task.task_attr;
187 sci_swab32_cpy(&cmd_iu->cdb, task->ssp_task.cmd->cmnd,
188 (task->ssp_task.cmd->cmd_len+3) / sizeof(u32));
194 struct sas_task *task = isci_request_access_task(ireq);
201 memcpy(task_iu->LUN, task->ssp_task.LUN, 8);
457 * ensures that the task request is issued ahead of other task destined
460 * being utilized to perform task management. -#control_frame == 1. This
462 * transmitted in the right order for a task frame.
463 * @ireq: This parameter specifies the task request object being constructed.
485 * constructing the SCU task context.
486 * @task_context: The buffer pointer for the SCU task context which is being
490 * the command buffer is complete. none Revisit task context construction to
491 * determine what is common for SSP/SMP/STP task context structures.
610 /* Build the STP task context structure */
621 * The difference between the DMA IN and DMA OUT request task type
623 * and FPDMA WRITE values. Add the supplied task type parameter
624 * to this difference to set the task type properly for this
631 * optimized task type. */
639 struct sas_task *task;
650 task = isci_request_access_task(ireq);
651 if (task->data_dir == DMA_NONE)
652 task->total_xfer_len = 0;
667 struct sas_task *task = isci_request_access_task(ireq);
682 if (!sas_protocol_ata(task->task_proto)) {
686 task->task_proto);
693 task->ata_task.fis.command == ATA_CMD_PACKET) {
699 if (task->data_dir == DMA_NONE) {
705 if (task->ata_task.use_ncq) {
713 if (task->ata_task.dma_xfer) {
726 struct sas_task *task = isci_request_access_task(ireq);
731 task->data_dir,
732 task->total_xfer_len);
759 struct sas_task *task = isci_request_access_task(ireq);
763 copy = (task->data_dir == DMA_NONE) ? false : true;
766 task->total_xfer_len,
767 task->data_dir,
792 * = start of task context SRAM + offset of (type.ssp.data_offset)
885 /* The task frame was already confirmed to have been
887 * now only waiting for the task response itself,
889 * and don't wait for the task response.
1143 /* Unless we get some strange error wait for the task abort to complete
1162 /* Currently, the decision is to simply allow the task request
1163 * to timeout if the task IU wasn't received successfully.
1164 * There is a potential for receiving multiple task responses if
1165 * we decide to send the task IU again.
1410 struct sas_task *task;
1416 task = isci_request_access_task(ireq);
1419 if (task->num_scatter > 0) {
1420 sg = task->scatter;
1434 BUG_ON(task->total_xfer_len < total_len);
1435 memcpy(task->scatter, src_addr, total_len);
1616 struct sas_task *task = isci_request_access_task(ireq);
1637 if (task->data_dir == DMA_NONE)
1663 struct sas_task *task = isci_request_access_task(ireq);
1670 if (task->data_dir == DMA_TO_DEVICE) {
1683 memcpy(&ireq->stp.cmd.lbal, task->ata_task.atapi_packet, cdb_len);
1686 /* task phase is set to TX_CMD */
1693 task_context->transfer_length_bytes = task->total_xfer_len;
1766 struct sas_task *task = isci_request_access_task(ireq);
1767 struct scatterlist *sg = &task->smp_task.smp_resp;
1889 struct sas_task *task = isci_request_access_task(ireq);
1933 if (task->data_dir == DMA_FROM_DEVICE) {
1935 } else if (task->data_dir == DMA_TO_DEVICE) {
2059 struct sas_task *task = isci_request_access_task(ireq);
2063 if (task->data_dir == DMA_NONE) {
2449 * response iu, in the task struct, from the request object for the upper
2451 * @task: This parameter is the task struct from the upper layer driver.
2458 struct sas_task *task,
2474 task->task_status.stat = resp_iu->status;
2476 /* libsas updates the task status fields based on the response iu. */
2477 sas_ssp_task_response(dev, task, resp_iu);
2484 * @task: This parameter is the task struct from the upper layer driver.
2494 struct sas_task *task,
2503 task->task_status.open_rej_reason = open_rej_reason;
2511 * @task: This parameter is the task struct from the upper layer driver.
2520 struct sas_task *task,
2535 * the target may still have a task outstanding that
2549 if (task->task_proto == SAS_PROTOCOL_SMP) {
2586 * has completed the task, so that no cleanup
2610 request, task, response_ptr, status_ptr,
2620 request, task, response_ptr, status_ptr,
2627 request, task, response_ptr, status_ptr,
2634 request, task, response_ptr, status_ptr,
2641 request, task, response_ptr, status_ptr,
2648 request, task, response_ptr, status_ptr,
2655 request, task, response_ptr, status_ptr,
2662 request, task, response_ptr, status_ptr,
2669 request, task, response_ptr, status_ptr,
2702 if (task->task_proto == SAS_PROTOCOL_SMP)
2710 static void isci_process_stp_response(struct sas_task *task, struct dev_to_host_fis *fis)
2712 struct task_status_struct *ts = &task->task_status;
2732 struct sas_task *task = isci_request_access_task(request);
2740 "%s: request = %p, task = %p, "
2741 "task->data_dir = %d completion_status = 0x%x\n",
2742 __func__, request, task, task->data_dir, completion_status);
2752 __func__, request, task);
2754 if (sas_protocol_ata(task->task_proto)) {
2755 isci_process_stp_response(task, &request->stp.rsp);
2756 } else if (SAS_PROTOCOL_SSP == task->task_proto) {
2760 isci_request_process_response_iu(task, resp_iu,
2763 } else if (SAS_PROTOCOL_SMP == task->task_proto) {
2774 /* use the task status set in the task struct by the
2778 response = task->task_status.resp;
2779 status = task->task_status.stat;
2797 task->task_status.residual
2798 = task->total_xfer_len - transferred_length;
2803 if (task->task_status.residual != 0)
2819 __func__, request, task);
2838 task, &response,
2850 spin_lock_irqsave(&task->task_state_lock, task_flags);
2851 task->task_state_flags |= SAS_TASK_NEED_DEV_RESET;
2852 spin_unlock_irqrestore(&task->task_state_lock, task_flags);
2892 if (SAS_PROTOCOL_SMP == task->task_proto)
2899 switch (task->task_proto) {
2901 if (task->data_dir == DMA_NONE)
2903 if (task->num_scatter == 0)
2907 task->total_xfer_len, task->data_dir);
2909 dma_unmap_sg(&ihost->pdev->dev, task->scatter,
2910 request->num_sg_entries, task->data_dir);
2913 struct scatterlist *sg = &task->smp_task.smp_req;
2930 spin_lock_irqsave(&task->task_state_lock, task_flags);
2932 task->task_status.resp = response;
2933 task->task_status.stat = status;
2937 task->task_state_flags |= SAS_TASK_STATE_DONE;
2938 task->task_state_flags &= ~SAS_TASK_STATE_PENDING;
2940 spin_unlock_irqrestore(&task->task_state_lock, task_flags);
2947 * task to recognize the already completed case.
2951 ireq_done(ihost, request, task);
2959 struct sas_task *task;
2964 task = (test_bit(IREQ_TMF, &ireq->flags)) ? NULL : isci_request_access_task(ireq);
2969 if (!task && dev->dev_type == SAS_END_DEVICE) {
2971 } else if (task && task->task_proto == SAS_PROTOCOL_SMP) {
2973 } else if (task && sas_protocol_ata(task->task_proto) &&
2974 !task->ata_task.use_ncq) {
2976 task->ata_task.fis.command == ATA_CMD_PACKET) {
2978 } else if (task->data_dir == DMA_NONE) {
2980 } else if (task->ata_task.dma_xfer) {
3146 struct sas_task *task = isci_request_access_task(ireq);
3148 struct ata_queued_cmd *qc = task->uldd_task;
3156 memcpy(fis, &task->ata_task.fis, sizeof(struct host_to_dev_fis));
3157 if (!task->ata_task.device_control_reg_update)
3178 struct sas_task *task)
3180 struct scatterlist *sg = &task->smp_task.smp_req;
3308 struct sas_task *task = isci_request_access_task(ireq);
3312 status = sci_io_request_construct_smp(dev, ireq, task);
3337 struct sas_task *task = isci_request_access_task(request);
3345 task->num_scatter);
3351 if (task->num_scatter &&
3352 !sas_protocol_ata(task->task_proto) &&
3353 !(SAS_PROTOCOL_SMP & task->task_proto)) {
3357 task->scatter,
3358 task->num_scatter,
3359 task->data_dir
3375 switch (task->task_proto) {
3410 struct sas_task *task,
3416 ireq->ttype_ptr.io_task_ptr = task;
3418 task->lldd_task = ireq;
3437 struct sas_task *task, struct isci_request *ireq)
3456 if (isci_task_is_ncq_recovery(task)) {
3459 * request on the task side. Note that it will
3502 spin_lock_irqsave(&task->task_state_lock, flags);
3503 task->task_state_flags |= SAS_TASK_NEED_DEV_RESET;
3504 spin_unlock_irqrestore(&task->task_state_lock, flags);
3506 /* Cause this task to be scheduled in the SCSI error
3509 sas_task_abort(task);