summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorZhenguo Zhao <Zhenguo.Zhao1@unisoc.com>2021-08-20 15:17:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-21 16:16:06 +0300
commit9e38020f17009c53b0f28347ec06102929b8962c (patch)
treeac9eeb7d811cc1417cd6c6a120a73acb94d4bb16 /drivers
parentd94a552183c0fde0c65ebdf5ed74bd9fb1dc55c4 (diff)
downloadlinux-9e38020f17009c53b0f28347ec06102929b8962c.tar.xz
tty: n_gsm: Delete gsmtty open SABM frame when config requester
[ Upstream commit cbff2b32516881bef30bbebf413d1b49495bab1d ] When n_gsm config "initiator=0",as requester ,it doesn't need to send SABM frame data during gsmtty open. Example,when gsmtty open,it will send SABM frame.for initiator,it maybe not want to receive the frame. [ 88.410426] c1 gsmld_output: 00000000: f9 07 3f 01 de f9 [ 88.420839] c1 --> 1) R: SABM(F) Signed-off-by: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com> Link: https://lore.kernel.org/r/1629461872-26965-6-git-send-email-zhenguo6858@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/n_gsm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index b05b7862778c..405b55bceba8 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -3024,6 +3024,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
{
struct gsm_dlci *dlci = tty->driver_data;
struct tty_port *port = &dlci->port;
+ struct gsm_mux *gsm = dlci->gsm;
port->count++;
tty_port_tty_set(port, tty);
@@ -3033,7 +3034,8 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
a DM straight back. This is ok as that will have caused a hangup */
tty_port_set_initialized(port, 1);
/* Start sending off SABM messages */
- gsm_dlci_begin_open(dlci);
+ if (gsm->initiator)
+ gsm_dlci_begin_open(dlci);
/* And wait for virtual carrier */
return tty_port_block_til_ready(port, tty, filp);
}