From 45653655d66c6631a7993781ae87d521cbff9e56 Mon Sep 17 00:00:00 2001 From: Tomas Tvaroha Date: Fri, 19 Aug 2016 11:21:52 +0200 Subject: [PATCH] sllin: add single-response flag --- sllin/linux/lin_bus.h | 1 + sllin/sllin.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/sllin/linux/lin_bus.h b/sllin/linux/lin_bus.h index dbd9a78..151d18f 100644 --- a/sllin/linux/lin_bus.h +++ b/sllin/linux/lin_bus.h @@ -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 */ diff --git a/sllin/sllin.c b/sllin/sllin.c index 908cce9..1febab2 100644 --- a/sllin/sllin.c +++ b/sllin/sllin.c @@ -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; -- 2.39.2