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);
579 ips_setup_funclist(ips_ha_t * ha) in ips_setup_funclist() argument
585 if (IPS_IS_MORPHEUS(ha) || IPS_IS_MARCO(ha)) { in ips_setup_funclist()
587 ha->func.isintr = ips_isintr_morpheus; in ips_setup_funclist()
588 ha->func.isinit = ips_isinit_morpheus; in ips_setup_funclist()
589 ha->func.issue = ips_issue_i2o_memio; in ips_setup_funclist()
590 ha->func.init = ips_init_morpheus; in ips_setup_funclist()
591 ha->func.statupd = ips_statupd_morpheus; in ips_setup_funclist()
592 ha->func.reset = ips_reset_morpheus; in ips_setup_funclist()
593 ha->func.intr = ips_intr_morpheus; in ips_setup_funclist()
594 ha->func.enableint = ips_enable_int_morpheus; in ips_setup_funclist()
595 } else if (IPS_USE_MEMIO(ha)) { in ips_setup_funclist()
597 ha->func.isintr = ips_isintr_copperhead_memio; in ips_setup_funclist()
598 ha->func.isinit = ips_isinit_copperhead_memio; in ips_setup_funclist()
599 ha->func.init = ips_init_copperhead_memio; in ips_setup_funclist()
600 ha->func.statupd = ips_statupd_copperhead_memio; in ips_setup_funclist()
601 ha->func.statinit = ips_statinit_memio; in ips_setup_funclist()
602 ha->func.reset = ips_reset_copperhead_memio; in ips_setup_funclist()
603 ha->func.intr = ips_intr_copperhead; in ips_setup_funclist()
604 ha->func.erasebios = ips_erase_bios_memio; in ips_setup_funclist()
605 ha->func.programbios = ips_program_bios_memio; in ips_setup_funclist()
606 ha->func.verifybios = ips_verify_bios_memio; in ips_setup_funclist()
607 ha->func.enableint = ips_enable_int_copperhead_memio; in ips_setup_funclist()
608 if (IPS_USE_I2O_DELIVER(ha)) in ips_setup_funclist()
609 ha->func.issue = ips_issue_i2o_memio; in ips_setup_funclist()
611 ha->func.issue = ips_issue_copperhead_memio; in ips_setup_funclist()
614 ha->func.isintr = ips_isintr_copperhead; in ips_setup_funclist()
615 ha->func.isinit = ips_isinit_copperhead; in ips_setup_funclist()
616 ha->func.init = ips_init_copperhead; in ips_setup_funclist()
617 ha->func.statupd = ips_statupd_copperhead; in ips_setup_funclist()
618 ha->func.statinit = ips_statinit; in ips_setup_funclist()
619 ha->func.reset = ips_reset_copperhead; in ips_setup_funclist()
620 ha->func.intr = ips_intr_copperhead; in ips_setup_funclist()
621 ha->func.erasebios = ips_erase_bios; in ips_setup_funclist()
622 ha->func.programbios = ips_program_bios; in ips_setup_funclist()
623 ha->func.verifybios = ips_verify_bios; in ips_setup_funclist()
624 ha->func.enableint = ips_enable_int_copperhead; in ips_setup_funclist()
626 if (IPS_USE_I2O_DELIVER(ha)) in ips_setup_funclist()
627 ha->func.issue = ips_issue_i2o; in ips_setup_funclist()
629 ha->func.issue = ips_issue_copperhead; in ips_setup_funclist()
646 ips_ha_t *ha; in ips_release() local
662 ha = IPS_HA(sh); in ips_release()
664 if (!ha) in ips_release()
668 scb = &ha->scbs[ha->max_cmds - 1]; in ips_release()
670 ips_init_scb(ha, scb); in ips_release()
676 scb->cmd.flush_cache.command_id = IPS_COMMAND_ID(ha, scb); in ips_release()
683 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Flushing Cache.\n"); in ips_release()
686 if (ips_send_wait(ha, scb, ips_cmd_timeout, IPS_INTR_ON) == IPS_FAILURE) in ips_release()
687 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Incomplete Flush.\n"); in ips_release()
689 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Flushing Complete.\n"); in ips_release()
695 ips_free(ha); in ips_release()
698 free_irq(ha->pcidev->irq, ha); in ips_release()
720 ips_ha_t *ha; in ips_halt() local
728 ha = (ips_ha_t *) ips_ha[i]; in ips_halt()
730 if (!ha) in ips_halt()
733 if (!ha->active) in ips_halt()
737 scb = &ha->scbs[ha->max_cmds - 1]; in ips_halt()
739 ips_init_scb(ha, scb); in ips_halt()
745 scb->cmd.flush_cache.command_id = IPS_COMMAND_ID(ha, scb); in ips_halt()
752 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Flushing Cache.\n"); in ips_halt()
755 if (ips_send_wait(ha, scb, ips_cmd_timeout, IPS_INTR_ON) == in ips_halt()
757 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_halt()
760 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_halt()
778 ips_ha_t *ha; in ips_eh_abort() local
789 ha = (ips_ha_t *) SC->device->host->hostdata; in ips_eh_abort()
791 if (!ha) in ips_eh_abort()
794 if (!ha->active) in ips_eh_abort()
800 item = ha->copp_waitlist.head; in ips_eh_abort()
806 ips_removeq_copp(&ha->copp_waitlist, item); in ips_eh_abort()
810 } else if (ips_removeq_wait(&ha->scb_waitlist, SC)) { in ips_eh_abort()
837 ips_ha_t *ha; in __ips_eh_reset() local
853 ha = (ips_ha_t *) SC->device->host->hostdata; in __ips_eh_reset()
855 if (!ha) { in __ips_eh_reset()
861 if (!ha->active) in __ips_eh_reset()
865 item = ha->copp_waitlist.head; in __ips_eh_reset()
871 ips_removeq_copp(&ha->copp_waitlist, item); in __ips_eh_reset()
876 if (ips_removeq_wait(&ha->scb_waitlist, SC)) { in __ips_eh_reset()
891 if (ha->ioctl_reset == 0) { /* IF Not an IOCTL Requested Reset */ in __ips_eh_reset()
892 scb = &ha->scbs[ha->max_cmds - 1]; in __ips_eh_reset()
894 ips_init_scb(ha, scb); in __ips_eh_reset()
900 scb->cmd.flush_cache.command_id = IPS_COMMAND_ID(ha, scb); in __ips_eh_reset()
908 ret = ips_send_wait(ha, scb, ips_cmd_timeout, IPS_INTR_IORL); in __ips_eh_reset()
910 IPS_PRINTK(KERN_NOTICE, ha->pcidev, in __ips_eh_reset()
919 ha->ioctl_reset = 0; /* Reset the IOCTL Requested Reset Flag */ in __ips_eh_reset()
925 IPS_PRINTK(KERN_NOTICE, ha->pcidev, "Resetting controller.\n"); in __ips_eh_reset()
926 ret = (*ha->func.reset) (ha); in __ips_eh_reset()
931 IPS_PRINTK(KERN_NOTICE, ha->pcidev, in __ips_eh_reset()
936 ips_name, ha->host_num); in __ips_eh_reset()
938 while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { in __ips_eh_reset()
941 ips_freescb(ha, scb); in __ips_eh_reset()
946 ips_name, ha->host_num); in __ips_eh_reset()
948 while ((scsi_cmd = ips_removeq_wait_head(&ha->scb_waitlist))) { in __ips_eh_reset()
953 ha->active = FALSE; in __ips_eh_reset()
957 if (!ips_clear_adapter(ha, IPS_INTR_IORL)) { in __ips_eh_reset()
960 IPS_PRINTK(KERN_NOTICE, ha->pcidev, in __ips_eh_reset()
965 ips_name, ha->host_num); in __ips_eh_reset()
967 while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { in __ips_eh_reset()
970 ips_freescb(ha, scb); in __ips_eh_reset()
975 ips_name, ha->host_num); in __ips_eh_reset()
977 while ((scsi_cmd = ips_removeq_wait_head(&ha->scb_waitlist))) { in __ips_eh_reset()
982 ha->active = FALSE; in __ips_eh_reset()
987 if (le32_to_cpu(ha->subsys->param[3]) & 0x300000) { in __ips_eh_reset()
988 ha->last_ffdc = ktime_get_real_seconds(); in __ips_eh_reset()
989 ha->reset_count++; in __ips_eh_reset()
990 ips_ffdc_reset(ha, IPS_INTR_IORL); in __ips_eh_reset()
994 DEBUG_VAR(1, "(%s%d) Failing active commands", ips_name, ha->host_num); in __ips_eh_reset()
996 while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { in __ips_eh_reset()
999 ips_freescb(ha, scb); in __ips_eh_reset()
1003 for (i = 1; i < ha->nbus; i++) in __ips_eh_reset()
1004 ha->dcdb_active[i - 1] = 0; in __ips_eh_reset()
1007 ha->num_ioctl = 0; in __ips_eh_reset()
1009 ips_next(ha, IPS_INTR_IORL); in __ips_eh_reset()
1041 ips_ha_t *ha; in ips_queue_lck() local
1046 ha = (ips_ha_t *) SC->device->host->hostdata; in ips_queue_lck()
1048 if (!ha) in ips_queue_lck()
1051 if (!ha->active) in ips_queue_lck()
1055 if (ha->copp_waitlist.count == IPS_MAX_IOCTL_QUEUE) { in ips_queue_lck()
1061 } else if (ha->scb_waitlist.count == IPS_MAX_QUEUE) { in ips_queue_lck()
1072 ha->host_num, in ips_queue_lck()
1078 && (scmd_id(SC) == ha->ha_id[scmd_channel(SC)])) { in ips_queue_lck()
1095 if (ha->scb_activelist.count != 0) { in ips_queue_lck()
1100 ha->ioctl_reset = 1; /* This reset request is from an IOCTL */ in ips_queue_lck()
1120 ips_putq_copp_tail(&ha->copp_waitlist, scratch); in ips_queue_lck()
1122 ips_putq_wait_tail(&ha->scb_waitlist, SC); in ips_queue_lck()
1125 ips_next(ha, IPS_INTR_IORL); in ips_queue_lck()
1144 ips_ha_t *ha = (ips_ha_t *) sdev->host->hostdata; in DEF_SCSI_QCMD() local
1151 if (!ha) in DEF_SCSI_QCMD()
1155 if (!ha->active) in DEF_SCSI_QCMD()
1158 if (!ips_read_adapter_status(ha, IPS_INTR_ON)) in DEF_SCSI_QCMD()
1162 if ((capacity > 0x400000) && ((ha->enq->ucMiscFlag & 0x8) == 0)) { in DEF_SCSI_QCMD()
1194 ips_ha_t *ha; in ips_slave_configure() local
1197 ha = IPS_HA(SDptr->host); in ips_slave_configure()
1199 min = ha->max_cmds / 2; in ips_slave_configure()
1200 if (ha->enq->ucLogDriveCount <= 2) in ips_slave_configure()
1201 min = ha->max_cmds - 1; in ips_slave_configure()
1222 ips_ha_t *ha; in do_ipsintr() local
1228 ha = (ips_ha_t *) dev_id; in do_ipsintr()
1229 if (!ha) in do_ipsintr()
1231 host = ips_sh[ha->host_num]; in do_ipsintr()
1234 (*ha->func.intr) (ha); in do_ipsintr()
1240 if (!ha->active) { in do_ipsintr()
1245 irqstatus = (*ha->func.intr) (ha); in do_ipsintr()
1250 ips_next(ha, IPS_INTR_ON); in do_ipsintr()
1266 ips_intr_copperhead(ips_ha_t * ha) in ips_intr_copperhead() argument
1275 if (!ha) in ips_intr_copperhead()
1278 if (!ha->active) in ips_intr_copperhead()
1281 intrstatus = (*ha->func.isintr) (ha); in ips_intr_copperhead()
1292 sp = &ha->sp; in ips_intr_copperhead()
1294 intrstatus = (*ha->func.isintr) (ha); in ips_intr_copperhead()
1299 cstatus.value = (*ha->func.statupd) (ha); in ips_intr_copperhead()
1306 ips_chkstatus(ha, &cstatus); in ips_intr_copperhead()
1313 (*scb->callback) (ha, scb); in ips_intr_copperhead()
1330 ips_intr_morpheus(ips_ha_t * ha) in ips_intr_morpheus() argument
1339 if (!ha) in ips_intr_morpheus()
1342 if (!ha->active) in ips_intr_morpheus()
1345 intrstatus = (*ha->func.isintr) (ha); in ips_intr_morpheus()
1356 sp = &ha->sp; in ips_intr_morpheus()
1358 intrstatus = (*ha->func.isintr) (ha); in ips_intr_morpheus()
1363 cstatus.value = (*ha->func.statupd) (ha); in ips_intr_morpheus()
1370 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_intr_morpheus()
1376 ips_chkstatus(ha, &cstatus); in ips_intr_morpheus()
1383 (*scb->callback) (ha, scb); in ips_intr_morpheus()
1402 ips_ha_t *ha; in ips_info() local
1406 ha = IPS_HA(SH); in ips_info()
1408 if (!ha) in ips_info()
1417 if (ha->ad_type > 0 && ha->ad_type <= MAX_ADAPTER_NAME) { in ips_info()
1419 strcat(bp, ips_adapter_name[ha->ad_type - 1]); in ips_info()
1430 ips_ha_t *ha = NULL; in ips_write_info() local
1436 ha = (ips_ha_t *) ips_sh[i]->hostdata; in ips_write_info()
1442 if (!ha) in ips_write_info()
1452 ips_ha_t *ha = NULL; in ips_show_info() local
1458 ha = (ips_ha_t *) ips_sh[i]->hostdata; in ips_show_info()
1464 if (!ha) in ips_show_info()
1467 return ips_host_info(ha, m); in ips_show_info()
1524 ips_alloc_passthru_buffer(ips_ha_t * ha, int length) in ips_alloc_passthru_buffer() argument
1529 if (ha->ioctl_data && length <= ha->ioctl_len) in ips_alloc_passthru_buffer()
1532 bigger_buf = pci_alloc_consistent(ha->pcidev, length, &dma_busaddr); in ips_alloc_passthru_buffer()
1535 pci_free_consistent(ha->pcidev, ha->ioctl_len, ha->ioctl_data, in ips_alloc_passthru_buffer()
1536 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 = pci_alloc_consistent(ha->pcidev, in ips_flash_copperhead()
1683 &ha->flash_busaddr); in ips_flash_copperhead()
1684 if (!ha->flash_data){ in ips_flash_copperhead()
1688 ha->flash_datasize = 0; in ips_flash_copperhead()
1689 ha->flash_len = datasize; in ips_flash_copperhead()
1693 if (pt->CoppCP.cmd.flashfw.count + ha->flash_datasize > in ips_flash_copperhead()
1694 ha->flash_len) { in ips_flash_copperhead()
1695 ips_free_flash_copperhead(ha); in ips_flash_copperhead()
1696 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_flash_copperhead()
1701 if (!ha->flash_data) in ips_flash_copperhead()
1704 memcpy(&ha->flash_data[ha->flash_datasize], pt + 1, in ips_flash_copperhead()
1706 ha->flash_datasize += pt->CoppCP.cmd.flashfw.count; in ips_flash_copperhead()
1710 return ips_flash_bios(ha, pt, scb); in ips_flash_copperhead()
1712 return ips_flash_firmware(ha, pt, scb); in ips_flash_copperhead()
1723 ips_flash_bios(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_bios() argument
1728 if ((!ha->func.programbios) || (!ha->func.erasebios) || in ips_flash_bios()
1729 (!ha->func.verifybios)) in ips_flash_bios()
1731 if ((*ha->func.erasebios) (ha)) { in ips_flash_bios()
1734 ips_name, ha->host_num); in ips_flash_bios()
1737 if ((*ha->func.programbios) (ha, in ips_flash_bios()
1738 ha->flash_data + in ips_flash_bios()
1740 ha->flash_datasize - in ips_flash_bios()
1744 ips_name, ha->host_num); in ips_flash_bios()
1747 if ((*ha->func.verifybios) (ha, in ips_flash_bios()
1748 ha->flash_data + in ips_flash_bios()
1750 ha->flash_datasize - in ips_flash_bios()
1754 ips_name, ha->host_num); in ips_flash_bios()
1757 ips_free_flash_copperhead(ha); in ips_flash_bios()
1761 if (!ha->func.erasebios) in ips_flash_bios()
1763 if ((*ha->func.erasebios) (ha)) { in ips_flash_bios()
1766 ips_name, ha->host_num); in ips_flash_bios()
1774 ips_free_flash_copperhead(ha); in ips_flash_bios()
1787 ips_fill_scb_sg_single(ips_ha_t * ha, dma_addr_t busaddr, in ips_fill_scb_sg_single() argument
1793 if ((scb->data_len + e_len) > ha->max_xfer) { in ips_fill_scb_sg_single()
1794 e_len = ha->max_xfer - scb->data_len; in ips_fill_scb_sg_single()
1802 if (IPS_USE_ENH_SGLIST(ha)) { in ips_fill_scb_sg_single()
1825 ips_flash_firmware(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_firmware() argument
1834 pt->CoppCP.cmd.flashfw.count = cpu_to_le32(ha->flash_datasize); in ips_flash_firmware()
1838 ips_free_flash_copperhead(ha); in ips_flash_firmware()
1859 scb->data_len = ha->flash_datasize; in ips_flash_firmware()
1861 pci_map_single(ha->pcidev, ha->flash_data, scb->data_len, in ips_flash_firmware()
1864 scb->cmd.flashfw.command_id = IPS_COMMAND_ID(ha, scb); in ips_flash_firmware()
1878 ips_free_flash_copperhead(ips_ha_t * ha) in ips_free_flash_copperhead() argument
1880 if (ha->flash_data == ips_FlashData) in ips_free_flash_copperhead()
1882 else if (ha->flash_data) in ips_free_flash_copperhead()
1883 pci_free_consistent(ha->pcidev, ha->flash_len, ha->flash_data, in ips_free_flash_copperhead()
1884 ha->flash_busaddr); in ips_free_flash_copperhead()
1885 ha->flash_data = NULL; in ips_free_flash_copperhead()
1898 ips_usrcmd(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_usrcmd() argument
1905 if ((!scb) || (!pt) || (!ha)) in ips_usrcmd()
1927 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_usrcmd()
1937 scb->data_busaddr = ha->ioctl_busaddr + sizeof (ips_passthru_t); in ips_usrcmd()
1986 ips_cleanup_passthru(ips_ha_t * ha, ips_scb_t * scb) in ips_cleanup_passthru() argument
1994 ips_name, ha->host_num); in ips_cleanup_passthru()
1998 pt = (ips_passthru_t *) ha->ioctl_data; in ips_cleanup_passthru()
2006 pt->AdapterType = ha->ad_type; in ips_cleanup_passthru()
2008 if (ha->pcidev->device == IPS_DEVICEID_COPPERHEAD && in ips_cleanup_passthru()
2011 ips_free_flash_copperhead(ha); in ips_cleanup_passthru()
2013 ips_scmd_buf_write(scb->scsi_cmd, ha->ioctl_data, ha->ioctl_datasize); in ips_cleanup_passthru()
2026 ips_host_info(ips_ha_t *ha, struct seq_file *m) in ips_host_info() argument
2032 if ((le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG) && in ips_host_info()
2033 (le16_to_cpu(ha->nvram->adapter_type) != 0)) in ips_host_info()
2035 ips_adapter_name[ha->ad_type - 1]); in ips_host_info()
2039 if (ha->io_addr) in ips_host_info()
2042 ha->io_addr, ha->io_len); in ips_host_info()
2044 if (ha->mem_addr) { in ips_host_info()
2047 ha->mem_addr, ha->mem_len); in ips_host_info()
2050 (unsigned long)ha->mem_ptr); in ips_host_info()
2053 seq_printf(m, "\tIRQ number : %d\n", ha->pcidev->irq); in ips_host_info()
2058 if (le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG) { in ips_host_info()
2059 if (ha->nvram->bios_low[3] == 0) { in ips_host_info()
2062 ha->nvram->bios_high[0], ha->nvram->bios_high[1], in ips_host_info()
2063 ha->nvram->bios_high[2], ha->nvram->bios_high[3], in ips_host_info()
2064 ha->nvram->bios_low[0], ha->nvram->bios_low[1], in ips_host_info()
2065 ha->nvram->bios_low[2]); in ips_host_info()
2070 ha->nvram->bios_high[0], ha->nvram->bios_high[1], in ips_host_info()
2071 ha->nvram->bios_high[2], ha->nvram->bios_high[3], in ips_host_info()
2072 ha->nvram->bios_low[0], ha->nvram->bios_low[1], in ips_host_info()
2073 ha->nvram->bios_low[2], ha->nvram->bios_low[3]); in ips_host_info()
2078 if (ha->enq->CodeBlkVersion[7] == 0) { in ips_host_info()
2081 ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1], in ips_host_info()
2082 ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3], in ips_host_info()
2083 ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5], in ips_host_info()
2084 ha->enq->CodeBlkVersion[6]); in ips_host_info()
2088 ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1], in ips_host_info()
2089 ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3], in ips_host_info()
2090 ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5], in ips_host_info()
2091 ha->enq->CodeBlkVersion[6], ha->enq->CodeBlkVersion[7]); in ips_host_info()
2094 if (ha->enq->BootBlkVersion[7] == 0) { in ips_host_info()
2097 ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1], in ips_host_info()
2098 ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3], in ips_host_info()
2099 ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5], in ips_host_info()
2100 ha->enq->BootBlkVersion[6]); in ips_host_info()
2104 ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1], in ips_host_info()
2105 ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3], in ips_host_info()
2106 ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5], in ips_host_info()
2107 ha->enq->BootBlkVersion[6], ha->enq->BootBlkVersion[7]); in ips_host_info()
2117 ha->enq->ucMaxPhysicalDevices); in ips_host_info()
2119 ha->max_cmds); in ips_host_info()
2121 ha->scb_waitlist.count); in ips_host_info()
2123 ha->scb_activelist.count - ha->num_ioctl); in ips_host_info()
2125 ha->copp_waitlist.count); in ips_host_info()
2127 ha->num_ioctl); in ips_host_info()
2144 ips_identify_controller(ips_ha_t * ha) in ips_identify_controller() argument
2148 switch (ha->pcidev->device) { in ips_identify_controller()
2150 if (ha->pcidev->revision <= IPS_REVID_SERVERAID) { in ips_identify_controller()
2151 ha->ad_type = IPS_ADTYPE_SERVERAID; in ips_identify_controller()
2152 } else if (ha->pcidev->revision == IPS_REVID_SERVERAID2) { in ips_identify_controller()
2153 ha->ad_type = IPS_ADTYPE_SERVERAID2; in ips_identify_controller()
2154 } else if (ha->pcidev->revision == IPS_REVID_NAVAJO) { in ips_identify_controller()
2155 ha->ad_type = IPS_ADTYPE_NAVAJO; in ips_identify_controller()
2156 } else if ((ha->pcidev->revision == IPS_REVID_SERVERAID2) in ips_identify_controller()
2157 && (ha->slot_num == 0)) { in ips_identify_controller()
2158 ha->ad_type = IPS_ADTYPE_KIOWA; in ips_identify_controller()
2159 } else if ((ha->pcidev->revision >= IPS_REVID_CLARINETP1) && in ips_identify_controller()
2160 (ha->pcidev->revision <= IPS_REVID_CLARINETP3)) { in ips_identify_controller()
2161 if (ha->enq->ucMaxPhysicalDevices == 15) in ips_identify_controller()
2162 ha->ad_type = IPS_ADTYPE_SERVERAID3L; in ips_identify_controller()
2164 ha->ad_type = IPS_ADTYPE_SERVERAID3; in ips_identify_controller()
2165 } else if ((ha->pcidev->revision >= IPS_REVID_TROMBONE32) && in ips_identify_controller()
2166 (ha->pcidev->revision <= IPS_REVID_TROMBONE64)) { in ips_identify_controller()
2167 ha->ad_type = IPS_ADTYPE_SERVERAID4H; in ips_identify_controller()
2172 switch (ha->pcidev->subsystem_device) { in ips_identify_controller()
2174 ha->ad_type = IPS_ADTYPE_SERVERAID4L; in ips_identify_controller()
2178 ha->ad_type = IPS_ADTYPE_SERVERAID4M; in ips_identify_controller()
2182 ha->ad_type = IPS_ADTYPE_SERVERAID4MX; in ips_identify_controller()
2186 ha->ad_type = IPS_ADTYPE_SERVERAID4LX; in ips_identify_controller()
2190 ha->ad_type = IPS_ADTYPE_SERVERAID5I2; in ips_identify_controller()
2194 ha->ad_type = IPS_ADTYPE_SERVERAID5I1; in ips_identify_controller()
2201 switch (ha->pcidev->subsystem_device) { in ips_identify_controller()
2203 ha->ad_type = IPS_ADTYPE_SERVERAID6M; in ips_identify_controller()
2206 ha->ad_type = IPS_ADTYPE_SERVERAID6I; in ips_identify_controller()
2209 ha->ad_type = IPS_ADTYPE_SERVERAID7k; in ips_identify_controller()
2212 ha->ad_type = IPS_ADTYPE_SERVERAID7M; in ips_identify_controller()
2229 ips_get_bios_version(ips_ha_t * ha, int intr) in ips_get_bios_version() argument
2243 strncpy(ha->bios_version, " ?", 8); in ips_get_bios_version()
2245 if (ha->pcidev->device == IPS_DEVICEID_COPPERHEAD) { in ips_get_bios_version()
2246 if (IPS_USE_MEMIO(ha)) { in ips_get_bios_version()
2250 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2251 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2254 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0x55) in ips_get_bios_version()
2257 writel(1, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2258 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2261 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0xAA) in ips_get_bios_version()
2265 writel(0x1FF, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2266 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2269 major = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_get_bios_version()
2272 writel(0x1FE, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2273 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2275 minor = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_get_bios_version()
2278 writel(0x1FD, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2279 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2281 subminor = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_get_bios_version()
2287 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2288 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2291 if (inb(ha->io_addr + IPS_REG_FLDP) != 0x55) in ips_get_bios_version()
2294 outl(1, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2295 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2298 if (inb(ha->io_addr + IPS_REG_FLDP) != 0xAA) in ips_get_bios_version()
2302 outl(0x1FF, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2303 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2306 major = inb(ha->io_addr + IPS_REG_FLDP); in ips_get_bios_version()
2309 outl(0x1FE, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2310 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2313 minor = inb(ha->io_addr + IPS_REG_FLDP); in ips_get_bios_version()
2316 outl(0x1FD, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2317 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2320 subminor = inb(ha->io_addr + IPS_REG_FLDP); in ips_get_bios_version()
2326 buffer = ha->ioctl_data; in ips_get_bios_version()
2330 scb = &ha->scbs[ha->max_cmds - 1]; in ips_get_bios_version()
2332 ips_init_scb(ha, scb); in ips_get_bios_version()
2338 scb->cmd.flashfw.command_id = IPS_COMMAND_ID(ha, scb); in ips_get_bios_version()
2345 scb->cmd.flashfw.buffer_addr = ha->ioctl_busaddr; in ips_get_bios_version()
2349 ips_send_wait(ha, scb, ips_cmd_timeout, in ips_get_bios_version()
2367 ha->bios_version[0] = hex_asc_upper_hi(major); in ips_get_bios_version()
2368 ha->bios_version[1] = '.'; in ips_get_bios_version()
2369 ha->bios_version[2] = hex_asc_upper_lo(major); in ips_get_bios_version()
2370 ha->bios_version[3] = hex_asc_upper_lo(subminor); in ips_get_bios_version()
2371 ha->bios_version[4] = '.'; in ips_get_bios_version()
2372 ha->bios_version[5] = hex_asc_upper_hi(minor); in ips_get_bios_version()
2373 ha->bios_version[6] = hex_asc_upper_lo(minor); in ips_get_bios_version()
2374 ha->bios_version[7] = 0; in ips_get_bios_version()
2389 ips_hainit(ips_ha_t * ha) in ips_hainit() argument
2395 if (!ha) in ips_hainit()
2398 if (ha->func.statinit) in ips_hainit()
2399 (*ha->func.statinit) (ha); in ips_hainit()
2401 if (ha->func.enableint) in ips_hainit()
2402 (*ha->func.enableint) (ha); in ips_hainit()
2405 ha->reset_count = 1; in ips_hainit()
2406 ha->last_ffdc = ktime_get_real_seconds(); in ips_hainit()
2407 ips_ffdc_reset(ha, IPS_INTR_IORL); in ips_hainit()
2409 if (!ips_read_config(ha, IPS_INTR_IORL)) { in ips_hainit()
2410 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2416 if (!ips_read_adapter_status(ha, IPS_INTR_IORL)) { in ips_hainit()
2417 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2424 ips_identify_controller(ha); in ips_hainit()
2426 if (!ips_read_subsystem_parameters(ha, IPS_INTR_IORL)) { in ips_hainit()
2427 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2434 if (!ips_write_driver_status(ha, IPS_INTR_IORL)) { in ips_hainit()
2435 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2442 if ((ha->conf->ucLogDriveCount > 0) && (ha->requires_esl == 1)) in ips_hainit()
2443 ips_clear_adapter(ha, IPS_INTR_IORL); in ips_hainit()
2446 ha->ntargets = IPS_MAX_TARGETS + 1; in ips_hainit()
2447 ha->nlun = 1; in ips_hainit()
2448 ha->nbus = (ha->enq->ucMaxPhysicalDevices / IPS_MAX_TARGETS) + 1; in ips_hainit()
2450 switch (ha->conf->logical_drive[0].ucStripeSize) { in ips_hainit()
2452 ha->max_xfer = 0x10000; in ips_hainit()
2456 ha->max_xfer = 0x20000; in ips_hainit()
2460 ha->max_xfer = 0x40000; in ips_hainit()
2465 ha->max_xfer = 0x80000; in ips_hainit()
2470 if (le32_to_cpu(ha->subsys->param[4]) & 0x1) { in ips_hainit()
2472 ha->max_cmds = ha->enq->ucConcurrentCmdCount; in ips_hainit()
2475 switch (ha->conf->logical_drive[0].ucStripeSize) { in ips_hainit()
2477 ha->max_cmds = 32; in ips_hainit()
2481 ha->max_cmds = 16; in ips_hainit()
2485 ha->max_cmds = 8; in ips_hainit()
2490 ha->max_cmds = 4; in ips_hainit()
2496 if ((ha->ad_type == IPS_ADTYPE_SERVERAID3L) || in ips_hainit()
2497 (ha->ad_type == IPS_ADTYPE_SERVERAID4L) || in ips_hainit()
2498 (ha->ad_type == IPS_ADTYPE_SERVERAID4LX)) { in ips_hainit()
2499 if ((ha->max_cmds > MaxLiteCmds) && (MaxLiteCmds)) in ips_hainit()
2500 ha->max_cmds = MaxLiteCmds; in ips_hainit()
2504 ha->ha_id[0] = IPS_ADAPTER_ID; in ips_hainit()
2505 for (i = 1; i < ha->nbus; i++) { in ips_hainit()
2506 ha->ha_id[i] = ha->conf->init_id[i - 1] & 0x1f; in ips_hainit()
2507 ha->dcdb_active[i - 1] = 0; in ips_hainit()
2523 ips_next(ips_ha_t * ha, int intr) in ips_next() argument
2534 if (!ha) in ips_next()
2536 host = ips_sh[ha->host_num]; in ips_next()
2544 if ((ha->subsys->param[3] & 0x300000) in ips_next()
2545 && (ha->scb_activelist.count == 0)) { in ips_next()
2547 if (now - ha->last_ffdc > IPS_SECS_8HOURS) { in ips_next()
2548 ha->last_ffdc = now; in ips_next()
2549 ips_ffdc_time(ha); in ips_next()
2560 while ((ha->num_ioctl < IPS_MAX_IOCTL) && in ips_next()
2561 (ha->copp_waitlist.head) && (scb = ips_getscb(ha))) { in ips_next()
2563 item = ips_removeq_copp_head(&ha->copp_waitlist); in ips_next()
2564 ha->num_ioctl++; in ips_next()
2570 ret = ips_make_passthru(ha, scb->scsi_cmd, scb, intr); in ips_next()
2581 ips_freescb(ha, scb); in ips_next()
2589 ips_freescb(ha, scb); in ips_next()
2596 ha->num_ioctl--; in ips_next()
2600 ret = ips_send_cmd(ha, scb); in ips_next()
2603 ips_putq_scb_head(&ha->scb_activelist, scb); in ips_next()
2605 ha->num_ioctl--; in ips_next()
2613 ips_freescb(ha, scb); in ips_next()
2616 ips_freescb(ha, scb); in ips_next()
2628 p = ha->scb_waitlist.head; in ips_next()
2629 while ((p) && (scb = ips_getscb(ha))) { in ips_next()
2631 && (ha-> in ips_next()
2634 ips_freescb(ha, scb); in ips_next()
2640 SC = ips_removeq_wait(&ha->scb_waitlist, q); in ips_next()
2671 (ha, sg_dma_address(sg), scb, i, in ips_next()
2702 ret = ips_send_cmd(ha, scb); in ips_next()
2706 ips_putq_scb_head(&ha->scb_activelist, scb); in ips_next()
2715 ha->dcdb_active[scb->bus - 1] &= in ips_next()
2718 ips_freescb(ha, scb); in ips_next()
2725 ha->dcdb_active[scb->bus - 1] &= in ips_next()
2728 ips_freescb(ha, scb); in ips_next()
3085 ipsintr_blocking(ips_ha_t * ha, ips_scb_t * scb) in ipsintr_blocking() argument
3089 ips_freescb(ha, scb); in ipsintr_blocking()
3090 if ((ha->waitflag == TRUE) && (ha->cmd_in_progress == scb->cdb[0])) { in ipsintr_blocking()
3091 ha->waitflag = FALSE; in ipsintr_blocking()
3107 ipsintr_done(ips_ha_t * ha, ips_scb_t * scb) in ipsintr_done() argument
3112 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ipsintr_done()
3120 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ipsintr_done()
3126 ips_done(ha, scb); in ipsintr_done()
3139 ips_done(ips_ha_t * ha, ips_scb_t * scb) in ips_done() argument
3149 ips_cleanup_passthru(ha, scb); in ips_done()
3150 ha->num_ioctl--; in ips_done()
3172 ips_fill_scb_sg_single(ha, in ips_done()
3180 (ha, in ips_done()
3199 ret = ips_send_cmd(ha, scb); in ips_done()
3208 ips_freescb(ha, scb); in ips_done()
3216 ips_freescb(ha, scb); in ips_done()
3227 ha->dcdb_active[scb->bus - 1] &= ~(1 << scb->target_id); in ips_done()
3232 ips_freescb(ha, scb); in ips_done()
3245 ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) in ips_map_status() argument
3258 ips_name, ha->host_num, in ips_map_status()
3382 ips_send_wait(ips_ha_t * ha, ips_scb_t * scb, int timeout, int intr) in ips_send_wait() argument
3389 ha->waitflag = TRUE; in ips_send_wait()
3390 ha->cmd_in_progress = scb->cdb[0]; in ips_send_wait()
3393 ret = ips_send_cmd(ha, scb); in ips_send_wait()
3399 ret = ips_wait(ha, timeout, intr); in ips_send_wait()
3448 ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) in ips_send_cmd() argument
3466 if ((ha->waitflag == TRUE) && in ips_send_cmd()
3467 (ha->cmd_in_progress == scb->cdb[0])) { in ips_send_cmd()
3468 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 pci_free_consistent(ha->pcidev, 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 pci_free_consistent(ha->pcidev, 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 pci_free_consistent(ha->pcidev, 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 pci_free_consistent(ha->pcidev, 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 pci_free_consistent(ha->pcidev, 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 pci_free_consistent(ha->pcidev, 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 = in ips_allocatescbs()
4311 pci_alloc_consistent(ha->pcidev, ha->max_cmds * sizeof (ips_scb_t), in ips_allocatescbs()
4313 if (ha->scbs == NULL) in ips_allocatescbs()
4316 pci_alloc_consistent(ha->pcidev, in ips_allocatescbs()
4317 IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * in ips_allocatescbs()
4318 ha->max_cmds, &sg_dma); in ips_allocatescbs()
4320 pci_free_consistent(ha->pcidev, in ips_allocatescbs()
4321 ha->max_cmds * sizeof (ips_scb_t), ha->scbs, in ips_allocatescbs()
4326 memset(ha->scbs, 0, ha->max_cmds * sizeof (ips_scb_t)); in ips_allocatescbs()
4328 for (i = 0; i < ha->max_cmds; i++) { in ips_allocatescbs()
4329 scb_p = &ha->scbs[i]; in ips_allocatescbs()
4332 if (IPS_USE_ENH_SGLIST(ha)) { in ips_allocatescbs()
4336 sg_dma + IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * i; in ips_allocatescbs()
4341 sg_dma + IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * i; in ips_allocatescbs()
4345 if (i < ha->max_cmds - 1) { in ips_allocatescbs()
4346 scb_p->q_next = ha->scb_freelist; in ips_allocatescbs()
4347 ha->scb_freelist = scb_p; in ips_allocatescbs()
4365 ips_init_scb(ips_ha_t * ha, ips_scb_t * scb) in ips_init_scb() argument
4379 memset(ha->dummy, 0, sizeof (IPS_IO_CMD)); in ips_init_scb()
4382 ha->dummy->op_code = 0xFF; in ips_init_scb()
4383 ha->dummy->ccsar = cpu_to_le32(ha->adapt->hw_status_start in ips_init_scb()
4385 ha->dummy->command_id = IPS_MAX_CMDS; in ips_init_scb()
4394 scb->cmd.basic_io.ccsar = cpu_to_le32(ha->adapt->hw_status_start in ips_init_scb()
4410 ips_getscb(ips_ha_t * ha) in ips_getscb() argument
4416 if ((scb = ha->scb_freelist) == NULL) { in ips_getscb()
4421 ha->scb_freelist = scb->q_next; in ips_getscb()
4425 ips_init_scb(ha, scb); in ips_getscb()
4442 ips_freescb(ips_ha_t * ha, ips_scb_t * scb) in ips_freescb() argument
4449 pci_unmap_single(ha->pcidev, scb->data_busaddr, scb->data_len, in ips_freescb()
4453 if (IPS_COMMAND_ID(ha, scb) < (ha->max_cmds - 1)) { in ips_freescb()
4454 scb->q_next = ha->scb_freelist; in ips_freescb()
4455 ha->scb_freelist = scb; in ips_freescb()
4469 ips_isinit_copperhead(ips_ha_t * ha) in ips_isinit_copperhead() argument
4476 isr = inb(ha->io_addr + IPS_REG_HISR); in ips_isinit_copperhead()
4477 scpr = inb(ha->io_addr + IPS_REG_SCPR); in ips_isinit_copperhead()
4495 ips_isinit_copperhead_memio(ips_ha_t * ha) in ips_isinit_copperhead_memio() argument
4502 isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_isinit_copperhead_memio()
4503 scpr = readb(ha->mem_ptr + IPS_REG_SCPR); in ips_isinit_copperhead_memio()
4521 ips_isinit_morpheus(ips_ha_t * ha) in ips_isinit_morpheus() argument
4528 if (ips_isintr_morpheus(ha)) in ips_isinit_morpheus()
4529 ips_flush_and_reset(ha); in ips_isinit_morpheus()
4531 post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_isinit_morpheus()
4532 bits = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_isinit_morpheus()
4553 ips_flush_and_reset(ips_ha_t *ha) in ips_flush_and_reset() argument
4562 scb = pci_alloc_consistent(ha->pcidev, sizeof(ips_scb_t), &command_dma); 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 pci_free_consistent(ha->pcidev, 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
4707 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4719 PostByte[i] = inb(ha->io_addr + IPS_REG_ISPR); in ips_init_copperhead()
4720 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4724 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_copperhead()
4733 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4745 ConfigByte[i] = inb(ha->io_addr + IPS_REG_ISPR); in ips_init_copperhead()
4746 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4750 Cbsp = inb(ha->io_addr + IPS_REG_CBSP); in ips_init_copperhead()
4764 outl(0x1010, ha->io_addr + IPS_REG_CCCR); in ips_init_copperhead()
4767 outb(IPS_BIT_EBM, ha->io_addr + IPS_REG_SCPR); in ips_init_copperhead()
4769 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_init_copperhead()
4771 outl(0, ha->io_addr + IPS_REG_NDAE); in ips_init_copperhead()
4774 outb(IPS_BIT_EI, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4789 ips_init_copperhead_memio(ips_ha_t * ha) in ips_init_copperhead_memio() argument
4801 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4813 PostByte[i] = readb(ha->mem_ptr + IPS_REG_ISPR); in ips_init_copperhead_memio()
4814 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4818 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_copperhead_memio()
4827 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4839 ConfigByte[i] = readb(ha->mem_ptr + IPS_REG_ISPR); in ips_init_copperhead_memio()
4840 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4844 Cbsp = readb(ha->mem_ptr + IPS_REG_CBSP); in ips_init_copperhead_memio()
4858 writel(0x1010, ha->mem_ptr + IPS_REG_CCCR); in ips_init_copperhead_memio()
4861 writeb(IPS_BIT_EBM, ha->mem_ptr + IPS_REG_SCPR); in ips_init_copperhead_memio()
4863 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_init_copperhead_memio()
4865 writel(0, ha->mem_ptr + IPS_REG_NDAE); in ips_init_copperhead_memio()
4868 writeb(IPS_BIT_EI, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4884 ips_init_morpheus(ips_ha_t * ha) in ips_init_morpheus() argument
4896 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4907 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4913 Post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_init_morpheus()
4916 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4921 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4924 Post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_init_morpheus()
4932 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4941 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4944 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4952 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4963 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4969 Config = readl(ha->mem_ptr + IPS_REG_I960_MSG1); in ips_init_morpheus()
4973 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4976 Oimr = readl(ha->mem_ptr + IPS_REG_I960_OIMR); in ips_init_morpheus()
4978 writel(Oimr, ha->mem_ptr + IPS_REG_I960_OIMR); in ips_init_morpheus()
4985 ha->requires_esl = 1; in ips_init_morpheus()
5001 ips_reset_copperhead(ips_ha_t * ha) in ips_reset_copperhead() argument
5008 ips_name, ha->host_num, ha->io_addr, ha->pcidev->irq); in ips_reset_copperhead()
5015 outb(IPS_BIT_RST, ha->io_addr + IPS_REG_SCPR); in ips_reset_copperhead()
5020 outb(0, ha->io_addr + IPS_REG_SCPR); in ips_reset_copperhead()
5025 if ((*ha->func.init) (ha)) in ips_reset_copperhead()
5046 ips_reset_copperhead_memio(ips_ha_t * ha) in ips_reset_copperhead_memio() argument
5053 ips_name, ha->host_num, ha->mem_addr, ha->pcidev->irq); in ips_reset_copperhead_memio()
5060 writeb(IPS_BIT_RST, ha->mem_ptr + IPS_REG_SCPR); in ips_reset_copperhead_memio()
5065 writeb(0, ha->mem_ptr + IPS_REG_SCPR); in ips_reset_copperhead_memio()
5070 if ((*ha->func.init) (ha)) in ips_reset_copperhead_memio()
5091 ips_reset_morpheus(ips_ha_t * ha) in ips_reset_morpheus() argument
5099 ips_name, ha->host_num, ha->mem_addr, ha->pcidev->irq); in ips_reset_morpheus()
5106 writel(0x80000000, ha->mem_ptr + IPS_REG_I960_IDR); in ips_reset_morpheus()
5112 pci_read_config_byte(ha->pcidev, 4, &junk); in ips_reset_morpheus()
5114 if ((*ha->func.init) (ha)) in ips_reset_morpheus()
5135 ips_statinit(ips_ha_t * ha) in ips_statinit() argument
5141 ha->adapt->p_status_start = ha->adapt->status; in ips_statinit()
5142 ha->adapt->p_status_end = ha->adapt->status + IPS_MAX_CMDS; in ips_statinit()
5143 ha->adapt->p_status_tail = ha->adapt->status; in ips_statinit()
5145 phys_status_start = ha->adapt->hw_status_start; in ips_statinit()
5146 outl(phys_status_start, ha->io_addr + IPS_REG_SQSR); in ips_statinit()
5148 ha->io_addr + IPS_REG_SQER); in ips_statinit()
5150 ha->io_addr + IPS_REG_SQHR); in ips_statinit()
5151 outl(phys_status_start, ha->io_addr + IPS_REG_SQTR); in ips_statinit()
5153 ha->adapt->hw_status_tail = phys_status_start; in ips_statinit()
5166 ips_statinit_memio(ips_ha_t * ha) in ips_statinit_memio() argument
5172 ha->adapt->p_status_start = ha->adapt->status; in ips_statinit_memio()
5173 ha->adapt->p_status_end = ha->adapt->status + IPS_MAX_CMDS; in ips_statinit_memio()
5174 ha->adapt->p_status_tail = ha->adapt->status; in ips_statinit_memio()
5176 phys_status_start = ha->adapt->hw_status_start; in ips_statinit_memio()
5177 writel(phys_status_start, ha->mem_ptr + IPS_REG_SQSR); in ips_statinit_memio()
5179 ha->mem_ptr + IPS_REG_SQER); in ips_statinit_memio()
5180 writel(phys_status_start + IPS_STATUS_SIZE, ha->mem_ptr + IPS_REG_SQHR); in ips_statinit_memio()
5181 writel(phys_status_start, ha->mem_ptr + IPS_REG_SQTR); in ips_statinit_memio()
5183 ha->adapt->hw_status_tail = phys_status_start; in ips_statinit_memio()
5196 ips_statupd_copperhead(ips_ha_t * ha) in ips_statupd_copperhead() argument
5200 if (ha->adapt->p_status_tail != ha->adapt->p_status_end) { in ips_statupd_copperhead()
5201 ha->adapt->p_status_tail++; in ips_statupd_copperhead()
5202 ha->adapt->hw_status_tail += sizeof (IPS_STATUS); in ips_statupd_copperhead()
5204 ha->adapt->p_status_tail = ha->adapt->p_status_start; in ips_statupd_copperhead()
5205 ha->adapt->hw_status_tail = ha->adapt->hw_status_start; in ips_statupd_copperhead()
5208 outl(ha->adapt->hw_status_tail, in ips_statupd_copperhead()
5209 ha->io_addr + IPS_REG_SQTR); in ips_statupd_copperhead()
5211 return (ha->adapt->p_status_tail->value); in ips_statupd_copperhead()
5224 ips_statupd_copperhead_memio(ips_ha_t * ha) in ips_statupd_copperhead_memio() argument
5228 if (ha->adapt->p_status_tail != ha->adapt->p_status_end) { in ips_statupd_copperhead_memio()
5229 ha->adapt->p_status_tail++; in ips_statupd_copperhead_memio()
5230 ha->adapt->hw_status_tail += sizeof (IPS_STATUS); in ips_statupd_copperhead_memio()
5232 ha->adapt->p_status_tail = ha->adapt->p_status_start; in ips_statupd_copperhead_memio()
5233 ha->adapt->hw_status_tail = ha->adapt->hw_status_start; in ips_statupd_copperhead_memio()
5236 writel(ha->adapt->hw_status_tail, ha->mem_ptr + IPS_REG_SQTR); in ips_statupd_copperhead_memio()
5238 return (ha->adapt->p_status_tail->value); in ips_statupd_copperhead_memio()
5251 ips_statupd_morpheus(ips_ha_t * ha) in ips_statupd_morpheus() argument
5257 val = readl(ha->mem_ptr + IPS_REG_I2O_OUTMSGQ); in ips_statupd_morpheus()
5272 ips_issue_copperhead(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_copperhead() argument
5282 ha->host_num, in ips_issue_copperhead()
5288 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_copperhead()
5294 le32_to_cpu(inl(ha->io_addr + IPS_REG_CCCR))) & IPS_BIT_SEM) { in ips_issue_copperhead()
5301 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead()
5303 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead()
5310 outl(scb->scb_busaddr, ha->io_addr + IPS_REG_CCSAR); in ips_issue_copperhead()
5311 outw(IPS_BIT_START_CMD, ha->io_addr + IPS_REG_CCCR); in ips_issue_copperhead()
5326 ips_issue_copperhead_memio(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_copperhead_memio() argument
5336 ha->host_num, in ips_issue_copperhead_memio()
5342 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_copperhead_memio()
5347 while ((val = readl(ha->mem_ptr + IPS_REG_CCCR)) & IPS_BIT_SEM) { in ips_issue_copperhead_memio()
5354 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead_memio()
5356 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead_memio()
5363 writel(scb->scb_busaddr, ha->mem_ptr + IPS_REG_CCSAR); in ips_issue_copperhead_memio()
5364 writel(IPS_BIT_START_CMD, ha->mem_ptr + IPS_REG_CCCR); in ips_issue_copperhead_memio()
5379 ips_issue_i2o(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_i2o() argument
5387 ha->host_num, in ips_issue_i2o()
5393 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_i2o()
5396 outl(scb->scb_busaddr, ha->io_addr + IPS_REG_I2O_INMSGQ); in ips_issue_i2o()
5411 ips_issue_i2o_memio(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_i2o_memio() argument
5419 ha->host_num, in ips_issue_i2o_memio()
5425 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_i2o_memio()
5428 writel(scb->scb_busaddr, ha->mem_ptr + IPS_REG_I2O_INMSGQ); in ips_issue_i2o_memio()
5443 ips_isintr_copperhead(ips_ha_t * ha) in ips_isintr_copperhead() argument
5449 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_isintr_copperhead()
5460 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_isintr_copperhead()
5476 ips_isintr_copperhead_memio(ips_ha_t * ha) in ips_isintr_copperhead_memio() argument
5482 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_isintr_copperhead_memio()
5493 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_isintr_copperhead_memio()
5509 ips_isintr_morpheus(ips_ha_t * ha) in ips_isintr_morpheus() argument
5515 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_isintr_morpheus()
5533 ips_wait(ips_ha_t * ha, int time, int intr) in ips_wait() argument
5547 if (ha->waitflag == FALSE) { in ips_wait()
5553 if (ha->waitflag == FALSE) { in ips_wait()
5570 (*ha->func.intr) (ha); in ips_wait()
5591 ips_write_driver_status(ips_ha_t * ha, int intr) in ips_write_driver_status() argument
5595 if (!ips_readwrite_page5(ha, FALSE, intr)) { in ips_write_driver_status()
5596 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_write_driver_status()
5604 if (le32_to_cpu(ha->nvram->signature) != IPS_NVRAM_P5_SIG) { in ips_write_driver_status()
5607 ips_name, ha->host_num, ha->nvram->signature); in ips_write_driver_status()
5608 ha->nvram->signature = IPS_NVRAM_P5_SIG; in ips_write_driver_status()
5613 ips_name, ha->host_num, le16_to_cpu(ha->nvram->adapter_type), in ips_write_driver_status()
5614 ha->nvram->adapter_slot, ha->nvram->bios_high[0], in ips_write_driver_status()
5615 ha->nvram->bios_high[1], ha->nvram->bios_high[2], in ips_write_driver_status()
5616 ha->nvram->bios_high[3], ha->nvram->bios_low[0], in ips_write_driver_status()
5617 ha->nvram->bios_low[1], ha->nvram->bios_low[2], in ips_write_driver_status()
5618 ha->nvram->bios_low[3]); in ips_write_driver_status()
5620 ips_get_bios_version(ha, intr); in ips_write_driver_status()
5623 ha->nvram->operating_system = IPS_OS_LINUX; in ips_write_driver_status()
5624 ha->nvram->adapter_type = ha->ad_type; in ips_write_driver_status()
5625 strncpy((char *) ha->nvram->driver_high, IPS_VERSION_HIGH, 4); in ips_write_driver_status()
5626 strncpy((char *) ha->nvram->driver_low, IPS_VERSION_LOW, 4); in ips_write_driver_status()
5627 strncpy((char *) ha->nvram->bios_high, ha->bios_version, 4); in ips_write_driver_status()
5628 strncpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4); in ips_write_driver_status()
5630 ha->nvram->versioning = 0; /* Indicate the Driver Does Not Support Versioning */ in ips_write_driver_status()
5633 if (!ips_readwrite_page5(ha, TRUE, intr)) { in ips_write_driver_status()
5634 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_write_driver_status()
5641 ha->slot_num = ha->nvram->adapter_slot; in ips_write_driver_status()
5656 ips_read_adapter_status(ips_ha_t * ha, int intr) in ips_read_adapter_status() argument
5663 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_adapter_status()
5665 ips_init_scb(ha, scb); in ips_read_adapter_status()
5671 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_adapter_status()
5676 scb->data_len = sizeof (*ha->enq); in ips_read_adapter_status()
5677 scb->cmd.basic_io.sg_addr = ha->enq_busaddr; in ips_read_adapter_status()
5681 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_adapter_status()
5699 ips_read_subsystem_parameters(ips_ha_t * ha, int intr) in ips_read_subsystem_parameters() argument
5706 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_subsystem_parameters()
5708 ips_init_scb(ha, scb); in ips_read_subsystem_parameters()
5714 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_subsystem_parameters()
5719 scb->data_len = sizeof (*ha->subsys); in ips_read_subsystem_parameters()
5720 scb->cmd.basic_io.sg_addr = ha->ioctl_busaddr; in ips_read_subsystem_parameters()
5724 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_subsystem_parameters()
5729 memcpy(ha->subsys, ha->ioctl_data, sizeof(*ha->subsys)); in ips_read_subsystem_parameters()
5743 ips_read_config(ips_ha_t * ha, int intr) in ips_read_config() argument
5753 ha->conf->init_id[i] = 7; in ips_read_config()
5755 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_config()
5757 ips_init_scb(ha, scb); in ips_read_config()
5763 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_config()
5764 scb->data_len = sizeof (*ha->conf); in ips_read_config()
5765 scb->cmd.basic_io.sg_addr = ha->ioctl_busaddr; in ips_read_config()
5769 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_config()
5773 memset(ha->conf, 0, sizeof (IPS_CONF)); in ips_read_config()
5777 ha->conf->init_id[i] = 7; in ips_read_config()
5787 memcpy(ha->conf, ha->ioctl_data, sizeof(*ha->conf)); in ips_read_config()
5801 ips_readwrite_page5(ips_ha_t * ha, int write, int intr) in ips_readwrite_page5() argument
5808 scb = &ha->scbs[ha->max_cmds - 1]; in ips_readwrite_page5()
5810 ips_init_scb(ha, scb); in ips_readwrite_page5()
5816 scb->cmd.nvram.command_id = IPS_COMMAND_ID(ha, scb); in ips_readwrite_page5()
5821 scb->data_len = sizeof (*ha->nvram); in ips_readwrite_page5()
5822 scb->cmd.nvram.buffer_addr = ha->ioctl_busaddr; in ips_readwrite_page5()
5824 memcpy(ha->ioctl_data, ha->nvram, sizeof(*ha->nvram)); in ips_readwrite_page5()
5828 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_readwrite_page5()
5832 memset(ha->nvram, 0, sizeof (IPS_NVRAM_P5)); in ips_readwrite_page5()
5837 memcpy(ha->nvram, ha->ioctl_data, sizeof(*ha->nvram)); in ips_readwrite_page5()
5851 ips_clear_adapter(ips_ha_t * ha, int intr) in ips_clear_adapter() argument
5858 scb = &ha->scbs[ha->max_cmds - 1]; in ips_clear_adapter()
5860 ips_init_scb(ha, scb); in ips_clear_adapter()
5866 scb->cmd.config_sync.command_id = IPS_COMMAND_ID(ha, scb); in ips_clear_adapter()
5875 ips_send_wait(ha, scb, ips_reset_timeout, intr)) == IPS_FAILURE) in ips_clear_adapter()
5881 ips_init_scb(ha, scb); in ips_clear_adapter()
5887 scb->cmd.unlock_stripe.command_id = IPS_COMMAND_ID(ha, scb); in ips_clear_adapter()
5896 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_clear_adapter()
5914 ips_ffdc_reset(ips_ha_t * ha, int intr) in ips_ffdc_reset() argument
5920 scb = &ha->scbs[ha->max_cmds - 1]; in ips_ffdc_reset()
5922 ips_init_scb(ha, scb); in ips_ffdc_reset()
5927 scb->cmd.ffdc.command_id = IPS_COMMAND_ID(ha, scb); in ips_ffdc_reset()
5928 scb->cmd.ffdc.reset_count = ha->reset_count; in ips_ffdc_reset()
5932 ips_fix_ffdc_time(ha, scb, ha->last_ffdc); in ips_ffdc_reset()
5935 ips_send_wait(ha, scb, ips_cmd_timeout, intr); in ips_ffdc_reset()
5948 ips_ffdc_time(ips_ha_t * ha) in ips_ffdc_time() argument
5954 DEBUG_VAR(1, "(%s%d) Sending time update.", ips_name, ha->host_num); in ips_ffdc_time()
5956 scb = &ha->scbs[ha->max_cmds - 1]; in ips_ffdc_time()
5958 ips_init_scb(ha, scb); in ips_ffdc_time()
5963 scb->cmd.ffdc.command_id = IPS_COMMAND_ID(ha, scb); in ips_ffdc_time()
5968 ips_fix_ffdc_time(ha, scb, ha->last_ffdc); in ips_ffdc_time()
5971 ips_send_wait(ha, scb, ips_cmd_timeout, IPS_FFDC); in ips_ffdc_time()
5983 ips_fix_ffdc_time(ips_ha_t * ha, ips_scb_t * scb, time64_t current_time) in ips_fix_ffdc_time() argument
6013 ips_erase_bios(ips_ha_t * ha) in ips_erase_bios() argument
6023 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6024 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6027 outb(0x50, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6028 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6032 outb(0x20, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6033 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6037 outb(0xD0, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6038 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6042 outb(0x70, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6043 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6049 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios()
6050 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6054 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6068 outb(0xB0, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6069 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6075 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios()
6076 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6080 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6104 outb(0x50, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6105 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6109 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6110 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6125 ips_erase_bios_memio(ips_ha_t * ha) in ips_erase_bios_memio() argument
6135 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6136 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6139 writeb(0x50, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6140 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6144 writeb(0x20, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6145 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6149 writeb(0xD0, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6150 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6154 writeb(0x70, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6155 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6161 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios_memio()
6162 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6166 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6180 writeb(0xB0, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6181 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6187 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios_memio()
6188 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6192 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6216 writeb(0x50, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6217 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6221 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6222 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6237 ips_program_bios(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_program_bios() argument
6250 outl(i + offset, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6251 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6254 outb(0x40, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6255 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6258 outb(buffer[i], ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6259 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6265 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_program_bios()
6266 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6270 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6281 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6282 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6285 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6286 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6295 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6296 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6299 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6300 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6308 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6309 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6312 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6313 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6328 ips_program_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_program_bios_memio() argument
6341 writel(i + offset, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6342 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6345 writeb(0x40, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6346 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6349 writeb(buffer[i], ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6350 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6356 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_program_bios_memio()
6357 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6361 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6372 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6373 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6376 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6377 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6386 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6387 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6390 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6391 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6399 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6400 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6403 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6404 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6419 ips_verify_bios(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_verify_bios() argument
6428 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6429 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6432 if (inb(ha->io_addr + IPS_REG_FLDP) != 0x55) in ips_verify_bios()
6435 outl(1, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6436 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6438 if (inb(ha->io_addr + IPS_REG_FLDP) != 0xAA) in ips_verify_bios()
6444 outl(i + offset, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6445 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6448 checksum = (uint8_t) checksum + inb(ha->io_addr + IPS_REG_FLDP); in ips_verify_bios()
6468 ips_verify_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_verify_bios_memio() argument
6477 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6478 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6481 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0x55) in ips_verify_bios_memio()
6484 writel(1, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6485 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6487 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0xAA) in ips_verify_bios_memio()
6493 writel(i + offset, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6494 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6498 (uint8_t) checksum + readb(ha->mem_ptr + IPS_REG_FLDP); in ips_verify_bios_memio()
6517 ips_abort_init(ips_ha_t * ha, int index) in ips_abort_init() argument
6519 ha->active = 0; in ips_abort_init()
6520 ips_free(ha); in ips_abort_init()
6656 ips_ha_t *ha, *oldha = ips_ha[index]; in ips_register_scsi() local
6663 ha = IPS_HA(sh); in ips_register_scsi()
6664 memcpy(ha, oldha, sizeof (ips_ha_t)); in ips_register_scsi()
6667 if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { in ips_register_scsi()
6668 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_register_scsi()
6676 sh->unique_id = (ha->io_addr) ? ha->io_addr : ha->mem_addr; in ips_register_scsi()
6683 sh->max_id = ha->ntargets; in ips_register_scsi()
6684 sh->max_lun = ha->nlun; in ips_register_scsi()
6685 sh->max_channel = ha->nbus - 1; in ips_register_scsi()
6686 sh->can_queue = ha->max_cmds - 1; in ips_register_scsi()
6688 if (scsi_add_host(sh, &ha->pcidev->dev)) in ips_register_scsi()
6692 ips_ha[index] = ha; in ips_register_scsi()
6699 free_irq(ha->pcidev->irq, ha); in ips_register_scsi()
6834 ips_ha_t *ha; in ips_init_phase1() local
6900 ha = kzalloc(sizeof (ips_ha_t), GFP_KERNEL); in ips_init_phase1()
6901 if (ha == NULL) { in ips_init_phase1()
6908 ips_ha[index] = ha; in ips_init_phase1()
6909 ha->active = 1; in ips_init_phase1()
6912 ha->io_addr = io_addr; in ips_init_phase1()
6913 ha->io_len = io_len; in ips_init_phase1()
6914 ha->mem_addr = mem_addr; in ips_init_phase1()
6915 ha->mem_len = mem_len; in ips_init_phase1()
6916 ha->mem_ptr = mem_ptr; in ips_init_phase1()
6917 ha->ioremap_ptr = ioremap_ptr; in ips_init_phase1()
6918 ha->host_num = (uint32_t) index; in ips_init_phase1()
6919 ha->slot_num = PCI_SLOT(pci_dev->devfn); in ips_init_phase1()
6920 ha->pcidev = pci_dev; in ips_init_phase1()
6928 if (IPS_ENABLE_DMA64 && IPS_HAS_ENH_SGLIST(ha) && in ips_init_phase1()
6929 !pci_set_dma_mask(ha->pcidev, DMA_BIT_MASK(64))) { in ips_init_phase1()
6930 (ha)->flags |= IPS_HA_ENH_SG; in ips_init_phase1()
6932 if (pci_set_dma_mask(ha->pcidev, DMA_BIT_MASK(32)) != 0) { in ips_init_phase1()
6934 return ips_abort_init(ha, index); in ips_init_phase1()
6942 ha->enq = pci_alloc_consistent(pci_dev, sizeof (IPS_ENQ), in ips_init_phase1()
6943 &ha->enq_busaddr); in ips_init_phase1()
6944 if (!ha->enq) { in ips_init_phase1()
6947 return ips_abort_init(ha, index); in ips_init_phase1()
6950 ha->adapt = pci_alloc_consistent(pci_dev, sizeof (IPS_ADAPTER) + in ips_init_phase1()
6952 if (!ha->adapt) { in ips_init_phase1()
6955 return ips_abort_init(ha, index); in ips_init_phase1()
6957 ha->adapt->hw_status_start = dma_address; in ips_init_phase1()
6958 ha->dummy = (void *) (ha->adapt + 1); in ips_init_phase1()
6962 ha->logical_drive_info = pci_alloc_consistent(pci_dev, sizeof (IPS_LD_INFO), &dma_address); in ips_init_phase1()
6963 if (!ha->logical_drive_info) { in ips_init_phase1()
6966 return ips_abort_init(ha, index); in ips_init_phase1()
6968 ha->logical_drive_info_dma_addr = dma_address; in ips_init_phase1()
6971 ha->conf = kmalloc(sizeof (IPS_CONF), GFP_KERNEL); in ips_init_phase1()
6973 if (!ha->conf) { in ips_init_phase1()
6976 return ips_abort_init(ha, index); in ips_init_phase1()
6979 ha->nvram = kmalloc(sizeof (IPS_NVRAM_P5), GFP_KERNEL); in ips_init_phase1()
6981 if (!ha->nvram) { in ips_init_phase1()
6984 return ips_abort_init(ha, index); in ips_init_phase1()
6987 ha->subsys = kmalloc(sizeof (IPS_SUBSYS), GFP_KERNEL); in ips_init_phase1()
6989 if (!ha->subsys) { in ips_init_phase1()
6992 return ips_abort_init(ha, index); in ips_init_phase1()
7000 ha->ioctl_data = pci_alloc_consistent(pci_dev, ips_ioctlsize, in ips_init_phase1()
7001 &ha->ioctl_busaddr); in ips_init_phase1()
7002 ha->ioctl_len = ips_ioctlsize; in ips_init_phase1()
7003 if (!ha->ioctl_data) { in ips_init_phase1()
7006 return ips_abort_init(ha, index); in ips_init_phase1()
7012 ips_setup_funclist(ha); in ips_init_phase1()
7014 if ((IPS_IS_MORPHEUS(ha)) || (IPS_IS_MARCO(ha))) { in ips_init_phase1()
7016 IsDead = readl(ha->mem_ptr + IPS_REG_I960_MSG1); in ips_init_phase1()
7018 ips_reset_morpheus(ha); in ips_init_phase1()
7026 if (!(*ha->func.isinit) (ha)) { in ips_init_phase1()
7027 if (!(*ha->func.init) (ha)) { in ips_init_phase1()
7033 return ips_abort_init(ha, index); in ips_init_phase1()
7053 ips_ha_t *ha; in ips_init_phase2() local
7055 ha = ips_ha[index]; in ips_init_phase2()
7058 if (!ha->active) { in ips_init_phase2()
7064 if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { in ips_init_phase2()
7065 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7067 return ips_abort_init(ha, index); in ips_init_phase2()
7073 ha->max_cmds = 1; in ips_init_phase2()
7074 if (!ips_allocatescbs(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 if (!ips_hainit(ha)) { in ips_init_phase2()
7082 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7084 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7085 return ips_abort_init(ha, index); in ips_init_phase2()
7088 ips_deallocatescbs(ha, 1); in ips_init_phase2()
7091 if (!ips_allocatescbs(ha)) { in ips_init_phase2()
7092 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7094 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7095 return ips_abort_init(ha, index); in ips_init_phase2()