Lines Matching refs:targ
262 mprsas_rescan_target(struct mpr_softc *sc, struct mprsas_target *targ) in mprsas_rescan_target() argument
271 if (targ == NULL) in mprsas_rescan_target()
274 targetid = targ - sassc->targets; in mprsas_rescan_target()
347 struct mprsas_target *targ; in mprsas_remove_volume() local
354 targ = tm->cm_targ; in mprsas_remove_volume()
376 targ->tid, handle); in mprsas_remove_volume()
386 targ = tm->cm_targ; in mprsas_remove_volume()
387 targ->handle = 0x0; in mprsas_remove_volume()
388 targ->encl_handle = 0x0; in mprsas_remove_volume()
389 targ->encl_level_valid = 0x0; in mprsas_remove_volume()
390 targ->encl_level = 0x0; in mprsas_remove_volume()
391 targ->connector_name[0] = ' '; in mprsas_remove_volume()
392 targ->connector_name[1] = ' '; in mprsas_remove_volume()
393 targ->connector_name[2] = ' '; in mprsas_remove_volume()
394 targ->connector_name[3] = ' '; in mprsas_remove_volume()
395 targ->encl_slot = 0x0; in mprsas_remove_volume()
396 targ->exp_dev_handle = 0x0; in mprsas_remove_volume()
397 targ->phy_num = 0x0; in mprsas_remove_volume()
398 targ->linkrate = 0x0; in mprsas_remove_volume()
399 targ->devinfo = 0x0; in mprsas_remove_volume()
400 targ->flags = 0x0; in mprsas_remove_volume()
401 targ->scsi_req_desc_type = 0; in mprsas_remove_volume()
445 struct mprsas_target *targ = NULL; in mprsas_prepare_volume_remove() local
450 targ = mprsas_find_target_by_handle(sassc, 0, handle); in mprsas_prepare_volume_remove()
451 if (targ == NULL) { in mprsas_prepare_volume_remove()
459 targ->flags |= MPRSAS_TARGET_INREMOVAL; in mprsas_prepare_volume_remove()
463 targ->flags |= MPRSAS_TARGET_TOREMOVE; in mprsas_prepare_volume_remove()
468 mprsas_rescan_target(sc, targ); in mprsas_prepare_volume_remove()
471 req->DevHandle = targ->handle; in mprsas_prepare_volume_remove()
474 if (!targ->is_nvme || sc->custom_nvme_tm_handling) { in mprsas_prepare_volume_remove()
483 cm->cm_targ = targ; in mprsas_prepare_volume_remove()
489 __func__, targ->tid); in mprsas_prepare_volume_remove()
490 mprsas_prepare_for_tm(sc, cm, targ, CAM_LUN_WILDCARD); in mprsas_prepare_volume_remove()
510 struct mprsas_target *targ = NULL; in mprsas_prepare_remove() local
516 targ = mprsas_find_target_by_handle(sassc, 0, handle); in mprsas_prepare_remove()
517 if (targ == NULL) { in mprsas_prepare_remove()
525 targ->flags |= MPRSAS_TARGET_INREMOVAL; in mprsas_prepare_remove()
529 targ->flags |= MPRSAS_TARGET_TOREMOVE; in mprsas_prepare_remove()
534 mprsas_rescan_target(sc, targ); in mprsas_prepare_remove()
537 req->DevHandle = htole16(targ->handle); in mprsas_prepare_remove()
543 tm->cm_targ = targ; in mprsas_prepare_remove()
549 __func__, targ->tid); in mprsas_prepare_remove()
550 mprsas_prepare_for_tm(sc, tm, targ, CAM_LUN_WILDCARD); in mprsas_prepare_remove()
560 struct mprsas_target *targ; in mprsas_remove_device() local
567 targ = tm->cm_targ; in mprsas_remove_device()
615 if (TAILQ_FIRST(&targ->commands) == NULL) { in mprsas_remove_device()
618 targ->tid, handle); in mprsas_remove_device()
620 targ->pending_remove_tm = NULL; in mprsas_remove_device()
622 targ->pending_remove_tm = tm; in mprsas_remove_device()
626 targ->tid, handle); in mprsas_remove_device()
627 if (targ->encl_level_valid) { in mprsas_remove_device()
629 "connector name (%4s)\n", targ->encl_level, targ->encl_slot, in mprsas_remove_device()
630 targ->connector_name); in mprsas_remove_device()
639 struct mprsas_target *targ; in mprsas_remove_complete() local
647 targ = tm->cm_targ; in mprsas_remove_complete()
653 KASSERT(TAILQ_FIRST(&targ->commands) == NULL, in mprsas_remove_complete()
688 targ->handle = 0x0; in mprsas_remove_complete()
689 targ->encl_handle = 0x0; in mprsas_remove_complete()
690 targ->encl_level_valid = 0x0; in mprsas_remove_complete()
691 targ->encl_level = 0x0; in mprsas_remove_complete()
692 targ->connector_name[0] = ' '; in mprsas_remove_complete()
693 targ->connector_name[1] = ' '; in mprsas_remove_complete()
694 targ->connector_name[2] = ' '; in mprsas_remove_complete()
695 targ->connector_name[3] = ' '; in mprsas_remove_complete()
696 targ->encl_slot = 0x0; in mprsas_remove_complete()
697 targ->exp_dev_handle = 0x0; in mprsas_remove_complete()
698 targ->phy_num = 0x0; in mprsas_remove_complete()
699 targ->linkrate = 0x0; in mprsas_remove_complete()
700 targ->devinfo = 0x0; in mprsas_remove_complete()
701 targ->flags = 0x0; in mprsas_remove_complete()
702 targ->scsi_req_desc_type = 0; in mprsas_remove_complete()
704 while (!SLIST_EMPTY(&targ->luns)) { in mprsas_remove_complete()
705 lun = SLIST_FIRST(&targ->luns); in mprsas_remove_complete()
706 SLIST_REMOVE_HEAD(&targ->luns, lun_link); in mprsas_remove_complete()
870 struct mprsas_target *targ; in mpr_detach_sas() local
916 targ = &sassc->targets[i]; in mpr_detach_sas()
917 SLIST_FOREACH_SAFE(lun, &targ->luns, lun_link, lun_tmp) { in mpr_detach_sas()
1010 struct mprsas_target *targ; in mprsas_action() local
1019 targ = &sassc->targets[cts->ccb_h.target_id]; in mprsas_action()
1020 if (targ->handle == 0x0) { in mprsas_action()
1030 switch (targ->linkrate) { in mprsas_action()
1226 struct mprsas_target *targ; in mprsas_logical_unit_reset_complete() local
1231 targ = tm->cm_targ; in mprsas_logical_unit_reset_complete()
1253 targ->tm = NULL; in mprsas_logical_unit_reset_complete()
1275 TAILQ_FOREACH(cm, &targ->commands, cm_link) { in mprsas_logical_unit_reset_complete()
1283 targ->tid); in mprsas_logical_unit_reset_complete()
1285 mprsas_announce_reset(sc, AC_SENT_BDR, targ->tid, in mprsas_logical_unit_reset_complete()
1293 cm = TAILQ_FIRST(&targ->timedout_commands); in mprsas_logical_unit_reset_complete()
1296 "More commands to abort for target %u\n", targ->tid); in mprsas_logical_unit_reset_complete()
1299 targ->tm = NULL; in mprsas_logical_unit_reset_complete()
1309 "have %u command(s), sending target reset\n", targ->tid, in mprsas_logical_unit_reset_complete()
1311 if (!targ->is_nvme || sc->custom_nvme_tm_handling) in mprsas_logical_unit_reset_complete()
1324 struct mprsas_target *targ; in mprsas_target_reset_complete() local
1330 targ = tm->cm_targ; in mprsas_target_reset_complete()
1352 targ->tm = NULL; in mprsas_target_reset_complete()
1369 if (targ->outstanding == 0) { in mprsas_target_reset_complete()
1375 "Finished reset recovery for target %u\n", targ->tid); in mprsas_target_reset_complete()
1380 targ->tm = NULL; in mprsas_target_reset_complete()
1390 "command(s), resetting controller\n", targ->tid, in mprsas_target_reset_complete()
1391 targ->outstanding); in mprsas_target_reset_complete()
1479 struct mprsas_target *targ; in mprsas_abort_complete() local
1485 targ = tm->cm_targ; in mprsas_abort_complete()
1508 targ->tm = NULL; in mprsas_abort_complete()
1532 "Finished abort recovery for target %u\n", targ->tid); in mprsas_abort_complete()
1533 targ->tm = NULL; in mprsas_abort_complete()
1538 "Continuing abort recovery for target %u\n", targ->tid); in mprsas_abort_complete()
1547 targ->tid); in mprsas_abort_complete()
1561 struct mprsas_target *targ; in mprsas_send_abort() local
1564 targ = cm->cm_targ; in mprsas_send_abort()
1565 if (targ->handle == 0) { in mprsas_send_abort()
1576 req->DevHandle = htole16(targ->handle); in mprsas_send_abort()
1590 if (!targ->is_nvme || sc->custom_nvme_tm_handling) in mprsas_send_abort()
1598 targ->aborts++; in mprsas_send_abort()
1600 mprsas_prepare_for_tm(sc, tm, targ, tm->cm_lun); in mprsas_send_abort()
1617 struct mprsas_target *targ; in mprsas_scsiio_timeout() local
1646 targ = cm->cm_targ; in mprsas_scsiio_timeout()
1647 targ->timeouts++; in mprsas_scsiio_timeout()
1652 targ->tid, targ->handle, ccb->ccb_h.timeout, in mprsas_scsiio_timeout()
1654 if (targ->encl_level_valid) { in mprsas_scsiio_timeout()
1657 targ->encl_level, targ->encl_slot, targ->connector_name); in mprsas_scsiio_timeout()
1665 TAILQ_INSERT_TAIL(&targ->timedout_commands, cm, cm_recovery); in mprsas_scsiio_timeout()
1667 if (targ->tm != NULL) { in mprsas_scsiio_timeout()
1673 cm, targ->tm); in mprsas_scsiio_timeout()
1674 } else if ((targ->tm = mprsas_alloc_tm(sc)) != NULL) { in mprsas_scsiio_timeout()
1676 "Sending abort to target %u for SMID %d\n", targ->tid, in mprsas_scsiio_timeout()
1679 cm, targ->tm); in mprsas_scsiio_timeout()
1682 mprsas_send_abort(sc, targ->tm, cm); in mprsas_scsiio_timeout()
1708 union ccb *ccb, struct mprsas_target *targ) in mprsas_build_nvme_unmap() argument
1749 if (data_length > targ->MDTS) { in mprsas_build_nvme_unmap()
1751 "Device's MDTS: %d\n", data_length, targ->MDTS); in mprsas_build_nvme_unmap()
1785 req->DevHandle = htole16(targ->handle); in mprsas_build_nvme_unmap()
1810 cm->cm_targ = targ; in mprsas_build_nvme_unmap()
1821 targ->issued++; in mprsas_build_nvme_unmap()
1822 targ->outstanding++; in mprsas_build_nvme_unmap()
1823 TAILQ_INSERT_TAIL(&targ->commands, cm, cm_link); in mprsas_build_nvme_unmap()
1827 __func__, cm, ccb, targ->outstanding); in mprsas_build_nvme_unmap()
1845 struct mprsas_target *targ; in mprsas_action_scsiio() local
1861 targ = &sassc->targets[csio->ccb_h.target_id]; in mprsas_action_scsiio()
1862 mpr_dprint(sc, MPR_TRACE, "ccb %p target flag %x\n", ccb, targ->flags); in mprsas_action_scsiio()
1863 if (targ->handle == 0x0) { in mprsas_action_scsiio()
1864 if (targ->flags & MPRSAS_TARGET_INDIAGRESET) { in mprsas_action_scsiio()
1879 if (targ->flags & MPR_TARGET_FLAGS_RAID_COMPONENT) { in mprsas_action_scsiio()
1906 if (targ->flags & MPRSAS_TARGET_INREMOVAL) { in mprsas_action_scsiio()
1907 if (targ->devinfo == 0) in mprsas_action_scsiio()
1926 if (targ->flags & MPRSAS_TARGET_INRESET) { in mprsas_action_scsiio()
1930 __func__, targ->tid); in mprsas_action_scsiio()
1956 targ->is_nvme && in mprsas_action_scsiio()
1958 rc = mprsas_build_nvme_unmap(sc, cm, ccb, targ); in mprsas_action_scsiio()
1970 req->DevHandle = htole16(targ->handle); in mprsas_action_scsiio()
2056 SLIST_FOREACH(lun, &targ->luns, lun_link) { in mprsas_action_scsiio()
2118 cm->cm_targ = targ; in mprsas_action_scsiio()
2125 if (targ->scsi_req_desc_type == in mprsas_action_scsiio()
2132 htole16(targ->handle); in mprsas_action_scsiio()
2138 cm->cm_desc.SCSIIO.DevHandle = htole16(targ->handle); in mprsas_action_scsiio()
2145 targ->issued++; in mprsas_action_scsiio()
2146 targ->outstanding++; in mprsas_action_scsiio()
2147 TAILQ_INSERT_TAIL(&targ->commands, cm, cm_link); in mprsas_action_scsiio()
2151 __func__, cm, ccb, targ->outstanding); in mprsas_action_scsiio()
2162 Mpi2SCSIIOReply_t *mpi_reply, struct mprsas_target *targ) in mpr_sc_failed_io_info() argument
2184 if (targ->encl_level_valid) { in mpr_sc_failed_io_info()
2186 "connector name (%4s)\n", targ->encl_level, targ->encl_slot, in mpr_sc_failed_io_info()
2187 targ->connector_name); in mpr_sc_failed_io_info()
3089 struct mprsas_target *targ; in mprsas_action_smpio() local
3099 targ = &sassc->targets[ccb->ccb_h.target_id]; in mprsas_action_smpio()
3100 if (targ->handle == 0x0) { in mprsas_action_smpio()
3113 if ((targ->devinfo & MPI2_SAS_DEVICE_INFO_SMP_TARGET) != 0) in mprsas_action_smpio()
3114 sasaddr = targ->sasaddr; in mprsas_action_smpio()
3148 if (targ->parent_handle == 0x0) { in mprsas_action_smpio()
3150 "a valid parent handle!\n", __func__, targ->handle); in mprsas_action_smpio()
3156 targ->parent_handle); in mprsas_action_smpio()
3160 "a valid parent target!\n", __func__, targ->handle); in mprsas_action_smpio()
3169 targ->handle, parent_target->handle); in mprsas_action_smpio()
3176 if ((targ->parent_devinfo & in mprsas_action_smpio()
3180 targ->handle, targ->parent_handle); in mprsas_action_smpio()
3184 if (targ->parent_sasaddr == 0x0) { in mprsas_action_smpio()
3187 targ->handle, targ->parent_handle); in mprsas_action_smpio()
3192 sasaddr = targ->parent_sasaddr; in mprsas_action_smpio()
3198 "handle %d\n", __func__, targ->handle); in mprsas_action_smpio()
3217 struct mprsas_target *targ; in mprsas_action_resetdev() local
3234 targ = &sassc->targets[ccb->ccb_h.target_id]; in mprsas_action_resetdev()
3236 req->DevHandle = htole16(targ->handle); in mprsas_action_resetdev()
3239 if (!targ->is_nvme || sc->custom_nvme_tm_handling) { in mprsas_action_resetdev()
3253 __func__, targ->tid); in mprsas_action_resetdev()
3254 tm->cm_targ = targ; in mprsas_action_resetdev()
3256 mprsas_prepare_for_tm(sc, tm, targ, CAM_LUN_WILDCARD); in mprsas_action_resetdev()
3565 struct mprsas_target *targ; in mprsas_realloc_targets() local
3575 targ = &sassc->targets[i]; in mprsas_realloc_targets()
3576 SLIST_FOREACH_SAFE(lun, &targ->luns, lun_link, lun_tmp) { in mprsas_realloc_targets()