From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: linux-kernel@vger.kernel.org
Cc: linux-amarula@amarulasolutions.com, michael@amarulasolutions.com,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
linux-can@vger.kernel.org
Subject: [RFC PATCH 5/6] can: netlink: extend stats to the error types (ack, CRC, form, ...)
Date: Mon, 14 Oct 2024 17:24:20 +0200 [thread overview]
Message-ID: <20241014152431.2045377-6-dario.binacchi@amarulasolutions.com> (raw)
In-Reply-To: <20241014152431.2045377-1-dario.binacchi@amarulasolutions.com>
The CAN bus protocol specifies 5 CAN error types:
- Bit Error [Transmitter]
- Bit Stuffing Error [Receiver]
- Form Error [Receiver]
- ACK Error (Acknowledgment) [Transmitter]
- CRC Error (Cyclic Redundancy Check) [Receiver]
The patch also adds the corresponding counters to the statistics. Since
each device/driver can determine which of these errors has occurred, why
not export this information along with the more general counters?
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
include/uapi/linux/can/netlink.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/uapi/linux/can/netlink.h b/include/uapi/linux/can/netlink.h
index 02ec32d69474..8b33549e7e19 100644
--- a/include/uapi/linux/can/netlink.h
+++ b/include/uapi/linux/can/netlink.h
@@ -114,6 +114,12 @@ struct can_device_stats {
__u32 bus_off; /* Changes to bus off state */
__u32 arbitration_lost; /* Arbitration lost errors */
__u32 restarts; /* CAN controller re-starts */
+ __u32 bit_error; /* Bit error */
+ __u32 stuff_error; /* Bit stuffing error */
+ __u32 form_error; /* form error */
+ __u32 ack_error; /* ack error */
+ __u32 crc_error; /* CRC error */
+ __u32 pad;
};
/*
--
2.43.0
next prev parent reply other threads:[~2024-10-14 15:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 15:24 [RFC PATCH 0/6] This series originates from some tests I ran on a CAN communication for Dario Binacchi
2024-10-14 15:24 ` [RFC PATCH 1/6] can: dev: add generic function can_update_bus_error_stats() Dario Binacchi
2024-10-14 15:24 ` [RFC PATCH 2/6] can: flexcan: use can_update_bus_error_stats() Dario Binacchi
2024-10-14 15:24 ` [RFC PATCH 3/6] can: dev: add helper macros to setup an error frame Dario Binacchi
2024-10-14 20:00 ` Marc Kleine-Budde
2024-10-15 7:47 ` Dario Binacchi
2024-10-14 15:24 ` [RFC PATCH 4/6] can: flexcan: use helper macros to setup the " Dario Binacchi
2024-10-14 15:24 ` Dario Binacchi [this message]
2024-10-14 15:24 ` [RFC PATCH 6/6] can: dev: update the error types stats (ack, CRC, form, ...) Dario Binacchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241014152431.2045377-6-dario.binacchi@amarulasolutions.com \
--to=dario.binacchi@amarulasolutions.com \
--cc=linux-amarula@amarulasolutions.com \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mailhol.vincent@wanadoo.fr \
--cc=michael@amarulasolutions.com \
--cc=mkl@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox