Lines Matching refs:vha

380 qla2x00_start_timer(scsi_qla_host_t *vha, unsigned long interval)  in qla2x00_start_timer()  argument
382 timer_setup(&vha->timer, qla2x00_timer, 0); in qla2x00_start_timer()
383 vha->timer.expires = jiffies + interval * HZ; in qla2x00_start_timer()
384 add_timer(&vha->timer); in qla2x00_start_timer()
385 vha->timer_active = 1; in qla2x00_start_timer()
389 qla2x00_restart_timer(scsi_qla_host_t *vha, unsigned long interval) in qla2x00_restart_timer() argument
392 if (vha->device_flags & DFLG_DEV_FAILED) { in qla2x00_restart_timer()
393 ql_dbg(ql_dbg_timer, vha, 0x600d, in qla2x00_restart_timer()
398 mod_timer(&vha->timer, jiffies + interval * HZ); in qla2x00_restart_timer()
402 qla2x00_stop_timer(scsi_qla_host_t *vha) in qla2x00_stop_timer() argument
404 del_timer_sync(&vha->timer); in qla2x00_stop_timer()
405 vha->timer_active = 0; in qla2x00_stop_timer()
420 static void qla_init_base_qpair(struct scsi_qla_host *vha, struct req_que *req, in qla_init_base_qpair() argument
423 struct qla_hw_data *ha = vha->hw; in qla_init_base_qpair()
430 ha->base_qpair->vha = vha; in qla_init_base_qpair()
449 scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev); in qla2x00_alloc_queues() local
454 ql_log(ql_log_fatal, vha, 0x003b, in qla2x00_alloc_queues()
462 ql_log(ql_log_fatal, vha, 0x003c, in qla2x00_alloc_queues()
469 ql_log(ql_log_warn, vha, 0x00e0, in qla2x00_alloc_queues()
474 qla_init_base_qpair(vha, req, rsp); in qla2x00_alloc_queues()
480 ql_log(ql_log_fatal, vha, 0x0180, in qla2x00_alloc_queues()
602 qla2x00_pci_info_str(struct scsi_qla_host *vha, char *str, size_t str_len) in qla2x00_pci_info_str() argument
604 struct qla_hw_data *ha = vha->hw; in qla2x00_pci_info_str()
623 qla24xx_pci_info_str(struct scsi_qla_host *vha, char *str, size_t str_len) in qla24xx_pci_info_str() argument
628 struct qla_hw_data *ha = vha->hw; in qla24xx_pci_info_str()
674 qla2x00_fw_version_str(struct scsi_qla_host *vha, char *str, size_t size) in qla2x00_fw_version_str() argument
677 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_version_str()
712 qla24xx_fw_version_str(struct scsi_qla_host *vha, char *str, size_t size) in qla24xx_fw_version_str() argument
714 struct qla_hw_data *ha = vha->hw; in qla24xx_fw_version_str()
723 struct qla_hw_data *ha = sp->vha->hw; in qla2x00_sp_free_dma()
781 struct qla_hw_data *ha = sp->fcport->vha->hw; in qla2xxx_qpair_sp_free_dma()
823 ql_dbg(ql_dbg_tgt+ql_dbg_verbose, sp->vha, 0xe022, in qla2xxx_qpair_sp_free_dma()
829 ql_dbg(ql_dbg_tgt+ql_dbg_verbose, sp->vha, 0xe022, in qla2xxx_qpair_sp_free_dma()
875 scsi_qla_host_t *vha = shost_priv(host); in qla2xxx_queuecommand() local
878 struct qla_hw_data *ha = vha->hw; in qla2xxx_queuecommand()
904 ql_dbg(ql_dbg_aer, vha, 0x9010, in qla2xxx_queuecommand()
909 ql_dbg(ql_dbg_aer, vha, 0x9011, in qla2xxx_queuecommand()
919 ql_dbg(ql_dbg_io + ql_dbg_verbose, vha, 0x3003, in qla2xxx_queuecommand()
925 if (!vha->flags.difdix_supported && in qla2xxx_queuecommand()
927 ql_dbg(ql_dbg_io, vha, 0x3004, in qla2xxx_queuecommand()
942 ql_dbg(ql_dbg_io, vha, 0x3005, in qla2xxx_queuecommand()
965 qla2xxx_init_sp(sp, vha, vha->hw->base_qpair, fcport); in qla2xxx_queuecommand()
974 ql_dbg(ql_dbg_io + ql_dbg_verbose, vha, 0x3013, in qla2xxx_queuecommand()
999 scsi_qla_host_t *vha = shost_priv(host); in qla2xxx_mqueuecommand() local
1002 struct qla_hw_data *ha = vha->hw; in qla2xxx_mqueuecommand()
1010 ql_dbg(ql_dbg_io + ql_dbg_verbose, vha, 0x3076, in qla2xxx_mqueuecommand()
1017 ql_dbg(ql_dbg_io, vha, 0x3077, in qla2xxx_mqueuecommand()
1031 ql_dbg(ql_dbg_io, vha, 0x3077, in qla2xxx_mqueuecommand()
1054 qla2xxx_init_sp(sp, vha, qpair, fcport); in qla2xxx_mqueuecommand()
1063 ql_dbg(ql_dbg_io + ql_dbg_verbose, vha, 0x3078, in qla2xxx_mqueuecommand()
1101 qla2x00_wait_for_hba_online(scsi_qla_host_t *vha) in qla2x00_wait_for_hba_online() argument
1105 struct qla_hw_data *ha = vha->hw; in qla2x00_wait_for_hba_online()
1124 static inline int test_fcport_count(scsi_qla_host_t *vha) in test_fcport_count() argument
1126 struct qla_hw_data *ha = vha->hw; in test_fcport_count()
1132 ql_dbg(ql_dbg_init, vha, 0x00ec, in test_fcport_count()
1134 vha, vha->fcport_count); in test_fcport_count()
1135 res = (vha->fcport_count == 0); in test_fcport_count()
1139 list_for_each_entry(fcport, &vha->vp_fcports, list) { in test_fcport_count()
1161 qla2x00_wait_for_sess_deletion(scsi_qla_host_t *vha) in qla2x00_wait_for_sess_deletion() argument
1165 qla2x00_mark_all_devices_lost(vha); in qla2x00_wait_for_sess_deletion()
1168 if (wait_event_timeout(vha->fcport_waitQ, in qla2x00_wait_for_sess_deletion()
1169 test_fcport_count(vha), HZ) > 0) in qla2x00_wait_for_sess_deletion()
1173 flush_workqueue(vha->hw->wq); in qla2x00_wait_for_sess_deletion()
1189 qla2x00_wait_for_hba_ready(scsi_qla_host_t *vha) in qla2x00_wait_for_hba_ready() argument
1191 struct qla_hw_data *ha = vha->hw; in qla2x00_wait_for_hba_ready()
1194 while ((qla2x00_reset_active(vha) || ha->dpc_active || in qla2x00_wait_for_hba_ready()
1196 test_bit(FX00_RESET_RECOVERY, &vha->dpc_flags) || in qla2x00_wait_for_hba_ready()
1197 test_bit(FX00_TARGET_SCAN, &vha->dpc_flags)) { in qla2x00_wait_for_hba_ready()
1205 qla2x00_wait_for_chip_reset(scsi_qla_host_t *vha) in qla2x00_wait_for_chip_reset() argument
1209 struct qla_hw_data *ha = vha->hw; in qla2x00_wait_for_chip_reset()
1250 scsi_qla_host_t *vha = shost_priv(cmd->device->host); in qla2xxx_eh_abort() local
1257 struct qla_hw_data *ha = vha->hw; in qla2xxx_eh_abort()
1264 ql_log(ql_log_info, vha, 0x8042, in qla2xxx_eh_abort()
1266 qla_pci_set_eeh_busy(vha); in qla2xxx_eh_abort()
1278 vha->cmd_timeout_cnt++; in qla2xxx_eh_abort()
1291 ql_dbg(ql_dbg_taskm, vha, 0x8002, in qla2xxx_eh_abort()
1293 vha->host_no, id, lun, sp, cmd, sp->handle); in qla2xxx_eh_abort()
1302 ql_dbg(ql_dbg_taskm, vha, 0x8003, in qla2xxx_eh_abort()
1311 ql_dbg(ql_dbg_taskm, vha, 0xffff, in qla2xxx_eh_abort()
1326 ql_log(ql_log_info, vha, 0x801c, in qla2xxx_eh_abort()
1328 vha->host_no, id, lun, ret); in qla2xxx_eh_abort()
1345 scsi_qla_host_t *vha = qpair->vha; in __qla2x00_eh_wait_for_pending_commands() local
1351 struct qla_hw_data *ha = vha->hw; in __qla2x00_eh_wait_for_pending_commands()
1365 if (vha->vp_idx != sp->vha->vp_idx) in __qla2x00_eh_wait_for_pending_commands()
1394 ql_dbg(ql_dbg_taskm, vha, 0x8005, in __qla2x00_eh_wait_for_pending_commands()
1421 qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t, in qla2x00_eh_wait_for_pending_commands() argument
1425 struct qla_hw_data *ha = vha->hw; in qla2x00_eh_wait_for_pending_commands()
1451 scsi_qla_host_t *vha = shost_priv(sdev->host); in qla2xxx_eh_device_reset() local
1454 struct qla_hw_data *ha = vha->hw; in qla2xxx_eh_device_reset()
1458 ql_log(ql_log_info, vha, 0x803e, in qla2xxx_eh_device_reset()
1460 qla_pci_set_eeh_busy(vha); in qla2xxx_eh_device_reset()
1475 ql_log(ql_log_info, vha, 0x8009, in qla2xxx_eh_device_reset()
1476 "DEVICE RESET ISSUED nexus=%ld:%d:%llu cmd=%p.\n", vha->host_no, in qla2xxx_eh_device_reset()
1480 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2xxx_eh_device_reset()
1481 ql_log(ql_log_warn, vha, 0x800a, in qla2xxx_eh_device_reset()
1488 ql_log(ql_log_warn, vha, 0x800c, in qla2xxx_eh_device_reset()
1493 if (qla2x00_eh_wait_for_pending_commands(vha, fcport->d_id.b24, in qla2xxx_eh_device_reset()
1496 ql_log(ql_log_warn, vha, 0x800d, in qla2xxx_eh_device_reset()
1501 ql_log(ql_log_info, vha, 0x800e, in qla2xxx_eh_device_reset()
1503 vha->host_no, sdev->id, sdev->lun, cmd); in qla2xxx_eh_device_reset()
1508 ql_log(ql_log_info, vha, 0x800f, in qla2xxx_eh_device_reset()
1510 reset_errors[err], vha->host_no, sdev->id, sdev->lun, in qla2xxx_eh_device_reset()
1512 vha->reset_cmd_err_cnt++; in qla2xxx_eh_device_reset()
1521 scsi_qla_host_t *vha = shost_priv(rport_to_shost(rport)); in qla2xxx_eh_target_reset() local
1522 struct qla_hw_data *ha = vha->hw; in qla2xxx_eh_target_reset()
1527 ql_log(ql_log_info, vha, 0x803f, in qla2xxx_eh_target_reset()
1529 qla_pci_set_eeh_busy(vha); in qla2xxx_eh_target_reset()
1544 ql_log(ql_log_info, vha, 0x8009, in qla2xxx_eh_target_reset()
1545 "TARGET RESET ISSUED nexus=%ld:%d cmd=%p.\n", vha->host_no, in qla2xxx_eh_target_reset()
1549 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2xxx_eh_target_reset()
1550 ql_log(ql_log_warn, vha, 0x800a, in qla2xxx_eh_target_reset()
1556 ql_log(ql_log_warn, vha, 0x800c, in qla2xxx_eh_target_reset()
1561 if (qla2x00_eh_wait_for_pending_commands(vha, fcport->d_id.b24, 0, in qla2xxx_eh_target_reset()
1563 ql_log(ql_log_warn, vha, 0x800d, in qla2xxx_eh_target_reset()
1568 ql_log(ql_log_info, vha, 0x800e, in qla2xxx_eh_target_reset()
1570 vha->host_no, sdev->id, cmd); in qla2xxx_eh_target_reset()
1575 ql_log(ql_log_info, vha, 0x800f, in qla2xxx_eh_target_reset()
1577 reset_errors[err], vha->host_no, cmd->device->id, cmd->device->lun, in qla2xxx_eh_target_reset()
1579 vha->reset_cmd_err_cnt++; in qla2xxx_eh_target_reset()
1601 scsi_qla_host_t *vha = shost_priv(cmd->device->host); in qla2xxx_eh_bus_reset() local
1605 struct qla_hw_data *ha = vha->hw; in qla2xxx_eh_bus_reset()
1608 ql_log(ql_log_info, vha, 0x8040, in qla2xxx_eh_bus_reset()
1610 qla_pci_set_eeh_busy(vha); in qla2xxx_eh_bus_reset()
1617 if (qla2x00_chip_is_down(vha)) in qla2xxx_eh_bus_reset()
1620 ql_log(ql_log_info, vha, 0x8012, in qla2xxx_eh_bus_reset()
1621 "BUS RESET ISSUED nexus=%ld:%d:%llu.\n", vha->host_no, id, lun); in qla2xxx_eh_bus_reset()
1623 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2xxx_eh_bus_reset()
1624 ql_log(ql_log_fatal, vha, 0x8013, in qla2xxx_eh_bus_reset()
1629 if (qla2x00_loop_reset(vha) == QLA_SUCCESS) in qla2xxx_eh_bus_reset()
1636 if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0, WAIT_HOST) != in qla2xxx_eh_bus_reset()
1638 ql_log(ql_log_warn, vha, 0x8014, in qla2xxx_eh_bus_reset()
1644 ql_log(ql_log_warn, vha, 0x802b, in qla2xxx_eh_bus_reset()
1646 (ret == FAILED) ? "FAILED" : "SUCCEEDED", vha->host_no, id, lun); in qla2xxx_eh_bus_reset()
1669 scsi_qla_host_t *vha = shost_priv(cmd->device->host); in qla2xxx_eh_host_reset() local
1670 struct qla_hw_data *ha = vha->hw; in qla2xxx_eh_host_reset()
1677 ql_log(ql_log_info, vha, 0x8041, in qla2xxx_eh_host_reset()
1679 qla_pci_set_eeh_busy(vha); in qla2xxx_eh_host_reset()
1686 ql_log(ql_log_info, vha, 0x8018, in qla2xxx_eh_host_reset()
1687 "ADAPTER RESET ISSUED nexus=%ld:%d:%llu.\n", vha->host_no, id, lun); in qla2xxx_eh_host_reset()
1693 if (qla2x00_reset_active(vha) || ha->optrom_state != QLA_SWAITING) in qla2xxx_eh_host_reset()
1696 if (vha != base_vha) { in qla2xxx_eh_host_reset()
1697 if (qla2x00_vp_abort_isp(vha)) in qla2xxx_eh_host_reset()
1700 if (IS_P3P_TYPE(vha->hw)) { in qla2xxx_eh_host_reset()
1701 if (!qla82xx_fcoe_ctx_reset(vha)) { in qla2xxx_eh_host_reset()
1717 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2xxx_eh_host_reset()
1718 ql_log(ql_log_warn, vha, 0x802a, in qla2xxx_eh_host_reset()
1727 if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0, WAIT_HOST) == in qla2xxx_eh_host_reset()
1732 ql_log(ql_log_info, vha, 0x8017, in qla2xxx_eh_host_reset()
1734 (ret == FAILED) ? "FAILED" : "SUCCEEDED", vha->host_no, id, lun); in qla2xxx_eh_host_reset()
1750 qla2x00_loop_reset(scsi_qla_host_t *vha) in qla2x00_loop_reset() argument
1753 struct qla_hw_data *ha = vha->hw; in qla2x00_loop_reset()
1759 atomic_set(&vha->loop_state, LOOP_DOWN); in qla2x00_loop_reset()
1760 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); in qla2x00_loop_reset()
1761 qla2x00_mark_all_devices_lost(vha); in qla2x00_loop_reset()
1762 ret = qla2x00_full_login_lip(vha); in qla2x00_loop_reset()
1764 ql_dbg(ql_dbg_taskm, vha, 0x802d, in qla2x00_loop_reset()
1770 ret = qla2x00_lip_reset(vha); in qla2x00_loop_reset()
1772 ql_dbg(ql_dbg_taskm, vha, 0x802e, in qla2x00_loop_reset()
1777 vha->marker_needed = 1; in qla2x00_loop_reset()
1792 scsi_qla_host_t *vha = qp->vha; in qla2x00_abort_srb() local
1793 struct qla_hw_data *ha = vha->hw; in qla2x00_abort_srb()
1801 if (qla2x00_chip_is_down(vha)) { in qla2x00_abort_srb()
1808 !test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) && in qla2x00_abort_srb()
1826 ql_dbg(ql_dbg_taskm, vha, 0xffff, in qla2x00_abort_srb()
1864 scsi_qla_host_t *vha = qp->vha; in __qla2x00_abort_all_cmds() local
1865 struct qla_hw_data *ha = vha->hw; in __qla2x00_abort_all_cmds()
1867 struct qla_tgt *tgt = vha->vha_tgt.qla_tgt; in __qla2x00_abort_all_cmds()
1880 if (qla2x00_chip_is_down(vha)) { in __qla2x00_abort_all_cmds()
1893 if (!vha->hw->tgt.tgt_ops || !tgt || in __qla2x00_abort_all_cmds()
1894 qla_ini_mode_enabled(vha)) { in __qla2x00_abort_all_cmds()
1895 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf003, in __qla2x00_abort_all_cmds()
1897 vha->dpc_flags); in __qla2x00_abort_all_cmds()
1920 qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) in qla2x00_abort_all_cmds() argument
1923 struct qla_hw_data *ha = vha->hw; in qla2x00_abort_all_cmds()
1956 scsi_qla_host_t *vha = shost_priv(sdev->host); in qla2xxx_slave_configure() local
1957 struct req_que *req = vha->req; in qla2xxx_slave_configure()
1959 if (IS_T10_PI_CAPABLE(vha->hw)) in qla2xxx_slave_configure()
2830 scsi_qla_host_t *vha = shost_priv(shost); in qla2xxx_scan_start() local
2832 if (vha->hw->flags.running_gold_fw) in qla2xxx_scan_start()
2835 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2xxx_scan_start()
2836 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2xxx_scan_start()
2837 set_bit(RSCN_UPDATE, &vha->dpc_flags); in qla2xxx_scan_start()
2838 set_bit(NPIV_CONFIG_NEEDED, &vha->dpc_flags); in qla2xxx_scan_start()
2844 scsi_qla_host_t *vha = shost_priv(shost); in qla2xxx_scan_finished() local
2846 if (test_bit(UNLOADING, &vha->dpc_flags)) in qla2xxx_scan_finished()
2848 if (!vha->host) in qla2xxx_scan_finished()
2850 if (time > vha->hw->loop_reset_delay * HZ) in qla2xxx_scan_finished()
2853 return atomic_read(&vha->loop_state) == LOOP_READY; in qla2xxx_scan_finished()
2868 struct scsi_qla_host *vha = container_of(work, in qla2x00_iocb_work_fn() local
2870 struct qla_hw_data *ha = vha->hw; in qla2x00_iocb_work_fn()
2878 while (!list_empty(&vha->work_list) && i > 0) { in qla2x00_iocb_work_fn()
2879 qla2x00_do_work(vha); in qla2x00_iocb_work_fn()
2883 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_iocb_work_fn()
2884 clear_bit(IOCB_WORK_ACTIVE, &vha->dpc_flags); in qla2x00_iocb_work_fn()
2885 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_iocb_work_fn()
3278 ha->mr.fcport.vha = base_vha; in qla2x00_probe_one()
3712 scsi_qla_host_t *vha; in qla2x00_shutdown() local
3715 vha = pci_get_drvdata(pdev); in qla2x00_shutdown()
3716 ha = vha->hw; in qla2x00_shutdown()
3718 ql_log(ql_log_info, vha, 0xfffa, in qla2x00_shutdown()
3725 __qla_set_remove_flag(vha); in qla2x00_shutdown()
3733 qlafx00_driver_shutdown(vha, 20); in qla2x00_shutdown()
3737 qla2x00_disable_fce_trace(vha, NULL, NULL); in qla2x00_shutdown()
3743 qla2x00_disable_eft_trace(vha); in qla2x00_shutdown()
3748 qla2x00_abort_isp_cleanup(vha); in qla2x00_shutdown()
3751 qla2x00_try_to_stop_firmware(vha); in qla2x00_shutdown()
3755 if (vha->timer_active) in qla2x00_shutdown()
3756 qla2x00_stop_timer(vha); in qla2x00_shutdown()
3759 vha->flags.online = 0; in qla2x00_shutdown()
3763 vha->flags.init_done = 0; in qla2x00_shutdown()
3767 qla2x00_free_irqs(vha); in qla2x00_shutdown()
3772 ql_log(ql_log_info, vha, 0xfffe, in qla2x00_shutdown()
3780 scsi_qla_host_t *vha; in qla2x00_delete_all_vps() local
3789 vha = list_first_entry(&base_vha->list, scsi_qla_host_t, list); in qla2x00_delete_all_vps()
3790 scsi_host_get(vha->host); in qla2x00_delete_all_vps()
3795 qla_nvme_delete(vha); in qla2x00_delete_all_vps()
3797 fc_vport_terminate(vha->fc_vport); in qla2x00_delete_all_vps()
3798 scsi_host_put(vha->host); in qla2x00_delete_all_vps()
3995 if (item == &item->vha->default_item) in qla24xx_free_purex_list()
4003 qla2x00_free_device(scsi_qla_host_t *vha) in qla2x00_free_device() argument
4005 struct qla_hw_data *ha = vha->hw; in qla2x00_free_device()
4007 qla2x00_abort_all_cmds(vha, DID_NO_CONNECT << 16); in qla2x00_free_device()
4010 if (vha->timer_active) in qla2x00_free_device()
4011 qla2x00_stop_timer(vha); in qla2x00_free_device()
4013 qla25xx_delete_queues(vha); in qla2x00_free_device()
4014 vha->flags.online = 0; in qla2x00_free_device()
4018 vha->flags.init_done = 0; in qla2x00_free_device()
4022 qla2x00_free_fcports(vha); in qla2x00_free_device()
4024 qla2x00_free_irqs(vha); in qla2x00_free_device()
4033 qla24xx_free_purex_list(&vha->purex_list); in qla2x00_free_device()
4037 qla82xx_md_free(vha); in qla2x00_free_device()
4045 void qla2x00_free_fcports(struct scsi_qla_host *vha) in qla2x00_free_fcports() argument
4049 list_for_each_entry_safe(fcport, tfcport, &vha->vp_fcports, list) in qla2x00_free_fcports()
4054 qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport) in qla2x00_schedule_rport_del() argument
4062 ql_dbg(ql_dbg_disc, fcport->vha, 0x2109, in qla2x00_schedule_rport_del()
4068 qlt_do_generation_tick(vha, &now); in qla2x00_schedule_rport_del()
4080 void qla2x00_mark_device_lost(scsi_qla_host_t *vha, fc_port_t *fcport, in qla2x00_mark_device_lost() argument
4083 if (IS_QLAFX00(vha->hw)) { in qla2x00_mark_device_lost()
4085 qla2x00_schedule_rport_del(vha, fcport); in qla2x00_mark_device_lost()
4090 vha->vp_idx == fcport->vha->vp_idx) { in qla2x00_mark_device_lost()
4092 qla2x00_schedule_rport_del(vha, fcport); in qla2x00_mark_device_lost()
4105 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla2x00_mark_device_lost()
4109 qla2x00_mark_all_devices_lost(scsi_qla_host_t *vha) in qla2x00_mark_all_devices_lost() argument
4113 ql_dbg(ql_dbg_disc, vha, 0x20f1, in qla2x00_mark_all_devices_lost()
4116 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_mark_all_devices_lost()
4121 !qla2x00_reset_active(vha)) { in qla2x00_mark_all_devices_lost()
4122 ql_dbg(ql_dbg_disc, vha, 0x211a, in qla2x00_mark_all_devices_lost()
4611 qla2x00_set_exlogins_buffer(scsi_qla_host_t *vha) in qla2x00_set_exlogins_buffer() argument
4616 struct qla_hw_data *ha = vha->hw; in qla2x00_set_exlogins_buffer()
4625 ql_log(ql_log_info, vha, 0xd021, "EXLOGIN count: %d.\n", ql2xexlogins); in qla2x00_set_exlogins_buffer()
4627 rval = qla_get_exlogin_status(vha, &size, &max_cnt); in qla2x00_set_exlogins_buffer()
4641 ql_log(ql_log_info, vha, 0xd024, in qla2x00_set_exlogins_buffer()
4645 ql_log(ql_log_info, vha, 0xd025, in qla2x00_set_exlogins_buffer()
4659 rval = qla_set_exlogin_mem_cfg(vha, ha->exlogin_buf_dma); in qla2x00_set_exlogins_buffer()
4661 ql_log(ql_log_fatal, vha, 0xd033, in qla2x00_set_exlogins_buffer()
4687 qla2x00_number_of_exch(scsi_qla_host_t *vha, u32 *ret_cnt, u16 max_cnt) in qla2x00_number_of_exch() argument
4690 struct init_cb_81xx *icb = (struct init_cb_81xx *)&vha->hw->init_cb; in qla2x00_number_of_exch()
4693 if (max_cnt > vha->hw->max_exchg) in qla2x00_number_of_exch()
4694 max_cnt = vha->hw->max_exchg; in qla2x00_number_of_exch()
4696 if (qla_ini_mode_enabled(vha)) { in qla2x00_number_of_exch()
4697 if (vha->ql2xiniexchg > max_cnt) in qla2x00_number_of_exch()
4698 vha->ql2xiniexchg = max_cnt; in qla2x00_number_of_exch()
4700 if (vha->ql2xiniexchg > FW_DEF_EXCHANGES_CNT) in qla2x00_number_of_exch()
4701 *ret_cnt = vha->ql2xiniexchg; in qla2x00_number_of_exch()
4703 } else if (qla_tgt_mode_enabled(vha)) { in qla2x00_number_of_exch()
4704 if (vha->ql2xexchoffld > max_cnt) { in qla2x00_number_of_exch()
4705 vha->ql2xexchoffld = max_cnt; in qla2x00_number_of_exch()
4706 icb->exchange_count = cpu_to_le16(vha->ql2xexchoffld); in qla2x00_number_of_exch()
4709 if (vha->ql2xexchoffld > FW_DEF_EXCHANGES_CNT) in qla2x00_number_of_exch()
4710 *ret_cnt = vha->ql2xexchoffld; in qla2x00_number_of_exch()
4711 } else if (qla_dual_mode_enabled(vha)) { in qla2x00_number_of_exch()
4712 temp = vha->ql2xiniexchg + vha->ql2xexchoffld; in qla2x00_number_of_exch()
4714 vha->ql2xiniexchg -= (temp - max_cnt)/2; in qla2x00_number_of_exch()
4715 vha->ql2xexchoffld -= (((temp - max_cnt)/2) + 1); in qla2x00_number_of_exch()
4717 icb->exchange_count = cpu_to_le16(vha->ql2xexchoffld); in qla2x00_number_of_exch()
4726 qla2x00_set_exchoffld_buffer(scsi_qla_host_t *vha) in qla2x00_set_exchoffld_buffer() argument
4731 struct qla_hw_data *ha = vha->hw; in qla2x00_set_exchoffld_buffer()
4740 rval = qla_get_exchoffld_status(vha, &size, &max_cnt); in qla2x00_set_exchoffld_buffer()
4747 qla2x00_number_of_exch(vha, &actual_cnt, max_cnt); in qla2x00_set_exchoffld_buffer()
4748 ql_log(ql_log_info, vha, 0xd014, in qla2x00_set_exchoffld_buffer()
4763 ql_log(ql_log_info, vha, 0xd016, in qla2x00_set_exchoffld_buffer()
4767 ql_log(ql_log_info, vha, 0xd017, in qla2x00_set_exchoffld_buffer()
4798 ql_log(ql_log_info, vha, 0xd016, in qla2x00_set_exchoffld_buffer()
4805 rval = qla_set_exchoffld_mem_cfg(vha); in qla2x00_set_exchoffld_buffer()
4807 ql_log(ql_log_fatal, vha, 0xd02e, in qla2x00_set_exchoffld_buffer()
4814 if (qla_ini_mode_enabled(vha)) in qla2x00_set_exchoffld_buffer()
4817 icb->exchange_count = cpu_to_le16(vha->ql2xexchoffld); in qla2x00_set_exchoffld_buffer()
5058 struct scsi_qla_host *vha = NULL; in qla2x00_create_host() local
5068 vha = shost_priv(host); in qla2x00_create_host()
5069 memset(vha, 0, sizeof(scsi_qla_host_t)); in qla2x00_create_host()
5071 vha->host = host; in qla2x00_create_host()
5072 vha->host_no = host->host_no; in qla2x00_create_host()
5073 vha->hw = ha; in qla2x00_create_host()
5075 vha->qlini_mode = ql2x_ini_mode; in qla2x00_create_host()
5076 vha->ql2xexchoffld = ql2xexchoffld; in qla2x00_create_host()
5077 vha->ql2xiniexchg = ql2xiniexchg; in qla2x00_create_host()
5079 INIT_LIST_HEAD(&vha->vp_fcports); in qla2x00_create_host()
5080 INIT_LIST_HEAD(&vha->work_list); in qla2x00_create_host()
5081 INIT_LIST_HEAD(&vha->list); in qla2x00_create_host()
5082 INIT_LIST_HEAD(&vha->qla_cmd_list); in qla2x00_create_host()
5083 INIT_LIST_HEAD(&vha->logo_list); in qla2x00_create_host()
5084 INIT_LIST_HEAD(&vha->plogi_ack_list); in qla2x00_create_host()
5085 INIT_LIST_HEAD(&vha->qp_list); in qla2x00_create_host()
5086 INIT_LIST_HEAD(&vha->gnl.fcports); in qla2x00_create_host()
5087 INIT_WORK(&vha->iocb_work, qla2x00_iocb_work_fn); in qla2x00_create_host()
5089 INIT_LIST_HEAD(&vha->purex_list.head); in qla2x00_create_host()
5090 spin_lock_init(&vha->purex_list.lock); in qla2x00_create_host()
5092 spin_lock_init(&vha->work_lock); in qla2x00_create_host()
5093 spin_lock_init(&vha->cmd_list_lock); in qla2x00_create_host()
5094 init_waitqueue_head(&vha->fcport_waitQ); in qla2x00_create_host()
5095 init_waitqueue_head(&vha->vref_waitq); in qla2x00_create_host()
5096 qla_enode_init(vha); in qla2x00_create_host()
5097 qla_edb_init(vha); in qla2x00_create_host()
5100 vha->gnl.size = sizeof(struct get_name_list_extended) * in qla2x00_create_host()
5102 vha->gnl.l = dma_alloc_coherent(&ha->pdev->dev, in qla2x00_create_host()
5103 vha->gnl.size, &vha->gnl.ldma, GFP_KERNEL); in qla2x00_create_host()
5104 if (!vha->gnl.l) { in qla2x00_create_host()
5105 ql_log(ql_log_fatal, vha, 0xd04a, in qla2x00_create_host()
5107 scsi_host_put(vha->host); in qla2x00_create_host()
5112 vha->scan.size = ha->max_fibre_devices * sizeof(struct fab_scan_rp); in qla2x00_create_host()
5113 vha->scan.l = vmalloc(vha->scan.size); in qla2x00_create_host()
5114 if (!vha->scan.l) { in qla2x00_create_host()
5115 ql_log(ql_log_fatal, vha, 0xd04a, in qla2x00_create_host()
5117 dma_free_coherent(&ha->pdev->dev, vha->gnl.size, in qla2x00_create_host()
5118 vha->gnl.l, vha->gnl.ldma); in qla2x00_create_host()
5119 vha->gnl.l = NULL; in qla2x00_create_host()
5120 scsi_host_put(vha->host); in qla2x00_create_host()
5123 INIT_DELAYED_WORK(&vha->scan.scan_work, qla_scan_work_fn); in qla2x00_create_host()
5125 snprintf(vha->host_str, sizeof(vha->host_str), "%s_%lu", in qla2x00_create_host()
5126 QLA2XXX_DRIVER_NAME, vha->host_no); in qla2x00_create_host()
5127 ql_dbg(ql_dbg_init, vha, 0x0041, in qla2x00_create_host()
5129 vha->host, vha->hw, vha, in qla2x00_create_host()
5132 return vha; in qla2x00_create_host()
5136 qla2x00_alloc_work(struct scsi_qla_host *vha, enum qla_work_type type) in qla2x00_alloc_work() argument
5140 if (test_bit(UNLOADING, &vha->dpc_flags)) in qla2x00_alloc_work()
5143 if (qla_vha_mark_busy(vha)) in qla2x00_alloc_work()
5148 QLA_VHA_MARK_NOT_BUSY(vha); in qla2x00_alloc_work()
5159 qla2x00_post_work(struct scsi_qla_host *vha, struct qla_work_evt *e) in qla2x00_post_work() argument
5164 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_post_work()
5165 list_add_tail(&e->list, &vha->work_list); in qla2x00_post_work()
5167 if (!test_and_set_bit(IOCB_WORK_ACTIVE, &vha->dpc_flags)) in qla2x00_post_work()
5170 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_post_work()
5173 queue_work(vha->hw->wq, &vha->iocb_work); in qla2x00_post_work()
5179 qla2x00_post_aen_work(struct scsi_qla_host *vha, enum fc_host_event_code code, in qla2x00_post_aen_work() argument
5184 e = qla2x00_alloc_work(vha, QLA_EVT_AEN); in qla2x00_post_aen_work()
5190 return qla2x00_post_work(vha, e); in qla2x00_post_aen_work()
5194 qla2x00_post_idc_ack_work(struct scsi_qla_host *vha, uint16_t *mb) in qla2x00_post_idc_ack_work() argument
5198 e = qla2x00_alloc_work(vha, QLA_EVT_IDC_ACK); in qla2x00_post_idc_ack_work()
5203 return qla2x00_post_work(vha, e); in qla2x00_post_idc_ack_work()
5208 struct scsi_qla_host *vha, \
5213 e = qla2x00_alloc_work(vha, type); \
5223 return qla2x00_post_work(vha, e); \
5233 qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code) in qla2x00_post_uevent_work() argument
5237 e = qla2x00_alloc_work(vha, QLA_EVT_UEVENT); in qla2x00_post_uevent_work()
5242 return qla2x00_post_work(vha, e); in qla2x00_post_uevent_work()
5246 qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code) in qla2x00_uevent_emit() argument
5254 vha->host_no); in qla2x00_uevent_emit()
5260 kobject_uevent_env(&vha->hw->pdev->dev.kobj, KOBJ_CHANGE, envp); in qla2x00_uevent_emit()
5264 qlafx00_post_aenfx_work(struct scsi_qla_host *vha, uint32_t evtcode, in qlafx00_post_aenfx_work() argument
5269 e = qla2x00_alloc_work(vha, QLA_EVT_AENFX); in qlafx00_post_aenfx_work()
5276 return qla2x00_post_work(vha, e); in qlafx00_post_aenfx_work()
5286 spin_lock_irqsave(&fcport->vha->work_lock, flags); in qla24xx_sched_upd_fcport()
5288 spin_unlock_irqrestore(&fcport->vha->work_lock, flags); in qla24xx_sched_upd_fcport()
5295 spin_unlock_irqrestore(&fcport->vha->work_lock, flags); in qla24xx_sched_upd_fcport()
5301 void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) in qla24xx_create_new_sess() argument
5309 ql_dbg(ql_dbg_disc, vha, 0xffff, in qla24xx_create_new_sess()
5313 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_create_new_sess()
5314 fcport = qla2x00_find_fcport_by_wwpn(vha, e->u.new_sess.port_name, 1); in qla24xx_create_new_sess()
5322 qlt_plogi_ack_link(vha, pla, fcport, QLT_PLOGI_LINK_SAME_WWN); in qla24xx_create_new_sess()
5329 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_create_new_sess()
5330 fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla24xx_create_new_sess()
5341 if (NVME_PRIORITY(vha->hw, fcport)) in qla24xx_create_new_sess()
5351 if (vha->flags.nvme_enabled) in qla24xx_create_new_sess()
5356 ql_dbg(ql_dbg_disc, vha, 0xffff, in qla24xx_create_new_sess()
5367 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_create_new_sess()
5369 tfcp = qla2x00_find_fcport_by_wwpn(vha, in qla24xx_create_new_sess()
5373 ql_dbg(ql_dbg_disc, vha, 0xffff, in qla24xx_create_new_sess()
5380 list_add_tail(&fcport->list, &vha->vp_fcports); in qla24xx_create_new_sess()
5384 qlt_plogi_ack_link(vha, pla, fcport, in qla24xx_create_new_sess()
5389 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_create_new_sess()
5394 fcport->chip_reset = vha->hw->base_qpair->chip_reset; in qla24xx_create_new_sess()
5419 qlt_plogi_ack_unref(vha, pla); in qla24xx_create_new_sess()
5423 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla24xx_create_new_sess()
5424 tfcp = qla2x00_find_fcport_by_nportid(vha, in qla24xx_create_new_sess()
5430 ql_dbg(ql_dbg_disc, vha, 0xffff, in qla24xx_create_new_sess()
5449 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla24xx_create_new_sess()
5453 if (N2N_TOPO(vha->hw)) { in qla24xx_create_new_sess()
5456 if (vha->flags.nvme_enabled) { in qla24xx_create_new_sess()
5463 schedule_delayed_work(&vha->scan.scan_work, 5); in qla24xx_create_new_sess()
5465 qla24xx_fcport_handle_login(vha, fcport); in qla24xx_create_new_sess()
5479 static void qla_sp_retry(struct scsi_qla_host *vha, struct qla_work_evt *e) in qla_sp_retry() argument
5486 ql_dbg(ql_dbg_disc, vha, 0x2043, in qla_sp_retry()
5489 qla24xx_sp_unmap(vha, sp); in qla_sp_retry()
5494 qla2x00_do_work(struct scsi_qla_host *vha) in qla2x00_do_work() argument
5501 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_do_work()
5502 list_splice_init(&vha->work_list, &work); in qla2x00_do_work()
5503 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_do_work()
5509 fc_host_post_event(vha->host, fc_get_event_number(), in qla2x00_do_work()
5513 qla81xx_idc_ack(vha, e->u.idc_ack.mb); in qla2x00_do_work()
5516 qla2x00_async_login(vha, e->u.logio.fcport, in qla2x00_do_work()
5520 rc = qla2x00_async_logout(vha, e->u.logio.fcport); in qla2x00_do_work()
5523 qla2x00_async_adisc(vha, e->u.logio.fcport, in qla2x00_do_work()
5527 qla2x00_uevent_emit(vha, e->u.uevent.code); in qla2x00_do_work()
5530 qlafx00_process_aen(vha, e); in qla2x00_do_work()
5533 qla24xx_sp_unmap(vha, e->u.iosb.sp); in qla2x00_do_work()
5536 qla2x00_relogin(vha); in qla2x00_do_work()
5539 qla24xx_create_new_sess(vha, e); in qla2x00_do_work()
5542 qla24xx_async_gpdb(vha, e->u.fcport.fcport, in qla2x00_do_work()
5546 qla24xx_async_prli(vha, e->u.fcport.fcport); in qla2x00_do_work()
5549 qla24xx_async_gpsc(vha, e->u.fcport.fcport); in qla2x00_do_work()
5552 qla24xx_async_gnl(vha, e->u.fcport.fcport); in qla2x00_do_work()
5555 qla24xx_do_nack_work(vha, e); in qla2x00_do_work()
5558 rc = qla2x00_async_prlo(vha, e->u.logio.fcport); in qla2x00_do_work()
5561 qla2x00_async_prlo_done(vha, e->u.logio.fcport, in qla2x00_do_work()
5565 qla24xx_async_gpnft(vha, e->u.gpnft.fc4_type, in qla2x00_do_work()
5569 qla24xx_async_gpnft_done(vha, e->u.iosb.sp); in qla2x00_do_work()
5572 qla24xx_async_gnnft_done(vha, e->u.iosb.sp); in qla2x00_do_work()
5575 qla24xx_async_gfpnid(vha, e->u.fcport.fcport); in qla2x00_do_work()
5578 qla_sp_retry(vha, e); in qla2x00_do_work()
5581 qla_do_iidma_work(vha, e->u.fcport.fcport); in qla2x00_do_work()
5584 qla24xx_els_dcmd2_iocb(vha, ELS_DCMD_PLOGI, in qla2x00_do_work()
5588 rc = qla24xx_issue_sa_replace_iocb(vha, e); in qla2x00_do_work()
5594 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_do_work()
5595 list_splice(&work, &vha->work_list); in qla2x00_do_work()
5596 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_do_work()
5604 QLA_VHA_MARK_NOT_BUSY(vha); in qla2x00_do_work()
5608 int qla24xx_post_relogin_work(struct scsi_qla_host *vha) in qla24xx_post_relogin_work() argument
5612 e = qla2x00_alloc_work(vha, QLA_EVT_RELOGIN); in qla24xx_post_relogin_work()
5615 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla24xx_post_relogin_work()
5619 return qla2x00_post_work(vha, e); in qla24xx_post_relogin_work()
5625 void qla2x00_relogin(struct scsi_qla_host *vha) in qla2x00_relogin() argument
5631 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_relogin()
5647 if (vha->hw->current_topology != ISP_CFG_NL) { in qla2x00_relogin()
5650 qla24xx_handle_relogin_event(vha, &ea); in qla2x00_relogin()
5651 } else if (vha->hw->current_topology == in qla2x00_relogin()
5653 IS_QLA2XXX_MIDTYPE(vha->hw)) { in qla2x00_relogin()
5654 (void)qla24xx_fcport_handle_login(vha, in qla2x00_relogin()
5656 } else if (vha->hw->current_topology == in qla2x00_relogin()
5660 qla2x00_local_device_login(vha, in qla2x00_relogin()
5665 ql_dbg(ql_dbg_disc, vha, 0x2003, in qla2x00_relogin()
5669 (vha, fcport); in qla2x00_relogin()
5672 &vha->dpc_flags); in qla2x00_relogin()
5674 ql_dbg(ql_dbg_disc, vha, 0x2007, in qla2x00_relogin()
5688 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_relogin()
5693 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla2x00_relogin()
5695 ql_dbg(ql_dbg_disc, vha, 0x400e, in qla2x00_relogin()
6018 qla25xx_rdp_rsp_reduce_size(struct scsi_qla_host *vha, in qla25xx_rdp_rsp_reduce_size() argument
6030 ql_dbg(ql_dbg_init, vha, 0x0181, "%s: s_id=%#x\n", __func__, sid); in qla25xx_rdp_rsp_reduce_size()
6034 ql_dbg(ql_dbg_init, vha, 0x0181, in qla25xx_rdp_rsp_reduce_size()
6036 } else if (qla24xx_get_port_database(vha, in qla25xx_rdp_rsp_reduce_size()
6038 ql_dbg(ql_dbg_init, vha, 0x0181, in qla25xx_rdp_rsp_reduce_size()
6042 ql_dbg(ql_dbg_init, vha, 0x0181, in qla25xx_rdp_rsp_reduce_size()
6051 vha->hw->isp_ops->fw_version_str(vha, fwstr, sizeof(fwstr)); in qla25xx_rdp_rsp_reduce_size()
6057 ql_dbg(ql_dbg_init, vha, 0x0181, "%s: fw=%s\n", __func__, fwstr); in qla25xx_rdp_rsp_reduce_size()
6073 void qla24xx_process_purex_rdp(struct scsi_qla_host *vha, in qla24xx_process_purex_rdp() argument
6076 struct qla_hw_data *ha = vha->hw; in qla24xx_process_purex_rdp()
6091 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x0180, in qla24xx_process_purex_rdp()
6094 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x0181, in qla24xx_process_purex_rdp()
6096 ql_dump_buffer(ql_dbg_init + ql_dbg_verbose, vha, 0x0182, in qla24xx_process_purex_rdp()
6099 if (qla25xx_rdp_rsp_reduce_size(vha, purex)) { in qla24xx_process_purex_rdp()
6102 ql_dbg(ql_dbg_init, vha, 0x0181, in qla24xx_process_purex_rdp()
6110 ql_log(ql_log_warn, vha, 0x0183, in qla24xx_process_purex_rdp()
6118 ql_log(ql_log_warn, vha, 0x0184, in qla24xx_process_purex_rdp()
6184 rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa0, 0x7, 2, 0); in qla24xx_process_purex_rdp()
6197 rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa0, 0x0, 1, 0); in qla24xx_process_purex_rdp()
6208 rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa2, 0x60, 10, 0); in qla24xx_process_purex_rdp()
6234 rval = qla24xx_get_isp_stats(vha, stat, stat_dma, 0); in qla24xx_process_purex_rdp()
6257 vha->node_name, in qla24xx_process_purex_rdp()
6260 vha->port_name, in qla24xx_process_purex_rdp()
6268 vha->fabric_node_name, in qla24xx_process_purex_rdp()
6271 vha->fabric_port_name, in qla24xx_process_purex_rdp()
6314 rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa2, 0, 64, 0); in qla24xx_process_purex_rdp()
6360 rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa2, 112, 64, 0); in qla24xx_process_purex_rdp()
6411 rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa0, 20, 64, 0); in qla24xx_process_purex_rdp()
6428 rval = qla2x00_read_sfp(vha, sfp_dma, sfp, 0xa0, 84, 8, 0); in qla24xx_process_purex_rdp()
6437 ql_dbg(ql_dbg_init, vha, 0x0183, in qla24xx_process_purex_rdp()
6439 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x0184, in qla24xx_process_purex_rdp()
6441 ql_dump_buffer(ql_dbg_init + ql_dbg_verbose, vha, 0x0185, in qla24xx_process_purex_rdp()
6443 ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x0186, in qla24xx_process_purex_rdp()
6445 ql_dump_buffer(ql_dbg_init + ql_dbg_verbose, vha, 0x0187, in qla24xx_process_purex_rdp()
6448 rval = qla2x00_issue_iocb(vha, rsp_els, rsp_els_dma, 0); in qla24xx_process_purex_rdp()
6451 ql_log(ql_log_warn, vha, 0x0188, in qla24xx_process_purex_rdp()
6454 ql_log(ql_log_warn, vha, 0x0189, in qla24xx_process_purex_rdp()
6459 ql_dbg(ql_dbg_init, vha, 0x018a, "%s: done.\n", __func__); in qla24xx_process_purex_rdp()
6480 if (item == &item->vha->default_item) in qla24xx_free_purex_item()
6481 memset(&item->vha->default_item, 0, sizeof(struct purex_item)); in qla24xx_free_purex_item()
6498 item->process_item(item->vha, item); in qla24xx_process_purex_list()
6570 __qla83xx_set_drv_presence(scsi_qla_host_t *vha) in __qla83xx_set_drv_presence() argument
6573 struct qla_hw_data *ha = vha->hw; in __qla83xx_set_drv_presence()
6576 rval = qla83xx_rd_reg(vha, QLA83XX_IDC_DRV_PRESENCE, &drv_presence); in __qla83xx_set_drv_presence()
6579 rval = qla83xx_wr_reg(vha, QLA83XX_IDC_DRV_PRESENCE, in __qla83xx_set_drv_presence()
6587 qla83xx_set_drv_presence(scsi_qla_host_t *vha) in qla83xx_set_drv_presence() argument
6591 qla83xx_idc_lock(vha, 0); in qla83xx_set_drv_presence()
6592 rval = __qla83xx_set_drv_presence(vha); in qla83xx_set_drv_presence()
6593 qla83xx_idc_unlock(vha, 0); in qla83xx_set_drv_presence()
6599 __qla83xx_clear_drv_presence(scsi_qla_host_t *vha) in __qla83xx_clear_drv_presence() argument
6602 struct qla_hw_data *ha = vha->hw; in __qla83xx_clear_drv_presence()
6605 rval = qla83xx_rd_reg(vha, QLA83XX_IDC_DRV_PRESENCE, &drv_presence); in __qla83xx_clear_drv_presence()
6608 rval = qla83xx_wr_reg(vha, QLA83XX_IDC_DRV_PRESENCE, in __qla83xx_clear_drv_presence()
6616 qla83xx_clear_drv_presence(scsi_qla_host_t *vha) in qla83xx_clear_drv_presence() argument
6620 qla83xx_idc_lock(vha, 0); in qla83xx_clear_drv_presence()
6621 rval = __qla83xx_clear_drv_presence(vha); in qla83xx_clear_drv_presence()
6622 qla83xx_idc_unlock(vha, 0); in qla83xx_clear_drv_presence()
6628 qla83xx_need_reset_handler(scsi_qla_host_t *vha) in qla83xx_need_reset_handler() argument
6630 struct qla_hw_data *ha = vha->hw; in qla83xx_need_reset_handler()
6637 qla83xx_rd_reg(vha, QLA83XX_IDC_DRIVER_ACK, &drv_ack); in qla83xx_need_reset_handler()
6638 qla83xx_rd_reg(vha, QLA83XX_IDC_DRV_PRESENCE, &drv_presence); in qla83xx_need_reset_handler()
6643 ql_log(ql_log_warn, vha, 0xb067, in qla83xx_need_reset_handler()
6652 qla83xx_wr_reg(vha, QLA83XX_IDC_DRV_PRESENCE, in qla83xx_need_reset_handler()
6657 qla83xx_idc_unlock(vha, 0); in qla83xx_need_reset_handler()
6659 qla83xx_idc_lock(vha, 0); in qla83xx_need_reset_handler()
6662 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE, QLA8XXX_DEV_COLD); in qla83xx_need_reset_handler()
6663 ql_log(ql_log_info, vha, 0xb068, "HW State: COLD/RE-INIT.\n"); in qla83xx_need_reset_handler()
6667 qla83xx_device_bootstrap(scsi_qla_host_t *vha) in qla83xx_device_bootstrap() argument
6672 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE, QLA8XXX_DEV_INITIALIZING); in qla83xx_device_bootstrap()
6673 ql_log(ql_log_info, vha, 0xb069, "HW State: INITIALIZING.\n"); in qla83xx_device_bootstrap()
6676 __qla83xx_get_idc_control(vha, &idc_control); in qla83xx_device_bootstrap()
6678 __qla83xx_set_idc_control(vha, 0); in qla83xx_device_bootstrap()
6680 qla83xx_idc_unlock(vha, 0); in qla83xx_device_bootstrap()
6681 rval = qla83xx_restart_nic_firmware(vha); in qla83xx_device_bootstrap()
6682 qla83xx_idc_lock(vha, 0); in qla83xx_device_bootstrap()
6685 ql_log(ql_log_fatal, vha, 0xb06a, in qla83xx_device_bootstrap()
6687 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE, QLA8XXX_DEV_FAILED); in qla83xx_device_bootstrap()
6688 ql_log(ql_log_info, vha, 0xb06b, "HW State: FAILED.\n"); in qla83xx_device_bootstrap()
6690 ql_dbg(ql_dbg_p3p, vha, 0xb06c, in qla83xx_device_bootstrap()
6692 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE, QLA8XXX_DEV_READY); in qla83xx_device_bootstrap()
6693 ql_log(ql_log_info, vha, 0xb06d, "HW State: READY.\n"); in qla83xx_device_bootstrap()
7256 qla2xxx_wake_dpc(struct scsi_qla_host *vha) in qla2xxx_wake_dpc() argument
7258 struct qla_hw_data *ha = vha->hw; in qla2xxx_wake_dpc()
7261 if (!test_bit(UNLOADING, &vha->dpc_flags) && t) in qla2xxx_wake_dpc()
7273 qla2x00_rst_aen(scsi_qla_host_t *vha) in qla2x00_rst_aen() argument
7275 if (vha->flags.online && !vha->flags.reset_active && in qla2x00_rst_aen()
7276 !atomic_read(&vha->loop_down_timer) && in qla2x00_rst_aen()
7277 !(test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags))) { in qla2x00_rst_aen()
7279 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla2x00_rst_aen()
7285 vha->marker_needed = 1; in qla2x00_rst_aen()
7286 } while (!atomic_read(&vha->loop_down_timer) && in qla2x00_rst_aen()
7287 (test_bit(RESET_MARKER_NEEDED, &vha->dpc_flags))); in qla2x00_rst_aen()
7291 static bool qla_do_heartbeat(struct scsi_qla_host *vha) in qla_do_heartbeat() argument
7293 struct qla_hw_data *ha = vha->hw; in qla_do_heartbeat()
7326 static void qla_heart_beat(struct scsi_qla_host *vha, u16 dpc_started) in qla_heart_beat() argument
7328 struct qla_hw_data *ha = vha->hw; in qla_heart_beat()
7330 if (vha->vp_idx) in qla_heart_beat()
7333 if (vha->hw->flags.eeh_busy || qla2x00_chip_is_down(vha)) in qla_heart_beat()
7345 if (qla_do_heartbeat(vha)) { in qla_heart_beat()
7351 static void qla_wind_down_chip(scsi_qla_host_t *vha) in qla_wind_down_chip() argument
7353 struct qla_hw_data *ha = vha->hw; in qla_wind_down_chip()
7367 ql_log(ql_log_info, vha, 0x9009, in qla_wind_down_chip()
7370 ha->isp_ops->reset_chip(vha); in qla_wind_down_chip()
7381 qla2x00_abort_isp_cleanup(vha); in qla_wind_down_chip()
7384 ql_log(ql_log_info, vha, 0x900a, in qla_wind_down_chip()
7400 scsi_qla_host_t *vha = from_timer(vha, t, timer); in qla2x00_timer() local
7406 struct qla_hw_data *ha = vha->hw; in qla2x00_timer()
7412 qla_wind_down_chip(vha); in qla2x00_timer()
7414 ql_dbg(ql_dbg_timer, vha, 0x6000, in qla2x00_timer()
7417 qla2x00_restart_timer(vha, WATCH_INTERVAL); in qla2x00_timer()
7427 qla2x00_check_reg16_for_disconnect(vha, w); in qla2x00_timer()
7431 if (!vha->vp_idx && IS_P3P_TYPE(ha)) { in qla2x00_timer()
7432 if (test_bit(ISP_QUIESCE_NEEDED, &vha->dpc_flags)) in qla2x00_timer()
7435 qla82xx_watchdog(vha); in qla2x00_timer()
7437 qla8044_watchdog(vha); in qla2x00_timer()
7440 if (!vha->vp_idx && IS_QLAFX00(ha)) in qla2x00_timer()
7441 qlafx00_timer_routine(vha); in qla2x00_timer()
7443 if (vha->link_down_time < QLA2XX_MAX_LINK_DOWN_TIME) in qla2x00_timer()
7444 vha->link_down_time++; in qla2x00_timer()
7446 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); in qla2x00_timer()
7447 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_timer()
7451 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); in qla2x00_timer()
7454 if (atomic_read(&vha->loop_down_timer) > 0 && in qla2x00_timer()
7455 !(test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags)) && in qla2x00_timer()
7456 !(test_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags)) in qla2x00_timer()
7457 && vha->flags.online) { in qla2x00_timer()
7459 if (atomic_read(&vha->loop_down_timer) == in qla2x00_timer()
7460 vha->loop_down_abort_time) { in qla2x00_timer()
7462 ql_log(ql_log_info, vha, 0x6008, in qla2x00_timer()
7465 if (!IS_QLA2100(ha) && vha->link_down_timeout) in qla2x00_timer()
7466 atomic_set(&vha->loop_state, LOOP_DEAD); in qla2x00_timer()
7473 if (!vha->vp_idx) { in qla2x00_timer()
7495 &vha->dpc_flags); in qla2x00_timer()
7498 &vha->dpc_flags); in qla2x00_timer()
7508 if (atomic_dec_and_test(&vha->loop_down_timer) != 0) { in qla2x00_timer()
7509 if (!(vha->device_flags & DFLG_NO_CABLE) && !vha->vp_idx) { in qla2x00_timer()
7510 ql_log(ql_log_warn, vha, 0x6009, in qla2x00_timer()
7515 &vha->dpc_flags); in qla2x00_timer()
7518 &vha->dpc_flags); in qla2x00_timer()
7521 ql_dbg(ql_dbg_timer, vha, 0x600a, in qla2x00_timer()
7523 atomic_read(&vha->loop_down_timer)); in qla2x00_timer()
7526 if (!vha->vp_idx && (ha->beacon_blink_led == 1)) { in qla2x00_timer()
7529 set_bit(BEACON_BLINK_NEEDED, &vha->dpc_flags); in qla2x00_timer()
7535 if (vha->hw->flags.edif_enabled) in qla2x00_timer()
7536 qla_edif_timer(vha); in qla2x00_timer()
7539 if (!list_empty(&vha->work_list)) { in qla2x00_timer()
7543 spin_lock_irqsave(&vha->work_lock, flags); in qla2x00_timer()
7544 if (!test_and_set_bit(IOCB_WORK_ACTIVE, &vha->dpc_flags)) in qla2x00_timer()
7546 spin_unlock_irqrestore(&vha->work_lock, flags); in qla2x00_timer()
7548 queue_work(vha->hw->wq, &vha->iocb_work); in qla2x00_timer()
7556 if (!vha->vp_idx && in qla2x00_timer()
7561 ql_log(ql_log_info, vha, 0x3002, in qla2x00_timer()
7564 set_bit(SET_ZIO_THRESHOLD_NEEDED, &vha->dpc_flags); in qla2x00_timer()
7568 if (!vha->vp_idx && in qla2x00_timer()
7571 ql_log(ql_log_info, vha, 0x3002, in qla2x00_timer()
7575 set_bit(SET_ZIO_THRESHOLD_NEEDED, &vha->dpc_flags); in qla2x00_timer()
7578 qla_adjust_buf(vha); in qla2x00_timer()
7583 if ((test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || in qla2x00_timer()
7584 test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags) || in qla2x00_timer()
7586 test_bit(RESET_MARKER_NEEDED, &vha->dpc_flags) || in qla2x00_timer()
7587 test_bit(BEACON_BLINK_NEEDED, &vha->dpc_flags) || in qla2x00_timer()
7588 test_bit(ISP_UNRECOVERABLE, &vha->dpc_flags) || in qla2x00_timer()
7589 test_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags) || in qla2x00_timer()
7590 test_bit(VP_DPC_NEEDED, &vha->dpc_flags) || in qla2x00_timer()
7591 test_bit(RELOGIN_NEEDED, &vha->dpc_flags) || in qla2x00_timer()
7592 test_bit(PROCESS_PUREX_IOCB, &vha->dpc_flags))) { in qla2x00_timer()
7593 ql_dbg(ql_dbg_timer, vha, 0x600b, in qla2x00_timer()
7596 test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags), in qla2x00_timer()
7597 test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags), in qla2x00_timer()
7598 start_dpc, test_bit(RESET_MARKER_NEEDED, &vha->dpc_flags)); in qla2x00_timer()
7599 ql_dbg(ql_dbg_timer, vha, 0x600c, in qla2x00_timer()
7603 test_bit(BEACON_BLINK_NEEDED, &vha->dpc_flags), in qla2x00_timer()
7604 test_bit(ISP_UNRECOVERABLE, &vha->dpc_flags), in qla2x00_timer()
7605 test_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags), in qla2x00_timer()
7606 test_bit(VP_DPC_NEEDED, &vha->dpc_flags), in qla2x00_timer()
7607 test_bit(RELOGIN_NEEDED, &vha->dpc_flags), in qla2x00_timer()
7608 test_bit(PROCESS_PUREX_IOCB, &vha->dpc_flags)); in qla2x00_timer()
7609 qla2xxx_wake_dpc(vha); in qla2x00_timer()
7613 qla_heart_beat(vha, w); in qla2x00_timer()
7615 qla2x00_restart_timer(vha, WATCH_INTERVAL); in qla2x00_timer()
7666 qla2x00_request_firmware(scsi_qla_host_t *vha) in qla2x00_request_firmware() argument
7668 struct qla_hw_data *ha = vha->hw; in qla2x00_request_firmware()
7707 ql_log(ql_log_warn, vha, 0x0063, in qla2x00_request_firmware()
7729 static void qla_pci_error_cleanup(scsi_qla_host_t *vha) in qla_pci_error_cleanup() argument
7731 struct qla_hw_data *ha = vha->hw; in qla_pci_error_cleanup()
7739 ql_dbg(ql_dbg_aer, vha, 0x9000, in qla_pci_error_cleanup()
7762 qla2x00_mark_all_devices_lost(vha); in qla_pci_error_cleanup()
7775 list_for_each_entry(fcport, &vha->vp_fcports, list) in qla_pci_error_cleanup()
7794 scsi_qla_host_t *vha = pci_get_drvdata(pdev); in qla2xxx_pci_error_detected() local
7795 struct qla_hw_data *ha = vha->hw; in qla2xxx_pci_error_detected()
7798 ql_log(ql_log_warn, vha, 0x9000, in qla2xxx_pci_error_detected()
7803 ql_log(ql_log_info, vha, 0xffff, in qla2xxx_pci_error_detected()
7811 qla_pci_set_eeh_busy(vha); in qla2xxx_pci_error_detected()
7813 set_bit(QPAIR_ONLINE_CHECK_NEEDED, &vha->dpc_flags); in qla2xxx_pci_error_detected()
7814 qla2xxx_wake_dpc(vha); in qla2xxx_pci_error_detected()
7819 qla_pci_set_eeh_busy(vha); in qla2xxx_pci_error_detected()
7824 qla2x00_abort_all_cmds(vha, DID_NO_CONNECT << 16); in qla2xxx_pci_error_detected()
7826 set_bit(QPAIR_ONLINE_CHECK_NEEDED, &vha->dpc_flags); in qla2xxx_pci_error_detected()
7827 qla2xxx_wake_dpc(vha); in qla2xxx_pci_error_detected()
7832 ql_dbg(ql_dbg_aer, vha, 0x600d, in qla2xxx_pci_error_detected()
7979 void qla_pci_set_eeh_busy(struct scsi_qla_host *vha) in qla_pci_set_eeh_busy() argument
7981 struct qla_hw_data *ha = vha->hw; in qla_pci_set_eeh_busy()
8007 void qla_schedule_eeh_work(struct scsi_qla_host *vha) in qla_schedule_eeh_work() argument
8009 struct qla_hw_data *ha = vha->hw; in qla_schedule_eeh_work()
8072 scsi_qla_host_t *vha = (scsi_qla_host_t *)shost->hostdata; in qla2xxx_map_queues() local
8075 if (USER_CTRL_IRQ(vha->hw) || !vha->hw->mqiobase) in qla2xxx_map_queues()
8078 blk_mq_pci_map_queues(qmap, vha->hw->pdev, vha->irq_offset); in qla2xxx_map_queues()