aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf_dl.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2016-01-21 20:42:40 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-08 00:45:37 +0100
commitf04a5b33ecf01a9bdbd7e971cddb0a87608d04a6 (patch)
treeec61a3b19d6123e7211a1ca8ab636d936d4d1aab /src/tbf_dl.cpp
parent0316dc6e4808d0413a4edf3738edea44193228e4 (diff)
tbf: Add abort method for downlink TBF
Currently the is a release() function which takes care of statistics and shutdown of properly finished TBFs, but which cannot be used for aborted TBFs. This commit add an abort() method which handles unacked RLC blocks as lost and doesn't start a release timer. This method will be invoked by tbf_free() for downlink TBF. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf_dl.cpp')
-rw-r--r--src/tbf_dl.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index a55f179e..64ebea4f 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -894,6 +894,33 @@ int gprs_rlcmac_dl_tbf::release()
return 0;
}
+int gprs_rlcmac_dl_tbf::abort()
+{
+ uint16_t lost;
+
+ if (state_is(GPRS_RLCMAC_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);
+ gprs_rlcmac_lost_rep(this);
+
+ /* TODO: Reschedule all LLC frames starting with the one that is
+ * (partly) encoded in chunk 1 of block V(A). (optional) */
+ }
+
+ set_state(GPRS_RLCMAC_RELEASING);
+
+ /* reset rlc states */
+ m_window.reset();
+
+ /* keep to flags */
+ state_flags &= GPRS_RLCMAC_FLAG_TO_MASK;
+ state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH);
+
+ return 0;
+}
int gprs_rlcmac_dl_tbf::rcvd_dl_ack(uint8_t final_ack, unsigned first_bsn,
struct bitvec *rbb)