Skip to content

Commit

Permalink
tty: n_gsm: delete DISC command frame as requester
Browse files Browse the repository at this point in the history
as initiator,it need to send DISC conmmand ,as requester,there is
no need to send the DISC control frame,it will cause redundant data.

Signed-off-by: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com>
  • Loading branch information
Zhenguo Zhao authored and intel-lab-lkp committed Jul 1, 2021
1 parent 15279eb commit 0ac8d1e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/tty/n_gsm.c
Expand Up @@ -2050,7 +2050,8 @@ static int gsm_disconnect(struct gsm_mux *gsm)
del_timer_sync(&gsm->t2_timer);
/* Now we are sure T2 has stopped */

gsm_dlci_begin_close(dlci);
if (gsm->initiator)
gsm_dlci_begin_close(dlci);
wait_event_interruptible(gsm->event,
dlci->state == DLCI_CLOSED);

Expand Down Expand Up @@ -3027,7 +3028,8 @@ static void gsmtty_close(struct tty_struct *tty, struct file *filp)
mutex_unlock(&dlci->mutex);
if (tty_port_close_start(&dlci->port, tty, filp) == 0)
return;
gsm_dlci_begin_close(dlci);
if (gsm->initiator)
gsm_dlci_begin_close(dlci);
if (tty_port_initialized(&dlci->port) && C_HUPCL(tty))
tty_port_lower_dtr_rts(&dlci->port);
tty_port_close_end(&dlci->port, tty);
Expand All @@ -3041,7 +3043,8 @@ static void gsmtty_hangup(struct tty_struct *tty)
if (dlci->state == DLCI_CLOSED)
return;
tty_port_hangup(&dlci->port);
gsm_dlci_begin_close(dlci);
if (gsm->initiator)
gsm_dlci_begin_close(dlci);
}

static int gsmtty_write(struct tty_struct *tty, const unsigned char *buf,
Expand Down

0 comments on commit 0ac8d1e

Please sign in to comment.