Lines Matching refs:ha
38 qla4_8xxx_pci_base_offsetfset(struct scsi_qla_host *ha, unsigned long off) in qla4_8xxx_pci_base_offsetfset() argument
40 if ((off < ha->first_page_group_end) && in qla4_8xxx_pci_base_offsetfset()
41 (off >= ha->first_page_group_start)) in qla4_8xxx_pci_base_offsetfset()
42 return (void __iomem *)(ha->nx_pcibase + off); in qla4_8xxx_pci_base_offsetfset()
359 qla4_82xx_pci_set_crbwindow_2M(struct scsi_qla_host *ha, ulong *off) in qla4_82xx_pci_set_crbwindow_2M() argument
363 ha->crb_win = CRB_HI(*off); in qla4_82xx_pci_set_crbwindow_2M()
364 writel(ha->crb_win, in qla4_82xx_pci_set_crbwindow_2M()
365 (void __iomem *)(CRB_WINDOW_2M + ha->nx_pcibase)); in qla4_82xx_pci_set_crbwindow_2M()
369 win_read = readl((void __iomem *)(CRB_WINDOW_2M + ha->nx_pcibase)); in qla4_82xx_pci_set_crbwindow_2M()
370 if (win_read != ha->crb_win) { in qla4_82xx_pci_set_crbwindow_2M()
371 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_82xx_pci_set_crbwindow_2M()
373 " off=0x%lx\n", __func__, ha->crb_win, win_read, *off)); in qla4_82xx_pci_set_crbwindow_2M()
375 *off = (*off & MASK(16)) + CRB_INDIRECT_2M + ha->nx_pcibase; in qla4_82xx_pci_set_crbwindow_2M()
383 static int qla4_82xx_crb_win_lock(struct scsi_qla_host *ha) in qla4_82xx_crb_win_lock() argument
389 done = qla4_82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM7_LOCK)); in qla4_82xx_crb_win_lock()
398 qla4_82xx_wr_32(ha, QLA82XX_CRB_WIN_LOCK_ID, ha->func_num); in qla4_82xx_crb_win_lock()
402 void qla4_82xx_crb_win_unlock(struct scsi_qla_host *ha) in qla4_82xx_crb_win_unlock() argument
404 qla4_82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM7_UNLOCK)); in qla4_82xx_crb_win_unlock()
408 qla4_82xx_wr_32(struct scsi_qla_host *ha, ulong off, u32 data) in qla4_82xx_wr_32() argument
413 rv = qla4_82xx_pci_get_crb_addr_2M(ha, &off); in qla4_82xx_wr_32()
418 write_lock_irqsave(&ha->hw_lock, flags); in qla4_82xx_wr_32()
419 qla4_82xx_crb_win_lock(ha); in qla4_82xx_wr_32()
420 qla4_82xx_pci_set_crbwindow_2M(ha, &off); in qla4_82xx_wr_32()
426 qla4_82xx_crb_win_unlock(ha); in qla4_82xx_wr_32()
427 write_unlock_irqrestore(&ha->hw_lock, flags); in qla4_82xx_wr_32()
431 uint32_t qla4_82xx_rd_32(struct scsi_qla_host *ha, ulong off) in qla4_82xx_rd_32() argument
437 rv = qla4_82xx_pci_get_crb_addr_2M(ha, &off); in qla4_82xx_rd_32()
442 write_lock_irqsave(&ha->hw_lock, flags); in qla4_82xx_rd_32()
443 qla4_82xx_crb_win_lock(ha); in qla4_82xx_rd_32()
444 qla4_82xx_pci_set_crbwindow_2M(ha, &off); in qla4_82xx_rd_32()
449 qla4_82xx_crb_win_unlock(ha); in qla4_82xx_rd_32()
450 write_unlock_irqrestore(&ha->hw_lock, flags); in qla4_82xx_rd_32()
456 int qla4_82xx_md_rd_32(struct scsi_qla_host *ha, uint32_t off, uint32_t *data) in qla4_82xx_md_rd_32() argument
462 writel(off_value, (void __iomem *)(CRB_WINDOW_2M + ha->nx_pcibase)); in qla4_82xx_md_rd_32()
468 win_read = readl((void __iomem *)(CRB_WINDOW_2M + ha->nx_pcibase)); in qla4_82xx_md_rd_32()
470 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_82xx_md_rd_32()
477 ha->nx_pcibase)); in qla4_82xx_md_rd_32()
482 int qla4_82xx_md_wr_32(struct scsi_qla_host *ha, uint32_t off, uint32_t data) in qla4_82xx_md_wr_32() argument
488 writel(off_value, (void __iomem *)(CRB_WINDOW_2M + ha->nx_pcibase)); in qla4_82xx_md_wr_32()
493 win_read = readl((void __iomem *)(CRB_WINDOW_2M + ha->nx_pcibase)); in qla4_82xx_md_wr_32()
495 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_82xx_md_wr_32()
502 ha->nx_pcibase)); in qla4_82xx_md_wr_32()
518 int qla4_82xx_idc_lock(struct scsi_qla_host *ha) in qla4_82xx_idc_lock() argument
526 done = qla4_82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM5_LOCK)); in qla4_82xx_idc_lock()
538 void qla4_82xx_idc_unlock(struct scsi_qla_host *ha) in qla4_82xx_idc_unlock() argument
540 qla4_82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM5_UNLOCK)); in qla4_82xx_idc_unlock()
544 qla4_82xx_pci_get_crb_addr_2M(struct scsi_qla_host *ha, ulong *off) in qla4_82xx_pci_get_crb_addr_2M() argument
553 QLA82XX_PCI_CAMQM_2M_BASE + ha->nx_pcibase; in qla4_82xx_pci_get_crb_addr_2M()
568 *off = *off + m->start_2M - m->start_128M + ha->nx_pcibase; in qla4_82xx_pci_get_crb_addr_2M()
583 qla4_82xx_pci_mem_bound_check(struct scsi_qla_host *ha, in qla4_82xx_pci_mem_bound_check() argument
599 qla4_82xx_pci_set_window(struct scsi_qla_host *ha, unsigned long long addr) in qla4_82xx_pci_set_window() argument
608 ha->ddr_mn_window = window; in qla4_82xx_pci_set_window()
609 qla4_82xx_wr_32(ha, ha->mn_win_crb | in qla4_82xx_pci_set_window()
611 win_read = qla4_82xx_rd_32(ha, ha->mn_win_crb | in qla4_82xx_pci_set_window()
614 ql4_printk(KERN_WARNING, ha, in qla4_82xx_pci_set_window()
629 ha->ddr_mn_window = window; in qla4_82xx_pci_set_window()
630 qla4_82xx_wr_32(ha, ha->mn_win_crb | in qla4_82xx_pci_set_window()
632 win_read = qla4_82xx_rd_32(ha, ha->mn_win_crb | in qla4_82xx_pci_set_window()
646 ha->qdr_sn_window = window; in qla4_82xx_pci_set_window()
647 qla4_82xx_wr_32(ha, ha->ms_win_crb | in qla4_82xx_pci_set_window()
649 win_read = qla4_82xx_rd_32(ha, in qla4_82xx_pci_set_window()
650 ha->ms_win_crb | QLA82XX_PCI_CRBSPACE); in qla4_82xx_pci_set_window()
673 static int qla4_82xx_pci_is_same_window(struct scsi_qla_host *ha, in qla4_82xx_pci_is_same_window() argument
695 if (ha->qdr_sn_window == window) in qla4_82xx_pci_is_same_window()
702 static int qla4_82xx_pci_mem_read_direct(struct scsi_qla_host *ha, in qla4_82xx_pci_mem_read_direct() argument
713 write_lock_irqsave(&ha->hw_lock, flags); in qla4_82xx_pci_mem_read_direct()
719 start = qla4_82xx_pci_set_window(ha, off); in qla4_82xx_pci_mem_read_direct()
721 (qla4_82xx_pci_is_same_window(ha, off + size - 1) == 0)) { in qla4_82xx_pci_mem_read_direct()
722 write_unlock_irqrestore(&ha->hw_lock, flags); in qla4_82xx_pci_mem_read_direct()
728 addr = qla4_8xxx_pci_base_offsetfset(ha, start); in qla4_82xx_pci_mem_read_direct()
730 write_unlock_irqrestore(&ha->hw_lock, flags); in qla4_82xx_pci_mem_read_direct()
731 mem_base = pci_resource_start(ha->pdev, 0); in qla4_82xx_pci_mem_read_direct()
747 write_lock_irqsave(&ha->hw_lock, flags); in qla4_82xx_pci_mem_read_direct()
767 write_unlock_irqrestore(&ha->hw_lock, flags); in qla4_82xx_pci_mem_read_direct()
775 qla4_82xx_pci_mem_write_direct(struct scsi_qla_host *ha, u64 off, in qla4_82xx_pci_mem_write_direct() argument
786 write_lock_irqsave(&ha->hw_lock, flags); in qla4_82xx_pci_mem_write_direct()
792 start = qla4_82xx_pci_set_window(ha, off); in qla4_82xx_pci_mem_write_direct()
794 (qla4_82xx_pci_is_same_window(ha, off + size - 1) == 0)) { in qla4_82xx_pci_mem_write_direct()
795 write_unlock_irqrestore(&ha->hw_lock, flags); in qla4_82xx_pci_mem_write_direct()
801 addr = qla4_8xxx_pci_base_offsetfset(ha, start); in qla4_82xx_pci_mem_write_direct()
803 write_unlock_irqrestore(&ha->hw_lock, flags); in qla4_82xx_pci_mem_write_direct()
804 mem_base = pci_resource_start(ha->pdev, 0); in qla4_82xx_pci_mem_write_direct()
818 write_lock_irqsave(&ha->hw_lock, flags); in qla4_82xx_pci_mem_write_direct()
838 write_unlock_irqrestore(&ha->hw_lock, flags); in qla4_82xx_pci_mem_write_direct()
878 qla4_82xx_rom_lock(struct scsi_qla_host *ha) in qla4_82xx_rom_lock() argument
886 done = qla4_82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_LOCK)); in qla4_82xx_rom_lock()
895 qla4_82xx_wr_32(ha, QLA82XX_ROM_LOCK_ID, ROM_LOCK_DRIVER); in qla4_82xx_rom_lock()
900 qla4_82xx_rom_unlock(struct scsi_qla_host *ha) in qla4_82xx_rom_unlock() argument
902 qla4_82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_UNLOCK)); in qla4_82xx_rom_unlock()
906 qla4_82xx_wait_rom_done(struct scsi_qla_host *ha) in qla4_82xx_wait_rom_done() argument
912 done = qla4_82xx_rd_32(ha, QLA82XX_ROMUSB_GLB_STATUS); in qla4_82xx_wait_rom_done()
925 qla4_82xx_do_rom_fast_read(struct scsi_qla_host *ha, int addr, int *valp) in qla4_82xx_do_rom_fast_read() argument
927 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_ADDRESS, addr); in qla4_82xx_do_rom_fast_read()
928 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); in qla4_82xx_do_rom_fast_read()
929 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_ABYTE_CNT, 3); in qla4_82xx_do_rom_fast_read()
930 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_INSTR_OPCODE, 0xb); in qla4_82xx_do_rom_fast_read()
931 if (qla4_82xx_wait_rom_done(ha)) { in qla4_82xx_do_rom_fast_read()
936 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); in qla4_82xx_do_rom_fast_read()
938 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_ABYTE_CNT, 0); in qla4_82xx_do_rom_fast_read()
940 *valp = qla4_82xx_rd_32(ha, QLA82XX_ROMUSB_ROM_RDATA); in qla4_82xx_do_rom_fast_read()
945 qla4_82xx_rom_fast_read(struct scsi_qla_host *ha, int addr, int *valp) in qla4_82xx_rom_fast_read() argument
949 while ((qla4_82xx_rom_lock(ha) != 0) && (loops < 50000)) { in qla4_82xx_rom_fast_read()
954 ql4_printk(KERN_WARNING, ha, "%s: qla4_82xx_rom_lock failed\n", in qla4_82xx_rom_fast_read()
958 ret = qla4_82xx_do_rom_fast_read(ha, addr, valp); in qla4_82xx_rom_fast_read()
959 qla4_82xx_rom_unlock(ha); in qla4_82xx_rom_fast_read()
968 qla4_82xx_pinit_from_rom(struct scsi_qla_host *ha, int verbose) in qla4_82xx_pinit_from_rom() argument
982 qla4_82xx_rom_lock(ha); in qla4_82xx_pinit_from_rom()
985 qla4_82xx_wr_32(ha, QLA82XX_CRB_I2Q + 0x10, 0x0); in qla4_82xx_pinit_from_rom()
986 qla4_82xx_wr_32(ha, QLA82XX_CRB_I2Q + 0x14, 0x0); in qla4_82xx_pinit_from_rom()
987 qla4_82xx_wr_32(ha, QLA82XX_CRB_I2Q + 0x18, 0x0); in qla4_82xx_pinit_from_rom()
988 qla4_82xx_wr_32(ha, QLA82XX_CRB_I2Q + 0x1c, 0x0); in qla4_82xx_pinit_from_rom()
989 qla4_82xx_wr_32(ha, QLA82XX_CRB_I2Q + 0x20, 0x0); in qla4_82xx_pinit_from_rom()
990 qla4_82xx_wr_32(ha, QLA82XX_CRB_I2Q + 0x24, 0x0); in qla4_82xx_pinit_from_rom()
993 qla4_82xx_wr_32(ha, QLA82XX_CRB_NIU + 0x40, 0xff); in qla4_82xx_pinit_from_rom()
995 qla4_82xx_wr_32(ha, QLA82XX_CRB_NIU + 0x70000, 0x00); in qla4_82xx_pinit_from_rom()
997 qla4_82xx_wr_32(ha, QLA82XX_CRB_NIU + 0x80000, 0x00); in qla4_82xx_pinit_from_rom()
999 qla4_82xx_wr_32(ha, QLA82XX_CRB_NIU + 0x90000, 0x00); in qla4_82xx_pinit_from_rom()
1001 qla4_82xx_wr_32(ha, QLA82XX_CRB_NIU + 0xa0000, 0x00); in qla4_82xx_pinit_from_rom()
1003 qla4_82xx_wr_32(ha, QLA82XX_CRB_NIU + 0xb0000, 0x00); in qla4_82xx_pinit_from_rom()
1006 val = qla4_82xx_rd_32(ha, QLA82XX_CRB_SRE + 0x1000); in qla4_82xx_pinit_from_rom()
1007 qla4_82xx_wr_32(ha, QLA82XX_CRB_SRE + 0x1000, val & (~(0x1))); in qla4_82xx_pinit_from_rom()
1010 qla4_82xx_wr_32(ha, QLA82XX_CRB_EPG + 0x1300, 0x1); in qla4_82xx_pinit_from_rom()
1013 qla4_82xx_wr_32(ha, QLA82XX_CRB_TIMER + 0x0, 0x0); in qla4_82xx_pinit_from_rom()
1014 qla4_82xx_wr_32(ha, QLA82XX_CRB_TIMER + 0x8, 0x0); in qla4_82xx_pinit_from_rom()
1015 qla4_82xx_wr_32(ha, QLA82XX_CRB_TIMER + 0x10, 0x0); in qla4_82xx_pinit_from_rom()
1016 qla4_82xx_wr_32(ha, QLA82XX_CRB_TIMER + 0x18, 0x0); in qla4_82xx_pinit_from_rom()
1017 qla4_82xx_wr_32(ha, QLA82XX_CRB_TIMER + 0x100, 0x0); in qla4_82xx_pinit_from_rom()
1018 qla4_82xx_wr_32(ha, QLA82XX_CRB_TIMER + 0x200, 0x0); in qla4_82xx_pinit_from_rom()
1021 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_0 + 0x3c, 1); in qla4_82xx_pinit_from_rom()
1022 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_1 + 0x3c, 1); in qla4_82xx_pinit_from_rom()
1023 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_2 + 0x3c, 1); in qla4_82xx_pinit_from_rom()
1024 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_3 + 0x3c, 1); in qla4_82xx_pinit_from_rom()
1025 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_4 + 0x3c, 1); in qla4_82xx_pinit_from_rom()
1029 if (test_bit(DPC_RESET_HA, &ha->dpc_flags)) in qla4_82xx_pinit_from_rom()
1031 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xfeffffff); in qla4_82xx_pinit_from_rom()
1033 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xffffffff); in qla4_82xx_pinit_from_rom()
1035 qla4_82xx_rom_unlock(ha); in qla4_82xx_pinit_from_rom()
1042 if (qla4_82xx_rom_fast_read(ha, 0, &n) != 0 || n != 0xcafecafeUL || in qla4_82xx_pinit_from_rom()
1043 qla4_82xx_rom_fast_read(ha, 4, &n) != 0) { in qla4_82xx_pinit_from_rom()
1044 ql4_printk(KERN_WARNING, ha, in qla4_82xx_pinit_from_rom()
1057 ql4_printk(KERN_WARNING, ha, in qla4_82xx_pinit_from_rom()
1063 ql4_printk(KERN_INFO, ha, in qla4_82xx_pinit_from_rom()
1068 ql4_printk(KERN_WARNING, ha, in qla4_82xx_pinit_from_rom()
1074 if (qla4_82xx_rom_fast_read(ha, 8*i + 4*offset, &val) != 0 || in qla4_82xx_pinit_from_rom()
1075 qla4_82xx_rom_fast_read(ha, 8*i + 4*offset + 4, &addr) != in qla4_82xx_pinit_from_rom()
1097 DEBUG2(ql4_printk(KERN_WARNING, ha, in qla4_82xx_pinit_from_rom()
1128 ql4_printk(KERN_WARNING, ha, in qla4_82xx_pinit_from_rom()
1134 qla4_82xx_wr_32(ha, off, buf[i].data); in qla4_82xx_pinit_from_rom()
1151 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_D+0xec, 0x1e); in qla4_82xx_pinit_from_rom()
1152 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_D+0x4c, 8); in qla4_82xx_pinit_from_rom()
1153 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_I+0x4c, 8); in qla4_82xx_pinit_from_rom()
1156 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_0+0x8, 0); in qla4_82xx_pinit_from_rom()
1157 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_0+0xc, 0); in qla4_82xx_pinit_from_rom()
1158 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_1+0x8, 0); in qla4_82xx_pinit_from_rom()
1159 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_1+0xc, 0); in qla4_82xx_pinit_from_rom()
1160 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_2+0x8, 0); in qla4_82xx_pinit_from_rom()
1161 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_2+0xc, 0); in qla4_82xx_pinit_from_rom()
1162 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_3+0x8, 0); in qla4_82xx_pinit_from_rom()
1163 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_3+0xc, 0); in qla4_82xx_pinit_from_rom()
1178 int qla4_8xxx_ms_mem_write_128b(struct scsi_qla_host *ha, uint64_t addr, in qla4_8xxx_ms_mem_write_128b() argument
1192 write_lock_irqsave(&ha->hw_lock, flags); in qla4_8xxx_ms_mem_write_128b()
1195 ret_val = ha->isp_ops->wr_reg_indirect(ha, MD_MIU_TEST_AGT_ADDR_HI, 0); in qla4_8xxx_ms_mem_write_128b()
1197 ql4_printk(KERN_ERR, ha, "%s: write to AGT_ADDR_HI failed\n", in qla4_8xxx_ms_mem_write_128b()
1211 ret_val = ha->isp_ops->wr_reg_indirect(ha, in qla4_8xxx_ms_mem_write_128b()
1215 ret_val |= ha->isp_ops->wr_reg_indirect(ha, in qla4_8xxx_ms_mem_write_128b()
1218 ret_val |= ha->isp_ops->wr_reg_indirect(ha, in qla4_8xxx_ms_mem_write_128b()
1221 ret_val |= ha->isp_ops->wr_reg_indirect(ha, in qla4_8xxx_ms_mem_write_128b()
1224 ret_val |= ha->isp_ops->wr_reg_indirect(ha, in qla4_8xxx_ms_mem_write_128b()
1228 ql4_printk(KERN_ERR, ha, "%s: write to AGT_WRDATA failed\n", in qla4_8xxx_ms_mem_write_128b()
1234 ret_val = ha->isp_ops->wr_reg_indirect(ha, MD_MIU_TEST_AGT_CTRL, in qla4_8xxx_ms_mem_write_128b()
1236 ret_val |= ha->isp_ops->wr_reg_indirect(ha, in qla4_8xxx_ms_mem_write_128b()
1240 ql4_printk(KERN_ERR, ha, "%s: write to AGT_CTRL failed\n", in qla4_8xxx_ms_mem_write_128b()
1246 ret_val = ha->isp_ops->rd_reg_indirect(ha, in qla4_8xxx_ms_mem_write_128b()
1250 ql4_printk(KERN_ERR, ha, "%s: failed to read MD_MIU_TEST_AGT_CTRL\n", in qla4_8xxx_ms_mem_write_128b()
1268 write_unlock_irqrestore(&ha->hw_lock, flags); in qla4_8xxx_ms_mem_write_128b()
1275 qla4_82xx_load_from_flash(struct scsi_qla_host *ha, uint32_t image_start) in qla4_82xx_load_from_flash() argument
1283 flashaddr = memaddr = ha->hw.flt_region_bootload; in qla4_82xx_load_from_flash()
1287 ha->host_no, __func__, flashaddr, image_start)); in qla4_82xx_load_from_flash()
1290 if ((qla4_82xx_rom_fast_read(ha, flashaddr, (int *)&low)) || in qla4_82xx_load_from_flash()
1291 (qla4_82xx_rom_fast_read(ha, flashaddr + 4, in qla4_82xx_load_from_flash()
1297 rval = qla4_82xx_pci_mem_write_2M(ha, memaddr, &data, 8); in qla4_82xx_load_from_flash()
1311 read_lock(&ha->hw_lock); in qla4_82xx_load_from_flash()
1312 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_0 + 0x18, 0x1020); in qla4_82xx_load_from_flash()
1313 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0x80001e); in qla4_82xx_load_from_flash()
1314 read_unlock(&ha->hw_lock); in qla4_82xx_load_from_flash()
1320 static int qla4_82xx_load_fw(struct scsi_qla_host *ha, uint32_t image_start) in qla4_82xx_load_fw() argument
1324 qla4_82xx_wr_32(ha, CRB_CMDPEG_STATE, 0); in qla4_82xx_load_fw()
1325 if (qla4_82xx_pinit_from_rom(ha, 0) != QLA_SUCCESS) { in qla4_82xx_load_fw()
1338 rst = qla4_82xx_rd_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET); in qla4_82xx_load_fw()
1341 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, rst); in qla4_82xx_load_fw()
1343 if (qla4_82xx_load_from_flash(ha, image_start)) { in qla4_82xx_load_fw()
1352 qla4_82xx_pci_mem_read_2M(struct scsi_qla_host *ha, in qla4_82xx_pci_mem_read_2M() argument
1368 if (qla4_82xx_pci_mem_bound_check(ha, off, size) == 0) in qla4_82xx_pci_mem_read_2M()
1369 return qla4_82xx_pci_mem_read_direct(ha, in qla4_82xx_pci_mem_read_2M()
1385 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_ADDR_LO, temp); in qla4_82xx_pci_mem_read_2M()
1387 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_ADDR_HI, temp); in qla4_82xx_pci_mem_read_2M()
1389 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_CTRL, temp); in qla4_82xx_pci_mem_read_2M()
1391 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_CTRL, temp); in qla4_82xx_pci_mem_read_2M()
1394 temp = qla4_82xx_rd_32(ha, mem_crb + MIU_TEST_AGT_CTRL); in qla4_82xx_pci_mem_read_2M()
1409 temp = qla4_82xx_rd_32(ha, in qla4_82xx_pci_mem_read_2M()
1443 qla4_82xx_pci_mem_write_2M(struct scsi_qla_host *ha, in qla4_82xx_pci_mem_write_2M() argument
1458 if (qla4_82xx_pci_mem_bound_check(ha, off, size) == 0) in qla4_82xx_pci_mem_write_2M()
1459 return qla4_82xx_pci_mem_write_direct(ha, in qla4_82xx_pci_mem_write_2M()
1474 if (qla4_82xx_pci_mem_read_2M(ha, off8 + in qla4_82xx_pci_mem_write_2M()
1510 qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_ADDR_LO, temp); in qla4_82xx_pci_mem_write_2M()
1512 qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_ADDR_HI, temp); in qla4_82xx_pci_mem_write_2M()
1514 qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_WRDATA_LO, temp); in qla4_82xx_pci_mem_write_2M()
1516 qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_WRDATA_HI, temp); in qla4_82xx_pci_mem_write_2M()
1518 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_WRDATA_UPPER_LO, in qla4_82xx_pci_mem_write_2M()
1521 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_WRDATA_UPPER_HI, in qla4_82xx_pci_mem_write_2M()
1525 qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_CTRL, temp); in qla4_82xx_pci_mem_write_2M()
1527 qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_CTRL, temp); in qla4_82xx_pci_mem_write_2M()
1530 temp = qla4_82xx_rd_32(ha, mem_crb + MIU_TEST_AGT_CTRL); in qla4_82xx_pci_mem_write_2M()
1537 ql4_printk(KERN_ERR, ha, in qla4_82xx_pci_mem_write_2M()
1548 static int qla4_82xx_cmdpeg_ready(struct scsi_qla_host *ha, int pegtune_val) in qla4_82xx_cmdpeg_ready() argument
1555 val = qla4_82xx_rd_32(ha, CRB_CMDPEG_STATE); in qla4_82xx_cmdpeg_ready()
1565 pegtune_val = qla4_82xx_rd_32(ha, in qla4_82xx_cmdpeg_ready()
1575 static int qla4_82xx_rcvpeg_ready(struct scsi_qla_host *ha) in qla4_82xx_rcvpeg_ready() argument
1581 read_lock(&ha->hw_lock); in qla4_82xx_rcvpeg_ready()
1582 state = qla4_82xx_rd_32(ha, CRB_RCVPEG_STATE); in qla4_82xx_rcvpeg_ready()
1583 read_unlock(&ha->hw_lock); in qla4_82xx_rcvpeg_ready()
1588 read_lock(&ha->hw_lock); in qla4_82xx_rcvpeg_ready()
1589 state = qla4_82xx_rd_32(ha, CRB_RCVPEG_STATE); in qla4_82xx_rcvpeg_ready()
1590 read_unlock(&ha->hw_lock); in qla4_82xx_rcvpeg_ready()
1596 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_82xx_rcvpeg_ready()
1605 qla4_8xxx_set_drv_active(struct scsi_qla_host *ha) in qla4_8xxx_set_drv_active() argument
1609 drv_active = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_ACTIVE); in qla4_8xxx_set_drv_active()
1616 if (is_qla8032(ha) || is_qla8042(ha)) in qla4_8xxx_set_drv_active()
1617 drv_active |= (1 << ha->func_num); in qla4_8xxx_set_drv_active()
1619 drv_active |= (1 << (ha->func_num * 4)); in qla4_8xxx_set_drv_active()
1621 ql4_printk(KERN_INFO, ha, "%s(%ld): drv_active: 0x%08x\n", in qla4_8xxx_set_drv_active()
1622 __func__, ha->host_no, drv_active); in qla4_8xxx_set_drv_active()
1623 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_ACTIVE, drv_active); in qla4_8xxx_set_drv_active()
1627 qla4_8xxx_clear_drv_active(struct scsi_qla_host *ha) in qla4_8xxx_clear_drv_active() argument
1631 drv_active = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_ACTIVE); in qla4_8xxx_clear_drv_active()
1638 if (is_qla8032(ha) || is_qla8042(ha)) in qla4_8xxx_clear_drv_active()
1639 drv_active &= ~(1 << (ha->func_num)); in qla4_8xxx_clear_drv_active()
1641 drv_active &= ~(1 << (ha->func_num * 4)); in qla4_8xxx_clear_drv_active()
1643 ql4_printk(KERN_INFO, ha, "%s(%ld): drv_active: 0x%08x\n", in qla4_8xxx_clear_drv_active()
1644 __func__, ha->host_no, drv_active); in qla4_8xxx_clear_drv_active()
1645 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_ACTIVE, drv_active); in qla4_8xxx_clear_drv_active()
1648 inline int qla4_8xxx_need_reset(struct scsi_qla_host *ha) in qla4_8xxx_need_reset() argument
1653 drv_active = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_ACTIVE); in qla4_8xxx_need_reset()
1654 drv_state = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_STATE); in qla4_8xxx_need_reset()
1661 if (is_qla8032(ha) || is_qla8042(ha)) in qla4_8xxx_need_reset()
1662 rval = drv_state & (1 << ha->func_num); in qla4_8xxx_need_reset()
1664 rval = drv_state & (1 << (ha->func_num * 4)); in qla4_8xxx_need_reset()
1666 if ((test_bit(AF_EEH_BUSY, &ha->flags)) && drv_active) in qla4_8xxx_need_reset()
1672 void qla4_8xxx_set_rst_ready(struct scsi_qla_host *ha) in qla4_8xxx_set_rst_ready() argument
1676 drv_state = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_STATE); in qla4_8xxx_set_rst_ready()
1683 if (is_qla8032(ha) || is_qla8042(ha)) in qla4_8xxx_set_rst_ready()
1684 drv_state |= (1 << ha->func_num); in qla4_8xxx_set_rst_ready()
1686 drv_state |= (1 << (ha->func_num * 4)); in qla4_8xxx_set_rst_ready()
1688 ql4_printk(KERN_INFO, ha, "%s(%ld): drv_state: 0x%08x\n", in qla4_8xxx_set_rst_ready()
1689 __func__, ha->host_no, drv_state); in qla4_8xxx_set_rst_ready()
1690 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_STATE, drv_state); in qla4_8xxx_set_rst_ready()
1693 void qla4_8xxx_clear_rst_ready(struct scsi_qla_host *ha) in qla4_8xxx_clear_rst_ready() argument
1697 drv_state = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_STATE); in qla4_8xxx_clear_rst_ready()
1704 if (is_qla8032(ha) || is_qla8042(ha)) in qla4_8xxx_clear_rst_ready()
1705 drv_state &= ~(1 << ha->func_num); in qla4_8xxx_clear_rst_ready()
1707 drv_state &= ~(1 << (ha->func_num * 4)); in qla4_8xxx_clear_rst_ready()
1709 ql4_printk(KERN_INFO, ha, "%s(%ld): drv_state: 0x%08x\n", in qla4_8xxx_clear_rst_ready()
1710 __func__, ha->host_no, drv_state); in qla4_8xxx_clear_rst_ready()
1711 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_STATE, drv_state); in qla4_8xxx_clear_rst_ready()
1715 qla4_8xxx_set_qsnt_ready(struct scsi_qla_host *ha) in qla4_8xxx_set_qsnt_ready() argument
1719 qsnt_state = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_STATE); in qla4_8xxx_set_qsnt_ready()
1726 if (is_qla8032(ha) || is_qla8042(ha)) in qla4_8xxx_set_qsnt_ready()
1727 qsnt_state |= (1 << ha->func_num); in qla4_8xxx_set_qsnt_ready()
1729 qsnt_state |= (2 << (ha->func_num * 4)); in qla4_8xxx_set_qsnt_ready()
1731 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_STATE, qsnt_state); in qla4_8xxx_set_qsnt_ready()
1736 qla4_82xx_start_firmware(struct scsi_qla_host *ha, uint32_t image_start) in qla4_82xx_start_firmware() argument
1741 qla4_82xx_wr_32(ha, CRB_DMA_SHIFT, 0x55555555); in qla4_82xx_start_firmware()
1744 qla4_82xx_wr_32(ha, CRB_CMDPEG_STATE, 0); in qla4_82xx_start_firmware()
1745 qla4_82xx_wr_32(ha, CRB_RCVPEG_STATE, 0); in qla4_82xx_start_firmware()
1746 qla4_82xx_wr_32(ha, QLA82XX_PEG_HALT_STATUS1, 0); in qla4_82xx_start_firmware()
1747 qla4_82xx_wr_32(ha, QLA82XX_PEG_HALT_STATUS2, 0); in qla4_82xx_start_firmware()
1749 if (qla4_82xx_load_fw(ha, image_start) != QLA_SUCCESS) { in qla4_82xx_start_firmware()
1755 if (qla4_82xx_cmdpeg_ready(ha, 0) != QLA_SUCCESS) { in qla4_82xx_start_firmware()
1761 pcie_capability_read_word(ha->pdev, PCI_EXP_LNKSTA, &lnk); in qla4_82xx_start_firmware()
1762 ha->link_width = (lnk >> 4) & 0x3f; in qla4_82xx_start_firmware()
1765 return qla4_82xx_rcvpeg_ready(ha); in qla4_82xx_start_firmware()
1768 int qla4_82xx_try_start_fw(struct scsi_qla_host *ha) in qla4_82xx_try_start_fw() argument
1778 ql4_printk(KERN_INFO, ha, in qla4_82xx_try_start_fw()
1780 rval = qla4_8xxx_get_flash_info(ha); in qla4_82xx_try_start_fw()
1784 ql4_printk(KERN_INFO, ha, in qla4_82xx_try_start_fw()
1786 rval = qla4_82xx_start_firmware(ha, ha->hw.flt_region_fw); in qla4_82xx_try_start_fw()
1789 ql4_printk(KERN_ERR, ha, "FW: Load firmware from flash" in qla4_82xx_try_start_fw()
1797 void qla4_82xx_rom_lock_recovery(struct scsi_qla_host *ha) in qla4_82xx_rom_lock_recovery() argument
1799 if (qla4_82xx_rom_lock(ha)) { in qla4_82xx_rom_lock_recovery()
1801 dev_info(&ha->pdev->dev, "Resetting rom_lock\n"); in qla4_82xx_rom_lock_recovery()
1809 qla4_82xx_rom_unlock(ha); in qla4_82xx_rom_lock_recovery()
1812 static uint32_t ql4_84xx_poll_wait_for_ready(struct scsi_qla_host *ha, in ql4_84xx_poll_wait_for_ready() argument
1821 ha->isp_ops->rd_reg_indirect(ha, addr1, &temp); in ql4_84xx_poll_wait_for_ready()
1826 ql4_printk(KERN_INFO, ha, "Error in processing rdmdio entry\n"); in ql4_84xx_poll_wait_for_ready()
1834 static uint32_t ql4_84xx_ipmdio_rd_reg(struct scsi_qla_host *ha, uint32_t addr1, in ql4_84xx_ipmdio_rd_reg() argument
1842 rval = ql4_84xx_poll_wait_for_ready(ha, addr1, mask); in ql4_84xx_ipmdio_rd_reg()
1847 ha->isp_ops->wr_reg_indirect(ha, addr1, temp); in ql4_84xx_ipmdio_rd_reg()
1849 rval = ql4_84xx_poll_wait_for_ready(ha, addr1, mask); in ql4_84xx_ipmdio_rd_reg()
1853 ha->isp_ops->rd_reg_indirect(ha, addr3, &data); in ql4_84xx_ipmdio_rd_reg()
1861 static uint32_t ql4_84xx_poll_wait_ipmdio_bus_idle(struct scsi_qla_host *ha, in ql4_84xx_poll_wait_ipmdio_bus_idle() argument
1873 ql4_84xx_ipmdio_rd_reg(ha, addr1, addr3, mask, addr2, &temp); in ql4_84xx_poll_wait_ipmdio_bus_idle()
1877 ql4_printk(KERN_INFO, ha, "Error in processing mdiobus idle\n"); in ql4_84xx_poll_wait_ipmdio_bus_idle()
1885 static int ql4_84xx_ipmdio_wr_reg(struct scsi_qla_host *ha, in ql4_84xx_ipmdio_wr_reg() argument
1892 rval = ql4_84xx_poll_wait_for_ready(ha, addr1, mask); in ql4_84xx_ipmdio_wr_reg()
1896 ha->isp_ops->wr_reg_indirect(ha, addr3, value); in ql4_84xx_ipmdio_wr_reg()
1897 ha->isp_ops->wr_reg_indirect(ha, addr1, addr); in ql4_84xx_ipmdio_wr_reg()
1899 rval = ql4_84xx_poll_wait_for_ready(ha, addr1, mask); in ql4_84xx_ipmdio_wr_reg()
1907 static void qla4_8xxx_minidump_process_rdcrb(struct scsi_qla_host *ha, in qla4_8xxx_minidump_process_rdcrb() argument
1915 DEBUG2(ql4_printk(KERN_INFO, ha, "Entering fn: %s\n", __func__)); in qla4_8xxx_minidump_process_rdcrb()
1922 ha->isp_ops->rd_reg_indirect(ha, r_addr, &r_value); in qla4_8xxx_minidump_process_rdcrb()
1930 static int qla4_83xx_check_dma_engine_state(struct scsi_qla_host *ha) in qla4_83xx_check_dma_engine_state() argument
1938 ha->fw_dump_tmplt_hdr; in qla4_83xx_check_dma_engine_state()
1945 rval = ha->isp_ops->rd_reg_indirect(ha, in qla4_83xx_check_dma_engine_state()
1959 static int qla4_83xx_start_pex_dma(struct scsi_qla_host *ha, in qla4_83xx_start_pex_dma() argument
1968 ha->fw_dump_tmplt_hdr; in qla4_83xx_start_pex_dma()
1974 rval = ha->isp_ops->wr_reg_indirect(ha, in qla4_83xx_start_pex_dma()
1980 rval = ha->isp_ops->wr_reg_indirect(ha, in qla4_83xx_start_pex_dma()
1985 rval = ha->isp_ops->wr_reg_indirect(ha, in qla4_83xx_start_pex_dma()
1993 rval = ha->isp_ops->rd_reg_indirect(ha, in qla4_83xx_start_pex_dma()
2015 static int qla4_8xxx_minidump_pex_dma_read(struct scsi_qla_host *ha, in qla4_8xxx_minidump_pex_dma_read() argument
2027 DEBUG2(ql4_printk(KERN_INFO, ha, "Entering fn: %s\n", __func__)); in qla4_8xxx_minidump_pex_dma_read()
2029 rval = qla4_83xx_check_dma_engine_state(ha); in qla4_8xxx_minidump_pex_dma_read()
2031 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_8xxx_minidump_pex_dma_read()
2038 rdmem_buffer = dma_alloc_coherent(&ha->pdev->dev, in qla4_8xxx_minidump_pex_dma_read()
2042 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_8xxx_minidump_pex_dma_read()
2055 dma_desc.cmd.dma_desc_cmd |= ((PCI_FUNC(ha->pdev->devfn) & 0xf) << 0x4); in qla4_8xxx_minidump_pex_dma_read()
2072 dma_free_coherent(&ha->pdev->dev, in qla4_8xxx_minidump_pex_dma_read()
2076 rdmem_buffer = dma_alloc_coherent(&ha->pdev->dev, size, in qla4_8xxx_minidump_pex_dma_read()
2080 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_8xxx_minidump_pex_dma_read()
2092 rval = qla4_8xxx_ms_mem_write_128b(ha, in qla4_8xxx_minidump_pex_dma_read()
2097 ql4_printk(KERN_INFO, ha, in qla4_8xxx_minidump_pex_dma_read()
2103 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_8xxx_minidump_pex_dma_read()
2107 rval = qla4_83xx_start_pex_dma(ha, m_hdr); in qla4_8xxx_minidump_pex_dma_read()
2109 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_8xxx_minidump_pex_dma_read()
2111 ha->host_no, rval)); in qla4_8xxx_minidump_pex_dma_read()
2120 DEBUG2(ql4_printk(KERN_INFO, ha, "Leaving fn: %s\n", __func__)); in qla4_8xxx_minidump_pex_dma_read()
2126 dma_free_coherent(&ha->pdev->dev, size, rdmem_buffer, in qla4_8xxx_minidump_pex_dma_read()
2132 static int qla4_8xxx_minidump_process_l2tag(struct scsi_qla_host *ha, in qla4_8xxx_minidump_process_l2tag() argument
2144 DEBUG2(ql4_printk(KERN_INFO, ha, "Entering fn: %s\n", __func__)); in qla4_8xxx_minidump_process_l2tag()
2159 ha->isp_ops->wr_reg_indirect(ha, t_r_addr, t_value); in qla4_8xxx_minidump_process_l2tag()
2162 ha->isp_ops->wr_reg_indirect(ha, c_addr, c_value_w); in qla4_8xxx_minidump_process_l2tag()
2167 ha->isp_ops->rd_reg_indirect(ha, c_addr, in qla4_8xxx_minidump_process_l2tag()
2180 ha->isp_ops->rd_reg_indirect(ha, addr, &r_value); in qla4_8xxx_minidump_process_l2tag()
2191 static int qla4_8xxx_minidump_process_control(struct scsi_qla_host *ha, in qla4_8xxx_minidump_process_control() argument
2201 DEBUG2(ql4_printk(KERN_INFO, ha, "Entering fn: %s\n", __func__)); in qla4_8xxx_minidump_process_control()
2203 ha->fw_dump_tmplt_hdr; in qla4_8xxx_minidump_process_control()
2210 ha->isp_ops->wr_reg_indirect(ha, crb_addr, in qla4_8xxx_minidump_process_control()
2215 ha->isp_ops->rd_reg_indirect(ha, crb_addr, &read_value); in qla4_8xxx_minidump_process_control()
2216 ha->isp_ops->wr_reg_indirect(ha, crb_addr, read_value); in qla4_8xxx_minidump_process_control()
2220 ha->isp_ops->rd_reg_indirect(ha, crb_addr, &read_value); in qla4_8xxx_minidump_process_control()
2227 ha->isp_ops->wr_reg_indirect(ha, crb_addr, read_value); in qla4_8xxx_minidump_process_control()
2230 ha->isp_ops->rd_reg_indirect(ha, crb_addr, &read_value); in qla4_8xxx_minidump_process_control()
2232 ha->isp_ops->wr_reg_indirect(ha, crb_addr, read_value); in qla4_8xxx_minidump_process_control()
2238 ha->isp_ops->rd_reg_indirect(ha, crb_addr, &read_value); in qla4_8xxx_minidump_process_control()
2249 ha->isp_ops->rd_reg_indirect(ha, in qla4_8xxx_minidump_process_control()
2264 ha->isp_ops->rd_reg_indirect(ha, addr, &read_value); in qla4_8xxx_minidump_process_control()
2286 ha->isp_ops->wr_reg_indirect(ha, addr, read_value); in qla4_8xxx_minidump_process_control()
2304 DEBUG2(ql4_printk(KERN_INFO, ha, "Leaving fn: %s\n", __func__)); in qla4_8xxx_minidump_process_control()
2308 static void qla4_8xxx_minidump_process_rdocm(struct scsi_qla_host *ha, in qla4_8xxx_minidump_process_rdocm() argument
2316 DEBUG2(ql4_printk(KERN_INFO, ha, "Entering fn: %s\n", __func__)); in qla4_8xxx_minidump_process_rdocm()
2322 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_8xxx_minidump_process_rdocm()
2327 r_value = readl((void __iomem *)(r_addr + ha->nx_pcibase)); in qla4_8xxx_minidump_process_rdocm()
2331 DEBUG2(ql4_printk(KERN_INFO, ha, "Leaving fn: %s datacount: 0x%lx\n", in qla4_8xxx_minidump_process_rdocm()
2336 static void qla4_8xxx_minidump_process_rdmux(struct scsi_qla_host *ha, in qla4_8xxx_minidump_process_rdmux() argument
2344 DEBUG2(ql4_printk(KERN_INFO, ha, "Entering fn: %s\n", __func__)); in qla4_8xxx_minidump_process_rdmux()
2353 ha->isp_ops->wr_reg_indirect(ha, s_addr, s_value); in qla4_8xxx_minidump_process_rdmux()
2354 ha->isp_ops->rd_reg_indirect(ha, r_addr, &r_value); in qla4_8xxx_minidump_process_rdmux()
2362 static void qla4_8xxx_minidump_process_l1cache(struct scsi_qla_host *ha, in qla4_8xxx_minidump_process_l1cache() argument
2383 ha->isp_ops->wr_reg_indirect(ha, t_r_addr, t_value); in qla4_8xxx_minidump_process_l1cache()
2384 ha->isp_ops->wr_reg_indirect(ha, c_addr, c_value_w); in qla4_8xxx_minidump_process_l1cache()
2387 ha->isp_ops->rd_reg_indirect(ha, addr, &r_value); in qla4_8xxx_minidump_process_l1cache()
2396 static void qla4_8xxx_minidump_process_queue(struct scsi_qla_host *ha, in qla4_8xxx_minidump_process_queue() argument
2406 DEBUG2(ql4_printk(KERN_INFO, ha, "Entering fn: %s\n", __func__)); in qla4_8xxx_minidump_process_queue()
2414 ha->isp_ops->wr_reg_indirect(ha, s_addr, qid); in qla4_8xxx_minidump_process_queue()
2417 ha->isp_ops->rd_reg_indirect(ha, r_addr, &r_value); in qla4_8xxx_minidump_process_queue()
2429 static void qla4_82xx_minidump_process_rdrom(struct scsi_qla_host *ha, in qla4_82xx_minidump_process_rdrom() argument
2438 DEBUG2(ql4_printk(KERN_INFO, ha, "Entering fn: %s\n", __func__)); in qla4_82xx_minidump_process_rdrom()
2443 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_82xx_minidump_process_rdrom()
2448 ha->isp_ops->wr_reg_indirect(ha, MD_DIRECT_ROM_WINDOW, in qla4_82xx_minidump_process_rdrom()
2450 ha->isp_ops->rd_reg_indirect(ha, in qla4_82xx_minidump_process_rdrom()
2463 static int __qla4_8xxx_minidump_process_rdmem(struct scsi_qla_host *ha, in __qla4_8xxx_minidump_process_rdmem() argument
2473 DEBUG2(ql4_printk(KERN_INFO, ha, "Entering fn: %s\n", __func__)); in __qla4_8xxx_minidump_process_rdmem()
2478 DEBUG2(ql4_printk(KERN_INFO, ha, in __qla4_8xxx_minidump_process_rdmem()
2483 DEBUG2(ql4_printk(KERN_INFO, ha, in __qla4_8xxx_minidump_process_rdmem()
2490 DEBUG2(ql4_printk(KERN_INFO, ha, in __qla4_8xxx_minidump_process_rdmem()
2496 DEBUG2(ql4_printk(KERN_INFO, ha, in __qla4_8xxx_minidump_process_rdmem()
2500 write_lock_irqsave(&ha->hw_lock, flags); in __qla4_8xxx_minidump_process_rdmem()
2502 ha->isp_ops->wr_reg_indirect(ha, MD_MIU_TEST_AGT_ADDR_LO, in __qla4_8xxx_minidump_process_rdmem()
2505 ha->isp_ops->wr_reg_indirect(ha, MD_MIU_TEST_AGT_ADDR_HI, in __qla4_8xxx_minidump_process_rdmem()
2508 ha->isp_ops->wr_reg_indirect(ha, MD_MIU_TEST_AGT_CTRL, r_value); in __qla4_8xxx_minidump_process_rdmem()
2510 ha->isp_ops->wr_reg_indirect(ha, MD_MIU_TEST_AGT_CTRL, r_value); in __qla4_8xxx_minidump_process_rdmem()
2513 ha->isp_ops->rd_reg_indirect(ha, MD_MIU_TEST_AGT_CTRL, in __qla4_8xxx_minidump_process_rdmem()
2523 write_unlock_irqrestore(&ha->hw_lock, flags); in __qla4_8xxx_minidump_process_rdmem()
2528 ha->isp_ops->rd_reg_indirect(ha, in __qla4_8xxx_minidump_process_rdmem()
2536 write_unlock_irqrestore(&ha->hw_lock, flags); in __qla4_8xxx_minidump_process_rdmem()
2538 DEBUG2(ql4_printk(KERN_INFO, ha, "Leaving fn: %s datacount: 0x%x\n", in __qla4_8xxx_minidump_process_rdmem()
2545 static int qla4_8xxx_minidump_process_rdmem(struct scsi_qla_host *ha, in qla4_8xxx_minidump_process_rdmem() argument
2552 rval = qla4_8xxx_minidump_pex_dma_read(ha, entry_hdr, &data_ptr); in qla4_8xxx_minidump_process_rdmem()
2554 rval = __qla4_8xxx_minidump_process_rdmem(ha, entry_hdr, in qla4_8xxx_minidump_process_rdmem()
2560 static void qla4_8xxx_mark_entry_skipped(struct scsi_qla_host *ha, in qla4_8xxx_mark_entry_skipped() argument
2565 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_8xxx_mark_entry_skipped()
2567 ha->host_no, index, entry_hdr->entry_type, in qla4_8xxx_mark_entry_skipped()
2573 ha->fw_dump_skip_size += entry_hdr->entry_capture_size; in qla4_8xxx_mark_entry_skipped()
2577 static uint32_t qla83xx_minidump_process_pollrd(struct scsi_qla_host *ha, in qla83xx_minidump_process_pollrd() argument
2597 ha->isp_ops->wr_reg_indirect(ha, s_addr, s_value); in qla83xx_minidump_process_pollrd()
2600 ha->isp_ops->rd_reg_indirect(ha, s_addr, &r_value); in qla83xx_minidump_process_pollrd()
2607 ql4_printk(KERN_ERR, ha, "%s: TIMEOUT\n", in qla83xx_minidump_process_pollrd()
2614 ha->isp_ops->rd_reg_indirect(ha, r_addr, &r_value); in qla83xx_minidump_process_pollrd()
2626 static uint32_t qla4_84xx_minidump_process_rddfe(struct scsi_qla_host *ha, in qla4_84xx_minidump_process_rddfe() argument
2654 ha->isp_ops->wr_reg_indirect(ha, addr1, (0x40000000 | value)); in qla4_84xx_minidump_process_rddfe()
2658 ha->isp_ops->rd_reg_indirect(ha, addr1, &temp); in qla4_84xx_minidump_process_rddfe()
2665 ql4_printk(KERN_ERR, ha, "%s: TIMEOUT\n", __func__); in qla4_84xx_minidump_process_rddfe()
2669 ha->isp_ops->rd_reg_indirect(ha, addr2, &temp); in qla4_84xx_minidump_process_rddfe()
2674 ha->isp_ops->wr_reg_indirect(ha, addr2, wrval); in qla4_84xx_minidump_process_rddfe()
2675 ha->isp_ops->wr_reg_indirect(ha, addr1, value); in qla4_84xx_minidump_process_rddfe()
2679 ha->isp_ops->rd_reg_indirect(ha, addr1, &temp); in qla4_84xx_minidump_process_rddfe()
2685 ql4_printk(KERN_ERR, ha, "%s: TIMEOUT\n", in qla4_84xx_minidump_process_rddfe()
2691 ha->isp_ops->wr_reg_indirect(ha, addr1, in qla4_84xx_minidump_process_rddfe()
2696 ha->isp_ops->rd_reg_indirect(ha, addr1, &temp); in qla4_84xx_minidump_process_rddfe()
2703 ql4_printk(KERN_ERR, ha, "%s: TIMEOUT\n", in qla4_84xx_minidump_process_rddfe()
2709 ha->isp_ops->rd_reg_indirect(ha, addr2, &data); in qla4_84xx_minidump_process_rddfe()
2721 static uint32_t qla4_84xx_minidump_process_rdmdio(struct scsi_qla_host *ha, in qla4_84xx_minidump_process_rdmdio() argument
2748 rval = ql4_84xx_poll_wait_ipmdio_bus_idle(ha, addr1, addr2, in qla4_84xx_minidump_process_rdmdio()
2754 rval = ql4_84xx_ipmdio_wr_reg(ha, addr1, addr3, mask, addr4, in qla4_84xx_minidump_process_rdmdio()
2760 rval = ql4_84xx_ipmdio_wr_reg(ha, addr1, addr3, mask, addr5, in qla4_84xx_minidump_process_rdmdio()
2766 rval = ql4_84xx_ipmdio_wr_reg(ha, addr1, addr3, mask, in qla4_84xx_minidump_process_rdmdio()
2771 rval = ql4_84xx_poll_wait_ipmdio_bus_idle(ha, addr1, addr2, in qla4_84xx_minidump_process_rdmdio()
2777 rval = ql4_84xx_ipmdio_rd_reg(ha, addr1, addr3, in qla4_84xx_minidump_process_rdmdio()
2796 static uint32_t qla4_84xx_minidump_process_pollwr(struct scsi_qla_host *ha, in qla4_84xx_minidump_process_pollwr() argument
2814 ha->isp_ops->rd_reg_indirect(ha, addr1, &r_value); in qla4_84xx_minidump_process_pollwr()
2823 ql4_printk(KERN_ERR, ha, "%s: TIMEOUT\n", __func__); in qla4_84xx_minidump_process_pollwr()
2828 ha->isp_ops->wr_reg_indirect(ha, addr2, value2); in qla4_84xx_minidump_process_pollwr()
2829 ha->isp_ops->wr_reg_indirect(ha, addr1, value1); in qla4_84xx_minidump_process_pollwr()
2833 ha->isp_ops->rd_reg_indirect(ha, addr1, &r_value); in qla4_84xx_minidump_process_pollwr()
2844 static void qla83xx_minidump_process_rdmux2(struct scsi_qla_host *ha, in qla83xx_minidump_process_rdmux2() argument
2862 ha->isp_ops->wr_reg_indirect(ha, sel_addr1, sel_val1); in qla83xx_minidump_process_rdmux2()
2866 ha->isp_ops->wr_reg_indirect(ha, sel_addr2, t_sel_val); in qla83xx_minidump_process_rdmux2()
2867 ha->isp_ops->rd_reg_indirect(ha, read_addr, &data); in qla83xx_minidump_process_rdmux2()
2871 ha->isp_ops->wr_reg_indirect(ha, sel_addr1, sel_val2); in qla83xx_minidump_process_rdmux2()
2875 ha->isp_ops->wr_reg_indirect(ha, sel_addr2, t_sel_val); in qla83xx_minidump_process_rdmux2()
2876 ha->isp_ops->rd_reg_indirect(ha, read_addr, &data); in qla83xx_minidump_process_rdmux2()
2887 static uint32_t qla83xx_minidump_process_pollrdmwr(struct scsi_qla_host *ha, in qla83xx_minidump_process_pollrdmwr() argument
2904 ha->isp_ops->wr_reg_indirect(ha, addr_1, value_1); in qla83xx_minidump_process_pollrdmwr()
2908 ha->isp_ops->rd_reg_indirect(ha, addr_1, &r_value); in qla83xx_minidump_process_pollrdmwr()
2915 ql4_printk(KERN_ERR, ha, "%s: TIMEOUT_1\n", in qla83xx_minidump_process_pollrdmwr()
2923 ha->isp_ops->rd_reg_indirect(ha, addr_2, &data); in qla83xx_minidump_process_pollrdmwr()
2925 ha->isp_ops->wr_reg_indirect(ha, addr_2, data); in qla83xx_minidump_process_pollrdmwr()
2926 ha->isp_ops->wr_reg_indirect(ha, addr_1, value_2); in qla83xx_minidump_process_pollrdmwr()
2930 ha->isp_ops->rd_reg_indirect(ha, addr_1, &r_value); in qla83xx_minidump_process_pollrdmwr()
2937 ql4_printk(KERN_ERR, ha, "%s: TIMEOUT_2\n", in qla83xx_minidump_process_pollrdmwr()
2953 static uint32_t qla4_83xx_minidump_process_rdrom(struct scsi_qla_host *ha, in qla4_83xx_minidump_process_rdrom() argument
2965 DEBUG2(ql4_printk(KERN_INFO, ha, "[%s]: fl_addr: 0x%x, count: 0x%x\n", in qla4_83xx_minidump_process_rdrom()
2968 rval = qla4_83xx_lockless_flash_read_u32(ha, fl_addr, in qla4_83xx_minidump_process_rdrom()
2972 ql4_printk(KERN_ERR, ha, "%s: Flash Read Error,Count=%d\n", in qla4_83xx_minidump_process_rdrom()
2988 static int qla4_8xxx_collect_md_data(struct scsi_qla_host *ha) in qla4_8xxx_collect_md_data() argument
2999 ha->fw_dump_skip_size = 0; in qla4_8xxx_collect_md_data()
3000 if (!ha->fw_dump) { in qla4_8xxx_collect_md_data()
3001 ql4_printk(KERN_INFO, ha, "%s(%ld) No buffer to dump\n", in qla4_8xxx_collect_md_data()
3002 __func__, ha->host_no); in qla4_8xxx_collect_md_data()
3007 ha->fw_dump_tmplt_hdr; in qla4_8xxx_collect_md_data()
3008 data_ptr = (uint32_t *)((uint8_t *)ha->fw_dump + in qla4_8xxx_collect_md_data()
3009 ha->fw_dump_tmplt_size); in qla4_8xxx_collect_md_data()
3010 data_collected += ha->fw_dump_tmplt_size; in qla4_8xxx_collect_md_data()
3013 ql4_printk(KERN_INFO, ha, "[%s]: starting data ptr: %p\n", in qla4_8xxx_collect_md_data()
3015 ql4_printk(KERN_INFO, ha, in qla4_8xxx_collect_md_data()
3018 ql4_printk(KERN_INFO, ha, "[%s]: Capture Mask obtained: 0x%x\n", in qla4_8xxx_collect_md_data()
3019 __func__, ha->fw_dump_capture_mask); in qla4_8xxx_collect_md_data()
3020 ql4_printk(KERN_INFO, ha, "[%s]: Total_data_size 0x%x, %d obtained\n", in qla4_8xxx_collect_md_data()
3021 __func__, ha->fw_dump_size, ha->fw_dump_size); in qla4_8xxx_collect_md_data()
3029 (((uint8_t *)ha->fw_dump_tmplt_hdr) + in qla4_8xxx_collect_md_data()
3032 if (is_qla8032(ha) || is_qla8042(ha)) in qla4_8xxx_collect_md_data()
3034 tmplt_hdr->ocm_window_reg[ha->func_num]; in qla4_8xxx_collect_md_data()
3038 if (data_collected > ha->fw_dump_size) { in qla4_8xxx_collect_md_data()
3039 ql4_printk(KERN_INFO, ha, in qla4_8xxx_collect_md_data()
3041 data_collected, ha->fw_dump_size); in qla4_8xxx_collect_md_data()
3046 ha->fw_dump_capture_mask)) { in qla4_8xxx_collect_md_data()
3052 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_8xxx_collect_md_data()
3055 (ha->fw_dump_size - data_collected))); in qla4_8xxx_collect_md_data()
3062 qla4_8xxx_mark_entry_skipped(ha, entry_hdr, i); in qla4_8xxx_collect_md_data()
3065 rval = qla4_8xxx_minidump_process_control(ha, in qla4_8xxx_collect_md_data()
3068 qla4_8xxx_mark_entry_skipped(ha, entry_hdr, i); in qla4_8xxx_collect_md_data()
3073 qla4_8xxx_minidump_process_rdcrb(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3077 rval = qla4_8xxx_minidump_process_rdmem(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3080 qla4_8xxx_mark_entry_skipped(ha, entry_hdr, i); in qla4_8xxx_collect_md_data()
3086 if (is_qla8022(ha)) { in qla4_8xxx_collect_md_data()
3087 qla4_82xx_minidump_process_rdrom(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3089 } else if (is_qla8032(ha) || is_qla8042(ha)) { in qla4_8xxx_collect_md_data()
3090 rval = qla4_83xx_minidump_process_rdrom(ha, in qla4_8xxx_collect_md_data()
3094 qla4_8xxx_mark_entry_skipped(ha, in qla4_8xxx_collect_md_data()
3103 rval = qla4_8xxx_minidump_process_l2tag(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3106 qla4_8xxx_mark_entry_skipped(ha, entry_hdr, i); in qla4_8xxx_collect_md_data()
3114 qla4_8xxx_minidump_process_l1cache(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3118 qla4_8xxx_minidump_process_rdocm(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3122 qla4_8xxx_minidump_process_rdmux(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3126 qla4_8xxx_minidump_process_queue(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3130 if (is_qla8022(ha)) { in qla4_8xxx_collect_md_data()
3131 qla4_8xxx_mark_entry_skipped(ha, entry_hdr, i); in qla4_8xxx_collect_md_data()
3134 rval = qla83xx_minidump_process_pollrd(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3137 qla4_8xxx_mark_entry_skipped(ha, entry_hdr, i); in qla4_8xxx_collect_md_data()
3140 if (is_qla8022(ha)) { in qla4_8xxx_collect_md_data()
3141 qla4_8xxx_mark_entry_skipped(ha, entry_hdr, i); in qla4_8xxx_collect_md_data()
3144 qla83xx_minidump_process_rdmux2(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3148 if (is_qla8022(ha)) { in qla4_8xxx_collect_md_data()
3149 qla4_8xxx_mark_entry_skipped(ha, entry_hdr, i); in qla4_8xxx_collect_md_data()
3152 rval = qla83xx_minidump_process_pollrdmwr(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3155 qla4_8xxx_mark_entry_skipped(ha, entry_hdr, i); in qla4_8xxx_collect_md_data()
3158 rval = qla4_84xx_minidump_process_rddfe(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3161 qla4_8xxx_mark_entry_skipped(ha, entry_hdr, i); in qla4_8xxx_collect_md_data()
3164 rval = qla4_84xx_minidump_process_rdmdio(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3167 qla4_8xxx_mark_entry_skipped(ha, entry_hdr, i); in qla4_8xxx_collect_md_data()
3170 rval = qla4_84xx_minidump_process_pollwr(ha, entry_hdr, in qla4_8xxx_collect_md_data()
3173 qla4_8xxx_mark_entry_skipped(ha, entry_hdr, i); in qla4_8xxx_collect_md_data()
3177 qla4_8xxx_mark_entry_skipped(ha, entry_hdr, i); in qla4_8xxx_collect_md_data()
3181 data_collected = (uint8_t *)data_ptr - (uint8_t *)ha->fw_dump; in qla4_8xxx_collect_md_data()
3189 if ((data_collected + ha->fw_dump_skip_size) != ha->fw_dump_size) { in qla4_8xxx_collect_md_data()
3190 ql4_printk(KERN_INFO, ha, in qla4_8xxx_collect_md_data()
3192 data_collected, ha->fw_dump_size); in qla4_8xxx_collect_md_data()
3197 DEBUG2(ql4_printk(KERN_INFO, ha, "Leaving fn: %s Last entry: 0x%x\n", in qla4_8xxx_collect_md_data()
3208 static void qla4_8xxx_uevent_emit(struct scsi_qla_host *ha, u32 code) in qla4_8xxx_uevent_emit() argument
3216 ha->host_no); in qla4_8xxx_uevent_emit()
3223 kobject_uevent_env(&(&ha->pdev->dev)->kobj, KOBJ_CHANGE, envp); in qla4_8xxx_uevent_emit()
3226 void qla4_8xxx_get_minidump(struct scsi_qla_host *ha) in qla4_8xxx_get_minidump() argument
3228 if (ql4xenablemd && test_bit(AF_FW_RECOVERY, &ha->flags) && in qla4_8xxx_get_minidump()
3229 !test_bit(AF_82XX_FW_DUMPED, &ha->flags)) { in qla4_8xxx_get_minidump()
3230 if (!qla4_8xxx_collect_md_data(ha)) { in qla4_8xxx_get_minidump()
3231 qla4_8xxx_uevent_emit(ha, QL4_UEVENT_CODE_FW_DUMP); in qla4_8xxx_get_minidump()
3232 set_bit(AF_82XX_FW_DUMPED, &ha->flags); in qla4_8xxx_get_minidump()
3234 ql4_printk(KERN_INFO, ha, "%s: Unable to collect minidump\n", in qla4_8xxx_get_minidump()
3246 int qla4_8xxx_device_bootstrap(struct scsi_qla_host *ha) in qla4_8xxx_device_bootstrap() argument
3253 need_reset = ha->isp_ops->need_reset(ha); in qla4_8xxx_device_bootstrap()
3257 if (test_bit(AF_FW_RECOVERY, &ha->flags)) in qla4_8xxx_device_bootstrap()
3258 ha->isp_ops->rom_lock_recovery(ha); in qla4_8xxx_device_bootstrap()
3260 old_count = qla4_8xxx_rd_direct(ha, QLA8XXX_PEG_ALIVE_COUNTER); in qla4_8xxx_device_bootstrap()
3263 count = qla4_8xxx_rd_direct(ha, in qla4_8xxx_device_bootstrap()
3270 ha->isp_ops->rom_lock_recovery(ha); in qla4_8xxx_device_bootstrap()
3274 ql4_printk(KERN_INFO, ha, "HW State: INITIALIZING\n"); in qla4_8xxx_device_bootstrap()
3275 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE, in qla4_8xxx_device_bootstrap()
3278 ha->isp_ops->idc_unlock(ha); in qla4_8xxx_device_bootstrap()
3280 if (is_qla8022(ha)) in qla4_8xxx_device_bootstrap()
3281 qla4_8xxx_get_minidump(ha); in qla4_8xxx_device_bootstrap()
3283 rval = ha->isp_ops->restart_firmware(ha); in qla4_8xxx_device_bootstrap()
3284 ha->isp_ops->idc_lock(ha); in qla4_8xxx_device_bootstrap()
3287 ql4_printk(KERN_INFO, ha, "HW State: FAILED\n"); in qla4_8xxx_device_bootstrap()
3288 qla4_8xxx_clear_drv_active(ha); in qla4_8xxx_device_bootstrap()
3289 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE, in qla4_8xxx_device_bootstrap()
3295 ql4_printk(KERN_INFO, ha, "HW State: READY\n"); in qla4_8xxx_device_bootstrap()
3296 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE, QLA8XXX_DEV_READY); in qla4_8xxx_device_bootstrap()
3308 qla4_82xx_need_reset_handler(struct scsi_qla_host *ha) in qla4_82xx_need_reset_handler() argument
3314 ql4_printk(KERN_INFO, ha, in qla4_82xx_need_reset_handler()
3317 if (test_and_clear_bit(AF_ONLINE, &ha->flags)) { in qla4_82xx_need_reset_handler()
3318 qla4_82xx_idc_unlock(ha); in qla4_82xx_need_reset_handler()
3319 ha->isp_ops->disable_intrs(ha); in qla4_82xx_need_reset_handler()
3320 qla4_82xx_idc_lock(ha); in qla4_82xx_need_reset_handler()
3323 if (!test_bit(AF_8XXX_RST_OWNER, &ha->flags)) { in qla4_82xx_need_reset_handler()
3324 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_82xx_need_reset_handler()
3326 __func__, ha->host_no)); in qla4_82xx_need_reset_handler()
3327 qla4_8xxx_set_rst_ready(ha); in qla4_82xx_need_reset_handler()
3329 active_mask = (~(1 << (ha->func_num * 4))); in qla4_82xx_need_reset_handler()
3333 reset_timeout = jiffies + (ha->nx_reset_timeout * HZ); in qla4_82xx_need_reset_handler()
3335 drv_state = qla4_82xx_rd_32(ha, QLA82XX_CRB_DRV_STATE); in qla4_82xx_need_reset_handler()
3336 drv_active = qla4_82xx_rd_32(ha, QLA82XX_CRB_DRV_ACTIVE); in qla4_82xx_need_reset_handler()
3338 ql4_printk(KERN_INFO, ha, in qla4_82xx_need_reset_handler()
3340 __func__, ha->host_no, drv_state, drv_active); in qla4_82xx_need_reset_handler()
3344 ql4_printk(KERN_INFO, ha, in qla4_82xx_need_reset_handler()
3354 if (test_bit(AF_8XXX_RST_OWNER, &ha->flags)) { in qla4_82xx_need_reset_handler()
3355 ql4_printk(KERN_INFO, ha, in qla4_82xx_need_reset_handler()
3357 __func__, ha->host_no, drv_state, in qla4_82xx_need_reset_handler()
3360 qla4_82xx_idc_unlock(ha); in qla4_82xx_need_reset_handler()
3362 qla4_82xx_idc_lock(ha); in qla4_82xx_need_reset_handler()
3364 drv_state = qla4_82xx_rd_32(ha, QLA82XX_CRB_DRV_STATE); in qla4_82xx_need_reset_handler()
3365 drv_active = qla4_82xx_rd_32(ha, QLA82XX_CRB_DRV_ACTIVE); in qla4_82xx_need_reset_handler()
3369 clear_bit(AF_8XXX_RST_OWNER, &ha->flags); in qla4_82xx_need_reset_handler()
3371 dev_state = qla4_82xx_rd_32(ha, QLA82XX_CRB_DEV_STATE); in qla4_82xx_need_reset_handler()
3372 ql4_printk(KERN_INFO, ha, "Device state is 0x%x = %s\n", dev_state, in qla4_82xx_need_reset_handler()
3377 ql4_printk(KERN_INFO, ha, "HW State: COLD/RE-INIT\n"); in qla4_82xx_need_reset_handler()
3378 qla4_82xx_wr_32(ha, QLA82XX_CRB_DEV_STATE, QLA8XXX_DEV_COLD); in qla4_82xx_need_reset_handler()
3379 qla4_8xxx_set_rst_ready(ha); in qla4_82xx_need_reset_handler()
3388 qla4_8xxx_need_qsnt_handler(struct scsi_qla_host *ha) in qla4_8xxx_need_qsnt_handler() argument
3390 ha->isp_ops->idc_lock(ha); in qla4_8xxx_need_qsnt_handler()
3391 qla4_8xxx_set_qsnt_ready(ha); in qla4_8xxx_need_qsnt_handler()
3392 ha->isp_ops->idc_unlock(ha); in qla4_8xxx_need_qsnt_handler()
3395 static void qla4_82xx_set_idc_ver(struct scsi_qla_host *ha) in qla4_82xx_set_idc_ver() argument
3400 drv_active = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_ACTIVE); in qla4_82xx_set_idc_ver()
3401 if (drv_active == (1 << (ha->func_num * 4))) { in qla4_82xx_set_idc_ver()
3402 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_IDC_VERSION, in qla4_82xx_set_idc_ver()
3404 ql4_printk(KERN_INFO, ha, in qla4_82xx_set_idc_ver()
3408 idc_ver = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_IDC_VERSION); in qla4_82xx_set_idc_ver()
3410 ql4_printk(KERN_INFO, ha, in qla4_82xx_set_idc_ver()
3417 static int qla4_83xx_set_idc_ver(struct scsi_qla_host *ha) in qla4_83xx_set_idc_ver() argument
3423 drv_active = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_ACTIVE); in qla4_83xx_set_idc_ver()
3424 if (drv_active == (1 << ha->func_num)) { in qla4_83xx_set_idc_ver()
3425 idc_ver = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_IDC_VERSION); in qla4_83xx_set_idc_ver()
3428 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_IDC_VERSION, idc_ver); in qla4_83xx_set_idc_ver()
3429 ql4_printk(KERN_INFO, ha, in qla4_83xx_set_idc_ver()
3433 idc_ver = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_IDC_VERSION); in qla4_83xx_set_idc_ver()
3436 ql4_printk(KERN_INFO, ha, in qla4_83xx_set_idc_ver()
3446 idc_ver = qla4_83xx_rd_reg(ha, QLA83XX_CRB_IDC_VER_MINOR); in qla4_83xx_set_idc_ver()
3447 idc_ver &= ~(0x03 << (ha->func_num * 2)); in qla4_83xx_set_idc_ver()
3448 idc_ver |= (QLA83XX_IDC_VER_MIN_VALUE << (ha->func_num * 2)); in qla4_83xx_set_idc_ver()
3449 qla4_83xx_wr_reg(ha, QLA83XX_CRB_IDC_VER_MINOR, idc_ver); in qla4_83xx_set_idc_ver()
3455 int qla4_8xxx_update_idc_reg(struct scsi_qla_host *ha) in qla4_8xxx_update_idc_reg() argument
3460 if (test_bit(AF_INIT_DONE, &ha->flags)) in qla4_8xxx_update_idc_reg()
3463 ha->isp_ops->idc_lock(ha); in qla4_8xxx_update_idc_reg()
3464 qla4_8xxx_set_drv_active(ha); in qla4_8xxx_update_idc_reg()
3470 if (is_qla8032(ha) || is_qla8042(ha)) { in qla4_8xxx_update_idc_reg()
3471 drv_active = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_ACTIVE); in qla4_8xxx_update_idc_reg()
3472 if ((drv_active == (1 << ha->func_num)) && !ql4xdontresethba) in qla4_8xxx_update_idc_reg()
3473 qla4_83xx_clear_idc_dontreset(ha); in qla4_8xxx_update_idc_reg()
3476 if (is_qla8022(ha)) { in qla4_8xxx_update_idc_reg()
3477 qla4_82xx_set_idc_ver(ha); in qla4_8xxx_update_idc_reg()
3478 } else if (is_qla8032(ha) || is_qla8042(ha)) { in qla4_8xxx_update_idc_reg()
3479 rval = qla4_83xx_set_idc_ver(ha); in qla4_8xxx_update_idc_reg()
3481 qla4_8xxx_clear_drv_active(ha); in qla4_8xxx_update_idc_reg()
3484 ha->isp_ops->idc_unlock(ha); in qla4_8xxx_update_idc_reg()
3496 int qla4_8xxx_device_state_handler(struct scsi_qla_host *ha) in qla4_8xxx_device_state_handler() argument
3502 rval = qla4_8xxx_update_idc_reg(ha); in qla4_8xxx_device_state_handler()
3506 dev_state = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DEV_STATE); in qla4_8xxx_device_state_handler()
3507 DEBUG2(ql4_printk(KERN_INFO, ha, "Device state is 0x%x = %s\n", in qla4_8xxx_device_state_handler()
3512 dev_init_timeout = jiffies + (ha->nx_dev_init_timeout * HZ); in qla4_8xxx_device_state_handler()
3514 ha->isp_ops->idc_lock(ha); in qla4_8xxx_device_state_handler()
3518 ql4_printk(KERN_WARNING, ha, in qla4_8xxx_device_state_handler()
3523 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE, in qla4_8xxx_device_state_handler()
3527 dev_state = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DEV_STATE); in qla4_8xxx_device_state_handler()
3528 ql4_printk(KERN_INFO, ha, "Device state is 0x%x = %s\n", in qla4_8xxx_device_state_handler()
3537 rval = qla4_8xxx_device_bootstrap(ha); in qla4_8xxx_device_state_handler()
3540 ha->isp_ops->idc_unlock(ha); in qla4_8xxx_device_state_handler()
3542 ha->isp_ops->idc_lock(ha); in qla4_8xxx_device_state_handler()
3550 if (is_qla8032(ha) || is_qla8042(ha)) { in qla4_8xxx_device_state_handler()
3551 qla4_83xx_need_reset_handler(ha); in qla4_8xxx_device_state_handler()
3552 } else if (is_qla8022(ha)) { in qla4_8xxx_device_state_handler()
3554 qla4_82xx_need_reset_handler(ha); in qla4_8xxx_device_state_handler()
3558 (ha->nx_dev_init_timeout * HZ); in qla4_8xxx_device_state_handler()
3560 ha->isp_ops->idc_unlock(ha); in qla4_8xxx_device_state_handler()
3562 ha->isp_ops->idc_lock(ha); in qla4_8xxx_device_state_handler()
3568 qla4_8xxx_need_qsnt_handler(ha); in qla4_8xxx_device_state_handler()
3571 ha->isp_ops->idc_unlock(ha); in qla4_8xxx_device_state_handler()
3573 ha->isp_ops->idc_lock(ha); in qla4_8xxx_device_state_handler()
3576 ha->isp_ops->idc_unlock(ha); in qla4_8xxx_device_state_handler()
3577 qla4xxx_dead_adapter_cleanup(ha); in qla4_8xxx_device_state_handler()
3579 ha->isp_ops->idc_lock(ha); in qla4_8xxx_device_state_handler()
3582 ha->isp_ops->idc_unlock(ha); in qla4_8xxx_device_state_handler()
3583 qla4xxx_dead_adapter_cleanup(ha); in qla4_8xxx_device_state_handler()
3585 ha->isp_ops->idc_lock(ha); in qla4_8xxx_device_state_handler()
3590 ha->isp_ops->idc_unlock(ha); in qla4_8xxx_device_state_handler()
3595 int qla4_8xxx_load_risc(struct scsi_qla_host *ha) in qla4_8xxx_load_risc() argument
3600 if (is_qla8032(ha) || is_qla8042(ha)) { in qla4_8xxx_load_risc()
3601 writel(0, &ha->qla4_83xx_reg->risc_intr); in qla4_8xxx_load_risc()
3602 readl(&ha->qla4_83xx_reg->risc_intr); in qla4_8xxx_load_risc()
3603 } else if (is_qla8022(ha)) { in qla4_8xxx_load_risc()
3604 writel(0, &ha->qla4_82xx_reg->host_int); in qla4_8xxx_load_risc()
3605 readl(&ha->qla4_82xx_reg->host_int); in qla4_8xxx_load_risc()
3608 retval = qla4_8xxx_device_state_handler(ha); in qla4_8xxx_load_risc()
3612 qla4xxx_init_rings(ha); in qla4_8xxx_load_risc()
3614 if (retval == QLA_SUCCESS && !test_bit(AF_IRQ_ATTACHED, &ha->flags)) in qla4_8xxx_load_risc()
3615 retval = qla4xxx_request_irqs(ha); in qla4_8xxx_load_risc()
3638 qla4_82xx_read_flash_data(struct scsi_qla_host *ha, uint32_t *dwptr, in qla4_82xx_read_flash_data() argument
3644 while ((qla4_82xx_rom_lock(ha) != 0) && (loops < 50000)) { in qla4_82xx_read_flash_data()
3650 ql4_printk(KERN_WARNING, ha, "ROM lock failed\n"); in qla4_82xx_read_flash_data()
3656 if (qla4_82xx_do_rom_fast_read(ha, faddr, &val)) { in qla4_82xx_read_flash_data()
3657 ql4_printk(KERN_WARNING, ha, in qla4_82xx_read_flash_data()
3665 qla4_82xx_rom_unlock(ha); in qla4_82xx_read_flash_data()
3673 qla4_82xx_read_optrom_data(struct scsi_qla_host *ha, uint8_t *buf, in qla4_82xx_read_optrom_data() argument
3676 qla4_82xx_read_flash_data(ha, (uint32_t *)buf, offset, length); in qla4_82xx_read_optrom_data()
3681 qla4_8xxx_find_flt_start(struct scsi_qla_host *ha, uint32_t *start) in qla4_8xxx_find_flt_start() argument
3693 DEBUG2(ql4_printk(KERN_INFO, ha, "FLTL[%s] = 0x%x.\n", loc, *start)); in qla4_8xxx_find_flt_start()
3698 qla4_8xxx_get_flt_info(struct scsi_qla_host *ha, uint32_t flt_addr) in qla4_8xxx_get_flt_info() argument
3706 struct ql82xx_hw_data *hw = &ha->hw; in qla4_8xxx_get_flt_info()
3709 wptr = (uint16_t *)ha->request_ring; in qla4_8xxx_get_flt_info()
3710 flt = (struct qla_flt_header *)ha->request_ring; in qla4_8xxx_get_flt_info()
3713 if (is_qla8022(ha)) { in qla4_8xxx_get_flt_info()
3714 qla4_82xx_read_optrom_data(ha, (uint8_t *)ha->request_ring, in qla4_8xxx_get_flt_info()
3716 } else if (is_qla8032(ha) || is_qla8042(ha)) { in qla4_8xxx_get_flt_info()
3717 status = qla4_83xx_flash_read_u32(ha, flt_addr << 2, in qla4_8xxx_get_flt_info()
3718 (uint8_t *)ha->request_ring, in qla4_8xxx_get_flt_info()
3727 DEBUG2(ql4_printk(KERN_INFO, ha, "Unsupported FLT detected: " in qla4_8xxx_get_flt_info()
3738 DEBUG2(ql4_printk(KERN_INFO, ha, "Inconsistent FLT detected: " in qla4_8xxx_get_flt_info()
3751 DEBUG3(ql4_printk(KERN_DEBUG, ha, "FLT[%02x]: start=0x%x " in qla4_8xxx_get_flt_info()
3798 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_8xxx_get_flt_info()
3808 qla4_82xx_get_fdt_info(struct scsi_qla_host *ha) in qla4_82xx_get_fdt_info() argument
3819 struct ql82xx_hw_data *hw = &ha->hw; in qla4_82xx_get_fdt_info()
3824 wptr = (uint16_t *)ha->request_ring; in qla4_82xx_get_fdt_info()
3825 fdt = (struct qla_fdt_layout *)ha->request_ring; in qla4_82xx_get_fdt_info()
3826 qla4_82xx_read_optrom_data(ha, (uint8_t *)ha->request_ring, in qla4_82xx_get_fdt_info()
3841 DEBUG2(ql4_printk(KERN_INFO, ha, "Inconsistent FDT detected: " in qla4_82xx_get_fdt_info()
3867 DEBUG2(ql4_printk(KERN_INFO, ha, "FDT[%s]: (0x%x/0x%x) erase=0x%x " in qla4_82xx_get_fdt_info()
3875 qla4_82xx_get_idc_param(struct scsi_qla_host *ha) in qla4_82xx_get_idc_param() argument
3880 if (!is_qla8022(ha)) in qla4_82xx_get_idc_param()
3882 wptr = (uint32_t *)ha->request_ring; in qla4_82xx_get_idc_param()
3883 qla4_82xx_read_optrom_data(ha, (uint8_t *)ha->request_ring, in qla4_82xx_get_idc_param()
3887 ha->nx_dev_init_timeout = ROM_DEV_INIT_TIMEOUT; in qla4_82xx_get_idc_param()
3888 ha->nx_reset_timeout = ROM_DRV_RESET_ACK_TIMEOUT; in qla4_82xx_get_idc_param()
3890 ha->nx_dev_init_timeout = le32_to_cpu(*wptr++); in qla4_82xx_get_idc_param()
3891 ha->nx_reset_timeout = le32_to_cpu(*wptr); in qla4_82xx_get_idc_param()
3894 DEBUG2(ql4_printk(KERN_DEBUG, ha, in qla4_82xx_get_idc_param()
3895 "ha->nx_dev_init_timeout = %d\n", ha->nx_dev_init_timeout)); in qla4_82xx_get_idc_param()
3896 DEBUG2(ql4_printk(KERN_DEBUG, ha, in qla4_82xx_get_idc_param()
3897 "ha->nx_reset_timeout = %d\n", ha->nx_reset_timeout)); in qla4_82xx_get_idc_param()
3901 void qla4_82xx_queue_mbox_cmd(struct scsi_qla_host *ha, uint32_t *mbx_cmd, in qla4_82xx_queue_mbox_cmd() argument
3908 writel(mbx_cmd[i], &ha->qla4_82xx_reg->mailbox_in[i]); in qla4_82xx_queue_mbox_cmd()
3911 writel(mbx_cmd[0], &ha->qla4_82xx_reg->mailbox_in[0]); in qla4_82xx_queue_mbox_cmd()
3912 readl(&ha->qla4_82xx_reg->mailbox_in[0]); in qla4_82xx_queue_mbox_cmd()
3913 writel(HINT_MBX_INT_PENDING, &ha->qla4_82xx_reg->hint); in qla4_82xx_queue_mbox_cmd()
3914 readl(&ha->qla4_82xx_reg->hint); in qla4_82xx_queue_mbox_cmd()
3917 void qla4_82xx_process_mbox_intr(struct scsi_qla_host *ha, int out_count) in qla4_82xx_process_mbox_intr() argument
3921 intr_status = readl(&ha->qla4_82xx_reg->host_int); in qla4_82xx_process_mbox_intr()
3923 ha->mbox_status_count = out_count; in qla4_82xx_process_mbox_intr()
3924 intr_status = readl(&ha->qla4_82xx_reg->host_status); in qla4_82xx_process_mbox_intr()
3925 ha->isp_ops->interrupt_service_routine(ha, intr_status); in qla4_82xx_process_mbox_intr()
3927 if (test_bit(AF_INTERRUPTS_ON, &ha->flags) && in qla4_82xx_process_mbox_intr()
3928 (!ha->pdev->msi_enabled && !ha->pdev->msix_enabled)) in qla4_82xx_process_mbox_intr()
3929 qla4_82xx_wr_32(ha, ha->nx_legacy_intr.tgt_mask_reg, in qla4_82xx_process_mbox_intr()
3935 qla4_8xxx_get_flash_info(struct scsi_qla_host *ha) in qla4_8xxx_get_flash_info() argument
3940 ret = qla4_8xxx_find_flt_start(ha, &flt_addr); in qla4_8xxx_get_flash_info()
3944 qla4_8xxx_get_flt_info(ha, flt_addr); in qla4_8xxx_get_flash_info()
3945 if (is_qla8022(ha)) { in qla4_8xxx_get_flash_info()
3946 qla4_82xx_get_fdt_info(ha); in qla4_8xxx_get_flash_info()
3947 qla4_82xx_get_idc_param(ha); in qla4_8xxx_get_flash_info()
3948 } else if (is_qla8032(ha) || is_qla8042(ha)) { in qla4_8xxx_get_flash_info()
3949 qla4_83xx_get_idc_param(ha); in qla4_8xxx_get_flash_info()
3965 qla4_8xxx_stop_firmware(struct scsi_qla_host *ha) in qla4_8xxx_stop_firmware() argument
3975 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, in qla4_8xxx_stop_firmware()
3978 DEBUG2(printk("scsi%ld: %s: status = %d\n", ha->host_no, in qla4_8xxx_stop_firmware()
3988 qla4_82xx_isp_reset(struct scsi_qla_host *ha) in qla4_82xx_isp_reset() argument
3993 qla4_82xx_idc_lock(ha); in qla4_82xx_isp_reset()
3994 dev_state = qla4_82xx_rd_32(ha, QLA82XX_CRB_DEV_STATE); in qla4_82xx_isp_reset()
3997 ql4_printk(KERN_INFO, ha, "HW State: NEED RESET\n"); in qla4_82xx_isp_reset()
3998 qla4_82xx_wr_32(ha, QLA82XX_CRB_DEV_STATE, in qla4_82xx_isp_reset()
4000 set_bit(AF_8XXX_RST_OWNER, &ha->flags); in qla4_82xx_isp_reset()
4002 ql4_printk(KERN_INFO, ha, "HW State: DEVICE INITIALIZING\n"); in qla4_82xx_isp_reset()
4004 qla4_82xx_idc_unlock(ha); in qla4_82xx_isp_reset()
4006 rval = qla4_8xxx_device_state_handler(ha); in qla4_82xx_isp_reset()
4008 qla4_82xx_idc_lock(ha); in qla4_82xx_isp_reset()
4009 qla4_8xxx_clear_rst_ready(ha); in qla4_82xx_isp_reset()
4010 qla4_82xx_idc_unlock(ha); in qla4_82xx_isp_reset()
4013 ql4_printk(KERN_INFO, ha, "Clearing AF_RECOVERY in qla4_82xx_isp_reset\n"); in qla4_82xx_isp_reset()
4014 clear_bit(AF_FW_RECOVERY, &ha->flags); in qla4_82xx_isp_reset()
4025 int qla4_8xxx_get_sys_info(struct scsi_qla_host *ha) in qla4_8xxx_get_sys_info() argument
4033 sys_info = dma_alloc_coherent(&ha->pdev->dev, sizeof(*sys_info), in qla4_8xxx_get_sys_info()
4037 ha->host_no, __func__)); in qla4_8xxx_get_sys_info()
4049 if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 6, &mbox_cmd[0], in qla4_8xxx_get_sys_info()
4052 ha->host_no, __func__)); in qla4_8xxx_get_sys_info()
4057 if (((is_qla8032(ha) || is_qla8042(ha)) ? mbox_sts[3] : mbox_sts[4]) < in qla4_8xxx_get_sys_info()
4060 " error (%x)\n", ha->host_no, __func__, mbox_sts[4])); in qla4_8xxx_get_sys_info()
4065 ha->port_num = sys_info->port_num; in qla4_8xxx_get_sys_info()
4066 memcpy(ha->my_mac, &sys_info->mac_addr[0], in qla4_8xxx_get_sys_info()
4067 min(sizeof(ha->my_mac), sizeof(sys_info->mac_addr))); in qla4_8xxx_get_sys_info()
4068 memcpy(ha->serial_number, &sys_info->serial_number, in qla4_8xxx_get_sys_info()
4069 min(sizeof(ha->serial_number), sizeof(sys_info->serial_number))); in qla4_8xxx_get_sys_info()
4070 memcpy(ha->model_name, &sys_info->board_id_str, in qla4_8xxx_get_sys_info()
4071 min(sizeof(ha->model_name), sizeof(sys_info->board_id_str))); in qla4_8xxx_get_sys_info()
4072 ha->phy_port_cnt = sys_info->phys_port_cnt; in qla4_8xxx_get_sys_info()
4073 ha->phy_port_num = sys_info->port_num; in qla4_8xxx_get_sys_info()
4074 ha->iscsi_pci_func_cnt = sys_info->iscsi_pci_func_cnt; in qla4_8xxx_get_sys_info()
4077 ha->host_no, __func__, ha->my_mac, ha->serial_number)); in qla4_8xxx_get_sys_info()
4082 dma_free_coherent(&ha->pdev->dev, sizeof(*sys_info), sys_info, in qla4_8xxx_get_sys_info()
4089 int qla4_8xxx_intr_enable(struct scsi_qla_host *ha) in qla4_8xxx_intr_enable() argument
4094 DEBUG2(ql4_printk(KERN_INFO, ha, "%s\n", __func__)); in qla4_8xxx_intr_enable()
4100 if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], in qla4_8xxx_intr_enable()
4102 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_8xxx_intr_enable()
4110 int qla4_8xxx_intr_disable(struct scsi_qla_host *ha) in qla4_8xxx_intr_disable() argument
4115 DEBUG2(ql4_printk(KERN_INFO, ha, "%s\n", __func__)); in qla4_8xxx_intr_disable()
4121 if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], in qla4_8xxx_intr_disable()
4123 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_8xxx_intr_disable()
4133 qla4_82xx_enable_intrs(struct scsi_qla_host *ha) in qla4_82xx_enable_intrs() argument
4135 qla4_8xxx_intr_enable(ha); in qla4_82xx_enable_intrs()
4137 spin_lock_irq(&ha->hardware_lock); in qla4_82xx_enable_intrs()
4139 qla4_82xx_wr_32(ha, ha->nx_legacy_intr.tgt_mask_reg, 0xfbff); in qla4_82xx_enable_intrs()
4140 spin_unlock_irq(&ha->hardware_lock); in qla4_82xx_enable_intrs()
4141 set_bit(AF_INTERRUPTS_ON, &ha->flags); in qla4_82xx_enable_intrs()
4145 qla4_82xx_disable_intrs(struct scsi_qla_host *ha) in qla4_82xx_disable_intrs() argument
4147 if (test_and_clear_bit(AF_INTERRUPTS_ON, &ha->flags)) in qla4_82xx_disable_intrs()
4148 qla4_8xxx_intr_disable(ha); in qla4_82xx_disable_intrs()
4150 spin_lock_irq(&ha->hardware_lock); in qla4_82xx_disable_intrs()
4152 qla4_82xx_wr_32(ha, ha->nx_legacy_intr.tgt_mask_reg, 0x0400); in qla4_82xx_disable_intrs()
4153 spin_unlock_irq(&ha->hardware_lock); in qla4_82xx_disable_intrs()
4157 qla4_8xxx_enable_msix(struct scsi_qla_host *ha) in qla4_8xxx_enable_msix() argument
4161 ret = pci_alloc_irq_vectors(ha->pdev, QLA_MSIX_ENTRIES, in qla4_8xxx_enable_msix()
4164 ql4_printk(KERN_WARNING, ha, in qla4_8xxx_enable_msix()
4170 ret = request_irq(pci_irq_vector(ha->pdev, 0), in qla4_8xxx_enable_msix()
4172 ha); in qla4_8xxx_enable_msix()
4176 ret = request_irq(pci_irq_vector(ha->pdev, 1), in qla4_8xxx_enable_msix()
4177 qla4_8xxx_msix_rsp_q, 0, "qla4xxx (rsp_q)", ha); in qla4_8xxx_enable_msix()
4184 free_irq(pci_irq_vector(ha->pdev, 0), ha); in qla4_8xxx_enable_msix()
4186 pci_free_irq_vectors(ha->pdev); in qla4_8xxx_enable_msix()
4190 int qla4_8xxx_check_init_adapter_retry(struct scsi_qla_host *ha) in qla4_8xxx_check_init_adapter_retry() argument
4195 if (!test_bit(AF_IRQ_ATTACHED, &ha->flags)) { in qla4_8xxx_check_init_adapter_retry()
4196 …ql4_printk(KERN_WARNING, ha, "%s: Skipping retry of adapter initialization as IRQs are not attache… in qla4_8xxx_check_init_adapter_retry()
4205 qla4xxx_free_irqs(ha); in qla4_8xxx_check_init_adapter_retry()