forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/net/ethernet/stmicro/stmmac/chain_mode.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*******************************************************************************
23 Specialised functions for managing Chained mode
34
....@@ -7,17 +8,6 @@
78 descriptors in case of the DMA is configured to work in chained or
89 in ring mode.
910
10
- This program is free software; you can redistribute it and/or modify it
11
- under the terms and conditions of the GNU General Public License,
12
- version 2, as published by the Free Software Foundation.
13
-
14
- This program is distributed in the hope it will be useful, but WITHOUT
15
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17
- more details.
18
-
19
- The full GNU General Public License is included in this distribution in
20
- the file called "COPYING".
2111
2212 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
2313 *******************************************************************************/
....@@ -56,7 +46,7 @@
5646
5747 while (len != 0) {
5848 tx_q->tx_skbuff[entry] = NULL;
59
- entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE);
49
+ entry = STMMAC_GET_ENTRY(entry, priv->dma_tx_size);
6050 desc = tx_q->dma_tx + entry;
6151
6252 if (len > bmax) {
....@@ -147,7 +137,7 @@
147137 */
148138 p->des3 = cpu_to_le32((unsigned int)(rx_q->dma_rx_phy +
149139 (((rx_q->dirty_rx) + 1) %
150
- DMA_RX_SIZE) *
140
+ priv->dma_rx_size) *
151141 sizeof(struct dma_desc)));
152142 }
153143
....@@ -164,7 +154,8 @@
164154 * to keep explicit chaining in the descriptor.
165155 */
166156 p->des3 = cpu_to_le32((unsigned int)((tx_q->dma_tx_phy +
167
- ((tx_q->dirty_tx + 1) % DMA_TX_SIZE))
157
+ ((tx_q->dirty_tx + 1) %
158
+ priv->dma_tx_size))
168159 * sizeof(struct dma_desc)));
169160 }
170161