diff options
Diffstat (limited to 'drivers/tty/n_gsm.c')
| -rw-r--r-- | drivers/tty/n_gsm.c | 10 | 
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 720160acd9d..a4c42a75a3b 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -1645,8 +1645,12 @@ static void gsm_queue(struct gsm_mux *gsm)  	if ((gsm->control & ~PF) == UI)  		gsm->fcs = gsm_fcs_add_block(gsm->fcs, gsm->buf, gsm->len); -	/* generate final CRC with received FCS */ -	gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->received_fcs); +	if (gsm->encoding == 0){ +		/* WARNING: gsm->received_fcs is used for gsm->encoding = 0 only. +		            In this case it contain the last piece of data +		            required to generate final CRC */ +		gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->received_fcs); +	}  	if (gsm->fcs != GOOD_FCS) {  		gsm->bad_fcs++;  		if (debug & 4) @@ -2110,7 +2114,7 @@ static int gsmld_attach_gsm(struct tty_struct *tty, struct gsm_mux *gsm)  /**   *	gsmld_detach_gsm	-	stop doing 0710 mux - *	@tty: tty atttached to the mux + *	@tty: tty attached to the mux   *	@gsm: mux   *   *	Shutdown and then clean up the resources used by the line discipline  |