• Home
  • Raw
  • Download

Lines Matching refs:vha

37 static void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha,
50 scsi_qla_host_t *vha = sp->vha; in qla2x00_sp_timeout() local
59 if (vha && qla2x00_isp_reg_stat(vha->hw)) { in qla2x00_sp_timeout()
60 ql_log(ql_log_info, vha, 0x9008, in qla2x00_sp_timeout()
62 qla_pci_set_eeh_busy(vha); in qla2x00_sp_timeout()
87 qla2x00_get_async_timeout(struct scsi_qla_host *vha) in qla2x00_get_async_timeout() argument
90 struct qla_hw_data *ha = vha->hw; in qla2x00_get_async_timeout()
116 ql_dbg(ql_dbg_async, sp->vha, 0x507c, in qla24xx_abort_iocb_timeout()
121 ql_dbg(ql_dbg_async, sp->vha, 0x507c, in qla24xx_abort_iocb_timeout()
175 scsi_qla_host_t *vha = cmd_sp->vha; in qla24xx_async_abort_cmd() local
181 sp = qla2xxx_get_qpair_sp(cmd_sp->vha, cmd_sp->qpair, cmd_sp->fcport, in qla24xx_async_abort_cmd()
186 qla_vha_mark_busy(vha); in qla24xx_async_abort_cmd()
203 ql_dbg(ql_dbg_async, vha, 0x507c, in qla24xx_async_abort_cmd()
235 ql_dbg(ql_dbg_disc, fcport->vha, 0x2071, in qla2x00_async_iocb_timeout()
297 struct scsi_qla_host *vha = sp->vha; in qla2x00_async_login_sp_done() local
301 ql_dbg(ql_dbg_disc, vha, 0x20dd, in qla2x00_async_login_sp_done()
306 if (!test_bit(UNLOADING, &vha->dpc_flags)) { in qla2x00_async_login_sp_done()
316 qla24xx_handle_plogi_done_event(vha, &ea); in qla2x00_async_login_sp_done()
324 qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_login() argument
331 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT) || in qla2x00_async_login()
333 ql_log(ql_log_warn, vha, 0xffff, in qla2x00_async_login()
340 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla2x00_async_login()
352 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha) + 2, in qla2x00_async_login()
356 if (N2N_TOPO(fcport->vha->hw) && fcport_is_bigger(fcport)) { in qla2x00_async_login()
359 if (vha->hw->flags.edif_enabled && in qla2x00_async_login()
360 DBELL_ACTIVE(vha)) { in qla2x00_async_login()
363 ql_dbg(ql_dbg_disc, vha, 0x2072, in qla2x00_async_login()
371 if (NVME_TARGET(vha->hw, fcport)) in qla2x00_async_login()
374 ql_dbg(ql_dbg_disc, vha, 0x2072, in qla2x00_async_login()
382 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla2x00_async_login()
407 qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport) in qla2x00_async_logout() argument
414 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla2x00_async_logout()
420 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha) + 2, in qla2x00_async_logout()
423 ql_dbg(ql_dbg_disc, vha, 0x2070, in qla2x00_async_logout()
443 qla2x00_async_prlo_done(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_prlo_done() argument
449 qla2x00_mark_device_lost(vha, fcport, 1); in qla2x00_async_prlo_done()
456 struct scsi_qla_host *vha = sp->vha; in qla2x00_async_prlo_sp_done() local
459 if (!test_bit(UNLOADING, &vha->dpc_flags)) in qla2x00_async_prlo_sp_done()
460 qla2x00_post_async_prlo_done_work(sp->fcport->vha, sp->fcport, in qla2x00_async_prlo_sp_done()
467 qla2x00_async_prlo(struct scsi_qla_host *vha, fc_port_t *fcport) in qla2x00_async_prlo() argument
474 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla2x00_async_prlo()
480 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha) + 2, in qla2x00_async_prlo()
483 ql_dbg(ql_dbg_disc, vha, 0x2070, in qla2x00_async_prlo()
503 void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) in qla24xx_handle_adisc_event() argument
508 ql_dbg(ql_dbg_disc, vha, 0x20d2, in qla24xx_handle_adisc_event()
518 ql_dbg(ql_dbg_disc, vha, 0x2066, in qla24xx_handle_adisc_event()
522 spin_lock_irqsave(&vha->work_lock, flags); in qla24xx_handle_adisc_event()
528 spin_unlock_irqrestore(&vha->work_lock, flags); in qla24xx_handle_adisc_event()
539 ql_dbg(ql_dbg_disc, vha, 0x20d3, in qla24xx_handle_adisc_event()
549 __qla24xx_handle_gpdb_event(vha, ea); in qla24xx_handle_adisc_event()
552 static int qla_post_els_plogi_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla_post_els_plogi_work() argument
556 e = qla2x00_alloc_work(vha, QLA_EVT_ELS_PLOGI); in qla_post_els_plogi_work()
563 return qla2x00_post_work(vha, e); in qla_post_els_plogi_work()
568 struct scsi_qla_host *vha = sp->vha; in qla2x00_async_adisc_sp_done() local
572 ql_dbg(ql_dbg_disc, vha, 0x2066, in qla2x00_async_adisc_sp_done()
589 qla24xx_handle_adisc_event(vha, &ea); in qla2x00_async_adisc_sp_done()
595 qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_adisc() argument
603 ql_log(ql_log_warn, vha, 0xffff, in qla2x00_async_adisc()
610 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) in qla2x00_async_adisc()
615 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla2x00_async_adisc()
623 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha) + 2, in qla2x00_async_adisc()
631 ql_dbg(ql_dbg_disc, vha, 0x206f, in qla2x00_async_adisc()
646 qla2x00_post_async_adisc_work(vha, fcport, data); in qla2x00_async_adisc()
650 static bool qla2x00_is_reserved_id(scsi_qla_host_t *vha, uint16_t loop_id) in qla2x00_is_reserved_id() argument
652 struct qla_hw_data *ha = vha->hw; in qla2x00_is_reserved_id()
672 static int qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev) in qla2x00_find_new_loop_id() argument
675 struct qla_hw_data *ha = vha->hw; in qla2x00_find_new_loop_id()
684 qla2x00_is_reserved_id(vha, dev->loop_id)) { in qla2x00_find_new_loop_id()
693 ql_dbg(ql_dbg_disc, dev->vha, 0x2086, in qla2x00_find_new_loop_id()
697 ql_log(ql_log_warn, dev->vha, 0x2087, in qla2x00_find_new_loop_id()
706 struct qla_hw_data *ha = fcport->vha->hw; in qla2x00_clear_loop_id()
709 qla2x00_is_reserved_id(fcport->vha, fcport->loop_id)) in qla2x00_clear_loop_id()
716 static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, in qla24xx_handle_gnl_done_event() argument
728 ql_dbg(ql_dbg_disc, vha, 0xffff, in qla24xx_handle_gnl_done_event()
733 fcport->rscn_gen, fcport->last_rscn_gen, vha->loop_id, fcport->edif.enable); in qla24xx_handle_gnl_done_event()
740 ql_dbg(ql_dbg_disc, vha, 0x20de, in qla24xx_handle_gnl_done_event()
752 ql_dbg(ql_dbg_disc, vha, 0x20e0, in qla24xx_handle_gnl_done_event()
755 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_gnl_done_event()
761 ql_dbg(ql_dbg_disc, vha, 0x20e1, in qla24xx_handle_gnl_done_event()
768 e = &vha->gnl.l[i]; in qla24xx_handle_gnl_done_event()
797 ql_dbg(ql_dbg_disc, vha, 0x20e2, in qla24xx_handle_gnl_done_event()
814 ql_dbg(ql_dbg_disc, vha, 0x20e3, in qla24xx_handle_gnl_done_event()
830 qlt_find_sess_invalidate_other(vha, wwn, in qla24xx_handle_gnl_done_event()
843 switch (vha->hw->current_topology) { in qla24xx_handle_gnl_done_event()
848 vha, 0x20e4, "%s %d %8phC post gpdb\n", in qla24xx_handle_gnl_done_event()
856 qla2x00_post_async_adisc_work(vha, fcport, in qla24xx_handle_gnl_done_event()
860 if (vha->hw->flags.edif_enabled) { in qla24xx_handle_gnl_done_event()
862 qla24xx_post_gpdb_work(vha, fcport, 0); in qla24xx_handle_gnl_done_event()
869 qla2x00_find_new_loop_id(vha, fcport); in qla24xx_handle_gnl_done_event()
873 ql_dbg(ql_dbg_disc, vha, 0x20e5, in qla24xx_handle_gnl_done_event()
876 qla24xx_fcport_handle_login(vha, fcport); in qla24xx_handle_gnl_done_event()
893 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_gnl_done_event()
902 qla2x00_post_async_adisc_work(vha, fcport, in qla24xx_handle_gnl_done_event()
906 if (vha->hw->flags.edif_enabled && in qla24xx_handle_gnl_done_event()
907 DBELL_ACTIVE(vha)) { in qla24xx_handle_gnl_done_event()
909 qla24xx_post_gpdb_work(vha, fcport, 0); in qla24xx_handle_gnl_done_event()
918 qla24xx_fcport_handle_login(vha, in qla24xx_handle_gnl_done_event()
930 qla24xx_fcport_handle_login(vha, in qla24xx_handle_gnl_done_event()
940 switch (vha->hw->current_topology) { in qla24xx_handle_gnl_done_event()
944 e = &vha->gnl.l[i]; in qla24xx_handle_gnl_done_event()
953 qla2x00_find_fcport_by_wwpn(vha, in qla24xx_handle_gnl_done_event()
957 vha, 0x20e5, in qla24xx_handle_gnl_done_event()
972 qla24xx_fcport_handle_login(vha, fcport); in qla24xx_handle_gnl_done_event()
985 &vha->dpc_flags); in qla24xx_handle_gnl_done_event()
988 ql_log(ql_log_info, vha, 0x705d, in qla24xx_handle_gnl_done_event()
991 &vha->dpc_flags); in qla24xx_handle_gnl_done_event()
994 ql_log(ql_log_info, vha, 0x705d, in qla24xx_handle_gnl_done_event()
1000 qla2xxx_wake_dpc(vha); in qla24xx_handle_gnl_done_event()
1006 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_gnl_done_event()
1010 qla24xx_fcport_handle_login(vha, fcport); in qla24xx_handle_gnl_done_event()
1020 struct scsi_qla_host *vha = sp->vha; in qla24xx_async_gnl_sp_done() local
1030 ql_dbg(ql_dbg_disc, vha, 0x20e7, in qla24xx_async_gnl_sp_done()
1049 e = &vha->gnl.l[i]; in qla24xx_async_gnl_sp_done()
1053 set_bit(loop_id, vha->hw->loop_id_map); in qla24xx_async_gnl_sp_done()
1056 ql_dbg(ql_dbg_disc, vha, 0x20e8, in qla24xx_async_gnl_sp_done()
1063 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
1067 if (!list_empty(&vha->gnl.fcports)) in qla24xx_async_gnl_sp_done()
1068 list_splice_init(&vha->gnl.fcports, &h); in qla24xx_async_gnl_sp_done()
1069 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
1072 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
1075 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
1078 qla24xx_handle_gnl_done_event(vha, &ea); in qla24xx_async_gnl_sp_done()
1086 e = &vha->gnl.l[i]; in qla24xx_async_gnl_sp_done()
1090 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) { in qla24xx_async_gnl_sp_done()
1104 ql_dbg(ql_dbg_disc, vha, 0x2065, in qla24xx_async_gnl_sp_done()
1108 qla24xx_post_newsess_work(vha, &id, (u8 *)&wwn, in qla24xx_async_gnl_sp_done()
1113 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
1114 vha->gnl.sent = 0; in qla24xx_async_gnl_sp_done()
1115 if (!list_empty(&vha->gnl.fcports)) { in qla24xx_async_gnl_sp_done()
1117 list_for_each_entry_safe(fcport, tf, &vha->gnl.fcports, in qla24xx_async_gnl_sp_done()
1121 if (qla24xx_post_gnl_work(vha, fcport) == QLA_SUCCESS) in qla24xx_async_gnl_sp_done()
1125 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
1131 int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_async_gnl() argument
1138 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) in qla24xx_async_gnl()
1141 ql_dbg(ql_dbg_disc, vha, 0x20d9, in qla24xx_async_gnl()
1144 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl()
1150 list_add_tail(&fcport->gnl_entry, &vha->gnl.fcports); in qla24xx_async_gnl()
1151 if (vha->gnl.sent) { in qla24xx_async_gnl()
1152 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl()
1155 vha->gnl.sent = 1; in qla24xx_async_gnl()
1156 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl()
1159 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla24xx_async_gnl()
1167 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha) + 2, in qla24xx_async_gnl()
1173 mb[2] = MSW(vha->gnl.ldma); in qla24xx_async_gnl()
1174 mb[3] = LSW(vha->gnl.ldma); in qla24xx_async_gnl()
1175 mb[6] = MSW(MSD(vha->gnl.ldma)); in qla24xx_async_gnl()
1176 mb[7] = LSW(MSD(vha->gnl.ldma)); in qla24xx_async_gnl()
1177 mb[8] = vha->gnl.size; in qla24xx_async_gnl()
1178 mb[9] = vha->vp_idx; in qla24xx_async_gnl()
1180 ql_dbg(ql_dbg_disc, vha, 0x20da, in qla24xx_async_gnl()
1199 int qla24xx_post_gnl_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_post_gnl_work() argument
1203 e = qla2x00_alloc_work(vha, QLA_EVT_GNL); in qla24xx_post_gnl_work()
1209 return qla2x00_post_work(vha, e); in qla24xx_post_gnl_work()
1214 struct scsi_qla_host *vha = sp->vha; in qla24xx_async_gpdb_sp_done() local
1215 struct qla_hw_data *ha = vha->hw; in qla24xx_async_gpdb_sp_done()
1220 ql_dbg(ql_dbg_disc, vha, 0x20db, in qla24xx_async_gpdb_sp_done()
1233 qla24xx_handle_gpdb_event(vha, &ea); in qla24xx_async_gpdb_sp_done()
1242 int qla24xx_post_prli_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_post_prli_work() argument
1246 if (vha->host->active_mode == MODE_TARGET) in qla24xx_post_prli_work()
1249 e = qla2x00_alloc_work(vha, QLA_EVT_PRLI); in qla24xx_post_prli_work()
1255 return qla2x00_post_work(vha, e); in qla24xx_post_prli_work()
1260 struct scsi_qla_host *vha = sp->vha; in qla2x00_async_prli_sp_done() local
1264 ql_dbg(ql_dbg_disc, vha, 0x2129, in qla2x00_async_prli_sp_done()
1270 if (!test_bit(UNLOADING, &vha->dpc_flags)) { in qla2x00_async_prli_sp_done()
1283 qla24xx_handle_prli_done_event(vha, &ea); in qla2x00_async_prli_sp_done()
1290 qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_async_prli() argument
1296 if (!vha->flags.online) { in qla24xx_async_prli()
1297 ql_dbg(ql_dbg_disc, vha, 0xffff, "%s %d %8phC exit\n", in qla24xx_async_prli()
1304 qla_dual_mode_enabled(vha)) { in qla24xx_async_prli()
1305 ql_dbg(ql_dbg_disc, vha, 0xffff, "%s %d %8phC exit\n", in qla24xx_async_prli()
1310 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla24xx_async_prli()
1319 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha) + 2, in qla24xx_async_prli()
1325 if (NVME_TARGET(vha->hw, fcport)) in qla24xx_async_prli()
1328 ql_dbg(ql_dbg_disc, vha, 0x211b, in qla24xx_async_prli()
1331 fcport->login_retry, fcport->fc4_type, vha->hw->fc4_type_priority, in qla24xx_async_prli()
1332 NVME_TARGET(vha->hw, fcport) ? "nvme" : "fcp"); in qla24xx_async_prli()
1337 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_async_prli()
1350 int qla24xx_post_gpdb_work(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt) in qla24xx_post_gpdb_work() argument
1354 e = qla2x00_alloc_work(vha, QLA_EVT_GPDB); in qla24xx_post_gpdb_work()
1361 return qla2x00_post_work(vha, e); in qla24xx_post_gpdb_work()
1364 int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt) in qla24xx_async_gpdb() argument
1372 struct qla_hw_data *ha = vha->hw; in qla24xx_async_gpdb()
1375 ql_log(ql_log_warn, vha, 0xffff, in qla24xx_async_gpdb()
1382 if (!vha->flags.online || fcport->flags & FCF_ASYNC_SENT) { in qla24xx_async_gpdb()
1383 ql_log(ql_log_warn, vha, 0xffff, in qla24xx_async_gpdb()
1385 __func__, fcport->port_name, vha->flags.online, fcport->flags); in qla24xx_async_gpdb()
1389 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla24xx_async_gpdb()
1400 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha) + 2, in qla24xx_async_gpdb()
1405 ql_log(ql_log_warn, vha, 0xd043, in qla24xx_async_gpdb()
1417 mb[9] = vha->vp_idx; in qla24xx_async_gpdb()
1424 ql_dbg(ql_dbg_disc, vha, 0x20dc, in qla24xx_async_gpdb()
1441 qla24xx_post_gpdb_work(vha, fcport, opt); in qla24xx_async_gpdb()
1446 void __qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) in __qla24xx_handle_gpdb_event() argument
1450 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in __qla24xx_handle_gpdb_event()
1455 vha->fcport_count++; in __qla24xx_handle_gpdb_event()
1458 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in __qla24xx_handle_gpdb_event()
1460 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in __qla24xx_handle_gpdb_event()
1467 ql_dbg(ql_dbg_disc, vha, 0x20d6, in __qla24xx_handle_gpdb_event()
1472 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in __qla24xx_handle_gpdb_event()
1475 static int qla_chk_secure_login(scsi_qla_host_t *vha, fc_port_t *fcport, in qla_chk_secure_login() argument
1481 ql_dbg(ql_dbg_disc, vha, 0x104d, in qla_chk_secure_login()
1486 ql_dbg(ql_dbg_disc, vha, 0x104d, in qla_chk_secure_login()
1491 if (vha->hw->flags.edif_enabled) { in qla_chk_secure_login()
1500 qla2x00_post_aen_work(vha, FCH_EVT_PORT_ONLINE, in qla_chk_secure_login()
1503 if (DBELL_ACTIVE(vha)) { in qla_chk_secure_login()
1504 ql_dbg(ql_dbg_disc, vha, 0x20ef, in qla_chk_secure_login()
1510 qla_edb_eventcreate(vha, VND_CMD_AUTH_STATE_NEEDED, in qla_chk_secure_login()
1515 } else if (qla_ini_mode_enabled(vha) || qla_dual_mode_enabled(vha)) { in qla_chk_secure_login()
1516 ql_dbg(ql_dbg_disc, vha, 0x2117, in qla_chk_secure_login()
1519 qla24xx_post_prli_work(vha, fcport); in qla_chk_secure_login()
1527 void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) in qla24xx_handle_gpdb_event() argument
1538 ql_dbg(ql_dbg_disc, vha, 0x20d2, in qla24xx_handle_gpdb_event()
1544 ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC\n", in qla24xx_handle_gpdb_event()
1549 if (NVME_TARGET(vha->hw, fcport)) in qla24xx_handle_gpdb_event()
1557 ql_dbg(ql_dbg_disc, vha, 0x20d3, in qla24xx_handle_gpdb_event()
1564 ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC, ls %x\n", in qla24xx_handle_gpdb_event()
1571 __qla24xx_parse_gpdb(vha, fcport, pd); in qla24xx_handle_gpdb_event()
1574 if (qla_chk_secure_login(vha, fcport, pd)) { in qla24xx_handle_gpdb_event()
1575 ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC, ls %x\n", in qla24xx_handle_gpdb_event()
1584 if (qla_dual_mode_enabled(vha) || in qla24xx_handle_gpdb_event()
1585 qla_ini_mode_enabled(vha)) { in qla24xx_handle_gpdb_event()
1587 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_gpdb_event()
1589 ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC, ls %x\n", in qla24xx_handle_gpdb_event()
1595 ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC post del sess\n", in qla24xx_handle_gpdb_event()
1600 __qla24xx_handle_gpdb_event(vha, ea); in qla24xx_handle_gpdb_event()
1603 static void qla_chk_n2n_b4_login(struct scsi_qla_host *vha, fc_port_t *fcport) in qla_chk_n2n_b4_login() argument
1608 ql_dbg(ql_dbg_disc, vha, 0x307b, in qla_chk_n2n_b4_login()
1613 if (qla_tgt_mode_enabled(vha)) in qla_chk_n2n_b4_login()
1616 if (qla_dual_mode_enabled(vha)) { in qla_chk_n2n_b4_login()
1617 if (N2N_TOPO(vha->hw)) { in qla_chk_n2n_b4_login()
1620 mywwn = wwn_to_u64(vha->port_name); in qla_chk_n2n_b4_login()
1640 rc = qla2x00_find_new_loop_id(vha, fcport); in qla_chk_n2n_b4_login()
1642 ql_dbg(ql_dbg_disc, vha, 0x20e6, in qla_chk_n2n_b4_login()
1650 ql_dbg(ql_dbg_disc, vha, 0x20bf, in qla_chk_n2n_b4_login()
1653 qla2x00_post_async_login_work(vha, fcport, NULL); in qla_chk_n2n_b4_login()
1657 int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_fcport_handle_login() argument
1663 ql_dbg(ql_dbg_disc, vha, 0x20d8, in qla24xx_fcport_handle_login()
1676 qla_dual_mode_enabled(vha) && in qla24xx_fcport_handle_login()
1682 !N2N_TOPO(vha->hw)) { in qla24xx_fcport_handle_login()
1684 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_fcport_handle_login()
1690 if (vha->host->active_mode == MODE_TARGET && !N2N_TOPO(vha->hw)) in qla24xx_fcport_handle_login()
1694 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_fcport_handle_login()
1701 switch (vha->hw->current_topology) { in qla24xx_fcport_handle_login()
1707 qla2x00_find_new_loop_id(vha, in qla24xx_fcport_handle_login()
1713 qla_post_els_plogi_work(vha, fcport); in qla24xx_fcport_handle_login()
1715 ql_log(ql_log_info, vha, 0x705d, in qla24xx_fcport_handle_login()
1720 qla24xx_post_gnl_work(vha, fcport); in qla24xx_fcport_handle_login()
1725 ql_dbg(ql_dbg_disc, vha, 0xffff, in qla24xx_fcport_handle_login()
1728 qla24xx_post_gnnid_work(vha, fcport); in qla24xx_fcport_handle_login()
1730 ql_dbg(ql_dbg_disc, vha, 0x20bd, in qla24xx_fcport_handle_login()
1733 qla24xx_post_gnl_work(vha, fcport); in qla24xx_fcport_handle_login()
1735 qla_chk_n2n_b4_login(vha, fcport); in qla24xx_fcport_handle_login()
1742 switch (vha->hw->current_topology) { in qla24xx_fcport_handle_login()
1745 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_fcport_handle_login()
1749 vha->hw->base_qpair->chip_reset; in qla24xx_fcport_handle_login()
1750 qla24xx_post_gpdb_work(vha, fcport, 0); in qla24xx_fcport_handle_login()
1752 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_fcport_handle_login()
1755 NVME_TARGET(vha->hw, fcport) ? "NVME" : in qla24xx_fcport_handle_login()
1757 qla24xx_post_prli_work(vha, fcport); in qla24xx_fcport_handle_login()
1762 ql_dbg(ql_dbg_disc, vha, 0x20d8, in qla24xx_fcport_handle_login()
1768 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_fcport_handle_login()
1771 qla_chk_n2n_b4_login(vha, fcport); in qla24xx_fcport_handle_login()
1777 if (N2N_TOPO(vha->hw)) in qla24xx_fcport_handle_login()
1778 qla_chk_n2n_b4_login(vha, fcport); in qla24xx_fcport_handle_login()
1786 qla2x00_post_async_adisc_work(vha, fcport, data); in qla24xx_fcport_handle_login()
1790 if (vha->hw->flags.edif_enabled) in qla24xx_fcport_handle_login()
1794 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_fcport_handle_login()
1797 NVME_TARGET(vha->hw, fcport) ? "NVME" : "FC"); in qla24xx_fcport_handle_login()
1798 qla24xx_post_prli_work(vha, fcport); in qla24xx_fcport_handle_login()
1808 ql_dbg(ql_dbg_disc, fcport->vha, 0xffff, in qla24xx_fcport_handle_login()
1815 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_fcport_handle_login()
1825 int qla24xx_post_newsess_work(struct scsi_qla_host *vha, port_id_t *id, in qla24xx_post_newsess_work() argument
1830 e = qla2x00_alloc_work(vha, QLA_EVT_NEW_SESS); in qla24xx_post_newsess_work()
1841 return qla2x00_post_work(vha, e); in qla24xx_post_newsess_work()
1844 void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea) in qla2x00_handle_rscn() argument
1851 fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1); in qla2x00_handle_rscn()
1855 ql_dbg(ql_dbg_disc, vha, 0x2115, in qla2x00_handle_rscn()
1861 if (vha->hw->flags.edif_enabled && DBELL_ACTIVE(vha)) { in qla2x00_handle_rscn()
1885 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_handle_rscn()
1897 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_handle_rscn()
1910 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_handle_rscn()
1921 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_handle_rscn()
1922 if (vha->scan.scan_flags == 0) { in qla2x00_handle_rscn()
1923 ql_dbg(ql_dbg_disc, vha, 0xffff, "%s: schedule\n", __func__); in qla2x00_handle_rscn()
1924 vha->scan.scan_flags |= SF_QUEUED; in qla2x00_handle_rscn()
1925 schedule_delayed_work(&vha->scan.scan_work, 5); in qla2x00_handle_rscn()
1927 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_handle_rscn()
1930 void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, in qla24xx_handle_relogin_event() argument
1935 if (test_bit(UNLOADING, &vha->dpc_flags)) in qla24xx_handle_relogin_event()
1938 ql_dbg(ql_dbg_disc, vha, 0x2102, in qla24xx_handle_relogin_event()
1948 ql_dbg(ql_dbg_disc, vha, 0x20e9, "%s %d %8phC post gnl\n", in qla24xx_handle_relogin_event()
1950 qla24xx_post_gnl_work(vha, fcport); in qla24xx_handle_relogin_event()
1954 qla24xx_fcport_handle_login(vha, fcport); in qla24xx_handle_relogin_event()
1957 void qla_handle_els_plogi_done(scsi_qla_host_t *vha, in qla_handle_els_plogi_done() argument
1960 if (N2N_TOPO(vha->hw) && fcport_is_smaller(ea->fcport) && in qla_handle_els_plogi_done()
1961 vha->hw->flags.edif_enabled) { in qla_handle_els_plogi_done()
1963 qla24xx_post_gpdb_work(vha, ea->fcport, 0); in qla_handle_els_plogi_done()
1968 if (vha->host->active_mode == MODE_TARGET) in qla_handle_els_plogi_done()
1971 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla_handle_els_plogi_done()
1974 qla24xx_post_prli_work(vha, ea->fcport); in qla_handle_els_plogi_done()
1996 qla2x00_handle_rscn(fcport->vha, &ea); in qla_rscn_replay()
2034 ql_dbg(ql_dbg_taskm, sp->vha, 0x8004, in qla_marker_sp_done()
2047 if (_chip_gen != sp->vha->hw->chip_reset || _login_gen != sp->fcport->login_gen) {\
2068 struct scsi_qla_host *vha = arg->vha; in qla26xx_marker() local
2076 ql_dbg(ql_dbg_taskm, vha, 0x8039, in qla26xx_marker()
2083 chip_gen = vha->hw->chip_reset; in qla26xx_marker()
2087 sp = qla2xxx_get_qpair_sp(vha, arg->qpair, fcport, GFP_KERNEL); in qla26xx_marker()
2093 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha), qla_marker_sp_done); in qla26xx_marker()
2101 tm_iocb->u.tmf.vp_index = vha->vp_idx; in qla26xx_marker()
2105 ql_dbg(ql_dbg_taskm, vha, 0x8006, in qla26xx_marker()
2111 ql_log(ql_log_warn, vha, 0x8031, in qla26xx_marker()
2120 ql_log(ql_log_warn, vha, 0x8019, in qla26xx_marker()
2146 return qla2x00_eh_wait_for_pending_commands(arg->vha, in qla_tmf_wait()
2149 return qla2x00_eh_wait_for_pending_commands(arg->vha, in qla_tmf_wait()
2156 struct scsi_qla_host *vha = arg->vha; in __qla2x00_async_tm_cmd() local
2165 ql_dbg(ql_dbg_taskm, vha, 0x8032, in __qla2x00_async_tm_cmd()
2172 chip_gen = vha->hw->chip_reset; in __qla2x00_async_tm_cmd()
2176 sp = qla2xxx_get_qpair_sp(vha, arg->qpair, fcport, GFP_KERNEL); in __qla2x00_async_tm_cmd()
2180 qla_vha_mark_busy(vha); in __qla2x00_async_tm_cmd()
2183 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha), in __qla2x00_async_tm_cmd()
2194 ql_dbg(ql_dbg_taskm, vha, 0x802f, in __qla2x00_async_tm_cmd()
2206 ql_log(ql_log_warn, vha, 0x8030, in __qla2x00_async_tm_cmd()
2210 if (!test_bit(UNLOADING, &vha->dpc_flags) && !IS_QLAFX00(vha->hw)) { in __qla2x00_async_tm_cmd()
2213 ql_log(ql_log_info, vha, 0x803e, in __qla2x00_async_tm_cmd()
2215 jiffies_to_msecs(jiffies - jif), vha->host_no, in __qla2x00_async_tm_cmd()
2219 if (chip_gen == vha->hw->chip_reset && login_gen == fcport->login_gen) { in __qla2x00_async_tm_cmd()
2222 ql_log(ql_log_info, vha, 0x803e, in __qla2x00_async_tm_cmd()
2224 vha->host_no, fcport->d_id.b24, arg->lun); in __qla2x00_async_tm_cmd()
2240 struct scsi_qla_host *vha = arg->vha; in qla_put_tmf() local
2241 struct qla_hw_data *ha = vha->hw; in qla_put_tmf()
2253 struct scsi_qla_host *vha = arg->vha; in qla_get_tmf() local
2254 struct qla_hw_data *ha = vha->hw; in qla_get_tmf()
2264 ql_log(ql_log_warn, vha, 0x802c, in qla_get_tmf()
2266 vha->host_no, fcport->d_id.b24, arg->lun); in qla_get_tmf()
2280 ql_log(ql_log_warn, vha, 0x802c, in qla_get_tmf()
2306 struct scsi_qla_host *vha = fcport->vha; in qla2x00_async_tm_cmd() local
2313 a.vha = fcport->vha; in qla2x00_async_tm_cmd()
2328 a.qpair = vha->hw->base_qpair; in qla2x00_async_tm_cmd()
2343 struct scsi_qla_host *vha = fcport->vha; in qla24xx_async_abort_command() local
2358 return qlafx00_fx_disc(vha, &vha->hw->mr.fcport, in qla24xx_async_abort_command()
2365 qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea) in qla24xx_handle_prli_done_event() argument
2373 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_handle_prli_done_event()
2377 ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset; in qla24xx_handle_prli_done_event()
2385 qla24xx_post_gpdb_work(vha, ea->fcport, 0); in qla24xx_handle_prli_done_event()
2389 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_handle_prli_done_event()
2392 vha->hw->fc4_type_priority == FC4_PRIORITY_FCP ? in qla24xx_handle_prli_done_event()
2406 if (N2N_TOPO(vha->hw)) { in qla24xx_handle_prli_done_event()
2408 vha->hw->login_retry_count && in qla24xx_handle_prli_done_event()
2415 vha->hw->login_retry_count) { in qla24xx_handle_prli_done_event()
2417 vha->relogin_jif = jiffies + 2 * HZ; in qla24xx_handle_prli_done_event()
2422 set_bit(N2N_LINK_RESET, &vha->dpc_flags); in qla24xx_handle_prli_done_event()
2423 qla2xxx_wake_dpc(vha); in qla24xx_handle_prli_done_event()
2425 ql_log(ql_log_warn, vha, 0x2119, in qla24xx_handle_prli_done_event()
2445 qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) in qla24xx_handle_plogi_done_event() argument
2453 ql_dbg(ql_dbg_disc, vha, 0xffff, in qla24xx_handle_plogi_done_event()
2462 ql_dbg(ql_dbg_disc, vha, 0x20ea, in qla24xx_handle_plogi_done_event()
2470 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_plogi_done_event()
2476 ql_dbg(ql_dbg_disc, vha, 0x20d3, in qla24xx_handle_plogi_done_event()
2479 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_plogi_done_event()
2482 ql_dbg(ql_dbg_disc, vha, 0x20d3, in qla24xx_handle_plogi_done_event()
2500 if (vha->hw->flags.edif_enabled) { in qla24xx_handle_plogi_done_event()
2501 set_bit(ea->fcport->loop_id, vha->hw->loop_id_map); in qla24xx_handle_plogi_done_event()
2502 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_handle_plogi_done_event()
2503 ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset; in qla24xx_handle_plogi_done_event()
2507 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_handle_plogi_done_event()
2509 qla24xx_post_gpdb_work(vha, ea->fcport, 0); in qla24xx_handle_plogi_done_event()
2511 if (NVME_TARGET(vha->hw, fcport)) { in qla24xx_handle_plogi_done_event()
2512 ql_dbg(ql_dbg_disc, vha, 0x2117, in qla24xx_handle_plogi_done_event()
2515 qla24xx_post_prli_work(vha, fcport); in qla24xx_handle_plogi_done_event()
2517 ql_dbg(ql_dbg_disc, vha, 0x20ea, in qla24xx_handle_plogi_done_event()
2522 set_bit(fcport->loop_id, vha->hw->loop_id_map); in qla24xx_handle_plogi_done_event()
2523 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_handle_plogi_done_event()
2524 fcport->chip_reset = vha->hw->base_qpair->chip_reset; in qla24xx_handle_plogi_done_event()
2528 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_handle_plogi_done_event()
2530 qla24xx_post_gpdb_work(vha, fcport, 0); in qla24xx_handle_plogi_done_event()
2535 ql_dbg(ql_dbg_disc, vha, 0x20eb, "%s %d %8phC cmd error %x\n", in qla24xx_handle_plogi_done_event()
2547 ql_dbg(ql_dbg_disc, vha, 0x20ec, in qla24xx_handle_plogi_done_event()
2552 set_bit(ea->fcport->loop_id, vha->hw->loop_id_map); in qla24xx_handle_plogi_done_event()
2554 qla24xx_post_gnl_work(vha, ea->fcport); in qla24xx_handle_plogi_done_event()
2558 qlt_find_sess_invalidate_other(vha, in qla24xx_handle_plogi_done_event()
2571 ql_dbg(ql_dbg_disc, vha, 0x20ed, in qla24xx_handle_plogi_done_event()
2576 ql_dbg(ql_dbg_disc, vha, 0x20ed, in qla24xx_handle_plogi_done_event()
2582 set_bit(lid, vha->hw->loop_id_map); in qla24xx_handle_plogi_done_event()
2598 qla83xx_nic_core_fw_load(scsi_qla_host_t *vha) in qla83xx_nic_core_fw_load() argument
2601 struct qla_hw_data *ha = vha->hw; in qla83xx_nic_core_fw_load()
2605 qla83xx_idc_lock(vha, 0); in qla83xx_nic_core_fw_load()
2614 if (__qla83xx_set_drv_presence(vha) != QLA_SUCCESS) { in qla83xx_nic_core_fw_load()
2615 ql_dbg(ql_dbg_p3p, vha, 0xb077, in qla83xx_nic_core_fw_load()
2622 qla83xx_reset_ownership(vha); in qla83xx_nic_core_fw_load()
2630 qla83xx_rd_reg(vha, QLA83XX_IDC_MAJOR_VERSION, &idc_major_ver); in qla83xx_nic_core_fw_load()
2634 qla83xx_wr_reg(vha, QLA83XX_IDC_MAJOR_VERSION, idc_major_ver); in qla83xx_nic_core_fw_load()
2637 qla83xx_wr_reg(vha, QLA83XX_IDC_LOCK_RECOVERY, 0); in qla83xx_nic_core_fw_load()
2643 ql_log(ql_log_warn, vha, 0xb07d, in qla83xx_nic_core_fw_load()
2646 __qla83xx_clear_drv_presence(vha); in qla83xx_nic_core_fw_load()
2651 qla83xx_rd_reg(vha, QLA83XX_IDC_MINOR_VERSION, &idc_minor_ver); in qla83xx_nic_core_fw_load()
2653 qla83xx_wr_reg(vha, QLA83XX_IDC_MINOR_VERSION, idc_minor_ver); in qla83xx_nic_core_fw_load()
2657 if (!qla81xx_get_port_config(vha, config)) in qla83xx_nic_core_fw_load()
2658 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE, in qla83xx_nic_core_fw_load()
2662 rval = qla83xx_idc_state_handler(vha); in qla83xx_nic_core_fw_load()
2665 qla83xx_idc_unlock(vha, 0); in qla83xx_nic_core_fw_load()
2681 qla2x00_initialize_adapter(scsi_qla_host_t *vha) in qla2x00_initialize_adapter() argument
2684 struct qla_hw_data *ha = vha->hw; in qla2x00_initialize_adapter()
2688 memset(&vha->qla_stats, 0, sizeof(vha->qla_stats)); in qla2x00_initialize_adapter()
2689 memset(&vha->fc_host_stat, 0, sizeof(vha->fc_host_stat)); in qla2x00_initialize_adapter()
2692 vha->flags.online = 0; in qla2x00_initialize_adapter()
2694 vha->flags.reset_active = 0; in qla2x00_initialize_adapter()
2697 vha->qla_stats.jiffies_at_last_reset = get_jiffies_64(); in qla2x00_initialize_adapter()
2698 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); in qla2x00_initialize_adapter()
2699 atomic_set(&vha->loop_state, LOOP_DOWN); in qla2x00_initialize_adapter()
2700 vha->device_flags = DFLG_NO_CABLE; in qla2x00_initialize_adapter()
2701 vha->dpc_flags = 0; in qla2x00_initialize_adapter()
2702 vha->flags.management_server_logged_in = 0; in qla2x00_initialize_adapter()
2703 vha->marker_needed = 0; in qla2x00_initialize_adapter()
2710 ql_dbg(ql_dbg_init, vha, 0x0040, in qla2x00_initialize_adapter()
2712 rval = ha->isp_ops->pci_config(vha); in qla2x00_initialize_adapter()
2714 ql_log(ql_log_warn, vha, 0x0044, in qla2x00_initialize_adapter()
2719 ha->isp_ops->reset_chip(vha); in qla2x00_initialize_adapter()
2725 ql_log(ql_log_info, vha, 0xffff, "Secure Adapter: %s\n", in qla2x00_initialize_adapter()
2730 rval = qla2xxx_get_flash_info(vha); in qla2x00_initialize_adapter()
2732 ql_log(ql_log_fatal, vha, 0x004f, in qla2x00_initialize_adapter()
2738 qla8044_read_reset_template(vha); in qla2x00_initialize_adapter()
2745 qla8044_set_idc_dontreset(vha); in qla2x00_initialize_adapter()
2748 ha->isp_ops->get_flash_version(vha, req->ring); in qla2x00_initialize_adapter()
2749 ql_dbg(ql_dbg_init, vha, 0x0061, in qla2x00_initialize_adapter()
2755 ha->isp_ops->nvram_config(vha); in qla2x00_initialize_adapter()
2761 ql_log(ql_log_info, vha, 0xffff, "FC4 priority set to %s\n", in qla2x00_initialize_adapter()
2766 ql_log(ql_log_info, vha, 0x0077, in qla2x00_initialize_adapter()
2767 "Masking HBA WWPN %8phN (via NVRAM).\n", vha->port_name); in qla2x00_initialize_adapter()
2771 ql_dbg(ql_dbg_init, vha, 0x0078, in qla2x00_initialize_adapter()
2780 if (qla2x00_isp_firmware(vha) != QLA_SUCCESS) { in qla2x00_initialize_adapter()
2781 rval = ha->isp_ops->chip_diag(vha); in qla2x00_initialize_adapter()
2784 rval = qla2x00_setup_chip(vha); in qla2x00_initialize_adapter()
2790 ha->cs84xx = qla84xx_get_chip(vha); in qla2x00_initialize_adapter()
2792 ql_log(ql_log_warn, vha, 0x00d0, in qla2x00_initialize_adapter()
2798 if (qla_ini_mode_enabled(vha) || qla_dual_mode_enabled(vha)) in qla2x00_initialize_adapter()
2799 rval = qla2x00_init_rings(vha); in qla2x00_initialize_adapter()
2809 rval = qla84xx_init_chip(vha); in qla2x00_initialize_adapter()
2811 ql_log(ql_log_warn, vha, 0x00d4, in qla2x00_initialize_adapter()
2813 qla84xx_put_chip(vha); in qla2x00_initialize_adapter()
2819 rval = qla83xx_nic_core_fw_load(vha); in qla2x00_initialize_adapter()
2821 ql_log(ql_log_warn, vha, 0x0124, in qla2x00_initialize_adapter()
2826 qla24xx_read_fcp_prio_cfg(vha); in qla2x00_initialize_adapter()
2829 qla82xx_set_driver_version(vha, QLA2XXX_VERSION); in qla2x00_initialize_adapter()
2831 qla25xx_set_driver_version(vha, QLA2XXX_VERSION); in qla2x00_initialize_adapter()
2843 qla2100_pci_config(scsi_qla_host_t *vha) in qla2100_pci_config() argument
2847 struct qla_hw_data *ha = vha->hw; in qla2100_pci_config()
2874 qla2300_pci_config(scsi_qla_host_t *vha) in qla2300_pci_config() argument
2879 struct qla_hw_data *ha = vha->hw; in qla2300_pci_config()
2956 qla24xx_pci_config(scsi_qla_host_t *vha) in qla24xx_pci_config() argument
2960 struct qla_hw_data *ha = vha->hw; in qla24xx_pci_config()
3000 qla25xx_pci_config(scsi_qla_host_t *vha) in qla25xx_pci_config() argument
3003 struct qla_hw_data *ha = vha->hw; in qla25xx_pci_config()
3031 qla2x00_isp_firmware(scsi_qla_host_t *vha) in qla2x00_isp_firmware() argument
3036 struct qla_hw_data *ha = vha->hw; in qla2x00_isp_firmware()
3042 ql_log(ql_log_info, vha, 0x0079, "RISC CODE NOT loaded.\n"); in qla2x00_isp_firmware()
3045 rval = qla2x00_verify_checksum(vha, ha->fw_srisc_address); in qla2x00_isp_firmware()
3048 rval = qla2x00_get_adapter_id(vha, &loop_id, &al_pa, in qla2x00_isp_firmware()
3054 ql_dbg(ql_dbg_init, vha, 0x007a, in qla2x00_isp_firmware()
3067 qla2x00_reset_chip(scsi_qla_host_t *vha) in qla2x00_reset_chip() argument
3070 struct qla_hw_data *ha = vha->hw; in qla2x00_reset_chip()
3214 qla81xx_reset_mpi(scsi_qla_host_t *vha) in qla81xx_reset_mpi() argument
3218 if (!IS_QLA81XX(vha->hw)) in qla81xx_reset_mpi()
3221 return qla81xx_write_mpi_register(vha, mb); in qla81xx_reset_mpi()
3225 qla_chk_risc_recovery(scsi_qla_host_t *vha) in qla_chk_risc_recovery() argument
3227 struct qla_hw_data *ha = vha->hw; in qla_chk_risc_recovery()
3248 ql_log(ql_log_warn, vha, 0x1015, in qla_chk_risc_recovery()
3251 ql_log(ql_log_warn, vha, 0x1015, in qla_chk_risc_recovery()
3255 ql_log(ql_log_warn, vha, 0x1015, in qla_chk_risc_recovery()
3259 ql_log(ql_log_warn, vha, 0x1015, in qla_chk_risc_recovery()
3274 qla24xx_reset_risc(scsi_qla_host_t *vha) in qla24xx_reset_risc() argument
3277 struct qla_hw_data *ha = vha->hw; in qla24xx_reset_risc()
3299 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x017e, in qla24xx_reset_risc()
3325 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x017f, in qla24xx_reset_risc()
3343 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x015d, in qla24xx_reset_risc()
3349 if (test_and_clear_bit(MPI_RESET_NEEDED, &vha->dpc_flags)) { in qla24xx_reset_risc()
3350 if (qla81xx_reset_mpi(vha) != QLA_SUCCESS) { in qla24xx_reset_risc()
3352 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla24xx_reset_risc()
3353 set_bit(MPI_RESET_NEEDED, &vha->dpc_flags); in qla24xx_reset_risc()
3360 vha->flags.online = 0; in qla24xx_reset_risc()
3380 if (print && qla_chk_risc_recovery(vha)) in qla24xx_reset_risc()
3387 ql_log(ql_log_warn, vha, 0x015e, in qla24xx_reset_risc()
3395 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x015e, in qla24xx_reset_risc()
3402 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x015f, in qla24xx_reset_risc()
3413 qla25xx_read_risc_sema_reg(scsi_qla_host_t *vha, uint32_t *data) in qla25xx_read_risc_sema_reg() argument
3415 struct device_reg_24xx __iomem *reg = &vha->hw->iobase->isp24; in qla25xx_read_risc_sema_reg()
3422 qla25xx_write_risc_sema_reg(scsi_qla_host_t *vha, uint32_t data) in qla25xx_write_risc_sema_reg() argument
3424 struct device_reg_24xx __iomem *reg = &vha->hw->iobase->isp24; in qla25xx_write_risc_sema_reg()
3431 qla25xx_manipulate_risc_semaphore(scsi_qla_host_t *vha) in qla25xx_manipulate_risc_semaphore() argument
3439 if (vha->hw->pdev->subsystem_device != 0x0175 && in qla25xx_manipulate_risc_semaphore()
3440 vha->hw->pdev->subsystem_device != 0x0240) in qla25xx_manipulate_risc_semaphore()
3443 wrt_reg_dword(&vha->hw->iobase->isp24.hccr, HCCRX_SET_RISC_PAUSE); in qla25xx_manipulate_risc_semaphore()
3450 qla25xx_write_risc_sema_reg(vha, RISC_SEMAPHORE_SET); in qla25xx_manipulate_risc_semaphore()
3451 qla25xx_read_risc_sema_reg(vha, &wd32); in qla25xx_manipulate_risc_semaphore()
3466 qla25xx_write_risc_sema_reg(vha, RISC_SEMAPHORE_CLR); in qla25xx_manipulate_risc_semaphore()
3470 qla25xx_read_risc_sema_reg(vha, &wd32); in qla25xx_manipulate_risc_semaphore()
3480 qla25xx_write_risc_sema_reg(vha, RISC_SEMAPHORE_FORCE_CLR); in qla25xx_manipulate_risc_semaphore()
3485 qla25xx_write_risc_sema_reg(vha, RISC_SEMAPHORE_FORCE_SET); in qla25xx_manipulate_risc_semaphore()
3498 qla24xx_reset_chip(scsi_qla_host_t *vha) in qla24xx_reset_chip() argument
3500 struct qla_hw_data *ha = vha->hw; in qla24xx_reset_chip()
3510 qla25xx_manipulate_risc_semaphore(vha); in qla24xx_reset_chip()
3513 rval = qla24xx_reset_risc(vha); in qla24xx_reset_chip()
3525 qla2x00_chip_diag(scsi_qla_host_t *vha) in qla2x00_chip_diag() argument
3528 struct qla_hw_data *ha = vha->hw; in qla2x00_chip_diag()
3539 ql_dbg(ql_dbg_init, vha, 0x007b, "Testing device at %p.\n", in qla2x00_chip_diag()
3562 ql_dbg(ql_dbg_init, vha, 0x007c, in qla2x00_chip_diag()
3584 ql_dbg(ql_dbg_init, vha, 0x007d, "Checking product ID of chip.\n"); in qla2x00_chip_diag()
3592 ql_log(ql_log_warn, vha, 0x0062, in qla2x00_chip_diag()
3613 ql_dbg(ql_dbg_init, vha, 0x007e, "Found QLA2200A Chip.\n"); in qla2x00_chip_diag()
3622 ql_dbg(ql_dbg_init, vha, 0x007f, "Checking mailboxes.\n"); in qla2x00_chip_diag()
3623 rval = qla2x00_mbx_reg_test(vha); in qla2x00_chip_diag()
3625 ql_log(ql_log_warn, vha, 0x0080, in qla2x00_chip_diag()
3634 ql_log(ql_log_info, vha, 0x0081, in qla2x00_chip_diag()
3649 qla24xx_chip_diag(scsi_qla_host_t *vha) in qla24xx_chip_diag() argument
3652 struct qla_hw_data *ha = vha->hw; in qla24xx_chip_diag()
3660 rval = qla2x00_mbx_reg_test(vha); in qla24xx_chip_diag()
3662 ql_log(ql_log_warn, vha, 0x0082, in qla24xx_chip_diag()
3673 qla2x00_init_fce_trace(scsi_qla_host_t *vha) in qla2x00_init_fce_trace() argument
3678 struct qla_hw_data *ha = vha->hw; in qla2x00_init_fce_trace()
3688 ql_dbg(ql_dbg_init, vha, 0x00bd, in qla2x00_init_fce_trace()
3698 ql_log(ql_log_warn, vha, 0x00be, in qla2x00_init_fce_trace()
3704 rval = qla2x00_enable_fce_trace(vha, tc_dma, FCE_NUM_BUFFERS, in qla2x00_init_fce_trace()
3707 ql_log(ql_log_warn, vha, 0x00bf, in qla2x00_init_fce_trace()
3713 ql_dbg(ql_dbg_init, vha, 0x00c0, in qla2x00_init_fce_trace()
3722 qla2x00_init_eft_trace(scsi_qla_host_t *vha) in qla2x00_init_eft_trace() argument
3727 struct qla_hw_data *ha = vha->hw; in qla2x00_init_eft_trace()
3733 ql_dbg(ql_dbg_init, vha, 0x00bd, in qla2x00_init_eft_trace()
3743 ql_log(ql_log_warn, vha, 0x00c1, in qla2x00_init_eft_trace()
3749 rval = qla2x00_enable_eft_trace(vha, tc_dma, EFT_NUM_BUFFERS); in qla2x00_init_eft_trace()
3751 ql_log(ql_log_warn, vha, 0x00c2, in qla2x00_init_eft_trace()
3757 ql_dbg(ql_dbg_init, vha, 0x00c3, in qla2x00_init_eft_trace()
3765 qla2x00_alloc_offload_mem(scsi_qla_host_t *vha) in qla2x00_alloc_offload_mem() argument
3767 qla2x00_init_fce_trace(vha); in qla2x00_alloc_offload_mem()
3768 qla2x00_init_eft_trace(vha); in qla2x00_alloc_offload_mem()
3772 qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) in qla2x00_alloc_fw_dump() argument
3776 struct qla_hw_data *ha = vha->hw; in qla2x00_alloc_fw_dump()
3782 ql_dbg(ql_dbg_init, vha, 0x00bd, in qla2x00_alloc_fw_dump()
3825 qla2x00_init_fce_trace(vha); in qla2x00_alloc_fw_dump()
3828 qla2x00_init_eft_trace(vha); in qla2x00_alloc_fw_dump()
3839 ql_dbg(ql_dbg_init, vha, 0x00ba, in qla2x00_alloc_fw_dump()
3843 ql_dbg(ql_dbg_init, vha, 0x00fa, in qla2x00_alloc_fw_dump()
3846 vha, fwdt->template); in qla2x00_alloc_fw_dump()
3847 ql_dbg(ql_dbg_init, vha, 0x00fa, in qla2x00_alloc_fw_dump()
3872 ql_dbg(ql_dbg_init, vha, 0x00c5, in qla2x00_alloc_fw_dump()
3879 ql_log(ql_log_warn, vha, 0x00c4, in qla2x00_alloc_fw_dump()
3889 ql_dbg(ql_dbg_init, vha, 0x00c5, in qla2x00_alloc_fw_dump()
3898 ql_dbg(ql_dbg_init, vha, 0x00c5, in qla2x00_alloc_fw_dump()
3936 qla81xx_mpi_sync(scsi_qla_host_t *vha) in qla81xx_mpi_sync() argument
3943 if (!IS_QLA81XX(vha->hw)) in qla81xx_mpi_sync()
3946 rval = qla2x00_write_ram_word(vha, 0x7c00, 1); in qla81xx_mpi_sync()
3948 ql_log(ql_log_warn, vha, 0x0105, in qla81xx_mpi_sync()
3953 pci_read_config_word(vha->hw->pdev, 0x54, &dc); in qla81xx_mpi_sync()
3954 rval = qla2x00_read_ram_word(vha, 0x7a15, &dw); in qla81xx_mpi_sync()
3956 ql_log(ql_log_warn, vha, 0x0067, "Unable to read sync.\n"); in qla81xx_mpi_sync()
3966 rval = qla2x00_write_ram_word(vha, 0x7a15, dw); in qla81xx_mpi_sync()
3968 ql_log(ql_log_warn, vha, 0x0114, "Unable to gain sync.\n"); in qla81xx_mpi_sync()
3972 rval = qla2x00_write_ram_word(vha, 0x7c00, 0); in qla81xx_mpi_sync()
3974 ql_log(ql_log_warn, vha, 0x006d, in qla81xx_mpi_sync()
4038 static void qla2xxx_print_sfp_info(struct scsi_qla_host *vha) in qla2xxx_print_sfp_info() argument
4041 struct sff_8247_a0 *a0 = (struct sff_8247_a0 *)vha->hw->sfp_data; in qla2xxx_print_sfp_info()
4047 ql_dbg(ql_dbg_init, vha, 0x015a, in qla2xxx_print_sfp_info()
4052 ql_dbg(ql_dbg_init, vha, 0x015c, in qla2xxx_print_sfp_info()
4067 ql_dbg(ql_dbg_init, vha, 0x0160, in qla2xxx_print_sfp_info()
4080 ql_dbg(ql_dbg_init, vha, 0x0196, in qla2xxx_print_sfp_info()
4092 ql_dbg(ql_dbg_init, vha, 0x016e, in qla2xxx_print_sfp_info()
4096 ql_dbg(ql_dbg_init, vha, 0x016f, in qla2xxx_print_sfp_info()
4099 ql_dbg(ql_dbg_init, vha, 0x0170, in qla2xxx_print_sfp_info()
4102 ql_dbg(ql_dbg_init, vha, 0x0189, in qla2xxx_print_sfp_info()
4105 ql_dbg(ql_dbg_init, vha, 0x018a, in qla2xxx_print_sfp_info()
4108 ql_dbg(ql_dbg_init, vha, 0x0194, in qla2xxx_print_sfp_info()
4111 ql_dbg(ql_dbg_init, vha, 0x0195, in qla2xxx_print_sfp_info()
4131 qla24xx_detect_sfp(scsi_qla_host_t *vha) in qla24xx_detect_sfp() argument
4135 struct qla_hw_data *ha = vha->hw; in qla24xx_detect_sfp()
4154 if (!IS_BPM_ENABLED(vha)) in qla24xx_detect_sfp()
4157 rc = qla2x00_read_sfp_dev(vha, NULL, 0); in qla24xx_detect_sfp()
4162 a = (struct sff_8247_a0 *)vha->hw->sfp_data; in qla24xx_detect_sfp()
4163 qla2xxx_print_sfp_info(vha); in qla24xx_detect_sfp()
4178 ql_dbg(ql_dbg_async, vha, 0x507b, in qla24xx_detect_sfp()
4191 struct qla_hw_data *ha = qpair->vha->hw; in __qla_adjust_iocb_limit()
4205 void qla_init_iocb_limit(scsi_qla_host_t *vha) in qla_init_iocb_limit() argument
4208 struct qla_hw_data *ha = vha->hw; in qla_init_iocb_limit()
4231 void qla_adjust_iocb_limit(scsi_qla_host_t *vha) in qla_adjust_iocb_limit() argument
4234 struct qla_hw_data *ha = vha->hw; in qla_adjust_iocb_limit()
4251 qla2x00_setup_chip(scsi_qla_host_t *vha) in qla2x00_setup_chip() argument
4255 struct qla_hw_data *ha = vha->hw; in qla2x00_setup_chip()
4262 rval = ha->isp_ops->load_risc(vha, &srisc_address); in qla2x00_setup_chip()
4264 qla2x00_stop_firmware(vha); in qla2x00_setup_chip()
4278 qla81xx_mpi_sync(vha); in qla2x00_setup_chip()
4282 rval = ha->isp_ops->load_risc(vha, &srisc_address); in qla2x00_setup_chip()
4284 ql_dbg(ql_dbg_init, vha, 0x00c9, in qla2x00_setup_chip()
4287 rval = qla2x00_verify_checksum(vha, srisc_address); in qla2x00_setup_chip()
4290 ql_dbg(ql_dbg_init, vha, 0x00ca, in qla2x00_setup_chip()
4296 if (qla_is_exch_offld_enabled(vha)) in qla2x00_setup_chip()
4299 rval = qla2x00_execute_fw(vha, srisc_address); in qla2x00_setup_chip()
4303 if (!done_once++ && qla24xx_detect_sfp(vha)) { in qla2x00_setup_chip()
4304 ql_dbg(ql_dbg_init, vha, 0x00ca, in qla2x00_setup_chip()
4307 ha->isp_ops->reset_chip(vha); in qla2x00_setup_chip()
4308 ha->isp_ops->chip_diag(vha); in qla2x00_setup_chip()
4313 qla27xx_set_zio_threshold(vha, in qla2x00_setup_chip()
4316 rval = qla2x00_set_exlogins_buffer(vha); in qla2x00_setup_chip()
4320 rval = qla2x00_set_exchoffld_buffer(vha); in qla2x00_setup_chip()
4327 qla82xx_check_md_needed(vha); in qla2x00_setup_chip()
4329 rval = qla2x00_get_fw_version(vha); in qla2x00_setup_chip()
4342 qla2x00_get_resource_cnts(vha); in qla2x00_setup_chip()
4343 qla_init_iocb_limit(vha); in qla2x00_setup_chip()
4350 vha->req); in qla2x00_setup_chip()
4355 qla2x00_alloc_offload_mem(vha); in qla2x00_setup_chip()
4358 qla2x00_alloc_fw_dump(vha); in qla2x00_setup_chip()
4364 ql_log(ql_log_fatal, vha, 0x00cd, in qla2x00_setup_chip()
4372 qla25xx_set_els_cmds_supported(vha); in qla2x00_setup_chip()
4394 rval = qla81xx_fac_get_sector_size(vha, &size); in qla2x00_setup_chip()
4399 ql_log(ql_log_warn, vha, 0x00ce, in qla2x00_setup_chip()
4412 ql_log(ql_log_fatal, vha, 0x00cf, in qla2x00_setup_chip()
4451 qla2x00_update_fw_options(scsi_qla_host_t *vha) in qla2x00_update_fw_options() argument
4454 struct qla_hw_data *ha = vha->hw; in qla2x00_update_fw_options()
4457 qla2x00_get_fw_options(vha, ha->fw_options); in qla2x00_update_fw_options()
4463 ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x0115, in qla2x00_update_fw_options()
4465 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x0109, in qla2x00_update_fw_options()
4524 ql_dbg(ql_dbg_disc, vha, 0x2100, in qla2x00_update_fw_options()
4530 qla2x00_set_fw_options(vha, ha->fw_options); in qla2x00_update_fw_options()
4534 qla24xx_update_fw_options(scsi_qla_host_t *vha) in qla24xx_update_fw_options() argument
4537 struct qla_hw_data *ha = vha->hw; in qla24xx_update_fw_options()
4549 ql_dbg(ql_dbg_disc, vha, 0x2101, in qla24xx_update_fw_options()
4557 if (qla_tgt_mode_enabled(vha) || in qla24xx_update_fw_options()
4558 qla_dual_mode_enabled(vha)) in qla24xx_update_fw_options()
4570 if (qla_tgt_mode_enabled(vha) || in qla24xx_update_fw_options()
4571 qla_dual_mode_enabled(vha)) in qla24xx_update_fw_options()
4587 DBELL_ACTIVE(vha)) { in qla24xx_update_fw_options()
4604 ql_dbg(ql_dbg_init, vha, 0x00e8, in qla24xx_update_fw_options()
4607 ha->fw_options[3], vha->host->active_mode); in qla24xx_update_fw_options()
4610 qla2x00_set_fw_options(vha, ha->fw_options); in qla24xx_update_fw_options()
4616 rval = qla2x00_set_serdes_params(vha, in qla24xx_update_fw_options()
4621 ql_log(ql_log_warn, vha, 0x0104, in qla24xx_update_fw_options()
4627 qla2x00_config_rings(struct scsi_qla_host *vha) in qla2x00_config_rings() argument
4629 struct qla_hw_data *ha = vha->hw; in qla2x00_config_rings()
4650 qla24xx_config_rings(struct scsi_qla_host *vha) in qla24xx_config_rings() argument
4652 struct qla_hw_data *ha = vha->hw; in qla24xx_config_rings()
4684 ql_dbg(ql_dbg_init, vha, 0x0019, in qla24xx_config_rings()
4701 ql_dbg(ql_dbg_init, vha, 0x00fe, in qla24xx_config_rings()
4719 qlt_24xx_config_rings(vha); in qla24xx_config_rings()
4723 ql_dbg(ql_dbg_init, vha, 0x00fd, in qla24xx_config_rings()
4743 qla2x00_init_rings(scsi_qla_host_t *vha) in qla2x00_init_rings() argument
4748 struct qla_hw_data *ha = vha->hw; in qla2x00_init_rings()
4790 qlt_init_atio_q_entries(vha); in qla2x00_init_rings()
4792 ha->isp_ops->config_rings(vha); in qla2x00_init_rings()
4797 rval = qlafx00_init_firmware(vha, ha->init_cb_size); in qla2x00_init_rings()
4802 ha->isp_ops->update_fw_options(vha); in qla2x00_init_rings()
4804 ql_dbg(ql_dbg_init, vha, 0x00d1, in qla2x00_init_rings()
4823 ql_dbg(ql_dbg_init, vha, 0x0191, "DPORT Support: %s.\n", in qla2x00_init_rings()
4829 ql_dbg(ql_dbg_init, vha, 0x00bc, "FA-WWPN Support: %s.\n", in qla2x00_init_rings()
4840 rval = qla2x00_init_firmware(vha, ha->init_cb_size); in qla2x00_init_rings()
4844 ql_log(ql_log_fatal, vha, 0x00d2, in qla2x00_init_rings()
4847 ql_dbg(ql_dbg_init, vha, 0x00d3, in qla2x00_init_rings()
4849 vha->u_ql2xexchoffld = vha->u_ql2xiniexchg = 0; in qla2x00_init_rings()
4862 qla2x00_fw_ready(scsi_qla_host_t *vha) in qla2x00_fw_ready() argument
4869 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_ready()
4871 if (IS_QLAFX00(vha->hw)) in qla2x00_fw_ready()
4872 return qlafx00_fw_ready(vha); in qla2x00_fw_ready()
4895 if (!vha->flags.init_done) in qla2x00_fw_ready()
4896 ql_log(ql_log_info, vha, 0x801e, in qla2x00_fw_ready()
4901 rval = qla2x00_get_firmware_state(vha, state); in qla2x00_fw_ready()
4904 vha->device_flags &= ~DFLG_NO_CABLE; in qla2x00_fw_ready()
4907 ql_dbg(ql_dbg_taskm, vha, 0x801f, in qla2x00_fw_ready()
4912 ql_dbg(ql_dbg_taskm, vha, 0x8028, in qla2x00_fw_ready()
4916 rval = qla84xx_init_chip(vha); in qla2x00_fw_ready()
4919 vha, 0x8007, in qla2x00_fw_ready()
4928 ql_dbg(ql_dbg_taskm, vha, 0x8008, in qla2x00_fw_ready()
4934 ql_dbg(ql_dbg_taskm, vha, 0x8037, in qla2x00_fw_ready()
4937 qla2x00_get_retry_cnt(vha, &ha->retry_count, in qla2x00_fw_ready()
4946 if (atomic_read(&vha->loop_down_timer) && in qla2x00_fw_ready()
4952 ql_log(ql_log_info, vha, 0x8038, in qla2x00_fw_ready()
4955 vha->device_flags |= DFLG_NO_CABLE; in qla2x00_fw_ready()
4973 ql_dbg(ql_dbg_taskm, vha, 0x803a, in qla2x00_fw_ready()
4977 if (rval && !(vha->device_flags & DFLG_NO_CABLE)) { in qla2x00_fw_ready()
4978 ql_log(ql_log_warn, vha, 0x803b, in qla2x00_fw_ready()
4999 qla2x00_configure_hba(scsi_qla_host_t *vha) in qla2x00_configure_hba() argument
5009 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_hba()
5015 rval = qla2x00_get_adapter_id(vha, in qla2x00_configure_hba()
5018 if (LOOP_TRANSITION(vha) || atomic_read(&ha->loop_down_timer) || in qla2x00_configure_hba()
5021 ql_dbg(ql_dbg_disc, vha, 0x2008, in qla2x00_configure_hba()
5024 ql_log(ql_log_warn, vha, 0x2009, in qla2x00_configure_hba()
5026 if (IS_FWI2_CAPABLE(ha) && (vha == base_vha) && in qla2x00_configure_hba()
5028 ql_log(ql_log_warn, vha, 0x1151, in qla2x00_configure_hba()
5030 if (qla24xx_link_initialize(vha) == QLA_SUCCESS) in qla2x00_configure_hba()
5033 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_configure_hba()
5039 ql_log(ql_log_info, vha, 0x200a, in qla2x00_configure_hba()
5044 vha->loop_id = loop_id; in qla2x00_configure_hba()
5052 ql_dbg(ql_dbg_disc, vha, 0x200b, "HBA in NL topology.\n"); in qla2x00_configure_hba()
5059 ql_dbg(ql_dbg_disc, vha, 0x200c, "HBA in FL topology.\n"); in qla2x00_configure_hba()
5066 ql_dbg(ql_dbg_disc, vha, 0x200d, "HBA in N P2P topology.\n"); in qla2x00_configure_hba()
5074 ql_dbg(ql_dbg_disc, vha, 0x200e, "HBA in F P2P topology.\n"); in qla2x00_configure_hba()
5082 ql_dbg(ql_dbg_disc, vha, 0x200f, in qla2x00_configure_hba()
5097 if (vha->hw->flags.edif_enabled) { in qla2x00_configure_hba()
5099 qlt_update_host_map(vha, id); in qla2x00_configure_hba()
5101 qlt_update_host_map(vha, id); in qla2x00_configure_hba()
5104 if (!vha->flags.init_done) in qla2x00_configure_hba()
5105 ql_log(ql_log_info, vha, 0x2010, in qla2x00_configure_hba()
5107 connect_type, vha->loop_id); in qla2x00_configure_hba()
5113 qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len, in qla2x00_set_model_info() argument
5119 struct qla_hw_data *ha = vha->hw; in qla2x00_set_model_info()
5159 qla2xxx_get_vpd_field(vha, "\x82", ha->model_desc, in qla2x00_set_model_info()
5166 static void qla2xxx_nvram_wwn_from_ofw(scsi_qla_host_t *vha, nvram_t *nv) in qla2xxx_nvram_wwn_from_ofw() argument
5169 struct qla_hw_data *ha = vha->hw; in qla2xxx_nvram_wwn_from_ofw()
5199 qla2x00_nvram_config(scsi_qla_host_t *vha) in qla2x00_nvram_config() argument
5205 struct qla_hw_data *ha = vha->hw; in qla2x00_nvram_config()
5221 ha->isp_ops->read_nvram(vha, ptr, ha->nvram_base, ha->nvram_size); in qla2x00_nvram_config()
5225 ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x010f, in qla2x00_nvram_config()
5227 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x0110, in qla2x00_nvram_config()
5234 ql_log(ql_log_warn, vha, 0x0064, in qla2x00_nvram_config()
5237 ql_log(ql_log_warn, vha, 0x0065, in qla2x00_nvram_config()
5275 qla2xxx_nvram_wwn_from_ofw(vha, nv); in qla2x00_nvram_config()
5315 qla2x00_set_model_info(vha, nv->model_number, in qla2x00_nvram_config()
5396 memcpy(vha->node_name, icb->node_name, WWN_SIZE); in qla2x00_nvram_config()
5397 memcpy(vha->port_name, icb->port_name, WWN_SIZE); in qla2x00_nvram_config()
5464 vha->flags.process_response_queue = 1; in qla2x00_nvram_config()
5467 if (!vha->flags.init_done) { in qla2x00_nvram_config()
5475 vha->flags.process_response_queue = 0; in qla2x00_nvram_config()
5479 ql_log(ql_log_info, vha, 0x0068, in qla2x00_nvram_config()
5485 vha->flags.process_response_queue = 1; in qla2x00_nvram_config()
5490 ql_log(ql_log_warn, vha, 0x0069, in qla2x00_nvram_config()
5503 spin_lock_irqsave(fcport->vha->host->host_lock, flags); in qla2x00_rport_del()
5506 spin_unlock_irqrestore(fcport->vha->host->host_lock, flags); in qla2x00_rport_del()
5508 ql_dbg(ql_dbg_disc, fcport->vha, 0x210b, in qla2x00_rport_del()
5526 ql_dbg(ql_dbg_disc, fcport->vha, 0x207d, in qla2x00_set_fcport_state()
5542 qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags) in qla2x00_alloc_fcport() argument
5550 fcport->ct_desc.ct_sns = dma_alloc_coherent(&vha->hw->pdev->dev, in qla2x00_alloc_fcport()
5554 ql_log(ql_log_warn, vha, 0xd049, in qla2x00_alloc_fcport()
5561 fcport->vha = vha; in qla2x00_alloc_fcport()
5571 fcport->login_retry = vha->hw->login_retry_count; in qla2x00_alloc_fcport()
5572 fcport->chip_reset = vha->hw->base_qpair->chip_reset; in qla2x00_alloc_fcport()
5579 ql_log(ql_log_warn, vha, 0xd049, in qla2x00_alloc_fcport()
5598 if (vha->e_dbell.db_flags == EDB_ACTIVE) in qla2x00_alloc_fcport()
5611 dma_free_coherent(&fcport->vha->hw->pdev->dev, in qla2x00_free_fcport()
5627 static void qla_get_login_template(scsi_qla_host_t *vha) in qla_get_login_template() argument
5629 struct qla_hw_data *ha = vha->hw; in qla_get_login_template()
5636 rval = qla24xx_get_port_login_templ(vha, ha->init_cb_dma, in qla_get_login_template()
5639 ql_dbg(ql_dbg_init, vha, 0x00d1, in qla_get_login_template()
5663 qla2x00_configure_loop(scsi_qla_host_t *vha) in qla2x00_configure_loop() argument
5667 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_loop()
5672 if (test_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags)) { in qla2x00_configure_loop()
5673 rval = qla2x00_configure_hba(vha); in qla2x00_configure_loop()
5675 ql_dbg(ql_dbg_disc, vha, 0x2013, in qla2x00_configure_loop()
5681 save_flags = flags = vha->dpc_flags; in qla2x00_configure_loop()
5682 ql_dbg(ql_dbg_disc, vha, 0x2014, in qla2x00_configure_loop()
5689 clear_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
5690 clear_bit(RSCN_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
5692 qla2x00_get_data_rate(vha); in qla2x00_configure_loop()
5693 qla_get_login_template(vha); in qla2x00_configure_loop()
5707 } else if (!vha->flags.online || in qla2x00_configure_loop()
5714 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_loop()
5715 ql_dbg(ql_dbg_disc, vha, 0x2015, in qla2x00_configure_loop()
5719 rval = qla2x00_configure_local_loop(vha); in qla2x00_configure_loop()
5723 if (LOOP_TRANSITION(vha)) { in qla2x00_configure_loop()
5724 ql_dbg(ql_dbg_disc, vha, 0x2099, in qla2x00_configure_loop()
5729 rval = qla2x00_configure_fabric(vha); in qla2x00_configure_loop()
5733 if (atomic_read(&vha->loop_down_timer) || in qla2x00_configure_loop()
5734 test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_loop()
5737 atomic_set(&vha->loop_state, LOOP_READY); in qla2x00_configure_loop()
5738 ql_dbg(ql_dbg_disc, vha, 0x2069, in qla2x00_configure_loop()
5746 if (ha->flags.edif_enabled && DBELL_INACTIVE(vha)) in qla2x00_configure_loop()
5747 qla2x00_post_aen_work(vha, FCH_EVT_LINKUP, in qla2x00_configure_loop()
5754 if (qla_tgt_mode_enabled(vha) || in qla2x00_configure_loop()
5755 qla_dual_mode_enabled(vha)) { in qla2x00_configure_loop()
5757 qlt_24xx_process_atio_queue(vha, 0); in qla2x00_configure_loop()
5765 ql_dbg(ql_dbg_disc, vha, 0x206a, in qla2x00_configure_loop()
5768 ql_dbg(ql_dbg_disc, vha, 0x206b, in qla2x00_configure_loop()
5770 __func__, vha->port_name, vha->d_id.b24); in qla2x00_configure_loop()
5774 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_loop()
5776 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
5778 set_bit(RSCN_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
5785 static int qla2x00_configure_n2n_loop(scsi_qla_host_t *vha) in qla2x00_configure_n2n_loop() argument
5790 ql_dbg(ql_dbg_disc, vha, 0x206a, "%s %d.\n", __func__, __LINE__); in qla2x00_configure_n2n_loop()
5792 if (test_and_clear_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags)) in qla2x00_configure_n2n_loop()
5793 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla2x00_configure_n2n_loop()
5795 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_n2n_loop()
5797 qla24xx_fcport_handle_login(vha, fcport); in qla2x00_configure_n2n_loop()
5802 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_configure_n2n_loop()
5803 vha->scan.scan_retry++; in qla2x00_configure_n2n_loop()
5804 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_configure_n2n_loop()
5806 if (vha->scan.scan_retry < MAX_SCAN_RETRIES) { in qla2x00_configure_n2n_loop()
5807 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_configure_n2n_loop()
5808 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_n2n_loop()
5814 qla_reinitialize_link(scsi_qla_host_t *vha) in qla_reinitialize_link() argument
5818 atomic_set(&vha->loop_state, LOOP_DOWN); in qla_reinitialize_link()
5819 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); in qla_reinitialize_link()
5820 rval = qla2x00_full_login_lip(vha); in qla_reinitialize_link()
5822 ql_dbg(ql_dbg_disc, vha, 0xd050, "Link reinitialized\n"); in qla_reinitialize_link()
5824 ql_dbg(ql_dbg_disc, vha, 0xd051, in qla_reinitialize_link()
5840 qla2x00_configure_local_loop(scsi_qla_host_t *vha) in qla2x00_configure_local_loop() argument
5851 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_local_loop()
5856 return qla2x00_configure_n2n_loop(vha); in qla2x00_configure_local_loop()
5864 rval = qla2x00_get_id_list(vha, ha->gid_list, ha->gid_list_dma, in qla2x00_configure_local_loop()
5869 ql_dbg(ql_dbg_disc, vha, 0x2011, in qla2x00_configure_local_loop()
5871 ql_dump_buffer(ql_dbg_disc + ql_dbg_buffer, vha, 0x2075, in qla2x00_configure_local_loop()
5875 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_configure_local_loop()
5876 vha->scan.scan_retry++; in qla2x00_configure_local_loop()
5877 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_configure_local_loop()
5879 if (vha->scan.scan_retry < MAX_SCAN_RETRIES) { in qla2x00_configure_local_loop()
5883 rc = qla2x00_get_fcal_position_map(vha, NULL, in qla2x00_configure_local_loop()
5890 qla_reinitialize_link(vha); in qla2x00_configure_local_loop()
5893 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_configure_local_loop()
5894 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_local_loop()
5897 vha->scan.scan_retry = 0; in qla2x00_configure_local_loop()
5900 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_local_loop()
5905 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_configure_local_loop()
5907 ql_log(ql_log_warn, vha, 0x2012, in qla2x00_configure_local_loop()
5931 if (area && domain && ((area != vha->d_id.b.area) || in qla2x00_configure_local_loop()
5932 (domain != vha->d_id.b.domain)) && in qla2x00_configure_local_loop()
5950 rval2 = qla2x00_get_port_database(vha, new_fcport, 0); in qla2x00_configure_local_loop()
5952 ql_dbg(ql_dbg_disc, vha, 0x2097, in qla2x00_configure_local_loop()
5958 ql_dbg(ql_dbg_disc, vha, 0x2105, in qla2x00_configure_local_loop()
5960 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_local_loop()
5965 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla2x00_configure_local_loop()
5969 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_local_loop()
5982 fcport->login_retry = vha->hw->login_retry_count; in qla2x00_configure_local_loop()
5983 ql_dbg(ql_dbg_disc, vha, 0x2135, in qla2x00_configure_local_loop()
5994 list_add_tail(&new_fcport->list, &vha->vp_fcports); in qla2x00_configure_local_loop()
5999 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla2x00_configure_local_loop()
6001 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_configure_local_loop()
6004 ql_log(ql_log_warn, vha, 0xd031, in qla2x00_configure_local_loop()
6009 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla2x00_configure_local_loop()
6013 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla2x00_configure_local_loop()
6021 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_local_loop()
6022 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_configure_local_loop()
6026 if ((qla_dual_mode_enabled(vha) || in qla2x00_configure_local_loop()
6027 qla_ini_mode_enabled(vha)) && in qla2x00_configure_local_loop()
6029 qla2x00_mark_device_lost(vha, fcport, in qla2x00_configure_local_loop()
6035 ql_dbg(ql_dbg_disc, vha, 0x20f0, in qla2x00_configure_local_loop()
6047 qla24xx_fcport_handle_login(vha, fcport); in qla2x00_configure_local_loop()
6055 ql_dbg(ql_dbg_disc, vha, 0x2098, in qla2x00_configure_local_loop()
6061 qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_iidma_fcport() argument
6065 struct qla_hw_data *ha = vha->hw; in qla2x00_iidma_fcport()
6078 rval = qla2x00_set_idma_speed(vha, fcport->loop_id, fcport->fp_speed, in qla2x00_iidma_fcport()
6081 ql_dbg(ql_dbg_disc, vha, 0x2004, in qla2x00_iidma_fcport()
6085 ql_dbg(ql_dbg_disc, vha, 0x2005, in qla2x00_iidma_fcport()
6092 void qla_do_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla_do_iidma_work() argument
6094 qla2x00_iidma_fcport(vha, fcport); in qla_do_iidma_work()
6095 qla24xx_update_fcport_fcp_prio(vha, fcport); in qla_do_iidma_work()
6098 int qla_post_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla_post_iidma_work() argument
6102 e = qla2x00_alloc_work(vha, QLA_EVT_IIDMA); in qla_post_iidma_work()
6107 return qla2x00_post_work(vha, e); in qla_post_iidma_work()
6112 qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_reg_remote_port() argument
6126 fcport->rport = rport = fc_remote_port_add(vha->host, 0, &rport_ids); in qla2x00_reg_remote_port()
6128 ql_log(ql_log_warn, vha, 0x2006, in qla2x00_reg_remote_port()
6133 spin_lock_irqsave(fcport->vha->host->host_lock, flags); in qla2x00_reg_remote_port()
6135 spin_unlock_irqrestore(fcport->vha->host->host_lock, flags); in qla2x00_reg_remote_port()
6154 ql_dbg(ql_dbg_disc, vha, 0x20ee, in qla2x00_reg_remote_port()
6156 __func__, fcport->port_name, vha->host_no, in qla2x00_reg_remote_port()
6178 qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_update_fcport() argument
6185 ql_dbg(ql_dbg_disc, vha, 0x20ef, "%s %8phC\n", in qla2x00_update_fcport()
6189 fcport->login_retry = vha->hw->login_retry_count; in qla2x00_update_fcport()
6192 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_update_fcport()
6194 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_update_fcport()
6196 if (vha->hw->current_topology == ISP_CFG_NL) in qla2x00_update_fcport()
6207 switch (vha->hw->current_topology) { in qla2x00_update_fcport()
6216 qla2x00_iidma_fcport(vha, fcport); in qla2x00_update_fcport()
6218 qla2x00_dfs_create_rport(vha, fcport); in qla2x00_update_fcport()
6220 if (NVME_TARGET(vha->hw, fcport)) { in qla2x00_update_fcport()
6221 qla_nvme_register_remote(vha, fcport); in qla2x00_update_fcport()
6227 qla24xx_update_fcport_fcp_prio(vha, fcport); in qla2x00_update_fcport()
6229 switch (vha->host->active_mode) { in qla2x00_update_fcport()
6231 qla2x00_reg_remote_port(vha, fcport); in qla2x00_update_fcport()
6234 if (!vha->vha_tgt.qla_tgt->tgt_stop && in qla2x00_update_fcport()
6235 !vha->vha_tgt.qla_tgt->tgt_stopped) in qla2x00_update_fcport()
6236 qlt_fc_port_added(vha, fcport); in qla2x00_update_fcport()
6239 qla2x00_reg_remote_port(vha, fcport); in qla2x00_update_fcport()
6240 if (!vha->vha_tgt.qla_tgt->tgt_stop && in qla2x00_update_fcport()
6241 !vha->vha_tgt.qla_tgt->tgt_stopped) in qla2x00_update_fcport()
6242 qlt_fc_port_added(vha, fcport); in qla2x00_update_fcport()
6250 if (IS_IIDMA_CAPABLE(vha->hw) && vha->hw->flags.gpsc_supported) { in qla2x00_update_fcport()
6253 ql_dbg(ql_dbg_disc, vha, 0x20d7, in qla2x00_update_fcport()
6256 vha->fcport_count); in qla2x00_update_fcport()
6257 qla24xx_post_gfpnid_work(vha, fcport); in qla2x00_update_fcport()
6259 ql_dbg(ql_dbg_disc, vha, 0x20d7, in qla2x00_update_fcport()
6262 vha->fcport_count); in qla2x00_update_fcport()
6263 qla24xx_post_gpsc_work(vha, fcport); in qla2x00_update_fcport()
6279 qla2x00_update_fcport(fcport->vha, fcport); in qla_register_fcport_fn()
6289 qla2x00_post_async_adisc_work(fcport->vha, fcport, in qla_register_fcport_fn()
6310 qla2x00_configure_fabric(scsi_qla_host_t *vha) in qla2x00_configure_fabric() argument
6317 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_fabric()
6325 rval = qla2x00_get_port_name(vha, loop_id, vha->fabric_node_name, 1); in qla2x00_configure_fabric()
6327 ql_dbg(ql_dbg_disc, vha, 0x20a0, in qla2x00_configure_fabric()
6330 vha->device_flags &= ~SWITCH_FOUND; in qla2x00_configure_fabric()
6333 vha->device_flags |= SWITCH_FOUND; in qla2x00_configure_fabric()
6335 rval = qla2x00_get_port_name(vha, loop_id, vha->fabric_port_name, 0); in qla2x00_configure_fabric()
6337 ql_dbg(ql_dbg_disc, vha, 0x20ff, in qla2x00_configure_fabric()
6340 if (qla_tgt_mode_enabled(vha) || qla_dual_mode_enabled(vha)) { in qla2x00_configure_fabric()
6341 rval = qla2x00_send_change_request(vha, 0x3, 0); in qla2x00_configure_fabric()
6343 ql_log(ql_log_warn, vha, 0x121, in qla2x00_configure_fabric()
6349 qla2x00_mgmt_svr_login(vha); in qla2x00_configure_fabric()
6353 rval = ha->isp_ops->fabric_login(vha, loop_id, 0xff, 0xff, in qla2x00_configure_fabric()
6356 ql_dbg(ql_dbg_disc, vha, 0x20a1, in qla2x00_configure_fabric()
6359 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_fabric()
6365 test_and_clear_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags)) in qla2x00_configure_fabric()
6366 qla2x00_fdmi_register(vha); in qla2x00_configure_fabric()
6368 if (test_and_clear_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_fabric()
6369 if (qla2x00_rft_id(vha)) { in qla2x00_configure_fabric()
6371 ql_dbg(ql_dbg_disc, vha, 0x20a2, in qla2x00_configure_fabric()
6374 &vha->dpc_flags)) in qla2x00_configure_fabric()
6377 if (qla2x00_rff_id(vha, FC4_TYPE_FCP_SCSI)) { in qla2x00_configure_fabric()
6379 ql_dbg(ql_dbg_disc, vha, 0x209a, in qla2x00_configure_fabric()
6382 &vha->dpc_flags)) in qla2x00_configure_fabric()
6385 if (vha->flags.nvme_enabled) { in qla2x00_configure_fabric()
6386 if (qla2x00_rff_id(vha, FC_TYPE_NVME)) { in qla2x00_configure_fabric()
6387 ql_dbg(ql_dbg_disc, vha, 0x2049, in qla2x00_configure_fabric()
6391 if (qla2x00_rnn_id(vha)) { in qla2x00_configure_fabric()
6393 ql_dbg(ql_dbg_disc, vha, 0x2104, in qla2x00_configure_fabric()
6396 &vha->dpc_flags)) in qla2x00_configure_fabric()
6398 } else if (qla2x00_rsnn_nn(vha)) { in qla2x00_configure_fabric()
6400 ql_dbg(ql_dbg_disc, vha, 0x209b, in qla2x00_configure_fabric()
6402 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_configure_fabric()
6414 qlt_do_generation_tick(vha, &discovery_gen); in qla2x00_configure_fabric()
6417 rval = qla24xx_async_gpnft(vha, FC4_TYPE_FCP_SCSI, in qla2x00_configure_fabric()
6420 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_fabric()
6422 list_for_each_entry(fcport, &vha->vp_fcports, list) in qla2x00_configure_fabric()
6425 rval = qla2x00_find_all_fabric_devs(vha); in qla2x00_configure_fabric()
6431 if (!vha->nvme_local_port && vha->flags.nvme_enabled) in qla2x00_configure_fabric()
6432 qla_nvme_register_hba(vha); in qla2x00_configure_fabric()
6435 ql_dbg(ql_dbg_disc, vha, 0x2068, in qla2x00_configure_fabric()
6455 qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) in qla2x00_find_all_fabric_devs() argument
6466 struct qla_hw_data *ha = vha->hw; in qla2x00_find_all_fabric_devs()
6479 ql_dbg(ql_dbg_disc, vha, 0x209c, in qla2x00_find_all_fabric_devs()
6483 if (qla2x00_gid_pt(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
6485 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
6487 } else if (qla2x00_gpn_id(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
6489 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
6491 } else if (qla2x00_gnn_id(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
6493 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
6495 } else if (qla2x00_gfpn_id(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
6497 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
6503 qla2x00_gff_id(vha, swl); in qla2x00_find_all_fabric_devs()
6504 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
6511 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_find_all_fabric_devs()
6513 ql_log(ql_log_warn, vha, 0x209d, in qla2x00_find_all_fabric_devs()
6525 if (qla2x00_is_reserved_id(vha, loop_id)) in qla2x00_find_all_fabric_devs()
6529 (atomic_read(&vha->loop_down_timer) || in qla2x00_find_all_fabric_devs()
6530 LOOP_TRANSITION(vha))) { in qla2x00_find_all_fabric_devs()
6531 atomic_set(&vha->loop_down_timer, 0); in qla2x00_find_all_fabric_devs()
6532 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_find_all_fabric_devs()
6533 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_find_all_fabric_devs()
6552 if (vha->flags.nvme_enabled && in qla2x00_find_all_fabric_devs()
6554 ql_log(ql_log_info, vha, 0x2131, in qla2x00_find_all_fabric_devs()
6566 rval = qla2x00_ga_nxt(vha, new_fcport); in qla2x00_find_all_fabric_devs()
6568 ql_log(ql_log_warn, vha, 0x209e, in qla2x00_find_all_fabric_devs()
6581 ql_dbg(ql_dbg_disc, vha, 0x209f, in qla2x00_find_all_fabric_devs()
6594 if (qla2x00_is_a_vp_did(vha, new_fcport->d_id.b24)) in qla2x00_find_all_fabric_devs()
6599 (vha->d_id.b24 & 0xffff00)) && ha->current_topology == in qla2x00_find_all_fabric_devs()
6613 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla2x00_find_all_fabric_devs()
6617 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_find_all_fabric_devs()
6637 (vha->host->active_mode == MODE_TARGET))) { in qla2x00_find_all_fabric_devs()
6643 vha->hw->login_retry_count; in qla2x00_find_all_fabric_devs()
6661 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf080, in qla2x00_find_all_fabric_devs()
6681 if (found && NVME_TARGET(vha->hw, fcport)) { in qla2x00_find_all_fabric_devs()
6684 vha->fcport_count--; in qla2x00_find_all_fabric_devs()
6690 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla2x00_find_all_fabric_devs()
6695 list_add_tail(&new_fcport->list, &vha->vp_fcports); in qla2x00_find_all_fabric_devs()
6697 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla2x00_find_all_fabric_devs()
6702 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_find_all_fabric_devs()
6704 ql_log(ql_log_warn, vha, 0xd032, in qla2x00_find_all_fabric_devs()
6717 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_find_all_fabric_devs()
6718 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
6725 if ((qla_dual_mode_enabled(vha) || in qla2x00_find_all_fabric_devs()
6726 qla_ini_mode_enabled(vha)) && in qla2x00_find_all_fabric_devs()
6728 qla2x00_mark_device_lost(vha, fcport, in qla2x00_find_all_fabric_devs()
6734 ql_dbg(ql_dbg_disc, vha, 0x20f0, in qla2x00_find_all_fabric_devs()
6746 qla24xx_fcport_handle_login(vha, fcport); in qla2x00_find_all_fabric_devs()
6753 qla2x00_reserve_mgmt_server_loop_id(scsi_qla_host_t *vha) in qla2x00_reserve_mgmt_server_loop_id() argument
6756 int lid = NPH_MGMT_SERVER - vha->vp_idx; in qla2x00_reserve_mgmt_server_loop_id()
6758 struct qla_hw_data *ha = vha->hw; in qla2x00_reserve_mgmt_server_loop_id()
6760 if (vha->vp_idx == 0) { in qla2x00_reserve_mgmt_server_loop_id()
6768 if (!test_bit(lid, vha->hw->loop_id_map)) { in qla2x00_reserve_mgmt_server_loop_id()
6769 set_bit(lid, vha->hw->loop_id_map); in qla2x00_reserve_mgmt_server_loop_id()
6794 qla2x00_fabric_login(scsi_qla_host_t *vha, fc_port_t *fcport, in qla2x00_fabric_login() argument
6801 struct qla_hw_data *ha = vha->hw; in qla2x00_fabric_login()
6807 ql_dbg(ql_dbg_disc, vha, 0x2000, in qla2x00_fabric_login()
6814 rval = ha->isp_ops->fabric_login(vha, fcport->loop_id, in qla2x00_fabric_login()
6832 ql_dbg(ql_dbg_disc, vha, 0x2001, in qla2x00_fabric_login()
6880 rval = qla2x00_find_new_loop_id(vha, fcport); in qla2x00_fabric_login()
6892 ha->isp_ops->fabric_logout(vha, fcport->loop_id, in qla2x00_fabric_login()
6895 qla2x00_mark_device_lost(vha, fcport, 1); in qla2x00_fabric_login()
6903 ql_dbg(ql_dbg_disc, vha, 0x2002, in qla2x00_fabric_login()
6910 ha->isp_ops->fabric_logout(vha, fcport->loop_id, in qla2x00_fabric_login()
6938 qla2x00_local_device_login(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_local_device_login() argument
6944 rval = qla2x00_login_local_device(vha, fcport, mb, BIT_0); in qla2x00_local_device_login()
6968 qla2x00_loop_resync(scsi_qla_host_t *vha) in qla2x00_loop_resync() argument
6973 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_loop_resync()
6974 if (vha->flags.online) { in qla2x00_loop_resync()
6975 if (!(rval = qla2x00_fw_ready(vha))) { in qla2x00_loop_resync()
6979 if (!IS_QLAFX00(vha->hw)) { in qla2x00_loop_resync()
6984 qla2x00_marker(vha, vha->hw->base_qpair, in qla2x00_loop_resync()
6986 vha->marker_needed = 0; in qla2x00_loop_resync()
6990 clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_loop_resync()
6992 if (IS_QLAFX00(vha->hw)) in qla2x00_loop_resync()
6993 qlafx00_configure_devices(vha); in qla2x00_loop_resync()
6995 qla2x00_configure_loop(vha); in qla2x00_loop_resync()
6998 } while (!atomic_read(&vha->loop_down_timer) && in qla2x00_loop_resync()
6999 !(test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) in qla2x00_loop_resync()
7001 &vha->dpc_flags))); in qla2x00_loop_resync()
7005 if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) in qla2x00_loop_resync()
7009 ql_dbg(ql_dbg_disc, vha, 0x206c, in qla2x00_loop_resync()
7050 struct scsi_qla_host *vha, *tvp; in qla2x00_update_fcports() local
7056 list_for_each_entry_safe(vha, tvp, &base_vha->hw->vp_list, list) { in qla2x00_update_fcports()
7057 atomic_inc(&vha->vref_count); in qla2x00_update_fcports()
7058 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_update_fcports()
7067 atomic_dec(&vha->vref_count); in qla2x00_update_fcports()
7068 wake_up(&vha->vref_waitq); in qla2x00_update_fcports()
7075 qla83xx_reset_ownership(scsi_qla_host_t *vha) in qla83xx_reset_ownership() argument
7077 struct qla_hw_data *ha = vha->hw; in qla83xx_reset_ownership()
7084 drv_presence = qla8044_rd_direct(vha, in qla83xx_reset_ownership()
7086 dev_part_info1 = qla8044_rd_direct(vha, in qla83xx_reset_ownership()
7088 dev_part_info2 = qla8044_rd_direct(vha, in qla83xx_reset_ownership()
7091 qla83xx_rd_reg(vha, QLA83XX_IDC_DRV_PRESENCE, &drv_presence); in qla83xx_reset_ownership()
7092 qla83xx_rd_reg(vha, QLA83XX_DEV_PARTINFO1, &dev_part_info1); in qla83xx_reset_ownership()
7093 qla83xx_rd_reg(vha, QLA83XX_DEV_PARTINFO2, &dev_part_info2); in qla83xx_reset_ownership()
7127 ql_dbg(ql_dbg_p3p, vha, 0xb07f, in qla83xx_reset_ownership()
7134 __qla83xx_set_drv_ack(scsi_qla_host_t *vha) in __qla83xx_set_drv_ack() argument
7137 struct qla_hw_data *ha = vha->hw; in __qla83xx_set_drv_ack()
7140 rval = qla83xx_rd_reg(vha, QLA83XX_IDC_DRIVER_ACK, &drv_ack); in __qla83xx_set_drv_ack()
7143 rval = qla83xx_wr_reg(vha, QLA83XX_IDC_DRIVER_ACK, drv_ack); in __qla83xx_set_drv_ack()
7150 __qla83xx_clear_drv_ack(scsi_qla_host_t *vha) in __qla83xx_clear_drv_ack() argument
7153 struct qla_hw_data *ha = vha->hw; in __qla83xx_clear_drv_ack()
7156 rval = qla83xx_rd_reg(vha, QLA83XX_IDC_DRIVER_ACK, &drv_ack); in __qla83xx_clear_drv_ack()
7159 rval = qla83xx_wr_reg(vha, QLA83XX_IDC_DRIVER_ACK, drv_ack); in __qla83xx_clear_drv_ack()
7190 qla83xx_idc_audit(scsi_qla_host_t *vha, int audit_type) in qla83xx_idc_audit() argument
7192 struct qla_hw_data *ha = vha->hw; in qla83xx_idc_audit()
7200 qla83xx_wr_reg(vha, QLA83XX_IDC_AUDIT, idc_audit_reg); in qla83xx_idc_audit()
7208 qla83xx_wr_reg(vha, QLA83XX_IDC_AUDIT, idc_audit_reg); in qla83xx_idc_audit()
7212 ql_log(ql_log_warn, vha, 0xb078, in qla83xx_idc_audit()
7220 qla83xx_initiating_reset(scsi_qla_host_t *vha) in qla83xx_initiating_reset() argument
7222 struct qla_hw_data *ha = vha->hw; in qla83xx_initiating_reset()
7225 __qla83xx_get_idc_control(vha, &idc_control); in qla83xx_initiating_reset()
7227 ql_log(ql_log_info, vha, 0xb080, in qla83xx_initiating_reset()
7234 qla83xx_rd_reg(vha, QLA83XX_IDC_DEV_STATE, &dev_state); in qla83xx_initiating_reset()
7236 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE, in qla83xx_initiating_reset()
7238 ql_log(ql_log_info, vha, 0xb056, "HW State: NEED RESET.\n"); in qla83xx_initiating_reset()
7239 qla83xx_idc_audit(vha, IDC_AUDIT_TIMESTAMP); in qla83xx_initiating_reset()
7243 ql_log(ql_log_info, vha, 0xb057, "HW State: %s.\n", state); in qla83xx_initiating_reset()
7248 qla83xx_idc_unlock(vha, 0); in qla83xx_initiating_reset()
7250 qla83xx_idc_lock(vha, 0); in qla83xx_initiating_reset()
7251 qla83xx_rd_reg(vha, QLA83XX_IDC_DEV_STATE, &dev_state); in qla83xx_initiating_reset()
7256 __qla83xx_set_drv_ack(vha); in qla83xx_initiating_reset()
7262 __qla83xx_set_idc_control(scsi_qla_host_t *vha, uint32_t idc_control) in __qla83xx_set_idc_control() argument
7264 return qla83xx_wr_reg(vha, QLA83XX_IDC_CONTROL, idc_control); in __qla83xx_set_idc_control()
7268 __qla83xx_get_idc_control(scsi_qla_host_t *vha, uint32_t *idc_control) in __qla83xx_get_idc_control() argument
7270 return qla83xx_rd_reg(vha, QLA83XX_IDC_CONTROL, idc_control); in __qla83xx_get_idc_control()
7274 qla83xx_check_driver_presence(scsi_qla_host_t *vha) in qla83xx_check_driver_presence() argument
7277 struct qla_hw_data *ha = vha->hw; in qla83xx_check_driver_presence()
7279 qla83xx_rd_reg(vha, QLA83XX_IDC_DRV_PRESENCE, &drv_presence); in qla83xx_check_driver_presence()
7287 qla83xx_nic_core_reset(scsi_qla_host_t *vha) in qla83xx_nic_core_reset() argument
7290 struct qla_hw_data *ha = vha->hw; in qla83xx_nic_core_reset()
7292 ql_dbg(ql_dbg_p3p, vha, 0xb058, in qla83xx_nic_core_reset()
7295 if (vha->device_flags & DFLG_DEV_FAILED) { in qla83xx_nic_core_reset()
7296 ql_log(ql_log_warn, vha, 0xb059, in qla83xx_nic_core_reset()
7301 qla83xx_idc_lock(vha, 0); in qla83xx_nic_core_reset()
7303 if (qla83xx_check_driver_presence(vha) != QLA_SUCCESS) { in qla83xx_nic_core_reset()
7304 ql_log(ql_log_warn, vha, 0xb05a, in qla83xx_nic_core_reset()
7311 qla83xx_reset_ownership(vha); in qla83xx_nic_core_reset()
7313 rval = qla83xx_initiating_reset(vha); in qla83xx_nic_core_reset()
7320 rval = qla83xx_idc_state_handler(vha); in qla83xx_nic_core_reset()
7324 __qla83xx_clear_drv_ack(vha); in qla83xx_nic_core_reset()
7328 qla83xx_idc_unlock(vha, 0); in qla83xx_nic_core_reset()
7330 ql_dbg(ql_dbg_p3p, vha, 0xb05b, "Exiting %s.\n", __func__); in qla83xx_nic_core_reset()
7336 qla2xxx_mctp_dump(scsi_qla_host_t *vha) in qla2xxx_mctp_dump() argument
7338 struct qla_hw_data *ha = vha->hw; in qla2xxx_mctp_dump()
7343 ql_log(ql_log_info, vha, 0x506d, in qla2xxx_mctp_dump()
7353 ql_log(ql_log_warn, vha, 0x506e, in qla2xxx_mctp_dump()
7360 rval = qla2x00_dump_mctp_data(vha, ha->mctp_dump_dma, in qla2xxx_mctp_dump()
7363 ql_log(ql_log_warn, vha, 0x506f, in qla2xxx_mctp_dump()
7366 ql_log(ql_log_info, vha, 0x5070, in qla2xxx_mctp_dump()
7368 vha->host_no, ha->mctp_dump); in qla2xxx_mctp_dump()
7374 rval = qla83xx_restart_nic_firmware(vha); in qla2xxx_mctp_dump()
7377 ql_log(ql_log_warn, vha, 0x5071, in qla2xxx_mctp_dump()
7380 ql_dbg(ql_dbg_p3p, vha, 0xb084, in qla2xxx_mctp_dump()
7398 qla2x00_quiesce_io(scsi_qla_host_t *vha) in qla2x00_quiesce_io() argument
7400 struct qla_hw_data *ha = vha->hw; in qla2x00_quiesce_io()
7404 ql_dbg(ql_dbg_dpc, vha, 0x401d, in qla2x00_quiesce_io()
7408 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { in qla2x00_quiesce_io()
7409 atomic_set(&vha->loop_state, LOOP_DOWN); in qla2x00_quiesce_io()
7410 qla2x00_mark_all_devices_lost(vha); in qla2x00_quiesce_io()
7424 if (!atomic_read(&vha->loop_down_timer)) in qla2x00_quiesce_io()
7425 atomic_set(&vha->loop_down_timer, in qla2x00_quiesce_io()
7429 WARN_ON_ONCE(qla2x00_eh_wait_for_pending_commands(vha, 0, 0, WAIT_HOST) in qla2x00_quiesce_io()
7434 qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) in qla2x00_abort_isp_cleanup() argument
7436 struct qla_hw_data *ha = vha->hw; in qla2x00_abort_isp_cleanup()
7446 vha->flags.online = 0; in qla2x00_abort_isp_cleanup()
7448 clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_abort_isp_cleanup()
7449 vha->qla_stats.total_isp_aborts++; in qla2x00_abort_isp_cleanup()
7451 ql_log(ql_log_info, vha, 0x00af, in qla2x00_abort_isp_cleanup()
7460 ha->isp_ops->reset_chip(vha); in qla2x00_abort_isp_cleanup()
7502 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); in qla2x00_abort_isp_cleanup()
7503 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { in qla2x00_abort_isp_cleanup()
7504 atomic_set(&vha->loop_state, LOOP_DOWN); in qla2x00_abort_isp_cleanup()
7505 qla2x00_mark_all_devices_lost(vha); in qla2x00_abort_isp_cleanup()
7519 if (!atomic_read(&vha->loop_down_timer)) in qla2x00_abort_isp_cleanup()
7520 atomic_set(&vha->loop_down_timer, in qla2x00_abort_isp_cleanup()
7525 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_abort_isp_cleanup()
7544 qla82xx_chip_reset_cleanup(vha); in qla2x00_abort_isp_cleanup()
7545 ql_log(ql_log_info, vha, 0x00b4, in qla2x00_abort_isp_cleanup()
7549 vha->flags.online = 0; in qla2x00_abort_isp_cleanup()
7553 qla2x00_abort_all_cmds(vha, DID_RESET << 16); in qla2x00_abort_isp_cleanup()
7569 qla2x00_abort_isp(scsi_qla_host_t *vha) in qla2x00_abort_isp() argument
7573 struct qla_hw_data *ha = vha->hw; in qla2x00_abort_isp()
7578 if (vha->flags.online) { in qla2x00_abort_isp()
7579 qla2x00_abort_isp_cleanup(vha); in qla2x00_abort_isp()
7581 if (vha->hw->flags.port_isolated) in qla2x00_abort_isp()
7585 ql_log(ql_log_info, vha, 0x803f, in qla2x00_abort_isp()
7590 if (test_and_clear_bit(ISP_ABORT_TO_ROM, &vha->dpc_flags)) { in qla2x00_abort_isp()
7592 vha->flags.online = 1; in qla2x00_abort_isp()
7594 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
7599 ql_dbg(ql_dbg_p3p, vha, 0xb05c, in qla2x00_abort_isp()
7601 if (qla83xx_clear_drv_presence(vha) != QLA_SUCCESS) in qla2x00_abort_isp()
7602 ql_dbg(ql_dbg_p3p, vha, 0xb073, in qla2x00_abort_isp()
7608 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
7613 switch (vha->qlini_mode) { in qla2x00_abort_isp()
7615 if (!qla_tgt_mode_enabled(vha)) in qla2x00_abort_isp()
7619 if (!qla_dual_mode_enabled(vha) && in qla2x00_abort_isp()
7620 !qla_ini_mode_enabled(vha)) in qla2x00_abort_isp()
7628 ha->isp_ops->get_flash_version(vha, req->ring); in qla2x00_abort_isp()
7631 ql_log(ql_log_info, vha, 0x803f, in qla2x00_abort_isp()
7635 ha->isp_ops->nvram_config(vha); in qla2x00_abort_isp()
7638 ql_log(ql_log_info, vha, 0x803f, in qla2x00_abort_isp()
7642 if (!qla2x00_restart_isp(vha)) { in qla2x00_abort_isp()
7643 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla2x00_abort_isp()
7645 if (!atomic_read(&vha->loop_down_timer)) { in qla2x00_abort_isp()
7650 vha->marker_needed = 1; in qla2x00_abort_isp()
7653 vha->flags.online = 1; in qla2x00_abort_isp()
7658 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
7661 qla2x00_get_fw_version(vha); in qla2x00_abort_isp()
7666 rval = qla2x00_enable_fce_trace(vha, in qla2x00_abort_isp()
7670 ql_log(ql_log_warn, vha, 0x8033, in qla2x00_abort_isp()
7679 rval = qla2x00_enable_eft_trace(vha, in qla2x00_abort_isp()
7682 ql_log(ql_log_warn, vha, 0x8034, in qla2x00_abort_isp()
7688 vha->flags.online = 1; in qla2x00_abort_isp()
7689 if (test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { in qla2x00_abort_isp()
7691 ql_log(ql_log_fatal, vha, 0x8035, in qla2x00_abort_isp()
7698 qla2x00_abort_isp_cleanup(vha); in qla2x00_abort_isp()
7699 vha->flags.online = 0; in qla2x00_abort_isp()
7701 &vha->dpc_flags); in qla2x00_abort_isp()
7705 ql_dbg(ql_dbg_taskm, vha, 0x8020, in qla2x00_abort_isp()
7712 ql_dbg(ql_dbg_taskm, vha, 0x8021, in qla2x00_abort_isp()
7715 set_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
7722 if (vha->hw->flags.port_isolated) { in qla2x00_abort_isp()
7723 qla2x00_abort_isp_cleanup(vha); in qla2x00_abort_isp()
7728 ql_dbg(ql_dbg_taskm, vha, 0x8022, "%s succeeded.\n", __func__); in qla2x00_abort_isp()
7729 qla2x00_configure_hba(vha); in qla2x00_abort_isp()
7745 ql_dbg(ql_dbg_p3p, vha, 0xb05d, in qla2x00_abort_isp()
7747 if (qla83xx_set_drv_presence(vha) != QLA_SUCCESS) in qla2x00_abort_isp()
7748 ql_dbg(ql_dbg_p3p, vha, 0xb074, in qla2x00_abort_isp()
7752 ql_log(ql_log_warn, vha, 0x8023, "%s **** FAILED ****.\n", in qla2x00_abort_isp()
7770 qla2x00_restart_isp(scsi_qla_host_t *vha) in qla2x00_restart_isp() argument
7773 struct qla_hw_data *ha = vha->hw; in qla2x00_restart_isp()
7776 if (qla2x00_isp_firmware(vha)) { in qla2x00_restart_isp()
7777 vha->flags.online = 0; in qla2x00_restart_isp()
7778 status = ha->isp_ops->chip_diag(vha); in qla2x00_restart_isp()
7781 status = qla2x00_setup_chip(vha); in qla2x00_restart_isp()
7786 status = qla2x00_init_rings(vha); in qla2x00_restart_isp()
7790 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla2x00_restart_isp()
7796 status = qla2x00_fw_ready(vha); in qla2x00_restart_isp()
7799 return vha->device_flags & DFLG_NO_CABLE ? 0 : status; in qla2x00_restart_isp()
7803 qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL); in qla2x00_restart_isp()
7804 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_restart_isp()
7860 qla2x00_reset_adapter(scsi_qla_host_t *vha) in qla2x00_reset_adapter() argument
7863 struct qla_hw_data *ha = vha->hw; in qla2x00_reset_adapter()
7866 vha->flags.online = 0; in qla2x00_reset_adapter()
7880 qla24xx_reset_adapter(scsi_qla_host_t *vha) in qla24xx_reset_adapter() argument
7883 struct qla_hw_data *ha = vha->hw; in qla24xx_reset_adapter()
7889 vha->flags.online = 0; in qla24xx_reset_adapter()
7908 static void qla24xx_nvram_wwn_from_ofw(scsi_qla_host_t *vha, in qla24xx_nvram_wwn_from_ofw() argument
7912 struct qla_hw_data *ha = vha->hw; in qla24xx_nvram_wwn_from_ofw()
7929 qla24xx_nvram_config(scsi_qla_host_t *vha) in qla24xx_nvram_config() argument
7938 struct qla_hw_data *ha = vha->hw; in qla24xx_nvram_config()
7958 ha->isp_ops->read_nvram(vha, ha->vpd, in qla24xx_nvram_config()
7963 ha->isp_ops->read_nvram(vha, dptr, ha->nvram_base, ha->nvram_size); in qla24xx_nvram_config()
7967 ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x006a, in qla24xx_nvram_config()
7969 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x010d, in qla24xx_nvram_config()
7976 ql_log(ql_log_warn, vha, 0x006b, in qla24xx_nvram_config()
7979 ql_dump_buffer(ql_dbg_init, vha, 0x006b, nv, sizeof(*nv)); in qla24xx_nvram_config()
7980 ql_log(ql_log_warn, vha, 0x006c, in qla24xx_nvram_config()
8010 qla24xx_nvram_wwn_from_ofw(vha, nv); in qla24xx_nvram_config()
8029 if (qla_tgt_mode_enabled(vha)) { in qla24xx_nvram_config()
8036 qlt_24xx_config_nvram_stage1(vha, nv); in qla24xx_nvram_config()
8062 qla2x00_set_model_info(vha, nv->model_name, sizeof(nv->model_name), in qla24xx_nvram_config()
8065 qlt_24xx_config_nvram_stage2(vha, icb); in qla24xx_nvram_config()
8103 memcpy(vha->node_name, icb->node_name, WWN_SIZE); in qla24xx_nvram_config()
8104 memcpy(vha->port_name, icb->port_name, WWN_SIZE); in qla24xx_nvram_config()
8161 if (!vha->flags.init_done) { in qla24xx_nvram_config()
8172 ql_log(ql_log_info, vha, 0x006f, in qla24xx_nvram_config()
8182 ql_log(ql_log_warn, vha, 0x0070, in qla24xx_nvram_config()
8189 qla27xx_print_image(struct scsi_qla_host *vha, char *name, in qla27xx_print_image() argument
8192 ql_dbg(ql_dbg_init, vha, 0x018b, in qla27xx_print_image()
8277 struct scsi_qla_host *vha, struct active_regions *active_regions) in qla28xx_get_aux_images() argument
8279 struct qla_hw_data *ha = vha->hw; in qla28xx_get_aux_images()
8285 ql_dbg(ql_dbg_init, vha, 0x018a, "Primary aux image not addressed\n"); in qla28xx_get_aux_images()
8289 qla24xx_read_flash_data(vha, (uint32_t *)&pri_aux_image_status, in qla28xx_get_aux_images()
8292 qla27xx_print_image(vha, "Primary aux image", &pri_aux_image_status); in qla28xx_get_aux_images()
8295 ql_dbg(ql_dbg_init, vha, 0x018b, in qla28xx_get_aux_images()
8302 ql_dbg(ql_dbg_init, vha, 0x018c, in qla28xx_get_aux_images()
8310 ql_dbg(ql_dbg_init, vha, 0x018d, in qla28xx_get_aux_images()
8317 ql_dbg(ql_dbg_init, vha, 0x018a, in qla28xx_get_aux_images()
8322 qla24xx_read_flash_data(vha, (uint32_t *)&sec_aux_image_status, in qla28xx_get_aux_images()
8325 qla27xx_print_image(vha, "Secondary aux image", &sec_aux_image_status); in qla28xx_get_aux_images()
8328 ql_dbg(ql_dbg_init, vha, 0x018b, in qla28xx_get_aux_images()
8335 ql_dbg(ql_dbg_init, vha, 0x018c, in qla28xx_get_aux_images()
8343 ql_dbg(ql_dbg_init, vha, 0x018d, in qla28xx_get_aux_images()
8365 ql_dbg(ql_dbg_init, vha, 0x018f, in qla28xx_get_aux_images()
8374 qla27xx_get_active_image(struct scsi_qla_host *vha, in qla27xx_get_active_image() argument
8377 struct qla_hw_data *ha = vha->hw; in qla27xx_get_active_image()
8383 ql_dbg(ql_dbg_init, vha, 0x018a, "Primary image not addressed\n"); in qla27xx_get_active_image()
8387 if (qla24xx_read_flash_data(vha, (uint32_t *)&pri_image_status, in qla27xx_get_active_image()
8393 qla27xx_print_image(vha, "Primary image", &pri_image_status); in qla27xx_get_active_image()
8396 ql_dbg(ql_dbg_init, vha, 0x018b, in qla27xx_get_active_image()
8403 ql_dbg(ql_dbg_init, vha, 0x018c, in qla27xx_get_active_image()
8411 ql_dbg(ql_dbg_init, vha, 0x018d, in qla27xx_get_active_image()
8418 ql_dbg(ql_dbg_init, vha, 0x018a, "Secondary image not addressed\n"); in qla27xx_get_active_image()
8422 qla24xx_read_flash_data(vha, (uint32_t *)(&sec_image_status), in qla27xx_get_active_image()
8424 qla27xx_print_image(vha, "Secondary image", &sec_image_status); in qla27xx_get_active_image()
8427 ql_dbg(ql_dbg_init, vha, 0x018b, in qla27xx_get_active_image()
8434 ql_dbg(ql_dbg_init, vha, 0x018c, in qla27xx_get_active_image()
8442 ql_dbg(ql_dbg_init, vha, 0x018d, in qla27xx_get_active_image()
8459 ql_dbg(ql_dbg_init, vha, 0x018f, "active image %s (%u)\n", in qla27xx_get_active_image()
8477 qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr, in qla24xx_load_risc_flash() argument
8487 struct qla_hw_data *ha = vha->hw; in qla24xx_load_risc_flash()
8491 ql_dbg(ql_dbg_init, vha, 0x008b, in qla24xx_load_risc_flash()
8495 qla24xx_read_flash_data(vha, dcode, faddr, 8); in qla24xx_load_risc_flash()
8497 ql_log(ql_log_fatal, vha, 0x008c, in qla24xx_load_risc_flash()
8500 ql_log(ql_log_fatal, vha, 0x008d, in qla24xx_load_risc_flash()
8511 ql_dbg(ql_dbg_init, vha, 0x008d, in qla24xx_load_risc_flash()
8513 qla24xx_read_flash_data(vha, dcode, faddr, 10); in qla24xx_load_risc_flash()
8526 ql_dbg(ql_dbg_init, vha, 0x008e, in qla24xx_load_risc_flash()
8529 qla24xx_read_flash_data(vha, dcode, faddr, dlen); in qla24xx_load_risc_flash()
8533 rval = qla2x00_load_ram(vha, req->dma, risc_addr, dlen); in qla24xx_load_risc_flash()
8535 ql_log(ql_log_fatal, vha, 0x008f, in qla24xx_load_risc_flash()
8551 ql_dbg(ql_dbg_init, vha, 0x0160, "-> templates = %u\n", templates); in qla24xx_load_risc_flash()
8558 qla24xx_read_flash_data(vha, dcode, faddr, 7); in qla24xx_load_risc_flash()
8560 ql_dbg(ql_dbg_init, vha, 0x0161, in qla24xx_load_risc_flash()
8564 ql_dbg(ql_dbg_init, vha, 0x0162, in qla24xx_load_risc_flash()
8573 ql_dbg(ql_dbg_init, vha, 0x0163, in qla24xx_load_risc_flash()
8578 ql_log(ql_log_warn, vha, 0x0164, in qla24xx_load_risc_flash()
8584 qla24xx_read_flash_data(vha, dcode, faddr, risc_size); in qla24xx_load_risc_flash()
8587 ql_log(ql_log_warn, vha, 0x0165, in qla24xx_load_risc_flash()
8593 ql_dbg(ql_dbg_init, vha, 0x0166, in qla24xx_load_risc_flash()
8597 ql_log(ql_log_warn, vha, 0x0167, in qla24xx_load_risc_flash()
8604 ql_dbg(ql_dbg_init, vha, 0x0168, in qla24xx_load_risc_flash()
8623 qla2x00_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla2x00_load_risc() argument
8631 struct qla_hw_data *ha = vha->hw; in qla2x00_load_risc()
8635 blob = qla2x00_request_firmware(vha); in qla2x00_load_risc()
8637 ql_log(ql_log_info, vha, 0x0083, in qla2x00_load_risc()
8639 ql_log(ql_log_info, vha, 0x0084, in qla2x00_load_risc()
8653 ql_log(ql_log_fatal, vha, 0x0085, in qla2x00_load_risc()
8663 ql_log(ql_log_fatal, vha, 0x0086, in qla2x00_load_risc()
8665 ql_log(ql_log_fatal, vha, 0x0087, in qla2x00_load_risc()
8680 ql_log(ql_log_fatal, vha, 0x0088, in qla2x00_load_risc()
8691 ql_dbg(ql_dbg_init, vha, 0x0089, in qla2x00_load_risc()
8698 rval = qla2x00_load_ram(vha, req->dma, risc_addr, in qla2x00_load_risc()
8701 ql_log(ql_log_fatal, vha, 0x008a, in qla2x00_load_risc()
8723 qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla24xx_load_risc_blob() argument
8734 struct qla_hw_data *ha = vha->hw; in qla24xx_load_risc_blob()
8738 ql_dbg(ql_dbg_init, vha, 0x0090, in qla24xx_load_risc_blob()
8741 blob = qla2x00_request_firmware(vha); in qla24xx_load_risc_blob()
8743 ql_log(ql_log_warn, vha, 0x0092, in qla24xx_load_risc_blob()
8752 ql_log(ql_log_fatal, vha, 0x0093, in qla24xx_load_risc_blob()
8755 ql_log(ql_log_fatal, vha, 0x0095, in qla24xx_load_risc_blob()
8765 ql_dbg(ql_dbg_init, vha, 0x0096, in qla24xx_load_risc_blob()
8780 ql_dbg(ql_dbg_init, vha, 0x0097, in qla24xx_load_risc_blob()
8789 rval = qla2x00_load_ram(vha, req->dma, risc_addr, dlen); in qla24xx_load_risc_blob()
8791 ql_log(ql_log_fatal, vha, 0x0098, in qla24xx_load_risc_blob()
8807 ql_dbg(ql_dbg_init, vha, 0x0170, "-> templates = %u\n", templates); in qla24xx_load_risc_blob()
8814 ql_dbg(ql_dbg_init, vha, 0x0171, in qla24xx_load_risc_blob()
8819 ql_dbg(ql_dbg_init, vha, 0x0172, in qla24xx_load_risc_blob()
8828 ql_dbg(ql_dbg_init, vha, 0x0173, in qla24xx_load_risc_blob()
8833 ql_log(ql_log_warn, vha, 0x0174, in qla24xx_load_risc_blob()
8843 ql_log(ql_log_warn, vha, 0x0175, in qla24xx_load_risc_blob()
8849 ql_dbg(ql_dbg_init, vha, 0x0176, in qla24xx_load_risc_blob()
8853 ql_log(ql_log_warn, vha, 0x0177, in qla24xx_load_risc_blob()
8860 ql_dbg(ql_dbg_init, vha, 0x0178, in qla24xx_load_risc_blob()
8877 qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla24xx_load_risc() argument
8882 return qla81xx_load_risc(vha, srisc_addr); in qla24xx_load_risc()
8889 rval = qla24xx_load_risc_blob(vha, srisc_addr); in qla24xx_load_risc()
8893 return qla24xx_load_risc_flash(vha, srisc_addr, in qla24xx_load_risc()
8894 vha->hw->flt_region_fw); in qla24xx_load_risc()
8898 qla81xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla81xx_load_risc() argument
8901 struct qla_hw_data *ha = vha->hw; in qla81xx_load_risc()
8916 qla27xx_get_active_image(vha, &active_regions); in qla81xx_load_risc()
8921 ql_dbg(ql_dbg_init, vha, 0x008b, in qla81xx_load_risc()
8923 rval = qla24xx_load_risc_flash(vha, srisc_addr, ha->flt_region_fw_sec); in qla81xx_load_risc()
8928 ql_dbg(ql_dbg_init, vha, 0x008b, in qla81xx_load_risc()
8930 rval = qla24xx_load_risc_flash(vha, srisc_addr, ha->flt_region_fw); in qla81xx_load_risc()
8935 rval = qla24xx_load_risc_blob(vha, srisc_addr); in qla81xx_load_risc()
8939 ql_log(ql_log_info, vha, 0x0099, in qla81xx_load_risc()
8941 rval = qla24xx_load_risc_flash(vha, srisc_addr, ha->flt_region_gold_fw); in qla81xx_load_risc()
8945 ql_log(ql_log_info, vha, 0x009a, "Need firmware flash update.\n"); in qla81xx_load_risc()
8951 qla2x00_try_to_stop_firmware(scsi_qla_host_t *vha) in qla2x00_try_to_stop_firmware() argument
8954 struct qla_hw_data *ha = vha->hw; in qla2x00_try_to_stop_firmware()
8965 ret = qla2x00_stop_firmware(vha); in qla2x00_try_to_stop_firmware()
8968 ha->isp_ops->reset_chip(vha); in qla2x00_try_to_stop_firmware()
8969 if (ha->isp_ops->chip_diag(vha) != QLA_SUCCESS) in qla2x00_try_to_stop_firmware()
8971 if (qla2x00_setup_chip(vha) != QLA_SUCCESS) in qla2x00_try_to_stop_firmware()
8973 ql_log(ql_log_info, vha, 0x8015, in qla2x00_try_to_stop_firmware()
8975 ret = qla2x00_stop_firmware(vha); in qla2x00_try_to_stop_firmware()
8983 qla24xx_configure_vhba(scsi_qla_host_t *vha) in qla24xx_configure_vhba() argument
8988 struct qla_hw_data *ha = vha->hw; in qla24xx_configure_vhba()
8991 if (!vha->vp_idx) in qla24xx_configure_vhba()
8997 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla24xx_configure_vhba()
8998 qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL); in qla24xx_configure_vhba()
9001 vha->flags.management_server_logged_in = 0; in qla24xx_configure_vhba()
9004 rval2 = ha->isp_ops->fabric_login(vha, NPH_SNS, 0xff, 0xff, 0xfc, mb, in qla24xx_configure_vhba()
9008 ql_dbg(ql_dbg_init, vha, 0x0120, in qla24xx_configure_vhba()
9012 ql_dbg(ql_dbg_init, vha, 0x0103, in qla24xx_configure_vhba()
9019 atomic_set(&vha->loop_down_timer, 0); in qla24xx_configure_vhba()
9020 atomic_set(&vha->loop_state, LOOP_UP); in qla24xx_configure_vhba()
9021 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla24xx_configure_vhba()
9022 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla24xx_configure_vhba()
9034 qla84xx_get_chip(struct scsi_qla_host *vha) in qla84xx_get_chip() argument
9037 struct qla_hw_data *ha = vha->hw; in qla84xx_get_chip()
9077 qla84xx_put_chip(struct scsi_qla_host *vha) in qla84xx_put_chip() argument
9079 struct qla_hw_data *ha = vha->hw; in qla84xx_put_chip()
9086 qla84xx_init_chip(scsi_qla_host_t *vha) in qla84xx_init_chip() argument
9090 struct qla_hw_data *ha = vha->hw; in qla84xx_init_chip()
9094 rval = qla84xx_verify_chip(vha, status); in qla84xx_init_chip()
9105 qla81xx_nvram_config(scsi_qla_host_t *vha) in qla81xx_nvram_config() argument
9114 struct qla_hw_data *ha = vha->hw; in qla81xx_nvram_config()
9129 qla28xx_get_aux_images(vha, &active_regions); in qla81xx_nvram_config()
9138 ql_dbg(ql_dbg_init, vha, 0x0110, in qla81xx_nvram_config()
9143 ha->isp_ops->read_optrom(vha, ha->vpd, faddr << 2, ha->vpd_size); in qla81xx_nvram_config()
9151 ql_dbg(ql_dbg_init, vha, 0x0110, in qla81xx_nvram_config()
9155 ha->isp_ops->read_optrom(vha, ha->nvram, faddr << 2, ha->nvram_size); in qla81xx_nvram_config()
9161 ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x0111, in qla81xx_nvram_config()
9163 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x0112, in qla81xx_nvram_config()
9170 ql_log(ql_log_info, vha, 0x0073, in qla81xx_nvram_config()
9173 ql_dump_buffer(ql_dbg_init, vha, 0x0073, nv, sizeof(*nv)); in qla81xx_nvram_config()
9174 ql_log(ql_log_info, vha, 0x0074, in qla81xx_nvram_config()
9230 qlt_81xx_config_nvram_stage1(vha, nv); in qla81xx_nvram_config()
9269 qla2x00_set_model_info(vha, nv->model_name, sizeof(nv->model_name), in qla81xx_nvram_config()
9272 qlt_81xx_config_nvram_stage2(vha, icb); in qla81xx_nvram_config()
9312 memcpy(vha->node_name, icb->node_name, WWN_SIZE); in qla81xx_nvram_config()
9313 memcpy(vha->port_name, icb->port_name, WWN_SIZE); in qla81xx_nvram_config()
9367 if (!vha->hw->flags.msix_enabled && in qla81xx_nvram_config()
9372 if (!vha->flags.init_done) { in qla81xx_nvram_config()
9380 vha->flags.process_response_queue = 0; in qla81xx_nvram_config()
9384 ql_log(ql_log_info, vha, 0x0075, in qla81xx_nvram_config()
9392 vha->flags.process_response_queue = 1; in qla81xx_nvram_config()
9402 ha->fc4_type_priority = qla2xxx_get_fc4_priority(vha); in qla81xx_nvram_config()
9405 ql_log(ql_log_warn, vha, 0x0076, in qla81xx_nvram_config()
9412 qla82xx_restart_isp(scsi_qla_host_t *vha) in qla82xx_restart_isp() argument
9415 struct qla_hw_data *ha = vha->hw; in qla82xx_restart_isp()
9419 status = qla2x00_init_rings(vha); in qla82xx_restart_isp()
9421 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla82xx_restart_isp()
9424 status = qla2x00_fw_ready(vha); in qla82xx_restart_isp()
9427 qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL); in qla82xx_restart_isp()
9428 vha->flags.online = 1; in qla82xx_restart_isp()
9429 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla82xx_restart_isp()
9433 if ((vha->device_flags & DFLG_NO_CABLE)) in qla82xx_restart_isp()
9438 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla82xx_restart_isp()
9440 if (!atomic_read(&vha->loop_down_timer)) { in qla82xx_restart_isp()
9445 vha->marker_needed = 1; in qla82xx_restart_isp()
9451 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla82xx_restart_isp()
9454 status = qla82xx_check_md_needed(vha); in qla82xx_restart_isp()
9460 rval = qla2x00_enable_fce_trace(vha, in qla82xx_restart_isp()
9464 ql_log(ql_log_warn, vha, 0x8001, in qla82xx_restart_isp()
9473 rval = qla2x00_enable_eft_trace(vha, in qla82xx_restart_isp()
9476 ql_log(ql_log_warn, vha, 0x8010, in qla82xx_restart_isp()
9484 ql_dbg(ql_dbg_taskm, vha, 0x8011, in qla82xx_restart_isp()
9502 ql_log(ql_log_warn, vha, 0x8016, in qla82xx_restart_isp()
9528 qla24xx_get_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport) in qla24xx_get_fcp_prio() argument
9536 struct qla_hw_data *ha = vha->hw; in qla24xx_get_fcp_prio()
9556 pid2 = vha->d_id.b24 & INVALID_PORT_ID; in qla24xx_get_fcp_prio()
9575 wwn1 = wwn_to_u64(vha->port_name); in qla24xx_get_fcp_prio()
9621 qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport) in qla24xx_update_fcport_fcp_prio() argument
9631 priority = qla24xx_get_fcp_prio(vha, fcport); in qla24xx_update_fcport_fcp_prio()
9635 if (IS_P3P_TYPE(vha->hw)) { in qla24xx_update_fcport_fcp_prio()
9640 ret = qla24xx_set_fcp_prio(vha, fcport->loop_id, priority, mb); in qla24xx_update_fcport_fcp_prio()
9643 ql_dbg(ql_dbg_user, vha, 0x709e, in qla24xx_update_fcport_fcp_prio()
9650 ql_dbg(ql_dbg_user, vha, 0x704f, in qla24xx_update_fcport_fcp_prio()
9672 qla24xx_update_all_fcp_prio(scsi_qla_host_t *vha) in qla24xx_update_all_fcp_prio() argument
9679 list_for_each_entry(fcport, &vha->vp_fcports, list) in qla24xx_update_all_fcp_prio()
9680 ret = qla24xx_update_fcport_fcp_prio(vha, fcport); in qla24xx_update_all_fcp_prio()
9685 struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos, in qla2xxx_create_qpair() argument
9691 struct qla_hw_data *ha = vha->hw; in qla2xxx_create_qpair()
9697 ql_log(ql_log_warn, vha, 0x00181, in qla2xxx_create_qpair()
9705 ql_log(ql_log_warn, vha, 0x0182, in qla2xxx_create_qpair()
9710 qpair->hw = vha->hw; in qla2xxx_create_qpair()
9711 qpair->vha = vha; in qla2xxx_create_qpair()
9721 ql_log(ql_log_warn, vha, 0x0183, in qla2xxx_create_qpair()
9742 ql_dbg(ql_dbg_multiq, vha, 0xc00f, in qla2xxx_create_qpair()
9747 ql_log(ql_log_warn, vha, 0x0184, in qla2xxx_create_qpair()
9753 list_add_tail(&qpair->qp_list_elem, &vha->qp_list); in qla2xxx_create_qpair()
9763 ql_log(ql_log_warn, vha, 0x0185, in qla2xxx_create_qpair()
9774 ql_log(ql_log_warn, vha, 0x0186, in qla2xxx_create_qpair()
9793 ql_log(ql_log_warn, vha, 0xd036, in qla2xxx_create_qpair()
9802 if (!vha->flags.qpairs_available) in qla2xxx_create_qpair()
9803 vha->flags.qpairs_available = 1; in qla2xxx_create_qpair()
9805 ql_dbg(ql_dbg_multiq, vha, 0xc00d, in qla2xxx_create_qpair()
9808 ql_dbg(ql_dbg_init, vha, 0x0187, in qla2xxx_create_qpair()
9816 qla25xx_delete_rsp_que(vha, qpair->rsp); in qla2xxx_create_qpair()
9821 if (list_empty(&vha->qp_list)) in qla2xxx_create_qpair()
9822 vha->flags.qpairs_available = 0; in qla2xxx_create_qpair()
9833 int qla2xxx_delete_qpair(struct scsi_qla_host *vha, struct qla_qpair *qpair) in qla2xxx_delete_qpair() argument
9840 ret = qla25xx_delete_req_que(vha, qpair->req); in qla2xxx_delete_qpair()
9844 ret = qla25xx_delete_rsp_que(vha, qpair->rsp); in qla2xxx_delete_qpair()
9853 if (list_empty(&vha->qp_list)) { in qla2xxx_delete_qpair()
9854 vha->flags.qpairs_available = 0; in qla2xxx_delete_qpair()
9855 vha->flags.qpairs_req_created = 0; in qla2xxx_delete_qpair()
9856 vha->flags.qpairs_rsp_created = 0; in qla2xxx_delete_qpair()
9881 qla2x00_get_num_tgts(scsi_qla_host_t *vha) in qla2x00_get_num_tgts() argument
9889 list_for_each_entry_safe(f, tf, &vha->vp_fcports, list) { in qla2x00_get_num_tgts()
9899 scsi_qla_host_t *vha = shost_priv(host); in qla2xxx_reset_stats() local
9904 vha->hw_err_cnt = 0; in qla2xxx_reset_stats()
9906 vha->short_link_down_cnt = 0; in qla2xxx_reset_stats()
9908 vha->interface_err_cnt = 0; in qla2xxx_reset_stats()
9910 vha->cmd_timeout_cnt = 0; in qla2xxx_reset_stats()
9912 vha->reset_cmd_err_cnt = 0; in qla2xxx_reset_stats()
9914 spin_lock_irqsave(&vha->hw->tgt.sess_lock, int_flags); in qla2xxx_reset_stats()
9915 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2xxx_reset_stats()
9919 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, int_flags); in qla2xxx_reset_stats()
9921 vha->link_down_time = QLA2XX_MAX_LINK_DOWN_TIME; in qla2xxx_reset_stats()
9938 scsi_qla_host_t *vha = shost_priv(host); in qla2xxx_get_ini_stats() local
9953 num_tgt = qla2x00_get_num_tgts(vha); in qla2xxx_get_ini_stats()
9967 rsp_data->entry[i].cnt = vha->hw_err_cnt; in qla2xxx_get_ini_stats()
9974 rsp_data->entry[i].cnt = vha->short_link_down_cnt; in qla2xxx_get_ini_stats()
9981 rsp_data->entry[i].cnt = vha->interface_err_cnt; in qla2xxx_get_ini_stats()
9988 rsp_data->entry[i].cnt = vha->cmd_timeout_cnt; in qla2xxx_get_ini_stats()
9995 rsp_data->entry[i].cnt = vha->reset_cmd_err_cnt; in qla2xxx_get_ini_stats()
10003 spin_lock_irqsave(&vha->hw->tgt.sess_lock, int_flags); in qla2xxx_get_ini_stats()
10004 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2xxx_get_ini_stats()
10014 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, int_flags); in qla2xxx_get_ini_stats()
10038 scsi_qla_host_t *vha = shost_priv(host); in qla2xxx_disable_port() local
10040 vha->hw->flags.port_isolated = 1; in qla2xxx_disable_port()
10042 if (qla2x00_isp_reg_stat(vha->hw)) { in qla2xxx_disable_port()
10043 ql_log(ql_log_info, vha, 0x9006, in qla2xxx_disable_port()
10045 qla_pci_set_eeh_busy(vha); in qla2xxx_disable_port()
10048 if (qla2x00_chip_is_down(vha)) in qla2xxx_disable_port()
10051 if (vha->flags.online) { in qla2xxx_disable_port()
10052 qla2x00_abort_isp_cleanup(vha); in qla2xxx_disable_port()
10053 qla2x00_wait_for_sess_deletion(vha); in qla2xxx_disable_port()
10061 scsi_qla_host_t *vha = shost_priv(host); in qla2xxx_enable_port() local
10063 if (qla2x00_isp_reg_stat(vha->hw)) { in qla2xxx_enable_port()
10064 ql_log(ql_log_info, vha, 0x9001, in qla2xxx_enable_port()
10066 qla_pci_set_eeh_busy(vha); in qla2xxx_enable_port()
10070 vha->hw->flags.port_isolated = 0; in qla2xxx_enable_port()
10072 vha->flags.online = 1; in qla2xxx_enable_port()
10073 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2xxx_enable_port()
10074 qla2xxx_wake_dpc(vha); in qla2xxx_enable_port()