Lines Matching refs:sess

105 static int qlt_issue_task_mgmt(struct fc_port *sess, u64 lun,
121 void qlt_unreg_sess(struct fc_port *sess);
707 struct fc_port *sess = fcport; in qlt_fc_port_added() local
724 if (!sess->se_sess) { in qlt_fc_port_added()
728 sess = qlt_create_sess(vha, fcport, false); in qlt_fc_port_added()
738 if (!kref_get_unless_zero(&sess->sess_kref)) { in qlt_fc_port_added()
741 __func__, sess->port_name); in qlt_fc_port_added()
749 sess->local ? "local " : "", sess->port_name, sess->loop_id); in qlt_fc_port_added()
752 "Reappeared sess %p\n", sess); in qlt_fc_port_added()
754 ha->tgt.tgt_ops->update_sess(sess, fcport->d_id, in qlt_fc_port_added()
759 if (sess && sess->local) { in qlt_fc_port_added()
763 fcport->port_name, sess->loop_id); in qlt_fc_port_added()
764 sess->local = 0; in qlt_fc_port_added()
768 ha->tgt.tgt_ops->put_sess(sess); in qlt_fc_port_added()
860 struct fc_port *sess, enum qlt_plogi_link_t link) in qlt_plogi_ack_link() argument
869 sess, link, sess->port_name, in qlt_plogi_ack_link()
875 switch (sess->disc_state) { in qlt_plogi_ack_link()
885 if (sess->plogi_link[link]) in qlt_plogi_ack_link()
886 qlt_plogi_ack_unref(vha, sess->plogi_link[link]); in qlt_plogi_ack_link()
889 pla->fcport = sess; in qlt_plogi_ack_link()
891 sess->plogi_link[link] = pla; in qlt_plogi_ack_link()
948 struct fc_port *sess = container_of(work, struct fc_port, in qlt_free_session_done() local
950 struct qla_tgt *tgt = sess->tgt; in qlt_free_session_done()
951 struct scsi_qla_host *vha = sess->vha; in qlt_free_session_done()
957 sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN]; in qlt_free_session_done()
962 __func__, sess->se_sess, sess, sess->port_name, sess->loop_id, in qlt_free_session_done()
963 sess->d_id.b.domain, sess->d_id.b.area, sess->d_id.b.al_pa, in qlt_free_session_done()
964 sess->logout_on_delete, sess->keep_nport_handle, in qlt_free_session_done()
965 sess->send_els_logo); in qlt_free_session_done()
967 if (!IS_SW_RESV_ADDR(sess->d_id)) { in qlt_free_session_done()
968 qla2x00_mark_device_lost(vha, sess, 0); in qlt_free_session_done()
970 if (sess->send_els_logo) { in qlt_free_session_done()
973 logo.id = sess->d_id; in qlt_free_session_done()
978 sess->send_els_logo = 0; in qlt_free_session_done()
981 if (sess->logout_on_delete && sess->loop_id != FC_NO_LOOP_ID) { in qlt_free_session_done()
986 sess->logout_completed = 0; in qlt_free_session_done()
987 rc = qla2x00_post_async_logout_work(vha, sess, in qlt_free_session_done()
992 sess, rc); in qlt_free_session_done()
997 rc = qla2x00_post_async_prlo_work(vha, sess, in qlt_free_session_done()
1002 sess, rc); in qlt_free_session_done()
1008 if (sess->nvme_flag & NVME_FLAG_REGISTERED && in qlt_free_session_done()
1009 !(sess->nvme_flag & NVME_FLAG_DELETING)) { in qlt_free_session_done()
1010 sess->nvme_flag |= NVME_FLAG_DELETING; in qlt_free_session_done()
1011 qla_nvme_unregister_remote_port(sess); in qlt_free_session_done()
1016 sess->edif.authok = 0; in qlt_free_session_done()
1020 __func__, sess->port_name); in qlt_free_session_done()
1021 qla2x00_release_all_sadb(vha, sess); in qlt_free_session_done()
1028 qla_edif_clear_appdata(vha, sess); in qlt_free_session_done()
1029 qla_edif_sess_down(vha, sess); in qlt_free_session_done()
1036 if (sess->se_sess != NULL) in qlt_free_session_done()
1037 ha->tgt.tgt_ops->free_session(sess); in qlt_free_session_done()
1043 while (!READ_ONCE(sess->logout_completed)) { in qlt_free_session_done()
1047 __func__, sess); in qlt_free_session_done()
1062 "%s: sess %p logout completed\n", __func__, sess); in qlt_free_session_done()
1066 if (!(sess->flags & FCF_FCP2_DEVICE) && in qlt_free_session_done()
1067 qla2x00_eh_wait_for_pending_commands(sess->vha, sess->d_id.b24, 0, WAIT_TARGET)) { in qlt_free_session_done()
1075 if (sess->logo_ack_needed) { in qlt_free_session_done()
1076 sess->logo_ack_needed = 0; in qlt_free_session_done()
1077 qla24xx_async_notify_ack(vha, sess, in qlt_free_session_done()
1078 (struct imm_ntfy_from_isp *)sess->iocb, SRB_NACK_LOGO); in qlt_free_session_done()
1082 if (sess->se_sess) { in qlt_free_session_done()
1083 sess->se_sess = NULL; in qlt_free_session_done()
1084 if (tgt && !IS_SW_RESV_ADDR(sess->d_id)) in qlt_free_session_done()
1088 qla2x00_set_fcport_disc_state(sess, DSC_DELETED); in qlt_free_session_done()
1089 sess->fw_login_state = DSC_LS_PORT_UNAVAIL; in qlt_free_session_done()
1091 if (sess->login_succ && !IS_SW_RESV_ADDR(sess->d_id)) { in qlt_free_session_done()
1093 sess->login_succ = 0; in qlt_free_session_done()
1096 qla2x00_clear_loop_id(sess); in qlt_free_session_done()
1098 if (sess->conflict) { in qlt_free_session_done()
1099 sess->conflict->login_pause = 0; in qlt_free_session_done()
1100 sess->conflict = NULL; in qlt_free_session_done()
1107 sess->plogi_link[QLT_PLOGI_LINK_CONFLICT]; in qlt_free_session_done()
1110 own = sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN]; in qlt_free_session_done()
1117 sess->se_sess, sess, sess->port_name, in qlt_free_session_done()
1122 sess->plogi_link[QLT_PLOGI_LINK_CONFLICT] = NULL; in qlt_free_session_done()
1126 sess->se_sess, sess, sess->port_name, in qlt_free_session_done()
1133 sess->fw_login_state = DSC_LS_PLOGI_PEND; in qlt_free_session_done()
1135 sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN] = NULL; in qlt_free_session_done()
1139 sess->explicit_logout = 0; in qlt_free_session_done()
1142 qla2x00_dfs_remove_rport(vha, sess); in qlt_free_session_done()
1145 sess->flags &= ~FCF_ASYNC_SENT; in qlt_free_session_done()
1146 sess->deleted = QLA_SESS_DELETED; in qlt_free_session_done()
1147 sess->free_pending = 0; in qlt_free_session_done()
1152 sess, sess->port_name, vha->fcport_count); in qlt_free_session_done()
1178 void qlt_unreg_sess(struct fc_port *sess) in qlt_unreg_sess() argument
1180 struct scsi_qla_host *vha = sess->vha; in qlt_unreg_sess()
1183 ql_dbg(ql_dbg_disc, sess->vha, 0x210a, in qlt_unreg_sess()
1185 __func__, sess, sess->port_name); in qlt_unreg_sess()
1187 spin_lock_irqsave(&sess->vha->work_lock, flags); in qlt_unreg_sess()
1188 if (sess->free_pending) { in qlt_unreg_sess()
1189 spin_unlock_irqrestore(&sess->vha->work_lock, flags); in qlt_unreg_sess()
1192 sess->free_pending = 1; in qlt_unreg_sess()
1197 sess->flags |= FCF_ASYNC_SENT; in qlt_unreg_sess()
1198 sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; in qlt_unreg_sess()
1199 spin_unlock_irqrestore(&sess->vha->work_lock, flags); in qlt_unreg_sess()
1201 if (sess->se_sess) in qlt_unreg_sess()
1202 vha->hw->tgt.tgt_ops->clear_nacl_from_fcport_map(sess); in qlt_unreg_sess()
1204 qla2x00_set_fcport_disc_state(sess, DSC_DELETE_PEND); in qlt_unreg_sess()
1205 sess->last_rscn_gen = sess->rscn_gen; in qlt_unreg_sess()
1206 sess->last_login_gen = sess->login_gen; in qlt_unreg_sess()
1208 queue_work(sess->vha->hw->wq, &sess->free_work); in qlt_unreg_sess()
1215 struct fc_port *sess = NULL; in qlt_reset() local
1230 sess = ha->tgt.tgt_ops->find_sess_by_loop_id(vha, loop_id); in qlt_reset()
1235 "Using sess for qla_tgt_reset: %p\n", sess); in qlt_reset()
1236 if (!sess) { in qlt_reset()
1243 "loop_id %d)\n", vha->host_no, sess, sess->port_name, in qlt_reset()
1246 return qlt_issue_task_mgmt(sess, 0, mcmd, iocb, QLA24XX_MGMT_SEND_NACK); in qlt_reset()
1249 static void qla24xx_chk_fcp_state(struct fc_port *sess) in qla24xx_chk_fcp_state() argument
1251 if (sess->chip_reset != sess->vha->hw->base_qpair->chip_reset) { in qla24xx_chk_fcp_state()
1252 sess->logout_on_delete = 0; in qla24xx_chk_fcp_state()
1253 sess->logo_ack_needed = 0; in qla24xx_chk_fcp_state()
1254 sess->fw_login_state = DSC_LS_PORT_UNAVAIL; in qla24xx_chk_fcp_state()
1258 void qlt_schedule_sess_for_deletion(struct fc_port *sess) in qlt_schedule_sess_for_deletion() argument
1260 struct qla_tgt *tgt = sess->tgt; in qlt_schedule_sess_for_deletion()
1264 switch (sess->disc_state) { in qlt_schedule_sess_for_deletion()
1268 if (!sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN] && in qlt_schedule_sess_for_deletion()
1269 !sess->plogi_link[QLT_PLOGI_LINK_CONFLICT]) { in qlt_schedule_sess_for_deletion()
1273 if (sess->vha->fcport_count == 0) in qlt_schedule_sess_for_deletion()
1274 wake_up_all(&sess->vha->fcport_waitQ); in qlt_schedule_sess_for_deletion()
1283 sess->next_disc_state = DSC_DELETE_PEND; in qlt_schedule_sess_for_deletion()
1285 sess->jiffies_at_registration)/1000; in qlt_schedule_sess_for_deletion()
1286 if (sess->sec_since_registration < sec && sec && !(sec % 5)) { in qlt_schedule_sess_for_deletion()
1287 sess->sec_since_registration = sec; in qlt_schedule_sess_for_deletion()
1288 ql_dbg(ql_dbg_disc, sess->vha, 0xffff, in qlt_schedule_sess_for_deletion()
1290 __func__, sess->port_name, sec); in qlt_schedule_sess_for_deletion()
1297 spin_lock_irqsave(&sess->vha->work_lock, flags); in qlt_schedule_sess_for_deletion()
1298 if (sess->deleted == QLA_SESS_DELETION_IN_PROGRESS) { in qlt_schedule_sess_for_deletion()
1299 spin_unlock_irqrestore(&sess->vha->work_lock, flags); in qlt_schedule_sess_for_deletion()
1302 sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; in qlt_schedule_sess_for_deletion()
1303 spin_unlock_irqrestore(&sess->vha->work_lock, flags); in qlt_schedule_sess_for_deletion()
1305 sess->prli_pend_timer = 0; in qlt_schedule_sess_for_deletion()
1306 qla2x00_set_fcport_disc_state(sess, DSC_DELETE_PEND); in qlt_schedule_sess_for_deletion()
1308 qla24xx_chk_fcp_state(sess); in qlt_schedule_sess_for_deletion()
1310 ql_dbg(ql_log_warn, sess->vha, 0xe001, in qlt_schedule_sess_for_deletion()
1312 sess, sess->port_name, sess->fc4_type); in qlt_schedule_sess_for_deletion()
1314 WARN_ON(!queue_work(sess->vha->hw->wq, &sess->del_work)); in qlt_schedule_sess_for_deletion()
1319 struct fc_port *sess; in qlt_clear_tgt_db() local
1322 list_for_each_entry(sess, &vha->vp_fcports, list) { in qlt_clear_tgt_db()
1323 if (sess->se_sess) in qlt_clear_tgt_db()
1324 qlt_schedule_sess_for_deletion(sess); in qlt_clear_tgt_db()
1387 struct fc_port *sess = fcport; in qlt_create_sess() local
1394 if (!kref_get_unless_zero(&sess->sess_kref)) { in qlt_create_sess()
1397 __func__, sess->port_name); in qlt_create_sess()
1402 sess->tgt = vha->vha_tgt.qla_tgt; in qlt_create_sess()
1403 sess->local = local; in qlt_create_sess()
1411 sess->logout_on_delete = 1; in qlt_create_sess()
1412 sess->keep_nport_handle = 0; in qlt_create_sess()
1413 sess->logout_completed = 0; in qlt_create_sess()
1416 &fcport->port_name[0], sess) < 0) { in qlt_create_sess()
1427 if (!kref_get_unless_zero(&sess->sess_kref)) { in qlt_create_sess()
1430 __func__, sess->port_name); in qlt_create_sess()
1435 if (!IS_SW_RESV_ADDR(sess->d_id)) in qlt_create_sess()
1438 qlt_do_generation_tick(vha, &sess->generation); in qlt_create_sess()
1444 sess, sess->se_sess, vha->vha_tgt.qla_tgt, in qlt_create_sess()
1451 fcport->loop_id, sess->d_id.b.domain, sess->d_id.b.area, in qlt_create_sess()
1452 sess->d_id.b.al_pa, sess->conf_compl_supported ? "" : "not "); in qlt_create_sess()
1454 return sess; in qlt_create_sess()
1465 struct fc_port *sess = fcport; in qlt_fc_port_deleted() local
1479 if (!sess->se_sess) { in qlt_fc_port_deleted()
1484 if (max_gen - sess->generation < 0) { in qlt_fc_port_deleted()
1489 sess->se_sess, sess, sess->port_name, max_gen, in qlt_fc_port_deleted()
1490 sess->generation); in qlt_fc_port_deleted()
1494 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf008, "qla_tgt_fc_port_deleted %p", sess); in qlt_fc_port_deleted()
1496 sess->local = 1; in qlt_fc_port_deleted()
1498 qlt_schedule_sess_for_deletion(sess); in qlt_fc_port_deleted()
2112 struct abts_recv_from_24xx *abts, struct fc_port *sess) in __qlt_24xx_handle_abts() argument
2132 mcmd->sess = sess; in __qlt_24xx_handle_abts()
2145 abort_cmd = ha->tgt.tgt_ops->find_cmd_by_tag(sess, in __qlt_24xx_handle_abts()
2173 struct fc_port *sess; in qlt_24xx_handle_abts() local
2206 sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, s_id); in qlt_24xx_handle_abts()
2207 if (!sess) { in qlt_24xx_handle_abts()
2220 if (sess->deleted) { in qlt_24xx_handle_abts()
2226 rc = __qlt_24xx_handle_abts(vha, abts, sess); in qlt_24xx_handle_abts()
2264 ctio->nport_handle = cpu_to_le16(mcmd->sess->loop_id); in qlt_24xx_send_task_mgmt_ctio()
2321 ctio->nport_handle = cpu_to_le16(cmd->sess->loop_id); in qlt_send_resp_ctio()
2364 struct scsi_qla_host *vha = mcmd->sess->vha; in qlt_xmit_tm_rsp()
2397 mcmd->sess->port_name, mcmd->fc_tm_rsp, in qlt_xmit_tm_rsp()
2399 qlt_schedule_sess_for_deletion(mcmd->sess); in qlt_xmit_tm_rsp()
2636 prm->cmd->sess->edif.rx_bytes += cmd->bufflen; in qlt_24xx_build_ctio_pkt()
2638 prm->cmd->sess->edif.tx_bytes += cmd->bufflen; in qlt_24xx_build_ctio_pkt()
3267 (cmd->sess && cmd->sess->deleted)) { in qlt_xmit_response()
3428 (cmd->sess && cmd->sess->deleted)) { in qlt_rdy_to_xfer()
3846 struct fc_port *sess = cmd->sess; in qlt_free_cmd() local
3861 if (!sess || !sess->se_sess) { in qlt_free_cmd()
3982 cmd->sess) { in qlt_do_ctio_completion()
3983 qlt_chk_edif_rx_sa_delete_pending(vha, cmd->sess, in qlt_do_ctio_completion()
4029 if (logged_out && cmd->sess) { in qlt_do_ctio_completion()
4034 cmd->sess->send_els_logo = 1; in qlt_do_ctio_completion()
4037 __func__, __LINE__, cmd->sess->port_name); in qlt_do_ctio_completion()
4039 qlt_schedule_sess_for_deletion(cmd->sess); in qlt_do_ctio_completion()
4158 struct fc_port *sess = cmd->sess; in __qlt_do_work() local
4202 ha->tgt.tgt_ops->put_sess(sess); in __qlt_do_work()
4219 ha->tgt.tgt_ops->put_sess(sess); in __qlt_do_work()
4340 struct fc_port *sess, in qlt_get_tag() argument
4345 cmd = vha->hw->tgt.tgt_ops->get_cmd(sess); in qlt_get_tag()
4356 cmd->sess = sess; in qlt_get_tag()
4357 cmd->loop_id = sess->loop_id; in qlt_get_tag()
4358 cmd->conf_compl_supported = sess->conf_compl_supported; in qlt_get_tag()
4368 cmd->edif = sess->edif.enable; in qlt_get_tag()
4379 struct fc_port *sess; in qlt_handle_cmd_for_atio() local
4394 sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, atio->u.isp24.fcp_hdr.s_id); in qlt_handle_cmd_for_atio()
4395 if (unlikely(!sess)) in qlt_handle_cmd_for_atio()
4400 if (sess->deleted) { in qlt_handle_cmd_for_atio()
4403 sess); in qlt_handle_cmd_for_atio()
4410 if (!kref_get_unless_zero(&sess->sess_kref)) { in qlt_handle_cmd_for_atio()
4413 __func__, sess->port_name, in qlt_handle_cmd_for_atio()
4418 cmd = qlt_get_tag(vha, sess, atio); in qlt_handle_cmd_for_atio()
4422 ha->tgt.tgt_ops->put_sess(sess); in qlt_handle_cmd_for_atio()
4450 static int qlt_issue_task_mgmt(struct fc_port *sess, u64 lun, in qlt_issue_task_mgmt() argument
4453 struct scsi_qla_host *vha = sess->vha; in qlt_issue_task_mgmt()
4468 mcmd->sess = sess; in qlt_issue_task_mgmt()
4515 struct fc_port *sess; in qlt_handle_task_mgmt() local
4523 sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, in qlt_handle_task_mgmt()
4530 if (sess == NULL || sess->deleted) in qlt_handle_task_mgmt()
4533 return qlt_issue_task_mgmt(sess, unpacked_lun, fn, iocb, 0); in qlt_handle_task_mgmt()
4538 struct imm_ntfy_from_isp *iocb, struct fc_port *sess) in __qlt_abort_task() argument
4555 mcmd->sess = sess; in __qlt_abort_task()
4583 struct fc_port *sess; in qlt_abort_task() local
4590 sess = ha->tgt.tgt_ops->find_sess_by_loop_id(vha, loop_id); in qlt_abort_task()
4593 if (sess == NULL) { in qlt_abort_task()
4601 return __qlt_abort_task(vha, iocb, sess); in qlt_abort_task()
4633 struct fc_port *sess = NULL, *other_sess; in qlt_find_sess_invalidate_other() local
4643 WARN_ON(sess); in qlt_find_sess_invalidate_other()
4644 sess = other_sess; in qlt_find_sess_invalidate_other()
4692 return sess; in qlt_find_sess_invalidate_other()
4734 struct fc_port *sess = NULL, *conflict_sess = NULL; in qlt_handle_login() local
4758 sess = qlt_find_sess_invalidate_other(vha, wwn, in qlt_handle_login()
4818 if (!sess) { in qlt_handle_login()
4836 if (sess->disc_state == DSC_UPD_FCPORT) { in qlt_handle_login()
4844 sess->next_disc_state = DSC_DELETE_PEND; in qlt_handle_login()
4846 sess->jiffies_at_registration) / 1000; in qlt_handle_login()
4847 if (sess->sec_since_registration < sec && sec && in qlt_handle_login()
4849 sess->sec_since_registration = sec; in qlt_handle_login()
4852 __func__, sess->port_name, sec); in qlt_handle_login()
4864 qlt_plogi_ack_link(vha, pla, sess, QLT_PLOGI_LINK_SAME_WWN); in qlt_handle_login()
4865 sess->d_id = port_id; in qlt_handle_login()
4866 sess->login_gen++; in qlt_handle_login()
4867 sess->loop_id = loop_id; in qlt_handle_login()
4871 if (N2N_TOPO(vha->hw) && fcport_is_bigger(sess)) in qlt_handle_login()
4872 vha->d_id = sess->d_id; in qlt_handle_login()
4876 __func__, sess->port_name); in qlt_handle_login()
4879 sess->d_id.b24); in qlt_handle_login()
4883 sess->fw_login_state = DSC_LS_PRLI_PEND; in qlt_handle_login()
4884 sess->local = 0; in qlt_handle_login()
4885 sess->loop_id = loop_id; in qlt_handle_login()
4886 sess->d_id = port_id; in qlt_handle_login()
4887 sess->fw_login_state = DSC_LS_PRLI_PEND; in qlt_handle_login()
4891 sess->conf_compl_supported = 1; in qlt_handle_login()
4894 sess->port_type = FCT_INITIATOR; in qlt_handle_login()
4896 sess->port_type = FCT_TARGET; in qlt_handle_login()
4899 sess->fw_login_state = DSC_LS_PLOGI_PEND; in qlt_handle_login()
4904 __func__, __LINE__, sess->port_name, sess->disc_state); in qlt_handle_login()
4906 switch (sess->disc_state) { in qlt_handle_login()
4931 sess->keep_nport_handle = ((sess->loop_id == loop_id) && in qlt_handle_login()
4932 (sess->d_id.b24 == port_id.b24)); in qlt_handle_login()
4936 __func__, __LINE__, sess->port_name); in qlt_handle_login()
4939 qlt_schedule_sess_for_deletion(sess); in qlt_handle_login()
4954 struct fc_port *sess = NULL, *conflict_sess = NULL; in qlt_24xx_handle_els() local
4990 sess = qla2x00_find_fcport_by_wwpn(vha, in qlt_24xx_handle_els()
4993 if (vha->hw->flags.edif_enabled && sess && in qlt_24xx_handle_els()
4994 (!(sess->flags & FCF_FCSP_DEVICE) || in qlt_24xx_handle_els()
4995 !sess->edif.authok)) { in qlt_24xx_handle_els()
5003 if (sess && sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN]) { in qlt_24xx_handle_els()
5025 sess = qlt_find_sess_invalidate_other(vha, wwn, port_id, in qlt_24xx_handle_els()
5047 if (sess != NULL) { in qlt_24xx_handle_els()
5051 if (vha->hw->flags.edif_enabled && sess && in qlt_24xx_handle_els()
5052 (!(sess->flags & FCF_FCSP_DEVICE) || in qlt_24xx_handle_els()
5053 !sess->edif.authok)) { in qlt_24xx_handle_els()
5062 switch (sess->fw_login_state) { in qlt_24xx_handle_els()
5072 switch (sess->disc_state) { in qlt_24xx_handle_els()
5078 sess->jiffies_at_registration)/1000; in qlt_24xx_handle_els()
5079 if (sess->sec_since_registration < sec && sec && in qlt_24xx_handle_els()
5081 sess->sec_since_registration = sec; in qlt_24xx_handle_els()
5082 ql_dbg(ql_dbg_disc, sess->vha, 0xffff, in qlt_24xx_handle_els()
5084 __func__, sess->port_name, sec); in qlt_24xx_handle_els()
5107 ql_log(ql_log_warn, sess->vha, 0xf095, in qlt_24xx_handle_els()
5109 sess); in qlt_24xx_handle_els()
5121 sess->loop_id, sess, iocb->u.isp24.nport_handle); in qlt_24xx_handle_els()
5123 sess->local = 0; in qlt_24xx_handle_els()
5124 sess->loop_id = loop_id; in qlt_24xx_handle_els()
5125 sess->d_id = port_id; in qlt_24xx_handle_els()
5126 sess->fw_login_state = DSC_LS_PRLI_PEND; in qlt_24xx_handle_els()
5129 sess->conf_compl_supported = 1; in qlt_24xx_handle_els()
5132 sess->port_type = FCT_INITIATOR; in qlt_24xx_handle_els()
5134 sess->port_type = FCT_TARGET; in qlt_24xx_handle_els()
5142 if (sess) { in qlt_24xx_handle_els()
5145 __func__, __LINE__, sess->port_name); in qlt_24xx_handle_els()
5146 qla24xx_post_nack_work(vha, sess, iocb, in qlt_24xx_handle_els()
5155 if (sess) { in qlt_24xx_handle_els()
5158 __func__, __LINE__, sess->port_name); in qlt_24xx_handle_els()
5159 qla24xx_post_nack_work(vha, sess, iocb, in qlt_24xx_handle_els()
5178 sess = qla2x00_find_fcport_by_loopid(vha, loop_id); in qlt_24xx_handle_els()
5181 if (sess) { in qlt_24xx_handle_els()
5182 sess->login_gen++; in qlt_24xx_handle_els()
5183 sess->fw_login_state = DSC_LS_LOGO_PEND; in qlt_24xx_handle_els()
5184 sess->logo_ack_needed = 1; in qlt_24xx_handle_els()
5185 memcpy(sess->iocb, iocb, IOCB_SIZE); in qlt_24xx_handle_els()
5192 __func__, wwn, res, sess); in qlt_24xx_handle_els()
5198 BUG_ON(!sess); in qlt_24xx_handle_els()
5202 if (sess) { in qlt_24xx_handle_els()
5203 qlt_schedule_sess_for_deletion(sess); in qlt_24xx_handle_els()
5220 sess = qla2x00_find_fcport_by_wwpn(vha, in qlt_24xx_handle_els()
5222 if (sess) { in qlt_24xx_handle_els()
5225 sess, sess->loop_id, loop_id, in qlt_24xx_handle_els()
5226 sess->disc_state, sess->fw_login_state); in qlt_24xx_handle_els()
5395 struct fc_port *sess = NULL; in __qlt_send_busy() local
5403 sess = qla2x00_find_fcport_by_nportid(vha, &id, 1); in __qlt_send_busy()
5405 if (!sess) { in __qlt_send_busy()
5425 ctio24->nport_handle = cpu_to_le16(sess->loop_id); in __qlt_send_busy()
5467 struct fc_port *sess; in qlt_alloc_qfull_cmd() local
5493 sess = ha->tgt.tgt_ops->find_sess_by_s_id in qlt_alloc_qfull_cmd()
5495 if (!sess) in qlt_alloc_qfull_cmd()
5498 cmd = ha->tgt.tgt_ops->get_cmd(sess); in qlt_alloc_qfull_cmd()
6204 struct fc_port *sess = NULL; in qlt_make_local_sess() local
6263 sess = qlt_create_sess(vha, fcport, true); in qlt_make_local_sess()
6267 return sess; in qlt_make_local_sess()
6275 struct fc_port *sess = NULL; in qlt_abort_work() local
6287 sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, s_id); in qlt_abort_work()
6288 if (!sess) { in qlt_abort_work()
6291 sess = qlt_make_local_sess(vha, s_id); in qlt_abort_work()
6295 if (!sess) in qlt_abort_work()
6298 if (sess->deleted) { in qlt_abort_work()
6299 sess = NULL; in qlt_abort_work()
6303 if (!kref_get_unless_zero(&sess->sess_kref)) { in qlt_abort_work()
6306 __func__, sess->port_name); in qlt_abort_work()
6307 sess = NULL; in qlt_abort_work()
6312 rc = __qlt_24xx_handle_abts(vha, &prm->abts, sess); in qlt_abort_work()
6315 ha->tgt.tgt_ops->put_sess(sess); in qlt_abort_work()