From patchwork Sun Jun 11 02:57:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Mailhol X-Patchwork-Id: 106044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1861508vqr; Sat, 10 Jun 2023 21:42:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ79pzO2eM1xGgTol38kLRlZ6qUNq8qL60XQEag0N+adK4ejfFdO1TmiFeHDatXLdiWcT7zT X-Received: by 2002:a17:90a:8809:b0:253:4f8f:52fb with SMTP id s9-20020a17090a880900b002534f8f52fbmr11942541pjn.10.1686458553918; Sat, 10 Jun 2023 21:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686458553; cv=none; d=google.com; s=arc-20160816; b=Ngw2Rk3kJWIKH90cvlzBQduceJQ2MrycCwgTU53d0JUb1Yrz0aaiTkxxyINQsYjwCG T7vwnGjQAOkaFK9cfxVTVd2YzvqpYquizQgsYhTp7mE1XDglsh06pSt7Km8Fc/iuM70h pCgqUpB9dKhBtEITqYUpBj9yEwcwsCeb7iWiPTrlHvUSuHq23VgTYxYBoDt9zdmffuXX rSEF6FGAQAircE1cuHY/9q7vQM7BqPfidp9BSOmVo5etUsQpI+D8aYKASV2IsgelOwbw s0GZwjqKLQofmdr2b1hk5RBQZ9sOYsCvyxDqayVb4NcerKKjIdS3ZHp1jE1b28VXVPbV nuMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=hOnAmvU8+4Mt3WlYCWLk9hDRAGAvBO+7sKgKdTa30LY=; b=KkgGAyKwZmBWXzKEiwUnmsjkVWBD1w7GP/tX95DLQKL1exraxebDE8/5j/nawI8d9O Y7zj2MTdn1N2wM9HaJOcsJCCy5DSfvC3nKlY94YV/yMV0uxLka7XOAkmAqHcfA2yTqMC egkVygBbXrOJxnA6Oj2U8hawjA5pPJ73YKJ4EetHQxAJybsWgO0EZ1zN+luvA+nOvDGq gJjmtpx2kPk+g/hyj3XyXrVwweWpPdC2+0J6lTWRUKBnoVr68HbDyN7ezzD2fqeNz5rJ obPVu4O49vf2KWQsU4l+E/0ZdTXzxR94vEA7Pn39u4NpEqNg7KAVHdjFB1rSI/VCI4Hf Qpwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=pBertmk0; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c14-20020a17090a020e00b0024c1ddfa1bfsi1113000pjc.92.2023.06.10.21.42.16; Sat, 10 Jun 2023 21:42:33 -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=20221208 header.b=pBertmk0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231744AbjFKC6B (ORCPT + 99 others); Sat, 10 Jun 2023 22:58:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230515AbjFKC56 (ORCPT ); Sat, 10 Jun 2023 22:57:58 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D52C394; Sat, 10 Jun 2023 19:57:57 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5440e98616cso1536740a12.0; Sat, 10 Jun 2023 19:57:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686452277; x=1689044277; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=hOnAmvU8+4Mt3WlYCWLk9hDRAGAvBO+7sKgKdTa30LY=; b=pBertmk0B/XJ9jQzxBAA1xZ5HWTElIvwUMWLmURRVUhjfWyUOw9VUuAcv8402XYSDc isMKiKPzQrQgk8fYqTShNMLpIvhikIlG/Gi8IabL1ysy+HZbfQUpLqtRyyMY7+QEtilP DX7/TW4JfK5hWB/2VoXJcrAW9m9Hf+1SAD0Wi3364o/5yTlM99Ebx+DTh0rGnrgYczJj /wTaCtZiIdAI03kJPpZ5nb+54Z5rt2kHdEeSOq34fxlx6+5Il0sLOzMUyY281pyEZ9qx pz/VEqWOZRpHGYCUoxzbN64+RDZJ6BP8p2ZWtimYHxEpbYYp0IJs6g7HHNFaE1teQ5/N Adwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686452277; x=1689044277; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hOnAmvU8+4Mt3WlYCWLk9hDRAGAvBO+7sKgKdTa30LY=; b=DCg+ytCi51ZQ8sCit0PSvMO2hl98utHvOInjcMWvHWtXmHgWArStSDOVfBMDvpHlgL Yp4bfcxkxNsf+Yqf5DmwWLoaPEGl8+Ngkaob24OQglgAnHbGT4rp/Dh1z4h+Bf7FiMr0 BTAqnb+UMhiZ4CAVYEGjVRvrK9a1pAamOtOiMAZLNDbau0olEBpZrFYhg7xpv2w5pSI/ QvI838Hw9OcNVndobjrh18Vl2m6SeUg55F1dxlYtL+SpG+OTnweQksDyl/FOsTxGHNRM Lpnlih8U62fGxsMhdjgXOHN41M0Yzln3Ts7+ia0+qM2ovXLMiLuScBkkrozEnmLfEvm0 qkxg== X-Gm-Message-State: AC+VfDx7KXamHNo37ETeH4ZvcrVGFVCmCGaXTz1zsdGzeobI1RlNXpoP pnUX9UNDUVlIEMN/LIF8NpU= X-Received: by 2002:a17:90b:4b46:b0:259:a603:936e with SMTP id mi6-20020a17090b4b4600b00259a603936emr10858227pjb.8.1686452277191; Sat, 10 Jun 2023 19:57:57 -0700 (PDT) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id l7-20020a17090a150700b0025621aa4c6bsm1530319pja.25.2023.06.10.19.57.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jun 2023 19:57:56 -0700 (PDT) Sender: Vincent Mailhol From: Vincent Mailhol To: Marc Kleine-Budde , linux-can@vger.kernel.org, Thomas.Kopp@microchip.com Cc: Oliver Hartkopp , netdev@vger.kernel.org, marex@denx.de, Simon Horman , linux-kernel@vger.kernel.org, Vincent Mailhol Subject: [PATCH v5 1/3] can: length: fix bitstuffing count Date: Sun, 11 Jun 2023 11:57:26 +0900 Message-Id: <20230611025728.450837-2-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230611025728.450837-1-mailhol.vincent@wanadoo.fr> References: <20230507155506.3179711-1-mailhol.vincent@wanadoo.fr> <20230611025728.450837-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767331007215885248?= X-GMAIL-MSGID: =?utf-8?q?1768379964911141271?= The Stuff Bit Count is always coded on 4 bits [1]. Update the Stuff Bit Count size accordingly. In addition, the CRC fields of CAN FD Frames contain stuff bits at fixed positions called fixed stuff bits [2]. The CRC field starts with a fixed stuff bit and then has another fixed stuff bit after each fourth bit [2], which allows us to derive this formula: FSB count = 1 + round_down(len(CRC field)/4) The length of the CRC field is [1]: len(CRC field) = len(Stuff Bit Count) + len(CRC) = 4 + len(CRC) with len(CRC) either 17 or 21 bits depending of the payload length. In conclusion, for CRC17: FSB count = 1 + round_down((4 + 17)/4) = 6 and for CRC 21: FSB count = 1 + round_down((4 + 21)/4) = 7 Add a Fixed Stuff bits (FSB) field with above values and update CANFD_FRAME_OVERHEAD_SFF and CANFD_FRAME_OVERHEAD_EFF accordingly. [1] ISO 11898-1:2015 section 10.4.2.6 "CRC field": The CRC field shall contain the CRC sequence followed by a recessive CRC delimiter. For FD Frames, the CRC field shall also contain the stuff count. Stuff count If FD Frames, the stuff count shall be at the beginning of the CRC field. It shall consist of the stuff bit count modulo 8 in a 3-bit gray code followed by a parity bit [...] [2] ISO 11898-1:2015 paragraph 10.5 "Frame coding": In the CRC field of FD Frames, the stuff bits shall be inserted at fixed positions; they are called fixed stuff bits. There shall be a fixed stuff bit before the first bit of the stuff count, even if the last bits of the preceding field are a sequence of five consecutive bits of identical value, there shall be only the fixed stuff bit, there shall not be two consecutive stuff bits. A further fixed stuff bit shall be inserted after each fourth bit of the CRC field [...] Fixes: 85d99c3e2a13 ("can: length: can_skb_get_frame_len(): introduce function to get data length of frame in data link layer") Suggested-by: Thomas Kopp Signed-off-by: Vincent Mailhol Reviewed-by: Thomas Kopp --- include/linux/can/length.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/linux/can/length.h b/include/linux/can/length.h index 69336549d24f..b8c12c83bc51 100644 --- a/include/linux/can/length.h +++ b/include/linux/can/length.h @@ -72,17 +72,18 @@ * Error Status Indicator (ESI) 1 * Data length code (DLC) 4 * Data field 0...512 - * Stuff Bit Count (SBC) 0...16: 4 20...64:5 + * Stuff Bit Count (SBC) 4 * CRC 0...16: 17 20...64:21 * CRC delimiter (CD) 1 + * Fixed Stuff bits (FSB) 0...16: 6 20...64:7 * ACK slot (AS) 1 * ACK delimiter (AD) 1 * End-of-frame (EOF) 7 * Inter frame spacing 3 * - * assuming CRC21, rounded up and ignoring bitstuffing + * assuming CRC21, rounded up and ignoring dynamic bitstuffing */ -#define CANFD_FRAME_OVERHEAD_SFF DIV_ROUND_UP(61, 8) +#define CANFD_FRAME_OVERHEAD_SFF DIV_ROUND_UP(67, 8) /* * Size of a CAN-FD Extended Frame @@ -101,17 +102,18 @@ * Error Status Indicator (ESI) 1 * Data length code (DLC) 4 * Data field 0...512 - * Stuff Bit Count (SBC) 0...16: 4 20...64:5 + * Stuff Bit Count (SBC) 4 * CRC 0...16: 17 20...64:21 * CRC delimiter (CD) 1 + * Fixed Stuff bits (FSB) 0...16: 6 20...64:7 * ACK slot (AS) 1 * ACK delimiter (AD) 1 * End-of-frame (EOF) 7 * Inter frame spacing 3 * - * assuming CRC21, rounded up and ignoring bitstuffing + * assuming CRC21, rounded up and ignoring dynamic bitstuffing */ -#define CANFD_FRAME_OVERHEAD_EFF DIV_ROUND_UP(80, 8) +#define CANFD_FRAME_OVERHEAD_EFF DIV_ROUND_UP(86, 8) /* * Maximum size of a Classical CAN frame From patchwork Sun Jun 11 02:57:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Mailhol X-Patchwork-Id: 106046 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1861507vqr; Sat, 10 Jun 2023 21:42:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ71XwrRoXBudxkYIwINz/XeFVcFvb8wfKjj4TrCXu7TXUpwL3KWWh76NkpYYvhOwcF7j7v9 X-Received: by 2002:a05:6a00:2d18:b0:664:2f24:5578 with SMTP id fa24-20020a056a002d1800b006642f245578mr3747169pfb.13.1686458553921; Sat, 10 Jun 2023 21:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686458553; cv=none; d=google.com; s=arc-20160816; b=x3TUvK8imD2T8vwZcBqZaCQ3XVu6/wMfLvbKHoOKR9pOduh3BgkRV3faoBAwOE3Yr+ VIOPwH/QpSHQdCZ3oZZMbjHsQHlqGA9dkE0H3pyzf74ByNwaSsawvb6Q9MDLcIrQW5i9 ELVFFN61dF+8rPlGwpQPIid6kv0PT8wCV4sJlg6GiwRQDVoXAw4CPF6wST3AGOz2mVZB exMHpKQ+UkkPb2NLzgmazttpuKUUhweOQmBUDH19l+YbNuatelqu4HGH8T/afz7M9Vxy SiTU2fC0YNICwWcLIOLznKkbCVqWdtMhjoHMzXOrhimY5bHY5hITXfvwh1ZO36WO5l0R SYpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=Sos5o2aSl2Xna3lUYggO8oUvOki47+N42NOhecvp6Vo=; b=y/lBBQ3v772PQ+qIu2pDHkn8oEDWgeyYTo4DQQ1nOY0kdwBsrvkkxTyJzfQZKo2RfJ 00LS5pO836UtXJnTKeU/uxdYNvjJ1pXTQBxDOC37H4OiACWth+EytcWADQJAhwAslm3h XYHRnpb43bmNXaiF3+TvtPCnyZoJ4Hm8RWmXBJHewlfE+i2TxLa72qfHq8koMPHyLgqk AQv5SPYRRatXFOwTNiOmiDqK5yvLsqUDa+l83dNMJHkjzpuxvKUfyyGoim5mCXWLsvfZ WEMJ6mSoGJSGgswR+Zb7UjmiAsi9tO6+mkRtW2pACg42Y3aDEbZ6RJt5OSLfX7DgvRhP vRqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Q0OF3etz; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y2-20020aa793c2000000b0065121dedaefsi4877694pff.339.2023.06.10.21.42.16; Sat, 10 Jun 2023 21:42:33 -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=20221208 header.b=Q0OF3etz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232054AbjFKDAI (ORCPT + 99 others); Sat, 10 Jun 2023 23:00:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231704AbjFKC6A (ORCPT ); Sat, 10 Jun 2023 22:58:00 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25A4294; Sat, 10 Jun 2023 19:58:00 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-25bc1014777so325306a91.2; Sat, 10 Jun 2023 19:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686452279; x=1689044279; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Sos5o2aSl2Xna3lUYggO8oUvOki47+N42NOhecvp6Vo=; b=Q0OF3etzomXhdeRg6ENjdEchikfpz1lT3HZNcT5mmdHo2mDA8Wh5evlx5DBhAiJT1D JhWSqPzCBu19NuMPjJJ7CXdZN9+7H3oV67hMjmQQp9U6ep/P39K1LReydwamXqLbF9Dx WJqB17NNI9DQHmyThf1GRZ25WuIuHmJPRV/10cJzJJs9a2HewuUKMTWBgnWBHoXh7qVa qxk0mwkW4N+G8dKyLT2ijn8kSEDYNMgKHMMlgHqNckLAWrFF+iGuyR6jv7pq/b6ZEH9j K2DLpck9k7Bd747i3oSvXv4tZA7A77LRc3iz5mj5KW4a99Lia+H04bWwXDtZK2wSXeKJ 1RmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686452279; x=1689044279; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Sos5o2aSl2Xna3lUYggO8oUvOki47+N42NOhecvp6Vo=; b=lJSMZZYUyV9Y73OVWAO4cz6QoxpqavmH0rpJoUAdikiaE9WDw4E6LsYrk4VjxmSRmt xluIuVGN6lmqCDyWuE6EdfiK/JOaIZxhpXwQ6d/VWeY5FKqsjwt1GQ1vJnW2ZvyRKPs7 wjy6xvYQME4RqjpArAEKEbHNdB8WZiw+62Ve3vyA0pcJk4fV9FKIbmsiUfENNRyUUu2E amq42b9DmRaJcdxxM+xl9NVAj4xmiYW4fiJVE9WvSwFz7mEPsSUUqKjdz1k+wPx8Yqmf 5I2DTrAWJmL7WGE7uc6pSefQleR7owwsYMUDGqNWm8Jaj9Mc8Ngiy4ruJ1taVjwtdn/T tgPQ== X-Gm-Message-State: AC+VfDz3bGy3d0FTZEUImevDANKZDExvVxZFqngFYKaiPpe3mD6N+Nhq u0tbRfiB7OBK//YpIG1oKEA= X-Received: by 2002:a17:90b:4a84:b0:259:16e6:ceaa with SMTP id lp4-20020a17090b4a8400b0025916e6ceaamr5047249pjb.12.1686452279554; Sat, 10 Jun 2023 19:57:59 -0700 (PDT) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id l7-20020a17090a150700b0025621aa4c6bsm1530319pja.25.2023.06.10.19.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jun 2023 19:57:59 -0700 (PDT) Sender: Vincent Mailhol From: Vincent Mailhol To: Marc Kleine-Budde , linux-can@vger.kernel.org, Thomas.Kopp@microchip.com Cc: Oliver Hartkopp , netdev@vger.kernel.org, marex@denx.de, Simon Horman , linux-kernel@vger.kernel.org, Vincent Mailhol Subject: [PATCH v5 2/3] can: length: fix description of the RRS field Date: Sun, 11 Jun 2023 11:57:27 +0900 Message-Id: <20230611025728.450837-3-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230611025728.450837-1-mailhol.vincent@wanadoo.fr> References: <20230507155506.3179711-1-mailhol.vincent@wanadoo.fr> <20230611025728.450837-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767331204962819953?= X-GMAIL-MSGID: =?utf-8?q?1768379964741396810?= The CAN-FD frames only have one reserved bit. The bit corresponding to Classical CAN frame's RTR bit is called the "Remote Request Substitution (RRS)" [1]. N.B. The RRS is not to be confused with the Substitute Remote Request (SRR). Fix the description in the CANFD_FRAME_OVERHEAD_SFF/EFF macros. The total remains unchanged, so this is just a documentation fix. In addition to the above add myself as copyright owner for 2020 (as coauthor of the initial version, c.f. Fixes tag). [1] ISO 11898-1:2015 paragraph 10.4.2.3 "Arbitration field": RSS bit [only in FD Frames] The RRS bit shall be transmitted in FD Frames at the position of the RTR bit in Classical Frames. The RRS bit shall be transmitted dominant, but receivers shall accept recessive and dominant RRS bits. Fixes: 85d99c3e2a13 ("can: length: can_skb_get_frame_len(): introduce function to get data length of frame in data link layer") Signed-off-by: Vincent Mailhol Reviewed-by: Thomas Kopp --- include/linux/can/length.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/can/length.h b/include/linux/can/length.h index b8c12c83bc51..521fdbce2d69 100644 --- a/include/linux/can/length.h +++ b/include/linux/can/length.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* Copyright (C) 2020 Oliver Hartkopp * Copyright (C) 2020 Marc Kleine-Budde + * Copyright (C) 2020 Vincent Mailhol */ #ifndef _CAN_LENGTH_H @@ -64,7 +65,7 @@ * --------------------------------------------------------- * Start-of-frame 1 * Identifier 11 - * Reserved bit (r1) 1 + * Remote Request Substitution (RRS) 1 * Identifier extension bit (IDE) 1 * Flexible data rate format (FDF) 1 * Reserved bit (r0) 1 @@ -95,7 +96,7 @@ * Substitute remote request (SRR) 1 * Identifier extension bit (IDE) 1 * Identifier B 18 - * Reserved bit (r1) 1 + * Remote Request Substitution (RRS) 1 * Flexible data rate format (FDF) 1 * Reserved bit (r0) 1 * Bit Rate Switch (BRS) 1