All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] tty: n_gsm: fix encoding of control signal octet bit DV
@ 2022-02-18  7:31 daniel.starke
  2022-02-18  7:31 ` [PATCH 2/7] tty: n_gsm: fix encoding of command/response bit daniel.starke
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: daniel.starke @ 2022-02-18  7:31 UTC (permalink / raw)
  To: linux-serial, gregkh, jirislaby; +Cc: linux-kernel, Daniel Starke

n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010.
See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516
The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to
the newer 27.010 here. Chapter 5.4.6.3.7 describes the encoding of the
control signal octet used by the MSC (modem status command). The same
encoding is also used in convergence layer type 2 as described in chapter
5.5.2. Table 7 and 24 both require the DV (data valid) bit to be set 1 for
outgoing control signal octets sent by the DTE (data terminal equipment),
i.e. for the initiator side.
Currently, the DV bit is only set if CD (carrier detect) is on, regardless
of the side.

This patch fixes this behavior by setting the DV bit on the initiator side
unconditionally.

Fixes: e1eaea46bb40 ("tty: n_gsm line discipline")
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Starke <daniel.starke@siemens.com>
---
 drivers/tty/n_gsm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 0b1808e3a912..e199315a158e 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -439,7 +439,7 @@ static u8 gsm_encode_modem(const struct gsm_dlci *dlci)
 		modembits |= MDM_RTR;
 	if (dlci->modem_tx & TIOCM_RI)
 		modembits |= MDM_IC;
-	if (dlci->modem_tx & TIOCM_CD)
+	if (dlci->modem_tx & TIOCM_CD || dlci->gsm->initiator)
 		modembits |= MDM_DV;
 	return modembits;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-02-18  7:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-18  7:31 [PATCH 1/7] tty: n_gsm: fix encoding of control signal octet bit DV daniel.starke
2022-02-18  7:31 ` [PATCH 2/7] tty: n_gsm: fix encoding of command/response bit daniel.starke
2022-02-18  7:31 ` [PATCH 3/7] tty: n_gsm: fix proper link termination after failed open daniel.starke
2022-02-18  7:31 ` [PATCH 4/7] tty: n_gsm: fix NULL pointer access due to DLCI release daniel.starke
2022-02-18  7:31 ` [PATCH 5/7] tty: n_gsm: fix wrong tty control line for flow control daniel.starke
2022-02-18  7:31 ` [PATCH 6/7] tty: n_gsm: fix wrong modem processing in convergence layer type 2 daniel.starke
2022-02-18  7:31 ` [PATCH 7/7] tty: n_gsm: fix deadlock in gsmtty_open() daniel.starke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.