[rtems-libbsd commit] dpaa: Add and use bman_new_pool_for_bpid()
Sebastian Huber
sebh at rtems.org
Tue Jan 23 13:59:17 UTC 2018
Module: rtems-libbsd
Branch: master
Commit: a7d252c645c59e877fe468e4c3e33dde47381d7c
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=a7d252c645c59e877fe468e4c3e33dde47381d7c
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Jan 12 13:22:10 2018 +0100
dpaa: Add and use bman_new_pool_for_bpid()
Update #3277.
---
linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 5 +++++
linux/drivers/soc/fsl/qbman/bman.c | 11 +++++++++++
linux/include/soc/fsl/bman.h | 3 +++
3 files changed, 19 insertions(+)
diff --git a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 00ffebd..bf7a277 100644
--- a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -571,6 +571,11 @@ static int dpaa_bp_alloc_pool(struct dpaa_bp *dpaa_bp)
dpaa_bp->bpid = (u8)bman_get_bpid(dpaa_bp->pool);
}
+#ifdef __rtems__
+ else {
+ dpaa_bp->pool = bman_new_pool_for_bpid(dpaa_bp->bpid);
+ }
+#endif /* __rtems__ */
if (dpaa_bp->seed_cb) {
err = dpaa_bp->seed_cb(dpaa_bp);
diff --git a/linux/drivers/soc/fsl/qbman/bman.c b/linux/drivers/soc/fsl/qbman/bman.c
index 44e4ee4..50923fb 100644
--- a/linux/drivers/soc/fsl/qbman/bman.c
+++ b/linux/drivers/soc/fsl/qbman/bman.c
@@ -720,6 +720,17 @@ err:
return NULL;
}
EXPORT_SYMBOL(bman_new_pool);
+#ifdef __rtems__
+struct bman_pool *
+bman_new_pool_for_bpid(u8 bpid)
+{
+ struct bman_pool *pool;
+
+ pool = malloc(sizeof(*pool), M_KMALLOC, M_WAITOK | M_ZERO);
+ pool->bpid = bpid;
+ return (pool);
+}
+#endif /* __rtems__ */
void bman_free_pool(struct bman_pool *pool)
{
diff --git a/linux/include/soc/fsl/bman.h b/linux/include/soc/fsl/bman.h
index eaaf56d..8cc2208 100644
--- a/linux/include/soc/fsl/bman.h
+++ b/linux/include/soc/fsl/bman.h
@@ -86,6 +86,9 @@ struct bman_pool;
* Creates a pool object, and returns a reference to it or NULL on error.
*/
struct bman_pool *bman_new_pool(void);
+#ifdef __rtems__
+struct bman_pool *bman_new_pool_for_bpid(u8 bpid);
+#endif /* __rtems__ */
/**
* bman_free_pool - Deallocates a Buffer Pool object
More information about the vc
mailing list