diff --git a/src/tbf.cpp b/src/tbf.cpp index 16a53cc4..097f002c 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -275,10 +275,23 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf) bts_do_rate_ctr_inc(tbf->bts, CTR_TBF_UL_ABORTED); } else { gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf); + gprs_rlc_dl_window *win = static_cast(dl_tbf->window()); + bts_do_rate_ctr_inc(tbf->bts, CTR_TBF_DL_FREED); - if (tbf->state_is(TBF_ST_FLOW)) + if (tbf->state_is(TBF_ST_FLOW)) { bts_do_rate_ctr_inc(tbf->bts, CTR_TBF_DL_ABORTED); - dl_tbf->abort(); + /* range V(A)..V(S)-1 */ + uint16_t lost = win->count_unacked(); + /* report all outstanding packets as lost */ + gprs_rlcmac_received_lost(dl_tbf, 0, lost); + /* TODO: Reschedule all LLC frames starting with the one that is + * (partly) encoded in chunk 1 of block V(A). (optional) */ + } + /* This state change looks unneeded and can probably be dropped at some point: */ + tbf_fsm_state_chg(dl_tbf->state_fsm.fi, TBF_ST_RELEASING); + /* reset rlc states */ + win->reset(); + osmo_fsm_inst_dispatch(dl_tbf->state_fsm.fi, TBF_EV_ASSIGN_DEL_CCCH, NULL); } LOGPTBF(tbf, LOGL_INFO, "free\n"); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 0330a785..9e06917a 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -1261,32 +1261,6 @@ int gprs_rlcmac_dl_tbf::release() return 0; } -int gprs_rlcmac_dl_tbf::abort() -{ - uint16_t lost; - - if (state_is(TBF_ST_FLOW)) { - /* range V(A)..V(S)-1 */ - lost = m_window.count_unacked(); - - /* report all outstanding packets as lost */ - gprs_rlcmac_received_lost(this, 0, lost); - - /* TODO: Reschedule all LLC frames starting with the one that is - * (partly) encoded in chunk 1 of block V(A). (optional) */ - } - - /* This state change looks unneeded and can probably be dropped at some point: */ - tbf_fsm_state_chg(this->state_fsm.fi, TBF_ST_RELEASING); - - /* reset rlc states */ - m_window.reset(); - - osmo_fsm_inst_dispatch(this->state_fsm.fi, TBF_EV_ASSIGN_DEL_CCCH, NULL); - - return 0; -} - int gprs_rlcmac_dl_tbf::rcvd_dl_ack(bool final_ack, unsigned first_bsn, struct bitvec *rbb) { diff --git a/src/tbf_dl.h b/src/tbf_dl.h index 6fddeb52..b8fecde5 100644 --- a/src/tbf_dl.h +++ b/src/tbf_dl.h @@ -61,7 +61,6 @@ struct gprs_rlcmac_dl_tbf : public gprs_rlcmac_tbf { int frames_since_last_drain(unsigned fn) const; bool keep_open(unsigned fn) const; int release(); - int abort(); uint16_t window_size() const; void set_window_size(); void update_coding_scheme_counter_dl(enum CodingScheme cs);