]> rtime.felk.cvut.cz Git - linux-lin.git/commitdiff
sllin: Evaluate message upon break only if received at least a LIN ID
authorAlexander Stein <alexander.stein@systec-electronic.com>
Mon, 16 Dec 2013 07:54:14 +0000 (08:54 +0100)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Thu, 16 Jan 2014 23:51:39 +0000 (00:51 +0100)
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
sllin/sllin.c

index 61c81348faa9a8e95a18db04b8c3f82c4e879815..8d7ad6975ab08873245b423bd826552db438cae4 100644 (file)
@@ -716,10 +716,12 @@ static void sllin_slave_receive_buf(struct tty_struct *tty,
                if (fp && *fp++) {
                        /*
                         * If we don't know the length of the current message
                if (fp && *fp++) {
                        /*
                         * If we don't know the length of the current message
-                        * we received the break of the next message.
-                        * Evaluate the previous one before continuing
+                        * and received at least the LIN ID, we received here
+                        * the break of the next message.
+                        * Evaluate the previous one before continuing.
                         */
                         */
-                       if (sl->rx_len_unknown == true)
+                       if ((sl->rx_len_unknown == true) &&
+                               (sl->rx_cnt >= SLLIN_BUFF_ID))
                        {
                                hrtimer_cancel(&sl->rx_timer);
                                sllin_slave_finish_rx_msg(sl);
                        {
                                hrtimer_cancel(&sl->rx_timer);
                                sllin_slave_finish_rx_msg(sl);