Skip to content

Commit

Permalink
n_gsm: Send CLD command on exit
Browse files Browse the repository at this point in the history
A DISC on DLCI 0 should close down the mux but Michael Lauer reports this
is not the case for some modems. Send a CLD as well.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Tested-by: Michael Lauer
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Aug 26, 2011
1 parent a4c9fe8 commit f17141f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/tty/n_gsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2003,6 +2003,7 @@ void gsm_cleanup_mux(struct gsm_mux *gsm)
int i;
struct gsm_dlci *dlci = gsm->dlci[0];
struct gsm_msg *txq;
struct gsm_control *gc;

gsm->dead = 1;

Expand All @@ -2016,6 +2017,13 @@ void gsm_cleanup_mux(struct gsm_mux *gsm)
spin_unlock(&gsm_mux_lock);
WARN_ON(i == MAX_MUX);

/* In theory disconnecting DLCI 0 is sufficient but for some
modems this is apparently not the case. */
if (dlci) {
gc = gsm_control_send(gsm, CMD_CLD, NULL, 0);
if (gc)
gsm_control_wait(gsm, gc);
}
del_timer_sync(&gsm->t2_timer);
/* Now we are sure T2 has stopped */
if (dlci) {
Expand Down

0 comments on commit f17141f

Please sign in to comment.