Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/3753

to look at the new patch set (#3).

Support receiving SI13 from BTS

* store SI13 in BTS struct
* check and handle BCCH SAPI

Change-Id: I610a93ce23725b182ec14e3507331295bd542f74
Related: OS#2400
---
M src/bts.h
M src/osmo-bts-litecell15/lc15_l1_if.c
M src/osmo-bts-sysmo/sysmo_l1_if.c
M src/pcu_l1_if.cpp
M src/pcu_main.cpp
M src/pcu_vty.h
6 files changed, 33 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/53/3753/3

diff --git a/src/bts.h b/src/bts.h
index b1fb8cc..d65cd2f 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -29,6 +29,7 @@
 #include <osmocom/core/timer.h>
 #include <osmocom/core/gsmtap.h>
 #include <osmocom/gsm/l1sap.h>
+#include <osmocom/gsm/protocol/gsm_04_08.h>
 }
 
 #include "poll_controller.h"
@@ -212,7 +213,8 @@
        uint8_t alpha, gamma;
        uint8_t egprs_enabled;
        uint32_t dl_tbf_idle_msec; /* hold time for idle DL TBFs */
-
+       uint8_t si13[GSM_MACBLOCK_LEN];
+       bool si13_is_set;
        /* 0 to support resegmentation in DL, 1 for no reseg */
        uint8_t dl_arq_type;
 
diff --git a/src/osmo-bts-litecell15/lc15_l1_if.c 
b/src/osmo-bts-litecell15/lc15_l1_if.c
index c82ddba..37b7f78 100644
--- a/src/osmo-bts-litecell15/lc15_l1_if.c
+++ b/src/osmo-bts-litecell15/lc15_l1_if.c
@@ -29,6 +29,8 @@
 #include <osmocom/core/gsmtap.h>
 #include <osmocom/core/talloc.h>
 #include <osmocom/core/timer.h>
+#include <osmocom/gsm/protocol/gsm_04_08.h>
+
 #include <lc15_l1_if.h>
 #include <gprs_debug.h>
 #include <pcu_l1_if.h>
diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c
index 9170972..1c5ecc9 100644
--- a/src/osmo-bts-sysmo/sysmo_l1_if.c
+++ b/src/osmo-bts-sysmo/sysmo_l1_if.c
@@ -10,6 +10,8 @@
 #include <osmocom/core/gsmtap.h>
 #include <osmocom/core/talloc.h>
 #include <osmocom/core/timer.h>
+#include <osmocom/gsm/protocol/gsm_04_08.h>
+
 #include <sysmo_l1_if.h>
 #include <gprs_debug.h>
 #include <pcu_l1_if.h>
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 97eee9b..7112b04 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -245,6 +245,27 @@
        return pdch->rcv_block(data, len, fn, meas);
 }
 
+static int pcu_rx_data_ind_bcch(uint8_t *data, uint8_t len)
+{
+       struct gprs_rlcmac_bts *bts = bts_main_data();
+
+       if (len == 0) {
+               bts->si13_is_set = false;
+               LOGP(DL1IF, LOGL_INFO, "Received PCU data indication with empty 
SI13: cache cleaned\n");
+               return 0;
+       }
+
+       if (len != GSM_MACBLOCK_LEN) {
+               LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with SI13 
with unexpected length %u\n", len);
+               return -EINVAL;
+       }
+
+       memcpy(bts->si13, data, GSM_MACBLOCK_LEN);
+       bts->si13_is_set = true;
+
+       return 0;
+}
+
 static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind)
 {
        struct gprs_rlcmac_bts *bts = bts_main_data();
@@ -271,6 +292,9 @@
                        data_ind->data, data_ind->len, data_ind->fn,
                        &meas);
                break;
+       case PCU_IF_SAPI_BCCH:
+               rc = pcu_rx_data_ind_bcch(data_ind->data, data_ind->len);
+               break;
        default:
                LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with "
                        "unsupported sapi %d\n", data_ind->sapi);
diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp
index e909b75..b7574f9 100644
--- a/src/pcu_main.cpp
+++ b/src/pcu_main.cpp
@@ -183,6 +183,7 @@
        bts->n3103 = 4;
        bts->n3105 = 8;
        bts->alpha = 0; /* a = 0.0 */
+       bts->si13_is_set = false;
        bts->ms_idle_sec = 60; /* slightly above T3314 (default 44s, 24.008, 
11.2.2) */
        bts->cs_adj_enabled = 1;
        bts->cs_adj_upper_limit = 33; /* Decrease CS if the error rate is above 
*/
diff --git a/src/pcu_vty.h b/src/pcu_vty.h
index c00b882..a075350 100644
--- a/src/pcu_vty.h
+++ b/src/pcu_vty.h
@@ -1,6 +1,7 @@
 #ifndef _PCU_VTY_H
 #define _PCU_VTY_H
 
+#include <osmocom/gsm/protocol/gsm_04_08.h>
 #include <osmocom/vty/command.h>
 #include <osmocom/vty/vty.h>
 

-- 
To view, visit https://gerrit.osmocom.org/3753
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I610a93ce23725b182ec14e3507331295bd542f74
Gerrit-PatchSet: 3
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder

Reply via email to