[PATCH 13/20] dpaa: Add and use SDK_DPAA_COMPAT_STATIC

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


---
 .../drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 36 ++++++++++++++++++++++
 .../drivers/net/ethernet/freescale/dpaa/dpaa_eth.h | 16 ++++++++++
 rtemsbsd/include/rtems/bsd/local/opt_dpaa.h        | 10 ++++++
 3 files changed, 62 insertions(+)

diff --git a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index ad06f4129..00ffebdf7 100644
--- a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -540,7 +540,13 @@ static void dpaa_bpid2pool_map(int bpid, struct dpaa_bp *dpaa_bp)
 	atomic_set(&dpaa_bp->refs, 1);
 }
 
+#ifdef __rtems__
+#define	static SDK_DPAA_COMPAT_STATIC
+#endif /* __rtems__ */
 static int dpaa_bp_alloc_pool(struct dpaa_bp *dpaa_bp)
+#ifdef __rtems__
+#undef static
+#endif /* __rtems__ */
 {
 	int err;
 
@@ -704,10 +710,16 @@ static inline void dpaa_assign_wq(struct dpaa_fq *fq, int idx)
 	}
 }
 
+#ifdef __rtems__
+#define	static SDK_DPAA_COMPAT_STATIC
+#endif /* __rtems__ */
 static struct dpaa_fq *dpaa_fq_alloc(struct device *dev,
 				     u32 start, u32 count,
 				     struct list_head *list,
 				     enum dpaa_fq_type fq_type)
+#ifdef __rtems__
+#undef static
+#endif /* __rtems__ */
 {
 	struct dpaa_fq *dpaa_fq;
 	int i;
@@ -774,7 +786,13 @@ fq_alloc_failed:
 static u32 rx_pool_channel;
 static DEFINE_SPINLOCK(rx_pool_channel_init);
 
+#ifdef __rtems__
+#define	static SDK_DPAA_COMPAT_STATIC
+#endif /* __rtems__ */
 static int dpaa_get_channel(void)
+#ifdef __rtems__
+#undef static
+#endif /* __rtems__ */
 {
 	spin_lock(&rx_pool_channel_init);
 	if (!rx_pool_channel) {
@@ -799,7 +817,13 @@ static void dpaa_release_channel(void)
 }
 #endif /* __rtems__ */
 
+#ifdef __rtems__
+#define	static SDK_DPAA_COMPAT_STATIC
+#endif /* __rtems__ */
 static void dpaa_eth_add_channel(u16 channel)
+#ifdef __rtems__
+#undef static
+#endif /* __rtems__ */
 {
 	u32 pool = QM_SDQCR_CHANNELS_POOL_CONV(channel);
 #ifndef __rtems__
@@ -919,9 +943,15 @@ static inline void dpaa_setup_egress(const struct dpaa_priv *priv,
 	}
 }
 
+#ifdef __rtems__
+#define	static SDK_DPAA_COMPAT_STATIC
+#endif /* __rtems__ */
 static void dpaa_fq_setup(struct dpaa_priv *priv,
 			  const struct dpaa_fq_cbs *fq_cbs,
 			  struct fman_port *tx_port)
+#ifdef __rtems__
+#undef static
+#endif /* __rtems__ */
 {
 #ifndef __rtems__
 	int egress_cnt = 0, conf_cnt = 0, num_portals = 0, cpu;
@@ -1016,7 +1046,13 @@ static inline int dpaa_tx_fq_to_id(const struct dpaa_priv *priv,
 	return -EINVAL;
 }
 
+#ifdef __rtems__
+#define	static SDK_DPAA_COMPAT_STATIC
+#endif /* __rtems__ */
 static int dpaa_fq_init(struct dpaa_fq *dpaa_fq, bool td_enable)
+#ifdef __rtems__
+#undef static
+#endif /* __rtems__ */
 {
 	const struct dpaa_priv	*priv;
 	struct qman_fq *confq = NULL;
diff --git a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h
index d5f6974b0..08e5fd6f4 100644
--- a/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h
+++ b/linux/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h
@@ -214,5 +214,21 @@ void dpaa_eth_sysfs_init(struct device *dev);
 #define	FSL_DPAA_BPID_INV 0xff
 
 void dpaa_cleanup_tx_fd(struct ifnet *ifp, const struct qm_fd *fd);
+
+#ifdef QORIQ_IS_HYPERVISOR_GUEST
+int dpaa_bp_alloc_pool(struct dpaa_bp *dpaa_bp);
+
+struct dpaa_fq *dpaa_fq_alloc(struct device *dev, u32 start, u32 count,
+    struct list_head *list, enum dpaa_fq_type fq_type);
+
+int dpaa_get_channel(void);
+
+void dpaa_eth_add_channel(u16 channel);
+
+void dpaa_fq_setup(struct dpaa_priv *priv, const struct dpaa_fq_cbs *fq_cbs,
+    struct fman_port *tx_port);
+
+int dpaa_fq_init(struct dpaa_fq *dpaa_fq, bool td_enable);
+#endif /* QORIQ_IS_HYPERVISOR_GUEST */
 #endif /* __rtems__ */
 #endif	/* __DPAA_H */
diff --git a/rtemsbsd/include/rtems/bsd/local/opt_dpaa.h b/rtemsbsd/include/rtems/bsd/local/opt_dpaa.h
index 496a88f73..2e78dcf38 100644
--- a/rtemsbsd/include/rtems/bsd/local/opt_dpaa.h
+++ b/rtemsbsd/include/rtems/bsd/local/opt_dpaa.h
@@ -1,4 +1,5 @@
 #include <bsp.h>
+
 #ifdef LIBBSP_POWERPC_QORIQ_BSP_H
 #if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
 #include <bsp/qoriq.h>
@@ -6,9 +7,18 @@
 #else
 #define QORIQ_CHIP_IS_T_VARIANT(x) 0
 #endif
+
+#ifdef QORIQ_IS_HYPERVISOR_GUEST
+#define SDK_DPAA_COMPAT_STATIC
+#else
+#define SDK_DPAA_COMPAT_STATIC static
+#endif
+
 #undef __ppc_generic
 #define __ppc_generic
+
 #define KBUILD_MODNAME "dpaa"
+
 #define CONFIG_FSL_BMAN
 #define CONFIG_FSL_BMAN_PORTAL
 #define CONFIG_FSL_BMAN_TEST_API
-- 
2.12.3



More information about the devel mailing list