[PATCH 15/20] dpaa: Add and use bman_new_pool_for_bpid()

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jan 19 13:54:05 UTC 2018


---
 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 00ffebdf7..bf7a2771a 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 44e4ee4b7..50923fb1b 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 eaaf56df4..8cc22082a 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
-- 
2.12.3




More information about the devel mailing list