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()
368 if (NVME_TARGET(vha->hw, fcport)) in qla2x00_async_login()
373 ql_dbg(ql_dbg_disc, vha, 0x2072, in qla2x00_async_login()
381 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla2x00_async_login()
412 qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport) in qla2x00_async_logout() argument
419 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla2x00_async_logout()
425 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha) + 2, in qla2x00_async_logout()
428 ql_dbg(ql_dbg_disc, vha, 0x2070, in qla2x00_async_logout()
448 qla2x00_async_prlo_done(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_prlo_done() argument
454 qla2x00_mark_device_lost(vha, fcport, 1); in qla2x00_async_prlo_done()
461 struct scsi_qla_host *vha = sp->vha; in qla2x00_async_prlo_sp_done() local
464 if (!test_bit(UNLOADING, &vha->dpc_flags)) in qla2x00_async_prlo_sp_done()
465 qla2x00_post_async_prlo_done_work(sp->fcport->vha, sp->fcport, in qla2x00_async_prlo_sp_done()
472 qla2x00_async_prlo(struct scsi_qla_host *vha, fc_port_t *fcport) in qla2x00_async_prlo() argument
479 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla2x00_async_prlo()
485 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha) + 2, in qla2x00_async_prlo()
488 ql_dbg(ql_dbg_disc, vha, 0x2070, in qla2x00_async_prlo()
508 void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) in qla24xx_handle_adisc_event() argument
513 ql_dbg(ql_dbg_disc, vha, 0x20d2, in qla24xx_handle_adisc_event()
523 ql_dbg(ql_dbg_disc, vha, 0x2066, in qla24xx_handle_adisc_event()
527 spin_lock_irqsave(&vha->work_lock, flags); in qla24xx_handle_adisc_event()
533 spin_unlock_irqrestore(&vha->work_lock, flags); in qla24xx_handle_adisc_event()
544 ql_dbg(ql_dbg_disc, vha, 0x20d3, in qla24xx_handle_adisc_event()
554 __qla24xx_handle_gpdb_event(vha, ea); in qla24xx_handle_adisc_event()
557 static int qla_post_els_plogi_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla_post_els_plogi_work() argument
561 e = qla2x00_alloc_work(vha, QLA_EVT_ELS_PLOGI); in qla_post_els_plogi_work()
568 return qla2x00_post_work(vha, e); in qla_post_els_plogi_work()
573 struct scsi_qla_host *vha = sp->vha; in qla2x00_async_adisc_sp_done() local
577 ql_dbg(ql_dbg_disc, vha, 0x2066, in qla2x00_async_adisc_sp_done()
594 qla24xx_handle_adisc_event(vha, &ea); in qla2x00_async_adisc_sp_done()
600 qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_adisc() argument
608 ql_log(ql_log_warn, vha, 0xffff, in qla2x00_async_adisc()
615 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) in qla2x00_async_adisc()
620 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla2x00_async_adisc()
628 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha) + 2, in qla2x00_async_adisc()
636 ql_dbg(ql_dbg_disc, vha, 0x206f, in qla2x00_async_adisc()
651 qla2x00_post_async_adisc_work(vha, fcport, data); in qla2x00_async_adisc()
655 static bool qla2x00_is_reserved_id(scsi_qla_host_t *vha, uint16_t loop_id) in qla2x00_is_reserved_id() argument
657 struct qla_hw_data *ha = vha->hw; in qla2x00_is_reserved_id()
677 static int qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev) in qla2x00_find_new_loop_id() argument
680 struct qla_hw_data *ha = vha->hw; in qla2x00_find_new_loop_id()
689 qla2x00_is_reserved_id(vha, dev->loop_id)) { in qla2x00_find_new_loop_id()
698 ql_dbg(ql_dbg_disc, dev->vha, 0x2086, in qla2x00_find_new_loop_id()
702 ql_log(ql_log_warn, dev->vha, 0x2087, in qla2x00_find_new_loop_id()
711 struct qla_hw_data *ha = fcport->vha->hw; in qla2x00_clear_loop_id()
714 qla2x00_is_reserved_id(fcport->vha, fcport->loop_id)) in qla2x00_clear_loop_id()
721 static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, in qla24xx_handle_gnl_done_event() argument
733 ql_dbg(ql_dbg_disc, vha, 0xffff, in qla24xx_handle_gnl_done_event()
738 fcport->rscn_gen, fcport->last_rscn_gen, vha->loop_id, fcport->edif.enable); in qla24xx_handle_gnl_done_event()
745 ql_dbg(ql_dbg_disc, vha, 0x20de, in qla24xx_handle_gnl_done_event()
757 ql_dbg(ql_dbg_disc, vha, 0x20e0, in qla24xx_handle_gnl_done_event()
760 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_gnl_done_event()
766 ql_dbg(ql_dbg_disc, vha, 0x20e1, in qla24xx_handle_gnl_done_event()
773 e = &vha->gnl.l[i]; in qla24xx_handle_gnl_done_event()
802 ql_dbg(ql_dbg_disc, vha, 0x20e2, in qla24xx_handle_gnl_done_event()
819 ql_dbg(ql_dbg_disc, vha, 0x20e3, in qla24xx_handle_gnl_done_event()
835 qlt_find_sess_invalidate_other(vha, wwn, in qla24xx_handle_gnl_done_event()
848 switch (vha->hw->current_topology) { in qla24xx_handle_gnl_done_event()
853 vha, 0x20e4, "%s %d %8phC post gpdb\n", in qla24xx_handle_gnl_done_event()
861 qla2x00_post_async_adisc_work(vha, fcport, in qla24xx_handle_gnl_done_event()
865 if (vha->hw->flags.edif_enabled) { in qla24xx_handle_gnl_done_event()
867 qla24xx_post_gpdb_work(vha, fcport, 0); in qla24xx_handle_gnl_done_event()
874 qla2x00_find_new_loop_id(vha, fcport); in qla24xx_handle_gnl_done_event()
878 ql_dbg(ql_dbg_disc, vha, 0x20e5, in qla24xx_handle_gnl_done_event()
881 qla24xx_fcport_handle_login(vha, fcport); in qla24xx_handle_gnl_done_event()
898 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_gnl_done_event()
907 qla2x00_post_async_adisc_work(vha, fcport, in qla24xx_handle_gnl_done_event()
911 if (vha->hw->flags.edif_enabled && in qla24xx_handle_gnl_done_event()
912 DBELL_ACTIVE(vha)) { in qla24xx_handle_gnl_done_event()
914 qla24xx_post_gpdb_work(vha, fcport, 0); in qla24xx_handle_gnl_done_event()
923 qla24xx_fcport_handle_login(vha, in qla24xx_handle_gnl_done_event()
935 qla24xx_fcport_handle_login(vha, in qla24xx_handle_gnl_done_event()
945 switch (vha->hw->current_topology) { in qla24xx_handle_gnl_done_event()
949 e = &vha->gnl.l[i]; in qla24xx_handle_gnl_done_event()
958 qla2x00_find_fcport_by_wwpn(vha, in qla24xx_handle_gnl_done_event()
962 vha, 0x20e5, in qla24xx_handle_gnl_done_event()
977 qla24xx_fcport_handle_login(vha, fcport); in qla24xx_handle_gnl_done_event()
990 &vha->dpc_flags); in qla24xx_handle_gnl_done_event()
993 ql_log(ql_log_info, vha, 0x705d, in qla24xx_handle_gnl_done_event()
996 &vha->dpc_flags); in qla24xx_handle_gnl_done_event()
999 ql_log(ql_log_info, vha, 0x705d, in qla24xx_handle_gnl_done_event()
1005 qla2xxx_wake_dpc(vha); in qla24xx_handle_gnl_done_event()
1011 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_gnl_done_event()
1015 qla24xx_fcport_handle_login(vha, fcport); in qla24xx_handle_gnl_done_event()
1025 struct scsi_qla_host *vha = sp->vha; in qla24xx_async_gnl_sp_done() local
1035 ql_dbg(ql_dbg_disc, vha, 0x20e7, in qla24xx_async_gnl_sp_done()
1054 e = &vha->gnl.l[i]; in qla24xx_async_gnl_sp_done()
1058 set_bit(loop_id, vha->hw->loop_id_map); in qla24xx_async_gnl_sp_done()
1061 ql_dbg(ql_dbg_disc, vha, 0x20e8, in qla24xx_async_gnl_sp_done()
1068 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
1072 if (!list_empty(&vha->gnl.fcports)) in qla24xx_async_gnl_sp_done()
1073 list_splice_init(&vha->gnl.fcports, &h); in qla24xx_async_gnl_sp_done()
1074 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
1077 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
1080 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
1083 qla24xx_handle_gnl_done_event(vha, &ea); in qla24xx_async_gnl_sp_done()
1091 e = &vha->gnl.l[i]; in qla24xx_async_gnl_sp_done()
1095 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) { in qla24xx_async_gnl_sp_done()
1109 ql_dbg(ql_dbg_disc, vha, 0x2065, in qla24xx_async_gnl_sp_done()
1113 qla24xx_post_newsess_work(vha, &id, (u8 *)&wwn, in qla24xx_async_gnl_sp_done()
1118 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
1119 vha->gnl.sent = 0; in qla24xx_async_gnl_sp_done()
1120 if (!list_empty(&vha->gnl.fcports)) { in qla24xx_async_gnl_sp_done()
1122 list_for_each_entry_safe(fcport, tf, &vha->gnl.fcports, in qla24xx_async_gnl_sp_done()
1126 if (qla24xx_post_gnl_work(vha, fcport) == QLA_SUCCESS) in qla24xx_async_gnl_sp_done()
1130 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
1136 int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_async_gnl() argument
1143 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) in qla24xx_async_gnl()
1146 ql_dbg(ql_dbg_disc, vha, 0x20d9, in qla24xx_async_gnl()
1149 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl()
1155 list_add_tail(&fcport->gnl_entry, &vha->gnl.fcports); in qla24xx_async_gnl()
1156 if (vha->gnl.sent) { in qla24xx_async_gnl()
1157 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl()
1160 vha->gnl.sent = 1; in qla24xx_async_gnl()
1161 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl()
1164 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla24xx_async_gnl()
1172 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha) + 2, in qla24xx_async_gnl()
1178 mb[2] = MSW(vha->gnl.ldma); in qla24xx_async_gnl()
1179 mb[3] = LSW(vha->gnl.ldma); in qla24xx_async_gnl()
1180 mb[6] = MSW(MSD(vha->gnl.ldma)); in qla24xx_async_gnl()
1181 mb[7] = LSW(MSD(vha->gnl.ldma)); in qla24xx_async_gnl()
1182 mb[8] = vha->gnl.size; in qla24xx_async_gnl()
1183 mb[9] = vha->vp_idx; in qla24xx_async_gnl()
1185 ql_dbg(ql_dbg_disc, vha, 0x20da, in qla24xx_async_gnl()
1204 int qla24xx_post_gnl_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_post_gnl_work() argument
1208 e = qla2x00_alloc_work(vha, QLA_EVT_GNL); in qla24xx_post_gnl_work()
1214 return qla2x00_post_work(vha, e); in qla24xx_post_gnl_work()
1219 struct scsi_qla_host *vha = sp->vha; in qla24xx_async_gpdb_sp_done() local
1220 struct qla_hw_data *ha = vha->hw; in qla24xx_async_gpdb_sp_done()
1225 ql_dbg(ql_dbg_disc, vha, 0x20db, in qla24xx_async_gpdb_sp_done()
1238 qla24xx_handle_gpdb_event(vha, &ea); in qla24xx_async_gpdb_sp_done()
1247 int qla24xx_post_prli_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_post_prli_work() argument
1251 if (vha->host->active_mode == MODE_TARGET) in qla24xx_post_prli_work()
1254 e = qla2x00_alloc_work(vha, QLA_EVT_PRLI); in qla24xx_post_prli_work()
1260 return qla2x00_post_work(vha, e); in qla24xx_post_prli_work()
1265 struct scsi_qla_host *vha = sp->vha; in qla2x00_async_prli_sp_done() local
1269 ql_dbg(ql_dbg_disc, vha, 0x2129, in qla2x00_async_prli_sp_done()
1275 if (!test_bit(UNLOADING, &vha->dpc_flags)) { in qla2x00_async_prli_sp_done()
1288 qla24xx_handle_prli_done_event(vha, &ea); in qla2x00_async_prli_sp_done()
1295 qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_async_prli() argument
1301 if (!vha->flags.online) { in qla24xx_async_prli()
1302 ql_dbg(ql_dbg_disc, vha, 0xffff, "%s %d %8phC exit\n", in qla24xx_async_prli()
1309 qla_dual_mode_enabled(vha)) { in qla24xx_async_prli()
1310 ql_dbg(ql_dbg_disc, vha, 0xffff, "%s %d %8phC exit\n", in qla24xx_async_prli()
1315 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla24xx_async_prli()
1324 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha) + 2, in qla24xx_async_prli()
1330 if (NVME_TARGET(vha->hw, fcport)) in qla24xx_async_prli()
1333 ql_dbg(ql_dbg_disc, vha, 0x211b, in qla24xx_async_prli()
1336 fcport->login_retry, fcport->fc4_type, vha->hw->fc4_type_priority, in qla24xx_async_prli()
1337 NVME_TARGET(vha->hw, fcport) ? "nvme" : "fcp"); in qla24xx_async_prli()
1342 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_async_prli()
1355 int qla24xx_post_gpdb_work(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt) in qla24xx_post_gpdb_work() argument
1359 e = qla2x00_alloc_work(vha, QLA_EVT_GPDB); in qla24xx_post_gpdb_work()
1366 return qla2x00_post_work(vha, e); in qla24xx_post_gpdb_work()
1369 int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt) in qla24xx_async_gpdb() argument
1377 struct qla_hw_data *ha = vha->hw; in qla24xx_async_gpdb()
1380 ql_log(ql_log_warn, vha, 0xffff, in qla24xx_async_gpdb()
1387 if (!vha->flags.online || fcport->flags & FCF_ASYNC_SENT) { in qla24xx_async_gpdb()
1388 ql_log(ql_log_warn, vha, 0xffff, in qla24xx_async_gpdb()
1390 __func__, fcport->port_name, vha->flags.online, fcport->flags); in qla24xx_async_gpdb()
1394 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla24xx_async_gpdb()
1405 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha) + 2, in qla24xx_async_gpdb()
1410 ql_log(ql_log_warn, vha, 0xd043, in qla24xx_async_gpdb()
1422 mb[9] = vha->vp_idx; in qla24xx_async_gpdb()
1429 ql_dbg(ql_dbg_disc, vha, 0x20dc, in qla24xx_async_gpdb()
1446 qla24xx_post_gpdb_work(vha, fcport, opt); in qla24xx_async_gpdb()
1451 void __qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) in __qla24xx_handle_gpdb_event() argument
1455 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in __qla24xx_handle_gpdb_event()
1460 vha->fcport_count++; in __qla24xx_handle_gpdb_event()
1463 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in __qla24xx_handle_gpdb_event()
1465 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in __qla24xx_handle_gpdb_event()
1472 ql_dbg(ql_dbg_disc, vha, 0x20d6, in __qla24xx_handle_gpdb_event()
1477 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in __qla24xx_handle_gpdb_event()
1480 static int qla_chk_secure_login(scsi_qla_host_t *vha, fc_port_t *fcport, in qla_chk_secure_login() argument
1486 ql_dbg(ql_dbg_disc, vha, 0x104d, in qla_chk_secure_login()
1491 ql_dbg(ql_dbg_disc, vha, 0x104d, in qla_chk_secure_login()
1496 if (vha->hw->flags.edif_enabled) { in qla_chk_secure_login()
1505 qla2x00_post_aen_work(vha, FCH_EVT_PORT_ONLINE, in qla_chk_secure_login()
1508 if (DBELL_ACTIVE(vha)) { in qla_chk_secure_login()
1509 ql_dbg(ql_dbg_disc, vha, 0x20ef, in qla_chk_secure_login()
1514 qla_edb_eventcreate(vha, VND_CMD_AUTH_STATE_NEEDED, in qla_chk_secure_login()
1519 } else if (qla_ini_mode_enabled(vha) || qla_dual_mode_enabled(vha)) { in qla_chk_secure_login()
1520 ql_dbg(ql_dbg_disc, vha, 0x2117, in qla_chk_secure_login()
1523 qla24xx_post_prli_work(vha, fcport); in qla_chk_secure_login()
1531 void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) in qla24xx_handle_gpdb_event() argument
1542 ql_dbg(ql_dbg_disc, vha, 0x20d2, in qla24xx_handle_gpdb_event()
1548 ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC\n", in qla24xx_handle_gpdb_event()
1553 if (NVME_TARGET(vha->hw, fcport)) in qla24xx_handle_gpdb_event()
1561 ql_dbg(ql_dbg_disc, vha, 0x20d3, in qla24xx_handle_gpdb_event()
1568 ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC, ls %x\n", in qla24xx_handle_gpdb_event()
1575 __qla24xx_parse_gpdb(vha, fcport, pd); in qla24xx_handle_gpdb_event()
1578 if (qla_chk_secure_login(vha, fcport, pd)) { in qla24xx_handle_gpdb_event()
1579 ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC, ls %x\n", in qla24xx_handle_gpdb_event()
1588 if (qla_dual_mode_enabled(vha) || in qla24xx_handle_gpdb_event()
1589 qla_ini_mode_enabled(vha)) { in qla24xx_handle_gpdb_event()
1591 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_gpdb_event()
1593 ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC, ls %x\n", in qla24xx_handle_gpdb_event()
1599 ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC post del sess\n", in qla24xx_handle_gpdb_event()
1604 __qla24xx_handle_gpdb_event(vha, ea); in qla24xx_handle_gpdb_event()
1607 static void qla_chk_n2n_b4_login(struct scsi_qla_host *vha, fc_port_t *fcport) in qla_chk_n2n_b4_login() argument
1612 ql_dbg(ql_dbg_disc, vha, 0x307b, in qla_chk_n2n_b4_login()
1617 if (qla_tgt_mode_enabled(vha)) in qla_chk_n2n_b4_login()
1620 if (qla_dual_mode_enabled(vha)) { in qla_chk_n2n_b4_login()
1621 if (N2N_TOPO(vha->hw)) { in qla_chk_n2n_b4_login()
1624 mywwn = wwn_to_u64(vha->port_name); in qla_chk_n2n_b4_login()
1644 rc = qla2x00_find_new_loop_id(vha, fcport); in qla_chk_n2n_b4_login()
1646 ql_dbg(ql_dbg_disc, vha, 0x20e6, in qla_chk_n2n_b4_login()
1654 ql_dbg(ql_dbg_disc, vha, 0x20bf, in qla_chk_n2n_b4_login()
1657 qla2x00_post_async_login_work(vha, fcport, NULL); in qla_chk_n2n_b4_login()
1661 int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_fcport_handle_login() argument
1666 ql_dbg(ql_dbg_disc, vha, 0x20d8, in qla24xx_fcport_handle_login()
1679 qla_dual_mode_enabled(vha) && in qla24xx_fcport_handle_login()
1685 !N2N_TOPO(vha->hw)) { in qla24xx_fcport_handle_login()
1687 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_fcport_handle_login()
1693 if (vha->host->active_mode == MODE_TARGET && !N2N_TOPO(vha->hw)) in qla24xx_fcport_handle_login()
1697 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_fcport_handle_login()
1703 switch (vha->hw->current_topology) { in qla24xx_fcport_handle_login()
1709 qla2x00_find_new_loop_id(vha, in qla24xx_fcport_handle_login()
1715 qla_post_els_plogi_work(vha, fcport); in qla24xx_fcport_handle_login()
1717 ql_log(ql_log_info, vha, 0x705d, in qla24xx_fcport_handle_login()
1722 qla24xx_post_gnl_work(vha, fcport); in qla24xx_fcport_handle_login()
1727 ql_dbg(ql_dbg_disc, vha, 0x20bd, in qla24xx_fcport_handle_login()
1730 qla24xx_post_gnl_work(vha, fcport); in qla24xx_fcport_handle_login()
1732 qla_chk_n2n_b4_login(vha, fcport); in qla24xx_fcport_handle_login()
1739 switch (vha->hw->current_topology) { in qla24xx_fcport_handle_login()
1742 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_fcport_handle_login()
1746 vha->hw->base_qpair->chip_reset; in qla24xx_fcport_handle_login()
1747 qla24xx_post_gpdb_work(vha, fcport, 0); in qla24xx_fcport_handle_login()
1749 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_fcport_handle_login()
1752 NVME_TARGET(vha->hw, fcport) ? "NVME" : in qla24xx_fcport_handle_login()
1754 qla24xx_post_prli_work(vha, fcport); in qla24xx_fcport_handle_login()
1759 ql_dbg(ql_dbg_disc, vha, 0x20d8, in qla24xx_fcport_handle_login()
1765 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_fcport_handle_login()
1768 qla_chk_n2n_b4_login(vha, fcport); in qla24xx_fcport_handle_login()
1774 if (N2N_TOPO(vha->hw)) in qla24xx_fcport_handle_login()
1775 qla_chk_n2n_b4_login(vha, fcport); in qla24xx_fcport_handle_login()
1783 qla2x00_post_async_adisc_work(vha, fcport, data); in qla24xx_fcport_handle_login()
1787 if (vha->hw->flags.edif_enabled) in qla24xx_fcport_handle_login()
1791 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_fcport_handle_login()
1794 NVME_TARGET(vha->hw, fcport) ? "NVME" : "FC"); in qla24xx_fcport_handle_login()
1795 qla24xx_post_prli_work(vha, fcport); in qla24xx_fcport_handle_login()
1805 ql_dbg(ql_dbg_disc, fcport->vha, 0xffff, in qla24xx_fcport_handle_login()
1812 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_fcport_handle_login()
1822 int qla24xx_post_newsess_work(struct scsi_qla_host *vha, port_id_t *id, in qla24xx_post_newsess_work() argument
1827 e = qla2x00_alloc_work(vha, QLA_EVT_NEW_SESS); in qla24xx_post_newsess_work()
1838 return qla2x00_post_work(vha, e); in qla24xx_post_newsess_work()
1841 void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea) in qla2x00_handle_rscn() argument
1848 fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1); in qla2x00_handle_rscn()
1853 ql_dbg(ql_dbg_disc, vha, 0x2115, in qla2x00_handle_rscn()
1859 if (vha->hw->flags.edif_enabled && DBELL_ACTIVE(vha)) { in qla2x00_handle_rscn()
1883 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_handle_rscn()
1895 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_handle_rscn()
1908 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_handle_rscn()
1919 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_handle_rscn()
1920 if (vha->scan.scan_flags == 0) { in qla2x00_handle_rscn()
1921 ql_dbg(ql_dbg_disc, vha, 0xffff, "%s: schedule\n", __func__); in qla2x00_handle_rscn()
1922 vha->scan.scan_flags |= SF_QUEUED; in qla2x00_handle_rscn()
1923 schedule_delayed_work(&vha->scan.scan_work, 5); in qla2x00_handle_rscn()
1925 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_handle_rscn()
1928 void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, in qla24xx_handle_relogin_event() argument
1933 if (test_bit(UNLOADING, &vha->dpc_flags)) in qla24xx_handle_relogin_event()
1936 ql_dbg(ql_dbg_disc, vha, 0x2102, in qla24xx_handle_relogin_event()
1946 ql_dbg(ql_dbg_disc, vha, 0x20e9, "%s %d %8phC post gnl\n", in qla24xx_handle_relogin_event()
1948 qla24xx_post_gnl_work(vha, fcport); in qla24xx_handle_relogin_event()
1952 qla24xx_fcport_handle_login(vha, fcport); in qla24xx_handle_relogin_event()
1955 void qla_handle_els_plogi_done(scsi_qla_host_t *vha, in qla_handle_els_plogi_done() argument
1958 if (N2N_TOPO(vha->hw) && fcport_is_smaller(ea->fcport) && in qla_handle_els_plogi_done()
1959 vha->hw->flags.edif_enabled) { in qla_handle_els_plogi_done()
1961 qla24xx_post_gpdb_work(vha, ea->fcport, 0); in qla_handle_els_plogi_done()
1966 if (vha->host->active_mode == MODE_TARGET) in qla_handle_els_plogi_done()
1969 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla_handle_els_plogi_done()
1972 qla24xx_post_prli_work(vha, ea->fcport); in qla_handle_els_plogi_done()
1994 qla2x00_handle_rscn(fcport->vha, &ea); in qla_rscn_replay()
2032 ql_dbg(ql_dbg_taskm, sp->vha, 0x8004, in qla_marker_sp_done()
2045 if (_chip_gen != sp->vha->hw->chip_reset || _login_gen != sp->fcport->login_gen) {\
2066 struct scsi_qla_host *vha = arg->vha; in qla26xx_marker() local
2074 ql_dbg(ql_dbg_taskm, vha, 0x8039, in qla26xx_marker()
2081 chip_gen = vha->hw->chip_reset; in qla26xx_marker()
2085 sp = qla2xxx_get_qpair_sp(vha, arg->qpair, fcport, GFP_KERNEL); in qla26xx_marker()
2091 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha), qla_marker_sp_done); in qla26xx_marker()
2099 tm_iocb->u.tmf.vp_index = vha->vp_idx; in qla26xx_marker()
2103 ql_dbg(ql_dbg_taskm, vha, 0x8006, in qla26xx_marker()
2109 ql_log(ql_log_warn, vha, 0x8031, in qla26xx_marker()
2118 ql_log(ql_log_warn, vha, 0x8019, in qla26xx_marker()
2144 return qla2x00_eh_wait_for_pending_commands(arg->vha, in qla_tmf_wait()
2147 return qla2x00_eh_wait_for_pending_commands(arg->vha, in qla_tmf_wait()
2154 struct scsi_qla_host *vha = arg->vha; in __qla2x00_async_tm_cmd() local
2163 ql_dbg(ql_dbg_taskm, vha, 0x8032, in __qla2x00_async_tm_cmd()
2170 chip_gen = vha->hw->chip_reset; in __qla2x00_async_tm_cmd()
2174 sp = qla2xxx_get_qpair_sp(vha, arg->qpair, fcport, GFP_KERNEL); in __qla2x00_async_tm_cmd()
2178 qla_vha_mark_busy(vha); in __qla2x00_async_tm_cmd()
2181 qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha), in __qla2x00_async_tm_cmd()
2192 ql_dbg(ql_dbg_taskm, vha, 0x802f, in __qla2x00_async_tm_cmd()
2204 ql_log(ql_log_warn, vha, 0x8030, in __qla2x00_async_tm_cmd()
2208 if (!test_bit(UNLOADING, &vha->dpc_flags) && !IS_QLAFX00(vha->hw)) { in __qla2x00_async_tm_cmd()
2211 ql_log(ql_log_info, vha, 0x803e, in __qla2x00_async_tm_cmd()
2213 jiffies_to_msecs(jiffies - jif), vha->host_no, in __qla2x00_async_tm_cmd()
2217 if (chip_gen == vha->hw->chip_reset && login_gen == fcport->login_gen) { in __qla2x00_async_tm_cmd()
2220 ql_log(ql_log_info, vha, 0x803e, in __qla2x00_async_tm_cmd()
2222 vha->host_no, fcport->d_id.b24, arg->lun); in __qla2x00_async_tm_cmd()
2238 struct scsi_qla_host *vha = arg->vha; in qla_put_tmf() local
2239 struct qla_hw_data *ha = vha->hw; in qla_put_tmf()
2251 struct scsi_qla_host *vha = arg->vha; in qla_get_tmf() local
2252 struct qla_hw_data *ha = vha->hw; in qla_get_tmf()
2262 ql_log(ql_log_warn, vha, 0x802c, in qla_get_tmf()
2264 vha->host_no, fcport->d_id.b24, arg->lun); in qla_get_tmf()
2278 ql_log(ql_log_warn, vha, 0x802c, in qla_get_tmf()
2304 struct scsi_qla_host *vha = fcport->vha; in qla2x00_async_tm_cmd() local
2311 a.vha = fcport->vha; in qla2x00_async_tm_cmd()
2326 a.qpair = vha->hw->base_qpair; in qla2x00_async_tm_cmd()
2341 struct scsi_qla_host *vha = fcport->vha; in qla24xx_async_abort_command() local
2356 return qlafx00_fx_disc(vha, &vha->hw->mr.fcport, in qla24xx_async_abort_command()
2363 qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea) in qla24xx_handle_prli_done_event() argument
2371 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_handle_prli_done_event()
2375 ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset; in qla24xx_handle_prli_done_event()
2383 qla24xx_post_gpdb_work(vha, ea->fcport, 0); in qla24xx_handle_prli_done_event()
2387 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_handle_prli_done_event()
2390 vha->hw->fc4_type_priority == FC4_PRIORITY_FCP ? in qla24xx_handle_prli_done_event()
2404 if (N2N_TOPO(vha->hw)) { in qla24xx_handle_prli_done_event()
2406 vha->hw->login_retry_count && in qla24xx_handle_prli_done_event()
2413 vha->hw->login_retry_count) { in qla24xx_handle_prli_done_event()
2415 vha->relogin_jif = jiffies + 2 * HZ; in qla24xx_handle_prli_done_event()
2420 set_bit(N2N_LINK_RESET, &vha->dpc_flags); in qla24xx_handle_prli_done_event()
2421 qla2xxx_wake_dpc(vha); in qla24xx_handle_prli_done_event()
2423 ql_log(ql_log_warn, vha, 0x2119, in qla24xx_handle_prli_done_event()
2443 qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) in qla24xx_handle_plogi_done_event() argument
2451 ql_dbg(ql_dbg_disc, vha, 0xffff, in qla24xx_handle_plogi_done_event()
2460 ql_dbg(ql_dbg_disc, vha, 0x20ea, in qla24xx_handle_plogi_done_event()
2468 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_plogi_done_event()
2474 ql_dbg(ql_dbg_disc, vha, 0x20d3, in qla24xx_handle_plogi_done_event()
2477 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_plogi_done_event()
2480 ql_dbg(ql_dbg_disc, vha, 0x20d3, in qla24xx_handle_plogi_done_event()
2498 if (vha->hw->flags.edif_enabled) { in qla24xx_handle_plogi_done_event()
2499 set_bit(ea->fcport->loop_id, vha->hw->loop_id_map); in qla24xx_handle_plogi_done_event()
2500 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_handle_plogi_done_event()
2501 ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset; in qla24xx_handle_plogi_done_event()
2505 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_handle_plogi_done_event()
2507 qla24xx_post_gpdb_work(vha, ea->fcport, 0); in qla24xx_handle_plogi_done_event()
2509 if (NVME_TARGET(vha->hw, fcport)) { in qla24xx_handle_plogi_done_event()
2510 ql_dbg(ql_dbg_disc, vha, 0x2117, in qla24xx_handle_plogi_done_event()
2513 qla24xx_post_prli_work(vha, fcport); in qla24xx_handle_plogi_done_event()
2515 ql_dbg(ql_dbg_disc, vha, 0x20ea, in qla24xx_handle_plogi_done_event()
2520 set_bit(fcport->loop_id, vha->hw->loop_id_map); in qla24xx_handle_plogi_done_event()
2521 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_handle_plogi_done_event()
2522 fcport->chip_reset = vha->hw->base_qpair->chip_reset; in qla24xx_handle_plogi_done_event()
2526 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_handle_plogi_done_event()
2528 qla24xx_post_gpdb_work(vha, fcport, 0); in qla24xx_handle_plogi_done_event()
2533 ql_dbg(ql_dbg_disc, vha, 0x20eb, "%s %d %8phC cmd error %x\n", in qla24xx_handle_plogi_done_event()
2545 ql_dbg(ql_dbg_disc, vha, 0x20ec, in qla24xx_handle_plogi_done_event()
2550 set_bit(ea->fcport->loop_id, vha->hw->loop_id_map); in qla24xx_handle_plogi_done_event()
2552 qla24xx_post_gnl_work(vha, ea->fcport); in qla24xx_handle_plogi_done_event()
2556 qlt_find_sess_invalidate_other(vha, in qla24xx_handle_plogi_done_event()
2569 ql_dbg(ql_dbg_disc, vha, 0x20ed, in qla24xx_handle_plogi_done_event()
2574 ql_dbg(ql_dbg_disc, vha, 0x20ed, in qla24xx_handle_plogi_done_event()
2580 set_bit(lid, vha->hw->loop_id_map); in qla24xx_handle_plogi_done_event()
2596 qla83xx_nic_core_fw_load(scsi_qla_host_t *vha) in qla83xx_nic_core_fw_load() argument
2599 struct qla_hw_data *ha = vha->hw; in qla83xx_nic_core_fw_load()
2603 qla83xx_idc_lock(vha, 0); in qla83xx_nic_core_fw_load()
2612 if (__qla83xx_set_drv_presence(vha) != QLA_SUCCESS) { in qla83xx_nic_core_fw_load()
2613 ql_dbg(ql_dbg_p3p, vha, 0xb077, in qla83xx_nic_core_fw_load()
2620 qla83xx_reset_ownership(vha); in qla83xx_nic_core_fw_load()
2628 qla83xx_rd_reg(vha, QLA83XX_IDC_MAJOR_VERSION, &idc_major_ver); in qla83xx_nic_core_fw_load()
2632 qla83xx_wr_reg(vha, QLA83XX_IDC_MAJOR_VERSION, idc_major_ver); in qla83xx_nic_core_fw_load()
2635 qla83xx_wr_reg(vha, QLA83XX_IDC_LOCK_RECOVERY, 0); in qla83xx_nic_core_fw_load()
2641 ql_log(ql_log_warn, vha, 0xb07d, in qla83xx_nic_core_fw_load()
2644 __qla83xx_clear_drv_presence(vha); in qla83xx_nic_core_fw_load()
2649 qla83xx_rd_reg(vha, QLA83XX_IDC_MINOR_VERSION, &idc_minor_ver); in qla83xx_nic_core_fw_load()
2651 qla83xx_wr_reg(vha, QLA83XX_IDC_MINOR_VERSION, idc_minor_ver); in qla83xx_nic_core_fw_load()
2655 if (!qla81xx_get_port_config(vha, config)) in qla83xx_nic_core_fw_load()
2656 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE, in qla83xx_nic_core_fw_load()
2660 rval = qla83xx_idc_state_handler(vha); in qla83xx_nic_core_fw_load()
2663 qla83xx_idc_unlock(vha, 0); in qla83xx_nic_core_fw_load()
2679 qla2x00_initialize_adapter(scsi_qla_host_t *vha) in qla2x00_initialize_adapter() argument
2682 struct qla_hw_data *ha = vha->hw; in qla2x00_initialize_adapter()
2686 memset(&vha->qla_stats, 0, sizeof(vha->qla_stats)); in qla2x00_initialize_adapter()
2687 memset(&vha->fc_host_stat, 0, sizeof(vha->fc_host_stat)); in qla2x00_initialize_adapter()
2690 vha->flags.online = 0; in qla2x00_initialize_adapter()
2692 vha->flags.reset_active = 0; in qla2x00_initialize_adapter()
2695 vha->qla_stats.jiffies_at_last_reset = get_jiffies_64(); in qla2x00_initialize_adapter()
2696 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); in qla2x00_initialize_adapter()
2697 atomic_set(&vha->loop_state, LOOP_DOWN); in qla2x00_initialize_adapter()
2698 vha->device_flags = DFLG_NO_CABLE; in qla2x00_initialize_adapter()
2699 vha->dpc_flags = 0; in qla2x00_initialize_adapter()
2700 vha->flags.management_server_logged_in = 0; in qla2x00_initialize_adapter()
2701 vha->marker_needed = 0; in qla2x00_initialize_adapter()
2708 ql_dbg(ql_dbg_init, vha, 0x0040, in qla2x00_initialize_adapter()
2710 rval = ha->isp_ops->pci_config(vha); in qla2x00_initialize_adapter()
2712 ql_log(ql_log_warn, vha, 0x0044, in qla2x00_initialize_adapter()
2717 ha->isp_ops->reset_chip(vha); in qla2x00_initialize_adapter()
2723 ql_log(ql_log_info, vha, 0xffff, "Secure Adapter: %s\n", in qla2x00_initialize_adapter()
2728 rval = qla2xxx_get_flash_info(vha); in qla2x00_initialize_adapter()
2730 ql_log(ql_log_fatal, vha, 0x004f, in qla2x00_initialize_adapter()
2736 qla8044_read_reset_template(vha); in qla2x00_initialize_adapter()
2743 qla8044_set_idc_dontreset(vha); in qla2x00_initialize_adapter()
2746 ha->isp_ops->get_flash_version(vha, req->ring); in qla2x00_initialize_adapter()
2747 ql_dbg(ql_dbg_init, vha, 0x0061, in qla2x00_initialize_adapter()
2753 ha->isp_ops->nvram_config(vha); in qla2x00_initialize_adapter()
2759 ql_log(ql_log_info, vha, 0xffff, "FC4 priority set to %s\n", in qla2x00_initialize_adapter()
2764 ql_log(ql_log_info, vha, 0x0077, in qla2x00_initialize_adapter()
2765 "Masking HBA WWPN %8phN (via NVRAM).\n", vha->port_name); in qla2x00_initialize_adapter()
2769 ql_dbg(ql_dbg_init, vha, 0x0078, in qla2x00_initialize_adapter()
2778 if (qla2x00_isp_firmware(vha) != QLA_SUCCESS) { in qla2x00_initialize_adapter()
2779 rval = ha->isp_ops->chip_diag(vha); in qla2x00_initialize_adapter()
2782 rval = qla2x00_setup_chip(vha); in qla2x00_initialize_adapter()
2788 ha->cs84xx = qla84xx_get_chip(vha); in qla2x00_initialize_adapter()
2790 ql_log(ql_log_warn, vha, 0x00d0, in qla2x00_initialize_adapter()
2796 if (qla_ini_mode_enabled(vha) || qla_dual_mode_enabled(vha)) in qla2x00_initialize_adapter()
2797 rval = qla2x00_init_rings(vha); in qla2x00_initialize_adapter()
2807 rval = qla84xx_init_chip(vha); in qla2x00_initialize_adapter()
2809 ql_log(ql_log_warn, vha, 0x00d4, in qla2x00_initialize_adapter()
2811 qla84xx_put_chip(vha); in qla2x00_initialize_adapter()
2817 rval = qla83xx_nic_core_fw_load(vha); in qla2x00_initialize_adapter()
2819 ql_log(ql_log_warn, vha, 0x0124, in qla2x00_initialize_adapter()
2824 qla24xx_read_fcp_prio_cfg(vha); in qla2x00_initialize_adapter()
2827 qla82xx_set_driver_version(vha, QLA2XXX_VERSION); in qla2x00_initialize_adapter()
2829 qla25xx_set_driver_version(vha, QLA2XXX_VERSION); in qla2x00_initialize_adapter()
2841 qla2100_pci_config(scsi_qla_host_t *vha) in qla2100_pci_config() argument
2845 struct qla_hw_data *ha = vha->hw; in qla2100_pci_config()
2872 qla2300_pci_config(scsi_qla_host_t *vha) in qla2300_pci_config() argument
2877 struct qla_hw_data *ha = vha->hw; in qla2300_pci_config()
2954 qla24xx_pci_config(scsi_qla_host_t *vha) in qla24xx_pci_config() argument
2958 struct qla_hw_data *ha = vha->hw; in qla24xx_pci_config()
2998 qla25xx_pci_config(scsi_qla_host_t *vha) in qla25xx_pci_config() argument
3001 struct qla_hw_data *ha = vha->hw; in qla25xx_pci_config()
3029 qla2x00_isp_firmware(scsi_qla_host_t *vha) in qla2x00_isp_firmware() argument
3034 struct qla_hw_data *ha = vha->hw; in qla2x00_isp_firmware()
3040 ql_log(ql_log_info, vha, 0x0079, "RISC CODE NOT loaded.\n"); in qla2x00_isp_firmware()
3043 rval = qla2x00_verify_checksum(vha, ha->fw_srisc_address); in qla2x00_isp_firmware()
3046 rval = qla2x00_get_adapter_id(vha, &loop_id, &al_pa, in qla2x00_isp_firmware()
3052 ql_dbg(ql_dbg_init, vha, 0x007a, in qla2x00_isp_firmware()
3065 qla2x00_reset_chip(scsi_qla_host_t *vha) in qla2x00_reset_chip() argument
3068 struct qla_hw_data *ha = vha->hw; in qla2x00_reset_chip()
3212 qla81xx_reset_mpi(scsi_qla_host_t *vha) in qla81xx_reset_mpi() argument
3216 if (!IS_QLA81XX(vha->hw)) in qla81xx_reset_mpi()
3219 return qla81xx_write_mpi_register(vha, mb); in qla81xx_reset_mpi()
3223 qla_chk_risc_recovery(scsi_qla_host_t *vha) in qla_chk_risc_recovery() argument
3225 struct qla_hw_data *ha = vha->hw; in qla_chk_risc_recovery()
3246 ql_log(ql_log_warn, vha, 0x1015, in qla_chk_risc_recovery()
3249 ql_log(ql_log_warn, vha, 0x1015, in qla_chk_risc_recovery()
3253 ql_log(ql_log_warn, vha, 0x1015, in qla_chk_risc_recovery()
3257 ql_log(ql_log_warn, vha, 0x1015, in qla_chk_risc_recovery()
3272 qla24xx_reset_risc(scsi_qla_host_t *vha) in qla24xx_reset_risc() argument
3275 struct qla_hw_data *ha = vha->hw; in qla24xx_reset_risc()
3297 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x017e, in qla24xx_reset_risc()
3323 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x017f, in qla24xx_reset_risc()
3341 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x015d, in qla24xx_reset_risc()
3347 if (test_and_clear_bit(MPI_RESET_NEEDED, &vha->dpc_flags)) { in qla24xx_reset_risc()
3348 if (qla81xx_reset_mpi(vha) != QLA_SUCCESS) { in qla24xx_reset_risc()
3350 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla24xx_reset_risc()
3351 set_bit(MPI_RESET_NEEDED, &vha->dpc_flags); in qla24xx_reset_risc()
3358 vha->flags.online = 0; in qla24xx_reset_risc()
3378 if (print && qla_chk_risc_recovery(vha)) in qla24xx_reset_risc()
3385 ql_log(ql_log_warn, vha, 0x015e, in qla24xx_reset_risc()
3393 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x015e, in qla24xx_reset_risc()
3400 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x015f, in qla24xx_reset_risc()
3411 qla25xx_read_risc_sema_reg(scsi_qla_host_t *vha, uint32_t *data) in qla25xx_read_risc_sema_reg() argument
3413 struct device_reg_24xx __iomem *reg = &vha->hw->iobase->isp24; in qla25xx_read_risc_sema_reg()
3420 qla25xx_write_risc_sema_reg(scsi_qla_host_t *vha, uint32_t data) in qla25xx_write_risc_sema_reg() argument
3422 struct device_reg_24xx __iomem *reg = &vha->hw->iobase->isp24; in qla25xx_write_risc_sema_reg()
3429 qla25xx_manipulate_risc_semaphore(scsi_qla_host_t *vha) in qla25xx_manipulate_risc_semaphore() argument
3437 if (vha->hw->pdev->subsystem_device != 0x0175 && in qla25xx_manipulate_risc_semaphore()
3438 vha->hw->pdev->subsystem_device != 0x0240) in qla25xx_manipulate_risc_semaphore()
3441 wrt_reg_dword(&vha->hw->iobase->isp24.hccr, HCCRX_SET_RISC_PAUSE); in qla25xx_manipulate_risc_semaphore()
3448 qla25xx_write_risc_sema_reg(vha, RISC_SEMAPHORE_SET); in qla25xx_manipulate_risc_semaphore()
3449 qla25xx_read_risc_sema_reg(vha, &wd32); in qla25xx_manipulate_risc_semaphore()
3464 qla25xx_write_risc_sema_reg(vha, RISC_SEMAPHORE_CLR); in qla25xx_manipulate_risc_semaphore()
3468 qla25xx_read_risc_sema_reg(vha, &wd32); in qla25xx_manipulate_risc_semaphore()
3478 qla25xx_write_risc_sema_reg(vha, RISC_SEMAPHORE_FORCE_CLR); in qla25xx_manipulate_risc_semaphore()
3483 qla25xx_write_risc_sema_reg(vha, RISC_SEMAPHORE_FORCE_SET); in qla25xx_manipulate_risc_semaphore()
3496 qla24xx_reset_chip(scsi_qla_host_t *vha) in qla24xx_reset_chip() argument
3498 struct qla_hw_data *ha = vha->hw; in qla24xx_reset_chip()
3508 qla25xx_manipulate_risc_semaphore(vha); in qla24xx_reset_chip()
3511 rval = qla24xx_reset_risc(vha); in qla24xx_reset_chip()
3523 qla2x00_chip_diag(scsi_qla_host_t *vha) in qla2x00_chip_diag() argument
3526 struct qla_hw_data *ha = vha->hw; in qla2x00_chip_diag()
3537 ql_dbg(ql_dbg_init, vha, 0x007b, "Testing device at %p.\n", in qla2x00_chip_diag()
3560 ql_dbg(ql_dbg_init, vha, 0x007c, in qla2x00_chip_diag()
3582 ql_dbg(ql_dbg_init, vha, 0x007d, "Checking product ID of chip.\n"); in qla2x00_chip_diag()
3590 ql_log(ql_log_warn, vha, 0x0062, in qla2x00_chip_diag()
3611 ql_dbg(ql_dbg_init, vha, 0x007e, "Found QLA2200A Chip.\n"); in qla2x00_chip_diag()
3620 ql_dbg(ql_dbg_init, vha, 0x007f, "Checking mailboxes.\n"); in qla2x00_chip_diag()
3621 rval = qla2x00_mbx_reg_test(vha); in qla2x00_chip_diag()
3623 ql_log(ql_log_warn, vha, 0x0080, in qla2x00_chip_diag()
3632 ql_log(ql_log_info, vha, 0x0081, in qla2x00_chip_diag()
3647 qla24xx_chip_diag(scsi_qla_host_t *vha) in qla24xx_chip_diag() argument
3650 struct qla_hw_data *ha = vha->hw; in qla24xx_chip_diag()
3658 rval = qla2x00_mbx_reg_test(vha); in qla24xx_chip_diag()
3660 ql_log(ql_log_warn, vha, 0x0082, in qla24xx_chip_diag()
3671 qla2x00_init_fce_trace(scsi_qla_host_t *vha) in qla2x00_init_fce_trace() argument
3676 struct qla_hw_data *ha = vha->hw; in qla2x00_init_fce_trace()
3686 ql_dbg(ql_dbg_init, vha, 0x00bd, in qla2x00_init_fce_trace()
3696 ql_log(ql_log_warn, vha, 0x00be, in qla2x00_init_fce_trace()
3702 rval = qla2x00_enable_fce_trace(vha, tc_dma, FCE_NUM_BUFFERS, in qla2x00_init_fce_trace()
3705 ql_log(ql_log_warn, vha, 0x00bf, in qla2x00_init_fce_trace()
3711 ql_dbg(ql_dbg_init, vha, 0x00c0, in qla2x00_init_fce_trace()
3720 qla2x00_init_eft_trace(scsi_qla_host_t *vha) in qla2x00_init_eft_trace() argument
3725 struct qla_hw_data *ha = vha->hw; in qla2x00_init_eft_trace()
3731 ql_dbg(ql_dbg_init, vha, 0x00bd, in qla2x00_init_eft_trace()
3741 ql_log(ql_log_warn, vha, 0x00c1, in qla2x00_init_eft_trace()
3747 rval = qla2x00_enable_eft_trace(vha, tc_dma, EFT_NUM_BUFFERS); in qla2x00_init_eft_trace()
3749 ql_log(ql_log_warn, vha, 0x00c2, in qla2x00_init_eft_trace()
3755 ql_dbg(ql_dbg_init, vha, 0x00c3, in qla2x00_init_eft_trace()
3763 qla2x00_alloc_offload_mem(scsi_qla_host_t *vha) in qla2x00_alloc_offload_mem() argument
3765 qla2x00_init_fce_trace(vha); in qla2x00_alloc_offload_mem()
3766 qla2x00_init_eft_trace(vha); in qla2x00_alloc_offload_mem()
3770 qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) in qla2x00_alloc_fw_dump() argument
3774 struct qla_hw_data *ha = vha->hw; in qla2x00_alloc_fw_dump()
3780 ql_dbg(ql_dbg_init, vha, 0x00bd, in qla2x00_alloc_fw_dump()
3823 qla2x00_init_fce_trace(vha); in qla2x00_alloc_fw_dump()
3826 qla2x00_init_eft_trace(vha); in qla2x00_alloc_fw_dump()
3837 ql_dbg(ql_dbg_init, vha, 0x00ba, in qla2x00_alloc_fw_dump()
3841 ql_dbg(ql_dbg_init, vha, 0x00fa, in qla2x00_alloc_fw_dump()
3844 vha, fwdt->template); in qla2x00_alloc_fw_dump()
3845 ql_dbg(ql_dbg_init, vha, 0x00fa, in qla2x00_alloc_fw_dump()
3870 ql_dbg(ql_dbg_init, vha, 0x00c5, in qla2x00_alloc_fw_dump()
3877 ql_log(ql_log_warn, vha, 0x00c4, in qla2x00_alloc_fw_dump()
3887 ql_dbg(ql_dbg_init, vha, 0x00c5, in qla2x00_alloc_fw_dump()
3896 ql_dbg(ql_dbg_init, vha, 0x00c5, in qla2x00_alloc_fw_dump()
3934 qla81xx_mpi_sync(scsi_qla_host_t *vha) in qla81xx_mpi_sync() argument
3941 if (!IS_QLA81XX(vha->hw)) in qla81xx_mpi_sync()
3944 rval = qla2x00_write_ram_word(vha, 0x7c00, 1); in qla81xx_mpi_sync()
3946 ql_log(ql_log_warn, vha, 0x0105, in qla81xx_mpi_sync()
3951 pci_read_config_word(vha->hw->pdev, 0x54, &dc); in qla81xx_mpi_sync()
3952 rval = qla2x00_read_ram_word(vha, 0x7a15, &dw); in qla81xx_mpi_sync()
3954 ql_log(ql_log_warn, vha, 0x0067, "Unable to read sync.\n"); in qla81xx_mpi_sync()
3964 rval = qla2x00_write_ram_word(vha, 0x7a15, dw); in qla81xx_mpi_sync()
3966 ql_log(ql_log_warn, vha, 0x0114, "Unable to gain sync.\n"); in qla81xx_mpi_sync()
3970 rval = qla2x00_write_ram_word(vha, 0x7c00, 0); in qla81xx_mpi_sync()
3972 ql_log(ql_log_warn, vha, 0x006d, in qla81xx_mpi_sync()
4036 static void qla2xxx_print_sfp_info(struct scsi_qla_host *vha) in qla2xxx_print_sfp_info() argument
4039 struct sff_8247_a0 *a0 = (struct sff_8247_a0 *)vha->hw->sfp_data; in qla2xxx_print_sfp_info()
4045 ql_dbg(ql_dbg_init, vha, 0x015a, in qla2xxx_print_sfp_info()
4050 ql_dbg(ql_dbg_init, vha, 0x015c, in qla2xxx_print_sfp_info()
4065 ql_dbg(ql_dbg_init, vha, 0x0160, in qla2xxx_print_sfp_info()
4078 ql_dbg(ql_dbg_init, vha, 0x0196, in qla2xxx_print_sfp_info()
4090 ql_dbg(ql_dbg_init, vha, 0x016e, in qla2xxx_print_sfp_info()
4094 ql_dbg(ql_dbg_init, vha, 0x016f, in qla2xxx_print_sfp_info()
4097 ql_dbg(ql_dbg_init, vha, 0x0170, in qla2xxx_print_sfp_info()
4100 ql_dbg(ql_dbg_init, vha, 0x0189, in qla2xxx_print_sfp_info()
4103 ql_dbg(ql_dbg_init, vha, 0x018a, in qla2xxx_print_sfp_info()
4106 ql_dbg(ql_dbg_init, vha, 0x0194, in qla2xxx_print_sfp_info()
4109 ql_dbg(ql_dbg_init, vha, 0x0195, in qla2xxx_print_sfp_info()
4129 qla24xx_detect_sfp(scsi_qla_host_t *vha) in qla24xx_detect_sfp() argument
4133 struct qla_hw_data *ha = vha->hw; in qla24xx_detect_sfp()
4152 if (!IS_BPM_ENABLED(vha)) in qla24xx_detect_sfp()
4155 rc = qla2x00_read_sfp_dev(vha, NULL, 0); in qla24xx_detect_sfp()
4160 a = (struct sff_8247_a0 *)vha->hw->sfp_data; in qla24xx_detect_sfp()
4161 qla2xxx_print_sfp_info(vha); in qla24xx_detect_sfp()
4176 ql_dbg(ql_dbg_async, vha, 0x507b, in qla24xx_detect_sfp()
4189 struct qla_hw_data *ha = qpair->vha->hw; in __qla_adjust_iocb_limit()
4203 void qla_init_iocb_limit(scsi_qla_host_t *vha) in qla_init_iocb_limit() argument
4206 struct qla_hw_data *ha = vha->hw; in qla_init_iocb_limit()
4229 void qla_adjust_iocb_limit(scsi_qla_host_t *vha) in qla_adjust_iocb_limit() argument
4232 struct qla_hw_data *ha = vha->hw; in qla_adjust_iocb_limit()
4249 qla2x00_setup_chip(scsi_qla_host_t *vha) in qla2x00_setup_chip() argument
4253 struct qla_hw_data *ha = vha->hw; in qla2x00_setup_chip()
4260 rval = ha->isp_ops->load_risc(vha, &srisc_address); in qla2x00_setup_chip()
4262 qla2x00_stop_firmware(vha); in qla2x00_setup_chip()
4276 qla81xx_mpi_sync(vha); in qla2x00_setup_chip()
4280 rval = ha->isp_ops->load_risc(vha, &srisc_address); in qla2x00_setup_chip()
4282 ql_dbg(ql_dbg_init, vha, 0x00c9, in qla2x00_setup_chip()
4285 rval = qla2x00_verify_checksum(vha, srisc_address); in qla2x00_setup_chip()
4288 ql_dbg(ql_dbg_init, vha, 0x00ca, in qla2x00_setup_chip()
4294 if (qla_is_exch_offld_enabled(vha)) in qla2x00_setup_chip()
4297 rval = qla2x00_execute_fw(vha, srisc_address); in qla2x00_setup_chip()
4301 if (!done_once++ && qla24xx_detect_sfp(vha)) { in qla2x00_setup_chip()
4302 ql_dbg(ql_dbg_init, vha, 0x00ca, in qla2x00_setup_chip()
4305 ha->isp_ops->reset_chip(vha); in qla2x00_setup_chip()
4306 ha->isp_ops->chip_diag(vha); in qla2x00_setup_chip()
4311 qla27xx_set_zio_threshold(vha, in qla2x00_setup_chip()
4314 rval = qla2x00_set_exlogins_buffer(vha); in qla2x00_setup_chip()
4318 rval = qla2x00_set_exchoffld_buffer(vha); in qla2x00_setup_chip()
4325 qla82xx_check_md_needed(vha); in qla2x00_setup_chip()
4327 rval = qla2x00_get_fw_version(vha); in qla2x00_setup_chip()
4340 qla2x00_get_resource_cnts(vha); in qla2x00_setup_chip()
4341 qla_init_iocb_limit(vha); in qla2x00_setup_chip()
4348 vha->req); in qla2x00_setup_chip()
4353 qla2x00_alloc_offload_mem(vha); in qla2x00_setup_chip()
4356 qla2x00_alloc_fw_dump(vha); in qla2x00_setup_chip()
4362 ql_log(ql_log_fatal, vha, 0x00cd, in qla2x00_setup_chip()
4370 qla25xx_set_els_cmds_supported(vha); in qla2x00_setup_chip()
4392 rval = qla81xx_fac_get_sector_size(vha, &size); in qla2x00_setup_chip()
4397 ql_log(ql_log_warn, vha, 0x00ce, in qla2x00_setup_chip()
4410 ql_log(ql_log_fatal, vha, 0x00cf, in qla2x00_setup_chip()
4449 qla2x00_update_fw_options(scsi_qla_host_t *vha) in qla2x00_update_fw_options() argument
4452 struct qla_hw_data *ha = vha->hw; in qla2x00_update_fw_options()
4455 qla2x00_get_fw_options(vha, ha->fw_options); in qla2x00_update_fw_options()
4461 ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x0115, in qla2x00_update_fw_options()
4463 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x0109, in qla2x00_update_fw_options()
4522 ql_dbg(ql_dbg_disc, vha, 0x2100, in qla2x00_update_fw_options()
4528 qla2x00_set_fw_options(vha, ha->fw_options); in qla2x00_update_fw_options()
4532 qla24xx_update_fw_options(scsi_qla_host_t *vha) in qla24xx_update_fw_options() argument
4535 struct qla_hw_data *ha = vha->hw; in qla24xx_update_fw_options()
4547 ql_dbg(ql_dbg_disc, vha, 0x2101, in qla24xx_update_fw_options()
4555 if (qla_tgt_mode_enabled(vha) || in qla24xx_update_fw_options()
4556 qla_dual_mode_enabled(vha)) in qla24xx_update_fw_options()
4568 if (qla_tgt_mode_enabled(vha) || in qla24xx_update_fw_options()
4569 qla_dual_mode_enabled(vha)) in qla24xx_update_fw_options()
4585 DBELL_ACTIVE(vha)) { in qla24xx_update_fw_options()
4602 ql_dbg(ql_dbg_init, vha, 0x00e8, in qla24xx_update_fw_options()
4605 ha->fw_options[3], vha->host->active_mode); in qla24xx_update_fw_options()
4608 qla2x00_set_fw_options(vha, ha->fw_options); in qla24xx_update_fw_options()
4614 rval = qla2x00_set_serdes_params(vha, in qla24xx_update_fw_options()
4619 ql_log(ql_log_warn, vha, 0x0104, in qla24xx_update_fw_options()
4625 qla2x00_config_rings(struct scsi_qla_host *vha) in qla2x00_config_rings() argument
4627 struct qla_hw_data *ha = vha->hw; in qla2x00_config_rings()
4648 qla24xx_config_rings(struct scsi_qla_host *vha) in qla24xx_config_rings() argument
4650 struct qla_hw_data *ha = vha->hw; in qla24xx_config_rings()
4682 ql_dbg(ql_dbg_init, vha, 0x0019, in qla24xx_config_rings()
4699 ql_dbg(ql_dbg_init, vha, 0x00fe, in qla24xx_config_rings()
4717 qlt_24xx_config_rings(vha); in qla24xx_config_rings()
4721 ql_dbg(ql_dbg_init, vha, 0x00fd, in qla24xx_config_rings()
4741 qla2x00_init_rings(scsi_qla_host_t *vha) in qla2x00_init_rings() argument
4746 struct qla_hw_data *ha = vha->hw; in qla2x00_init_rings()
4788 qlt_init_atio_q_entries(vha); in qla2x00_init_rings()
4790 ha->isp_ops->config_rings(vha); in qla2x00_init_rings()
4795 rval = qlafx00_init_firmware(vha, ha->init_cb_size); in qla2x00_init_rings()
4800 ha->isp_ops->update_fw_options(vha); in qla2x00_init_rings()
4802 ql_dbg(ql_dbg_init, vha, 0x00d1, in qla2x00_init_rings()
4821 ql_dbg(ql_dbg_init, vha, 0x0191, "DPORT Support: %s.\n", in qla2x00_init_rings()
4827 ql_dbg(ql_dbg_init, vha, 0x00bc, "FA-WWPN Support: %s.\n", in qla2x00_init_rings()
4838 rval = qla2x00_init_firmware(vha, ha->init_cb_size); in qla2x00_init_rings()
4842 ql_log(ql_log_fatal, vha, 0x00d2, in qla2x00_init_rings()
4845 ql_dbg(ql_dbg_init, vha, 0x00d3, in qla2x00_init_rings()
4847 vha->u_ql2xexchoffld = vha->u_ql2xiniexchg = 0; in qla2x00_init_rings()
4860 qla2x00_fw_ready(scsi_qla_host_t *vha) in qla2x00_fw_ready() argument
4867 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_ready()
4869 if (IS_QLAFX00(vha->hw)) in qla2x00_fw_ready()
4870 return qlafx00_fw_ready(vha); in qla2x00_fw_ready()
4893 if (!vha->flags.init_done) in qla2x00_fw_ready()
4894 ql_log(ql_log_info, vha, 0x801e, in qla2x00_fw_ready()
4899 rval = qla2x00_get_firmware_state(vha, state); in qla2x00_fw_ready()
4902 vha->device_flags &= ~DFLG_NO_CABLE; in qla2x00_fw_ready()
4905 ql_dbg(ql_dbg_taskm, vha, 0x801f, in qla2x00_fw_ready()
4910 ql_dbg(ql_dbg_taskm, vha, 0x8028, in qla2x00_fw_ready()
4914 rval = qla84xx_init_chip(vha); in qla2x00_fw_ready()
4917 vha, 0x8007, in qla2x00_fw_ready()
4926 ql_dbg(ql_dbg_taskm, vha, 0x8008, in qla2x00_fw_ready()
4932 ql_dbg(ql_dbg_taskm, vha, 0x8037, in qla2x00_fw_ready()
4935 qla2x00_get_retry_cnt(vha, &ha->retry_count, in qla2x00_fw_ready()
4944 if (atomic_read(&vha->loop_down_timer) && in qla2x00_fw_ready()
4950 ql_log(ql_log_info, vha, 0x8038, in qla2x00_fw_ready()
4953 vha->device_flags |= DFLG_NO_CABLE; in qla2x00_fw_ready()
4971 ql_dbg(ql_dbg_taskm, vha, 0x803a, in qla2x00_fw_ready()
4975 if (rval && !(vha->device_flags & DFLG_NO_CABLE)) { in qla2x00_fw_ready()
4976 ql_log(ql_log_warn, vha, 0x803b, in qla2x00_fw_ready()
4997 qla2x00_configure_hba(scsi_qla_host_t *vha) in qla2x00_configure_hba() argument
5007 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_hba()
5013 rval = qla2x00_get_adapter_id(vha, in qla2x00_configure_hba()
5016 if (LOOP_TRANSITION(vha) || atomic_read(&ha->loop_down_timer) || in qla2x00_configure_hba()
5019 ql_dbg(ql_dbg_disc, vha, 0x2008, in qla2x00_configure_hba()
5022 ql_log(ql_log_warn, vha, 0x2009, in qla2x00_configure_hba()
5024 if (IS_FWI2_CAPABLE(ha) && (vha == base_vha) && in qla2x00_configure_hba()
5026 ql_log(ql_log_warn, vha, 0x1151, in qla2x00_configure_hba()
5028 if (qla24xx_link_initialize(vha) == QLA_SUCCESS) in qla2x00_configure_hba()
5031 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_configure_hba()
5037 ql_log(ql_log_info, vha, 0x200a, in qla2x00_configure_hba()
5042 vha->loop_id = loop_id; in qla2x00_configure_hba()
5050 ql_dbg(ql_dbg_disc, vha, 0x200b, "HBA in NL topology.\n"); in qla2x00_configure_hba()
5057 ql_dbg(ql_dbg_disc, vha, 0x200c, "HBA in FL topology.\n"); in qla2x00_configure_hba()
5064 ql_dbg(ql_dbg_disc, vha, 0x200d, "HBA in N P2P topology.\n"); in qla2x00_configure_hba()
5072 ql_dbg(ql_dbg_disc, vha, 0x200e, "HBA in F P2P topology.\n"); in qla2x00_configure_hba()
5080 ql_dbg(ql_dbg_disc, vha, 0x200f, in qla2x00_configure_hba()
5095 if (vha->hw->flags.edif_enabled) { in qla2x00_configure_hba()
5097 qla_update_host_map(vha, id); in qla2x00_configure_hba()
5099 qla_update_host_map(vha, id); in qla2x00_configure_hba()
5102 if (!vha->flags.init_done) in qla2x00_configure_hba()
5103 ql_log(ql_log_info, vha, 0x2010, in qla2x00_configure_hba()
5105 connect_type, vha->loop_id); in qla2x00_configure_hba()
5111 qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len, in qla2x00_set_model_info() argument
5117 struct qla_hw_data *ha = vha->hw; in qla2x00_set_model_info()
5157 qla2xxx_get_vpd_field(vha, "\x82", ha->model_desc, in qla2x00_set_model_info()
5164 static void qla2xxx_nvram_wwn_from_ofw(scsi_qla_host_t *vha, nvram_t *nv) in qla2xxx_nvram_wwn_from_ofw() argument
5167 struct qla_hw_data *ha = vha->hw; in qla2xxx_nvram_wwn_from_ofw()
5197 qla2x00_nvram_config(scsi_qla_host_t *vha) in qla2x00_nvram_config() argument
5203 struct qla_hw_data *ha = vha->hw; in qla2x00_nvram_config()
5219 ha->isp_ops->read_nvram(vha, ptr, ha->nvram_base, ha->nvram_size); in qla2x00_nvram_config()
5223 ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x010f, in qla2x00_nvram_config()
5225 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x0110, in qla2x00_nvram_config()
5232 ql_log(ql_log_warn, vha, 0x0064, in qla2x00_nvram_config()
5235 ql_log(ql_log_warn, vha, 0x0065, in qla2x00_nvram_config()
5273 qla2xxx_nvram_wwn_from_ofw(vha, nv); in qla2x00_nvram_config()
5313 qla2x00_set_model_info(vha, nv->model_number, in qla2x00_nvram_config()
5394 memcpy(vha->node_name, icb->node_name, WWN_SIZE); in qla2x00_nvram_config()
5395 memcpy(vha->port_name, icb->port_name, WWN_SIZE); in qla2x00_nvram_config()
5462 vha->flags.process_response_queue = 1; in qla2x00_nvram_config()
5465 if (!vha->flags.init_done) { in qla2x00_nvram_config()
5473 vha->flags.process_response_queue = 0; in qla2x00_nvram_config()
5477 ql_log(ql_log_info, vha, 0x0068, in qla2x00_nvram_config()
5483 vha->flags.process_response_queue = 1; in qla2x00_nvram_config()
5488 ql_log(ql_log_warn, vha, 0x0069, in qla2x00_nvram_config()
5503 ql_dbg(ql_dbg_disc, fcport->vha, 0x207d, in qla2x00_set_fcport_state()
5519 qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags) in qla2x00_alloc_fcport() argument
5527 fcport->ct_desc.ct_sns = dma_alloc_coherent(&vha->hw->pdev->dev, in qla2x00_alloc_fcport()
5531 ql_log(ql_log_warn, vha, 0xd049, in qla2x00_alloc_fcport()
5538 fcport->vha = vha; in qla2x00_alloc_fcport()
5548 fcport->login_retry = vha->hw->login_retry_count; in qla2x00_alloc_fcport()
5549 fcport->chip_reset = vha->hw->base_qpair->chip_reset; in qla2x00_alloc_fcport()
5556 ql_log(ql_log_warn, vha, 0xd049, in qla2x00_alloc_fcport()
5586 dma_free_coherent(&fcport->vha->hw->pdev->dev, in qla2x00_free_fcport()
5602 static void qla_get_login_template(scsi_qla_host_t *vha) in qla_get_login_template() argument
5604 struct qla_hw_data *ha = vha->hw; in qla_get_login_template()
5611 rval = qla24xx_get_port_login_templ(vha, ha->init_cb_dma, in qla_get_login_template()
5614 ql_dbg(ql_dbg_init, vha, 0x00d1, in qla_get_login_template()
5638 qla2x00_configure_loop(scsi_qla_host_t *vha) in qla2x00_configure_loop() argument
5642 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_loop()
5647 if (test_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags)) { in qla2x00_configure_loop()
5648 rval = qla2x00_configure_hba(vha); in qla2x00_configure_loop()
5650 ql_dbg(ql_dbg_disc, vha, 0x2013, in qla2x00_configure_loop()
5656 save_flags = flags = vha->dpc_flags; in qla2x00_configure_loop()
5657 ql_dbg(ql_dbg_disc, vha, 0x2014, in qla2x00_configure_loop()
5664 clear_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
5665 clear_bit(RSCN_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
5667 qla2x00_get_data_rate(vha); in qla2x00_configure_loop()
5668 qla_get_login_template(vha); in qla2x00_configure_loop()
5682 } else if (!vha->flags.online || in qla2x00_configure_loop()
5689 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_loop()
5690 ql_dbg(ql_dbg_disc, vha, 0x2015, in qla2x00_configure_loop()
5694 rval = qla2x00_configure_local_loop(vha); in qla2x00_configure_loop()
5698 if (LOOP_TRANSITION(vha)) { in qla2x00_configure_loop()
5699 ql_dbg(ql_dbg_disc, vha, 0x2099, in qla2x00_configure_loop()
5704 rval = qla2x00_configure_fabric(vha); in qla2x00_configure_loop()
5708 if (atomic_read(&vha->loop_down_timer) || in qla2x00_configure_loop()
5709 test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_loop()
5712 atomic_set(&vha->loop_state, LOOP_READY); in qla2x00_configure_loop()
5713 ql_dbg(ql_dbg_disc, vha, 0x2069, in qla2x00_configure_loop()
5721 if (ha->flags.edif_enabled && DBELL_INACTIVE(vha)) in qla2x00_configure_loop()
5722 qla2x00_post_aen_work(vha, FCH_EVT_LINKUP, in qla2x00_configure_loop()
5729 if (qla_tgt_mode_enabled(vha) || in qla2x00_configure_loop()
5730 qla_dual_mode_enabled(vha)) { in qla2x00_configure_loop()
5732 qlt_24xx_process_atio_queue(vha, 0); in qla2x00_configure_loop()
5740 ql_dbg(ql_dbg_disc, vha, 0x206a, in qla2x00_configure_loop()
5743 ql_dbg(ql_dbg_disc, vha, 0x206b, in qla2x00_configure_loop()
5745 __func__, vha->port_name, vha->d_id.b24); in qla2x00_configure_loop()
5749 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_loop()
5751 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
5753 set_bit(RSCN_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
5760 static int qla2x00_configure_n2n_loop(scsi_qla_host_t *vha) in qla2x00_configure_n2n_loop() argument
5765 ql_dbg(ql_dbg_disc, vha, 0x206a, "%s %d.\n", __func__, __LINE__); in qla2x00_configure_n2n_loop()
5767 if (test_and_clear_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags)) in qla2x00_configure_n2n_loop()
5768 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla2x00_configure_n2n_loop()
5770 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_n2n_loop()
5772 qla24xx_fcport_handle_login(vha, fcport); in qla2x00_configure_n2n_loop()
5777 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_configure_n2n_loop()
5778 vha->scan.scan_retry++; in qla2x00_configure_n2n_loop()
5779 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_configure_n2n_loop()
5781 if (vha->scan.scan_retry < MAX_SCAN_RETRIES) { in qla2x00_configure_n2n_loop()
5782 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_configure_n2n_loop()
5783 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_n2n_loop()
5789 qla_reinitialize_link(scsi_qla_host_t *vha) in qla_reinitialize_link() argument
5793 atomic_set(&vha->loop_state, LOOP_DOWN); in qla_reinitialize_link()
5794 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); in qla_reinitialize_link()
5795 rval = qla2x00_full_login_lip(vha); in qla_reinitialize_link()
5797 ql_dbg(ql_dbg_disc, vha, 0xd050, "Link reinitialized\n"); in qla_reinitialize_link()
5799 ql_dbg(ql_dbg_disc, vha, 0xd051, in qla_reinitialize_link()
5815 qla2x00_configure_local_loop(scsi_qla_host_t *vha) in qla2x00_configure_local_loop() argument
5825 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_local_loop()
5830 return qla2x00_configure_n2n_loop(vha); in qla2x00_configure_local_loop()
5837 rval = qla2x00_get_id_list(vha, ha->gid_list, ha->gid_list_dma, in qla2x00_configure_local_loop()
5842 ql_dbg(ql_dbg_disc, vha, 0x2011, in qla2x00_configure_local_loop()
5844 ql_dump_buffer(ql_dbg_disc + ql_dbg_buffer, vha, 0x2075, in qla2x00_configure_local_loop()
5848 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_configure_local_loop()
5849 vha->scan.scan_retry++; in qla2x00_configure_local_loop()
5850 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_configure_local_loop()
5852 if (vha->scan.scan_retry < MAX_SCAN_RETRIES) { in qla2x00_configure_local_loop()
5856 rc = qla2x00_get_fcal_position_map(vha, NULL, in qla2x00_configure_local_loop()
5863 qla_reinitialize_link(vha); in qla2x00_configure_local_loop()
5866 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_configure_local_loop()
5867 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_local_loop()
5870 vha->scan.scan_retry = 0; in qla2x00_configure_local_loop()
5873 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_local_loop()
5878 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_configure_local_loop()
5880 ql_log(ql_log_warn, vha, 0x2012, in qla2x00_configure_local_loop()
5904 if (area && domain && ((area != vha->d_id.b.area) || in qla2x00_configure_local_loop()
5905 (domain != vha->d_id.b.domain)) && in qla2x00_configure_local_loop()
5923 rval2 = qla2x00_get_port_database(vha, new_fcport, 0); in qla2x00_configure_local_loop()
5925 ql_dbg(ql_dbg_disc, vha, 0x2097, in qla2x00_configure_local_loop()
5931 ql_dbg(ql_dbg_disc, vha, 0x2105, in qla2x00_configure_local_loop()
5933 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_local_loop()
5938 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla2x00_configure_local_loop()
5942 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_local_loop()
5955 fcport->login_retry = vha->hw->login_retry_count; in qla2x00_configure_local_loop()
5956 ql_dbg(ql_dbg_disc, vha, 0x2135, in qla2x00_configure_local_loop()
5967 list_add_tail(&new_fcport->list, &vha->vp_fcports); in qla2x00_configure_local_loop()
5972 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla2x00_configure_local_loop()
5974 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_configure_local_loop()
5977 ql_log(ql_log_warn, vha, 0xd031, in qla2x00_configure_local_loop()
5982 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla2x00_configure_local_loop()
5986 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla2x00_configure_local_loop()
5992 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_local_loop()
5993 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_configure_local_loop()
5997 if ((qla_dual_mode_enabled(vha) || in qla2x00_configure_local_loop()
5998 qla_ini_mode_enabled(vha)) && in qla2x00_configure_local_loop()
6000 qla2x00_mark_device_lost(vha, fcport, in qla2x00_configure_local_loop()
6006 ql_dbg(ql_dbg_disc, vha, 0x20f0, in qla2x00_configure_local_loop()
6018 qla24xx_fcport_handle_login(vha, fcport); in qla2x00_configure_local_loop()
6026 ql_dbg(ql_dbg_disc, vha, 0x2098, in qla2x00_configure_local_loop()
6032 qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_iidma_fcport() argument
6036 struct qla_hw_data *ha = vha->hw; in qla2x00_iidma_fcport()
6049 rval = qla2x00_set_idma_speed(vha, fcport->loop_id, fcport->fp_speed, in qla2x00_iidma_fcport()
6052 ql_dbg(ql_dbg_disc, vha, 0x2004, in qla2x00_iidma_fcport()
6056 ql_dbg(ql_dbg_disc, vha, 0x2005, in qla2x00_iidma_fcport()
6063 void qla_do_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla_do_iidma_work() argument
6065 qla2x00_iidma_fcport(vha, fcport); in qla_do_iidma_work()
6066 qla24xx_update_fcport_fcp_prio(vha, fcport); in qla_do_iidma_work()
6069 int qla_post_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla_post_iidma_work() argument
6073 e = qla2x00_alloc_work(vha, QLA_EVT_IIDMA); in qla_post_iidma_work()
6078 return qla2x00_post_work(vha, e); in qla_post_iidma_work()
6083 qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_reg_remote_port() argument
6097 fcport->rport = rport = fc_remote_port_add(vha->host, 0, &rport_ids); in qla2x00_reg_remote_port()
6099 ql_log(ql_log_warn, vha, 0x2006, in qla2x00_reg_remote_port()
6104 spin_lock_irqsave(fcport->vha->host->host_lock, flags); in qla2x00_reg_remote_port()
6106 spin_unlock_irqrestore(fcport->vha->host->host_lock, flags); in qla2x00_reg_remote_port()
6125 ql_dbg(ql_dbg_disc, vha, 0x20ee, in qla2x00_reg_remote_port()
6127 __func__, fcport->port_name, vha->host_no, in qla2x00_reg_remote_port()
6149 qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_update_fcport() argument
6156 ql_dbg(ql_dbg_disc, vha, 0x20ef, "%s %8phC\n", in qla2x00_update_fcport()
6160 fcport->login_retry = vha->hw->login_retry_count; in qla2x00_update_fcport()
6163 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_update_fcport()
6165 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_update_fcport()
6167 if (vha->hw->current_topology == ISP_CFG_NL) in qla2x00_update_fcport()
6178 switch (vha->hw->current_topology) { in qla2x00_update_fcport()
6187 qla2x00_iidma_fcport(vha, fcport); in qla2x00_update_fcport()
6189 qla2x00_dfs_create_rport(vha, fcport); in qla2x00_update_fcport()
6191 qla24xx_update_fcport_fcp_prio(vha, fcport); in qla2x00_update_fcport()
6193 switch (vha->host->active_mode) { in qla2x00_update_fcport()
6195 qla2x00_reg_remote_port(vha, fcport); in qla2x00_update_fcport()
6198 if (!vha->vha_tgt.qla_tgt->tgt_stop && in qla2x00_update_fcport()
6199 !vha->vha_tgt.qla_tgt->tgt_stopped) in qla2x00_update_fcport()
6200 qlt_fc_port_added(vha, fcport); in qla2x00_update_fcport()
6203 qla2x00_reg_remote_port(vha, fcport); in qla2x00_update_fcport()
6204 if (!vha->vha_tgt.qla_tgt->tgt_stop && in qla2x00_update_fcport()
6205 !vha->vha_tgt.qla_tgt->tgt_stopped) in qla2x00_update_fcport()
6206 qlt_fc_port_added(vha, fcport); in qla2x00_update_fcport()
6212 if (NVME_TARGET(vha->hw, fcport)) in qla2x00_update_fcport()
6213 qla_nvme_register_remote(vha, fcport); in qla2x00_update_fcport()
6217 if (IS_IIDMA_CAPABLE(vha->hw) && vha->hw->flags.gpsc_supported) { in qla2x00_update_fcport()
6220 ql_dbg(ql_dbg_disc, vha, 0x20d7, in qla2x00_update_fcport()
6223 vha->fcport_count); in qla2x00_update_fcport()
6224 qla24xx_post_gfpnid_work(vha, fcport); in qla2x00_update_fcport()
6226 ql_dbg(ql_dbg_disc, vha, 0x20d7, in qla2x00_update_fcport()
6229 vha->fcport_count); in qla2x00_update_fcport()
6230 qla24xx_post_gpsc_work(vha, fcport); in qla2x00_update_fcport()
6246 qla2x00_update_fcport(fcport->vha, fcport); in qla_register_fcport_fn()
6248 ql_dbg(ql_dbg_disc, fcport->vha, 0x911e, in qla_register_fcport_fn()
6260 qla2x00_post_async_adisc_work(fcport->vha, fcport, in qla_register_fcport_fn()
6281 qla2x00_configure_fabric(scsi_qla_host_t *vha) in qla2x00_configure_fabric() argument
6287 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_fabric()
6295 rval = qla2x00_get_port_name(vha, loop_id, vha->fabric_node_name, 1); in qla2x00_configure_fabric()
6297 ql_dbg(ql_dbg_disc, vha, 0x20a0, in qla2x00_configure_fabric()
6300 vha->device_flags &= ~SWITCH_FOUND; in qla2x00_configure_fabric()
6303 vha->device_flags |= SWITCH_FOUND; in qla2x00_configure_fabric()
6305 rval = qla2x00_get_port_name(vha, loop_id, vha->fabric_port_name, 0); in qla2x00_configure_fabric()
6307 ql_dbg(ql_dbg_disc, vha, 0x20ff, in qla2x00_configure_fabric()
6310 if (qla_tgt_mode_enabled(vha) || qla_dual_mode_enabled(vha)) { in qla2x00_configure_fabric()
6311 rval = qla2x00_send_change_request(vha, 0x3, 0); in qla2x00_configure_fabric()
6313 ql_log(ql_log_warn, vha, 0x121, in qla2x00_configure_fabric()
6319 qla2x00_mgmt_svr_login(vha); in qla2x00_configure_fabric()
6323 rval = ha->isp_ops->fabric_login(vha, loop_id, 0xff, 0xff, in qla2x00_configure_fabric()
6326 ql_dbg(ql_dbg_disc, vha, 0x20a1, in qla2x00_configure_fabric()
6329 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_fabric()
6335 test_and_clear_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags)) in qla2x00_configure_fabric()
6336 qla2x00_fdmi_register(vha); in qla2x00_configure_fabric()
6338 if (test_and_clear_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_fabric()
6339 if (qla2x00_rft_id(vha)) { in qla2x00_configure_fabric()
6341 ql_dbg(ql_dbg_disc, vha, 0x20a2, in qla2x00_configure_fabric()
6344 &vha->dpc_flags)) in qla2x00_configure_fabric()
6347 if (qla2x00_rff_id(vha, FC4_TYPE_FCP_SCSI)) { in qla2x00_configure_fabric()
6349 ql_dbg(ql_dbg_disc, vha, 0x209a, in qla2x00_configure_fabric()
6352 &vha->dpc_flags)) in qla2x00_configure_fabric()
6355 if (vha->flags.nvme_enabled) { in qla2x00_configure_fabric()
6356 if (qla2x00_rff_id(vha, FC_TYPE_NVME)) { in qla2x00_configure_fabric()
6357 ql_dbg(ql_dbg_disc, vha, 0x2049, in qla2x00_configure_fabric()
6361 if (qla2x00_rnn_id(vha)) { in qla2x00_configure_fabric()
6363 ql_dbg(ql_dbg_disc, vha, 0x2104, in qla2x00_configure_fabric()
6366 &vha->dpc_flags)) in qla2x00_configure_fabric()
6368 } else if (qla2x00_rsnn_nn(vha)) { in qla2x00_configure_fabric()
6370 ql_dbg(ql_dbg_disc, vha, 0x209b, in qla2x00_configure_fabric()
6372 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_configure_fabric()
6384 qlt_do_generation_tick(vha, &discovery_gen); in qla2x00_configure_fabric()
6387 rval = qla24xx_async_gpnft(vha, FC4_TYPE_FCP_SCSI, in qla2x00_configure_fabric()
6390 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_fabric()
6392 list_for_each_entry(fcport, &vha->vp_fcports, list) in qla2x00_configure_fabric()
6395 rval = qla2x00_find_all_fabric_devs(vha); in qla2x00_configure_fabric()
6401 if (!vha->nvme_local_port && vha->flags.nvme_enabled) in qla2x00_configure_fabric()
6402 qla_nvme_register_hba(vha); in qla2x00_configure_fabric()
6405 ql_dbg(ql_dbg_disc, vha, 0x2068, in qla2x00_configure_fabric()
6425 qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) in qla2x00_find_all_fabric_devs() argument
6436 struct qla_hw_data *ha = vha->hw; in qla2x00_find_all_fabric_devs()
6449 ql_dbg(ql_dbg_disc, vha, 0x209c, in qla2x00_find_all_fabric_devs()
6453 if (qla2x00_gid_pt(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
6455 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
6457 } else if (qla2x00_gpn_id(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
6459 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
6461 } else if (qla2x00_gnn_id(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
6463 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
6465 } else if (qla2x00_gfpn_id(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
6467 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
6473 qla2x00_gff_id(vha, swl); in qla2x00_find_all_fabric_devs()
6474 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
6481 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_find_all_fabric_devs()
6483 ql_log(ql_log_warn, vha, 0x209d, in qla2x00_find_all_fabric_devs()
6495 if (qla2x00_is_reserved_id(vha, loop_id)) in qla2x00_find_all_fabric_devs()
6499 (atomic_read(&vha->loop_down_timer) || in qla2x00_find_all_fabric_devs()
6500 LOOP_TRANSITION(vha))) { in qla2x00_find_all_fabric_devs()
6501 atomic_set(&vha->loop_down_timer, 0); in qla2x00_find_all_fabric_devs()
6502 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_find_all_fabric_devs()
6503 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_find_all_fabric_devs()
6522 if (vha->flags.nvme_enabled && in qla2x00_find_all_fabric_devs()
6524 ql_log(ql_log_info, vha, 0x2131, in qla2x00_find_all_fabric_devs()
6536 rval = qla2x00_ga_nxt(vha, new_fcport); in qla2x00_find_all_fabric_devs()
6538 ql_log(ql_log_warn, vha, 0x209e, in qla2x00_find_all_fabric_devs()
6551 ql_dbg(ql_dbg_disc, vha, 0x209f, in qla2x00_find_all_fabric_devs()
6564 if (qla2x00_is_a_vp_did(vha, new_fcport->d_id.b24)) in qla2x00_find_all_fabric_devs()
6569 (vha->d_id.b24 & 0xffff00)) && ha->current_topology == in qla2x00_find_all_fabric_devs()
6583 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla2x00_find_all_fabric_devs()
6587 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_find_all_fabric_devs()
6607 (vha->host->active_mode == MODE_TARGET))) { in qla2x00_find_all_fabric_devs()
6613 vha->hw->login_retry_count; in qla2x00_find_all_fabric_devs()
6631 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf080, in qla2x00_find_all_fabric_devs()
6651 if (found && NVME_TARGET(vha->hw, fcport)) { in qla2x00_find_all_fabric_devs()
6654 vha->fcport_count--; in qla2x00_find_all_fabric_devs()
6660 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla2x00_find_all_fabric_devs()
6665 list_add_tail(&new_fcport->list, &vha->vp_fcports); in qla2x00_find_all_fabric_devs()
6667 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla2x00_find_all_fabric_devs()
6672 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_find_all_fabric_devs()
6674 ql_log(ql_log_warn, vha, 0xd032, in qla2x00_find_all_fabric_devs()
6687 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_find_all_fabric_devs()
6688 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
6695 if ((qla_dual_mode_enabled(vha) || in qla2x00_find_all_fabric_devs()
6696 qla_ini_mode_enabled(vha)) && in qla2x00_find_all_fabric_devs()
6698 qla2x00_mark_device_lost(vha, fcport, in qla2x00_find_all_fabric_devs()
6704 ql_dbg(ql_dbg_disc, vha, 0x20f0, in qla2x00_find_all_fabric_devs()
6716 qla24xx_fcport_handle_login(vha, fcport); in qla2x00_find_all_fabric_devs()
6723 qla2x00_reserve_mgmt_server_loop_id(scsi_qla_host_t *vha) in qla2x00_reserve_mgmt_server_loop_id() argument
6726 int lid = NPH_MGMT_SERVER - vha->vp_idx; in qla2x00_reserve_mgmt_server_loop_id()
6728 struct qla_hw_data *ha = vha->hw; in qla2x00_reserve_mgmt_server_loop_id()
6730 if (vha->vp_idx == 0) { in qla2x00_reserve_mgmt_server_loop_id()
6738 if (!test_bit(lid, vha->hw->loop_id_map)) { in qla2x00_reserve_mgmt_server_loop_id()
6739 set_bit(lid, vha->hw->loop_id_map); in qla2x00_reserve_mgmt_server_loop_id()
6764 qla2x00_fabric_login(scsi_qla_host_t *vha, fc_port_t *fcport, in qla2x00_fabric_login() argument
6771 struct qla_hw_data *ha = vha->hw; in qla2x00_fabric_login()
6777 ql_dbg(ql_dbg_disc, vha, 0x2000, in qla2x00_fabric_login()
6784 rval = ha->isp_ops->fabric_login(vha, fcport->loop_id, in qla2x00_fabric_login()
6802 ql_dbg(ql_dbg_disc, vha, 0x2001, in qla2x00_fabric_login()
6850 rval = qla2x00_find_new_loop_id(vha, fcport); in qla2x00_fabric_login()
6862 ha->isp_ops->fabric_logout(vha, fcport->loop_id, in qla2x00_fabric_login()
6865 qla2x00_mark_device_lost(vha, fcport, 1); in qla2x00_fabric_login()
6873 ql_dbg(ql_dbg_disc, vha, 0x2002, in qla2x00_fabric_login()
6880 ha->isp_ops->fabric_logout(vha, fcport->loop_id, in qla2x00_fabric_login()
6908 qla2x00_local_device_login(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_local_device_login() argument
6914 rval = qla2x00_login_local_device(vha, fcport, mb, BIT_0); in qla2x00_local_device_login()
6938 qla2x00_loop_resync(scsi_qla_host_t *vha) in qla2x00_loop_resync() argument
6943 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_loop_resync()
6944 if (vha->flags.online) { in qla2x00_loop_resync()
6945 if (!(rval = qla2x00_fw_ready(vha))) { in qla2x00_loop_resync()
6949 if (!IS_QLAFX00(vha->hw)) { in qla2x00_loop_resync()
6954 qla2x00_marker(vha, vha->hw->base_qpair, in qla2x00_loop_resync()
6956 vha->marker_needed = 0; in qla2x00_loop_resync()
6960 clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_loop_resync()
6962 if (IS_QLAFX00(vha->hw)) in qla2x00_loop_resync()
6963 qlafx00_configure_devices(vha); in qla2x00_loop_resync()
6965 qla2x00_configure_loop(vha); in qla2x00_loop_resync()
6968 } while (!atomic_read(&vha->loop_down_timer) && in qla2x00_loop_resync()
6969 !(test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) in qla2x00_loop_resync()
6971 &vha->dpc_flags))); in qla2x00_loop_resync()
6975 if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) in qla2x00_loop_resync()
6979 ql_dbg(ql_dbg_disc, vha, 0x206c, in qla2x00_loop_resync()
7018 qla83xx_reset_ownership(scsi_qla_host_t *vha) in qla83xx_reset_ownership() argument
7020 struct qla_hw_data *ha = vha->hw; in qla83xx_reset_ownership()
7027 drv_presence = qla8044_rd_direct(vha, in qla83xx_reset_ownership()
7029 dev_part_info1 = qla8044_rd_direct(vha, in qla83xx_reset_ownership()
7031 dev_part_info2 = qla8044_rd_direct(vha, in qla83xx_reset_ownership()
7034 qla83xx_rd_reg(vha, QLA83XX_IDC_DRV_PRESENCE, &drv_presence); in qla83xx_reset_ownership()
7035 qla83xx_rd_reg(vha, QLA83XX_DEV_PARTINFO1, &dev_part_info1); in qla83xx_reset_ownership()
7036 qla83xx_rd_reg(vha, QLA83XX_DEV_PARTINFO2, &dev_part_info2); in qla83xx_reset_ownership()
7070 ql_dbg(ql_dbg_p3p, vha, 0xb07f, in qla83xx_reset_ownership()
7077 __qla83xx_set_drv_ack(scsi_qla_host_t *vha) in __qla83xx_set_drv_ack() argument
7080 struct qla_hw_data *ha = vha->hw; in __qla83xx_set_drv_ack()
7083 rval = qla83xx_rd_reg(vha, QLA83XX_IDC_DRIVER_ACK, &drv_ack); in __qla83xx_set_drv_ack()
7086 rval = qla83xx_wr_reg(vha, QLA83XX_IDC_DRIVER_ACK, drv_ack); in __qla83xx_set_drv_ack()
7093 __qla83xx_clear_drv_ack(scsi_qla_host_t *vha) in __qla83xx_clear_drv_ack() argument
7096 struct qla_hw_data *ha = vha->hw; in __qla83xx_clear_drv_ack()
7099 rval = qla83xx_rd_reg(vha, QLA83XX_IDC_DRIVER_ACK, &drv_ack); in __qla83xx_clear_drv_ack()
7102 rval = qla83xx_wr_reg(vha, QLA83XX_IDC_DRIVER_ACK, drv_ack); in __qla83xx_clear_drv_ack()
7110 qla83xx_idc_audit(scsi_qla_host_t *vha, int audit_type) in qla83xx_idc_audit() argument
7112 struct qla_hw_data *ha = vha->hw; in qla83xx_idc_audit()
7120 qla83xx_wr_reg(vha, QLA83XX_IDC_AUDIT, idc_audit_reg); in qla83xx_idc_audit()
7128 qla83xx_wr_reg(vha, QLA83XX_IDC_AUDIT, idc_audit_reg); in qla83xx_idc_audit()
7132 ql_log(ql_log_warn, vha, 0xb078, in qla83xx_idc_audit()
7140 qla83xx_initiating_reset(scsi_qla_host_t *vha) in qla83xx_initiating_reset() argument
7142 struct qla_hw_data *ha = vha->hw; in qla83xx_initiating_reset()
7145 __qla83xx_get_idc_control(vha, &idc_control); in qla83xx_initiating_reset()
7147 ql_log(ql_log_info, vha, 0xb080, in qla83xx_initiating_reset()
7154 qla83xx_rd_reg(vha, QLA83XX_IDC_DEV_STATE, &dev_state); in qla83xx_initiating_reset()
7156 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE, in qla83xx_initiating_reset()
7158 ql_log(ql_log_info, vha, 0xb056, "HW State: NEED RESET.\n"); in qla83xx_initiating_reset()
7159 qla83xx_idc_audit(vha, IDC_AUDIT_TIMESTAMP); in qla83xx_initiating_reset()
7161 ql_log(ql_log_info, vha, 0xb057, "HW State: %s.\n", in qla83xx_initiating_reset()
7167 qla83xx_idc_unlock(vha, 0); in qla83xx_initiating_reset()
7169 qla83xx_idc_lock(vha, 0); in qla83xx_initiating_reset()
7170 qla83xx_rd_reg(vha, QLA83XX_IDC_DEV_STATE, &dev_state); in qla83xx_initiating_reset()
7175 __qla83xx_set_drv_ack(vha); in qla83xx_initiating_reset()
7181 __qla83xx_set_idc_control(scsi_qla_host_t *vha, uint32_t idc_control) in __qla83xx_set_idc_control() argument
7183 return qla83xx_wr_reg(vha, QLA83XX_IDC_CONTROL, idc_control); in __qla83xx_set_idc_control()
7187 __qla83xx_get_idc_control(scsi_qla_host_t *vha, uint32_t *idc_control) in __qla83xx_get_idc_control() argument
7189 return qla83xx_rd_reg(vha, QLA83XX_IDC_CONTROL, idc_control); in __qla83xx_get_idc_control()
7193 qla83xx_check_driver_presence(scsi_qla_host_t *vha) in qla83xx_check_driver_presence() argument
7196 struct qla_hw_data *ha = vha->hw; in qla83xx_check_driver_presence()
7198 qla83xx_rd_reg(vha, QLA83XX_IDC_DRV_PRESENCE, &drv_presence); in qla83xx_check_driver_presence()
7206 qla83xx_nic_core_reset(scsi_qla_host_t *vha) in qla83xx_nic_core_reset() argument
7209 struct qla_hw_data *ha = vha->hw; in qla83xx_nic_core_reset()
7211 ql_dbg(ql_dbg_p3p, vha, 0xb058, in qla83xx_nic_core_reset()
7214 if (vha->device_flags & DFLG_DEV_FAILED) { in qla83xx_nic_core_reset()
7215 ql_log(ql_log_warn, vha, 0xb059, in qla83xx_nic_core_reset()
7220 qla83xx_idc_lock(vha, 0); in qla83xx_nic_core_reset()
7222 if (qla83xx_check_driver_presence(vha) != QLA_SUCCESS) { in qla83xx_nic_core_reset()
7223 ql_log(ql_log_warn, vha, 0xb05a, in qla83xx_nic_core_reset()
7230 qla83xx_reset_ownership(vha); in qla83xx_nic_core_reset()
7232 rval = qla83xx_initiating_reset(vha); in qla83xx_nic_core_reset()
7239 rval = qla83xx_idc_state_handler(vha); in qla83xx_nic_core_reset()
7243 __qla83xx_clear_drv_ack(vha); in qla83xx_nic_core_reset()
7247 qla83xx_idc_unlock(vha, 0); in qla83xx_nic_core_reset()
7249 ql_dbg(ql_dbg_p3p, vha, 0xb05b, "Exiting %s.\n", __func__); in qla83xx_nic_core_reset()
7255 qla2xxx_mctp_dump(scsi_qla_host_t *vha) in qla2xxx_mctp_dump() argument
7257 struct qla_hw_data *ha = vha->hw; in qla2xxx_mctp_dump()
7262 ql_log(ql_log_info, vha, 0x506d, in qla2xxx_mctp_dump()
7272 ql_log(ql_log_warn, vha, 0x506e, in qla2xxx_mctp_dump()
7279 rval = qla2x00_dump_mctp_data(vha, ha->mctp_dump_dma, in qla2xxx_mctp_dump()
7282 ql_log(ql_log_warn, vha, 0x506f, in qla2xxx_mctp_dump()
7285 ql_log(ql_log_info, vha, 0x5070, in qla2xxx_mctp_dump()
7287 vha->host_no, ha->mctp_dump); in qla2xxx_mctp_dump()
7293 rval = qla83xx_restart_nic_firmware(vha); in qla2xxx_mctp_dump()
7296 ql_log(ql_log_warn, vha, 0x5071, in qla2xxx_mctp_dump()
7299 ql_dbg(ql_dbg_p3p, vha, 0xb084, in qla2xxx_mctp_dump()
7317 qla2x00_quiesce_io(scsi_qla_host_t *vha) in qla2x00_quiesce_io() argument
7319 struct qla_hw_data *ha = vha->hw; in qla2x00_quiesce_io()
7323 ql_dbg(ql_dbg_dpc, vha, 0x401d, in qla2x00_quiesce_io()
7327 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { in qla2x00_quiesce_io()
7328 atomic_set(&vha->loop_state, LOOP_DOWN); in qla2x00_quiesce_io()
7329 qla2x00_mark_all_devices_lost(vha); in qla2x00_quiesce_io()
7343 if (!atomic_read(&vha->loop_down_timer)) in qla2x00_quiesce_io()
7344 atomic_set(&vha->loop_down_timer, in qla2x00_quiesce_io()
7348 WARN_ON_ONCE(qla2x00_eh_wait_for_pending_commands(vha, 0, 0, WAIT_HOST) in qla2x00_quiesce_io()
7353 qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) in qla2x00_abort_isp_cleanup() argument
7355 struct qla_hw_data *ha = vha->hw; in qla2x00_abort_isp_cleanup()
7365 vha->flags.online = 0; in qla2x00_abort_isp_cleanup()
7367 clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_abort_isp_cleanup()
7368 vha->qla_stats.total_isp_aborts++; in qla2x00_abort_isp_cleanup()
7370 ql_log(ql_log_info, vha, 0x00af, in qla2x00_abort_isp_cleanup()
7379 ha->isp_ops->reset_chip(vha); in qla2x00_abort_isp_cleanup()
7421 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); in qla2x00_abort_isp_cleanup()
7422 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { in qla2x00_abort_isp_cleanup()
7423 atomic_set(&vha->loop_state, LOOP_DOWN); in qla2x00_abort_isp_cleanup()
7424 qla2x00_mark_all_devices_lost(vha); in qla2x00_abort_isp_cleanup()
7438 if (!atomic_read(&vha->loop_down_timer)) in qla2x00_abort_isp_cleanup()
7439 atomic_set(&vha->loop_down_timer, in qla2x00_abort_isp_cleanup()
7444 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_abort_isp_cleanup()
7463 qla82xx_chip_reset_cleanup(vha); in qla2x00_abort_isp_cleanup()
7464 ql_log(ql_log_info, vha, 0x00b4, in qla2x00_abort_isp_cleanup()
7468 vha->flags.online = 0; in qla2x00_abort_isp_cleanup()
7472 qla2x00_abort_all_cmds(vha, DID_RESET << 16); in qla2x00_abort_isp_cleanup()
7488 qla2x00_abort_isp(scsi_qla_host_t *vha) in qla2x00_abort_isp() argument
7492 struct qla_hw_data *ha = vha->hw; in qla2x00_abort_isp()
7497 if (vha->flags.online) { in qla2x00_abort_isp()
7498 qla2x00_abort_isp_cleanup(vha); in qla2x00_abort_isp()
7500 vha->dport_status |= DPORT_DIAG_CHIP_RESET_IN_PROGRESS; in qla2x00_abort_isp()
7501 vha->dport_status &= ~DPORT_DIAG_IN_PROGRESS; in qla2x00_abort_isp()
7503 if (vha->hw->flags.port_isolated) in qla2x00_abort_isp()
7507 ql_log(ql_log_info, vha, 0x803f, in qla2x00_abort_isp()
7512 if (test_and_clear_bit(ISP_ABORT_TO_ROM, &vha->dpc_flags)) { in qla2x00_abort_isp()
7514 vha->flags.online = 1; in qla2x00_abort_isp()
7516 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
7521 ql_dbg(ql_dbg_p3p, vha, 0xb05c, in qla2x00_abort_isp()
7523 if (qla83xx_clear_drv_presence(vha) != QLA_SUCCESS) in qla2x00_abort_isp()
7524 ql_dbg(ql_dbg_p3p, vha, 0xb073, in qla2x00_abort_isp()
7530 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
7535 switch (vha->qlini_mode) { in qla2x00_abort_isp()
7537 if (!qla_tgt_mode_enabled(vha)) in qla2x00_abort_isp()
7541 if (!qla_dual_mode_enabled(vha) && in qla2x00_abort_isp()
7542 !qla_ini_mode_enabled(vha)) in qla2x00_abort_isp()
7550 ha->isp_ops->get_flash_version(vha, req->ring); in qla2x00_abort_isp()
7553 ql_log(ql_log_info, vha, 0x803f, in qla2x00_abort_isp()
7557 ha->isp_ops->nvram_config(vha); in qla2x00_abort_isp()
7560 ql_log(ql_log_info, vha, 0x803f, in qla2x00_abort_isp()
7564 if (!qla2x00_restart_isp(vha)) { in qla2x00_abort_isp()
7565 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla2x00_abort_isp()
7567 if (!atomic_read(&vha->loop_down_timer)) { in qla2x00_abort_isp()
7572 vha->marker_needed = 1; in qla2x00_abort_isp()
7575 vha->flags.online = 1; in qla2x00_abort_isp()
7580 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
7583 qla2x00_get_fw_version(vha); in qla2x00_abort_isp()
7588 rval = qla2x00_enable_fce_trace(vha, in qla2x00_abort_isp()
7592 ql_log(ql_log_warn, vha, 0x8033, in qla2x00_abort_isp()
7601 rval = qla2x00_enable_eft_trace(vha, in qla2x00_abort_isp()
7604 ql_log(ql_log_warn, vha, 0x8034, in qla2x00_abort_isp()
7610 vha->flags.online = 1; in qla2x00_abort_isp()
7611 if (test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { in qla2x00_abort_isp()
7613 ql_log(ql_log_fatal, vha, 0x8035, in qla2x00_abort_isp()
7620 qla2x00_abort_isp_cleanup(vha); in qla2x00_abort_isp()
7621 vha->flags.online = 0; in qla2x00_abort_isp()
7623 &vha->dpc_flags); in qla2x00_abort_isp()
7627 ql_dbg(ql_dbg_taskm, vha, 0x8020, in qla2x00_abort_isp()
7634 ql_dbg(ql_dbg_taskm, vha, 0x8021, in qla2x00_abort_isp()
7637 set_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
7644 if (vha->hw->flags.port_isolated) { in qla2x00_abort_isp()
7645 qla2x00_abort_isp_cleanup(vha); in qla2x00_abort_isp()
7650 ql_dbg(ql_dbg_taskm, vha, 0x8022, "%s succeeded.\n", __func__); in qla2x00_abort_isp()
7651 qla2x00_configure_hba(vha); in qla2x00_abort_isp()
7667 ql_dbg(ql_dbg_p3p, vha, 0xb05d, in qla2x00_abort_isp()
7669 if (qla83xx_set_drv_presence(vha) != QLA_SUCCESS) in qla2x00_abort_isp()
7670 ql_dbg(ql_dbg_p3p, vha, 0xb074, in qla2x00_abort_isp()
7674 ql_log(ql_log_warn, vha, 0x8023, "%s **** FAILED ****.\n", in qla2x00_abort_isp()
7692 qla2x00_restart_isp(scsi_qla_host_t *vha) in qla2x00_restart_isp() argument
7695 struct qla_hw_data *ha = vha->hw; in qla2x00_restart_isp()
7698 if (qla2x00_isp_firmware(vha)) { in qla2x00_restart_isp()
7699 vha->flags.online = 0; in qla2x00_restart_isp()
7700 status = ha->isp_ops->chip_diag(vha); in qla2x00_restart_isp()
7703 status = qla2x00_setup_chip(vha); in qla2x00_restart_isp()
7708 status = qla2x00_init_rings(vha); in qla2x00_restart_isp()
7712 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla2x00_restart_isp()
7718 status = qla2x00_fw_ready(vha); in qla2x00_restart_isp()
7721 return vha->device_flags & DFLG_NO_CABLE ? 0 : status; in qla2x00_restart_isp()
7725 qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL); in qla2x00_restart_isp()
7726 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_restart_isp()
7782 qla2x00_reset_adapter(scsi_qla_host_t *vha) in qla2x00_reset_adapter() argument
7785 struct qla_hw_data *ha = vha->hw; in qla2x00_reset_adapter()
7788 vha->flags.online = 0; in qla2x00_reset_adapter()
7802 qla24xx_reset_adapter(scsi_qla_host_t *vha) in qla24xx_reset_adapter() argument
7805 struct qla_hw_data *ha = vha->hw; in qla24xx_reset_adapter()
7811 vha->flags.online = 0; in qla24xx_reset_adapter()
7830 static void qla24xx_nvram_wwn_from_ofw(scsi_qla_host_t *vha, in qla24xx_nvram_wwn_from_ofw() argument
7834 struct qla_hw_data *ha = vha->hw; in qla24xx_nvram_wwn_from_ofw()
7851 qla24xx_nvram_config(scsi_qla_host_t *vha) in qla24xx_nvram_config() argument
7860 struct qla_hw_data *ha = vha->hw; in qla24xx_nvram_config()
7880 ha->isp_ops->read_nvram(vha, ha->vpd, in qla24xx_nvram_config()
7885 ha->isp_ops->read_nvram(vha, dptr, ha->nvram_base, ha->nvram_size); in qla24xx_nvram_config()
7889 ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x006a, in qla24xx_nvram_config()
7891 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x010d, in qla24xx_nvram_config()
7898 ql_log(ql_log_warn, vha, 0x006b, in qla24xx_nvram_config()
7901 ql_dump_buffer(ql_dbg_init, vha, 0x006b, nv, sizeof(*nv)); in qla24xx_nvram_config()
7902 ql_log(ql_log_warn, vha, 0x006c, in qla24xx_nvram_config()
7932 qla24xx_nvram_wwn_from_ofw(vha, nv); in qla24xx_nvram_config()
7951 if (qla_tgt_mode_enabled(vha)) { in qla24xx_nvram_config()
7958 qlt_24xx_config_nvram_stage1(vha, nv); in qla24xx_nvram_config()
7984 qla2x00_set_model_info(vha, nv->model_name, sizeof(nv->model_name), in qla24xx_nvram_config()
7987 qlt_24xx_config_nvram_stage2(vha, icb); in qla24xx_nvram_config()
8025 memcpy(vha->node_name, icb->node_name, WWN_SIZE); in qla24xx_nvram_config()
8026 memcpy(vha->port_name, icb->port_name, WWN_SIZE); in qla24xx_nvram_config()
8083 if (!vha->flags.init_done) { in qla24xx_nvram_config()
8094 ql_log(ql_log_info, vha, 0x006f, in qla24xx_nvram_config()
8104 ql_log(ql_log_warn, vha, 0x0070, in qla24xx_nvram_config()
8111 qla27xx_print_image(struct scsi_qla_host *vha, char *name, in qla27xx_print_image() argument
8114 ql_dbg(ql_dbg_init, vha, 0x018b, in qla27xx_print_image()
8202 struct scsi_qla_host *vha, struct active_regions *active_regions) in qla28xx_get_aux_images() argument
8204 struct qla_hw_data *ha = vha->hw; in qla28xx_get_aux_images()
8210 ql_dbg(ql_dbg_init, vha, 0x018a, "Primary aux image not addressed\n"); in qla28xx_get_aux_images()
8214 qla24xx_read_flash_data(vha, (uint32_t *)&pri_aux_image_status, in qla28xx_get_aux_images()
8217 qla27xx_print_image(vha, "Primary aux image", &pri_aux_image_status); in qla28xx_get_aux_images()
8220 ql_dbg(ql_dbg_init, vha, 0x018b, in qla28xx_get_aux_images()
8227 ql_dbg(ql_dbg_init, vha, 0x018c, in qla28xx_get_aux_images()
8235 ql_dbg(ql_dbg_init, vha, 0x018d, in qla28xx_get_aux_images()
8242 ql_dbg(ql_dbg_init, vha, 0x018a, in qla28xx_get_aux_images()
8247 qla24xx_read_flash_data(vha, (uint32_t *)&sec_aux_image_status, in qla28xx_get_aux_images()
8250 qla27xx_print_image(vha, "Secondary aux image", &sec_aux_image_status); in qla28xx_get_aux_images()
8253 ql_dbg(ql_dbg_init, vha, 0x018b, in qla28xx_get_aux_images()
8260 ql_dbg(ql_dbg_init, vha, 0x018c, in qla28xx_get_aux_images()
8268 ql_dbg(ql_dbg_init, vha, 0x018d, in qla28xx_get_aux_images()
8290 ql_dbg(ql_dbg_init, vha, 0x018f, in qla28xx_get_aux_images()
8300 qla27xx_get_active_image(struct scsi_qla_host *vha, in qla27xx_get_active_image() argument
8303 struct qla_hw_data *ha = vha->hw; in qla27xx_get_active_image()
8309 ql_dbg(ql_dbg_init, vha, 0x018a, "Primary image not addressed\n"); in qla27xx_get_active_image()
8313 if (qla24xx_read_flash_data(vha, (uint32_t *)&pri_image_status, in qla27xx_get_active_image()
8319 qla27xx_print_image(vha, "Primary image", &pri_image_status); in qla27xx_get_active_image()
8322 ql_dbg(ql_dbg_init, vha, 0x018b, in qla27xx_get_active_image()
8329 ql_dbg(ql_dbg_init, vha, 0x018c, in qla27xx_get_active_image()
8337 ql_dbg(ql_dbg_init, vha, 0x018d, in qla27xx_get_active_image()
8344 ql_dbg(ql_dbg_init, vha, 0x018a, "Secondary image not addressed\n"); in qla27xx_get_active_image()
8348 qla24xx_read_flash_data(vha, (uint32_t *)(&sec_image_status), in qla27xx_get_active_image()
8350 qla27xx_print_image(vha, "Secondary image", &sec_image_status); in qla27xx_get_active_image()
8353 ql_dbg(ql_dbg_init, vha, 0x018b, in qla27xx_get_active_image()
8360 ql_dbg(ql_dbg_init, vha, 0x018c, in qla27xx_get_active_image()
8368 ql_dbg(ql_dbg_init, vha, 0x018d, in qla27xx_get_active_image()
8385 ql_dbg(ql_dbg_init, vha, 0x018f, "active image %s (%u)\n", in qla27xx_get_active_image()
8403 qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr, in qla24xx_load_risc_flash() argument
8413 struct qla_hw_data *ha = vha->hw; in qla24xx_load_risc_flash()
8417 ql_dbg(ql_dbg_init, vha, 0x008b, in qla24xx_load_risc_flash()
8421 qla24xx_read_flash_data(vha, dcode, faddr, 8); in qla24xx_load_risc_flash()
8423 ql_log(ql_log_fatal, vha, 0x008c, in qla24xx_load_risc_flash()
8426 ql_log(ql_log_fatal, vha, 0x008d, in qla24xx_load_risc_flash()
8437 ql_dbg(ql_dbg_init, vha, 0x008d, in qla24xx_load_risc_flash()
8439 qla24xx_read_flash_data(vha, dcode, faddr, 10); in qla24xx_load_risc_flash()
8452 ql_dbg(ql_dbg_init, vha, 0x008e, in qla24xx_load_risc_flash()
8455 qla24xx_read_flash_data(vha, dcode, faddr, dlen); in qla24xx_load_risc_flash()
8459 rval = qla2x00_load_ram(vha, req->dma, risc_addr, dlen); in qla24xx_load_risc_flash()
8461 ql_log(ql_log_fatal, vha, 0x008f, in qla24xx_load_risc_flash()
8477 ql_dbg(ql_dbg_init, vha, 0x0160, "-> templates = %u\n", templates); in qla24xx_load_risc_flash()
8484 qla24xx_read_flash_data(vha, dcode, faddr, 7); in qla24xx_load_risc_flash()
8486 ql_dbg(ql_dbg_init, vha, 0x0161, in qla24xx_load_risc_flash()
8490 ql_dbg(ql_dbg_init, vha, 0x0162, in qla24xx_load_risc_flash()
8499 ql_dbg(ql_dbg_init, vha, 0x0163, in qla24xx_load_risc_flash()
8504 ql_log(ql_log_warn, vha, 0x0164, in qla24xx_load_risc_flash()
8510 qla24xx_read_flash_data(vha, dcode, faddr, risc_size); in qla24xx_load_risc_flash()
8513 ql_log(ql_log_warn, vha, 0x0165, in qla24xx_load_risc_flash()
8519 ql_dbg(ql_dbg_init, vha, 0x0166, in qla24xx_load_risc_flash()
8523 ql_log(ql_log_warn, vha, 0x0167, in qla24xx_load_risc_flash()
8530 ql_dbg(ql_dbg_init, vha, 0x0168, in qla24xx_load_risc_flash()
8549 qla2x00_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla2x00_load_risc() argument
8557 struct qla_hw_data *ha = vha->hw; in qla2x00_load_risc()
8561 blob = qla2x00_request_firmware(vha); in qla2x00_load_risc()
8563 ql_log(ql_log_info, vha, 0x0083, in qla2x00_load_risc()
8565 ql_log(ql_log_info, vha, 0x0084, in qla2x00_load_risc()
8579 ql_log(ql_log_fatal, vha, 0x0085, in qla2x00_load_risc()
8589 ql_log(ql_log_fatal, vha, 0x0086, in qla2x00_load_risc()
8591 ql_log(ql_log_fatal, vha, 0x0087, in qla2x00_load_risc()
8606 ql_log(ql_log_fatal, vha, 0x0088, in qla2x00_load_risc()
8617 ql_dbg(ql_dbg_init, vha, 0x0089, in qla2x00_load_risc()
8624 rval = qla2x00_load_ram(vha, req->dma, risc_addr, in qla2x00_load_risc()
8627 ql_log(ql_log_fatal, vha, 0x008a, in qla2x00_load_risc()
8649 qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla24xx_load_risc_blob() argument
8660 struct qla_hw_data *ha = vha->hw; in qla24xx_load_risc_blob()
8664 ql_dbg(ql_dbg_init, vha, 0x0090, in qla24xx_load_risc_blob()
8667 blob = qla2x00_request_firmware(vha); in qla24xx_load_risc_blob()
8669 ql_log(ql_log_warn, vha, 0x0092, in qla24xx_load_risc_blob()
8678 ql_log(ql_log_fatal, vha, 0x0093, in qla24xx_load_risc_blob()
8681 ql_log(ql_log_fatal, vha, 0x0095, in qla24xx_load_risc_blob()
8691 ql_dbg(ql_dbg_init, vha, 0x0096, in qla24xx_load_risc_blob()
8706 ql_dbg(ql_dbg_init, vha, 0x0097, in qla24xx_load_risc_blob()
8715 rval = qla2x00_load_ram(vha, req->dma, risc_addr, dlen); in qla24xx_load_risc_blob()
8717 ql_log(ql_log_fatal, vha, 0x0098, in qla24xx_load_risc_blob()
8733 ql_dbg(ql_dbg_init, vha, 0x0170, "-> templates = %u\n", templates); in qla24xx_load_risc_blob()
8740 ql_dbg(ql_dbg_init, vha, 0x0171, in qla24xx_load_risc_blob()
8745 ql_dbg(ql_dbg_init, vha, 0x0172, in qla24xx_load_risc_blob()
8754 ql_dbg(ql_dbg_init, vha, 0x0173, in qla24xx_load_risc_blob()
8759 ql_log(ql_log_warn, vha, 0x0174, in qla24xx_load_risc_blob()
8769 ql_log(ql_log_warn, vha, 0x0175, in qla24xx_load_risc_blob()
8775 ql_dbg(ql_dbg_init, vha, 0x0176, in qla24xx_load_risc_blob()
8779 ql_log(ql_log_warn, vha, 0x0177, in qla24xx_load_risc_blob()
8786 ql_dbg(ql_dbg_init, vha, 0x0178, in qla24xx_load_risc_blob()
8803 qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla24xx_load_risc() argument
8808 return qla81xx_load_risc(vha, srisc_addr); in qla24xx_load_risc()
8815 rval = qla24xx_load_risc_blob(vha, srisc_addr); in qla24xx_load_risc()
8819 return qla24xx_load_risc_flash(vha, srisc_addr, in qla24xx_load_risc()
8820 vha->hw->flt_region_fw); in qla24xx_load_risc()
8824 qla81xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla81xx_load_risc() argument
8827 struct qla_hw_data *ha = vha->hw; in qla81xx_load_risc()
8842 qla27xx_get_active_image(vha, &active_regions); in qla81xx_load_risc()
8847 ql_dbg(ql_dbg_init, vha, 0x008b, in qla81xx_load_risc()
8849 rval = qla24xx_load_risc_flash(vha, srisc_addr, ha->flt_region_fw_sec); in qla81xx_load_risc()
8854 ql_dbg(ql_dbg_init, vha, 0x008b, in qla81xx_load_risc()
8856 rval = qla24xx_load_risc_flash(vha, srisc_addr, ha->flt_region_fw); in qla81xx_load_risc()
8861 rval = qla24xx_load_risc_blob(vha, srisc_addr); in qla81xx_load_risc()
8865 ql_log(ql_log_info, vha, 0x0099, in qla81xx_load_risc()
8867 rval = qla24xx_load_risc_flash(vha, srisc_addr, ha->flt_region_gold_fw); in qla81xx_load_risc()
8871 ql_log(ql_log_info, vha, 0x009a, "Need firmware flash update.\n"); in qla81xx_load_risc()
8877 qla2x00_try_to_stop_firmware(scsi_qla_host_t *vha) in qla2x00_try_to_stop_firmware() argument
8880 struct qla_hw_data *ha = vha->hw; in qla2x00_try_to_stop_firmware()
8891 ret = qla2x00_stop_firmware(vha); in qla2x00_try_to_stop_firmware()
8894 ha->isp_ops->reset_chip(vha); in qla2x00_try_to_stop_firmware()
8895 if (ha->isp_ops->chip_diag(vha) != QLA_SUCCESS) in qla2x00_try_to_stop_firmware()
8897 if (qla2x00_setup_chip(vha) != QLA_SUCCESS) in qla2x00_try_to_stop_firmware()
8899 ql_log(ql_log_info, vha, 0x8015, in qla2x00_try_to_stop_firmware()
8901 ret = qla2x00_stop_firmware(vha); in qla2x00_try_to_stop_firmware()
8909 qla24xx_configure_vhba(scsi_qla_host_t *vha) in qla24xx_configure_vhba() argument
8914 struct qla_hw_data *ha = vha->hw; in qla24xx_configure_vhba()
8917 if (!vha->vp_idx) in qla24xx_configure_vhba()
8923 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla24xx_configure_vhba()
8924 qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL); in qla24xx_configure_vhba()
8927 vha->flags.management_server_logged_in = 0; in qla24xx_configure_vhba()
8930 rval2 = ha->isp_ops->fabric_login(vha, NPH_SNS, 0xff, 0xff, 0xfc, mb, in qla24xx_configure_vhba()
8934 ql_dbg(ql_dbg_init, vha, 0x0120, in qla24xx_configure_vhba()
8938 ql_dbg(ql_dbg_init, vha, 0x0103, in qla24xx_configure_vhba()
8945 atomic_set(&vha->loop_down_timer, 0); in qla24xx_configure_vhba()
8946 atomic_set(&vha->loop_state, LOOP_UP); in qla24xx_configure_vhba()
8947 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla24xx_configure_vhba()
8948 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla24xx_configure_vhba()
8960 qla84xx_get_chip(struct scsi_qla_host *vha) in qla84xx_get_chip() argument
8963 struct qla_hw_data *ha = vha->hw; in qla84xx_get_chip()
9003 qla84xx_put_chip(struct scsi_qla_host *vha) in qla84xx_put_chip() argument
9005 struct qla_hw_data *ha = vha->hw; in qla84xx_put_chip()
9012 qla84xx_init_chip(scsi_qla_host_t *vha) in qla84xx_init_chip() argument
9016 struct qla_hw_data *ha = vha->hw; in qla84xx_init_chip()
9020 rval = qla84xx_verify_chip(vha, status); in qla84xx_init_chip()
9031 qla81xx_nvram_config(scsi_qla_host_t *vha) in qla81xx_nvram_config() argument
9040 struct qla_hw_data *ha = vha->hw; in qla81xx_nvram_config()
9055 qla28xx_get_aux_images(vha, &active_regions); in qla81xx_nvram_config()
9064 ql_dbg(ql_dbg_init, vha, 0x0110, in qla81xx_nvram_config()
9069 ha->isp_ops->read_optrom(vha, ha->vpd, faddr << 2, ha->vpd_size); in qla81xx_nvram_config()
9077 ql_dbg(ql_dbg_init, vha, 0x0110, in qla81xx_nvram_config()
9081 ha->isp_ops->read_optrom(vha, ha->nvram, faddr << 2, ha->nvram_size); in qla81xx_nvram_config()
9087 ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x0111, in qla81xx_nvram_config()
9089 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x0112, in qla81xx_nvram_config()
9096 ql_log(ql_log_info, vha, 0x0073, in qla81xx_nvram_config()
9099 ql_dump_buffer(ql_dbg_init, vha, 0x0073, nv, sizeof(*nv)); in qla81xx_nvram_config()
9100 ql_log(ql_log_info, vha, 0x0074, in qla81xx_nvram_config()
9156 qlt_81xx_config_nvram_stage1(vha, nv); in qla81xx_nvram_config()
9195 qla2x00_set_model_info(vha, nv->model_name, sizeof(nv->model_name), in qla81xx_nvram_config()
9198 qlt_81xx_config_nvram_stage2(vha, icb); in qla81xx_nvram_config()
9238 memcpy(vha->node_name, icb->node_name, WWN_SIZE); in qla81xx_nvram_config()
9239 memcpy(vha->port_name, icb->port_name, WWN_SIZE); in qla81xx_nvram_config()
9293 if (!vha->hw->flags.msix_enabled && in qla81xx_nvram_config()
9298 if (!vha->flags.init_done) { in qla81xx_nvram_config()
9306 vha->flags.process_response_queue = 0; in qla81xx_nvram_config()
9310 ql_log(ql_log_info, vha, 0x0075, in qla81xx_nvram_config()
9318 vha->flags.process_response_queue = 1; in qla81xx_nvram_config()
9328 ha->fc4_type_priority = qla2xxx_get_fc4_priority(vha); in qla81xx_nvram_config()
9331 ql_log(ql_log_warn, vha, 0x0076, in qla81xx_nvram_config()
9338 qla82xx_restart_isp(scsi_qla_host_t *vha) in qla82xx_restart_isp() argument
9341 struct qla_hw_data *ha = vha->hw; in qla82xx_restart_isp()
9345 status = qla2x00_init_rings(vha); in qla82xx_restart_isp()
9347 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla82xx_restart_isp()
9350 status = qla2x00_fw_ready(vha); in qla82xx_restart_isp()
9353 qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL); in qla82xx_restart_isp()
9354 vha->flags.online = 1; in qla82xx_restart_isp()
9355 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla82xx_restart_isp()
9359 if ((vha->device_flags & DFLG_NO_CABLE)) in qla82xx_restart_isp()
9364 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla82xx_restart_isp()
9366 if (!atomic_read(&vha->loop_down_timer)) { in qla82xx_restart_isp()
9371 vha->marker_needed = 1; in qla82xx_restart_isp()
9377 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla82xx_restart_isp()
9380 status = qla82xx_check_md_needed(vha); in qla82xx_restart_isp()
9386 rval = qla2x00_enable_fce_trace(vha, in qla82xx_restart_isp()
9390 ql_log(ql_log_warn, vha, 0x8001, in qla82xx_restart_isp()
9399 rval = qla2x00_enable_eft_trace(vha, in qla82xx_restart_isp()
9402 ql_log(ql_log_warn, vha, 0x8010, in qla82xx_restart_isp()
9410 ql_dbg(ql_dbg_taskm, vha, 0x8011, in qla82xx_restart_isp()
9428 ql_log(ql_log_warn, vha, 0x8016, in qla82xx_restart_isp()
9454 qla24xx_get_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport) in qla24xx_get_fcp_prio() argument
9462 struct qla_hw_data *ha = vha->hw; in qla24xx_get_fcp_prio()
9482 pid2 = vha->d_id.b24 & INVALID_PORT_ID; in qla24xx_get_fcp_prio()
9501 wwn1 = wwn_to_u64(vha->port_name); in qla24xx_get_fcp_prio()
9547 qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport) in qla24xx_update_fcport_fcp_prio() argument
9557 priority = qla24xx_get_fcp_prio(vha, fcport); in qla24xx_update_fcport_fcp_prio()
9561 if (IS_P3P_TYPE(vha->hw)) { in qla24xx_update_fcport_fcp_prio()
9566 ret = qla24xx_set_fcp_prio(vha, fcport->loop_id, priority, mb); in qla24xx_update_fcport_fcp_prio()
9569 ql_dbg(ql_dbg_user, vha, 0x709e, in qla24xx_update_fcport_fcp_prio()
9576 ql_dbg(ql_dbg_user, vha, 0x704f, in qla24xx_update_fcport_fcp_prio()
9598 qla24xx_update_all_fcp_prio(scsi_qla_host_t *vha) in qla24xx_update_all_fcp_prio() argument
9605 list_for_each_entry(fcport, &vha->vp_fcports, list) in qla24xx_update_all_fcp_prio()
9606 ret = qla24xx_update_fcport_fcp_prio(vha, fcport); in qla24xx_update_all_fcp_prio()
9611 struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos, in qla2xxx_create_qpair() argument
9617 struct qla_hw_data *ha = vha->hw; in qla2xxx_create_qpair()
9623 ql_log(ql_log_warn, vha, 0x00181, in qla2xxx_create_qpair()
9631 ql_log(ql_log_warn, vha, 0x0182, in qla2xxx_create_qpair()
9636 qpair->hw = vha->hw; in qla2xxx_create_qpair()
9637 qpair->vha = vha; in qla2xxx_create_qpair()
9647 ql_log(ql_log_warn, vha, 0x0183, in qla2xxx_create_qpair()
9669 ql_dbg(ql_dbg_multiq, vha, 0xc00f, in qla2xxx_create_qpair()
9674 ql_log(ql_log_warn, vha, 0x0184, in qla2xxx_create_qpair()
9680 list_add_tail(&qpair->qp_list_elem, &vha->qp_list); in qla2xxx_create_qpair()
9690 ql_log(ql_log_warn, vha, 0x0185, in qla2xxx_create_qpair()
9701 ql_log(ql_log_warn, vha, 0x0186, in qla2xxx_create_qpair()
9720 ql_log(ql_log_warn, vha, 0xd036, in qla2xxx_create_qpair()
9726 if (qla_create_buf_pool(vha, qpair)) { in qla2xxx_create_qpair()
9727 ql_log(ql_log_warn, vha, 0xd036, in qla2xxx_create_qpair()
9736 if (!vha->flags.qpairs_available) in qla2xxx_create_qpair()
9737 vha->flags.qpairs_available = 1; in qla2xxx_create_qpair()
9739 ql_dbg(ql_dbg_multiq, vha, 0xc00d, in qla2xxx_create_qpair()
9742 ql_dbg(ql_dbg_init, vha, 0x0187, in qla2xxx_create_qpair()
9751 qla25xx_delete_req_que(vha, qpair->req); in qla2xxx_create_qpair()
9753 qla25xx_delete_rsp_que(vha, qpair->rsp); in qla2xxx_create_qpair()
9758 if (list_empty(&vha->qp_list)) in qla2xxx_create_qpair()
9759 vha->flags.qpairs_available = 0; in qla2xxx_create_qpair()
9770 int qla2xxx_delete_qpair(struct scsi_qla_host *vha, struct qla_qpair *qpair) in qla2xxx_delete_qpair() argument
9779 ret = qla25xx_delete_req_que(vha, qpair->req); in qla2xxx_delete_qpair()
9783 ret = qla25xx_delete_rsp_que(vha, qpair->rsp); in qla2xxx_delete_qpair()
9805 if (list_empty(&vha->qp_list)) { in qla2xxx_delete_qpair()
9806 vha->flags.qpairs_available = 0; in qla2xxx_delete_qpair()
9807 vha->flags.qpairs_req_created = 0; in qla2xxx_delete_qpair()
9808 vha->flags.qpairs_rsp_created = 0; in qla2xxx_delete_qpair()
9833 qla2x00_get_num_tgts(scsi_qla_host_t *vha) in qla2x00_get_num_tgts() argument
9841 list_for_each_entry_safe(f, tf, &vha->vp_fcports, list) { in qla2x00_get_num_tgts()
9851 scsi_qla_host_t *vha = shost_priv(host); in qla2xxx_reset_stats() local
9856 vha->hw_err_cnt = 0; in qla2xxx_reset_stats()
9858 vha->short_link_down_cnt = 0; in qla2xxx_reset_stats()
9860 vha->interface_err_cnt = 0; in qla2xxx_reset_stats()
9862 vha->cmd_timeout_cnt = 0; in qla2xxx_reset_stats()
9864 vha->reset_cmd_err_cnt = 0; in qla2xxx_reset_stats()
9866 spin_lock_irqsave(&vha->hw->tgt.sess_lock, int_flags); in qla2xxx_reset_stats()
9867 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2xxx_reset_stats()
9871 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, int_flags); in qla2xxx_reset_stats()
9873 vha->link_down_time = QLA2XX_MAX_LINK_DOWN_TIME; in qla2xxx_reset_stats()
9890 scsi_qla_host_t *vha = shost_priv(host); in qla2xxx_get_ini_stats() local
9905 num_tgt = qla2x00_get_num_tgts(vha); in qla2xxx_get_ini_stats()
9919 rsp_data->entry[i].cnt = vha->hw_err_cnt; in qla2xxx_get_ini_stats()
9926 rsp_data->entry[i].cnt = vha->short_link_down_cnt; in qla2xxx_get_ini_stats()
9933 rsp_data->entry[i].cnt = vha->interface_err_cnt; in qla2xxx_get_ini_stats()
9940 rsp_data->entry[i].cnt = vha->cmd_timeout_cnt; in qla2xxx_get_ini_stats()
9947 rsp_data->entry[i].cnt = vha->reset_cmd_err_cnt; in qla2xxx_get_ini_stats()
9955 spin_lock_irqsave(&vha->hw->tgt.sess_lock, int_flags); in qla2xxx_get_ini_stats()
9956 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2xxx_get_ini_stats()
9966 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, int_flags); in qla2xxx_get_ini_stats()
9990 scsi_qla_host_t *vha = shost_priv(host); in qla2xxx_disable_port() local
9992 vha->hw->flags.port_isolated = 1; in qla2xxx_disable_port()
9994 if (qla2x00_isp_reg_stat(vha->hw)) { in qla2xxx_disable_port()
9995 ql_log(ql_log_info, vha, 0x9006, in qla2xxx_disable_port()
9997 qla_pci_set_eeh_busy(vha); in qla2xxx_disable_port()
10000 if (qla2x00_chip_is_down(vha)) in qla2xxx_disable_port()
10003 if (vha->flags.online) { in qla2xxx_disable_port()
10004 qla2x00_abort_isp_cleanup(vha); in qla2xxx_disable_port()
10005 qla2x00_wait_for_sess_deletion(vha); in qla2xxx_disable_port()
10013 scsi_qla_host_t *vha = shost_priv(host); in qla2xxx_enable_port() local
10015 if (qla2x00_isp_reg_stat(vha->hw)) { in qla2xxx_enable_port()
10016 ql_log(ql_log_info, vha, 0x9001, in qla2xxx_enable_port()
10018 qla_pci_set_eeh_busy(vha); in qla2xxx_enable_port()
10022 vha->hw->flags.port_isolated = 0; in qla2xxx_enable_port()
10024 vha->flags.online = 1; in qla2xxx_enable_port()
10025 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2xxx_enable_port()
10026 qla2xxx_wake_dpc(vha); in qla2xxx_enable_port()