|
@@ -1093,6 +1093,7 @@ static int init_dma_desc_rings(struct net_device *dev, gfp_t flags)
|
|
p->des2 = 0;
|
|
p->des2 = 0;
|
|
priv->tx_skbuff_dma[i].buf = 0;
|
|
priv->tx_skbuff_dma[i].buf = 0;
|
|
priv->tx_skbuff_dma[i].map_as_page = false;
|
|
priv->tx_skbuff_dma[i].map_as_page = false;
|
|
|
|
+ priv->tx_skbuff_dma[i].len = 0;
|
|
priv->tx_skbuff[i] = NULL;
|
|
priv->tx_skbuff[i] = NULL;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1136,12 +1137,12 @@ static void dma_free_tx_skbufs(struct stmmac_priv *priv)
|
|
if (priv->tx_skbuff_dma[i].map_as_page)
|
|
if (priv->tx_skbuff_dma[i].map_as_page)
|
|
dma_unmap_page(priv->device,
|
|
dma_unmap_page(priv->device,
|
|
priv->tx_skbuff_dma[i].buf,
|
|
priv->tx_skbuff_dma[i].buf,
|
|
- priv->hw->desc->get_tx_len(p),
|
|
|
|
|
|
+ priv->tx_skbuff_dma[i].len,
|
|
DMA_TO_DEVICE);
|
|
DMA_TO_DEVICE);
|
|
else
|
|
else
|
|
dma_unmap_single(priv->device,
|
|
dma_unmap_single(priv->device,
|
|
priv->tx_skbuff_dma[i].buf,
|
|
priv->tx_skbuff_dma[i].buf,
|
|
- priv->hw->desc->get_tx_len(p),
|
|
|
|
|
|
+ priv->tx_skbuff_dma[i].len,
|
|
DMA_TO_DEVICE);
|
|
DMA_TO_DEVICE);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1347,12 +1348,12 @@ static void stmmac_tx_clean(struct stmmac_priv *priv)
|
|
if (priv->tx_skbuff_dma[entry].map_as_page)
|
|
if (priv->tx_skbuff_dma[entry].map_as_page)
|
|
dma_unmap_page(priv->device,
|
|
dma_unmap_page(priv->device,
|
|
priv->tx_skbuff_dma[entry].buf,
|
|
priv->tx_skbuff_dma[entry].buf,
|
|
- priv->hw->desc->get_tx_len(p),
|
|
|
|
|
|
+ priv->tx_skbuff_dma[entry].len,
|
|
DMA_TO_DEVICE);
|
|
DMA_TO_DEVICE);
|
|
else
|
|
else
|
|
dma_unmap_single(priv->device,
|
|
dma_unmap_single(priv->device,
|
|
priv->tx_skbuff_dma[entry].buf,
|
|
priv->tx_skbuff_dma[entry].buf,
|
|
- priv->hw->desc->get_tx_len(p),
|
|
|
|
|
|
+ priv->tx_skbuff_dma[entry].len,
|
|
DMA_TO_DEVICE);
|
|
DMA_TO_DEVICE);
|
|
priv->tx_skbuff_dma[entry].buf = 0;
|
|
priv->tx_skbuff_dma[entry].buf = 0;
|
|
priv->tx_skbuff_dma[entry].map_as_page = false;
|
|
priv->tx_skbuff_dma[entry].map_as_page = false;
|
|
@@ -1986,6 +1987,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
|
|
if (dma_mapping_error(priv->device, desc->des2))
|
|
if (dma_mapping_error(priv->device, desc->des2))
|
|
goto dma_map_err;
|
|
goto dma_map_err;
|
|
priv->tx_skbuff_dma[entry].buf = desc->des2;
|
|
priv->tx_skbuff_dma[entry].buf = desc->des2;
|
|
|
|
+ priv->tx_skbuff_dma[entry].len = nopaged_len;
|
|
priv->hw->desc->prepare_tx_desc(desc, 1, nopaged_len,
|
|
priv->hw->desc->prepare_tx_desc(desc, 1, nopaged_len,
|
|
csum_insertion, priv->mode);
|
|
csum_insertion, priv->mode);
|
|
} else {
|
|
} else {
|
|
@@ -2014,6 +2016,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
|
|
|
|
|
|
priv->tx_skbuff_dma[entry].buf = desc->des2;
|
|
priv->tx_skbuff_dma[entry].buf = desc->des2;
|
|
priv->tx_skbuff_dma[entry].map_as_page = true;
|
|
priv->tx_skbuff_dma[entry].map_as_page = true;
|
|
|
|
+ priv->tx_skbuff_dma[entry].len = len;
|
|
priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion,
|
|
priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion,
|
|
priv->mode);
|
|
priv->mode);
|
|
wmb();
|
|
wmb();
|