Lines Matching defs:task

214 static int asd_clear_nexus_tag(struct sas_task *task)
216 struct asd_ha_struct *asd_ha = task->dev->port->ha->lldd_ha;
217 struct asd_ascb *tascb = task->lldd_task;
221 memcpy(scb->clear_nexus.ssp_task.lun, task->ssp_task.LUN, 8);
223 if (task->dev->tproto)
225 task->dev->lldd_dev);
229 static int asd_clear_nexus_index(struct sas_task *task)
231 struct asd_ha_struct *asd_ha = task->dev->port->ha->lldd_ha;
232 struct asd_ascb *tascb = task->lldd_task;
236 if (task->dev->tproto)
238 task->dev->lldd_dev);
324 static int asd_clear_nexus(struct sas_task *task)
328 struct asd_ascb *tascb = task->lldd_task;
334 ASD_DPRINTK("task not done, clearing nexus\n");
336 res = asd_clear_nexus_tag(task);
338 res = asd_clear_nexus_index(task);
343 spin_lock_irqsave(&task->task_state_lock, flags);
346 if (task->task_state_flags & SAS_TASK_STATE_DONE)
348 spin_unlock_irqrestore(&task->task_state_lock, flags);
355 * @task: the task to be aborted
357 * Before calling ABORT TASK the task state flags should be ORed with
367 * task->task_state_flags, and then the return value of ABORT TASK.
369 * If the task has task state bit SAS_TASK_STATE_DONE set, then the
370 * task was completed successfully prior to it being aborted. The
371 * caller of ABORT TASK has responsibility to call task->task_done()
372 * xor free the task, depending on their framework. The return code
377 * the task was aborted successfully. The caller of
378 * ABORT TASK has responsibility to call task->task_done()
379 * to finish the task, xor free the task depending on their
382 * the ABORT TASK returned some kind of error. The task
386 int asd_abort_task(struct sas_task *task)
388 struct asd_ascb *tascb = task->lldd_task;
401 spin_lock_irqsave(&task->task_state_lock, flags);
402 if (task->task_state_flags & SAS_TASK_STATE_DONE) {
403 spin_unlock_irqrestore(&task->task_state_lock, flags);
405 ASD_DPRINTK("%s: task 0x%p done\n", __func__, task);
408 spin_unlock_irqrestore(&task->task_state_lock, flags);
419 switch (task->task_proto) {
426 scb->abort_task.proto_conn_rate |= task->dev->linkrate;
434 if (task->task_proto == SAS_PROTOCOL_SSP) {
437 task->dev->hashed_sas_addr, HASHED_SAS_ADDR_SIZE);
439 task->dev->port->ha->hashed_sas_addr,
443 memcpy(scb->abort_task.ssp_task.lun, task->ssp_task.LUN, 8);
450 (u16)(unsigned long)task->dev->lldd_dev);
465 spin_lock_irqsave(&task->task_state_lock, flags);
466 if (task->task_state_flags & SAS_TASK_STATE_DONE) {
467 spin_unlock_irqrestore(&task->task_state_lock, flags);
469 ASD_DPRINTK("%s: task 0x%p done\n", __func__, task);
472 spin_unlock_irqrestore(&task->task_state_lock, flags);
475 /* The task to be aborted has been sent to the device.
478 res = asd_clear_nexus(task);
492 res = asd_clear_nexus(task);
496 /* The task hasn't been sent to the device xor
508 spin_lock_irqsave(&task->task_state_lock, flags);
511 if (task->task_state_flags & SAS_TASK_STATE_DONE)
513 spin_unlock_irqrestore(&task->task_state_lock, flags);
528 task->lldd_task = NULL;
532 ASD_DPRINTK("task 0x%p aborted, res: 0x%x\n", task, res);
537 ASD_DPRINTK("task 0x%p aborted, res: 0x%x\n", task, res);
546 * @index: the transaction context of the task to be queried if QT TMF
676 * @task: pointer to sas_task struct of interest
678 * Returns: TMF_RESP_FUNC_COMPLETE if the task is not in the task set,
679 * or TMF_RESP_FUNC_SUCC if the task is in the task set.
681 * Normally the management layer sets the task to aborted state,
682 * and then calls query task and then abort task.
684 int asd_query_task(struct sas_task *task)
686 struct asd_ascb *ascb = task->lldd_task;
691 return asd_initiate_ssp_tmf(task->dev, task->ssp_task.LUN,