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/6694
host/trxcon: handle ccch_mode from L1CTL_FBSB_REQ
Previously, the content of L1CTL_FBSB_REQ message was only used
to obtain a new ARFCN and retune transceiver. Now, since we have
working TDMA scheduler, some other params (like ccch_mode) may be
used too.
Change-Id: Iccabba376d67e091b55a604a2ae87f2aa86362e5
---
M src/host/trxcon/l1ctl.c
M src/host/trxcon/trxcon.c
2 files changed, 42 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/94/6694/1
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 26670f1..0bb26f7 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -125,7 +125,7 @@
static int l1ctl_rx_fbsb_req(struct l1ctl_link *l1l, struct msgb *msg)
{
- struct l1ctl_fbsb_req *fbsb;
+ struct l1ctl_fbsb_req *fbsb, *fbsb_copy;
uint16_t band_arfcn;
int rc = 0;
@@ -143,8 +143,19 @@
gsm_band_name(gsm_arfcn2band(band_arfcn)),
band_arfcn &~ ARFCN_FLAG_MASK);
- osmo_fsm_inst_dispatch(trxcon_fsm,
- L1CTL_EVENT_FBSB_REQ, &band_arfcn);
+ /**
+ * We cannot simply pass a pointer to fbsb,
+ * because the memory will be freed.
+ *
+ * TODO: better solution?
+ */
+ fbsb_copy = talloc_memdup(l1l, fbsb, sizeof(struct l1ctl_fbsb_req));
+ if (fbsb_copy == NULL) {
+ rc = -EINVAL;
+ goto exit;
+ }
+
+ osmo_fsm_inst_dispatch(trxcon_fsm, L1CTL_EVENT_FBSB_REQ, fbsb_copy);
exit:
msgb_free(msg);
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index d88e990..6f50d1a 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -29,6 +29,8 @@
#include <unistd.h>
#include <signal.h>
+#include <arpa/inet.h>
+
#include <osmocom/core/fsm.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/talloc.h>
@@ -72,6 +74,31 @@
void *tall_trx_ctx = NULL;
struct osmo_fsm_inst *trxcon_fsm;
+static void trxcon_handle_fbsb_req(struct l1ctl_fbsb_req *req)
+{
+ uint16_t band_arfcn;
+
+ /* Reset L1 */
+ sched_trx_reset(app_data.trx);
+
+ /* Configure a single timeslot */
+ if (req->ccch_mode == CCCH_MODE_COMBINED)
+ sched_trx_configure_ts(app_data.trx, 0, GSM_PCHAN_CCCH_SDCCH4);
+ else
+ sched_trx_configure_ts(app_data.trx, 0, GSM_PCHAN_CCCH);
+
+ /* Store current ARFCN */
+ band_arfcn = ntohs(req->band_arfcn);
+ app_data.trx->band_arfcn = band_arfcn;
+
+ /* Tune transceiver to required ARFCN */
+ trx_if_cmd_rxtune(app_data.trx, band_arfcn);
+ trx_if_cmd_txtune(app_data.trx, band_arfcn);
+ trx_if_cmd_poweron(app_data.trx);
+
+ talloc_free(req);
+}
+
static void trxcon_fsm_idle_action(struct osmo_fsm_inst *fi,
uint32_t event, void *data)
{
@@ -101,10 +128,7 @@
l1ctl_tx_reset_conf(app_data.l1l, L1CTL_RES_T_BOOT);
break;
case L1CTL_EVENT_FBSB_REQ:
- app_data.trx->band_arfcn = *((uint16_t *) data);
- trx_if_cmd_rxtune(app_data.trx, app_data.trx->band_arfcn);
- trx_if_cmd_txtune(app_data.trx, app_data.trx->band_arfcn);
- trx_if_cmd_poweron(app_data.trx);
+ trxcon_handle_fbsb_req((struct l1ctl_fbsb_req *) data);
break;
case TRX_EVENT_RSP_ERROR:
case TRX_EVENT_OFFLINE:
--
To view, visit https://gerrit.osmocom.org/6694
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iccabba376d67e091b55a604a2ae87f2aa86362e5
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>