laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-pcu/+/24621 )

Change subject: pcuif: Support receiving System Information 2
......................................................................

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
---
M src/bts.h
M src/pcu_l1_if.cpp
2 files changed, 33 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/bts.h b/src/bts.h
index 2a7d883..a2f4598 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -231,6 +231,9 @@

        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];
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 0453b92..818cb1a 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -286,9 +286,28 @@
        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 @@
                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 @@
                        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;

--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/24621
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I4a9c4f70beac6805322a19835a0d30f7247780b4
Gerrit-Change-Number: 24621
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-MessageType: merged

Reply via email to