Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp8908470ioo; Sat, 4 Jun 2022 23:23:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdEb9oykoYYLCETPKbxfn1hhIAa0VOv/JgJWTm/pz7zfckf4FI0nbDCg2H+ICGnImL2rGe X-Received: by 2002:a17:902:7b8f:b0:162:467:db7c with SMTP id w15-20020a1709027b8f00b001620467db7cmr17559918pll.140.1654410225752; Sat, 04 Jun 2022 23:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654410225; cv=none; d=google.com; s=arc-20160816; b=Vq0PoZjsR0BRqhfkCeLh/14O304Ji5x46GuqX9ZGIdKavBQfaiQfxp0ndPvQX57X5n x9qFUW8SrsTbL1vjRF7CV6TxDeDdQMMA6OGzjweOgDNY4gcrhjwFIHvQM8dLn7d1N0Bq fbWmeWKYLQHOWY8qO+AI4oklsgMVcGoYo+s3HQHoFDn7Wl0ABQwyic1GtTShrRg3UNlx VXQ+CC1QOg33tzTawtu5CkYnNX9VZKxVmepcQ6wyfGKl3to5e5tU86Btfm3PjZGT0Vam EDDmHH2iHU8sRyYUteACQv2SHle59AHHIclGIV1c9S8D8EnzAY+qqmefLs3T33an95dB +hBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/rpR+ysTG3r/oi1euOdZz8SzpGxkF/hmbsauLKYdP7M=; b=QX0rZA7iEYIYjRXS/CTrttx7dztUn24CR6yMwgb6J+5U1E3dJ9F2DKOy6trLaAarC6 5vBxz7R5yM2dW++SM+PNt52HC1BngeToMtnKfQFbGvjG93Oe0vc6GnnUzCMzcBzTI/sD MLXrmnSB9R95Zv6/JqO8nzsHimER53cuBU5se4D9ApMMKFtRe5PaaFG34zKSxEsKIyFb LahawEcSA53bN9VY5tJ5sHqHxflDRqwioFMMnRSmxYce/pMAXiSgbypYCnIQf774QDjz j/DI4J3s/gPHkB/30+fem1uRhdyTaAj0RFjj/PijwtplfdP5FXDJcjnQZXG04CDe9ztv hoMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=j8ZnU74u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z1-20020aa79901000000b005180f2b05b4si14415932pff.102.2022.06.04.23.23.23; Sat, 04 Jun 2022 23:23:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=j8ZnU74u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245643AbiFCPrY (ORCPT + 99 others); Fri, 3 Jun 2022 11:47:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245610AbiFCPrW (ORCPT ); Fri, 3 Jun 2022 11:47:22 -0400 Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDD07201A2; Fri, 3 Jun 2022 08:47:21 -0700 (PDT) Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-30ec2aa3b6cso86223427b3.11; Fri, 03 Jun 2022 08:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/rpR+ysTG3r/oi1euOdZz8SzpGxkF/hmbsauLKYdP7M=; b=j8ZnU74uAZ6D4PTcz0R6xcRPZMVDV8xfs5gVpnCQ6CesHfOkQDe66XxCuvKfSh4iEX N6mLXP92d2JjbWn9UdwWXdA50w0AI1WOCDG64KjH8GMVwGGLPoCPbXJgyxLz/XMJi/Uu HNBD3fiXZV1JvbRNjOaY1JwGSYVf6MhvvExqfxuwDWPV6qInk4kuOsAAAgRRkR9Toklm MNfg3sHEVHYby5WuSoDGfjMKh2/bWBoBr5LR3SqMOCmmdmXIenMCpiQ/TY4xDK7f4vfq i/vU1rDsXyLxIUx6fvfgKgb0thIDs3LP8uCwAv1WChdgH2h9PwmjYor0+0pxHND1JY6t vObg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/rpR+ysTG3r/oi1euOdZz8SzpGxkF/hmbsauLKYdP7M=; b=IqGK73z0NcnEYx1hG20tmAtH6FnNCPsh48dfT16Bv9RhfjfqUi6dIIGgQJ/KeblbCZ rTgF8L2zPAPnBb/1RlUzq5UHe4mlAJV4TMckhhZ6n0gZchE7irb0VrD20yZKhpdDK82z mN3RwvMyQijaA1cUr6ir/y5Pyn3Tzz7cFL26TuaDT+WFPsmVUBpIE5rxDnJ65Xwvm6pB 5naRzTGpvKAzOuf76yHEi2KPh9Puu4UyR/pAboILJJlMQ9U9rOutbc9uVnOve0vrAb0/ u/ygdEH6xRUwEfnyOMeGqSdlVJVvHofPLTGCE1eVocGTgitRXdz40iIReTQWG0nDDEug /Qvw== X-Gm-Message-State: AOAM53179q1k6LYbltLArOd5uxbK+q09qQYblg8iyN5WP2k9NImBD6lw OMZcYV8t5TQ3vuBJ2Tt3rJBYFI53rNLXNE1+p5uRl+8M8ga1rA== X-Received: by 2002:a81:60c6:0:b0:30f:ea59:10c7 with SMTP id u189-20020a8160c6000000b0030fea5910c7mr9504447ywb.78.1654271241188; Fri, 03 Jun 2022 08:47:21 -0700 (PDT) MIME-Version: 1.0 References: <20220602213544.68273-1-max@enpas.org> In-Reply-To: From: Vincent Mailhol Date: Sat, 4 Jun 2022 00:47:10 +0900 Message-ID: Subject: Re: [PATCH v7] can, tty: can327 CAN/ldisc driver for ELM327 based OBD-II adapters To: Max Staudt Cc: Wolfgang Grandegger , Marc Kleine-Budde , linux-can@vger.kernel.org, Greg Kroah-Hartman , Oliver Neukum , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat. 4 June 2022 at 00:12, Vincent Mailhol 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 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 > > Signed-off-by: Max Staudt > > --- [...] > > 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 > > + * slcan.c Author : Oliver Hartkopp > > + * slip.c Authors : Laurence Culhane > > + * Fred N. van Kempen > > + */ > > + > > +#define pr_fmt(fmt) "can327: " fmt > > + > > +#include > > +#include > > +#include > > linux/moduleparam.h is not needed, right? Please make sure to clean up > unused headers. > > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > 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 > > + > > +#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