All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]        tty: n_gsm: Fix CR bit value when initiator=0
@ 2021-06-16  2:56 Zhenguo Zhao
  2021-06-16  6:19 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Zhenguo Zhao @ 2021-06-16  2:56 UTC (permalink / raw)
  To: zhenguo6858, gregkh, jirislaby; +Cc: linux-kernel

From: Zhenguo Zhao <zhenguo.zhao1@unisoc.com>

	When set initiator=0,switch to Responder,gsmld received dlci SABM/DISC
	frame,CR bit should be 0 by calculation.

	receive DLC0 SABM CMD:
	[69.740263] c1 gsmld_receive: 00000000: f9 03 3f 01 1c f9
	[69.893247] c1 gsm_queue cr:1
	[69.897629] c1 <-- 0) C: SABM(P)
	[69.907516] c1 gsm_queue cr:0

Signed-off-by: Zhenguo Zhao <zhenguo.zhao1@unisoc.com>
---
 drivers/tty/n_gsm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 5fea02c..becca2c 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -1779,7 +1779,7 @@ static void gsm_queue(struct gsm_mux *gsm)
 
 	switch (gsm->control) {
 	case SABM|PF:
-		if (cr == 0)
+		if (cr == 1)
 			goto invalid;
 		if (dlci == NULL)
 			dlci = gsm_dlci_alloc(gsm, address);
@@ -1793,7 +1793,7 @@ static void gsm_queue(struct gsm_mux *gsm)
 		}
 		break;
 	case DISC|PF:
-		if (cr == 0)
+		if (cr == 1)
 			goto invalid;
 		if (dlci == NULL || dlci->state == DLCI_CLOSED) {
 			gsm_response(gsm, address, DM);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-16  8:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16  2:56 [PATCH] tty: n_gsm: Fix CR bit value when initiator=0 Zhenguo Zhao
2021-06-16  6:19 ` Greg KH
2021-06-16  7:29   ` 赵振国
2021-06-16  7:39     ` Greg KH
2021-06-16  7:45       ` Jiri Slaby
2021-06-16  8:01         ` 赵振国

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.