Skip to content

Commit cbff2b3

Browse files
Zhenguo Zhaogregkh
authored andcommitted
tty: n_gsm: Delete gsmtty open SABM frame when config requester
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 509067b commit cbff2b3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/tty/n_gsm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3004,6 +3004,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
30043004
{
30053005
struct gsm_dlci *dlci = tty->driver_data;
30063006
struct tty_port *port = &dlci->port;
3007+
struct gsm_mux *gsm = dlci->gsm;
30073008

30083009
port->count++;
30093010
tty_port_tty_set(port, tty);
@@ -3013,7 +3014,8 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
30133014
a DM straight back. This is ok as that will have caused a hangup */
30143015
tty_port_set_initialized(port, 1);
30153016
/* Start sending off SABM messages */
3016-
gsm_dlci_begin_open(dlci);
3017+
if (gsm->initiator)
3018+
gsm_dlci_begin_open(dlci);
30173019
/* And wait for virtual carrier */
30183020
return tty_port_block_til_ready(port, tty, filp);
30193021
}

0 commit comments

Comments
 (0)