aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2023-01-05 15:51:55 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2023-01-31 12:05:02 +0100
commit373d4f05f6d87a76492bf614978003445c407359 (patch)
tree92505370c1cf48c0d0c1670612c11a0f0a1a2f75 /src/osmo-bsc
parentcb3140faf6fcae0614a0416d705c77ee58b5b1a9 (diff)
pcu_sock: rework check logic for ts
Before filling in the TS in the info indication, it is checked that the MO opstate is enabled. Also it is checked that the TS serves a PDCH. Lets restructure this check and move the PDCH check into a helper function as we need to check for PDCH from other location as well later. Change-Id: Icaab52ab73c38889dfadb523b89bb54cafacc99a Related: OS#5198
Diffstat (limited to 'src/osmo-bsc')
-rw-r--r--src/osmo-bsc/pcu_sock.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index b778cbd7d..def2df069 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -92,6 +92,20 @@ struct msgb *pcu_msgb_alloc(uint8_t msg_type, uint8_t bts_nr)
return msg;
}
+/* Check if the timeslot can be utilized as PDCH now
+ * (PDCH is currently active on BTS) */
+static bool ts_now_usable_as_pdch(const struct gsm_bts_trx_ts *ts)
+{
+ switch (ts->pchan_is) {
+ case GSM_PCHAN_PDCH:
+ /* NOTE: We currently only support Ericsson RBS as a BSC
+ * co-located BTS. This BTS only supports dynamic channels. */
+ return true;
+ default:
+ return false;
+ }
+}
+
/* Fill the frequency hopping parameter */
static void info_ind_fill_fhp(struct gsm_pcu_if_info_trx_ts *ts_info,
const struct gsm_bts_trx_ts *ts)
@@ -124,8 +138,9 @@ static void info_ind_fill_trx(struct gsm_pcu_if_info_trx *trx_info, const struct
for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) {
ts = &trx->ts[tn];
- if (ts->mo.nm_state.operational != NM_OPSTATE_ENABLED ||
- ts->pchan_is != GSM_PCHAN_PDCH)
+ if (ts->mo.nm_state.operational != NM_OPSTATE_ENABLED)
+ continue;
+ if (!ts_now_usable_as_pdch(ts))
continue;
trx_info->pdch_mask |= (1 << tn);