diff options
author | Mugunthan V N <mugunthanvnm@ti.com> | 2013-05-29 20:22:01 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-31 17:25:43 -0700 |
commit | 28a19fe60f4f31cbd349f8473f0483aa7500acf5 (patch) | |
tree | 4cfe6f2662530b2b5e3df89a1383760aa0e78f5a /drivers/net/ethernet/ti/davinci_cpdma.c | |
parent | d97a079a79a7dcbc2470572b41cd1f07a16d8b7f (diff) | |
download | op-kernel-dev-28a19fe60f4f31cbd349f8473f0483aa7500acf5.zip op-kernel-dev-28a19fe60f4f31cbd349f8473f0483aa7500acf5.tar.gz |
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: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/davinci_cpdma.c')
-rw-r--r-- | drivers/net/ethernet/ti/davinci_cpdma.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c index 49dfd592..a377bc7 100644 --- a/drivers/net/ethernet/ti/davinci_cpdma.c +++ b/drivers/net/ethernet/ti/davinci_cpdma.c @@ -64,6 +64,7 @@ #define CPDMA_DESC_TO_PORT_EN BIT(20) #define CPDMA_TO_PORT_SHIFT 16 #define CPDMA_DESC_PORT_MASK (BIT(18) | BIT(17) | BIT(16)) +#define CPDMA_DESC_CRC_LEN 4 #define CPDMA_TEARDOWN_VALUE 0xfffffffc @@ -798,6 +799,10 @@ static int __cpdma_chan_process(struct cpdma_chan *chan) status = -EBUSY; goto unlock_ret; } + + if (status & CPDMA_DESC_PASS_CRC) + outlen -= CPDMA_DESC_CRC_LEN; + status = status & (CPDMA_DESC_EOQ | CPDMA_DESC_TD_COMPLETE | CPDMA_DESC_PORT_MASK); |