aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2016-07-27 15:52:55 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2016-07-28 17:58:05 +0200
commit576071d6ca2ffa266b3a6e0858b00205827fa10a (patch)
tree9175df7cb1684df127b24c36306a46a2dff706d0
parent5069c1c518fa9e6622adcfb3979da8f58c1c26b9 (diff)
dyn TS, dyn PDCH: common/l1sap.c: properly notice PDCH
In l1sap_ph_rts_ind(), l1sap_ph_data_ind() and to_gsmtap(), the decision to handle a TS as PDCH was still missing for dynamic TS. It is not yet clear why this did not impact functionality for dynamic timeslots on other BTS models. AFAICT they should not work without this patch, but in fact they do. It would be nice to clarify this some day. Change-Id: I7b873a089a3de70d980885a7539cb91997464743
-rw-r--r--src/common/l1sap.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 7f73e3fb..4f6cf05d 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -294,6 +294,14 @@ static int gsmtap_ph_rach(struct osmo_phsap_prim *l1sap, uint8_t *chan_type,
return 0;
}
+static bool ts_is_pdch(const struct gsm_bts_trx_ts *ts)
+{
+ return ts->pchan == GSM_PCHAN_PDCH
+ || (ts->pchan == GSM_PCHAN_TCH_F_PDCH
+ && (ts->flags & TS_F_PDCH_ACTIVE)
+ && !(ts->flags & TS_F_PDCH_PENDING_MASK));
+}
+
static int to_gsmtap(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)
{
uint8_t *data;
@@ -311,7 +319,7 @@ static int to_gsmtap(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)
uplink = 0;
/* fall through */
case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_INDICATION):
- if (trx->ts[tn].pchan == GSM_PCHAN_PDCH)
+ if (ts_is_pdch(&trx->ts[tn]))
rc = gsmtap_pdch(l1sap, &chan_type, &tn, &ss, &fn, &data,
&len);
else
@@ -542,7 +550,7 @@ static int l1sap_ph_rts_ind(struct gsm_bts_trx *trx,
DEBUGP(DL1P, "Rx PH-RTS.ind %02u/%02u/%02u chan_nr=%d link_id=%d\n",
g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id);
- if (trx->ts[tn].pchan == GSM_PCHAN_PDCH) {
+ if (ts_is_pdch(&trx->ts[tn])) {
if (L1SAP_IS_PTCCH(rts_ind->fn)) {
pcu_tx_rts_req(&trx->ts[tn], 1, fn, 1 /* ARFCN */,
L1SAP_FN2PTCCHBLOCK(fn));
@@ -806,7 +814,7 @@ static int l1sap_ph_data_ind(struct gsm_bts_trx *trx,
DEBUGP(DL1P, "Rx PH-DATA.ind %02u/%02u/%02u chan_nr=%d link_id=%d\n",
g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id);
- if (trx->ts[tn].pchan == GSM_PCHAN_PDCH) {
+ if (ts_is_pdch(&trx->ts[tn])) {
if (len == 0)
return -EINVAL;
if (L1SAP_IS_PTCCH(fn)) {