aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/oml.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2016-07-24 15:24:56 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2016-07-25 22:13:44 +0200
commit090a41f897091f3386b1517d33e12eca4ef5a528 (patch)
treed3b45ecc83662cadc8048761d5427383fb775a75 /src/osmo-bts-sysmo/oml.c
parent78458a3811af63829039e327a8f77f74055ae03e (diff)
dyn TS: implement SysmoBTS specifics
For chan_nr_by_sapi(), add GSM_PCHAN_TCH_F_TCH_H_PDCH to pick_pchan(). Add GSM_PCHAN_TCH_F_TCH_H_PDCH to pchan_to_logChComb[] for first pchan initialization. In ts_connect_as(), make sure that callers pass proper "real world" pchan types, i.e. reject the "meta" GSM_PCHAN_TCH_F_TCH_H_PDCH pchan constant. In ts_opstart(), connect as PCHAN_NONE since we will only know the desired pchan when the first RSL chan activ is received. Add GSM_PCHAN_TCH_F_TCH_H_PDCH to lchan_to_GsmL1_SubCh_t(), by using its current "real" pchan mode. Call cb_ts_[dis]connected() unconditionally, i.e. not only for TCH_F_PDCH when a pending flag is set. The cb_ts_[dis]connected() will be a no-op if the pchan type is not dynamic. Change-Id: Iaffd2fc0aa9fc6c4a2acbc534ce6384392e0635b
Diffstat (limited to 'src/osmo-bts-sysmo/oml.c')
-rw-r--r--src/osmo-bts-sysmo/oml.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index 00c00fe5..585e6d08 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -88,6 +88,8 @@ static const enum GsmL1_LogChComb_t pchan_to_logChComb[_GSM_PCHAN_MAX] = {
[GSM_PCHAN_PDCH] = GsmL1_LogChComb_XIII,
[GSM_PCHAN_TCH_F_PDCH] = GsmL1_LogChComb_I, /*< first init
like TCH/F, until PDCH ACT */
+ [GSM_PCHAN_TCH_F_TCH_H_PDCH] = GsmL1_LogChComb_0, /*< first unused,
+ until first RSL CHAN ACT */
[GSM_PCHAN_UNKNOWN] = GsmL1_LogChComb_0,
};
@@ -489,6 +491,14 @@ static int ts_connect_as(struct gsm_bts_trx_ts *ts,
struct femtol1_hdl *fl1h = trx_femtol1_hdl(ts->trx);
GsmL1_MphConnectReq_t *cr;
+ if (pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) {
+ LOGP(DL1C, LOGL_ERROR,
+ "%s Requested TS connect as %s,"
+ " expected a specific pchan instead\n",
+ gsm_ts_and_pchan_name(ts), gsm_pchan_name(pchan));
+ return -EINVAL;
+ }
+
cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h,
l1p_handle_for_ts(ts));
cr->u8Tn = ts->nr;
@@ -503,6 +513,11 @@ static int ts_connect_as(struct gsm_bts_trx_ts *ts,
static int ts_opstart(struct gsm_bts_trx_ts *ts)
{
+ if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) {
+ /* First connect as NONE, until first RSL CHAN ACT. */
+ ts->dyn.pchan_is = ts->dyn.pchan_want = GSM_PCHAN_NONE;
+ return ts_connect_as(ts, GSM_PCHAN_NONE, opstart_compl_cb, NULL);
+ }
return ts_connect_as(ts, ts->pchan, opstart_compl_cb, NULL);
}
@@ -523,7 +538,12 @@ GsmL1_Sapi_t lchan_to_GsmL1_Sapi_t(const struct gsm_lchan *lchan)
GsmL1_SubCh_t lchan_to_GsmL1_SubCh_t(const struct gsm_lchan *lchan)
{
- switch (lchan->ts->pchan) {
+ enum gsm_phys_chan_config pchan = lchan->ts->pchan;
+
+ if (pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH)
+ pchan = lchan->ts->dyn.pchan_want;
+
+ switch (pchan) {
case GSM_PCHAN_CCCH_SDCCH4:
case GSM_PCHAN_CCCH_SDCCH4_CBCH:
if (lchan->type == GSM_LCHAN_CCCH)
@@ -540,6 +560,7 @@ GsmL1_SubCh_t lchan_to_GsmL1_SubCh_t(const struct gsm_lchan *lchan)
case GSM_PCHAN_TCH_F_PDCH:
case GSM_PCHAN_UNKNOWN:
default:
+ /* case GSM_PCHAN_TCH_F_TCH_H_PDCH: is caught above */
return GsmL1_SubCh_NA;
}
@@ -1866,8 +1887,7 @@ static int ts_disconnect_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg,
LOGP(DL1C, LOGL_DEBUG, "%s Rx mphDisconnectCnf\n",
gsm_lchan_name(ts->lchan));
- if (ts->flags & TS_F_PDCH_PENDING_MASK)
- cb_ts_disconnected(ts);
+ cb_ts_disconnected(ts);
return 0;
}
@@ -1901,8 +1921,7 @@ static int ts_connect_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg,
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)
- cb_ts_connected(ts);
+ cb_ts_connected(ts);
return 0;
}