[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230203145023.6012-3-daniel.starke@siemens.com>
Date: Fri, 3 Feb 2023 15:50:22 +0100
From: "D. Starke" <daniel.starke@...mens.com>
To: linux-serial@...r.kernel.org, gregkh@...uxfoundation.org,
jirislaby@...nel.org, ilpo.jarvinen@...ux.intel.com
Cc: linux-kernel@...r.kernel.org,
Daniel Starke <daniel.starke@...mens.com>
Subject: [PATCH v3 3/4] tty: n_gsm: add RING/CD control support
From: Daniel Starke <daniel.starke@...mens.com>
The status lines ring and carrier detect are used by the modem to signal
incoming calls (RING) or an established connection (CD). This is
implemented as physical lines on a standard RS232 connection. However,
the muxer protocol encodes these status lines as modem bits IC and DV.
These incoming lines are masked by tty driver (see tty_io.c) and cannot be
set by a user application.
Allow setting RING via TIOCM_OUT1 and CD via TIOCM_OUT2 to allow
implementation of a modem or modem emulator.
Signed-off-by: Daniel Starke <daniel.starke@...mens.com>
---
drivers/tty/n_gsm.c | 5 +++++
1 file changed, 5 insertions(+)
v2 -> v3:
No changes.
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index d068df1cf2fd..cf1ab7d619d9 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -546,6 +546,11 @@ static u8 gsm_encode_modem(const struct gsm_dlci *dlci)
modembits |= MDM_IC;
if (dlci->modem_tx & TIOCM_CD || dlci->gsm->initiator)
modembits |= MDM_DV;
+ /* special mappings for passive side to operate as UE */
+ if (dlci->modem_tx & TIOCM_OUT1)
+ modembits |= MDM_IC;
+ if (dlci->modem_tx & TIOCM_OUT2)
+ modembits |= MDM_DV;
return modembits;
}
--
2.34.1
Powered by blists - more mailing lists