diff mbox

[2/2] can: mcp251x: fix generation of error frames

Message ID 1287568946-32727-3-git-send-email-mkl@pengutronix.de
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Marc Kleine-Budde Oct. 20, 2010, 10:02 a.m. UTC
The function "mcp251x_error_skb" is used to generate error frames.
They are identified by the "CAN_ERR_FLAG" in can_id. The function
overwrites the can_id so that the frames show up as normal frames instead
of error frames.

This patch fixes the problem by or'ing the can_id instead of overwriting it.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Tested-by: Jargalan Nermunkh <jargalan.nermunkh@criticallink.com>
---
 drivers/net/can/mcp251x.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

David Miller Oct. 21, 2010, 11:33 a.m. UTC | #1
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Wed, 20 Oct 2010 12:02:26 +0200

> The function "mcp251x_error_skb" is used to generate error frames.
> They are identified by the "CAN_ERR_FLAG" in can_id. The function
> overwrites the can_id so that the frames show up as normal frames instead
> of error frames.
> 
> This patch fixes the problem by or'ing the can_id instead of overwriting it.
> 
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> Tested-by: Jargalan Nermunkh <jargalan.nermunkh@criticallink.com>

Applied.
--
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/can/mcp251x.c b/drivers/net/can/mcp251x.c
index 59f40bc..6aadc3e 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -705,7 +705,7 @@  static void mcp251x_error_skb(struct net_device *net, int can_id, int data1)
 
 	skb = alloc_can_err_skb(net, &frame);
 	if (skb) {
-		frame->can_id = can_id;
+		frame->can_id |= can_id;
 		frame->data[1] = data1;
 		netif_rx_ni(skb);
 	} else {