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
This commit is contained in:
Philipp Maier 2023-01-05 15:51:55 +01:00
parent cb3140faf6
commit 373d4f05f6
1 changed files with 17 additions and 2 deletions

View File

@ -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);