>From ed3e38befc5500e05f46e1d52ea20a0b8d3829f3 Mon Sep 17 00:00:00 2001 From: Giuseppe Cavallaro Date: Thu, 10 Mar 2016 14:57:48 +0100 Subject: [PATCH (linux-sti-4.1)] stmmac: fix tx prepare for normal desc 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 --- 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