| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /******************************************************************************* |
|---|
| 2 | 3 | Specialised functions for managing Ring 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 | *******************************************************************************/ |
|---|
| .. | .. |
|---|
| 59 | 49 | |
|---|
| 60 | 50 | desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); |
|---|
| 61 | 51 | stmmac_prepare_tx_desc(priv, desc, 1, bmax, csum, |
|---|
| 62 | | - STMMAC_RING_MODE, 1, false, skb->len); |
|---|
| 52 | + STMMAC_RING_MODE, 0, false, skb->len); |
|---|
| 63 | 53 | tx_q->tx_skbuff[entry] = NULL; |
|---|
| 64 | | - entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE); |
|---|
| 54 | + entry = STMMAC_GET_ENTRY(entry, priv->dma_tx_size); |
|---|
| 65 | 55 | |
|---|
| 66 | 56 | if (priv->extend_desc) |
|---|
| 67 | 57 | desc = (struct dma_desc *)(tx_q->dma_etx + entry); |
|---|
| .. | .. |
|---|
| 79 | 69 | |
|---|
| 80 | 70 | desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); |
|---|
| 81 | 71 | stmmac_prepare_tx_desc(priv, desc, 0, len, csum, |
|---|
| 82 | | - STMMAC_RING_MODE, 1, true, skb->len); |
|---|
| 72 | + STMMAC_RING_MODE, 1, !skb_is_nonlinear(skb), |
|---|
| 73 | + skb->len); |
|---|
| 83 | 74 | } else { |
|---|
| 84 | 75 | des2 = dma_map_single(priv->device, skb->data, |
|---|
| 85 | 76 | nopaged_len, DMA_TO_DEVICE); |
|---|
| .. | .. |
|---|
| 91 | 82 | tx_q->tx_skbuff_dma[entry].is_jumbo = true; |
|---|
| 92 | 83 | desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); |
|---|
| 93 | 84 | stmmac_prepare_tx_desc(priv, desc, 1, nopaged_len, csum, |
|---|
| 94 | | - STMMAC_RING_MODE, 1, true, skb->len); |
|---|
| 85 | + STMMAC_RING_MODE, 0, !skb_is_nonlinear(skb), |
|---|
| 86 | + skb->len); |
|---|
| 95 | 87 | } |
|---|
| 96 | 88 | |
|---|
| 97 | 89 | tx_q->cur_tx = entry; |
|---|