summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-07-06 11:50:34 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-10-23 22:05:49 +0330
commit44fa340a66415b1cbc54a40d553ebe72b1d4685e (patch)
treed9c74533d39e563ddec216b677104ad405df5651
parent40375003b7e6eeeb34fe047306a5b907af6c1ba6 (diff)
host/trxcon: store arfcn and band in trx_instance
-rw-r--r--src/host/trxcon/trx_if.h1
-rw-r--r--src/host/trxcon/trxcon.c10
2 files changed, 6 insertions, 5 deletions
diff --git a/src/host/trxcon/trx_if.h b/src/host/trxcon/trx_if.h
index 1241fd5..4d9e470 100644
--- a/src/host/trxcon/trx_if.h
+++ b/src/host/trxcon/trx_if.h
@@ -24,6 +24,7 @@ struct trx_instance {
struct llist_head trx_ctrl_list;
struct osmo_fsm_inst *fsm;
uint32_t prev_state;
+ uint16_t band_arfcn;
/* Scheduler stuff */
struct trx_sched sched;
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index 791bd25..d88e990 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -36,6 +36,8 @@
#include <osmocom/core/select.h>
#include <osmocom/core/application.h>
+#include <osmocom/gsm/gsm_utils.h>
+
#include "trxcon.h"
#include "trx_if.h"
#include "logging.h"
@@ -80,8 +82,6 @@ static void trxcon_fsm_idle_action(struct osmo_fsm_inst *fi,
static void trxcon_fsm_managed_action(struct osmo_fsm_inst *fi,
uint32_t event, void *data)
{
- uint16_t *band_arfcn;
-
switch (event) {
case L1CTL_EVENT_DISCONNECT:
osmo_fsm_inst_state_chg(trxcon_fsm, TRXCON_STATE_IDLE, 0, 0);
@@ -101,9 +101,9 @@ static void trxcon_fsm_managed_action(struct osmo_fsm_inst *fi,
l1ctl_tx_reset_conf(app_data.l1l, L1CTL_RES_T_BOOT);
break;
case L1CTL_EVENT_FBSB_REQ:
- band_arfcn = (uint16_t *) data;
- trx_if_cmd_rxtune(app_data.trx, *band_arfcn);
- trx_if_cmd_txtune(app_data.trx, *band_arfcn);
+ 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);
break;
case TRX_EVENT_RSP_ERROR: