forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h
....@@ -32,6 +32,7 @@
3232 #define __DPAA_H
3333
3434 #include <linux/netdevice.h>
35
+#include <linux/refcount.h>
3536 #include <soc/fsl/qman.h>
3637 #include <soc/fsl/bman.h>
3738
....@@ -45,8 +46,6 @@
4546 #define DPAA_TC_TXQ_NUM NR_CPUS
4647 /* Total number of Tx queues */
4748 #define DPAA_ETH_TXQ_NUM (DPAA_TC_NUM * DPAA_TC_TXQ_NUM)
48
-
49
-#define DPAA_BPS_NUM 3 /* number of bpools per interface */
5049
5150 /* More detailed FQ types - used for fine-grained WQ assignments */
5251 enum dpaa_fq_type {
....@@ -79,9 +78,11 @@
7978 struct qman_fq egress_ern;
8079 };
8180
81
+struct dpaa_priv;
82
+
8283 struct dpaa_bp {
83
- /* device used in the DMA mapping operations */
84
- struct device *dev;
84
+ /* used in the DMA mapping operations */
85
+ struct dpaa_priv *priv;
8586 /* current number of buffers in the buffer pool alloted to each CPU */
8687 int __percpu *percpu_count;
8788 /* all buffers allocated for this pool have this raw size */
....@@ -99,7 +100,7 @@
99100 int (*seed_cb)(struct dpaa_bp *);
100101 /* bpool can be emptied before freeing by this cb */
101102 void (*free_buf_cb)(const struct dpaa_bp *, struct bm_buffer *);
102
- atomic_t refs;
103
+ refcount_t refs;
103104 };
104105
105106 struct dpaa_rx_errors {
....@@ -145,13 +146,15 @@
145146
146147 struct dpaa_priv {
147148 struct dpaa_percpu_priv __percpu *percpu_priv;
148
- struct dpaa_bp *dpaa_bps[DPAA_BPS_NUM];
149
+ struct dpaa_bp *dpaa_bp;
149150 /* Store here the needed Tx headroom for convenience and speed
150151 * (even though it can be computed based on the fields of buf_layout)
151152 */
152153 u16 tx_headroom;
153154 struct net_device *net_dev;
154155 struct mac_device *mac_dev;
156
+ struct device *rx_dma_dev;
157
+ struct device *tx_dma_dev;
155158 struct qman_fq *egress_fqs[DPAA_ETH_TXQ_NUM];
156159 struct qman_fq *conf_fqs[DPAA_ETH_TXQ_NUM];
157160