Lines Matching refs:ha
275 static void ips_free_flash_copperhead(ips_ha_t * ha);
326 static int ips_abort_init(ips_ha_t * ha, int index);
332 static int ips_poll_for_flush_complete(ips_ha_t * ha);
333 static void ips_flush_and_reset(ips_ha_t *ha);
578 ips_setup_funclist(ips_ha_t * ha) in ips_setup_funclist() argument
584 if (IPS_IS_MORPHEUS(ha) || IPS_IS_MARCO(ha)) { in ips_setup_funclist()
586 ha->func.isintr = ips_isintr_morpheus; in ips_setup_funclist()
587 ha->func.isinit = ips_isinit_morpheus; in ips_setup_funclist()
588 ha->func.issue = ips_issue_i2o_memio; in ips_setup_funclist()
589 ha->func.init = ips_init_morpheus; in ips_setup_funclist()
590 ha->func.statupd = ips_statupd_morpheus; in ips_setup_funclist()
591 ha->func.reset = ips_reset_morpheus; in ips_setup_funclist()
592 ha->func.intr = ips_intr_morpheus; in ips_setup_funclist()
593 ha->func.enableint = ips_enable_int_morpheus; in ips_setup_funclist()
594 } else if (IPS_USE_MEMIO(ha)) { in ips_setup_funclist()
596 ha->func.isintr = ips_isintr_copperhead_memio; in ips_setup_funclist()
597 ha->func.isinit = ips_isinit_copperhead_memio; in ips_setup_funclist()
598 ha->func.init = ips_init_copperhead_memio; in ips_setup_funclist()
599 ha->func.statupd = ips_statupd_copperhead_memio; in ips_setup_funclist()
600 ha->func.statinit = ips_statinit_memio; in ips_setup_funclist()
601 ha->func.reset = ips_reset_copperhead_memio; in ips_setup_funclist()
602 ha->func.intr = ips_intr_copperhead; in ips_setup_funclist()
603 ha->func.erasebios = ips_erase_bios_memio; in ips_setup_funclist()
604 ha->func.programbios = ips_program_bios_memio; in ips_setup_funclist()
605 ha->func.verifybios = ips_verify_bios_memio; in ips_setup_funclist()
606 ha->func.enableint = ips_enable_int_copperhead_memio; in ips_setup_funclist()
607 if (IPS_USE_I2O_DELIVER(ha)) in ips_setup_funclist()
608 ha->func.issue = ips_issue_i2o_memio; in ips_setup_funclist()
610 ha->func.issue = ips_issue_copperhead_memio; in ips_setup_funclist()
613 ha->func.isintr = ips_isintr_copperhead; in ips_setup_funclist()
614 ha->func.isinit = ips_isinit_copperhead; in ips_setup_funclist()
615 ha->func.init = ips_init_copperhead; in ips_setup_funclist()
616 ha->func.statupd = ips_statupd_copperhead; in ips_setup_funclist()
617 ha->func.statinit = ips_statinit; in ips_setup_funclist()
618 ha->func.reset = ips_reset_copperhead; in ips_setup_funclist()
619 ha->func.intr = ips_intr_copperhead; in ips_setup_funclist()
620 ha->func.erasebios = ips_erase_bios; in ips_setup_funclist()
621 ha->func.programbios = ips_program_bios; in ips_setup_funclist()
622 ha->func.verifybios = ips_verify_bios; in ips_setup_funclist()
623 ha->func.enableint = ips_enable_int_copperhead; in ips_setup_funclist()
625 if (IPS_USE_I2O_DELIVER(ha)) in ips_setup_funclist()
626 ha->func.issue = ips_issue_i2o; in ips_setup_funclist()
628 ha->func.issue = ips_issue_copperhead; in ips_setup_funclist()
645 ips_ha_t *ha; in ips_release() local
661 ha = IPS_HA(sh); in ips_release()
663 if (!ha) in ips_release()
667 scb = &ha->scbs[ha->max_cmds - 1]; in ips_release()
669 ips_init_scb(ha, scb); in ips_release()
675 scb->cmd.flush_cache.command_id = IPS_COMMAND_ID(ha, scb); in ips_release()
682 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Flushing Cache.\n"); in ips_release()
685 if (ips_send_wait(ha, scb, ips_cmd_timeout, IPS_INTR_ON) == IPS_FAILURE) in ips_release()
686 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Incomplete Flush.\n"); in ips_release()
688 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Flushing Complete.\n"); in ips_release()
694 ips_free(ha); in ips_release()
697 free_irq(ha->pcidev->irq, ha); in ips_release()
719 ips_ha_t *ha; in ips_halt() local
727 ha = (ips_ha_t *) ips_ha[i]; in ips_halt()
729 if (!ha) in ips_halt()
732 if (!ha->active) in ips_halt()
736 scb = &ha->scbs[ha->max_cmds - 1]; in ips_halt()
738 ips_init_scb(ha, scb); in ips_halt()
744 scb->cmd.flush_cache.command_id = IPS_COMMAND_ID(ha, scb); in ips_halt()
751 IPS_PRINTK(KERN_WARNING, ha->pcidev, "Flushing Cache.\n"); in ips_halt()
754 if (ips_send_wait(ha, scb, ips_cmd_timeout, IPS_INTR_ON) == in ips_halt()
756 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_halt()
759 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_halt()
777 ips_ha_t *ha; in ips_eh_abort() local
788 ha = (ips_ha_t *) SC->device->host->hostdata; in ips_eh_abort()
790 if (!ha) in ips_eh_abort()
793 if (!ha->active) in ips_eh_abort()
799 item = ha->copp_waitlist.head; in ips_eh_abort()
805 ips_removeq_copp(&ha->copp_waitlist, item); in ips_eh_abort()
809 } else if (ips_removeq_wait(&ha->scb_waitlist, SC)) { in ips_eh_abort()
836 ips_ha_t *ha; in __ips_eh_reset() local
852 ha = (ips_ha_t *) SC->device->host->hostdata; in __ips_eh_reset()
854 if (!ha) { in __ips_eh_reset()
860 if (!ha->active) in __ips_eh_reset()
864 item = ha->copp_waitlist.head; in __ips_eh_reset()
870 ips_removeq_copp(&ha->copp_waitlist, item); in __ips_eh_reset()
875 if (ips_removeq_wait(&ha->scb_waitlist, SC)) { in __ips_eh_reset()
890 if (ha->ioctl_reset == 0) { /* IF Not an IOCTL Requested Reset */ in __ips_eh_reset()
891 scb = &ha->scbs[ha->max_cmds - 1]; in __ips_eh_reset()
893 ips_init_scb(ha, scb); in __ips_eh_reset()
899 scb->cmd.flush_cache.command_id = IPS_COMMAND_ID(ha, scb); in __ips_eh_reset()
907 ret = ips_send_wait(ha, scb, ips_cmd_timeout, IPS_INTR_IORL); in __ips_eh_reset()
909 IPS_PRINTK(KERN_NOTICE, ha->pcidev, in __ips_eh_reset()
918 ha->ioctl_reset = 0; /* Reset the IOCTL Requested Reset Flag */ in __ips_eh_reset()
924 IPS_PRINTK(KERN_NOTICE, ha->pcidev, "Resetting controller.\n"); in __ips_eh_reset()
925 ret = (*ha->func.reset) (ha); in __ips_eh_reset()
930 IPS_PRINTK(KERN_NOTICE, ha->pcidev, in __ips_eh_reset()
935 ips_name, ha->host_num); in __ips_eh_reset()
937 while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { in __ips_eh_reset()
940 ips_freescb(ha, scb); in __ips_eh_reset()
945 ips_name, ha->host_num); in __ips_eh_reset()
947 while ((scsi_cmd = ips_removeq_wait_head(&ha->scb_waitlist))) { in __ips_eh_reset()
952 ha->active = FALSE; in __ips_eh_reset()
956 if (!ips_clear_adapter(ha, IPS_INTR_IORL)) { in __ips_eh_reset()
959 IPS_PRINTK(KERN_NOTICE, ha->pcidev, in __ips_eh_reset()
964 ips_name, ha->host_num); in __ips_eh_reset()
966 while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { in __ips_eh_reset()
969 ips_freescb(ha, scb); in __ips_eh_reset()
974 ips_name, ha->host_num); in __ips_eh_reset()
976 while ((scsi_cmd = ips_removeq_wait_head(&ha->scb_waitlist))) { in __ips_eh_reset()
981 ha->active = FALSE; in __ips_eh_reset()
986 if (le32_to_cpu(ha->subsys->param[3]) & 0x300000) { in __ips_eh_reset()
987 ha->last_ffdc = ktime_get_real_seconds(); in __ips_eh_reset()
988 ha->reset_count++; in __ips_eh_reset()
989 ips_ffdc_reset(ha, IPS_INTR_IORL); in __ips_eh_reset()
993 DEBUG_VAR(1, "(%s%d) Failing active commands", ips_name, ha->host_num); in __ips_eh_reset()
995 while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { in __ips_eh_reset()
998 ips_freescb(ha, scb); in __ips_eh_reset()
1002 for (i = 1; i < ha->nbus; i++) in __ips_eh_reset()
1003 ha->dcdb_active[i - 1] = 0; in __ips_eh_reset()
1006 ha->num_ioctl = 0; in __ips_eh_reset()
1008 ips_next(ha, IPS_INTR_IORL); in __ips_eh_reset()
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 == TRUE) && (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 == TRUE) && in ips_send_cmd()
3472 (ha->cmd_in_progress == scb->cdb[0])) { in ips_send_cmd()
3473 ha->waitflag = FALSE; in ips_send_cmd()
3539 scb->cmd.logical_info.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3543 scb->data_busaddr = ha->logical_drive_info_dma_addr; in ips_send_cmd()
3552 ips_reqsen(ha, scb); in ips_send_cmd()
3571 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3577 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3617 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3623 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3662 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3665 scb->data_len = sizeof (*ha->enq); in ips_send_cmd()
3666 scb->cmd.basic_io.sg_addr = ha->enq_busaddr; in ips_send_cmd()
3672 scb->cmd.logical_info.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3677 scb->data_busaddr = ha->logical_drive_info_dma_addr; in ips_send_cmd()
3720 if (ha->conf->dev[scb->bus - 1][scb->target_id].ucState == 0) { in ips_send_cmd()
3725 ha->dcdb_active[scb->bus - 1] |= (1 << scb->target_id); in ips_send_cmd()
3726 scb->cmd.dcdb.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3739 if (ha->subsys->param[4] & 0x00100000) { /* If NEW Tape DCDB is Supported */ in ips_send_cmd()
3746 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3785 IPS_USE_ENH_SGLIST(ha) ? 0xFF : 0; in ips_send_cmd()
3823 return ((*ha->func.issue) (ha, scb)); in ips_send_cmd()
3836 ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) in ips_chkstatus() argument
3847 scb = &ha->scbs[pstatus->fields.command_id]; in ips_chkstatus()
3852 sp = &ha->sp; in ips_chkstatus()
3857 ips_removeq_scb(&ha->scb_activelist, scb); in ips_chkstatus()
3865 ha->host_num, in ips_chkstatus()
3884 ips_name, ha->host_num, in ips_chkstatus()
3902 if (!ips_online(ha, scb)) { in ips_chkstatus()
3908 if (ips_online(ha, scb)) { in ips_chkstatus()
3909 ips_inquiry(ha, scb); in ips_chkstatus()
3916 ips_reqsen(ha, scb); in ips_chkstatus()
3928 if (!ips_online(ha, scb) in ips_chkstatus()
3929 || !ips_msense(ha, scb)) { in ips_chkstatus()
3935 if (ips_online(ha, scb)) in ips_chkstatus()
3936 ips_rdcap(ha, scb); in ips_chkstatus()
3975 ips_name, ha->host_num, in ips_chkstatus()
3980 ips_map_status(ha, scb, sp); in ips_chkstatus()
3994 ips_online(ips_ha_t * ha, ips_scb_t * scb) in ips_online() argument
4002 memset(ha->logical_drive_info, 0, sizeof (IPS_LD_INFO)); in ips_online()
4006 if (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()
4012 && ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4029 ips_inquiry(ips_ha_t * ha, ips_scb_t * scb) in ips_inquiry() argument
4064 ips_rdcap(ips_ha_t * ha, ips_scb_t * scb) in ips_rdcap() argument
4075 (ha->logical_drive_info-> in ips_rdcap()
4094 ips_msense(ips_ha_t * ha, ips_scb_t * scb) in ips_msense() argument
4103 if (le32_to_cpu(ha->enq->ulDriveSize[scb->target_id]) > 0x400000 && in ips_msense()
4104 (ha->enq->ucMiscFlag & 0x8) == 0) { in ips_msense()
4113 (le32_to_cpu(ha->enq->ulDriveSize[scb->target_id]) - in ips_msense()
4185 ips_reqsen(ips_ha_t * ha, ips_scb_t * scb) in ips_reqsen() argument
4214 ips_free(ips_ha_t * ha) in ips_free() argument
4219 if (ha) { in ips_free()
4220 if (ha->enq) { in ips_free()
4221 dma_free_coherent(&ha->pcidev->dev, sizeof(IPS_ENQ), in ips_free()
4222 ha->enq, ha->enq_busaddr); in ips_free()
4223 ha->enq = NULL; in ips_free()
4226 kfree(ha->conf); in ips_free()
4227 ha->conf = NULL; in ips_free()
4229 if (ha->adapt) { in ips_free()
4230 dma_free_coherent(&ha->pcidev->dev, in ips_free()
4232 sizeof (IPS_IO_CMD), ha->adapt, in ips_free()
4233 ha->adapt->hw_status_start); in ips_free()
4234 ha->adapt = NULL; in ips_free()
4237 if (ha->logical_drive_info) { in ips_free()
4238 dma_free_coherent(&ha->pcidev->dev, in ips_free()
4240 ha->logical_drive_info, in ips_free()
4241 ha->logical_drive_info_dma_addr); in ips_free()
4242 ha->logical_drive_info = NULL; in ips_free()
4245 kfree(ha->nvram); in ips_free()
4246 ha->nvram = NULL; in ips_free()
4248 kfree(ha->subsys); in ips_free()
4249 ha->subsys = NULL; in ips_free()
4251 if (ha->ioctl_data) { in ips_free()
4252 dma_free_coherent(&ha->pcidev->dev, ha->ioctl_len, in ips_free()
4253 ha->ioctl_data, ha->ioctl_busaddr); in ips_free()
4254 ha->ioctl_data = NULL; in ips_free()
4255 ha->ioctl_datasize = 0; in ips_free()
4256 ha->ioctl_len = 0; in ips_free()
4258 ips_deallocatescbs(ha, ha->max_cmds); in ips_free()
4261 if (ha->mem_ptr) { in ips_free()
4262 iounmap(ha->ioremap_ptr); in ips_free()
4263 ha->ioremap_ptr = NULL; in ips_free()
4264 ha->mem_ptr = NULL; in ips_free()
4267 ha->mem_addr = 0; in ips_free()
4282 ips_deallocatescbs(ips_ha_t * ha, int cmds) in ips_deallocatescbs() argument
4284 if (ha->scbs) { in ips_deallocatescbs()
4285 dma_free_coherent(&ha->pcidev->dev, in ips_deallocatescbs()
4286 IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * cmds, in ips_deallocatescbs()
4287 ha->scbs->sg_list.list, in ips_deallocatescbs()
4288 ha->scbs->sg_busaddr); in ips_deallocatescbs()
4289 dma_free_coherent(&ha->pcidev->dev, sizeof (ips_scb_t) * cmds, in ips_deallocatescbs()
4290 ha->scbs, ha->scbs->scb_busaddr); in ips_deallocatescbs()
4291 ha->scbs = NULL; in ips_deallocatescbs()
4306 ips_allocatescbs(ips_ha_t * ha) in ips_allocatescbs() argument
4316 ha->scbs = dma_alloc_coherent(&ha->pcidev->dev, in ips_allocatescbs()
4317 ha->max_cmds * sizeof (ips_scb_t), in ips_allocatescbs()
4319 if (ha->scbs == NULL) in ips_allocatescbs()
4321 ips_sg.list = dma_alloc_coherent(&ha->pcidev->dev, in ips_allocatescbs()
4322 IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * ha->max_cmds, in ips_allocatescbs()
4325 dma_free_coherent(&ha->pcidev->dev, in ips_allocatescbs()
4326 ha->max_cmds * sizeof (ips_scb_t), ha->scbs, in ips_allocatescbs()
4331 memset(ha->scbs, 0, ha->max_cmds * sizeof (ips_scb_t)); in ips_allocatescbs()
4333 for (i = 0; i < ha->max_cmds; i++) { in ips_allocatescbs()
4334 scb_p = &ha->scbs[i]; in ips_allocatescbs()
4337 if (IPS_USE_ENH_SGLIST(ha)) { in ips_allocatescbs()
4341 sg_dma + IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * i; in ips_allocatescbs()
4346 sg_dma + IPS_SGLIST_SIZE(ha) * IPS_MAX_SG * i; in ips_allocatescbs()
4350 if (i < ha->max_cmds - 1) { in ips_allocatescbs()
4351 scb_p->q_next = ha->scb_freelist; in ips_allocatescbs()
4352 ha->scb_freelist = scb_p; in ips_allocatescbs()
4370 ips_init_scb(ips_ha_t * ha, ips_scb_t * scb) in ips_init_scb() argument
4384 memset(ha->dummy, 0, sizeof (IPS_IO_CMD)); in ips_init_scb()
4387 ha->dummy->op_code = 0xFF; in ips_init_scb()
4388 ha->dummy->ccsar = cpu_to_le32(ha->adapt->hw_status_start in ips_init_scb()
4390 ha->dummy->command_id = IPS_MAX_CMDS; in ips_init_scb()
4399 scb->cmd.basic_io.ccsar = cpu_to_le32(ha->adapt->hw_status_start in ips_init_scb()
4415 ips_getscb(ips_ha_t * ha) in ips_getscb() argument
4421 if ((scb = ha->scb_freelist) == NULL) { in ips_getscb()
4426 ha->scb_freelist = scb->q_next; in ips_getscb()
4430 ips_init_scb(ha, scb); in ips_getscb()
4447 ips_freescb(ips_ha_t * ha, ips_scb_t * scb) in ips_freescb() argument
4454 dma_unmap_single(&ha->pcidev->dev, scb->data_busaddr, in ips_freescb()
4458 if (IPS_COMMAND_ID(ha, scb) < (ha->max_cmds - 1)) { in ips_freescb()
4459 scb->q_next = ha->scb_freelist; in ips_freescb()
4460 ha->scb_freelist = scb; in ips_freescb()
4474 ips_isinit_copperhead(ips_ha_t * ha) in ips_isinit_copperhead() argument
4481 isr = inb(ha->io_addr + IPS_REG_HISR); in ips_isinit_copperhead()
4482 scpr = inb(ha->io_addr + IPS_REG_SCPR); in ips_isinit_copperhead()
4500 ips_isinit_copperhead_memio(ips_ha_t * ha) in ips_isinit_copperhead_memio() argument
4507 isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_isinit_copperhead_memio()
4508 scpr = readb(ha->mem_ptr + IPS_REG_SCPR); in ips_isinit_copperhead_memio()
4526 ips_isinit_morpheus(ips_ha_t * ha) in ips_isinit_morpheus() argument
4533 if (ips_isintr_morpheus(ha)) in ips_isinit_morpheus()
4534 ips_flush_and_reset(ha); in ips_isinit_morpheus()
4536 post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_isinit_morpheus()
4537 bits = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_isinit_morpheus()
4558 ips_flush_and_reset(ips_ha_t *ha) in ips_flush_and_reset() argument
4567 scb = dma_alloc_coherent(&ha->pcidev->dev, sizeof(ips_scb_t), in ips_flush_and_reset()
4571 ips_init_scb(ha, scb); in ips_flush_and_reset()
4585 ret = ips_send_cmd(ha, scb); /* Send the Flush Command */ in ips_flush_and_reset()
4592 done = ips_poll_for_flush_complete(ha); in ips_flush_and_reset()
4601 (*ha->func.reset) (ha); in ips_flush_and_reset()
4603 dma_free_coherent(&ha->pcidev->dev, sizeof(ips_scb_t), scb, command_dma); in ips_flush_and_reset()
4618 ips_poll_for_flush_complete(ips_ha_t * ha) in ips_poll_for_flush_complete() argument
4623 cstatus.value = (*ha->func.statupd) (ha); in ips_poll_for_flush_complete()
4645 ips_enable_int_copperhead(ips_ha_t * ha) in ips_enable_int_copperhead() argument
4649 outb(ha->io_addr + IPS_REG_HISR, IPS_BIT_EI); in ips_enable_int_copperhead()
4650 inb(ha->io_addr + IPS_REG_HISR); /*Ensure PCI Posting Completes*/ in ips_enable_int_copperhead()
4662 ips_enable_int_copperhead_memio(ips_ha_t * ha) in ips_enable_int_copperhead_memio() argument
4666 writeb(IPS_BIT_EI, ha->mem_ptr + IPS_REG_HISR); in ips_enable_int_copperhead_memio()
4667 readb(ha->mem_ptr + IPS_REG_HISR); /*Ensure PCI Posting Completes*/ in ips_enable_int_copperhead_memio()
4679 ips_enable_int_morpheus(ips_ha_t * ha) in ips_enable_int_morpheus() argument
4685 Oimr = readl(ha->mem_ptr + IPS_REG_I960_OIMR); in ips_enable_int_morpheus()
4687 writel(Oimr, ha->mem_ptr + IPS_REG_I960_OIMR); in ips_enable_int_morpheus()
4688 readl(ha->mem_ptr + IPS_REG_I960_OIMR); /*Ensure PCI Posting Completes*/ in ips_enable_int_morpheus()
4701 ips_init_copperhead(ips_ha_t * ha) in ips_init_copperhead() argument
4712 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4724 PostByte[i] = inb(ha->io_addr + IPS_REG_ISPR); in ips_init_copperhead()
4725 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4729 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_copperhead()
4738 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4750 inb(ha->io_addr + IPS_REG_ISPR); in ips_init_copperhead()
4751 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4755 Cbsp = inb(ha->io_addr + IPS_REG_CBSP); in ips_init_copperhead()
4769 outl(0x1010, ha->io_addr + IPS_REG_CCCR); in ips_init_copperhead()
4772 outb(IPS_BIT_EBM, ha->io_addr + IPS_REG_SCPR); in ips_init_copperhead()
4774 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_init_copperhead()
4776 outl(0, ha->io_addr + IPS_REG_NDAE); in ips_init_copperhead()
4779 outb(IPS_BIT_EI, ha->io_addr + IPS_REG_HISR); in ips_init_copperhead()
4794 ips_init_copperhead_memio(ips_ha_t * ha) in ips_init_copperhead_memio() argument
4805 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4817 PostByte[i] = readb(ha->mem_ptr + IPS_REG_ISPR); in ips_init_copperhead_memio()
4818 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4822 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_copperhead_memio()
4831 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4843 readb(ha->mem_ptr + IPS_REG_ISPR); in ips_init_copperhead_memio()
4844 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4848 Cbsp = readb(ha->mem_ptr + IPS_REG_CBSP); in ips_init_copperhead_memio()
4862 writel(0x1010, ha->mem_ptr + IPS_REG_CCCR); in ips_init_copperhead_memio()
4865 writeb(IPS_BIT_EBM, ha->mem_ptr + IPS_REG_SCPR); in ips_init_copperhead_memio()
4867 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_init_copperhead_memio()
4869 writel(0, ha->mem_ptr + IPS_REG_NDAE); in ips_init_copperhead_memio()
4872 writeb(IPS_BIT_EI, ha->mem_ptr + IPS_REG_HISR); in ips_init_copperhead_memio()
4888 ips_init_morpheus(ips_ha_t * ha) in ips_init_morpheus() argument
4900 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4911 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4917 Post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_init_morpheus()
4920 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4925 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4928 Post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); in ips_init_morpheus()
4936 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4945 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4948 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4956 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4967 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_morpheus()
4973 Config = readl(ha->mem_ptr + IPS_REG_I960_MSG1); in ips_init_morpheus()
4977 writel(Isr, ha->mem_ptr + IPS_REG_I2O_HIR); in ips_init_morpheus()
4980 Oimr = readl(ha->mem_ptr + IPS_REG_I960_OIMR); in ips_init_morpheus()
4982 writel(Oimr, ha->mem_ptr + IPS_REG_I960_OIMR); in ips_init_morpheus()
4989 ha->requires_esl = 1; in ips_init_morpheus()
5005 ips_reset_copperhead(ips_ha_t * ha) in ips_reset_copperhead() argument
5012 ips_name, ha->host_num, ha->io_addr, ha->pcidev->irq); in ips_reset_copperhead()
5019 outb(IPS_BIT_RST, ha->io_addr + IPS_REG_SCPR); in ips_reset_copperhead()
5024 outb(0, ha->io_addr + IPS_REG_SCPR); in ips_reset_copperhead()
5029 if ((*ha->func.init) (ha)) in ips_reset_copperhead()
5050 ips_reset_copperhead_memio(ips_ha_t * ha) in ips_reset_copperhead_memio() argument
5057 ips_name, ha->host_num, ha->mem_addr, ha->pcidev->irq); in ips_reset_copperhead_memio()
5064 writeb(IPS_BIT_RST, ha->mem_ptr + IPS_REG_SCPR); in ips_reset_copperhead_memio()
5069 writeb(0, ha->mem_ptr + IPS_REG_SCPR); in ips_reset_copperhead_memio()
5074 if ((*ha->func.init) (ha)) in ips_reset_copperhead_memio()
5095 ips_reset_morpheus(ips_ha_t * ha) in ips_reset_morpheus() argument
5103 ips_name, ha->host_num, ha->mem_addr, ha->pcidev->irq); in ips_reset_morpheus()
5110 writel(0x80000000, ha->mem_ptr + IPS_REG_I960_IDR); in ips_reset_morpheus()
5116 pci_read_config_byte(ha->pcidev, 4, &junk); in ips_reset_morpheus()
5118 if ((*ha->func.init) (ha)) in ips_reset_morpheus()
5139 ips_statinit(ips_ha_t * ha) in ips_statinit() argument
5145 ha->adapt->p_status_start = ha->adapt->status; in ips_statinit()
5146 ha->adapt->p_status_end = ha->adapt->status + IPS_MAX_CMDS; in ips_statinit()
5147 ha->adapt->p_status_tail = ha->adapt->status; in ips_statinit()
5149 phys_status_start = ha->adapt->hw_status_start; in ips_statinit()
5150 outl(phys_status_start, ha->io_addr + IPS_REG_SQSR); in ips_statinit()
5152 ha->io_addr + IPS_REG_SQER); in ips_statinit()
5154 ha->io_addr + IPS_REG_SQHR); in ips_statinit()
5155 outl(phys_status_start, ha->io_addr + IPS_REG_SQTR); in ips_statinit()
5157 ha->adapt->hw_status_tail = phys_status_start; in ips_statinit()
5170 ips_statinit_memio(ips_ha_t * ha) in ips_statinit_memio() argument
5176 ha->adapt->p_status_start = ha->adapt->status; in ips_statinit_memio()
5177 ha->adapt->p_status_end = ha->adapt->status + IPS_MAX_CMDS; in ips_statinit_memio()
5178 ha->adapt->p_status_tail = ha->adapt->status; in ips_statinit_memio()
5180 phys_status_start = ha->adapt->hw_status_start; in ips_statinit_memio()
5181 writel(phys_status_start, ha->mem_ptr + IPS_REG_SQSR); in ips_statinit_memio()
5183 ha->mem_ptr + IPS_REG_SQER); in ips_statinit_memio()
5184 writel(phys_status_start + IPS_STATUS_SIZE, ha->mem_ptr + IPS_REG_SQHR); in ips_statinit_memio()
5185 writel(phys_status_start, ha->mem_ptr + IPS_REG_SQTR); in ips_statinit_memio()
5187 ha->adapt->hw_status_tail = phys_status_start; in ips_statinit_memio()
5200 ips_statupd_copperhead(ips_ha_t * ha) in ips_statupd_copperhead() argument
5204 if (ha->adapt->p_status_tail != ha->adapt->p_status_end) { in ips_statupd_copperhead()
5205 ha->adapt->p_status_tail++; in ips_statupd_copperhead()
5206 ha->adapt->hw_status_tail += sizeof (IPS_STATUS); in ips_statupd_copperhead()
5208 ha->adapt->p_status_tail = ha->adapt->p_status_start; in ips_statupd_copperhead()
5209 ha->adapt->hw_status_tail = ha->adapt->hw_status_start; in ips_statupd_copperhead()
5212 outl(ha->adapt->hw_status_tail, in ips_statupd_copperhead()
5213 ha->io_addr + IPS_REG_SQTR); in ips_statupd_copperhead()
5215 return (ha->adapt->p_status_tail->value); in ips_statupd_copperhead()
5228 ips_statupd_copperhead_memio(ips_ha_t * ha) in ips_statupd_copperhead_memio() argument
5232 if (ha->adapt->p_status_tail != ha->adapt->p_status_end) { in ips_statupd_copperhead_memio()
5233 ha->adapt->p_status_tail++; in ips_statupd_copperhead_memio()
5234 ha->adapt->hw_status_tail += sizeof (IPS_STATUS); in ips_statupd_copperhead_memio()
5236 ha->adapt->p_status_tail = ha->adapt->p_status_start; in ips_statupd_copperhead_memio()
5237 ha->adapt->hw_status_tail = ha->adapt->hw_status_start; in ips_statupd_copperhead_memio()
5240 writel(ha->adapt->hw_status_tail, ha->mem_ptr + IPS_REG_SQTR); in ips_statupd_copperhead_memio()
5242 return (ha->adapt->p_status_tail->value); in ips_statupd_copperhead_memio()
5255 ips_statupd_morpheus(ips_ha_t * ha) in ips_statupd_morpheus() argument
5261 val = readl(ha->mem_ptr + IPS_REG_I2O_OUTMSGQ); in ips_statupd_morpheus()
5276 ips_issue_copperhead(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_copperhead() argument
5286 ha->host_num, in ips_issue_copperhead()
5292 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_copperhead()
5298 le32_to_cpu(inl(ha->io_addr + IPS_REG_CCCR))) & IPS_BIT_SEM) { in ips_issue_copperhead()
5305 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead()
5307 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead()
5314 outl(scb->scb_busaddr, ha->io_addr + IPS_REG_CCSAR); in ips_issue_copperhead()
5315 outw(IPS_BIT_START_CMD, ha->io_addr + IPS_REG_CCCR); in ips_issue_copperhead()
5330 ips_issue_copperhead_memio(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_copperhead_memio() argument
5340 ha->host_num, in ips_issue_copperhead_memio()
5346 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_copperhead_memio()
5351 while ((val = readl(ha->mem_ptr + IPS_REG_CCCR)) & IPS_BIT_SEM) { in ips_issue_copperhead_memio()
5358 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead_memio()
5360 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_issue_copperhead_memio()
5367 writel(scb->scb_busaddr, ha->mem_ptr + IPS_REG_CCSAR); in ips_issue_copperhead_memio()
5368 writel(IPS_BIT_START_CMD, ha->mem_ptr + IPS_REG_CCCR); in ips_issue_copperhead_memio()
5383 ips_issue_i2o(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_i2o() argument
5391 ha->host_num, in ips_issue_i2o()
5397 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_i2o()
5400 outl(scb->scb_busaddr, ha->io_addr + IPS_REG_I2O_INMSGQ); in ips_issue_i2o()
5415 ips_issue_i2o_memio(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_i2o_memio() argument
5423 ha->host_num, in ips_issue_i2o_memio()
5429 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_i2o_memio()
5432 writel(scb->scb_busaddr, ha->mem_ptr + IPS_REG_I2O_INMSGQ); in ips_issue_i2o_memio()
5447 ips_isintr_copperhead(ips_ha_t * ha) in ips_isintr_copperhead() argument
5453 Isr = inb(ha->io_addr + IPS_REG_HISR); in ips_isintr_copperhead()
5464 outb(Isr, ha->io_addr + IPS_REG_HISR); in ips_isintr_copperhead()
5480 ips_isintr_copperhead_memio(ips_ha_t * ha) in ips_isintr_copperhead_memio() argument
5486 Isr = readb(ha->mem_ptr + IPS_REG_HISR); in ips_isintr_copperhead_memio()
5497 writeb(Isr, ha->mem_ptr + IPS_REG_HISR); in ips_isintr_copperhead_memio()
5513 ips_isintr_morpheus(ips_ha_t * ha) in ips_isintr_morpheus() argument
5519 Isr = readl(ha->mem_ptr + IPS_REG_I2O_HIR); in ips_isintr_morpheus()
5537 ips_wait(ips_ha_t * ha, int time, int intr) in ips_wait() argument
5551 if (ha->waitflag == FALSE) { in ips_wait()
5557 if (ha->waitflag == FALSE) { in ips_wait()
5574 (*ha->func.intr) (ha); in ips_wait()
5595 ips_write_driver_status(ips_ha_t * ha, int intr) in ips_write_driver_status() argument
5599 if (!ips_readwrite_page5(ha, FALSE, intr)) { in ips_write_driver_status()
5600 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_write_driver_status()
5608 if (le32_to_cpu(ha->nvram->signature) != IPS_NVRAM_P5_SIG) { in ips_write_driver_status()
5611 ips_name, ha->host_num, ha->nvram->signature); in ips_write_driver_status()
5612 ha->nvram->signature = IPS_NVRAM_P5_SIG; in ips_write_driver_status()
5617 ips_name, ha->host_num, le16_to_cpu(ha->nvram->adapter_type), in ips_write_driver_status()
5618 ha->nvram->adapter_slot, ha->nvram->bios_high[0], in ips_write_driver_status()
5619 ha->nvram->bios_high[1], ha->nvram->bios_high[2], in ips_write_driver_status()
5620 ha->nvram->bios_high[3], ha->nvram->bios_low[0], in ips_write_driver_status()
5621 ha->nvram->bios_low[1], ha->nvram->bios_low[2], in ips_write_driver_status()
5622 ha->nvram->bios_low[3]); in ips_write_driver_status()
5624 ips_get_bios_version(ha, intr); in ips_write_driver_status()
5627 ha->nvram->operating_system = IPS_OS_LINUX; in ips_write_driver_status()
5628 ha->nvram->adapter_type = ha->ad_type; in ips_write_driver_status()
5629 memcpy((char *) ha->nvram->driver_high, IPS_VERSION_HIGH, 4); in ips_write_driver_status()
5630 memcpy((char *) ha->nvram->driver_low, IPS_VERSION_LOW, 4); in ips_write_driver_status()
5631 memcpy((char *) ha->nvram->bios_high, ha->bios_version, 4); in ips_write_driver_status()
5632 memcpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4); in ips_write_driver_status()
5634 ha->nvram->versioning = 0; /* Indicate the Driver Does Not Support Versioning */ in ips_write_driver_status()
5637 if (!ips_readwrite_page5(ha, TRUE, intr)) { in ips_write_driver_status()
5638 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_write_driver_status()
5645 ha->slot_num = ha->nvram->adapter_slot; in ips_write_driver_status()
5660 ips_read_adapter_status(ips_ha_t * ha, int intr) in ips_read_adapter_status() argument
5667 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_adapter_status()
5669 ips_init_scb(ha, scb); in ips_read_adapter_status()
5675 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_adapter_status()
5680 scb->data_len = sizeof (*ha->enq); in ips_read_adapter_status()
5681 scb->cmd.basic_io.sg_addr = ha->enq_busaddr; in ips_read_adapter_status()
5685 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_adapter_status()
5703 ips_read_subsystem_parameters(ips_ha_t * ha, int intr) in ips_read_subsystem_parameters() argument
5710 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_subsystem_parameters()
5712 ips_init_scb(ha, scb); in ips_read_subsystem_parameters()
5718 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_subsystem_parameters()
5723 scb->data_len = sizeof (*ha->subsys); in ips_read_subsystem_parameters()
5724 scb->cmd.basic_io.sg_addr = ha->ioctl_busaddr; in ips_read_subsystem_parameters()
5728 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_subsystem_parameters()
5733 memcpy(ha->subsys, ha->ioctl_data, sizeof(*ha->subsys)); in ips_read_subsystem_parameters()
5747 ips_read_config(ips_ha_t * ha, int intr) in ips_read_config() argument
5757 ha->conf->init_id[i] = 7; in ips_read_config()
5759 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_config()
5761 ips_init_scb(ha, scb); in ips_read_config()
5767 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_config()
5768 scb->data_len = sizeof (*ha->conf); in ips_read_config()
5769 scb->cmd.basic_io.sg_addr = ha->ioctl_busaddr; in ips_read_config()
5773 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_config()
5777 memset(ha->conf, 0, sizeof (IPS_CONF)); in ips_read_config()
5781 ha->conf->init_id[i] = 7; in ips_read_config()
5791 memcpy(ha->conf, ha->ioctl_data, sizeof(*ha->conf)); in ips_read_config()
5805 ips_readwrite_page5(ips_ha_t * ha, int write, int intr) in ips_readwrite_page5() argument
5812 scb = &ha->scbs[ha->max_cmds - 1]; in ips_readwrite_page5()
5814 ips_init_scb(ha, scb); in ips_readwrite_page5()
5820 scb->cmd.nvram.command_id = IPS_COMMAND_ID(ha, scb); in ips_readwrite_page5()
5825 scb->data_len = sizeof (*ha->nvram); in ips_readwrite_page5()
5826 scb->cmd.nvram.buffer_addr = ha->ioctl_busaddr; in ips_readwrite_page5()
5828 memcpy(ha->ioctl_data, ha->nvram, sizeof(*ha->nvram)); in ips_readwrite_page5()
5832 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_readwrite_page5()
5836 memset(ha->nvram, 0, sizeof (IPS_NVRAM_P5)); in ips_readwrite_page5()
5841 memcpy(ha->nvram, ha->ioctl_data, sizeof(*ha->nvram)); in ips_readwrite_page5()
5855 ips_clear_adapter(ips_ha_t * ha, int intr) in ips_clear_adapter() argument
5862 scb = &ha->scbs[ha->max_cmds - 1]; in ips_clear_adapter()
5864 ips_init_scb(ha, scb); in ips_clear_adapter()
5870 scb->cmd.config_sync.command_id = IPS_COMMAND_ID(ha, scb); in ips_clear_adapter()
5879 ips_send_wait(ha, scb, ips_reset_timeout, intr)) == IPS_FAILURE) in ips_clear_adapter()
5885 ips_init_scb(ha, scb); in ips_clear_adapter()
5891 scb->cmd.unlock_stripe.command_id = IPS_COMMAND_ID(ha, scb); in ips_clear_adapter()
5900 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_clear_adapter()
5918 ips_ffdc_reset(ips_ha_t * ha, int intr) in ips_ffdc_reset() argument
5924 scb = &ha->scbs[ha->max_cmds - 1]; in ips_ffdc_reset()
5926 ips_init_scb(ha, scb); in ips_ffdc_reset()
5931 scb->cmd.ffdc.command_id = IPS_COMMAND_ID(ha, scb); in ips_ffdc_reset()
5932 scb->cmd.ffdc.reset_count = ha->reset_count; in ips_ffdc_reset()
5936 ips_fix_ffdc_time(ha, scb, ha->last_ffdc); in ips_ffdc_reset()
5939 ips_send_wait(ha, scb, ips_cmd_timeout, intr); in ips_ffdc_reset()
5952 ips_ffdc_time(ips_ha_t * ha) in ips_ffdc_time() argument
5958 DEBUG_VAR(1, "(%s%d) Sending time update.", ips_name, ha->host_num); in ips_ffdc_time()
5960 scb = &ha->scbs[ha->max_cmds - 1]; in ips_ffdc_time()
5962 ips_init_scb(ha, scb); in ips_ffdc_time()
5967 scb->cmd.ffdc.command_id = IPS_COMMAND_ID(ha, scb); in ips_ffdc_time()
5972 ips_fix_ffdc_time(ha, scb, ha->last_ffdc); in ips_ffdc_time()
5975 ips_send_wait(ha, scb, ips_cmd_timeout, IPS_FFDC); in ips_ffdc_time()
5987 ips_fix_ffdc_time(ips_ha_t * ha, ips_scb_t * scb, time64_t current_time) in ips_fix_ffdc_time() argument
6017 ips_erase_bios(ips_ha_t * ha) in ips_erase_bios() argument
6027 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6028 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6031 outb(0x50, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6032 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6036 outb(0x20, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6037 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6041 outb(0xD0, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6042 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6046 outb(0x70, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6047 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6053 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios()
6054 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6058 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6072 outb(0xB0, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6073 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6079 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios()
6080 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_erase_bios()
6084 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6108 outb(0x50, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6109 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6113 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_erase_bios()
6114 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios()
6129 ips_erase_bios_memio(ips_ha_t * ha) in ips_erase_bios_memio() argument
6139 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6140 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6143 writeb(0x50, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6144 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6148 writeb(0x20, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6149 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6153 writeb(0xD0, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6154 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6158 writeb(0x70, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6159 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6165 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios_memio()
6166 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6170 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6184 writeb(0xB0, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6185 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6191 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_erase_bios_memio()
6192 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_erase_bios_memio()
6196 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6220 writeb(0x50, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6221 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6225 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_erase_bios_memio()
6226 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_erase_bios_memio()
6241 ips_program_bios(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_program_bios() argument
6254 outl(i + offset, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6255 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6258 outb(0x40, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6259 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6262 outb(buffer[i], ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6263 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6269 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_program_bios()
6270 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6274 status = inb(ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6285 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6286 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6289 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6290 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6299 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6300 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6303 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6304 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6312 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_program_bios()
6313 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6316 outb(0xFF, ha->io_addr + IPS_REG_FLDP); in ips_program_bios()
6317 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios()
6332 ips_program_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_program_bios_memio() argument
6345 writel(i + offset, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6346 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6349 writeb(0x40, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6350 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6353 writeb(buffer[i], ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6354 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6360 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) { in ips_program_bios_memio()
6361 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6365 status = readb(ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6376 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6377 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6380 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6381 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6390 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6391 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6394 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6395 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6403 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_program_bios_memio()
6404 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6407 writeb(0xFF, ha->mem_ptr + IPS_REG_FLDP); in ips_program_bios_memio()
6408 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_program_bios_memio()
6423 ips_verify_bios(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_verify_bios() argument
6432 outl(0, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6433 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6436 if (inb(ha->io_addr + IPS_REG_FLDP) != 0x55) in ips_verify_bios()
6439 outl(1, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6440 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6442 if (inb(ha->io_addr + IPS_REG_FLDP) != 0xAA) in ips_verify_bios()
6448 outl(i + offset, ha->io_addr + IPS_REG_FLAP); in ips_verify_bios()
6449 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios()
6452 checksum = (uint8_t) checksum + inb(ha->io_addr + IPS_REG_FLDP); in ips_verify_bios()
6472 ips_verify_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize, in ips_verify_bios_memio() argument
6481 writel(0, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6482 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6485 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0x55) in ips_verify_bios_memio()
6488 writel(1, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6489 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6491 if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0xAA) in ips_verify_bios_memio()
6497 writel(i + offset, ha->mem_ptr + IPS_REG_FLAP); in ips_verify_bios_memio()
6498 if (ha->pcidev->revision == IPS_REVID_TROMBONE64) in ips_verify_bios_memio()
6502 (uint8_t) checksum + readb(ha->mem_ptr + IPS_REG_FLDP); in ips_verify_bios_memio()
6521 ips_abort_init(ips_ha_t * ha, int index) in ips_abort_init() argument
6523 ha->active = 0; in ips_abort_init()
6524 ips_free(ha); in ips_abort_init()
6660 ips_ha_t *ha, *oldha = ips_ha[index]; in ips_register_scsi() local
6667 ha = IPS_HA(sh); in ips_register_scsi()
6668 memcpy(ha, oldha, sizeof (ips_ha_t)); in ips_register_scsi()
6671 if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { in ips_register_scsi()
6672 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_register_scsi()
6680 sh->unique_id = (ha->io_addr) ? ha->io_addr : ha->mem_addr; in ips_register_scsi()
6686 sh->max_id = ha->ntargets; in ips_register_scsi()
6687 sh->max_lun = ha->nlun; in ips_register_scsi()
6688 sh->max_channel = ha->nbus - 1; in ips_register_scsi()
6689 sh->can_queue = ha->max_cmds - 1; in ips_register_scsi()
6691 if (scsi_add_host(sh, &ha->pcidev->dev)) in ips_register_scsi()
6695 ips_ha[index] = ha; in ips_register_scsi()
6702 free_irq(ha->pcidev->irq, ha); in ips_register_scsi()
6837 ips_ha_t *ha; in ips_init_phase1() local
6897 ha = kzalloc(sizeof (ips_ha_t), GFP_KERNEL); in ips_init_phase1()
6898 if (ha == NULL) { in ips_init_phase1()
6905 ips_ha[index] = ha; in ips_init_phase1()
6906 ha->active = 1; in ips_init_phase1()
6909 ha->io_addr = io_addr; in ips_init_phase1()
6910 ha->io_len = io_len; in ips_init_phase1()
6911 ha->mem_addr = mem_addr; in ips_init_phase1()
6912 ha->mem_len = mem_len; in ips_init_phase1()
6913 ha->mem_ptr = mem_ptr; in ips_init_phase1()
6914 ha->ioremap_ptr = ioremap_ptr; in ips_init_phase1()
6915 ha->host_num = (uint32_t) index; in ips_init_phase1()
6916 ha->slot_num = PCI_SLOT(pci_dev->devfn); in ips_init_phase1()
6917 ha->pcidev = pci_dev; in ips_init_phase1()
6925 if (sizeof(dma_addr_t) > 4 && IPS_HAS_ENH_SGLIST(ha) && in ips_init_phase1()
6926 !dma_set_mask(&ha->pcidev->dev, DMA_BIT_MASK(64))) { in ips_init_phase1()
6927 (ha)->flags |= IPS_HA_ENH_SG; in ips_init_phase1()
6929 if (dma_set_mask(&ha->pcidev->dev, DMA_BIT_MASK(32)) != 0) { in ips_init_phase1()
6931 return ips_abort_init(ha, index); in ips_init_phase1()
6939 ha->enq = dma_alloc_coherent(&pci_dev->dev, sizeof (IPS_ENQ), in ips_init_phase1()
6940 &ha->enq_busaddr, GFP_KERNEL); in ips_init_phase1()
6941 if (!ha->enq) { in ips_init_phase1()
6944 return ips_abort_init(ha, index); in ips_init_phase1()
6947 ha->adapt = dma_alloc_coherent(&pci_dev->dev, in ips_init_phase1()
6950 if (!ha->adapt) { in ips_init_phase1()
6953 return ips_abort_init(ha, index); in ips_init_phase1()
6955 ha->adapt->hw_status_start = dma_address; in ips_init_phase1()
6956 ha->dummy = (void *) (ha->adapt + 1); in ips_init_phase1()
6960 ha->logical_drive_info = dma_alloc_coherent(&pci_dev->dev, in ips_init_phase1()
6962 if (!ha->logical_drive_info) { in ips_init_phase1()
6965 return ips_abort_init(ha, index); in ips_init_phase1()
6967 ha->logical_drive_info_dma_addr = dma_address; in ips_init_phase1()
6970 ha->conf = kmalloc(sizeof (IPS_CONF), GFP_KERNEL); in ips_init_phase1()
6972 if (!ha->conf) { in ips_init_phase1()
6975 return ips_abort_init(ha, index); in ips_init_phase1()
6978 ha->nvram = kmalloc(sizeof (IPS_NVRAM_P5), GFP_KERNEL); in ips_init_phase1()
6980 if (!ha->nvram) { in ips_init_phase1()
6983 return ips_abort_init(ha, index); in ips_init_phase1()
6986 ha->subsys = kmalloc(sizeof (IPS_SUBSYS), GFP_KERNEL); in ips_init_phase1()
6988 if (!ha->subsys) { in ips_init_phase1()
6991 return ips_abort_init(ha, index); in ips_init_phase1()
6999 ha->ioctl_data = dma_alloc_coherent(&pci_dev->dev, ips_ioctlsize, in ips_init_phase1()
7000 &ha->ioctl_busaddr, GFP_KERNEL); in ips_init_phase1()
7001 ha->ioctl_len = ips_ioctlsize; in ips_init_phase1()
7002 if (!ha->ioctl_data) { in ips_init_phase1()
7005 return ips_abort_init(ha, index); in ips_init_phase1()
7011 ips_setup_funclist(ha); in ips_init_phase1()
7013 if ((IPS_IS_MORPHEUS(ha)) || (IPS_IS_MARCO(ha))) { in ips_init_phase1()
7015 IsDead = readl(ha->mem_ptr + IPS_REG_I960_MSG1); in ips_init_phase1()
7017 ips_reset_morpheus(ha); in ips_init_phase1()
7025 if (!(*ha->func.isinit) (ha)) { in ips_init_phase1()
7026 if (!(*ha->func.init) (ha)) { in ips_init_phase1()
7032 return ips_abort_init(ha, index); in ips_init_phase1()
7052 ips_ha_t *ha; in ips_init_phase2() local
7054 ha = ips_ha[index]; in ips_init_phase2()
7057 if (!ha->active) { in ips_init_phase2()
7063 if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { in ips_init_phase2()
7064 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7066 return ips_abort_init(ha, index); in ips_init_phase2()
7072 ha->max_cmds = 1; in ips_init_phase2()
7073 if (!ips_allocatescbs(ha)) { in ips_init_phase2()
7074 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7076 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7077 return ips_abort_init(ha, index); in ips_init_phase2()
7080 if (!ips_hainit(ha)) { in ips_init_phase2()
7081 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7083 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7084 return ips_abort_init(ha, index); in ips_init_phase2()
7087 ips_deallocatescbs(ha, 1); in ips_init_phase2()
7090 if (!ips_allocatescbs(ha)) { in ips_init_phase2()
7091 IPS_PRINTK(KERN_WARNING, ha->pcidev, in ips_init_phase2()
7093 free_irq(ha->pcidev->irq, ha); in ips_init_phase2()
7094 return ips_abort_init(ha, index); in ips_init_phase2()