Lines Matching refs:fifo
64 __hal_fifo_t *fifo = (__hal_fifo_t *) userdata; in __hal_fifo_mempool_item_alloc() local
66 vxge_assert(fifo != NULL); in __hal_fifo_mempool_item_alloc()
71 __hal_device_t *hldev = (__hal_device_t *) fifo->channel.devh; in __hal_fifo_mempool_item_alloc()
93 for (i = 0; i < fifo->txdl_per_memblock; i++) { in __hal_fifo_mempool_item_alloc()
98 int dtr_index = item_index * fifo->txdl_per_memblock + i; in __hal_fifo_mempool_item_alloc()
101 ((char *) item + i * fifo->txdl_size)); in __hal_fifo_mempool_item_alloc()
105 fifo->channel.dtr_arr[dtr_index].dtr = txdp; in __hal_fifo_mempool_item_alloc()
107 fifo->channel.dtr_arr[dtr_index].uld_priv = (void *) in __hal_fifo_mempool_item_alloc()
108 ((char *) block_priv + fifo->txdl_priv_size * i); in __hal_fifo_mempool_item_alloc()
110 fifo->channel.dtr_arr[dtr_index].hal_priv = (void *) in __hal_fifo_mempool_item_alloc()
111 (((char *) fifo->channel.dtr_arr[dtr_index].uld_priv) + in __hal_fifo_mempool_item_alloc()
112 fifo->per_txdl_space); in __hal_fifo_mempool_item_alloc()
115 fifo->channel.dtr_arr[dtr_index].hal_priv; in __hal_fifo_mempool_item_alloc()
144 if (fifo->config->alignment_size) { in __hal_fifo_mempool_item_alloc()
145 status = __hal_fifo_txdl_align_alloc_map(fifo, in __hal_fifo_mempool_item_alloc()
152 fifo->channel.devh; in __hal_fifo_mempool_item_alloc()
157 (item_index * fifo->txdl_per_memblock + i), in __hal_fifo_mempool_item_alloc()
158 fifo->align_size, status); in __hal_fifo_mempool_item_alloc()
170 if (fifo->txdl_init) { in __hal_fifo_mempool_item_alloc()
171 fifo->txdl_init(fifo->channel.vph, in __hal_fifo_mempool_item_alloc()
173 VXGE_HAL_FIFO_ULD_PRIV(fifo, txdp), in __hal_fifo_mempool_item_alloc()
175 fifo->channel.userdata, VXGE_HAL_OPEN_NORMAL); in __hal_fifo_mempool_item_alloc()
181 __hal_device_t *hldev = (__hal_device_t *) fifo->channel.devh; in __hal_fifo_mempool_item_alloc()
221 __hal_fifo_t *fifo = (__hal_fifo_t *) userdata; in __hal_fifo_mempool_item_free() local
223 vxge_assert(fifo != NULL); in __hal_fifo_mempool_item_free()
225 __hal_device_t *hldev = (__hal_device_t *) fifo->channel.devh; in __hal_fifo_mempool_item_free()
243 __hal_fifo_t *fifo = (__hal_fifo_t *) userdata; in __hal_fifo_mempool_item_free() local
245 vxge_assert(fifo != NULL); in __hal_fifo_mempool_item_free()
246 if (fifo->config->alignment_size) { in __hal_fifo_mempool_item_free()
251 for (i = 0; i < fifo->txdl_per_memblock; i++) { in __hal_fifo_mempool_item_free()
253 ((char *) item + i * fifo->txdl_size); in __hal_fifo_mempool_item_free()
254 __hal_fifo_txdl_align_free_unmap(fifo, txdp); in __hal_fifo_mempool_item_free()
262 __hal_fifo_t *fifo = (__hal_fifo_t *) userdata; in __hal_fifo_mempool_item_free() local
264 vxge_assert(fifo != NULL); in __hal_fifo_mempool_item_free()
266 __hal_device_t *hldev = (__hal_device_t *) fifo->channel.devh; in __hal_fifo_mempool_item_free()
290 __hal_fifo_t *fifo; in __hal_fifo_create() local
317 &vp->vpath->hldev->header.config.vp_config[vp->vpath->vp_id].fifo; in __hal_fifo_create()
331 fifo = (__hal_fifo_t *) vxge_hal_channel_allocate( in __hal_fifo_create()
339 if (fifo == NULL) { in __hal_fifo_create()
348 vp->vpath->fifoh = fifo; in __hal_fifo_create()
350 fifo->stats = &vp->vpath->sw_stats->fifo_stats; in __hal_fifo_create()
352 fifo->config = config; in __hal_fifo_create()
354 fifo->memblock_size = memblock_size; in __hal_fifo_create()
357 vxge_os_spin_lock_init(&fifo->channel.post_lock, in __hal_fifo_create()
360 vxge_os_spin_lock_init_irq(&fifo->channel.post_lock, in __hal_fifo_create()
364 fifo->align_size = in __hal_fifo_create()
365 fifo->config->alignment_size * fifo->config->max_aligned_frags; in __hal_fifo_create()
368 fifo->interrupt_type = VXGE_HAL_FIFO_TXD_INT_TYPE_UTILZ; in __hal_fifo_create()
369 if (fifo->config->intr) { in __hal_fifo_create()
370 fifo->interrupt_type = VXGE_HAL_FIFO_TXD_INT_TYPE_PER_LIST; in __hal_fifo_create()
373 fifo->no_snoop_bits = config->no_snoop_bits; in __hal_fifo_create()
398 fifo->txdl_priv_size = in __hal_fifo_create()
400 fifo->txdl_priv_size = in __hal_fifo_create()
401 ((fifo->txdl_priv_size + __vxge_os_cacheline_size - 1) / in __hal_fifo_create()
404 fifo->per_txdl_space = attr->per_txdl_space; in __hal_fifo_create()
407 fifo->txdl_size = txdl_size; in __hal_fifo_create()
408 fifo->txdl_per_memblock = txdl_per_memblock; in __hal_fifo_create()
415 fifo->txdl_init = attr->txdl_init; in __hal_fifo_create()
416 fifo->txdl_term = attr->txdl_term; in __hal_fifo_create()
417 fifo->callback = attr->callback; in __hal_fifo_create()
419 if (fifo->txdl_per_memblock == 0) { in __hal_fifo_create()
428 fifo->txdlblock_priv_size = in __hal_fifo_create()
429 fifo->txdl_priv_size * fifo->txdl_per_memblock; in __hal_fifo_create()
431 fifo->mempool = in __hal_fifo_create()
433 fifo->memblock_size, in __hal_fifo_create()
434 fifo->memblock_size, in __hal_fifo_create()
435 fifo->txdlblock_priv_size, in __hal_fifo_create()
436 fifo->config->fifo_length / in __hal_fifo_create()
437 fifo->txdl_per_memblock, in __hal_fifo_create()
438 fifo->config->fifo_length / in __hal_fifo_create()
439 fifo->txdl_per_memblock, in __hal_fifo_create()
442 fifo); in __hal_fifo_create()
444 if (fifo->mempool == NULL) { in __hal_fifo_create()
451 status = vxge_hal_channel_initialize(&fifo->channel); in __hal_fifo_create()
477 __hal_fifo_t *fifo = (__hal_fifo_t *) fifoh; in __hal_fifo_abort() local
483 hldev = (__hal_device_t *) fifo->channel.devh; in __hal_fifo_abort()
491 if (fifo->txdl_term) { in __hal_fifo_abort()
492 __hal_channel_for_each_dtr(&fifo->channel, txdlh, i) { in __hal_fifo_abort()
493 if (!__hal_channel_is_posted_dtr(&fifo->channel, in __hal_fifo_abort()
495 fifo->txdl_term(fifo->channel.vph, txdlh, in __hal_fifo_abort()
496 VXGE_HAL_FIFO_ULD_PRIV(fifo, txdlh), in __hal_fifo_abort()
498 fifo->channel.userdata, in __hal_fifo_abort()
505 __hal_channel_dtr_try_complete(&fifo->channel, &txdlh); in __hal_fifo_abort()
510 __hal_channel_dtr_complete(&fifo->channel); in __hal_fifo_abort()
512 if (fifo->txdl_term) { in __hal_fifo_abort()
513 fifo->txdl_term(fifo->channel.vph, txdlh, in __hal_fifo_abort()
514 VXGE_HAL_FIFO_ULD_PRIV(fifo, txdlh), in __hal_fifo_abort()
516 fifo->channel.userdata, in __hal_fifo_abort()
520 __hal_channel_dtr_free(&fifo->channel, in __hal_fifo_abort()
540 __hal_fifo_t *fifo = (__hal_fifo_t *) fifoh; in __hal_fifo_reset() local
544 hldev = (__hal_device_t *) fifo->channel.devh; in __hal_fifo_reset()
554 status = __hal_channel_reset(&fifo->channel); in __hal_fifo_reset()
582 __hal_fifo_t *fifo; in vxge_hal_fifo_doorbell_reset() local
599 fifo = (__hal_fifo_t *) vp->vpath->fifoh; in vxge_hal_fifo_doorbell_reset()
601 vpath = ((__hal_vpath_handle_t *) fifo->channel.vph)->vpath; in vxge_hal_fifo_doorbell_reset()
603 status = __hal_non_offload_db_reset(fifo->channel.vph); in vxge_hal_fifo_doorbell_reset()
611 __hal_channel_for_each_posted_dtr(&fifo->channel, txdlh, i) { in vxge_hal_fifo_doorbell_reset()
613 txdl_priv = VXGE_HAL_FIFO_HAL_PRIV(fifo, txdlh); in vxge_hal_fifo_doorbell_reset()
615 __hal_non_offload_db_post(fifo->channel.vph, in vxge_hal_fifo_doorbell_reset()
621 vpath->vp_config->fifo.no_snoop_bits); in vxge_hal_fifo_doorbell_reset()
641 __hal_fifo_t *fifo; in __hal_fifo_delete() local
654 fifo = (__hal_fifo_t *) vp->vpath->fifoh; in __hal_fifo_delete()
656 vxge_assert(fifo != NULL); in __hal_fifo_delete()
658 if (fifo->mempool) { in __hal_fifo_delete()
660 vxge_hal_mempool_destroy(fifo->mempool); in __hal_fifo_delete()
663 vxge_hal_channel_terminate(&fifo->channel); in __hal_fifo_delete()
666 vxge_os_spin_lock_destroy(&fifo->channel.post_lock, in __hal_fifo_delete()
669 vxge_os_spin_lock_destroy_irq(&fifo->channel.post_lock, in __hal_fifo_delete()
673 vxge_hal_channel_free(&fifo->channel); in __hal_fifo_delete()
689 __hal_fifo_t *fifo, in __hal_fifo_txdl_align_free_unmap() argument
695 vxge_assert((fifo != NULL) && (txdp != NULL)); in __hal_fifo_txdl_align_free_unmap()
697 hldev = (__hal_device_t *) fifo->channel.devh; in __hal_fifo_txdl_align_free_unmap()
704 (ptr_t) fifo, (ptr_t) txdp); in __hal_fifo_txdl_align_free_unmap()
706 txdl_priv = VXGE_HAL_FIFO_HAL_PRIV(fifo, txdp); in __hal_fifo_txdl_align_free_unmap()
709 __hal_blockpool_free(fifo->channel.devh, in __hal_fifo_txdl_align_free_unmap()
711 fifo->align_size, in __hal_fifo_txdl_align_free_unmap()
733 __hal_fifo_t *fifo, in __hal_fifo_txdl_align_alloc_map() argument
739 vxge_assert((fifo != NULL) && (txdp != NULL)); in __hal_fifo_txdl_align_alloc_map()
741 hldev = (__hal_device_t *) fifo->channel.devh; in __hal_fifo_txdl_align_alloc_map()
748 (ptr_t) fifo, (ptr_t) txdp); in __hal_fifo_txdl_align_alloc_map()
750 txdl_priv = VXGE_HAL_FIFO_HAL_PRIV(fifo, txdp); in __hal_fifo_txdl_align_alloc_map()
754 (u8 *) __hal_blockpool_malloc(fifo->channel.devh, in __hal_fifo_txdl_align_alloc_map()
755 fifo->align_size, in __hal_fifo_txdl_align_alloc_map()
832 __hal_fifo_t *fifo; in vxge_hal_fifo_txdl_reserve() local
851 fifo = (__hal_fifo_t *) vp->vpath->fifoh; in vxge_hal_fifo_txdl_reserve()
853 vxge_assert(fifo != NULL); in vxge_hal_fifo_txdl_reserve()
856 vxge_os_spin_lock(&fifo->channel.post_lock); in vxge_hal_fifo_txdl_reserve()
858 vxge_os_spin_lock_irq(&fifo->channel.post_lock, flags); in vxge_hal_fifo_txdl_reserve()
861 status = __hal_channel_dtr_reserve(&fifo->channel, txdlh); in vxge_hal_fifo_txdl_reserve()
864 vxge_os_spin_unlock(&fifo->channel.post_lock); in vxge_hal_fifo_txdl_reserve()
866 vxge_os_spin_unlock_irq(&fifo->channel.post_lock, flags); in vxge_hal_fifo_txdl_reserve()
873 priv = VXGE_HAL_FIFO_HAL_PRIV(fifo, txdp); in vxge_hal_fifo_txdl_reserve()
880 priv->alloc_frags = fifo->config->max_frags; in vxge_hal_fifo_txdl_reserve()
886 *txdl_priv = VXGE_HAL_FIFO_ULD_PRIV(fifo, txdp); in vxge_hal_fifo_txdl_reserve()
888 for (i = 0; i < fifo->config->max_frags; i++) { in vxge_hal_fifo_txdl_reserve()
929 __hal_fifo_t *fifo; in vxge_hal_fifo_txdl_buffer_set() local
948 fifo = (__hal_fifo_t *) vp->vpath->fifoh; in vxge_hal_fifo_txdl_buffer_set()
950 vxge_assert(fifo != NULL); in vxge_hal_fifo_txdl_buffer_set()
952 txdl_priv = VXGE_HAL_FIFO_HAL_PRIV(fifo, txdlh); in vxge_hal_fifo_txdl_buffer_set()
967 fifo->stats->total_buffers++; in vxge_hal_fifo_txdl_buffer_set()
1025 __hal_fifo_t *fifo; in vxge_hal_fifo_txdl_buffer_set_aligned() local
1049 fifo = (__hal_fifo_t *) vp->vpath->fifoh; in vxge_hal_fifo_txdl_buffer_set_aligned()
1051 vxge_assert(fifo != NULL); in vxge_hal_fifo_txdl_buffer_set_aligned()
1053 txdl_priv = VXGE_HAL_FIFO_HAL_PRIV(fifo, txdlh); in vxge_hal_fifo_txdl_buffer_set_aligned()
1065 misaligned_size <= fifo->config->alignment_size); in vxge_hal_fifo_txdl_buffer_set_aligned()
1073 if (txdl_priv->align_used_frags >= fifo->config->max_aligned_frags) { in vxge_hal_fifo_txdl_buffer_set_aligned()
1083 fifo->stats->total_buffers++; in vxge_hal_fifo_txdl_buffer_set_aligned()
1086 txdl_priv->align_vaddr_start += fifo->config->alignment_size; in vxge_hal_fifo_txdl_buffer_set_aligned()
1091 vxge_os_dma_sync(fifo->channel.pdev, in vxge_hal_fifo_txdl_buffer_set_aligned()
1106 fifo->stats->total_buffers++; in vxge_hal_fifo_txdl_buffer_set_aligned()
1143 __hal_fifo_t *fifo; in vxge_hal_fifo_txdl_buffer_append() local
1161 fifo = (__hal_fifo_t *) vp->vpath->fifoh; in vxge_hal_fifo_txdl_buffer_append()
1163 vxge_assert(fifo != NULL); in vxge_hal_fifo_txdl_buffer_append()
1165 txdl_priv = VXGE_HAL_FIFO_HAL_PRIV(fifo, txdlh); in vxge_hal_fifo_txdl_buffer_append()
1171 if (used + (unsigned int)size > (unsigned int)fifo->align_size) in vxge_hal_fifo_txdl_buffer_append()
1177 fifo->stats->copied_frags++; in vxge_hal_fifo_txdl_buffer_append()
1208 __hal_fifo_t *fifo; in vxge_hal_fifo_txdl_buffer_finalize() local
1226 fifo = (__hal_fifo_t *) vp->vpath->fifoh; in vxge_hal_fifo_txdl_buffer_finalize()
1228 vxge_assert(fifo != NULL); in vxge_hal_fifo_txdl_buffer_finalize()
1230 txdl_priv = VXGE_HAL_FIFO_HAL_PRIV(fifo, txdlh); in vxge_hal_fifo_txdl_buffer_finalize()
1239 fifo->stats->total_buffers++; in vxge_hal_fifo_txdl_buffer_finalize()
1240 fifo->stats->copied_buffers++; in vxge_hal_fifo_txdl_buffer_finalize()
1246 vxge_os_dma_sync(fifo->channel.pdev, in vxge_hal_fifo_txdl_buffer_finalize()
1280 __hal_fifo_t *fifo; in vxge_hal_fifo_txdl_new_frame_set() local
1296 fifo = (__hal_fifo_t *) vp->vpath->fifoh; in vxge_hal_fifo_txdl_new_frame_set()
1298 vxge_assert(fifo != NULL); in vxge_hal_fifo_txdl_new_frame_set()
1300 txdl_priv = VXGE_HAL_FIFO_HAL_PRIV(fifo, txdlh); in vxge_hal_fifo_txdl_new_frame_set()
1308 txdp->control_1 |= fifo->interrupt_type; in vxge_hal_fifo_txdl_new_frame_set()
1345 __hal_fifo_t *fifo; in vxge_hal_fifo_txdl_post() local
1367 fifo = (__hal_fifo_t *) vp->vpath->fifoh; in vxge_hal_fifo_txdl_post()
1369 vxge_assert(fifo != NULL); in vxge_hal_fifo_txdl_post()
1371 txdl_priv = VXGE_HAL_FIFO_HAL_PRIV(fifo, txdlh); in vxge_hal_fifo_txdl_post()
1380 txdp_first->control_1 |= fifo->interrupt_type; in vxge_hal_fifo_txdl_post()
1393 vxge_os_spin_lock(&fifo->channel.post_lock); in vxge_hal_fifo_txdl_post()
1395 vxge_os_spin_lock_irq(&fifo->channel.post_lock, flags); in vxge_hal_fifo_txdl_post()
1408 vxge_os_dma_sync(fifo->channel.pdev, in vxge_hal_fifo_txdl_post()
1418 __hal_channel_dtr_post(&fifo->channel, VXGE_HAL_FIFO_TXDL_INDEX(txdlh)); in vxge_hal_fifo_txdl_post()
1423 vp->vpath->vp_config->fifo.no_snoop_bits); in vxge_hal_fifo_txdl_post()
1434 fifo->stats->total_posts++; in vxge_hal_fifo_txdl_post()
1435 fifo->stats->common_stats.usage_cnt++; in vxge_hal_fifo_txdl_post()
1436 if (fifo->stats->common_stats.usage_max < in vxge_hal_fifo_txdl_post()
1437 fifo->stats->common_stats.usage_cnt) in vxge_hal_fifo_txdl_post()
1438 fifo->stats->common_stats.usage_max = in vxge_hal_fifo_txdl_post()
1439 fifo->stats->common_stats.usage_cnt; in vxge_hal_fifo_txdl_post()
1442 vxge_os_spin_unlock(&fifo->channel.post_lock); in vxge_hal_fifo_txdl_post()
1444 vxge_os_spin_unlock_irq(&fifo->channel.post_lock, flags); in vxge_hal_fifo_txdl_post()
1459 __hal_fifo_t *fifo; in vxge_hal_fifo_is_next_txdl_completed() local
1481 fifo = (__hal_fifo_t *) vp->vpath->fifoh; in vxge_hal_fifo_is_next_txdl_completed()
1483 vxge_assert(fifo != NULL); in vxge_hal_fifo_is_next_txdl_completed()
1486 vxge_os_spin_lock(&fifo->channel.post_lock); in vxge_hal_fifo_is_next_txdl_completed()
1488 vxge_os_spin_lock_irq(&fifo->channel.post_lock, flags); in vxge_hal_fifo_is_next_txdl_completed()
1491 __hal_channel_dtr_try_complete(&fifo->channel, &txdlh); in vxge_hal_fifo_is_next_txdl_completed()
1500 vxge_os_spin_unlock(&fifo->channel.post_lock); in vxge_hal_fifo_is_next_txdl_completed()
1502 vxge_os_spin_unlock_irq(&fifo->channel.post_lock, flags); in vxge_hal_fifo_is_next_txdl_completed()
1552 __hal_fifo_t *fifo; in vxge_hal_fifo_txdl_next_completed() local
1580 fifo = (__hal_fifo_t *) vp->vpath->fifoh; in vxge_hal_fifo_txdl_next_completed()
1582 vxge_assert(fifo != NULL); in vxge_hal_fifo_txdl_next_completed()
1587 vxge_os_spin_lock(&fifo->channel.post_lock); in vxge_hal_fifo_txdl_next_completed()
1589 vxge_os_spin_lock_irq(&fifo->channel.post_lock, flags); in vxge_hal_fifo_txdl_next_completed()
1592 __hal_channel_dtr_try_complete(&fifo->channel, txdlh); in vxge_hal_fifo_txdl_next_completed()
1598 priv = VXGE_HAL_FIFO_HAL_PRIV(fifo, txdp); in vxge_hal_fifo_txdl_next_completed()
1605 vxge_os_dma_sync(fifo->channel.pdev, in vxge_hal_fifo_txdl_next_completed()
1616 __hal_channel_dtr_complete(&fifo->channel); in vxge_hal_fifo_txdl_next_completed()
1618 *txdl_priv = VXGE_HAL_FIFO_ULD_PRIV(fifo, txdp); in vxge_hal_fifo_txdl_next_completed()
1623 if (fifo->stats->common_stats.usage_cnt > 0) in vxge_hal_fifo_txdl_next_completed()
1624 fifo->stats->common_stats.usage_cnt--; in vxge_hal_fifo_txdl_next_completed()
1632 vxge_os_spin_unlock(&fifo->channel.post_lock); in vxge_hal_fifo_txdl_next_completed()
1634 vxge_os_spin_unlock_irq(&fifo->channel.post_lock, flags); in vxge_hal_fifo_txdl_next_completed()
1727 __hal_fifo_t *fifo, in __hal_fifo_txdl_free_many() argument
1735 __hal_vpath_handle_t *vp = (__hal_vpath_handle_t *) fifo->channel.vph; in __hal_fifo_txdl_free_many()
1738 vxge_assert((fifo != NULL) && (txdp != NULL)); in __hal_fifo_txdl_free_many()
1747 "list_size = %d, frags = %d", (ptr_t) fifo, (ptr_t) txdp, in __hal_fifo_txdl_free_many()
1761 current_txdl_priv = VXGE_HAL_FIFO_HAL_PRIV(fifo, txdp); in __hal_fifo_txdl_free_many()
1765 __hal_channel_dtr_free(&fifo->channel, in __hal_fifo_txdl_free_many()
1817 __hal_fifo_t *fifo; in vxge_hal_fifo_txdl_free() local
1836 fifo = (__hal_fifo_t *) vp->vpath->fifoh; in vxge_hal_fifo_txdl_free()
1838 vxge_assert(fifo != NULL); in vxge_hal_fifo_txdl_free()
1840 txdl_priv = VXGE_HAL_FIFO_HAL_PRIV(fifo, txdlh); in vxge_hal_fifo_txdl_free()
1842 max_frags = fifo->config->max_frags; in vxge_hal_fifo_txdl_free()
1845 vxge_os_spin_lock(&fifo->channel.post_lock); in vxge_hal_fifo_txdl_free()
1847 vxge_os_spin_lock_irq(&fifo->channel.post_lock, flags); in vxge_hal_fifo_txdl_free()
1866 __hal_fifo_txdl_free_many(fifo, dang_txdp, in vxge_hal_fifo_txdl_free()
1874 __hal_fifo_txdl_free_many(fifo, in vxge_hal_fifo_txdl_free()
1878 __hal_channel_dtr_free(&fifo->channel, in vxge_hal_fifo_txdl_free()
1882 fifo->channel.poll_bytes += txdl_priv->bytes_sent; in vxge_hal_fifo_txdl_free()
1889 vxge_os_spin_unlock(&fifo->channel.post_lock); in vxge_hal_fifo_txdl_free()
1891 vxge_os_spin_unlock_irq(&fifo->channel.post_lock, flags); in vxge_hal_fifo_txdl_free()