summaryrefslogtreecommitdiffstats
path: root/src/host/trxcon/trxcon.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2016-07-25 00:20:37 +0600
committerVadim Yanitskiy <axilirator@gmail.com>2017-11-19 17:35:07 +0700
commit90a0d3c78dbebc9722629c31dd8fcdf19c148cb4 (patch)
tree4fd5ecfb30bcf540c36529824a0cb16db2fe09c3 /src/host/trxcon/trxcon.c
parent423aeefc4047038417b8da49aa5887553ffcfad3 (diff)
host/trxcon: initial release of L1CTL handlers
Now it's possible to handle the following requests from layer23 apps: - L1CTL_FBSB_REQ - L1CTL_PM_REQ - L1CTL_RESET_REQ - L1CTL_ECHO_REQ It should be noted, that the L1CTL_PM_REQ isn't handled correctly yet, due to required task isn't implemented on the TRX side yet. Instead of this, temporary we are sending some fake responses. Change-Id: I343eca3e20922ddd83e06231811200b26da442f3
Diffstat (limited to 'src/host/trxcon/trxcon.c')
-rw-r--r--src/host/trxcon/trxcon.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index 5874560d..a90d038d 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -39,7 +39,9 @@
#include "trxcon.h"
#include "trx_if.h"
#include "logging.h"
+#include "l1ctl.h"
#include "l1ctl_link.h"
+#include "l1ctl_proto.h"
#define COPYRIGHT \
"Copyright (C) 2016-2017 by Vadim Yanitskiy <axilirator@gmail.com>\n" \
@@ -76,6 +78,8 @@ 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);
@@ -85,7 +89,19 @@ static void trxcon_fsm_managed_action(struct osmo_fsm_inst *fi,
trx_if_cmd_poweroff(app_data.trx);
}
break;
+ case L1CTL_EVENT_RESET_REQ:
+ trx_if_cmd_echo(app_data.trx);
+ break;
case TRX_EVENT_RESET_IND:
+ /* TODO: send proper reset type */
+ 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);
+ trx_if_cmd_poweron(app_data.trx);
+ break;
case TRX_EVENT_RSP_ERROR:
case TRX_EVENT_OFFLINE:
/* TODO: notify L2 & L3 about that */
@@ -105,6 +121,8 @@ static struct osmo_fsm_state trxcon_fsm_states[] = {
[TRXCON_STATE_MANAGED] = {
.in_event_mask = (
GEN_MASK(L1CTL_EVENT_DISCONNECT) |
+ GEN_MASK(L1CTL_EVENT_FBSB_REQ) |
+ GEN_MASK(L1CTL_EVENT_RESET_REQ) |
GEN_MASK(TRX_EVENT_RESET_IND) |
GEN_MASK(TRX_EVENT_RSP_ERROR) |
GEN_MASK(TRX_EVENT_OFFLINE)),