Review at  https://gerrit.osmocom.org/6701

host/trxcon: send L1CTL_DATA_IND directly from lchan handler

Change-Id: Idfc86a59469c7a0bba1c16177502844e59ed8887
---
M src/host/trxcon/l1ctl.c
M src/host/trxcon/sched_lchan_handlers.c
M src/host/trxcon/trxcon.c
M src/host/trxcon/trxcon.h
4 files changed, 5 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/01/6701/1

diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index c01d372..ab73194 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -142,7 +142,6 @@
 
        /* 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 41e60d8..7c18fdd 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 @@
        /* 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 a87626f..0ff3a7a 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -94,8 +94,6 @@
                        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 @@
                        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 6452f80..b3d4e3e 100644
--- a/src/host/trxcon/trxcon.h
+++ b/src/host/trxcon/trxcon.h
@@ -20,5 +20,4 @@
        /* Scheduler specific events */
        SCH_EVENT_CLCK_IND,
        SCH_EVENT_CLCK_LOSS,
-       SCH_EVENT_DATA,
 };

-- 
To view, visit https://gerrit.osmocom.org/6701
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idfc86a59469c7a0bba1c16177502844e59ed8887
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>

Reply via email to