diff options
author | Alan Cox <alan@linux.intel.com> | 2011-08-26 06:28:11 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-26 14:01:14 -0400 |
commit | f17141fdd407de78379222dd59d6f161437db4c8 (patch) | |
tree | 109e62b0085f745f9dd0710b1d746ace2ada53b5 /drivers/tty | |
parent | a4c9fe8daf88b27f81be8022d49c073d37fe645e (diff) |
n_gsm: Send CLD command on exit
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>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/n_gsm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index ed429082304d..8d7766bfef87 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c | |||
@@ -2003,6 +2003,7 @@ void gsm_cleanup_mux(struct gsm_mux *gsm) | |||
2003 | int i; | 2003 | int i; |
2004 | struct gsm_dlci *dlci = gsm->dlci[0]; | 2004 | struct gsm_dlci *dlci = gsm->dlci[0]; |
2005 | struct gsm_msg *txq; | 2005 | struct gsm_msg *txq; |
2006 | struct gsm_control *gc; | ||
2006 | 2007 | ||
2007 | gsm->dead = 1; | 2008 | gsm->dead = 1; |
2008 | 2009 | ||
@@ -2016,6 +2017,13 @@ void gsm_cleanup_mux(struct gsm_mux *gsm) | |||
2016 | spin_unlock(&gsm_mux_lock); | 2017 | spin_unlock(&gsm_mux_lock); |
2017 | WARN_ON(i == MAX_MUX); | 2018 | WARN_ON(i == MAX_MUX); |
2018 | 2019 | ||
2020 | /* In theory disconnecting DLCI 0 is sufficient but for some | ||
2021 | modems this is apparently not the case. */ | ||
2022 | if (dlci) { | ||
2023 | gc = gsm_control_send(gsm, CMD_CLD, NULL, 0); | ||
2024 | if (gc) | ||
2025 | gsm_control_wait(gsm, gc); | ||
2026 | } | ||
2019 | del_timer_sync(&gsm->t2_timer); | 2027 | del_timer_sync(&gsm->t2_timer); |
2020 | /* Now we are sure T2 has stopped */ | 2028 | /* Now we are sure T2 has stopped */ |
2021 | if (dlci) { | 2029 | if (dlci) { |