a23fd118e437af0a7877dd313db8fdaa3537c675yl * CDDL HEADER START
a23fd118e437af0a7877dd313db8fdaa3537c675yl * The contents of this file are subject to the terms of the
a23fd118e437af0a7877dd313db8fdaa3537c675yl * Common Development and Distribution License (the "License").
a23fd118e437af0a7877dd313db8fdaa3537c675yl * You may not use this file except in compliance with the License.
a23fd118e437af0a7877dd313db8fdaa3537c675yl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
a23fd118e437af0a7877dd313db8fdaa3537c675yl * See the License for the specific language governing permissions
a23fd118e437af0a7877dd313db8fdaa3537c675yl * and limitations under the License.
a23fd118e437af0a7877dd313db8fdaa3537c675yl * When distributing Covered Code, include this CDDL HEADER in each
a23fd118e437af0a7877dd313db8fdaa3537c675yl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a23fd118e437af0a7877dd313db8fdaa3537c675yl * If applicable, add the following below this CDDL HEADER, with the
a23fd118e437af0a7877dd313db8fdaa3537c675yl * fields enclosed by brackets "[]" replaced with your own identifying
a23fd118e437af0a7877dd313db8fdaa3537c675yl * information: Portions Copyright [yyyy] [name of copyright owner]
a23fd118e437af0a7877dd313db8fdaa3537c675yl * CDDL HEADER END
8347601bcb0a439f6e50fc36b4039a73d08700e1yl * Copyright (c) 2002-2006 Neterion, Inc.
a23fd118e437af0a7877dd313db8fdaa3537c675yl * struct xge_hal_mempool_dma_t - Represents DMA objects passed to the
a23fd118e437af0a7877dd313db8fdaa3537c675yl * xge_hal_mempool_item_f - Mempool item alloc/free callback
a23fd118e437af0a7877dd313db8fdaa3537c675yl * @mempoolh: Memory pool handle.
a23fd118e437af0a7877dd313db8fdaa3537c675yl * @item: Item that gets allocated or freed.
a23fd118e437af0a7877dd313db8fdaa3537c675yl * @index: Item's index in the memory pool.
a23fd118e437af0a7877dd313db8fdaa3537c675yl * @is_last: True, if this item is the last one in the pool; false - otherwise.
a23fd118e437af0a7877dd313db8fdaa3537c675yl * userdat: Per-pool user context.
a23fd118e437af0a7877dd313db8fdaa3537c675yl * Memory pool allocation/deallocation callback.
a23fd118e437af0a7877dd313db8fdaa3537c675yltypedef xge_hal_status_e (*xge_hal_mempool_item_f) (xge_hal_mempool_h mempoolh,
a23fd118e437af0a7877dd313db8fdaa3537c675yl * struct xge_hal_mempool_t - Memory pool.
a23fd118e437af0a7877dd313db8fdaa3537c675yl * __hal_mempool_item - Returns pointer to the item in the mempool
a23fd118e437af0a7877dd313db8fdaa3537c675yl * items array.
a23fd118e437af0a7877dd313db8fdaa3537c675ylstatic inline void*
a23fd118e437af0a7877dd313db8fdaa3537c675yl * __hal_mempool_item_priv - will return pointer on per item private space
a23fd118e437af0a7877dd313db8fdaa3537c675ylstatic inline void*
a23fd118e437af0a7877dd313db8fdaa3537c675yl__hal_mempool_item_priv(xge_hal_mempool_t *mempool, int memblock_idx,
a23fd118e437af0a7877dd313db8fdaa3537c675yl xge_assert(offset >= 0 && offset < mempool->memblock_size);
a23fd118e437af0a7877dd313db8fdaa3537c675yl (*memblock_item_idx) = (int) offset / mempool->item_size;
a23fd118e437af0a7877dd313db8fdaa3537c675yl xge_assert((*memblock_item_idx) < mempool->items_per_memblock);
a23fd118e437af0a7877dd313db8fdaa3537c675yl return (char*)mempool->memblocks_priv_arr[memblock_idx] +
a23fd118e437af0a7877dd313db8fdaa3537c675yl * __hal_mempool_items_arr - will return pointer to the items array in the
a23fd118e437af0a7877dd313db8fdaa3537c675yl * mempool.
a23fd118e437af0a7877dd313db8fdaa3537c675ylstatic inline void*
a23fd118e437af0a7877dd313db8fdaa3537c675yl * __hal_mempool_memblock - will return pointer to the memblock in the
a23fd118e437af0a7877dd313db8fdaa3537c675yl * mempool memblocks array.
a23fd118e437af0a7877dd313db8fdaa3537c675ylstatic inline void*
a23fd118e437af0a7877dd313db8fdaa3537c675yl__hal_mempool_memblock(xge_hal_mempool_t *mempool, int memblock_idx)
a23fd118e437af0a7877dd313db8fdaa3537c675yl * __hal_mempool_memblock_dma - will return pointer to the dma block
a23fd118e437af0a7877dd313db8fdaa3537c675yl * corresponds to the memblock(identified by memblock_idx) in the mempool.
a23fd118e437af0a7877dd313db8fdaa3537c675yl__hal_mempool_memblock_dma(xge_hal_mempool_t *mempool, int memblock_idx)
a23fd118e437af0a7877dd313db8fdaa3537c675ylxge_hal_status_e __hal_mempool_grow(xge_hal_mempool_t *mempool,
a23fd118e437af0a7877dd313db8fdaa3537c675ylxge_hal_mempool_t* __hal_mempool_create(pci_dev_h pdev, int memblock_size,
a23fd118e437af0a7877dd313db8fdaa3537c675yl#endif /* XGE_HAL_MM_H */