aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-10-17 14:43:31 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-10-17 15:07:33 +0700
commit52aa451ae28b43e361d4b6c04a21109dde471be9 (patch)
tree9464da1a030a3444c9b9524d44c585aeb51f9860
parentae09c8acb4aa93284cdb44f8bbdc14533dc4fa52 (diff)
scheduler: ensure PRIM_OP_REQUEST when adding to the queue
-rw-r--r--src/common/scheduler.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index e7cbc83f..f0b8c312 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -651,10 +651,6 @@ struct msgb *_sched_dequeue_prim(struct l1sched_trx *l1t, int8_t tn, uint32_t fn
/* get prim of current fn from queue */
llist_for_each_entry_safe(msg, msg2, &l1ts->dl_prims, list) {
l1sap = msgb_l1sap_prim(msg);
- if (l1sap->oph.operation != PRIM_OP_REQUEST) {
- LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has wrong type.\n");
- goto free_msg;
- }
switch (l1sap->oph.primitive) {
case PRIM_PH_DATA:
chan_nr = l1sap->u.data.chan_nr;
@@ -806,6 +802,7 @@ int trx_sched_ph_data_req(struct l1sched_trx *l1t, struct osmo_phsap_prim *l1sap
"PH-DATA.req: chan_nr=0x%02x link_id=0x%02x\n",
l1sap->u.data.chan_nr, l1sap->u.data.link_id);
+ OSMO_ASSERT(l1sap->oph.operation == PRIM_OP_REQUEST);
OSMO_ASSERT(l1sap->oph.msg);
/* ignore empty frame */
@@ -827,6 +824,7 @@ int trx_sched_tch_req(struct l1sched_trx *l1t, struct osmo_phsap_prim *l1sap)
LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, -1, l1sap->u.tch.fn, "TCH.req: chan_nr=0x%02x\n",
l1sap->u.tch.chan_nr);
+ OSMO_ASSERT(l1sap->oph.operation == PRIM_OP_REQUEST);
OSMO_ASSERT(l1sap->oph.msg);
/* ignore empty frame */