Lines Matching refs:pcibr_dmamap
105 #define ATE_FREEZE() s = ate_freeze(pcibr_dmamap, &freeze_time, cmd_regs)
107 #define ATE_FREEZE() s = ate_freeze(pcibr_dmamap, cmd_regs)
111 #define ATE_THAW() ate_thaw(pcibr_dmamap, ate_index, ate, ate_total, freeze_time, cmd_regs, s)
113 #define ATE_THAW() ate_thaw(pcibr_dmamap, ate_index, cmd_regs, s)
151 extern unsigned ate_freeze(pcibr_dmamap_t pcibr_dmamap,
157 extern void ate_thaw(pcibr_dmamap_t pcibr_dmamap, int ate_index,
2818 pcibr_dmamap_t pcibr_dmamap; in pcibr_dmamap_alloc() local
2830 pcibr_dmamap = (pcibr_dmamap_t)get_free_pciio_dmamap(pcibr_soft->bs_vhdl); in pcibr_dmamap_alloc()
2832 if (!pcibr_dmamap) in pcibr_dmamap_alloc()
2840 free_pciio_dmamap(pcibr_dmamap); in pcibr_dmamap_alloc()
2846 pcibr_dmamap->bd_dev = pconn_vhdl; in pcibr_dmamap_alloc()
2847 pcibr_dmamap->bd_slot = PCIBR_DEVICE_TO_SLOT(pcibr_soft, slot); in pcibr_dmamap_alloc()
2848 pcibr_dmamap->bd_soft = pcibr_soft; in pcibr_dmamap_alloc()
2849 pcibr_dmamap->bd_xtalk = xtalk_dmamap; in pcibr_dmamap_alloc()
2850 pcibr_dmamap->bd_max_size = req_size_max; in pcibr_dmamap_alloc()
2851 pcibr_dmamap->bd_xio_port = xio_port; in pcibr_dmamap_alloc()
2867 pcibr_dmamap->bd_flags = flags; in pcibr_dmamap_alloc()
2868 pcibr_dmamap->bd_xio_addr = 0; in pcibr_dmamap_alloc()
2869 pcibr_dmamap->bd_pci_addr = pci_addr; in pcibr_dmamap_alloc()
2890 pcibr_dmamap)); in pcibr_dmamap_alloc()
2891 return pcibr_dmamap; in pcibr_dmamap_alloc()
2898 DEL(pcibr_dmamap); in pcibr_dmamap_alloc()
2918 pcibr_dmamap)); in pcibr_dmamap_alloc()
2919 pcibr_dmamap->bd_flags = flags; in pcibr_dmamap_alloc()
2920 pcibr_dmamap->bd_xio_addr = pcibr_soft->bs_dir_xbase; in pcibr_dmamap_alloc()
2921 pcibr_dmamap->bd_pci_addr = PCI32_DIRECT_BASE; in pcibr_dmamap_alloc()
2922 return pcibr_dmamap; in pcibr_dmamap_alloc()
2931 free_pciio_dmamap(pcibr_dmamap); in pcibr_dmamap_alloc()
2961 "pcibr_dmamap=0x%x\n", ate_index, pcibr_dmamap)); in pcibr_dmamap_alloc()
2965 pcibr_dmamap->bd_flags = flags; in pcibr_dmamap_alloc()
2966 pcibr_dmamap->bd_pci_addr = in pcibr_dmamap_alloc()
2973 ATE_SWAP_ON(pcibr_dmamap->bd_pci_addr); in pcibr_dmamap_alloc()
2980 ATE_SWAP_ON(pcibr_dmamap->bd_pci_addr); in pcibr_dmamap_alloc()
2982 ATE_SWAP_OFF(pcibr_dmamap->bd_pci_addr); in pcibr_dmamap_alloc()
2984 pcibr_dmamap->bd_xio_addr = 0; in pcibr_dmamap_alloc()
2985 pcibr_dmamap->bd_ate_ptr = pcibr_ate_addr(pcibr_soft, ate_index); in pcibr_dmamap_alloc()
2986 pcibr_dmamap->bd_ate_index = ate_index; in pcibr_dmamap_alloc()
2987 pcibr_dmamap->bd_ate_count = ate_count; in pcibr_dmamap_alloc()
2988 pcibr_dmamap->bd_ate_proto = ate_proto; in pcibr_dmamap_alloc()
3011 pcibr_dmamap->bd_flags |= PCIBR_DMAMAP_SSRAM; in pcibr_dmamap_alloc()
3023 return pcibr_dmamap; in pcibr_dmamap_alloc()
3037 free_pciio_dmamap(pcibr_dmamap); in pcibr_dmamap_alloc()
3043 pcibr_dmamap_free(pcibr_dmamap_t pcibr_dmamap) in pcibr_dmamap_free() argument
3045 pcibr_soft_t pcibr_soft = pcibr_dmamap->bd_soft; in pcibr_dmamap_free()
3047 pcibr_dmamap->bd_slot); in pcibr_dmamap_free()
3049 unsigned flags = pcibr_dmamap->bd_flags; in pcibr_dmamap_free()
3059 xtalk_dmamap_free(pcibr_dmamap->bd_xtalk); in pcibr_dmamap_free()
3061 if (pcibr_dmamap->bd_flags & PCIIO_DMA_A64) { in pcibr_dmamap_free()
3064 if (pcibr_dmamap->bd_ate_count) { in pcibr_dmamap_free()
3065 pcibr_ate_free(pcibr_dmamap->bd_soft, in pcibr_dmamap_free()
3066 pcibr_dmamap->bd_ate_index, in pcibr_dmamap_free()
3067 pcibr_dmamap->bd_ate_count); in pcibr_dmamap_free()
3071 PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP, pcibr_dmamap->bd_dev, in pcibr_dmamap_free()
3072 "pcibr_dmamap_free: pcibr_dmamap=0x%x\n", pcibr_dmamap)); in pcibr_dmamap_free()
3074 free_pciio_dmamap(pcibr_dmamap); in pcibr_dmamap_free()
3142 pcibr_dmamap_addr(pcibr_dmamap_t pcibr_dmamap, in pcibr_dmamap_addr() argument
3152 ASSERT(pcibr_dmamap != NULL); in pcibr_dmamap_addr()
3154 ASSERT(req_size <= pcibr_dmamap->bd_max_size); in pcibr_dmamap_addr()
3156 pcibr_soft = pcibr_dmamap->bd_soft; in pcibr_dmamap_addr()
3158 flags = pcibr_dmamap->bd_flags; in pcibr_dmamap_addr()
3160 xio_addr = xtalk_dmamap_addr(pcibr_dmamap->bd_xtalk, paddr, req_size); in pcibr_dmamap_addr()
3165 xio_port = pcibr_dmamap->bd_xio_port; in pcibr_dmamap_addr()
3184 pci_addr = pcibr_dmamap->bd_pci_addr in pcibr_dmamap_addr()
3197 pcibr_dmamap->bd_dev, in pcibr_dmamap_addr()
3212 else if (xio_addr < pcibr_dmamap->bd_xio_addr) in pcibr_dmamap_addr()
3215 (pcibr_dmamap->bd_xio_addr + BRIDGE_DMA_DIRECT_SIZE)) in pcibr_dmamap_addr()
3218 pci_addr = pcibr_dmamap->bd_pci_addr + in pcibr_dmamap_addr()
3219 xio_addr - pcibr_dmamap->bd_xio_addr; in pcibr_dmamap_addr()
3222 pcibr_dmamap->bd_dev, in pcibr_dmamap_addr()
3230 bridge_ate_t ate_proto = pcibr_dmamap->bd_ate_proto; in pcibr_dmamap_addr()
3233 int ate_index = pcibr_dmamap->bd_ate_index; in pcibr_dmamap_addr()
3241 bridge_ate_p ate_ptr = pcibr_dmamap->bd_ate_ptr; in pcibr_dmamap_addr()
3256 pci_addr = pcibr_dmamap->bd_pci_addr + offset; in pcibr_dmamap_addr()
3264 if (ate_count <= pcibr_dmamap->bd_ate_count) { in pcibr_dmamap_addr()
3271 PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP, pcibr_dmamap->bd_dev, in pcibr_dmamap_addr()
3285 PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DMAMAP, pcibr_dmamap->bd_dev, in pcibr_dmamap_addr()
3290 ate_count, pcibr_dmamap->bd_ate_count)); in pcibr_dmamap_addr()
3300 pcibr_dmamap_done(pcibr_dmamap_t pcibr_dmamap) in pcibr_dmamap_done() argument
3303 pcibr_soft_t pcibr_soft = pcibr_dmamap->bd_soft; in pcibr_dmamap_done()
3313 if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_BUSY) { in pcibr_dmamap_done()
3314 pcibr_dmamap->bd_flags &= ~PCIBR_DMAMAP_BUSY; in pcibr_dmamap_done()
3316 if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM) in pcibr_dmamap_done()
3317 atomic_dec(&(pcibr_dmamap->bd_soft->bs_slot[pcibr_dmamap->bd_slot]. bss_ext_ates_active)); in pcibr_dmamap_done()
3319 xtalk_dmamap_done(pcibr_dmamap->bd_xtalk); in pcibr_dmamap_done()
3321 PCIBR_DEBUG((PCIBR_DEBUG_DMAMAP, pcibr_dmamap->bd_dev, in pcibr_dmamap_done()
3322 "pcibr_dmamap_done: pcibr_dmamap=0x%x\n", pcibr_dmamap)); in pcibr_dmamap_done()
3603 pcibr_dmamap_pciaddr_get(pcibr_dmamap_t pcibr_dmamap)
3605 return (pcibr_dmamap->bd_pci_addr);