]> rtime.felk.cvut.cz Git - linux-lin.git/commitdiff
sllin: dlc in cache > 0 is the expected LIN frame length
authorAlexander Stein <alexander.stein@systec-electronic.com>
Mon, 16 Dec 2013 07:54:09 +0000 (08:54 +0100)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Thu, 16 Jan 2014 23:51:12 +0000 (00:51 +0100)
A cache entry should not be set to LIN_CACHE_RESPONSE if there is nothing
to reply from this node. A dlc set > 0 configures the expected length.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
sllin/sllin.c

index 487b72ad337d2c64a411c60710889f8c2dac63d8..c5e174949d831c7ed125c501ca50311c91257cea 100644 (file)
@@ -768,7 +768,7 @@ static void sllin_slave_receive_buf(struct tty_struct *tty,
 
                        sl->lin_state = SLSTATE_ID_RECEIVED;
                        /* Is the length of data set in frame cache? */
 
                        sl->lin_state = SLSTATE_ID_RECEIVED;
                        /* Is the length of data set in frame cache? */
-                       if (sce->frame_fl & LIN_CACHE_RESPONSE) {
+                       if (sce->dlc > 0) {
                                sl->rx_expect += sce->dlc + 1; /* + checksum */
                                sl->rx_len_unknown = false;
                                set_bit(SLF_MSGEVENT, &sl->flags);
                                sl->rx_expect += sce->dlc + 1; /* + checksum */
                                sl->rx_len_unknown = false;
                                set_bit(SLF_MSGEVENT, &sl->flags);