Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3406837rwa; Tue, 23 Aug 2022 04:22:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR56qebr/aIoKfRdiIKqOs0bEeDlKq/S0rHzuNozT2kzmbwiwBNwOTW5WmZ0y7rP76TG9axL X-Received: by 2002:a17:902:8d83:b0:172:c4f6:aa84 with SMTP id v3-20020a1709028d8300b00172c4f6aa84mr18574507plo.67.1661253754777; Tue, 23 Aug 2022 04:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253754; cv=none; d=google.com; s=arc-20160816; b=EChReHrMOjYTJGKphMYXaSlbzkAT7nZrCnqe8d5/FNrBqTZJcg+WaHL5a9GAVcXXju QqHZKpI9h9skdURmWyVeTxV/9NAwwfobbeOYL2A7Yq5J69XdZt3fjZUYkwpZl5pCCx/x O5MW3/6Py4OLPePTw6NWFNJ95V9syMeValwsmxK5weEuqMIpuYWlQ8/xPgTj4Lixz11U Pyi1dnQ1DMe8fsyZS7+b7DBPQGW8RVFvoqyAqw5QthUyzRPADuPCgfHt7ULOVxe4Pn77 UG8ls/RWxbn2ppLjxZhxcyqsadrOLH7ElMG8adA62zGxCWuDxSYZ5sryWsWucohFTBqy HALA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TmUSaAd/zo/H5TF9qqw/+wkBOpWkA16FDfjaimcLTPQ=; b=I6gxGlNSzG1L25ULw/521R1gHxte7bX3/i6Mtka4j9a0S+JXClRctoM8yJNSGiwl34 3Qbc5nTsRXAVoTM7zzyx5m9MMBiNxmGK9Fn3dqOcsNPIXcYcCMbwGXeEXdmkCIkGBVPf 0t3oEJVuEr8bPxE2H9bzNHCZ/oWYtW2g1VYcgz5F09rrf6bFbdCgrfMSnzoRmNIMO8ua rA07tNoEvua4/J2cCYFPivKP6gaoPbOf+dN2VEX1aC+fkNcfbDuWTiqIx5yWFfjZOO3Z FTh266Y/HUm6puyTY12WJzoGA9FHmPJLx86sxzCtS5FKfc7dCPeEUV5NUoX+FkFWx1dV EAWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=co78bTfT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb5-20020a17090b060500b001fae363bebfsi7737978pjb.142.2022.08.23.04.22.23; Tue, 23 Aug 2022 04:22:34 -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=@linuxfoundation.org header.s=korg header.b=co78bTfT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241849AbiHWJoI (ORCPT + 99 others); Tue, 23 Aug 2022 05:44:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352165AbiHWJk7 (ORCPT ); Tue, 23 Aug 2022 05:40:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 605DA79A57; Tue, 23 Aug 2022 01:41:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 72EFDB81C6B; Tue, 23 Aug 2022 08:41:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C22A9C433D7; Tue, 23 Aug 2022 08:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244093; bh=xmnsuXtUw8sGw9bxdWq+/4tnHuPDrOAAJeRf/dZAQZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=co78bTfTD5idZAGbZogxZsT2A2gUKo7D/8iM6xWOQZLLGeD5ni5I9CPWi5jN2u0Sn ppAB8IrTUIV9TLRnN/SjcU9cove7oLKo4U874mTCN1zJe1BisWOHo82vfK+vH6cjcb 9fyAGlTwBVlx2vLJOSuaXMPBbmpq6SA64R/ZPvwQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vincent Mailhol , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 4.14 085/229] can: error: specify the values of data[5..7] of CAN error frames Date: Tue, 23 Aug 2022 10:24:06 +0200 Message-Id: <20220823080056.762652145@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Vincent Mailhol [ Upstream commit e70a3263a7eed768d5f947b8f2aff8d2a79c9d97 ] Currently, data[5..7] of struct can_frame, when used as a CAN error frame, are defined as being "controller specific". Device specific behaviours are problematic because it prevents someone from writing code which is portable between devices. As a matter of fact, data[5] is never used, data[6] is always used to report TX error counter and data[7] is always used to report RX error counter. can-utils also relies on this. This patch updates the comment in the uapi header to specify that data[5] is reserved (and thus should not be used) and that data[6..7] are used for error counters. Fixes: 0d66548a10cb ("[CAN]: Add PF_CAN core module") Link: https://lore.kernel.org/all/20220719143550.3681-11-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- include/uapi/linux/can/error.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/can/error.h b/include/uapi/linux/can/error.h index bfc4b5d22a5e..383f3d508a53 100644 --- a/include/uapi/linux/can/error.h +++ b/include/uapi/linux/can/error.h @@ -120,6 +120,9 @@ #define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */ #define CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */ -/* controller specific additional information / data[5..7] */ +/* data[5] is reserved (do not use) */ + +/* TX error counter / data[6] */ +/* RX error counter / data[7] */ #endif /* _UAPI_CAN_ERROR_H */ -- 2.35.1