From: Wolfgang Grandegger <wg@grandegger.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [RFC] CAN FD support part 1 - uncommented source
Date: Thu, 03 May 2012 13:34:00 +0200 [thread overview]
Message-ID: <4FA26D28.80307@grandegger.com> (raw)
In-Reply-To: <4FA2689D.5030905@hartkopp.net>
On 05/03/2012 01:14 PM, Oliver Hartkopp wrote:
>
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
>
> diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
> index f03d7a4..1b7e843 100644
> --- a/drivers/net/can/dev.c
> +++ b/drivers/net/can/dev.c
> @@ -454,7 +454,7 @@ EXPORT_SYMBOL_GPL(can_bus_off);
> static void can_setup(struct net_device *dev)
> {
> dev->type = ARPHRD_CAN;
> - dev->mtu = sizeof(struct can_frame);
> + dev->mtu = CAN_MTU;
> dev->hard_header_len = 0;
> dev->addr_len = 0;
> dev->tx_queue_len = 10;
> diff --git a/drivers/net/can/vcan.c b/drivers/net/can/vcan.c
> index ea2d942..bddbafb 100644
> --- a/drivers/net/can/vcan.c
> +++ b/drivers/net/can/vcan.c
> @@ -74,9 +74,8 @@ static void vcan_rx(struct sk_buff *skb, struct net_device *dev)
> struct net_device_stats *stats = &dev->stats;
>
> stats->rx_packets++;
> - stats->rx_bytes += cf->can_dlc;
> + stats->rx_bytes += can_dlc2len(cf->can_dlc);
Hm, I think "cf->can_dlc" should contain the *real* length. That would
simplify things a lot. The conversion is done when the corresponding DLC
registers are read or written.
Wolfgang.
next prev parent reply other threads:[~2012-05-03 11:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-03 11:14 [RFC] CAN FD support part 1 - uncommented source Oliver Hartkopp
2012-05-03 11:34 ` Wolfgang Grandegger [this message]
2012-05-03 11:43 ` Oliver Hartkopp
2012-05-03 12:10 ` Wolfgang Grandegger
2012-05-03 12:18 ` [RFC] CAN FD support Kurt Van Dijck
2012-05-03 12:38 ` Oliver Hartkopp
2012-05-03 12:43 ` Wolfgang Grandegger
2012-05-03 13:00 ` Kurt Van Dijck
2012-05-03 13:13 ` Oliver Hartkopp
2012-05-03 13:44 ` Marc Kleine-Budde
2012-05-03 14:41 ` Oliver Hartkopp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FA26D28.80307@grandegger.com \
--to=wg@grandegger.com \
--cc=linux-can@vger.kernel.org \
--cc=socketcan@hartkopp.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.