diff mbox

[1/6] netdev: bfin_mac: handler RX status errors

Message ID 1263899307-10627-1-git-send-email-vapier@gentoo.org
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Mike Frysinger Jan. 19, 2010, 11:08 a.m. UTC
From: Peter Meerwald <pmeerw@pmeerw.net>

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/net/bfin_mac.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

Comments

David Miller Jan. 21, 2010, 9:14 a.m. UTC | #1
This patch set doesn't apply cleanly to net-next-2.6, please
respin.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mike Frysinger Jan. 21, 2010, 9:31 a.m. UTC | #2
On Thu, Jan 21, 2010 at 04:14, David Miller wrote:
> This patch set doesn't apply cleanly to net-next-2.6, please
> respin.

i thought you said you merged the patch i sent out earlier ?
bfin_mac: use the newer CLKBUFOE bit name via asm/dpmc.h
-mike
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Jan. 21, 2010, 9:33 a.m. UTC | #3
From: Mike Frysinger <vapier.adi@gmail.com>
Date: Thu, 21 Jan 2010 04:31:17 -0500

> On Thu, Jan 21, 2010 at 04:14, David Miller wrote:
>> This patch set doesn't apply cleanly to net-next-2.6, please
>> respin.
> 
> i thought you said you merged the patch i sent out earlier ?
> bfin_mac: use the newer CLKBUFOE bit name via asm/dpmc.h

I did, to net-2.6 since it fixed a build.

If you are sending me patches that depend upon net-2.6 changes,
you have to mention that in your patch submission.

Otherwise how do I know that I need to merge net-2.6 into
net-next-2.6 in order to apply your patches?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mike Frysinger Jan. 21, 2010, 9:42 a.m. UTC | #4
On Thu, Jan 21, 2010 at 04:33, David Miller wrote:
> From: Mike Frysinger <vapier.adi@gmail.com>
>> On Thu, Jan 21, 2010 at 04:14, David Miller wrote:
>>> This patch set doesn't apply cleanly to net-next-2.6, please
>>> respin.
>>
>> i thought you said you merged the patch i sent out earlier ?
>> bfin_mac: use the newer CLKBUFOE bit name via asm/dpmc.h
>
> I did, to net-2.6 since it fixed a build.
>
> If you are sending me patches that depend upon net-2.6 changes,
> you have to mention that in your patch submission.

np

> Otherwise how do I know that I need to merge net-2.6 into
> net-next-2.6 in order to apply your patches?

it seems odd to me to have a "next" tree that doesnt include all of
the "now" changes, so i just assumed the tree state

not saying you should change your development flow, just pointing out
where the misunderstanding came from
-mike
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 0b23bc4..e0fe9d0 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -660,11 +660,24 @@  out:
 	return NETDEV_TX_OK;
 }
 
+#define RX_ERROR_MASK (RX_LONG | RX_ALIGN | RX_CRC | RX_LEN | \
+	RX_FRAG | RX_ADDR | RX_DMAO | RX_PHY | RX_LATE | RX_RANGE)
+
 static void bfin_mac_rx(struct net_device *dev)
 {
 	struct sk_buff *skb, *new_skb;
 	unsigned short len;
 
+	/* check if frame status word reports an error condition
+	 * we which case we simply drop the packet
+	 */
+	if (current_rx_ptr->status.status_word & RX_ERROR_MASK) {
+		printk(KERN_NOTICE DRV_NAME
+		       ": rx: receive error - packet dropped\n");
+		dev->stats.rx_dropped++;
+		goto out;
+	}
+
 	/* allocate a new skb for next time receive */
 	skb = current_rx_ptr->skb;
 	new_skb = dev_alloc_skb(PKT_BUF_SZ + NET_IP_ALIGN);
@@ -699,11 +712,9 @@  static void bfin_mac_rx(struct net_device *dev)
 	netif_rx(skb);
 	dev->stats.rx_packets++;
 	dev->stats.rx_bytes += len;
+out:
 	current_rx_ptr->status.status_word = 0x00000000;
 	current_rx_ptr = current_rx_ptr->next;
-
-out:
-	return;
 }
 
 /* interrupt routine to handle rx and error signal */