aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcu_l1_if.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pcu_l1_if.cpp')
-rw-r--r--src/pcu_l1_if.cpp67
1 files changed, 60 insertions, 7 deletions
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index d7590e1..738eec6 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -42,6 +42,7 @@ extern "C" {
#include <osmocom/gprs/gprs_ns2.h>
#include <osmocom/gsm/l1sap.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
+#include <osmocom/gsm/sysinfo.h>
}
#include <gprs_rlcmac.h>
@@ -291,18 +292,70 @@ int pcu_rx_data_ind_pdtch(struct gprs_rlcmac_bts *bts, uint8_t trx_no, uint8_t t
static int pcu_rx_data_ind_bcch(struct gprs_rlcmac_bts *bts, uint8_t *data, uint8_t len)
{
if (len == 0) {
- bts->si13_is_set = false;
- LOGP(DL1IF, LOGL_INFO, "Received PCU data indication with empty SI13: cache cleaned\n");
+ LOGP(DL1IF, LOGL_ERROR,
+ "Received PCU data indication that contains no data -- ignored.\n");
return 0;
}
- if (len != GSM_MACBLOCK_LEN) {
- LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with SI13 with unexpected length %u\n", len);
+ if (len == 1) {
+ /* Revoke SI */
+ switch (data[0]) {
+ case SYSINFO_TYPE_1:
+ bts->si1_is_set = false;
+ break;
+ case SYSINFO_TYPE_3:
+ bts->si3_is_set = false;
+ break;
+ case SYSINFO_TYPE_13:
+ bts->si13_is_set = false;
+ break;
+ default:
+ LOGP(DL1IF, LOGL_ERROR,
+ "Received PCU data indication that contains an unsupported system information identifier -- ignored.\n");
+ return -EINVAL;
+ }
+ LOGP(DPCU, LOGL_DEBUG,
+ "Received PCU data indication: Revoked SI%s\n",
+ get_value_string(osmo_sitype_strs, data[0]));
+ return 0;
+ } else if (len == 1 + GSM_MACBLOCK_LEN) {
+ /* Update SI */
+ switch (data[0]) {
+ case SYSINFO_TYPE_1:
+ memcpy(bts->si1, data + 1, GSM_MACBLOCK_LEN);
+ bts->si1_is_set = true;
+ break;
+ case SYSINFO_TYPE_3:
+ memcpy(bts->si3, data + 1, GSM_MACBLOCK_LEN);
+ bts->si3_is_set = true;
+ break;
+ case SYSINFO_TYPE_13:
+ memcpy(bts->si13, data + 1, GSM_MACBLOCK_LEN);
+ bts->si13_is_set = true;
+ break;
+ default:
+ LOGP(DL1IF, LOGL_ERROR,
+ "Received PCU data indication that contains an unsupported system information identifier -- ignored.\n");
+ return -EINVAL;
+ }
+ LOGP(DPCU, LOGL_DEBUG,
+ "Received PCU data indication: Updated SI%s: %s\n",
+ get_value_string(osmo_sitype_strs, data[0]),
+ osmo_hexdump_nospc(data + 1, GSM_MACBLOCK_LEN));
+ return 0;
+ } else {
+ LOGP(DL1IF, LOGL_ERROR,
+ "Received PCU data indication with unexpected data length: %u -- ignored.\n",
+ len);
return -EINVAL;
}
- memcpy(bts->si13, data, GSM_MACBLOCK_LEN);
- bts->si13_is_set = true;
+ if (len != GSM_MACBLOCK_LEN) {
+ LOGP(DL1IF, LOGL_ERROR,
+ "Received PCU data indication with SI13 with unexpected length %u\n",
+ len);
+ return -EINVAL;
+ }
return 0;
}
@@ -782,7 +835,7 @@ static int pcu_rx_pag_req(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_pag_req
static int pcu_rx_susp_req(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_susp_req *susp_req)
{
- struct bssgp_bvc_ctx *bctx = bts->pcu->bssgp.bctx;
+ struct bssgp_bvc_ctx *bctx = the_pcu->bssgp.bctx;
GprsMs *ms;
struct gprs_rlcmac_dl_tbf *dl_tbf;
struct gprs_rlcmac_ul_tbf *ul_tbf;