lkml.org 
[lkml]   [2021]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] tty: n_gsm: CR bit value should be 0 when config "initiator=0"
Date
From: Zhenguo Zhao <zhenguo.zhao1@unisoc.com>

config "initiator=0",gsmld will receives dlci SABM/DISC control command
frame,as slaver,the CR bit value check should be 1.

if check "cr == 0",it will goto invalid,so it can't send UA response
frame and open slaver dlci.

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
\
 
 \ /
  Last update: 2021-06-16 13:54    [W:0.077 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site