From patchwork Sun Nov 27 19:02:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Fritz X-Patchwork-Id: 13056838 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2369C46467 for ; Sun, 27 Nov 2022 19:18:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbiK0TSy (ORCPT ); Sun, 27 Nov 2022 14:18:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbiK0TSs (ORCPT ); Sun, 27 Nov 2022 14:18:48 -0500 Received: from fritzc.com (mail.fritzc.com [IPv6:2a00:17d8:100::e31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E53F3A4; Sun, 27 Nov 2022 11:18:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fritzc.com; s=dkim; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=C+mZx1Eg6bo4mfX+DFliuwOi9n3vRN8QYXoOJN3XKzg=; b=jWzEMUkiw2c8kHimMLq5YPfDMl 8zx4jM3k6D+Xz0eHpryqHe8swrxyjuF7KWjH7U2bmjfjsIsHm47K8DRbjiHmZrb9Kok/yNnrJlDxJ H6NhXquUI/+PJ+mOlS82Qp+x7QxxDMs9Aru7mrg+GyOSz1Qn/esHMtGdAF32cSRo5O9o=; Received: from 127.0.0.1 by fritzc.com with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim latest) (envelope-from ) id 1ozMvf-000XD6-0c; Sun, 27 Nov 2022 20:03:03 +0100 From: Christoph Fritz To: Oliver Hartkopp , Pavel Pisa , Richard Weinberger , Andreas Lauser , Wolfgang Grandegger , Marc Kleine-Budde , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC][PATCH 0/2] LIN support for Linux Date: Sun, 27 Nov 2022 20:02:42 +0100 Message-Id: <20221127190244.888414-1-christoph.fritz@hexdev.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam_score: -1.0 X-Spam_bar: - Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-State: RFC The intention of this series is to kick off a discussion about how to support LIN (ISO 17987) [0] in Linux. This series consist of two patches which are two individual proposals for adding LIN abstraction into the kernel. One approach is to add LIN ontop of CANFD: [RFC] can: introduce LIN abstraction The other approach is adding a new type of CAN-socket: [RFC] can: Add LIN proto skeleton These patches are abstracting LIN so that actual device drivers can make use of it. For reference, the LIN-ontop-of-CANFD variant already has a device driver using it (not part of this series). It is a specially built USB LIN-BUS adapter hardware called hexLIN [1]. Its purpose is mainly to test, adapt and discuss different LIN APIs for mainline Linux kernel. But it can already be used productively as a Linux LIN node in controller (master) and responder (slave) mode. By sysfs, hexLIN supports different checksum calculations and setting up a responder-table. For more info about hexLIN, see link below [1]. We are looking for partners with Linux based LIN projects for funding. [0]: https://en.wikipedia.org/wiki/Local_Interconnect_Network [1]: https://hexdev.de/hexlin/ Christoph Fritz (1): [RFC] can: Introduce LIN bus as CANFD abstraction Richard Weinberger (1): [RFC] can: Add LIN proto skeleton drivers/net/can/Kconfig | 10 ++ drivers/net/can/Makefile | 1 + drivers/net/can/lin.c | 181 +++++++++++++++++++++++++++ include/net/lin.h | 30 +++++ include/uapi/linux/can.h | 8 +- include/uapi/linux/can/lin.h | 15 +++ include/uapi/linux/can/netlink.h | 1 + net/can/Kconfig | 5 + net/can/Makefile | 3 + net/can/lin.c | 207 +++++++++++++++++++++++++++++++ 10 files changed, 460 insertions(+), 1 deletion(-) create mode 100644 drivers/net/can/lin.c create mode 100644 include/net/lin.h create mode 100644 include/uapi/linux/can/lin.h create mode 100644 net/can/lin.c