summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-07-08 18:58:51 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-10-23 22:05:49 +0330
commitdd5c09faf65e11a46326407b56e3bf0f9b380e3f (patch)
tree223c8b47e02da3742ec06ffe43f776ecdc82a5ea
parentcb1b60a7c1fbdbdf7fb204ecde57dd95e04b26a5 (diff)
host/trxcon: send L1CTL_DATA_IND directly from lchan handler
-rw-r--r--src/host/trxcon/l1ctl.c1
-rw-r--r--src/host/trxcon/sched_lchan_handlers.c6
-rw-r--r--src/host/trxcon/trxcon.c5
-rw-r--r--src/host/trxcon/trxcon.h1
4 files changed, 5 insertions, 8 deletions
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index c01d372b..ab731949 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -142,7 +142,6 @@ int l1ctl_tx_data_ind(struct l1ctl_link *l1l, struct l1ctl_info_dl *data)
/* Copy header and data from source message */
memcpy(dl, data, len);
- talloc_free(data);
/* Put message to upper layers */
return l1ctl_link_send(l1l, msg);
diff --git a/src/host/trxcon/sched_lchan_handlers.c b/src/host/trxcon/sched_lchan_handlers.c
index 41e60d8b..7c18fdd0 100644
--- a/src/host/trxcon/sched_lchan_handlers.c
+++ b/src/host/trxcon/sched_lchan_handlers.c
@@ -43,6 +43,7 @@
#include "logging.h"
#include "trx_if.h"
#include "trxcon.h"
+#include "l1ctl.h"
extern struct osmo_fsm_inst *trxcon_fsm;
@@ -154,8 +155,9 @@ int rx_data_fn(struct trx_instance *trx, struct trx_ts *ts,
/* Fill in decoded payload */
memcpy(data->payload, l2, 23);
- /* Raise an event to trxcon */
- osmo_fsm_inst_dispatch(trxcon_fsm, SCH_EVENT_DATA, data);
+ /* Put a packet to higher layers */
+ l1ctl_tx_data_ind(trx->l1l, data);
+ talloc_free(data);
/* TODO: AGC, TA loops */
return 0;
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index a87626f2..0ff3a7a4 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -94,8 +94,6 @@ static void trxcon_fsm_managed_action(struct osmo_fsm_inst *fi,
trx_if_cmd_poweroff(app_data.trx);
}
break;
- case SCH_EVENT_DATA:
- l1ctl_tx_data_ind(app_data.l1l, (struct l1ctl_info_dl *) data);
case TRX_EVENT_RSP_ERROR:
case TRX_EVENT_OFFLINE:
case SCH_EVENT_CLCK_IND:
@@ -122,8 +120,7 @@ static struct osmo_fsm_state trxcon_fsm_states[] = {
GEN_MASK(TRX_EVENT_RSP_ERROR) |
GEN_MASK(TRX_EVENT_OFFLINE) |
GEN_MASK(SCH_EVENT_CLCK_IND) |
- GEN_MASK(SCH_EVENT_CLCK_LOSS) |
- GEN_MASK(SCH_EVENT_DATA)),
+ GEN_MASK(SCH_EVENT_CLCK_LOSS)),
.out_state_mask = GEN_MASK(TRXCON_STATE_IDLE),
.name = "MANAGED",
.action = trxcon_fsm_managed_action,
diff --git a/src/host/trxcon/trxcon.h b/src/host/trxcon/trxcon.h
index 6452f803..b3d4e3e2 100644
--- a/src/host/trxcon/trxcon.h
+++ b/src/host/trxcon/trxcon.h
@@ -20,5 +20,4 @@ enum trxcon_fsm_events {
/* Scheduler specific events */
SCH_EVENT_CLCK_IND,
SCH_EVENT_CLCK_LOSS,
- SCH_EVENT_DATA,
};