[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1629461872-26965-4-git-send-email-zhenguo6858@gmail.com>
Date: Fri, 20 Aug 2021 20:17:48 +0800
From: Zhenguo Zhao <zhenguo6858@...il.com>
To: nianfu.bai@...soc.com, gregkh@...uxfoundation.org,
jirislaby@...nel.org
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH 4/8] tty: n_gsm: Modify CR,PF bit printk info when config requester
From: Zhenguo Zhao <Zhenguo.Zhao1@...soc.com>
When n_gsm config "initiator=0",as requester,gsmld receives dlci SABM/DISC
control command frame,UA frame printk info is error.
Example:
Gsmld send UA frame "f9 03 73 01 d7 f9",but CR,PF bit printk info
looks like error.
Kernel test log as follows:
Before modify
[ 78.837626] c0 gsmld_receive: 00000000: f9 03 3f 01 1c f9
[ 78.846356] c0 <-- 0) C: SABM(P)
[ 78.854021] c0 gsmld_output: 00000000: f9 03 73 01 d7 f9
[ 78.862574] c0 --> 0) C: UA(P)
After modify
[ 261.233188] c0 gsmld_receive: 00000000: f9 03 3f 01 1c f9
[ 261.242767] c0 <-- 0) C: SABM(P)
[ 261.250497] c0 gsmld_output: 00000000: f9 03 73 01 d7 f9
[ 261.259759] c0 --> 0) R: UA(F)
Signed-off-by: Zhenguo Zhao <Zhenguo.Zhao1@...soc.com>
---
drivers/tty/n_gsm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 7aa10de..e3e1be3 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -587,6 +587,10 @@ static void gsm_send(struct gsm_mux *gsm, int addr, int cr, int control)
return;
}
gsmld_output(gsm, cbuf, len);
+ if (!gsm->initiator) {
+ cr = cr & gsm->initiator;
+ control = control & ~PF;
+ }
gsm_print_packet("-->", addr, cr, control, NULL, 0);
}
--
1.9.1
Powered by blists - more mailing lists