diff options
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/norm_desc.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c index 25953bb45a73..68962c549a2d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c +++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c | |||
@@ -22,6 +22,7 @@ | |||
22 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | 22 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
23 | *******************************************************************************/ | 23 | *******************************************************************************/ |
24 | 24 | ||
25 | #include <linux/stmmac.h> | ||
25 | #include "common.h" | 26 | #include "common.h" |
26 | #include "descs_com.h" | 27 | #include "descs_com.h" |
27 | 28 | ||
@@ -201,9 +202,17 @@ static void ndesc_close_tx_desc(struct dma_desc *p) | |||
201 | p->des01.tx.interrupt = 1; | 202 | p->des01.tx.interrupt = 1; |
202 | } | 203 | } |
203 | 204 | ||
204 | static int ndesc_get_rx_frame_len(struct dma_desc *p) | 205 | static int ndesc_get_rx_frame_len(struct dma_desc *p, int rx_coe_type) |
205 | { | 206 | { |
206 | return p->des01.rx.frame_length; | 207 | /* The type-1 checksum offload engines append the checksum at |
208 | * the end of frame and the two bytes of checksum are added in | ||
209 | * the length. | ||
210 | * Adjust for that in the framelen for type-1 checksum offload | ||
211 | * engines. */ | ||
212 | if (rx_coe_type == STMMAC_RX_COE_TYPE1) | ||
213 | return p->des01.rx.frame_length - 2; | ||
214 | else | ||
215 | return p->des01.rx.frame_length; | ||
207 | } | 216 | } |
208 | 217 | ||
209 | const struct stmmac_desc_ops ndesc_ops = { | 218 | const struct stmmac_desc_ops ndesc_ops = { |