pcuif: Support receiving System Information 2

OsmoPCU will need this SI2 in order to gain knowledge of the BCCH
Frequency List being broadcasted, in order to build a per-MS specific
Neighbour List using NC_FREQUENCY_LIST bits in Packet Measurement Order.

Related: SYS#5303
Change-Id: I4a9c4f70beac6805322a19835a0d30f7247780b4
This commit is contained in:
Pau Espin 2021-06-08 18:53:40 +02:00
parent c6e911cf22
commit 86f4c093d1
2 changed files with 33 additions and 0 deletions

View File

@ -231,6 +231,9 @@ struct gprs_rlcmac_bts {
uint8_t si1[GSM_MACBLOCK_LEN];
bool si1_is_set;
uint8_t si2[GSM_MACBLOCK_LEN];
bool si2_is_set;
struct gsm_sysinfo_freq si2_bcch_cell_list[1024];
uint8_t si3[GSM_MACBLOCK_LEN];
bool si3_is_set;
uint8_t si13[GSM_MACBLOCK_LEN];

View File

@ -286,9 +286,28 @@ int pcu_rx_data_ind_pdtch(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_pdch *
return rc;
}
static int list_arfcn(const struct gprs_rlcmac_bts *bts, const struct gsm_sysinfo_freq *freq, const char *text)
{
int n = 0, i;
for (i = 0; i < 1024; i++) {
if (freq[i].mask) {
if (!n)
LOGP(DL1IF, LOGL_INFO, "BTS%d: %s", bts->nr, text);
LOGPC(DL1IF, LOGL_INFO, " %d", i);
n++;
}
}
if (n)
LOGPC(DL1IF, LOGL_INFO, "\n");
return n;
}
static int pcu_rx_data_ind_bcch(struct gprs_rlcmac_bts *bts, uint8_t *data, uint8_t len)
{
struct gsm48_system_information_type_2 *si2;
const uint8_t *si_ro;
switch (len) {
case 0:
/* Due to historical reasons also accept a completely empty message as
@ -305,6 +324,9 @@ static int pcu_rx_data_ind_bcch(struct gprs_rlcmac_bts *bts, uint8_t *data, uint
case SYSINFO_TYPE_1:
bts->si1_is_set = false;
break;
case SYSINFO_TYPE_2:
bts->si2_is_set = false;
break;
case SYSINFO_TYPE_3:
bts->si3_is_set = false;
break;
@ -328,6 +350,14 @@ static int pcu_rx_data_ind_bcch(struct gprs_rlcmac_bts *bts, uint8_t *data, uint
memcpy(bts->si1, data, GSM_MACBLOCK_LEN);
bts->si1_is_set = true;
break;
case GSM48_MT_RR_SYSINFO_2:
memcpy(bts->si2, data, GSM_MACBLOCK_LEN);
bts->si2_is_set = true;
si2 = (struct gsm48_system_information_type_2 *)bts->si2;
gsm48_decode_freq_list(bts->si2_bcch_cell_list, si2->bcch_frequency_list,
sizeof(si2->bcch_frequency_list), 0xce, 1);
list_arfcn(bts, bts->si2_bcch_cell_list, "SI2 Neighbour cells in same band:");
break;
case GSM48_MT_RR_SYSINFO_3:
memcpy(bts->si3, data, GSM_MACBLOCK_LEN);
bts->si3_is_set = true;