| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /******************************************************************************* |
|---|
| 2 | 3 | Specialised functions for managing Chained mode |
|---|
| 3 | 4 | |
|---|
| .. | .. |
|---|
| 7 | 8 | descriptors in case of the DMA is configured to work in chained or |
|---|
| 8 | 9 | in ring mode. |
|---|
| 9 | 10 | |
|---|
| 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". |
|---|
| 21 | 11 | |
|---|
| 22 | 12 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
|---|
| 23 | 13 | *******************************************************************************/ |
|---|
| .. | .. |
|---|
| 56 | 46 | |
|---|
| 57 | 47 | while (len != 0) { |
|---|
| 58 | 48 | 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); |
|---|
| 60 | 50 | desc = tx_q->dma_tx + entry; |
|---|
| 61 | 51 | |
|---|
| 62 | 52 | if (len > bmax) { |
|---|
| .. | .. |
|---|
| 147 | 137 | */ |
|---|
| 148 | 138 | p->des3 = cpu_to_le32((unsigned int)(rx_q->dma_rx_phy + |
|---|
| 149 | 139 | (((rx_q->dirty_rx) + 1) % |
|---|
| 150 | | - DMA_RX_SIZE) * |
|---|
| 140 | + priv->dma_rx_size) * |
|---|
| 151 | 141 | sizeof(struct dma_desc))); |
|---|
| 152 | 142 | } |
|---|
| 153 | 143 | |
|---|
| .. | .. |
|---|
| 164 | 154 | * to keep explicit chaining in the descriptor. |
|---|
| 165 | 155 | */ |
|---|
| 166 | 156 | 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)) |
|---|
| 168 | 159 | * sizeof(struct dma_desc))); |
|---|
| 169 | 160 | } |
|---|
| 170 | 161 | |
|---|