sllin: add single-response flag
authorTomas Tvaroha <tomas.tvaroha@e4t.cz>
Fri, 19 Aug 2016 09:21:52 +0000 (11:21 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Mon, 20 Mar 2017 08:58:43 +0000 (09:58 +0100)
sllin/linux/lin_bus.h
sllin/sllin.c

index dbd9a78..151d18f 100644 (file)
@@ -11,6 +11,7 @@
 
 #define LIN_CACHE_RESPONSE     (1 << (LIN_CANFR_FLAGS_OFFS))
 #define LIN_CHECKSUM_EXTENDED  (1 << (LIN_CANFR_FLAGS_OFFS + 1))
+#define LIN_SINGLE_RESPONSE (1 << (LIN_CANFR_FLAGS_OFFS + 2))
 
 
 /* Error flags */
index 908cce9..1febab2 100644 (file)
@@ -1106,6 +1106,9 @@ static int sllin_kwthread(void *ptr)
                                if ((sce->frame_fl & LIN_CACHE_RESPONSE)
                                        && (sce->dlc > 0)) {
 
+                                       if (sce->frame_fl & LIN_SINGLE_RESPONSE)
+                                               sce->frame_fl &= ~LIN_CACHE_RESPONSE;
+
                                        netdev_dbg(sl->dev, "Sending LIN response from linfr_cache\n");
 
                                        lin_data = sce->data;
@@ -1256,6 +1259,9 @@ slstate_response_wait:
                        if ((sce->frame_fl & LIN_CACHE_RESPONSE)
                                        && (sce->dlc > 0)) {
 
+                               if (sce->frame_fl & LIN_SINGLE_RESPONSE)
+                                       sce->frame_fl &= ~LIN_CACHE_RESPONSE;
+
                                netdev_dbg(sl->dev, "Sending LIN response from linfr_cache\n");
 
                                lin_data = sce->data;