Skip to content

Commit 42ec0b9

Browse files
dstarke-siemensgregkh
authored andcommitted
tty: n_gsm: add RING/CD control support
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@siemens.com> Link: https://lore.kernel.org/r/20230206114606.2133-3-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9bd6dcb commit 42ec0b9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/tty/n_gsm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,11 @@ static u8 gsm_encode_modem(const struct gsm_dlci *dlci)
540540
modembits |= MDM_IC;
541541
if (dlci->modem_tx & TIOCM_CD || dlci->gsm->initiator)
542542
modembits |= MDM_DV;
543+
/* special mappings for passive side to operate as UE */
544+
if (dlci->modem_tx & TIOCM_OUT1)
545+
modembits |= MDM_IC;
546+
if (dlci->modem_tx & TIOCM_OUT2)
547+
modembits |= MDM_DV;
543548
return modembits;
544549
}
545550

0 commit comments

Comments
 (0)