pespin has uploaded this change for review.
rlcmac: tbf_ul_ass_fsm: Fix state not reset after first UL-TBF re-assignment
The FSM can be reused several times to assign a UL TBF over its
lifespan, eg. if a DL TBF DL ACK/NACK is reuse to request allocation of
a UL TBF several times.
Some state like ctx->tbf_starting_time_exists was being left as =true
during the initial run of the FSM, and as a result subsequent runs going
through the check delaying completing after sending the PKT CTRL ACK.
Change-Id: Iaddbd1e3924036be1cf6eed41367031d3e127f57
---
M src/rlcmac/tbf_ul_ass_fsm.c
1 file changed, 31 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/22/34622/1
diff --git a/src/rlcmac/tbf_ul_ass_fsm.c b/src/rlcmac/tbf_ul_ass_fsm.c
index 5b5a892..df5b799 100644
--- a/src/rlcmac/tbf_ul_ass_fsm.c
+++ b/src/rlcmac/tbf_ul_ass_fsm.c
@@ -128,6 +128,12 @@
static int handle_imm_ass(struct gprs_rlcmac_tbf_ul_ass_fsm_ctx *ctx, const struct tbf_ul_ass_ev_rx_ccch_imm_ass_ctx *d)
{
+ /* reset previous state: */
+ memset(&ctx->phase1_alloc, 0, sizeof(ctx->phase1_alloc));
+ ctx->sba = true;
+ ctx->tbf_starting_time_exists = false;
+ ctx->tbf_starting_time = 0;
+
/* TS 44.018 10.5.2.16 IA Rest Octets */
switch (d->iaro->UnionType) {
case 1: /* d->iaro->u.lh.* (IA_RestOctetsLH_t) */
@@ -195,6 +201,12 @@
const Timeslot_Allocation_t *ts_alloc;
const Timeslot_Allocation_Power_Ctrl_Param_t *ts_alloc_pwr_ctl;
+ /* reset previous state: */
+ memset(&ctx->phase2_alloc, 0, sizeof(ctx->phase2_alloc));
+ ctx->sba = false;
+ ctx->tbf_starting_time_exists = false;
+ ctx->tbf_starting_time = 0;
+
switch (ulass->UnionType) {
case 0: /* ulass->u.PUA_GPRS_Struct.* (PUA_GPRS_t) */
ctx->ul_tbf->tx_cs = ulass->u.PUA_GPRS_Struct.CHANNEL_CODING_COMMAND + 1;
@@ -258,7 +270,9 @@
ctx->dl_tbf = NULL;
memset(&ctx->phase1_alloc, 0, sizeof(ctx->phase1_alloc));
memset(&ctx->phase2_alloc, 0, sizeof(ctx->phase2_alloc));
+ ctx->sba = false;
ctx->tbf_starting_time_exists = false;
+ ctx->tbf_starting_time = 0;
}
static void st_idle(struct osmo_fsm_inst *fi, uint32_t event, void *data)
@@ -369,7 +383,6 @@
data_ctx->msg = create_pkt_resource_req(ctx, data_ctx);
if (!data_ctx->msg)
return;
- ctx->sba = false; /* Reset state */
tbf_ul_ass_fsm_state_chg(fi, GPRS_RLCMAC_TBF_UL_ASS_ST_WAIT_PKT_UL_ASS);
break;
default:
To view, visit change 34622. To unsubscribe, or for help writing mail filters, visit settings.