From 84bf0faed9912ba2b31e56299f5a0441973076eb Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 1 Sep 2017 11:02:40 +0200 Subject: Support receiving SI13 from BTS * store SI13 in BTS struct * check and handle BCCH SAPI Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Related: OS#2400 --- src/bts.h | 4 +++- src/osmo-bts-litecell15/lc15_l1_if.c | 2 ++ src/osmo-bts-sysmo/sysmo_l1_if.c | 2 ++ src/pcu_l1_if.cpp | 24 ++++++++++++++++++++++++ src/pcu_main.cpp | 1 + src/pcu_vty.h | 1 + 6 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/bts.h b/src/bts.h index b1fb8cca..d65cd2f6 100644 --- a/src/bts.h +++ b/src/bts.h @@ -29,6 +29,7 @@ extern "C" { #include #include #include +#include } #include "poll_controller.h" @@ -212,7 +213,8 @@ struct gprs_rlcmac_bts { 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 c82ddba2..37b7f789 100644 --- a/src/osmo-bts-litecell15/lc15_l1_if.c +++ b/src/osmo-bts-litecell15/lc15_l1_if.c @@ -29,6 +29,8 @@ #include #include #include +#include + #include #include #include diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c index 91709724..1c5ecc93 100644 --- a/src/osmo-bts-sysmo/sysmo_l1_if.c +++ b/src/osmo-bts-sysmo/sysmo_l1_if.c @@ -10,6 +10,8 @@ #include #include #include +#include + #include #include #include diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 97eee9b8..7112b044 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -245,6 +245,27 @@ extern "C" int pcu_rx_data_ind_pdtch(uint8_t trx_no, uint8_t ts_no, uint8_t *dat 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 @@ static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind) 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 e909b754..b7574f96 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -183,6 +183,7 @@ int main(int argc, char *argv[]) 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 c00b8824..a0753501 100644 --- a/src/pcu_vty.h +++ b/src/pcu_vty.h @@ -1,6 +1,7 @@ #ifndef _PCU_VTY_H #define _PCU_VTY_H +#include #include #include -- cgit v1.2.3