sllin: Fix checksum mode decision
authorAlexander Stein <alexander.stein@systec-electronic.com>
Mon, 16 Dec 2013 07:54:08 +0000 (08:54 +0100)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Thu, 16 Jan 2014 23:51:07 +0000 (00:51 +0100)
rx_buff[SLLIN_BUFF_ID] only holds LIN ID + parity bits, but never internal
bits like LIN_CHECKSUM_EXTENDED.
Use correct value from internal cache entry.

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

index e05564c..487b72a 100644 (file)
@@ -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,