Lines Matching refs:vha
77 qla2x00_get_async_timeout(struct scsi_qla_host *vha) in qla2x00_get_async_timeout() argument
80 struct qla_hw_data *ha = vha->hw; in qla2x00_get_async_timeout()
106 ql_dbg(ql_dbg_disc, fcport->vha, 0x2071, in qla2x00_async_iocb_timeout()
169 struct scsi_qla_host *vha = sp->vha; in qla2x00_async_login_sp_done() local
173 ql_dbg(ql_dbg_disc, vha, 0x20dd, in qla2x00_async_login_sp_done()
178 if (!test_bit(UNLOADING, &vha->dpc_flags)) { in qla2x00_async_login_sp_done()
187 qla2x00_fcport_event_handler(vha, &ea); in qla2x00_async_login_sp_done()
197 wwn_to_u64(fcport->vha->port_name)) in fcport_is_smaller()
210 qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_login() argument
217 if (!vha->flags.online) in qla2x00_async_login()
220 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla2x00_async_login()
235 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); in qla2x00_async_login()
238 if (N2N_TOPO(fcport->vha->hw) && fcport_is_bigger(fcport)) { in qla2x00_async_login()
251 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla2x00_async_login()
255 ql_dbg(ql_dbg_disc, vha, 0x2072, in qla2x00_async_login()
282 qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport) in qla2x00_async_logout() argument
288 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) in qla2x00_async_logout()
292 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla2x00_async_logout()
301 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); in qla2x00_async_logout()
308 ql_dbg(ql_dbg_disc, vha, 0x2070, in qla2x00_async_logout()
323 qla2x00_async_prlo_done(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_prlo_done() argument
329 qla2x00_mark_device_lost(vha, fcport, 1, 0); in qla2x00_async_prlo_done()
338 struct scsi_qla_host *vha = sp->vha; in qla2x00_async_prlo_sp_done() local
341 if (!test_bit(UNLOADING, &vha->dpc_flags)) in qla2x00_async_prlo_sp_done()
342 qla2x00_post_async_prlo_done_work(sp->fcport->vha, sp->fcport, in qla2x00_async_prlo_sp_done()
348 qla2x00_async_prlo(struct scsi_qla_host *vha, fc_port_t *fcport) in qla2x00_async_prlo() argument
355 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla2x00_async_prlo()
364 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); in qla2x00_async_prlo()
371 ql_dbg(ql_dbg_disc, vha, 0x2070, in qla2x00_async_prlo()
385 void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) in qla24xx_handle_adisc_event() argument
389 ql_dbg(ql_dbg_disc, vha, 0x20d2, in qla24xx_handle_adisc_event()
396 ql_dbg(ql_dbg_disc, vha, 0x2066, in qla24xx_handle_adisc_event()
408 ql_dbg(ql_dbg_disc, vha, 0x20d3, in qla24xx_handle_adisc_event()
413 ql_dbg(ql_dbg_disc, vha, 0x20d4, "%s %d %8phC post gidpn\n", in qla24xx_handle_adisc_event()
415 qla24xx_post_gidpn_work(vha, ea->fcport); in qla24xx_handle_adisc_event()
419 __qla24xx_handle_gpdb_event(vha, ea); in qla24xx_handle_adisc_event()
422 int qla_post_els_plogi_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla_post_els_plogi_work() argument
426 e = qla2x00_alloc_work(vha, QLA_EVT_ELS_PLOGI); in qla_post_els_plogi_work()
432 return qla2x00_post_work(vha, e); in qla_post_els_plogi_work()
439 struct scsi_qla_host *vha = sp->vha; in qla2x00_async_adisc_sp_done() local
443 ql_dbg(ql_dbg_disc, vha, 0x2066, in qla2x00_async_adisc_sp_done()
459 qla2x00_fcport_event_handler(vha, &ea); in qla2x00_async_adisc_sp_done()
465 qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_adisc() argument
474 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla2x00_async_adisc()
485 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); in qla2x00_async_adisc()
494 ql_dbg(ql_dbg_disc, vha, 0x206f, in qla2x00_async_adisc()
503 qla2x00_post_async_adisc_work(vha, fcport, data); in qla2x00_async_adisc()
507 static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, in qla24xx_handle_gnl_done_event() argument
519 ql_dbg(ql_dbg_disc, vha, 0xffff, in qla24xx_handle_gnl_done_event()
524 fcport->rscn_gen, fcport->last_rscn_gen, vha->loop_id); in qla24xx_handle_gnl_done_event()
531 ql_dbg(ql_dbg_disc, vha, 0x20de, in qla24xx_handle_gnl_done_event()
539 ql_dbg(ql_dbg_disc, vha, 0x20df, in qla24xx_handle_gnl_done_event()
543 qla24xx_post_gidpn_work(vha, fcport); in qla24xx_handle_gnl_done_event()
546 ql_dbg(ql_dbg_disc, vha, 0x20e0, in qla24xx_handle_gnl_done_event()
554 ql_dbg(ql_dbg_disc, vha, 0x20e1, in qla24xx_handle_gnl_done_event()
561 e = &vha->gnl.l[i]; in qla24xx_handle_gnl_done_event()
584 ql_dbg(ql_dbg_disc, vha, 0x20e2, in qla24xx_handle_gnl_done_event()
601 ql_dbg(ql_dbg_disc, vha, 0x20e3, in qla24xx_handle_gnl_done_event()
613 qlt_find_sess_invalidate_other(vha, wwn, in qla24xx_handle_gnl_done_event()
626 switch (vha->hw->current_topology) { in qla24xx_handle_gnl_done_event()
631 vha, 0x20e4, "%s %d %8phC post gpdb\n", in qla24xx_handle_gnl_done_event()
639 qla2x00_post_async_adisc_work(vha, fcport, in qla24xx_handle_gnl_done_event()
649 qla24xx_fcport_handle_login(vha, fcport); in qla24xx_handle_gnl_done_event()
664 qla2x00_post_async_adisc_work(vha, fcport, in qla24xx_handle_gnl_done_event()
674 qla24xx_fcport_handle_login(vha, in qla24xx_handle_gnl_done_event()
686 qla24xx_fcport_handle_login(vha, in qla24xx_handle_gnl_done_event()
696 switch (vha->hw->current_topology) { in qla24xx_handle_gnl_done_event()
700 e = &vha->gnl.l[i]; in qla24xx_handle_gnl_done_event()
709 qla2x00_find_fcport_by_wwpn(vha, in qla24xx_handle_gnl_done_event()
713 vha, 0x20e5, in qla24xx_handle_gnl_done_event()
728 qla24xx_fcport_handle_login(vha, fcport); in qla24xx_handle_gnl_done_event()
741 &vha->dpc_flags); in qla24xx_handle_gnl_done_event()
744 ql_log(ql_log_info, vha, 0x705d, in qla24xx_handle_gnl_done_event()
747 &vha->dpc_flags); in qla24xx_handle_gnl_done_event()
750 ql_log(ql_log_info, vha, 0x705d, in qla24xx_handle_gnl_done_event()
756 qla2xxx_wake_dpc(vha); in qla24xx_handle_gnl_done_event()
762 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_gnl_done_event()
775 struct scsi_qla_host *vha = sp->vha; in qla24xx_async_gnl_sp_done() local
785 ql_dbg(ql_dbg_disc, vha, 0x20e7, in qla24xx_async_gnl_sp_done()
803 e = &vha->gnl.l[i]; in qla24xx_async_gnl_sp_done()
807 set_bit(loop_id, vha->hw->loop_id_map); in qla24xx_async_gnl_sp_done()
810 ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0x20e8, in qla24xx_async_gnl_sp_done()
817 spin_lock_irqsave(&vha->gnl.fcports_lock, flags); in qla24xx_async_gnl_sp_done()
821 if (!list_empty(&vha->gnl.fcports)) in qla24xx_async_gnl_sp_done()
822 list_splice_init(&vha->gnl.fcports, &h); in qla24xx_async_gnl_sp_done()
826 spin_lock(&vha->hw->tgt.sess_lock); in qla24xx_async_gnl_sp_done()
828 spin_unlock(&vha->hw->tgt.sess_lock); in qla24xx_async_gnl_sp_done()
831 qla2x00_fcport_event_handler(vha, &ea); in qla24xx_async_gnl_sp_done()
833 spin_unlock_irqrestore(&vha->gnl.fcports_lock, flags); in qla24xx_async_gnl_sp_done()
835 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
841 e = &vha->gnl.l[i]; in qla24xx_async_gnl_sp_done()
845 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) { in qla24xx_async_gnl_sp_done()
859 ql_dbg(ql_dbg_disc, vha, 0x2065, in qla24xx_async_gnl_sp_done()
863 qla24xx_post_newsess_work(vha, &id, (u8 *)&wwn, in qla24xx_async_gnl_sp_done()
868 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_async_gnl_sp_done()
873 int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_async_gnl() argument
881 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) in qla24xx_async_gnl()
884 ql_dbg(ql_dbg_disc, vha, 0x20d9, in qla24xx_async_gnl()
887 spin_lock_irqsave(&vha->gnl.fcports_lock, flags); in qla24xx_async_gnl()
889 spin_unlock_irqrestore(&vha->gnl.fcports_lock, flags); in qla24xx_async_gnl()
894 spin_lock(&vha->hw->tgt.sess_lock); in qla24xx_async_gnl()
898 spin_unlock(&vha->hw->tgt.sess_lock); in qla24xx_async_gnl()
900 list_add_tail(&fcport->gnl_entry, &vha->gnl.fcports); in qla24xx_async_gnl()
901 spin_unlock_irqrestore(&vha->gnl.fcports_lock, flags); in qla24xx_async_gnl()
903 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla24xx_async_gnl()
915 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)+2); in qla24xx_async_gnl()
920 mb[2] = MSW(vha->gnl.ldma); in qla24xx_async_gnl()
921 mb[3] = LSW(vha->gnl.ldma); in qla24xx_async_gnl()
922 mb[6] = MSW(MSD(vha->gnl.ldma)); in qla24xx_async_gnl()
923 mb[7] = LSW(MSD(vha->gnl.ldma)); in qla24xx_async_gnl()
924 mb[8] = vha->gnl.size; in qla24xx_async_gnl()
925 mb[9] = vha->vp_idx; in qla24xx_async_gnl()
933 ql_dbg(ql_dbg_disc, vha, 0x20da, in qla24xx_async_gnl()
946 int qla24xx_post_gnl_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_post_gnl_work() argument
950 e = qla2x00_alloc_work(vha, QLA_EVT_GNL); in qla24xx_post_gnl_work()
956 return qla2x00_post_work(vha, e); in qla24xx_post_gnl_work()
963 struct scsi_qla_host *vha = sp->vha; in qla24xx_async_gpdb_sp_done() local
964 struct qla_hw_data *ha = vha->hw; in qla24xx_async_gpdb_sp_done()
969 ql_dbg(ql_dbg_disc, vha, 0x20db, in qla24xx_async_gpdb_sp_done()
980 qla2x00_fcport_event_handler(vha, &ea); in qla24xx_async_gpdb_sp_done()
988 static int qla24xx_post_prli_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_post_prli_work() argument
992 e = qla2x00_alloc_work(vha, QLA_EVT_PRLI); in qla24xx_post_prli_work()
998 return qla2x00_post_work(vha, e); in qla24xx_post_prli_work()
1005 struct scsi_qla_host *vha = sp->vha; in qla2x00_async_prli_sp_done() local
1009 ql_dbg(ql_dbg_disc, vha, 0x2129, in qla2x00_async_prli_sp_done()
1015 if (!test_bit(UNLOADING, &vha->dpc_flags)) { in qla2x00_async_prli_sp_done()
1025 qla2x00_fcport_event_handler(vha, &ea); in qla2x00_async_prli_sp_done()
1032 qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_async_prli() argument
1038 if (!vha->flags.online) in qla24xx_async_prli()
1045 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla24xx_async_prli()
1057 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); in qla24xx_async_prli()
1068 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_async_prli()
1072 ql_dbg(ql_dbg_disc, vha, 0x211b, in qla24xx_async_prli()
1085 int qla24xx_post_gpdb_work(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt) in qla24xx_post_gpdb_work() argument
1089 e = qla2x00_alloc_work(vha, QLA_EVT_GPDB); in qla24xx_post_gpdb_work()
1096 return qla2x00_post_work(vha, e); in qla24xx_post_gpdb_work()
1099 int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt) in qla24xx_async_gpdb() argument
1107 struct qla_hw_data *ha = vha->hw; in qla24xx_async_gpdb()
1109 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) in qla24xx_async_gpdb()
1114 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla24xx_async_gpdb()
1126 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); in qla24xx_async_gpdb()
1130 ql_log(ql_log_warn, vha, 0xd043, in qla24xx_async_gpdb()
1142 mb[9] = vha->vp_idx; in qla24xx_async_gpdb()
1154 ql_dbg(ql_dbg_disc, vha, 0x20dc, in qla24xx_async_gpdb()
1167 qla24xx_post_gpdb_work(vha, fcport, opt); in qla24xx_async_gpdb()
1172 void __qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) in __qla24xx_handle_gpdb_event() argument
1176 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in __qla24xx_handle_gpdb_event()
1182 vha->fcport_count++; in __qla24xx_handle_gpdb_event()
1185 ql_dbg(ql_dbg_disc, vha, 0x20d6, in __qla24xx_handle_gpdb_event()
1188 vha->fcport_count); in __qla24xx_handle_gpdb_event()
1189 qla24xx_post_upd_fcport_work(vha, ea->fcport); in __qla24xx_handle_gpdb_event()
1196 ql_dbg(ql_dbg_disc, vha, 0x20d6, in __qla24xx_handle_gpdb_event()
1201 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in __qla24xx_handle_gpdb_event()
1205 void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) in qla24xx_handle_gpdb_event() argument
1216 ql_dbg(ql_dbg_disc, vha, 0x20d2, in qla24xx_handle_gpdb_event()
1231 __qla24xx_parse_gpdb(vha, fcport, pd); in qla24xx_handle_gpdb_event()
1238 if (qla_dual_mode_enabled(vha) || in qla24xx_handle_gpdb_event()
1239 qla_ini_mode_enabled(vha)) { in qla24xx_handle_gpdb_event()
1241 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_gpdb_event()
1247 ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC post del sess\n", in qla24xx_handle_gpdb_event()
1252 __qla24xx_handle_gpdb_event(vha, ea); in qla24xx_handle_gpdb_event()
1255 static void qla_chk_n2n_b4_login(struct scsi_qla_host *vha, fc_port_t *fcport) in qla_chk_n2n_b4_login() argument
1260 if (qla_tgt_mode_enabled(vha)) in qla_chk_n2n_b4_login()
1263 if (qla_dual_mode_enabled(vha)) { in qla_chk_n2n_b4_login()
1264 if (N2N_TOPO(vha->hw)) { in qla_chk_n2n_b4_login()
1267 mywwn = wwn_to_u64(vha->port_name); in qla_chk_n2n_b4_login()
1286 rc = qla2x00_find_new_loop_id(vha, fcport); in qla_chk_n2n_b4_login()
1288 ql_dbg(ql_dbg_disc, vha, 0x20e6, in qla_chk_n2n_b4_login()
1296 ql_dbg(ql_dbg_disc, vha, 0x20bf, in qla_chk_n2n_b4_login()
1299 qla2x00_post_async_login_work(vha, fcport, NULL); in qla_chk_n2n_b4_login()
1303 int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) in qla24xx_fcport_handle_login() argument
1308 ql_dbg(ql_dbg_disc, vha, 0x20d8, in qla24xx_fcport_handle_login()
1326 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_fcport_handle_login()
1332 if (vha->host->active_mode == MODE_TARGET) in qla24xx_fcport_handle_login()
1336 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_fcport_handle_login()
1343 switch (vha->hw->current_topology) { in qla24xx_fcport_handle_login()
1349 qla2x00_find_new_loop_id(vha, in qla24xx_fcport_handle_login()
1355 qla_post_els_plogi_work(vha, fcport); in qla24xx_fcport_handle_login()
1357 ql_log(ql_log_info, vha, 0x705d, in qla24xx_fcport_handle_login()
1362 qla24xx_post_gnl_work(vha, fcport); in qla24xx_fcport_handle_login()
1367 ql_dbg(ql_dbg_disc, vha, 0xffff, in qla24xx_fcport_handle_login()
1370 qla24xx_post_gnnid_work(vha, fcport); in qla24xx_fcport_handle_login()
1372 ql_dbg(ql_dbg_disc, vha, 0x20bd, in qla24xx_fcport_handle_login()
1375 qla24xx_post_gnl_work(vha, fcport); in qla24xx_fcport_handle_login()
1377 qla_chk_n2n_b4_login(vha, fcport); in qla24xx_fcport_handle_login()
1384 switch (vha->hw->current_topology) { in qla24xx_fcport_handle_login()
1387 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_fcport_handle_login()
1391 vha->hw->base_qpair->chip_reset; in qla24xx_fcport_handle_login()
1392 qla24xx_post_gpdb_work(vha, fcport, 0); in qla24xx_fcport_handle_login()
1394 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_fcport_handle_login()
1397 qla24xx_post_prli_work(vha, fcport); in qla24xx_fcport_handle_login()
1404 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_fcport_handle_login()
1407 qla_chk_n2n_b4_login(vha, fcport); in qla24xx_fcport_handle_login()
1414 ql_dbg(ql_dbg_disc, vha, 0x20d0, in qla24xx_fcport_handle_login()
1417 if (N2N_TOPO(vha->hw)) in qla24xx_fcport_handle_login()
1418 qla_chk_n2n_b4_login(vha, fcport); in qla24xx_fcport_handle_login()
1420 qla24xx_post_gidpn_work(vha, fcport); in qla24xx_fcport_handle_login()
1425 ql_dbg(ql_dbg_disc, vha, 0x20d1, in qla24xx_fcport_handle_login()
1430 qla2x00_post_async_adisc_work(vha, fcport, data); in qla24xx_fcport_handle_login()
1435 qla24xx_post_prli_work(vha, fcport); in qla24xx_fcport_handle_login()
1450 ql_dbg(ql_dbg_disc, fcport->vha, 0x210c, in qla24xx_handle_rscn_event()
1461 qla24xx_post_gpnid_work(fcport->vha, &ea->id); in qla24xx_handle_rscn_event()
1468 int qla24xx_post_newsess_work(struct scsi_qla_host *vha, port_id_t *id, in qla24xx_post_newsess_work() argument
1472 e = qla2x00_alloc_work(vha, QLA_EVT_NEW_SESS); in qla24xx_post_newsess_work()
1483 return qla2x00_post_work(vha, e); in qla24xx_post_newsess_work()
1487 void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, in qla24xx_handle_relogin_event() argument
1492 ql_dbg(ql_dbg_disc, vha, 0x2102, in qla24xx_handle_relogin_event()
1507 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_relogin_event()
1513 ql_dbg(ql_dbg_disc, vha, 0x20e9, "%s %d %8phC post gidpn\n", in qla24xx_handle_relogin_event()
1516 qla24xx_post_gidpn_work(vha, fcport); in qla24xx_handle_relogin_event()
1520 qla24xx_fcport_handle_login(vha, fcport); in qla24xx_handle_relogin_event()
1524 void qla_handle_els_plogi_done(scsi_qla_host_t *vha, struct event_arg *ea) in qla_handle_els_plogi_done() argument
1526 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla_handle_els_plogi_done()
1529 qla24xx_post_prli_work(vha, ea->fcport); in qla_handle_els_plogi_done()
1532 void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea) in qla2x00_fcport_event_handler() argument
1541 if (test_bit(UNLOADING, &vha->dpc_flags)) in qla2x00_fcport_event_handler()
1544 qla24xx_handle_relogin_event(vha, ea); in qla2x00_fcport_event_handler()
1547 if (test_bit(UNLOADING, &vha->dpc_flags)) in qla2x00_fcport_event_handler()
1552 (vha, &ea->id, 1); in qla2x00_fcport_event_handler()
1556 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_fcport_event_handler()
1557 if (vha->scan.scan_flags == 0) { in qla2x00_fcport_event_handler()
1558 ql_dbg(ql_dbg_disc, vha, 0xffff, in qla2x00_fcport_event_handler()
1560 vha->scan.scan_flags |= SF_QUEUED; in qla2x00_fcport_event_handler()
1561 schedule_delayed_work(&vha->scan.scan_work, 5); in qla2x00_fcport_event_handler()
1563 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_fcport_event_handler()
1570 ql_dbg(ql_dbg_async, vha, 0x5044, in qla2x00_fcport_event_handler()
1575 ql_dbg(ql_dbg_async, vha, 0x507a, in qla2x00_fcport_event_handler()
1581 list_for_each_entry_safe(f, tf, &vha->vp_fcports, in qla2x00_fcport_event_handler()
1592 ql_log(ql_log_warn, vha, 0xd045, in qla2x00_fcport_event_handler()
1595 qla2x00_mark_all_devices_lost(vha, 1); in qla2x00_fcport_event_handler()
1596 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_fcport_event_handler()
1597 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_fcport_event_handler()
1601 qla24xx_handle_gidpn_event(vha, ea); in qla2x00_fcport_event_handler()
1604 qla24xx_handle_gnl_done_event(vha, ea); in qla2x00_fcport_event_handler()
1607 qla24xx_handle_gpsc_event(vha, ea); in qla2x00_fcport_event_handler()
1610 qla24xx_handle_plogi_done_event(vha, ea); in qla2x00_fcport_event_handler()
1613 qla24xx_handle_prli_done_event(vha, ea); in qla2x00_fcport_event_handler()
1616 qla24xx_handle_gpdb_event(vha, ea); in qla2x00_fcport_event_handler()
1619 qla24xx_handle_gpnid_event(vha, ea); in qla2x00_fcport_event_handler()
1622 qla24xx_handle_gffid_event(vha, ea); in qla2x00_fcport_event_handler()
1625 qla24xx_handle_adisc_event(vha, ea); in qla2x00_fcport_event_handler()
1628 qla24xx_handle_gnnid_event(vha, ea); in qla2x00_fcport_event_handler()
1631 qla24xx_handle_gfpnid_event(vha, ea); in qla2x00_fcport_event_handler()
1634 qla_handle_els_plogi_done(vha, ea); in qla2x00_fcport_event_handler()
1665 struct scsi_qla_host *vha = fcport->vha; in qla2x00_async_tm_cmd() local
1670 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla2x00_async_tm_cmd()
1680 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)); in qla2x00_async_tm_cmd()
1691 ql_dbg(ql_dbg_taskm, vha, 0x802f, in qla2x00_async_tm_cmd()
1701 ql_log(ql_log_warn, vha, 0x8030, in qla2x00_async_tm_cmd()
1705 if (!test_bit(UNLOADING, &vha->dpc_flags) && !IS_QLAFX00(vha->hw)) { in qla2x00_async_tm_cmd()
1710 qla2x00_marker(vha, vha->hw->req_q_map[0], in qla2x00_async_tm_cmd()
1711 vha->hw->rsp_q_map[0], sp->fcport->loop_id, lun, in qla2x00_async_tm_cmd()
1749 scsi_qla_host_t *vha = cmd_sp->vha; in qla24xx_async_abort_cmd() local
1755 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla24xx_async_abort_cmd()
1767 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)); in qla24xx_async_abort_cmd()
1771 if (vha->flags.qpairs_available && cmd_sp->qpair) in qla24xx_async_abort_cmd()
1775 abt_iocb->u.abt.req_que_no = cpu_to_le16(vha->req->id); in qla24xx_async_abort_cmd()
1783 ql_dbg(ql_dbg_async, vha, 0x507c, in qla24xx_async_abort_cmd()
1806 struct scsi_qla_host *vha = fcport->vha; in qla24xx_async_abort_command() local
1807 struct qla_hw_data *ha = vha->hw; in qla24xx_async_abort_command()
1808 struct req_que *req = vha->req; in qla24xx_async_abort_command()
1810 if (vha->flags.qpairs_available && sp->qpair) in qla24xx_async_abort_command()
1824 return qlafx00_fx_disc(vha, &vha->hw->mr.fcport, in qla24xx_async_abort_command()
1831 qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea) in qla24xx_handle_prli_done_event() argument
1835 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_handle_prli_done_event()
1839 ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset; in qla24xx_handle_prli_done_event()
1841 qla24xx_post_gpdb_work(vha, ea->fcport, 0); in qla24xx_handle_prli_done_event()
1846 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_prli_done_event()
1852 ql_dbg(ql_dbg_disc, vha, 0x2118, in qla24xx_handle_prli_done_event()
1857 qla24xx_post_prli_work(vha, ea->fcport); in qla24xx_handle_prli_done_event()
1859 ql_dbg(ql_dbg_disc, vha, 0x2119, in qla24xx_handle_prli_done_event()
1867 qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) in qla24xx_handle_plogi_done_event() argument
1875 ql_dbg(ql_dbg_disc, vha, 0xffff, in qla24xx_handle_plogi_done_event()
1884 ql_dbg(ql_dbg_disc, vha, 0x20ea, in qla24xx_handle_plogi_done_event()
1895 ql_dbg(ql_dbg_disc, vha, 0x20d3, in qla24xx_handle_plogi_done_event()
1898 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_plogi_done_event()
1901 ql_dbg(ql_dbg_disc, vha, 0x20d4, "%s %d %8phC post gidpn\n", in qla24xx_handle_plogi_done_event()
1903 qla24xx_post_gidpn_work(vha, fcport); in qla24xx_handle_plogi_done_event()
1915 ql_dbg(ql_dbg_disc, vha, 0x2117, in qla24xx_handle_plogi_done_event()
1918 qla24xx_post_prli_work(vha, ea->fcport); in qla24xx_handle_plogi_done_event()
1920 ql_dbg(ql_dbg_disc, vha, 0x20ea, in qla24xx_handle_plogi_done_event()
1925 set_bit(ea->fcport->loop_id, vha->hw->loop_id_map); in qla24xx_handle_plogi_done_event()
1926 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_handle_plogi_done_event()
1927 ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset; in qla24xx_handle_plogi_done_event()
1931 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_handle_plogi_done_event()
1933 qla24xx_post_gpdb_work(vha, ea->fcport, 0); in qla24xx_handle_plogi_done_event()
1937 ql_dbg(ql_dbg_disc, vha, 0x20eb, "%s %d %8phC cmd error %x\n", in qla24xx_handle_plogi_done_event()
1943 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_handle_plogi_done_event()
1945 qla2x00_mark_device_lost(vha, ea->fcport, 1, 0); in qla24xx_handle_plogi_done_event()
1954 ql_dbg(ql_dbg_disc, vha, 0x20ec, in qla24xx_handle_plogi_done_event()
1960 set_bit(ea->fcport->loop_id, vha->hw->loop_id_map); in qla24xx_handle_plogi_done_event()
1965 qla24xx_post_gnl_work(vha, ea->fcport); in qla24xx_handle_plogi_done_event()
1968 ql_dbg(ql_dbg_disc, vha, 0x20ed, in qla24xx_handle_plogi_done_event()
1975 qlt_find_sess_invalidate_other(vha, in qla24xx_handle_plogi_done_event()
1988 ql_dbg(ql_dbg_disc, vha, 0x20ed, in qla24xx_handle_plogi_done_event()
1993 qla24xx_post_gidpn_work(vha, ea->fcport); in qla24xx_handle_plogi_done_event()
1995 ql_dbg(ql_dbg_disc, vha, 0x20ed, in qla24xx_handle_plogi_done_event()
2001 set_bit(lid, vha->hw->loop_id_map); in qla24xx_handle_plogi_done_event()
2012 qla2x00_async_logout_done(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_logout_done() argument
2022 qla2x00_async_adisc_done(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_adisc_done() argument
2027 qla2x00_update_fcport(vha, fcport); in qla2x00_async_adisc_done()
2034 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla2x00_async_adisc_done()
2036 qla2x00_mark_device_lost(vha, fcport, 1, 0); in qla2x00_async_adisc_done()
2046 qla83xx_nic_core_fw_load(scsi_qla_host_t *vha) in qla83xx_nic_core_fw_load() argument
2049 struct qla_hw_data *ha = vha->hw; in qla83xx_nic_core_fw_load()
2053 qla83xx_idc_lock(vha, 0); in qla83xx_nic_core_fw_load()
2062 if (__qla83xx_set_drv_presence(vha) != QLA_SUCCESS) { in qla83xx_nic_core_fw_load()
2063 ql_dbg(ql_dbg_p3p, vha, 0xb077, in qla83xx_nic_core_fw_load()
2070 qla83xx_reset_ownership(vha); in qla83xx_nic_core_fw_load()
2078 qla83xx_rd_reg(vha, QLA83XX_IDC_MAJOR_VERSION, &idc_major_ver); in qla83xx_nic_core_fw_load()
2082 qla83xx_wr_reg(vha, QLA83XX_IDC_MAJOR_VERSION, idc_major_ver); in qla83xx_nic_core_fw_load()
2085 qla83xx_wr_reg(vha, QLA83XX_IDC_LOCK_RECOVERY, 0); in qla83xx_nic_core_fw_load()
2091 ql_log(ql_log_warn, vha, 0xb07d, in qla83xx_nic_core_fw_load()
2094 __qla83xx_clear_drv_presence(vha); in qla83xx_nic_core_fw_load()
2099 qla83xx_rd_reg(vha, QLA83XX_IDC_MINOR_VERSION, &idc_minor_ver); in qla83xx_nic_core_fw_load()
2101 qla83xx_wr_reg(vha, QLA83XX_IDC_MINOR_VERSION, idc_minor_ver); in qla83xx_nic_core_fw_load()
2105 if (!qla81xx_get_port_config(vha, config)) in qla83xx_nic_core_fw_load()
2106 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE, in qla83xx_nic_core_fw_load()
2110 rval = qla83xx_idc_state_handler(vha); in qla83xx_nic_core_fw_load()
2113 qla83xx_idc_unlock(vha, 0); in qla83xx_nic_core_fw_load()
2129 qla2x00_initialize_adapter(scsi_qla_host_t *vha) in qla2x00_initialize_adapter() argument
2132 struct qla_hw_data *ha = vha->hw; in qla2x00_initialize_adapter()
2135 memset(&vha->qla_stats, 0, sizeof(vha->qla_stats)); in qla2x00_initialize_adapter()
2136 memset(&vha->fc_host_stat, 0, sizeof(vha->fc_host_stat)); in qla2x00_initialize_adapter()
2139 vha->flags.online = 0; in qla2x00_initialize_adapter()
2141 vha->flags.reset_active = 0; in qla2x00_initialize_adapter()
2144 vha->qla_stats.jiffies_at_last_reset = get_jiffies_64(); in qla2x00_initialize_adapter()
2145 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); in qla2x00_initialize_adapter()
2146 atomic_set(&vha->loop_state, LOOP_DOWN); in qla2x00_initialize_adapter()
2147 vha->device_flags = DFLG_NO_CABLE; in qla2x00_initialize_adapter()
2148 vha->dpc_flags = 0; in qla2x00_initialize_adapter()
2149 vha->flags.management_server_logged_in = 0; in qla2x00_initialize_adapter()
2150 vha->marker_needed = 0; in qla2x00_initialize_adapter()
2157 ql_dbg(ql_dbg_init, vha, 0x0040, in qla2x00_initialize_adapter()
2159 rval = ha->isp_ops->pci_config(vha); in qla2x00_initialize_adapter()
2161 ql_log(ql_log_warn, vha, 0x0044, in qla2x00_initialize_adapter()
2166 ha->isp_ops->reset_chip(vha); in qla2x00_initialize_adapter()
2168 rval = qla2xxx_get_flash_info(vha); in qla2x00_initialize_adapter()
2170 ql_log(ql_log_fatal, vha, 0x004f, in qla2x00_initialize_adapter()
2176 qla8044_read_reset_template(vha); in qla2x00_initialize_adapter()
2183 qla8044_set_idc_dontreset(vha); in qla2x00_initialize_adapter()
2186 ha->isp_ops->get_flash_version(vha, req->ring); in qla2x00_initialize_adapter()
2187 ql_dbg(ql_dbg_init, vha, 0x0061, in qla2x00_initialize_adapter()
2190 ha->isp_ops->nvram_config(vha); in qla2x00_initialize_adapter()
2194 ql_log(ql_log_info, vha, 0x0077, in qla2x00_initialize_adapter()
2195 "Masking HBA WWPN %8phN (via NVRAM).\n", vha->port_name); in qla2x00_initialize_adapter()
2199 ql_dbg(ql_dbg_init, vha, 0x0078, in qla2x00_initialize_adapter()
2202 if (qla2x00_isp_firmware(vha) != QLA_SUCCESS) { in qla2x00_initialize_adapter()
2203 rval = ha->isp_ops->chip_diag(vha); in qla2x00_initialize_adapter()
2206 rval = qla2x00_setup_chip(vha); in qla2x00_initialize_adapter()
2212 ha->cs84xx = qla84xx_get_chip(vha); in qla2x00_initialize_adapter()
2214 ql_log(ql_log_warn, vha, 0x00d0, in qla2x00_initialize_adapter()
2220 if (qla_ini_mode_enabled(vha) || qla_dual_mode_enabled(vha)) in qla2x00_initialize_adapter()
2221 rval = qla2x00_init_rings(vha); in qla2x00_initialize_adapter()
2227 rval = qla84xx_init_chip(vha); in qla2x00_initialize_adapter()
2229 ql_log(ql_log_warn, vha, 0x00d4, in qla2x00_initialize_adapter()
2231 qla84xx_put_chip(vha); in qla2x00_initialize_adapter()
2237 rval = qla83xx_nic_core_fw_load(vha); in qla2x00_initialize_adapter()
2239 ql_log(ql_log_warn, vha, 0x0124, in qla2x00_initialize_adapter()
2244 qla24xx_read_fcp_prio_cfg(vha); in qla2x00_initialize_adapter()
2247 qla82xx_set_driver_version(vha, QLA2XXX_VERSION); in qla2x00_initialize_adapter()
2249 qla25xx_set_driver_version(vha, QLA2XXX_VERSION); in qla2x00_initialize_adapter()
2261 qla2100_pci_config(scsi_qla_host_t *vha) in qla2100_pci_config() argument
2265 struct qla_hw_data *ha = vha->hw; in qla2100_pci_config()
2292 qla2300_pci_config(scsi_qla_host_t *vha) in qla2300_pci_config() argument
2297 struct qla_hw_data *ha = vha->hw; in qla2300_pci_config()
2374 qla24xx_pci_config(scsi_qla_host_t *vha) in qla24xx_pci_config() argument
2378 struct qla_hw_data *ha = vha->hw; in qla24xx_pci_config()
2418 qla25xx_pci_config(scsi_qla_host_t *vha) in qla25xx_pci_config() argument
2421 struct qla_hw_data *ha = vha->hw; in qla25xx_pci_config()
2449 qla2x00_isp_firmware(scsi_qla_host_t *vha) in qla2x00_isp_firmware() argument
2454 struct qla_hw_data *ha = vha->hw; in qla2x00_isp_firmware()
2460 ql_log(ql_log_info, vha, 0x0079, "RISC CODE NOT loaded.\n"); in qla2x00_isp_firmware()
2463 rval = qla2x00_verify_checksum(vha, ha->fw_srisc_address); in qla2x00_isp_firmware()
2466 rval = qla2x00_get_adapter_id(vha, &loop_id, &al_pa, in qla2x00_isp_firmware()
2472 ql_dbg(ql_dbg_init, vha, 0x007a, in qla2x00_isp_firmware()
2485 qla2x00_reset_chip(scsi_qla_host_t *vha) in qla2x00_reset_chip() argument
2488 struct qla_hw_data *ha = vha->hw; in qla2x00_reset_chip()
2629 qla81xx_reset_mpi(scsi_qla_host_t *vha) in qla81xx_reset_mpi() argument
2633 if (!IS_QLA81XX(vha->hw)) in qla81xx_reset_mpi()
2636 return qla81xx_write_mpi_register(vha, mb); in qla81xx_reset_mpi()
2646 qla24xx_reset_risc(scsi_qla_host_t *vha) in qla24xx_reset_risc() argument
2649 struct qla_hw_data *ha = vha->hw; in qla24xx_reset_risc()
2670 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x017e, in qla24xx_reset_risc()
2696 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x017f, in qla24xx_reset_risc()
2714 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x015d, in qla24xx_reset_risc()
2720 if (test_and_clear_bit(MPI_RESET_NEEDED, &vha->dpc_flags)) { in qla24xx_reset_risc()
2721 if (qla81xx_reset_mpi(vha) != QLA_SUCCESS) { in qla24xx_reset_risc()
2723 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla24xx_reset_risc()
2724 set_bit(MPI_RESET_NEEDED, &vha->dpc_flags); in qla24xx_reset_risc()
2731 vha->flags.online = 0; in qla24xx_reset_risc()
2757 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x015e, in qla24xx_reset_risc()
2764 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x015f, in qla24xx_reset_risc()
2775 qla25xx_read_risc_sema_reg(scsi_qla_host_t *vha, uint32_t *data) in qla25xx_read_risc_sema_reg() argument
2777 struct device_reg_24xx __iomem *reg = &vha->hw->iobase->isp24; in qla25xx_read_risc_sema_reg()
2785 qla25xx_write_risc_sema_reg(scsi_qla_host_t *vha, uint32_t data) in qla25xx_write_risc_sema_reg() argument
2787 struct device_reg_24xx __iomem *reg = &vha->hw->iobase->isp24; in qla25xx_write_risc_sema_reg()
2794 qla25xx_manipulate_risc_semaphore(scsi_qla_host_t *vha) in qla25xx_manipulate_risc_semaphore() argument
2802 if (vha->hw->pdev->subsystem_device != 0x0175 && in qla25xx_manipulate_risc_semaphore()
2803 vha->hw->pdev->subsystem_device != 0x0240) in qla25xx_manipulate_risc_semaphore()
2806 WRT_REG_DWORD(&vha->hw->iobase->isp24.hccr, HCCRX_SET_RISC_PAUSE); in qla25xx_manipulate_risc_semaphore()
2813 qla25xx_write_risc_sema_reg(vha, RISC_SEMAPHORE_SET); in qla25xx_manipulate_risc_semaphore()
2814 qla25xx_read_risc_sema_reg(vha, &wd32); in qla25xx_manipulate_risc_semaphore()
2829 qla25xx_write_risc_sema_reg(vha, RISC_SEMAPHORE_CLR); in qla25xx_manipulate_risc_semaphore()
2833 qla25xx_read_risc_sema_reg(vha, &wd32); in qla25xx_manipulate_risc_semaphore()
2843 qla25xx_write_risc_sema_reg(vha, RISC_SEMAPHORE_FORCE_CLR); in qla25xx_manipulate_risc_semaphore()
2848 qla25xx_write_risc_sema_reg(vha, RISC_SEMAPHORE_FORCE_SET); in qla25xx_manipulate_risc_semaphore()
2861 qla24xx_reset_chip(scsi_qla_host_t *vha) in qla24xx_reset_chip() argument
2863 struct qla_hw_data *ha = vha->hw; in qla24xx_reset_chip()
2872 qla25xx_manipulate_risc_semaphore(vha); in qla24xx_reset_chip()
2875 qla24xx_reset_risc(vha); in qla24xx_reset_chip()
2885 qla2x00_chip_diag(scsi_qla_host_t *vha) in qla2x00_chip_diag() argument
2888 struct qla_hw_data *ha = vha->hw; in qla2x00_chip_diag()
2899 ql_dbg(ql_dbg_init, vha, 0x007b, "Testing device at %p.\n", in qla2x00_chip_diag()
2922 ql_dbg(ql_dbg_init, vha, 0x007c, in qla2x00_chip_diag()
2944 ql_dbg(ql_dbg_init, vha, 0x007d, "Checking product ID of chip.\n"); in qla2x00_chip_diag()
2952 ql_log(ql_log_warn, vha, 0x0062, in qla2x00_chip_diag()
2973 ql_dbg(ql_dbg_init, vha, 0x007e, "Found QLA2200A Chip.\n"); in qla2x00_chip_diag()
2982 ql_dbg(ql_dbg_init, vha, 0x007f, "Checking mailboxes.\n"); in qla2x00_chip_diag()
2983 rval = qla2x00_mbx_reg_test(vha); in qla2x00_chip_diag()
2985 ql_log(ql_log_warn, vha, 0x0080, in qla2x00_chip_diag()
2994 ql_log(ql_log_info, vha, 0x0081, in qla2x00_chip_diag()
3009 qla24xx_chip_diag(scsi_qla_host_t *vha) in qla24xx_chip_diag() argument
3012 struct qla_hw_data *ha = vha->hw; in qla24xx_chip_diag()
3020 rval = qla2x00_mbx_reg_test(vha); in qla24xx_chip_diag()
3022 ql_log(ql_log_warn, vha, 0x0082, in qla24xx_chip_diag()
3033 qla2x00_alloc_offload_mem(scsi_qla_host_t *vha) in qla2x00_alloc_offload_mem() argument
3038 struct qla_hw_data *ha = vha->hw; in qla2x00_alloc_offload_mem()
3041 ql_dbg(ql_dbg_init, vha, 0x00bd, in qla2x00_alloc_offload_mem()
3061 ql_log(ql_log_warn, vha, 0x00be, in qla2x00_alloc_offload_mem()
3067 rval = qla2x00_enable_fce_trace(vha, tc_dma, FCE_NUM_BUFFERS, in qla2x00_alloc_offload_mem()
3070 ql_log(ql_log_warn, vha, 0x00bf, in qla2x00_alloc_offload_mem()
3077 ql_dbg(ql_dbg_init, vha, 0x00c0, in qla2x00_alloc_offload_mem()
3093 ql_log(ql_log_warn, vha, 0x00c1, in qla2x00_alloc_offload_mem()
3099 rval = qla2x00_enable_eft_trace(vha, tc_dma, EFT_NUM_BUFFERS); in qla2x00_alloc_offload_mem()
3101 ql_log(ql_log_warn, vha, 0x00c2, in qla2x00_alloc_offload_mem()
3107 ql_dbg(ql_dbg_init, vha, 0x00c3, in qla2x00_alloc_offload_mem()
3119 qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) in qla2x00_alloc_fw_dump() argument
3123 struct qla_hw_data *ha = vha->hw; in qla2x00_alloc_fw_dump()
3170 ql_dbg(ql_dbg_init, vha, 0x00c3, in qla2x00_alloc_fw_dump()
3177 ql_log(ql_log_warn, vha, 0x00ba, in qla2x00_alloc_fw_dump()
3181 dump_size = qla27xx_fwdt_calculate_dump_size(vha); in qla2x00_alloc_fw_dump()
3182 ql_dbg(ql_dbg_init, vha, 0x00fa, in qla2x00_alloc_fw_dump()
3205 ql_log(ql_log_warn, vha, 0x00c4, in qla2x00_alloc_fw_dump()
3214 ql_dbg(ql_dbg_init, vha, 0x00c5, in qla2x00_alloc_fw_dump()
3243 qla81xx_mpi_sync(scsi_qla_host_t *vha) in qla81xx_mpi_sync() argument
3250 if (!IS_QLA81XX(vha->hw)) in qla81xx_mpi_sync()
3253 rval = qla2x00_write_ram_word(vha, 0x7c00, 1); in qla81xx_mpi_sync()
3255 ql_log(ql_log_warn, vha, 0x0105, in qla81xx_mpi_sync()
3260 pci_read_config_word(vha->hw->pdev, 0x54, &dc); in qla81xx_mpi_sync()
3261 rval = qla2x00_read_ram_word(vha, 0x7a15, &dw); in qla81xx_mpi_sync()
3263 ql_log(ql_log_warn, vha, 0x0067, "Unable to read sync.\n"); in qla81xx_mpi_sync()
3273 rval = qla2x00_write_ram_word(vha, 0x7a15, dw); in qla81xx_mpi_sync()
3275 ql_log(ql_log_warn, vha, 0x0114, "Unable to gain sync.\n"); in qla81xx_mpi_sync()
3279 rval = qla2x00_write_ram_word(vha, 0x7c00, 0); in qla81xx_mpi_sync()
3281 ql_log(ql_log_warn, vha, 0x006d, in qla81xx_mpi_sync()
3345 static void qla2xxx_print_sfp_info(struct scsi_qla_host *vha) in qla2xxx_print_sfp_info() argument
3348 struct sff_8247_a0 *a0 = (struct sff_8247_a0 *)vha->hw->sfp_data; in qla2xxx_print_sfp_info()
3354 ql_dbg(ql_dbg_init, vha, 0x015a, in qla2xxx_print_sfp_info()
3359 ql_dbg(ql_dbg_init, vha, 0x015c, in qla2xxx_print_sfp_info()
3374 ql_dbg(ql_dbg_init, vha, 0x0160, in qla2xxx_print_sfp_info()
3387 ql_dbg(ql_dbg_init, vha, 0x0196, in qla2xxx_print_sfp_info()
3399 ql_dbg(ql_dbg_init, vha, 0x016e, in qla2xxx_print_sfp_info()
3403 ql_dbg(ql_dbg_init, vha, 0x016f, in qla2xxx_print_sfp_info()
3406 ql_dbg(ql_dbg_init, vha, 0x0170, in qla2xxx_print_sfp_info()
3409 ql_dbg(ql_dbg_init, vha, 0x0189, in qla2xxx_print_sfp_info()
3412 ql_dbg(ql_dbg_init, vha, 0x018a, in qla2xxx_print_sfp_info()
3415 ql_dbg(ql_dbg_init, vha, 0x0194, in qla2xxx_print_sfp_info()
3418 ql_dbg(ql_dbg_init, vha, 0x0195, in qla2xxx_print_sfp_info()
3430 qla24xx_detect_sfp(scsi_qla_host_t *vha) in qla24xx_detect_sfp() argument
3434 struct qla_hw_data *ha = vha->hw; in qla24xx_detect_sfp()
3436 if (!AUTO_DETECT_SFP_SUPPORT(vha)) in qla24xx_detect_sfp()
3439 rc = qla2x00_read_sfp_dev(vha, NULL, 0); in qla24xx_detect_sfp()
3443 a = (struct sff_8247_a0 *)vha->hw->sfp_data; in qla24xx_detect_sfp()
3444 qla2xxx_print_sfp_info(vha); in qla24xx_detect_sfp()
3456 ql_dbg(ql_dbg_async, vha, 0x507b, in qla24xx_detect_sfp()
3462 ql_dbg(ql_dbg_async, vha, 0x5084, in qla24xx_detect_sfp()
3466 if (!vha->flags.init_done) in qla24xx_detect_sfp()
3479 qla2x00_setup_chip(scsi_qla_host_t *vha) in qla2x00_setup_chip() argument
3483 struct qla_hw_data *ha = vha->hw; in qla2x00_setup_chip()
3489 rval = ha->isp_ops->load_risc(vha, &srisc_address); in qla2x00_setup_chip()
3491 qla2x00_stop_firmware(vha); in qla2x00_setup_chip()
3505 qla81xx_mpi_sync(vha); in qla2x00_setup_chip()
3508 rval = ha->isp_ops->load_risc(vha, &srisc_address); in qla2x00_setup_chip()
3510 ql_dbg(ql_dbg_init, vha, 0x00c9, in qla2x00_setup_chip()
3513 rval = qla2x00_verify_checksum(vha, srisc_address); in qla2x00_setup_chip()
3516 ql_dbg(ql_dbg_init, vha, 0x00ca, in qla2x00_setup_chip()
3522 if (qla_is_exch_offld_enabled(vha)) in qla2x00_setup_chip()
3525 rval = qla2x00_execute_fw(vha, srisc_address); in qla2x00_setup_chip()
3528 qla24xx_detect_sfp(vha); in qla2x00_setup_chip()
3530 rval = qla2x00_set_exlogins_buffer(vha); in qla2x00_setup_chip()
3534 rval = qla2x00_set_exchoffld_buffer(vha); in qla2x00_setup_chip()
3541 qla82xx_check_md_needed(vha); in qla2x00_setup_chip()
3543 rval = qla2x00_get_fw_version(vha); in qla2x00_setup_chip()
3556 qla2x00_get_resource_cnts(vha); in qla2x00_setup_chip()
3563 vha->req); in qla2x00_setup_chip()
3568 qla2x00_alloc_offload_mem(vha); in qla2x00_setup_chip()
3571 qla2x00_alloc_fw_dump(vha); in qla2x00_setup_chip()
3577 ql_log(ql_log_fatal, vha, 0x00cd, in qla2x00_setup_chip()
3602 rval = qla81xx_fac_get_sector_size(vha, &size); in qla2x00_setup_chip()
3607 ql_log(ql_log_warn, vha, 0x00ce, in qla2x00_setup_chip()
3620 ql_log(ql_log_fatal, vha, 0x00cf, in qla2x00_setup_chip()
3659 qla2x00_update_fw_options(scsi_qla_host_t *vha) in qla2x00_update_fw_options() argument
3662 struct qla_hw_data *ha = vha->hw; in qla2x00_update_fw_options()
3665 qla2x00_get_fw_options(vha, ha->fw_options); in qla2x00_update_fw_options()
3671 ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x0115, in qla2x00_update_fw_options()
3673 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x0109, in qla2x00_update_fw_options()
3733 ql_dbg(ql_dbg_disc, vha, 0x2100, in qla2x00_update_fw_options()
3739 qla2x00_set_fw_options(vha, ha->fw_options); in qla2x00_update_fw_options()
3743 qla24xx_update_fw_options(scsi_qla_host_t *vha) in qla24xx_update_fw_options() argument
3746 struct qla_hw_data *ha = vha->hw; in qla24xx_update_fw_options()
3758 ql_dbg(ql_dbg_disc, vha, 0x2101, in qla24xx_update_fw_options()
3766 if (qla_tgt_mode_enabled(vha) || in qla24xx_update_fw_options()
3767 qla_dual_mode_enabled(vha)) in qla24xx_update_fw_options()
3778 if (qla_tgt_mode_enabled(vha) || in qla24xx_update_fw_options()
3779 qla_dual_mode_enabled(vha)) in qla24xx_update_fw_options()
3791 ql_dbg(ql_dbg_init, vha, 0x00e8, in qla24xx_update_fw_options()
3794 ha->fw_options[3], vha->host->active_mode); in qla24xx_update_fw_options()
3797 qla2x00_set_fw_options(vha, ha->fw_options); in qla24xx_update_fw_options()
3803 rval = qla2x00_set_serdes_params(vha, in qla24xx_update_fw_options()
3808 ql_log(ql_log_warn, vha, 0x0104, in qla24xx_update_fw_options()
3814 qla2x00_config_rings(struct scsi_qla_host *vha) in qla2x00_config_rings() argument
3816 struct qla_hw_data *ha = vha->hw; in qla2x00_config_rings()
3839 qla24xx_config_rings(struct scsi_qla_host *vha) in qla24xx_config_rings() argument
3841 struct qla_hw_data *ha = vha->hw; in qla24xx_config_rings()
3875 ql_dbg(ql_dbg_init, vha, 0x0019, in qla24xx_config_rings()
3892 ql_dbg(ql_dbg_init, vha, 0x00fe, in qla24xx_config_rings()
3909 qlt_24xx_config_rings(vha); in qla24xx_config_rings()
3925 qla2x00_init_rings(scsi_qla_host_t *vha) in qla2x00_init_rings() argument
3930 struct qla_hw_data *ha = vha->hw; in qla2x00_init_rings()
3972 qlt_init_atio_q_entries(vha); in qla2x00_init_rings()
3974 ha->isp_ops->config_rings(vha); in qla2x00_init_rings()
3978 ql_dbg(ql_dbg_init, vha, 0x00d1, "Issue init firmware.\n"); in qla2x00_init_rings()
3981 rval = qlafx00_init_firmware(vha, ha->init_cb_size); in qla2x00_init_rings()
3986 ha->isp_ops->update_fw_options(vha); in qla2x00_init_rings()
4000 ql_dbg(ql_dbg_init, vha, 0x0191, "DPORT Support: %s.\n", in qla2x00_init_rings()
4005 ql_dbg(ql_dbg_init, vha, 0x00bc, "FA-WWPN Support: %s.\n", in qla2x00_init_rings()
4009 rval = qla2x00_init_firmware(vha, ha->init_cb_size); in qla2x00_init_rings()
4012 ql_log(ql_log_fatal, vha, 0x00d2, in qla2x00_init_rings()
4015 ql_dbg(ql_dbg_init, vha, 0x00d3, in qla2x00_init_rings()
4030 qla2x00_fw_ready(scsi_qla_host_t *vha) in qla2x00_fw_ready() argument
4037 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_ready()
4039 if (IS_QLAFX00(vha->hw)) in qla2x00_fw_ready()
4040 return qlafx00_fw_ready(vha); in qla2x00_fw_ready()
4065 if (!vha->flags.init_done) in qla2x00_fw_ready()
4066 ql_log(ql_log_info, vha, 0x801e, in qla2x00_fw_ready()
4071 rval = qla2x00_get_firmware_state(vha, state); in qla2x00_fw_ready()
4074 vha->device_flags &= ~DFLG_NO_CABLE; in qla2x00_fw_ready()
4077 ql_dbg(ql_dbg_taskm, vha, 0x801f, in qla2x00_fw_ready()
4082 ql_dbg(ql_dbg_taskm, vha, 0x8028, in qla2x00_fw_ready()
4086 rval = qla84xx_init_chip(vha); in qla2x00_fw_ready()
4089 vha, 0x8007, in qla2x00_fw_ready()
4098 ql_dbg(ql_dbg_taskm, vha, 0x8008, in qla2x00_fw_ready()
4104 ql_dbg(ql_dbg_taskm, vha, 0x8037, in qla2x00_fw_ready()
4107 qla2x00_get_retry_cnt(vha, &ha->retry_count, in qla2x00_fw_ready()
4116 if (atomic_read(&vha->loop_down_timer) && in qla2x00_fw_ready()
4122 ql_log(ql_log_info, vha, 0x8038, in qla2x00_fw_ready()
4125 vha->device_flags |= DFLG_NO_CABLE; in qla2x00_fw_ready()
4143 ql_dbg(ql_dbg_taskm, vha, 0x803a, in qla2x00_fw_ready()
4147 if (rval && !(vha->device_flags & DFLG_NO_CABLE)) { in qla2x00_fw_ready()
4148 ql_log(ql_log_warn, vha, 0x803b, in qla2x00_fw_ready()
4169 qla2x00_configure_hba(scsi_qla_host_t *vha) in qla2x00_configure_hba() argument
4179 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_hba()
4185 rval = qla2x00_get_adapter_id(vha, in qla2x00_configure_hba()
4188 if (LOOP_TRANSITION(vha) || atomic_read(&ha->loop_down_timer) || in qla2x00_configure_hba()
4191 ql_dbg(ql_dbg_disc, vha, 0x2008, in qla2x00_configure_hba()
4194 ql_log(ql_log_warn, vha, 0x2009, in qla2x00_configure_hba()
4196 if (IS_FWI2_CAPABLE(ha) && (vha == base_vha) && in qla2x00_configure_hba()
4198 ql_log(ql_log_warn, vha, 0x1151, in qla2x00_configure_hba()
4200 if (qla24xx_link_initialize(vha) == QLA_SUCCESS) in qla2x00_configure_hba()
4203 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_configure_hba()
4209 ql_log(ql_log_info, vha, 0x200a, in qla2x00_configure_hba()
4214 vha->loop_id = loop_id; in qla2x00_configure_hba()
4223 ql_dbg(ql_dbg_disc, vha, 0x200b, "HBA in NL topology.\n"); in qla2x00_configure_hba()
4229 ql_dbg(ql_dbg_disc, vha, 0x200c, "HBA in FL topology.\n"); in qla2x00_configure_hba()
4236 ql_dbg(ql_dbg_disc, vha, 0x200d, "HBA in N P2P topology.\n"); in qla2x00_configure_hba()
4243 ql_dbg(ql_dbg_disc, vha, 0x200e, "HBA in F P2P topology.\n"); in qla2x00_configure_hba()
4251 ql_dbg(ql_dbg_disc, vha, 0x200f, in qla2x00_configure_hba()
4266 qlt_update_host_map(vha, id); in qla2x00_configure_hba()
4269 if (!vha->flags.init_done) in qla2x00_configure_hba()
4270 ql_log(ql_log_info, vha, 0x2010, in qla2x00_configure_hba()
4272 connect_type, vha->loop_id); in qla2x00_configure_hba()
4278 qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len, in qla2x00_set_model_info() argument
4283 struct qla_hw_data *ha = vha->hw; in qla2x00_set_model_info()
4319 qla2xxx_get_vpd_field(vha, "\x82", ha->model_desc, in qla2x00_set_model_info()
4326 static void qla2xxx_nvram_wwn_from_ofw(scsi_qla_host_t *vha, nvram_t *nv) in qla2xxx_nvram_wwn_from_ofw() argument
4329 struct qla_hw_data *ha = vha->hw; in qla2xxx_nvram_wwn_from_ofw()
4359 qla2x00_nvram_config(scsi_qla_host_t *vha) in qla2x00_nvram_config() argument
4365 struct qla_hw_data *ha = vha->hw; in qla2x00_nvram_config()
4381 ha->isp_ops->read_nvram(vha, ptr, ha->nvram_base, ha->nvram_size); in qla2x00_nvram_config()
4385 ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x010f, in qla2x00_nvram_config()
4387 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x0110, in qla2x00_nvram_config()
4394 ql_log(ql_log_warn, vha, 0x0064, in qla2x00_nvram_config()
4398 ql_log(ql_log_warn, vha, 0x0065, in qla2x00_nvram_config()
4436 qla2xxx_nvram_wwn_from_ofw(vha, nv); in qla2x00_nvram_config()
4490 qla2x00_set_model_info(vha, nv->model_number, in qla2x00_nvram_config()
4571 memcpy(vha->node_name, icb->node_name, WWN_SIZE); in qla2x00_nvram_config()
4572 memcpy(vha->port_name, icb->port_name, WWN_SIZE); in qla2x00_nvram_config()
4639 vha->flags.process_response_queue = 1; in qla2x00_nvram_config()
4642 if (!vha->flags.init_done) { in qla2x00_nvram_config()
4650 vha->flags.process_response_queue = 0; in qla2x00_nvram_config()
4654 ql_log(ql_log_info, vha, 0x0068, in qla2x00_nvram_config()
4660 vha->flags.process_response_queue = 1; in qla2x00_nvram_config()
4665 ql_log(ql_log_warn, vha, 0x0069, in qla2x00_nvram_config()
4678 spin_lock_irqsave(fcport->vha->host->host_lock, flags); in qla2x00_rport_del()
4681 spin_unlock_irqrestore(fcport->vha->host->host_lock, flags); in qla2x00_rport_del()
4683 ql_dbg(ql_dbg_disc, fcport->vha, 0x210b, in qla2x00_rport_del()
4700 qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags) in qla2x00_alloc_fcport() argument
4709 fcport->vha = vha; in qla2x00_alloc_fcport()
4715 fcport->ct_desc.ct_sns = dma_alloc_coherent(&vha->hw->pdev->dev, in qla2x00_alloc_fcport()
4721 fcport->login_retry = vha->hw->login_retry_count; in qla2x00_alloc_fcport()
4725 ql_log(ql_log_warn, vha, 0xd049, in qla2x00_alloc_fcport()
4741 dma_free_coherent(&fcport->vha->hw->pdev->dev, in qla2x00_free_fcport()
4763 qla2x00_configure_loop(scsi_qla_host_t *vha) in qla2x00_configure_loop() argument
4767 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_loop()
4771 if (test_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags)) { in qla2x00_configure_loop()
4772 rval = qla2x00_configure_hba(vha); in qla2x00_configure_loop()
4774 ql_dbg(ql_dbg_disc, vha, 0x2013, in qla2x00_configure_loop()
4780 save_flags = flags = vha->dpc_flags; in qla2x00_configure_loop()
4781 ql_dbg(ql_dbg_disc, vha, 0x2014, in qla2x00_configure_loop()
4788 clear_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
4789 clear_bit(RSCN_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
4791 qla2x00_get_data_rate(vha); in qla2x00_configure_loop()
4807 if (qla_tgt_mode_enabled(vha)) { in qla2x00_configure_loop()
4810 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla2x00_configure_loop()
4815 } else if (!vha->flags.online || in qla2x00_configure_loop()
4822 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_loop()
4823 ql_dbg(ql_dbg_disc, vha, 0x2015, in qla2x00_configure_loop()
4827 rval = qla2x00_configure_local_loop(vha); in qla2x00_configure_loop()
4831 if (LOOP_TRANSITION(vha)) { in qla2x00_configure_loop()
4832 ql_dbg(ql_dbg_disc, vha, 0x2099, in qla2x00_configure_loop()
4837 rval = qla2x00_configure_fabric(vha); in qla2x00_configure_loop()
4841 if (atomic_read(&vha->loop_down_timer) || in qla2x00_configure_loop()
4842 test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_loop()
4845 atomic_set(&vha->loop_state, LOOP_READY); in qla2x00_configure_loop()
4846 ql_dbg(ql_dbg_disc, vha, 0x2069, in qla2x00_configure_loop()
4854 if (qla_tgt_mode_enabled(vha) || in qla2x00_configure_loop()
4855 qla_dual_mode_enabled(vha)) { in qla2x00_configure_loop()
4859 qlt_24xx_process_atio_queue(vha, 0); in qla2x00_configure_loop()
4865 qlt_24xx_process_atio_queue(vha, 1); in qla2x00_configure_loop()
4874 ql_dbg(ql_dbg_disc, vha, 0x206a, in qla2x00_configure_loop()
4877 ql_dbg(ql_dbg_disc, vha, 0x206b, in qla2x00_configure_loop()
4882 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_loop()
4884 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
4886 set_bit(RSCN_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
4904 qla2x00_configure_local_loop(scsi_qla_host_t *vha) in qla2x00_configure_local_loop() argument
4916 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_local_loop()
4920 if (test_and_clear_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_local_loop()
4927 rval = qla24xx_get_port_login_templ(vha, ha->init_cb_dma, in qla2x00_configure_local_loop()
4936 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla2x00_configure_local_loop()
4938 ql_dbg(ql_dbg_init, vha, 0x00d1, in qla2x00_configure_local_loop()
4950 rval = qla2x00_get_id_list(vha, ha->gid_list, ha->gid_list_dma, in qla2x00_configure_local_loop()
4955 ql_dbg(ql_dbg_disc, vha, 0x2011, in qla2x00_configure_local_loop()
4957 ql_dump_buffer(ql_dbg_disc + ql_dbg_buffer, vha, 0x2075, in qla2x00_configure_local_loop()
4961 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_local_loop()
4966 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_configure_local_loop()
4968 ql_log(ql_log_warn, vha, 0x2012, in qla2x00_configure_local_loop()
4995 (area != vha->d_id.b.area || domain != vha->d_id.b.domain)) in qla2x00_configure_local_loop()
5011 rval2 = qla2x00_get_port_database(vha, new_fcport, 0); in qla2x00_configure_local_loop()
5013 ql_dbg(ql_dbg_disc, vha, 0x2097, in qla2x00_configure_local_loop()
5019 ql_dbg(ql_dbg_disc, vha, 0x2105, in qla2x00_configure_local_loop()
5021 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_local_loop()
5026 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla2x00_configure_local_loop()
5030 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_local_loop()
5048 list_add_tail(&new_fcport->list, &vha->vp_fcports); in qla2x00_configure_local_loop()
5053 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla2x00_configure_local_loop()
5055 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_configure_local_loop()
5058 ql_log(ql_log_warn, vha, 0xd031, in qla2x00_configure_local_loop()
5063 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla2x00_configure_local_loop()
5067 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla2x00_configure_local_loop()
5075 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_local_loop()
5076 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_configure_local_loop()
5080 if ((qla_dual_mode_enabled(vha) || in qla2x00_configure_local_loop()
5081 qla_ini_mode_enabled(vha)) && in qla2x00_configure_local_loop()
5083 qla2x00_mark_device_lost(vha, fcport, in qla2x00_configure_local_loop()
5089 ql_dbg(ql_dbg_disc, vha, 0x20f0, in qla2x00_configure_local_loop()
5101 qla24xx_fcport_handle_login(vha, fcport); in qla2x00_configure_local_loop()
5108 ql_dbg(ql_dbg_disc, vha, 0x2098, in qla2x00_configure_local_loop()
5116 qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_iidma_fcport() argument
5120 struct qla_hw_data *ha = vha->hw; in qla2x00_iidma_fcport()
5133 rval = qla2x00_set_idma_speed(vha, fcport->loop_id, fcport->fp_speed, in qla2x00_iidma_fcport()
5136 ql_dbg(ql_dbg_disc, vha, 0x2004, in qla2x00_iidma_fcport()
5140 ql_dbg(ql_dbg_disc, vha, 0x2005, in qla2x00_iidma_fcport()
5147 void qla_do_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla_do_iidma_work() argument
5149 qla2x00_iidma_fcport(vha, fcport); in qla_do_iidma_work()
5150 qla24xx_update_fcport_fcp_prio(vha, fcport); in qla_do_iidma_work()
5153 int qla_post_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport) in qla_post_iidma_work() argument
5157 e = qla2x00_alloc_work(vha, QLA_EVT_IIDMA); in qla_post_iidma_work()
5162 return qla2x00_post_work(vha, e); in qla_post_iidma_work()
5167 qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_reg_remote_port() argument
5181 fcport->rport = rport = fc_remote_port_add(vha->host, 0, &rport_ids); in qla2x00_reg_remote_port()
5183 ql_log(ql_log_warn, vha, 0x2006, in qla2x00_reg_remote_port()
5188 spin_lock_irqsave(fcport->vha->host->host_lock, flags); in qla2x00_reg_remote_port()
5190 spin_unlock_irqrestore(fcport->vha->host->host_lock, flags); in qla2x00_reg_remote_port()
5200 ql_dbg(ql_dbg_disc, vha, 0x20ee, in qla2x00_reg_remote_port()
5224 qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_update_fcport() argument
5226 fcport->vha = vha; in qla2x00_update_fcport()
5235 fcport->login_retry = vha->hw->login_retry_count; in qla2x00_update_fcport()
5238 qla2x00_iidma_fcport(vha, fcport); in qla2x00_update_fcport()
5240 switch (vha->hw->current_topology) { in qla2x00_update_fcport()
5250 qla_nvme_register_remote(vha, fcport); in qla2x00_update_fcport()
5256 qla24xx_update_fcport_fcp_prio(vha, fcport); in qla2x00_update_fcport()
5258 switch (vha->host->active_mode) { in qla2x00_update_fcport()
5260 qla2x00_reg_remote_port(vha, fcport); in qla2x00_update_fcport()
5263 if (!vha->vha_tgt.qla_tgt->tgt_stop && in qla2x00_update_fcport()
5264 !vha->vha_tgt.qla_tgt->tgt_stopped) in qla2x00_update_fcport()
5265 qlt_fc_port_added(vha, fcport); in qla2x00_update_fcport()
5268 qla2x00_reg_remote_port(vha, fcport); in qla2x00_update_fcport()
5269 if (!vha->vha_tgt.qla_tgt->tgt_stop && in qla2x00_update_fcport()
5270 !vha->vha_tgt.qla_tgt->tgt_stopped) in qla2x00_update_fcport()
5271 qlt_fc_port_added(vha, fcport); in qla2x00_update_fcport()
5277 if (IS_IIDMA_CAPABLE(vha->hw) && vha->hw->flags.gpsc_supported) { in qla2x00_update_fcport()
5280 ql_dbg(ql_dbg_disc, vha, 0x20d7, in qla2x00_update_fcport()
5283 vha->fcport_count); in qla2x00_update_fcport()
5284 qla24xx_post_gfpnid_work(vha, fcport); in qla2x00_update_fcport()
5286 ql_dbg(ql_dbg_disc, vha, 0x20d7, in qla2x00_update_fcport()
5289 vha->fcport_count); in qla2x00_update_fcport()
5290 qla24xx_post_gpsc_work(vha, fcport); in qla2x00_update_fcport()
5308 qla2x00_configure_fabric(scsi_qla_host_t *vha) in qla2x00_configure_fabric() argument
5315 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_fabric()
5323 rval = qla2x00_get_port_name(vha, loop_id, vha->fabric_node_name, 1); in qla2x00_configure_fabric()
5325 ql_dbg(ql_dbg_disc, vha, 0x20a0, in qla2x00_configure_fabric()
5328 vha->device_flags &= ~SWITCH_FOUND; in qla2x00_configure_fabric()
5331 vha->device_flags |= SWITCH_FOUND; in qla2x00_configure_fabric()
5334 if (qla_tgt_mode_enabled(vha) || qla_dual_mode_enabled(vha)) { in qla2x00_configure_fabric()
5335 rval = qla2x00_send_change_request(vha, 0x3, 0); in qla2x00_configure_fabric()
5337 ql_log(ql_log_warn, vha, 0x121, in qla2x00_configure_fabric()
5344 qla2x00_mgmt_svr_login(vha); in qla2x00_configure_fabric()
5348 test_and_clear_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags)) in qla2x00_configure_fabric()
5349 qla2x00_fdmi_register(vha); in qla2x00_configure_fabric()
5353 rval = ha->isp_ops->fabric_login(vha, loop_id, 0xff, 0xff, in qla2x00_configure_fabric()
5356 ql_dbg(ql_dbg_disc, vha, 0x20a1, in qla2x00_configure_fabric()
5359 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_fabric()
5362 if (test_and_clear_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_fabric()
5363 if (qla2x00_rft_id(vha)) { in qla2x00_configure_fabric()
5365 ql_dbg(ql_dbg_disc, vha, 0x20a2, in qla2x00_configure_fabric()
5368 &vha->dpc_flags)) in qla2x00_configure_fabric()
5371 if (qla2x00_rff_id(vha, FC4_TYPE_FCP_SCSI)) { in qla2x00_configure_fabric()
5373 ql_dbg(ql_dbg_disc, vha, 0x209a, in qla2x00_configure_fabric()
5376 &vha->dpc_flags)) in qla2x00_configure_fabric()
5379 if (vha->flags.nvme_enabled) { in qla2x00_configure_fabric()
5380 if (qla2x00_rff_id(vha, FC_TYPE_NVME)) { in qla2x00_configure_fabric()
5381 ql_dbg(ql_dbg_disc, vha, 0x2049, in qla2x00_configure_fabric()
5385 if (qla2x00_rnn_id(vha)) { in qla2x00_configure_fabric()
5387 ql_dbg(ql_dbg_disc, vha, 0x2104, in qla2x00_configure_fabric()
5390 &vha->dpc_flags)) in qla2x00_configure_fabric()
5392 } else if (qla2x00_rsnn_nn(vha)) { in qla2x00_configure_fabric()
5394 ql_dbg(ql_dbg_disc, vha, 0x209b, in qla2x00_configure_fabric()
5396 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_configure_fabric()
5408 qlt_do_generation_tick(vha, &discovery_gen); in qla2x00_configure_fabric()
5411 rval = qla24xx_async_gpnft(vha, FC4_TYPE_FCP_SCSI, in qla2x00_configure_fabric()
5414 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_fabric()
5416 list_for_each_entry(fcport, &vha->vp_fcports, list) in qla2x00_configure_fabric()
5419 rval = qla2x00_find_all_fabric_devs(vha); in qla2x00_configure_fabric()
5425 if (!vha->nvme_local_port && vha->flags.nvme_enabled) in qla2x00_configure_fabric()
5426 qla_nvme_register_hba(vha); in qla2x00_configure_fabric()
5429 ql_dbg(ql_dbg_disc, vha, 0x2068, in qla2x00_configure_fabric()
5449 qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) in qla2x00_find_all_fabric_devs() argument
5460 struct qla_hw_data *ha = vha->hw; in qla2x00_find_all_fabric_devs()
5473 ql_dbg(ql_dbg_disc, vha, 0x209c, in qla2x00_find_all_fabric_devs()
5477 if (qla2x00_gid_pt(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
5479 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
5481 } else if (qla2x00_gpn_id(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
5483 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
5485 } else if (qla2x00_gnn_id(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
5487 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
5489 } else if (qla2x00_gfpn_id(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
5491 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
5497 qla2x00_gff_id(vha, swl); in qla2x00_find_all_fabric_devs()
5498 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
5505 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_find_all_fabric_devs()
5507 ql_log(ql_log_warn, vha, 0x209d, in qla2x00_find_all_fabric_devs()
5519 if (qla2x00_is_reserved_id(vha, loop_id)) in qla2x00_find_all_fabric_devs()
5523 (atomic_read(&vha->loop_down_timer) || in qla2x00_find_all_fabric_devs()
5524 LOOP_TRANSITION(vha))) { in qla2x00_find_all_fabric_devs()
5525 atomic_set(&vha->loop_down_timer, 0); in qla2x00_find_all_fabric_devs()
5526 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_find_all_fabric_devs()
5527 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_find_all_fabric_devs()
5547 if (vha->flags.nvme_enabled && in qla2x00_find_all_fabric_devs()
5551 ql_log(ql_log_info, vha, 0x2131, in qla2x00_find_all_fabric_devs()
5563 rval = qla2x00_ga_nxt(vha, new_fcport); in qla2x00_find_all_fabric_devs()
5565 ql_log(ql_log_warn, vha, 0x209e, in qla2x00_find_all_fabric_devs()
5578 ql_dbg(ql_dbg_disc, vha, 0x209f, in qla2x00_find_all_fabric_devs()
5591 if (qla2x00_is_a_vp_did(vha, new_fcport->d_id.b24)) in qla2x00_find_all_fabric_devs()
5596 (vha->d_id.b24 & 0xffff00)) && ha->current_topology == in qla2x00_find_all_fabric_devs()
5610 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla2x00_find_all_fabric_devs()
5614 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_find_all_fabric_devs()
5634 (vha->host->active_mode == MODE_TARGET))) { in qla2x00_find_all_fabric_devs()
5655 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf080, in qla2x00_find_all_fabric_devs()
5678 vha->fcport_count--; in qla2x00_find_all_fabric_devs()
5684 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla2x00_find_all_fabric_devs()
5689 list_add_tail(&new_fcport->list, &vha->vp_fcports); in qla2x00_find_all_fabric_devs()
5691 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla2x00_find_all_fabric_devs()
5696 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_find_all_fabric_devs()
5698 ql_log(ql_log_warn, vha, 0xd032, in qla2x00_find_all_fabric_devs()
5711 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_find_all_fabric_devs()
5712 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_find_all_fabric_devs()
5720 if ((qla_dual_mode_enabled(vha) || in qla2x00_find_all_fabric_devs()
5721 qla_ini_mode_enabled(vha)) && in qla2x00_find_all_fabric_devs()
5723 qla2x00_mark_device_lost(vha, fcport, in qla2x00_find_all_fabric_devs()
5729 ql_dbg(ql_dbg_disc, vha, 0x20f0, in qla2x00_find_all_fabric_devs()
5740 qla24xx_fcport_handle_login(vha, fcport); in qla2x00_find_all_fabric_devs()
5760 qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev) in qla2x00_find_new_loop_id() argument
5763 struct qla_hw_data *ha = vha->hw; in qla2x00_find_new_loop_id()
5773 qla2x00_is_reserved_id(vha, dev->loop_id)) { in qla2x00_find_new_loop_id()
5782 ql_dbg(ql_dbg_disc, dev->vha, 0x2086, in qla2x00_find_new_loop_id()
5786 ql_log(ql_log_warn, dev->vha, 0x2087, in qla2x00_find_new_loop_id()
5796 qla2x00_reserve_mgmt_server_loop_id(scsi_qla_host_t *vha) in qla2x00_reserve_mgmt_server_loop_id() argument
5799 int lid = NPH_MGMT_SERVER - vha->vp_idx; in qla2x00_reserve_mgmt_server_loop_id()
5801 struct qla_hw_data *ha = vha->hw; in qla2x00_reserve_mgmt_server_loop_id()
5803 if (vha->vp_idx == 0) { in qla2x00_reserve_mgmt_server_loop_id()
5811 if (!test_bit(lid, vha->hw->loop_id_map)) { in qla2x00_reserve_mgmt_server_loop_id()
5812 set_bit(lid, vha->hw->loop_id_map); in qla2x00_reserve_mgmt_server_loop_id()
5837 qla2x00_fabric_login(scsi_qla_host_t *vha, fc_port_t *fcport, in qla2x00_fabric_login() argument
5844 struct qla_hw_data *ha = vha->hw; in qla2x00_fabric_login()
5850 ql_dbg(ql_dbg_disc, vha, 0x2000, in qla2x00_fabric_login()
5857 rval = ha->isp_ops->fabric_login(vha, fcport->loop_id, in qla2x00_fabric_login()
5875 ql_dbg(ql_dbg_disc, vha, 0x2001, in qla2x00_fabric_login()
5923 rval = qla2x00_find_new_loop_id(vha, fcport); in qla2x00_fabric_login()
5935 ha->isp_ops->fabric_logout(vha, fcport->loop_id, in qla2x00_fabric_login()
5938 qla2x00_mark_device_lost(vha, fcport, 1, 0); in qla2x00_fabric_login()
5946 ql_dbg(ql_dbg_disc, vha, 0x2002, in qla2x00_fabric_login()
5953 ha->isp_ops->fabric_logout(vha, fcport->loop_id, in qla2x00_fabric_login()
5981 qla2x00_local_device_login(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_local_device_login() argument
5987 rval = qla2x00_login_local_device(vha, fcport, mb, BIT_0); in qla2x00_local_device_login()
6011 qla2x00_loop_resync(scsi_qla_host_t *vha) in qla2x00_loop_resync() argument
6018 req = vha->req; in qla2x00_loop_resync()
6021 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_loop_resync()
6022 if (vha->flags.online) { in qla2x00_loop_resync()
6023 if (!(rval = qla2x00_fw_ready(vha))) { in qla2x00_loop_resync()
6027 if (!IS_QLAFX00(vha->hw)) { in qla2x00_loop_resync()
6032 qla2x00_marker(vha, req, rsp, 0, 0, in qla2x00_loop_resync()
6034 vha->marker_needed = 0; in qla2x00_loop_resync()
6038 clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_loop_resync()
6040 if (IS_QLAFX00(vha->hw)) in qla2x00_loop_resync()
6041 qlafx00_configure_devices(vha); in qla2x00_loop_resync()
6043 qla2x00_configure_loop(vha); in qla2x00_loop_resync()
6046 } while (!atomic_read(&vha->loop_down_timer) && in qla2x00_loop_resync()
6047 !(test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) in qla2x00_loop_resync()
6049 &vha->dpc_flags))); in qla2x00_loop_resync()
6053 if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) in qla2x00_loop_resync()
6057 ql_dbg(ql_dbg_disc, vha, 0x206c, in qla2x00_loop_resync()
6098 struct scsi_qla_host *vha; in qla2x00_update_fcports() local
6104 list_for_each_entry(vha, &base_vha->hw->vp_list, list) { in qla2x00_update_fcports()
6105 atomic_inc(&vha->vref_count); in qla2x00_update_fcports()
6106 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_update_fcports()
6115 atomic_dec(&vha->vref_count); in qla2x00_update_fcports()
6116 wake_up(&vha->vref_waitq); in qla2x00_update_fcports()
6123 qla83xx_reset_ownership(scsi_qla_host_t *vha) in qla83xx_reset_ownership() argument
6125 struct qla_hw_data *ha = vha->hw; in qla83xx_reset_ownership()
6132 drv_presence = qla8044_rd_direct(vha, in qla83xx_reset_ownership()
6134 dev_part_info1 = qla8044_rd_direct(vha, in qla83xx_reset_ownership()
6136 dev_part_info2 = qla8044_rd_direct(vha, in qla83xx_reset_ownership()
6139 qla83xx_rd_reg(vha, QLA83XX_IDC_DRV_PRESENCE, &drv_presence); in qla83xx_reset_ownership()
6140 qla83xx_rd_reg(vha, QLA83XX_DEV_PARTINFO1, &dev_part_info1); in qla83xx_reset_ownership()
6141 qla83xx_rd_reg(vha, QLA83XX_DEV_PARTINFO2, &dev_part_info2); in qla83xx_reset_ownership()
6175 ql_dbg(ql_dbg_p3p, vha, 0xb07f, in qla83xx_reset_ownership()
6182 __qla83xx_set_drv_ack(scsi_qla_host_t *vha) in __qla83xx_set_drv_ack() argument
6185 struct qla_hw_data *ha = vha->hw; in __qla83xx_set_drv_ack()
6188 rval = qla83xx_rd_reg(vha, QLA83XX_IDC_DRIVER_ACK, &drv_ack); in __qla83xx_set_drv_ack()
6191 rval = qla83xx_wr_reg(vha, QLA83XX_IDC_DRIVER_ACK, drv_ack); in __qla83xx_set_drv_ack()
6198 __qla83xx_clear_drv_ack(scsi_qla_host_t *vha) in __qla83xx_clear_drv_ack() argument
6201 struct qla_hw_data *ha = vha->hw; in __qla83xx_clear_drv_ack()
6204 rval = qla83xx_rd_reg(vha, QLA83XX_IDC_DRIVER_ACK, &drv_ack); in __qla83xx_clear_drv_ack()
6207 rval = qla83xx_wr_reg(vha, QLA83XX_IDC_DRIVER_ACK, drv_ack); in __qla83xx_clear_drv_ack()
6238 qla83xx_idc_audit(scsi_qla_host_t *vha, int audit_type) in qla83xx_idc_audit() argument
6240 struct qla_hw_data *ha = vha->hw; in qla83xx_idc_audit()
6248 qla83xx_wr_reg(vha, QLA83XX_IDC_AUDIT, idc_audit_reg); in qla83xx_idc_audit()
6256 qla83xx_wr_reg(vha, QLA83XX_IDC_AUDIT, idc_audit_reg); in qla83xx_idc_audit()
6260 ql_log(ql_log_warn, vha, 0xb078, in qla83xx_idc_audit()
6268 qla83xx_initiating_reset(scsi_qla_host_t *vha) in qla83xx_initiating_reset() argument
6270 struct qla_hw_data *ha = vha->hw; in qla83xx_initiating_reset()
6273 __qla83xx_get_idc_control(vha, &idc_control); in qla83xx_initiating_reset()
6275 ql_log(ql_log_info, vha, 0xb080, in qla83xx_initiating_reset()
6282 qla83xx_rd_reg(vha, QLA83XX_IDC_DEV_STATE, &dev_state); in qla83xx_initiating_reset()
6284 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE, in qla83xx_initiating_reset()
6286 ql_log(ql_log_info, vha, 0xb056, "HW State: NEED RESET.\n"); in qla83xx_initiating_reset()
6287 qla83xx_idc_audit(vha, IDC_AUDIT_TIMESTAMP); in qla83xx_initiating_reset()
6290 ql_log(ql_log_info, vha, 0xb057, "HW State: %s.\n", state); in qla83xx_initiating_reset()
6295 qla83xx_idc_unlock(vha, 0); in qla83xx_initiating_reset()
6297 qla83xx_idc_lock(vha, 0); in qla83xx_initiating_reset()
6298 qla83xx_rd_reg(vha, QLA83XX_IDC_DEV_STATE, &dev_state); in qla83xx_initiating_reset()
6303 __qla83xx_set_drv_ack(vha); in qla83xx_initiating_reset()
6309 __qla83xx_set_idc_control(scsi_qla_host_t *vha, uint32_t idc_control) in __qla83xx_set_idc_control() argument
6311 return qla83xx_wr_reg(vha, QLA83XX_IDC_CONTROL, idc_control); in __qla83xx_set_idc_control()
6315 __qla83xx_get_idc_control(scsi_qla_host_t *vha, uint32_t *idc_control) in __qla83xx_get_idc_control() argument
6317 return qla83xx_rd_reg(vha, QLA83XX_IDC_CONTROL, idc_control); in __qla83xx_get_idc_control()
6321 qla83xx_check_driver_presence(scsi_qla_host_t *vha) in qla83xx_check_driver_presence() argument
6324 struct qla_hw_data *ha = vha->hw; in qla83xx_check_driver_presence()
6326 qla83xx_rd_reg(vha, QLA83XX_IDC_DRV_PRESENCE, &drv_presence); in qla83xx_check_driver_presence()
6334 qla83xx_nic_core_reset(scsi_qla_host_t *vha) in qla83xx_nic_core_reset() argument
6337 struct qla_hw_data *ha = vha->hw; in qla83xx_nic_core_reset()
6339 ql_dbg(ql_dbg_p3p, vha, 0xb058, in qla83xx_nic_core_reset()
6342 if (vha->device_flags & DFLG_DEV_FAILED) { in qla83xx_nic_core_reset()
6343 ql_log(ql_log_warn, vha, 0xb059, in qla83xx_nic_core_reset()
6348 qla83xx_idc_lock(vha, 0); in qla83xx_nic_core_reset()
6350 if (qla83xx_check_driver_presence(vha) != QLA_SUCCESS) { in qla83xx_nic_core_reset()
6351 ql_log(ql_log_warn, vha, 0xb05a, in qla83xx_nic_core_reset()
6358 qla83xx_reset_ownership(vha); in qla83xx_nic_core_reset()
6360 rval = qla83xx_initiating_reset(vha); in qla83xx_nic_core_reset()
6367 rval = qla83xx_idc_state_handler(vha); in qla83xx_nic_core_reset()
6371 __qla83xx_clear_drv_ack(vha); in qla83xx_nic_core_reset()
6375 qla83xx_idc_unlock(vha, 0); in qla83xx_nic_core_reset()
6377 ql_dbg(ql_dbg_p3p, vha, 0xb05b, "Exiting %s.\n", __func__); in qla83xx_nic_core_reset()
6383 qla2xxx_mctp_dump(scsi_qla_host_t *vha) in qla2xxx_mctp_dump() argument
6385 struct qla_hw_data *ha = vha->hw; in qla2xxx_mctp_dump()
6390 ql_log(ql_log_info, vha, 0x506d, in qla2xxx_mctp_dump()
6400 ql_log(ql_log_warn, vha, 0x506e, in qla2xxx_mctp_dump()
6407 rval = qla2x00_dump_mctp_data(vha, ha->mctp_dump_dma, in qla2xxx_mctp_dump()
6410 ql_log(ql_log_warn, vha, 0x506f, in qla2xxx_mctp_dump()
6413 ql_log(ql_log_info, vha, 0x5070, in qla2xxx_mctp_dump()
6415 vha->host_no, ha->mctp_dump); in qla2xxx_mctp_dump()
6421 rval = qla83xx_restart_nic_firmware(vha); in qla2xxx_mctp_dump()
6424 ql_log(ql_log_warn, vha, 0x5071, in qla2xxx_mctp_dump()
6427 ql_dbg(ql_dbg_p3p, vha, 0xb084, in qla2xxx_mctp_dump()
6445 qla2x00_quiesce_io(scsi_qla_host_t *vha) in qla2x00_quiesce_io() argument
6447 struct qla_hw_data *ha = vha->hw; in qla2x00_quiesce_io()
6450 ql_dbg(ql_dbg_dpc, vha, 0x401d, in qla2x00_quiesce_io()
6454 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { in qla2x00_quiesce_io()
6455 atomic_set(&vha->loop_state, LOOP_DOWN); in qla2x00_quiesce_io()
6456 qla2x00_mark_all_devices_lost(vha, 0); in qla2x00_quiesce_io()
6460 if (!atomic_read(&vha->loop_down_timer)) in qla2x00_quiesce_io()
6461 atomic_set(&vha->loop_down_timer, in qla2x00_quiesce_io()
6465 qla2x00_eh_wait_for_pending_commands(vha, 0, 0, WAIT_HOST); in qla2x00_quiesce_io()
6469 qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) in qla2x00_abort_isp_cleanup() argument
6471 struct qla_hw_data *ha = vha->hw; in qla2x00_abort_isp_cleanup()
6481 vha->flags.online = 0; in qla2x00_abort_isp_cleanup()
6483 clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_abort_isp_cleanup()
6484 vha->qla_stats.total_isp_aborts++; in qla2x00_abort_isp_cleanup()
6486 ql_log(ql_log_info, vha, 0x00af, in qla2x00_abort_isp_cleanup()
6495 ha->isp_ops->reset_chip(vha); in qla2x00_abort_isp_cleanup()
6529 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); in qla2x00_abort_isp_cleanup()
6530 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { in qla2x00_abort_isp_cleanup()
6531 atomic_set(&vha->loop_state, LOOP_DOWN); in qla2x00_abort_isp_cleanup()
6532 qla2x00_mark_all_devices_lost(vha, 0); in qla2x00_abort_isp_cleanup()
6546 if (!atomic_read(&vha->loop_down_timer)) in qla2x00_abort_isp_cleanup()
6547 atomic_set(&vha->loop_down_timer, in qla2x00_abort_isp_cleanup()
6552 list_for_each_entry(fcport, &vha->vp_fcports, list) in qla2x00_abort_isp_cleanup()
6570 qla82xx_chip_reset_cleanup(vha); in qla2x00_abort_isp_cleanup()
6571 ql_log(ql_log_info, vha, 0x00b4, in qla2x00_abort_isp_cleanup()
6577 vha->flags.online = 0; in qla2x00_abort_isp_cleanup()
6581 qla2x00_abort_all_cmds(vha, DID_RESET << 16); in qla2x00_abort_isp_cleanup()
6598 qla2x00_abort_isp(scsi_qla_host_t *vha) in qla2x00_abort_isp() argument
6602 struct qla_hw_data *ha = vha->hw; in qla2x00_abort_isp()
6607 if (vha->flags.online) { in qla2x00_abort_isp()
6608 qla2x00_abort_isp_cleanup(vha); in qla2x00_abort_isp()
6611 ql_dbg(ql_dbg_p3p, vha, 0xb05c, in qla2x00_abort_isp()
6613 if (qla83xx_clear_drv_presence(vha) != QLA_SUCCESS) in qla2x00_abort_isp()
6614 ql_dbg(ql_dbg_p3p, vha, 0xb073, in qla2x00_abort_isp()
6620 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
6625 ha->isp_ops->get_flash_version(vha, req->ring); in qla2x00_abort_isp()
6627 ha->isp_ops->nvram_config(vha); in qla2x00_abort_isp()
6629 if (!qla2x00_restart_isp(vha)) { in qla2x00_abort_isp()
6630 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla2x00_abort_isp()
6632 if (!atomic_read(&vha->loop_down_timer)) { in qla2x00_abort_isp()
6637 vha->marker_needed = 1; in qla2x00_abort_isp()
6640 vha->flags.online = 1; in qla2x00_abort_isp()
6645 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
6648 qla2x00_get_fw_version(vha); in qla2x00_abort_isp()
6653 rval = qla2x00_enable_fce_trace(vha, in qla2x00_abort_isp()
6657 ql_log(ql_log_warn, vha, 0x8033, in qla2x00_abort_isp()
6666 rval = qla2x00_enable_eft_trace(vha, in qla2x00_abort_isp()
6669 ql_log(ql_log_warn, vha, 0x8034, in qla2x00_abort_isp()
6675 vha->flags.online = 1; in qla2x00_abort_isp()
6676 if (test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { in qla2x00_abort_isp()
6678 ql_log(ql_log_fatal, vha, 0x8035, in qla2x00_abort_isp()
6685 ha->isp_ops->reset_adapter(vha); in qla2x00_abort_isp()
6686 vha->flags.online = 0; in qla2x00_abort_isp()
6688 &vha->dpc_flags); in qla2x00_abort_isp()
6692 ql_dbg(ql_dbg_taskm, vha, 0x8020, in qla2x00_abort_isp()
6699 ql_dbg(ql_dbg_taskm, vha, 0x8021, in qla2x00_abort_isp()
6702 set_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
6710 ql_dbg(ql_dbg_taskm, vha, 0x8022, "%s succeeded.\n", __func__); in qla2x00_abort_isp()
6711 qla2x00_configure_hba(vha); in qla2x00_abort_isp()
6727 ql_dbg(ql_dbg_p3p, vha, 0xb05d, in qla2x00_abort_isp()
6729 if (qla83xx_set_drv_presence(vha) != QLA_SUCCESS) in qla2x00_abort_isp()
6730 ql_dbg(ql_dbg_p3p, vha, 0xb074, in qla2x00_abort_isp()
6734 ql_log(ql_log_warn, vha, 0x8023, "%s **** FAILED ****.\n", in qla2x00_abort_isp()
6752 qla2x00_restart_isp(scsi_qla_host_t *vha) in qla2x00_restart_isp() argument
6755 struct qla_hw_data *ha = vha->hw; in qla2x00_restart_isp()
6760 if (qla2x00_isp_firmware(vha)) { in qla2x00_restart_isp()
6761 vha->flags.online = 0; in qla2x00_restart_isp()
6762 status = ha->isp_ops->chip_diag(vha); in qla2x00_restart_isp()
6764 status = qla2x00_setup_chip(vha); in qla2x00_restart_isp()
6767 if (!status && !(status = qla2x00_init_rings(vha))) { in qla2x00_restart_isp()
6768 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla2x00_restart_isp()
6774 status = qla2x00_fw_ready(vha); in qla2x00_restart_isp()
6777 qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL); in qla2x00_restart_isp()
6778 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_restart_isp()
6782 if ((vha->device_flags & DFLG_NO_CABLE)) in qla2x00_restart_isp()
6839 qla2x00_reset_adapter(scsi_qla_host_t *vha) in qla2x00_reset_adapter() argument
6842 struct qla_hw_data *ha = vha->hw; in qla2x00_reset_adapter()
6845 vha->flags.online = 0; in qla2x00_reset_adapter()
6857 qla24xx_reset_adapter(scsi_qla_host_t *vha) in qla24xx_reset_adapter() argument
6860 struct qla_hw_data *ha = vha->hw; in qla24xx_reset_adapter()
6866 vha->flags.online = 0; in qla24xx_reset_adapter()
6883 static void qla24xx_nvram_wwn_from_ofw(scsi_qla_host_t *vha, in qla24xx_nvram_wwn_from_ofw() argument
6887 struct qla_hw_data *ha = vha->hw; in qla24xx_nvram_wwn_from_ofw()
6904 qla24xx_nvram_config(scsi_qla_host_t *vha) in qla24xx_nvram_config() argument
6913 struct qla_hw_data *ha = vha->hw; in qla24xx_nvram_config()
6933 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->vpd, in qla24xx_nvram_config()
6938 ha->isp_ops->read_nvram(vha, (uint8_t *)dptr, ha->nvram_base, in qla24xx_nvram_config()
6943 ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x006a, in qla24xx_nvram_config()
6945 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x010d, in qla24xx_nvram_config()
6953 ql_log(ql_log_warn, vha, 0x006b, in qla24xx_nvram_config()
6956 ql_log(ql_log_warn, vha, 0x006c, in qla24xx_nvram_config()
6986 qla24xx_nvram_wwn_from_ofw(vha, nv); in qla24xx_nvram_config()
7005 if (qla_tgt_mode_enabled(vha)) { in qla24xx_nvram_config()
7012 qlt_24xx_config_nvram_stage1(vha, nv); in qla24xx_nvram_config()
7038 qla2x00_set_model_info(vha, nv->model_name, sizeof(nv->model_name), in qla24xx_nvram_config()
7041 qlt_24xx_config_nvram_stage2(vha, icb); in qla24xx_nvram_config()
7079 memcpy(vha->node_name, icb->node_name, WWN_SIZE); in qla24xx_nvram_config()
7080 memcpy(vha->port_name, icb->port_name, WWN_SIZE); in qla24xx_nvram_config()
7137 if (!vha->flags.init_done) { in qla24xx_nvram_config()
7145 vha->flags.process_response_queue = 0; in qla24xx_nvram_config()
7149 ql_log(ql_log_info, vha, 0x006f, in qla24xx_nvram_config()
7156 vha->flags.process_response_queue = 1; in qla24xx_nvram_config()
7160 ql_log(ql_log_warn, vha, 0x0070, in qla24xx_nvram_config()
7166 uint8_t qla27xx_find_valid_image(struct scsi_qla_host *vha) in qla27xx_find_valid_image() argument
7172 struct qla_hw_data *ha = vha->hw; in qla27xx_find_valid_image()
7183 qla24xx_read_flash_data(vha, (uint32_t *)(&pri_image_status), in qla27xx_find_valid_image()
7187 ql_dbg(ql_dbg_init, vha, 0x018b, in qla27xx_find_valid_image()
7201 ql_dbg(ql_dbg_init, vha, 0x018c, in qla27xx_find_valid_image()
7213 qla24xx_read_flash_data(vha, (uint32_t *)(&sec_image_status), in qla27xx_find_valid_image()
7217 ql_dbg(ql_dbg_init, vha, 0x018d, in qla27xx_find_valid_image()
7229 ql_dbg(ql_dbg_init, vha, 0x018e, in qla27xx_find_valid_image()
7245 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x018f, "%s image\n", in qla27xx_find_valid_image()
7255 qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr, in qla24xx_load_risc_flash() argument
7264 struct qla_hw_data *ha = vha->hw; in qla24xx_load_risc_flash()
7267 ql_dbg(ql_dbg_init, vha, 0x008b, in qla24xx_load_risc_flash()
7277 qla27xx_find_valid_image(vha) == QLA27XX_SECONDARY_IMAGE) in qla24xx_load_risc_flash()
7281 qla24xx_read_flash_data(vha, dcode, faddr + 4, 4); in qla24xx_load_risc_flash()
7288 ql_log(ql_log_fatal, vha, 0x008c, in qla24xx_load_risc_flash()
7291 ql_log(ql_log_fatal, vha, 0x008d, in qla24xx_load_risc_flash()
7300 qla24xx_read_flash_data(vha, dcode, faddr, 4); in qla24xx_load_risc_flash()
7312 ql_dbg(ql_dbg_init, vha, 0x008e, in qla24xx_load_risc_flash()
7317 qla24xx_read_flash_data(vha, dcode, faddr, dlen); in qla24xx_load_risc_flash()
7321 rval = qla2x00_load_ram(vha, req->dma, risc_addr, in qla24xx_load_risc_flash()
7324 ql_log(ql_log_fatal, vha, 0x008f, in qla24xx_load_risc_flash()
7348 ql_dbg(ql_dbg_init, vha, 0x0161, in qla24xx_load_risc_flash()
7350 qla24xx_read_flash_data(vha, dcode, faddr, 7); in qla24xx_load_risc_flash()
7352 ql_dbg(ql_dbg_init, vha, 0x0162, in qla24xx_load_risc_flash()
7358 ql_dbg(ql_dbg_init, vha, 0x0163, in qla24xx_load_risc_flash()
7362 ql_log(ql_log_warn, vha, 0x0164, in qla24xx_load_risc_flash()
7370 qla24xx_read_flash_data(vha, dcode, faddr, risc_size); in qla24xx_load_risc_flash()
7375 ql_log(ql_log_warn, vha, 0x0165, in qla24xx_load_risc_flash()
7381 ql_dbg(ql_dbg_init, vha, 0x0166, in qla24xx_load_risc_flash()
7384 ql_log(ql_log_warn, vha, 0x0167, in qla24xx_load_risc_flash()
7393 ql_log(ql_log_warn, vha, 0x0168, "Using default fwdump template\n"); in qla24xx_load_risc_flash()
7400 ql_dbg(ql_dbg_init, vha, 0x0169, in qla24xx_load_risc_flash()
7404 ql_log(ql_log_warn, vha, 0x016a, in qla24xx_load_risc_flash()
7416 ql_log(ql_log_warn, vha, 0x016b, in qla24xx_load_risc_flash()
7422 ql_dbg(ql_dbg_init, vha, 0x016c, in qla24xx_load_risc_flash()
7428 ql_log(ql_log_warn, vha, 0x016d, "Failed default fwdump template\n"); in qla24xx_load_risc_flash()
7439 qla2x00_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla2x00_load_risc() argument
7446 struct qla_hw_data *ha = vha->hw; in qla2x00_load_risc()
7450 blob = qla2x00_request_firmware(vha); in qla2x00_load_risc()
7452 ql_log(ql_log_info, vha, 0x0083, in qla2x00_load_risc()
7454 ql_log(ql_log_info, vha, 0x0084, in qla2x00_load_risc()
7468 ql_log(ql_log_fatal, vha, 0x0085, in qla2x00_load_risc()
7478 ql_log(ql_log_fatal, vha, 0x0086, in qla2x00_load_risc()
7480 ql_log(ql_log_fatal, vha, 0x0087, in qla2x00_load_risc()
7495 ql_log(ql_log_fatal, vha, 0x0088, in qla2x00_load_risc()
7506 ql_dbg(ql_dbg_init, vha, 0x0089, in qla2x00_load_risc()
7513 rval = qla2x00_load_ram(vha, req->dma, risc_addr, in qla2x00_load_risc()
7516 ql_log(ql_log_fatal, vha, 0x008a, in qla2x00_load_risc()
7538 qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla24xx_load_risc_blob() argument
7549 struct qla_hw_data *ha = vha->hw; in qla24xx_load_risc_blob()
7553 blob = qla2x00_request_firmware(vha); in qla24xx_load_risc_blob()
7555 ql_log(ql_log_warn, vha, 0x0090, in qla24xx_load_risc_blob()
7557 ql_log(ql_log_warn, vha, 0x0091, in qla24xx_load_risc_blob()
7564 ql_dbg(ql_dbg_init, vha, 0x0092, in qla24xx_load_risc_blob()
7577 ql_log(ql_log_fatal, vha, 0x0093, in qla24xx_load_risc_blob()
7588 ql_log(ql_log_fatal, vha, 0x0094, in qla24xx_load_risc_blob()
7591 ql_log(ql_log_fatal, vha, 0x0095, in qla24xx_load_risc_blob()
7605 ql_log(ql_log_fatal, vha, 0x0096, in qla24xx_load_risc_blob()
7617 ql_dbg(ql_dbg_init, vha, 0x0097, in qla24xx_load_risc_blob()
7624 rval = qla2x00_load_ram(vha, req->dma, risc_addr, in qla24xx_load_risc_blob()
7627 ql_log(ql_log_fatal, vha, 0x0098, in qla24xx_load_risc_blob()
7651 ql_dbg(ql_dbg_init, vha, 0x171, in qla24xx_load_risc_blob()
7655 ql_dbg(ql_dbg_init, vha, 0x172, in qla24xx_load_risc_blob()
7661 ql_dbg(ql_dbg_init, vha, 0x0173, in qla24xx_load_risc_blob()
7665 ql_log(ql_log_warn, vha, 0x0174, in qla24xx_load_risc_blob()
7677 ql_log(ql_log_warn, vha, 0x0175, in qla24xx_load_risc_blob()
7683 ql_dbg(ql_dbg_init, vha, 0x0176, in qla24xx_load_risc_blob()
7686 ql_log(ql_log_warn, vha, 0x0177, in qla24xx_load_risc_blob()
7695 ql_log(ql_log_warn, vha, 0x0178, "Using default fwdump template\n"); in qla24xx_load_risc_blob()
7702 ql_dbg(ql_dbg_init, vha, 0x0179, in qla24xx_load_risc_blob()
7706 ql_log(ql_log_warn, vha, 0x017a, in qla24xx_load_risc_blob()
7718 ql_log(ql_log_warn, vha, 0x017b, in qla24xx_load_risc_blob()
7724 ql_dbg(ql_dbg_init, vha, 0x017c, in qla24xx_load_risc_blob()
7730 ql_log(ql_log_warn, vha, 0x017d, "Failed default fwdump template\n"); in qla24xx_load_risc_blob()
7739 qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla24xx_load_risc() argument
7744 return qla81xx_load_risc(vha, srisc_addr); in qla24xx_load_risc()
7751 rval = qla24xx_load_risc_blob(vha, srisc_addr); in qla24xx_load_risc()
7755 return qla24xx_load_risc_flash(vha, srisc_addr, in qla24xx_load_risc()
7756 vha->hw->flt_region_fw); in qla24xx_load_risc()
7760 qla81xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla81xx_load_risc() argument
7763 struct qla_hw_data *ha = vha->hw; in qla81xx_load_risc()
7774 rval = qla24xx_load_risc_flash(vha, srisc_addr, ha->flt_region_fw); in qla81xx_load_risc()
7779 rval = qla24xx_load_risc_blob(vha, srisc_addr); in qla81xx_load_risc()
7783 ql_log(ql_log_info, vha, 0x0099, in qla81xx_load_risc()
7785 rval = qla24xx_load_risc_flash(vha, srisc_addr, ha->flt_region_gold_fw); in qla81xx_load_risc()
7789 ql_log(ql_log_info, vha, 0x009a, "Update operational firmware.\n"); in qla81xx_load_risc()
7795 qla2x00_try_to_stop_firmware(scsi_qla_host_t *vha) in qla2x00_try_to_stop_firmware() argument
7798 struct qla_hw_data *ha = vha->hw; in qla2x00_try_to_stop_firmware()
7809 ret = qla2x00_stop_firmware(vha); in qla2x00_try_to_stop_firmware()
7812 ha->isp_ops->reset_chip(vha); in qla2x00_try_to_stop_firmware()
7813 if (ha->isp_ops->chip_diag(vha) != QLA_SUCCESS) in qla2x00_try_to_stop_firmware()
7815 if (qla2x00_setup_chip(vha) != QLA_SUCCESS) in qla2x00_try_to_stop_firmware()
7817 ql_log(ql_log_info, vha, 0x8015, in qla2x00_try_to_stop_firmware()
7819 ret = qla2x00_stop_firmware(vha); in qla2x00_try_to_stop_firmware()
7827 qla24xx_configure_vhba(scsi_qla_host_t *vha) in qla24xx_configure_vhba() argument
7832 struct qla_hw_data *ha = vha->hw; in qla24xx_configure_vhba()
7837 if (!vha->vp_idx) in qla24xx_configure_vhba()
7841 if (vha->qpair) in qla24xx_configure_vhba()
7842 req = vha->qpair->req; in qla24xx_configure_vhba()
7848 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla24xx_configure_vhba()
7849 qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL); in qla24xx_configure_vhba()
7852 vha->flags.management_server_logged_in = 0; in qla24xx_configure_vhba()
7855 rval2 = ha->isp_ops->fabric_login(vha, NPH_SNS, 0xff, 0xff, 0xfc, mb, in qla24xx_configure_vhba()
7859 ql_dbg(ql_dbg_init, vha, 0x0120, in qla24xx_configure_vhba()
7863 ql_dbg(ql_dbg_init, vha, 0x0103, in qla24xx_configure_vhba()
7870 atomic_set(&vha->loop_down_timer, 0); in qla24xx_configure_vhba()
7871 atomic_set(&vha->loop_state, LOOP_UP); in qla24xx_configure_vhba()
7872 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla24xx_configure_vhba()
7873 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla24xx_configure_vhba()
7885 qla84xx_get_chip(struct scsi_qla_host *vha) in qla84xx_get_chip() argument
7888 struct qla_hw_data *ha = vha->hw; in qla84xx_get_chip()
7928 qla84xx_put_chip(struct scsi_qla_host *vha) in qla84xx_put_chip() argument
7930 struct qla_hw_data *ha = vha->hw; in qla84xx_put_chip()
7936 qla84xx_init_chip(scsi_qla_host_t *vha) in qla84xx_init_chip() argument
7940 struct qla_hw_data *ha = vha->hw; in qla84xx_init_chip()
7944 rval = qla84xx_verify_chip(vha, status); in qla84xx_init_chip()
7955 qla81xx_nvram_config(scsi_qla_host_t *vha) in qla81xx_nvram_config() argument
7964 struct qla_hw_data *ha = vha->hw; in qla81xx_nvram_config()
7978 ha->isp_ops->read_optrom(vha, ha->vpd, ha->flt_region_vpd << 2, in qla81xx_nvram_config()
7982 ha->isp_ops->read_optrom(vha, ha->nvram, ha->flt_region_nvram << 2, in qla81xx_nvram_config()
7988 ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x0111, in qla81xx_nvram_config()
7990 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x0112, in qla81xx_nvram_config()
7998 ql_log(ql_log_info, vha, 0x0073, in qla81xx_nvram_config()
8002 ql_log(ql_log_info, vha, 0x0074, in qla81xx_nvram_config()
8058 qlt_81xx_config_nvram_stage1(vha, nv); in qla81xx_nvram_config()
8097 qla2x00_set_model_info(vha, nv->model_name, sizeof(nv->model_name), in qla81xx_nvram_config()
8100 qlt_81xx_config_nvram_stage2(vha, icb); in qla81xx_nvram_config()
8135 memcpy(vha->node_name, icb->node_name, WWN_SIZE); in qla81xx_nvram_config()
8136 memcpy(vha->port_name, icb->port_name, WWN_SIZE); in qla81xx_nvram_config()
8190 if (!vha->hw->flags.msix_enabled && (IS_QLA83XX(ha) || IS_QLA27XX(ha))) in qla81xx_nvram_config()
8194 if (!vha->flags.init_done) { in qla81xx_nvram_config()
8202 vha->flags.process_response_queue = 0; in qla81xx_nvram_config()
8206 ql_log(ql_log_info, vha, 0x0075, in qla81xx_nvram_config()
8214 vha->flags.process_response_queue = 1; in qla81xx_nvram_config()
8225 ql_dbg(ql_log_info, vha, 0x0075, in qla81xx_nvram_config()
8230 ql_log(ql_log_warn, vha, 0x0076, in qla81xx_nvram_config()
8237 qla82xx_restart_isp(scsi_qla_host_t *vha) in qla82xx_restart_isp() argument
8240 struct qla_hw_data *ha = vha->hw; in qla82xx_restart_isp()
8246 status = qla2x00_init_rings(vha); in qla82xx_restart_isp()
8248 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla82xx_restart_isp()
8251 status = qla2x00_fw_ready(vha); in qla82xx_restart_isp()
8254 qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL); in qla82xx_restart_isp()
8255 vha->flags.online = 1; in qla82xx_restart_isp()
8256 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla82xx_restart_isp()
8260 if ((vha->device_flags & DFLG_NO_CABLE)) in qla82xx_restart_isp()
8265 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla82xx_restart_isp()
8267 if (!atomic_read(&vha->loop_down_timer)) { in qla82xx_restart_isp()
8272 vha->marker_needed = 1; in qla82xx_restart_isp()
8278 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla82xx_restart_isp()
8281 status = qla82xx_check_md_needed(vha); in qla82xx_restart_isp()
8287 rval = qla2x00_enable_fce_trace(vha, in qla82xx_restart_isp()
8291 ql_log(ql_log_warn, vha, 0x8001, in qla82xx_restart_isp()
8300 rval = qla2x00_enable_eft_trace(vha, in qla82xx_restart_isp()
8303 ql_log(ql_log_warn, vha, 0x8010, in qla82xx_restart_isp()
8311 ql_dbg(ql_dbg_taskm, vha, 0x8011, in qla82xx_restart_isp()
8329 ql_log(ql_log_warn, vha, 0x8016, in qla82xx_restart_isp()
8337 qla81xx_update_fw_options(scsi_qla_host_t *vha) in qla81xx_update_fw_options() argument
8339 struct qla_hw_data *ha = vha->hw; in qla81xx_update_fw_options()
8348 ql_dbg(ql_dbg_disc, vha, 0x2103, in qla81xx_update_fw_options()
8355 if (qla_tgt_mode_enabled(vha) || in qla81xx_update_fw_options()
8356 qla_dual_mode_enabled(vha)) in qla81xx_update_fw_options()
8362 if (qla_tgt_mode_enabled(vha) || in qla81xx_update_fw_options()
8363 qla_dual_mode_enabled(vha)) { in qla81xx_update_fw_options()
8383 ql_dbg(ql_dbg_init, vha, 0x00e9, in qla81xx_update_fw_options()
8386 ha->fw_options[3], vha->host->active_mode); in qla81xx_update_fw_options()
8388 qla2x00_set_fw_options(vha, ha->fw_options); in qla81xx_update_fw_options()
8410 qla24xx_get_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport) in qla24xx_get_fcp_prio() argument
8418 struct qla_hw_data *ha = vha->hw; in qla24xx_get_fcp_prio()
8438 pid2 = vha->d_id.b24 & INVALID_PORT_ID; in qla24xx_get_fcp_prio()
8457 wwn1 = wwn_to_u64(vha->port_name); in qla24xx_get_fcp_prio()
8503 qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport) in qla24xx_update_fcport_fcp_prio() argument
8513 priority = qla24xx_get_fcp_prio(vha, fcport); in qla24xx_update_fcport_fcp_prio()
8517 if (IS_P3P_TYPE(vha->hw)) { in qla24xx_update_fcport_fcp_prio()
8522 ret = qla24xx_set_fcp_prio(vha, fcport->loop_id, priority, mb); in qla24xx_update_fcport_fcp_prio()
8525 ql_dbg(ql_dbg_user, vha, 0x709e, in qla24xx_update_fcport_fcp_prio()
8532 ql_dbg(ql_dbg_user, vha, 0x704f, in qla24xx_update_fcport_fcp_prio()
8554 qla24xx_update_all_fcp_prio(scsi_qla_host_t *vha) in qla24xx_update_all_fcp_prio() argument
8561 list_for_each_entry(fcport, &vha->vp_fcports, list) in qla24xx_update_all_fcp_prio()
8562 ret = qla24xx_update_fcport_fcp_prio(vha, fcport); in qla24xx_update_all_fcp_prio()
8567 struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos, in qla2xxx_create_qpair() argument
8573 struct qla_hw_data *ha = vha->hw; in qla2xxx_create_qpair()
8579 ql_log(ql_log_warn, vha, 0x00181, in qla2xxx_create_qpair()
8587 ql_log(ql_log_warn, vha, 0x0182, in qla2xxx_create_qpair()
8593 qpair->hw = vha->hw; in qla2xxx_create_qpair()
8594 qpair->vha = vha; in qla2xxx_create_qpair()
8604 ql_log(ql_log_warn, vha, 0x0183, in qla2xxx_create_qpair()
8625 ql_dbg(ql_dbg_multiq, vha, 0xc00f, in qla2xxx_create_qpair()
8630 ql_log(ql_log_warn, vha, 0x0184, in qla2xxx_create_qpair()
8636 list_add_tail(&qpair->qp_list_elem, &vha->qp_list); in qla2xxx_create_qpair()
8646 ql_log(ql_log_warn, vha, 0x0185, in qla2xxx_create_qpair()
8657 ql_log(ql_log_warn, vha, 0x0186, in qla2xxx_create_qpair()
8675 ql_log(ql_log_warn, vha, 0xd036, in qla2xxx_create_qpair()
8684 if (!vha->flags.qpairs_available) in qla2xxx_create_qpair()
8685 vha->flags.qpairs_available = 1; in qla2xxx_create_qpair()
8687 ql_dbg(ql_dbg_multiq, vha, 0xc00d, in qla2xxx_create_qpair()
8690 ql_dbg(ql_dbg_init, vha, 0x0187, in qla2xxx_create_qpair()
8698 qla25xx_delete_rsp_que(vha, qpair->rsp); in qla2xxx_create_qpair()
8703 if (list_empty(&vha->qp_list)) in qla2xxx_create_qpair()
8704 vha->flags.qpairs_available = 0; in qla2xxx_create_qpair()
8715 int qla2xxx_delete_qpair(struct scsi_qla_host *vha, struct qla_qpair *qpair) in qla2xxx_delete_qpair() argument
8724 ret = qla25xx_delete_req_que(vha, qpair->req); in qla2xxx_delete_qpair()
8728 ret = qla25xx_delete_rsp_que(vha, qpair->rsp); in qla2xxx_delete_qpair()
8737 if (list_empty(&vha->qp_list)) { in qla2xxx_delete_qpair()
8738 vha->flags.qpairs_available = 0; in qla2xxx_delete_qpair()
8739 vha->flags.qpairs_req_created = 0; in qla2xxx_delete_qpair()
8740 vha->flags.qpairs_rsp_created = 0; in qla2xxx_delete_qpair()