• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/scsi/qla2xxx/

Lines Matching refs:vha

230 qla2x00_start_timer(scsi_qla_host_t *vha, void *func, unsigned long interval)
232 init_timer(&vha->timer);
233 vha->timer.expires = jiffies + interval * HZ;
234 vha->timer.data = (unsigned long)vha;
235 vha->timer.function = (void (*)(unsigned long))func;
236 add_timer(&vha->timer);
237 vha->timer_active = 1;
241 qla2x00_restart_timer(scsi_qla_host_t *vha, unsigned long interval)
244 if (vha->device_flags & DFLG_DEV_FAILED)
247 mod_timer(&vha->timer, jiffies + interval * HZ);
251 qla2x00_stop_timer(scsi_qla_host_t *vha)
253 del_timer_sync(&vha->timer);
254 vha->timer_active = 0;
338 static int qla25xx_setup_mode(struct scsi_qla_host *vha)
342 struct qla_hw_data *ha = vha->hw;
360 vha->req = ha->req_q_map[req];
379 qla25xx_delete_queues(vha);
391 qla2x00_pci_info_str(struct scsi_qla_host *vha, char *str)
393 struct qla_hw_data *ha = vha->hw;
415 qla24xx_pci_info_str(struct scsi_qla_host *vha, char *str)
418 struct qla_hw_data *ha = vha->hw;
466 qla2x00_fw_version_str(struct scsi_qla_host *vha, char *str)
469 struct qla_hw_data *ha = vha->hw;
505 qla24xx_fw_version_str(struct scsi_qla_host *vha, char *str)
507 struct qla_hw_data *ha = vha->hw;
515 qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport,
519 struct qla_hw_data *ha = vha->hw;
539 scsi_qla_host_t *vha = shost_priv(cmd->device->host);
542 struct qla_hw_data *ha = vha->hw;
565 if (!vha->flags.difdix_supported &&
582 spin_unlock_irq(vha->host->host_lock);
592 spin_lock_irq(vha->host->host_lock);
601 spin_lock_irq(vha->host->host_lock);
632 scsi_qla_host_t *vha = shost_priv(cmd->device->host);
633 struct qla_hw_data *ha = vha->hw;
668 qla2x00_wait_for_hba_online(scsi_qla_host_t *vha)
672 struct qla_hw_data *ha = vha->hw;
710 qla2x00_wait_for_reset_ready(scsi_qla_host_t *vha)
714 struct qla_hw_data *ha = vha->hw;
736 qla2x00_wait_for_chip_reset(scsi_qla_host_t *vha)
740 struct qla_hw_data *ha = vha->hw;
780 qla2x00_wait_for_loop_ready(scsi_qla_host_t *vha)
784 struct qla_hw_data *ha = vha->hw;
830 scsi_qla_host_t *vha = shost_priv(cmd->device->host);
837 struct qla_hw_data *ha = vha->hw;
838 struct req_que *req = vha->req;
870 " pid=%ld.\n", __func__, vha->host_no, sp, serial));
879 "mbx failed.\n", __func__, vha->host_no));
883 "mbx success.\n", __func__, vha->host_no));
896 "%x.\n", vha->host_no, id, lun, serial, ret);
906 vha->host_no, id, lun, wait, serial, ret);
912 qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t,
917 struct qla_hw_data *ha = vha->hw;
924 req = vha->req;
932 if (vha->vp_idx != sp->fcport->vha->vp_idx)
970 scsi_qla_host_t *vha = shost_priv(cmd->device->host);
979 qla_printk(KERN_INFO, vha->hw, "scsi(%ld:%d:%d): %s RESET ISSUED.\n",
980 vha->host_no, cmd->device->id, cmd->device->lun, name);
983 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS)
986 if (qla2x00_wait_for_loop_ready(vha) != QLA_SUCCESS)
993 if (qla2x00_eh_wait_for_pending_commands(vha, cmd->device->id,
997 qla_printk(KERN_INFO, vha->hw, "scsi(%ld:%d:%d): %s RESET SUCCEEDED.\n",
998 vha->host_no, cmd->device->id, cmd->device->lun, name);
1003 qla_printk(KERN_INFO, vha->hw, "scsi(%ld:%d:%d): %s RESET FAILED: %s.\n"
1004 , vha->host_no, cmd->device->id, cmd->device->lun, name,
1012 scsi_qla_host_t *vha = shost_priv(cmd->device->host);
1013 struct qla_hw_data *ha = vha->hw;
1022 scsi_qla_host_t *vha = shost_priv(cmd->device->host);
1023 struct qla_hw_data *ha = vha->hw;
1047 scsi_qla_host_t *vha = shost_priv(cmd->device->host);
1062 qla_printk(KERN_INFO, vha->hw,
1063 "scsi(%ld:%d:%d): BUS RESET ISSUED.\n", vha->host_no, id, lun);
1065 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) {
1070 if (qla2x00_wait_for_loop_ready(vha) == QLA_SUCCESS) {
1071 if (qla2x00_loop_reset(vha) == QLA_SUCCESS)
1078 if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0, WAIT_HOST) !=
1083 qla_printk(KERN_INFO, vha->hw, "%s: reset %s\n", __func__,
1107 scsi_qla_host_t *vha = shost_priv(cmd->device->host);
1109 struct qla_hw_data *ha = vha->hw;
1125 "scsi(%ld:%d:%d): ADAPTER RESET ISSUED.\n", vha->host_no, id, lun);
1127 if (qla2x00_wait_for_reset_ready(vha) != QLA_SUCCESS)
1130 qla2x00_wait_for_loop_ready(vha);
1131 if (vha != base_vha) {
1132 if (qla2x00_vp_abort_isp(vha))
1135 if (IS_QLA82XX(vha->hw)) {
1136 if (!qla82xx_fcoe_ctx_reset(vha)) {
1152 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS)
1159 if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0, WAIT_HOST) ==
1181 qla2x00_loop_reset(scsi_qla_host_t *vha)
1185 struct qla_hw_data *ha = vha->hw;
1188 list_for_each_entry(fcport, &vha->vp_fcports, list) {
1196 vha->host_no, ret, fcport->d_id.b24));
1202 ret = qla2x00_full_login_lip(vha);
1205 "full_login_lip=%d.\n", __func__, vha->host_no,
1208 atomic_set(&vha->loop_state, LOOP_DOWN);
1209 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
1210 qla2x00_mark_all_devices_lost(vha, 0);
1211 qla2x00_wait_for_loop_ready(vha);
1215 ret = qla2x00_lip_reset(vha);
1218 "lip_reset=%d.\n", __func__, vha->host_no, ret));
1220 qla2x00_wait_for_loop_ready(vha);
1224 vha->marker_needed = 1;
1230 qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res)
1236 struct qla_hw_data *ha = vha->hw;
1294 scsi_qla_host_t *vha = shost_priv(sdev->host);
1295 struct qla_hw_data *ha = vha->hw;
1297 struct req_que *req = vha->req;
1322 DEBUG2(qla_printk(KERN_INFO, fcport->vha->hw,
1324 fcport->vha->host_no, sdev->channel, sdev->id, sdev->lun,
1331 struct scsi_qla_host *vha = fcport->vha;
1332 struct qla_hw_data *ha = vha->hw;
1335 req = vha->req;
1349 fcport->vha->host_no, sdev->channel, sdev->id, sdev->lun,
1901 scsi_qla_host_t *vha = shost_priv(shost);
1903 if (vha->hw->flags.running_gold_fw)
1906 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
1907 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
1908 set_bit(RSCN_UPDATE, &vha->dpc_flags);
1909 set_bit(NPIV_CONFIG_NEEDED, &vha->dpc_flags);
1915 scsi_qla_host_t *vha = shost_priv(shost);
1917 if (!vha->host)
1919 if (time > vha->hw->loop_reset_delay * HZ)
1922 return atomic_read(&vha->loop_state) == LOOP_READY;
2342 scsi_qla_host_t *base_vha, *vha;
2350 list_for_each_entry(vha, &ha->vp_list, list) {
2351 atomic_inc(&vha->vref_count);
2353 if (vha && vha->fc_vport) {
2356 fc_vport_terminate(vha->fc_vport);
2361 atomic_dec(&vha->vref_count);
2435 qla2x00_free_device(scsi_qla_host_t *vha)
2437 struct qla_hw_data *ha = vha->hw;
2439 qla2x00_abort_all_cmds(vha, DID_NO_CONNECT << 16);
2442 if (vha->timer_active)
2443 qla2x00_stop_timer(vha);
2457 qla25xx_delete_queues(vha);
2460 qla2x00_disable_fce_trace(vha, NULL, NULL);
2463 qla2x00_disable_eft_trace(vha);
2466 qla2x00_try_to_stop_firmware(vha);
2468 vha->flags.online = 0;
2472 vha->flags.init_done = 0;
2476 qla2x00_free_irqs(vha);
2478 qla2x00_free_fcports(vha);
2485 void qla2x00_free_fcports(struct scsi_qla_host *vha)
2489 list_for_each_entry_safe(fcport, tfcport, &vha->vp_fcports, list) {
2497 qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport,
2508 base_vha = pci_get_drvdata(vha->hw->pdev);
2509 spin_lock_irq(vha->host->host_lock);
2511 spin_unlock_irq(vha->host->host_lock);
2527 void qla2x00_mark_device_lost(scsi_qla_host_t *vha, fc_port_t *fcport,
2531 vha->vp_idx == fcport->vp_idx) {
2533 qla2x00_schedule_rport_del(vha, fcport, defer);
2546 fcport->login_retry = vha->hw->login_retry_count;
2547 set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
2552 vha->host_no,
2580 qla2x00_mark_all_devices_lost(scsi_qla_host_t *vha, int defer)
2584 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2585 if (vha->vp_idx != 0 && vha->vp_idx != fcport->vp_idx)
2596 qla2x00_schedule_rport_del(vha, fcport, defer);
2597 else if (vha->vp_idx == fcport->vp_idx)
2598 qla2x00_schedule_rport_del(vha, fcport, defer);
2954 struct scsi_qla_host *vha = NULL;
2964 vha = shost_priv(host);
2965 memset(vha, 0, sizeof(scsi_qla_host_t));
2967 vha->host = host;
2968 vha->host_no = host->host_no;
2969 vha->hw = ha;
2971 INIT_LIST_HEAD(&vha->vp_fcports);
2972 INIT_LIST_HEAD(&vha->work_list);
2973 INIT_LIST_HEAD(&vha->list);
2975 spin_lock_init(&vha->work_lock);
2977 sprintf(vha->host_str, "%s_%ld", QLA2XXX_DRIVER_NAME, vha->host_no);
2978 return vha;
2981 return vha;
2985 qla2x00_alloc_work(struct scsi_qla_host *vha, enum qla_work_type type)
2990 QLA_VHA_MARK_BUSY(vha, bail);
2996 QLA_VHA_MARK_NOT_BUSY(vha);
3007 qla2x00_post_work(struct scsi_qla_host *vha, struct qla_work_evt *e)
3011 spin_lock_irqsave(&vha->work_lock, flags);
3012 list_add_tail(&e->list, &vha->work_list);
3013 spin_unlock_irqrestore(&vha->work_lock, flags);
3014 qla2xxx_wake_dpc(vha);
3020 qla2x00_post_aen_work(struct scsi_qla_host *vha, enum fc_host_event_code code,
3025 e = qla2x00_alloc_work(vha, QLA_EVT_AEN);
3031 return qla2x00_post_work(vha, e);
3035 qla2x00_post_idc_ack_work(struct scsi_qla_host *vha, uint16_t *mb)
3039 e = qla2x00_alloc_work(vha, QLA_EVT_IDC_ACK);
3044 return qla2x00_post_work(vha, e);
3049 struct scsi_qla_host *vha, \
3054 e = qla2x00_alloc_work(vha, type); \
3063 return qla2x00_post_work(vha, e); \
3074 qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code)
3078 e = qla2x00_alloc_work(vha, QLA_EVT_UEVENT);
3083 return qla2x00_post_work(vha, e);
3087 qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
3095 vha->host_no);
3101 kobject_uevent_env(&vha->hw->pdev->dev.kobj, KOBJ_CHANGE, envp);
3105 qla2x00_do_work(struct scsi_qla_host *vha)
3111 spin_lock_irqsave(&vha->work_lock, flags);
3112 list_splice_init(&vha->work_list, &work);
3113 spin_unlock_irqrestore(&vha->work_lock, flags);
3120 fc_host_post_event(vha->host, fc_get_event_number(),
3124 qla81xx_idc_ack(vha, e->u.idc_ack.mb);
3127 qla2x00_async_login(vha, e->u.logio.fcport,
3131 qla2x00_async_login_done(vha, e->u.logio.fcport,
3135 qla2x00_async_logout(vha, e->u.logio.fcport);
3138 qla2x00_async_logout_done(vha, e->u.logio.fcport,
3142 qla2x00_async_adisc(vha, e->u.logio.fcport,
3146 qla2x00_async_adisc_done(vha, e->u.logio.fcport,
3150 qla2x00_uevent_emit(vha, e->u.uevent.code);
3156 /* For each work completed decrement vha ref count */
3157 QLA_VHA_MARK_NOT_BUSY(vha);
3164 void qla2x00_relogin(struct scsi_qla_host *vha)
3169 struct qla_hw_data *ha = vha->hw;
3172 list_for_each_entry(fcport, &vha->vp_fcports, list) {
3182 ha->isp_ops->fabric_logout(vha,
3193 vha, fcport, data);
3199 status = qla2x00_fabric_login(vha,
3202 status = qla2x00_local_device_login(vha,
3209 "in ID 0x%x\n", vha->host_no, fcport->loop_id));
3211 qla2x00_update_fcport(vha, fcport);
3214 set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
3218 vha->host_no, fcport->login_retry,
3227 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags))
3430 qla2xxx_wake_dpc(struct scsi_qla_host *vha)
3432 struct qla_hw_data *ha = vha->hw;
3435 if (!test_bit(UNLOADING, &vha->dpc_flags) && t)
3447 qla2x00_rst_aen(scsi_qla_host_t *vha)
3449 if (vha->flags.online && !vha->flags.reset_active &&
3450 !atomic_read(&vha->loop_down_timer) &&
3451 !(test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags))) {
3453 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
3459 vha->marker_needed = 1;
3460 } while (!atomic_read(&vha->loop_down_timer) &&
3461 (test_bit(RESET_MARKER_NEEDED, &vha->dpc_flags)));
3469 struct qla_hw_data *ha = sp->fcport->vha->hw;
3542 qla2x00_timer(scsi_qla_host_t *vha)
3551 struct qla_hw_data *ha = vha->hw;
3555 qla82xx_watchdog(vha);
3568 list_for_each_entry(fcport, &vha->vp_fcports, list) {
3582 vha->host_no,
3590 if (atomic_read(&vha->loop_down_timer) > 0 &&
3591 !(test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags))
3592 && vha->flags.online) {
3594 if (atomic_read(&vha->loop_down_timer) ==
3595 vha->loop_down_abort_time) {
3599 vha->host_no));
3601 if (!IS_QLA2100(ha) && vha->link_down_timeout)
3602 atomic_set(&vha->loop_state, LOOP_DEAD);
3609 if (!vha->vp_idx) {
3628 &vha->dpc_flags);
3638 if (atomic_dec_and_test(&vha->loop_down_timer) != 0) {
3639 if (!(vha->device_flags & DFLG_NO_CABLE)) {
3642 vha->host_no));
3646 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
3650 vha->host_no,
3651 atomic_read(&vha->loop_down_timer)));
3656 set_bit(BEACON_BLINK_NEEDED, &vha->dpc_flags);
3661 if (!list_empty(&vha->work_list))
3665 if ((test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
3666 test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags) ||
3667 test_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags) ||
3669 test_bit(RESET_MARKER_NEEDED, &vha->dpc_flags) ||
3670 test_bit(BEACON_BLINK_NEEDED, &vha->dpc_flags) ||
3671 test_bit(ISP_UNRECOVERABLE, &vha->dpc_flags) ||
3672 test_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags) ||
3673 test_bit(VP_DPC_NEEDED, &vha->dpc_flags) ||
3674 test_bit(RELOGIN_NEEDED, &vha->dpc_flags)))
3675 qla2xxx_wake_dpc(vha);
3677 qla2x00_restart_timer(vha, WATCH_INTERVAL);
3715 qla2x00_request_firmware(scsi_qla_host_t *vha)
3717 struct qla_hw_data *ha = vha->hw;
3745 "(%s).\n", vha->host_no, blob->name));
3771 scsi_qla_host_t *vha = pci_get_drvdata(pdev);
3772 struct qla_hw_data *ha = vha->hw;
3783 qla2x00_free_irqs(vha);
3788 qla2x00_abort_all_cmds(vha, DID_NO_CONNECT << 16);