提交 612eef4f 编写于 作者: M Marc Kleine-Budde 提交者: David S. Miller

can: mcp251x: fix generation of error frames

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: NMarc Kleine-Budde <mkl@pengutronix.de>
Tested-by: NJargalan Nermunkh <jargalan.nermunkh@criticallink.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5601b2df
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册