summaryrefslogtreecommitdiffstats
path: root/include/soc
diff options
context:
space:
mode:
authorHoria Geantă <horia.geanta@nxp.com>2018-09-12 11:59:29 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2018-09-21 13:24:50 +0800
commit55d0110248b2a419fdf94f0275c19fc9c394273a (patch)
treeff637b72d7927cb83d134cfc1861d9a4be11656e /include/soc
parent009447a038ec98cd11074e78a85ffd71f5c84d3b (diff)
downloadlinux-55d0110248b2a419fdf94f0275c19fc9c394273a.tar.bz2
soc: fsl: dpio: add congestion notification support
Add support for Congestion State Change Notifications (CSCN), which allow DPIO users to be notified when a congestion group changes its state (due to hitting the entrance / exit threshold). Acked-by: Li Yang <leoyang.li@nxp.com> Signed-off-by: Horia Geantă <horia.geanta@nxp.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/soc')
-rw-r--r--include/soc/fsl/dpaa2-global.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/soc/fsl/dpaa2-global.h b/include/soc/fsl/dpaa2-global.h
index 9bc0713346a8..2bfc379d3dc9 100644
--- a/include/soc/fsl/dpaa2-global.h
+++ b/include/soc/fsl/dpaa2-global.h
@@ -174,4 +174,19 @@ static inline const struct dpaa2_fd *dpaa2_dq_fd(const struct dpaa2_dq *dq)
return (const struct dpaa2_fd *)&dq->dq.fd[0];
}
+#define DPAA2_CSCN_SIZE sizeof(struct dpaa2_dq)
+#define DPAA2_CSCN_ALIGN 16
+#define DPAA2_CSCN_STATE_CG BIT(0)
+
+/**
+ * dpaa2_cscn_state_congested() - Check congestion state
+ * @cscn: congestion SCN (delivered to WQ or memory)
+ *
+i * Return true is congested.
+ */
+static inline bool dpaa2_cscn_state_congested(struct dpaa2_dq *cscn)
+{
+ return !!(cscn->scn.state & DPAA2_CSCN_STATE_CG);
+}
+
#endif /* __FSL_DPAA2_GLOBAL_H */