All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [PATCH] can: Unify MTU settings for CAN interfaces
Date: Fri, 07 Mar 2014 12:40:35 +0100	[thread overview]
Message-ID: <5319B033.10705@pengutronix.de> (raw)
In-Reply-To: <5319820D.6060104@hartkopp.net>

[-- Attachment #1: Type: text/plain, Size: 1528 bytes --]

On 03/07/2014 09:23 AM, Oliver Hartkopp wrote:
> CAN interfaces only support MTU values of 16 (CAN 2.0) and 72 (CAN FD).
> Setting the MTU to other values is pointless but it does not really hurt.
> With the introduction of the CAN FD support in drivers/net/can a new
> function to switch the MTU for CAN FD has been introduced.
> 
> This patch makes use of this can_change_mtu() function to check for correct
> MTU settings also in legacy CAN (2.0) devices.
> 
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>

> diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
> index 3fcdae2..f5b16e0 100644
> --- a/drivers/net/can/slcan.c
> +++ b/drivers/net/can/slcan.c
> @@ -411,10 +411,16 @@ static void slc_free_netdev(struct net_device *dev)
>  	slcan_devs[i] = NULL;
>  }
>  
> +static int slcan_change_mtu(struct net_device *dev, int new_mtu)
> +{
> +	return -EINVAL;
> +}
> +

Why is the slcan special?

>  static const struct net_device_ops slc_netdev_ops = {
>  	.ndo_open               = slc_open,
>  	.ndo_stop               = slc_close,
>  	.ndo_start_xmit         = slc_xmit,
> +	.ndo_change_mtu         = slcan_change_mtu,
>  };
>  
>  static void slc_setup(struct net_device *dev)

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]

  reply	other threads:[~2014-03-07 11:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07  8:23 [PATCH] can: Unify MTU settings for CAN interfaces Oliver Hartkopp
2014-03-07 11:40 ` Marc Kleine-Budde [this message]
2014-03-07 12:53   ` Oliver Hartkopp
2014-03-07 12:56     ` Marc Kleine-Budde
2014-03-07 12:58       ` Oliver Hartkopp
2014-03-07 13:04         ` Marc Kleine-Budde

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=5319B033.10705@pengutronix.de \
    --to=mkl@pengutronix.de \
    --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.