aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2016-08-23 15:19:57 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-08-30 12:38:04 +0000
commit8a148613b4c93f5a25dd2a2d9929de75882adbc5 (patch)
tree392fdb2871d40ce39b718a314431dea9d2a24584
parent4dfc3da96bbad9e6a8641233c87a05a46af7d906 (diff)
Fix ip.access style dyn PDCH, broken in 37af36e85eca546595081246aec010fa7f6fd0be
Commit "sysmo,lc15: ts_connect_as(): log error also for pchan_as == TCH/F_PDCH" introduced a check for TCH/F_PDCH intended only for TCH/F_TCH/H_PDCH. It looked correct, but TCH/F_PDCH startup was designed differently: For TCH/F_PDCH, the idea was to look it up in pchan_to_logChComb[] and obtain the TCH/F channel combination, so that TCH/F_PDCH first initialize as TCH/F. So pchan was in fact intended to be passed as TCH/F_PDCH. For Osmocom TCH/F_TCH/H_PDCH, we've in the meantime added a ts_opstart() function that makes this decision explicitly. So, instead of reverting the erratic commit, add TCH/F_PDCH to ts_opstart(), for both sysmo and lc15. In ts_opstart(), move to a switch statement to resolve the actual pchan to use for ts_connect_as(). Drop TCH/F_PDCH and TCH/F_TCH/H_PDCH from pchan_to_logChComb[] and comment. Change-Id: I376b92a06f4cbe943c1c913dea7487fac53a7d08
-rw-r--r--src/osmo-bts-litecell15/oml.c27
-rw-r--r--src/osmo-bts-sysmo/oml.c27
2 files changed, 38 insertions, 16 deletions
diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c
index 5ce510ad..a175af4b 100644
--- a/src/osmo-bts-litecell15/oml.c
+++ b/src/osmo-bts-litecell15/oml.c
@@ -89,11 +89,12 @@ static const enum GsmL1_LogChComb_t pchan_to_logChComb[_GSM_PCHAN_MAX] = {
[GSM_PCHAN_SDCCH8_SACCH8C] = GsmL1_LogChComb_VII,
[GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = GsmL1_LogChComb_VII,
[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,
+ /*
+ * GSM_PCHAN_TCH_F_PDCH and GSM_PCHAN_TCH_F_TCH_H_PDCH should not be
+ * part of this, only "real" pchan values will be looked up here.
+ * See the callers of ts_connect_as().
+ */
};
static int trx_rf_lock(struct gsm_bts_trx *trx, int locked, l1if_compl_cb *cb);
@@ -507,12 +508,22 @@ 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. */
+ enum gsm_phys_chan_config pchan = ts->pchan;
+ switch (pchan) {
+ case GSM_PCHAN_TCH_F_TCH_H_PDCH:
ts->dyn.pchan_is = ts->dyn.pchan_want = GSM_PCHAN_NONE;
- return ts_connect_as(ts, GSM_PCHAN_NONE, opstart_compl_cb, NULL);
+ /* First connect as NONE, until first RSL CHAN ACT. */
+ pchan = GSM_PCHAN_NONE;
+ break;
+ case GSM_PCHAN_TCH_F_PDCH:
+ /* First connect as TCH/F, expecting PDCH ACT. */
+ pchan = GSM_PCHAN_TCH_F;
+ break;
+ default:
+ /* simply use ts->pchan */
+ break;
}
- return ts_connect_as(ts, ts->pchan, opstart_compl_cb, NULL);
+ return ts_connect_as(ts, pchan, opstart_compl_cb, NULL);
}
GsmL1_Sapi_t lchan_to_GsmL1_Sapi_t(const struct gsm_lchan *lchan)
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index 6f0629d4..dea1c5e2 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -86,11 +86,12 @@ static const enum GsmL1_LogChComb_t pchan_to_logChComb[_GSM_PCHAN_MAX] = {
[GSM_PCHAN_SDCCH8_SACCH8C] = GsmL1_LogChComb_VII,
[GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = GsmL1_LogChComb_VII,
[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,
+ /*
+ * GSM_PCHAN_TCH_F_PDCH and GSM_PCHAN_TCH_F_TCH_H_PDCH should not be
+ * part of this, only "real" pchan values will be looked up here.
+ * See the callers of ts_connect_as().
+ */
};
static int trx_rf_lock(struct gsm_bts_trx *trx, int locked, l1if_compl_cb *cb);
@@ -515,12 +516,22 @@ 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. */
+ enum gsm_phys_chan_config pchan = ts->pchan;
+ switch (pchan) {
+ case GSM_PCHAN_TCH_F_TCH_H_PDCH:
ts->dyn.pchan_is = ts->dyn.pchan_want = GSM_PCHAN_NONE;
- return ts_connect_as(ts, GSM_PCHAN_NONE, opstart_compl_cb, NULL);
+ /* First connect as NONE, until first RSL CHAN ACT. */
+ pchan = GSM_PCHAN_NONE;
+ break;
+ case GSM_PCHAN_TCH_F_PDCH:
+ /* First connect as TCH/F, expecting PDCH ACT. */
+ pchan = GSM_PCHAN_TCH_F;
+ break;
+ default:
+ /* simply use ts->pchan */
+ break;
}
- return ts_connect_as(ts, ts->pchan, opstart_compl_cb, NULL);
+ return ts_connect_as(ts, pchan, opstart_compl_cb, NULL);
}
GsmL1_Sapi_t lchan_to_GsmL1_Sapi_t(const struct gsm_lchan *lchan)