From 258d510bf0d298d32de4565e223c58bdc3b1a5f5 Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Mon, 16 Dec 2013 08:54:13 +0100 Subject: [PATCH 1/1] sllin: Add LIN ID to timeout frame Signed-off-by: Alexander Stein --- sllin/sllin.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sllin/sllin.c b/sllin/sllin.c index c922b84..61c8134 100644 --- a/sllin/sllin.c +++ b/sllin/sllin.c @@ -517,6 +517,9 @@ static void sllin_master_receive_buf(struct tty_struct *tty, */ static void sllin_report_error(struct sllin *sl, int err) { + unsigned char *lin_buff; + int lin_id; + switch (err) { case LIN_ERR_CHECKSUM: sl->dev->stats.rx_crc_errors++; @@ -531,7 +534,9 @@ static void sllin_report_error(struct sllin *sl, int err) break; } - sllin_send_canfr(sl, 0 | CAN_EFF_FLAG | + lin_buff = (sl->lin_master) ? sl->tx_buff : sl->rx_buff; + lin_id = lin_buff[SLLIN_BUFF_ID] & LIN_ID_MASK; + sllin_send_canfr(sl, lin_id | CAN_EFF_FLAG | (err & ~LIN_ID_MASK), NULL, 0); } -- 2.39.2