summaryrefslogtreecommitdiffstats
path: root/src/host
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2010-10-23 20:47:26 +0200
committerroot <root@laptop.jolly.ten>2010-10-24 12:14:47 +0000
commitece1463f6f4041509a1c8fda827db3b14acc47c1 (patch)
treeb85b020cfe030329d117a20cc0a54bb3cef5b629 /src/host
parentff37a753e3eb78c5c969fa02b181d1256c2bbaeb (diff)
layer23/lapdm: Properly handle S frame with F=1 when in timer recovery
This is the signal to exit recovery mode ! See GSM 04.06 Section 5.5.7 Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'src/host')
-rw-r--r--src/host/layer23/src/common/lapdm.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/host/layer23/src/common/lapdm.c b/src/host/layer23/src/common/lapdm.c
index b1c0d404..f3eed52d 100644
--- a/src/host/layer23/src/common/lapdm.c
+++ b/src/host/layer23/src/common/lapdm.c
@@ -1078,11 +1078,17 @@ static int lapdm_rx_s(struct msgb *msg, struct lapdm_msg_ctx *mctx)
rsl_rll_error(RLL_CAUSE_SFRM_INC_PARAM, mctx);
return -EIO;
}
- /* 5.4.2.2: Inidcate error on supervisory reponse F=1 */
+
if (LAPDm_ADDR_CR(mctx->addr) == CR_BS2MS_RESP
&& LAPDm_CTRL_PF_BIT(mctx->ctrl)) {
- LOGP(DLAPDM, LOGL_NOTICE, "S frame response with F=1 error\n");
- rsl_rll_error(RLL_CAUSE_UNSOL_SPRV_RESP, mctx);
+ if (dl->state != LAPDm_STATE_TIMER_RECOV) {
+ /* 5.4.2.2: Inidcate error on supervisory reponse F=1 */
+ LOGP(DLAPDM, LOGL_NOTICE, "S frame response with F=1 error\n");
+ rsl_rll_error(RLL_CAUSE_UNSOL_SPRV_RESP, mctx);
+ } else {
+ /* 5.5.7: Exit Timer Recovery */
+ lapdm_dl_newstate(dl, LAPDm_STATE_MF_EST);
+ }
}
switch (dl->state) {