aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2016-06-21 21:25:59 +0200
committerHarald Welte <laforge@gnumonks.org>2016-06-22 23:25:54 +0000
commit037dcfe98197e91b13bbc943d128b136355f05b5 (patch)
tree9a3e02b86df6602069b51a873514021282e92919
parent380a2e6d902fbfb00fdba9bd81abc0f0b7b2093b (diff)
dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags
Analogous to 0d10f0e482cdd50acc916e75a8b3ba1beb94227c on osmo-bts-sysmo. According to the PDCH Active flag, handle a TS as TCH/F or PDCH. Change-Id: I0c97b360136f76bdae8d70d06af9a31fdf75c1ba
-rw-r--r--src/osmo-bts-litecell15/l1_if.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index d823e31..395ee0d 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -615,11 +615,23 @@ static int handle_mph_time_ind(struct lc15l1_hdl *fl1,
return l1sap_up(trx, &l1sap);
}
-static uint8_t chan_nr_by_sapi(enum gsm_phys_chan_config pchan,
+static enum gsm_phys_chan_config pick_pchan(struct gsm_bts_trx_ts *ts)
+{
+ if (ts->pchan != GSM_PCHAN_TCH_F_PDCH)
+ return ts->pchan;
+ if (ts->flags & TS_F_PDCH_ACTIVE)
+ return GSM_PCHAN_PDCH;
+ return GSM_PCHAN_TCH_F;
+}
+
+static uint8_t chan_nr_by_sapi(struct gsm_bts_trx_ts *ts,
GsmL1_Sapi_t sapi, GsmL1_SubCh_t subCh,
uint8_t u8Tn, uint32_t u32Fn)
{
uint8_t cbits = 0;
+ enum gsm_phys_chan_config pchan = pick_pchan(ts);
+ OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_PDCH);
+
switch (sapi) {
case GsmL1_Sapi_Bcch:
cbits = 0x10;
@@ -728,7 +740,7 @@ static int handle_ph_readytosend_ind(struct lc15l1_hdl *fl1,
uint32_t fn;
/* check if primitive should be handled by common part */
- chan_nr = chan_nr_by_sapi(trx->ts[rts_ind->u8Tn].pchan, rts_ind->sapi,
+ chan_nr = chan_nr_by_sapi(&trx->ts[rts_ind->u8Tn], rts_ind->sapi,
rts_ind->subCh, rts_ind->u8Tn, rts_ind->u32Fn);
if (chan_nr) {
fn = rts_ind->u32Fn;
@@ -847,7 +859,7 @@ static int handle_ph_data_ind(struct lc15l1_hdl *fl1, GsmL1_PhDataInd_t *data_in
int rc = 0;
int8_t rssi;
- chan_nr = chan_nr_by_sapi(trx->ts[data_ind->u8Tn].pchan, data_ind->sapi,
+ chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi,
data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn);
if (!chan_nr) {
LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi "