summaryrefslogtreecommitdiff
path: root/target/linux/generic/patches-3.10/775-bgmac-check-length-of-received-frame.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2013-12-26 23:22:31 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2013-12-26 23:22:31 +0000
commitbc3d934148144bd0bb67e5a8c569bc707e57bf9e (patch)
tree718fbf77b139c18a495b7260a4dde7f00bc8b53c /target/linux/generic/patches-3.10/775-bgmac-check-length-of-received-frame.patch
parentac8d56250364a5f297c7c4ac2d175d3fe7d0aec2 (diff)
downloadmtk-20170518-bc3d934148144bd0bb67e5a8c569bc707e57bf9e.zip
mtk-20170518-bc3d934148144bd0bb67e5a8c569bc707e57bf9e.tar.gz
mtk-20170518-bc3d934148144bd0bb67e5a8c569bc707e57bf9e.tar.bz2
kernel: bgmac: update patches
This updates the bgmac backport patch to the current upstream version and adds some more patches mostly for BCM4707. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 39165
Diffstat (limited to 'target/linux/generic/patches-3.10/775-bgmac-check-length-of-received-frame.patch')
-rw-r--r--target/linux/generic/patches-3.10/775-bgmac-check-length-of-received-frame.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/target/linux/generic/patches-3.10/775-bgmac-check-length-of-received-frame.patch b/target/linux/generic/patches-3.10/775-bgmac-check-length-of-received-frame.patch
new file mode 100644
index 0000000..3b818be
--- /dev/null
+++ b/target/linux/generic/patches-3.10/775-bgmac-check-length-of-received-frame.patch
@@ -0,0 +1,41 @@
+From 2d12a9abf3f81de5b51852e3cfcba8cedac82642 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Fri, 6 Dec 2013 01:14:52 +0100
+Subject: [PATCH] bgmac: check length of received frame
+
+---
+ drivers/net/ethernet/broadcom/bgmac.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/broadcom/bgmac.c
++++ b/drivers/net/ethernet/broadcom/bgmac.c
+@@ -347,6 +347,7 @@ static int bgmac_dma_rx_read(struct bgma
+ struct sk_buff *skb = slot->skb;
+ struct bgmac_rx_header *rx;
+ u16 len, flags;
++ int count;
+
+ /* Unmap buffer to make it accessible to the CPU */
+ dma_sync_single_for_cpu(dma_dev, slot->dma_addr,
+@@ -355,6 +356,12 @@ static int bgmac_dma_rx_read(struct bgma
+ /* Get info from the header */
+ rx = (struct bgmac_rx_header *)skb->data;
+ len = le16_to_cpu(rx->len);
++ for (count = 0; count < 200; count++) {
++ len = le16_to_cpu(rx->len);
++ if (len)
++ break;
++ udelay(1);
++ }
+ flags = le16_to_cpu(rx->flags);
+
+ do {
+@@ -362,7 +369,7 @@ static int bgmac_dma_rx_read(struct bgma
+ int err;
+
+ /* Check for poison and drop or pass the packet */
+- if (len == 0xdead && flags == 0xbeef) {
++ if (!len || (len == 0xdead && flags == 0xbeef)) {
+ bgmac_err(bgmac, "Found poisoned packet at slot %d, DMA issue!\n",
+ ring->start);
+ dma_sync_single_for_device(dma_dev,