Lines Matching refs: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);
1071 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
1074 if (tgt && !IS_SW_RESV_ADDR(sess->d_id))
1075 tgt->sess_count--;
1130 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
1144 if (tgt && (tgt->sess_count == 0))
1145 wake_up_all(&tgt->waitQ);
1149 (!tgt || !tgt->tgt_stop) && !LOOP_TRANSITION(vha)) {
1167 /* ha->tgt.sess_lock supposed to be held on entry */
1192 vha->hw->tgt.tgt_ops->clear_nacl_from_fcport_map(sess);
1215 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
1217 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
1219 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
1220 sess = ha->tgt.tgt_ops->find_sess_by_loop_id(vha, loop_id);
1221 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
1250 struct qla_tgt *tgt = sess->tgt;
1260 if (tgt && tgt->tgt_stop && tgt->sess_count == 0)
1261 wake_up_all(&tgt->waitQ);
1307 static void qlt_clear_tgt_db(struct qla_tgt *tgt)
1310 scsi_qla_host_t *vha = tgt->vha;
1317 /* At this point tgt could be already dead */
1392 sess->tgt = vha->vha_tgt.qla_tgt;
1405 if (ha->tgt.tgt_ops->check_initiator_node_acl(vha,
1415 * fc_port access across ->tgt.sess_lock reaquire.
1424 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
1429 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
1433 "Adding sess %p se_sess %p to tgt %p sess_count %d\n",
1454 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
1458 if (!vha->hw->tgt.tgt_ops)
1461 if (!tgt)
1464 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
1465 if (tgt->tgt_stop) {
1466 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
1470 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
1475 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
1487 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
1491 static inline int test_tgt_sess_count(struct qla_tgt *tgt)
1493 struct qla_hw_data *ha = tgt->ha;
1497 * We need to protect against race, when tgt is freed before or
1500 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
1501 ql_dbg(ql_dbg_tgt, tgt->vha, 0xe002,
1502 "tgt %p, sess_count=%d\n",
1503 tgt, tgt->sess_count);
1504 res = (tgt->sess_count == 0);
1505 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
1511 int qlt_stop_phase1(struct qla_tgt *tgt)
1513 struct scsi_qla_host *vha = tgt->vha;
1514 struct qla_hw_data *ha = tgt->ha;
1520 if (tgt->tgt_stop || tgt->tgt_stopped) {
1522 "Already in tgt->tgt_stop or tgt_stopped state\n");
1535 tgt->tgt_stop = 1;
1536 qlt_clear_tgt_db(tgt);
1541 "Waiting for sess works (tgt %p)", tgt);
1542 spin_lock_irqsave(&tgt->sess_work_lock, flags);
1544 spin_unlock_irqrestore(&tgt->sess_work_lock, flags);
1545 flush_work(&tgt->sess_work);
1546 spin_lock_irqsave(&tgt->sess_work_lock, flags);
1547 } while (!list_empty(&tgt->sess_works_list));
1548 spin_unlock_irqrestore(&tgt->sess_work_lock, flags);
1551 "Waiting for tgt %p: sess_count=%d\n", tgt, tgt->sess_count);
1553 wait_event_timeout(tgt->waitQ, test_tgt_sess_count(tgt), 10*HZ);
1561 wait_event_timeout(tgt->waitQ, test_tgt_sess_count(tgt), 10*HZ);
1569 void qlt_stop_phase2(struct qla_tgt *tgt)
1571 scsi_qla_host_t *vha = tgt->vha;
1573 if (tgt->tgt_stopped) {
1575 "Already in tgt->tgt_stopped state\n");
1579 if (!tgt->tgt_stop) {
1586 mutex_lock(&tgt->ha->optrom_mutex);
1588 tgt->tgt_stop = 0;
1589 tgt->tgt_stopped = 1;
1591 mutex_unlock(&tgt->ha->optrom_mutex);
1593 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf00c, "Stop of tgt %p finished\n",
1594 tgt);
1608 static void qlt_release(struct qla_tgt *tgt)
1610 scsi_qla_host_t *vha = tgt->vha;
1617 if (!tgt->tgt_stop && !tgt->tgt_stopped)
1618 qlt_stop_phase1(tgt);
1620 if (!tgt->tgt_stopped)
1621 qlt_stop_phase2(tgt);
1626 h = &tgt->qphints[i];
1634 kfree(tgt->qphints);
1639 btree_for_each_safe64(&tgt->lun_qpair_map, key, node)
1640 btree_remove64(&tgt->lun_qpair_map, key);
1642 btree_destroy64(&tgt->lun_qpair_map);
1645 if (ha->tgt.tgt_ops &&
1646 ha->tgt.tgt_ops->remove_target &&
1648 ha->tgt.tgt_ops->remove_target(vha);
1653 "Release of tgt %p finished\n", tgt);
1655 kfree(tgt);
1659 static int qlt_sched_sess_work(struct qla_tgt *tgt, int type,
1667 ql_dbg(ql_dbg_tgt_mgt, tgt->vha, 0xf050,
1673 ql_dbg(ql_dbg_tgt_mgt, tgt->vha, 0xf00e,
1675 " to find session for param %p (size %d, tgt %p)\n",
1676 type, prm, param, param_size, tgt);
1681 spin_lock_irqsave(&tgt->sess_work_lock, flags);
1682 list_add_tail(&prm->sess_works_list_entry, &tgt->sess_works_list);
1683 spin_unlock_irqrestore(&tgt->sess_work_lock, flags);
1685 schedule_work(&tgt->sess_work);
2033 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
2037 h = btree_lookup64(&tgt->lun_qpair_map, unpacked_lun);
2039 h = &tgt->qphints[0];
2041 h = &tgt->qphints[0];
2065 rc = ha->tgt.tgt_ops->handle_tmr(mcmd, mcmd->unpacked_lun,
2135 abort_cmd = ha->tgt.tgt_ops->find_cmd_by_tag(sess,
2195 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
2196 sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, s_id);
2201 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
2207 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
2375 ha->tgt.tgt_ops->free_mcmd(mcmd);
2413 ha->tgt.tgt_ops->free_mcmd(mcmd);
2775 prm->tgt = cmd->tgt;
2953 scsi_qla_host_t *vha = cmd->tgt->vha;
2974 t32 = ha->tgt.tgt_ops->get_dif_tags(cmd, pfw_prot_opts);
2997 !(ha->tgt.tgt_ops->chk_dif_tags(t32))) {
3014 !(ha->tgt.tgt_ops->chk_dif_tags(t32))) {
3405 struct qla_tgt *tgt = cmd->tgt;
3413 prm.tgt = tgt;
3426 vha->hw->tgt.tgt_ops->handle_data(cmd);
3565 vha->hw->tgt.tgt_ops->handle_data(cmd);
3571 vha->hw->tgt.tgt_ops->free_cmd(cmd);
3581 vha->hw->tgt.tgt_ops->free_cmd(cmd);
3740 vha->hw->tgt.tgt_ops->free_cmd(cmd);
3754 vha->hw->tgt.leak_exchg_thresh_hold =
3758 if (!list_empty(&vha->hw->tgt.q_full_list)) {
3760 list_splice_init(&vha->hw->tgt.q_full_list, &free_list);
3768 vha->hw->tgt.num_qfull_cmds_alloc--;
3771 vha->hw->tgt.num_qfull_cmds_dropped = 0;
3778 total_leaked = vha->hw->tgt.num_qfull_cmds_dropped;
3780 if (vha->hw->tgt.leak_exchg_thresh_hold &&
3781 (total_leaked > vha->hw->tgt.leak_exchg_thresh_hold)) {
3798 struct qla_tgt *tgt = cmd->tgt;
3799 struct scsi_qla_host *vha = tgt->vha;
3856 cmd->vha->hw->tgt.tgt_ops->rel_cmd(cmd);
4087 ha->tgt.tgt_ops->handle_data(cmd);
4106 ha->tgt.tgt_ops->free_cmd(cmd);
4185 ret = ha->tgt.tgt_ops->handle_cmd(vha, cmd, cdb, data_length,
4192 ha->tgt.tgt_ops->put_sess(sess);
4206 cmd->vha->hw->tgt.tgt_ops->rel_cmd(cmd);
4209 ha->tgt.tgt_ops->put_sess(sess);
4229 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
4235 ha->tgt.num_act_qpairs);
4237 spin_lock_irqsave(&ha->tgt.atio_lock, flags);
4239 btree_for_each_safe64(&tgt->lun_qpair_map, key, node)
4240 btree_remove64(&tgt->lun_qpair_map, key);
4247 spin_unlock_irqrestore(&ha->tgt.atio_lock, flags);
4254 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
4258 h = btree_lookup64(&tgt->lun_qpair_map, cmd->unpacked_lun);
4268 h = qla_qpair_to_hint(tgt, qpair);
4270 rc = btree_insert64(&tgt->lun_qpair_map,
4288 h = qla_qpair_to_hint(tgt, qp);
4290 rc = btree_insert64(&tgt->lun_qpair_map,
4310 h = qla_qpair_to_hint(tgt, qpair);
4312 rc = btree_insert64(&tgt->lun_qpair_map,
4322 h = &tgt->qphints[0];
4335 cmd = vha->hw->tgt.tgt_ops->get_cmd(sess);
4343 cmd->tgt = vha->vha_tgt.qla_tgt;
4368 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
4374 if (unlikely(tgt->tgt_stop)) {
4376 "New command while device %p is shutting down\n", tgt);
4384 sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, atio->u.isp24.fcp_hdr.s_id);
4412 ha->tgt.tgt_ops->put_sess(sess);
4512 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
4513 sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha,
4515 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
4555 rc = ha->tgt.tgt_ops->handle_tmr(mcmd, unpacked_lun, mcmd->tmr_func,
4579 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
4580 sess = ha->tgt.tgt_ops->find_sess_by_loop_id(vha, loop_id);
4581 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
4613 * ha->hardware_lock supposed to be held on entry (to protect tgt->sess_list)
4747 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
4750 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
4942 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
5014 spin_lock_irqsave(&tgt->ha->tgt.sess_lock, flags);
5017 spin_unlock_irqrestore(&tgt->ha->tgt.sess_lock, flags);
5051 spin_lock_irqsave(&tgt->ha->tgt.sess_lock, flags);
5064 spin_unlock_irqrestore(&tgt->ha->tgt.sess_lock,
5090 spin_unlock_irqrestore(&tgt->ha->tgt.sess_lock,
5126 spin_unlock_irqrestore(&tgt->ha->tgt.sess_lock, flags);
5167 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
5169 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
5202 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
5204 if (tgt->link_reinit_iocb_pending) {
5206 &tgt->link_reinit_iocb, 0, 0, 0, 0, 0, 0);
5207 tgt->link_reinit_iocb_pending = 0;
5269 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
5276 if (tgt->link_reinit_iocb_pending) {
5278 &tgt->link_reinit_iocb, 0, 0, 0, 0, 0, 0);
5280 memcpy(&tgt->link_reinit_iocb, iocb, sizeof(*iocb));
5281 tgt->link_reinit_iocb_pending = 1;
5392 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
5394 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
5455 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
5461 if (unlikely(tgt->tgt_stop)) {
5463 "New command while device %p is shutting down\n", tgt);
5467 if ((vha->hw->tgt.num_qfull_cmds_alloc + 1) > MAX_QFULL_CMDS_ALLOC) {
5468 vha->hw->tgt.num_qfull_cmds_dropped++;
5469 if (vha->hw->tgt.num_qfull_cmds_dropped >
5472 vha->hw->tgt.num_qfull_cmds_dropped;
5477 vha->hw->tgt.num_qfull_cmds_dropped);
5483 sess = ha->tgt.tgt_ops->find_sess_by_s_id
5488 cmd = ha->tgt.tgt_ops->get_cmd(sess);
5494 vha->hw->tgt.num_qfull_cmds_dropped++;
5495 if (vha->hw->tgt.num_qfull_cmds_dropped >
5498 vha->hw->tgt.num_qfull_cmds_dropped;
5508 cmd->tgt = vha->vha_tgt.qla_tgt;
5521 spin_lock_irqsave(&vha->hw->tgt.q_full_lock, flags);
5522 list_add_tail(&cmd->cmd_list, &vha->hw->tgt.q_full_list);
5524 vha->hw->tgt.num_qfull_cmds_alloc++;
5525 if (vha->hw->tgt.num_qfull_cmds_alloc >
5528 vha->hw->tgt.num_qfull_cmds_alloc;
5529 spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
5542 if (list_empty(&ha->tgt.q_full_list))
5548 spin_lock_irqsave(&vha->hw->tgt.q_full_lock, flags);
5549 if (list_empty(&ha->tgt.q_full_list)) {
5550 spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
5554 list_splice_init(&vha->hw->tgt.q_full_list, &q_full_list);
5555 spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
5584 vha->hw->tgt.num_qfull_cmds_alloc--;
5599 spin_lock_irqsave(&vha->hw->tgt.q_full_lock, flags);
5600 list_splice(&q_full_list, &vha->hw->tgt.q_full_list);
5601 spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
5626 if (ha->tgt.num_pend_cmds < Q_FULL_THRESH_HOLD(ha))
5644 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
5648 if (unlikely(tgt == NULL)) {
5650 "ATIO pkt, but no tgt (ha %p)", ha);
5658 tgt->atio_irq_cmd_count++;
5681 tgt->atio_irq_cmd_count--;
5750 tgt->atio_irq_cmd_count--;
5829 ha->tgt.tgt_ops->free_mcmd(mcmd);
5840 ha->tgt.tgt_ops->free_mcmd(mcmd);
5843 ha->tgt.tgt_ops->free_mcmd(mcmd);
5852 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
5854 if (unlikely(tgt == NULL)) {
5856 "qla_target(%d): Response pkt %x received, but no tgt (ha %p)\n",
5954 if (tgt->notify_ack_expected > 0) {
5961 tgt->notify_ack_expected--;
5983 if (tgt->abts_resp_expected > 0) {
6008 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
6011 if (!tgt || tgt->tgt_stop || tgt->tgt_stopped)
6042 if (tgt->link_reinit_iocb_pending) {
6044 &tgt->link_reinit_iocb,
6046 tgt->link_reinit_iocb_pending = 0;
6137 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
6163 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
6260 static void qlt_abort_work(struct qla_tgt *tgt,
6263 struct scsi_qla_host *vha = tgt->vha;
6270 spin_lock_irqsave(&ha->tgt.sess_lock, flags2);
6272 if (tgt->tgt_stop)
6277 sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, s_id);
6279 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags2);
6284 spin_lock_irqsave(&ha->tgt.sess_lock, flags2);
6303 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags2);
6305 ha->tgt.tgt_ops->put_sess(sess);
6312 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags2);
6323 struct qla_tgt *tgt = container_of(work, struct qla_tgt, sess_work);
6324 struct scsi_qla_host *vha = tgt->vha;
6327 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf000, "Sess work (tgt %p)", tgt);
6329 spin_lock_irqsave(&tgt->sess_work_lock, flags);
6330 while (!list_empty(&tgt->sess_works_list)) {
6332 tgt->sess_works_list.next, typeof(*prm),
6341 spin_unlock_irqrestore(&tgt->sess_work_lock, flags);
6345 qlt_abort_work(tgt, prm);
6352 spin_lock_irqsave(&tgt->sess_work_lock, flags);
6356 spin_unlock_irqrestore(&tgt->sess_work_lock, flags);
6362 struct qla_tgt *tgt;
6380 tgt = kzalloc(sizeof(struct qla_tgt), GFP_KERNEL);
6381 if (!tgt) {
6387 tgt->qphints = kcalloc(ha->max_qpairs + 1,
6390 if (!tgt->qphints) {
6391 kfree(tgt);
6399 rc = btree_init64(&tgt->lun_qpair_map);
6401 kfree(tgt->qphints);
6402 kfree(tgt);
6407 h = &tgt->qphints[0];
6418 h = &tgt->qphints[i + 1];
6429 tgt->ha = ha;
6430 tgt->vha = base_vha;
6431 init_waitqueue_head(&tgt->waitQ);
6432 spin_lock_init(&tgt->sess_work_lock);
6433 INIT_WORK(&tgt->sess_work, qlt_sess_work_fn);
6434 INIT_LIST_HEAD(&tgt->sess_works_list);
6435 atomic_set(&tgt->tgt_global_resets_count, 0);
6437 base_vha->vha_tgt.qla_tgt = tgt;
6443 tgt->sg_tablesize = QLA_TGT_MAX_SG_24XX(base_vha->req->length - 3);
6446 list_add_tail(&tgt->tgt_list_entry, &qla_tgt_glist);
6449 if (ha->tgt.tgt_ops && ha->tgt.tgt_ops->add_target)
6450 ha->tgt.tgt_ops->add_target(base_vha);
6509 struct qla_tgt *tgt;
6518 list_for_each_entry(tgt, &qla_tgt_glist, tgt_list_entry) {
6519 vha = tgt->vha;
6539 if (tgt->tgt_stop) {
6585 ha->tgt.tgt_ops = NULL;
6640 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
6644 if (!tgt) {
6654 if (ha->tgt.num_act_qpairs > ha->max_qpairs)
6655 ha->tgt.num_act_qpairs = ha->max_qpairs;
6657 tgt->tgt_stopped = 0;
6685 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
6688 if (!tgt) {
6736 ha->tgt.atio_q_length = ATIO_ENTRY_CNT_24XX;
6772 struct atio_from_isp *pkt = (struct atio_from_isp *)ha->tgt.atio_ring;
6777 for (cnt = 0; cnt < ha->tgt.atio_q_length; cnt++) {
6798 while ((ha->tgt.atio_ring_ptr->signature != ATIO_PROCESSED) ||
6799 fcpcmd_is_corrupted(ha->tgt.atio_ring_ptr)) {
6800 pkt = (struct atio_from_isp *)ha->tgt.atio_ring_ptr;
6803 if (unlikely(fcpcmd_is_corrupted(ha->tgt.atio_ring_ptr))) {
6824 ha->tgt.atio_ring_index++;
6825 if (ha->tgt.atio_ring_index == ha->tgt.atio_q_length) {
6826 ha->tgt.atio_ring_index = 0;
6827 ha->tgt.atio_ring_ptr = ha->tgt.atio_ring;
6829 ha->tgt.atio_ring_ptr++;
6832 pkt = (struct atio_from_isp *)ha->tgt.atio_ring_ptr;
6838 wrt_reg_dword(ISP_ATIO_Q_OUT(vha), ha->tgt.atio_ring_index);
6884 if (!ha->tgt.saved_set) {
6886 ha->tgt.saved_exchange_count = nv->exchange_count;
6887 ha->tgt.saved_firmware_options_1 =
6889 ha->tgt.saved_firmware_options_2 =
6891 ha->tgt.saved_firmware_options_3 =
6893 ha->tgt.saved_set = 1;
6939 if (ha->tgt.saved_set) {
6940 nv->exchange_count = ha->tgt.saved_exchange_count;
6942 ha->tgt.saved_firmware_options_1;
6944 ha->tgt.saved_firmware_options_2;
6946 ha->tgt.saved_firmware_options_3;
6974 if (ha->tgt.node_name_set) {
6975 memcpy(icb->node_name, ha->tgt.tgt_node_name, WWN_SIZE);
6990 if (!ha->tgt.saved_set) {
6992 ha->tgt.saved_exchange_count = nv->exchange_count;
6993 ha->tgt.saved_firmware_options_1 =
6995 ha->tgt.saved_firmware_options_2 =
6997 ha->tgt.saved_firmware_options_3 =
6999 ha->tgt.saved_set = 1;
7042 if (ha->tgt.saved_set) {
7043 nv->exchange_count = ha->tgt.saved_exchange_count;
7045 ha->tgt.saved_firmware_options_1;
7047 ha->tgt.saved_firmware_options_2;
7049 ha->tgt.saved_firmware_options_3;
7077 if (ha->tgt.node_name_set) {
7078 memcpy(icb->node_name, ha->tgt.tgt_node_name, WWN_SIZE);
7144 spin_lock_irqsave(&ha->tgt.atio_lock, flags);
7148 spin_unlock_irqrestore(&ha->tgt.atio_lock, flags);
7166 spin_lock_irqsave(&ha->tgt.atio_lock, flags);
7168 spin_unlock_irqrestore(&ha->tgt.atio_lock, flags);
7208 ha->tgt.atio_ring = dma_alloc_coherent(&ha->pdev->dev,
7209 (ha->tgt.atio_q_length + 1) * sizeof(struct atio_from_isp),
7210 &ha->tgt.atio_dma, GFP_KERNEL);
7211 if (!ha->tgt.atio_ring) {
7223 if (ha->tgt.atio_ring) {
7224 dma_free_coherent(&ha->pdev->dev, (ha->tgt.atio_q_length + 1) *
7225 sizeof(struct atio_from_isp), ha->tgt.atio_ring,
7226 ha->tgt.atio_dma);
7228 ha->tgt.atio_ring = NULL;
7229 ha->tgt.atio_dma = 0;