diff options
author | Pau Espin Pedrol <pespin@espeweb.net> | 2021-03-02 14:15:17 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@espeweb.net> | 2021-03-02 18:25:33 +0100 |
commit | cf6c71263fc243022fe4756d8c9e38c1ba4d144e (patch) | |
tree | 8fadcf3afe945f60e51d7a014f747ef5bb1bf106 /src | |
parent | 8afc6bad806ac6255a04f0aae8d01a9249a05b1f (diff) |
tbf_dl: fix FBI not set upon X2031 = 0
If Idle TBF timer (X2031) is set to 0, it means the TBF release is
immediately started once all queued data has been scheduled. In that
case, we must set FBI=1 (by setting cv=0) and move to FINISH state.
This used to work over the usual path where X2031 != 0, because release
start will alays happen at a later sched poll time where a dummy LLC
frame is sent and FBI set accordingly.
Change-Id: Ib20602936ae084c413f6bfe14eea33b602020be0
Diffstat (limited to 'src')
-rw-r--r-- | src/tbf_dl.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index d963644b..44baa005 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -700,6 +700,16 @@ int gprs_rlcmac_dl_tbf::create_new_bsn(const uint32_t fn, enum CodingScheme cs) LOGPTBFDL(this, LOGL_DEBUG, "LLC queue completely drained and there's " "still %d free bytes in rlcmac data block\n", space); + + /* We may need to update fbi in header here + * since m_last_dl_drained_fn was updated above + * Specially important when X2031 is 0. */ + is_final = llc_queue_size(llc_queue()) == 0 && !keep_open(fn); + if (is_final) { + rdbi->cv = 0; + TBF_SET_STATE(this, GPRS_RLCMAC_FINISHED); + } + if (mcs_is_edge(cs)) { /* in EGPRS there's no M bit, so we need * to flag padding with LI=127 */ |