Message ID | 20221219212013.1294820-2-frank.jungclaus@esd.eu |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2622930wrn; Mon, 19 Dec 2022 13:25:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXsAzeZTTjlnrr1axcIF9NjgYrntHjjTI5GDZnXDEHBFFlt/+Xmt96CtbEM7vFPTkPQhesrH X-Received: by 2002:a17:902:e549:b0:18f:9282:d8b0 with SMTP id n9-20020a170902e54900b0018f9282d8b0mr14428935plf.53.1671485123781; Mon, 19 Dec 2022 13:25:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671485123; cv=pass; d=google.com; s=arc-20160816; b=y9TDWYBL7pCfaU/BbXe7HA+NnzK9DF1jUIl1skodiROeSGCZ7xmgJaumzVo7NIxLMU 8AiEQqz3prYNr6QfzsMY7A9jXg2b1vHVH0eqUdJEbUm6u0ajogffwacjHBBCmPnCdr2M 2FVsImKXzJHsPTu3PfMoxyrrkx8JC4nD1usMVrz/m+8riJHFi9E4DiL2Sg6lVkrSBVkH 8KFKK8MSH9IwRNlMV4u/Kv0W4osZYhq9eJHdjv0SPV4XdmD68W4O7GU5s7+pzfPsHRbj 0p4La1+XkIjt7Wr9MSQEMpSPp13MCMCOJ0soWSxQKbC5wlFD2KxkB5liwrgusjd4Gi7N Rs/g== ARC-Message-Signature: i=2; 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 :dkim-signature; bh=ySpz1nlgcq/mVnqqCPG7zzsJF94xzgLeBnibFVWUUbs=; b=w5MS51AMMN5TP6o5aBCmMMLB2pZ1CjP0Eyj3aFJOa8j+GcVSM6GlrMLiAJHDSItjy8 HR63MJsRzBlhyl/4IEWdjish5fu34hv2PA+gUHa4CAQElFN8p1IjXTR8lbcM1Sq2Do3i euq1MeLHm1drvYL9FImjJFgdDjsYg98mlHs2oekuoxatkZ32CzcGT2XNMwo82XBThiT0 gYHXiDops7WPXxGmD/m0uoV1otznIHGJTze4BSZlWUg1XhS05mhj3Hq86FpBYcAmCXs9 i3eGRcAnoJj8a5wxDdTNOHJ22m4U6dm1Gz4qE/7CKmDJIuN0ha+d93IVL2kStSU+uOS3 d6TQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@esdhannover.onmicrosoft.com header.s=selector1-esdhannover-onmicrosoft-com header.b=ferSbRDn; arc=pass (i=1); 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 h14-20020a170902f54e00b001890c6feffasi12469269plf.568.2022.12.19.13.25.10; Mon, 19 Dec 2022 13:25:23 -0800 (PST) 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=@esdhannover.onmicrosoft.com header.s=selector1-esdhannover-onmicrosoft-com header.b=ferSbRDn; arc=pass (i=1); 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 S232666AbiLSVVC (ORCPT <rfc822;abdi.embedded@gmail.com> + 99 others); Mon, 19 Dec 2022 16:21:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232552AbiLSVUz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 19 Dec 2022 16:20:55 -0500 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2118.outbound.protection.outlook.com [40.107.22.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F20D764D1; Mon, 19 Dec 2022 13:20:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lnas/Ei5LpXYNSAGuaR60BOH0sdBPciffqdJcSi1REfxWVp7eRhSqhbBSKsBxPYkIMWAxszZJ4lCC+fvUR05HxqCnEiHwrAhiXrJujKvqINhmITCMxwPisHkIi6GORMEQKt4GsQ3z5eFMDJa8/EW2G+rwjfaXS72cAgM/Iq06LejoWm4ACBNV72dK4RnsrfpnzbldnLsQnqPuHLdlk0h1BnIX7E/Wi0FDjLiT4vezAOAuAmYmcgVQljCriij80PxwS7DuiQDpXMIO20SGzovURZARXGIreQNlD4YDCm1VtDgTkY/RTI4guXhuOfpfxIMnCs0I3i1OY3IisZnftMtZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ySpz1nlgcq/mVnqqCPG7zzsJF94xzgLeBnibFVWUUbs=; b=X9W5k/52LPPUx48eAnTXCbjnXBTHUQGvHNmGSyIGyYlE9aZG1tPr8iryMv3FLRYg//1CrKlZLeALo02QBVG801xaOoLlTNnW+xLViKj2nndL3RYAUQcRX2AtaQNZqPRtvD7bTP3r6P7uWS6PMA201uTf2pe6Lkf2UhHJUgnoOyyE+bgUxLg4738ltdW0rgnJ3UiAz8pcuvpH/3hCtxC7VzFohFr84aL6ciz6DRkkHztWxbzRO0I12aP2buXAUj1IcugAfQpAxmge1FYc9y2OCo1AKHWVsDILDacEKnz65I5jj7FMO9iVxKPGuiv70tikURoh1daGmA4ep33xSEqpSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 80.151.164.27) smtp.rcpttodomain=esd.eu smtp.mailfrom=esd.eu; dmarc=none action=none header.from=esd.eu; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=esdhannover.onmicrosoft.com; s=selector1-esdhannover-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ySpz1nlgcq/mVnqqCPG7zzsJF94xzgLeBnibFVWUUbs=; b=ferSbRDnt7pMME2ZMLo995J3V3C+cuFqXe2mhv+A3kPBzV3bTOzEUiJYOeaWPrQT3w6dD2oBNzy50FVLcjEFn6VkyYQbtmAIJEp3xVZqe6EyHI3DBjsZuMnBUfoIOJuu8swj3ccqfKpX0YnE6ZVekMIdd7+uqo7if3qn/bXudsE= Received: from ZR0P278CA0053.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::22) by AM7PR03MB6232.eurprd03.prod.outlook.com (2603:10a6:20b:13b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Mon, 19 Dec 2022 21:20:50 +0000 Received: from VI1EUR06FT067.eop-eur06.prod.protection.outlook.com (2603:10a6:910:1d:cafe::99) by ZR0P278CA0053.outlook.office365.com (2603:10a6:910:1d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.20 via Frontend Transport; Mon, 19 Dec 2022 21:20:50 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 80.151.164.27) smtp.mailfrom=esd.eu; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=esd.eu; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning esd.eu discourages use of 80.151.164.27 as permitted sender) Received: from esd-s7.esd (80.151.164.27) by VI1EUR06FT067.mail.protection.outlook.com (10.13.6.78) with Microsoft SMTP Server id 15.20.5924.16 via Frontend Transport; Mon, 19 Dec 2022 21:20:49 +0000 Received: from esd-s20.esd.local (debby [10.0.0.190]) by esd-s7.esd (Postfix) with ESMTPS id 4AD3C7C16C8; Mon, 19 Dec 2022 22:20:49 +0100 (CET) Received: by esd-s20.esd.local (Postfix, from userid 2046) id 3F9E72E1DC1; Mon, 19 Dec 2022 22:20:49 +0100 (CET) From: Frank Jungclaus <frank.jungclaus@esd.eu> To: linux-can@vger.kernel.org, Marc Kleine-Budde <mkl@pengutronix.de>, Wolfgang Grandegger <wg@grandegger.com>, Vincent Mailhol <mailhol.vincent@wanadoo.fr> Cc: =?utf-8?q?Stefan_M=C3=A4tje?= <stefan.maetje@esd.eu>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Frank Jungclaus <frank.jungclaus@esd.eu> Subject: [PATCH 1/3] can: esd_usb: Improved behavior on esd CAN_ERROR_EXT event (1) Date: Mon, 19 Dec 2022 22:20:12 +0100 Message-Id: <20221219212013.1294820-2-frank.jungclaus@esd.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221219212013.1294820-1-frank.jungclaus@esd.eu> References: <20221219212013.1294820-1-frank.jungclaus@esd.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1EUR06FT067:EE_|AM7PR03MB6232:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: cd797964-2040-4923-17d0-08dae206e6f4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /x5HfrvrFergW/ATbm2GhQfYnetiOiJTOpURBDZQBh9Jml4ApOLUy2Jw7KW1tOIfO9RHuRdSE3h0oit+bRZ159PXmaXTYxL35aASUDwaCh87ravkDsT7Jmn3oBO0FC1INT+KWeNy+2UvTD3NQGqv5FMpZLv8mqtyEcG7q3EcX23lXbYWS1hV41wTfmnCLDvYHjKXizThFQfojPhFuSMnmclKMsFFU2nft+N5APXVQ4E3xK1kx6s5FRpvzMl/mDE3d+WhxwsUrtZ94UQlIcZ/TYdi5O5hN0UyjkINr54pDJHL9z722ket2+CtXmmA0GUTkjy9rW7dnviGj8SM0hqLwj7rO4MPuvNep4LqXV9gCuhzSKaOBY1hziPYA294Nxda0cTYaXTthfISNswNi3wqhtVR88/ZUGB/rL8kED1QdikCQesMAy3et2i4ZEFaSKFypF2ps76T6WjIRiGvE6CqeW7wD7uB5LoUQxzw/eYyHZuirQ1hscMUXJkFqpiE8+B0tYIwqJBzFCidoGlp7hR72ZF5DvesDohgkwoaYx+Yzxmr02BGTSU4LKYskOWjDVo0gMtw++RYAPy2Z2AxCDng3IiKdJ9YyA6wgYQsIpH0GdTxLaoSz6Uyux3DwOGoMwQwW5/MQORFsKLcZJgewbNuM8Sy6xgWnaSYIgr8UiM8TP0= X-Forefront-Antispam-Report: CIP:80.151.164.27;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:esd-s7.esd;PTR:p5097a41b.dip0.t-ipconnect.de;CAT:NONE;SFS:(13230022)(4636009)(136003)(396003)(346002)(39830400003)(376002)(451199015)(36840700001)(46966006)(8936002)(8676002)(70586007)(70206006)(5660300002)(4326008)(44832011)(36860700001)(41300700001)(42186006)(316002)(40480700001)(2906002)(54906003)(110136005)(86362001)(2616005)(1076003)(356005)(83380400001)(26005)(186003)(6266002)(82310400005)(336012)(47076005)(81166007)(478600001)(36756003)(6666004);DIR:OUT;SFP:1102; X-OriginatorOrg: esd.eu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2022 21:20:49.7846 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd797964-2040-4923-17d0-08dae206e6f4 X-MS-Exchange-CrossTenant-Id: 5a9c3a1d-52db-4235-b74c-9fd851db2e6b X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5a9c3a1d-52db-4235-b74c-9fd851db2e6b;Ip=[80.151.164.27];Helo=[esd-s7.esd] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR06FT067.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR03MB6232 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752679185341095870?= X-GMAIL-MSGID: =?utf-8?q?1752679185341095870?= |
Series |
can: esd_usb: Some more preparation for supporting esd CAN-USB/3
|
|
Commit Message
Frank Jungclaus
Dec. 19, 2022, 9:20 p.m. UTC
Moved the supply for cf->data[3] (bit stream position of CAN error)
outside of the "switch (ecc & SJA1000_ECC_MASK){}"-statement, because
this position is independent of the error type.
Fixes: 96d8e90382dc ("can: Add driver for esd CAN-USB/2 device")
Signed-off-by: Frank Jungclaus <frank.jungclaus@esd.eu>
---
drivers/net/can/usb/esd_usb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
On Tue. 20 Dec. 2022 at 06:25, Frank Jungclaus <frank.jungclaus@esd.eu> wrote: > > Moved the supply for cf->data[3] (bit stream position of CAN error) > outside of the "switch (ecc & SJA1000_ECC_MASK){}"-statement, because > this position is independent of the error type. > > Fixes: 96d8e90382dc ("can: Add driver for esd CAN-USB/2 device") > Signed-off-by: Frank Jungclaus <frank.jungclaus@esd.eu> > --- > drivers/net/can/usb/esd_usb.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c > index 42323f5e6f3a..5e182fadd875 100644 > --- a/drivers/net/can/usb/esd_usb.c > +++ b/drivers/net/can/usb/esd_usb.c > @@ -286,7 +286,6 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv, > cf->data[2] |= CAN_ERR_PROT_STUFF; > break; > default: > - cf->data[3] = ecc & SJA1000_ECC_SEG; > break; > } > > @@ -294,6 +293,9 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv, > if (!(ecc & SJA1000_ECC_DIR)) > cf->data[2] |= CAN_ERR_PROT_TX; > > + /* Bit stream position in CAN frame as the error was detected */ > + cf->data[3] = ecc & SJA1000_ECC_SEG; Can you confirm that the value returned by the device matches the specifications from linux/can/error.h? https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/can/error.h#L90 > if (priv->can.state == CAN_STATE_ERROR_WARNING || > priv->can.state == CAN_STATE_ERROR_PASSIVE) { > cf->data[1] = (txerr > rxerr) ? > -- > 2.25.1 >
On Tue, 2022-12-20 at 14:16 +0900, Vincent MAILHOL wrote: > On Tue. 20 Dec. 2022 at 06:25, Frank Jungclaus <frank.jungclaus@esd.eu> wrote: > > > > Moved the supply for cf->data[3] (bit stream position of CAN error) > > outside of the "switch (ecc & SJA1000_ECC_MASK){}"-statement, because > > this position is independent of the error type. > > > > Fixes: 96d8e90382dc ("can: Add driver for esd CAN-USB/2 device") > > Signed-off-by: Frank Jungclaus <frank.jungclaus@esd.eu> > > --- > > drivers/net/can/usb/esd_usb.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c > > index 42323f5e6f3a..5e182fadd875 100644 > > --- a/drivers/net/can/usb/esd_usb.c > > +++ b/drivers/net/can/usb/esd_usb.c > > @@ -286,7 +286,6 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv, > > cf->data[2] |= CAN_ERR_PROT_STUFF; > > break; > > default: > > - cf->data[3] = ecc & SJA1000_ECC_SEG; > > break; > > } > > > > @@ -294,6 +293,9 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv, > > if (!(ecc & SJA1000_ECC_DIR)) > > cf->data[2] |= CAN_ERR_PROT_TX; > > > > + /* Bit stream position in CAN frame as the error was detected */ > > + cf->data[3] = ecc & SJA1000_ECC_SEG; > > Can you confirm that the value returned by the device matches the > specifications from linux/can/error.h? The value returned is supposed to be compatible to the SJA1000 ECC register. See https://esd.eu/fileadmin/esd/docs/manuals/NTCAN_Part1_Function_API_Manual_en_56.pdf Chapter "6.2.10 EV_CAN_ERROR_EXT" (page 185) and "Annex B: Bus Error Code" table 37 and 38 (page 272 and following). So this should be compliant with the values given in linux/can/error.h. > > https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/can/error.h#L90 > > > if (priv->can.state == CAN_STATE_ERROR_WARNING || > > priv->can.state == CAN_STATE_ERROR_PASSIVE) { > > cf->data[1] = (txerr > rxerr) ? > > -- > > 2.25.1 > >
On Tue. 22 Dec. 2022 at 02:55, Frank Jungclaus <Frank.Jungclaus@esd.eu> wrote: > On Tue, 2022-12-20 at 14:16 +0900, Vincent MAILHOL wrote: > > On Tue. 20 Dec. 2022 at 06:25, Frank Jungclaus <frank.jungclaus@esd.eu> wrote: > > > > > > Moved the supply for cf->data[3] (bit stream position of CAN error) > > > outside of the "switch (ecc & SJA1000_ECC_MASK){}"-statement, because > > > this position is independent of the error type. > > > > > > Fixes: 96d8e90382dc ("can: Add driver for esd CAN-USB/2 device") > > > Signed-off-by: Frank Jungclaus <frank.jungclaus@esd.eu> > > > --- > > > drivers/net/can/usb/esd_usb.c | 4 +++- > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c > > > index 42323f5e6f3a..5e182fadd875 100644 > > > --- a/drivers/net/can/usb/esd_usb.c > > > +++ b/drivers/net/can/usb/esd_usb.c > > > @@ -286,7 +286,6 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv, > > > cf->data[2] |= CAN_ERR_PROT_STUFF; > > > break; > > > default: > > > - cf->data[3] = ecc & SJA1000_ECC_SEG; > > > break; > > > } > > > > > > @@ -294,6 +293,9 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv, > > > if (!(ecc & SJA1000_ECC_DIR)) > > > cf->data[2] |= CAN_ERR_PROT_TX; > > > > > > + /* Bit stream position in CAN frame as the error was detected */ > > > + cf->data[3] = ecc & SJA1000_ECC_SEG; > > > > Can you confirm that the value returned by the device matches the > > specifications from linux/can/error.h? > > The value returned is supposed to be compatible to the SJA1000 ECC > register. > > See > https://esd.eu/fileadmin/esd/docs/manuals/NTCAN_Part1_Function_API_Manual_en_56.pdf > > Chapter "6.2.10 EV_CAN_ERROR_EXT" (page 185) > and > "Annex B: Bus Error Code" table 37 and 38 (page 272 and following). > > So this should be compliant with the values given in linux/can/error.h. Thanks for the link. It is indeed compliant. Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> > > https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/can/error.h#L90 > > > > > if (priv->can.state == CAN_STATE_ERROR_WARNING || > > > priv->can.state == CAN_STATE_ERROR_PASSIVE) { > > > cf->data[1] = (txerr > rxerr) ? > > > -- > > > 2.25.1 > > > >
diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c index 42323f5e6f3a..5e182fadd875 100644 --- a/drivers/net/can/usb/esd_usb.c +++ b/drivers/net/can/usb/esd_usb.c @@ -286,7 +286,6 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv, cf->data[2] |= CAN_ERR_PROT_STUFF; break; default: - cf->data[3] = ecc & SJA1000_ECC_SEG; break; } @@ -294,6 +293,9 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv, if (!(ecc & SJA1000_ECC_DIR)) cf->data[2] |= CAN_ERR_PROT_TX; + /* Bit stream position in CAN frame as the error was detected */ + cf->data[3] = ecc & SJA1000_ECC_SEG; + if (priv->can.state == CAN_STATE_ERROR_WARNING || priv->can.state == CAN_STATE_ERROR_PASSIVE) { cf->data[1] = (txerr > rxerr) ?