diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-04-18 19:31:42 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-04-19 09:39:52 +0200 |
commit | 29e1fdd994e2ea8c8e7518cb1b979bb23ae23c8a (patch) | |
tree | f903c148e0c2de54d52d62ad08127c29c0039ba1 /src/osmo-bts-sysmo/oml.c | |
parent | af02387183acd5cd80d3183862c8a6a2ed8318d1 (diff) |
lchan: Deactivate the SACCH only once, use the sach_deact flag for that
Use the deact_sach (renamed to deact_sacch in master) to remember if the
SACCH has been disabled. This should fix the case of lchan errors due releasing
the lchan twice.
Diffstat (limited to 'src/osmo-bts-sysmo/oml.c')
-rw-r--r-- | src/osmo-bts-sysmo/oml.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index dba17275..30dbf20e 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -887,9 +887,18 @@ int lchan_deactivate(struct gsm_lchan *lchan) int i; for (i = s4l->num_sapis-1; i >= 0; i--) { - struct msgb *msg = l1p_msgb_alloc(); + struct msgb *msg; GsmL1_MphDeactivateReq_t *deact_req; + if (s4l->sapis[i].sapi == GsmL1_Sapi_Sacch && lchan->sach_deact) { + LOGP(DL1C, LOGL_INFO, "%s SACCH already deactivated.\n", + gsm_lchan_name(lchan)); + continue; + } + + + msg = l1p_msgb_alloc(); + deact_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDeactivateReq, fl1h); deact_req->u8Tn = lchan->ts->nr; deact_req->subCh = lchan_to_GsmL1_SubCh_t(lchan); @@ -914,7 +923,7 @@ int lchan_deactivate(struct gsm_lchan *lchan) return 0; } -int lchan_deactivate_sacch(struct gsm_lchan *lchan) +static int lchan_deactivate_sacch(struct gsm_lchan *lchan) { struct femtol1_hdl *fl1h = trx_femtol1_hdl(lchan->ts->trx); struct msgb *msg = l1p_msgb_alloc(); @@ -926,6 +935,8 @@ int lchan_deactivate_sacch(struct gsm_lchan *lchan) deact_req->dir = DIR_BOTH; deact_req->sapi = GsmL1_Sapi_Sacch; + lchan->sach_deact = 1; + LOGP(DL1C, LOGL_INFO, "%s MPH-DEACTIVATE.req (SACCH)\n", gsm_lchan_name(lchan)); @@ -995,6 +1006,7 @@ int bts_model_rsl_chan_act(struct gsm_lchan *lchan, struct tlv_parsed *tp) //uint8_t mode = *TLVP_VAL(tp, RSL_IE_CHAN_MODE); //uint8_t type = *TLVP_VAL(tp, RSL_IE_ACT_TYPE); + lchan->sach_deact = 0; lchan_activate(lchan); /* FIXME: only do this in case of success */ |