]> rtime.felk.cvut.cz Git - linux-lin.git/blobdiff - sllin/sllin.c
sllin: Add LIN ID to timeout frame
[linux-lin.git] / sllin / sllin.c
index ffbdf0133b65330f2876af45c418ad19d0b32283..61c81348faa9a8e95a18db04b8c3f82c4e879815 100644 (file)
@@ -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);
 }
 
@@ -1241,8 +1246,6 @@ slstate_response_wait:
                                        sllin_send_tx_buff(sl);
                                }
 
-                               kfree_skb(sl->tx_req_skb);
-                               netif_wake_queue(sl->dev);
                                hrtimer_start(&sl->rx_timer,
                                        ktime_add(ktime_get(), sl->rx_timer_timeout),
                                        HRTIMER_MODE_ABS);