diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-03-09 14:50:14 +0100 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2021-03-12 07:40:11 +0000 |
commit | c1f31c46ac1eb80427486c5920052195ca3301a3 (patch) | |
tree | ae8282b5919e86ace38b7d2378f863a01207bb97 /src | |
parent | 91cc780b40aaac721650b672cca9caf7ee291f3a (diff) |
Improve DATA.ind logging
pdch object is obtained prior in the stack so it is available for
logging.
Change-Id: If51f7bdbd626a44c7b8e182a3460dad49fda6ec3
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo-bts-litecell15/lc15_l1_if.c | 14 | ||||
-rw-r--r-- | src/osmo-bts-oc2g/oc2g_l1_if.c | 14 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/sysmo_l1_if.c | 14 | ||||
-rw-r--r-- | src/pcu_l1_if.cpp | 31 | ||||
-rw-r--r-- | src/pcu_l1_if.h | 4 |
5 files changed, 46 insertions, 31 deletions
diff --git a/src/osmo-bts-litecell15/lc15_l1_if.c b/src/osmo-bts-litecell15/lc15_l1_if.c index c87edaf9..99c82a12 100644 --- a/src/osmo-bts-litecell15/lc15_l1_if.c +++ b/src/osmo-bts-litecell15/lc15_l1_if.c @@ -194,11 +194,13 @@ static int handle_ph_data_ind(struct lc15l1_hdl *fl1h, { int rc = 0; struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_pdch *pdch; struct pcu_l1_meas meas = {0}; uint8_t *data; uint8_t data_len; - DEBUGP(DL1IF, "Rx PH-DATA.ind %s (hL2 %08x): %s\n", + DEBUGP(DL1IF, "(trx=%" PRIu8 ",ts=%u) FN=%u Rx PH-DATA.ind %s (hL2 %08x): %s\n", + fl1h->trx_no, data_ind->u8Tn, data_ind->u32Fn, get_value_string(lc15bts_l1sapi_names, data_ind->sapi), data_ind->hLayer2, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, @@ -224,12 +226,14 @@ static int handle_ph_data_ind(struct lc15l1_hdl *fl1h, data = NULL; data_len = 0; } - pcu_rx_data_ind_pdtch(bts, fl1h->trx_no, data_ind->u8Tn, data, - data_len, data_ind->u32Fn, &meas); + pdch = &bts->trx[fl1h->trx_no].pdch[data_ind->u8Tn]; + pcu_rx_data_ind_pdtch(bts, pdch, data, data_len, data_ind->u32Fn, &meas); break; default: - LOGP(DL1IF, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n", - get_value_string(lc15bts_l1sapi_names, data_ind->sapi)); + LOGP(DL1IF, LOGL_NOTICE, + "(trx=%" PRIu8 ",ts=%u) FN=%u Rx PH-DATA.ind for unknown L1 SAPI %s\n", + fl1h->trx_no, data_ind->u8Tn, data_ind->u32Fn, + get_value_string(lc15bts_l1sapi_names, data_ind->sapi)); break; } diff --git a/src/osmo-bts-oc2g/oc2g_l1_if.c b/src/osmo-bts-oc2g/oc2g_l1_if.c index 5d2ce691..101bd560 100644 --- a/src/osmo-bts-oc2g/oc2g_l1_if.c +++ b/src/osmo-bts-oc2g/oc2g_l1_if.c @@ -194,11 +194,13 @@ static int handle_ph_data_ind(struct oc2gl1_hdl *fl1h, { int rc = 0; struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_pdch *pdch; struct pcu_l1_meas meas = {0}; uint8_t *data; uint8_t data_len; - DEBUGP(DL1IF, "Rx PH-DATA.ind %s (hL2 %08x): %s\n", + DEBUGP(DL1IF, "(trx=%" PRIu8 ",ts=%u) FN=%u Rx PH-DATA.ind %s (hL2 %08x): %s\n", + fl1h->trx_no, data_ind->u8Tn, data_ind->u32Fn, get_value_string(oc2gbts_l1sapi_names, data_ind->sapi), data_ind->hLayer2, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, @@ -229,12 +231,14 @@ static int handle_ph_data_ind(struct oc2gl1_hdl *fl1h, data = NULL; data_len = 0; } - pcu_rx_data_ind_pdtch(bts, fl1h->trx_no, data_ind->u8Tn, data, - data_len, data_ind->u32Fn, &meas); + pdch = &bts->trx[fl1h->trx_no].pdch[data_ind->u8Tn]; + pcu_rx_data_ind_pdtch(bts, pdch, data, data_len, data_ind->u32Fn, &meas); break; default: - LOGP(DL1IF, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n", - get_value_string(oc2gbts_l1sapi_names, data_ind->sapi)); + LOGP(DL1IF, LOGL_NOTICE, + "(trx=%" PRIu8 ",ts=%u) FN=%u Rx PH-DATA.ind for unknown L1 SAPI %s\n", + fl1h->trx_no, data_ind->u8Tn, data_ind->u32Fn, + get_value_string(oc2gbts_l1sapi_names, data_ind->sapi)); break; } diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c index 4faccaa2..eb869e11 100644 --- a/src/osmo-bts-sysmo/sysmo_l1_if.c +++ b/src/osmo-bts-sysmo/sysmo_l1_if.c @@ -176,12 +176,14 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1h, { int rc = 0; struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_pdch *pdch; struct pcu_l1_meas meas = {0}; uint8_t *data; uint8_t data_len; - DEBUGP(DL1IF, "Rx PH-DATA.ind %s (hL2 %08x): %s\n", + DEBUGP(DL1IF, "(trx=%" PRIu8 ",ts=%u) FN=%u Rx PH-DATA.ind %s (hL2 %08x): %s\n", + fl1h->trx_no, data_ind->u8Tn, data_ind->u32Fn, get_value_string(femtobts_l1sapi_names, data_ind->sapi), data_ind->hLayer2, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, @@ -208,12 +210,14 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1h, data = NULL; data_len = 0; } - pcu_rx_data_ind_pdtch(bts, fl1h->trx_no, data_ind->u8Tn, data, - data_len, data_ind->u32Fn, &meas); + pdch = &bts->trx[fl1h->trx_no].pdch[data_ind->u8Tn]; + pcu_rx_data_ind_pdtch(bts, pdch, data, data_len, data_ind->u32Fn, &meas); break; default: - LOGP(DL1IF, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n", - get_value_string(femtobts_l1sapi_names, data_ind->sapi)); + LOGP(DL1IF, LOGL_NOTICE, + "(trx=%" PRIu8 ",ts=%u) FN=%u Rx PH-DATA.ind for unknown L1 SAPI %s\n", + fl1h->trx_no, data_ind->u8Tn, data_ind->u32Fn, + get_value_string(femtobts_l1sapi_names, data_ind->sapi)); rc = -1; break; } diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index a14a4eef..5a5031c3 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -281,12 +281,9 @@ void pcu_rx_ra_time(struct gprs_rlcmac_bts *bts, uint16_t arfcn, uint32_t fn, ui bts_set_current_block_frame_number(bts, fn, 5); } -int pcu_rx_data_ind_pdtch(struct gprs_rlcmac_bts *bts, uint8_t trx_no, uint8_t ts_no, uint8_t *data, +int pcu_rx_data_ind_pdtch(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_pdch *pdch, uint8_t *data, uint8_t len, uint32_t fn, struct pcu_l1_meas *meas) { - struct gprs_rlcmac_pdch *pdch; - - pdch = &bts->trx[trx_no].pdch[ts_no]; return pdch->rcv_block(data, len, fn, meas); } @@ -366,27 +363,30 @@ static int pcu_rx_data_ind(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_data * int rc; int current_fn = bts_current_frame_number(bts); struct pcu_l1_meas meas = {0}; + struct gprs_rlcmac_pdch *pdch; uint8_t gsmtap_chantype; - LOGP(DL1IF, LOGL_DEBUG, "Data indication received: sapi=%d arfcn=%d " - "fn=%d cur_fn=%d block=%d data=%s\n", data_ind->sapi, - data_ind->arfcn, data_ind->fn, current_fn, data_ind->block_nr, - osmo_hexdump(data_ind->data, data_ind->len)); + LOGP(DL1IF, LOGL_DEBUG, "(bts=%" PRIu8 ",trx=%" PRIu8 ",ts=%" PRIu8 ") FN=%u " + "Rx DATA.ind: sapi=%d arfcn=%d cur_fn=%d " + "block=%d data=%s\n", bts->nr, data_ind->trx_nr, data_ind->ts_nr, + data_ind->fn, data_ind->sapi, data_ind->arfcn, current_fn, + data_ind->block_nr, osmo_hexdump(data_ind->data, data_ind->len)); switch (data_ind->sapi) { case PCU_IF_SAPI_PDTCH: + pdch = &bts->trx[data_ind->trx_nr].pdch[data_ind->ts_nr]; pcu_l1_meas_set_rssi(&meas, data_ind->rssi); /* convert BER to % value */ pcu_l1_meas_set_ber(&meas, data_ind->ber10k / 100); pcu_l1_meas_set_bto(&meas, data_ind->ta_offs_qbits); pcu_l1_meas_set_link_qual(&meas, 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); + LOGPDCH(pdch, DL1IF, LOGL_DEBUG, "FN=%u Rx DATA.ind PDTCH: " + "BER10k = %d, BTO = %d, Q = %d\n", data_ind->fn, + data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb); - rc = pcu_rx_data_ind_pdtch(bts, data_ind->trx_nr, data_ind->ts_nr, - data_ind->data, data_ind->len, data_ind->fn, - &meas); + rc = pcu_rx_data_ind_pdtch(bts, pdch, data_ind->data, data_ind->len, + data_ind->fn, &meas); gsmtap_chantype = GSMTAP_CHANNEL_PDTCH; break; case PCU_IF_SAPI_BCCH: @@ -394,8 +394,9 @@ static int pcu_rx_data_ind(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_data * gsmtap_chantype = GSMTAP_CHANNEL_BCCH; break; default: - LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with " - "unsupported sapi %d\n", data_ind->sapi); + LOGP(DL1IF, LOGL_ERROR, "(bts=%" PRIu8 ",trx=%" PRIu8 ",ts=%" PRIu8 ") " + "FN=%u Rx DATA.ind with unsupported sapi %d\n", + bts->nr, data_ind->trx_nr, data_ind->ts_nr, data_ind->fn, data_ind->sapi); rc = -EINVAL; gsmtap_chantype = GSMTAP_CHANNEL_UNKNOWN; } diff --git a/src/pcu_l1_if.h b/src/pcu_l1_if.h index e4a46a9e..aff23f5d 100644 --- a/src/pcu_l1_if.h +++ b/src/pcu_l1_if.h @@ -34,6 +34,8 @@ extern "C" { } #endif +#include "pdch.h" + static inline uint8_t qta2ta(int16_t qta) { if (qta < 0) @@ -171,7 +173,7 @@ int pcu_rx_rts_req_ptcch(struct gprs_rlcmac_bts *bts, uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr); int pcu_rx_rach_ind_ptcch(struct gprs_rlcmac_bts *bts, uint8_t trx_nr, uint8_t ts_nr, uint32_t fn, int16_t qta); -int pcu_rx_data_ind_pdtch(struct gprs_rlcmac_bts *bts, uint8_t trx, uint8_t ts, uint8_t *data, +int pcu_rx_data_ind_pdtch(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_pdch *pdch, uint8_t *data, uint8_t len, uint32_t fn, struct pcu_l1_meas *meas); void pcu_rx_block_time(struct gprs_rlcmac_bts *bts, uint16_t arfcn, uint32_t fn, uint8_t ts_no); |