Skip to content

Commit 4847380

Browse files
dstarke-siemensgregkh
authored andcommitted
tty: n_gsm: fix missing update of modem controls after DLCI open
Currently the peer is not informed about the initial state of the modem control lines after a new DLCI has been opened. Fix this by sending the initial modem control line states after DLCI open. Fixes: e1eaea4 ("tty: n_gsm line discipline") Cc: [email protected] Signed-off-by: Daniel Starke <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent cc994bb commit 4847380

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/tty/n_gsm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ static const u8 gsm_fcs8[256] = {
370370
#define GOOD_FCS 0xCF
371371

372372
static int gsmld_output(struct gsm_mux *gsm, u8 *data, int len);
373+
static int gsmtty_modem_update(struct gsm_dlci *dlci, u8 brk);
373374

374375
/**
375376
* gsm_fcs_add - update FCS
@@ -1483,6 +1484,9 @@ static void gsm_dlci_open(struct gsm_dlci *dlci)
14831484
pr_debug("DLCI %d goes open.\n", dlci->addr);
14841485
/* Register gsmtty driver,report gsmtty dev add uevent for user */
14851486
tty_register_device(gsm_tty_driver, dlci->addr, NULL);
1487+
/* Send current modem state */
1488+
if (dlci->addr)
1489+
gsmtty_modem_update(dlci, 0);
14861490
wake_up(&dlci->gsm->event);
14871491
}
14881492

0 commit comments

Comments
 (0)