Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-07-10 15:34:49 +0200
committerTakashi Iwai <tiwai@suse.de>2018-07-10 15:44:10 +0200
commit32baffe398cf3a7a735714140b03844089c58289 (patch)
treed4f5de993a6fd657e7b2dff212910e7b71de7d02
parentdb8b623fb7c277e8f0fe85b12770127045170a39 (diff)
tty: n_gsm: Fix DLCI handling for ADM mode if debug & 2 is
not set (bsc#1051510). suse-commit: 136e568e7b267908ce59b2d2813b216d255b955c
-rw-r--r--drivers/tty/n_gsm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 5a23c2c67d8c..c00f5263bdef 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2858,11 +2858,22 @@ static int gsmtty_modem_update(struct gsm_dlci *dlci, u8 brk)
static int gsm_carrier_raised(struct tty_port *port)
{
struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port);
+ struct gsm_mux *gsm = dlci->gsm;
+
/* Not yet open so no carrier info */
if (dlci->state != DLCI_OPEN)
return 0;
if (debug & 2)
return 1;
+
+ /*
+ * Basic mode with control channel in ADM mode may not respond
+ * to CMD_MSC at all and modem_rx is empty.
+ */
+ if (gsm->encoding == 0 && gsm->dlci[0]->mode == DLCI_MODE_ADM &&
+ !dlci->modem_rx)
+ return 1;
+
return dlci->modem_rx & TIOCM_CD;
}