Lines Matching refs:tgt

52 static void pmcs_flush_nonio_cmds(pmcs_hw_t *pwp, pmcs_xscsi_t *tgt);
1167 pmcs_xscsi_t *tgt;
1218 tgt = pptr->target;
1219 if (tgt != NULL) {
1220 pmcs_prt(pwp, PMCS_PRT_DEBUG_CONFIG, pptr, tgt,
1222 __func__, (void *) tgt);
1223 mutex_enter(&tgt->statlock);
1224 pmcs_clear_xp(pwp, tgt);
1225 mutex_exit(&tgt->statlock);
2792 /* No iport for this tgt */
3331 "%s: Not assigning existing tgt %p for PHY %p "
4597 "%s: %s has tgt support=%x init support=(%x)",
4646 "%s has tgt support=%x init support=(%x)",
4875 pmcs_xscsi_t *tgt;
4969 tgt = pptr->target;
4978 pmcs_prt(pwp, PMCS_PRT_DEBUG, pptr, tgt,
4981 pmcs_prt(pwp, PMCS_PRT_DEBUG, pptr, tgt,
4985 if (tgt != NULL) {
4986 mutex_enter(&tgt->statlock);
4987 if ((tgt->dev_state != PMCS_DEVICE_STATE_IN_RECOVERY) &&
4988 (tgt->dev_state !=
4990 pmcs_prt(pwp, PMCS_PRT_DEBUG, pptr, tgt,
4991 "%s: Trying DS error recovery for tgt 0x%p",
4992 __func__, (void *)tgt);
4994 PMCS_DEVICE_STATE_IN_RECOVERY, pptr, tgt);
4996 mutex_exit(&tgt->statlock);
5015 pmcs_prt(pwp, PMCS_PRT_DEBUG, pptr, tgt,
5027 if (tgt != NULL) {
5028 mutex_enter(&tgt->statlock);
5029 if (tgt->dev_state == PMCS_DEVICE_STATE_IN_RECOVERY) {
5030 pmcs_prt(pwp, PMCS_PRT_DEBUG, pptr, tgt,
5031 "%s: Restoring OPERATIONAL dev_state for tgt 0x%p",
5032 __func__, (void *)tgt);
5034 PMCS_DEVICE_STATE_OPERATIONAL, pptr, tgt);
5036 mutex_exit(&tgt->statlock);
5170 " for tgt 0x%p (status = %s)",
5186 " for tgt 0x%p (status = %s)",
5283 pmcs_xscsi_t *tgt;
5327 tgt = pptr->target;
5329 pmcs_prt(pwp, PMCS_PRT_DEBUG, pptr, tgt, pmcs_timeo, __func__);
5334 if (tgt == NULL) {
5335 pmcs_prt(pwp, PMCS_PRT_DEBUG, pptr, tgt,
5341 mutex_enter(&tgt->statlock);
5351 if (tgt->dev_state != ds) {
5352 pmcs_prt(pwp, PMCS_PRT_DEBUG, pptr, tgt, "%s: Trying "
5353 "SATA DS Recovery for tgt(0x%p) for status(%s)",
5354 __func__, (void *)tgt, pmcs_status_str(status));
5355 (void) pmcs_send_err_recovery_cmd(pwp, ds, pptr, tgt);
5358 mutex_exit(&tgt->statlock);
5367 pmcs_prt(pwp, PMCS_PRT_DEBUG, pptr, tgt,
5370 pmcs_prt(pwp, PMCS_PRT_DEBUG, pptr, tgt,
6976 pmcs_flush_target_queues(pmcs_hw_t *pwp, pmcs_xscsi_t *tgt, uint8_t queues)
6982 ASSERT(tgt != NULL);
6984 pmcs_prt(pwp, PMCS_PRT_DEBUG, NULL, tgt,
6986 queues, (void *)tgt);
6993 mutex_enter(&tgt->wqlock);
6994 while ((sp = STAILQ_FIRST(&tgt->wq)) != NULL) {
6995 STAILQ_REMOVE(&tgt->wq, sp, pmcs_cmd, cmd_next);
6996 pmcs_prt(pwp, PMCS_PRT_DEBUG1, NULL, tgt,
6998 __func__, (void *)sp, (void *)tgt);
7001 mutex_exit(&tgt->wqlock);
7007 mutex_enter(&tgt->wqlock);
7009 mutex_exit(&tgt->wqlock);
7017 mutex_exit(&tgt->statlock);
7018 mutex_enter(&tgt->aqlock);
7019 sp = STAILQ_FIRST(&tgt->aq);
7030 pmcs_prt(pwp, PMCS_PRT_DEBUG1, tgt->phy, tgt,
7038 STAILQ_REMOVE(&tgt->aq, sp, pmcs_cmd, cmd_next);
7039 pmcs_prt(pwp, PMCS_PRT_DEBUG1, tgt->phy, tgt,
7042 (void *)tgt);
7043 mutex_exit(&tgt->aqlock);
7056 mutex_enter(&tgt->aqlock);
7059 mutex_exit(&tgt->aqlock);
7060 mutex_enter(&tgt->statlock);
7064 while ((sp = STAILQ_FIRST(&tgt->sq)) != NULL) {
7065 STAILQ_REMOVE(&tgt->sq, sp, pmcs_cmd, cmd_next);
7066 pmcs_prt(pwp, PMCS_PRT_DEBUG1, tgt->phy, tgt,
7068 __func__, (void *)sp, (void *)tgt);
7079 mutex_exit(&tgt->statlock);
7080 pmcs_flush_nonio_cmds(pwp, tgt);
7081 mutex_enter(&tgt->statlock);
7090 pmcs_flush_nonio_cmds(pmcs_hw_t *pwp, pmcs_xscsi_t *tgt)
7098 if (p->xp != tgt) {
7220 "%s: no iport associated with tgt(0x%p)",
8060 pmcs_xscsi_t *tgt;
8099 tgt = *phyp->target_addr;
8101 tgt = phyp->target;
8106 mutex_enter(&tgt->statlock);
8107 if (!list_is_empty(&tgt->lun_list)) {
8110 lunp = list_head(&tgt->lun_list);
8120 lunp = list_next(&tgt->lun_list, lunp);
8122 } else if (tgt->smpd) {
8123 (void) smp_device_prop_update_string(tgt->smpd,
8126 (void) smp_device_prop_update_string(tgt->smpd,
8130 mutex_exit(&tgt->statlock);