diff options
author | xiaojin <jin.xiao@intel.com> | 2012-08-13 13:43:15 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-07 08:39:34 -0700 |
commit | 4cac0c9a7374d8e5456093b5ca8800d8dd362973 (patch) | |
tree | d4376183f72153b34620fa510afbf2633ecc0fc5 /drivers/tty | |
parent | 9155bc2acdd5b7c11dee00dc9b792b89ca181d61 (diff) | |
download | linux-stable-4cac0c9a7374d8e5456093b5ca8800d8dd362973.tar.gz linux-stable-4cac0c9a7374d8e5456093b5ca8800d8dd362973.tar.bz2 linux-stable-4cac0c9a7374d8e5456093b5ca8800d8dd362973.zip |
n_gsm.c: Implement 3GPP27.010 DLC start-up procedure in MUX
commit 7e8ac7b23b67416700dfb8b4136a4e81ce675b48 upstream.
In 3GPP27.010 5.8.1, it defined:
The TE multiplexer initiates the establishment of the multiplexer control channel by sending a SABM frame on DLCI 0 using the procedures of clause 5.4.1.
Once the multiplexer channel is established other DLCs may be established using the procedures of clause 5.4.1.
This patch implement 5.8.1 in MUX level, it make sure DLC0 is the first channel to be setup.
[or for those not familiar with the specification: it was possible to try
and open a data connection while the control channel was not yet fully
open, which is a spec violation and confuses some modems]
Signed-off-by: xiaojin <jin.xiao@intel.com>
Tested-by: Yin, Fengwei <fengwei.yin@intel.com>
[tweaked the order we check things and error code]
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/n_gsm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index c43b683b6eb8..0a73b59f797d 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2889,6 +2889,10 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp) gsm = gsm_mux[mux]; if (gsm->dead) return -EL2HLT; + /* If DLCI 0 is not yet fully open return an error. This is ok from a locking + perspective as we don't have to worry about this if DLCI0 is lost */ + if (gsm->dlci[0] && gsm->dlci[0]->state != DLCI_OPEN) + return -EL2NSYNC; dlci = gsm->dlci[line]; if (dlci == NULL) dlci = gsm_dlci_alloc(gsm, line); |