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()
1527 ips_alloc_passthru_buffer(ips_ha_t * ha, int length) in ips_alloc_passthru_buffer() argument
1532 if (ha->ioctl_data && length <= ha->ioctl_len) in ips_alloc_passthru_buffer()
1535 bigger_buf = dma_alloc_coherent(&ha->pcidev->dev, length, &dma_busaddr, in ips_alloc_passthru_buffer()
1539 dma_free_coherent(&ha->pcidev->dev, ha->ioctl_len, in ips_alloc_passthru_buffer()
1540 ha->ioctl_data, ha->ioctl_busaddr); in ips_alloc_passthru_buffer()
1542 ha->ioctl_data = (char *) bigger_buf; in ips_alloc_passthru_buffer()
1543 ha->ioctl_len = length; in ips_alloc_passthru_buffer()
1544 ha->ioctl_busaddr = dma_busaddr; in ips_alloc_passthru_buffer()
1561 ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr) in ips_make_passthru() argument
1576 ips_name, ha->host_num); in ips_make_passthru()
1579 if (ips_alloc_passthru_buffer(ha, length)) { in ips_make_passthru()
1582 if (ha->ioctl_data) { in ips_make_passthru()
1583 pt = (ips_passthru_t *) ha->ioctl_data; in ips_make_passthru()
1591 ha->ioctl_datasize = length; in ips_make_passthru()
1593 ips_scmd_buf_read(SC, ha->ioctl_data, ha->ioctl_datasize); in ips_make_passthru()
1594 pt = (ips_passthru_t *) ha->ioctl_data; in ips_make_passthru()
1608 memcpy(ha->ioctl_data + sizeof (ips_passthru_t), in ips_make_passthru()
1610 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
1623 ips_name, ha->host_num); in ips_make_passthru()
1628 if (ha->pcidev->device == IPS_DEVICEID_COPPERHEAD && in ips_make_passthru()
1631 ret = ips_flash_copperhead(ha, pt, scb); in ips_make_passthru()
1632 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
1636 if (ips_usrcmd(ha, pt, scb)) in ips_make_passthru()
1655 ips_flash_copperhead(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_copperhead() argument
1661 if (IPS_IS_TROMBONE(ha) && pt->CoppCP.cmd.flashfw.type == IPS_FW_IMAGE) { in ips_flash_copperhead()
1662 if (ips_usrcmd(ha, pt, scb)) in ips_flash_copperhead()
1675 return ips_flash_bios(ha, pt, scb); in ips_flash_copperhead()
1678 ha->flash_data = ips_FlashData; in ips_flash_copperhead()
1679 ha->flash_busaddr = ips_flashbusaddr; in ips_flash_copperhead()
1680 ha->flash_len = PAGE_SIZE << 7; in ips_flash_copperhead()
1681 ha->flash_datasize = 0; in ips_flash_copperhead()
1682 } else if (!ha->flash_data) { in ips_flash_copperhead()
1685 ha->flash_data = dma_alloc_coherent(&ha->pcidev->dev, in ips_flash_copperhead()
1686 datasize, &ha->flash_busaddr, GFP_KERNEL); in ips_flash_copperhead()
1687 if (!ha->flash_data){ in ips_flash_copperhead()
1691 ha->flash_datasize = 0; in ips_flash_copperhead()
1692 ha->flash_len = datasize; in ips_flash_copperhead()
1696 if (pt->CoppCP.cmd.flashfw.count + ha->flash_datasize > in ips_flash_copperhead()
1697 ha->flash_len) { in ips_flash_copperhead()
1698 ips_free_flash_copperhead(ha); in ips_flash_copperhead()
1699 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_flash_copperhead()
1704 if (!ha->flash_data) in ips_flash_copperhead()
1707 memcpy(&ha->flash_data[ha->flash_datasize], pt + 1, in ips_flash_copperhead()
1709 ha->flash_datasize += pt->CoppCP.cmd.flashfw.count; in ips_flash_copperhead()
1713 return ips_flash_bios(ha, pt, scb); in ips_flash_copperhead()
1715 return ips_flash_firmware(ha, pt, scb); in ips_flash_copperhead()
1726 ips_flash_bios(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_bios() argument
1731 if ((!ha->func.programbios) || (!ha->func.erasebios) || in ips_flash_bios()
1732 (!ha->func.verifybios)) in ips_flash_bios()
1734 if ((*ha->func.erasebios) (ha)) { in ips_flash_bios()
1737 ips_name, ha->host_num); in ips_flash_bios()
1740 if ((*ha->func.programbios) (ha, in ips_flash_bios()
1741 ha->flash_data + in ips_flash_bios()
1743 ha->flash_datasize - in ips_flash_bios()
1747 ips_name, ha->host_num); in ips_flash_bios()
1750 if ((*ha->func.verifybios) (ha, in ips_flash_bios()
1751 ha->flash_data + in ips_flash_bios()
1753 ha->flash_datasize - in ips_flash_bios()
1757 ips_name, ha->host_num); in ips_flash_bios()
1760 ips_free_flash_copperhead(ha); in ips_flash_bios()
1764 if (!ha->func.erasebios) in ips_flash_bios()
1766 if ((*ha->func.erasebios) (ha)) { in ips_flash_bios()
1769 ips_name, ha->host_num); in ips_flash_bios()
1777 ips_free_flash_copperhead(ha); in ips_flash_bios()
1790 ips_fill_scb_sg_single(ips_ha_t * ha, dma_addr_t busaddr, in ips_fill_scb_sg_single() argument
1796 if ((scb->data_len + e_len) > ha->max_xfer) { in ips_fill_scb_sg_single()
1797 e_len = ha->max_xfer - scb->data_len; in ips_fill_scb_sg_single()
1805 if (IPS_USE_ENH_SGLIST(ha)) { in ips_fill_scb_sg_single()
1828 ips_flash_firmware(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_firmware() argument
1837 pt->CoppCP.cmd.flashfw.count = cpu_to_le32(ha->flash_datasize); in ips_flash_firmware()
1841 ips_free_flash_copperhead(ha); in ips_flash_firmware()
1862 scb->data_len = ha->flash_datasize; in ips_flash_firmware()
1864 dma_map_single(&ha->pcidev->dev, ha->flash_data, scb->data_len, in ips_flash_firmware()
1867 scb->cmd.flashfw.command_id = IPS_COMMAND_ID(ha, scb); in ips_flash_firmware()
1881 ips_free_flash_copperhead(ips_ha_t * ha) in ips_free_flash_copperhead() argument
1883 if (ha->flash_data == ips_FlashData) in ips_free_flash_copperhead()
1885 else if (ha->flash_data) in ips_free_flash_copperhead()
1886 dma_free_coherent(&ha->pcidev->dev, ha->flash_len, in ips_free_flash_copperhead()
1887 ha->flash_data, ha->flash_busaddr); in ips_free_flash_copperhead()
1888 ha->flash_data = NULL; in ips_free_flash_copperhead()
1901 ips_usrcmd(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_usrcmd() argument
1908 if ((!scb) || (!pt) || (!ha)) in ips_usrcmd()
1930 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_usrcmd()
1940 scb->data_busaddr = ha->ioctl_busaddr + sizeof (ips_passthru_t); in ips_usrcmd()
1989 ips_cleanup_passthru(ips_ha_t * ha, ips_scb_t * scb) in ips_cleanup_passthru() argument
1997 ips_name, ha->host_num); in ips_cleanup_passthru()
2001 pt = (ips_passthru_t *) ha->ioctl_data; in ips_cleanup_passthru()
2009 pt->AdapterType = ha->ad_type; in ips_cleanup_passthru()
2011 if (ha->pcidev->device == IPS_DEVICEID_COPPERHEAD && in ips_cleanup_passthru()
2014 ips_free_flash_copperhead(ha); in ips_cleanup_passthru()
2016 ips_scmd_buf_write(scb->scsi_cmd, ha->ioctl_data, ha->ioctl_datasize); in ips_cleanup_passthru()
2029 ips_host_info(ips_ha_t *ha, struct seq_file *m) in ips_host_info() argument
2035 if ((le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG) && in ips_host_info()
2036 (le16_to_cpu(ha->nvram->adapter_type) != 0)) in ips_host_info()
2038 ips_adapter_name[ha->ad_type - 1]); in ips_host_info()
2042 if (ha->io_addr) in ips_host_info()
2045 ha->io_addr, ha->io_len); in ips_host_info()
2047 if (ha->mem_addr) { in ips_host_info()
2050 ha->mem_addr, ha->mem_len); in ips_host_info()
2053 (unsigned long)ha->mem_ptr); in ips_host_info()
2056 seq_printf(m, "\tIRQ number : %d\n", ha->pcidev->irq); in ips_host_info()
2061 if (le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG) { in ips_host_info()
2062 if (ha->nvram->bios_low[3] == 0) { in ips_host_info()
2065 ha->nvram->bios_high[0], ha->nvram->bios_high[1], in ips_host_info()
2066 ha->nvram->bios_high[2], ha->nvram->bios_high[3], in ips_host_info()
2067 ha->nvram->bios_low[0], ha->nvram->bios_low[1], in ips_host_info()
2068 ha->nvram->bios_low[2]); in ips_host_info()
2073 ha->nvram->bios_high[0], ha->nvram->bios_high[1], in ips_host_info()
2074 ha->nvram->bios_high[2], ha->nvram->bios_high[3], in ips_host_info()
2075 ha->nvram->bios_low[0], ha->nvram->bios_low[1], in ips_host_info()
2076 ha->nvram->bios_low[2], ha->nvram->bios_low[3]); in ips_host_info()
2081 if (ha->enq->CodeBlkVersion[7] == 0) { in ips_host_info()
2084 ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1], in ips_host_info()
2085 ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3], in ips_host_info()
2086 ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5], in ips_host_info()
2087 ha->enq->CodeBlkVersion[6]); in ips_host_info()
2091 ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1], in ips_host_info()
2092 ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3], in ips_host_info()
2093 ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5], in ips_host_info()
2094 ha->enq->CodeBlkVersion[6], ha->enq->CodeBlkVersion[7]); in ips_host_info()
2097 if (ha->enq->BootBlkVersion[7] == 0) { in ips_host_info()
2100 ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1], in ips_host_info()
2101 ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3], in ips_host_info()
2102 ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5], in ips_host_info()
2103 ha->enq->BootBlkVersion[6]); in ips_host_info()
2107 ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1], in ips_host_info()
2108 ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3], in ips_host_info()
2109 ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5], in ips_host_info()
2110 ha->enq->BootBlkVersion[6], ha->enq->BootBlkVersion[7]); in ips_host_info()
2120 ha->enq->ucMaxPhysicalDevices); in ips_host_info()
2122 ha->max_cmds); in ips_host_info()
2124 ha->scb_waitlist.count); in ips_host_info()
2126 ha->scb_activelist.count - ha->num_ioctl); in ips_host_info()
2128 ha->copp_waitlist.count); in ips_host_info()
2130 ha->num_ioctl); in ips_host_info()
2147 ips_identify_controller(ips_ha_t * ha) in ips_identify_controller() argument
2151 switch (ha->pcidev->device) { in ips_identify_controller()
2153 if (ha->pcidev->revision <= IPS_REVID_SERVERAID) { in ips_identify_controller()
2154 ha->ad_type = IPS_ADTYPE_SERVERAID; in ips_identify_controller()
2155 } else if (ha->pcidev->revision == IPS_REVID_SERVERAID2) { in ips_identify_controller()
2156 ha->ad_type = IPS_ADTYPE_SERVERAID2; in ips_identify_controller()
2157 } else if (ha->pcidev->revision == IPS_REVID_NAVAJO) { in ips_identify_controller()
2158 ha->ad_type = IPS_ADTYPE_NAVAJO; in ips_identify_controller()
2159 } else if ((ha->pcidev->revision == IPS_REVID_SERVERAID2) in ips_identify_controller()
2160 && (ha->slot_num == 0)) { in ips_identify_controller()
2161 ha->ad_type = IPS_ADTYPE_KIOWA; in ips_identify_controller()
2162 } else if ((ha->pcidev->revision >= IPS_REVID_CLARINETP1) && in ips_identify_controller()
2163 (ha->pcidev->revision <= IPS_REVID_CLARINETP3)) { in ips_identify_controller()
2164 if (ha->enq->ucMaxPhysicalDevices == 15) in ips_identify_controller()
2165 ha->ad_type = IPS_ADTYPE_SERVERAID3L; in ips_identify_controller()
2167 ha->ad_type = IPS_ADTYPE_SERVERAID3; in ips_identify_controller()
2168 } else if ((ha->pcidev->revision >= IPS_REVID_TROMBONE32) && in ips_identify_controller()
2169 (ha->pcidev->revision <= IPS_REVID_TROMBONE64)) { in ips_identify_controller()
2170 ha->ad_type = IPS_ADTYPE_SERVERAID4H; in ips_identify_controller()
2175 switch (ha->pcidev->subsystem_device) { in ips_identify_controller()
2177 ha->ad_type = IPS_ADTYPE_SERVERAID4L; in ips_identify_controller()
2181 ha->ad_type = IPS_ADTYPE_SERVERAID4M; in ips_identify_controller()
2185 ha->ad_type = IPS_ADTYPE_SERVERAID4MX; in ips_identify_controller()
2189 ha->ad_type = IPS_ADTYPE_SERVERAID4LX; in ips_identify_controller()
2193 ha->ad_type = IPS_ADTYPE_SERVERAID5I2; in ips_identify_controller()
2197 ha->ad_type = IPS_ADTYPE_SERVERAID5I1; in ips_identify_controller()
2204 switch (ha->pcidev->subsystem_device) { in ips_identify_controller()
2206 ha->ad_type = IPS_ADTYPE_SERVERAID6M; in ips_identify_controller()
2209 ha->ad_type = IPS_ADTYPE_SERVERAID6I; in ips_identify_controller()
2212 ha->ad_type = IPS_ADTYPE_SERVERAID7k; in ips_identify_controller()
2215 ha->ad_type = IPS_ADTYPE_SERVERAID7M; in ips_identify_controller()
2232 ips_get_bios_version(ips_ha_t * ha, int intr) in ips_get_bios_version() argument
2246 memcpy(ha->bios_version, " ?", 8); in ips_get_bios_version()
2248 if (ha->pcidev->device == IPS_DEVICEID_COPPERHEAD) { in ips_get_bios_version()
2249 if (IPS_USE_MEMIO(ha)) { in ips_get_bios_version()
2253 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2254 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2257 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0x55) in ips_get_bios_version()
2260 writel(1, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2261 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2264 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0xAA) in ips_get_bios_version()
2268 writel(0x1FF, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2269 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2272 major = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_get_bios_version()
2275 writel(0x1FE, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2276 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2278 minor = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_get_bios_version()
2281 writel(0x1FD, ha->mem_ptr + IPS_REG_FLAP); in ips_get_bios_version()
2282 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2284 subminor = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_get_bios_version()
2290 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2291 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2294 if (inb(ha->io_addr + IPS_REG_FLDP) != 0x55) in ips_get_bios_version()
2297 outl(1, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2298 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2301 if (inb(ha->io_addr + IPS_REG_FLDP) != 0xAA) in ips_get_bios_version()
2305 outl(0x1FF, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2306 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2309 major = inb(ha->io_addr + IPS_REG_FLDP); in ips_get_bios_version()
2312 outl(0x1FE, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2313 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2316 minor = inb(ha->io_addr + IPS_REG_FLDP); in ips_get_bios_version()
2319 outl(0x1FD, ha->io_addr + IPS_REG_FLAP); in ips_get_bios_version()
2320 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_get_bios_version()
2323 subminor = inb(ha->io_addr + IPS_REG_FLDP); in ips_get_bios_version()
2329 buffer = ha->ioctl_data; in ips_get_bios_version()
2333 scb = &ha->scbs[ha->max_cmds - 1]; in ips_get_bios_version()
2335 ips_init_scb(ha, scb); in ips_get_bios_version()
2341 scb->cmd.flashfw.command_id = IPS_COMMAND_ID(ha, scb); in ips_get_bios_version()
2348 scb->cmd.flashfw.buffer_addr = ha->ioctl_busaddr; in ips_get_bios_version()
2352 ips_send_wait(ha, scb, ips_cmd_timeout, in ips_get_bios_version()
2370 ha->bios_version[0] = hex_asc_upper_hi(major); in ips_get_bios_version()
2371 ha->bios_version[1] = '.'; in ips_get_bios_version()
2372 ha->bios_version[2] = hex_asc_upper_lo(major); in ips_get_bios_version()
2373 ha->bios_version[3] = hex_asc_upper_lo(subminor); in ips_get_bios_version()
2374 ha->bios_version[4] = '.'; in ips_get_bios_version()
2375 ha->bios_version[5] = hex_asc_upper_hi(minor); in ips_get_bios_version()
2376 ha->bios_version[6] = hex_asc_upper_lo(minor); in ips_get_bios_version()
2377 ha->bios_version[7] = 0; in ips_get_bios_version()
2392 ips_hainit(ips_ha_t * ha) in ips_hainit() argument
2398 if (!ha) in ips_hainit()
2401 if (ha->func.statinit) in ips_hainit()
2402 (*ha->func.statinit) (ha); in ips_hainit()
2404 if (ha->func.enableint) in ips_hainit()
2405 (*ha->func.enableint) (ha); in ips_hainit()
2408 ha->reset_count = 1; in ips_hainit()
2409 ha->last_ffdc = ktime_get_real_seconds(); in ips_hainit()
2410 ips_ffdc_reset(ha, IPS_INTR_IORL); in ips_hainit()
2412 if (!ips_read_config(ha, IPS_INTR_IORL)) { in ips_hainit()
2413 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2419 if (!ips_read_adapter_status(ha, IPS_INTR_IORL)) { in ips_hainit()
2420 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2427 ips_identify_controller(ha); in ips_hainit()
2429 if (!ips_read_subsystem_parameters(ha, IPS_INTR_IORL)) { in ips_hainit()
2430 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2437 if (!ips_write_driver_status(ha, IPS_INTR_IORL)) { in ips_hainit()
2438 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_hainit()
2445 if ((ha->conf->ucLogDriveCount > 0) && (ha->requires_esl == 1)) in ips_hainit()
2446 ips_clear_adapter(ha, IPS_INTR_IORL); in ips_hainit()
2449 ha->ntargets = IPS_MAX_TARGETS + 1; in ips_hainit()
2450 ha->nlun = 1; in ips_hainit()
2451 ha->nbus = (ha->enq->ucMaxPhysicalDevices / IPS_MAX_TARGETS) + 1; in ips_hainit()
2453 switch (ha->conf->logical_drive[0].ucStripeSize) { in ips_hainit()
2455 ha->max_xfer = 0x10000; in ips_hainit()
2459 ha->max_xfer = 0x20000; in ips_hainit()
2463 ha->max_xfer = 0x40000; in ips_hainit()
2468 ha->max_xfer = 0x80000; in ips_hainit()
2473 if (le32_to_cpu(ha->subsys->param[4]) & 0x1) { in ips_hainit()
2475 ha->max_cmds = ha->enq->ucConcurrentCmdCount; in ips_hainit()
2478 switch (ha->conf->logical_drive[0].ucStripeSize) { in ips_hainit()
2480 ha->max_cmds = 32; in ips_hainit()
2484 ha->max_cmds = 16; in ips_hainit()
2488 ha->max_cmds = 8; in ips_hainit()
2493 ha->max_cmds = 4; in ips_hainit()
2499 if ((ha->ad_type == IPS_ADTYPE_SERVERAID3L) || in ips_hainit()
2500 (ha->ad_type == IPS_ADTYPE_SERVERAID4L) || in ips_hainit()
2501 (ha->ad_type == IPS_ADTYPE_SERVERAID4LX)) { in ips_hainit()
2502 if ((ha->max_cmds > MaxLiteCmds) && (MaxLiteCmds)) in ips_hainit()
2503 ha->max_cmds = MaxLiteCmds; in ips_hainit()
2507 ha->ha_id[0] = IPS_ADAPTER_ID; in ips_hainit()
2508 for (i = 1; i < ha->nbus; i++) { in ips_hainit()
2509 ha->ha_id[i] = ha->conf->init_id[i - 1] & 0x1f; in ips_hainit()
2510 ha->dcdb_active[i - 1] = 0; in ips_hainit()
2526 ips_next(ips_ha_t * ha, int intr) in ips_next() argument
2537 if (!ha) in ips_next()
2539 host = ips_sh[ha->host_num]; in ips_next()
2547 if ((ha->subsys->param[3] & 0x300000) in ips_next()
2548 && (ha->scb_activelist.count == 0)) { in ips_next()
2550 if (now - ha->last_ffdc > IPS_SECS_8HOURS) { in ips_next()
2551 ha->last_ffdc = now; in ips_next()
2552 ips_ffdc_time(ha); in ips_next()
2563 while ((ha->num_ioctl < IPS_MAX_IOCTL) && in ips_next()
2564 (ha->copp_waitlist.head) && (scb = ips_getscb(ha))) { in ips_next()
2566 item = ips_removeq_copp_head(&ha->copp_waitlist); in ips_next()
2567 ha->num_ioctl++; in ips_next()
2573 ret = ips_make_passthru(ha, scb->scsi_cmd, scb, intr); in ips_next()
2584 ips_freescb(ha, scb); in ips_next()
2592 ips_freescb(ha, scb); in ips_next()
2599 ha->num_ioctl--; in ips_next()
2603 ret = ips_send_cmd(ha, scb); in ips_next()
2606 ips_putq_scb_head(&ha->scb_activelist, scb); in ips_next()
2608 ha->num_ioctl--; in ips_next()
2616 ips_freescb(ha, scb); in ips_next()
2619 ips_freescb(ha, scb); in ips_next()
2631 p = ha->scb_waitlist.head; in ips_next()
2632 while ((p) && (scb = ips_getscb(ha))) { in ips_next()
2634 && (ha-> in ips_next()
2637 ips_freescb(ha, scb); in ips_next()
2643 SC = ips_removeq_wait(&ha->scb_waitlist, q); in ips_next()
2674 (ha, sg_dma_address(sg), scb, i, in ips_next()
2705 ret = ips_send_cmd(ha, scb); in ips_next()
2709 ips_putq_scb_head(&ha->scb_activelist, scb); in ips_next()
2718 ha->dcdb_active[scb->bus - 1] &= in ips_next()
2721 ips_freescb(ha, scb); in ips_next()
2728 ha->dcdb_active[scb->bus - 1] &= in ips_next()
2731 ips_freescb(ha, scb); in ips_next()
3088 ipsintr_blocking(ips_ha_t * ha, ips_scb_t * scb) in ipsintr_blocking() argument
3092 ips_freescb(ha, scb); in ipsintr_blocking()
3093 if (ha->waitflag && ha->cmd_in_progress == scb->cdb[0]) { in ipsintr_blocking()
3094 ha->waitflag = false; in ipsintr_blocking()
3110 ipsintr_done(ips_ha_t * ha, ips_scb_t * scb) in ipsintr_done() argument
3115 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ipsintr_done()
3123 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ipsintr_done()
3129 ips_done(ha, scb); in ipsintr_done()
3142 ips_done(ips_ha_t * ha, ips_scb_t * scb) in ips_done() argument
3152 ips_cleanup_passthru(ha, scb); in ips_done()
3153 ha->num_ioctl--; in ips_done()
3175 ips_fill_scb_sg_single(ha, in ips_done()
3183 (ha, in ips_done()
3202 ret = ips_send_cmd(ha, scb); in ips_done()
3211 ips_freescb(ha, scb); in ips_done()
3219 ips_freescb(ha, scb); in ips_done()
3230 ha->dcdb_active[scb->bus - 1] &= ~(1 << scb->target_id); in ips_done()
3235 ips_freescb(ha, scb); in ips_done()
3248 ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) in ips_map_status() argument
3261 ips_name, ha->host_num, in ips_map_status()
3387 ips_send_wait(ips_ha_t * ha, ips_scb_t * scb, int timeout, int intr) in ips_send_wait() argument
3394 ha->waitflag = true; in ips_send_wait()
3395 ha->cmd_in_progress = scb->cdb[0]; in ips_send_wait()
3398 ret = ips_send_cmd(ha, scb); in ips_send_wait()
3404 ret = ips_wait(ha, timeout, intr); in ips_send_wait()
3453 ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) in ips_send_cmd() argument
3471 if (ha->waitflag && ha->cmd_in_progress == scb->cdb[0]) in ips_send_cmd()
3472 ha->waitflag = false; in ips_send_cmd()
3537 scb->cmd.logical_info.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3541 scb->data_busaddr = ha->logical_drive_info_dma_addr; in ips_send_cmd()
3550 ips_reqsen(ha, scb); in ips_send_cmd()
3569 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3575 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3615 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3621 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3660 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3663 scb->data_len = sizeof (*ha->enq); in ips_send_cmd()
3664 scb->cmd.basic_io.sg_addr = ha->enq_busaddr; in ips_send_cmd()
3670 scb->cmd.logical_info.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3675 scb->data_busaddr = ha->logical_drive_info_dma_addr; in ips_send_cmd()
3718 if (ha->conf->dev[scb->bus - 1][scb->target_id].ucState == 0) { in ips_send_cmd()
3723 ha->dcdb_active[scb->bus - 1] |= (1 << scb->target_id); in ips_send_cmd()
3724 scb->cmd.dcdb.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3737 if (ha->subsys->param[4] & 0x00100000) { /* If NEW Tape DCDB is Supported */ in ips_send_cmd()
3744 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3783 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3821 return ((*ha->func.issue) (ha, scb)); in ips_send_cmd()
3834 ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) in ips_chkstatus() argument
3845 scb = &ha->scbs[pstatus->fields.command_id]; in ips_chkstatus()
3850 sp = &ha->sp; in ips_chkstatus()
3855 ips_removeq_scb(&ha->scb_activelist, scb); in ips_chkstatus()
3863 ha->host_num, in ips_chkstatus()
3882 ips_name, ha->host_num, in ips_chkstatus()
3900 if (!ips_online(ha, scb)) { in ips_chkstatus()
3906 if (ips_online(ha, scb)) { in ips_chkstatus()
3907 ips_inquiry(ha, scb); in ips_chkstatus()
3914 ips_reqsen(ha, scb); in ips_chkstatus()
3926 if (!ips_online(ha, scb) in ips_chkstatus()
3927 || !ips_msense(ha, scb)) { in ips_chkstatus()
3933 if (ips_online(ha, scb)) in ips_chkstatus()
3934 ips_rdcap(ha, scb); in ips_chkstatus()
3973 ips_name, ha->host_num, in ips_chkstatus()
3978 ips_map_status(ha, scb, sp); in ips_chkstatus()
3992 ips_online(ips_ha_t * ha, ips_scb_t * scb) in ips_online() argument
4000 memset(ha->logical_drive_info, 0, sizeof (IPS_LD_INFO)); in ips_online()
4004 if (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()
4008 && ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4010 && ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4027 ips_inquiry(ips_ha_t * ha, ips_scb_t * scb) in ips_inquiry() argument
4062 ips_rdcap(ips_ha_t * ha, ips_scb_t * scb) in ips_rdcap() argument
4073 (ha->logical_drive_info-> in ips_rdcap()
4092 ips_msense(ips_ha_t * ha, ips_scb_t * scb) in ips_msense() argument
4101 if (le32_to_cpu(ha->enq->ulDriveSize[scb->target_id]) > 0x400000 && in ips_msense()
4102 (ha->enq->ucMiscFlag & 0x8) == 0) { in ips_msense()
4111 (le32_to_cpu(ha->enq->ulDriveSize[scb->target_id]) - in ips_msense()
4183 ips_reqsen(ips_ha_t * ha, ips_scb_t * scb) in ips_reqsen() argument
4212 ips_free(ips_ha_t * ha) in ips_free() argument
4217 if (ha) { in ips_free()
4218 if (ha->enq) { in ips_free()
4219 dma_free_coherent(&ha->pcidev->dev, sizeof(IPS_ENQ), in ips_free()
4220 ha->enq, ha->enq_busaddr); in ips_free()
4221 ha->enq = NULL; in ips_free()
4224 kfree(ha->conf); in ips_free()
4225 ha->conf = NULL; in ips_free()
4227 if (ha->adapt) { in ips_free()
4228 dma_free_coherent(&ha->pcidev->dev, in ips_free()
4230 sizeof (IPS_IO_CMD), ha->adapt, in ips_free()
4231 ha->adapt->hw_status_start); in ips_free()
4232 ha->adapt = NULL; in ips_free()
4235 if (ha->logical_drive_info) { in ips_free()
4236 dma_free_coherent(&ha->pcidev->dev, in ips_free()
4238 ha->logical_drive_info, in ips_free()
4239 ha->logical_drive_info_dma_addr); in ips_free()
4240 ha->logical_drive_info = NULL; in ips_free()
4243 kfree(ha->nvram); in ips_free()
4244 ha->nvram = NULL; in ips_free()
4246 kfree(ha->subsys); in ips_free()
4247 ha->subsys = NULL; in ips_free()
4249 if (ha->ioctl_data) { in ips_free()
4250 dma_free_coherent(&ha->pcidev->dev, ha->ioctl_len, in ips_free()
4251 ha->ioctl_data, ha->ioctl_busaddr); in ips_free()
4252 ha->ioctl_data = NULL; in ips_free()
4253 ha->ioctl_datasize = 0; in ips_free()
4254 ha->ioctl_len = 0; in ips_free()
4256 ips_deallocatescbs(ha, ha->max_cmds); in ips_free()
4259 if (ha->mem_ptr) { in ips_free()
4260 iounmap(ha->ioremap_ptr); in ips_free()
4261 ha->ioremap_ptr = NULL; in ips_free()
4262 ha->mem_ptr = NULL; in ips_free()
4265 ha->mem_addr = 0; in ips_free()
4280 ips_deallocatescbs(ips_ha_t * ha, int cmds) in ips_deallocatescbs() argument
4282 if (ha->scbs) { in ips_deallocatescbs()
4283 dma_free_coherent(&ha->pcidev->dev, in ips_deallocatescbs()
4284 IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * cmds, in ips_deallocatescbs()
4285 ha->scbs->sg_list.list, in ips_deallocatescbs()
4286 ha->scbs->sg_busaddr); in ips_deallocatescbs()
4287 dma_free_coherent(&ha->pcidev->dev, sizeof (ips_scb_t) * cmds, in ips_deallocatescbs()
4288 ha->scbs, ha->scbs->scb_busaddr); in ips_deallocatescbs()
4289 ha->scbs = NULL; in ips_deallocatescbs()
4304 ips_allocatescbs(ips_ha_t * ha) in ips_allocatescbs() argument
4314 ha->scbs = dma_alloc_coherent(&ha->pcidev->dev, in ips_allocatescbs()
4315 ha->max_cmds * sizeof (ips_scb_t), in ips_allocatescbs()
4317 if (ha->scbs == NULL) in ips_allocatescbs()
4319 ips_sg.list = dma_alloc_coherent(&ha->pcidev->dev, in ips_allocatescbs()
4320 IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * ha->max_cmds, in ips_allocatescbs()
4323 dma_free_coherent(&ha->pcidev->dev, in ips_allocatescbs()
4324 ha->max_cmds * sizeof (ips_scb_t), ha->scbs, in ips_allocatescbs()
4329 memset(ha->scbs, 0, ha->max_cmds * sizeof (ips_scb_t)); in ips_allocatescbs()
4331 for (i = 0; i < ha->max_cmds; i++) { in ips_allocatescbs()
4332 scb_p = &ha->scbs[i]; in ips_allocatescbs()
4335 if (IPS_USE_ENH_SGLIST(ha)) { in ips_allocatescbs()
4339 sg_dma + IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * i; in ips_allocatescbs()
4344 sg_dma + IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * i; in ips_allocatescbs()
4348 if (i < ha->max_cmds - 1) { in ips_allocatescbs()
4349 scb_p->q_next = ha->scb_freelist; in ips_allocatescbs()
4350 ha->scb_freelist = scb_p; in ips_allocatescbs()
4368 ips_init_scb(ips_ha_t * ha, ips_scb_t * scb) in ips_init_scb() argument
4382 memset(ha->dummy, 0, sizeof (IPS_IO_CMD)); in ips_init_scb()
4385 ha->dummy->op_code = 0xFF; in ips_init_scb()
4386 ha->dummy->ccsar = cpu_to_le32(ha->adapt->hw_status_start in ips_init_scb()
4388 ha->dummy->command_id = IPS_MAX_CMDS; in ips_init_scb()
4397 scb->cmd.basic_io.ccsar = cpu_to_le32(ha->adapt->hw_status_start in ips_init_scb()
4413 ips_getscb(ips_ha_t * ha) in ips_getscb() argument
4419 if ((scb = ha->scb_freelist) == NULL) { in ips_getscb()
4424 ha->scb_freelist = scb->q_next; in ips_getscb()
4428 ips_init_scb(ha, scb); in ips_getscb()
4445 ips_freescb(ips_ha_t * ha, ips_scb_t * scb) in ips_freescb() argument
4452 dma_unmap_single(&ha->pcidev->dev, scb->data_busaddr, in ips_freescb()
4456 if (IPS_COMMAND_ID(ha, scb) < (ha->max_cmds - 1)) { in ips_freescb()
4457 scb->q_next = ha->scb_freelist; in ips_freescb()
4458 ha->scb_freelist = scb; in ips_freescb()
4472 ips_isinit_copperhead(ips_ha_t * ha) in ips_isinit_copperhead() argument
4479 isr = inb(ha->io_addr + IPS_REG_HISR); in ips_isinit_copperhead()
4480 scpr = inb(ha->io_addr + IPS_REG_SCPR); in ips_isinit_copperhead()
4498 ips_isinit_copperhead_memio(ips_ha_t * ha) in ips_isinit_copperhead_memio() argument
4505 isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_isinit_copperhead_memio()
4506 scpr = readb(ha->mem_ptr + IPS_REG_SCPR); in ips_isinit_copperhead_memio()
4524 ips_isinit_morpheus(ips_ha_t * ha) in ips_isinit_morpheus() argument
4531 if (ips_isintr_morpheus(ha)) in ips_isinit_morpheus()
4532 ips_flush_and_reset(ha); in ips_isinit_morpheus()
4534 post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_isinit_morpheus()
4535 bits = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_isinit_morpheus()
4556 ips_flush_and_reset(ips_ha_t *ha) in ips_flush_and_reset() argument
4565 scb = dma_alloc_coherent(&ha->pcidev->dev, sizeof(ips_scb_t), in ips_flush_and_reset()
4569 ips_init_scb(ha, scb); in ips_flush_and_reset()
4583 ret = ips_send_cmd(ha, scb); /* Send the Flush Command */ in ips_flush_and_reset()
4590 done = ips_poll_for_flush_complete(ha); in ips_flush_and_reset()
4599 (*ha->func.reset) (ha); in ips_flush_and_reset()
4601 dma_free_coherent(&ha->pcidev->dev, sizeof(ips_scb_t), scb, command_dma); in ips_flush_and_reset()
4616 ips_poll_for_flush_complete(ips_ha_t * ha) in ips_poll_for_flush_complete() argument
4621 cstatus.value = (*ha->func.statupd) (ha); in ips_poll_for_flush_complete()
4643 ips_enable_int_copperhead(ips_ha_t * ha) in ips_enable_int_copperhead() argument
4647 outb(ha->io_addr + IPS_REG_HISR, IPS_BIT_EI); in ips_enable_int_copperhead()
4648 inb(ha->io_addr + IPS_REG_HISR); /*Ensure PCI Posting Completes*/ in ips_enable_int_copperhead()
4660 ips_enable_int_copperhead_memio(ips_ha_t * ha) in ips_enable_int_copperhead_memio() argument
4664 writeb(IPS_BIT_EI, ha->mem_ptr + IPS_REG_HISR); in ips_enable_int_copperhead_memio()
4665 readb(ha->mem_ptr + IPS_REG_HISR); /*Ensure PCI Posting Completes*/ in ips_enable_int_copperhead_memio()
4677 ips_enable_int_morpheus(ips_ha_t * ha) in ips_enable_int_morpheus() argument
4683 Oimr = readl(ha->mem_ptr + IPS_REG_I960_OIMR); in ips_enable_int_morpheus()
4685 writel(Oimr, ha->mem_ptr + IPS_REG_I960_OIMR); in ips_enable_int_morpheus()
4686 readl(ha->mem_ptr + IPS_REG_I960_OIMR); /*Ensure PCI Posting Completes*/ in ips_enable_int_morpheus()
4699 ips_init_copperhead(ips_ha_t * ha) in ips_init_copperhead() argument
4710 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4722 PostByte[i] = inb(ha->io_addr + IPS_REG_ISPR); in ips_init_copperhead()
4723 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4727 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_copperhead()
4736 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4748 inb(ha->io_addr + IPS_REG_ISPR); in ips_init_copperhead()
4749 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4753 Cbsp = inb(ha->io_addr + IPS_REG_CBSP); in ips_init_copperhead()
4767 outl(0x1010, ha->io_addr + IPS_REG_CCCR); in ips_init_copperhead()
4770 outb(IPS_BIT_EBM, ha->io_addr + IPS_REG_SCPR); in ips_init_copperhead()
4772 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_init_copperhead()
4774 outl(0, ha->io_addr + IPS_REG_NDAE); in ips_init_copperhead()
4777 outb(IPS_BIT_EI, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4792 ips_init_copperhead_memio(ips_ha_t * ha) in ips_init_copperhead_memio() argument
4803 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4815 PostByte[i] = readb(ha->mem_ptr + IPS_REG_ISPR); in ips_init_copperhead_memio()
4816 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4820 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_copperhead_memio()
4829 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4841 readb(ha->mem_ptr + IPS_REG_ISPR); in ips_init_copperhead_memio()
4842 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4846 Cbsp = readb(ha->mem_ptr + IPS_REG_CBSP); in ips_init_copperhead_memio()
4860 writel(0x1010, ha->mem_ptr + IPS_REG_CCCR); in ips_init_copperhead_memio()
4863 writeb(IPS_BIT_EBM, ha->mem_ptr + IPS_REG_SCPR); in ips_init_copperhead_memio()
4865 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_init_copperhead_memio()
4867 writel(0, ha->mem_ptr + IPS_REG_NDAE); in ips_init_copperhead_memio()
4870 writeb(IPS_BIT_EI, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4886 ips_init_morpheus(ips_ha_t * ha) in ips_init_morpheus() argument
4898 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4909 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4915 Post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_init_morpheus()
4918 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4923 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4926 Post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_init_morpheus()
4934 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4943 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4946 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4954 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4965 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4971 Config = readl(ha->mem_ptr + IPS_REG_I960_MSG1); in ips_init_morpheus()
4975 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4978 Oimr = readl(ha->mem_ptr + IPS_REG_I960_OIMR); in ips_init_morpheus()
4980 writel(Oimr, ha->mem_ptr + IPS_REG_I960_OIMR); in ips_init_morpheus()
4987 ha->requires_esl = 1; in ips_init_morpheus()
5003 ips_reset_copperhead(ips_ha_t * ha) in ips_reset_copperhead() argument
5010 ips_name, ha->host_num, ha->io_addr, ha->pcidev->irq); in ips_reset_copperhead()
5017 outb(IPS_BIT_RST, ha->io_addr + IPS_REG_SCPR); in ips_reset_copperhead()
5022 outb(0, ha->io_addr + IPS_REG_SCPR); in ips_reset_copperhead()
5027 if ((*ha->func.init) (ha)) in ips_reset_copperhead()
5048 ips_reset_copperhead_memio(ips_ha_t * ha) in ips_reset_copperhead_memio() argument
5055 ips_name, ha->host_num, ha->mem_addr, ha->pcidev->irq); in ips_reset_copperhead_memio()
5062 writeb(IPS_BIT_RST, ha->mem_ptr + IPS_REG_SCPR); in ips_reset_copperhead_memio()
5067 writeb(0, ha->mem_ptr + IPS_REG_SCPR); in ips_reset_copperhead_memio()
5072 if ((*ha->func.init) (ha)) in ips_reset_copperhead_memio()
5093 ips_reset_morpheus(ips_ha_t * ha) in ips_reset_morpheus() argument
5101 ips_name, ha->host_num, ha->mem_addr, ha->pcidev->irq); in ips_reset_morpheus()
5108 writel(0x80000000, ha->mem_ptr + IPS_REG_I960_IDR); in ips_reset_morpheus()
5114 pci_read_config_byte(ha->pcidev, 4, &junk); in ips_reset_morpheus()
5116 if ((*ha->func.init) (ha)) in ips_reset_morpheus()
5137 ips_statinit(ips_ha_t * ha) in ips_statinit() argument
5143 ha->adapt->p_status_start = ha->adapt->status; in ips_statinit()
5144 ha->adapt->p_status_end = ha->adapt->status + IPS_MAX_CMDS; in ips_statinit()
5145 ha->adapt->p_status_tail = ha->adapt->status; in ips_statinit()
5147 phys_status_start = ha->adapt->hw_status_start; in ips_statinit()
5148 outl(phys_status_start, ha->io_addr + IPS_REG_SQSR); in ips_statinit()
5150 ha->io_addr + IPS_REG_SQER); in ips_statinit()
5152 ha->io_addr + IPS_REG_SQHR); in ips_statinit()
5153 outl(phys_status_start, ha->io_addr + IPS_REG_SQTR); in ips_statinit()
5155 ha->adapt->hw_status_tail = phys_status_start; in ips_statinit()
5168 ips_statinit_memio(ips_ha_t * ha) in ips_statinit_memio() argument
5174 ha->adapt->p_status_start = ha->adapt->status; in ips_statinit_memio()
5175 ha->adapt->p_status_end = ha->adapt->status + IPS_MAX_CMDS; in ips_statinit_memio()
5176 ha->adapt->p_status_tail = ha->adapt->status; in ips_statinit_memio()
5178 phys_status_start = ha->adapt->hw_status_start; in ips_statinit_memio()
5179 writel(phys_status_start, ha->mem_ptr + IPS_REG_SQSR); in ips_statinit_memio()
5181 ha->mem_ptr + IPS_REG_SQER); in ips_statinit_memio()
5182 writel(phys_status_start + IPS_STATUS_SIZE, ha->mem_ptr + IPS_REG_SQHR); in ips_statinit_memio()
5183 writel(phys_status_start, ha->mem_ptr + IPS_REG_SQTR); in ips_statinit_memio()
5185 ha->adapt->hw_status_tail = phys_status_start; in ips_statinit_memio()
5198 ips_statupd_copperhead(ips_ha_t * ha) in ips_statupd_copperhead() argument
5202 if (ha->adapt->p_status_tail != ha->adapt->p_status_end) { in ips_statupd_copperhead()
5203 ha->adapt->p_status_tail++; in ips_statupd_copperhead()
5204 ha->adapt->hw_status_tail += sizeof (IPS_STATUS); in ips_statupd_copperhead()
5206 ha->adapt->p_status_tail = ha->adapt->p_status_start; in ips_statupd_copperhead()
5207 ha->adapt->hw_status_tail = ha->adapt->hw_status_start; in ips_statupd_copperhead()
5210 outl(ha->adapt->hw_status_tail, in ips_statupd_copperhead()
5211 ha->io_addr + IPS_REG_SQTR); in ips_statupd_copperhead()
5213 return (ha->adapt->p_status_tail->value); in ips_statupd_copperhead()
5226 ips_statupd_copperhead_memio(ips_ha_t * ha) in ips_statupd_copperhead_memio() argument
5230 if (ha->adapt->p_status_tail != ha->adapt->p_status_end) { in ips_statupd_copperhead_memio()
5231 ha->adapt->p_status_tail++; in ips_statupd_copperhead_memio()
5232 ha->adapt->hw_status_tail += sizeof (IPS_STATUS); in ips_statupd_copperhead_memio()
5234 ha->adapt->p_status_tail = ha->adapt->p_status_start; in ips_statupd_copperhead_memio()
5235 ha->adapt->hw_status_tail = ha->adapt->hw_status_start; in ips_statupd_copperhead_memio()
5238 writel(ha->adapt->hw_status_tail, ha->mem_ptr + IPS_REG_SQTR); in ips_statupd_copperhead_memio()
5240 return (ha->adapt->p_status_tail->value); in ips_statupd_copperhead_memio()
5253 ips_statupd_morpheus(ips_ha_t * ha) in ips_statupd_morpheus() argument
5259 val = readl(ha->mem_ptr + IPS_REG_I2O_OUTMSGQ); in ips_statupd_morpheus()
5274 ips_issue_copperhead(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_copperhead() argument
5284 ha->host_num, in ips_issue_copperhead()
5290 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_copperhead()
5296 le32_to_cpu(inl(ha->io_addr + IPS_REG_CCCR))) & IPS_BIT_SEM) { in ips_issue_copperhead()
5303 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead()
5305 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead()
5312 outl(scb->scb_busaddr, ha->io_addr + IPS_REG_CCSAR); in ips_issue_copperhead()
5313 outw(IPS_BIT_START_CMD, ha->io_addr + IPS_REG_CCCR); in ips_issue_copperhead()
5328 ips_issue_copperhead_memio(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_copperhead_memio() argument
5338 ha->host_num, in ips_issue_copperhead_memio()
5344 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_copperhead_memio()
5349 while ((val = readl(ha->mem_ptr + IPS_REG_CCCR)) & IPS_BIT_SEM) { in ips_issue_copperhead_memio()
5356 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead_memio()
5358 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead_memio()
5365 writel(scb->scb_busaddr, ha->mem_ptr + IPS_REG_CCSAR); in ips_issue_copperhead_memio()
5366 writel(IPS_BIT_START_CMD, ha->mem_ptr + IPS_REG_CCCR); in ips_issue_copperhead_memio()
5381 ips_issue_i2o(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_i2o() argument
5389 ha->host_num, in ips_issue_i2o()
5395 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_i2o()
5398 outl(scb->scb_busaddr, ha->io_addr + IPS_REG_I2O_INMSGQ); in ips_issue_i2o()
5413 ips_issue_i2o_memio(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_i2o_memio() argument
5421 ha->host_num, in ips_issue_i2o_memio()
5427 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_i2o_memio()
5430 writel(scb->scb_busaddr, ha->mem_ptr + IPS_REG_I2O_INMSGQ); in ips_issue_i2o_memio()
5445 ips_isintr_copperhead(ips_ha_t * ha) in ips_isintr_copperhead() argument
5451 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_isintr_copperhead()
5462 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_isintr_copperhead()
5478 ips_isintr_copperhead_memio(ips_ha_t * ha) in ips_isintr_copperhead_memio() argument
5484 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_isintr_copperhead_memio()
5495 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_isintr_copperhead_memio()
5511 ips_isintr_morpheus(ips_ha_t * ha) in ips_isintr_morpheus() argument
5517 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_isintr_morpheus()
5535 ips_wait(ips_ha_t * ha, int time, int intr) in ips_wait() argument
5549 if (!ha->waitflag) { in ips_wait()
5555 if (!ha->waitflag) { in ips_wait()
5572 (*ha->func.intr) (ha); in ips_wait()
5593 ips_write_driver_status(ips_ha_t * ha, int intr) in ips_write_driver_status() argument
5597 if (!ips_readwrite_page5(ha, false, intr)) { in ips_write_driver_status()
5598 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_write_driver_status()
5606 if (le32_to_cpu(ha->nvram->signature) != IPS_NVRAM_P5_SIG) { in ips_write_driver_status()
5609 ips_name, ha->host_num, ha->nvram->signature); in ips_write_driver_status()
5610 ha->nvram->signature = IPS_NVRAM_P5_SIG; in ips_write_driver_status()
5615 ips_name, ha->host_num, le16_to_cpu(ha->nvram->adapter_type), in ips_write_driver_status()
5616 ha->nvram->adapter_slot, ha->nvram->bios_high[0], in ips_write_driver_status()
5617 ha->nvram->bios_high[1], ha->nvram->bios_high[2], in ips_write_driver_status()
5618 ha->nvram->bios_high[3], ha->nvram->bios_low[0], in ips_write_driver_status()
5619 ha->nvram->bios_low[1], ha->nvram->bios_low[2], in ips_write_driver_status()
5620 ha->nvram->bios_low[3]); in ips_write_driver_status()
5622 ips_get_bios_version(ha, intr); in ips_write_driver_status()
5625 ha->nvram->operating_system = IPS_OS_LINUX; in ips_write_driver_status()
5626 ha->nvram->adapter_type = ha->ad_type; in ips_write_driver_status()
5627 memcpy((char *) ha->nvram->driver_high, IPS_VERSION_HIGH, 4); in ips_write_driver_status()
5628 memcpy((char *) ha->nvram->driver_low, IPS_VERSION_LOW, 4); in ips_write_driver_status()
5629 memcpy((char *) ha->nvram->bios_high, ha->bios_version, 4); in ips_write_driver_status()
5630 memcpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4); in ips_write_driver_status()
5632 ha->nvram->versioning = 0; /* Indicate the Driver Does Not Support Versioning */ in ips_write_driver_status()
5635 if (!ips_readwrite_page5(ha, true, intr)) { in ips_write_driver_status()
5636 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_write_driver_status()
5643 ha->slot_num = ha->nvram->adapter_slot; in ips_write_driver_status()
5658 ips_read_adapter_status(ips_ha_t * ha, int intr) in ips_read_adapter_status() argument
5665 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_adapter_status()
5667 ips_init_scb(ha, scb); in ips_read_adapter_status()
5673 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_adapter_status()
5678 scb->data_len = sizeof (*ha->enq); in ips_read_adapter_status()
5679 scb->cmd.basic_io.sg_addr = ha->enq_busaddr; in ips_read_adapter_status()
5683 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_adapter_status()
5701 ips_read_subsystem_parameters(ips_ha_t * ha, int intr) in ips_read_subsystem_parameters() argument
5708 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_subsystem_parameters()
5710 ips_init_scb(ha, scb); in ips_read_subsystem_parameters()
5716 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_subsystem_parameters()
5721 scb->data_len = sizeof (*ha->subsys); in ips_read_subsystem_parameters()
5722 scb->cmd.basic_io.sg_addr = ha->ioctl_busaddr; in ips_read_subsystem_parameters()
5726 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_subsystem_parameters()
5731 memcpy(ha->subsys, ha->ioctl_data, sizeof(*ha->subsys)); in ips_read_subsystem_parameters()
5745 ips_read_config(ips_ha_t * ha, int intr) in ips_read_config() argument
5755 ha->conf->init_id[i] = 7; in ips_read_config()
5757 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_config()
5759 ips_init_scb(ha, scb); in ips_read_config()
5765 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_config()
5766 scb->data_len = sizeof (*ha->conf); in ips_read_config()
5767 scb->cmd.basic_io.sg_addr = ha->ioctl_busaddr; in ips_read_config()
5771 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_config()
5775 memset(ha->conf, 0, sizeof (IPS_CONF)); in ips_read_config()
5779 ha->conf->init_id[i] = 7; in ips_read_config()
5789 memcpy(ha->conf, ha->ioctl_data, sizeof(*ha->conf)); in ips_read_config()
5803 ips_readwrite_page5(ips_ha_t * ha, int write, int intr) in ips_readwrite_page5() argument
5810 scb = &ha->scbs[ha->max_cmds - 1]; in ips_readwrite_page5()
5812 ips_init_scb(ha, scb); in ips_readwrite_page5()
5818 scb->cmd.nvram.command_id = IPS_COMMAND_ID(ha, scb); in ips_readwrite_page5()
5823 scb->data_len = sizeof (*ha->nvram); in ips_readwrite_page5()
5824 scb->cmd.nvram.buffer_addr = ha->ioctl_busaddr; in ips_readwrite_page5()
5826 memcpy(ha->ioctl_data, ha->nvram, sizeof(*ha->nvram)); in ips_readwrite_page5()
5830 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_readwrite_page5()
5834 memset(ha->nvram, 0, sizeof (IPS_NVRAM_P5)); in ips_readwrite_page5()
5839 memcpy(ha->nvram, ha->ioctl_data, sizeof(*ha->nvram)); in ips_readwrite_page5()
5853 ips_clear_adapter(ips_ha_t * ha, int intr) in ips_clear_adapter() argument
5860 scb = &ha->scbs[ha->max_cmds - 1]; in ips_clear_adapter()
5862 ips_init_scb(ha, scb); in ips_clear_adapter()
5868 scb->cmd.config_sync.command_id = IPS_COMMAND_ID(ha, scb); in ips_clear_adapter()
5877 ips_send_wait(ha, scb, ips_reset_timeout, intr)) == IPS_FAILURE) in ips_clear_adapter()
5883 ips_init_scb(ha, scb); in ips_clear_adapter()
5889 scb->cmd.unlock_stripe.command_id = IPS_COMMAND_ID(ha, scb); in ips_clear_adapter()
5898 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_clear_adapter()
5916 ips_ffdc_reset(ips_ha_t * ha, int intr) in ips_ffdc_reset() argument
5922 scb = &ha->scbs[ha->max_cmds - 1]; in ips_ffdc_reset()
5924 ips_init_scb(ha, scb); in ips_ffdc_reset()
5929 scb->cmd.ffdc.command_id = IPS_COMMAND_ID(ha, scb); in ips_ffdc_reset()
5930 scb->cmd.ffdc.reset_count = ha->reset_count; in ips_ffdc_reset()
5934 ips_fix_ffdc_time(ha, scb, ha->last_ffdc); in ips_ffdc_reset()
5937 ips_send_wait(ha, scb, ips_cmd_timeout, intr); in ips_ffdc_reset()
5950 ips_ffdc_time(ips_ha_t * ha) in ips_ffdc_time() argument
5956 DEBUG_VAR(1, "(%s%d) Sending time update.", ips_name, ha->host_num); in ips_ffdc_time()
5958 scb = &ha->scbs[ha->max_cmds - 1]; in ips_ffdc_time()
5960 ips_init_scb(ha, scb); in ips_ffdc_time()
5965 scb->cmd.ffdc.command_id = IPS_COMMAND_ID(ha, scb); in ips_ffdc_time()
5970 ips_fix_ffdc_time(ha, scb, ha->last_ffdc); in ips_ffdc_time()
5973 ips_send_wait(ha, scb, ips_cmd_timeout, IPS_FFDC); in ips_ffdc_time()
5985 ips_fix_ffdc_time(ips_ha_t * ha, ips_scb_t * scb, time64_t current_time) in ips_fix_ffdc_time() argument
6015 ips_erase_bios(ips_ha_t * ha) in ips_erase_bios() argument
6025 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6026 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6029 outb(0x50, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6030 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6034 outb(0x20, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6035 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6039 outb(0xD0, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6040 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6044 outb(0x70, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6045 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6051 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios()
6052 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6056 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6070 outb(0xB0, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6071 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6077 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios()
6078 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6082 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6106 outb(0x50, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6107 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6111 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6112 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6127 ips_erase_bios_memio(ips_ha_t * ha) in ips_erase_bios_memio() argument
6137 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6138 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6141 writeb(0x50, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6142 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6146 writeb(0x20, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6147 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6151 writeb(0xD0, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6152 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6156 writeb(0x70, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6157 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6163 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios_memio()
6164 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6168 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6182 writeb(0xB0, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6183 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6189 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios_memio()
6190 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6194 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6218 writeb(0x50, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6219 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6223 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6224 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6239 ips_program_bios(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_program_bios() argument
6252 outl(i + offset, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6253 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6256 outb(0x40, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6257 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6260 outb(buffer[i], ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6261 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6267 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_program_bios()
6268 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6272 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6283 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6284 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6287 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6288 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6297 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6298 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6301 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6302 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6310 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6311 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6314 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6315 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6330 ips_program_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_program_bios_memio() argument
6343 writel(i + offset, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6344 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6347 writeb(0x40, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6348 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6351 writeb(buffer[i], ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6352 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6358 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_program_bios_memio()
6359 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6363 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6374 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6375 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6378 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6379 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6388 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6389 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6392 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6393 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6401 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6402 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6405 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6406 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6421 ips_verify_bios(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_verify_bios() argument
6430 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6431 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6434 if (inb(ha->io_addr + IPS_REG_FLDP) != 0x55) in ips_verify_bios()
6437 outl(1, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6438 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6440 if (inb(ha->io_addr + IPS_REG_FLDP) != 0xAA) in ips_verify_bios()
6446 outl(i + offset, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6447 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6450 checksum = (uint8_t) checksum + inb(ha->io_addr + IPS_REG_FLDP); in ips_verify_bios()
6470 ips_verify_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_verify_bios_memio() argument
6479 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6480 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6483 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0x55) in ips_verify_bios_memio()
6486 writel(1, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6487 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6489 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0xAA) in ips_verify_bios_memio()
6495 writel(i + offset, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6496 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6500 (uint8_t) checksum + readb(ha->mem_ptr + IPS_REG_FLDP); in ips_verify_bios_memio()
6519 ips_abort_init(ips_ha_t * ha, int index) in ips_abort_init() argument
6521 ha->active = 0; in ips_abort_init()
6522 ips_free(ha); in ips_abort_init()
6658 ips_ha_t *ha, *oldha = ips_ha[index]; in ips_register_scsi() local
6665 ha = IPS_HA(sh); in ips_register_scsi()
6666 memcpy(ha, oldha, sizeof (ips_ha_t)); in ips_register_scsi()
6669 if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { in ips_register_scsi()
6670 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_register_scsi()
6678 sh->unique_id = (ha->io_addr) ? ha->io_addr : ha->mem_addr; in ips_register_scsi()
6684 sh->max_id = ha->ntargets; in ips_register_scsi()
6685 sh->max_lun = ha->nlun; in ips_register_scsi()
6686 sh->max_channel = ha->nbus - 1; in ips_register_scsi()
6687 sh->can_queue = ha->max_cmds - 1; in ips_register_scsi()
6689 if (scsi_add_host(sh, &ha->pcidev->dev)) in ips_register_scsi()
6693 ips_ha[index] = ha; in ips_register_scsi()
6700 free_irq(ha->pcidev->irq, ha); in ips_register_scsi()
6835 ips_ha_t *ha; in ips_init_phase1() local
6895 ha = kzalloc(sizeof (ips_ha_t), GFP_KERNEL); in ips_init_phase1()
6896 if (ha == NULL) { in ips_init_phase1()
6903 ips_ha[index] = ha; in ips_init_phase1()
6904 ha->active = 1; in ips_init_phase1()
6907 ha->io_addr = io_addr; in ips_init_phase1()
6908 ha->io_len = io_len; in ips_init_phase1()
6909 ha->mem_addr = mem_addr; in ips_init_phase1()
6910 ha->mem_len = mem_len; in ips_init_phase1()
6911 ha->mem_ptr = mem_ptr; in ips_init_phase1()
6912 ha->ioremap_ptr = ioremap_ptr; in ips_init_phase1()
6913 ha->host_num = (uint32_t) index; in ips_init_phase1()
6914 ha->slot_num = PCI_SLOT(pci_dev->devfn); in ips_init_phase1()
6915 ha->pcidev = pci_dev; in ips_init_phase1()
6923 if (sizeof(dma_addr_t) > 4 && IPS_HAS_ENH_SGLIST(ha) && in ips_init_phase1()
6924 !dma_set_mask(&ha->pcidev->dev, DMA_BIT_MASK(64))) { in ips_init_phase1()
6925 (ha)->flags |= IPS_HA_ENH_SG; in ips_init_phase1()
6927 if (dma_set_mask(&ha->pcidev->dev, DMA_BIT_MASK(32)) != 0) { in ips_init_phase1()
6929 return ips_abort_init(ha, index); in ips_init_phase1()
6937 ha->enq = dma_alloc_coherent(&pci_dev->dev, sizeof (IPS_ENQ), in ips_init_phase1()
6938 &ha->enq_busaddr, GFP_KERNEL); in ips_init_phase1()
6939 if (!ha->enq) { in ips_init_phase1()
6942 return ips_abort_init(ha, index); in ips_init_phase1()
6945 ha->adapt = dma_alloc_coherent(&pci_dev->dev, in ips_init_phase1()
6948 if (!ha->adapt) { in ips_init_phase1()
6951 return ips_abort_init(ha, index); in ips_init_phase1()
6953 ha->adapt->hw_status_start = dma_address; in ips_init_phase1()
6954 ha->dummy = (void *) (ha->adapt + 1); in ips_init_phase1()
6958 ha->logical_drive_info = dma_alloc_coherent(&pci_dev->dev, in ips_init_phase1()
6960 if (!ha->logical_drive_info) { in ips_init_phase1()
6963 return ips_abort_init(ha, index); in ips_init_phase1()
6965 ha->logical_drive_info_dma_addr = dma_address; in ips_init_phase1()
6968 ha->conf = kmalloc(sizeof (IPS_CONF), GFP_KERNEL); in ips_init_phase1()
6970 if (!ha->conf) { in ips_init_phase1()
6973 return ips_abort_init(ha, index); in ips_init_phase1()
6976 ha->nvram = kmalloc(sizeof (IPS_NVRAM_P5), GFP_KERNEL); in ips_init_phase1()
6978 if (!ha->nvram) { in ips_init_phase1()
6981 return ips_abort_init(ha, index); in ips_init_phase1()
6984 ha->subsys = kmalloc(sizeof (IPS_SUBSYS), GFP_KERNEL); in ips_init_phase1()
6986 if (!ha->subsys) { in ips_init_phase1()
6989 return ips_abort_init(ha, index); in ips_init_phase1()
6997 ha->ioctl_data = dma_alloc_coherent(&pci_dev->dev, ips_ioctlsize, in ips_init_phase1()
6998 &ha->ioctl_busaddr, GFP_KERNEL); in ips_init_phase1()
6999 ha->ioctl_len = ips_ioctlsize; in ips_init_phase1()
7000 if (!ha->ioctl_data) { in ips_init_phase1()
7003 return ips_abort_init(ha, index); in ips_init_phase1()
7009 ips_setup_funclist(ha); in ips_init_phase1()
7011 if ((IPS_IS_MORPHEUS(ha)) || (IPS_IS_MARCO(ha))) { in ips_init_phase1()
7013 IsDead = readl(ha->mem_ptr + IPS_REG_I960_MSG1); in ips_init_phase1()
7015 ips_reset_morpheus(ha); in ips_init_phase1()
7023 if (!(*ha->func.isinit) (ha)) { in ips_init_phase1()
7024 if (!(*ha->func.init) (ha)) { in ips_init_phase1()
7030 return ips_abort_init(ha, index); in ips_init_phase1()
7050 ips_ha_t *ha; in ips_init_phase2() local
7052 ha = ips_ha[index]; in ips_init_phase2()
7055 if (!ha->active) { in ips_init_phase2()
7061 if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { in ips_init_phase2()
7062 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7064 return ips_abort_init(ha, index); in ips_init_phase2()
7070 ha->max_cmds = 1; in ips_init_phase2()
7071 if (!ips_allocatescbs(ha)) { in ips_init_phase2()
7072 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7074 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7075 return ips_abort_init(ha, index); in ips_init_phase2()
7078 if (!ips_hainit(ha)) { in ips_init_phase2()
7079 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7081 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7082 return ips_abort_init(ha, index); in ips_init_phase2()
7085 ips_deallocatescbs(ha, 1); in ips_init_phase2()
7088 if (!ips_allocatescbs(ha)) { in ips_init_phase2()
7089 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7091 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7092 return ips_abort_init(ha, index); in ips_init_phase2()