Lines Matching refs:ha

34 qla8044_rd_reg(struct qla_hw_data *ha, ulong addr)
36 return readl((void __iomem *) (ha->nx_pcibase + addr));
40 qla8044_wr_reg(struct qla_hw_data *ha, ulong addr, uint32_t val)
42 writel(val, (void __iomem *)((ha)->nx_pcibase + addr));
49 struct qla_hw_data *ha = vha->hw;
52 return qla8044_rd_reg(ha, qla8044_reg_tbl[crb_reg]);
62 struct qla_hw_data *ha = vha->hw;
65 qla8044_wr_reg(ha, qla8044_reg_tbl[crb_reg], value);
73 struct qla_hw_data *ha = vha->hw;
75 qla8044_wr_reg(ha, QLA8044_CRB_WIN_FUNC(ha->portnum), addr);
76 val = qla8044_rd_reg(ha, QLA8044_CRB_WIN_FUNC(ha->portnum));
92 struct qla_hw_data *ha = vha->hw;
96 *data = qla8044_rd_reg(ha, QLA8044_WILDCARD);
107 struct qla_hw_data *ha = vha->hw;
111 qla8044_wr_reg(ha, QLA8044_WILDCARD, data);
122 * @ha : Pointer to adapter structure
259 struct qla_hw_data *ha = vha->hw;
262 qsnt_state |= (1 << ha->portnum);
272 struct qla_hw_data *ha = vha->hw;
275 qsnt_state &= ~(1 << ha->portnum);
310 struct qla_hw_data *ha = vha->hw;
312 lockid = qla8044_rd_reg(ha, QLA8044_DRV_LOCKRECOVERY);
319 qla8044_wr_reg(ha, QLA8044_DRV_LOCKRECOVERY,
320 (ha->portnum <<
325 lockid = qla8044_rd_reg(ha, QLA8044_DRV_LOCKRECOVERY);
326 if ((lockid & IDC_LOCK_RECOVERY_OWNER_MASK) != (ha->portnum <<
331 , __func__, ha->portnum);
334 qla8044_wr_reg(ha, QLA8044_DRV_LOCKRECOVERY,
335 (ha->portnum << IDC_LOCK_RECOVERY_STATE_SHIFT_BITS) |
339 qla8044_wr_reg(ha, QLA8044_DRV_LOCK_ID, 0xFF);
340 qla8044_rd_reg(ha, QLA8044_DRV_UNLOCK);
343 qla8044_wr_reg(ha, QLA8044_DRV_LOCKRECOVERY, 0);
346 lock = qla8044_rd_reg(ha, QLA8044_DRV_LOCK);
348 lockid = qla8044_rd_reg(ha, QLA8044_DRV_LOCK_ID);
349 lockid = ((lockid + (1 << 8)) & ~0xFF) | ha->portnum;
350 qla8044_wr_reg(ha, QLA8044_DRV_LOCK_ID, lockid);
357 qla8044_idc_lock(struct qla_hw_data *ha)
361 scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
365 status = qla8044_rd_reg(ha, QLA8044_DRV_LOCK);
370 lock_id = qla8044_rd_reg(ha, QLA8044_DRV_LOCK_ID);
371 lock_id = ((lock_id + (1 << 8)) & ~0xFF) | ha->portnum;
372 qla8044_wr_reg(ha, QLA8044_DRV_LOCK_ID, lock_id);
377 first_owner = qla8044_rd_reg(ha, QLA8044_DRV_LOCK_ID);
381 tmo_owner = qla8044_rd_reg(ha, QLA8044_DRV_LOCK_ID);
387 __func__, ha->portnum, func_num, lock_cnt,
396 __func__, ha->portnum);
407 ha->portnum);
416 ha->portnum);
426 qla8044_idc_unlock(struct qla_hw_data *ha)
429 scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
431 id = qla8044_rd_reg(ha, QLA8044_DRV_LOCK_ID);
433 if ((id & 0xFF) != ha->portnum) {
436 __func__, ha->portnum, (id & 0xFF));
440 /* Keep lock counter value, update the ha->func_num to 0xFF */
441 qla8044_wr_reg(ha, QLA8044_DRV_LOCK_ID, (id | 0xFF));
442 qla8044_rd_reg(ha, QLA8044_DRV_UNLOCK);
453 struct qla_hw_data *ha = vha->hw;
456 lock_status = qla8044_rd_reg(ha, QLA8044_FLASH_LOCK);
461 lock_owner = qla8044_rd_reg(ha,
465 __func__, ha->portnum, lock_owner);
471 qla8044_wr_reg(ha, QLA8044_FLASH_LOCK_ID, ha->portnum);
478 struct qla_hw_data *ha = vha->hw;
481 qla8044_wr_reg(ha, QLA8044_FLASH_LOCK_ID, 0xFF);
482 qla8044_rd_reg(ha, QLA8044_FLASH_UNLOCK);
581 struct qla_hw_data *ha = vha->hw;
586 rval = drv_state & (1 << ha->portnum);
588 if (ha->flags.eeh_busy && drv_active)
650 * @ha : Pointer to adapter structure
707 * @ha : Pointer to adapter structure
935 * @ha : Pointer to adapter structure
1127 struct qla_hw_data *ha = vha->hw;
1134 write_lock_irqsave(&ha->hw_lock, flags);
1207 write_unlock_irqrestore(&ha->hw_lock, flags);
1220 struct qla_hw_data *ha = vha->hw;
1223 dest = qla8044_rd_reg(ha, QLA8044_BOOTLOADER_ADDR);
1224 size = qla8044_rd_reg(ha, QLA8044_BOOTLOADER_SIZE);
1275 struct qla_hw_data *ha = vha->hw;
1299 qla8044_wr_reg(ha, QLA8044_FW_IMAGE_VALID, QLA8044_BOOT_FROM_FLASH);
1311 * @ha : Pointer to adapter structure
1320 struct qla_hw_data *ha = vha->hw;
1323 val = qla8044_rd_reg(ha, QLA8044_CMDPEG_STATE);
1364 qla8044_clear_drv_active(struct qla_hw_data *ha)
1367 struct scsi_qla_host *vha = pci_get_drvdata(ha->pdev);
1370 drv_active &= ~(1 << (ha->portnum));
1381 * @ha: pointer to adapter structure
1393 struct qla_hw_data *ha = vha->hw;
1414 if (ha->flags.isp82xx_fw_hung)
1424 qla8044_idc_unlock(ha);
1426 qla8044_idc_lock(ha);
1431 qla8044_clear_drv_active(ha);
1439 idc_ctrl = qla8044_rd_reg(ha, QLA8044_IDC_DRV_CTRL);
1441 qla8044_wr_reg(ha, QLA8044_IDC_DRV_CTRL,
1443 ha->fw_dumped = false;
1480 * @ha : Pointer to adapter structure
1509 * the template and store offsets of stop/start/init offsets in ha->reset_tmplt.
1511 * @ha : Pointer to adapter structure
1611 struct qla_hw_data *ha = vha->hw;
1613 idc_ctrl = qla8044_rd_reg(ha, QLA8044_IDC_DRV_CTRL);
1617 qla8044_wr_reg(ha, QLA8044_IDC_DRV_CTRL, idc_ctrl);
1624 struct qla_hw_data *ha = vha->hw;
1630 drv_state |= (1 << ha->portnum);
1649 struct qla_hw_data *ha = vha->hw;
1655 qla8044_idc_unlock(ha);
1657 ha->isp_ops->get_flash_version(vha, vha->req->ring);
1658 ha->isp_ops->nvram_config(vha);
1659 qla8044_idc_lock(ha);
1676 reset_timeout = jiffies + (ha->fcoe_reset_timeout * HZ);
1682 __func__, ha->portnum, drv_state, drv_active);
1686 qla8044_idc_unlock(ha);
1688 qla8044_idc_lock(ha);
1703 __func__, vha->host_no, ha->portnum,
1713 if ((ha->flags.nic_core_reset_owner) &&
1715 ha->flags.nic_core_reset_owner = 0;
1722 if (!(drv_active & (1 << ha->portnum))) {
1723 ha->flags.nic_core_reset_owner = 0;
1731 if (ha->flags.nic_core_reset_owner ||
1733 ha->flags.nic_core_reset_owner = 0;
1742 struct qla_hw_data *ha = vha->hw;
1748 drv_active |= (1 << ha->portnum);
1760 struct qla_hw_data *ha = vha->hw;
1763 if (drv_active & (1 << ha->portnum))
1773 struct qla_hw_data *ha = vha->hw;
1775 idc_ctrl = qla8044_rd_reg(ha, QLA8044_IDC_DRV_CTRL);
1780 qla8044_wr_reg(ha, QLA8044_IDC_DRV_CTRL, idc_ctrl);
1789 struct qla_hw_data *ha = vha->hw;
1792 if (drv_active == (1 << ha->portnum)) {
1819 idc_ver = qla8044_rd_reg(ha, QLA8044_CRB_IDC_VER_MINOR);
1820 idc_ver &= ~(0x03 << (ha->portnum * 2));
1821 idc_ver |= (QLA8044_IDC_VER_MIN_VALUE << (ha->portnum * 2));
1822 qla8044_wr_reg(ha, QLA8044_CRB_IDC_VER_MINOR, idc_ver);
1833 struct qla_hw_data *ha = vha->hw;
1838 qla8044_idc_lock(ha);
1846 if ((drv_active == (1 << ha->portnum)) && !ql2xdontresethba)
1851 qla8044_clear_drv_active(ha);
1852 qla8044_idc_unlock(ha);
1867 struct qla_hw_data *ha = vha->hw;
1898 qla8044_idc_unlock(ha);
1900 qla8044_idc_lock(ha);
1922 * @ha: pointer to host adapter structure.
1932 struct qla_hw_data *ha = vha->hw;
1944 dev_init_timeout = jiffies + (ha->fcoe_dev_init_timeout * HZ);
1946 qla8044_idc_lock(ha);
1969 ha->flags.nic_core_reset_owner = 0;
1975 qla8044_idc_unlock(ha);
1977 qla8044_idc_lock(ha);
1991 (ha->fcoe_reset_timeout * HZ);
1997 qla8044_idc_unlock(ha);
1999 qla8044_idc_lock(ha);
2003 (ha->fcoe_reset_timeout * HZ);
2006 ha->flags.nic_core_reset_owner = 0;
2007 qla8044_idc_unlock(ha);
2010 qla8044_idc_lock(ha);
2013 qla8044_idc_unlock(ha);
2016 qla8044_idc_lock(ha);
2021 qla8044_idc_unlock(ha);
2123 struct qla_hw_data *ha = vha->hw;
2131 ha->flags.isp82xx_fw_hung = 1;
2139 ha->flags.isp82xx_fw_hung = 1;
2157 if (ha->flags.isp82xx_fw_hung) {
2212 struct qla_hw_data *ha = vha->hw;
2216 ha->md_tmplt_hdr;
2347 struct qla_hw_data *ha = vha->hw;
2376 write_lock_irqsave(&ha->hw_lock, flags);
2394 write_unlock_irqrestore(&ha->hw_lock, flags);
2406 write_unlock_irqrestore(&ha->hw_lock, flags);
2557 struct qla_hw_data *ha = vha->hw;
2571 r_value = readl((void __iomem *)(r_addr + ha->nx_pcibase));
2812 struct qla_hw_data *ha = vha->hw;
2818 tmplt_hdr = ha->md_tmplt_hdr;
2842 struct qla_hw_data *ha = vha->hw;
2848 tmplt_hdr = ha->md_tmplt_hdr;
2899 struct qla_hw_data *ha = vha->hw;
2917 rdmem_buffer = dma_alloc_coherent(&ha->pdev->dev,
2935 ((PCI_FUNC(ha->pdev->devfn) & 0xf) << 0x4);
2982 dma_free_coherent(&ha->pdev->dev, ISP8044_PEX_DMA_READ_SIZE,
3211 * @ha: pointer to adapter structure
3224 struct qla_hw_data *ha = vha->hw;
3226 if (!ha->md_dump) {
3233 if (ha->fw_dumped) {
3236 "-- ignoring request.\n", ha->fw_dump);
3240 ha->fw_dumped = false;
3242 if (!ha->md_tmplt_hdr || !ha->md_dump) {
3248 qla8044_idc_lock(ha);
3249 idc_control = qla8044_rd_reg(ha, QLA8044_IDC_DRV_CTRL);
3254 qla8044_wr_reg(ha, QLA8044_IDC_DRV_CTRL,
3256 qla8044_idc_unlock(ha);
3260 qla8044_idc_unlock(ha);
3269 ha->md_tmplt_hdr;
3270 data_ptr = (uint32_t *)((uint8_t *)ha->md_dump);
3294 __func__, ha->md_dump_size, ha->md_dump_size);
3302 (((uint8_t *)ha->md_tmplt_hdr) + tmplt_hdr->first_entry_offset);
3304 tmplt_hdr->ocm_window_reg[ha->portnum];
3308 if (data_collected > ha->md_dump_size) {
3312 data_collected, ha->md_dump_size);
3326 (ha->md_dump_size - data_collected));
3440 (uint8_t *)((uint8_t *)ha->md_dump);
3449 if (data_collected != ha->md_dump_size) {
3453 data_collected, ha->md_dump_size);
3460 vha->host_no, ha->md_tmplt_hdr, vha->host_no, ha->md_dump);
3461 ha->fw_dumped = true;
3475 struct qla_hw_data *ha = vha->hw;
3478 ha->fw_dumped = true;
3479 ha->prev_minidump_failed = 0;
3484 ha->prev_minidump_failed = 1;
3564 struct qla_hw_data *ha = vha->hw;
3566 ret_val = qla8044_write_flash_status_reg(vha, ha->fdt_wrt_enable);
3581 struct qla_hw_data *ha = vha->hw;
3583 ret_val = qla8044_write_flash_status_reg(vha, ha->fdt_wrt_disable);
3640 * @ha : Pointer to adapter structure
3879 struct qla_hw_data *ha;
3895 ha = rsp->hw;
3896 vha = pci_get_drvdata(ha->pdev);
3898 if (unlikely(pci_channel_offline(ha->pdev)))
3901 leg_int_ptr = qla8044_rd_reg(ha, LEG_INTR_PTR_OFFSET);
3911 pf_bit = ha->portnum << 16;
3917 "ha->pf_bit = 0x%x\n", __func__,
3926 qla8044_wr_reg(ha, LEG_INTR_TRIG_OFFSET, 0);
3928 leg_int_ptr = qla8044_rd_reg(ha, LEG_INTR_PTR_OFFSET);
3933 reg = &ha->iobase->isp82;
3934 spin_lock_irqsave(&ha->hardware_lock, flags);
3970 qla2x00_handle_mbx_completion(ha, status);
3971 spin_unlock_irqrestore(&ha->hardware_lock, flags);
3977 qla8044_idc_dontreset(struct qla_hw_data *ha)
3981 idc_ctrl = qla8044_rd_reg(ha, QLA8044_IDC_DRV_CTRL);
4009 struct qla_hw_data *ha = vha->hw;
4011 qla8044_idc_lock(ha);
4026 if (qla8044_idc_dontreset(ha) == DONTRESET_BIT0) {
4044 qla8044_idc_unlock(ha);
4046 qla8044_idc_lock(ha);
4050 qla8044_idc_unlock(ha);
4052 ha->flags.isp82xx_fw_hung = 0;
4053 ha->flags.nic_core_reset_hdlr_active = 0;
4063 struct qla_hw_data *ha = vha->hw;
4065 if (!ha->allow_cna_fw_dump)
4069 ha->flags.isp82xx_no_md_cap = 1;
4070 qla8044_idc_lock(ha);
4072 qla8044_idc_unlock(ha);