]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.4.182/tty-n_gsm-fix-encoding-of-control-signal-octet-bit-dv.patch
Drop nfc patches from older trees
[thirdparty/kernel/stable-queue.git] / releases / 5.4.182 / tty-n_gsm-fix-encoding-of-control-signal-octet-bit-dv.patch
1 From 737b0ef3be6b319d6c1fd64193d1603311969326 Mon Sep 17 00:00:00 2001
2 From: "daniel.starke@siemens.com" <daniel.starke@siemens.com>
3 Date: Thu, 17 Feb 2022 23:31:17 -0800
4 Subject: tty: n_gsm: fix encoding of control signal octet bit DV
5
6 From: daniel.starke@siemens.com <daniel.starke@siemens.com>
7
8 commit 737b0ef3be6b319d6c1fd64193d1603311969326 upstream.
9
10 n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010.
11 See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516
12 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to
13 the newer 27.010 here. Chapter 5.4.6.3.7 describes the encoding of the
14 control signal octet used by the MSC (modem status command). The same
15 encoding is also used in convergence layer type 2 as described in chapter
16 5.5.2. Table 7 and 24 both require the DV (data valid) bit to be set 1 for
17 outgoing control signal octets sent by the DTE (data terminal equipment),
18 i.e. for the initiator side.
19 Currently, the DV bit is only set if CD (carrier detect) is on, regardless
20 of the side.
21
22 This patch fixes this behavior by setting the DV bit on the initiator side
23 unconditionally.
24
25 Fixes: e1eaea46bb40 ("tty: n_gsm line discipline")
26 Cc: stable@vger.kernel.org
27 Signed-off-by: Daniel Starke <daniel.starke@siemens.com>
28 Link: https://lore.kernel.org/r/20220218073123.2121-1-daniel.starke@siemens.com
29 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
30 ---
31 drivers/tty/n_gsm.c | 2 +-
32 1 file changed, 1 insertion(+), 1 deletion(-)
33
34 --- a/drivers/tty/n_gsm.c
35 +++ b/drivers/tty/n_gsm.c
36 @@ -428,7 +428,7 @@ static u8 gsm_encode_modem(const struct
37 modembits |= MDM_RTR;
38 if (dlci->modem_tx & TIOCM_RI)
39 modembits |= MDM_IC;
40 - if (dlci->modem_tx & TIOCM_CD)
41 + if (dlci->modem_tx & TIOCM_CD || dlci->gsm->initiator)
42 modembits |= MDM_DV;
43 return modembits;
44 }