Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2145166iof; Tue, 7 Jun 2022 21:15:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCWqoZaRLbP+boFqw6jfCHKxm1D1PkOrSQsNo22h9j+Spee2E1rN535fLKFWIavmDFHhvp X-Received: by 2002:a05:6a00:14cb:b0:51c:3f31:b60e with SMTP id w11-20020a056a0014cb00b0051c3f31b60emr6084469pfu.27.1654661719316; Tue, 07 Jun 2022 21:15:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654661719; cv=none; d=google.com; s=arc-20160816; b=S0g/1zgOuij5BB+mp2bj6g5k4ZkNAAy1F7g1gz5MLLeAMyp5eXXTZG8uxbZv2ERoij 4QvPZQtdmRk2IYPjW1DpiqpfZWiPgFYPbqX7ZeUfIOsKoxv4dSx8+t+cHEY5xdKdsgDq ji+VMYNgRvoMFPORsnUDU2afSjWFAh/Rf9fcGmftAoSqJPVg8nDkBzi6CQdhw+ZLYqaD T01s4DUXErqj3SP/ka60e8JnVePeUAuTCoCx2x8C/iG/bVpd87ix5r3XDW5y8I19bIuz LuEwZ+s+6UI+BvVbBNLkWI0eJ64y25IwkbBRRIKIWo2ITgE95tvq6KcbU3wZFnZ90YCn ZpyQ== 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; bh=rJl5uDTfeXSgFEAYnHs/jRj0vy7VJnNLGNEZQoMWkYY=; b=A7+NAsA/BlNhO2DJKQ5Wm4nxzCJC/uoB4R5RBLaMvKpnIwLs+mz1LpiR6CH8uOqxSI ThUxE9ZY3D3b1Dr2t8FrKuh0Om73bCvScxL5CrRzhJ3xJPXWxPgSyVPkVQWniEFV6zn9 3nBXYJkKxcBaqppznzYUjtD8cgGjoxfrCts1eb9ET7LqSsidMGZHoL8e+vUMbQdqfR0/ soP7XyJqXzOeBUPTcRUyhWuxkTnIa7p9tyNNc9SaMIZja5EPJHZ69RFTZ5Q3rOHohZC8 lAtV5mr90RYE03OBqRrXzsEZ1YgmcIf7IuylaZC1X8qSe4jfji+bG7mTtkWXIHpcyNB7 TI1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 19-20020a621413000000b0050cff7b2666si24566900pfu.241.2022.06.07.21.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:15:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CECBB2BF843; Tue, 7 Jun 2022 20:47:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243608AbiFGMUq (ORCPT + 99 others); Tue, 7 Jun 2022 08:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243837AbiFGMUJ (ORCPT ); Tue, 7 Jun 2022 08:20:09 -0400 Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD964C5E6A; Tue, 7 Jun 2022 05:20:05 -0700 (PDT) Received: by mail-yb1-f178.google.com with SMTP id s39so3264111ybi.0; Tue, 07 Jun 2022 05:20:05 -0700 (PDT) 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=rJl5uDTfeXSgFEAYnHs/jRj0vy7VJnNLGNEZQoMWkYY=; b=jNwQEXn4QAM4N2paOiazAh9aXrlU1TB3oJZ/9XV6/lFgZiXdUs5DTRfClZFR0w6kMh JFlduPIhDO3OCXgH0m8qovqvuImgRhW1HnTM/VEMklMJbH0yJ4Kj4jbGI54/ncLLaHPB Sz7PPYjp5iZEh5w1uya3R2jiPiJObunrK9+JQXgwdfm4EOB37PujZ96r/WUH0M5sp3ri br4bjwH7CD8q7wlUP6a+2RNiicW0jbc5DgI5u7x5Lne/yFUdoZ2Jg8v56yeNhJbaiwb/ qPEXpxo1xIXWlP2CC1SOd7CDD3Mmnyftn2jrE7+GqRzMa36ShJUp34qrvs5ZgcOkYVyo RwWA== X-Gm-Message-State: AOAM531oEV3vK1W0P6uqKNSlZJ74F0rRqQF45Nr0TXLkM7gnvXeNAZNC LDZCoQ/EA0C9c4kxoL7DZAbcIfZEn0S3s6ID2kA= X-Received: by 2002:a25:9841:0:b0:663:eaf2:4866 with SMTP id k1-20020a259841000000b00663eaf24866mr1119907ybo.381.1654604404961; Tue, 07 Jun 2022 05:20:04 -0700 (PDT) MIME-Version: 1.0 References: <20220607094752.1029295-1-dario.binacchi@amarulasolutions.com> In-Reply-To: <20220607094752.1029295-1-dario.binacchi@amarulasolutions.com> From: Vincent MAILHOL Date: Tue, 7 Jun 2022 21:19:54 +0900 Message-ID: Subject: Re: [RFC PATCH 00/13] can: slcan: extend supported features To: Dario Binacchi Cc: linux-kernel@vger.kernel.org, Amarula patchwork , michael@amarulasolutions.com, "David S. Miller" , Eric Dumazet , Greg Kroah-Hartman , Jakub Kicinski , Jiri Slaby , Marc Kleine-Budde , Paolo Abeni , Sebastian Andrzej Siewior , Wolfgang Grandegger , linux-can@vger.kernel.org, netdev@vger.kernel.org, Max Staudt Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 +CC: Max Staudt On Tue. 7 Jun. 2022 at 18:47, Dario Binacchi wrote: > This series originated as a result of CAN communication tests for an > application using the USBtin adapter (https://www.fischl.de/usbtin/). > The tests showed some errors but for the driver everything was ok. > Also, being the first time I used the slcan driver, I was amazed that > it was not possible to configure the bitrate via the ip tool. > For these two reasons, I started looking at the driver code and realized > that it didn't use the CAN network device driver interface. > > Starting from these assumptions, I tried to: > - Use the CAN network device driver interface. > - Set the bitrate via the ip tool. > - Send the open/close command to the adapter from the driver. > - Add ethtool support to reset the adapter errors. > - Extend the protocol to forward the adapter CAN communication > errors and the CAN state changes to the netdev upper layers. > > Except for the protocol extension patches (i. e. forward the adapter CAN > communication errors and the CAN state changes to the netdev upper > layers), the whole series has been tested. Testing the extension > protocol patches requires updating the adapter firmware. Before modifying > the firmware I think it makes sense to know if these extensions can be > considered useful. > > Before applying the series I used these commands: > > slcan_attach -f -s6 -o /dev/ttyACM0 > slcand ttyACM0 can0 > ip link set can0 up > > After applying the series I am using these commands: > > slcan_attach /dev/ttyACM0 > slcand ttyACM0 can0 > ip link set dev can0 down > ip link set can0 type can bitrate 500000 > ethtool --set-priv-flags can0 err-rst-on-open on > ip link set dev can0 up In his CAN327 driver, Max manages to bring the can0 device without the need of dedicated user space daemon by using line discipline (ldattach): https://lore.kernel.org/linux-can/20220602213544.68273-1-max@enpas.org/ Isn't the same feasible with slcan so that we completely remove the dependency toward slcand? Max what do you think of this? > Now there is a clearer separation between serial line and CAN, > but above all, it is possible to use the ip and ethtool commands > as it happens for any CAN device driver. The changes are backward > compatible, you can continue to use the slcand and slcan_attach > command options. Yours sincerely, Vincent Mailhol