diff --git a/include/osmo-bts/bts_model.h b/include/osmo-bts/bts_model.h index 81b30e941..e7a0d040e 100644 --- a/include/osmo-bts/bts_model.h +++ b/include/osmo-bts/bts_model.h @@ -29,5 +29,6 @@ int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, int bts_model_rsl_chan_act(struct gsm_lchan *lchan, struct tlv_parsed *tp); int bts_model_rsl_chan_rel(struct gsm_lchan *lchan); +int bts_model_rsl_deact_sacch(struct gsm_lchan *lchan); #endif diff --git a/src/common/rsl.c b/src/common/rsl.c index 650db2451..e6ced2694 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -946,6 +946,7 @@ static int rsl_rx_dchan(struct gsm_bts_trx *trx, struct msgb *msg) case RSL_MT_SACCH_INFO_MODIFY: return rsl_rx_sacch_inf_mod(msg); case RSL_MT_DEACTIVATE_SACCH: + return bts_model_rsl_deact_sacch(msg->lchan); case RSL_MT_ENCR_CMD: case RSL_MT_MODE_MODIFY_REQ: case RSL_MT_PHY_CONTEXT_REQ: diff --git a/src/osmo-bts-sysmo/bts_model.c b/src/osmo-bts-sysmo/bts_model.c index 71d8803c3..7e9ffee2c 100644 --- a/src/osmo-bts-sysmo/bts_model.c +++ b/src/osmo-bts-sysmo/bts_model.c @@ -39,3 +39,8 @@ int bts_model_rsl_chan_rel(struct gsm_lchan *lchan) lchan_deactivate(lchan); return rsl_tx_rf_rel_ack(lchan); } + +int bts_model_rsl_deact_sacch(struct gsm_lchan *lchan) +{ + return lchan_deactivate_sacch(lchan); +} diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 0c9183a46..068ca58d3 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -487,6 +487,25 @@ int lchan_deactivate(struct gsm_lchan *lchan) return 0; } +int lchan_deactivate_sacch(struct gsm_lchan *lchan) +{ + struct femtol1_hdl *fl1h = trx_femtol1_hdl(lchan->ts->trx); + struct msgb *msg = l1p_msgb_alloc(); + GsmL1_MphDeactivateReq_t *deact_req; + + 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); + deact_req->dir = DIR_BOTH; + deact_req->sapi = GsmL1_Sapi_Sacch; + + LOGP(DL1C, LOGL_NOTICE, "%s SACCH MPH-DEACTIVATE.req\n", + gsm_lchan_name(lchan)); + + /* send the primitive for all GsmL1_Sapi_* that match the LCHAN */ + return l1if_req_compl(fl1h, msg, 0, lchan_deact_compl_cb, lchan); +} + struct gsm_time *bts_model_get_time(struct gsm_bts *bts) {