[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241014152431.2045377-6-dario.binacchi@amarulasolutions.com>
Date: Mon, 14 Oct 2024 17:24:20 +0200
From: Dario Binacchi <dario.binacchi@...rulasolutions.com>
To: linux-kernel@...r.kernel.org
Cc: linux-amarula@...rulasolutions.com,
michael@...rulasolutions.com,
Dario Binacchi <dario.binacchi@...rulasolutions.com>,
Marc Kleine-Budde <mkl@...gutronix.de>,
Vincent Mailhol <mailhol.vincent@...adoo.fr>,
linux-can@...r.kernel.org
Subject: [RFC PATCH 5/6] can: netlink: extend stats to the error types (ack, CRC, form, ...)
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@...rulasolutions.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
Powered by blists - more mailing lists