fixeria submitted this change.
trxcon: move FBSB timeout calculation to the trxcon_fsm
In the upcoming patches I am adding a possibility to enlarge the FBSB
timeout by providing API for that. This is needed for SDR based PHYs,
because for them it takes longer to tune and so on. The L1CTL codec
is not the right place for applying PHY specific quirks, so let's
move the TDMA FNs -> ms conversion to the FSM logic.
Change-Id: I685f48cfed000997b0d7c16073c6387bc05d2bbe
Related: OS#5599
---
M src/host/trxcon/include/osmocom/bb/trxcon/trxcon_fsm.h
M src/host/trxcon/src/l1ctl.c
M src/host/trxcon/src/trxcon_fsm.c
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/trxcon_fsm.h b/src/host/trxcon/include/osmocom/bb/trxcon/trxcon_fsm.h
index ec0b2c6..49b5e3a 100644
--- a/src/host/trxcon/include/osmocom/bb/trxcon/trxcon_fsm.h
+++ b/src/host/trxcon/include/osmocom/bb/trxcon/trxcon_fsm.h
@@ -54,7 +54,7 @@
/* param of TRXCON_EV_FBSB_SEARCH_REQ */
struct trxcon_param_fbsb_search_req {
uint16_t band_arfcn;
- uint16_t timeout_ms;
+ uint16_t timeout_fns; /* in TDMA Fn periods */
uint8_t pchan_config;
};
diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c
index e424524..b0516cd 100644
--- a/src/host/trxcon/src/l1ctl.c
+++ b/src/host/trxcon/src/l1ctl.c
@@ -35,8 +35,8 @@
#include <osmocom/core/logging.h>
#include <osmocom/core/utils.h>
-#include <osmocom/gsm/gsm0502.h>
#include <osmocom/gsm/gsm_utils.h>
+#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/protocol/gsm_08_58.h>
#include <osmocom/bb/trxcon/logging.h>
@@ -369,15 +369,15 @@
struct trxcon_param_fbsb_search_req req = {
.pchan_config = l1ctl_ccch_mode2pchan_config(fbsb->ccch_mode),
- .timeout_ms = ntohs(fbsb->timeout) * GSM_TDMA_FN_DURATION_uS / 1000,
+ .timeout_fns = ntohs(fbsb->timeout),
.band_arfcn = ntohs(fbsb->band_arfcn),
};
LOGPFSMSL(fi, g_logc_l1c, LOGL_NOTICE,
- "Received FBSB request (%s %d, timeout %u ms)\n",
+ "Received FBSB request (%s %d, timeout %u TDMA FNs)\n",
arfcn2band_name(req.band_arfcn),
req.band_arfcn & ~ARFCN_FLAG_MASK,
- req.timeout_ms);
+ req.timeout_fns);
osmo_fsm_inst_dispatch(fi, TRXCON_EV_FBSB_SEARCH_REQ, &req);
diff --git a/src/host/trxcon/src/trxcon_fsm.c b/src/host/trxcon/src/trxcon_fsm.c
index eaa4825..10663b1 100644
--- a/src/host/trxcon/src/trxcon_fsm.c
+++ b/src/host/trxcon/src/trxcon_fsm.c
@@ -28,6 +28,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/logging.h>
+#include <osmocom/gsm/gsm0502.h>
#include <osmocom/bb/trxcon/trxcon.h>
#include <osmocom/bb/trxcon/trxcon_fsm.h>
@@ -163,8 +164,10 @@
case TRXCON_EV_FBSB_SEARCH_REQ:
{
const struct trxcon_param_fbsb_search_req *req = data;
+ unsigned long timeout_ms;
- osmo_fsm_inst_state_chg_ms(fi, TRXCON_ST_FBSB_SEARCH, req->timeout_ms, 0);
+ timeout_ms = req->timeout_fns * GSM_TDMA_FN_DURATION_uS / 1000;
+ osmo_fsm_inst_state_chg_ms(fi, TRXCON_ST_FBSB_SEARCH, timeout_ms, 0);
l1sched_configure_ts(trxcon->sched, 0, req->pchan_config);
To view, visit change 30611. To unsubscribe, or for help writing mail filters, visit settings.