[PATCH (linux-sti-4.1)] stmmac: fix tx prepare for normal desc

From: Giuseppe Cavallaro
Date: Thu Mar 10 2016 - 08:57:48 EST


This patch fixes a bug inside when use the normal descriptors.
While preparing the tx descriptor the frame size was not
properly set.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@xxxxxx>
---
drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
index e13228f..432b3f1 100644
--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
@@ -197,13 +197,15 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
bool csum_flag, int mode, bool tx_own,
bool ls)
{
- unsigned int tdes1 = p->des1;
+ unsigned int tdes1;

if (mode == STMMAC_CHAIN_MODE)
norm_set_tx_desc_len_on_chain(p, len);
else
norm_set_tx_desc_len_on_ring(p, len);

+ tdes1 = p->des1;
+
if (is_fs)
tdes1 |= TDES1_FIRST_SEGMENT;
else
--
1.7.4.4


--------------080008040906020605010002--