lkml.org 
[lkml]   [2021]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] tty: n_gsm: delete CLD command frame as requester
Date
From: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com>

as initiator,it may be send CLD conmmand ,as requester,there is
no need to send the CLD control frame,it will cause redundant data.

Signed-off-by: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com>
---
drivers/tty/n_gsm.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 5fea02c..eecbc76 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2043,9 +2043,11 @@ static int gsm_disconnect(struct gsm_mux *gsm)

/* In theory disconnecting DLCI 0 is sufficient but for some
modems this is apparently not the case. */
- gc = gsm_control_send(gsm, CMD_CLD, NULL, 0);
- if (gc)
- gsm_control_wait(gsm, gc);
+ if (gsm->initiator) {
+ 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 */
--
1.9.1
\
 
 \ /
  Last update: 2021-07-01 07:59    [W:0.124 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site