aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2016-06-21 20:04:05 +0200
committerHarald Welte <laforge@gnumonks.org>2016-06-22 23:26:15 +0000
commit3f919171efc52c88f54cc9140588854e14d152b5 (patch)
tree08f1b040256d2e34fb44f162e4c8dd8f9a22e980
parenta4c68023154f4ac3b3fc31e1566896f9280244a9 (diff)
dyn PDCH: lc15: complete for litecell15-bts: implement bts_model_ts_*()
Analogous to 63b296bdd9a25134ee61ce6f269750e796a8bfca on osmo-bts-sysmo. Implement bts_model_ts_disconnect() by sending an MphDisconnect message to L1. Pass a disconnect callback to invoke dyn_pdch_ts_disconnected() in common/rsl.c. Implement bts_model_ts_connect() by calling ts_connect_as(). Pass a connect cb to invoke dyn_pdch_connected() in common/rsl.c. Change-Id: I8c8c3244c726fd6055cedb22ee11706994ff9cd4
-rw-r--r--src/osmo-bts-litecell15/oml.c51
1 files changed, 49 insertions, 2 deletions
diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c
index 27df64d..8f783f3 100644
--- a/src/osmo-bts-litecell15/oml.c
+++ b/src/osmo-bts-litecell15/oml.c
@@ -1836,13 +1836,60 @@ int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm)
return l1if_set_txpower(trx_lc15l1_hdl(trx), ((float) p_trxout_mdBm)/1000.0);
}
+static int ts_disconnect_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg,
+ void *data)
+{
+ GsmL1_Prim_t *l1p = msgb_l1prim(l1_msg);
+ GsmL1_MphDisconnectCnf_t *cnf = &l1p->u.mphDisconnectCnf;
+ struct gsm_bts_trx_ts *ts = &trx->ts[cnf->u8Tn];
+ OSMO_ASSERT(cnf->u8Tn < TRX_NR_TS);
+
+ LOGP(DL1C, LOGL_DEBUG, "%s Rx mphDisconnectCnf\n",
+ gsm_lchan_name(ts->lchan));
+
+ if (ts->flags & TS_F_PDCH_PENDING_MASK)
+ dyn_pdch_ts_disconnected(ts);
+
+ return 0;
+}
+
int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts)
{
- return -ENOTSUP;
+ struct msgb *msg = l1p_msgb_alloc();
+ struct lc15l1_hdl *fl1h = trx_lc15l1_hdl(ts->trx);
+ GsmL1_MphDisconnectReq_t *cr;
+
+ DEBUGP(DRSL, "%s TS disconnect\n", gsm_lchan_name(ts->lchan));
+ cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDisconnectReq, fl1h,
+ l1p_handle_for_ts(ts));
+ cr->u8Tn = ts->nr;
+
+ return l1if_gsm_req_compl(fl1h, msg, ts_disconnect_cb, NULL);
+}
+
+static int ts_connect_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg,
+ void *data)
+{
+ GsmL1_Prim_t *l1p = msgb_l1prim(l1_msg);
+ GsmL1_MphConnectCnf_t *cnf = &l1p->u.mphConnectCnf;
+ struct gsm_bts_trx_ts *ts = &trx->ts[cnf->u8Tn];
+ OSMO_ASSERT(cnf->u8Tn < TRX_NR_TS);
+
+ DEBUGP(DL1C, "%s %s Rx mphConnectCnf flags=%s%s%s\n",
+ gsm_lchan_name(ts->lchan),
+ gsm_pchan_name(ts->pchan),
+ ts->flags & TS_F_PDCH_ACTIVE ? "ACTIVE " : "",
+ ts->flags & TS_F_PDCH_ACT_PENDING ? "ACT_PENDING " : "",
+ ts->flags & TS_F_PDCH_DEACT_PENDING ? "DEACT_PENDING " : "");
+
+ if (ts->flags & TS_F_PDCH_PENDING_MASK)
+ dyn_pdch_ts_connected(ts);
+
+ return 0;
}
int bts_model_ts_connect(struct gsm_bts_trx_ts *ts,
enum gsm_phys_chan_config as_pchan)
{
- return -ENOTSUP;
+ return ts_connect_as(ts, as_pchan, ts_connect_cb, NULL);
}