This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Vadim Yanitskiy gerrit-no-reply at lists.osmocom.orgVadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/17301 )
Change subject: trxcon/scheduler: print completeness of the Rx burst buffers
......................................................................
trxcon/scheduler: print completeness of the Rx burst buffers
Change-Id: Ife9f5eabc23aa2eea08b190361e10a98e890d608
Related: OS#3554
---
M src/host/trxcon/sched_lchan_common.c
M src/host/trxcon/sched_lchan_pdtch.c
M src/host/trxcon/sched_lchan_tchf.c
M src/host/trxcon/sched_lchan_tchh.c
M src/host/trxcon/sched_lchan_xcch.c
M src/host/trxcon/sched_trx.h
6 files changed, 33 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/01/17301/1
diff --git a/src/host/trxcon/sched_lchan_common.c b/src/host/trxcon/sched_lchan_common.c
index d8d9ee1..813f315 100644
--- a/src/host/trxcon/sched_lchan_common.c
+++ b/src/host/trxcon/sched_lchan_common.c
@@ -2,7 +2,7 @@
* OsmocomBB <-> SDR connection bridge
* TDMA scheduler: common routines for lchan handlers
*
- * (C) 2017-2019 by Vadim Yanitskiy <axilirator at gmail.com>
+ * (C) 2017-2020 by Vadim Yanitskiy <axilirator at gmail.com>
*
* All Rights Reserved
*
@@ -84,6 +84,25 @@
},
};
+/* Get a string representation of the burst buffer's completeness.
+ * Examples: " ****.." (incomplete, 4/6 bursts)
+ * " ****" (complete, all 4 bursts)
+ * "**.***.." (incomplete, 5/8 bursts) */
+const char *burst_mask2str(const uint8_t *mask, int bits)
+{
+ /* TODO: CSD is interleaved over 22 bursts, so the mask needs to be extended */
+ static char buf[8 + 1];
+ char *ptr = buf;
+
+ OSMO_ASSERT(bits <= 8 && bits > 0);
+
+ while (--bits >= 0)
+ *(ptr++) = (*mask & (1 << bits)) ? '*' : '.';
+ *ptr = '\0';
+
+ return buf;
+}
+
int sched_gsmtap_send(enum trx_lchan_type lchan_type, uint32_t fn, uint8_t tn,
uint16_t band_arfcn, int8_t signal_dbm, uint8_t snr,
const uint8_t *data, size_t data_len)
diff --git a/src/host/trxcon/sched_lchan_pdtch.c b/src/host/trxcon/sched_lchan_pdtch.c
index 733e574..83a6f53 100644
--- a/src/host/trxcon/sched_lchan_pdtch.c
+++ b/src/host/trxcon/sched_lchan_pdtch.c
@@ -88,8 +88,9 @@
/* Check for complete set of bursts */
if ((*mask & 0xf) != 0xf) {
- LOGP(DSCHD, LOGL_ERROR, "Received incomplete data frame at "
- "fn=%u (%u/%u) for %s\n", *first_fn,
+ LOGP(DSCHD, LOGL_ERROR, "Received incomplete (%s) data frame at "
+ "fn=%u (%u/%u) for %s\n",
+ burst_mask2str(mask, 4), *first_fn,
(*first_fn) % ts->mf_layout->period,
ts->mf_layout->period,
lchan_desc->name);
diff --git a/src/host/trxcon/sched_lchan_tchf.c b/src/host/trxcon/sched_lchan_tchf.c
index f2ecdcc..0109280 100644
--- a/src/host/trxcon/sched_lchan_tchf.c
+++ b/src/host/trxcon/sched_lchan_tchf.c
@@ -90,8 +90,9 @@
/* Check for complete set of bursts */
if ((*mask & 0xf) != 0xf) {
- LOGP(DSCHD, LOGL_ERROR, "Received incomplete traffic frame at "
- "fn=%u (%u/%u) for %s\n", *first_fn,
+ LOGP(DSCHD, LOGL_ERROR, "Received incomplete (%s) traffic frame at "
+ "fn=%u (%u/%u) for %s\n",
+ burst_mask2str(mask, 8), *first_fn,
(*first_fn) % ts->mf_layout->period,
ts->mf_layout->period,
lchan_desc->name);
diff --git a/src/host/trxcon/sched_lchan_tchh.c b/src/host/trxcon/sched_lchan_tchh.c
index 0201ee3..8288670 100644
--- a/src/host/trxcon/sched_lchan_tchh.c
+++ b/src/host/trxcon/sched_lchan_tchh.c
@@ -299,8 +299,9 @@
/* Check decoding result */
if (rc < 4) {
- LOGP(DSCHD, LOGL_ERROR, "Received bad TCH frame ending at "
- "fn=%u on %s (rc=%d)\n", fn, lchan_desc->name, rc);
+ LOGP(DSCHD, LOGL_ERROR, "Received bad TCH frame (%s) ending at "
+ "fn=%u on %s (rc=%d)\n", burst_mask2str(mask, 6),
+ fn, lchan_desc->name, rc);
/* Send BFI */
goto bfi;
diff --git a/src/host/trxcon/sched_lchan_xcch.c b/src/host/trxcon/sched_lchan_xcch.c
index d341646..34fe5ce 100644
--- a/src/host/trxcon/sched_lchan_xcch.c
+++ b/src/host/trxcon/sched_lchan_xcch.c
@@ -87,8 +87,9 @@
/* Check for complete set of bursts */
if ((*mask & 0xf) != 0xf) {
- LOGP(DSCHD, LOGL_ERROR, "Received incomplete data frame at "
- "fn=%u (%u/%u) for %s\n", *first_fn,
+ LOGP(DSCHD, LOGL_ERROR, "Received incomplete (%s) data frame at "
+ "fn=%u (%u/%u) for %s\n",
+ burst_mask2str(mask, 4), *first_fn,
(*first_fn) % ts->mf_layout->period,
ts->mf_layout->period,
lchan_desc->name);
diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h
index 8718ed6..13fc678 100644
--- a/src/host/trxcon/sched_trx.h
+++ b/src/host/trxcon/sched_trx.h
@@ -355,6 +355,7 @@
/* Shared declarations for lchan handlers */
extern const uint8_t sched_nb_training_bits[8][26];
+const char *burst_mask2str(const uint8_t *mask, int bits);
size_t sched_bad_frame_ind(uint8_t *l2, struct trx_lchan_state *lchan);
int sched_send_dt_ind(struct trx_instance *trx, struct trx_ts *ts,
struct trx_lchan_state *lchan, uint8_t *l2, size_t l2_len,
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/17301
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ife9f5eabc23aa2eea08b190361e10a98e890d608
Gerrit-Change-Number: 17301
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200229/3cb5a28e/attachment.htm>