Lines Matching +full:ts +full:- +full:attached

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Serial Attached SCSI (SAS) class SCSI Host glue.
39 struct task_status_struct *ts = &task->task_status; in sas_end_task() local
43 if (ts->resp == SAS_TASK_UNDELIVERED) { in sas_end_task()
46 } else { /* ts->resp == SAS_TASK_COMPLETE */ in sas_end_task()
48 switch (ts->stat) { in sas_end_task()
57 scsi_set_resid(sc, ts->residual); in sas_end_task()
58 if (scsi_bufflen(sc) - scsi_get_resid(sc) < sc->underflow) in sas_end_task()
71 if (ts->open_rej_reason == SAS_OREJ_RSVD_RETRY) in sas_end_task()
78 task->dev->port->ha->sas_ha_name); in sas_end_task()
84 memcpy(sc->sense_buffer, ts->buf, in sas_end_task()
85 min(SCSI_SENSE_BUFFERSIZE, ts->buf_valid_size)); in sas_end_task()
89 stat = ts->stat; in sas_end_task()
94 sc->result = (hs << 16) | stat; in sas_end_task()
101 struct scsi_cmnd *sc = task->uldd_task; in sas_scsi_task_done()
102 struct domain_device *dev = task->dev; in sas_scsi_task_done()
103 struct sas_ha_struct *ha = dev->port->ha; in sas_scsi_task_done()
106 spin_lock_irqsave(&dev->done_lock, flags); in sas_scsi_task_done()
107 if (test_bit(SAS_HA_FROZEN, &ha->state)) in sas_scsi_task_done()
111 spin_unlock_irqrestore(&dev->done_lock, flags); in sas_scsi_task_done()
139 task->uldd_task = cmd; in sas_create_task()
142 task->dev = dev; in sas_create_task()
143 task->task_proto = task->dev->tproto; /* BUG_ON(!SSP) */ in sas_create_task()
145 int_to_scsilun(cmd->device->lun, &lun); in sas_create_task()
146 memcpy(task->ssp_task.LUN, &lun.scsi_lun, 8); in sas_create_task()
147 task->ssp_task.task_attr = TASK_ATTR_SIMPLE; in sas_create_task()
148 task->ssp_task.cmd = cmd; in sas_create_task()
150 task->scatter = scsi_sglist(cmd); in sas_create_task()
151 task->num_scatter = scsi_sg_count(cmd); in sas_create_task()
152 task->total_xfer_len = scsi_bufflen(cmd); in sas_create_task()
153 task->data_dir = cmd->sc_data_direction; in sas_create_task()
155 task->task_done = sas_scsi_task_done; in sas_create_task()
162 struct sas_internal *i = to_sas_internal(host->transportt); in sas_queuecommand()
168 if (test_bit(SAS_DEV_GONE, &dev->state)) { in sas_queuecommand()
169 cmd->result = DID_BAD_TARGET << 16; in sas_queuecommand()
174 spin_lock_irq(dev->sata_dev.ap->lock); in sas_queuecommand()
175 res = ata_sas_queuecmd(cmd, dev->sata_dev.ap); in sas_queuecommand()
176 spin_unlock_irq(dev->sata_dev.ap->lock); in sas_queuecommand()
184 res = i->dft->lldd_execute_task(task, GFP_ATOMIC); in sas_queuecommand()
193 if (res == -SAS_QUEUE_FULL) in sas_queuecommand()
194 cmd->result = DID_SOFT_ERROR << 16; /* retry */ in sas_queuecommand()
196 cmd->result = DID_ERROR << 16; in sas_queuecommand()
205 struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(cmd->device->host); in sas_eh_finish_cmd()
219 list_move_tail(&cmd->eh_entry, &sas_ha->eh_ata_q); in sas_eh_finish_cmd()
227 scsi_eh_finish_cmd(cmd, &sas_ha->eh_done_q); in sas_eh_finish_cmd()
235 if (cmd->device->sdev_target == my_cmd->device->sdev_target && in sas_scsi_clear_queue_lu()
236 cmd->device->lun == my_cmd->device->lun) in sas_scsi_clear_queue_lu()
261 struct asd_sas_port *x = dev->port; in sas_scsi_clear_queue_port()
281 to_sas_internal(task->dev->port->ha->shost->transportt); in sas_scsi_find_task()
285 res = si->dft->lldd_abort_task(task); in sas_scsi_find_task()
287 spin_lock_irqsave(&task->task_state_lock, flags); in sas_scsi_find_task()
288 if (task->task_state_flags & SAS_TASK_STATE_DONE) { in sas_scsi_find_task()
289 spin_unlock_irqrestore(&task->task_state_lock, flags); in sas_scsi_find_task()
293 spin_unlock_irqrestore(&task->task_state_lock, flags); in sas_scsi_find_task()
299 } else if (si->dft->lldd_query_task) { in sas_scsi_find_task()
301 res = si->dft->lldd_query_task(task); in sas_scsi_find_task()
329 to_sas_internal(dev->port->ha->shost->transportt); in sas_recover_lu()
331 int_to_scsilun(cmd->device->lun, &lun); in sas_recover_lu()
334 SAS_ADDR(dev->sas_addr), in sas_recover_lu()
335 cmd->device->lun); in sas_recover_lu()
337 if (i->dft->lldd_abort_task_set) in sas_recover_lu()
338 res = i->dft->lldd_abort_task_set(dev, lun.scsi_lun); in sas_recover_lu()
341 if (i->dft->lldd_clear_task_set) in sas_recover_lu()
342 res = i->dft->lldd_clear_task_set(dev, lun.scsi_lun); in sas_recover_lu()
346 if (i->dft->lldd_lu_reset) in sas_recover_lu()
347 res = i->dft->lldd_lu_reset(dev, lun.scsi_lun); in sas_recover_lu()
357 to_sas_internal(dev->port->ha->shost->transportt); in sas_recover_I_T()
360 SAS_ADDR(dev->sas_addr)); in sas_recover_I_T()
362 if (i->dft->lldd_I_T_nexus_reset) in sas_recover_I_T()
363 res = i->dft->lldd_I_T_nexus_reset(dev); in sas_recover_I_T()
371 struct sas_ha_struct *ha = dev->port->ha; in sas_get_local_phy()
378 BUG_ON(!dev->phy); in sas_get_local_phy()
380 spin_lock_irqsave(&ha->phy_port_lock, flags); in sas_get_local_phy()
381 phy = dev->phy; in sas_get_local_phy()
382 get_device(&phy->dev); in sas_get_local_phy()
383 spin_unlock_irqrestore(&ha->phy_port_lock, flags); in sas_get_local_phy()
391 struct sas_ha_struct *ha = dev->port->ha; in sas_queue_reset()
400 while (!scheduled && tries--) { in sas_queue_reset()
401 spin_lock_irq(&ha->lock); in sas_queue_reset()
402 if (!test_bit(SAS_DEV_EH_PENDING, &dev->state) && in sas_queue_reset()
403 !test_bit(reset_type, &dev->state)) { in sas_queue_reset()
405 ha->eh_active++; in sas_queue_reset()
406 list_add_tail(&dev->ssp_dev.eh_list_node, &ha->eh_dev_q); in sas_queue_reset()
407 set_bit(SAS_DEV_EH_PENDING, &dev->state); in sas_queue_reset()
408 set_bit(reset_type, &dev->state); in sas_queue_reset()
409 int_to_scsilun(lun, &dev->ssp_dev.reset_lun); in sas_queue_reset()
410 scsi_schedule_eh(ha->shost); in sas_queue_reset()
412 spin_unlock_irq(&ha->lock); in sas_queue_reset()
420 dev_name(&dev->rphy->dev)); in sas_queue_reset()
429 struct Scsi_Host *host = cmd->device->host; in sas_eh_abort_handler()
431 struct sas_internal *i = to_sas_internal(host->transportt); in sas_eh_abort_handler()
434 if (!i->dft->lldd_abort_task) in sas_eh_abort_handler()
437 spin_lock_irqsave(host->host_lock, flags); in sas_eh_abort_handler()
439 if (dev_is_sata(dev) && !host->host_eh_scheduled) { in sas_eh_abort_handler()
440 spin_unlock_irqrestore(host->host_lock, flags); in sas_eh_abort_handler()
443 spin_unlock_irqrestore(host->host_lock, flags); in sas_eh_abort_handler()
446 res = i->dft->lldd_abort_task(task); in sas_eh_abort_handler()
461 struct Scsi_Host *host = cmd->device->host; in sas_eh_device_reset_handler()
463 struct sas_internal *i = to_sas_internal(host->transportt); in sas_eh_device_reset_handler()
465 if (current != host->ehandler) in sas_eh_device_reset_handler()
466 return sas_queue_reset(dev, SAS_DEV_LU_RESET, cmd->device->lun); in sas_eh_device_reset_handler()
468 int_to_scsilun(cmd->device->lun, &lun); in sas_eh_device_reset_handler()
470 if (!i->dft->lldd_lu_reset) in sas_eh_device_reset_handler()
473 res = i->dft->lldd_lu_reset(dev, lun.scsi_lun); in sas_eh_device_reset_handler()
484 struct Scsi_Host *host = cmd->device->host; in sas_eh_target_reset_handler()
486 struct sas_internal *i = to_sas_internal(host->transportt); in sas_eh_target_reset_handler()
488 if (current != host->ehandler) in sas_eh_target_reset_handler()
491 if (!i->dft->lldd_I_T_nexus_reset) in sas_eh_target_reset_handler()
494 res = i->dft->lldd_I_T_nexus_reset(dev); in sas_eh_target_reset_handler()
496 res == -ENODEV) in sas_eh_target_reset_handler()
507 struct Scsi_Host *shost = cmd->device->host; in try_to_reset_cmd_device()
509 if (!shost->hostt->eh_device_reset_handler) in try_to_reset_cmd_device()
512 res = shost->hostt->eh_device_reset_handler(cmd); in try_to_reset_cmd_device()
517 if (shost->hostt->eh_target_reset_handler) in try_to_reset_cmd_device()
518 return shost->hostt->eh_target_reset_handler(cmd); in try_to_reset_cmd_device()
528 struct sas_internal *i = to_sas_internal(shost->transportt); in sas_eh_handle_sas_errors()
538 spin_lock_irqsave(&dev->done_lock, flags); in sas_eh_handle_sas_errors()
544 spin_unlock_irqrestore(&dev->done_lock, flags); in sas_eh_handle_sas_errors()
547 list_move_tail(&cmd->eh_entry, &done); in sas_eh_handle_sas_errors()
554 list_del_init(&cmd->eh_entry); in sas_eh_handle_sas_errors()
556 spin_lock_irqsave(&task->task_state_lock, flags); in sas_eh_handle_sas_errors()
557 need_reset = task->task_state_flags & SAS_TASK_NEED_DEV_RESET; in sas_eh_handle_sas_errors()
558 spin_unlock_irqrestore(&task->task_state_lock, flags); in sas_eh_handle_sas_errors()
583 tmf_resp = sas_recover_lu(task->dev, cmd); in sas_eh_handle_sas_errors()
586 SAS_ADDR(task->dev), in sas_eh_handle_sas_errors()
587 cmd->device->lun); in sas_eh_handle_sas_errors()
597 tmf_resp = sas_recover_I_T(task->dev); in sas_eh_handle_sas_errors()
599 tmf_resp == -ENODEV) { in sas_eh_handle_sas_errors()
600 struct domain_device *dev = task->dev; in sas_eh_handle_sas_errors()
602 SAS_ADDR(task->dev->sas_addr)); in sas_eh_handle_sas_errors()
607 /* Hammer time :-) */ in sas_eh_handle_sas_errors()
609 if (i->dft->lldd_clear_nexus_port) { in sas_eh_handle_sas_errors()
610 struct asd_sas_port *port = task->dev->port; in sas_eh_handle_sas_errors()
612 port->id); in sas_eh_handle_sas_errors()
613 res = i->dft->lldd_clear_nexus_port(port); in sas_eh_handle_sas_errors()
616 port->id); in sas_eh_handle_sas_errors()
623 if (i->dft->lldd_clear_nexus_ha) { in sas_eh_handle_sas_errors()
625 res = i->dft->lldd_clear_nexus_ha(ha); in sas_eh_handle_sas_errors()
632 /* If we are here -- this means that no amount in sas_eh_handle_sas_errors()
637 SAS_ADDR(task->dev->sas_addr), in sas_eh_handle_sas_errors()
638 cmd->device->lun); in sas_eh_handle_sas_errors()
646 list_splice_tail_init(&ha->eh_ata_q, work_q); in sas_eh_handle_sas_errors()
650 pr_debug("--- Exit %s -- clear_q\n", __func__); in sas_eh_handle_sas_errors()
659 struct sas_internal *i = to_sas_internal(shost->transportt); in sas_eh_handle_resets()
662 spin_lock_irq(&ha->lock); in sas_eh_handle_resets()
663 while (!list_empty(&ha->eh_dev_q)) { in sas_eh_handle_resets()
667 ssp = list_entry(ha->eh_dev_q.next, typeof(*ssp), eh_list_node); in sas_eh_handle_resets()
668 list_del_init(&ssp->eh_list_node); in sas_eh_handle_resets()
670 kref_get(&dev->kref); in sas_eh_handle_resets()
673 spin_unlock_irq(&ha->lock); in sas_eh_handle_resets()
675 if (test_and_clear_bit(SAS_DEV_LU_RESET, &dev->state)) in sas_eh_handle_resets()
676 i->dft->lldd_lu_reset(dev, ssp->reset_lun.scsi_lun); in sas_eh_handle_resets()
678 if (test_and_clear_bit(SAS_DEV_RESET, &dev->state)) in sas_eh_handle_resets()
679 i->dft->lldd_I_T_nexus_reset(dev); in sas_eh_handle_resets()
682 spin_lock_irq(&ha->lock); in sas_eh_handle_resets()
683 clear_bit(SAS_DEV_EH_PENDING, &dev->state); in sas_eh_handle_resets()
684 ha->eh_active--; in sas_eh_handle_resets()
686 spin_unlock_irq(&ha->lock); in sas_eh_handle_resets()
700 spin_lock_irq(shost->host_lock); in sas_scsi_recover_host()
701 list_splice_init(&shost->eh_cmd_q, &eh_work_q); in sas_scsi_recover_host()
702 spin_unlock_irq(shost->host_lock); in sas_scsi_recover_host()
705 __func__, scsi_host_busy(shost), shost->host_failed); in sas_scsi_recover_host()
711 set_bit(SAS_HA_FROZEN, &ha->state); in sas_scsi_recover_host()
713 clear_bit(SAS_HA_FROZEN, &ha->state); in sas_scsi_recover_host()
719 * code (and hopefully sense data) attached. This is roughly what in sas_scsi_recover_host()
724 if (!scsi_eh_get_sense(&eh_work_q, &ha->eh_done_q)) in sas_scsi_recover_host()
725 scsi_eh_ready_devs(shost, &eh_work_q, &ha->eh_done_q); in sas_scsi_recover_host()
730 /* now link into libata eh --- if we have any ata devices */ in sas_scsi_recover_host()
733 scsi_eh_flush_done_q(&ha->eh_done_q); in sas_scsi_recover_host()
736 spin_lock_irq(&ha->lock); in sas_scsi_recover_host()
737 if (ha->eh_active == 0) { in sas_scsi_recover_host()
738 shost->host_eh_scheduled = 0; in sas_scsi_recover_host()
741 spin_unlock_irq(&ha->lock); in sas_scsi_recover_host()
746 pr_notice("--- Exit %s: busy: %d failed: %d tries: %d\n", in sas_scsi_recover_host()
748 shost->host_failed, tries); in sas_scsi_recover_host()
756 return ata_sas_scsi_ioctl(dev->sata_dev.ap, sdev, cmd, arg); in sas_ioctl()
758 return -EINVAL; in sas_ioctl()
764 struct Scsi_Host *shost = dev_to_shost(rphy->dev.parent); in sas_find_dev_by_rphy()
770 spin_lock_irqsave(&ha->phy_port_lock, flags); in sas_find_dev_by_rphy()
771 for (i = 0; i < ha->num_phys; i++) { in sas_find_dev_by_rphy()
772 struct asd_sas_port *port = ha->sas_port[i]; in sas_find_dev_by_rphy()
775 spin_lock(&port->dev_list_lock); in sas_find_dev_by_rphy()
776 list_for_each_entry(dev, &port->dev_list, dev_list_node) { in sas_find_dev_by_rphy()
777 if (rphy == dev->rphy) { in sas_find_dev_by_rphy()
779 spin_unlock(&port->dev_list_lock); in sas_find_dev_by_rphy()
783 spin_unlock(&port->dev_list_lock); in sas_find_dev_by_rphy()
786 spin_unlock_irqrestore(&ha->phy_port_lock, flags); in sas_find_dev_by_rphy()
793 struct sas_rphy *rphy = dev_to_rphy(starget->dev.parent); in sas_target_alloc()
797 return -ENODEV; in sas_target_alloc()
799 kref_get(&found_dev->kref); in sas_target_alloc()
800 starget->hostdata = found_dev; in sas_target_alloc()
812 BUG_ON(dev->rphy->identify.device_type != SAS_END_DEVICE); in sas_device_configure()
815 ata_sas_device_configure(scsi_dev, lim, dev->sata_dev.ap); in sas_device_configure()
821 if (scsi_dev->tagged_supported) { in sas_device_configure()
825 SAS_ADDR(dev->sas_addr), scsi_dev->lun); in sas_device_configure()
829 scsi_dev->allow_restart = 1; in sas_device_configure()
840 return ata_change_queue_depth(dev->sata_dev.ap, sdev, depth); in sas_change_queue_depth()
842 if (!sdev->tagged_supported) in sas_change_queue_depth()
863 del_timer(&task->slow_task->timer); in sas_task_internal_done()
864 complete(&task->slow_task->completion); in sas_task_internal_done()
870 struct sas_task *task = slow->task; in sas_task_internal_timedout()
874 spin_lock_irqsave(&task->task_state_lock, flags); in sas_task_internal_timedout()
875 if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) { in sas_task_internal_timedout()
876 task->task_state_flags |= SAS_TASK_STATE_ABORTED; in sas_task_internal_timedout()
879 spin_unlock_irqrestore(&task->task_state_lock, flags); in sas_task_internal_timedout()
882 complete(&task->slow_task->completion); in sas_task_internal_timedout()
892 struct sas_ha_struct *ha = device->port->ha; in sas_execute_internal_abort()
893 struct sas_internal *i = to_sas_internal(ha->shost->transportt); in sas_execute_internal_abort()
900 return -ENOMEM; in sas_execute_internal_abort()
902 task->dev = device; in sas_execute_internal_abort()
903 task->task_proto = SAS_PROTOCOL_INTERNAL_ABORT; in sas_execute_internal_abort()
904 task->task_done = sas_task_internal_done; in sas_execute_internal_abort()
905 task->slow_task->timer.function = sas_task_internal_timedout; in sas_execute_internal_abort()
906 task->slow_task->timer.expires = jiffies + TASK_TIMEOUT; in sas_execute_internal_abort()
907 add_timer(&task->slow_task->timer); in sas_execute_internal_abort()
909 task->abort_task.tag = tag; in sas_execute_internal_abort()
910 task->abort_task.type = type; in sas_execute_internal_abort()
911 task->abort_task.qid = qid; in sas_execute_internal_abort()
913 res = i->dft->lldd_execute_task(task, GFP_KERNEL); in sas_execute_internal_abort()
915 del_timer_sync(&task->slow_task->timer); in sas_execute_internal_abort()
917 SAS_ADDR(device->sas_addr), res); in sas_execute_internal_abort()
921 wait_for_completion(&task->slow_task->completion); in sas_execute_internal_abort()
925 if (task->task_state_flags & SAS_TASK_STATE_ABORTED) { in sas_execute_internal_abort()
928 if (i->dft->lldd_abort_timeout) in sas_execute_internal_abort()
929 quit = i->dft->lldd_abort_timeout(task, data); in sas_execute_internal_abort()
932 SAS_ADDR(device->sas_addr)); in sas_execute_internal_abort()
933 res = -EIO; in sas_execute_internal_abort()
938 if (task->task_status.resp == SAS_TASK_COMPLETE && in sas_execute_internal_abort()
939 task->task_status.stat == SAS_SAM_STAT_GOOD) { in sas_execute_internal_abort()
944 if (task->task_status.resp == SAS_TASK_COMPLETE && in sas_execute_internal_abort()
945 task->task_status.stat == TMF_RESP_FUNC_SUCC) { in sas_execute_internal_abort()
951 SAS_ADDR(device->sas_addr), task->task_status.resp, in sas_execute_internal_abort()
952 task->task_status.stat); in sas_execute_internal_abort()
983 to_sas_internal(device->port->ha->shost->transportt); in sas_execute_tmf()
989 return -ENOMEM; in sas_execute_tmf()
991 task->dev = device; in sas_execute_tmf()
992 task->task_proto = device->tproto; in sas_execute_tmf()
995 task->ata_task.device_control_reg_update = 1; in sas_execute_tmf()
997 task->ata_task.force_phy = true; in sas_execute_tmf()
998 task->ata_task.force_phy_id = force_phy_id; in sas_execute_tmf()
1000 memcpy(&task->ata_task.fis, parameter, para_len); in sas_execute_tmf()
1002 memcpy(&task->ssp_task, parameter, para_len); in sas_execute_tmf()
1005 task->task_done = sas_task_internal_done; in sas_execute_tmf()
1006 task->tmf = tmf; in sas_execute_tmf()
1008 task->slow_task->timer.function = sas_task_internal_timedout; in sas_execute_tmf()
1009 task->slow_task->timer.expires = jiffies + TASK_TIMEOUT; in sas_execute_tmf()
1010 add_timer(&task->slow_task->timer); in sas_execute_tmf()
1012 res = i->dft->lldd_execute_task(task, GFP_KERNEL); in sas_execute_tmf()
1014 del_timer_sync(&task->slow_task->timer); in sas_execute_tmf()
1016 SAS_ADDR(device->sas_addr), res); in sas_execute_tmf()
1020 wait_for_completion(&task->slow_task->completion); in sas_execute_tmf()
1022 if (i->dft->lldd_tmf_exec_complete) in sas_execute_tmf()
1023 i->dft->lldd_tmf_exec_complete(device); in sas_execute_tmf()
1027 if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) { in sas_execute_tmf()
1028 if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) { in sas_execute_tmf()
1030 SAS_ADDR(device->sas_addr)); in sas_execute_tmf()
1031 if (i->dft->lldd_tmf_aborted) in sas_execute_tmf()
1032 i->dft->lldd_tmf_aborted(task); in sas_execute_tmf()
1036 SAS_ADDR(device->sas_addr)); in sas_execute_tmf()
1039 if (task->task_status.resp == SAS_TASK_COMPLETE && in sas_execute_tmf()
1040 task->task_status.stat == TMF_RESP_FUNC_COMPLETE) { in sas_execute_tmf()
1045 if (task->task_status.resp == SAS_TASK_COMPLETE && in sas_execute_tmf()
1046 task->task_status.stat == TMF_RESP_FUNC_SUCC) { in sas_execute_tmf()
1051 if (task->task_status.resp == SAS_TASK_COMPLETE && in sas_execute_tmf()
1052 task->task_status.stat == SAS_DATA_UNDERRUN) { in sas_execute_tmf()
1057 SAS_ADDR(device->sas_addr), in sas_execute_tmf()
1058 task->task_status.resp, in sas_execute_tmf()
1059 task->task_status.stat); in sas_execute_tmf()
1060 res = task->task_status.residual; in sas_execute_tmf()
1064 if (task->task_status.resp == SAS_TASK_COMPLETE && in sas_execute_tmf()
1065 task->task_status.stat == SAS_DATA_OVERRUN) { in sas_execute_tmf()
1067 SAS_ADDR(device->sas_addr)); in sas_execute_tmf()
1068 res = -EMSGSIZE; in sas_execute_tmf()
1072 if (task->task_status.resp == SAS_TASK_COMPLETE && in sas_execute_tmf()
1073 task->task_status.stat == SAS_OPEN_REJECT) { in sas_execute_tmf()
1075 SAS_ADDR(device->sas_addr)); in sas_execute_tmf()
1076 res = -EIO; in sas_execute_tmf()
1079 SAS_ADDR(device->sas_addr), in sas_execute_tmf()
1080 task->task_status.resp, in sas_execute_tmf()
1081 task->task_status.stat); in sas_execute_tmf()
1089 SAS_ADDR(device->sas_addr), TASK_RETRY); in sas_execute_tmf()
1100 if (!(device->tproto & SAS_PROTOCOL_SSP)) in sas_execute_ssp_tmf()
1105 return sas_execute_tmf(device, &ssp_task, sizeof(ssp_task), -1, tmf); in sas_execute_ssp_tmf()
1144 struct scsi_cmnd *cmnd = task->uldd_task; in sas_query_task()
1145 struct domain_device *dev = task->dev; in sas_query_task()
1148 int_to_scsilun(cmnd->device->lun, &lun); in sas_query_task()
1160 struct scsi_cmnd *cmnd = task->uldd_task; in sas_abort_task()
1161 struct domain_device *dev = task->dev; in sas_abort_task()
1164 int_to_scsilun(cmnd->device->lun, &lun); in sas_abort_task()
1176 struct scsi_cmnd *sc = task->uldd_task; in sas_task_abort()
1180 struct sas_task_slow *slow = task->slow_task; in sas_task_abort()
1184 if (!del_timer(&slow->timer)) in sas_task_abort()
1186 slow->timer.function(&slow->timer); in sas_task_abort()
1190 if (dev_is_sata(task->dev)) in sas_task_abort()
1199 if (dev_is_sata(sdev_to_domain_dev(sdev)) && sdev->lun) in sas_slave_alloc()
1200 return -ENXIO; in sas_slave_alloc()
1208 struct domain_device *found_dev = starget->hostdata; in sas_target_destroy()
1213 starget->hostdata = NULL; in sas_target_destroy()
1225 res = request_firmware(&fw, "sas_addr", &shost->shost_gendev); in sas_request_addr()
1229 if (fw->size < SAS_STRING_ADDR_SIZE) { in sas_request_addr()
1230 res = -ENODEV; in sas_request_addr()
1234 res = hex2bin(addr, fw->data, strnlen(fw->data, SAS_ADDR_SIZE * 2) / 2); in sas_request_addr()