Commit 28a19fe6 authored by Mugunthan V N's avatar Mugunthan V N Committed by David S. Miller

drivers: net: davinci_cpdma: remove CRC bytes from skb added by CPDMA

Additional 4 bytes found in the skb is the CRC calculated by the
CPDMA hardware, check the CRC bit in CPDMA status field of
Descriptor and remove the CRC length from the skb. This extra
4 byte can be seen when capturing packets using tcpdump.
This has been tested in TI816x platform.
Signed-off-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d97a079a
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#define CPDMA_DESC_TO_PORT_EN BIT(20) #define CPDMA_DESC_TO_PORT_EN BIT(20)
#define CPDMA_TO_PORT_SHIFT 16 #define CPDMA_TO_PORT_SHIFT 16
#define CPDMA_DESC_PORT_MASK (BIT(18) | BIT(17) | BIT(16)) #define CPDMA_DESC_PORT_MASK (BIT(18) | BIT(17) | BIT(16))
#define CPDMA_DESC_CRC_LEN 4
#define CPDMA_TEARDOWN_VALUE 0xfffffffc #define CPDMA_TEARDOWN_VALUE 0xfffffffc
...@@ -798,6 +799,10 @@ static int __cpdma_chan_process(struct cpdma_chan *chan) ...@@ -798,6 +799,10 @@ static int __cpdma_chan_process(struct cpdma_chan *chan)
status = -EBUSY; status = -EBUSY;
goto unlock_ret; goto unlock_ret;
} }
if (status & CPDMA_DESC_PASS_CRC)
outlen -= CPDMA_DESC_CRC_LEN;
status = status & (CPDMA_DESC_EOQ | CPDMA_DESC_TD_COMPLETE | status = status & (CPDMA_DESC_EOQ | CPDMA_DESC_TD_COMPLETE |
CPDMA_DESC_PORT_MASK); CPDMA_DESC_PORT_MASK);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment