diff options
author | Vincent Mailhol <mailhol.vincent@wanadoo.fr> | 2022-07-19 23:35:49 +0900 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2022-07-20 09:27:37 +0200 |
commit | 3e5c291c7942d0909a48bc5ec1b9bba136465166 (patch) | |
tree | 4b20cdd0fac2827c886243ecb1a897638e879f67 /drivers/net/can/pch_can.c | |
parent | e70a3263a7eed768d5f947b8f2aff8d2a79c9d97 (diff) |
can: add CAN_ERR_CNT flag to notify availability of error counter
Add a dedicated flag in uapi/linux/can/error.h to notify the userland
that fields data[6] and data[7] of the CAN error frame were
respectively populated with the tx and rx error counters.
For all driver tree-wide, set up this flags whenever needed.
Link: https://lore.kernel.org/all/20220719143550.3681-12-mailhol.vincent@wanadoo.fr
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/pch_can.c')
-rw-r--r-- | drivers/net/can/pch_can.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c index 497ef77340ea..50f6719b3aa4 100644 --- a/drivers/net/can/pch_can.c +++ b/drivers/net/can/pch_can.c @@ -497,6 +497,7 @@ static void pch_can_error(struct net_device *ndev, u32 status) priv->can.can_stats.bus_off++; can_bus_off(ndev); } else { + cf->can_id |= CAN_ERR_CNT; cf->data[6] = errc & PCH_TEC; cf->data[7] = (errc & PCH_REC) >> 8; } |