• Home
  • Raw
  • Download

Lines Matching refs:acb

82 static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb,
84 static int arcmsr_iop_confirm(struct AdapterControlBlock *acb);
96 static void arcmsr_iop_init(struct AdapterControlBlock *acb);
97 static void arcmsr_free_ccb_pool(struct AdapterControlBlock *acb);
98 static u32 arcmsr_disable_outbound_ints(struct AdapterControlBlock *acb);
99 static void arcmsr_enable_outbound_ints(struct AdapterControlBlock *acb,
101 static void arcmsr_stop_adapter_bgrb(struct AdapterControlBlock *acb);
102 static void arcmsr_hbaA_flush_cache(struct AdapterControlBlock *acb);
103 static void arcmsr_hbaB_flush_cache(struct AdapterControlBlock *acb);
105 static void arcmsr_hbaA_request_device_map(struct AdapterControlBlock *acb);
106 static void arcmsr_hbaB_request_device_map(struct AdapterControlBlock *acb);
107 static void arcmsr_hbaC_request_device_map(struct AdapterControlBlock *acb);
109 static bool arcmsr_get_firmware_spec(struct AdapterControlBlock *acb);
110 static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb);
112 static void arcmsr_hbaD_message_isr(struct AdapterControlBlock *acb);
113 static void arcmsr_hardware_reset(struct AdapterControlBlock *acb);
115 static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb);
202 static void arcmsr_free_mu(struct AdapterControlBlock *acb) in arcmsr_free_mu() argument
204 switch (acb->adapter_type) { in arcmsr_free_mu()
207 dma_free_coherent(&acb->pdev->dev, acb->roundup_ccbsize, in arcmsr_free_mu()
208 acb->dma_coherent2, acb->dma_coherent_handle2); in arcmsr_free_mu()
214 static bool arcmsr_remap_pciregion(struct AdapterControlBlock *acb) in arcmsr_remap_pciregion() argument
216 struct pci_dev *pdev = acb->pdev; in arcmsr_remap_pciregion()
217 switch (acb->adapter_type){ in arcmsr_remap_pciregion()
219 acb->pmuA = ioremap(pci_resource_start(pdev,0), pci_resource_len(pdev,0)); in arcmsr_remap_pciregion()
220 if (!acb->pmuA) { in arcmsr_remap_pciregion()
221 printk(KERN_NOTICE "arcmsr%d: memory mapping region fail \n", acb->host->host_no); in arcmsr_remap_pciregion()
230 printk(KERN_NOTICE "arcmsr%d: memory mapping region fail \n", acb->host->host_no); in arcmsr_remap_pciregion()
236 printk(KERN_NOTICE "arcmsr%d: memory mapping region fail \n", acb->host->host_no); in arcmsr_remap_pciregion()
239 acb->mem_base0 = mem_base0; in arcmsr_remap_pciregion()
240 acb->mem_base1 = mem_base1; in arcmsr_remap_pciregion()
244 acb->pmuC = ioremap_nocache(pci_resource_start(pdev, 1), pci_resource_len(pdev, 1)); in arcmsr_remap_pciregion()
245 if (!acb->pmuC) { in arcmsr_remap_pciregion()
246 printk(KERN_NOTICE "arcmsr%d: memory mapping region fail \n", acb->host->host_no); in arcmsr_remap_pciregion()
249 if (readl(&acb->pmuC->outbound_doorbell) & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { in arcmsr_remap_pciregion()
250 …writel(ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE_DOORBELL_CLEAR, &acb->pmuC->outbound_doorbell_clear);… in arcmsr_remap_pciregion()
265 acb->host->host_no); in arcmsr_remap_pciregion()
268 acb->mem_base0 = mem_base0; in arcmsr_remap_pciregion()
275 static void arcmsr_unmap_pciregion(struct AdapterControlBlock *acb) in arcmsr_unmap_pciregion() argument
277 switch (acb->adapter_type) { in arcmsr_unmap_pciregion()
279 iounmap(acb->pmuA); in arcmsr_unmap_pciregion()
283 iounmap(acb->mem_base0); in arcmsr_unmap_pciregion()
284 iounmap(acb->mem_base1); in arcmsr_unmap_pciregion()
289 iounmap(acb->pmuC); in arcmsr_unmap_pciregion()
293 iounmap(acb->mem_base0); in arcmsr_unmap_pciregion()
301 struct AdapterControlBlock *acb = dev_id; in arcmsr_do_interrupt() local
303 handle_state = arcmsr_interrupt(acb); in arcmsr_do_interrupt()
335 static uint8_t arcmsr_hbaA_wait_msgint_ready(struct AdapterControlBlock *acb) in arcmsr_hbaA_wait_msgint_ready() argument
337 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_hbaA_wait_msgint_ready()
353 static uint8_t arcmsr_hbaB_wait_msgint_ready(struct AdapterControlBlock *acb) in arcmsr_hbaB_wait_msgint_ready() argument
355 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_hbaB_wait_msgint_ready()
408 static void arcmsr_hbaA_flush_cache(struct AdapterControlBlock *acb) in arcmsr_hbaA_flush_cache() argument
410 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_hbaA_flush_cache()
414 if (arcmsr_hbaA_wait_msgint_ready(acb)) in arcmsr_hbaA_flush_cache()
419 timeout, retry count down = %d \n", acb->host->host_no, retry_count); in arcmsr_hbaA_flush_cache()
424 static void arcmsr_hbaB_flush_cache(struct AdapterControlBlock *acb) in arcmsr_hbaB_flush_cache() argument
426 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_hbaB_flush_cache()
430 if (arcmsr_hbaB_wait_msgint_ready(acb)) in arcmsr_hbaB_flush_cache()
435 timeout,retry count down = %d \n", acb->host->host_no, retry_count); in arcmsr_hbaB_flush_cache()
475 static void arcmsr_flush_adapter_cache(struct AdapterControlBlock *acb) in arcmsr_flush_adapter_cache() argument
477 switch (acb->adapter_type) { in arcmsr_flush_adapter_cache()
480 arcmsr_hbaA_flush_cache(acb); in arcmsr_flush_adapter_cache()
485 arcmsr_hbaB_flush_cache(acb); in arcmsr_flush_adapter_cache()
489 arcmsr_hbaC_flush_cache(acb); in arcmsr_flush_adapter_cache()
493 arcmsr_hbaD_flush_cache(acb); in arcmsr_flush_adapter_cache()
498 static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb) in arcmsr_alloc_ccb_pool() argument
500 struct pci_dev *pdev = acb->pdev; in arcmsr_alloc_ccb_pool()
513 acb->devstate[i][j] = ARECA_RAID_GONE; in arcmsr_alloc_ccb_pool()
517 firm_config_version = acb->firm_cfg_version; in arcmsr_alloc_ccb_pool()
522 acb->host->max_sectors = max_xfer_len/512; in arcmsr_alloc_ccb_pool()
523 acb->host->sg_tablesize = max_sg_entrys; in arcmsr_alloc_ccb_pool()
525 acb->uncache_size = roundup_ccbsize * ARCMSR_MAX_FREECCB_NUM; in arcmsr_alloc_ccb_pool()
526 dma_coherent = dma_alloc_coherent(&pdev->dev, acb->uncache_size, &dma_coherent_handle, GFP_KERNEL); in arcmsr_alloc_ccb_pool()
528 printk(KERN_NOTICE "arcmsr%d: dma_alloc_coherent got error\n", acb->host->host_no); in arcmsr_alloc_ccb_pool()
531 acb->dma_coherent = dma_coherent; in arcmsr_alloc_ccb_pool()
532 acb->dma_coherent_handle = dma_coherent_handle; in arcmsr_alloc_ccb_pool()
533 memset(dma_coherent, 0, acb->uncache_size); in arcmsr_alloc_ccb_pool()
535 acb->vir2phy_offset = (unsigned long)dma_coherent - (unsigned long)dma_coherent_handle; in arcmsr_alloc_ccb_pool()
538 switch (acb->adapter_type) { in arcmsr_alloc_ccb_pool()
548 acb->pccb_pool[i] = ccb_tmp; in arcmsr_alloc_ccb_pool()
549 ccb_tmp->acb = acb; in arcmsr_alloc_ccb_pool()
551 list_add_tail(&ccb_tmp->list, &acb->ccb_free_list); in arcmsr_alloc_ccb_pool()
560 struct AdapterControlBlock *acb = container_of(work, in arcmsr_message_isr_bh_fn() local
562 char *acb_dev_map = (char *)acb->device_map; in arcmsr_message_isr_bh_fn()
569 switch (acb->adapter_type) { in arcmsr_message_isr_bh_fn()
571 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_message_isr_bh_fn()
578 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_message_isr_bh_fn()
585 struct MessageUnit_C __iomem *reg = acb->pmuC; in arcmsr_message_isr_bh_fn()
592 struct MessageUnit_D *reg = acb->pmuD; in arcmsr_message_isr_bh_fn()
599 atomic_inc(&acb->rq_map_token); in arcmsr_message_isr_bh_fn()
612 scsi_add_device(acb->host, in arcmsr_message_isr_bh_fn()
616 psdev = scsi_device_lookup(acb->host, in arcmsr_message_isr_bh_fn()
633 arcmsr_request_irq(struct pci_dev *pdev, struct AdapterControlBlock *acb) in arcmsr_request_irq() argument
643 acb->msix_vector_count = r; in arcmsr_request_irq()
646 arcmsr_do_interrupt, 0, "arcmsr", acb)) { in arcmsr_request_irq()
648 acb->host->host_no, entries[i].vector); in arcmsr_request_irq()
650 free_irq(entries[j].vector, acb); in arcmsr_request_irq()
654 acb->entries[i] = entries[i]; in arcmsr_request_irq()
656 acb->acb_flags |= ACB_F_MSIX_ENABLED; in arcmsr_request_irq()
657 pr_info("arcmsr%d: msi-x enabled\n", acb->host->host_no); in arcmsr_request_irq()
663 IRQF_SHARED, "arcmsr", acb)) { in arcmsr_request_irq()
665 acb->host->host_no, pdev->irq); in arcmsr_request_irq()
669 acb->acb_flags |= ACB_F_MSI_ENABLED; in arcmsr_request_irq()
670 pr_info("arcmsr%d: msi enabled\n", acb->host->host_no); in arcmsr_request_irq()
674 IRQF_SHARED, "arcmsr", acb)) { in arcmsr_request_irq()
676 acb->host->host_no, pdev->irq); in arcmsr_request_irq()
685 struct AdapterControlBlock *acb; in arcmsr_probe() local
709 acb = (struct AdapterControlBlock *) host->hostdata; in arcmsr_probe()
710 memset(acb,0,sizeof(struct AdapterControlBlock)); in arcmsr_probe()
711 acb->pdev = pdev; in arcmsr_probe()
712 acb->host = host; in arcmsr_probe()
726 spin_lock_init(&acb->eh_lock); in arcmsr_probe()
727 spin_lock_init(&acb->ccblist_lock); in arcmsr_probe()
728 spin_lock_init(&acb->postq_lock); in arcmsr_probe()
729 spin_lock_init(&acb->doneq_lock); in arcmsr_probe()
730 spin_lock_init(&acb->rqbuffer_lock); in arcmsr_probe()
731 spin_lock_init(&acb->wqbuffer_lock); in arcmsr_probe()
732 acb->acb_flags |= (ACB_F_MESSAGE_WQBUFFER_CLEARED | in arcmsr_probe()
735 acb->acb_flags &= ~ACB_F_SCSISTOPADAPTER; in arcmsr_probe()
736 INIT_LIST_HEAD(&acb->ccb_free_list); in arcmsr_probe()
737 acb->adapter_type = id->driver_data; in arcmsr_probe()
738 error = arcmsr_remap_pciregion(acb); in arcmsr_probe()
742 error = arcmsr_get_firmware_spec(acb); in arcmsr_probe()
746 error = arcmsr_alloc_ccb_pool(acb); in arcmsr_probe()
754 if (arcmsr_request_irq(pdev, acb) == FAILED) in arcmsr_probe()
756 arcmsr_iop_init(acb); in arcmsr_probe()
757 INIT_WORK(&acb->arcmsr_do_message_isr_bh, arcmsr_message_isr_bh_fn); in arcmsr_probe()
758 atomic_set(&acb->rq_map_token, 16); in arcmsr_probe()
759 atomic_set(&acb->ante_token_value, 16); in arcmsr_probe()
760 acb->fw_flag = FW_NORMAL; in arcmsr_probe()
761 init_timer(&acb->eternal_timer); in arcmsr_probe()
762 acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6 * HZ); in arcmsr_probe()
763 acb->eternal_timer.data = (unsigned long) acb; in arcmsr_probe()
764 acb->eternal_timer.function = &arcmsr_request_device_map; in arcmsr_probe()
765 add_timer(&acb->eternal_timer); in arcmsr_probe()
766 if(arcmsr_alloc_sysfs_attr(acb)) in arcmsr_probe()
771 del_timer_sync(&acb->eternal_timer); in arcmsr_probe()
772 flush_work(&acb->arcmsr_do_message_isr_bh); in arcmsr_probe()
773 arcmsr_stop_adapter_bgrb(acb); in arcmsr_probe()
774 arcmsr_flush_adapter_cache(acb); in arcmsr_probe()
775 arcmsr_free_irq(pdev, acb); in arcmsr_probe()
779 arcmsr_free_ccb_pool(acb); in arcmsr_probe()
781 arcmsr_free_mu(acb); in arcmsr_probe()
783 arcmsr_unmap_pciregion(acb); in arcmsr_probe()
794 struct AdapterControlBlock *acb) in arcmsr_free_irq() argument
798 if (acb->acb_flags & ACB_F_MSI_ENABLED) { in arcmsr_free_irq()
799 free_irq(pdev->irq, acb); in arcmsr_free_irq()
801 } else if (acb->acb_flags & ACB_F_MSIX_ENABLED) { in arcmsr_free_irq()
802 for (i = 0; i < acb->msix_vector_count; i++) in arcmsr_free_irq()
803 free_irq(acb->entries[i].vector, acb); in arcmsr_free_irq()
806 free_irq(pdev->irq, acb); in arcmsr_free_irq()
813 struct AdapterControlBlock *acb = in arcmsr_suspend() local
816 intmask_org = arcmsr_disable_outbound_ints(acb); in arcmsr_suspend()
817 arcmsr_free_irq(pdev, acb); in arcmsr_suspend()
818 del_timer_sync(&acb->eternal_timer); in arcmsr_suspend()
819 flush_work(&acb->arcmsr_do_message_isr_bh); in arcmsr_suspend()
820 arcmsr_stop_adapter_bgrb(acb); in arcmsr_suspend()
821 arcmsr_flush_adapter_cache(acb); in arcmsr_suspend()
833 struct AdapterControlBlock *acb = in arcmsr_resume() local
853 if (arcmsr_request_irq(pdev, acb) == FAILED) in arcmsr_resume()
855 arcmsr_iop_init(acb); in arcmsr_resume()
856 INIT_WORK(&acb->arcmsr_do_message_isr_bh, arcmsr_message_isr_bh_fn); in arcmsr_resume()
857 atomic_set(&acb->rq_map_token, 16); in arcmsr_resume()
858 atomic_set(&acb->ante_token_value, 16); in arcmsr_resume()
859 acb->fw_flag = FW_NORMAL; in arcmsr_resume()
860 init_timer(&acb->eternal_timer); in arcmsr_resume()
861 acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6 * HZ); in arcmsr_resume()
862 acb->eternal_timer.data = (unsigned long) acb; in arcmsr_resume()
863 acb->eternal_timer.function = &arcmsr_request_device_map; in arcmsr_resume()
864 add_timer(&acb->eternal_timer); in arcmsr_resume()
867 arcmsr_stop_adapter_bgrb(acb); in arcmsr_resume()
868 arcmsr_flush_adapter_cache(acb); in arcmsr_resume()
871 arcmsr_free_ccb_pool(acb); in arcmsr_resume()
872 arcmsr_unmap_pciregion(acb); in arcmsr_resume()
879 static uint8_t arcmsr_hbaA_abort_allcmd(struct AdapterControlBlock *acb) in arcmsr_hbaA_abort_allcmd() argument
881 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_hbaA_abort_allcmd()
883 if (!arcmsr_hbaA_wait_msgint_ready(acb)) { in arcmsr_hbaA_abort_allcmd()
886 , acb->host->host_no); in arcmsr_hbaA_abort_allcmd()
892 static uint8_t arcmsr_hbaB_abort_allcmd(struct AdapterControlBlock *acb) in arcmsr_hbaB_abort_allcmd() argument
894 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_hbaB_abort_allcmd()
897 if (!arcmsr_hbaB_wait_msgint_ready(acb)) { in arcmsr_hbaB_abort_allcmd()
900 , acb->host->host_no); in arcmsr_hbaB_abort_allcmd()
932 static uint8_t arcmsr_abort_allcmd(struct AdapterControlBlock *acb) in arcmsr_abort_allcmd() argument
935 switch (acb->adapter_type) { in arcmsr_abort_allcmd()
937 rtnval = arcmsr_hbaA_abort_allcmd(acb); in arcmsr_abort_allcmd()
942 rtnval = arcmsr_hbaB_abort_allcmd(acb); in arcmsr_abort_allcmd()
947 rtnval = arcmsr_hbaC_abort_allcmd(acb); in arcmsr_abort_allcmd()
952 rtnval = arcmsr_hbaD_abort_allcmd(acb); in arcmsr_abort_allcmd()
967 struct AdapterControlBlock *acb = ccb->acb; in arcmsr_ccb_complete() local
970 atomic_dec(&acb->ccboutstandingcount); in arcmsr_ccb_complete()
973 spin_lock_irqsave(&acb->ccblist_lock, flags); in arcmsr_ccb_complete()
974 list_add_tail(&ccb->list, &acb->ccb_free_list); in arcmsr_ccb_complete()
975 spin_unlock_irqrestore(&acb->ccblist_lock, flags); in arcmsr_ccb_complete()
996 static u32 arcmsr_disable_outbound_ints(struct AdapterControlBlock *acb) in arcmsr_disable_outbound_ints() argument
999 switch (acb->adapter_type) { in arcmsr_disable_outbound_ints()
1001 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_disable_outbound_ints()
1008 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_disable_outbound_ints()
1014 struct MessageUnit_C __iomem *reg = acb->pmuC; in arcmsr_disable_outbound_ints()
1021 struct MessageUnit_D *reg = acb->pmuD; in arcmsr_disable_outbound_ints()
1030 static void arcmsr_report_ccb_state(struct AdapterControlBlock *acb, in arcmsr_report_ccb_state() argument
1037 if (acb->devstate[id][lun] == ARECA_RAID_GONE) in arcmsr_report_ccb_state()
1038 acb->devstate[id][lun] = ARECA_RAID_GOOD; in arcmsr_report_ccb_state()
1044 acb->devstate[id][lun] = ARECA_RAID_GONE; in arcmsr_report_ccb_state()
1053 acb->devstate[id][lun] = ARECA_RAID_GONE; in arcmsr_report_ccb_state()
1060 acb->devstate[id][lun] = ARECA_RAID_GOOD; in arcmsr_report_ccb_state()
1070 , acb->host->host_no in arcmsr_report_ccb_state()
1074 acb->devstate[id][lun] = ARECA_RAID_GONE; in arcmsr_report_ccb_state()
1082 static void arcmsr_drain_donequeue(struct AdapterControlBlock *acb, struct CommandControlBlock *pCC… in arcmsr_drain_donequeue() argument
1085 if ((pCCB->acb != acb) || (pCCB->startdone != ARCMSR_CCB_START)) { in arcmsr_drain_donequeue()
1094 acb->host->host_no, pCCB); in arcmsr_drain_donequeue()
1102 , acb->host->host_no in arcmsr_drain_donequeue()
1103 , acb in arcmsr_drain_donequeue()
1105 , pCCB->acb in arcmsr_drain_donequeue()
1107 , atomic_read(&acb->ccboutstandingcount)); in arcmsr_drain_donequeue()
1110 arcmsr_report_ccb_state(acb, pCCB, error); in arcmsr_drain_donequeue()
1113 static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) in arcmsr_done4abort_postqueue() argument
1120 switch (acb->adapter_type) { in arcmsr_done4abort_postqueue()
1123 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_done4abort_postqueue()
1126 acb->outbound_int_enable; in arcmsr_done4abort_postqueue()
1131 …pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5));/*frame must be 32 byte… in arcmsr_done4abort_postqueue()
1134 arcmsr_drain_donequeue(acb, pCCB, error); in arcmsr_done4abort_postqueue()
1140 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_done4abort_postqueue()
1147 …pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset+(flag_ccb << 5));/*frame must be 32 bytes … in arcmsr_done4abort_postqueue()
1150 arcmsr_drain_donequeue(acb, pCCB, error); in arcmsr_done4abort_postqueue()
1159 struct MessageUnit_C __iomem *reg = acb->pmuC; in arcmsr_done4abort_postqueue()
1164 …pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset+ccb_cdb_phy);/*frame must be 32 bytes ali… in arcmsr_done4abort_postqueue()
1167 arcmsr_drain_donequeue(acb, pCCB, error); in arcmsr_done4abort_postqueue()
1172 struct MessageUnit_D *pmu = acb->pmuD; in arcmsr_done4abort_postqueue()
1177 residual = atomic_read(&acb->ccboutstandingcount); in arcmsr_done4abort_postqueue()
1179 spin_lock_irqsave(&acb->doneq_lock, flags); in arcmsr_done4abort_postqueue()
1191 spin_unlock_irqrestore(&acb->doneq_lock, flags); in arcmsr_done4abort_postqueue()
1196 (acb->vir2phy_offset + ccb_cdb_phy); in arcmsr_done4abort_postqueue()
1202 arcmsr_drain_donequeue(acb, pCCB, error); in arcmsr_done4abort_postqueue()
1206 spin_unlock_irqrestore(&acb->doneq_lock, flags); in arcmsr_done4abort_postqueue()
1220 struct AdapterControlBlock *acb = in arcmsr_remove() local
1223 arcmsr_free_sysfs_attr(acb); in arcmsr_remove()
1225 flush_work(&acb->arcmsr_do_message_isr_bh); in arcmsr_remove()
1226 del_timer_sync(&acb->eternal_timer); in arcmsr_remove()
1227 arcmsr_disable_outbound_ints(acb); in arcmsr_remove()
1228 arcmsr_stop_adapter_bgrb(acb); in arcmsr_remove()
1229 arcmsr_flush_adapter_cache(acb); in arcmsr_remove()
1230 acb->acb_flags |= ACB_F_SCSISTOPADAPTER; in arcmsr_remove()
1231 acb->acb_flags &= ~ACB_F_IOP_INITED; in arcmsr_remove()
1234 if (!atomic_read(&acb->ccboutstandingcount)) in arcmsr_remove()
1236 arcmsr_interrupt(acb);/* FIXME: need spinlock */ in arcmsr_remove()
1240 if (atomic_read(&acb->ccboutstandingcount)) { in arcmsr_remove()
1243 arcmsr_abort_allcmd(acb); in arcmsr_remove()
1244 arcmsr_done4abort_postqueue(acb); in arcmsr_remove()
1246 struct CommandControlBlock *ccb = acb->pccb_pool[i]; in arcmsr_remove()
1254 arcmsr_free_irq(pdev, acb); in arcmsr_remove()
1255 arcmsr_free_ccb_pool(acb); in arcmsr_remove()
1256 arcmsr_free_mu(acb); in arcmsr_remove()
1257 arcmsr_unmap_pciregion(acb); in arcmsr_remove()
1266 struct AdapterControlBlock *acb = in arcmsr_shutdown() local
1268 del_timer_sync(&acb->eternal_timer); in arcmsr_shutdown()
1269 arcmsr_disable_outbound_ints(acb); in arcmsr_shutdown()
1270 arcmsr_free_irq(pdev, acb); in arcmsr_shutdown()
1271 flush_work(&acb->arcmsr_do_message_isr_bh); in arcmsr_shutdown()
1272 arcmsr_stop_adapter_bgrb(acb); in arcmsr_shutdown()
1273 arcmsr_flush_adapter_cache(acb); in arcmsr_shutdown()
1290 static void arcmsr_enable_outbound_ints(struct AdapterControlBlock *acb, in arcmsr_enable_outbound_ints() argument
1294 switch (acb->adapter_type) { in arcmsr_enable_outbound_ints()
1297 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_enable_outbound_ints()
1302 acb->outbound_int_enable = ~(intmask_org & mask) & 0x000000ff; in arcmsr_enable_outbound_ints()
1307 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_enable_outbound_ints()
1313 acb->outbound_int_enable = (intmask_org | mask) & 0x0000000f; in arcmsr_enable_outbound_ints()
1317 struct MessageUnit_C __iomem *reg = acb->pmuC; in arcmsr_enable_outbound_ints()
1320 acb->outbound_int_enable = ~(intmask_org & mask) & 0x0000000f; in arcmsr_enable_outbound_ints()
1324 struct MessageUnit_D *reg = acb->pmuD; in arcmsr_enable_outbound_ints()
1333 static int arcmsr_build_ccb(struct AdapterControlBlock *acb, in arcmsr_build_ccb() argument
1353 if (unlikely(nseg > acb->host->sg_tablesize || nseg < 0)) in arcmsr_build_ccb()
1388 static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandControlBlock *ccb) in arcmsr_post_ccb() argument
1392 atomic_inc(&acb->ccboutstandingcount); in arcmsr_post_ccb()
1394 switch (acb->adapter_type) { in arcmsr_post_ccb()
1396 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_post_ccb()
1407 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_post_ccb()
1425 struct MessageUnit_C __iomem *phbcmu = acb->pmuC; in arcmsr_post_ccb()
1430 if (acb->cdb_phyaddr_hi32) { in arcmsr_post_ccb()
1431 writel(acb->cdb_phyaddr_hi32, &phbcmu->inbound_queueport_high); in arcmsr_post_ccb()
1439 struct MessageUnit_D *pmu = acb->pmuD; in arcmsr_post_ccb()
1445 spin_lock_irqsave(&acb->postq_lock, flags); in arcmsr_post_ccb()
1458 spin_unlock_irqrestore(&acb->postq_lock, flags); in arcmsr_post_ccb()
1464 static void arcmsr_hbaA_stop_bgrb(struct AdapterControlBlock *acb) in arcmsr_hbaA_stop_bgrb() argument
1466 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_hbaA_stop_bgrb()
1467 acb->acb_flags &= ~ACB_F_MSG_START_BGRB; in arcmsr_hbaA_stop_bgrb()
1469 if (!arcmsr_hbaA_wait_msgint_ready(acb)) { in arcmsr_hbaA_stop_bgrb()
1472 , acb->host->host_no); in arcmsr_hbaA_stop_bgrb()
1476 static void arcmsr_hbaB_stop_bgrb(struct AdapterControlBlock *acb) in arcmsr_hbaB_stop_bgrb() argument
1478 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_hbaB_stop_bgrb()
1479 acb->acb_flags &= ~ACB_F_MSG_START_BGRB; in arcmsr_hbaB_stop_bgrb()
1482 if (!arcmsr_hbaB_wait_msgint_ready(acb)) { in arcmsr_hbaB_stop_bgrb()
1485 , acb->host->host_no); in arcmsr_hbaB_stop_bgrb()
1514 static void arcmsr_stop_adapter_bgrb(struct AdapterControlBlock *acb) in arcmsr_stop_adapter_bgrb() argument
1516 switch (acb->adapter_type) { in arcmsr_stop_adapter_bgrb()
1518 arcmsr_hbaA_stop_bgrb(acb); in arcmsr_stop_adapter_bgrb()
1523 arcmsr_hbaB_stop_bgrb(acb); in arcmsr_stop_adapter_bgrb()
1527 arcmsr_hbaC_stop_bgrb(acb); in arcmsr_stop_adapter_bgrb()
1531 arcmsr_hbaD_stop_bgrb(acb); in arcmsr_stop_adapter_bgrb()
1536 static void arcmsr_free_ccb_pool(struct AdapterControlBlock *acb) in arcmsr_free_ccb_pool() argument
1538 dma_free_coherent(&acb->pdev->dev, acb->uncache_size, acb->dma_coherent, acb->dma_coherent_handle); in arcmsr_free_ccb_pool()
1541 static void arcmsr_iop_message_read(struct AdapterControlBlock *acb) in arcmsr_iop_message_read() argument
1543 switch (acb->adapter_type) { in arcmsr_iop_message_read()
1545 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_iop_message_read()
1551 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_iop_message_read()
1556 struct MessageUnit_C __iomem *reg = acb->pmuC; in arcmsr_iop_message_read()
1562 struct MessageUnit_D *reg = acb->pmuD; in arcmsr_iop_message_read()
1570 static void arcmsr_iop_message_wrote(struct AdapterControlBlock *acb) in arcmsr_iop_message_wrote() argument
1572 switch (acb->adapter_type) { in arcmsr_iop_message_wrote()
1574 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_iop_message_wrote()
1584 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_iop_message_wrote()
1593 struct MessageUnit_C __iomem *reg = acb->pmuC; in arcmsr_iop_message_wrote()
1602 struct MessageUnit_D *reg = acb->pmuD; in arcmsr_iop_message_wrote()
1610 struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *acb) in arcmsr_get_iop_rqbuffer() argument
1613 switch (acb->adapter_type) { in arcmsr_get_iop_rqbuffer()
1616 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_get_iop_rqbuffer()
1622 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_get_iop_rqbuffer()
1627 struct MessageUnit_C __iomem *phbcmu = acb->pmuC; in arcmsr_get_iop_rqbuffer()
1632 struct MessageUnit_D *reg = acb->pmuD; in arcmsr_get_iop_rqbuffer()
1640 static struct QBUFFER __iomem *arcmsr_get_iop_wqbuffer(struct AdapterControlBlock *acb) in arcmsr_get_iop_wqbuffer() argument
1643 switch (acb->adapter_type) { in arcmsr_get_iop_wqbuffer()
1646 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_get_iop_wqbuffer()
1652 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_get_iop_wqbuffer()
1657 struct MessageUnit_C __iomem *reg = acb->pmuC; in arcmsr_get_iop_wqbuffer()
1662 struct MessageUnit_D *reg = acb->pmuD; in arcmsr_get_iop_wqbuffer()
1671 arcmsr_Read_iop_rqbuffer_in_DWORD(struct AdapterControlBlock *acb, in arcmsr_Read_iop_rqbuffer_in_DWORD() argument
1697 pQbuffer = &acb->rqbuffer[acb->rqbuf_putIndex]; in arcmsr_Read_iop_rqbuffer_in_DWORD()
1699 acb->rqbuf_putIndex++; in arcmsr_Read_iop_rqbuffer_in_DWORD()
1701 acb->rqbuf_putIndex %= ARCMSR_MAX_QBUFFER; in arcmsr_Read_iop_rqbuffer_in_DWORD()
1707 arcmsr_iop_message_read(acb); in arcmsr_Read_iop_rqbuffer_in_DWORD()
1712 arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, in arcmsr_Read_iop_rqbuffer_data() argument
1719 if (acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) in arcmsr_Read_iop_rqbuffer_data()
1720 return arcmsr_Read_iop_rqbuffer_in_DWORD(acb, prbuffer); in arcmsr_Read_iop_rqbuffer_data()
1724 pQbuffer = &acb->rqbuffer[acb->rqbuf_putIndex]; in arcmsr_Read_iop_rqbuffer_data()
1726 acb->rqbuf_putIndex++; in arcmsr_Read_iop_rqbuffer_data()
1727 acb->rqbuf_putIndex %= ARCMSR_MAX_QBUFFER; in arcmsr_Read_iop_rqbuffer_data()
1731 arcmsr_iop_message_read(acb); in arcmsr_Read_iop_rqbuffer_data()
1735 static void arcmsr_iop2drv_data_wrote_handle(struct AdapterControlBlock *acb) in arcmsr_iop2drv_data_wrote_handle() argument
1741 spin_lock_irqsave(&acb->rqbuffer_lock, flags); in arcmsr_iop2drv_data_wrote_handle()
1742 prbuffer = arcmsr_get_iop_rqbuffer(acb); in arcmsr_iop2drv_data_wrote_handle()
1743 buf_empty_len = (acb->rqbuf_putIndex - acb->rqbuf_getIndex - 1) & in arcmsr_iop2drv_data_wrote_handle()
1746 if (arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) in arcmsr_iop2drv_data_wrote_handle()
1747 acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; in arcmsr_iop2drv_data_wrote_handle()
1749 acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; in arcmsr_iop2drv_data_wrote_handle()
1750 spin_unlock_irqrestore(&acb->rqbuffer_lock, flags); in arcmsr_iop2drv_data_wrote_handle()
1753 static void arcmsr_write_ioctldata2iop_in_DWORD(struct AdapterControlBlock *acb) in arcmsr_write_ioctldata2iop_in_DWORD() argument
1761 if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READED) { in arcmsr_write_ioctldata2iop_in_DWORD()
1767 acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READED); in arcmsr_write_ioctldata2iop_in_DWORD()
1768 pwbuffer = arcmsr_get_iop_wqbuffer(acb); in arcmsr_write_ioctldata2iop_in_DWORD()
1770 while ((acb->wqbuf_getIndex != acb->wqbuf_putIndex) in arcmsr_write_ioctldata2iop_in_DWORD()
1772 pQbuffer = &acb->wqbuffer[acb->wqbuf_getIndex]; in arcmsr_write_ioctldata2iop_in_DWORD()
1774 acb->wqbuf_getIndex++; in arcmsr_write_ioctldata2iop_in_DWORD()
1775 acb->wqbuf_getIndex %= ARCMSR_MAX_QBUFFER; in arcmsr_write_ioctldata2iop_in_DWORD()
1793 arcmsr_iop_message_wrote(acb); in arcmsr_write_ioctldata2iop_in_DWORD()
1798 arcmsr_write_ioctldata2iop(struct AdapterControlBlock *acb) in arcmsr_write_ioctldata2iop() argument
1805 if (acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { in arcmsr_write_ioctldata2iop()
1806 arcmsr_write_ioctldata2iop_in_DWORD(acb); in arcmsr_write_ioctldata2iop()
1809 if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READED) { in arcmsr_write_ioctldata2iop()
1810 acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READED); in arcmsr_write_ioctldata2iop()
1811 pwbuffer = arcmsr_get_iop_wqbuffer(acb); in arcmsr_write_ioctldata2iop()
1813 while ((acb->wqbuf_getIndex != acb->wqbuf_putIndex) in arcmsr_write_ioctldata2iop()
1815 pQbuffer = &acb->wqbuffer[acb->wqbuf_getIndex]; in arcmsr_write_ioctldata2iop()
1817 acb->wqbuf_getIndex++; in arcmsr_write_ioctldata2iop()
1818 acb->wqbuf_getIndex %= ARCMSR_MAX_QBUFFER; in arcmsr_write_ioctldata2iop()
1823 arcmsr_iop_message_wrote(acb); in arcmsr_write_ioctldata2iop()
1827 static void arcmsr_iop2drv_data_read_handle(struct AdapterControlBlock *acb) in arcmsr_iop2drv_data_read_handle() argument
1831 spin_lock_irqsave(&acb->wqbuffer_lock, flags); in arcmsr_iop2drv_data_read_handle()
1832 acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_READED; in arcmsr_iop2drv_data_read_handle()
1833 if (acb->wqbuf_getIndex != acb->wqbuf_putIndex) in arcmsr_iop2drv_data_read_handle()
1834 arcmsr_write_ioctldata2iop(acb); in arcmsr_iop2drv_data_read_handle()
1835 if (acb->wqbuf_getIndex == acb->wqbuf_putIndex) in arcmsr_iop2drv_data_read_handle()
1836 acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_CLEARED; in arcmsr_iop2drv_data_read_handle()
1837 spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); in arcmsr_iop2drv_data_read_handle()
1840 static void arcmsr_hbaA_doorbell_isr(struct AdapterControlBlock *acb) in arcmsr_hbaA_doorbell_isr() argument
1843 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_hbaA_doorbell_isr()
1848 arcmsr_iop2drv_data_wrote_handle(acb); in arcmsr_hbaA_doorbell_isr()
1850 arcmsr_iop2drv_data_read_handle(acb); in arcmsr_hbaA_doorbell_isr()
1902 static void arcmsr_hbaA_postqueue_isr(struct AdapterControlBlock *acb) in arcmsr_hbaA_postqueue_isr() argument
1905 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_hbaA_postqueue_isr()
1910 …pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5));/*frame must be 32 byte… in arcmsr_hbaA_postqueue_isr()
1913 arcmsr_drain_donequeue(acb, pCCB, error); in arcmsr_hbaA_postqueue_isr()
1916 static void arcmsr_hbaB_postqueue_isr(struct AdapterControlBlock *acb) in arcmsr_hbaB_postqueue_isr() argument
1920 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_hbaB_postqueue_isr()
1927 …pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset+(flag_ccb << 5));/*frame must be 32 bytes … in arcmsr_hbaB_postqueue_isr()
1930 arcmsr_drain_donequeue(acb, pCCB, error); in arcmsr_hbaB_postqueue_isr()
1937 static void arcmsr_hbaC_postqueue_isr(struct AdapterControlBlock *acb) in arcmsr_hbaC_postqueue_isr() argument
1945 phbcmu = acb->pmuC; in arcmsr_hbaC_postqueue_isr()
1952 arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset in arcmsr_hbaC_postqueue_isr()
1959 arcmsr_drain_donequeue(acb, ccb, error); in arcmsr_hbaC_postqueue_isr()
1969 static void arcmsr_hbaD_postqueue_isr(struct AdapterControlBlock *acb) in arcmsr_hbaD_postqueue_isr() argument
1979 spin_lock_irqsave(&acb->doneq_lock, flags); in arcmsr_hbaD_postqueue_isr()
1980 pmu = acb->pmuD; in arcmsr_hbaD_postqueue_isr()
1994 arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset in arcmsr_hbaD_postqueue_isr()
2000 arcmsr_drain_donequeue(acb, ccb, error); in arcmsr_hbaD_postqueue_isr()
2008 spin_unlock_irqrestore(&acb->doneq_lock, flags); in arcmsr_hbaD_postqueue_isr()
2019 static void arcmsr_hbaA_message_isr(struct AdapterControlBlock *acb) in arcmsr_hbaA_message_isr() argument
2021 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_hbaA_message_isr()
2024 schedule_work(&acb->arcmsr_do_message_isr_bh); in arcmsr_hbaA_message_isr()
2026 static void arcmsr_hbaB_message_isr(struct AdapterControlBlock *acb) in arcmsr_hbaB_message_isr() argument
2028 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_hbaB_message_isr()
2032 schedule_work(&acb->arcmsr_do_message_isr_bh); in arcmsr_hbaB_message_isr()
2043 static void arcmsr_hbaC_message_isr(struct AdapterControlBlock *acb) in arcmsr_hbaC_message_isr() argument
2045 struct MessageUnit_C __iomem *reg = acb->pmuC; in arcmsr_hbaC_message_isr()
2048 schedule_work(&acb->arcmsr_do_message_isr_bh); in arcmsr_hbaC_message_isr()
2051 static void arcmsr_hbaD_message_isr(struct AdapterControlBlock *acb) in arcmsr_hbaD_message_isr() argument
2053 struct MessageUnit_D *reg = acb->pmuD; in arcmsr_hbaD_message_isr()
2057 schedule_work(&acb->arcmsr_do_message_isr_bh); in arcmsr_hbaD_message_isr()
2060 static int arcmsr_hbaA_handle_isr(struct AdapterControlBlock *acb) in arcmsr_hbaA_handle_isr() argument
2063 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_hbaA_handle_isr()
2065 acb->outbound_int_enable; in arcmsr_hbaA_handle_isr()
2071 arcmsr_hbaA_doorbell_isr(acb); in arcmsr_hbaA_handle_isr()
2073 arcmsr_hbaA_postqueue_isr(acb); in arcmsr_hbaA_handle_isr()
2075 arcmsr_hbaA_message_isr(acb); in arcmsr_hbaA_handle_isr()
2077 acb->outbound_int_enable; in arcmsr_hbaA_handle_isr()
2084 static int arcmsr_hbaB_handle_isr(struct AdapterControlBlock *acb) in arcmsr_hbaB_handle_isr() argument
2087 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_hbaB_handle_isr()
2089 acb->outbound_int_enable; in arcmsr_hbaB_handle_isr()
2096 arcmsr_iop2drv_data_wrote_handle(acb); in arcmsr_hbaB_handle_isr()
2098 arcmsr_iop2drv_data_read_handle(acb); in arcmsr_hbaB_handle_isr()
2100 arcmsr_hbaB_postqueue_isr(acb); in arcmsr_hbaB_handle_isr()
2102 arcmsr_hbaB_message_isr(acb); in arcmsr_hbaB_handle_isr()
2104 acb->outbound_int_enable; in arcmsr_hbaB_handle_isr()
2163 static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb) in arcmsr_interrupt() argument
2165 switch (acb->adapter_type) { in arcmsr_interrupt()
2167 return arcmsr_hbaA_handle_isr(acb); in arcmsr_interrupt()
2170 return arcmsr_hbaB_handle_isr(acb); in arcmsr_interrupt()
2173 return arcmsr_hbaC_handle_isr(acb); in arcmsr_interrupt()
2175 return arcmsr_hbaD_handle_isr(acb); in arcmsr_interrupt()
2181 static void arcmsr_iop_parking(struct AdapterControlBlock *acb) in arcmsr_iop_parking() argument
2183 if (acb) { in arcmsr_iop_parking()
2185 if (acb->acb_flags & ACB_F_MSG_START_BGRB) { in arcmsr_iop_parking()
2187 acb->acb_flags &= ~ACB_F_MSG_START_BGRB; in arcmsr_iop_parking()
2188 intmask_org = arcmsr_disable_outbound_ints(acb); in arcmsr_iop_parking()
2189 arcmsr_stop_adapter_bgrb(acb); in arcmsr_iop_parking()
2190 arcmsr_flush_adapter_cache(acb); in arcmsr_iop_parking()
2191 arcmsr_enable_outbound_ints(acb, intmask_org); in arcmsr_iop_parking()
2197 void arcmsr_clear_iop2drv_rqueue_buffer(struct AdapterControlBlock *acb) in arcmsr_clear_iop2drv_rqueue_buffer() argument
2201 if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { in arcmsr_clear_iop2drv_rqueue_buffer()
2203 if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { in arcmsr_clear_iop2drv_rqueue_buffer()
2204 acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; in arcmsr_clear_iop2drv_rqueue_buffer()
2205 acb->rqbuf_getIndex = 0; in arcmsr_clear_iop2drv_rqueue_buffer()
2206 acb->rqbuf_putIndex = 0; in arcmsr_clear_iop2drv_rqueue_buffer()
2207 arcmsr_iop_message_read(acb); in arcmsr_clear_iop2drv_rqueue_buffer()
2209 } else if (acb->rqbuf_getIndex != in arcmsr_clear_iop2drv_rqueue_buffer()
2210 acb->rqbuf_putIndex) { in arcmsr_clear_iop2drv_rqueue_buffer()
2211 acb->rqbuf_getIndex = 0; in arcmsr_clear_iop2drv_rqueue_buffer()
2212 acb->rqbuf_putIndex = 0; in arcmsr_clear_iop2drv_rqueue_buffer()
2220 static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, in arcmsr_iop_message_xfer() argument
2260 spin_lock_irqsave(&acb->rqbuffer_lock, flags); in arcmsr_iop_message_xfer()
2261 if (acb->rqbuf_getIndex != acb->rqbuf_putIndex) { in arcmsr_iop_message_xfer()
2262 unsigned int tail = acb->rqbuf_getIndex; in arcmsr_iop_message_xfer()
2263 unsigned int head = acb->rqbuf_putIndex; in arcmsr_iop_message_xfer()
2271 memcpy(ptmpQbuffer, acb->rqbuffer + tail, allxfer_len); in arcmsr_iop_message_xfer()
2273 memcpy(ptmpQbuffer, acb->rqbuffer + tail, cnt_to_end); in arcmsr_iop_message_xfer()
2274 memcpy(ptmpQbuffer + cnt_to_end, acb->rqbuffer, allxfer_len - cnt_to_end); in arcmsr_iop_message_xfer()
2276 acb->rqbuf_getIndex = (acb->rqbuf_getIndex + allxfer_len) % ARCMSR_MAX_QBUFFER; in arcmsr_iop_message_xfer()
2280 if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { in arcmsr_iop_message_xfer()
2282 acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; in arcmsr_iop_message_xfer()
2283 prbuffer = arcmsr_get_iop_rqbuffer(acb); in arcmsr_iop_message_xfer()
2284 if (arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) in arcmsr_iop_message_xfer()
2285 acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; in arcmsr_iop_message_xfer()
2287 spin_unlock_irqrestore(&acb->rqbuffer_lock, flags); in arcmsr_iop_message_xfer()
2290 if (acb->fw_flag == FW_DEADLOCK) in arcmsr_iop_message_xfer()
2319 spin_lock_irqsave(&acb->wqbuffer_lock, flags); in arcmsr_iop_message_xfer()
2320 if (acb->wqbuf_putIndex != acb->wqbuf_getIndex) { in arcmsr_iop_message_xfer()
2323 arcmsr_write_ioctldata2iop(acb); in arcmsr_iop_message_xfer()
2332 pQbuffer = &acb->wqbuffer[acb->wqbuf_putIndex]; in arcmsr_iop_message_xfer()
2333 cnt2end = ARCMSR_MAX_QBUFFER - acb->wqbuf_putIndex; in arcmsr_iop_message_xfer()
2338 acb->wqbuf_putIndex = 0; in arcmsr_iop_message_xfer()
2339 pQbuffer = acb->wqbuffer; in arcmsr_iop_message_xfer()
2342 acb->wqbuf_putIndex += user_len; in arcmsr_iop_message_xfer()
2343 acb->wqbuf_putIndex %= ARCMSR_MAX_QBUFFER; in arcmsr_iop_message_xfer()
2344 if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_CLEARED) { in arcmsr_iop_message_xfer()
2345 acb->acb_flags &= in arcmsr_iop_message_xfer()
2347 arcmsr_write_ioctldata2iop(acb); in arcmsr_iop_message_xfer()
2350 spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); in arcmsr_iop_message_xfer()
2352 if (acb->fw_flag == FW_DEADLOCK) in arcmsr_iop_message_xfer()
2361 uint8_t *pQbuffer = acb->rqbuffer; in arcmsr_iop_message_xfer()
2363 arcmsr_clear_iop2drv_rqueue_buffer(acb); in arcmsr_iop_message_xfer()
2364 spin_lock_irqsave(&acb->rqbuffer_lock, flags); in arcmsr_iop_message_xfer()
2365 acb->acb_flags |= ACB_F_MESSAGE_RQBUFFER_CLEARED; in arcmsr_iop_message_xfer()
2366 acb->rqbuf_getIndex = 0; in arcmsr_iop_message_xfer()
2367 acb->rqbuf_putIndex = 0; in arcmsr_iop_message_xfer()
2369 spin_unlock_irqrestore(&acb->rqbuffer_lock, flags); in arcmsr_iop_message_xfer()
2370 if (acb->fw_flag == FW_DEADLOCK) in arcmsr_iop_message_xfer()
2379 uint8_t *pQbuffer = acb->wqbuffer; in arcmsr_iop_message_xfer()
2380 spin_lock_irqsave(&acb->wqbuffer_lock, flags); in arcmsr_iop_message_xfer()
2381 acb->acb_flags |= (ACB_F_MESSAGE_WQBUFFER_CLEARED | in arcmsr_iop_message_xfer()
2383 acb->wqbuf_getIndex = 0; in arcmsr_iop_message_xfer()
2384 acb->wqbuf_putIndex = 0; in arcmsr_iop_message_xfer()
2386 spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); in arcmsr_iop_message_xfer()
2387 if (acb->fw_flag == FW_DEADLOCK) in arcmsr_iop_message_xfer()
2397 arcmsr_clear_iop2drv_rqueue_buffer(acb); in arcmsr_iop_message_xfer()
2398 spin_lock_irqsave(&acb->rqbuffer_lock, flags); in arcmsr_iop_message_xfer()
2399 acb->acb_flags |= ACB_F_MESSAGE_RQBUFFER_CLEARED; in arcmsr_iop_message_xfer()
2400 acb->rqbuf_getIndex = 0; in arcmsr_iop_message_xfer()
2401 acb->rqbuf_putIndex = 0; in arcmsr_iop_message_xfer()
2402 pQbuffer = acb->rqbuffer; in arcmsr_iop_message_xfer()
2404 spin_unlock_irqrestore(&acb->rqbuffer_lock, flags); in arcmsr_iop_message_xfer()
2405 spin_lock_irqsave(&acb->wqbuffer_lock, flags); in arcmsr_iop_message_xfer()
2406 acb->acb_flags |= (ACB_F_MESSAGE_WQBUFFER_CLEARED | in arcmsr_iop_message_xfer()
2408 acb->wqbuf_getIndex = 0; in arcmsr_iop_message_xfer()
2409 acb->wqbuf_putIndex = 0; in arcmsr_iop_message_xfer()
2410 pQbuffer = acb->wqbuffer; in arcmsr_iop_message_xfer()
2412 spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); in arcmsr_iop_message_xfer()
2413 if (acb->fw_flag == FW_DEADLOCK) in arcmsr_iop_message_xfer()
2422 if (acb->fw_flag == FW_DEADLOCK) in arcmsr_iop_message_xfer()
2432 if (acb->fw_flag == FW_DEADLOCK) in arcmsr_iop_message_xfer()
2443 if (acb->fw_flag == FW_DEADLOCK) in arcmsr_iop_message_xfer()
2449 arcmsr_iop_parking(acb); in arcmsr_iop_message_xfer()
2453 if (acb->fw_flag == FW_DEADLOCK) in arcmsr_iop_message_xfer()
2459 arcmsr_flush_adapter_cache(acb); in arcmsr_iop_message_xfer()
2474 static struct CommandControlBlock *arcmsr_get_freeccb(struct AdapterControlBlock *acb) in arcmsr_get_freeccb() argument
2476 struct list_head *head = &acb->ccb_free_list; in arcmsr_get_freeccb()
2479 spin_lock_irqsave(&acb->ccblist_lock, flags); in arcmsr_get_freeccb()
2484 spin_unlock_irqrestore(&acb->ccblist_lock, flags); in arcmsr_get_freeccb()
2487 spin_unlock_irqrestore(&acb->ccblist_lock, flags); in arcmsr_get_freeccb()
2491 static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb, in arcmsr_handle_virtual_command() argument
2531 if (arcmsr_iop_message_xfer(acb, cmd)) in arcmsr_handle_virtual_command()
2545 struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; in arcmsr_queue_command_lck() local
2553 arcmsr_handle_virtual_command(acb, cmd); in arcmsr_queue_command_lck()
2556 ccb = arcmsr_get_freeccb(acb); in arcmsr_queue_command_lck()
2559 if (arcmsr_build_ccb( acb, ccb, cmd ) == FAILED) { in arcmsr_queue_command_lck()
2564 arcmsr_post_ccb(acb, ccb); in arcmsr_queue_command_lck()
2570 static bool arcmsr_hbaA_get_config(struct AdapterControlBlock *acb) in DEF_SCSI_QCMD()
2572 struct MessageUnit_A __iomem *reg = acb->pmuA; in DEF_SCSI_QCMD()
2573 char *acb_firm_model = acb->firm_model; in DEF_SCSI_QCMD()
2574 char *acb_firm_version = acb->firm_version; in DEF_SCSI_QCMD()
2575 char *acb_device_map = acb->device_map; in DEF_SCSI_QCMD()
2581 if (!arcmsr_hbaA_wait_msgint_ready(acb)) { in DEF_SCSI_QCMD()
2583 miscellaneous data' timeout \n", acb->host->host_no); in DEF_SCSI_QCMD()
2610 acb->host->host_no, in DEF_SCSI_QCMD()
2611 acb->firm_model, in DEF_SCSI_QCMD()
2612 acb->firm_version); in DEF_SCSI_QCMD()
2613 acb->signature = readl(&reg->message_rwbuffer[0]); in DEF_SCSI_QCMD()
2614 acb->firm_request_len = readl(&reg->message_rwbuffer[1]); in DEF_SCSI_QCMD()
2615 acb->firm_numbers_queue = readl(&reg->message_rwbuffer[2]); in DEF_SCSI_QCMD()
2616 acb->firm_sdram_size = readl(&reg->message_rwbuffer[3]); in DEF_SCSI_QCMD()
2617 acb->firm_hd_channels = readl(&reg->message_rwbuffer[4]); in DEF_SCSI_QCMD()
2618 acb->firm_cfg_version = readl(&reg->message_rwbuffer[25]); /*firm_cfg_version,25,100-103*/ in DEF_SCSI_QCMD()
2621 static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb) in arcmsr_hbaB_get_config() argument
2623 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_hbaB_get_config()
2624 struct pci_dev *pdev = acb->pdev; in arcmsr_hbaB_get_config()
2627 char *acb_firm_model = acb->firm_model; in arcmsr_hbaB_get_config()
2628 char *acb_firm_version = acb->firm_version; in arcmsr_hbaB_get_config()
2629 char *acb_device_map = acb->device_map; in arcmsr_hbaB_get_config()
2638 acb->roundup_ccbsize = roundup(sizeof(struct MessageUnit_B), 32); in arcmsr_hbaB_get_config()
2639 dma_coherent = dma_alloc_coherent(&pdev->dev, acb->roundup_ccbsize, in arcmsr_hbaB_get_config()
2644 acb->host->host_no); in arcmsr_hbaB_get_config()
2647 acb->dma_coherent_handle2 = dma_coherent_handle; in arcmsr_hbaB_get_config()
2648 acb->dma_coherent2 = dma_coherent; in arcmsr_hbaB_get_config()
2650 acb->pmuB = reg; in arcmsr_hbaB_get_config()
2651 …reg->drv2iop_doorbell= (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_DRV2IOP_DOORBEL… in arcmsr_hbaB_get_config()
2652 …reg->drv2iop_doorbell_mask = (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_DRV2IOP_D… in arcmsr_hbaB_get_config()
2653 …reg->iop2drv_doorbell = (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_IOP2DRV_DOORBE… in arcmsr_hbaB_get_config()
2654 …reg->iop2drv_doorbell_mask = (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_IOP2DRV_D… in arcmsr_hbaB_get_config()
2655 …reg->message_wbuffer = (uint32_t __iomem *)((unsigned long)acb->mem_base1 + ARCMSR_MESSAGE_WBUFFER… in arcmsr_hbaB_get_config()
2656 …reg->message_rbuffer = (uint32_t __iomem *)((unsigned long)acb->mem_base1 + ARCMSR_MESSAGE_RBUFFE… in arcmsr_hbaB_get_config()
2657 …reg->message_rwbuffer = (uint32_t __iomem *)((unsigned long)acb->mem_base1 + ARCMSR_MESSAGE_RWBUFF… in arcmsr_hbaB_get_config()
2663 if (!arcmsr_hbaB_wait_msgint_ready(acb)) { in arcmsr_hbaB_get_config()
2665 miscellaneous data' timeout \n", acb->host->host_no); in arcmsr_hbaB_get_config()
2692 acb->host->host_no, in arcmsr_hbaB_get_config()
2693 acb->firm_model, in arcmsr_hbaB_get_config()
2694 acb->firm_version); in arcmsr_hbaB_get_config()
2696 acb->signature = readl(&reg->message_rwbuffer[0]); in arcmsr_hbaB_get_config()
2698 acb->firm_request_len = readl(&reg->message_rwbuffer[1]); in arcmsr_hbaB_get_config()
2700 acb->firm_numbers_queue = readl(&reg->message_rwbuffer[2]); in arcmsr_hbaB_get_config()
2702 acb->firm_sdram_size = readl(&reg->message_rwbuffer[3]); in arcmsr_hbaB_get_config()
2704 acb->firm_hd_channels = readl(&reg->message_rwbuffer[4]); in arcmsr_hbaB_get_config()
2706 acb->firm_cfg_version = readl(&reg->message_rwbuffer[25]); /*firm_cfg_version,25,100-103*/ in arcmsr_hbaB_get_config()
2710 dma_free_coherent(&acb->pdev->dev, acb->roundup_ccbsize, in arcmsr_hbaB_get_config()
2711 acb->dma_coherent2, acb->dma_coherent_handle2); in arcmsr_hbaB_get_config()
2774 static bool arcmsr_hbaD_get_config(struct AdapterControlBlock *acb) in arcmsr_hbaD_get_config() argument
2776 char *acb_firm_model = acb->firm_model; in arcmsr_hbaD_get_config()
2777 char *acb_firm_version = acb->firm_version; in arcmsr_hbaD_get_config()
2778 char *acb_device_map = acb->device_map; in arcmsr_hbaD_get_config()
2786 struct pci_dev *pdev = acb->pdev; in arcmsr_hbaD_get_config()
2788 acb->roundup_ccbsize = roundup(sizeof(struct MessageUnit_D), 32); in arcmsr_hbaD_get_config()
2789 dma_coherent2 = dma_alloc_coherent(&pdev->dev, acb->roundup_ccbsize, in arcmsr_hbaD_get_config()
2795 memset(dma_coherent2, 0, acb->roundup_ccbsize); in arcmsr_hbaD_get_config()
2796 acb->dma_coherent_handle2 = dma_coherent_handle2; in arcmsr_hbaD_get_config()
2797 acb->dma_coherent2 = dma_coherent2; in arcmsr_hbaD_get_config()
2799 acb->pmuD = reg; in arcmsr_hbaD_get_config()
2800 reg->chip_id = acb->mem_base0 + ARCMSR_ARC1214_CHIP_ID; in arcmsr_hbaD_get_config()
2801 reg->cpu_mem_config = acb->mem_base0 + in arcmsr_hbaD_get_config()
2803 reg->i2o_host_interrupt_mask = acb->mem_base0 + in arcmsr_hbaD_get_config()
2805 reg->sample_at_reset = acb->mem_base0 + ARCMSR_ARC1214_SAMPLE_RESET; in arcmsr_hbaD_get_config()
2806 reg->reset_request = acb->mem_base0 + ARCMSR_ARC1214_RESET_REQUEST; in arcmsr_hbaD_get_config()
2807 reg->host_int_status = acb->mem_base0 + in arcmsr_hbaD_get_config()
2809 reg->pcief0_int_enable = acb->mem_base0 + in arcmsr_hbaD_get_config()
2811 reg->inbound_msgaddr0 = acb->mem_base0 + in arcmsr_hbaD_get_config()
2813 reg->inbound_msgaddr1 = acb->mem_base0 + in arcmsr_hbaD_get_config()
2815 reg->outbound_msgaddr0 = acb->mem_base0 + in arcmsr_hbaD_get_config()
2817 reg->outbound_msgaddr1 = acb->mem_base0 + in arcmsr_hbaD_get_config()
2819 reg->inbound_doorbell = acb->mem_base0 + in arcmsr_hbaD_get_config()
2821 reg->outbound_doorbell = acb->mem_base0 + in arcmsr_hbaD_get_config()
2823 reg->outbound_doorbell_enable = acb->mem_base0 + in arcmsr_hbaD_get_config()
2825 reg->inboundlist_base_low = acb->mem_base0 + in arcmsr_hbaD_get_config()
2827 reg->inboundlist_base_high = acb->mem_base0 + in arcmsr_hbaD_get_config()
2829 reg->inboundlist_write_pointer = acb->mem_base0 + in arcmsr_hbaD_get_config()
2831 reg->outboundlist_base_low = acb->mem_base0 + in arcmsr_hbaD_get_config()
2833 reg->outboundlist_base_high = acb->mem_base0 + in arcmsr_hbaD_get_config()
2835 reg->outboundlist_copy_pointer = acb->mem_base0 + in arcmsr_hbaD_get_config()
2837 reg->outboundlist_read_pointer = acb->mem_base0 + in arcmsr_hbaD_get_config()
2839 reg->outboundlist_interrupt_cause = acb->mem_base0 + in arcmsr_hbaD_get_config()
2841 reg->outboundlist_interrupt_enable = acb->mem_base0 + in arcmsr_hbaD_get_config()
2843 reg->message_wbuffer = acb->mem_base0 + ARCMSR_ARC1214_MESSAGE_WBUFFER; in arcmsr_hbaD_get_config()
2844 reg->message_rbuffer = acb->mem_base0 + ARCMSR_ARC1214_MESSAGE_RBUFFER; in arcmsr_hbaD_get_config()
2845 reg->msgcode_rwbuffer = acb->mem_base0 + in arcmsr_hbaD_get_config()
2850 if (readl(acb->pmuD->outbound_doorbell) & in arcmsr_hbaD_get_config()
2853 acb->pmuD->outbound_doorbell);/*clear interrupt*/ in arcmsr_hbaD_get_config()
2858 if (!arcmsr_hbaD_wait_msgint_ready(acb)) { in arcmsr_hbaD_get_config()
2860 "miscellaneous data timeout\n", acb->host->host_no); in arcmsr_hbaD_get_config()
2861 dma_free_coherent(&acb->pdev->dev, acb->roundup_ccbsize, in arcmsr_hbaD_get_config()
2862 acb->dma_coherent2, acb->dma_coherent_handle2); in arcmsr_hbaD_get_config()
2886 acb->signature = readl(&reg->msgcode_rwbuffer[0]); in arcmsr_hbaD_get_config()
2888 acb->firm_request_len = readl(&reg->msgcode_rwbuffer[1]); in arcmsr_hbaD_get_config()
2890 acb->firm_numbers_queue = readl(&reg->msgcode_rwbuffer[2]); in arcmsr_hbaD_get_config()
2892 acb->firm_sdram_size = readl(&reg->msgcode_rwbuffer[3]); in arcmsr_hbaD_get_config()
2894 acb->firm_hd_channels = readl(&reg->msgcode_rwbuffer[4]); in arcmsr_hbaD_get_config()
2896 acb->firm_cfg_version = readl(&reg->msgcode_rwbuffer[25]); in arcmsr_hbaD_get_config()
2898 acb->host->host_no, in arcmsr_hbaD_get_config()
2899 acb->firm_model, in arcmsr_hbaD_get_config()
2900 acb->firm_version); in arcmsr_hbaD_get_config()
2904 static bool arcmsr_get_firmware_spec(struct AdapterControlBlock *acb) in arcmsr_get_firmware_spec() argument
2908 switch (acb->adapter_type) { in arcmsr_get_firmware_spec()
2910 rtn = arcmsr_hbaA_get_config(acb); in arcmsr_get_firmware_spec()
2913 rtn = arcmsr_hbaB_get_config(acb); in arcmsr_get_firmware_spec()
2916 rtn = arcmsr_hbaC_get_config(acb); in arcmsr_get_firmware_spec()
2919 rtn = arcmsr_hbaD_get_config(acb); in arcmsr_get_firmware_spec()
2924 if (acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) in arcmsr_get_firmware_spec()
2925 acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD; in arcmsr_get_firmware_spec()
2927 acb->maxOutstanding = acb->firm_numbers_queue - 1; in arcmsr_get_firmware_spec()
2928 acb->host->can_queue = acb->maxOutstanding; in arcmsr_get_firmware_spec()
2932 static int arcmsr_hbaA_polling_ccbdone(struct AdapterControlBlock *acb, in arcmsr_hbaA_polling_ccbdone() argument
2935 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_hbaA_polling_ccbdone()
2943 outbound_intstatus = readl(&reg->outbound_intstatus) & acb->outbound_int_enable; in arcmsr_hbaA_polling_ccbdone()
2959 arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5)); in arcmsr_hbaA_polling_ccbdone()
2962 if ((ccb->acb != acb) || (ccb->startdone != ARCMSR_CCB_START)) { in arcmsr_hbaA_polling_ccbdone()
2966 , acb->host->host_no in arcmsr_hbaA_polling_ccbdone()
2977 , acb->host->host_no in arcmsr_hbaA_polling_ccbdone()
2979 , atomic_read(&acb->ccboutstandingcount)); in arcmsr_hbaA_polling_ccbdone()
2983 arcmsr_report_ccb_state(acb, ccb, error); in arcmsr_hbaA_polling_ccbdone()
2988 static int arcmsr_hbaB_polling_ccbdone(struct AdapterControlBlock *acb, in arcmsr_hbaB_polling_ccbdone() argument
2991 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_hbaB_polling_ccbdone()
3024 arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5)); in arcmsr_hbaB_polling_ccbdone()
3027 if ((ccb->acb != acb) || (ccb->startdone != ARCMSR_CCB_START)) { in arcmsr_hbaB_polling_ccbdone()
3031 ,acb->host->host_no in arcmsr_hbaB_polling_ccbdone()
3042 , acb->host->host_no in arcmsr_hbaB_polling_ccbdone()
3044 , atomic_read(&acb->ccboutstandingcount)); in arcmsr_hbaB_polling_ccbdone()
3048 arcmsr_report_ccb_state(acb, ccb, error); in arcmsr_hbaB_polling_ccbdone()
3053 static int arcmsr_hbaC_polling_ccbdone(struct AdapterControlBlock *acb, in arcmsr_hbaC_polling_ccbdone() argument
3056 struct MessageUnit_C __iomem *reg = acb->pmuC; in arcmsr_hbaC_polling_ccbdone()
3081 …arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + ccb_cdb_phy);/*frame must be 32 bytes ali… in arcmsr_hbaC_polling_ccbdone()
3085 if ((pCCB->acb != acb) || (pCCB->startdone != ARCMSR_CCB_START)) { in arcmsr_hbaC_polling_ccbdone()
3089 , acb->host->host_no in arcmsr_hbaC_polling_ccbdone()
3100 , acb->host->host_no in arcmsr_hbaC_polling_ccbdone()
3102 , atomic_read(&acb->ccboutstandingcount)); in arcmsr_hbaC_polling_ccbdone()
3106 arcmsr_report_ccb_state(acb, pCCB, error); in arcmsr_hbaC_polling_ccbdone()
3111 static int arcmsr_hbaD_polling_ccbdone(struct AdapterControlBlock *acb, in arcmsr_hbaD_polling_ccbdone() argument
3120 struct MessageUnit_D *pmu = acb->pmuD; in arcmsr_hbaD_polling_ccbdone()
3125 spin_lock_irqsave(&acb->doneq_lock, flags); in arcmsr_hbaD_polling_ccbdone()
3129 spin_unlock_irqrestore(&acb->doneq_lock, flags); in arcmsr_hbaD_polling_ccbdone()
3148 spin_unlock_irqrestore(&acb->doneq_lock, flags); in arcmsr_hbaD_polling_ccbdone()
3151 arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + in arcmsr_hbaD_polling_ccbdone()
3156 if ((pCCB->acb != acb) || in arcmsr_hbaD_polling_ccbdone()
3162 , acb->host->host_no in arcmsr_hbaD_polling_ccbdone()
3173 , acb->host->host_no in arcmsr_hbaD_polling_ccbdone()
3175 , atomic_read(&acb->ccboutstandingcount)); in arcmsr_hbaD_polling_ccbdone()
3180 arcmsr_report_ccb_state(acb, pCCB, error); in arcmsr_hbaD_polling_ccbdone()
3185 static int arcmsr_polling_ccbdone(struct AdapterControlBlock *acb, in arcmsr_polling_ccbdone() argument
3189 switch (acb->adapter_type) { in arcmsr_polling_ccbdone()
3192 rtn = arcmsr_hbaA_polling_ccbdone(acb, poll_ccb); in arcmsr_polling_ccbdone()
3197 rtn = arcmsr_hbaB_polling_ccbdone(acb, poll_ccb); in arcmsr_polling_ccbdone()
3201 rtn = arcmsr_hbaC_polling_ccbdone(acb, poll_ccb); in arcmsr_polling_ccbdone()
3205 rtn = arcmsr_hbaD_polling_ccbdone(acb, poll_ccb); in arcmsr_polling_ccbdone()
3211 static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) in arcmsr_iop_confirm() argument
3222 switch (acb->adapter_type) { in arcmsr_iop_confirm()
3225 dma_coherent_handle = acb->dma_coherent_handle2; in arcmsr_iop_confirm()
3228 dma_coherent_handle = acb->dma_coherent_handle; in arcmsr_iop_confirm()
3233 acb->cdb_phyaddr_hi32 = cdb_phyaddr_hi32; in arcmsr_iop_confirm()
3239 switch (acb->adapter_type) { in arcmsr_iop_confirm()
3243 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_iop_confirm()
3249 if (!arcmsr_hbaA_wait_msgint_ready(acb)) { in arcmsr_iop_confirm()
3252 acb->host->host_no); in arcmsr_iop_confirm()
3262 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_iop_confirm()
3266 if (!arcmsr_hbaB_wait_msgint_ready(acb)) { in arcmsr_iop_confirm()
3268 acb->host->host_no); in arcmsr_iop_confirm()
3284 if (!arcmsr_hbaB_wait_msgint_ready(acb)) { in arcmsr_iop_confirm()
3286 timeout \n",acb->host->host_no); in arcmsr_iop_confirm()
3290 if (!arcmsr_hbaB_wait_msgint_ready(acb)) { in arcmsr_iop_confirm()
3292 acb->host->host_no); in arcmsr_iop_confirm()
3299 struct MessageUnit_C __iomem *reg = acb->pmuC; in arcmsr_iop_confirm()
3302 acb->adapter_index, cdb_phyaddr_hi32); in arcmsr_iop_confirm()
3307 if (!arcmsr_hbaC_wait_msgint_ready(acb)) { in arcmsr_iop_confirm()
3309 timeout \n", acb->host->host_no); in arcmsr_iop_confirm()
3317 struct MessageUnit_D *reg = acb->pmuD; in arcmsr_iop_confirm()
3328 if (!arcmsr_hbaD_wait_msgint_ready(acb)) { in arcmsr_iop_confirm()
3330 acb->host->host_no); in arcmsr_iop_confirm()
3339 static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb) in arcmsr_wait_firmware_ready() argument
3342 switch (acb->adapter_type) { in arcmsr_wait_firmware_ready()
3345 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_wait_firmware_ready()
3353 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_wait_firmware_ready()
3361 struct MessageUnit_C __iomem *reg = acb->pmuC; in arcmsr_wait_firmware_ready()
3368 struct MessageUnit_D *reg = acb->pmuD; in arcmsr_wait_firmware_ready()
3378 static void arcmsr_hbaA_request_device_map(struct AdapterControlBlock *acb) in arcmsr_hbaA_request_device_map() argument
3380 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_hbaA_request_device_map()
3381 …if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ((acb->acb_flags & ACB_F_BUS_RESET) != 0 ) |… in arcmsr_hbaA_request_device_map()
3382 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); in arcmsr_hbaA_request_device_map()
3385 acb->fw_flag = FW_NORMAL; in arcmsr_hbaA_request_device_map()
3386 if (atomic_read(&acb->ante_token_value) == atomic_read(&acb->rq_map_token)){ in arcmsr_hbaA_request_device_map()
3387 atomic_set(&acb->rq_map_token, 16); in arcmsr_hbaA_request_device_map()
3389 atomic_set(&acb->ante_token_value, atomic_read(&acb->rq_map_token)); in arcmsr_hbaA_request_device_map()
3390 if (atomic_dec_and_test(&acb->rq_map_token)) { in arcmsr_hbaA_request_device_map()
3391 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); in arcmsr_hbaA_request_device_map()
3395 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); in arcmsr_hbaA_request_device_map()
3400 static void arcmsr_hbaB_request_device_map(struct AdapterControlBlock *acb) in arcmsr_hbaB_request_device_map() argument
3402 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_hbaB_request_device_map()
3403 …if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ((acb->acb_flags & ACB_F_BUS_RESET) != 0 ) |… in arcmsr_hbaB_request_device_map()
3404 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); in arcmsr_hbaB_request_device_map()
3407 acb->fw_flag = FW_NORMAL; in arcmsr_hbaB_request_device_map()
3408 if (atomic_read(&acb->ante_token_value) == atomic_read(&acb->rq_map_token)) { in arcmsr_hbaB_request_device_map()
3409 atomic_set(&acb->rq_map_token, 16); in arcmsr_hbaB_request_device_map()
3411 atomic_set(&acb->ante_token_value, atomic_read(&acb->rq_map_token)); in arcmsr_hbaB_request_device_map()
3412 if (atomic_dec_and_test(&acb->rq_map_token)) { in arcmsr_hbaB_request_device_map()
3413 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); in arcmsr_hbaB_request_device_map()
3417 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); in arcmsr_hbaB_request_device_map()
3422 static void arcmsr_hbaC_request_device_map(struct AdapterControlBlock *acb) in arcmsr_hbaC_request_device_map() argument
3424 struct MessageUnit_C __iomem *reg = acb->pmuC; in arcmsr_hbaC_request_device_map()
3425 …if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ((acb->acb_flags & ACB_F_BUS_RESET) != 0) ||… in arcmsr_hbaC_request_device_map()
3426 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); in arcmsr_hbaC_request_device_map()
3429 acb->fw_flag = FW_NORMAL; in arcmsr_hbaC_request_device_map()
3430 if (atomic_read(&acb->ante_token_value) == atomic_read(&acb->rq_map_token)) { in arcmsr_hbaC_request_device_map()
3431 atomic_set(&acb->rq_map_token, 16); in arcmsr_hbaC_request_device_map()
3433 atomic_set(&acb->ante_token_value, atomic_read(&acb->rq_map_token)); in arcmsr_hbaC_request_device_map()
3434 if (atomic_dec_and_test(&acb->rq_map_token)) { in arcmsr_hbaC_request_device_map()
3435 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); in arcmsr_hbaC_request_device_map()
3440 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); in arcmsr_hbaC_request_device_map()
3445 static void arcmsr_hbaD_request_device_map(struct AdapterControlBlock *acb) in arcmsr_hbaD_request_device_map() argument
3447 struct MessageUnit_D *reg = acb->pmuD; in arcmsr_hbaD_request_device_map()
3449 if (unlikely(atomic_read(&acb->rq_map_token) == 0) || in arcmsr_hbaD_request_device_map()
3450 ((acb->acb_flags & ACB_F_BUS_RESET) != 0) || in arcmsr_hbaD_request_device_map()
3451 ((acb->acb_flags & ACB_F_ABORT) != 0)) { in arcmsr_hbaD_request_device_map()
3452 mod_timer(&acb->eternal_timer, in arcmsr_hbaD_request_device_map()
3455 acb->fw_flag = FW_NORMAL; in arcmsr_hbaD_request_device_map()
3456 if (atomic_read(&acb->ante_token_value) == in arcmsr_hbaD_request_device_map()
3457 atomic_read(&acb->rq_map_token)) { in arcmsr_hbaD_request_device_map()
3458 atomic_set(&acb->rq_map_token, 16); in arcmsr_hbaD_request_device_map()
3460 atomic_set(&acb->ante_token_value, in arcmsr_hbaD_request_device_map()
3461 atomic_read(&acb->rq_map_token)); in arcmsr_hbaD_request_device_map()
3462 if (atomic_dec_and_test(&acb->rq_map_token)) { in arcmsr_hbaD_request_device_map()
3463 mod_timer(&acb->eternal_timer, jiffies + in arcmsr_hbaD_request_device_map()
3469 mod_timer(&acb->eternal_timer, jiffies + in arcmsr_hbaD_request_device_map()
3476 struct AdapterControlBlock *acb = (struct AdapterControlBlock *)pacb; in arcmsr_request_device_map() local
3477 switch (acb->adapter_type) { in arcmsr_request_device_map()
3479 arcmsr_hbaA_request_device_map(acb); in arcmsr_request_device_map()
3483 arcmsr_hbaB_request_device_map(acb); in arcmsr_request_device_map()
3487 arcmsr_hbaC_request_device_map(acb); in arcmsr_request_device_map()
3491 arcmsr_hbaD_request_device_map(acb); in arcmsr_request_device_map()
3496 static void arcmsr_hbaA_start_bgrb(struct AdapterControlBlock *acb) in arcmsr_hbaA_start_bgrb() argument
3498 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_hbaA_start_bgrb()
3499 acb->acb_flags |= ACB_F_MSG_START_BGRB; in arcmsr_hbaA_start_bgrb()
3501 if (!arcmsr_hbaA_wait_msgint_ready(acb)) { in arcmsr_hbaA_start_bgrb()
3503 rebulid' timeout \n", acb->host->host_no); in arcmsr_hbaA_start_bgrb()
3507 static void arcmsr_hbaB_start_bgrb(struct AdapterControlBlock *acb) in arcmsr_hbaB_start_bgrb() argument
3509 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_hbaB_start_bgrb()
3510 acb->acb_flags |= ACB_F_MSG_START_BGRB; in arcmsr_hbaB_start_bgrb()
3512 if (!arcmsr_hbaB_wait_msgint_ready(acb)) { in arcmsr_hbaB_start_bgrb()
3514 rebulid' timeout \n",acb->host->host_no); in arcmsr_hbaB_start_bgrb()
3543 static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb) in arcmsr_start_adapter_bgrb() argument
3545 switch (acb->adapter_type) { in arcmsr_start_adapter_bgrb()
3547 arcmsr_hbaA_start_bgrb(acb); in arcmsr_start_adapter_bgrb()
3550 arcmsr_hbaB_start_bgrb(acb); in arcmsr_start_adapter_bgrb()
3553 arcmsr_hbaC_start_bgrb(acb); in arcmsr_start_adapter_bgrb()
3556 arcmsr_hbaD_start_bgrb(acb); in arcmsr_start_adapter_bgrb()
3561 static void arcmsr_clear_doorbell_queue_buffer(struct AdapterControlBlock *acb) in arcmsr_clear_doorbell_queue_buffer() argument
3563 switch (acb->adapter_type) { in arcmsr_clear_doorbell_queue_buffer()
3565 struct MessageUnit_A __iomem *reg = acb->pmuA; in arcmsr_clear_doorbell_queue_buffer()
3576 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_clear_doorbell_queue_buffer()
3584 struct MessageUnit_C __iomem *reg = acb->pmuC; in arcmsr_clear_doorbell_queue_buffer()
3605 struct MessageUnit_D *reg = acb->pmuD; in arcmsr_clear_doorbell_queue_buffer()
3629 static void arcmsr_enable_eoi_mode(struct AdapterControlBlock *acb) in arcmsr_enable_eoi_mode() argument
3631 switch (acb->adapter_type) { in arcmsr_enable_eoi_mode()
3636 struct MessageUnit_B *reg = acb->pmuB; in arcmsr_enable_eoi_mode()
3638 if (!arcmsr_hbaB_wait_msgint_ready(acb)) { in arcmsr_enable_eoi_mode()
3650 static void arcmsr_hardware_reset(struct AdapterControlBlock *acb) in arcmsr_hardware_reset() argument
3654 struct MessageUnit_A __iomem *pmuA = acb->pmuA; in arcmsr_hardware_reset()
3655 struct MessageUnit_C __iomem *pmuC = acb->pmuC; in arcmsr_hardware_reset()
3656 struct MessageUnit_D *pmuD = acb->pmuD; in arcmsr_hardware_reset()
3659 printk(KERN_NOTICE "arcmsr%d: executing hw bus reset .....\n", acb->host->host_no); in arcmsr_hardware_reset()
3661 pci_read_config_byte(acb->pdev, i, &value[i]); in arcmsr_hardware_reset()
3664 if ((acb->dev_id == 0x1680)) { in arcmsr_hardware_reset()
3666 } else if ((acb->dev_id == 0x1880)) { in arcmsr_hardware_reset()
3677 } else if ((acb->dev_id == 0x1214)) { in arcmsr_hardware_reset()
3680 pci_write_config_byte(acb->pdev, 0x84, 0x20); in arcmsr_hardware_reset()
3685 pci_write_config_byte(acb->pdev, i, value[i]); in arcmsr_hardware_reset()
3690 static void arcmsr_iop_init(struct AdapterControlBlock *acb) in arcmsr_iop_init() argument
3694 intmask_org = arcmsr_disable_outbound_ints(acb); in arcmsr_iop_init()
3695 arcmsr_wait_firmware_ready(acb); in arcmsr_iop_init()
3696 arcmsr_iop_confirm(acb); in arcmsr_iop_init()
3698 arcmsr_start_adapter_bgrb(acb); in arcmsr_iop_init()
3700 arcmsr_clear_doorbell_queue_buffer(acb); in arcmsr_iop_init()
3701 arcmsr_enable_eoi_mode(acb); in arcmsr_iop_init()
3703 arcmsr_enable_outbound_ints(acb, intmask_org); in arcmsr_iop_init()
3704 acb->acb_flags |= ACB_F_IOP_INITED; in arcmsr_iop_init()
3707 static uint8_t arcmsr_iop_reset(struct AdapterControlBlock *acb) in arcmsr_iop_reset() argument
3715 if (atomic_read(&acb->ccboutstandingcount) != 0) { in arcmsr_iop_reset()
3717 intmask_org = arcmsr_disable_outbound_ints(acb); in arcmsr_iop_reset()
3719 rtnval = arcmsr_abort_allcmd(acb); in arcmsr_iop_reset()
3721 arcmsr_done4abort_postqueue(acb); in arcmsr_iop_reset()
3723 ccb = acb->pccb_pool[i]; in arcmsr_iop_reset()
3728 spin_lock_irqsave(&acb->ccblist_lock, flags); in arcmsr_iop_reset()
3729 list_add_tail(&ccb->list, &acb->ccb_free_list); in arcmsr_iop_reset()
3730 spin_unlock_irqrestore(&acb->ccblist_lock, flags); in arcmsr_iop_reset()
3733 atomic_set(&acb->ccboutstandingcount, 0); in arcmsr_iop_reset()
3735 arcmsr_enable_outbound_ints(acb, intmask_org); in arcmsr_iop_reset()
3743 struct AdapterControlBlock *acb; in arcmsr_bus_reset() local
3747 acb = (struct AdapterControlBlock *) cmd->device->host->hostdata; in arcmsr_bus_reset()
3748 … executing bus reset eh.....num_resets = %d, num_aborts = %d \n", acb->num_resets, acb->num_aborts… in arcmsr_bus_reset()
3749 acb->num_resets++; in arcmsr_bus_reset()
3751 switch(acb->adapter_type){ in arcmsr_bus_reset()
3753 if (acb->acb_flags & ACB_F_BUS_RESET){ in arcmsr_bus_reset()
3756 timeout = wait_event_timeout(wait_q, (acb->acb_flags & ACB_F_BUS_RESET) == 0, 220*HZ); in arcmsr_bus_reset()
3761 acb->acb_flags |= ACB_F_BUS_RESET; in arcmsr_bus_reset()
3762 if (!arcmsr_iop_reset(acb)) { in arcmsr_bus_reset()
3764 reg = acb->pmuA; in arcmsr_bus_reset()
3765 arcmsr_hardware_reset(acb); in arcmsr_bus_reset()
3766 acb->acb_flags &= ~ACB_F_IOP_INITED; in arcmsr_bus_reset()
3770 …printk(KERN_ERR "arcmsr%d: waiting for hw bus reset return, retry=%d\n", acb->host->host_no, retry… in arcmsr_bus_reset()
3772 acb->fw_flag = FW_DEADLOCK; in arcmsr_bus_reset()
3773 …printk(KERN_ERR "arcmsr%d: waiting for hw bus reset return, RETRY TERMINATED!!\n", acb->host->host… in arcmsr_bus_reset()
3779 acb->acb_flags |= ACB_F_IOP_INITED; in arcmsr_bus_reset()
3781 intmask_org = arcmsr_disable_outbound_ints(acb); in arcmsr_bus_reset()
3782 arcmsr_get_firmware_spec(acb); in arcmsr_bus_reset()
3783 arcmsr_start_adapter_bgrb(acb); in arcmsr_bus_reset()
3789 arcmsr_enable_outbound_ints(acb, intmask_org); in arcmsr_bus_reset()
3790 atomic_set(&acb->rq_map_token, 16); in arcmsr_bus_reset()
3791 atomic_set(&acb->ante_token_value, 16); in arcmsr_bus_reset()
3792 acb->fw_flag = FW_NORMAL; in arcmsr_bus_reset()
3793 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); in arcmsr_bus_reset()
3794 acb->acb_flags &= ~ACB_F_BUS_RESET; in arcmsr_bus_reset()
3798 acb->acb_flags &= ~ACB_F_BUS_RESET; in arcmsr_bus_reset()
3799 atomic_set(&acb->rq_map_token, 16); in arcmsr_bus_reset()
3800 atomic_set(&acb->ante_token_value, 16); in arcmsr_bus_reset()
3801 acb->fw_flag = FW_NORMAL; in arcmsr_bus_reset()
3802 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6*HZ)); in arcmsr_bus_reset()
3808 acb->acb_flags |= ACB_F_BUS_RESET; in arcmsr_bus_reset()
3809 if (!arcmsr_iop_reset(acb)) { in arcmsr_bus_reset()
3810 acb->acb_flags &= ~ACB_F_BUS_RESET; in arcmsr_bus_reset()
3813 acb->acb_flags &= ~ACB_F_BUS_RESET; in arcmsr_bus_reset()
3814 atomic_set(&acb->rq_map_token, 16); in arcmsr_bus_reset()
3815 atomic_set(&acb->ante_token_value, 16); in arcmsr_bus_reset()
3816 acb->fw_flag = FW_NORMAL; in arcmsr_bus_reset()
3817 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); in arcmsr_bus_reset()
3823 if (acb->acb_flags & ACB_F_BUS_RESET) { in arcmsr_bus_reset()
3826 timeout = wait_event_timeout(wait_q, (acb->acb_flags & ACB_F_BUS_RESET) == 0, 220*HZ); in arcmsr_bus_reset()
3831 acb->acb_flags |= ACB_F_BUS_RESET; in arcmsr_bus_reset()
3832 if (!arcmsr_iop_reset(acb)) { in arcmsr_bus_reset()
3834 reg = acb->pmuC; in arcmsr_bus_reset()
3835 arcmsr_hardware_reset(acb); in arcmsr_bus_reset()
3836 acb->acb_flags &= ~ACB_F_IOP_INITED; in arcmsr_bus_reset()
3840 …printk(KERN_ERR "arcmsr%d: waiting for hw bus reset return, retry=%d\n", acb->host->host_no, retry… in arcmsr_bus_reset()
3842 acb->fw_flag = FW_DEADLOCK; in arcmsr_bus_reset()
3843 …printk(KERN_ERR "arcmsr%d: waiting for hw bus reset return, RETRY TERMINATED!!\n", acb->host->host… in arcmsr_bus_reset()
3849 acb->acb_flags |= ACB_F_IOP_INITED; in arcmsr_bus_reset()
3851 intmask_org = arcmsr_disable_outbound_ints(acb); in arcmsr_bus_reset()
3852 arcmsr_get_firmware_spec(acb); in arcmsr_bus_reset()
3853 arcmsr_start_adapter_bgrb(acb); in arcmsr_bus_reset()
3855 arcmsr_clear_doorbell_queue_buffer(acb); in arcmsr_bus_reset()
3857 arcmsr_enable_outbound_ints(acb, intmask_org); in arcmsr_bus_reset()
3858 atomic_set(&acb->rq_map_token, 16); in arcmsr_bus_reset()
3859 atomic_set(&acb->ante_token_value, 16); in arcmsr_bus_reset()
3860 acb->fw_flag = FW_NORMAL; in arcmsr_bus_reset()
3861 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); in arcmsr_bus_reset()
3862 acb->acb_flags &= ~ACB_F_BUS_RESET; in arcmsr_bus_reset()
3866 acb->acb_flags &= ~ACB_F_BUS_RESET; in arcmsr_bus_reset()
3867 atomic_set(&acb->rq_map_token, 16); in arcmsr_bus_reset()
3868 atomic_set(&acb->ante_token_value, 16); in arcmsr_bus_reset()
3869 acb->fw_flag = FW_NORMAL; in arcmsr_bus_reset()
3870 mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6*HZ)); in arcmsr_bus_reset()
3876 if (acb->acb_flags & ACB_F_BUS_RESET) { in arcmsr_bus_reset()
3880 timeout = wait_event_timeout(wait_q, (acb->acb_flags in arcmsr_bus_reset()
3885 acb->acb_flags |= ACB_F_BUS_RESET; in arcmsr_bus_reset()
3886 if (!arcmsr_iop_reset(acb)) { in arcmsr_bus_reset()
3888 reg = acb->pmuD; in arcmsr_bus_reset()
3889 arcmsr_hardware_reset(acb); in arcmsr_bus_reset()
3890 acb->acb_flags &= ~ACB_F_IOP_INITED; in arcmsr_bus_reset()
3896 acb->host->host_no, retry_count); in arcmsr_bus_reset()
3898 acb->fw_flag = FW_DEADLOCK; in arcmsr_bus_reset()
3902 acb->host->host_no); in arcmsr_bus_reset()
3908 acb->acb_flags |= ACB_F_IOP_INITED; in arcmsr_bus_reset()
3910 intmask_org = arcmsr_disable_outbound_ints(acb); in arcmsr_bus_reset()
3911 arcmsr_get_firmware_spec(acb); in arcmsr_bus_reset()
3912 arcmsr_start_adapter_bgrb(acb); in arcmsr_bus_reset()
3913 arcmsr_clear_doorbell_queue_buffer(acb); in arcmsr_bus_reset()
3914 arcmsr_enable_outbound_ints(acb, intmask_org); in arcmsr_bus_reset()
3915 atomic_set(&acb->rq_map_token, 16); in arcmsr_bus_reset()
3916 atomic_set(&acb->ante_token_value, 16); in arcmsr_bus_reset()
3917 acb->fw_flag = FW_NORMAL; in arcmsr_bus_reset()
3918 mod_timer(&acb->eternal_timer, in arcmsr_bus_reset()
3920 acb->acb_flags &= ~ACB_F_BUS_RESET; in arcmsr_bus_reset()
3925 acb->acb_flags &= ~ACB_F_BUS_RESET; in arcmsr_bus_reset()
3926 atomic_set(&acb->rq_map_token, 16); in arcmsr_bus_reset()
3927 atomic_set(&acb->ante_token_value, 16); in arcmsr_bus_reset()
3928 acb->fw_flag = FW_NORMAL; in arcmsr_bus_reset()
3929 mod_timer(&acb->eternal_timer, in arcmsr_bus_reset()
3939 static int arcmsr_abort_one_cmd(struct AdapterControlBlock *acb, in arcmsr_abort_one_cmd() argument
3943 rtn = arcmsr_polling_ccbdone(acb, ccb); in arcmsr_abort_one_cmd()
3949 struct AdapterControlBlock *acb = in arcmsr_abort() local
3957 acb->host->host_no, cmd->device->id, (u32)cmd->device->lun); in arcmsr_abort()
3958 acb->acb_flags |= ACB_F_ABORT; in arcmsr_abort()
3959 acb->num_aborts++; in arcmsr_abort()
3966 if (!atomic_read(&acb->ccboutstandingcount)) { in arcmsr_abort()
3967 acb->acb_flags &= ~ACB_F_ABORT; in arcmsr_abort()
3971 intmask_org = arcmsr_disable_outbound_ints(acb); in arcmsr_abort()
3973 struct CommandControlBlock *ccb = acb->pccb_pool[i]; in arcmsr_abort()
3976 rtn = arcmsr_abort_one_cmd(acb, ccb); in arcmsr_abort()
3980 acb->acb_flags &= ~ACB_F_ABORT; in arcmsr_abort()
3981 arcmsr_enable_outbound_ints(acb, intmask_org); in arcmsr_abort()
3987 struct AdapterControlBlock *acb = in arcmsr_info() local
3992 switch (acb->pdev->device) { in arcmsr_info()