• 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

53 	struct qla_hw_data *ha = fcport->vha->hw;
72 struct scsi_qla_host *vha = sp->fcport->vha;
77 mempool_free(sp, sp->fcport->vha->hw->srb_mempool);
79 QLA_VHA_MARK_NOT_BUSY(vha);
83 qla2x00_get_ctx_sp(scsi_qla_host_t *vha, fc_port_t *fcport, size_t size,
87 struct qla_hw_data *ha = vha->hw;
92 QLA_VHA_MARK_BUSY(vha, bail);
128 QLA_VHA_MARK_NOT_BUSY(vha);
135 qla2x00_get_async_timeout(struct scsi_qla_host *vha)
138 struct qla_hw_data *ha = vha->hw;
160 fcport->vha->host_no, sp->handle,
167 qla2x00_post_async_logout_work(fcport->vha, fcport, NULL);
172 qla2x00_post_async_login_done_work(fcport->vha, fcport,
183 qla2x00_post_async_login_done_work(sp->fcport->vha, sp->fcport,
189 qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport,
198 sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx),
199 qla2x00_get_async_timeout(vha) + 2);
218 "retries=%d.\n", fcport->vha->host_no, sp->handle, fcport->loop_id,
235 qla2x00_post_async_logout_done_work(sp->fcport->vha, sp->fcport,
241 qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport)
249 sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx),
250 qla2x00_get_async_timeout(vha) + 2);
266 fcport->vha->host_no, sp->handle, fcport->loop_id,
282 qla2x00_post_async_adisc_done_work(sp->fcport->vha, sp->fcport,
288 qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport,
297 sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx),
298 qla2x00_get_async_timeout(vha) + 2);
316 fcport->vha->host_no, sp->handle, fcport->loop_id,
333 qla2x00_async_tm_cmd_done(sp->fcport->vha, sp->fcport, iocb);
341 struct scsi_qla_host *vha = fcport->vha;
348 sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx),
349 qla2x00_get_async_timeout(vha) + 2);
369 fcport->vha->host_no, sp->handle, fcport->loop_id,
381 qla2x00_async_login_done(struct scsi_qla_host *vha, fc_port_t *fcport,
390 qla2x00_post_async_adisc_work(vha, fcport, data);
393 qla2x00_update_fcport(vha, fcport);
398 set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
400 qla2x00_mark_device_lost(vha, fcport, 1, 1);
404 qla2x00_post_async_logout_work(vha, fcport, NULL);
405 qla2x00_post_async_login_work(vha, fcport, NULL);
409 rval = qla2x00_find_new_loop_id(vha, fcport);
412 qla2x00_mark_device_lost(vha, fcport, 1, 1);
415 qla2x00_post_async_login_work(vha, fcport, NULL);
422 qla2x00_async_logout_done(struct scsi_qla_host *vha, fc_port_t *fcport,
425 qla2x00_mark_device_lost(vha, fcport, 1, 0);
430 qla2x00_async_adisc_done(struct scsi_qla_host *vha, fc_port_t *fcport,
434 qla2x00_update_fcport(vha, fcport);
442 set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
444 qla2x00_mark_device_lost(vha, fcport, 1, 1);
450 qla2x00_async_tm_cmd_done(struct scsi_qla_host *vha, fc_port_t *fcport,
461 rval = qla2x00_marker(vha, vha->hw->req_q_map[0],
462 vha->hw->rsp_q_map[0], fcport->loop_id, lun,
468 __func__, vha->host_no, rval));
489 qla2x00_initialize_adapter(scsi_qla_host_t *vha)
492 struct qla_hw_data *ha = vha->hw;
496 vha->flags.online = 0;
498 vha->flags.reset_active = 0;
501 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
502 atomic_set(&vha->loop_state, LOOP_DOWN);
503 vha->device_flags = DFLG_NO_CABLE;
504 vha->dpc_flags = 0;
505 vha->flags.management_server_logged_in = 0;
506 vha->marker_needed = 0;
514 rval = ha->isp_ops->pci_config(vha);
517 vha->host_no));
521 ha->isp_ops->reset_chip(vha);
523 rval = qla2xxx_get_flash_info(vha);
526 vha->host_no));
530 ha->isp_ops->get_flash_version(vha, req->ring);
534 ha->isp_ops->nvram_config(vha);
540 vha->port_name[0], vha->port_name[1],
541 vha->port_name[2], vha->port_name[3],
542 vha->port_name[4], vha->port_name[5],
543 vha->port_name[6], vha->port_name[7]);
549 if (qla2x00_isp_firmware(vha) != QLA_SUCCESS) {
550 rval = ha->isp_ops->chip_diag(vha);
553 rval = qla2x00_setup_chip(vha);
559 ha->cs84xx = qla84xx_get_chip(vha);
566 rval = qla2x00_init_rings(vha);
571 rval = qla84xx_init_chip(vha);
575 qla84xx_put_chip(vha);
580 qla24xx_read_fcp_prio_cfg(vha);
592 qla2100_pci_config(scsi_qla_host_t *vha)
596 struct qla_hw_data *ha = vha->hw;
623 qla2300_pci_config(scsi_qla_host_t *vha)
628 struct qla_hw_data *ha = vha->hw;
705 qla24xx_pci_config(scsi_qla_host_t *vha)
709 struct qla_hw_data *ha = vha->hw;
749 qla25xx_pci_config(scsi_qla_host_t *vha)
752 struct qla_hw_data *ha = vha->hw;
780 qla2x00_isp_firmware(scsi_qla_host_t *vha)
785 struct qla_hw_data *ha = vha->hw;
792 vha->host_no));
796 rval = qla2x00_verify_checksum(vha, ha->fw_srisc_address);
799 rval = qla2x00_get_adapter_id(vha, &loop_id, &al_pa,
806 vha->host_no));
819 qla2x00_reset_chip(scsi_qla_host_t *vha)
822 struct qla_hw_data *ha = vha->hw;
963 qla24xx_reset_risc(scsi_qla_host_t *vha)
966 struct qla_hw_data *ha = vha->hw;
1032 qla24xx_reset_chip(scsi_qla_host_t *vha)
1034 struct qla_hw_data *ha = vha->hw;
1044 qla24xx_reset_risc(vha);
1054 qla2x00_chip_diag(scsi_qla_host_t *vha)
1057 struct qla_hw_data *ha = vha->hw;
1069 vha->host_no, (u_long)&reg->flash_address));
1092 vha->host_no));
1112 DEBUG3(printk("scsi(%ld): Checking product ID of chip\n", vha->host_no));
1141 vha->host_no));
1150 DEBUG3(printk("scsi(%ld): Checking mailboxes.\n", vha->host_no));
1151 rval = qla2x00_mbx_reg_test(vha);
1154 vha->host_no));
1167 "****\n", vha->host_no));
1181 qla24xx_chip_diag(scsi_qla_host_t *vha)
1184 struct qla_hw_data *ha = vha->hw;
1192 rval = qla2x00_mbx_reg_test(vha);
1195 vha->host_no));
1207 qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
1214 struct qla_hw_data *ha = vha->hw;
1256 rval = qla2x00_enable_fce_trace(vha, tc_dma, FCE_NUM_BUFFERS,
1285 rval = qla2x00_enable_eft_trace(vha, tc_dma, EFT_NUM_BUFFERS);
1347 qla81xx_mpi_sync(scsi_qla_host_t *vha)
1353 struct qla_hw_data *ha = vha->hw;
1355 if (!IS_QLA81XX(vha->hw))
1358 rval = qla2x00_write_ram_word(vha, 0x7c00, 1);
1365 pci_read_config_word(vha->hw->pdev, 0x54, &dc);
1366 rval = qla2x00_read_ram_word(vha, 0x7a15, &dw);
1379 rval = qla2x00_write_ram_word(vha, 0x7a15, dw);
1386 rval = qla2x00_write_ram_word(vha, 0x7c00, 0);
1403 qla2x00_setup_chip(scsi_qla_host_t *vha)
1407 struct qla_hw_data *ha = vha->hw;
1413 rval = ha->isp_ops->load_risc(vha, &srisc_address);
1415 qla2x00_stop_firmware(vha);
1429 qla81xx_mpi_sync(vha);
1432 rval = ha->isp_ops->load_risc(vha, &srisc_address);
1435 "code.\n", vha->host_no));
1437 rval = qla2x00_verify_checksum(vha, srisc_address);
1441 "firmware.\n", vha->host_no));
1443 rval = qla2x00_execute_fw(vha, srisc_address);
1448 rval = qla2x00_get_fw_version(vha,
1467 qla2x00_get_resource_cnts(vha, NULL,
1473 qla2x00_alloc_fw_dump(vha);
1479 vha->host_no));
1499 rval = qla81xx_fac_get_sector_size(vha, &size);
1513 vha->host_no));
1551 qla2x00_update_fw_options(scsi_qla_host_t *vha)
1554 struct qla_hw_data *ha = vha->hw;
1557 qla2x00_get_fw_options(vha, ha->fw_options);
1564 vha->host_no));
1622 qla2x00_set_fw_options(vha, ha->fw_options);
1626 qla24xx_update_fw_options(scsi_qla_host_t *vha)
1629 struct qla_hw_data *ha = vha->hw;
1638 rval = qla2x00_set_serdes_params(vha,
1649 qla2x00_config_rings(struct scsi_qla_host *vha)
1651 struct qla_hw_data *ha = vha->hw;
1674 qla24xx_config_rings(struct scsi_qla_host *vha)
1676 struct qla_hw_data *ha = vha->hw;
1751 qla2x00_init_rings(scsi_qla_host_t *vha)
1756 struct qla_hw_data *ha = vha->hw;
1798 ha->isp_ops->config_rings(vha);
1803 ha->isp_ops->update_fw_options(vha);
1805 DEBUG(printk("scsi(%ld): Issue init firmware.\n", vha->host_no));
1819 rval = qla2x00_init_firmware(vha, ha->init_cb_size);
1822 vha->host_no));
1825 vha->host_no));
1838 qla2x00_fw_ready(scsi_qla_host_t *vha)
1845 struct qla_hw_data *ha = vha->hw;
1867 if (!vha->flags.init_done)
1871 vha->host_no));
1874 rval = qla2x00_get_firmware_state(vha, state);
1877 vha->device_flags &= ~DFLG_NO_CABLE;
1881 "84xx=%x.\n", vha->host_no, state[0],
1886 "verify iocb.\n", vha->host_no));
1889 rval = qla84xx_init_chip(vha);
1899 vha->host_no, cs84xx_time, wtime));
1903 vha->host_no));
1905 qla2x00_get_retry_cnt(vha, &ha->retry_count,
1914 if (atomic_read(&vha->loop_down_timer) &&
1923 vha->device_flags |= DFLG_NO_CABLE;
1941 vha->host_no, state[0], jiffies));
1945 vha->host_no, state[0], state[1], state[2], state[3], state[4],
1950 vha->host_no));
1970 qla2x00_configure_hba(scsi_qla_host_t *vha)
1980 struct qla_hw_data *ha = vha->hw;
1983 rval = qla2x00_get_adapter_id(vha,
1986 if (LOOP_TRANSITION(vha) || atomic_read(&ha->loop_down_timer) ||
1989 __func__, vha->host_no));
1993 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
2004 vha->loop_id = loop_id;
2014 vha->host_no));
2021 vha->host_no));
2029 vha->host_no));
2037 vha->host_no));
2047 vha->host_no, topo));
2055 vha->d_id.b.domain = domain;
2056 vha->d_id.b.area = area;
2057 vha->d_id.b.al_pa = al_pa;
2059 if (!vha->flags.init_done)
2062 connect_type, vha->loop_id);
2065 DEBUG2_3(printk("scsi(%ld): FAILED.\n", vha->host_no));
2067 DEBUG3(printk("scsi(%ld): exiting normally.\n", vha->host_no));
2074 qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len,
2079 struct qla_hw_data *ha = vha->hw;
2115 qla2xxx_get_vpd_field(vha, "\x82", ha->model_desc,
2122 static void qla2xxx_nvram_wwn_from_ofw(scsi_qla_host_t *vha, nvram_t *nv)
2125 struct qla_hw_data *ha = vha->hw;
2155 qla2x00_nvram_config(scsi_qla_host_t *vha)
2161 struct qla_hw_data *ha = vha->hw;
2177 ha->isp_ops->read_nvram(vha, ptr, ha->nvram_base, ha->nvram_size);
2181 DEBUG5(printk("scsi(%ld): Contents of NVRAM\n", vha->host_no));
2228 qla2xxx_nvram_wwn_from_ofw(vha, nv);
2282 qla2x00_set_model_info(vha, nv->model_number,
2358 memcpy(vha->node_name, icb->node_name, WWN_SIZE);
2359 memcpy(vha->port_name, icb->port_name, WWN_SIZE);
2427 vha->flags.process_response_queue = 1;
2430 if (!vha->flags.init_done) {
2438 vha->flags.process_response_queue = 0;
2443 "delay (%d us).\n", vha->host_no, ha->zio_mode,
2451 vha->flags.process_response_queue = 1;
2457 "scsi(%ld): NVRAM configuration failed!\n", vha->host_no));
2468 spin_lock_irq(fcport->vha->host->host_lock);
2471 spin_unlock_irq(fcport->vha->host->host_lock);
2484 qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags)
2493 fcport->vha = vha;
2494 fcport->vp_idx = vha->vp_idx;
2516 qla2x00_configure_loop(scsi_qla_host_t *vha)
2520 struct qla_hw_data *ha = vha->hw;
2524 if (test_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags)) {
2525 rval = qla2x00_configure_hba(vha);
2528 vha->host_no));
2533 save_flags = flags = vha->dpc_flags;
2535 vha->host_no, flags));
2541 clear_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
2542 clear_bit(RSCN_UPDATE, &vha->dpc_flags);
2544 qla2x00_get_data_rate(vha);
2550 vha->flags.rscn_queue_overflow = 1;
2556 vha->flags.rscn_queue_overflow = 1;
2563 } else if (!vha->flags.online ||
2566 vha->flags.rscn_queue_overflow = 1;
2572 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags))
2575 rval = qla2x00_configure_local_loop(vha);
2579 if (LOOP_TRANSITION(vha))
2582 rval = qla2x00_configure_fabric(vha);
2586 if (atomic_read(&vha->loop_down_timer) ||
2587 test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) {
2590 atomic_set(&vha->loop_state, LOOP_READY);
2592 DEBUG(printk("scsi(%ld): LOOP READY\n", vha->host_no));
2598 __func__, vha->host_no));
2604 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) {
2606 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
2608 set_bit(RSCN_UPDATE, &vha->dpc_flags);
2610 vha->flags.rscn_queue_overflow = 1;
2630 qla2x00_configure_local_loop(scsi_qla_host_t *vha)
2642 struct qla_hw_data *ha = vha->hw;
2648 DEBUG3(printk("scsi(%ld): Getting FCAL position map\n", vha->host_no));
2649 DEBUG3(qla2x00_get_fcal_position_map(vha, NULL));
2653 rval = qla2x00_get_id_list(vha, ha->gid_list, ha->gid_list_dma,
2659 vha->host_no, entries));
2664 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL);
2674 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2681 vha->host_no, fcport->loop_id));
2707 (area != vha->d_id.b.area || domain != vha->d_id.b.domain))
2719 new_fcport->vp_idx = vha->vp_idx;
2720 rval2 = qla2x00_get_port_database(vha, new_fcport, 0);
2725 vha->host_no, rval2, new_fcport->loop_id));
2727 vha->host_no));
2728 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
2735 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2753 if (vha->vp_idx) {
2754 new_fcport->vha = vha;
2755 new_fcport->vp_idx = vha->vp_idx;
2757 list_add_tail(&new_fcport->list, &vha->vp_fcports);
2761 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL);
2772 qla2x00_update_fcport(vha, fcport);
2782 "rval=%x\n", vha->host_no, rval));
2789 qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
2796 struct qla_hw_data *ha = vha->hw;
2805 rval = qla2x00_set_idma_speed(vha, fcport->loop_id, fcport->fp_speed,
2810 vha->host_no, fcport->port_name[0], fcport->port_name[1],
2833 qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport)
2837 struct qla_hw_data *ha = vha->hw;
2846 fcport->rport = rport = fc_remote_port_add(vha->host, 0, &rport_ids);
2852 spin_lock_irq(fcport->vha->host->host_lock);
2854 spin_unlock_irq(fcport->vha->host->host_lock);
2882 qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
2884 struct qla_hw_data *ha = vha->hw;
2886 fcport->vha = vha;
2894 qla2x00_iidma_fcport(vha, fcport);
2898 qla2x00_reg_remote_port(vha, fcport);
2913 qla2x00_configure_fabric(scsi_qla_host_t *vha)
2921 struct qla_hw_data *ha = vha->hw;
2929 rval = qla2x00_get_port_name(vha, loop_id, vha->fabric_node_name, 1);
2932 "Port\n", vha->host_no));
2934 vha->device_flags &= ~SWITCH_FOUND;
2937 vha->device_flags |= SWITCH_FOUND;
2940 rval2 = qla2x00_device_resync(vha);
2948 test_and_clear_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags))
2949 qla2x00_fdmi_register(vha);
2956 ha->isp_ops->fabric_login(vha, loop_id, 0xff, 0xff,
2966 if (test_and_clear_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags)) {
2967 if (qla2x00_rft_id(vha)) {
2970 "TYPE failed.\n", vha->host_no));
2972 if (qla2x00_rff_id(vha)) {
2975 "Features failed.\n", vha->host_no));
2977 if (qla2x00_rnn_id(vha)) {
2980 "failed.\n", vha->host_no));
2981 } else if (qla2x00_rsnn_nn(vha)) {
2984 "Node Name failed.\n", vha->host_no));
2988 rval = qla2x00_find_all_fabric_devs(vha, &new_fcports);
2996 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2997 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags))
3004 qla2x00_mark_device_lost(vha, fcport,
3010 ha->isp_ops->fabric_logout(vha,
3027 list_for_each_entry(fcport, &vha->vp_fcports, list) {
3028 if (atomic_read(&vha->loop_down_timer) ||
3029 test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags))
3046 qla2x00_fabric_dev_login(vha, fcport, &next_loopid);
3058 if (atomic_read(&vha->loop_down_timer) ||
3059 test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags))
3071 qla2x00_fabric_dev_login(vha, fcport, &next_loopid);
3073 if (vha->vp_idx) {
3074 fcport->vha = vha;
3075 fcport->vp_idx = vha->vp_idx;
3077 list_move_tail(&fcport->list, &vha->vp_fcports);
3089 "rval=%d\n", vha->host_no, rval));
3109 qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha,
3121 struct qla_hw_data *ha = vha->hw;
3132 "on GA_NXT\n", vha->host_no));
3134 if (qla2x00_gid_pt(vha, swl) != QLA_SUCCESS) {
3137 } else if (qla2x00_gpn_id(vha, swl) != QLA_SUCCESS) {
3140 } else if (qla2x00_gnn_id(vha, swl) != QLA_SUCCESS) {
3144 qla2x00_gfpn_id(vha, swl) == QLA_SUCCESS) {
3145 qla2x00_gpsc(vha, swl);
3150 qla2x00_gff_id(vha, swl);
3155 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL);
3168 if (qla2x00_is_reserved_id(vha, loop_id))
3172 (atomic_read(&vha->loop_down_timer) ||
3173 LOOP_TRANSITION(vha))) {
3174 atomic_set(&vha->loop_down_timer, 0);
3175 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
3176 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
3201 rval = qla2x00_ga_nxt(vha, new_fcport);
3222 vha->host_no, new_fcport->d_id.b.domain,
3251 (vha->d_id.b24 & 0xffff00)) && ha->current_topology ==
3267 list_for_each_entry(fcport, &vha->vp_fcports, list) {
3310 ha->isp_ops->fabric_logout(vha, fcport->loop_id,
3326 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL);
3356 qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev)
3362 struct qla_hw_data *ha = vha->hw;
3374 if (dev->loop_id == vha->loop_id)
3378 while (qla2x00_is_reserved_id(vha, dev->loop_id))
3436 qla2x00_device_resync(scsi_qla_host_t *vha)
3448 while (vha->rscn_out_ptr != vha->rscn_in_ptr ||
3449 vha->flags.rscn_queue_overflow) {
3451 rscn_entry = vha->rscn_queue[vha->rscn_out_ptr];
3459 vha->host_no, vha->rscn_out_ptr, format, d_id.b.domain,
3462 vha->rscn_out_ptr++;
3463 if (vha->rscn_out_ptr == MAX_RSCN_COUNT)
3464 vha->rscn_out_ptr = 0;
3467 for (rscn_out_iter = vha->rscn_out_ptr;
3468 !vha->flags.rscn_queue_overflow &&
3469 rscn_out_iter != vha->rscn_in_ptr;
3473 if (rscn_entry != vha->rscn_queue[rscn_out_iter])
3477 "entry found at [%d].\n", vha->host_no,
3480 vha->rscn_out_ptr = rscn_out_iter;
3484 if (vha->flags.rscn_queue_overflow) {
3486 "overflow.\n", vha->host_no));
3489 vha->flags.rscn_queue_overflow = 0;
3505 vha->rscn_out_ptr = vha->rscn_in_ptr;
3511 list_for_each_entry(fcport, &vha->vp_fcports, list) {
3520 qla2x00_mark_device_lost(vha, fcport,
3546 qla2x00_fabric_dev_login(scsi_qla_host_t *vha, fc_port_t *fcport,
3552 struct qla_hw_data *ha = vha->hw;
3561 rval = qla2x00_post_async_login_work(vha, fcport, NULL);
3567 rval = qla2x00_fabric_login(vha, fcport, next_loopid);
3573 rval = qla2x00_get_port_database(vha, fcport, opts);
3575 ha->isp_ops->fabric_logout(vha, fcport->loop_id,
3578 qla2x00_mark_device_lost(vha, fcport, 1, 0);
3580 qla2x00_update_fcport(vha, fcport);
3602 qla2x00_fabric_login(scsi_qla_host_t *vha, fc_port_t *fcport,
3609 struct qla_hw_data *ha = vha->hw;
3617 vha->host_no, fcport->loop_id, fcport->d_id.b.domain,
3621 ha->isp_ops->fabric_login(vha, fcport->loop_id,
3677 rval = qla2x00_find_new_loop_id(vha, fcport);
3689 ha->isp_ops->fabric_logout(vha, fcport->loop_id,
3692 qla2x00_mark_device_lost(vha, fcport, 1, 0);
3702 __func__, vha->host_no, mb[0],
3707 ha->isp_ops->fabric_logout(vha, fcport->loop_id,
3735 qla2x00_local_device_login(scsi_qla_host_t *vha, fc_port_t *fcport)
3741 rval = qla2x00_login_local_device(vha, fcport, mb, BIT_0);
3765 qla2x00_loop_resync(scsi_qla_host_t *vha)
3772 if (vha->hw->flags.cpu_affinity_enabled)
3773 req = vha->hw->req_q_map[0];
3775 req = vha->req;
3778 atomic_set(&vha->loop_state, LOOP_UPDATE);
3779 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags);
3780 if (vha->flags.online) {
3781 if (!(rval = qla2x00_fw_ready(vha))) {
3785 atomic_set(&vha->loop_state, LOOP_UPDATE);
3788 qla2x00_marker(vha, req, rsp, 0, 0,
3790 vha->marker_needed = 0;
3793 clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
3795 qla2x00_configure_loop(vha);
3797 } while (!atomic_read(&vha->loop_down_timer) &&
3798 !(test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags))
3800 &vha->dpc_flags)));
3804 if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags))
3817 struct scsi_qla_host *vha;
3823 list_for_each_entry(vha, &base_vha->hw->vp_list, list) {
3824 atomic_inc(&vha->vref_count);
3825 list_for_each_entry(fcport, &vha->vp_fcports, list) {
3835 atomic_dec(&vha->vref_count);
3841 qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha)
3843 struct qla_hw_data *ha = vha->hw;
3847 vha->flags.online = 0;
3849 clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
3857 ha->isp_ops->reset_chip(vha);
3859 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
3860 if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
3861 atomic_set(&vha->loop_state, LOOP_DOWN);
3862 qla2x00_mark_all_devices_lost(vha, 0);
3876 if (!atomic_read(&vha->loop_down_timer))
3877 atomic_set(&vha->loop_down_timer,
3883 if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0,
3891 qla2x00_abort_all_cmds(vha, DID_RESET << 16);
3905 qla2x00_abort_isp(scsi_qla_host_t *vha)
3909 struct qla_hw_data *ha = vha->hw;
3914 if (vha->flags.online) {
3915 qla2x00_abort_isp_cleanup(vha);
3919 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags);
3924 ha->isp_ops->get_flash_version(vha, req->ring);
3926 ha->isp_ops->nvram_config(vha);
3928 if (!qla2x00_restart_isp(vha)) {
3929 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
3931 if (!atomic_read(&vha->loop_down_timer)) {
3936 vha->marker_needed = 1;
3939 vha->flags.online = 1;
3944 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags);
3947 qla2x00_get_fw_version(vha,
3959 rval = qla2x00_enable_fce_trace(vha,
3972 rval = qla2x00_enable_eft_trace(vha,
3981 vha->flags.online = 1;
3982 if (test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
3991 ha->isp_ops->reset_adapter(vha);
3992 vha->flags.online = 0;
3994 &vha->dpc_flags);
4000 vha->host_no, ha->isp_abort_cnt));
4007 vha->host_no, ha->isp_abort_cnt));
4008 set_bit(ISP_ABORT_RETRY, &vha->dpc_flags);
4018 vha->host_no));
4053 qla2x00_restart_isp(scsi_qla_host_t *vha)
4057 struct qla_hw_data *ha = vha->hw;
4062 if (qla2x00_isp_firmware(vha)) {
4063 vha->flags.online = 0;
4064 status = ha->isp_ops->chip_diag(vha);
4066 status = qla2x00_setup_chip(vha);
4069 if (!status && !(status = qla2x00_init_rings(vha))) {
4070 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
4075 status = qla2x00_fw_ready(vha);
4081 qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL);
4083 vha->flags.online = 1;
4087 clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
4088 qla2x00_configure_loop(vha);
4090 } while (!atomic_read(&vha->loop_down_timer) &&
4091 !(test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags))
4093 &vha->dpc_flags)));
4097 if ((vha->device_flags & DFLG_NO_CABLE))
4158 qla2x00_reset_adapter(scsi_qla_host_t *vha)
4161 struct qla_hw_data *ha = vha->hw;
4164 vha->flags.online = 0;
4176 qla24xx_reset_adapter(scsi_qla_host_t *vha)
4179 struct qla_hw_data *ha = vha->hw;
4185 vha->flags.online = 0;
4202 static void qla24xx_nvram_wwn_from_ofw(scsi_qla_host_t *vha,
4206 struct qla_hw_data *ha = vha->hw;
4223 qla24xx_nvram_config(scsi_qla_host_t *vha)
4232 struct qla_hw_data *ha = vha->hw;
4253 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->vpd,
4258 ha->isp_ops->read_nvram(vha, (uint8_t *)dptr, ha->nvram_base,
4263 DEBUG5(printk("scsi(%ld): Contents of NVRAM\n", vha->host_no));
4303 qla24xx_nvram_wwn_from_ofw(vha, nv);
4346 qla2x00_set_model_info(vha, nv->model_name, sizeof(nv->model_name),
4385 memcpy(vha->node_name, icb->node_name, WWN_SIZE);
4386 memcpy(vha->port_name, icb->port_name, WWN_SIZE);
4441 if (!vha->flags.init_done) {
4449 vha->flags.process_response_queue = 0;
4454 "(%d us).\n", vha->host_no, ha->zio_mode,
4463 vha->flags.process_response_queue = 1;
4468 "scsi(%ld): NVRAM configuration failed!\n", vha->host_no));
4474 qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr,
4483 struct qla_hw_data *ha = vha->hw;
4496 qla24xx_read_flash_data(vha, dcode, faddr + 4, 4);
4514 qla24xx_read_flash_data(vha, dcode, faddr, 4);
4528 vha->host_no, risc_addr, dlen, faddr));
4530 qla24xx_read_flash_data(vha, dcode, faddr, dlen);
4534 rval = qla2x00_load_ram(vha, req->dma, risc_addr,
4538 "segment %d of firmware\n", vha->host_no,
4562 qla2x00_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
4569 struct qla_hw_data *ha = vha->hw;
4573 blob = qla2x00_request_firmware(vha);
4630 "addr %x, number of words 0x%x.\n", vha->host_no,
4636 rval = qla2x00_load_ram(vha, req->dma, risc_addr,
4640 "segment %d of firmware\n", vha->host_no,
4664 qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr)
4674 struct qla_hw_data *ha = vha->hw;
4678 blob = qla2x00_request_firmware(vha);
4741 "addr %x, number of dwords 0x%x.\n", vha->host_no,
4747 rval = qla2x00_load_ram(vha, req->dma, risc_addr,
4751 "segment %d of firmware\n", vha->host_no,
4775 qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
4780 return qla81xx_load_risc(vha, srisc_addr);
4787 rval = qla24xx_load_risc_blob(vha, srisc_addr);
4791 return qla24xx_load_risc_flash(vha, srisc_addr,
4792 vha->hw->flt_region_fw);
4796 qla81xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
4799 struct qla_hw_data *ha = vha->hw;
4810 rval = qla24xx_load_risc_flash(vha, srisc_addr, ha->flt_region_fw);
4815 rval = qla24xx_load_risc_blob(vha, srisc_addr);
4821 rval = qla24xx_load_risc_flash(vha, srisc_addr, ha->flt_region_gold_fw);
4833 qla2x00_try_to_stop_firmware(scsi_qla_host_t *vha)
4836 struct qla_hw_data *ha = vha->hw;
4845 ret = qla2x00_stop_firmware(vha);
4848 ha->isp_ops->reset_chip(vha);
4849 if (ha->isp_ops->chip_diag(vha) != QLA_SUCCESS)
4851 if (qla2x00_setup_chip(vha) != QLA_SUCCESS)
4855 ret = qla2x00_stop_firmware(vha);
4860 qla24xx_configure_vhba(scsi_qla_host_t *vha)
4864 struct qla_hw_data *ha = vha->hw;
4869 if (!vha->vp_idx)
4876 req = vha->req;
4880 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
4881 qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL);
4884 vha->flags.management_server_logged_in = 0;
4887 ha->isp_ops->fabric_login(vha, NPH_SNS, 0xff, 0xff, 0xfc, mb, BIT_1);
4896 atomic_set(&vha->loop_down_timer, 0);
4897 atomic_set(&vha->loop_state, LOOP_UP);
4898 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
4899 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
4911 qla84xx_get_chip(struct scsi_qla_host *vha)
4914 struct qla_hw_data *ha = vha->hw;
4954 qla84xx_put_chip(struct scsi_qla_host *vha)
4956 struct qla_hw_data *ha = vha->hw;
4962 qla84xx_init_chip(scsi_qla_host_t *vha)
4966 struct qla_hw_data *ha = vha->hw;
4970 rval = qla84xx_verify_chip(vha, status);
4981 qla81xx_nvram_config(scsi_qla_host_t *vha)
4990 struct qla_hw_data *ha = vha->hw;
5002 ha->isp_ops->read_optrom(vha, ha->vpd, ha->flt_region_vpd << 2,
5006 ha->isp_ops->read_optrom(vha, ha->nvram, ha->flt_region_nvram << 2,
5012 DEBUG5(printk("scsi(%ld): Contents of NVRAM\n", vha->host_no));
5112 qla2x00_set_model_info(vha, nv->model_name, sizeof(nv->model_name),
5148 memcpy(vha->node_name, icb->node_name, WWN_SIZE);
5149 memcpy(vha->port_name, icb->port_name, WWN_SIZE);
5204 if (!vha->flags.init_done) {
5212 vha->flags.process_response_queue = 0;
5217 "(%d us).\n", vha->host_no, ha->zio_mode,
5226 vha->flags.process_response_queue = 1;
5231 "scsi(%ld): NVRAM configuration failed!\n", vha->host_no));
5237 qla82xx_restart_isp(scsi_qla_host_t *vha)
5241 struct qla_hw_data *ha = vha->hw;
5247 status = qla2x00_init_rings(vha);
5249 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
5252 status = qla2x00_fw_ready(vha);
5259 qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL);
5261 vha->flags.online = 1;
5265 clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
5266 qla2x00_configure_loop(vha);
5268 } while (!atomic_read(&vha->loop_down_timer) &&
5269 !(test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) &&
5271 (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)));
5275 if ((vha->device_flags & DFLG_NO_CABLE))
5284 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
5286 if (!atomic_read(&vha->loop_down_timer)) {
5291 vha->marker_needed = 1;
5294 vha->flags.online = 1;
5299 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags);
5305 rval = qla2x00_enable_fce_trace(vha,
5318 rval = qla2x00_enable_eft_trace(vha,
5331 vha->host_no));
5356 qla81xx_update_fw_options(scsi_qla_host_t *vha)
5358 struct qla_hw_data *ha = vha->hw;
5366 qla2x00_set_fw_options(vha, ha->fw_options);
5388 qla24xx_get_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport)
5396 struct qla_hw_data *ha = vha->hw;
5416 pid2 = vha->d_id.b24 & INVALID_PORT_ID;
5435 wwn1 = wwn_to_u64(vha->port_name);
5518 qla24xx_update_all_fcp_prio(scsi_qla_host_t *vha)
5525 list_for_each_entry(fcport, &vha->vp_fcports, list)
5526 ret = qla24xx_update_fcport_fcp_prio(vha, fcport);