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);
183 cmd_iu->task_prio = task->ssp_task.task_prio;
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);
461 * SCU_TASK_PRIORITY_HIGH. This ensures that the task request is issued
462 * ahead of other task destined for the same Remote Node. -# task_type ==
464 * (i.e. non-raw frame) is being utilized to perform task management. -#
466 * that the bytes are transmitted in the right order for a task frame.
467 * @sci_req: This parameter specifies the task request object being
490 * constructing the SCU task context.
491 * @task_context: The buffer pointer for the SCU task context which is being
495 * the command buffer is complete. none Revisit task context construction to
496 * determine what is common for SSP/SMP/STP task context structures.
615 /* Build the STP task context structure */
626 * The difference between the DMA IN and DMA OUT request task type
628 * and FPDMA WRITE values. Add the supplied task type parameter
629 * to this difference to set the task type properly for this
636 * optimized task type. */
644 struct sas_task *task;
655 task = isci_request_access_task(ireq);
656 if (task->data_dir == DMA_NONE)
657 task->total_xfer_len = 0;
672 struct sas_task *task = isci_request_access_task(ireq);
687 if (!sas_protocol_ata(task->task_proto)) {
691 task->task_proto);
698 task->ata_task.fis.command == ATA_CMD_PACKET) {
704 if (task->data_dir == DMA_NONE) {
710 if (task->ata_task.use_ncq) {
718 if (task->ata_task.dma_xfer) {
731 struct sas_task *task = isci_request_access_task(ireq);
736 task->data_dir,
737 task->total_xfer_len);
764 struct sas_task *task = isci_request_access_task(ireq);
768 copy = (task->data_dir == DMA_NONE) ? false : true;
771 task->total_xfer_len,
772 task->data_dir,
797 * = start of task context SRAM + offset of (type.ssp.data_offset)
890 /* The task frame was already confirmed to have been
892 * now only waiting for the task response itself,
894 * and don't wait for the task response.
1147 /* Unless we get some strange error wait for the task abort to complete
1166 /* Currently, the decision is to simply allow the task request
1167 * to timeout if the task IU wasn't received successfully.
1168 * There is a potential for receiving multiple task responses if
1169 * we decide to send the task IU again.
1414 struct sas_task *task;
1420 task = isci_request_access_task(ireq);
1423 if (task->num_scatter > 0) {
1424 sg = task->scatter;
1438 BUG_ON(task->total_xfer_len < total_len);
1439 memcpy(task->scatter, src_addr, total_len);
1622 struct sas_task *task = isci_request_access_task(ireq);
1643 if (task->data_dir == DMA_NONE)
1669 struct sas_task *task = isci_request_access_task(ireq);
1676 if (task->data_dir == DMA_TO_DEVICE) {
1689 memcpy(&ireq->stp.cmd.lbal, task->ata_task.atapi_packet, cdb_len);
1692 /* task phase is set to TX_CMD */
1699 task_context->transfer_length_bytes = task->total_xfer_len;
1772 struct sas_task *task = isci_request_access_task(ireq);
1773 struct scatterlist *sg = &task->smp_task.smp_resp;
1895 struct sas_task *task = isci_request_access_task(ireq);
1939 if (task->data_dir == DMA_FROM_DEVICE) {
1941 } else if (task->data_dir == DMA_TO_DEVICE) {
2065 struct sas_task *task = isci_request_access_task(ireq);
2069 if (task->data_dir == DMA_NONE) {
2459 * response iu, in the task struct, from the request object for the upper
2461 * @sas_task: This parameter is the task struct from the upper layer driver.
2468 struct sas_task *task,
2484 task->task_status.stat = resp_iu->status;
2486 /* libsas updates the task status fields based on the response iu. */
2487 sas_ssp_task_response(dev, task, resp_iu);
2503 struct sas_task *task,
2512 task->task_status.open_rej_reason = open_rej_reason;
2527 struct sas_task *task,
2542 * the target may still have a task outstanding that
2556 if (task->task_proto == SAS_PROTOCOL_SMP) {
2593 * has completed the task, so that no cleanup
2617 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,
2676 request, task, response_ptr, status_ptr,
2709 if (task->task_proto == SAS_PROTOCOL_SMP)
2717 static void isci_process_stp_response(struct sas_task *task, struct dev_to_host_fis *fis)
2719 struct task_status_struct *ts = &task->task_status;
2739 struct sas_task *task = isci_request_access_task(request);
2747 "%s: request = %p, task = %p, "
2748 "task->data_dir = %d completion_status = 0x%x\n",
2749 __func__, request, task, task->data_dir, completion_status);
2759 __func__, request, task);
2761 if (sas_protocol_ata(task->task_proto)) {
2762 isci_process_stp_response(task, &request->stp.rsp);
2763 } else if (SAS_PROTOCOL_SSP == task->task_proto) {
2767 isci_request_process_response_iu(task, resp_iu,
2770 } else if (SAS_PROTOCOL_SMP == task->task_proto) {
2781 /* use the task status set in the task struct by the
2785 response = task->task_status.resp;
2786 status = task->task_status.stat;
2804 task->task_status.residual
2805 = task->total_xfer_len - transferred_length;
2810 if (task->task_status.residual != 0)
2826 __func__, request, task);
2845 task, &response,
2857 spin_lock_irqsave(&task->task_state_lock, task_flags);
2858 task->task_state_flags |= SAS_TASK_NEED_DEV_RESET;
2859 spin_unlock_irqrestore(&task->task_state_lock, task_flags);
2899 if (SAS_PROTOCOL_SMP == task->task_proto)
2906 switch (task->task_proto) {
2908 if (task->data_dir == DMA_NONE)
2910 if (task->num_scatter == 0)
2914 task->total_xfer_len, task->data_dir);
2916 dma_unmap_sg(&ihost->pdev->dev, task->scatter,
2917 request->num_sg_entries, task->data_dir);
2920 struct scatterlist *sg = &task->smp_task.smp_req;
2937 spin_lock_irqsave(&task->task_state_lock, task_flags);
2939 task->task_status.resp = response;
2940 task->task_status.stat = status;
2944 task->task_state_flags |= SAS_TASK_STATE_DONE;
2945 task->task_state_flags &= ~(SAS_TASK_AT_INITIATOR |
2948 spin_unlock_irqrestore(&task->task_state_lock, task_flags);
2955 * task to recognize the already completed case.
2959 ireq_done(ihost, request, task);
2967 struct sas_task *task;
2972 task = (test_bit(IREQ_TMF, &ireq->flags)) ? NULL : isci_request_access_task(ireq);
2977 if (!task && dev->dev_type == SAS_END_DEVICE) {
2979 } else if (task && task->task_proto == SAS_PROTOCOL_SMP) {
2981 } else if (task && sas_protocol_ata(task->task_proto) &&
2982 !task->ata_task.use_ncq) {
2984 task->ata_task.fis.command == ATA_CMD_PACKET) {
2986 } else if (task->data_dir == DMA_NONE) {
2988 } else if (task->ata_task.dma_xfer) {
3154 struct sas_task *task = isci_request_access_task(ireq);
3156 struct ata_queued_cmd *qc = task->uldd_task;
3164 memcpy(fis, &task->ata_task.fis, sizeof(struct host_to_dev_fis));
3165 if (!task->ata_task.device_control_reg_update)
3186 struct sas_task *task)
3188 struct scatterlist *sg = &task->smp_task.smp_req;
3316 struct sas_task *task = isci_request_access_task(ireq);
3320 status = sci_io_request_construct_smp(dev, ireq, task);
3345 struct sas_task *task = isci_request_access_task(request);
3353 task->num_scatter);
3359 if (task->num_scatter &&
3360 !sas_protocol_ata(task->task_proto) &&
3361 !(SAS_PROTOCOL_SMP & task->task_proto)) {
3365 task->scatter,
3366 task->num_scatter,
3367 task->data_dir
3383 switch (task->task_proto) {
3418 struct sas_task *task,
3424 ireq->ttype_ptr.io_task_ptr = task;
3426 task->lldd_task = ireq;
3445 struct sas_task *task, u16 tag)
3453 ireq = isci_io_request_from_tag(ihost, task, tag);
3468 if (isci_task_is_ncq_recovery(task)) {
3471 * request on the task side. Note that it will
3514 spin_lock_irqsave(&task->task_state_lock, flags);
3515 task->task_state_flags |= SAS_TASK_NEED_DEV_RESET;
3516 spin_unlock_irqrestore(&task->task_state_lock, flags);
3518 /* Cause this task to be scheduled in the SCSI error
3521 sas_task_abort(task);