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/.
Harald Welte gerrit-no-reply at lists.osmocom.org
Review at https://gerrit.osmocom.org/6755
host/trxcon/scheduler: git rid of sched_trx_find_ts()
After simplification of timeslot management API this
function does not make sense.
Change-Id: I2fc0c68d784c8f01e1452bc46f8e1eaac2917656
---
M src/host/trxcon/l1ctl.c
M src/host/trxcon/sched_trx.c
M src/host/trxcon/sched_trx.h
3 files changed, 7 insertions(+), 16 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/55/6755/1
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index f9c1cad..b6bc404 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -453,7 +453,7 @@
"(offset=%u ra=0x%02x)\n", req->offset, req->ra);
/* FIXME: can we use other than TS0? */
- ts = sched_trx_find_ts(l1l->trx, 0);
+ ts = l1l->trx->ts_list[0];
if (ts == NULL) {
LOGP(DL1C, LOGL_DEBUG, "Couldn't send RACH: "
"TS0 is not active\n");
@@ -539,13 +539,11 @@
/* Configure requested TS */
rc = sched_trx_configure_ts(l1l->trx, tn, config);
+ ts = l1l->trx->ts_list[tn];
if (rc) {
rc = -EINVAL;
goto exit;
}
-
- /* Find just configured TS */
- ts = sched_trx_find_ts(l1l->trx, tn);
/* Activate only requested lchan, disabling others */
sched_trx_deactivate_all_lchans(ts);
@@ -606,10 +604,10 @@
goto exit;
}
- /* Attempt to find required TS */
- ts = sched_trx_find_ts(l1l->trx, tn);
- if (ts == NULL) {
- LOGP(DL1C, LOGL_DEBUG, "Couldn't find required TS\n");
+ /* Check whether required timeslot is allocated and configured */
+ ts = l1l->trx->ts_list[tn];
+ if (ts == NULL || ts->mf_layout == NULL) {
+ LOGP(DL1C, LOGL_ERROR, "Timeslot %u isn't configured\n", tn);
rc = -EINVAL;
goto exit;
}
diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index cf05bb6..b5f1abc 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -173,12 +173,6 @@
return trx->ts_list[tn];
}
-/* FIXME: one kept here for compatibility reasons */
-struct trx_ts *sched_trx_find_ts(struct trx_instance *trx, int tn)
-{
- return trx->ts_list[tn];
-}
-
void sched_trx_del_ts(struct trx_instance *trx, int tn)
{
struct trx_ts *ts;
@@ -424,7 +418,7 @@
uint8_t offset, bid;
/* Check whether required timeslot is allocated and configured */
- ts = sched_trx_find_ts(trx, tn);
+ ts = trx->ts_list[tn];
if (ts == NULL || ts->mf_layout == NULL) {
LOGP(DSCH, LOGL_DEBUG, "TDMA timeslot #%u isn't configured, "
"ignoring burst...\n", tn);
diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h
index 42953b3..ad2c569 100644
--- a/src/host/trxcon/sched_trx.h
+++ b/src/host/trxcon/sched_trx.h
@@ -251,7 +251,6 @@
/* Timeslot management functions */
struct trx_ts *sched_trx_add_ts(struct trx_instance *trx, int ts_num);
-struct trx_ts *sched_trx_find_ts(struct trx_instance *trx, int ts_num);
void sched_trx_del_ts(struct trx_instance *trx, int ts_num);
int sched_trx_reset_ts(struct trx_instance *trx, int ts_num);
int sched_trx_configure_ts(struct trx_instance *trx, int ts_num,
--
To view, visit https://gerrit.osmocom.org/6755
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fc0c68d784c8f01e1452bc46f8e1eaac2917656
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>