summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-06-27 12:51:07 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-23 09:24:07 +0200
commite3dc39ee0cc025cb66baae8ab5d9ccb7bdbcd57c (patch)
tree9882bd6803ca766c585d19c8f7727bbc79c4a83c /linux
parent9789434e2127185fad5ad2fa4f3eb219c6c698ec (diff)
downloadrtems-libbsd-e3dc39ee0cc025cb66baae8ab5d9ccb7bdbcd57c.tar.bz2
dpaa: Add <soc/fsl/dpaa.h>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 3698101a..e010f5dc 100644
--- a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -56,6 +56,8 @@
#include <linux/percpu.h>
#include <linux/dma-mapping.h>
#include <linux/sort.h>
+#else /* __rtems__ */
+#include <soc/fsl/dpaa.h>
#endif /* __rtems__ */
#include <soc/fsl/bman.h>
#include <soc/fsl/qman.h>
@@ -1606,6 +1608,35 @@ release_previous_buffs:
return 0;
}
+#ifdef __rtems__
+void
+dpaa_recycle_mcluster(struct dpaa_priv *dpaa_priv,
+ dpaa_buffer_recycle_context *rc, struct mbuf *m)
+{
+ size_t i;
+ dma_addr_t addr;
+
+ i = rc->count;
+ m->m_data = m->m_ext.ext_buf;
+ *(struct mbuf **)(mtod(m, char *) + DPAA_MBUF_POINTER_OFFSET) = m;
+ addr = mtod(m, dma_addr_t);
+ rc->bmb[i].data = 0;
+ bm_buffer_set64(&rc->bmb[i], addr);
+
+ if (i < ARRAY_SIZE(rc->bmb) - 1) {
+ rc->count = i + 1;
+ } else {
+ struct dpaa_bp *dpaa_bp;
+ int *countptr;
+
+ rc->count = 0;
+ dpaa_bp = dpaa_priv->dpaa_bps[0];
+ countptr = this_cpu_ptr(dpaa_bp->percpu_count);
+ *countptr += dpaa_bman_release(dpaa_bp, rc->bmb,
+ ARRAY_SIZE(rc->bmb));
+ }
+}
+#endif /* __rtems__ */
static int dpaa_bp_seed(struct dpaa_bp *dpaa_bp)
{