diff options
author | Max <msuraev@sysmocom.de> | 2017-09-01 11:02:40 +0200 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2017-09-01 11:08:06 +0200 |
commit | 84bf0faed9912ba2b31e56299f5a0441973076eb (patch) | |
tree | 33cfd68214575bb5379e33bb6f45c692f0460031 | |
parent | b216c6b1652454d01f10c376a16bae864b717a1e (diff) |
Support receiving SI13 from BTS
* store SI13 in BTS struct
* check and handle BCCH SAPI
Change-Id: I610a93ce23725b182ec14e3507331295bd542f74
Related: OS#2400
-rw-r--r-- | src/bts.h | 4 | ||||
-rw-r--r-- | src/osmo-bts-litecell15/lc15_l1_if.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/sysmo_l1_if.c | 2 | ||||
-rw-r--r-- | src/pcu_l1_if.cpp | 24 | ||||
-rw-r--r-- | src/pcu_main.cpp | 1 | ||||
-rw-r--r-- | src/pcu_vty.h | 1 |
6 files changed, 33 insertions, 1 deletions
@@ -29,6 +29,7 @@ extern "C" { #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 @@ 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 <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 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 <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 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 <osmocom/gsm/protocol/gsm_04_08.h> #include <osmocom/vty/command.h> #include <osmocom/vty/vty.h> |