Lines Matching refs:vha

53 	struct qla_hw_data *ha = fcport->vha->hw;  in qla2x00_ctx_sp_timeout()
72 struct scsi_qla_host *vha = sp->fcport->vha; in qla2x00_ctx_sp_free() local
77 mempool_free(sp, sp->fcport->vha->hw->srb_mempool); in qla2x00_ctx_sp_free()
79 QLA_VHA_MARK_NOT_BUSY(vha); in qla2x00_ctx_sp_free()
83 qla2x00_get_ctx_sp(scsi_qla_host_t *vha, fc_port_t *fcport, size_t size, in qla2x00_get_ctx_sp() argument
87 struct qla_hw_data *ha = vha->hw; in qla2x00_get_ctx_sp()
92 QLA_VHA_MARK_BUSY(vha, bail); in qla2x00_get_ctx_sp()
128 QLA_VHA_MARK_NOT_BUSY(vha); in qla2x00_get_ctx_sp()
135 qla2x00_get_async_timeout(struct scsi_qla_host *vha) in qla2x00_get_async_timeout() argument
138 struct qla_hw_data *ha = vha->hw; in qla2x00_get_async_timeout()
160 fcport->vha->host_no, sp->handle, in qla2x00_async_iocb_timeout()
167 qla2x00_post_async_logout_work(fcport->vha, fcport, NULL); in qla2x00_async_iocb_timeout()
172 qla2x00_post_async_login_done_work(fcport->vha, fcport, in qla2x00_async_iocb_timeout()
183 qla2x00_post_async_login_done_work(sp->fcport->vha, sp->fcport, in qla2x00_async_login_ctx_done()
189 qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_login() argument
198 sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx), in qla2x00_async_login()
199 qla2x00_get_async_timeout(vha) + 2); in qla2x00_async_login()
218 "retries=%d.\n", fcport->vha->host_no, sp->handle, fcport->loop_id, in qla2x00_async_login()
235 qla2x00_post_async_logout_done_work(sp->fcport->vha, sp->fcport, in qla2x00_async_logout_ctx_done()
241 qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport) in qla2x00_async_logout() argument
249 sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx), in qla2x00_async_logout()
250 qla2x00_get_async_timeout(vha) + 2); in qla2x00_async_logout()
266 fcport->vha->host_no, sp->handle, fcport->loop_id, in qla2x00_async_logout()
282 qla2x00_post_async_adisc_done_work(sp->fcport->vha, sp->fcport, in qla2x00_async_adisc_ctx_done()
288 qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_adisc() argument
297 sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx), in qla2x00_async_adisc()
298 qla2x00_get_async_timeout(vha) + 2); in qla2x00_async_adisc()
316 fcport->vha->host_no, sp->handle, fcport->loop_id, in qla2x00_async_adisc()
333 qla2x00_async_tm_cmd_done(sp->fcport->vha, sp->fcport, iocb); in qla2x00_async_tm_cmd_ctx_done()
341 struct scsi_qla_host *vha = fcport->vha; in qla2x00_async_tm_cmd() local
348 sp = qla2x00_get_ctx_sp(vha, fcport, sizeof(struct srb_ctx), in qla2x00_async_tm_cmd()
349 qla2x00_get_async_timeout(vha) + 2); in qla2x00_async_tm_cmd()
369 fcport->vha->host_no, sp->handle, fcport->loop_id, in qla2x00_async_tm_cmd()
381 qla2x00_async_login_done(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_login_done() argument
390 qla2x00_post_async_adisc_work(vha, fcport, data); in qla2x00_async_login_done()
393 qla2x00_update_fcport(vha, fcport); in qla2x00_async_login_done()
398 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla2x00_async_login_done()
400 qla2x00_mark_device_lost(vha, fcport, 1, 1); in qla2x00_async_login_done()
404 qla2x00_post_async_logout_work(vha, fcport, NULL); in qla2x00_async_login_done()
405 qla2x00_post_async_login_work(vha, fcport, NULL); in qla2x00_async_login_done()
409 rval = qla2x00_find_new_loop_id(vha, fcport); in qla2x00_async_login_done()
412 qla2x00_mark_device_lost(vha, fcport, 1, 1); in qla2x00_async_login_done()
415 qla2x00_post_async_login_work(vha, fcport, NULL); in qla2x00_async_login_done()
422 qla2x00_async_logout_done(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_logout_done() argument
425 qla2x00_mark_device_lost(vha, fcport, 1, 0); in qla2x00_async_logout_done()
430 qla2x00_async_adisc_done(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_adisc_done() argument
434 qla2x00_update_fcport(vha, fcport); in qla2x00_async_adisc_done()
442 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); in qla2x00_async_adisc_done()
444 qla2x00_mark_device_lost(vha, fcport, 1, 1); in qla2x00_async_adisc_done()
450 qla2x00_async_tm_cmd_done(struct scsi_qla_host *vha, fc_port_t *fcport, in qla2x00_async_tm_cmd_done() argument
461 rval = qla2x00_marker(vha, vha->hw->req_q_map[0], in qla2x00_async_tm_cmd_done()
462 vha->hw->rsp_q_map[0], fcport->loop_id, lun, in qla2x00_async_tm_cmd_done()
468 __func__, vha->host_no, rval)); in qla2x00_async_tm_cmd_done()
489 qla2x00_initialize_adapter(scsi_qla_host_t *vha) in qla2x00_initialize_adapter() argument
492 struct qla_hw_data *ha = vha->hw; in qla2x00_initialize_adapter()
496 vha->flags.online = 0; in qla2x00_initialize_adapter()
498 vha->flags.reset_active = 0; in qla2x00_initialize_adapter()
502 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); in qla2x00_initialize_adapter()
503 atomic_set(&vha->loop_state, LOOP_DOWN); in qla2x00_initialize_adapter()
504 vha->device_flags = DFLG_NO_CABLE; in qla2x00_initialize_adapter()
505 vha->dpc_flags = 0; in qla2x00_initialize_adapter()
506 vha->flags.management_server_logged_in = 0; in qla2x00_initialize_adapter()
507 vha->marker_needed = 0; in qla2x00_initialize_adapter()
515 rval = ha->isp_ops->pci_config(vha); in qla2x00_initialize_adapter()
518 vha->host_no)); in qla2x00_initialize_adapter()
522 ha->isp_ops->reset_chip(vha); in qla2x00_initialize_adapter()
524 rval = qla2xxx_get_flash_info(vha); in qla2x00_initialize_adapter()
527 vha->host_no)); in qla2x00_initialize_adapter()
531 ha->isp_ops->get_flash_version(vha, req->ring); in qla2x00_initialize_adapter()
535 ha->isp_ops->nvram_config(vha); in qla2x00_initialize_adapter()
541 vha->port_name[0], vha->port_name[1], in qla2x00_initialize_adapter()
542 vha->port_name[2], vha->port_name[3], in qla2x00_initialize_adapter()
543 vha->port_name[4], vha->port_name[5], in qla2x00_initialize_adapter()
544 vha->port_name[6], vha->port_name[7]); in qla2x00_initialize_adapter()
550 if (qla2x00_isp_firmware(vha) != QLA_SUCCESS) { in qla2x00_initialize_adapter()
551 rval = ha->isp_ops->chip_diag(vha); in qla2x00_initialize_adapter()
554 rval = qla2x00_setup_chip(vha); in qla2x00_initialize_adapter()
560 ha->cs84xx = qla84xx_get_chip(vha); in qla2x00_initialize_adapter()
567 rval = qla2x00_init_rings(vha); in qla2x00_initialize_adapter()
572 rval = qla84xx_init_chip(vha); in qla2x00_initialize_adapter()
576 qla84xx_put_chip(vha); in qla2x00_initialize_adapter()
581 qla24xx_read_fcp_prio_cfg(vha); in qla2x00_initialize_adapter()
593 qla2100_pci_config(scsi_qla_host_t *vha) in qla2100_pci_config() argument
597 struct qla_hw_data *ha = vha->hw; in qla2100_pci_config()
624 qla2300_pci_config(scsi_qla_host_t *vha) in qla2300_pci_config() argument
629 struct qla_hw_data *ha = vha->hw; in qla2300_pci_config()
706 qla24xx_pci_config(scsi_qla_host_t *vha) in qla24xx_pci_config() argument
710 struct qla_hw_data *ha = vha->hw; in qla24xx_pci_config()
750 qla25xx_pci_config(scsi_qla_host_t *vha) in qla25xx_pci_config() argument
753 struct qla_hw_data *ha = vha->hw; in qla25xx_pci_config()
781 qla2x00_isp_firmware(scsi_qla_host_t *vha) in qla2x00_isp_firmware() argument
786 struct qla_hw_data *ha = vha->hw; in qla2x00_isp_firmware()
793 vha->host_no)); in qla2x00_isp_firmware()
797 rval = qla2x00_verify_checksum(vha, ha->fw_srisc_address); in qla2x00_isp_firmware()
800 rval = qla2x00_get_adapter_id(vha, &loop_id, &al_pa, in qla2x00_isp_firmware()
807 vha->host_no)); in qla2x00_isp_firmware()
820 qla2x00_reset_chip(scsi_qla_host_t *vha) in qla2x00_reset_chip() argument
823 struct qla_hw_data *ha = vha->hw; in qla2x00_reset_chip()
963 qla81xx_reset_mpi(scsi_qla_host_t *vha) in qla81xx_reset_mpi() argument
967 return qla81xx_write_mpi_register(vha, mb); in qla81xx_reset_mpi()
977 qla24xx_reset_risc(scsi_qla_host_t *vha) in qla24xx_reset_risc() argument
980 struct qla_hw_data *ha = vha->hw; in qla24xx_reset_risc()
1019 if (test_and_clear_bit(MPI_RESET_NEEDED, &vha->dpc_flags)) { in qla24xx_reset_risc()
1020 if (qla81xx_reset_mpi(vha) != QLA_SUCCESS) { in qla24xx_reset_risc()
1022 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla24xx_reset_risc()
1023 set_bit(MPI_RESET_NEEDED, &vha->dpc_flags); in qla24xx_reset_risc()
1030 vha->flags.online = 0; in qla24xx_reset_risc()
1064 qla24xx_reset_chip(scsi_qla_host_t *vha) in qla24xx_reset_chip() argument
1066 struct qla_hw_data *ha = vha->hw; in qla24xx_reset_chip()
1076 qla24xx_reset_risc(vha); in qla24xx_reset_chip()
1086 qla2x00_chip_diag(scsi_qla_host_t *vha) in qla2x00_chip_diag() argument
1089 struct qla_hw_data *ha = vha->hw; in qla2x00_chip_diag()
1101 vha->host_no, (u_long)&reg->flash_address)); in qla2x00_chip_diag()
1124 vha->host_no)); in qla2x00_chip_diag()
1145 DEBUG3(printk("scsi(%ld): Checking product ID of chip\n", vha->host_no)); in qla2x00_chip_diag()
1174 vha->host_no)); in qla2x00_chip_diag()
1183 DEBUG3(printk("scsi(%ld): Checking mailboxes.\n", vha->host_no)); in qla2x00_chip_diag()
1184 rval = qla2x00_mbx_reg_test(vha); in qla2x00_chip_diag()
1187 vha->host_no)); in qla2x00_chip_diag()
1200 "****\n", vha->host_no)); in qla2x00_chip_diag()
1214 qla24xx_chip_diag(scsi_qla_host_t *vha) in qla24xx_chip_diag() argument
1217 struct qla_hw_data *ha = vha->hw; in qla24xx_chip_diag()
1225 rval = qla2x00_mbx_reg_test(vha); in qla24xx_chip_diag()
1228 vha->host_no)); in qla24xx_chip_diag()
1240 qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) in qla2x00_alloc_fw_dump() argument
1247 struct qla_hw_data *ha = vha->hw; in qla2x00_alloc_fw_dump()
1289 rval = qla2x00_enable_fce_trace(vha, tc_dma, FCE_NUM_BUFFERS, in qla2x00_alloc_fw_dump()
1318 rval = qla2x00_enable_eft_trace(vha, tc_dma, EFT_NUM_BUFFERS); in qla2x00_alloc_fw_dump()
1387 qla81xx_mpi_sync(scsi_qla_host_t *vha) in qla81xx_mpi_sync() argument
1393 struct qla_hw_data *ha = vha->hw; in qla81xx_mpi_sync()
1395 if (!IS_QLA81XX(vha->hw)) in qla81xx_mpi_sync()
1398 rval = qla2x00_write_ram_word(vha, 0x7c00, 1); in qla81xx_mpi_sync()
1405 pci_read_config_word(vha->hw->pdev, 0x54, &dc); in qla81xx_mpi_sync()
1406 rval = qla2x00_read_ram_word(vha, 0x7a15, &dw); in qla81xx_mpi_sync()
1419 rval = qla2x00_write_ram_word(vha, 0x7a15, dw); in qla81xx_mpi_sync()
1426 rval = qla2x00_write_ram_word(vha, 0x7c00, 0); in qla81xx_mpi_sync()
1443 qla2x00_setup_chip(scsi_qla_host_t *vha) in qla2x00_setup_chip() argument
1447 struct qla_hw_data *ha = vha->hw; in qla2x00_setup_chip()
1453 rval = ha->isp_ops->load_risc(vha, &srisc_address); in qla2x00_setup_chip()
1455 qla2x00_stop_firmware(vha); in qla2x00_setup_chip()
1469 qla81xx_mpi_sync(vha); in qla2x00_setup_chip()
1472 rval = ha->isp_ops->load_risc(vha, &srisc_address); in qla2x00_setup_chip()
1475 "code.\n", vha->host_no)); in qla2x00_setup_chip()
1477 rval = qla2x00_verify_checksum(vha, srisc_address); in qla2x00_setup_chip()
1481 "firmware.\n", vha->host_no)); in qla2x00_setup_chip()
1483 rval = qla2x00_execute_fw(vha, srisc_address); in qla2x00_setup_chip()
1488 rval = qla2x00_get_fw_version(vha, in qla2x00_setup_chip()
1507 qla2x00_get_resource_cnts(vha, NULL, in qla2x00_setup_chip()
1513 qla2x00_alloc_fw_dump(vha); in qla2x00_setup_chip()
1519 vha->host_no)); in qla2x00_setup_chip()
1539 rval = qla81xx_fac_get_sector_size(vha, &size); in qla2x00_setup_chip()
1553 vha->host_no)); in qla2x00_setup_chip()
1591 qla2x00_update_fw_options(scsi_qla_host_t *vha) in qla2x00_update_fw_options() argument
1594 struct qla_hw_data *ha = vha->hw; in qla2x00_update_fw_options()
1597 qla2x00_get_fw_options(vha, ha->fw_options); in qla2x00_update_fw_options()
1604 vha->host_no)); in qla2x00_update_fw_options()
1662 qla2x00_set_fw_options(vha, ha->fw_options); in qla2x00_update_fw_options()
1666 qla24xx_update_fw_options(scsi_qla_host_t *vha) in qla24xx_update_fw_options() argument
1669 struct qla_hw_data *ha = vha->hw; in qla24xx_update_fw_options()
1678 rval = qla2x00_set_serdes_params(vha, in qla24xx_update_fw_options()
1689 qla2x00_config_rings(struct scsi_qla_host *vha) in qla2x00_config_rings() argument
1691 struct qla_hw_data *ha = vha->hw; in qla2x00_config_rings()
1714 qla24xx_config_rings(struct scsi_qla_host *vha) in qla24xx_config_rings() argument
1716 struct qla_hw_data *ha = vha->hw; in qla24xx_config_rings()
1791 qla2x00_init_rings(scsi_qla_host_t *vha) in qla2x00_init_rings() argument
1796 struct qla_hw_data *ha = vha->hw; in qla2x00_init_rings()
1838 ha->isp_ops->config_rings(vha); in qla2x00_init_rings()
1843 ha->isp_ops->update_fw_options(vha); in qla2x00_init_rings()
1845 DEBUG(printk("scsi(%ld): Issue init firmware.\n", vha->host_no)); in qla2x00_init_rings()
1859 rval = qla2x00_init_firmware(vha, ha->init_cb_size); in qla2x00_init_rings()
1862 vha->host_no)); in qla2x00_init_rings()
1865 vha->host_no)); in qla2x00_init_rings()
1878 qla2x00_fw_ready(scsi_qla_host_t *vha) in qla2x00_fw_ready() argument
1885 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_ready()
1907 if (!vha->flags.init_done) in qla2x00_fw_ready()
1911 vha->host_no)); in qla2x00_fw_ready()
1914 rval = qla2x00_get_firmware_state(vha, state); in qla2x00_fw_ready()
1917 vha->device_flags &= ~DFLG_NO_CABLE; in qla2x00_fw_ready()
1921 "84xx=%x.\n", vha->host_no, state[0], in qla2x00_fw_ready()
1926 "verify iocb.\n", vha->host_no)); in qla2x00_fw_ready()
1929 rval = qla84xx_init_chip(vha); in qla2x00_fw_ready()
1939 vha->host_no, cs84xx_time, wtime)); in qla2x00_fw_ready()
1943 vha->host_no)); in qla2x00_fw_ready()
1945 qla2x00_get_retry_cnt(vha, &ha->retry_count, in qla2x00_fw_ready()
1954 if (atomic_read(&vha->loop_down_timer) && in qla2x00_fw_ready()
1963 vha->device_flags |= DFLG_NO_CABLE; in qla2x00_fw_ready()
1981 vha->host_no, state[0], jiffies)); in qla2x00_fw_ready()
1985 vha->host_no, state[0], state[1], state[2], state[3], state[4], in qla2x00_fw_ready()
1990 vha->host_no)); in qla2x00_fw_ready()
2010 qla2x00_configure_hba(scsi_qla_host_t *vha) in qla2x00_configure_hba() argument
2020 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_hba()
2023 rval = qla2x00_get_adapter_id(vha, in qla2x00_configure_hba()
2026 if (LOOP_TRANSITION(vha) || atomic_read(&ha->loop_down_timer) || in qla2x00_configure_hba()
2030 __func__, vha->host_no)); in qla2x00_configure_hba()
2034 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_configure_hba()
2045 vha->loop_id = loop_id; in qla2x00_configure_hba()
2055 vha->host_no)); in qla2x00_configure_hba()
2062 vha->host_no)); in qla2x00_configure_hba()
2070 vha->host_no)); in qla2x00_configure_hba()
2078 vha->host_no)); in qla2x00_configure_hba()
2088 vha->host_no, topo)); in qla2x00_configure_hba()
2096 vha->d_id.b.domain = domain; in qla2x00_configure_hba()
2097 vha->d_id.b.area = area; in qla2x00_configure_hba()
2098 vha->d_id.b.al_pa = al_pa; in qla2x00_configure_hba()
2100 if (!vha->flags.init_done) in qla2x00_configure_hba()
2103 connect_type, vha->loop_id); in qla2x00_configure_hba()
2106 DEBUG2_3(printk("scsi(%ld): FAILED.\n", vha->host_no)); in qla2x00_configure_hba()
2108 DEBUG3(printk("scsi(%ld): exiting normally.\n", vha->host_no)); in qla2x00_configure_hba()
2115 qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len, in qla2x00_set_model_info() argument
2120 struct qla_hw_data *ha = vha->hw; in qla2x00_set_model_info()
2156 qla2xxx_get_vpd_field(vha, "\x82", ha->model_desc, in qla2x00_set_model_info()
2163 static void qla2xxx_nvram_wwn_from_ofw(scsi_qla_host_t *vha, nvram_t *nv) in qla2xxx_nvram_wwn_from_ofw() argument
2166 struct qla_hw_data *ha = vha->hw; in qla2xxx_nvram_wwn_from_ofw()
2196 qla2x00_nvram_config(scsi_qla_host_t *vha) in qla2x00_nvram_config() argument
2202 struct qla_hw_data *ha = vha->hw; in qla2x00_nvram_config()
2218 ha->isp_ops->read_nvram(vha, ptr, ha->nvram_base, ha->nvram_size); in qla2x00_nvram_config()
2222 DEBUG5(printk("scsi(%ld): Contents of NVRAM\n", vha->host_no)); in qla2x00_nvram_config()
2269 qla2xxx_nvram_wwn_from_ofw(vha, nv); in qla2x00_nvram_config()
2323 qla2x00_set_model_info(vha, nv->model_number, in qla2x00_nvram_config()
2399 memcpy(vha->node_name, icb->node_name, WWN_SIZE); in qla2x00_nvram_config()
2400 memcpy(vha->port_name, icb->port_name, WWN_SIZE); in qla2x00_nvram_config()
2468 vha->flags.process_response_queue = 1; in qla2x00_nvram_config()
2471 if (!vha->flags.init_done) { in qla2x00_nvram_config()
2479 vha->flags.process_response_queue = 0; in qla2x00_nvram_config()
2484 "delay (%d us).\n", vha->host_no, ha->zio_mode, in qla2x00_nvram_config()
2492 vha->flags.process_response_queue = 1; in qla2x00_nvram_config()
2498 "scsi(%ld): NVRAM configuration failed!\n", vha->host_no)); in qla2x00_nvram_config()
2510 spin_lock_irqsave(fcport->vha->host->host_lock, flags); in qla2x00_rport_del()
2513 spin_unlock_irqrestore(fcport->vha->host->host_lock, flags); in qla2x00_rport_del()
2526 qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags) in qla2x00_alloc_fcport() argument
2535 fcport->vha = vha; in qla2x00_alloc_fcport()
2536 fcport->vp_idx = vha->vp_idx; in qla2x00_alloc_fcport()
2558 qla2x00_configure_loop(scsi_qla_host_t *vha) in qla2x00_configure_loop() argument
2562 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_loop()
2566 if (test_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags)) { in qla2x00_configure_loop()
2567 rval = qla2x00_configure_hba(vha); in qla2x00_configure_loop()
2570 vha->host_no)); in qla2x00_configure_loop()
2575 save_flags = flags = vha->dpc_flags; in qla2x00_configure_loop()
2577 vha->host_no, flags)); in qla2x00_configure_loop()
2583 clear_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
2584 clear_bit(RSCN_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
2586 qla2x00_get_data_rate(vha); in qla2x00_configure_loop()
2592 vha->flags.rscn_queue_overflow = 1; in qla2x00_configure_loop()
2598 vha->flags.rscn_queue_overflow = 1; in qla2x00_configure_loop()
2605 } else if (!vha->flags.online || in qla2x00_configure_loop()
2608 vha->flags.rscn_queue_overflow = 1; in qla2x00_configure_loop()
2614 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_configure_loop()
2617 rval = qla2x00_configure_local_loop(vha); in qla2x00_configure_loop()
2621 if (LOOP_TRANSITION(vha)) in qla2x00_configure_loop()
2624 rval = qla2x00_configure_fabric(vha); in qla2x00_configure_loop()
2628 if (atomic_read(&vha->loop_down_timer) || in qla2x00_configure_loop()
2629 test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_loop()
2632 atomic_set(&vha->loop_state, LOOP_READY); in qla2x00_configure_loop()
2634 DEBUG(printk("scsi(%ld): LOOP READY\n", vha->host_no)); in qla2x00_configure_loop()
2640 __func__, vha->host_no)); in qla2x00_configure_loop()
2646 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_loop()
2648 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
2650 set_bit(RSCN_UPDATE, &vha->dpc_flags); in qla2x00_configure_loop()
2652 vha->flags.rscn_queue_overflow = 1; in qla2x00_configure_loop()
2672 qla2x00_configure_local_loop(scsi_qla_host_t *vha) in qla2x00_configure_local_loop() argument
2684 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_local_loop()
2690 DEBUG3(printk("scsi(%ld): Getting FCAL position map\n", vha->host_no)); in qla2x00_configure_local_loop()
2691 DEBUG3(qla2x00_get_fcal_position_map(vha, NULL)); in qla2x00_configure_local_loop()
2695 rval = qla2x00_get_id_list(vha, ha->gid_list, ha->gid_list_dma, in qla2x00_configure_local_loop()
2701 vha->host_no, entries)); in qla2x00_configure_local_loop()
2706 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_configure_local_loop()
2716 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_local_loop()
2723 vha->host_no, fcport->loop_id)); in qla2x00_configure_local_loop()
2749 (area != vha->d_id.b.area || domain != vha->d_id.b.domain)) in qla2x00_configure_local_loop()
2761 new_fcport->vp_idx = vha->vp_idx; in qla2x00_configure_local_loop()
2762 rval2 = qla2x00_get_port_database(vha, new_fcport, 0); in qla2x00_configure_local_loop()
2767 vha->host_no, rval2, new_fcport->loop_id)); in qla2x00_configure_local_loop()
2769 vha->host_no)); in qla2x00_configure_local_loop()
2770 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_configure_local_loop()
2777 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_local_loop()
2795 if (vha->vp_idx) { in qla2x00_configure_local_loop()
2796 new_fcport->vha = vha; in qla2x00_configure_local_loop()
2797 new_fcport->vp_idx = vha->vp_idx; in qla2x00_configure_local_loop()
2799 list_add_tail(&new_fcport->list, &vha->vp_fcports); in qla2x00_configure_local_loop()
2803 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_configure_local_loop()
2814 qla2x00_update_fcport(vha, fcport); in qla2x00_configure_local_loop()
2824 "rval=%x\n", vha->host_no, rval)); in qla2x00_configure_local_loop()
2831 qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_iidma_fcport() argument
2838 struct qla_hw_data *ha = vha->hw; in qla2x00_iidma_fcport()
2850 rval = qla2x00_set_idma_speed(vha, fcport->loop_id, fcport->fp_speed, in qla2x00_iidma_fcport()
2855 vha->host_no, fcport->port_name[0], fcport->port_name[1], in qla2x00_iidma_fcport()
2878 qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_reg_remote_port() argument
2882 struct qla_hw_data *ha = vha->hw; in qla2x00_reg_remote_port()
2892 fcport->rport = rport = fc_remote_port_add(vha->host, 0, &rport_ids); in qla2x00_reg_remote_port()
2898 spin_lock_irqsave(fcport->vha->host->host_lock, flags); in qla2x00_reg_remote_port()
2900 spin_unlock_irqrestore(fcport->vha->host->host_lock, flags); in qla2x00_reg_remote_port()
2928 qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_update_fcport() argument
2930 fcport->vha = vha; in qla2x00_update_fcport()
2934 qla2x00_iidma_fcport(vha, fcport); in qla2x00_update_fcport()
2935 qla24xx_update_fcport_fcp_prio(vha, fcport); in qla2x00_update_fcport()
2936 qla2x00_reg_remote_port(vha, fcport); in qla2x00_update_fcport()
2952 qla2x00_configure_fabric(scsi_qla_host_t *vha) in qla2x00_configure_fabric() argument
2960 struct qla_hw_data *ha = vha->hw; in qla2x00_configure_fabric()
2968 rval = qla2x00_get_port_name(vha, loop_id, vha->fabric_node_name, 1); in qla2x00_configure_fabric()
2971 "Port\n", vha->host_no)); in qla2x00_configure_fabric()
2973 vha->device_flags &= ~SWITCH_FOUND; in qla2x00_configure_fabric()
2976 vha->device_flags |= SWITCH_FOUND; in qla2x00_configure_fabric()
2979 rval2 = qla2x00_device_resync(vha); in qla2x00_configure_fabric()
2987 test_and_clear_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags)) in qla2x00_configure_fabric()
2988 qla2x00_fdmi_register(vha); in qla2x00_configure_fabric()
2995 ha->isp_ops->fabric_login(vha, loop_id, 0xff, 0xff, in qla2x00_configure_fabric()
3005 if (test_and_clear_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags)) { in qla2x00_configure_fabric()
3006 if (qla2x00_rft_id(vha)) { in qla2x00_configure_fabric()
3009 "TYPE failed.\n", vha->host_no)); in qla2x00_configure_fabric()
3011 if (qla2x00_rff_id(vha)) { in qla2x00_configure_fabric()
3014 "Features failed.\n", vha->host_no)); in qla2x00_configure_fabric()
3016 if (qla2x00_rnn_id(vha)) { in qla2x00_configure_fabric()
3019 "failed.\n", vha->host_no)); in qla2x00_configure_fabric()
3020 } else if (qla2x00_rsnn_nn(vha)) { in qla2x00_configure_fabric()
3023 "Node Name failed.\n", vha->host_no)); in qla2x00_configure_fabric()
3027 rval = qla2x00_find_all_fabric_devs(vha, &new_fcports); in qla2x00_configure_fabric()
3035 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_fabric()
3036 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_configure_fabric()
3043 qla2x00_mark_device_lost(vha, fcport, in qla2x00_configure_fabric()
3049 ha->isp_ops->fabric_logout(vha, in qla2x00_configure_fabric()
3066 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_configure_fabric()
3067 if (atomic_read(&vha->loop_down_timer) || in qla2x00_configure_fabric()
3068 test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_configure_fabric()
3085 qla2x00_fabric_dev_login(vha, fcport, &next_loopid); in qla2x00_configure_fabric()
3097 if (atomic_read(&vha->loop_down_timer) || in qla2x00_configure_fabric()
3098 test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) in qla2x00_configure_fabric()
3110 qla2x00_fabric_dev_login(vha, fcport, &next_loopid); in qla2x00_configure_fabric()
3112 if (vha->vp_idx) { in qla2x00_configure_fabric()
3113 fcport->vha = vha; in qla2x00_configure_fabric()
3114 fcport->vp_idx = vha->vp_idx; in qla2x00_configure_fabric()
3116 list_move_tail(&fcport->list, &vha->vp_fcports); in qla2x00_configure_fabric()
3128 "rval=%d\n", vha->host_no, rval)); in qla2x00_configure_fabric()
3148 qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha, in qla2x00_find_all_fabric_devs() argument
3160 struct qla_hw_data *ha = vha->hw; in qla2x00_find_all_fabric_devs()
3171 "on GA_NXT\n", vha->host_no)); in qla2x00_find_all_fabric_devs()
3173 if (qla2x00_gid_pt(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
3176 } else if (qla2x00_gpn_id(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
3179 } else if (qla2x00_gnn_id(vha, swl) != QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
3183 qla2x00_gfpn_id(vha, swl) == QLA_SUCCESS) { in qla2x00_find_all_fabric_devs()
3184 qla2x00_gpsc(vha, swl); in qla2x00_find_all_fabric_devs()
3189 qla2x00_gff_id(vha, swl); in qla2x00_find_all_fabric_devs()
3194 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_find_all_fabric_devs()
3207 if (qla2x00_is_reserved_id(vha, loop_id)) in qla2x00_find_all_fabric_devs()
3211 (atomic_read(&vha->loop_down_timer) || in qla2x00_find_all_fabric_devs()
3212 LOOP_TRANSITION(vha))) { in qla2x00_find_all_fabric_devs()
3213 atomic_set(&vha->loop_down_timer, 0); in qla2x00_find_all_fabric_devs()
3214 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_find_all_fabric_devs()
3215 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla2x00_find_all_fabric_devs()
3240 rval = qla2x00_ga_nxt(vha, new_fcport); in qla2x00_find_all_fabric_devs()
3261 vha->host_no, new_fcport->d_id.b.domain, in qla2x00_find_all_fabric_devs()
3290 (vha->d_id.b24 & 0xffff00)) && ha->current_topology == in qla2x00_find_all_fabric_devs()
3306 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_find_all_fabric_devs()
3349 ha->isp_ops->fabric_logout(vha, fcport->loop_id, in qla2x00_find_all_fabric_devs()
3365 new_fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); in qla2x00_find_all_fabric_devs()
3395 qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev) in qla2x00_find_new_loop_id() argument
3401 struct qla_hw_data *ha = vha->hw; in qla2x00_find_new_loop_id()
3413 if (dev->loop_id == vha->loop_id) in qla2x00_find_new_loop_id()
3417 while (qla2x00_is_reserved_id(vha, dev->loop_id)) in qla2x00_find_new_loop_id()
3475 qla2x00_device_resync(scsi_qla_host_t *vha) in qla2x00_device_resync() argument
3487 while (vha->rscn_out_ptr != vha->rscn_in_ptr || in qla2x00_device_resync()
3488 vha->flags.rscn_queue_overflow) { in qla2x00_device_resync()
3490 rscn_entry = vha->rscn_queue[vha->rscn_out_ptr]; in qla2x00_device_resync()
3498 vha->host_no, vha->rscn_out_ptr, format, d_id.b.domain, in qla2x00_device_resync()
3501 vha->rscn_out_ptr++; in qla2x00_device_resync()
3502 if (vha->rscn_out_ptr == MAX_RSCN_COUNT) in qla2x00_device_resync()
3503 vha->rscn_out_ptr = 0; in qla2x00_device_resync()
3506 for (rscn_out_iter = vha->rscn_out_ptr; in qla2x00_device_resync()
3507 !vha->flags.rscn_queue_overflow && in qla2x00_device_resync()
3508 rscn_out_iter != vha->rscn_in_ptr; in qla2x00_device_resync()
3512 if (rscn_entry != vha->rscn_queue[rscn_out_iter]) in qla2x00_device_resync()
3516 "entry found at [%d].\n", vha->host_no, in qla2x00_device_resync()
3519 vha->rscn_out_ptr = rscn_out_iter; in qla2x00_device_resync()
3523 if (vha->flags.rscn_queue_overflow) { in qla2x00_device_resync()
3525 "overflow.\n", vha->host_no)); in qla2x00_device_resync()
3528 vha->flags.rscn_queue_overflow = 0; in qla2x00_device_resync()
3544 vha->rscn_out_ptr = vha->rscn_in_ptr; in qla2x00_device_resync()
3550 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_device_resync()
3559 qla2x00_mark_device_lost(vha, fcport, in qla2x00_device_resync()
3585 qla2x00_fabric_dev_login(scsi_qla_host_t *vha, fc_port_t *fcport, in qla2x00_fabric_dev_login() argument
3591 struct qla_hw_data *ha = vha->hw; in qla2x00_fabric_dev_login()
3600 rval = qla2x00_post_async_login_work(vha, fcport, NULL); in qla2x00_fabric_dev_login()
3606 rval = qla2x00_fabric_login(vha, fcport, next_loopid); in qla2x00_fabric_dev_login()
3612 rval = qla2x00_get_port_database(vha, fcport, opts); in qla2x00_fabric_dev_login()
3614 ha->isp_ops->fabric_logout(vha, fcport->loop_id, in qla2x00_fabric_dev_login()
3617 qla2x00_mark_device_lost(vha, fcport, 1, 0); in qla2x00_fabric_dev_login()
3619 qla2x00_update_fcport(vha, fcport); in qla2x00_fabric_dev_login()
3641 qla2x00_fabric_login(scsi_qla_host_t *vha, fc_port_t *fcport, in qla2x00_fabric_login() argument
3648 struct qla_hw_data *ha = vha->hw; in qla2x00_fabric_login()
3656 vha->host_no, fcport->loop_id, fcport->d_id.b.domain, in qla2x00_fabric_login()
3660 ha->isp_ops->fabric_login(vha, fcport->loop_id, in qla2x00_fabric_login()
3716 rval = qla2x00_find_new_loop_id(vha, fcport); in qla2x00_fabric_login()
3728 ha->isp_ops->fabric_logout(vha, fcport->loop_id, in qla2x00_fabric_login()
3731 qla2x00_mark_device_lost(vha, fcport, 1, 0); in qla2x00_fabric_login()
3741 __func__, vha->host_no, mb[0], in qla2x00_fabric_login()
3746 ha->isp_ops->fabric_logout(vha, fcport->loop_id, in qla2x00_fabric_login()
3774 qla2x00_local_device_login(scsi_qla_host_t *vha, fc_port_t *fcport) in qla2x00_local_device_login() argument
3780 rval = qla2x00_login_local_device(vha, fcport, mb, BIT_0); in qla2x00_local_device_login()
3804 qla2x00_loop_resync(scsi_qla_host_t *vha) in qla2x00_loop_resync() argument
3811 if (vha->hw->flags.cpu_affinity_enabled) in qla2x00_loop_resync()
3812 req = vha->hw->req_q_map[0]; in qla2x00_loop_resync()
3814 req = vha->req; in qla2x00_loop_resync()
3817 atomic_set(&vha->loop_state, LOOP_UPDATE); in qla2x00_loop_resync()
3818 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_loop_resync()
3819 if (vha->flags.online) { in qla2x00_loop_resync()
3820 if (!(rval = qla2x00_fw_ready(vha))) { in qla2x00_loop_resync()
3824 atomic_set(&vha->loop_state, LOOP_UPDATE); in qla2x00_loop_resync()
3827 qla2x00_marker(vha, req, rsp, 0, 0, in qla2x00_loop_resync()
3829 vha->marker_needed = 0; in qla2x00_loop_resync()
3832 clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_loop_resync()
3834 qla2x00_configure_loop(vha); in qla2x00_loop_resync()
3836 } while (!atomic_read(&vha->loop_down_timer) && in qla2x00_loop_resync()
3837 !(test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) in qla2x00_loop_resync()
3839 &vha->dpc_flags))); in qla2x00_loop_resync()
3843 if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) in qla2x00_loop_resync()
3887 struct scsi_qla_host *vha; in qla2x00_update_fcports() local
3893 list_for_each_entry(vha, &base_vha->hw->vp_list, list) { in qla2x00_update_fcports()
3894 atomic_inc(&vha->vref_count); in qla2x00_update_fcports()
3895 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_update_fcports()
3905 atomic_dec(&vha->vref_count); in qla2x00_update_fcports()
3919 qla82xx_quiescent_state_cleanup(scsi_qla_host_t *vha) in qla82xx_quiescent_state_cleanup() argument
3921 struct qla_hw_data *ha = vha->hw; in qla82xx_quiescent_state_cleanup()
3928 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { in qla82xx_quiescent_state_cleanup()
3929 atomic_set(&vha->loop_state, LOOP_DOWN); in qla82xx_quiescent_state_cleanup()
3930 qla2x00_mark_all_devices_lost(vha, 0); in qla82xx_quiescent_state_cleanup()
3932 qla2x00_mark_all_devices_lost(vha, 0); in qla82xx_quiescent_state_cleanup()
3934 if (!atomic_read(&vha->loop_down_timer)) in qla82xx_quiescent_state_cleanup()
3935 atomic_set(&vha->loop_down_timer, in qla82xx_quiescent_state_cleanup()
3939 qla2x00_eh_wait_for_pending_commands(vha, 0, 0, WAIT_HOST); in qla82xx_quiescent_state_cleanup()
3943 qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) in qla2x00_abort_isp_cleanup() argument
3945 struct qla_hw_data *ha = vha->hw; in qla2x00_abort_isp_cleanup()
3954 vha->flags.online = 0; in qla2x00_abort_isp_cleanup()
3956 clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_abort_isp_cleanup()
3967 ha->isp_ops->reset_chip(vha); in qla2x00_abort_isp_cleanup()
3969 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); in qla2x00_abort_isp_cleanup()
3970 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { in qla2x00_abort_isp_cleanup()
3971 atomic_set(&vha->loop_state, LOOP_DOWN); in qla2x00_abort_isp_cleanup()
3972 qla2x00_mark_all_devices_lost(vha, 0); in qla2x00_abort_isp_cleanup()
3986 if (!atomic_read(&vha->loop_down_timer)) in qla2x00_abort_isp_cleanup()
3987 atomic_set(&vha->loop_down_timer, in qla2x00_abort_isp_cleanup()
3992 list_for_each_entry(fcport, &vha->vp_fcports, list) in qla2x00_abort_isp_cleanup()
4010 qla82xx_chip_reset_cleanup(vha); in qla2x00_abort_isp_cleanup()
4015 vha->flags.online = 0; in qla2x00_abort_isp_cleanup()
4019 qla2x00_abort_all_cmds(vha, DID_RESET << 16); in qla2x00_abort_isp_cleanup()
4034 qla2x00_abort_isp(scsi_qla_host_t *vha) in qla2x00_abort_isp() argument
4038 struct qla_hw_data *ha = vha->hw; in qla2x00_abort_isp()
4043 if (vha->flags.online) { in qla2x00_abort_isp()
4044 qla2x00_abort_isp_cleanup(vha); in qla2x00_abort_isp()
4048 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
4053 ha->isp_ops->get_flash_version(vha, req->ring); in qla2x00_abort_isp()
4055 ha->isp_ops->nvram_config(vha); in qla2x00_abort_isp()
4057 if (!qla2x00_restart_isp(vha)) { in qla2x00_abort_isp()
4058 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla2x00_abort_isp()
4060 if (!atomic_read(&vha->loop_down_timer)) { in qla2x00_abort_isp()
4065 vha->marker_needed = 1; in qla2x00_abort_isp()
4068 vha->flags.online = 1; in qla2x00_abort_isp()
4073 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
4076 qla2x00_get_fw_version(vha, in qla2x00_abort_isp()
4088 rval = qla2x00_enable_fce_trace(vha, in qla2x00_abort_isp()
4101 rval = qla2x00_enable_eft_trace(vha, in qla2x00_abort_isp()
4110 vha->flags.online = 1; in qla2x00_abort_isp()
4111 if (test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { in qla2x00_abort_isp()
4120 ha->isp_ops->reset_adapter(vha); in qla2x00_abort_isp()
4121 vha->flags.online = 0; in qla2x00_abort_isp()
4123 &vha->dpc_flags); in qla2x00_abort_isp()
4129 vha->host_no, ha->isp_abort_cnt)); in qla2x00_abort_isp()
4136 vha->host_no, ha->isp_abort_cnt)); in qla2x00_abort_isp()
4137 set_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla2x00_abort_isp()
4147 vha->host_no)); in qla2x00_abort_isp()
4182 qla2x00_restart_isp(scsi_qla_host_t *vha) in qla2x00_restart_isp() argument
4186 struct qla_hw_data *ha = vha->hw; in qla2x00_restart_isp()
4191 if (qla2x00_isp_firmware(vha)) { in qla2x00_restart_isp()
4192 vha->flags.online = 0; in qla2x00_restart_isp()
4193 status = ha->isp_ops->chip_diag(vha); in qla2x00_restart_isp()
4195 status = qla2x00_setup_chip(vha); in qla2x00_restart_isp()
4198 if (!status && !(status = qla2x00_init_rings(vha))) { in qla2x00_restart_isp()
4199 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla2x00_restart_isp()
4204 status = qla2x00_fw_ready(vha); in qla2x00_restart_isp()
4210 qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL); in qla2x00_restart_isp()
4212 vha->flags.online = 1; in qla2x00_restart_isp()
4216 clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla2x00_restart_isp()
4217 qla2x00_configure_loop(vha); in qla2x00_restart_isp()
4219 } while (!atomic_read(&vha->loop_down_timer) && in qla2x00_restart_isp()
4220 !(test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) in qla2x00_restart_isp()
4222 &vha->dpc_flags))); in qla2x00_restart_isp()
4226 if ((vha->device_flags & DFLG_NO_CABLE)) in qla2x00_restart_isp()
4287 qla2x00_reset_adapter(scsi_qla_host_t *vha) in qla2x00_reset_adapter() argument
4290 struct qla_hw_data *ha = vha->hw; in qla2x00_reset_adapter()
4293 vha->flags.online = 0; in qla2x00_reset_adapter()
4305 qla24xx_reset_adapter(scsi_qla_host_t *vha) in qla24xx_reset_adapter() argument
4308 struct qla_hw_data *ha = vha->hw; in qla24xx_reset_adapter()
4314 vha->flags.online = 0; in qla24xx_reset_adapter()
4331 static void qla24xx_nvram_wwn_from_ofw(scsi_qla_host_t *vha, in qla24xx_nvram_wwn_from_ofw() argument
4335 struct qla_hw_data *ha = vha->hw; in qla24xx_nvram_wwn_from_ofw()
4352 qla24xx_nvram_config(scsi_qla_host_t *vha) in qla24xx_nvram_config() argument
4361 struct qla_hw_data *ha = vha->hw; in qla24xx_nvram_config()
4382 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->vpd, in qla24xx_nvram_config()
4387 ha->isp_ops->read_nvram(vha, (uint8_t *)dptr, ha->nvram_base, in qla24xx_nvram_config()
4392 DEBUG5(printk("scsi(%ld): Contents of NVRAM\n", vha->host_no)); in qla24xx_nvram_config()
4432 qla24xx_nvram_wwn_from_ofw(vha, nv); in qla24xx_nvram_config()
4475 qla2x00_set_model_info(vha, nv->model_name, sizeof(nv->model_name), in qla24xx_nvram_config()
4514 memcpy(vha->node_name, icb->node_name, WWN_SIZE); in qla24xx_nvram_config()
4515 memcpy(vha->port_name, icb->port_name, WWN_SIZE); in qla24xx_nvram_config()
4570 if (!vha->flags.init_done) { in qla24xx_nvram_config()
4578 vha->flags.process_response_queue = 0; in qla24xx_nvram_config()
4583 "(%d us).\n", vha->host_no, ha->zio_mode, in qla24xx_nvram_config()
4592 vha->flags.process_response_queue = 1; in qla24xx_nvram_config()
4597 "scsi(%ld): NVRAM configuration failed!\n", vha->host_no)); in qla24xx_nvram_config()
4603 qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr, in qla24xx_load_risc_flash() argument
4612 struct qla_hw_data *ha = vha->hw; in qla24xx_load_risc_flash()
4625 qla24xx_read_flash_data(vha, dcode, faddr + 4, 4); in qla24xx_load_risc_flash()
4643 qla24xx_read_flash_data(vha, dcode, faddr, 4); in qla24xx_load_risc_flash()
4657 vha->host_no, risc_addr, dlen, faddr)); in qla24xx_load_risc_flash()
4659 qla24xx_read_flash_data(vha, dcode, faddr, dlen); in qla24xx_load_risc_flash()
4663 rval = qla2x00_load_ram(vha, req->dma, risc_addr, in qla24xx_load_risc_flash()
4667 "segment %d of firmware\n", vha->host_no, in qla24xx_load_risc_flash()
4691 qla2x00_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla2x00_load_risc() argument
4698 struct qla_hw_data *ha = vha->hw; in qla2x00_load_risc()
4702 blob = qla2x00_request_firmware(vha); in qla2x00_load_risc()
4759 "addr %x, number of words 0x%x.\n", vha->host_no, in qla2x00_load_risc()
4765 rval = qla2x00_load_ram(vha, req->dma, risc_addr, in qla2x00_load_risc()
4769 "segment %d of firmware\n", vha->host_no, in qla2x00_load_risc()
4793 qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla24xx_load_risc_blob() argument
4803 struct qla_hw_data *ha = vha->hw; in qla24xx_load_risc_blob()
4807 blob = qla2x00_request_firmware(vha); in qla24xx_load_risc_blob()
4870 "addr %x, number of dwords 0x%x.\n", vha->host_no, in qla24xx_load_risc_blob()
4876 rval = qla2x00_load_ram(vha, req->dma, risc_addr, in qla24xx_load_risc_blob()
4880 "segment %d of firmware\n", vha->host_no, in qla24xx_load_risc_blob()
4904 qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla24xx_load_risc() argument
4909 return qla81xx_load_risc(vha, srisc_addr); in qla24xx_load_risc()
4916 rval = qla24xx_load_risc_blob(vha, srisc_addr); in qla24xx_load_risc()
4920 return qla24xx_load_risc_flash(vha, srisc_addr, in qla24xx_load_risc()
4921 vha->hw->flt_region_fw); in qla24xx_load_risc()
4925 qla81xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) in qla81xx_load_risc() argument
4928 struct qla_hw_data *ha = vha->hw; in qla81xx_load_risc()
4939 rval = qla24xx_load_risc_flash(vha, srisc_addr, ha->flt_region_fw); in qla81xx_load_risc()
4944 rval = qla24xx_load_risc_blob(vha, srisc_addr); in qla81xx_load_risc()
4950 rval = qla24xx_load_risc_flash(vha, srisc_addr, ha->flt_region_gold_fw); in qla81xx_load_risc()
4962 qla2x00_try_to_stop_firmware(scsi_qla_host_t *vha) in qla2x00_try_to_stop_firmware() argument
4965 struct qla_hw_data *ha = vha->hw; in qla2x00_try_to_stop_firmware()
4974 ret = qla2x00_stop_firmware(vha); in qla2x00_try_to_stop_firmware()
4977 ha->isp_ops->reset_chip(vha); in qla2x00_try_to_stop_firmware()
4978 if (ha->isp_ops->chip_diag(vha) != QLA_SUCCESS) in qla2x00_try_to_stop_firmware()
4980 if (qla2x00_setup_chip(vha) != QLA_SUCCESS) in qla2x00_try_to_stop_firmware()
4984 ret = qla2x00_stop_firmware(vha); in qla2x00_try_to_stop_firmware()
4989 qla24xx_configure_vhba(scsi_qla_host_t *vha) in qla24xx_configure_vhba() argument
4993 struct qla_hw_data *ha = vha->hw; in qla24xx_configure_vhba()
4998 if (!vha->vp_idx) in qla24xx_configure_vhba()
5005 req = vha->req; in qla24xx_configure_vhba()
5009 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla24xx_configure_vhba()
5010 qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL); in qla24xx_configure_vhba()
5013 vha->flags.management_server_logged_in = 0; in qla24xx_configure_vhba()
5016 ha->isp_ops->fabric_login(vha, NPH_SNS, 0xff, 0xff, 0xfc, mb, BIT_1); in qla24xx_configure_vhba()
5025 atomic_set(&vha->loop_down_timer, 0); in qla24xx_configure_vhba()
5026 atomic_set(&vha->loop_state, LOOP_UP); in qla24xx_configure_vhba()
5027 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla24xx_configure_vhba()
5028 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); in qla24xx_configure_vhba()
5040 qla84xx_get_chip(struct scsi_qla_host *vha) in qla84xx_get_chip() argument
5043 struct qla_hw_data *ha = vha->hw; in qla84xx_get_chip()
5083 qla84xx_put_chip(struct scsi_qla_host *vha) in qla84xx_put_chip() argument
5085 struct qla_hw_data *ha = vha->hw; in qla84xx_put_chip()
5091 qla84xx_init_chip(scsi_qla_host_t *vha) in qla84xx_init_chip() argument
5095 struct qla_hw_data *ha = vha->hw; in qla84xx_init_chip()
5099 rval = qla84xx_verify_chip(vha, status); in qla84xx_init_chip()
5110 qla81xx_nvram_config(scsi_qla_host_t *vha) in qla81xx_nvram_config() argument
5119 struct qla_hw_data *ha = vha->hw; in qla81xx_nvram_config()
5131 ha->isp_ops->read_optrom(vha, ha->vpd, ha->flt_region_vpd << 2, in qla81xx_nvram_config()
5135 ha->isp_ops->read_optrom(vha, ha->nvram, ha->flt_region_nvram << 2, in qla81xx_nvram_config()
5141 DEBUG5(printk("scsi(%ld): Contents of NVRAM\n", vha->host_no)); in qla81xx_nvram_config()
5241 qla2x00_set_model_info(vha, nv->model_name, sizeof(nv->model_name), in qla81xx_nvram_config()
5277 memcpy(vha->node_name, icb->node_name, WWN_SIZE); in qla81xx_nvram_config()
5278 memcpy(vha->port_name, icb->port_name, WWN_SIZE); in qla81xx_nvram_config()
5333 if (!vha->flags.init_done) { in qla81xx_nvram_config()
5341 vha->flags.process_response_queue = 0; in qla81xx_nvram_config()
5346 "(%d us).\n", vha->host_no, ha->zio_mode, in qla81xx_nvram_config()
5355 vha->flags.process_response_queue = 1; in qla81xx_nvram_config()
5360 "scsi(%ld): NVRAM configuration failed!\n", vha->host_no)); in qla81xx_nvram_config()
5366 qla82xx_restart_isp(scsi_qla_host_t *vha) in qla82xx_restart_isp() argument
5370 struct qla_hw_data *ha = vha->hw; in qla82xx_restart_isp()
5376 status = qla2x00_init_rings(vha); in qla82xx_restart_isp()
5378 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla82xx_restart_isp()
5381 status = qla2x00_fw_ready(vha); in qla82xx_restart_isp()
5388 qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL); in qla82xx_restart_isp()
5390 vha->flags.online = 1; in qla82xx_restart_isp()
5394 clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); in qla82xx_restart_isp()
5395 qla2x00_configure_loop(vha); in qla82xx_restart_isp()
5397 } while (!atomic_read(&vha->loop_down_timer) && in qla82xx_restart_isp()
5398 !(test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) && in qla82xx_restart_isp()
5400 (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags))); in qla82xx_restart_isp()
5404 if ((vha->device_flags & DFLG_NO_CABLE)) in qla82xx_restart_isp()
5413 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); in qla82xx_restart_isp()
5415 if (!atomic_read(&vha->loop_down_timer)) { in qla82xx_restart_isp()
5420 vha->marker_needed = 1; in qla82xx_restart_isp()
5423 vha->flags.online = 1; in qla82xx_restart_isp()
5428 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); in qla82xx_restart_isp()
5434 rval = qla2x00_enable_fce_trace(vha, in qla82xx_restart_isp()
5447 rval = qla2x00_enable_eft_trace(vha, in qla82xx_restart_isp()
5460 vha->host_no)); in qla82xx_restart_isp()
5485 qla81xx_update_fw_options(scsi_qla_host_t *vha) in qla81xx_update_fw_options() argument
5487 struct qla_hw_data *ha = vha->hw; in qla81xx_update_fw_options()
5495 qla2x00_set_fw_options(vha, ha->fw_options); in qla81xx_update_fw_options()
5517 qla24xx_get_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport) in qla24xx_get_fcp_prio() argument
5525 struct qla_hw_data *ha = vha->hw; in qla24xx_get_fcp_prio()
5545 pid2 = vha->d_id.b24 & INVALID_PORT_ID; in qla24xx_get_fcp_prio()
5564 wwn1 = wwn_to_u64(vha->port_name); in qla24xx_get_fcp_prio()
5610 qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport) in qla24xx_update_fcport_fcp_prio() argument
5620 priority = qla24xx_get_fcp_prio(vha, fcport); in qla24xx_update_fcport_fcp_prio()
5621 ret = qla24xx_set_fcp_prio(vha, fcport->loop_id, priority, mb); in qla24xx_update_fcport_fcp_prio()
5627 " ret=0x%x\n", vha->host_no, ret)); in qla24xx_update_fcport_fcp_prio()
5646 qla24xx_update_all_fcp_prio(scsi_qla_host_t *vha) in qla24xx_update_all_fcp_prio() argument
5653 list_for_each_entry(fcport, &vha->vp_fcports, list) in qla24xx_update_all_fcp_prio()
5654 ret = qla24xx_update_fcport_fcp_prio(vha, fcport); in qla24xx_update_all_fcp_prio()