Lines Matching refs:ha
279 static void ips_free_flash_copperhead(ips_ha_t * ha);
330 static int ips_abort_init(ips_ha_t * ha, int index);
336 static int ips_poll_for_flush_complete(ips_ha_t * ha);
337 static void ips_flush_and_reset(ips_ha_t *ha);
582 ips_setup_funclist(ips_ha_t * ha) in ips_setup_funclist() argument
588 if (IPS_IS_MORPHEUS(ha) || IPS_IS_MARCO(ha)) { in ips_setup_funclist()
590 ha->func.isintr = ips_isintr_morpheus; in ips_setup_funclist()
591 ha->func.isinit = ips_isinit_morpheus; in ips_setup_funclist()
592 ha->func.issue = ips_issue_i2o_memio; in ips_setup_funclist()
593 ha->func.init = ips_init_morpheus; in ips_setup_funclist()
594 ha->func.statupd = ips_statupd_morpheus; in ips_setup_funclist()
595 ha->func.reset = ips_reset_morpheus; in ips_setup_funclist()
596 ha->func.intr = ips_intr_morpheus; in ips_setup_funclist()
597 ha->func.enableint = ips_enable_int_morpheus; in ips_setup_funclist()
598 } else if (IPS_USE_MEMIO(ha)) { in ips_setup_funclist()
600 ha->func.isintr = ips_isintr_copperhead_memio; in ips_setup_funclist()
601 ha->func.isinit = ips_isinit_copperhead_memio; in ips_setup_funclist()
602 ha->func.init = ips_init_copperhead_memio; in ips_setup_funclist()
603 ha->func.statupd = ips_statupd_copperhead_memio; in ips_setup_funclist()
604 ha->func.statinit = ips_statinit_memio; in ips_setup_funclist()
605 ha->func.reset = ips_reset_copperhead_memio; in ips_setup_funclist()
606 ha->func.intr = ips_intr_copperhead; in ips_setup_funclist()
607 ha->func.erasebios = ips_erase_bios_memio; in ips_setup_funclist()
608 ha->func.programbios = ips_program_bios_memio; in ips_setup_funclist()
609 ha->func.verifybios = ips_verify_bios_memio; in ips_setup_funclist()
610 ha->func.enableint = ips_enable_int_copperhead_memio; in ips_setup_funclist()
611 if (IPS_USE_I2O_DELIVER(ha)) in ips_setup_funclist()
612 ha->func.issue = ips_issue_i2o_memio; in ips_setup_funclist()
614 ha->func.issue = ips_issue_copperhead_memio; in ips_setup_funclist()
617 ha->func.isintr = ips_isintr_copperhead; in ips_setup_funclist()
618 ha->func.isinit = ips_isinit_copperhead; in ips_setup_funclist()
619 ha->func.init = ips_init_copperhead; in ips_setup_funclist()
620 ha->func.statupd = ips_statupd_copperhead; in ips_setup_funclist()
621 ha->func.statinit = ips_statinit; in ips_setup_funclist()
622 ha->func.reset = ips_reset_copperhead; in ips_setup_funclist()
623 ha->func.intr = ips_intr_copperhead; in ips_setup_funclist()
624 ha->func.erasebios = ips_erase_bios; in ips_setup_funclist()
625 ha->func.programbios = ips_program_bios; in ips_setup_funclist()
626 ha->func.verifybios = ips_verify_bios; in ips_setup_funclist()
627 ha->func.enableint = ips_enable_int_copperhead; in ips_setup_funclist()
629 if (IPS_USE_I2O_DELIVER(ha)) in ips_setup_funclist()
630 ha->func.issue = ips_issue_i2o; in ips_setup_funclist()
632 ha->func.issue = ips_issue_copperhead; in ips_setup_funclist()
648 ips_ha_t *ha; in ips_release() local
663 ha = IPS_HA(sh); in ips_release()
665 if (!ha) in ips_release()
669 scb = &ha->scbs[ha->max_cmds - 1]; in ips_release()
671 ips_init_scb(ha, scb); in ips_release()
677 scb->cmd.flush_cache.command_id = IPS_COMMAND_ID(ha, scb); in ips_release()
684 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Flushing Cache.\n"); in ips_release()
687 if (ips_send_wait(ha, scb, ips_cmd_timeout, IPS_INTR_ON) == IPS_FAILURE) in ips_release()
688 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Incomplete Flush.\n"); in ips_release()
690 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Flushing Complete.\n"); in ips_release()
696 ips_free(ha); in ips_release()
699 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()
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()
1070 ha->host_num, in ips_queue_lck()
1076 && (scmd_id(SC) == ha->ha_id[scmd_channel(SC)])) { in ips_queue_lck()
1093 if (ha->scb_activelist.count != 0) { in ips_queue_lck()
1098 ha->ioctl_reset = 1; /* This reset request is from an IOCTL */ in ips_queue_lck()
1118 ips_putq_copp_tail(&ha->copp_waitlist, scratch); in ips_queue_lck()
1120 ips_putq_wait_tail(&ha->scb_waitlist, SC); in ips_queue_lck()
1123 ips_next(ha, IPS_INTR_IORL); in ips_queue_lck()
1147 ips_ha_t *ha = (ips_ha_t *) sdev->host->hostdata; in DEF_SCSI_QCMD() local
1154 if (!ha) in DEF_SCSI_QCMD()
1158 if (!ha->active) in DEF_SCSI_QCMD()
1161 if (!ips_read_adapter_status(ha, IPS_INTR_ON)) in DEF_SCSI_QCMD()
1165 if ((capacity > 0x400000) && ((ha->enq->ucMiscFlag & 0x8) == 0)) { in DEF_SCSI_QCMD()
1197 ips_ha_t *ha; in ips_slave_configure() local
1200 ha = IPS_HA(SDptr->host); in ips_slave_configure()
1202 min = ha->max_cmds / 2; in ips_slave_configure()
1203 if (ha->enq->ucLogDriveCount <= 2) in ips_slave_configure()
1204 min = ha->max_cmds - 1; in ips_slave_configure()
1225 ips_ha_t *ha; in do_ipsintr() local
1231 ha = (ips_ha_t *) dev_id; in do_ipsintr()
1232 if (!ha) in do_ipsintr()
1234 host = ips_sh[ha->host_num]; in do_ipsintr()
1237 (*ha->func.intr) (ha); in do_ipsintr()
1243 if (!ha->active) { in do_ipsintr()
1248 irqstatus = (*ha->func.intr) (ha); in do_ipsintr()
1253 ips_next(ha, IPS_INTR_ON); in do_ipsintr()
1269 ips_intr_copperhead(ips_ha_t * ha) in ips_intr_copperhead() argument
1278 if (!ha) in ips_intr_copperhead()
1281 if (!ha->active) in ips_intr_copperhead()
1284 intrstatus = (*ha->func.isintr) (ha); in ips_intr_copperhead()
1295 sp = &ha->sp; in ips_intr_copperhead()
1297 intrstatus = (*ha->func.isintr) (ha); in ips_intr_copperhead()
1302 cstatus.value = (*ha->func.statupd) (ha); in ips_intr_copperhead()
1309 ips_chkstatus(ha, &cstatus); in ips_intr_copperhead()
1316 (*scb->callback) (ha, scb); in ips_intr_copperhead()
1333 ips_intr_morpheus(ips_ha_t * ha) in ips_intr_morpheus() argument
1342 if (!ha) in ips_intr_morpheus()
1345 if (!ha->active) in ips_intr_morpheus()
1348 intrstatus = (*ha->func.isintr) (ha); in ips_intr_morpheus()
1359 sp = &ha->sp; in ips_intr_morpheus()
1361 intrstatus = (*ha->func.isintr) (ha); in ips_intr_morpheus()
1366 cstatus.value = (*ha->func.statupd) (ha); in ips_intr_morpheus()
1373 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_intr_morpheus()
1379 ips_chkstatus(ha, &cstatus); in ips_intr_morpheus()
1386 (*scb->callback) (ha, scb); in ips_intr_morpheus()
1405 ips_ha_t *ha; in ips_info() local
1409 ha = IPS_HA(SH); in ips_info()
1411 if (!ha) in ips_info()
1420 if (ha->ad_type > 0 && ha->ad_type <= MAX_ADAPTER_NAME) { in ips_info()
1422 strcat(bp, ips_adapter_name[ha->ad_type - 1]); in ips_info()
1433 ips_ha_t *ha = NULL; in ips_write_info() local
1439 ha = (ips_ha_t *) ips_sh[i]->hostdata; in ips_write_info()
1445 if (!ha) in ips_write_info()
1455 ips_ha_t *ha = NULL; in ips_show_info() local
1461 ha = (ips_ha_t *) ips_sh[i]->hostdata; in ips_show_info()
1467 if (!ha) in ips_show_info()
1470 return ips_host_info(ha, m); in ips_show_info()
1526 ips_alloc_passthru_buffer(ips_ha_t * ha, int length) in ips_alloc_passthru_buffer() argument
1531 if (ha->ioctl_data && length <= ha->ioctl_len) in ips_alloc_passthru_buffer()
1534 bigger_buf = dma_alloc_coherent(&ha->pcidev->dev, length, &dma_busaddr, in ips_alloc_passthru_buffer()
1538 dma_free_coherent(&ha->pcidev->dev, ha->ioctl_len, in ips_alloc_passthru_buffer()
1539 ha->ioctl_data, ha->ioctl_busaddr); in ips_alloc_passthru_buffer()
1541 ha->ioctl_data = (char *) bigger_buf; in ips_alloc_passthru_buffer()
1542 ha->ioctl_len = length; in ips_alloc_passthru_buffer()
1543 ha->ioctl_busaddr = dma_busaddr; in ips_alloc_passthru_buffer()
1560 ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr) in ips_make_passthru() argument
1575 ips_name, ha->host_num); in ips_make_passthru()
1578 if (ips_alloc_passthru_buffer(ha, length)) { in ips_make_passthru()
1581 if (ha->ioctl_data) { in ips_make_passthru()
1582 pt = (ips_passthru_t *) ha->ioctl_data; in ips_make_passthru()
1590 ha->ioctl_datasize = length; in ips_make_passthru()
1592 ips_scmd_buf_read(SC, ha->ioctl_data, ha->ioctl_datasize); in ips_make_passthru()
1593 pt = (ips_passthru_t *) ha->ioctl_data; in ips_make_passthru()
1607 memcpy(ha->ioctl_data + sizeof (ips_passthru_t), in ips_make_passthru()
1609 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
1622 ips_name, ha->host_num); in ips_make_passthru()
1627 if (ha->pcidev->device == IPS_DEVICEID_COPPERHEAD && in ips_make_passthru()
1630 ret = ips_flash_copperhead(ha, pt, scb); in ips_make_passthru()
1631 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
1635 if (ips_usrcmd(ha, pt, scb)) in ips_make_passthru()
1654 ips_flash_copperhead(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_copperhead() argument
1660 if (IPS_IS_TROMBONE(ha) && pt->CoppCP.cmd.flashfw.type == IPS_FW_IMAGE) { in ips_flash_copperhead()
1661 if (ips_usrcmd(ha, pt, scb)) in ips_flash_copperhead()
1674 return ips_flash_bios(ha, pt, scb); in ips_flash_copperhead()
1677 ha->flash_data = ips_FlashData; in ips_flash_copperhead()
1678 ha->flash_busaddr = ips_flashbusaddr; in ips_flash_copperhead()
1679 ha->flash_len = PAGE_SIZE << 7; in ips_flash_copperhead()
1680 ha->flash_datasize = 0; in ips_flash_copperhead()
1681 } else if (!ha->flash_data) { in ips_flash_copperhead()
1684 ha->flash_data = dma_alloc_coherent(&ha->pcidev->dev, in ips_flash_copperhead()
1685 datasize, &ha->flash_busaddr, GFP_KERNEL); in ips_flash_copperhead()
1686 if (!ha->flash_data){ in ips_flash_copperhead()
1690 ha->flash_datasize = 0; in ips_flash_copperhead()
1691 ha->flash_len = datasize; in ips_flash_copperhead()
1695 if (pt->CoppCP.cmd.flashfw.count + ha->flash_datasize > in ips_flash_copperhead()
1696 ha->flash_len) { in ips_flash_copperhead()
1697 ips_free_flash_copperhead(ha); in ips_flash_copperhead()
1698 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_flash_copperhead()
1703 if (!ha->flash_data) in ips_flash_copperhead()
1706 memcpy(&ha->flash_data[ha->flash_datasize], pt + 1, in ips_flash_copperhead()
1708 ha->flash_datasize += pt->CoppCP.cmd.flashfw.count; in ips_flash_copperhead()
1712 return ips_flash_bios(ha, pt, scb); in ips_flash_copperhead()
1714 return ips_flash_firmware(ha, pt, scb); in ips_flash_copperhead()
1725 ips_flash_bios(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_bios() argument
1730 if ((!ha->func.programbios) || (!ha->func.erasebios) || in ips_flash_bios()
1731 (!ha->func.verifybios)) in ips_flash_bios()
1733 if ((*ha->func.erasebios) (ha)) { in ips_flash_bios()
1736 ips_name, ha->host_num); in ips_flash_bios()
1739 if ((*ha->func.programbios) (ha, in ips_flash_bios()
1740 ha->flash_data + in ips_flash_bios()
1742 ha->flash_datasize - in ips_flash_bios()
1746 ips_name, ha->host_num); in ips_flash_bios()
1749 if ((*ha->func.verifybios) (ha, in ips_flash_bios()
1750 ha->flash_data + in ips_flash_bios()
1752 ha->flash_datasize - in ips_flash_bios()
1756 ips_name, ha->host_num); in ips_flash_bios()
1759 ips_free_flash_copperhead(ha); in ips_flash_bios()
1763 if (!ha->func.erasebios) in ips_flash_bios()
1765 if ((*ha->func.erasebios) (ha)) { in ips_flash_bios()
1768 ips_name, ha->host_num); in ips_flash_bios()
1776 ips_free_flash_copperhead(ha); in ips_flash_bios()
1789 ips_fill_scb_sg_single(ips_ha_t * ha, dma_addr_t busaddr, in ips_fill_scb_sg_single() argument
1795 if ((scb->data_len + e_len) > ha->max_xfer) { in ips_fill_scb_sg_single()
1796 e_len = ha->max_xfer - scb->data_len; in ips_fill_scb_sg_single()
1804 if (IPS_USE_ENH_SGLIST(ha)) { in ips_fill_scb_sg_single()
1827 ips_flash_firmware(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_firmware() argument
1836 pt->CoppCP.cmd.flashfw.count = cpu_to_le32(ha->flash_datasize); in ips_flash_firmware()
1840 ips_free_flash_copperhead(ha); in ips_flash_firmware()
1861 scb->data_len = ha->flash_datasize; in ips_flash_firmware()
1863 dma_map_single(&ha->pcidev->dev, ha->flash_data, scb->data_len, in ips_flash_firmware()
1866 scb->cmd.flashfw.command_id = IPS_COMMAND_ID(ha, scb); in ips_flash_firmware()
1880 ips_free_flash_copperhead(ips_ha_t * ha) in ips_free_flash_copperhead() argument
1882 if (ha->flash_data == ips_FlashData) in ips_free_flash_copperhead()
1884 else if (ha->flash_data) in ips_free_flash_copperhead()
1885 dma_free_coherent(&ha->pcidev->dev, ha->flash_len, in ips_free_flash_copperhead()
1886 ha->flash_data, ha->flash_busaddr); in ips_free_flash_copperhead()
1887 ha->flash_data = NULL; in ips_free_flash_copperhead()
1900 ips_usrcmd(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_usrcmd() argument
1907 if ((!scb) || (!pt) || (!ha)) in ips_usrcmd()
1929 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_usrcmd()
1939 scb->data_busaddr = ha->ioctl_busaddr + sizeof (ips_passthru_t); in ips_usrcmd()
1988 ips_cleanup_passthru(ips_ha_t * ha, ips_scb_t * scb) in ips_cleanup_passthru() argument
1996 ips_name, ha->host_num); in ips_cleanup_passthru()
2000 pt = (ips_passthru_t *) ha->ioctl_data; in ips_cleanup_passthru()
2008 pt->AdapterType = ha->ad_type; in ips_cleanup_passthru()
2010 if (ha->pcidev->device == IPS_DEVICEID_COPPERHEAD && in ips_cleanup_passthru()
2013 ips_free_flash_copperhead(ha); in ips_cleanup_passthru()
2015 ips_scmd_buf_write(scb->scsi_cmd, ha->ioctl_data, ha->ioctl_datasize); in ips_cleanup_passthru()
2028 ips_host_info(ips_ha_t *ha, struct seq_file *m) in ips_host_info() argument
2034 if ((le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG) && in ips_host_info()
2035 (le16_to_cpu(ha->nvram->adapter_type) != 0)) in ips_host_info()
2037 ips_adapter_name[ha->ad_type - 1]); in ips_host_info()
2041 if (ha->io_addr) in ips_host_info()
2044 ha->io_addr, ha->io_len); in ips_host_info()
2046 if (ha->mem_addr) { in ips_host_info()
2049 ha->mem_addr, ha->mem_len); in ips_host_info()
2052 (unsigned long)ha->mem_ptr); in ips_host_info()
2055 seq_printf(m, "\tIRQ number : %d\n", ha->pcidev->irq); in ips_host_info()
2060 if (le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG) { in ips_host_info()
2061 if (ha->nvram->bios_low[3] == 0) { in ips_host_info()
2064 ha->nvram->bios_high[0], ha->nvram->bios_high[1], in ips_host_info()
2065 ha->nvram->bios_high[2], ha->nvram->bios_high[3], in ips_host_info()
2066 ha->nvram->bios_low[0], ha->nvram->bios_low[1], in ips_host_info()
2067 ha->nvram->bios_low[2]); in ips_host_info()
2072 ha->nvram->bios_high[0], ha->nvram->bios_high[1], in ips_host_info()
2073 ha->nvram->bios_high[2], ha->nvram->bios_high[3], in ips_host_info()
2074 ha->nvram->bios_low[0], ha->nvram->bios_low[1], in ips_host_info()
2075 ha->nvram->bios_low[2], ha->nvram->bios_low[3]); in ips_host_info()
2080 if (ha->enq->CodeBlkVersion[7] == 0) { in ips_host_info()
2083 ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1], in ips_host_info()
2084 ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3], in ips_host_info()
2085 ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5], in ips_host_info()
2086 ha->enq->CodeBlkVersion[6]); in ips_host_info()
2090 ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1], in ips_host_info()
2091 ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3], in ips_host_info()
2092 ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5], in ips_host_info()
2093 ha->enq->CodeBlkVersion[6], ha->enq->CodeBlkVersion[7]); in ips_host_info()
2096 if (ha->enq->BootBlkVersion[7] == 0) { in ips_host_info()
2099 ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1], in ips_host_info()
2100 ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3], in ips_host_info()
2101 ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5], in ips_host_info()
2102 ha->enq->BootBlkVersion[6]); in ips_host_info()
2106 ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1], in ips_host_info()
2107 ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3], in ips_host_info()
2108 ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5], in ips_host_info()
2109 ha->enq->BootBlkVersion[6], ha->enq->BootBlkVersion[7]); in ips_host_info()
2119 ha->enq->ucMaxPhysicalDevices); in ips_host_info()
2121 ha->max_cmds); in ips_host_info()
2123 ha->scb_waitlist.count); in ips_host_info()
2125 ha->scb_activelist.count - ha->num_ioctl); in ips_host_info()
2127 ha->copp_waitlist.count); in ips_host_info()
2129 ha->num_ioctl); in ips_host_info()
2146 ips_identify_controller(ips_ha_t * ha) in ips_identify_controller() argument
2150 switch (ha->pcidev->device) { in ips_identify_controller()
2152 if (ha->pcidev->revision <= IPS_REVID_SERVERAID) { in ips_identify_controller()
2153 ha->ad_type = IPS_ADTYPE_SERVERAID; in ips_identify_controller()
2154 } else if (ha->pcidev->revision == IPS_REVID_SERVERAID2) { in ips_identify_controller()
2155 ha->ad_type = IPS_ADTYPE_SERVERAID2; in ips_identify_controller()
2156 } else if (ha->pcidev->revision == IPS_REVID_NAVAJO) { in ips_identify_controller()
2157 ha->ad_type = IPS_ADTYPE_NAVAJO; in ips_identify_controller()
2158 } else if ((ha->pcidev->revision == IPS_REVID_SERVERAID2) in ips_identify_controller()
2159 && (ha->slot_num == 0)) { in ips_identify_controller()
2160 ha->ad_type = IPS_ADTYPE_KIOWA; in ips_identify_controller()
2161 } else if ((ha->pcidev->revision >= IPS_REVID_CLARINETP1) && in ips_identify_controller()
2162 (ha->pcidev->revision <= IPS_REVID_CLARINETP3)) { in ips_identify_controller()
2163 if (ha->enq->ucMaxPhysicalDevices == 15) in ips_identify_controller()
2164 ha->ad_type = IPS_ADTYPE_SERVERAID3L; in ips_identify_controller()
2166 ha->ad_type = IPS_ADTYPE_SERVERAID3; in ips_identify_controller()
2167 } else if ((ha->pcidev->revision >= IPS_REVID_TROMBONE32) && in ips_identify_controller()
2168 (ha->pcidev->revision <= IPS_REVID_TROMBONE64)) { in ips_identify_controller()
2169 ha->ad_type = IPS_ADTYPE_SERVERAID4H; in ips_identify_controller()
2174 switch (ha->pcidev->subsystem_device) { in ips_identify_controller()
2176 ha->ad_type = IPS_ADTYPE_SERVERAID4L; in ips_identify_controller()
2180 ha->ad_type = IPS_ADTYPE_SERVERAID4M; in ips_identify_controller()
2184 ha->ad_type = IPS_ADTYPE_SERVERAID4MX; in ips_identify_controller()
2188 ha->ad_type = IPS_ADTYPE_SERVERAID4LX; in ips_identify_controller()
2192 ha->ad_type = IPS_ADTYPE_SERVERAID5I2; in ips_identify_controller()
2196 ha->ad_type = IPS_ADTYPE_SERVERAID5I1; in ips_identify_controller()
2203 switch (ha->pcidev->subsystem_device) { in ips_identify_controller()
2205 ha->ad_type = IPS_ADTYPE_SERVERAID6M; in ips_identify_controller()
2208 ha->ad_type = IPS_ADTYPE_SERVERAID6I; in ips_identify_controller()
2211 ha->ad_type = IPS_ADTYPE_SERVERAID7k; in ips_identify_controller()
2214 ha->ad_type = IPS_ADTYPE_SERVERAID7M; in ips_identify_controller()
2231 ips_get_bios_version(ips_ha_t * ha, int intr) in ips_get_bios_version() argument
2245 memcpy(ha->bios_version, " ?", 8); in ips_get_bios_version()
2247 if (ha->pcidev->device == IPS_DEVICEID_COPPERHEAD) { in ips_get_bios_version()
2248 if (IPS_USE_MEMIO(ha)) { in ips_get_bios_version()
2252 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2253 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2256 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0x55) in ips_get_bios_version()
2259 writel(1, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2260 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2263 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0xAA) in ips_get_bios_version()
2267 writel(0x1FF, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2268 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2271 major = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_get_bios_version()
2274 writel(0x1FE, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2275 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2277 minor = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_get_bios_version()
2280 writel(0x1FD, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2281 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2283 subminor = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_get_bios_version()
2289 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2290 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2293 if (inb(ha->io_addr + IPS_REG_FLDP) != 0x55) in ips_get_bios_version()
2296 outl(1, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2297 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2300 if (inb(ha->io_addr + IPS_REG_FLDP) != 0xAA) in ips_get_bios_version()
2304 outl(0x1FF, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2305 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2308 major = inb(ha->io_addr + IPS_REG_FLDP); in ips_get_bios_version()
2311 outl(0x1FE, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2312 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2315 minor = inb(ha->io_addr + IPS_REG_FLDP); in ips_get_bios_version()
2318 outl(0x1FD, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2319 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2322 subminor = inb(ha->io_addr + IPS_REG_FLDP); in ips_get_bios_version()
2328 buffer = ha->ioctl_data; in ips_get_bios_version()
2332 scb = &ha->scbs[ha->max_cmds - 1]; in ips_get_bios_version()
2334 ips_init_scb(ha, scb); in ips_get_bios_version()
2340 scb->cmd.flashfw.command_id = IPS_COMMAND_ID(ha, scb); in ips_get_bios_version()
2347 scb->cmd.flashfw.buffer_addr = ha->ioctl_busaddr; in ips_get_bios_version()
2351 ips_send_wait(ha, scb, ips_cmd_timeout, in ips_get_bios_version()
2369 ha->bios_version[0] = hex_asc_upper_hi(major); in ips_get_bios_version()
2370 ha->bios_version[1] = '.'; in ips_get_bios_version()
2371 ha->bios_version[2] = hex_asc_upper_lo(major); in ips_get_bios_version()
2372 ha->bios_version[3] = hex_asc_upper_lo(subminor); in ips_get_bios_version()
2373 ha->bios_version[4] = '.'; in ips_get_bios_version()
2374 ha->bios_version[5] = hex_asc_upper_hi(minor); in ips_get_bios_version()
2375 ha->bios_version[6] = hex_asc_upper_lo(minor); in ips_get_bios_version()
2376 ha->bios_version[7] = 0; in ips_get_bios_version()
2391 ips_hainit(ips_ha_t * ha) in ips_hainit() argument
2397 if (!ha) in ips_hainit()
2400 if (ha->func.statinit) in ips_hainit()
2401 (*ha->func.statinit) (ha); in ips_hainit()
2403 if (ha->func.enableint) in ips_hainit()
2404 (*ha->func.enableint) (ha); in ips_hainit()
2407 ha->reset_count = 1; in ips_hainit()
2408 ha->last_ffdc = ktime_get_real_seconds(); in ips_hainit()
2409 ips_ffdc_reset(ha, IPS_INTR_IORL); in ips_hainit()
2411 if (!ips_read_config(ha, IPS_INTR_IORL)) { in ips_hainit()
2412 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2418 if (!ips_read_adapter_status(ha, IPS_INTR_IORL)) { in ips_hainit()
2419 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2426 ips_identify_controller(ha); in ips_hainit()
2428 if (!ips_read_subsystem_parameters(ha, IPS_INTR_IORL)) { in ips_hainit()
2429 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2436 if (!ips_write_driver_status(ha, IPS_INTR_IORL)) { in ips_hainit()
2437 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2444 if ((ha->conf->ucLogDriveCount > 0) && (ha->requires_esl == 1)) in ips_hainit()
2445 ips_clear_adapter(ha, IPS_INTR_IORL); in ips_hainit()
2448 ha->ntargets = IPS_MAX_TARGETS + 1; in ips_hainit()
2449 ha->nlun = 1; in ips_hainit()
2450 ha->nbus = (ha->enq->ucMaxPhysicalDevices / IPS_MAX_TARGETS) + 1; in ips_hainit()
2452 switch (ha->conf->logical_drive[0].ucStripeSize) { in ips_hainit()
2454 ha->max_xfer = 0x10000; in ips_hainit()
2458 ha->max_xfer = 0x20000; in ips_hainit()
2462 ha->max_xfer = 0x40000; in ips_hainit()
2467 ha->max_xfer = 0x80000; in ips_hainit()
2472 if (le32_to_cpu(ha->subsys->param[4]) & 0x1) { in ips_hainit()
2474 ha->max_cmds = ha->enq->ucConcurrentCmdCount; in ips_hainit()
2477 switch (ha->conf->logical_drive[0].ucStripeSize) { in ips_hainit()
2479 ha->max_cmds = 32; in ips_hainit()
2483 ha->max_cmds = 16; in ips_hainit()
2487 ha->max_cmds = 8; in ips_hainit()
2492 ha->max_cmds = 4; in ips_hainit()
2498 if ((ha->ad_type == IPS_ADTYPE_SERVERAID3L) || in ips_hainit()
2499 (ha->ad_type == IPS_ADTYPE_SERVERAID4L) || in ips_hainit()
2500 (ha->ad_type == IPS_ADTYPE_SERVERAID4LX)) { in ips_hainit()
2501 if ((ha->max_cmds > MaxLiteCmds) && (MaxLiteCmds)) in ips_hainit()
2502 ha->max_cmds = MaxLiteCmds; in ips_hainit()
2506 ha->ha_id[0] = IPS_ADAPTER_ID; in ips_hainit()
2507 for (i = 1; i < ha->nbus; i++) { in ips_hainit()
2508 ha->ha_id[i] = ha->conf->init_id[i - 1] & 0x1f; in ips_hainit()
2509 ha->dcdb_active[i - 1] = 0; in ips_hainit()
2525 ips_next(ips_ha_t * ha, int intr) in ips_next() argument
2536 if (!ha) in ips_next()
2538 host = ips_sh[ha->host_num]; in ips_next()
2546 if ((ha->subsys->param[3] & 0x300000) in ips_next()
2547 && (ha->scb_activelist.count == 0)) { in ips_next()
2549 if (now - ha->last_ffdc > IPS_SECS_8HOURS) { in ips_next()
2550 ha->last_ffdc = now; in ips_next()
2551 ips_ffdc_time(ha); in ips_next()
2562 while ((ha->num_ioctl < IPS_MAX_IOCTL) && in ips_next()
2563 (ha->copp_waitlist.head) && (scb = ips_getscb(ha))) { in ips_next()
2565 item = ips_removeq_copp_head(&ha->copp_waitlist); in ips_next()
2566 ha->num_ioctl++; in ips_next()
2572 ret = ips_make_passthru(ha, scb->scsi_cmd, scb, intr); in ips_next()
2583 ips_freescb(ha, scb); in ips_next()
2591 ips_freescb(ha, scb); in ips_next()
2598 ha->num_ioctl--; in ips_next()
2602 ret = ips_send_cmd(ha, scb); in ips_next()
2605 ips_putq_scb_head(&ha->scb_activelist, scb); in ips_next()
2607 ha->num_ioctl--; in ips_next()
2615 ips_freescb(ha, scb); in ips_next()
2618 ips_freescb(ha, scb); in ips_next()
2630 p = ha->scb_waitlist.head; in ips_next()
2631 while ((p) && (scb = ips_getscb(ha))) { in ips_next()
2633 && (ha-> in ips_next()
2636 ips_freescb(ha, scb); in ips_next()
2642 SC = ips_removeq_wait(&ha->scb_waitlist, q); in ips_next()
2673 (ha, sg_dma_address(sg), scb, i, in ips_next()
2704 ret = ips_send_cmd(ha, scb); in ips_next()
2708 ips_putq_scb_head(&ha->scb_activelist, scb); in ips_next()
2717 ha->dcdb_active[scb->bus - 1] &= in ips_next()
2720 ips_freescb(ha, scb); in ips_next()
2727 ha->dcdb_active[scb->bus - 1] &= in ips_next()
2730 ips_freescb(ha, scb); in ips_next()
3087 ipsintr_blocking(ips_ha_t * ha, ips_scb_t * scb) in ipsintr_blocking() argument
3091 ips_freescb(ha, scb); in ipsintr_blocking()
3092 if (ha->waitflag && ha->cmd_in_progress == scb->cdb[0]) { in ipsintr_blocking()
3093 ha->waitflag = false; in ipsintr_blocking()
3109 ipsintr_done(ips_ha_t * ha, ips_scb_t * scb) in ipsintr_done() argument
3114 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ipsintr_done()
3122 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ipsintr_done()
3128 ips_done(ha, scb); in ipsintr_done()
3141 ips_done(ips_ha_t * ha, ips_scb_t * scb) in ips_done() argument
3151 ips_cleanup_passthru(ha, scb); in ips_done()
3152 ha->num_ioctl--; in ips_done()
3174 ips_fill_scb_sg_single(ha, in ips_done()
3182 (ha, in ips_done()
3201 ret = ips_send_cmd(ha, scb); in ips_done()
3210 ips_freescb(ha, scb); in ips_done()
3218 ips_freescb(ha, scb); in ips_done()
3229 ha->dcdb_active[scb->bus - 1] &= ~(1 << scb->target_id); in ips_done()
3234 ips_freescb(ha, scb); in ips_done()
3247 ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) in ips_map_status() argument
3260 ips_name, ha->host_num, in ips_map_status()
3386 ips_send_wait(ips_ha_t * ha, ips_scb_t * scb, int timeout, int intr) in ips_send_wait() argument
3393 ha->waitflag = true; in ips_send_wait()
3394 ha->cmd_in_progress = scb->cdb[0]; in ips_send_wait()
3397 ret = ips_send_cmd(ha, scb); in ips_send_wait()
3403 ret = ips_wait(ha, timeout, intr); in ips_send_wait()
3452 ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) in ips_send_cmd() argument
3470 if (ha->waitflag && ha->cmd_in_progress == scb->cdb[0]) in ips_send_cmd()
3471 ha->waitflag = false; in ips_send_cmd()
3536 scb->cmd.logical_info.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3540 scb->data_busaddr = ha->logical_drive_info_dma_addr; in ips_send_cmd()
3549 ips_reqsen(ha, scb); in ips_send_cmd()
3568 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3574 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3614 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3620 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3659 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3662 scb->data_len = sizeof (*ha->enq); in ips_send_cmd()
3663 scb->cmd.basic_io.sg_addr = ha->enq_busaddr; in ips_send_cmd()
3669 scb->cmd.logical_info.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3674 scb->data_busaddr = ha->logical_drive_info_dma_addr; in ips_send_cmd()
3717 if (ha->conf->dev[scb->bus - 1][scb->target_id].ucState == 0) { in ips_send_cmd()
3722 ha->dcdb_active[scb->bus - 1] |= (1 << scb->target_id); in ips_send_cmd()
3723 scb->cmd.dcdb.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3736 if (ha->subsys->param[4] & 0x00100000) { /* If NEW Tape DCDB is Supported */ in ips_send_cmd()
3743 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3782 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3820 return ((*ha->func.issue) (ha, scb)); in ips_send_cmd()
3833 ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) in ips_chkstatus() argument
3844 scb = &ha->scbs[pstatus->fields.command_id]; in ips_chkstatus()
3849 sp = &ha->sp; in ips_chkstatus()
3854 ips_removeq_scb(&ha->scb_activelist, scb); in ips_chkstatus()
3862 ha->host_num, in ips_chkstatus()
3881 ips_name, ha->host_num, in ips_chkstatus()
3899 if (!ips_online(ha, scb)) { in ips_chkstatus()
3905 if (ips_online(ha, scb)) { in ips_chkstatus()
3906 ips_inquiry(ha, scb); in ips_chkstatus()
3913 ips_reqsen(ha, scb); in ips_chkstatus()
3925 if (!ips_online(ha, scb) in ips_chkstatus()
3926 || !ips_msense(ha, scb)) { in ips_chkstatus()
3932 if (ips_online(ha, scb)) in ips_chkstatus()
3933 ips_rdcap(ha, scb); in ips_chkstatus()
3972 ips_name, ha->host_num, in ips_chkstatus()
3977 ips_map_status(ha, scb, sp); in ips_chkstatus()
3991 ips_online(ips_ha_t * ha, ips_scb_t * scb) in ips_online() argument
3999 memset(ha->logical_drive_info, 0, sizeof (IPS_LD_INFO)); in ips_online()
4003 if (ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4005 && ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4007 && ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4009 && ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4026 ips_inquiry(ips_ha_t * ha, ips_scb_t * scb) in ips_inquiry() argument
4061 ips_rdcap(ips_ha_t * ha, ips_scb_t * scb) in ips_rdcap() argument
4072 (ha->logical_drive_info-> in ips_rdcap()
4091 ips_msense(ips_ha_t * ha, ips_scb_t * scb) in ips_msense() argument
4100 if (le32_to_cpu(ha->enq->ulDriveSize[scb->target_id]) > 0x400000 && in ips_msense()
4101 (ha->enq->ucMiscFlag & 0x8) == 0) { in ips_msense()
4110 (le32_to_cpu(ha->enq->ulDriveSize[scb->target_id]) - in ips_msense()
4182 ips_reqsen(ips_ha_t * ha, ips_scb_t * scb) in ips_reqsen() argument
4211 ips_free(ips_ha_t * ha) in ips_free() argument
4216 if (ha) { in ips_free()
4217 if (ha->enq) { in ips_free()
4218 dma_free_coherent(&ha->pcidev->dev, sizeof(IPS_ENQ), in ips_free()
4219 ha->enq, ha->enq_busaddr); in ips_free()
4220 ha->enq = NULL; in ips_free()
4223 kfree(ha->conf); in ips_free()
4224 ha->conf = NULL; in ips_free()
4226 if (ha->adapt) { in ips_free()
4227 dma_free_coherent(&ha->pcidev->dev, in ips_free()
4229 sizeof (IPS_IO_CMD), ha->adapt, in ips_free()
4230 ha->adapt->hw_status_start); in ips_free()
4231 ha->adapt = NULL; in ips_free()
4234 if (ha->logical_drive_info) { in ips_free()
4235 dma_free_coherent(&ha->pcidev->dev, in ips_free()
4237 ha->logical_drive_info, in ips_free()
4238 ha->logical_drive_info_dma_addr); in ips_free()
4239 ha->logical_drive_info = NULL; in ips_free()
4242 kfree(ha->nvram); in ips_free()
4243 ha->nvram = NULL; in ips_free()
4245 kfree(ha->subsys); in ips_free()
4246 ha->subsys = NULL; in ips_free()
4248 if (ha->ioctl_data) { in ips_free()
4249 dma_free_coherent(&ha->pcidev->dev, ha->ioctl_len, in ips_free()
4250 ha->ioctl_data, ha->ioctl_busaddr); in ips_free()
4251 ha->ioctl_data = NULL; in ips_free()
4252 ha->ioctl_datasize = 0; in ips_free()
4253 ha->ioctl_len = 0; in ips_free()
4255 ips_deallocatescbs(ha, ha->max_cmds); in ips_free()
4258 if (ha->mem_ptr) { in ips_free()
4259 iounmap(ha->ioremap_ptr); in ips_free()
4260 ha->ioremap_ptr = NULL; in ips_free()
4261 ha->mem_ptr = NULL; in ips_free()
4264 ha->mem_addr = 0; in ips_free()
4279 ips_deallocatescbs(ips_ha_t * ha, int cmds) in ips_deallocatescbs() argument
4281 if (ha->scbs) { in ips_deallocatescbs()
4282 dma_free_coherent(&ha->pcidev->dev, in ips_deallocatescbs()
4283 IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * cmds, in ips_deallocatescbs()
4284 ha->scbs->sg_list.list, in ips_deallocatescbs()
4285 ha->scbs->sg_busaddr); in ips_deallocatescbs()
4286 dma_free_coherent(&ha->pcidev->dev, sizeof (ips_scb_t) * cmds, in ips_deallocatescbs()
4287 ha->scbs, ha->scbs->scb_busaddr); in ips_deallocatescbs()
4288 ha->scbs = NULL; in ips_deallocatescbs()
4303 ips_allocatescbs(ips_ha_t * ha) in ips_allocatescbs() argument
4313 ha->scbs = dma_alloc_coherent(&ha->pcidev->dev, in ips_allocatescbs()
4314 ha->max_cmds * sizeof (ips_scb_t), in ips_allocatescbs()
4316 if (ha->scbs == NULL) in ips_allocatescbs()
4318 ips_sg.list = dma_alloc_coherent(&ha->pcidev->dev, in ips_allocatescbs()
4319 IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * ha->max_cmds, in ips_allocatescbs()
4322 dma_free_coherent(&ha->pcidev->dev, in ips_allocatescbs()
4323 ha->max_cmds * sizeof (ips_scb_t), ha->scbs, in ips_allocatescbs()
4328 memset(ha->scbs, 0, ha->max_cmds * sizeof (ips_scb_t)); in ips_allocatescbs()
4330 for (i = 0; i < ha->max_cmds; i++) { in ips_allocatescbs()
4331 scb_p = &ha->scbs[i]; in ips_allocatescbs()
4334 if (IPS_USE_ENH_SGLIST(ha)) { in ips_allocatescbs()
4338 sg_dma + IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * i; in ips_allocatescbs()
4343 sg_dma + IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * i; in ips_allocatescbs()
4347 if (i < ha->max_cmds - 1) { in ips_allocatescbs()
4348 scb_p->q_next = ha->scb_freelist; in ips_allocatescbs()
4349 ha->scb_freelist = scb_p; in ips_allocatescbs()
4367 ips_init_scb(ips_ha_t * ha, ips_scb_t * scb) in ips_init_scb() argument
4381 memset(ha->dummy, 0, sizeof (IPS_IO_CMD)); in ips_init_scb()
4384 ha->dummy->op_code = 0xFF; in ips_init_scb()
4385 ha->dummy->ccsar = cpu_to_le32(ha->adapt->hw_status_start in ips_init_scb()
4387 ha->dummy->command_id = IPS_MAX_CMDS; in ips_init_scb()
4396 scb->cmd.basic_io.ccsar = cpu_to_le32(ha->adapt->hw_status_start in ips_init_scb()
4412 ips_getscb(ips_ha_t * ha) in ips_getscb() argument
4418 if ((scb = ha->scb_freelist) == NULL) { in ips_getscb()
4423 ha->scb_freelist = scb->q_next; in ips_getscb()
4427 ips_init_scb(ha, scb); in ips_getscb()
4444 ips_freescb(ips_ha_t * ha, ips_scb_t * scb) in ips_freescb() argument
4451 dma_unmap_single(&ha->pcidev->dev, scb->data_busaddr, in ips_freescb()
4455 if (IPS_COMMAND_ID(ha, scb) < (ha->max_cmds - 1)) { in ips_freescb()
4456 scb->q_next = ha->scb_freelist; in ips_freescb()
4457 ha->scb_freelist = scb; in ips_freescb()
4471 ips_isinit_copperhead(ips_ha_t * ha) in ips_isinit_copperhead() argument
4478 isr = inb(ha->io_addr + IPS_REG_HISR); in ips_isinit_copperhead()
4479 scpr = inb(ha->io_addr + IPS_REG_SCPR); in ips_isinit_copperhead()
4497 ips_isinit_copperhead_memio(ips_ha_t * ha) in ips_isinit_copperhead_memio() argument
4504 isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_isinit_copperhead_memio()
4505 scpr = readb(ha->mem_ptr + IPS_REG_SCPR); in ips_isinit_copperhead_memio()
4523 ips_isinit_morpheus(ips_ha_t * ha) in ips_isinit_morpheus() argument
4530 if (ips_isintr_morpheus(ha)) in ips_isinit_morpheus()
4531 ips_flush_and_reset(ha); in ips_isinit_morpheus()
4533 post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_isinit_morpheus()
4534 bits = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_isinit_morpheus()
4555 ips_flush_and_reset(ips_ha_t *ha) in ips_flush_and_reset() argument
4564 scb = dma_alloc_coherent(&ha->pcidev->dev, sizeof(ips_scb_t), in ips_flush_and_reset()
4568 ips_init_scb(ha, scb); in ips_flush_and_reset()
4582 ret = ips_send_cmd(ha, scb); /* Send the Flush Command */ in ips_flush_and_reset()
4589 done = ips_poll_for_flush_complete(ha); in ips_flush_and_reset()
4598 (*ha->func.reset) (ha); in ips_flush_and_reset()
4600 dma_free_coherent(&ha->pcidev->dev, sizeof(ips_scb_t), scb, command_dma); in ips_flush_and_reset()
4615 ips_poll_for_flush_complete(ips_ha_t * ha) in ips_poll_for_flush_complete() argument
4620 cstatus.value = (*ha->func.statupd) (ha); in ips_poll_for_flush_complete()
4642 ips_enable_int_copperhead(ips_ha_t * ha) in ips_enable_int_copperhead() argument
4646 outb(ha->io_addr + IPS_REG_HISR, IPS_BIT_EI); in ips_enable_int_copperhead()
4647 inb(ha->io_addr + IPS_REG_HISR); /*Ensure PCI Posting Completes*/ in ips_enable_int_copperhead()
4659 ips_enable_int_copperhead_memio(ips_ha_t * ha) in ips_enable_int_copperhead_memio() argument
4663 writeb(IPS_BIT_EI, ha->mem_ptr + IPS_REG_HISR); in ips_enable_int_copperhead_memio()
4664 readb(ha->mem_ptr + IPS_REG_HISR); /*Ensure PCI Posting Completes*/ in ips_enable_int_copperhead_memio()
4676 ips_enable_int_morpheus(ips_ha_t * ha) in ips_enable_int_morpheus() argument
4682 Oimr = readl(ha->mem_ptr + IPS_REG_I960_OIMR); in ips_enable_int_morpheus()
4684 writel(Oimr, ha->mem_ptr + IPS_REG_I960_OIMR); in ips_enable_int_morpheus()
4685 readl(ha->mem_ptr + IPS_REG_I960_OIMR); /*Ensure PCI Posting Completes*/ in ips_enable_int_morpheus()
4698 ips_init_copperhead(ips_ha_t * ha) in ips_init_copperhead() argument
4709 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4721 PostByte[i] = inb(ha->io_addr + IPS_REG_ISPR); in ips_init_copperhead()
4722 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4726 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_copperhead()
4735 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4747 inb(ha->io_addr + IPS_REG_ISPR); in ips_init_copperhead()
4748 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4752 Cbsp = inb(ha->io_addr + IPS_REG_CBSP); in ips_init_copperhead()
4766 outl(0x1010, ha->io_addr + IPS_REG_CCCR); in ips_init_copperhead()
4769 outb(IPS_BIT_EBM, ha->io_addr + IPS_REG_SCPR); in ips_init_copperhead()
4771 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_init_copperhead()
4773 outl(0, ha->io_addr + IPS_REG_NDAE); in ips_init_copperhead()
4776 outb(IPS_BIT_EI, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4791 ips_init_copperhead_memio(ips_ha_t * ha) in ips_init_copperhead_memio() argument
4802 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4814 PostByte[i] = readb(ha->mem_ptr + IPS_REG_ISPR); in ips_init_copperhead_memio()
4815 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4819 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_copperhead_memio()
4828 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4840 readb(ha->mem_ptr + IPS_REG_ISPR); in ips_init_copperhead_memio()
4841 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4845 Cbsp = readb(ha->mem_ptr + IPS_REG_CBSP); in ips_init_copperhead_memio()
4859 writel(0x1010, ha->mem_ptr + IPS_REG_CCCR); in ips_init_copperhead_memio()
4862 writeb(IPS_BIT_EBM, ha->mem_ptr + IPS_REG_SCPR); in ips_init_copperhead_memio()
4864 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_init_copperhead_memio()
4866 writel(0, ha->mem_ptr + IPS_REG_NDAE); in ips_init_copperhead_memio()
4869 writeb(IPS_BIT_EI, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4885 ips_init_morpheus(ips_ha_t * ha) in ips_init_morpheus() argument
4897 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4908 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4914 Post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_init_morpheus()
4917 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4922 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4925 Post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_init_morpheus()
4933 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4942 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4945 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4953 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4964 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4970 Config = readl(ha->mem_ptr + IPS_REG_I960_MSG1); in ips_init_morpheus()
4974 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4977 Oimr = readl(ha->mem_ptr + IPS_REG_I960_OIMR); in ips_init_morpheus()
4979 writel(Oimr, ha->mem_ptr + IPS_REG_I960_OIMR); in ips_init_morpheus()
4986 ha->requires_esl = 1; in ips_init_morpheus()
5002 ips_reset_copperhead(ips_ha_t * ha) in ips_reset_copperhead() argument
5009 ips_name, ha->host_num, ha->io_addr, ha->pcidev->irq); in ips_reset_copperhead()
5016 outb(IPS_BIT_RST, ha->io_addr + IPS_REG_SCPR); in ips_reset_copperhead()
5021 outb(0, ha->io_addr + IPS_REG_SCPR); in ips_reset_copperhead()
5026 if ((*ha->func.init) (ha)) in ips_reset_copperhead()
5047 ips_reset_copperhead_memio(ips_ha_t * ha) in ips_reset_copperhead_memio() argument
5054 ips_name, ha->host_num, ha->mem_addr, ha->pcidev->irq); in ips_reset_copperhead_memio()
5061 writeb(IPS_BIT_RST, ha->mem_ptr + IPS_REG_SCPR); in ips_reset_copperhead_memio()
5066 writeb(0, ha->mem_ptr + IPS_REG_SCPR); in ips_reset_copperhead_memio()
5071 if ((*ha->func.init) (ha)) in ips_reset_copperhead_memio()
5092 ips_reset_morpheus(ips_ha_t * ha) in ips_reset_morpheus() argument
5100 ips_name, ha->host_num, ha->mem_addr, ha->pcidev->irq); in ips_reset_morpheus()
5107 writel(0x80000000, ha->mem_ptr + IPS_REG_I960_IDR); in ips_reset_morpheus()
5113 pci_read_config_byte(ha->pcidev, 4, &junk); in ips_reset_morpheus()
5115 if ((*ha->func.init) (ha)) in ips_reset_morpheus()
5136 ips_statinit(ips_ha_t * ha) in ips_statinit() argument
5142 ha->adapt->p_status_start = ha->adapt->status; in ips_statinit()
5143 ha->adapt->p_status_end = ha->adapt->status + IPS_MAX_CMDS; in ips_statinit()
5144 ha->adapt->p_status_tail = ha->adapt->status; in ips_statinit()
5146 phys_status_start = ha->adapt->hw_status_start; in ips_statinit()
5147 outl(phys_status_start, ha->io_addr + IPS_REG_SQSR); in ips_statinit()
5149 ha->io_addr + IPS_REG_SQER); in ips_statinit()
5151 ha->io_addr + IPS_REG_SQHR); in ips_statinit()
5152 outl(phys_status_start, ha->io_addr + IPS_REG_SQTR); in ips_statinit()
5154 ha->adapt->hw_status_tail = phys_status_start; in ips_statinit()
5167 ips_statinit_memio(ips_ha_t * ha) in ips_statinit_memio() argument
5173 ha->adapt->p_status_start = ha->adapt->status; in ips_statinit_memio()
5174 ha->adapt->p_status_end = ha->adapt->status + IPS_MAX_CMDS; in ips_statinit_memio()
5175 ha->adapt->p_status_tail = ha->adapt->status; in ips_statinit_memio()
5177 phys_status_start = ha->adapt->hw_status_start; in ips_statinit_memio()
5178 writel(phys_status_start, ha->mem_ptr + IPS_REG_SQSR); in ips_statinit_memio()
5180 ha->mem_ptr + IPS_REG_SQER); in ips_statinit_memio()
5181 writel(phys_status_start + IPS_STATUS_SIZE, ha->mem_ptr + IPS_REG_SQHR); in ips_statinit_memio()
5182 writel(phys_status_start, ha->mem_ptr + IPS_REG_SQTR); in ips_statinit_memio()
5184 ha->adapt->hw_status_tail = phys_status_start; in ips_statinit_memio()
5197 ips_statupd_copperhead(ips_ha_t * ha) in ips_statupd_copperhead() argument
5201 if (ha->adapt->p_status_tail != ha->adapt->p_status_end) { in ips_statupd_copperhead()
5202 ha->adapt->p_status_tail++; in ips_statupd_copperhead()
5203 ha->adapt->hw_status_tail += sizeof (IPS_STATUS); in ips_statupd_copperhead()
5205 ha->adapt->p_status_tail = ha->adapt->p_status_start; in ips_statupd_copperhead()
5206 ha->adapt->hw_status_tail = ha->adapt->hw_status_start; in ips_statupd_copperhead()
5209 outl(ha->adapt->hw_status_tail, in ips_statupd_copperhead()
5210 ha->io_addr + IPS_REG_SQTR); in ips_statupd_copperhead()
5212 return (ha->adapt->p_status_tail->value); in ips_statupd_copperhead()
5225 ips_statupd_copperhead_memio(ips_ha_t * ha) in ips_statupd_copperhead_memio() argument
5229 if (ha->adapt->p_status_tail != ha->adapt->p_status_end) { in ips_statupd_copperhead_memio()
5230 ha->adapt->p_status_tail++; in ips_statupd_copperhead_memio()
5231 ha->adapt->hw_status_tail += sizeof (IPS_STATUS); in ips_statupd_copperhead_memio()
5233 ha->adapt->p_status_tail = ha->adapt->p_status_start; in ips_statupd_copperhead_memio()
5234 ha->adapt->hw_status_tail = ha->adapt->hw_status_start; in ips_statupd_copperhead_memio()
5237 writel(ha->adapt->hw_status_tail, ha->mem_ptr + IPS_REG_SQTR); in ips_statupd_copperhead_memio()
5239 return (ha->adapt->p_status_tail->value); in ips_statupd_copperhead_memio()
5252 ips_statupd_morpheus(ips_ha_t * ha) in ips_statupd_morpheus() argument
5258 val = readl(ha->mem_ptr + IPS_REG_I2O_OUTMSGQ); in ips_statupd_morpheus()
5273 ips_issue_copperhead(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_copperhead() argument
5283 ha->host_num, in ips_issue_copperhead()
5289 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_copperhead()
5295 le32_to_cpu(inl(ha->io_addr + IPS_REG_CCCR))) & IPS_BIT_SEM) { in ips_issue_copperhead()
5302 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead()
5304 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead()
5311 outl(scb->scb_busaddr, ha->io_addr + IPS_REG_CCSAR); in ips_issue_copperhead()
5312 outw(IPS_BIT_START_CMD, ha->io_addr + IPS_REG_CCCR); in ips_issue_copperhead()
5327 ips_issue_copperhead_memio(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_copperhead_memio() argument
5337 ha->host_num, in ips_issue_copperhead_memio()
5343 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_copperhead_memio()
5348 while ((val = readl(ha->mem_ptr + IPS_REG_CCCR)) & IPS_BIT_SEM) { in ips_issue_copperhead_memio()
5355 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead_memio()
5357 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead_memio()
5364 writel(scb->scb_busaddr, ha->mem_ptr + IPS_REG_CCSAR); in ips_issue_copperhead_memio()
5365 writel(IPS_BIT_START_CMD, ha->mem_ptr + IPS_REG_CCCR); in ips_issue_copperhead_memio()
5380 ips_issue_i2o(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_i2o() argument
5388 ha->host_num, in ips_issue_i2o()
5394 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_i2o()
5397 outl(scb->scb_busaddr, ha->io_addr + IPS_REG_I2O_INMSGQ); in ips_issue_i2o()
5412 ips_issue_i2o_memio(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_i2o_memio() argument
5420 ha->host_num, in ips_issue_i2o_memio()
5426 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_i2o_memio()
5429 writel(scb->scb_busaddr, ha->mem_ptr + IPS_REG_I2O_INMSGQ); in ips_issue_i2o_memio()
5444 ips_isintr_copperhead(ips_ha_t * ha) in ips_isintr_copperhead() argument
5450 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_isintr_copperhead()
5461 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_isintr_copperhead()
5477 ips_isintr_copperhead_memio(ips_ha_t * ha) in ips_isintr_copperhead_memio() argument
5483 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_isintr_copperhead_memio()
5494 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_isintr_copperhead_memio()
5510 ips_isintr_morpheus(ips_ha_t * ha) in ips_isintr_morpheus() argument
5516 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_isintr_morpheus()
5534 ips_wait(ips_ha_t * ha, int time, int intr) in ips_wait() argument
5548 if (!ha->waitflag) { in ips_wait()
5554 if (!ha->waitflag) { in ips_wait()
5571 (*ha->func.intr) (ha); in ips_wait()
5592 ips_write_driver_status(ips_ha_t * ha, int intr) in ips_write_driver_status() argument
5596 if (!ips_readwrite_page5(ha, false, intr)) { in ips_write_driver_status()
5597 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_write_driver_status()
5605 if (le32_to_cpu(ha->nvram->signature) != IPS_NVRAM_P5_SIG) { in ips_write_driver_status()
5608 ips_name, ha->host_num, ha->nvram->signature); in ips_write_driver_status()
5609 ha->nvram->signature = IPS_NVRAM_P5_SIG; in ips_write_driver_status()
5614 ips_name, ha->host_num, le16_to_cpu(ha->nvram->adapter_type), in ips_write_driver_status()
5615 ha->nvram->adapter_slot, ha->nvram->bios_high[0], in ips_write_driver_status()
5616 ha->nvram->bios_high[1], ha->nvram->bios_high[2], in ips_write_driver_status()
5617 ha->nvram->bios_high[3], ha->nvram->bios_low[0], in ips_write_driver_status()
5618 ha->nvram->bios_low[1], ha->nvram->bios_low[2], in ips_write_driver_status()
5619 ha->nvram->bios_low[3]); in ips_write_driver_status()
5621 ips_get_bios_version(ha, intr); in ips_write_driver_status()
5624 ha->nvram->operating_system = IPS_OS_LINUX; in ips_write_driver_status()
5625 ha->nvram->adapter_type = ha->ad_type; in ips_write_driver_status()
5626 memcpy((char *) ha->nvram->driver_high, IPS_VERSION_HIGH, 4); in ips_write_driver_status()
5627 memcpy((char *) ha->nvram->driver_low, IPS_VERSION_LOW, 4); in ips_write_driver_status()
5628 memcpy((char *) ha->nvram->bios_high, ha->bios_version, 4); in ips_write_driver_status()
5629 memcpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4); in ips_write_driver_status()
5631 ha->nvram->versioning = 0; /* Indicate the Driver Does Not Support Versioning */ in ips_write_driver_status()
5634 if (!ips_readwrite_page5(ha, true, intr)) { in ips_write_driver_status()
5635 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_write_driver_status()
5642 ha->slot_num = ha->nvram->adapter_slot; in ips_write_driver_status()
5657 ips_read_adapter_status(ips_ha_t * ha, int intr) in ips_read_adapter_status() argument
5664 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_adapter_status()
5666 ips_init_scb(ha, scb); in ips_read_adapter_status()
5672 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_adapter_status()
5677 scb->data_len = sizeof (*ha->enq); in ips_read_adapter_status()
5678 scb->cmd.basic_io.sg_addr = ha->enq_busaddr; in ips_read_adapter_status()
5682 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_adapter_status()
5700 ips_read_subsystem_parameters(ips_ha_t * ha, int intr) in ips_read_subsystem_parameters() argument
5707 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_subsystem_parameters()
5709 ips_init_scb(ha, scb); in ips_read_subsystem_parameters()
5715 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_subsystem_parameters()
5720 scb->data_len = sizeof (*ha->subsys); in ips_read_subsystem_parameters()
5721 scb->cmd.basic_io.sg_addr = ha->ioctl_busaddr; in ips_read_subsystem_parameters()
5725 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_subsystem_parameters()
5730 memcpy(ha->subsys, ha->ioctl_data, sizeof(*ha->subsys)); in ips_read_subsystem_parameters()
5744 ips_read_config(ips_ha_t * ha, int intr) in ips_read_config() argument
5754 ha->conf->init_id[i] = 7; in ips_read_config()
5756 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_config()
5758 ips_init_scb(ha, scb); in ips_read_config()
5764 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_config()
5765 scb->data_len = sizeof (*ha->conf); in ips_read_config()
5766 scb->cmd.basic_io.sg_addr = ha->ioctl_busaddr; in ips_read_config()
5770 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_config()
5774 memset(ha->conf, 0, sizeof (IPS_CONF)); in ips_read_config()
5778 ha->conf->init_id[i] = 7; in ips_read_config()
5788 memcpy(ha->conf, ha->ioctl_data, sizeof(*ha->conf)); in ips_read_config()
5802 ips_readwrite_page5(ips_ha_t * ha, int write, int intr) in ips_readwrite_page5() argument
5809 scb = &ha->scbs[ha->max_cmds - 1]; in ips_readwrite_page5()
5811 ips_init_scb(ha, scb); in ips_readwrite_page5()
5817 scb->cmd.nvram.command_id = IPS_COMMAND_ID(ha, scb); in ips_readwrite_page5()
5822 scb->data_len = sizeof (*ha->nvram); in ips_readwrite_page5()
5823 scb->cmd.nvram.buffer_addr = ha->ioctl_busaddr; in ips_readwrite_page5()
5825 memcpy(ha->ioctl_data, ha->nvram, sizeof(*ha->nvram)); in ips_readwrite_page5()
5829 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_readwrite_page5()
5833 memset(ha->nvram, 0, sizeof (IPS_NVRAM_P5)); in ips_readwrite_page5()
5838 memcpy(ha->nvram, ha->ioctl_data, sizeof(*ha->nvram)); in ips_readwrite_page5()
5852 ips_clear_adapter(ips_ha_t * ha, int intr) in ips_clear_adapter() argument
5859 scb = &ha->scbs[ha->max_cmds - 1]; in ips_clear_adapter()
5861 ips_init_scb(ha, scb); in ips_clear_adapter()
5867 scb->cmd.config_sync.command_id = IPS_COMMAND_ID(ha, scb); in ips_clear_adapter()
5876 ips_send_wait(ha, scb, ips_reset_timeout, intr)) == IPS_FAILURE) in ips_clear_adapter()
5882 ips_init_scb(ha, scb); in ips_clear_adapter()
5888 scb->cmd.unlock_stripe.command_id = IPS_COMMAND_ID(ha, scb); in ips_clear_adapter()
5897 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_clear_adapter()
5915 ips_ffdc_reset(ips_ha_t * ha, int intr) in ips_ffdc_reset() argument
5921 scb = &ha->scbs[ha->max_cmds - 1]; in ips_ffdc_reset()
5923 ips_init_scb(ha, scb); in ips_ffdc_reset()
5928 scb->cmd.ffdc.command_id = IPS_COMMAND_ID(ha, scb); in ips_ffdc_reset()
5929 scb->cmd.ffdc.reset_count = ha->reset_count; in ips_ffdc_reset()
5933 ips_fix_ffdc_time(ha, scb, ha->last_ffdc); in ips_ffdc_reset()
5936 ips_send_wait(ha, scb, ips_cmd_timeout, intr); in ips_ffdc_reset()
5949 ips_ffdc_time(ips_ha_t * ha) in ips_ffdc_time() argument
5955 DEBUG_VAR(1, "(%s%d) Sending time update.", ips_name, ha->host_num); in ips_ffdc_time()
5957 scb = &ha->scbs[ha->max_cmds - 1]; in ips_ffdc_time()
5959 ips_init_scb(ha, scb); in ips_ffdc_time()
5964 scb->cmd.ffdc.command_id = IPS_COMMAND_ID(ha, scb); in ips_ffdc_time()
5969 ips_fix_ffdc_time(ha, scb, ha->last_ffdc); in ips_ffdc_time()
5972 ips_send_wait(ha, scb, ips_cmd_timeout, IPS_FFDC); in ips_ffdc_time()
5984 ips_fix_ffdc_time(ips_ha_t * ha, ips_scb_t * scb, time64_t current_time) in ips_fix_ffdc_time() argument
6014 ips_erase_bios(ips_ha_t * ha) in ips_erase_bios() argument
6024 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6025 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6028 outb(0x50, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6029 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6033 outb(0x20, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6034 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6038 outb(0xD0, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6039 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6043 outb(0x70, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6044 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6050 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios()
6051 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6055 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6069 outb(0xB0, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6070 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6076 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios()
6077 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6081 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6105 outb(0x50, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6106 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6110 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6111 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6126 ips_erase_bios_memio(ips_ha_t * ha) in ips_erase_bios_memio() argument
6136 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6137 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6140 writeb(0x50, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6141 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6145 writeb(0x20, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6146 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6150 writeb(0xD0, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6151 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6155 writeb(0x70, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6156 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6162 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios_memio()
6163 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6167 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6181 writeb(0xB0, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6182 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6188 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios_memio()
6189 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6193 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6217 writeb(0x50, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6218 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6222 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6223 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6238 ips_program_bios(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_program_bios() argument
6251 outl(i + offset, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6252 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6255 outb(0x40, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6256 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6259 outb(buffer[i], ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6260 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6266 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_program_bios()
6267 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6271 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6282 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6283 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6286 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6287 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6296 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6297 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6300 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6301 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6309 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6310 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6313 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6314 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6329 ips_program_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_program_bios_memio() argument
6342 writel(i + offset, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6343 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6346 writeb(0x40, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6347 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6350 writeb(buffer[i], ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6351 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6357 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_program_bios_memio()
6358 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6362 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6373 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6374 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6377 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6378 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6387 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6388 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6391 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6392 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6400 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6401 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6404 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6405 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6420 ips_verify_bios(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_verify_bios() argument
6429 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6430 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6433 if (inb(ha->io_addr + IPS_REG_FLDP) != 0x55) in ips_verify_bios()
6436 outl(1, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6437 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6439 if (inb(ha->io_addr + IPS_REG_FLDP) != 0xAA) in ips_verify_bios()
6445 outl(i + offset, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6446 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6449 checksum = (uint8_t) checksum + inb(ha->io_addr + IPS_REG_FLDP); in ips_verify_bios()
6469 ips_verify_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_verify_bios_memio() argument
6478 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6479 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6482 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0x55) in ips_verify_bios_memio()
6485 writel(1, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6486 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6488 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0xAA) in ips_verify_bios_memio()
6494 writel(i + offset, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6495 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6499 (uint8_t) checksum + readb(ha->mem_ptr + IPS_REG_FLDP); in ips_verify_bios_memio()
6518 ips_abort_init(ips_ha_t * ha, int index) in ips_abort_init() argument
6520 ha->active = 0; in ips_abort_init()
6521 ips_free(ha); in ips_abort_init()
6657 ips_ha_t *ha, *oldha = ips_ha[index]; in ips_register_scsi() local
6664 ha = IPS_HA(sh); in ips_register_scsi()
6665 memcpy(ha, oldha, sizeof (ips_ha_t)); in ips_register_scsi()
6668 if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { in ips_register_scsi()
6669 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_register_scsi()
6677 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
6894 ha = kzalloc(sizeof (ips_ha_t), GFP_KERNEL); in ips_init_phase1()
6895 if (ha == NULL) { in ips_init_phase1()
6902 ips_ha[index] = ha; in ips_init_phase1()
6903 ha->active = 1; in ips_init_phase1()
6906 ha->io_addr = io_addr; in ips_init_phase1()
6907 ha->io_len = io_len; in ips_init_phase1()
6908 ha->mem_addr = mem_addr; in ips_init_phase1()
6909 ha->mem_len = mem_len; in ips_init_phase1()
6910 ha->mem_ptr = mem_ptr; in ips_init_phase1()
6911 ha->ioremap_ptr = ioremap_ptr; in ips_init_phase1()
6912 ha->host_num = (uint32_t) index; in ips_init_phase1()
6913 ha->slot_num = PCI_SLOT(pci_dev->devfn); in ips_init_phase1()
6914 ha->pcidev = pci_dev; in ips_init_phase1()
6922 if (sizeof(dma_addr_t) > 4 && IPS_HAS_ENH_SGLIST(ha) && in ips_init_phase1()
6923 !dma_set_mask(&ha->pcidev->dev, DMA_BIT_MASK(64))) { in ips_init_phase1()
6924 (ha)->flags |= IPS_HA_ENH_SG; in ips_init_phase1()
6926 if (dma_set_mask(&ha->pcidev->dev, DMA_BIT_MASK(32)) != 0) { in ips_init_phase1()
6928 return ips_abort_init(ha, index); in ips_init_phase1()
6936 ha->enq = dma_alloc_coherent(&pci_dev->dev, sizeof (IPS_ENQ), in ips_init_phase1()
6937 &ha->enq_busaddr, GFP_KERNEL); in ips_init_phase1()
6938 if (!ha->enq) { in ips_init_phase1()
6941 return ips_abort_init(ha, index); in ips_init_phase1()
6944 ha->adapt = dma_alloc_coherent(&pci_dev->dev, in ips_init_phase1()
6947 if (!ha->adapt) { in ips_init_phase1()
6950 return ips_abort_init(ha, index); in ips_init_phase1()
6952 ha->adapt->hw_status_start = dma_address; in ips_init_phase1()
6953 ha->dummy = (void *) (ha->adapt + 1); in ips_init_phase1()
6957 ha->logical_drive_info = dma_alloc_coherent(&pci_dev->dev, in ips_init_phase1()
6959 if (!ha->logical_drive_info) { in ips_init_phase1()
6962 return ips_abort_init(ha, index); in ips_init_phase1()
6964 ha->logical_drive_info_dma_addr = dma_address; in ips_init_phase1()
6967 ha->conf = kmalloc(sizeof (IPS_CONF), GFP_KERNEL); in ips_init_phase1()
6969 if (!ha->conf) { in ips_init_phase1()
6972 return ips_abort_init(ha, index); in ips_init_phase1()
6975 ha->nvram = kmalloc(sizeof (IPS_NVRAM_P5), GFP_KERNEL); in ips_init_phase1()
6977 if (!ha->nvram) { in ips_init_phase1()
6980 return ips_abort_init(ha, index); in ips_init_phase1()
6983 ha->subsys = kmalloc(sizeof (IPS_SUBSYS), GFP_KERNEL); in ips_init_phase1()
6985 if (!ha->subsys) { in ips_init_phase1()
6988 return ips_abort_init(ha, index); in ips_init_phase1()
6996 ha->ioctl_data = dma_alloc_coherent(&pci_dev->dev, ips_ioctlsize, in ips_init_phase1()
6997 &ha->ioctl_busaddr, GFP_KERNEL); in ips_init_phase1()
6998 ha->ioctl_len = ips_ioctlsize; in ips_init_phase1()
6999 if (!ha->ioctl_data) { in ips_init_phase1()
7002 return ips_abort_init(ha, index); in ips_init_phase1()
7008 ips_setup_funclist(ha); in ips_init_phase1()
7010 if ((IPS_IS_MORPHEUS(ha)) || (IPS_IS_MARCO(ha))) { in ips_init_phase1()
7012 IsDead = readl(ha->mem_ptr + IPS_REG_I960_MSG1); in ips_init_phase1()
7014 ips_reset_morpheus(ha); in ips_init_phase1()
7022 if (!(*ha->func.isinit) (ha)) { in ips_init_phase1()
7023 if (!(*ha->func.init) (ha)) { in ips_init_phase1()
7029 return ips_abort_init(ha, index); in ips_init_phase1()
7049 ips_ha_t *ha; in ips_init_phase2() local
7051 ha = ips_ha[index]; in ips_init_phase2()
7054 if (!ha->active) { in ips_init_phase2()
7060 if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { in ips_init_phase2()
7061 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7063 return ips_abort_init(ha, index); in ips_init_phase2()
7069 ha->max_cmds = 1; in ips_init_phase2()
7070 if (!ips_allocatescbs(ha)) { in ips_init_phase2()
7071 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7073 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7074 return ips_abort_init(ha, index); in ips_init_phase2()
7077 if (!ips_hainit(ha)) { in ips_init_phase2()
7078 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7080 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7081 return ips_abort_init(ha, index); in ips_init_phase2()
7084 ips_deallocatescbs(ha, 1); in ips_init_phase2()
7087 if (!ips_allocatescbs(ha)) { in ips_init_phase2()
7088 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7090 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7091 return ips_abort_init(ha, index); in ips_init_phase2()