forked from clearlinux-pkgs/linux-iot-lts2018
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0014-cbc-Avoid-rx-sequence-counter-mismatch-warnings.patch
73 lines (67 loc) · 2.27 KB
/
0014-cbc-Avoid-rx-sequence-counter-mismatch-warnings.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From a01378510b915827720ad92ea90ae35f681766c5 Mon Sep 17 00:00:00 2001
From: "G Jaya Kumaran, Vineetha" <[email protected]>
Date: Fri, 25 May 2018 14:24:11 +0800
Subject: [PATCH 2/3] cbc: Avoid rx sequence counter mismatch warnings
The receive sequence counter should only be incremented
if the checksum passes, to avoid unnecessary spawning
of receive sequence mismatch warnings.
Change-Id: I8a595dd9365693e257e6f621c4ef26f0834488b9
Signed-off-by: G Jaya Kumaran, Vineetha
---
drivers/tty/cbc/cbc_link_layer.c | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/drivers/tty/cbc/cbc_link_layer.c b/drivers/tty/cbc/cbc_link_layer.c
index a55cd8ce7add..bd747aac250f 100644
--- a/drivers/tty/cbc/cbc_link_layer.c
+++ b/drivers/tty/cbc/cbc_link_layer.c
@@ -264,7 +264,8 @@ u8 cbc_core_on_receive_cbc_serial_data(u8 length, const u8 *rx_buf)
return number_of_bytes_accepted;
}
-static void _cbc_link_layer_checksum(u8 *rx_cvh_frame, u8 frame_length)
+static void _cbc_link_layer_checksum(u8 *rx_cvh_frame, u8 frame_length,
+ struct cbc_buffer *buffer)
{
u8 expected_checksum = 0U;
u8 checksum = 0U;
@@ -302,6 +303,17 @@ static void _cbc_link_layer_checksum(u8 *rx_cvh_frame, u8 frame_length)
rx_cvh_frame[1]
& CBC_SEQUENCE_COUNTER_WIDTH_MASK;
}
+
+ /* Increment seq. counter. */
+ rx_sequence_counter++;
+ rx_sequence_counter &=
+ CBC_SEQUENCE_COUNTER_WIDTH_MASK;
+
+ /* Forward frame to Mux. layer. */
+ buffer->frame_length = frame_length;
+ cbc_mux_multiplexer_process_rx_buffer(buffer);
+ cbc_link_release_rx_data(frame_length);
+ last_rx_frame_valid = 1;
}
}
@@ -361,21 +373,7 @@ void cbc_link_layer_rx_handler(void)
} else if (bytes_avail >= frame_length) {
/* ok */
_cbc_link_layer_checksum(rx_cvh_frame,
- frame_length);
-
- /* Increment seq. counter. */
- rx_sequence_counter++;
- rx_sequence_counter &=
- CBC_SEQUENCE_COUNTER_WIDTH_MASK;
-
- /* Forward frame to Mux. layer. */
- buffer->frame_length = frame_length;
- cbc_mux_multiplexer_process_rx_buffer(
- buffer);
- cbc_link_release_rx_data(frame_length);
-
- last_rx_frame_valid = 1;
- /* else */
+ frame_length, buffer);
number_of_bytes_expected = 0;
} else {
/*
--
2.19.1