Skip to content

Commit f999c3b

Browse files
Zhenguo Zhaogregkh
authored andcommitted
tty: n_gsm: Modify CR,PF bit printk info when config requester
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent cc0f421 commit f999c3b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/tty/n_gsm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,10 @@ static void gsm_send(struct gsm_mux *gsm, int addr, int cr, int control)
587587
return;
588588
}
589589
gsmld_output(gsm, cbuf, len);
590+
if (!gsm->initiator) {
591+
cr = cr & gsm->initiator;
592+
control = control & ~PF;
593+
}
590594
gsm_print_packet("-->", addr, cr, control, NULL, 0);
591595
}
592596

0 commit comments

Comments
 (0)