mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhenguo Zhao <zhenguo6858@gmail.com>
To: nianfu.bai@unisoc.com, gregkh@linuxfoundation.org, jirislaby@kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 5/8] tty: n_gsm: Delete gsm_disconnect when config requester
Date: Fri, 20 Aug 2021 20:17:49 +0800	[thread overview]
Message-ID: <1629461872-26965-5-git-send-email-zhenguo6858@gmail.com> (raw)
In-Reply-To: <1629461872-26965-1-git-send-email-zhenguo6858@gmail.com>

From: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com>

When n_gsm config "initiator=0",when gsmld config ,as requester ,it
doesn't need to send CLD frame data or SABM frame.

Example,when tty dev receive "AT+CMUX=0",it will change ldisc
n_tty to n_gsm,during config requester,gsmld output "7e 01 ef c3 aa 7e",
initiator maybe not want to receive the frame data.

[  154.666457] c1 Q>  0) R: UIH(F)
[  154.669514] c1 C3
[  154.671519] c1 gsmld_output: 00000000: 7e 01 ef c3 aa 7e
[  155.014874] c1 Q>  0) R: UIH(F)
[  155.018000] c1 C3
[  155.020046] c1 gsmld_output: 00000000: 7e 01 ef c3 aa 7e
[  155.364425] c1 Q>  0) R: UIH(F)
[  155.367546] c1 C3
[  155.369597] c1 gsmld_output: 00000000: 7e 01 ef c3 aa 7e

Signed-off-by: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com>
---
 drivers/tty/n_gsm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index e3e1be3..9ded99a 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2304,7 +2304,7 @@ static int gsm_config(struct gsm_mux *gsm, struct gsm_config *c)
 	 * configuration
 	 */
 
-	if (need_close || need_restart) {
+	if (gsm->initiator && (need_close || need_restart)) {
 		int ret;
 
 		ret = gsm_disconnect(gsm);
-- 
1.9.1


  parent reply	other threads:[~2021-08-20 12:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20 12:17 [PATCH 1/8] tty: n_gsm: Add some instructions and code for requester Zhenguo Zhao
2021-08-20 12:17 ` [PATCH 2/8] tty: n_gsm: Modify cr bit value when config requester Zhenguo Zhao
2021-08-20 12:17 ` [PATCH 3/8] tty: n_gsm: Modify CR,PF bit " Zhenguo Zhao
2021-08-20 12:17 ` [PATCH 4/8] tty: n_gsm: Modify CR,PF bit printk info " Zhenguo Zhao
2021-08-20 12:17 ` Zhenguo Zhao [this message]
2021-08-20 12:17 ` [PATCH 6/8] tty: n_gsm: Delete gsmtty open SABM frame " Zhenguo Zhao
2021-08-20 12:17 ` [PATCH 7/8] tty: n_gsm: Modify gsmtty driver register method " Zhenguo Zhao
2021-08-20 12:17 ` [PATCH 8/8] tty: n_gsm: Save dlci address open status " Zhenguo Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1629461872-26965-5-git-send-email-zhenguo6858@gmail.com \
    --to=zhenguo6858@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nianfu.bai@unisoc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®