Message ID | 20230214160223.1199464-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:eb09:0:0:0:0:0 with SMTP id s9csp3066594wrn; Tue, 14 Feb 2023 08:13:21 -0800 (PST) X-Google-Smtp-Source: AK7set9UWdfM2olM3SCFMXdMiEOtj3bxY0X0dG7R9xIWRsNRtgsxnnOSfPQsLq0ZULFeco2lLDPQ X-Received: by 2002:a17:90b:3904:b0:233:ee50:d26d with SMTP id ob4-20020a17090b390400b00233ee50d26dmr3130394pjb.4.1676391201430; Tue, 14 Feb 2023 08:13:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1676391201; cv=pass; d=google.com; s=arc-20160816; b=tD+p1SpvihVN0nscY+hJlEYNIymtaiJdnzOytn+CmjB9zVwS5LSEosxukaXDDQ0S24 L9B4a/yvJxT4nOS22P4pqGYQkRWadXqqJ/5OjOMMugEU4KRPyAX7m6ChAvjCb6uG7+JE YReF4coKU+AH+bebHAkxfpza/hpBOMvpCMaP9KF0LghNuObfNjx7EZl+HKRSUlMv0zGT vfqlFzPYCorjNy4Y4aTeddUE3MUrTc1U7ydUhz2/s3wt/7OFnMARBqNs7r0/D2LBtKjQ wF8bb8J4gF4R8MPP3vcYoOiicwD/19mgy3P3Ca4DZ5KHqPW5h0zpJ8Wz+J5c0+yh8FPK PWEA== 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=kwGnzY+wItMUr+e7809AGC4ypeS4PwXRjrVTNHyfvjnVUmQV6OfCQWdI5CQ7UXMTBb SgwtclwkwYPiKNkzhW9s8B3+MLm+C6rJKRSan29B/ildPUqUMnfueTpMwDgkBbjgjZLx MrAVou4l6sNqaeIS/BdJ6LOsN6sx8/sJVsITcB42TEiRgB/rOFNobotBY5xrOvvoKxl4 lIQkYAyf5LTUEeBiXbFgVwl301R2uEqWg96eyRxYGH5f33qRPses3WYR8AjTTfwivq+9 K32cIM9MN+PFnQU2Afm6VxMcTRgHS9/w5ZlxrdjgBiWiMMUjmsvpe2yogtiUk57j1/Rf psvw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@esdhannover.onmicrosoft.com header.s=selector1-esdhannover-onmicrosoft-com header.b="iSs/czP2"; 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 gq15-20020a17090b104f00b002340e488cc5si4649519pjb.96.2023.02.14.08.13.08; Tue, 14 Feb 2023 08:13:21 -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="iSs/czP2"; 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 S229508AbjBNQDs (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Tue, 14 Feb 2023 11:03:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbjBNQDr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 14 Feb 2023 11:03:47 -0500 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2119.outbound.protection.outlook.com [40.107.105.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26A502132; Tue, 14 Feb 2023 08:03:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cmcNzuCm6Bry52pBstqhMeBsISyMBuXYUt9wHfK488l5FeP/2mllZIEJ/W+4EYQwCL3P+fSswbdMNQjBeTzlJsbu36zoUWvsU8umlYnCZRgVAJneinUax7ufAj9vF67aUPp/fYTJrkYuJBYeSVpvu8B1G2oNJYBABev+moQyN11ctumURDasvDZaMmjk6Lbo+ahGwDZSyHZFKNNs32eM81W5fiCNbAL2QGAxK2alHaWNng+M1eF46K42m+E/y2TVwzF7uvB3Qwz4qzMXMehFq9FnWjcvho/ofr7b4nPlWJL2WfCWpZbqus1Lf6IaqsuW/MI2RF6sJ8Om7fqXdMLvaA== 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=b/12WeyBJJ21Nj6OiH+zJ8E6vqAVnx5adWJYtyofhUcS7EeoE+8TVM1ImGbGaiH3qVktxwnYnmvJN5AiuecZ8SuJgiEaUG5DBGYiAvPj7eu4fobnvgXZ4nSRqKRaGJDmn0iaVOk1qKPcRzTn43QIFXYS+KuknDF7H8Jveh+/YiAb1n5QlNSd50tkl016Ie4H4u00gy+3e6ttw4C1EDom1EJDfWQX3Zu1v8nec0mDuFk0w80LCycBQ2yKcUZ9nfm084+SN2sAC3wh9ZW0HststRjAeS2nky7Z6uYMqOXJN4djxCjR8gjLxzaSjlipxXLVt8RZ0W4Y4UuHCiWayBWabw== 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=iSs/czP2qlcXaPys0uLva5TJDgeubW8pKIKlKeeEeNInlfWFBKNTWEJczSxlN1/owdI3Gn90p+Idj9p6UPuI/34VFbjxVfArkPLmILLxt4UFiTgqwm5yyGVy/YIiKTMkc36wsLs7GjVIysD8mHfoCq7i8n7+0kn+me245k5AsxA= Received: from AM5PR0701CA0022.eurprd07.prod.outlook.com (2603:10a6:203:51::32) by AS2PR03MB9049.eurprd03.prod.outlook.com (2603:10a6:20b:5f0::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.23; Tue, 14 Feb 2023 16:03:10 +0000 Received: from AM7EUR06FT049.eop-eur06.prod.protection.outlook.com (2603:10a6:203:51:cafe::8) by AM5PR0701CA0022.outlook.office365.com (2603:10a6:203:51::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.10 via Frontend Transport; Tue, 14 Feb 2023 16:03:10 +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 AM7EUR06FT049.mail.protection.outlook.com (10.233.255.201) with Microsoft SMTP Server id 15.20.6086.24 via Frontend Transport; Tue, 14 Feb 2023 16:03:10 +0000 Received: from esd-s20.esd.local (jenkins.esd.local [10.0.0.190]) by esd-s7.esd (Postfix) with ESMTPS id 6A8977C1635; Tue, 14 Feb 2023 17:03:10 +0100 (CET) Received: by esd-s20.esd.local (Postfix, from userid 2046) id 5F1652E0125; Tue, 14 Feb 2023 17:03:10 +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 v2 1/3] can: esd_usb: Improved behavior on esd CAN_ERROR_EXT event (1) Date: Tue, 14 Feb 2023 17:02:21 +0100 Message-Id: <20230214160223.1199464-2-frank.jungclaus@esd.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214160223.1199464-1-frank.jungclaus@esd.eu> References: <20230214160223.1199464-1-frank.jungclaus@esd.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7EUR06FT049:EE_|AS2PR03MB9049:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: f9121bc2-4c5f-4f9e-cee2-08db0ea4f856 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cmFw5xy9Ua969J4Vv/9ezup/o4bzi7nHpbhoHlEKo5vqdSIsfVbFHRqRTdOjJGJbkKow4UkrlAVM740FfS3anJM/z5XedULvg6dVTZ5FHtAEfB/eoRaaCUJYhdY3Kz2QiZklc5Qg0mrReMGqaNvn7PPDuNEQAhJikBDV+n30eVLUEuRJ3JNdnDdD/vI5G9BqHiy+z9W5tUB6T9dWg6vCTpIGyIj4Zcl1jnhyrdU3jNZ8dmqeduiXxeCCFAIIBGc7FggSh5b6QdKNaFpyLjR2Mjm2dxjpvTLSZOwSvsWOlct/thezYYKt/K3al9eA0bMSn9vBtU7c6wUFs7sok//CJIc0mTJvHZNmhdjyViMeJ4OvgJxwXyZo7W42bTqUm7O8Z0WWYD9jr1x/KPnDVFmXeRrB4d04yk7cFQ2EPnh9eWlsQ9sFN5ClpDqsllboypmmEYfAgi/YkGpILOx/N3OswP47q40+O5TdMT9BZOy7tqXgkeo144/GIqzee6jK9RR30kuJXo5W+A0TJgvFR7O7ljeToiYIjlb9dUTCORveKp3Tn5ymmPKHSfZuxyBnICjebC9k/29zM1hI2+Mvb5I6j0SsOtUyfCInAaRIJPWUk49GJo985RocH9521GNWoxURdfvWtwYiD9gI1FtENm8eT/uPWDKcctwAEOVa/VmWYLU= 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:(13230025)(4636009)(376002)(346002)(136003)(396003)(39840400004)(451199018)(36840700001)(46966006)(36756003)(47076005)(2616005)(336012)(83380400001)(356005)(36860700001)(81166007)(82310400005)(40480700001)(186003)(8936002)(2906002)(41300700001)(44832011)(5660300002)(6666004)(6266002)(26005)(1076003)(8676002)(4326008)(316002)(86362001)(110136005)(42186006)(54906003)(70206006)(70586007)(478600001);DIR:OUT;SFP:1102; X-OriginatorOrg: esd.eu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2023 16:03:10.6139 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f9121bc2-4c5f-4f9e-cee2-08db0ea4f856 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: AM7EUR06FT049.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9049 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?1757823580671244462?= X-GMAIL-MSGID: =?utf-8?q?1757823580671244462?= |
Series |
can: esd_usb: Some more preparation for supporting esd CAN-USB/3
|
|
Commit Message
Frank Jungclaus
Feb. 14, 2023, 4:02 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(-)
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) ?