Lines Matching refs:ha
275 static void ips_free_flash_copperhead(ips_ha_t * ha);
326 static int ips_abort_init(ips_ha_t * ha, int index);
332 static int ips_poll_for_flush_complete(ips_ha_t * ha);
333 static void ips_flush_and_reset(ips_ha_t *ha);
578 ips_setup_funclist(ips_ha_t * ha) in ips_setup_funclist() argument
584 if (IPS_IS_MORPHEUS(ha) || IPS_IS_MARCO(ha)) { in ips_setup_funclist()
586 ha->func.isintr = ips_isintr_morpheus; in ips_setup_funclist()
587 ha->func.isinit = ips_isinit_morpheus; in ips_setup_funclist()
588 ha->func.issue = ips_issue_i2o_memio; in ips_setup_funclist()
589 ha->func.init = ips_init_morpheus; in ips_setup_funclist()
590 ha->func.statupd = ips_statupd_morpheus; in ips_setup_funclist()
591 ha->func.reset = ips_reset_morpheus; in ips_setup_funclist()
592 ha->func.intr = ips_intr_morpheus; in ips_setup_funclist()
593 ha->func.enableint = ips_enable_int_morpheus; in ips_setup_funclist()
594 } else if (IPS_USE_MEMIO(ha)) { in ips_setup_funclist()
596 ha->func.isintr = ips_isintr_copperhead_memio; in ips_setup_funclist()
597 ha->func.isinit = ips_isinit_copperhead_memio; in ips_setup_funclist()
598 ha->func.init = ips_init_copperhead_memio; in ips_setup_funclist()
599 ha->func.statupd = ips_statupd_copperhead_memio; in ips_setup_funclist()
600 ha->func.statinit = ips_statinit_memio; in ips_setup_funclist()
601 ha->func.reset = ips_reset_copperhead_memio; in ips_setup_funclist()
602 ha->func.intr = ips_intr_copperhead; in ips_setup_funclist()
603 ha->func.erasebios = ips_erase_bios_memio; in ips_setup_funclist()
604 ha->func.programbios = ips_program_bios_memio; in ips_setup_funclist()
605 ha->func.verifybios = ips_verify_bios_memio; in ips_setup_funclist()
606 ha->func.enableint = ips_enable_int_copperhead_memio; in ips_setup_funclist()
607 if (IPS_USE_I2O_DELIVER(ha)) in ips_setup_funclist()
608 ha->func.issue = ips_issue_i2o_memio; in ips_setup_funclist()
610 ha->func.issue = ips_issue_copperhead_memio; in ips_setup_funclist()
613 ha->func.isintr = ips_isintr_copperhead; in ips_setup_funclist()
614 ha->func.isinit = ips_isinit_copperhead; in ips_setup_funclist()
615 ha->func.init = ips_init_copperhead; in ips_setup_funclist()
616 ha->func.statupd = ips_statupd_copperhead; in ips_setup_funclist()
617 ha->func.statinit = ips_statinit; in ips_setup_funclist()
618 ha->func.reset = ips_reset_copperhead; in ips_setup_funclist()
619 ha->func.intr = ips_intr_copperhead; in ips_setup_funclist()
620 ha->func.erasebios = ips_erase_bios; in ips_setup_funclist()
621 ha->func.programbios = ips_program_bios; in ips_setup_funclist()
622 ha->func.verifybios = ips_verify_bios; in ips_setup_funclist()
623 ha->func.enableint = ips_enable_int_copperhead; in ips_setup_funclist()
625 if (IPS_USE_I2O_DELIVER(ha)) in ips_setup_funclist()
626 ha->func.issue = ips_issue_i2o; in ips_setup_funclist()
628 ha->func.issue = ips_issue_copperhead; in ips_setup_funclist()
645 ips_ha_t *ha; in ips_release() local
661 ha = IPS_HA(sh); in ips_release()
663 if (!ha) in ips_release()
667 scb = &ha->scbs[ha->max_cmds - 1]; in ips_release()
669 ips_init_scb(ha, scb); in ips_release()
675 scb->cmd.flush_cache.command_id = IPS_COMMAND_ID(ha, scb); in ips_release()
682 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Flushing Cache.\n"); in ips_release()
685 if (ips_send_wait(ha, scb, ips_cmd_timeout, IPS_INTR_ON) == IPS_FAILURE) in ips_release()
686 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Incomplete Flush.\n"); in ips_release()
688 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Flushing Complete.\n"); in ips_release()
694 ips_free(ha); in ips_release()
697 free_irq(ha->pcidev->irq, ha); in ips_release()
719 ips_ha_t *ha; in ips_halt() local
727 ha = (ips_ha_t *) ips_ha[i]; in ips_halt()
729 if (!ha) in ips_halt()
732 if (!ha->active) in ips_halt()
736 scb = &ha->scbs[ha->max_cmds - 1]; in ips_halt()
738 ips_init_scb(ha, scb); in ips_halt()
744 scb->cmd.flush_cache.command_id = IPS_COMMAND_ID(ha, scb); in ips_halt()
751 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Flushing Cache.\n"); in ips_halt()
754 if (ips_send_wait(ha, scb, ips_cmd_timeout, IPS_INTR_ON) == in ips_halt()
756 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_halt()
759 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_halt()
777 ips_ha_t *ha; in ips_eh_abort() local
788 ha = (ips_ha_t *) SC->device->host->hostdata; in ips_eh_abort()
790 if (!ha) in ips_eh_abort()
793 if (!ha->active) in ips_eh_abort()
799 item = ha->copp_waitlist.head; in ips_eh_abort()
805 ips_removeq_copp(&ha->copp_waitlist, item); in ips_eh_abort()
809 } else if (ips_removeq_wait(&ha->scb_waitlist, SC)) { in ips_eh_abort()
836 ips_ha_t *ha; in __ips_eh_reset() local
852 ha = (ips_ha_t *) SC->device->host->hostdata; in __ips_eh_reset()
854 if (!ha) { in __ips_eh_reset()
860 if (!ha->active) in __ips_eh_reset()
864 item = ha->copp_waitlist.head; in __ips_eh_reset()
870 ips_removeq_copp(&ha->copp_waitlist, item); in __ips_eh_reset()
875 if (ips_removeq_wait(&ha->scb_waitlist, SC)) { in __ips_eh_reset()
890 if (ha->ioctl_reset == 0) { /* IF Not an IOCTL Requested Reset */ in __ips_eh_reset()
891 scb = &ha->scbs[ha->max_cmds - 1]; in __ips_eh_reset()
893 ips_init_scb(ha, scb); in __ips_eh_reset()
899 scb->cmd.flush_cache.command_id = IPS_COMMAND_ID(ha, scb); in __ips_eh_reset()
907 ret = ips_send_wait(ha, scb, ips_cmd_timeout, IPS_INTR_IORL); in __ips_eh_reset()
909 IPS_PRINTK(KERN_NOTICE, ha->pcidev, in __ips_eh_reset()
918 ha->ioctl_reset = 0; /* Reset the IOCTL Requested Reset Flag */ in __ips_eh_reset()
924 IPS_PRINTK(KERN_NOTICE, ha->pcidev, "Resetting controller.\n"); in __ips_eh_reset()
925 ret = (*ha->func.reset) (ha); in __ips_eh_reset()
930 IPS_PRINTK(KERN_NOTICE, ha->pcidev, in __ips_eh_reset()
935 ips_name, ha->host_num); in __ips_eh_reset()
937 while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { in __ips_eh_reset()
940 ips_freescb(ha, scb); in __ips_eh_reset()
945 ips_name, ha->host_num); in __ips_eh_reset()
947 while ((scsi_cmd = ips_removeq_wait_head(&ha->scb_waitlist))) { in __ips_eh_reset()
952 ha->active = FALSE; in __ips_eh_reset()
956 if (!ips_clear_adapter(ha, IPS_INTR_IORL)) { in __ips_eh_reset()
959 IPS_PRINTK(KERN_NOTICE, ha->pcidev, in __ips_eh_reset()
964 ips_name, ha->host_num); in __ips_eh_reset()
966 while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { in __ips_eh_reset()
969 ips_freescb(ha, scb); in __ips_eh_reset()
974 ips_name, ha->host_num); in __ips_eh_reset()
976 while ((scsi_cmd = ips_removeq_wait_head(&ha->scb_waitlist))) { in __ips_eh_reset()
981 ha->active = FALSE; in __ips_eh_reset()
986 if (le32_to_cpu(ha->subsys->param[3]) & 0x300000) { in __ips_eh_reset()
987 ha->last_ffdc = ktime_get_real_seconds(); in __ips_eh_reset()
988 ha->reset_count++; in __ips_eh_reset()
989 ips_ffdc_reset(ha, IPS_INTR_IORL); in __ips_eh_reset()
993 DEBUG_VAR(1, "(%s%d) Failing active commands", ips_name, ha->host_num); in __ips_eh_reset()
995 while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { in __ips_eh_reset()
998 ips_freescb(ha, scb); in __ips_eh_reset()
1002 for (i = 1; i < ha->nbus; i++) in __ips_eh_reset()
1003 ha->dcdb_active[i - 1] = 0; in __ips_eh_reset()
1006 ha->num_ioctl = 0; in __ips_eh_reset()
1008 ips_next(ha, IPS_INTR_IORL); in __ips_eh_reset()
1040 ips_ha_t *ha; in ips_queue_lck() local
1045 ha = (ips_ha_t *) SC->device->host->hostdata; in ips_queue_lck()
1047 if (!ha) in ips_queue_lck()
1050 if (!ha->active) in ips_queue_lck()
1054 if (ha->copp_waitlist.count == IPS_MAX_IOCTL_QUEUE) { in ips_queue_lck()
1060 } else if (ha->scb_waitlist.count == IPS_MAX_QUEUE) { in ips_queue_lck()
1071 ha->host_num, in ips_queue_lck()
1077 && (scmd_id(SC) == ha->ha_id[scmd_channel(SC)])) { in ips_queue_lck()
1094 if (ha->scb_activelist.count != 0) { in ips_queue_lck()
1099 ha->ioctl_reset = 1; /* This reset request is from an IOCTL */ in ips_queue_lck()
1119 ips_putq_copp_tail(&ha->copp_waitlist, scratch); in ips_queue_lck()
1121 ips_putq_wait_tail(&ha->scb_waitlist, SC); in ips_queue_lck()
1124 ips_next(ha, IPS_INTR_IORL); in ips_queue_lck()
1143 ips_ha_t *ha = (ips_ha_t *) sdev->host->hostdata; in DEF_SCSI_QCMD() local
1150 if (!ha) in DEF_SCSI_QCMD()
1154 if (!ha->active) in DEF_SCSI_QCMD()
1157 if (!ips_read_adapter_status(ha, IPS_INTR_ON)) in DEF_SCSI_QCMD()
1161 if ((capacity > 0x400000) && ((ha->enq->ucMiscFlag & 0x8) == 0)) { in DEF_SCSI_QCMD()
1193 ips_ha_t *ha; in ips_slave_configure() local
1196 ha = IPS_HA(SDptr->host); in ips_slave_configure()
1198 min = ha->max_cmds / 2; in ips_slave_configure()
1199 if (ha->enq->ucLogDriveCount <= 2) in ips_slave_configure()
1200 min = ha->max_cmds - 1; in ips_slave_configure()
1221 ips_ha_t *ha; in do_ipsintr() local
1227 ha = (ips_ha_t *) dev_id; in do_ipsintr()
1228 if (!ha) in do_ipsintr()
1230 host = ips_sh[ha->host_num]; in do_ipsintr()
1233 (*ha->func.intr) (ha); in do_ipsintr()
1239 if (!ha->active) { in do_ipsintr()
1244 irqstatus = (*ha->func.intr) (ha); in do_ipsintr()
1249 ips_next(ha, IPS_INTR_ON); in do_ipsintr()
1265 ips_intr_copperhead(ips_ha_t * ha) in ips_intr_copperhead() argument
1274 if (!ha) in ips_intr_copperhead()
1277 if (!ha->active) in ips_intr_copperhead()
1280 intrstatus = (*ha->func.isintr) (ha); in ips_intr_copperhead()
1291 sp = &ha->sp; in ips_intr_copperhead()
1293 intrstatus = (*ha->func.isintr) (ha); in ips_intr_copperhead()
1298 cstatus.value = (*ha->func.statupd) (ha); in ips_intr_copperhead()
1305 ips_chkstatus(ha, &cstatus); in ips_intr_copperhead()
1312 (*scb->callback) (ha, scb); in ips_intr_copperhead()
1329 ips_intr_morpheus(ips_ha_t * ha) in ips_intr_morpheus() argument
1338 if (!ha) in ips_intr_morpheus()
1341 if (!ha->active) in ips_intr_morpheus()
1344 intrstatus = (*ha->func.isintr) (ha); in ips_intr_morpheus()
1355 sp = &ha->sp; in ips_intr_morpheus()
1357 intrstatus = (*ha->func.isintr) (ha); in ips_intr_morpheus()
1362 cstatus.value = (*ha->func.statupd) (ha); in ips_intr_morpheus()
1369 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_intr_morpheus()
1375 ips_chkstatus(ha, &cstatus); in ips_intr_morpheus()
1382 (*scb->callback) (ha, scb); in ips_intr_morpheus()
1401 ips_ha_t *ha; in ips_info() local
1405 ha = IPS_HA(SH); in ips_info()
1407 if (!ha) in ips_info()
1416 if (ha->ad_type > 0 && ha->ad_type <= MAX_ADAPTER_NAME) { in ips_info()
1418 strcat(bp, ips_adapter_name[ha->ad_type - 1]); in ips_info()
1429 ips_ha_t *ha = NULL; in ips_write_info() local
1435 ha = (ips_ha_t *) ips_sh[i]->hostdata; in ips_write_info()
1441 if (!ha) in ips_write_info()
1451 ips_ha_t *ha = NULL; in ips_show_info() local
1457 ha = (ips_ha_t *) ips_sh[i]->hostdata; in ips_show_info()
1463 if (!ha) in ips_show_info()
1466 return ips_host_info(ha, m); in ips_show_info()
1523 ips_alloc_passthru_buffer(ips_ha_t * ha, int length) in ips_alloc_passthru_buffer() argument
1528 if (ha->ioctl_data && length <= ha->ioctl_len) in ips_alloc_passthru_buffer()
1531 bigger_buf = dma_alloc_coherent(&ha->pcidev->dev, length, &dma_busaddr, in ips_alloc_passthru_buffer()
1535 dma_free_coherent(&ha->pcidev->dev, ha->ioctl_len, in ips_alloc_passthru_buffer()
1536 ha->ioctl_data, ha->ioctl_busaddr); in ips_alloc_passthru_buffer()
1538 ha->ioctl_data = (char *) bigger_buf; in ips_alloc_passthru_buffer()
1539 ha->ioctl_len = length; in ips_alloc_passthru_buffer()
1540 ha->ioctl_busaddr = dma_busaddr; in ips_alloc_passthru_buffer()
1557 ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr) in ips_make_passthru() argument
1572 ips_name, ha->host_num); in ips_make_passthru()
1575 if (ips_alloc_passthru_buffer(ha, length)) { in ips_make_passthru()
1578 if (ha->ioctl_data) { in ips_make_passthru()
1579 pt = (ips_passthru_t *) ha->ioctl_data; in ips_make_passthru()
1587 ha->ioctl_datasize = length; in ips_make_passthru()
1589 ips_scmd_buf_read(SC, ha->ioctl_data, ha->ioctl_datasize); in ips_make_passthru()
1590 pt = (ips_passthru_t *) ha->ioctl_data; in ips_make_passthru()
1604 memcpy(ha->ioctl_data + sizeof (ips_passthru_t), in ips_make_passthru()
1606 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
1619 ips_name, ha->host_num); in ips_make_passthru()
1624 if (ha->pcidev->device == IPS_DEVICEID_COPPERHEAD && in ips_make_passthru()
1627 ret = ips_flash_copperhead(ha, pt, scb); in ips_make_passthru()
1628 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
1632 if (ips_usrcmd(ha, pt, scb)) in ips_make_passthru()
1651 ips_flash_copperhead(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_copperhead() argument
1657 if (IPS_IS_TROMBONE(ha) && pt->CoppCP.cmd.flashfw.type == IPS_FW_IMAGE) { in ips_flash_copperhead()
1658 if (ips_usrcmd(ha, pt, scb)) in ips_flash_copperhead()
1671 return ips_flash_bios(ha, pt, scb); in ips_flash_copperhead()
1674 ha->flash_data = ips_FlashData; in ips_flash_copperhead()
1675 ha->flash_busaddr = ips_flashbusaddr; in ips_flash_copperhead()
1676 ha->flash_len = PAGE_SIZE << 7; in ips_flash_copperhead()
1677 ha->flash_datasize = 0; in ips_flash_copperhead()
1678 } else if (!ha->flash_data) { in ips_flash_copperhead()
1681 ha->flash_data = dma_alloc_coherent(&ha->pcidev->dev, in ips_flash_copperhead()
1682 datasize, &ha->flash_busaddr, GFP_KERNEL); in ips_flash_copperhead()
1683 if (!ha->flash_data){ in ips_flash_copperhead()
1687 ha->flash_datasize = 0; in ips_flash_copperhead()
1688 ha->flash_len = datasize; in ips_flash_copperhead()
1692 if (pt->CoppCP.cmd.flashfw.count + ha->flash_datasize > in ips_flash_copperhead()
1693 ha->flash_len) { in ips_flash_copperhead()
1694 ips_free_flash_copperhead(ha); in ips_flash_copperhead()
1695 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_flash_copperhead()
1700 if (!ha->flash_data) in ips_flash_copperhead()
1703 memcpy(&ha->flash_data[ha->flash_datasize], pt + 1, in ips_flash_copperhead()
1705 ha->flash_datasize += pt->CoppCP.cmd.flashfw.count; in ips_flash_copperhead()
1709 return ips_flash_bios(ha, pt, scb); in ips_flash_copperhead()
1711 return ips_flash_firmware(ha, pt, scb); in ips_flash_copperhead()
1722 ips_flash_bios(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_bios() argument
1727 if ((!ha->func.programbios) || (!ha->func.erasebios) || in ips_flash_bios()
1728 (!ha->func.verifybios)) in ips_flash_bios()
1730 if ((*ha->func.erasebios) (ha)) { in ips_flash_bios()
1733 ips_name, ha->host_num); in ips_flash_bios()
1736 if ((*ha->func.programbios) (ha, in ips_flash_bios()
1737 ha->flash_data + in ips_flash_bios()
1739 ha->flash_datasize - in ips_flash_bios()
1743 ips_name, ha->host_num); in ips_flash_bios()
1746 if ((*ha->func.verifybios) (ha, in ips_flash_bios()
1747 ha->flash_data + in ips_flash_bios()
1749 ha->flash_datasize - in ips_flash_bios()
1753 ips_name, ha->host_num); in ips_flash_bios()
1756 ips_free_flash_copperhead(ha); in ips_flash_bios()
1760 if (!ha->func.erasebios) in ips_flash_bios()
1762 if ((*ha->func.erasebios) (ha)) { in ips_flash_bios()
1765 ips_name, ha->host_num); in ips_flash_bios()
1773 ips_free_flash_copperhead(ha); in ips_flash_bios()
1786 ips_fill_scb_sg_single(ips_ha_t * ha, dma_addr_t busaddr, in ips_fill_scb_sg_single() argument
1792 if ((scb->data_len + e_len) > ha->max_xfer) { in ips_fill_scb_sg_single()
1793 e_len = ha->max_xfer - scb->data_len; in ips_fill_scb_sg_single()
1801 if (IPS_USE_ENH_SGLIST(ha)) { in ips_fill_scb_sg_single()
1824 ips_flash_firmware(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_firmware() argument
1833 pt->CoppCP.cmd.flashfw.count = cpu_to_le32(ha->flash_datasize); in ips_flash_firmware()
1837 ips_free_flash_copperhead(ha); in ips_flash_firmware()
1858 scb->data_len = ha->flash_datasize; in ips_flash_firmware()
1860 dma_map_single(&ha->pcidev->dev, ha->flash_data, scb->data_len, in ips_flash_firmware()
1863 scb->cmd.flashfw.command_id = IPS_COMMAND_ID(ha, scb); in ips_flash_firmware()
1877 ips_free_flash_copperhead(ips_ha_t * ha) in ips_free_flash_copperhead() argument
1879 if (ha->flash_data == ips_FlashData) in ips_free_flash_copperhead()
1881 else if (ha->flash_data) in ips_free_flash_copperhead()
1882 dma_free_coherent(&ha->pcidev->dev, ha->flash_len, in ips_free_flash_copperhead()
1883 ha->flash_data, ha->flash_busaddr); in ips_free_flash_copperhead()
1884 ha->flash_data = NULL; in ips_free_flash_copperhead()
1897 ips_usrcmd(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_usrcmd() argument
1904 if ((!scb) || (!pt) || (!ha)) in ips_usrcmd()
1926 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_usrcmd()
1936 scb->data_busaddr = ha->ioctl_busaddr + sizeof (ips_passthru_t); in ips_usrcmd()
1985 ips_cleanup_passthru(ips_ha_t * ha, ips_scb_t * scb) in ips_cleanup_passthru() argument
1993 ips_name, ha->host_num); in ips_cleanup_passthru()
1997 pt = (ips_passthru_t *) ha->ioctl_data; in ips_cleanup_passthru()
2005 pt->AdapterType = ha->ad_type; in ips_cleanup_passthru()
2007 if (ha->pcidev->device == IPS_DEVICEID_COPPERHEAD && in ips_cleanup_passthru()
2010 ips_free_flash_copperhead(ha); in ips_cleanup_passthru()
2012 ips_scmd_buf_write(scb->scsi_cmd, ha->ioctl_data, ha->ioctl_datasize); in ips_cleanup_passthru()
2025 ips_host_info(ips_ha_t *ha, struct seq_file *m) in ips_host_info() argument
2031 if ((le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG) && in ips_host_info()
2032 (le16_to_cpu(ha->nvram->adapter_type) != 0)) in ips_host_info()
2034 ips_adapter_name[ha->ad_type - 1]); in ips_host_info()
2038 if (ha->io_addr) in ips_host_info()
2041 ha->io_addr, ha->io_len); in ips_host_info()
2043 if (ha->mem_addr) { in ips_host_info()
2046 ha->mem_addr, ha->mem_len); in ips_host_info()
2049 (unsigned long)ha->mem_ptr); in ips_host_info()
2052 seq_printf(m, "\tIRQ number : %d\n", ha->pcidev->irq); in ips_host_info()
2057 if (le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG) { in ips_host_info()
2058 if (ha->nvram->bios_low[3] == 0) { in ips_host_info()
2061 ha->nvram->bios_high[0], ha->nvram->bios_high[1], in ips_host_info()
2062 ha->nvram->bios_high[2], ha->nvram->bios_high[3], in ips_host_info()
2063 ha->nvram->bios_low[0], ha->nvram->bios_low[1], in ips_host_info()
2064 ha->nvram->bios_low[2]); in ips_host_info()
2069 ha->nvram->bios_high[0], ha->nvram->bios_high[1], in ips_host_info()
2070 ha->nvram->bios_high[2], ha->nvram->bios_high[3], in ips_host_info()
2071 ha->nvram->bios_low[0], ha->nvram->bios_low[1], in ips_host_info()
2072 ha->nvram->bios_low[2], ha->nvram->bios_low[3]); in ips_host_info()
2077 if (ha->enq->CodeBlkVersion[7] == 0) { in ips_host_info()
2080 ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1], in ips_host_info()
2081 ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3], in ips_host_info()
2082 ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5], in ips_host_info()
2083 ha->enq->CodeBlkVersion[6]); in ips_host_info()
2087 ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1], in ips_host_info()
2088 ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3], in ips_host_info()
2089 ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5], in ips_host_info()
2090 ha->enq->CodeBlkVersion[6], ha->enq->CodeBlkVersion[7]); in ips_host_info()
2093 if (ha->enq->BootBlkVersion[7] == 0) { in ips_host_info()
2096 ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1], in ips_host_info()
2097 ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3], in ips_host_info()
2098 ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5], in ips_host_info()
2099 ha->enq->BootBlkVersion[6]); in ips_host_info()
2103 ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1], in ips_host_info()
2104 ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3], in ips_host_info()
2105 ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5], in ips_host_info()
2106 ha->enq->BootBlkVersion[6], ha->enq->BootBlkVersion[7]); in ips_host_info()
2116 ha->enq->ucMaxPhysicalDevices); in ips_host_info()
2118 ha->max_cmds); in ips_host_info()
2120 ha->scb_waitlist.count); in ips_host_info()
2122 ha->scb_activelist.count - ha->num_ioctl); in ips_host_info()
2124 ha->copp_waitlist.count); in ips_host_info()
2126 ha->num_ioctl); in ips_host_info()
2143 ips_identify_controller(ips_ha_t * ha) in ips_identify_controller() argument
2147 switch (ha->pcidev->device) { in ips_identify_controller()
2149 if (ha->pcidev->revision <= IPS_REVID_SERVERAID) { in ips_identify_controller()
2150 ha->ad_type = IPS_ADTYPE_SERVERAID; in ips_identify_controller()
2151 } else if (ha->pcidev->revision == IPS_REVID_SERVERAID2) { in ips_identify_controller()
2152 ha->ad_type = IPS_ADTYPE_SERVERAID2; in ips_identify_controller()
2153 } else if (ha->pcidev->revision == IPS_REVID_NAVAJO) { in ips_identify_controller()
2154 ha->ad_type = IPS_ADTYPE_NAVAJO; in ips_identify_controller()
2155 } else if ((ha->pcidev->revision == IPS_REVID_SERVERAID2) in ips_identify_controller()
2156 && (ha->slot_num == 0)) { in ips_identify_controller()
2157 ha->ad_type = IPS_ADTYPE_KIOWA; in ips_identify_controller()
2158 } else if ((ha->pcidev->revision >= IPS_REVID_CLARINETP1) && in ips_identify_controller()
2159 (ha->pcidev->revision <= IPS_REVID_CLARINETP3)) { in ips_identify_controller()
2160 if (ha->enq->ucMaxPhysicalDevices == 15) in ips_identify_controller()
2161 ha->ad_type = IPS_ADTYPE_SERVERAID3L; in ips_identify_controller()
2163 ha->ad_type = IPS_ADTYPE_SERVERAID3; in ips_identify_controller()
2164 } else if ((ha->pcidev->revision >= IPS_REVID_TROMBONE32) && in ips_identify_controller()
2165 (ha->pcidev->revision <= IPS_REVID_TROMBONE64)) { in ips_identify_controller()
2166 ha->ad_type = IPS_ADTYPE_SERVERAID4H; in ips_identify_controller()
2171 switch (ha->pcidev->subsystem_device) { in ips_identify_controller()
2173 ha->ad_type = IPS_ADTYPE_SERVERAID4L; in ips_identify_controller()
2177 ha->ad_type = IPS_ADTYPE_SERVERAID4M; in ips_identify_controller()
2181 ha->ad_type = IPS_ADTYPE_SERVERAID4MX; in ips_identify_controller()
2185 ha->ad_type = IPS_ADTYPE_SERVERAID4LX; in ips_identify_controller()
2189 ha->ad_type = IPS_ADTYPE_SERVERAID5I2; in ips_identify_controller()
2193 ha->ad_type = IPS_ADTYPE_SERVERAID5I1; in ips_identify_controller()
2200 switch (ha->pcidev->subsystem_device) { in ips_identify_controller()
2202 ha->ad_type = IPS_ADTYPE_SERVERAID6M; in ips_identify_controller()
2205 ha->ad_type = IPS_ADTYPE_SERVERAID6I; in ips_identify_controller()
2208 ha->ad_type = IPS_ADTYPE_SERVERAID7k; in ips_identify_controller()
2211 ha->ad_type = IPS_ADTYPE_SERVERAID7M; in ips_identify_controller()
2228 ips_get_bios_version(ips_ha_t * ha, int intr) in ips_get_bios_version() argument
2242 memcpy(ha->bios_version, " ?", 8); in ips_get_bios_version()
2244 if (ha->pcidev->device == IPS_DEVICEID_COPPERHEAD) { in ips_get_bios_version()
2245 if (IPS_USE_MEMIO(ha)) { in ips_get_bios_version()
2249 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2250 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2253 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0x55) in ips_get_bios_version()
2256 writel(1, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2257 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2260 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0xAA) in ips_get_bios_version()
2264 writel(0x1FF, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2265 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2268 major = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_get_bios_version()
2271 writel(0x1FE, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2272 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2274 minor = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_get_bios_version()
2277 writel(0x1FD, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2278 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2280 subminor = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_get_bios_version()
2286 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2287 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2290 if (inb(ha->io_addr + IPS_REG_FLDP) != 0x55) in ips_get_bios_version()
2293 outl(1, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2294 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2297 if (inb(ha->io_addr + IPS_REG_FLDP) != 0xAA) in ips_get_bios_version()
2301 outl(0x1FF, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2302 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2305 major = inb(ha->io_addr + IPS_REG_FLDP); in ips_get_bios_version()
2308 outl(0x1FE, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2309 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2312 minor = inb(ha->io_addr + IPS_REG_FLDP); in ips_get_bios_version()
2315 outl(0x1FD, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2316 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2319 subminor = inb(ha->io_addr + IPS_REG_FLDP); in ips_get_bios_version()
2325 buffer = ha->ioctl_data; in ips_get_bios_version()
2329 scb = &ha->scbs[ha->max_cmds - 1]; in ips_get_bios_version()
2331 ips_init_scb(ha, scb); in ips_get_bios_version()
2337 scb->cmd.flashfw.command_id = IPS_COMMAND_ID(ha, scb); in ips_get_bios_version()
2344 scb->cmd.flashfw.buffer_addr = ha->ioctl_busaddr; in ips_get_bios_version()
2348 ips_send_wait(ha, scb, ips_cmd_timeout, in ips_get_bios_version()
2366 ha->bios_version[0] = hex_asc_upper_hi(major); in ips_get_bios_version()
2367 ha->bios_version[1] = '.'; in ips_get_bios_version()
2368 ha->bios_version[2] = hex_asc_upper_lo(major); in ips_get_bios_version()
2369 ha->bios_version[3] = hex_asc_upper_lo(subminor); in ips_get_bios_version()
2370 ha->bios_version[4] = '.'; in ips_get_bios_version()
2371 ha->bios_version[5] = hex_asc_upper_hi(minor); in ips_get_bios_version()
2372 ha->bios_version[6] = hex_asc_upper_lo(minor); in ips_get_bios_version()
2373 ha->bios_version[7] = 0; in ips_get_bios_version()
2388 ips_hainit(ips_ha_t * ha) in ips_hainit() argument
2394 if (!ha) in ips_hainit()
2397 if (ha->func.statinit) in ips_hainit()
2398 (*ha->func.statinit) (ha); in ips_hainit()
2400 if (ha->func.enableint) in ips_hainit()
2401 (*ha->func.enableint) (ha); in ips_hainit()
2404 ha->reset_count = 1; in ips_hainit()
2405 ha->last_ffdc = ktime_get_real_seconds(); in ips_hainit()
2406 ips_ffdc_reset(ha, IPS_INTR_IORL); in ips_hainit()
2408 if (!ips_read_config(ha, IPS_INTR_IORL)) { in ips_hainit()
2409 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2415 if (!ips_read_adapter_status(ha, IPS_INTR_IORL)) { in ips_hainit()
2416 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2423 ips_identify_controller(ha); in ips_hainit()
2425 if (!ips_read_subsystem_parameters(ha, IPS_INTR_IORL)) { in ips_hainit()
2426 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2433 if (!ips_write_driver_status(ha, IPS_INTR_IORL)) { in ips_hainit()
2434 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2441 if ((ha->conf->ucLogDriveCount > 0) && (ha->requires_esl == 1)) in ips_hainit()
2442 ips_clear_adapter(ha, IPS_INTR_IORL); in ips_hainit()
2445 ha->ntargets = IPS_MAX_TARGETS + 1; in ips_hainit()
2446 ha->nlun = 1; in ips_hainit()
2447 ha->nbus = (ha->enq->ucMaxPhysicalDevices / IPS_MAX_TARGETS) + 1; in ips_hainit()
2449 switch (ha->conf->logical_drive[0].ucStripeSize) { in ips_hainit()
2451 ha->max_xfer = 0x10000; in ips_hainit()
2455 ha->max_xfer = 0x20000; in ips_hainit()
2459 ha->max_xfer = 0x40000; in ips_hainit()
2464 ha->max_xfer = 0x80000; in ips_hainit()
2469 if (le32_to_cpu(ha->subsys->param[4]) & 0x1) { in ips_hainit()
2471 ha->max_cmds = ha->enq->ucConcurrentCmdCount; in ips_hainit()
2474 switch (ha->conf->logical_drive[0].ucStripeSize) { in ips_hainit()
2476 ha->max_cmds = 32; in ips_hainit()
2480 ha->max_cmds = 16; in ips_hainit()
2484 ha->max_cmds = 8; in ips_hainit()
2489 ha->max_cmds = 4; in ips_hainit()
2495 if ((ha->ad_type == IPS_ADTYPE_SERVERAID3L) || in ips_hainit()
2496 (ha->ad_type == IPS_ADTYPE_SERVERAID4L) || in ips_hainit()
2497 (ha->ad_type == IPS_ADTYPE_SERVERAID4LX)) { in ips_hainit()
2498 if ((ha->max_cmds > MaxLiteCmds) && (MaxLiteCmds)) in ips_hainit()
2499 ha->max_cmds = MaxLiteCmds; in ips_hainit()
2503 ha->ha_id[0] = IPS_ADAPTER_ID; in ips_hainit()
2504 for (i = 1; i < ha->nbus; i++) { in ips_hainit()
2505 ha->ha_id[i] = ha->conf->init_id[i - 1] & 0x1f; in ips_hainit()
2506 ha->dcdb_active[i - 1] = 0; in ips_hainit()
2522 ips_next(ips_ha_t * ha, int intr) in ips_next() argument
2533 if (!ha) in ips_next()
2535 host = ips_sh[ha->host_num]; in ips_next()
2543 if ((ha->subsys->param[3] & 0x300000) in ips_next()
2544 && (ha->scb_activelist.count == 0)) { in ips_next()
2546 if (now - ha->last_ffdc > IPS_SECS_8HOURS) { in ips_next()
2547 ha->last_ffdc = now; in ips_next()
2548 ips_ffdc_time(ha); in ips_next()
2559 while ((ha->num_ioctl < IPS_MAX_IOCTL) && in ips_next()
2560 (ha->copp_waitlist.head) && (scb = ips_getscb(ha))) { in ips_next()
2562 item = ips_removeq_copp_head(&ha->copp_waitlist); in ips_next()
2563 ha->num_ioctl++; in ips_next()
2569 ret = ips_make_passthru(ha, scb->scsi_cmd, scb, intr); in ips_next()
2580 ips_freescb(ha, scb); in ips_next()
2588 ips_freescb(ha, scb); in ips_next()
2595 ha->num_ioctl--; in ips_next()
2599 ret = ips_send_cmd(ha, scb); in ips_next()
2602 ips_putq_scb_head(&ha->scb_activelist, scb); in ips_next()
2604 ha->num_ioctl--; in ips_next()
2612 ips_freescb(ha, scb); in ips_next()
2615 ips_freescb(ha, scb); in ips_next()
2627 p = ha->scb_waitlist.head; in ips_next()
2628 while ((p) && (scb = ips_getscb(ha))) { in ips_next()
2630 && (ha-> in ips_next()
2633 ips_freescb(ha, scb); in ips_next()
2639 SC = ips_removeq_wait(&ha->scb_waitlist, q); in ips_next()
2670 (ha, sg_dma_address(sg), scb, i, in ips_next()
2701 ret = ips_send_cmd(ha, scb); in ips_next()
2705 ips_putq_scb_head(&ha->scb_activelist, scb); in ips_next()
2714 ha->dcdb_active[scb->bus - 1] &= in ips_next()
2717 ips_freescb(ha, scb); in ips_next()
2724 ha->dcdb_active[scb->bus - 1] &= in ips_next()
2727 ips_freescb(ha, scb); in ips_next()
3084 ipsintr_blocking(ips_ha_t * ha, ips_scb_t * scb) in ipsintr_blocking() argument
3088 ips_freescb(ha, scb); in ipsintr_blocking()
3089 if ((ha->waitflag == TRUE) && (ha->cmd_in_progress == scb->cdb[0])) { in ipsintr_blocking()
3090 ha->waitflag = FALSE; in ipsintr_blocking()
3106 ipsintr_done(ips_ha_t * ha, ips_scb_t * scb) in ipsintr_done() argument
3111 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ipsintr_done()
3119 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ipsintr_done()
3125 ips_done(ha, scb); in ipsintr_done()
3138 ips_done(ips_ha_t * ha, ips_scb_t * scb) in ips_done() argument
3148 ips_cleanup_passthru(ha, scb); in ips_done()
3149 ha->num_ioctl--; in ips_done()
3171 ips_fill_scb_sg_single(ha, in ips_done()
3179 (ha, in ips_done()
3198 ret = ips_send_cmd(ha, scb); in ips_done()
3207 ips_freescb(ha, scb); in ips_done()
3215 ips_freescb(ha, scb); in ips_done()
3226 ha->dcdb_active[scb->bus - 1] &= ~(1 << scb->target_id); in ips_done()
3231 ips_freescb(ha, scb); in ips_done()
3244 ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) in ips_map_status() argument
3257 ips_name, ha->host_num, in ips_map_status()
3381 ips_send_wait(ips_ha_t * ha, ips_scb_t * scb, int timeout, int intr) in ips_send_wait() argument
3388 ha->waitflag = TRUE; in ips_send_wait()
3389 ha->cmd_in_progress = scb->cdb[0]; in ips_send_wait()
3392 ret = ips_send_cmd(ha, scb); in ips_send_wait()
3398 ret = ips_wait(ha, timeout, intr); in ips_send_wait()
3447 ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) in ips_send_cmd() argument
3465 if ((ha->waitflag == TRUE) && in ips_send_cmd()
3466 (ha->cmd_in_progress == scb->cdb[0])) { in ips_send_cmd()
3467 ha->waitflag = FALSE; in ips_send_cmd()
3533 scb->cmd.logical_info.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3537 scb->data_busaddr = ha->logical_drive_info_dma_addr; in ips_send_cmd()
3546 ips_reqsen(ha, scb); in ips_send_cmd()
3565 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3571 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3611 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3617 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3656 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3659 scb->data_len = sizeof (*ha->enq); in ips_send_cmd()
3660 scb->cmd.basic_io.sg_addr = ha->enq_busaddr; in ips_send_cmd()
3666 scb->cmd.logical_info.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3671 scb->data_busaddr = ha->logical_drive_info_dma_addr; in ips_send_cmd()
3714 if (ha->conf->dev[scb->bus - 1][scb->target_id].ucState == 0) { in ips_send_cmd()
3719 ha->dcdb_active[scb->bus - 1] |= (1 << scb->target_id); in ips_send_cmd()
3720 scb->cmd.dcdb.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3733 if (ha->subsys->param[4] & 0x00100000) { /* If NEW Tape DCDB is Supported */ in ips_send_cmd()
3740 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3779 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3817 return ((*ha->func.issue) (ha, scb)); in ips_send_cmd()
3830 ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) in ips_chkstatus() argument
3841 scb = &ha->scbs[pstatus->fields.command_id]; in ips_chkstatus()
3846 sp = &ha->sp; in ips_chkstatus()
3851 ips_removeq_scb(&ha->scb_activelist, scb); in ips_chkstatus()
3859 ha->host_num, in ips_chkstatus()
3878 ips_name, ha->host_num, in ips_chkstatus()
3896 if (!ips_online(ha, scb)) { in ips_chkstatus()
3902 if (ips_online(ha, scb)) { in ips_chkstatus()
3903 ips_inquiry(ha, scb); in ips_chkstatus()
3910 ips_reqsen(ha, scb); in ips_chkstatus()
3922 if (!ips_online(ha, scb) in ips_chkstatus()
3923 || !ips_msense(ha, scb)) { in ips_chkstatus()
3929 if (ips_online(ha, scb)) in ips_chkstatus()
3930 ips_rdcap(ha, scb); in ips_chkstatus()
3969 ips_name, ha->host_num, in ips_chkstatus()
3974 ips_map_status(ha, scb, sp); in ips_chkstatus()
3988 ips_online(ips_ha_t * ha, ips_scb_t * scb) in ips_online() argument
3996 memset(ha->logical_drive_info, 0, sizeof (IPS_LD_INFO)); in ips_online()
4000 if (ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4002 && ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4004 && ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4006 && ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4023 ips_inquiry(ips_ha_t * ha, ips_scb_t * scb) in ips_inquiry() argument
4058 ips_rdcap(ips_ha_t * ha, ips_scb_t * scb) in ips_rdcap() argument
4069 (ha->logical_drive_info-> in ips_rdcap()
4088 ips_msense(ips_ha_t * ha, ips_scb_t * scb) in ips_msense() argument
4097 if (le32_to_cpu(ha->enq->ulDriveSize[scb->target_id]) > 0x400000 && in ips_msense()
4098 (ha->enq->ucMiscFlag & 0x8) == 0) { in ips_msense()
4107 (le32_to_cpu(ha->enq->ulDriveSize[scb->target_id]) - in ips_msense()
4179 ips_reqsen(ips_ha_t * ha, ips_scb_t * scb) in ips_reqsen() argument
4208 ips_free(ips_ha_t * ha) in ips_free() argument
4213 if (ha) { in ips_free()
4214 if (ha->enq) { in ips_free()
4215 dma_free_coherent(&ha->pcidev->dev, sizeof(IPS_ENQ), in ips_free()
4216 ha->enq, ha->enq_busaddr); in ips_free()
4217 ha->enq = NULL; in ips_free()
4220 kfree(ha->conf); in ips_free()
4221 ha->conf = NULL; in ips_free()
4223 if (ha->adapt) { in ips_free()
4224 dma_free_coherent(&ha->pcidev->dev, in ips_free()
4226 sizeof (IPS_IO_CMD), ha->adapt, in ips_free()
4227 ha->adapt->hw_status_start); in ips_free()
4228 ha->adapt = NULL; in ips_free()
4231 if (ha->logical_drive_info) { in ips_free()
4232 dma_free_coherent(&ha->pcidev->dev, in ips_free()
4234 ha->logical_drive_info, in ips_free()
4235 ha->logical_drive_info_dma_addr); in ips_free()
4236 ha->logical_drive_info = NULL; in ips_free()
4239 kfree(ha->nvram); in ips_free()
4240 ha->nvram = NULL; in ips_free()
4242 kfree(ha->subsys); in ips_free()
4243 ha->subsys = NULL; in ips_free()
4245 if (ha->ioctl_data) { in ips_free()
4246 dma_free_coherent(&ha->pcidev->dev, ha->ioctl_len, in ips_free()
4247 ha->ioctl_data, ha->ioctl_busaddr); in ips_free()
4248 ha->ioctl_data = NULL; in ips_free()
4249 ha->ioctl_datasize = 0; in ips_free()
4250 ha->ioctl_len = 0; in ips_free()
4252 ips_deallocatescbs(ha, ha->max_cmds); in ips_free()
4255 if (ha->mem_ptr) { in ips_free()
4256 iounmap(ha->ioremap_ptr); in ips_free()
4257 ha->ioremap_ptr = NULL; in ips_free()
4258 ha->mem_ptr = NULL; in ips_free()
4261 ha->mem_addr = 0; in ips_free()
4276 ips_deallocatescbs(ips_ha_t * ha, int cmds) in ips_deallocatescbs() argument
4278 if (ha->scbs) { in ips_deallocatescbs()
4279 dma_free_coherent(&ha->pcidev->dev, in ips_deallocatescbs()
4280 IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * cmds, in ips_deallocatescbs()
4281 ha->scbs->sg_list.list, in ips_deallocatescbs()
4282 ha->scbs->sg_busaddr); in ips_deallocatescbs()
4283 dma_free_coherent(&ha->pcidev->dev, sizeof (ips_scb_t) * cmds, in ips_deallocatescbs()
4284 ha->scbs, ha->scbs->scb_busaddr); in ips_deallocatescbs()
4285 ha->scbs = NULL; in ips_deallocatescbs()
4300 ips_allocatescbs(ips_ha_t * ha) in ips_allocatescbs() argument
4310 ha->scbs = dma_alloc_coherent(&ha->pcidev->dev, in ips_allocatescbs()
4311 ha->max_cmds * sizeof (ips_scb_t), in ips_allocatescbs()
4313 if (ha->scbs == NULL) in ips_allocatescbs()
4315 ips_sg.list = dma_alloc_coherent(&ha->pcidev->dev, in ips_allocatescbs()
4316 IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * ha->max_cmds, in ips_allocatescbs()
4319 dma_free_coherent(&ha->pcidev->dev, in ips_allocatescbs()
4320 ha->max_cmds * sizeof (ips_scb_t), ha->scbs, in ips_allocatescbs()
4325 memset(ha->scbs, 0, ha->max_cmds * sizeof (ips_scb_t)); in ips_allocatescbs()
4327 for (i = 0; i < ha->max_cmds; i++) { in ips_allocatescbs()
4328 scb_p = &ha->scbs[i]; in ips_allocatescbs()
4331 if (IPS_USE_ENH_SGLIST(ha)) { in ips_allocatescbs()
4335 sg_dma + IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * i; in ips_allocatescbs()
4340 sg_dma + IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * i; in ips_allocatescbs()
4344 if (i < ha->max_cmds - 1) { in ips_allocatescbs()
4345 scb_p->q_next = ha->scb_freelist; in ips_allocatescbs()
4346 ha->scb_freelist = scb_p; in ips_allocatescbs()
4364 ips_init_scb(ips_ha_t * ha, ips_scb_t * scb) in ips_init_scb() argument
4378 memset(ha->dummy, 0, sizeof (IPS_IO_CMD)); in ips_init_scb()
4381 ha->dummy->op_code = 0xFF; in ips_init_scb()
4382 ha->dummy->ccsar = cpu_to_le32(ha->adapt->hw_status_start in ips_init_scb()
4384 ha->dummy->command_id = IPS_MAX_CMDS; in ips_init_scb()
4393 scb->cmd.basic_io.ccsar = cpu_to_le32(ha->adapt->hw_status_start in ips_init_scb()
4409 ips_getscb(ips_ha_t * ha) in ips_getscb() argument
4415 if ((scb = ha->scb_freelist) == NULL) { in ips_getscb()
4420 ha->scb_freelist = scb->q_next; in ips_getscb()
4424 ips_init_scb(ha, scb); in ips_getscb()
4441 ips_freescb(ips_ha_t * ha, ips_scb_t * scb) in ips_freescb() argument
4448 dma_unmap_single(&ha->pcidev->dev, scb->data_busaddr, in ips_freescb()
4452 if (IPS_COMMAND_ID(ha, scb) < (ha->max_cmds - 1)) { in ips_freescb()
4453 scb->q_next = ha->scb_freelist; in ips_freescb()
4454 ha->scb_freelist = scb; in ips_freescb()
4468 ips_isinit_copperhead(ips_ha_t * ha) in ips_isinit_copperhead() argument
4475 isr = inb(ha->io_addr + IPS_REG_HISR); in ips_isinit_copperhead()
4476 scpr = inb(ha->io_addr + IPS_REG_SCPR); in ips_isinit_copperhead()
4494 ips_isinit_copperhead_memio(ips_ha_t * ha) in ips_isinit_copperhead_memio() argument
4501 isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_isinit_copperhead_memio()
4502 scpr = readb(ha->mem_ptr + IPS_REG_SCPR); in ips_isinit_copperhead_memio()
4520 ips_isinit_morpheus(ips_ha_t * ha) in ips_isinit_morpheus() argument
4527 if (ips_isintr_morpheus(ha)) in ips_isinit_morpheus()
4528 ips_flush_and_reset(ha); in ips_isinit_morpheus()
4530 post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_isinit_morpheus()
4531 bits = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_isinit_morpheus()
4552 ips_flush_and_reset(ips_ha_t *ha) in ips_flush_and_reset() argument
4561 scb = dma_alloc_coherent(&ha->pcidev->dev, sizeof(ips_scb_t), in ips_flush_and_reset()
4565 ips_init_scb(ha, scb); in ips_flush_and_reset()
4579 ret = ips_send_cmd(ha, scb); /* Send the Flush Command */ in ips_flush_and_reset()
4586 done = ips_poll_for_flush_complete(ha); in ips_flush_and_reset()
4595 (*ha->func.reset) (ha); in ips_flush_and_reset()
4597 dma_free_coherent(&ha->pcidev->dev, sizeof(ips_scb_t), scb, command_dma); in ips_flush_and_reset()
4612 ips_poll_for_flush_complete(ips_ha_t * ha) in ips_poll_for_flush_complete() argument
4617 cstatus.value = (*ha->func.statupd) (ha); in ips_poll_for_flush_complete()
4639 ips_enable_int_copperhead(ips_ha_t * ha) in ips_enable_int_copperhead() argument
4643 outb(ha->io_addr + IPS_REG_HISR, IPS_BIT_EI); in ips_enable_int_copperhead()
4644 inb(ha->io_addr + IPS_REG_HISR); /*Ensure PCI Posting Completes*/ in ips_enable_int_copperhead()
4656 ips_enable_int_copperhead_memio(ips_ha_t * ha) in ips_enable_int_copperhead_memio() argument
4660 writeb(IPS_BIT_EI, ha->mem_ptr + IPS_REG_HISR); in ips_enable_int_copperhead_memio()
4661 readb(ha->mem_ptr + IPS_REG_HISR); /*Ensure PCI Posting Completes*/ in ips_enable_int_copperhead_memio()
4673 ips_enable_int_morpheus(ips_ha_t * ha) in ips_enable_int_morpheus() argument
4679 Oimr = readl(ha->mem_ptr + IPS_REG_I960_OIMR); in ips_enable_int_morpheus()
4681 writel(Oimr, ha->mem_ptr + IPS_REG_I960_OIMR); in ips_enable_int_morpheus()
4682 readl(ha->mem_ptr + IPS_REG_I960_OIMR); /*Ensure PCI Posting Completes*/ in ips_enable_int_morpheus()
4695 ips_init_copperhead(ips_ha_t * ha) in ips_init_copperhead() argument
4706 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4718 PostByte[i] = inb(ha->io_addr + IPS_REG_ISPR); in ips_init_copperhead()
4719 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4723 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_copperhead()
4732 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4744 inb(ha->io_addr + IPS_REG_ISPR); in ips_init_copperhead()
4745 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4749 Cbsp = inb(ha->io_addr + IPS_REG_CBSP); in ips_init_copperhead()
4763 outl(0x1010, ha->io_addr + IPS_REG_CCCR); in ips_init_copperhead()
4766 outb(IPS_BIT_EBM, ha->io_addr + IPS_REG_SCPR); in ips_init_copperhead()
4768 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_init_copperhead()
4770 outl(0, ha->io_addr + IPS_REG_NDAE); in ips_init_copperhead()
4773 outb(IPS_BIT_EI, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4788 ips_init_copperhead_memio(ips_ha_t * ha) in ips_init_copperhead_memio() argument
4799 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4811 PostByte[i] = readb(ha->mem_ptr + IPS_REG_ISPR); in ips_init_copperhead_memio()
4812 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4816 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_copperhead_memio()
4825 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4837 readb(ha->mem_ptr + IPS_REG_ISPR); in ips_init_copperhead_memio()
4838 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4842 Cbsp = readb(ha->mem_ptr + IPS_REG_CBSP); in ips_init_copperhead_memio()
4856 writel(0x1010, ha->mem_ptr + IPS_REG_CCCR); in ips_init_copperhead_memio()
4859 writeb(IPS_BIT_EBM, ha->mem_ptr + IPS_REG_SCPR); in ips_init_copperhead_memio()
4861 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_init_copperhead_memio()
4863 writel(0, ha->mem_ptr + IPS_REG_NDAE); in ips_init_copperhead_memio()
4866 writeb(IPS_BIT_EI, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4882 ips_init_morpheus(ips_ha_t * ha) in ips_init_morpheus() argument
4894 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4905 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4911 Post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_init_morpheus()
4914 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4919 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4922 Post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_init_morpheus()
4930 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4939 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4942 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4950 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4961 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4967 Config = readl(ha->mem_ptr + IPS_REG_I960_MSG1); in ips_init_morpheus()
4971 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4974 Oimr = readl(ha->mem_ptr + IPS_REG_I960_OIMR); in ips_init_morpheus()
4976 writel(Oimr, ha->mem_ptr + IPS_REG_I960_OIMR); in ips_init_morpheus()
4983 ha->requires_esl = 1; in ips_init_morpheus()
4999 ips_reset_copperhead(ips_ha_t * ha) in ips_reset_copperhead() argument
5006 ips_name, ha->host_num, ha->io_addr, ha->pcidev->irq); in ips_reset_copperhead()
5013 outb(IPS_BIT_RST, ha->io_addr + IPS_REG_SCPR); in ips_reset_copperhead()
5018 outb(0, ha->io_addr + IPS_REG_SCPR); in ips_reset_copperhead()
5023 if ((*ha->func.init) (ha)) in ips_reset_copperhead()
5044 ips_reset_copperhead_memio(ips_ha_t * ha) in ips_reset_copperhead_memio() argument
5051 ips_name, ha->host_num, ha->mem_addr, ha->pcidev->irq); in ips_reset_copperhead_memio()
5058 writeb(IPS_BIT_RST, ha->mem_ptr + IPS_REG_SCPR); in ips_reset_copperhead_memio()
5063 writeb(0, ha->mem_ptr + IPS_REG_SCPR); in ips_reset_copperhead_memio()
5068 if ((*ha->func.init) (ha)) in ips_reset_copperhead_memio()
5089 ips_reset_morpheus(ips_ha_t * ha) in ips_reset_morpheus() argument
5097 ips_name, ha->host_num, ha->mem_addr, ha->pcidev->irq); in ips_reset_morpheus()
5104 writel(0x80000000, ha->mem_ptr + IPS_REG_I960_IDR); in ips_reset_morpheus()
5110 pci_read_config_byte(ha->pcidev, 4, &junk); in ips_reset_morpheus()
5112 if ((*ha->func.init) (ha)) in ips_reset_morpheus()
5133 ips_statinit(ips_ha_t * ha) in ips_statinit() argument
5139 ha->adapt->p_status_start = ha->adapt->status; in ips_statinit()
5140 ha->adapt->p_status_end = ha->adapt->status + IPS_MAX_CMDS; in ips_statinit()
5141 ha->adapt->p_status_tail = ha->adapt->status; in ips_statinit()
5143 phys_status_start = ha->adapt->hw_status_start; in ips_statinit()
5144 outl(phys_status_start, ha->io_addr + IPS_REG_SQSR); in ips_statinit()
5146 ha->io_addr + IPS_REG_SQER); in ips_statinit()
5148 ha->io_addr + IPS_REG_SQHR); in ips_statinit()
5149 outl(phys_status_start, ha->io_addr + IPS_REG_SQTR); in ips_statinit()
5151 ha->adapt->hw_status_tail = phys_status_start; in ips_statinit()
5164 ips_statinit_memio(ips_ha_t * ha) in ips_statinit_memio() argument
5170 ha->adapt->p_status_start = ha->adapt->status; in ips_statinit_memio()
5171 ha->adapt->p_status_end = ha->adapt->status + IPS_MAX_CMDS; in ips_statinit_memio()
5172 ha->adapt->p_status_tail = ha->adapt->status; in ips_statinit_memio()
5174 phys_status_start = ha->adapt->hw_status_start; in ips_statinit_memio()
5175 writel(phys_status_start, ha->mem_ptr + IPS_REG_SQSR); in ips_statinit_memio()
5177 ha->mem_ptr + IPS_REG_SQER); in ips_statinit_memio()
5178 writel(phys_status_start + IPS_STATUS_SIZE, ha->mem_ptr + IPS_REG_SQHR); in ips_statinit_memio()
5179 writel(phys_status_start, ha->mem_ptr + IPS_REG_SQTR); in ips_statinit_memio()
5181 ha->adapt->hw_status_tail = phys_status_start; in ips_statinit_memio()
5194 ips_statupd_copperhead(ips_ha_t * ha) in ips_statupd_copperhead() argument
5198 if (ha->adapt->p_status_tail != ha->adapt->p_status_end) { in ips_statupd_copperhead()
5199 ha->adapt->p_status_tail++; in ips_statupd_copperhead()
5200 ha->adapt->hw_status_tail += sizeof (IPS_STATUS); in ips_statupd_copperhead()
5202 ha->adapt->p_status_tail = ha->adapt->p_status_start; in ips_statupd_copperhead()
5203 ha->adapt->hw_status_tail = ha->adapt->hw_status_start; in ips_statupd_copperhead()
5206 outl(ha->adapt->hw_status_tail, in ips_statupd_copperhead()
5207 ha->io_addr + IPS_REG_SQTR); in ips_statupd_copperhead()
5209 return (ha->adapt->p_status_tail->value); in ips_statupd_copperhead()
5222 ips_statupd_copperhead_memio(ips_ha_t * ha) in ips_statupd_copperhead_memio() argument
5226 if (ha->adapt->p_status_tail != ha->adapt->p_status_end) { in ips_statupd_copperhead_memio()
5227 ha->adapt->p_status_tail++; in ips_statupd_copperhead_memio()
5228 ha->adapt->hw_status_tail += sizeof (IPS_STATUS); in ips_statupd_copperhead_memio()
5230 ha->adapt->p_status_tail = ha->adapt->p_status_start; in ips_statupd_copperhead_memio()
5231 ha->adapt->hw_status_tail = ha->adapt->hw_status_start; in ips_statupd_copperhead_memio()
5234 writel(ha->adapt->hw_status_tail, ha->mem_ptr + IPS_REG_SQTR); in ips_statupd_copperhead_memio()
5236 return (ha->adapt->p_status_tail->value); in ips_statupd_copperhead_memio()
5249 ips_statupd_morpheus(ips_ha_t * ha) in ips_statupd_morpheus() argument
5255 val = readl(ha->mem_ptr + IPS_REG_I2O_OUTMSGQ); in ips_statupd_morpheus()
5270 ips_issue_copperhead(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_copperhead() argument
5280 ha->host_num, in ips_issue_copperhead()
5286 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_copperhead()
5292 le32_to_cpu(inl(ha->io_addr + IPS_REG_CCCR))) & IPS_BIT_SEM) { in ips_issue_copperhead()
5299 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead()
5301 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead()
5308 outl(scb->scb_busaddr, ha->io_addr + IPS_REG_CCSAR); in ips_issue_copperhead()
5309 outw(IPS_BIT_START_CMD, ha->io_addr + IPS_REG_CCCR); in ips_issue_copperhead()
5324 ips_issue_copperhead_memio(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_copperhead_memio() argument
5334 ha->host_num, in ips_issue_copperhead_memio()
5340 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_copperhead_memio()
5345 while ((val = readl(ha->mem_ptr + IPS_REG_CCCR)) & IPS_BIT_SEM) { in ips_issue_copperhead_memio()
5352 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead_memio()
5354 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead_memio()
5361 writel(scb->scb_busaddr, ha->mem_ptr + IPS_REG_CCSAR); in ips_issue_copperhead_memio()
5362 writel(IPS_BIT_START_CMD, ha->mem_ptr + IPS_REG_CCCR); in ips_issue_copperhead_memio()
5377 ips_issue_i2o(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_i2o() argument
5385 ha->host_num, in ips_issue_i2o()
5391 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_i2o()
5394 outl(scb->scb_busaddr, ha->io_addr + IPS_REG_I2O_INMSGQ); in ips_issue_i2o()
5409 ips_issue_i2o_memio(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_i2o_memio() argument
5417 ha->host_num, in ips_issue_i2o_memio()
5423 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_i2o_memio()
5426 writel(scb->scb_busaddr, ha->mem_ptr + IPS_REG_I2O_INMSGQ); in ips_issue_i2o_memio()
5441 ips_isintr_copperhead(ips_ha_t * ha) in ips_isintr_copperhead() argument
5447 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_isintr_copperhead()
5458 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_isintr_copperhead()
5474 ips_isintr_copperhead_memio(ips_ha_t * ha) in ips_isintr_copperhead_memio() argument
5480 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_isintr_copperhead_memio()
5491 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_isintr_copperhead_memio()
5507 ips_isintr_morpheus(ips_ha_t * ha) in ips_isintr_morpheus() argument
5513 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_isintr_morpheus()
5531 ips_wait(ips_ha_t * ha, int time, int intr) in ips_wait() argument
5545 if (ha->waitflag == FALSE) { in ips_wait()
5551 if (ha->waitflag == FALSE) { in ips_wait()
5568 (*ha->func.intr) (ha); in ips_wait()
5589 ips_write_driver_status(ips_ha_t * ha, int intr) in ips_write_driver_status() argument
5593 if (!ips_readwrite_page5(ha, FALSE, intr)) { in ips_write_driver_status()
5594 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_write_driver_status()
5602 if (le32_to_cpu(ha->nvram->signature) != IPS_NVRAM_P5_SIG) { in ips_write_driver_status()
5605 ips_name, ha->host_num, ha->nvram->signature); in ips_write_driver_status()
5606 ha->nvram->signature = IPS_NVRAM_P5_SIG; in ips_write_driver_status()
5611 ips_name, ha->host_num, le16_to_cpu(ha->nvram->adapter_type), in ips_write_driver_status()
5612 ha->nvram->adapter_slot, ha->nvram->bios_high[0], in ips_write_driver_status()
5613 ha->nvram->bios_high[1], ha->nvram->bios_high[2], in ips_write_driver_status()
5614 ha->nvram->bios_high[3], ha->nvram->bios_low[0], in ips_write_driver_status()
5615 ha->nvram->bios_low[1], ha->nvram->bios_low[2], in ips_write_driver_status()
5616 ha->nvram->bios_low[3]); in ips_write_driver_status()
5618 ips_get_bios_version(ha, intr); in ips_write_driver_status()
5621 ha->nvram->operating_system = IPS_OS_LINUX; in ips_write_driver_status()
5622 ha->nvram->adapter_type = ha->ad_type; in ips_write_driver_status()
5623 memcpy((char *) ha->nvram->driver_high, IPS_VERSION_HIGH, 4); in ips_write_driver_status()
5624 memcpy((char *) ha->nvram->driver_low, IPS_VERSION_LOW, 4); in ips_write_driver_status()
5625 memcpy((char *) ha->nvram->bios_high, ha->bios_version, 4); in ips_write_driver_status()
5626 memcpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4); in ips_write_driver_status()
5628 ha->nvram->versioning = 0; /* Indicate the Driver Does Not Support Versioning */ in ips_write_driver_status()
5631 if (!ips_readwrite_page5(ha, TRUE, intr)) { in ips_write_driver_status()
5632 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_write_driver_status()
5639 ha->slot_num = ha->nvram->adapter_slot; in ips_write_driver_status()
5654 ips_read_adapter_status(ips_ha_t * ha, int intr) in ips_read_adapter_status() argument
5661 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_adapter_status()
5663 ips_init_scb(ha, scb); in ips_read_adapter_status()
5669 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_adapter_status()
5674 scb->data_len = sizeof (*ha->enq); in ips_read_adapter_status()
5675 scb->cmd.basic_io.sg_addr = ha->enq_busaddr; in ips_read_adapter_status()
5679 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_adapter_status()
5697 ips_read_subsystem_parameters(ips_ha_t * ha, int intr) in ips_read_subsystem_parameters() argument
5704 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_subsystem_parameters()
5706 ips_init_scb(ha, scb); in ips_read_subsystem_parameters()
5712 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_subsystem_parameters()
5717 scb->data_len = sizeof (*ha->subsys); in ips_read_subsystem_parameters()
5718 scb->cmd.basic_io.sg_addr = ha->ioctl_busaddr; in ips_read_subsystem_parameters()
5722 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_subsystem_parameters()
5727 memcpy(ha->subsys, ha->ioctl_data, sizeof(*ha->subsys)); in ips_read_subsystem_parameters()
5741 ips_read_config(ips_ha_t * ha, int intr) in ips_read_config() argument
5751 ha->conf->init_id[i] = 7; in ips_read_config()
5753 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_config()
5755 ips_init_scb(ha, scb); in ips_read_config()
5761 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_config()
5762 scb->data_len = sizeof (*ha->conf); in ips_read_config()
5763 scb->cmd.basic_io.sg_addr = ha->ioctl_busaddr; in ips_read_config()
5767 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_config()
5771 memset(ha->conf, 0, sizeof (IPS_CONF)); in ips_read_config()
5775 ha->conf->init_id[i] = 7; in ips_read_config()
5785 memcpy(ha->conf, ha->ioctl_data, sizeof(*ha->conf)); in ips_read_config()
5799 ips_readwrite_page5(ips_ha_t * ha, int write, int intr) in ips_readwrite_page5() argument
5806 scb = &ha->scbs[ha->max_cmds - 1]; in ips_readwrite_page5()
5808 ips_init_scb(ha, scb); in ips_readwrite_page5()
5814 scb->cmd.nvram.command_id = IPS_COMMAND_ID(ha, scb); in ips_readwrite_page5()
5819 scb->data_len = sizeof (*ha->nvram); in ips_readwrite_page5()
5820 scb->cmd.nvram.buffer_addr = ha->ioctl_busaddr; in ips_readwrite_page5()
5822 memcpy(ha->ioctl_data, ha->nvram, sizeof(*ha->nvram)); in ips_readwrite_page5()
5826 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_readwrite_page5()
5830 memset(ha->nvram, 0, sizeof (IPS_NVRAM_P5)); in ips_readwrite_page5()
5835 memcpy(ha->nvram, ha->ioctl_data, sizeof(*ha->nvram)); in ips_readwrite_page5()
5849 ips_clear_adapter(ips_ha_t * ha, int intr) in ips_clear_adapter() argument
5856 scb = &ha->scbs[ha->max_cmds - 1]; in ips_clear_adapter()
5858 ips_init_scb(ha, scb); in ips_clear_adapter()
5864 scb->cmd.config_sync.command_id = IPS_COMMAND_ID(ha, scb); in ips_clear_adapter()
5873 ips_send_wait(ha, scb, ips_reset_timeout, intr)) == IPS_FAILURE) in ips_clear_adapter()
5879 ips_init_scb(ha, scb); in ips_clear_adapter()
5885 scb->cmd.unlock_stripe.command_id = IPS_COMMAND_ID(ha, scb); in ips_clear_adapter()
5894 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_clear_adapter()
5912 ips_ffdc_reset(ips_ha_t * ha, int intr) in ips_ffdc_reset() argument
5918 scb = &ha->scbs[ha->max_cmds - 1]; in ips_ffdc_reset()
5920 ips_init_scb(ha, scb); in ips_ffdc_reset()
5925 scb->cmd.ffdc.command_id = IPS_COMMAND_ID(ha, scb); in ips_ffdc_reset()
5926 scb->cmd.ffdc.reset_count = ha->reset_count; in ips_ffdc_reset()
5930 ips_fix_ffdc_time(ha, scb, ha->last_ffdc); in ips_ffdc_reset()
5933 ips_send_wait(ha, scb, ips_cmd_timeout, intr); in ips_ffdc_reset()
5946 ips_ffdc_time(ips_ha_t * ha) in ips_ffdc_time() argument
5952 DEBUG_VAR(1, "(%s%d) Sending time update.", ips_name, ha->host_num); in ips_ffdc_time()
5954 scb = &ha->scbs[ha->max_cmds - 1]; in ips_ffdc_time()
5956 ips_init_scb(ha, scb); in ips_ffdc_time()
5961 scb->cmd.ffdc.command_id = IPS_COMMAND_ID(ha, scb); in ips_ffdc_time()
5966 ips_fix_ffdc_time(ha, scb, ha->last_ffdc); in ips_ffdc_time()
5969 ips_send_wait(ha, scb, ips_cmd_timeout, IPS_FFDC); in ips_ffdc_time()
5981 ips_fix_ffdc_time(ips_ha_t * ha, ips_scb_t * scb, time64_t current_time) in ips_fix_ffdc_time() argument
6011 ips_erase_bios(ips_ha_t * ha) in ips_erase_bios() argument
6021 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6022 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6025 outb(0x50, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6026 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6030 outb(0x20, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6031 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6035 outb(0xD0, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6036 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6040 outb(0x70, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6041 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6047 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios()
6048 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6052 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6066 outb(0xB0, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6067 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6073 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios()
6074 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6078 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6102 outb(0x50, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6103 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6107 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6108 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6123 ips_erase_bios_memio(ips_ha_t * ha) in ips_erase_bios_memio() argument
6133 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6134 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6137 writeb(0x50, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6138 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6142 writeb(0x20, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6143 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6147 writeb(0xD0, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6148 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6152 writeb(0x70, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6153 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6159 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios_memio()
6160 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6164 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6178 writeb(0xB0, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6179 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6185 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios_memio()
6186 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6190 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6214 writeb(0x50, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6215 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6219 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6220 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6235 ips_program_bios(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_program_bios() argument
6248 outl(i + offset, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6249 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6252 outb(0x40, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6253 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6256 outb(buffer[i], ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6257 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6263 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_program_bios()
6264 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6268 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6279 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6280 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6283 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6284 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6293 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6294 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6297 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6298 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6306 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6307 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6310 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6311 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6326 ips_program_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_program_bios_memio() argument
6339 writel(i + offset, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6340 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6343 writeb(0x40, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6344 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6347 writeb(buffer[i], ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6348 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6354 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_program_bios_memio()
6355 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6359 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6370 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6371 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6374 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6375 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6384 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6385 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6388 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6389 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6397 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6398 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6401 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6402 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6417 ips_verify_bios(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_verify_bios() argument
6426 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6427 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6430 if (inb(ha->io_addr + IPS_REG_FLDP) != 0x55) in ips_verify_bios()
6433 outl(1, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6434 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6436 if (inb(ha->io_addr + IPS_REG_FLDP) != 0xAA) in ips_verify_bios()
6442 outl(i + offset, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6443 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6446 checksum = (uint8_t) checksum + inb(ha->io_addr + IPS_REG_FLDP); in ips_verify_bios()
6466 ips_verify_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_verify_bios_memio() argument
6475 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6476 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6479 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0x55) in ips_verify_bios_memio()
6482 writel(1, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6483 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6485 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0xAA) in ips_verify_bios_memio()
6491 writel(i + offset, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6492 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6496 (uint8_t) checksum + readb(ha->mem_ptr + IPS_REG_FLDP); in ips_verify_bios_memio()
6515 ips_abort_init(ips_ha_t * ha, int index) in ips_abort_init() argument
6517 ha->active = 0; in ips_abort_init()
6518 ips_free(ha); in ips_abort_init()
6654 ips_ha_t *ha, *oldha = ips_ha[index]; in ips_register_scsi() local
6661 ha = IPS_HA(sh); in ips_register_scsi()
6662 memcpy(ha, oldha, sizeof (ips_ha_t)); in ips_register_scsi()
6665 if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { in ips_register_scsi()
6666 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_register_scsi()
6674 sh->unique_id = (ha->io_addr) ? ha->io_addr : ha->mem_addr; in ips_register_scsi()
6680 sh->max_id = ha->ntargets; in ips_register_scsi()
6681 sh->max_lun = ha->nlun; in ips_register_scsi()
6682 sh->max_channel = ha->nbus - 1; in ips_register_scsi()
6683 sh->can_queue = ha->max_cmds - 1; in ips_register_scsi()
6685 if (scsi_add_host(sh, &ha->pcidev->dev)) in ips_register_scsi()
6689 ips_ha[index] = ha; in ips_register_scsi()
6696 free_irq(ha->pcidev->irq, ha); in ips_register_scsi()
6831 ips_ha_t *ha; in ips_init_phase1() local
6891 ha = kzalloc(sizeof (ips_ha_t), GFP_KERNEL); in ips_init_phase1()
6892 if (ha == NULL) { in ips_init_phase1()
6899 ips_ha[index] = ha; in ips_init_phase1()
6900 ha->active = 1; in ips_init_phase1()
6903 ha->io_addr = io_addr; in ips_init_phase1()
6904 ha->io_len = io_len; in ips_init_phase1()
6905 ha->mem_addr = mem_addr; in ips_init_phase1()
6906 ha->mem_len = mem_len; in ips_init_phase1()
6907 ha->mem_ptr = mem_ptr; in ips_init_phase1()
6908 ha->ioremap_ptr = ioremap_ptr; in ips_init_phase1()
6909 ha->host_num = (uint32_t) index; in ips_init_phase1()
6910 ha->slot_num = PCI_SLOT(pci_dev->devfn); in ips_init_phase1()
6911 ha->pcidev = pci_dev; in ips_init_phase1()
6919 if (sizeof(dma_addr_t) > 4 && IPS_HAS_ENH_SGLIST(ha) && in ips_init_phase1()
6920 !dma_set_mask(&ha->pcidev->dev, DMA_BIT_MASK(64))) { in ips_init_phase1()
6921 (ha)->flags |= IPS_HA_ENH_SG; in ips_init_phase1()
6923 if (dma_set_mask(&ha->pcidev->dev, DMA_BIT_MASK(32)) != 0) { in ips_init_phase1()
6925 return ips_abort_init(ha, index); in ips_init_phase1()
6933 ha->enq = dma_alloc_coherent(&pci_dev->dev, sizeof (IPS_ENQ), in ips_init_phase1()
6934 &ha->enq_busaddr, GFP_KERNEL); in ips_init_phase1()
6935 if (!ha->enq) { in ips_init_phase1()
6938 return ips_abort_init(ha, index); in ips_init_phase1()
6941 ha->adapt = dma_alloc_coherent(&pci_dev->dev, in ips_init_phase1()
6944 if (!ha->adapt) { in ips_init_phase1()
6947 return ips_abort_init(ha, index); in ips_init_phase1()
6949 ha->adapt->hw_status_start = dma_address; in ips_init_phase1()
6950 ha->dummy = (void *) (ha->adapt + 1); in ips_init_phase1()
6954 ha->logical_drive_info = dma_alloc_coherent(&pci_dev->dev, in ips_init_phase1()
6956 if (!ha->logical_drive_info) { in ips_init_phase1()
6959 return ips_abort_init(ha, index); in ips_init_phase1()
6961 ha->logical_drive_info_dma_addr = dma_address; in ips_init_phase1()
6964 ha->conf = kmalloc(sizeof (IPS_CONF), GFP_KERNEL); in ips_init_phase1()
6966 if (!ha->conf) { in ips_init_phase1()
6969 return ips_abort_init(ha, index); in ips_init_phase1()
6972 ha->nvram = kmalloc(sizeof (IPS_NVRAM_P5), GFP_KERNEL); in ips_init_phase1()
6974 if (!ha->nvram) { in ips_init_phase1()
6977 return ips_abort_init(ha, index); in ips_init_phase1()
6980 ha->subsys = kmalloc(sizeof (IPS_SUBSYS), GFP_KERNEL); in ips_init_phase1()
6982 if (!ha->subsys) { in ips_init_phase1()
6985 return ips_abort_init(ha, index); in ips_init_phase1()
6993 ha->ioctl_data = dma_alloc_coherent(&pci_dev->dev, ips_ioctlsize, in ips_init_phase1()
6994 &ha->ioctl_busaddr, GFP_KERNEL); in ips_init_phase1()
6995 ha->ioctl_len = ips_ioctlsize; in ips_init_phase1()
6996 if (!ha->ioctl_data) { in ips_init_phase1()
6999 return ips_abort_init(ha, index); in ips_init_phase1()
7005 ips_setup_funclist(ha); in ips_init_phase1()
7007 if ((IPS_IS_MORPHEUS(ha)) || (IPS_IS_MARCO(ha))) { in ips_init_phase1()
7009 IsDead = readl(ha->mem_ptr + IPS_REG_I960_MSG1); in ips_init_phase1()
7011 ips_reset_morpheus(ha); in ips_init_phase1()
7019 if (!(*ha->func.isinit) (ha)) { in ips_init_phase1()
7020 if (!(*ha->func.init) (ha)) { in ips_init_phase1()
7026 return ips_abort_init(ha, index); in ips_init_phase1()
7046 ips_ha_t *ha; in ips_init_phase2() local
7048 ha = ips_ha[index]; in ips_init_phase2()
7051 if (!ha->active) { in ips_init_phase2()
7057 if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { in ips_init_phase2()
7058 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7060 return ips_abort_init(ha, index); in ips_init_phase2()
7066 ha->max_cmds = 1; in ips_init_phase2()
7067 if (!ips_allocatescbs(ha)) { in ips_init_phase2()
7068 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7070 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7071 return ips_abort_init(ha, index); in ips_init_phase2()
7074 if (!ips_hainit(ha)) { in ips_init_phase2()
7075 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7077 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7078 return ips_abort_init(ha, index); in ips_init_phase2()
7081 ips_deallocatescbs(ha, 1); in ips_init_phase2()
7084 if (!ips_allocatescbs(ha)) { in ips_init_phase2()
7085 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7087 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7088 return ips_abort_init(ha, index); in ips_init_phase2()