]> rtime.felk.cvut.cz Git - linux-lin.git/blobdiff - sllin/sllin.c
sllin: dlc in cache > 0 is the expected LIN frame length
[linux-lin.git] / sllin / sllin.c
index e05564cf33598d7839ece2a71c0b68cc1a0bc803..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? */
-                       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);
@@ -1216,7 +1216,7 @@ slstate_response_wait:
                                tx_bytes = lin_dlc;
 
                                mode = SLLIN_STPMSG_RESPONLY;
-                               if (sl->rx_buff[SLLIN_BUFF_ID] & LIN_CHECKSUM_EXTENDED)
+                               if (sce->frame_fl & LIN_CHECKSUM_EXTENDED)
                                        mode |= SLLIN_STPMSG_CHCKSUM_ENH;
 
                                if (sllin_setup_msg(sl, mode, lin_id & LIN_ID_MASK,