Review at https://gerrit.osmocom.org/3753
Support receiving SI13 from BTS * store SI13 in BTS struct * check and handle BCCH SAPI * bundle direct-phy related code together to simplify modifications Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Related: OS#2400 --- M src/bts.h M src/pcu_l1_if.cpp M src/pcu_main.cpp M src/pcu_vty.h 4 files changed, 34 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/53/3753/1 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/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 50e181e..6d94850 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -163,9 +163,9 @@ void pcu_l1if_tx_pdtch(msgb *msg, uint8_t trx, uint8_t ts, uint16_t arfcn, uint32_t fn, uint8_t block_nr) { +#ifdef ENABLE_DIRECT_PHY struct gprs_rlcmac_bts *bts = bts_main_data(); -#ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 0, fn, arfcn, block_nr, msg->data, msg->len); @@ -245,21 +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 != 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(); int rc; pcu_l1_meas meas; - meas.set_rssi(data_ind->rssi); -#ifndef ENABLE_DIRECT_PHY - /* convert BER to % value */ - meas.set_ber(data_ind->ber10k / 100); - meas.set_bto(data_ind->ta_offs_qbits); - meas.set_link_qual(data_ind->lqual_cb / 10); - LOGP(DL1IF, LOGL_DEBUG, "Data indication with raw measurements " - "received: BER10k = %d, BTO = %d, Q = %d\n", data_ind->ber10k, - data_ind->ta_offs_qbits, data_ind->lqual_cb); -#endif + LOGP(DL1IF, LOGL_DEBUG, "Data indication received: sapi=%d arfcn=%d " "block=%d data=%s\n", data_ind->sapi, data_ind->arfcn, data_ind->block_nr, @@ -267,10 +273,22 @@ switch (data_ind->sapi) { case PCU_IF_SAPI_PDTCH: + meas.set_rssi(data_ind->rssi); +#ifndef ENABLE_DIRECT_PHY + /* convert BER to % value */ + meas.set_ber(data_ind->ber10k / 100); + meas.set_bto(data_ind->ta_offs_qbits); + meas.set_link_qual(data_ind->lqual_cb / 10); + LOGP(DL1IF, LOGL_DEBUG, "Data indication with raw measurements received: BER10k = %d, BTO = %d, Q = %d\n", + data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb); +#endif rc = pcu_rx_data_ind_pdtch(data_ind->trx_nr, data_ind->ts_nr, 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: newchange Gerrit-Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max <msur...@sysmocom.de>