Lines Matching defs:tgt

112 static void qlt_clear_tgt_db(struct qla_tgt *tgt);
205 spin_lock_irqsave(&vha->hw->tgt.q_full_lock, flags);
207 vha->hw->tgt.num_pend_cmds++;
208 if (vha->hw->tgt.num_pend_cmds > vha->qla_stats.stat_max_pend_cmds)
210 vha->hw->tgt.num_pend_cmds;
211 spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
217 spin_lock_irqsave(&vha->hw->tgt.q_full_lock, flags);
218 vha->hw->tgt.num_pend_cmds--;
219 spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
227 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
230 if (tgt->tgt_stop) {
232 "qla_target(%d): dropping unknown ATIO_TYPE7, because tgt is being stopped",
264 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
283 } else if (tgt->tgt_stop) {
285 "Freeing unknown %s %p, because tgt is being stopped\n",
545 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
580 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
582 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
598 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
674 vha->hw->tgt.tgt_ops->put_sess(e->u.nack.fcport);
693 ha->tgt.tgt_ops->shutdown_sess(fcport);
694 ha->tgt.tgt_ops->put_sess(fcport);
706 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
710 if (!vha->hw->tgt.tgt_ops)
713 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
714 if (tgt->tgt_stop) {
715 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
720 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
725 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
731 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
734 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
742 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
754 ha->tgt.tgt_ops->update_sess(sess, fcport->d_id,
766 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
768 ha->tgt.tgt_ops->put_sess(sess);
950 struct qla_tgt *tgt = sess->tgt;
1037 ha->tgt.tgt_ops->free_session(sess);
1081 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
1084 if (tgt && !IS_SW_RESV_ADDR(sess->d_id))
1085 tgt->sess_count--;
1140 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
1154 if (tgt && (tgt->sess_count == 0))
1155 wake_up_all(&tgt->waitQ);
1159 (!tgt || !tgt->tgt_stop) && !LOOP_TRANSITION(vha)) {
1177 /* ha->tgt.sess_lock supposed to be held on entry */
1202 vha->hw->tgt.tgt_ops->clear_nacl_from_fcport_map(sess);
1225 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
1227 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
1229 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
1230 sess = ha->tgt.tgt_ops->find_sess_by_loop_id(vha, loop_id);
1231 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
1260 struct qla_tgt *tgt = sess->tgt;
1270 if (tgt && tgt->tgt_stop && tgt->sess_count == 0)
1271 wake_up_all(&tgt->waitQ);
1317 static void qlt_clear_tgt_db(struct qla_tgt *tgt)
1320 scsi_qla_host_t *vha = tgt->vha;
1327 /* At this point tgt could be already dead */
1402 sess->tgt = vha->vha_tgt.qla_tgt;
1415 if (ha->tgt.tgt_ops->check_initiator_node_acl(vha,
1425 * fc_port access across ->tgt.sess_lock reaquire.
1434 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
1439 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
1443 "Adding sess %p se_sess %p to tgt %p sess_count %d\n",
1464 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
1468 if (!vha->hw->tgt.tgt_ops)
1471 if (!tgt)
1474 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
1475 if (tgt->tgt_stop) {
1476 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
1480 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
1485 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
1497 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
1501 static inline int test_tgt_sess_count(struct qla_tgt *tgt)
1503 struct qla_hw_data *ha = tgt->ha;
1507 * We need to protect against race, when tgt is freed before or
1510 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
1511 ql_dbg(ql_dbg_tgt, tgt->vha, 0xe002,
1512 "tgt %p, sess_count=%d\n",
1513 tgt, tgt->sess_count);
1514 res = (tgt->sess_count == 0);
1515 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
1521 int qlt_stop_phase1(struct qla_tgt *tgt)
1523 struct scsi_qla_host *vha = tgt->vha;
1524 struct qla_hw_data *ha = tgt->ha;
1530 if (tgt->tgt_stop || tgt->tgt_stopped) {
1532 "Already in tgt->tgt_stop or tgt_stopped state\n");
1545 tgt->tgt_stop = 1;
1546 qlt_clear_tgt_db(tgt);
1551 "Waiting for sess works (tgt %p)", tgt);
1552 spin_lock_irqsave(&tgt->sess_work_lock, flags);
1554 spin_unlock_irqrestore(&tgt->sess_work_lock, flags);
1555 flush_work(&tgt->sess_work);
1556 spin_lock_irqsave(&tgt->sess_work_lock, flags);
1557 } while (!list_empty(&tgt->sess_works_list));
1558 spin_unlock_irqrestore(&tgt->sess_work_lock, flags);
1561 "Waiting for tgt %p: sess_count=%d\n", tgt, tgt->sess_count);
1563 wait_event_timeout(tgt->waitQ, test_tgt_sess_count(tgt), 10*HZ);
1571 wait_event_timeout(tgt->waitQ, test_tgt_sess_count(tgt), 10*HZ);
1579 void qlt_stop_phase2(struct qla_tgt *tgt)
1581 scsi_qla_host_t *vha = tgt->vha;
1583 if (tgt->tgt_stopped) {
1585 "Already in tgt->tgt_stopped state\n");
1589 if (!tgt->tgt_stop) {
1596 mutex_lock(&tgt->ha->optrom_mutex);
1598 tgt->tgt_stop = 0;
1599 tgt->tgt_stopped = 1;
1601 mutex_unlock(&tgt->ha->optrom_mutex);
1603 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf00c, "Stop of tgt %p finished\n",
1604 tgt);
1618 static void qlt_release(struct qla_tgt *tgt)
1620 scsi_qla_host_t *vha = tgt->vha;
1627 if (!tgt->tgt_stop && !tgt->tgt_stopped)
1628 qlt_stop_phase1(tgt);
1630 if (!tgt->tgt_stopped)
1631 qlt_stop_phase2(tgt);
1636 h = &tgt->qphints[i];
1644 kfree(tgt->qphints);
1649 btree_for_each_safe64(&tgt->lun_qpair_map, key, node)
1650 btree_remove64(&tgt->lun_qpair_map, key);
1652 btree_destroy64(&tgt->lun_qpair_map);
1655 if (ha->tgt.tgt_ops &&
1656 ha->tgt.tgt_ops->remove_target &&
1658 ha->tgt.tgt_ops->remove_target(vha);
1663 "Release of tgt %p finished\n", tgt);
1665 kfree(tgt);
1669 static int qlt_sched_sess_work(struct qla_tgt *tgt, int type,
1677 ql_dbg(ql_dbg_tgt_mgt, tgt->vha, 0xf050,
1683 ql_dbg(ql_dbg_tgt_mgt, tgt->vha, 0xf00e,
1685 " to find session for param %p (size %d, tgt %p)\n",
1686 type, prm, param, param_size, tgt);
1691 spin_lock_irqsave(&tgt->sess_work_lock, flags);
1692 list_add_tail(&prm->sess_works_list_entry, &tgt->sess_works_list);
1693 spin_unlock_irqrestore(&tgt->sess_work_lock, flags);
1695 schedule_work(&tgt->sess_work);
2043 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
2047 h = btree_lookup64(&tgt->lun_qpair_map, unpacked_lun);
2049 h = &tgt->qphints[0];
2051 h = &tgt->qphints[0];
2075 rc = ha->tgt.tgt_ops->handle_tmr(mcmd, mcmd->unpacked_lun,
2145 abort_cmd = ha->tgt.tgt_ops->find_cmd_by_tag(sess,
2205 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
2206 sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, s_id);
2211 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
2217 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
2385 ha->tgt.tgt_ops->free_mcmd(mcmd);
2423 ha->tgt.tgt_ops->free_mcmd(mcmd);
2785 prm->tgt = cmd->tgt;
2963 scsi_qla_host_t *vha = cmd->tgt->vha;
2984 t32 = ha->tgt.tgt_ops->get_dif_tags(cmd, pfw_prot_opts);
3007 !(ha->tgt.tgt_ops->chk_dif_tags(t32))) {
3024 !(ha->tgt.tgt_ops->chk_dif_tags(t32))) {
3415 struct qla_tgt *tgt = cmd->tgt;
3423 prm.tgt = tgt;
3436 vha->hw->tgt.tgt_ops->handle_data(cmd);
3575 vha->hw->tgt.tgt_ops->handle_data(cmd);
3581 vha->hw->tgt.tgt_ops->free_cmd(cmd);
3591 vha->hw->tgt.tgt_ops->free_cmd(cmd);
3750 vha->hw->tgt.tgt_ops->free_cmd(cmd);
3764 vha->hw->tgt.leak_exchg_thresh_hold =
3768 if (!list_empty(&vha->hw->tgt.q_full_list)) {
3770 list_splice_init(&vha->hw->tgt.q_full_list, &free_list);
3778 vha->hw->tgt.num_qfull_cmds_alloc--;
3781 vha->hw->tgt.num_qfull_cmds_dropped = 0;
3788 total_leaked = vha->hw->tgt.num_qfull_cmds_dropped;
3790 if (vha->hw->tgt.leak_exchg_thresh_hold &&
3791 (total_leaked > vha->hw->tgt.leak_exchg_thresh_hold)) {
3808 struct qla_tgt *tgt = cmd->tgt;
3809 struct scsi_qla_host *vha = tgt->vha;
3866 cmd->vha->hw->tgt.tgt_ops->rel_cmd(cmd);
4097 ha->tgt.tgt_ops->handle_data(cmd);
4116 ha->tgt.tgt_ops->free_cmd(cmd);
4195 ret = ha->tgt.tgt_ops->handle_cmd(vha, cmd, cdb, data_length,
4202 ha->tgt.tgt_ops->put_sess(sess);
4216 cmd->vha->hw->tgt.tgt_ops->rel_cmd(cmd);
4219 ha->tgt.tgt_ops->put_sess(sess);
4239 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
4245 ha->tgt.num_act_qpairs);
4247 spin_lock_irqsave(&ha->tgt.atio_lock, flags);
4249 btree_for_each_safe64(&tgt->lun_qpair_map, key, node)
4250 btree_remove64(&tgt->lun_qpair_map, key);
4257 spin_unlock_irqrestore(&ha->tgt.atio_lock, flags);
4264 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
4268 h = btree_lookup64(&tgt->lun_qpair_map, cmd->unpacked_lun);
4278 h = qla_qpair_to_hint(tgt, qpair);
4280 rc = btree_insert64(&tgt->lun_qpair_map,
4298 h = qla_qpair_to_hint(tgt, qp);
4300 rc = btree_insert64(&tgt->lun_qpair_map,
4320 h = qla_qpair_to_hint(tgt, qpair);
4322 rc = btree_insert64(&tgt->lun_qpair_map,
4332 h = &tgt->qphints[0];
4345 cmd = vha->hw->tgt.tgt_ops->get_cmd(sess);
4353 cmd->tgt = vha->vha_tgt.qla_tgt;
4378 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
4384 if (unlikely(tgt->tgt_stop)) {
4386 "New command while device %p is shutting down\n", tgt);
4394 sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, atio->u.isp24.fcp_hdr.s_id);
4422 ha->tgt.tgt_ops->put_sess(sess);
4522 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
4523 sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha,
4525 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
4565 rc = ha->tgt.tgt_ops->handle_tmr(mcmd, unpacked_lun, mcmd->tmr_func,
4589 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
4590 sess = ha->tgt.tgt_ops->find_sess_by_loop_id(vha, loop_id);
4591 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
4623 * ha->hardware_lock supposed to be held on entry (to protect tgt->sess_list)
4757 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
4760 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
4952 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
5024 spin_lock_irqsave(&tgt->ha->tgt.sess_lock, flags);
5027 spin_unlock_irqrestore(&tgt->ha->tgt.sess_lock, flags);
5061 spin_lock_irqsave(&tgt->ha->tgt.sess_lock, flags);
5074 spin_unlock_irqrestore(&tgt->ha->tgt.sess_lock,
5100 spin_unlock_irqrestore(&tgt->ha->tgt.sess_lock,
5136 spin_unlock_irqrestore(&tgt->ha->tgt.sess_lock, flags);
5177 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
5179 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
5212 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
5214 if (tgt->link_reinit_iocb_pending) {
5216 &tgt->link_reinit_iocb, 0, 0, 0, 0, 0, 0);
5217 tgt->link_reinit_iocb_pending = 0;
5279 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
5286 if (tgt->link_reinit_iocb_pending) {
5288 &tgt->link_reinit_iocb, 0, 0, 0, 0, 0, 0);
5290 memcpy(&tgt->link_reinit_iocb, iocb, sizeof(*iocb));
5291 tgt->link_reinit_iocb_pending = 1;
5402 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
5404 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
5465 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
5471 if (unlikely(tgt->tgt_stop)) {
5473 "New command while device %p is shutting down\n", tgt);
5477 if ((vha->hw->tgt.num_qfull_cmds_alloc + 1) > MAX_QFULL_CMDS_ALLOC) {
5478 vha->hw->tgt.num_qfull_cmds_dropped++;
5479 if (vha->hw->tgt.num_qfull_cmds_dropped >
5482 vha->hw->tgt.num_qfull_cmds_dropped;
5487 vha->hw->tgt.num_qfull_cmds_dropped);
5493 sess = ha->tgt.tgt_ops->find_sess_by_s_id
5498 cmd = ha->tgt.tgt_ops->get_cmd(sess);
5504 vha->hw->tgt.num_qfull_cmds_dropped++;
5505 if (vha->hw->tgt.num_qfull_cmds_dropped >
5508 vha->hw->tgt.num_qfull_cmds_dropped;
5518 cmd->tgt = vha->vha_tgt.qla_tgt;
5531 spin_lock_irqsave(&vha->hw->tgt.q_full_lock, flags);
5532 list_add_tail(&cmd->cmd_list, &vha->hw->tgt.q_full_list);
5534 vha->hw->tgt.num_qfull_cmds_alloc++;
5535 if (vha->hw->tgt.num_qfull_cmds_alloc >
5538 vha->hw->tgt.num_qfull_cmds_alloc;
5539 spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
5552 if (list_empty(&ha->tgt.q_full_list))
5558 spin_lock_irqsave(&vha->hw->tgt.q_full_lock, flags);
5559 if (list_empty(&ha->tgt.q_full_list)) {
5560 spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
5564 list_splice_init(&vha->hw->tgt.q_full_list, &q_full_list);
5565 spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
5594 vha->hw->tgt.num_qfull_cmds_alloc--;
5609 spin_lock_irqsave(&vha->hw->tgt.q_full_lock, flags);
5610 list_splice(&q_full_list, &vha->hw->tgt.q_full_list);
5611 spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
5636 if (ha->tgt.num_pend_cmds < Q_FULL_THRESH_HOLD(ha))
5654 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
5658 if (unlikely(tgt == NULL)) {
5660 "ATIO pkt, but no tgt (ha %p)", ha);
5668 tgt->atio_irq_cmd_count++;
5691 tgt->atio_irq_cmd_count--;
5760 tgt->atio_irq_cmd_count--;
5839 ha->tgt.tgt_ops->free_mcmd(mcmd);
5850 ha->tgt.tgt_ops->free_mcmd(mcmd);
5853 ha->tgt.tgt_ops->free_mcmd(mcmd);
5862 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
5864 if (unlikely(tgt == NULL)) {
5866 "qla_target(%d): Response pkt %x received, but no tgt (ha %p)\n",
5964 if (tgt->notify_ack_expected > 0) {
5971 tgt->notify_ack_expected--;
5993 if (tgt->abts_resp_expected > 0) {
6018 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
6021 if (!tgt || tgt->tgt_stop || tgt->tgt_stopped)
6052 if (tgt->link_reinit_iocb_pending) {
6054 &tgt->link_reinit_iocb,
6056 tgt->link_reinit_iocb_pending = 0;
6147 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
6173 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
6270 static void qlt_abort_work(struct qla_tgt *tgt,
6273 struct scsi_qla_host *vha = tgt->vha;
6280 spin_lock_irqsave(&ha->tgt.sess_lock, flags2);
6282 if (tgt->tgt_stop)
6287 sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, s_id);
6289 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags2);
6294 spin_lock_irqsave(&ha->tgt.sess_lock, flags2);
6313 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags2);
6315 ha->tgt.tgt_ops->put_sess(sess);
6322 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags2);
6333 struct qla_tgt *tgt = container_of(work, struct qla_tgt, sess_work);
6334 struct scsi_qla_host *vha = tgt->vha;
6337 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf000, "Sess work (tgt %p)", tgt);
6339 spin_lock_irqsave(&tgt->sess_work_lock, flags);
6340 while (!list_empty(&tgt->sess_works_list)) {
6342 tgt->sess_works_list.next, typeof(*prm),
6351 spin_unlock_irqrestore(&tgt->sess_work_lock, flags);
6355 qlt_abort_work(tgt, prm);
6362 spin_lock_irqsave(&tgt->sess_work_lock, flags);
6366 spin_unlock_irqrestore(&tgt->sess_work_lock, flags);
6372 struct qla_tgt *tgt;
6390 tgt = kzalloc(sizeof(struct qla_tgt), GFP_KERNEL);
6391 if (!tgt) {
6397 tgt->qphints = kcalloc(ha->max_qpairs + 1,
6400 if (!tgt->qphints) {
6401 kfree(tgt);
6409 rc = btree_init64(&tgt->lun_qpair_map);
6411 kfree(tgt->qphints);
6412 kfree(tgt);
6417 h = &tgt->qphints[0];
6428 h = &tgt->qphints[i + 1];
6439 tgt->ha = ha;
6440 tgt->vha = base_vha;
6441 init_waitqueue_head(&tgt->waitQ);
6442 spin_lock_init(&tgt->sess_work_lock);
6443 INIT_WORK(&tgt->sess_work, qlt_sess_work_fn);
6444 INIT_LIST_HEAD(&tgt->sess_works_list);
6445 atomic_set(&tgt->tgt_global_resets_count, 0);
6447 base_vha->vha_tgt.qla_tgt = tgt;
6453 tgt->sg_tablesize = QLA_TGT_MAX_SG_24XX(base_vha->req->length - 3);
6456 list_add_tail(&tgt->tgt_list_entry, &qla_tgt_glist);
6459 if (ha->tgt.tgt_ops && ha->tgt.tgt_ops->add_target)
6460 ha->tgt.tgt_ops->add_target(base_vha);
6519 struct qla_tgt *tgt;
6528 list_for_each_entry(tgt, &qla_tgt_glist, tgt_list_entry) {
6529 vha = tgt->vha;
6549 if (tgt->tgt_stop) {
6595 ha->tgt.tgt_ops = NULL;
6650 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
6654 if (!tgt) {
6664 if (ha->tgt.num_act_qpairs > ha->max_qpairs)
6665 ha->tgt.num_act_qpairs = ha->max_qpairs;
6667 tgt->tgt_stopped = 0;
6695 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
6698 if (!tgt) {
6746 ha->tgt.atio_q_length = ATIO_ENTRY_CNT_24XX;
6782 struct atio_from_isp *pkt = (struct atio_from_isp *)ha->tgt.atio_ring;
6787 for (cnt = 0; cnt < ha->tgt.atio_q_length; cnt++) {
6808 while ((ha->tgt.atio_ring_ptr->signature != ATIO_PROCESSED) ||
6809 fcpcmd_is_corrupted(ha->tgt.atio_ring_ptr)) {
6810 pkt = (struct atio_from_isp *)ha->tgt.atio_ring_ptr;
6813 if (unlikely(fcpcmd_is_corrupted(ha->tgt.atio_ring_ptr))) {
6834 ha->tgt.atio_ring_index++;
6835 if (ha->tgt.atio_ring_index == ha->tgt.atio_q_length) {
6836 ha->tgt.atio_ring_index = 0;
6837 ha->tgt.atio_ring_ptr = ha->tgt.atio_ring;
6839 ha->tgt.atio_ring_ptr++;
6842 pkt = (struct atio_from_isp *)ha->tgt.atio_ring_ptr;
6848 wrt_reg_dword(ISP_ATIO_Q_OUT(vha), ha->tgt.atio_ring_index);
6894 if (!ha->tgt.saved_set) {
6896 ha->tgt.saved_exchange_count = nv->exchange_count;
6897 ha->tgt.saved_firmware_options_1 =
6899 ha->tgt.saved_firmware_options_2 =
6901 ha->tgt.saved_firmware_options_3 =
6903 ha->tgt.saved_set = 1;
6949 if (ha->tgt.saved_set) {
6950 nv->exchange_count = ha->tgt.saved_exchange_count;
6952 ha->tgt.saved_firmware_options_1;
6954 ha->tgt.saved_firmware_options_2;
6956 ha->tgt.saved_firmware_options_3;
6984 if (ha->tgt.node_name_set) {
6985 memcpy(icb->node_name, ha->tgt.tgt_node_name, WWN_SIZE);
7000 if (!ha->tgt.saved_set) {
7002 ha->tgt.saved_exchange_count = nv->exchange_count;
7003 ha->tgt.saved_firmware_options_1 =
7005 ha->tgt.saved_firmware_options_2 =
7007 ha->tgt.saved_firmware_options_3 =
7009 ha->tgt.saved_set = 1;
7052 if (ha->tgt.saved_set) {
7053 nv->exchange_count = ha->tgt.saved_exchange_count;
7055 ha->tgt.saved_firmware_options_1;
7057 ha->tgt.saved_firmware_options_2;
7059 ha->tgt.saved_firmware_options_3;
7087 if (ha->tgt.node_name_set) {
7088 memcpy(icb->node_name, ha->tgt.tgt_node_name, WWN_SIZE);
7154 spin_lock_irqsave(&ha->tgt.atio_lock, flags);
7158 spin_unlock_irqrestore(&ha->tgt.atio_lock, flags);
7176 spin_lock_irqsave(&ha->tgt.atio_lock, flags);
7178 spin_unlock_irqrestore(&ha->tgt.atio_lock, flags);
7218 ha->tgt.atio_ring = dma_alloc_coherent(&ha->pdev->dev,
7219 (ha->tgt.atio_q_length + 1) * sizeof(struct atio_from_isp),
7220 &ha->tgt.atio_dma, GFP_KERNEL);
7221 if (!ha->tgt.atio_ring) {
7233 if (ha->tgt.atio_ring) {
7234 dma_free_coherent(&ha->pdev->dev, (ha->tgt.atio_q_length + 1) *
7235 sizeof(struct atio_from_isp), ha->tgt.atio_ring,
7236 ha->tgt.atio_dma);
7238 ha->tgt.atio_ring = NULL;
7239 ha->tgt.atio_dma = 0;