linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincent Mailhol <vincent.mailhol@gmail.com>
To: Max Staudt <max@enpas.org>
Cc: Wolfgang Grandegger <wg@grandegger.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	linux-can@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Oliver Neukum <oneukum@suse.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7] can, tty: can327 CAN/ldisc driver for ELM327 based OBD-II adapters
Date: Sat, 4 Jun 2022 00:47:10 +0900	[thread overview]
Message-ID: <CAMZ6RqKM7Z3GzO6vKyWf7D1z=HvJBN2QaZz1==LBsEJKjz=Qag@mail.gmail.com> (raw)
In-Reply-To: <CAMZ6RqLLn3tE6kPd+yyHURsbBU_jVKN=u4=YvhZVyAf_NyRqCQ@mail.gmail.com>

On Sat. 4 June 2022 at 00:12, Vincent Mailhol <vincent.mailhol@gmail.com> wrote:
> Hi Max,
>
> I gave a final deep look into your driver. I found a few things which
> went through the cracks of my previous reviews. But overall, it start
> to look good. Well done and looking forward for the v8.
>
> On Fri. 3 June 2022 at 06:36, Max Staudt <max@enpas.org> wrote:
> > This is the can327 driver. It does a surprisingly good job at turning
> > ELM327 based OBD-II interfaces into cheap CAN interfaces for simple
> > homebrew projects.
> >
> > Please see the included documentation for details and limitations:
> > Documentation/networking/device_drivers/can/can327.rst
> >
> > Cc: linux-can <linux-can@vger.kernel.org>
> > Signed-off-by: Max Staudt <max@enpas.org>
> > ---
[...]
> > diff --git a/drivers/net/can/can327.c b/drivers/net/can/can327.c
> > new file mode 100644
> > index 000000000000..e29031ad825d
> > --- /dev/null
> > +++ b/drivers/net/can/can327.c
> > @@ -0,0 +1,1158 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/* ELM327 based CAN interface driver (tty line discipline)
> > + *
> > + * This driver started as a derivative of linux/drivers/net/can/slcan.c
> > + * and my thanks go to the original authors for their inspiration.
> > + *
> > + * can327.c Author : Max Staudt <max-linux@enpas.org>
> > + * slcan.c Author  : Oliver Hartkopp <socketcan@hartkopp.net>
> > + * slip.c Authors  : Laurence Culhane <loz@holmes.demon.co.uk>
> > + *                   Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>
> > + */
> > +
> > +#define pr_fmt(fmt) "can327: " fmt
> > +
> > +#include <linux/init.h>
> > +#include <linux/module.h>
> > +#include <linux/moduleparam.h>
>
> linux/moduleparam.h is not needed, right? Please make sure to clean up
> unused headers.
>
> > +
> > +#include <linux/atomic.h>
> > +#include <linux/bitops.h>
> > +#include <linux/ctype.h>
> > +#include <linux/delay.h>
> > +#include <linux/errno.h>
> > +#include <linux/if_ether.h>
> > +#include <linux/kernel.h>
> > +#include <linux/list.h>
> > +#include <linux/lockdep.h>
> > +#include <linux/netdevice.h>
> > +#include <linux/skbuff.h>
> > +#include <linux/spinlock.h>
> > +#include <linux/string.h>
> > +#include <linux/tty.h>
> > +#include <linux/tty_ldisc.h>
> > +#include <linux/workqueue.h>
> > +
> > +#include <uapi/linux/tty.h>
> > +
> > +#include <linux/can.h>
> > +#include <linux/can/dev.h>
> > +#include <linux/can/error.h>
> > +#include <linux/can/led.h>
>
> Rebase on net-next (or can-next) and remove CAN LED. c.f.:
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=6c1e423a3c84953edcf91ff03ab97829b287184a
>
> > +#include <linux/can/rx-offload.h>
> > +
> > +#define ELM327_NAPI_WEIGHT 4
> > +
> > +#define ELM327_SIZE_RXBUF 224
> > +#define ELM327_SIZE_TXBUF 32
> > +
> > +#define ELM327_CAN_CONFIG_SEND_SFF           0x8000
> > +#define ELM327_CAN_CONFIG_VARIABLE_DLC       0x4000
> > +#define ELM327_CAN_CONFIG_RECV_BOTH_SFF_EFF  0x2000
> > +#define ELM327_CAN_CONFIG_BAUDRATE_MULT_8_7  0x1000

This ELM327_CAN_CONFIG_BAUDRATE_MULT_8_7 macro is not used.

> > +#define ELM327_DUMMY_CHAR 'y'
> > +#define ELM327_DUMMY_STRING "y"
> > +#define ELM327_READY_CHAR '>'


Yours sincerely,
Vincent Mailhol

  reply	other threads:[~2022-06-03 15:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 21:35 [PATCH v7] can, tty: can327 CAN/ldisc driver for ELM327 based OBD-II adapters Max Staudt
2022-06-03 15:12 ` Vincent Mailhol
2022-06-03 15:47   ` Vincent Mailhol [this message]
2022-06-11 13:16     ` Max Staudt
2022-06-11 13:31       ` Marc Kleine-Budde
2022-06-11 13:15   ` Max Staudt
2022-06-11 13:36     ` Marc Kleine-Budde
2022-06-11 14:17       ` Max Staudt
2022-06-11 14:20         ` Marc Kleine-Budde
2022-06-11 14:42     ` Vincent Mailhol
2022-06-11 15:28       ` Marc Kleine-Budde
2022-06-11 16:41       ` Max Staudt
2022-06-12  1:33         ` Vincent Mailhol
2022-06-12 12:03           ` Max Staudt

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='CAMZ6RqKM7Z3GzO6vKyWf7D1z=HvJBN2QaZz1==LBsEJKjz=Qag@mail.gmail.com' \
    --to=vincent.mailhol@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=max@enpas.org \
    --cc=mkl@pengutronix.de \
    --cc=oneukum@suse.com \
    --cc=wg@grandegger.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).