Move WAIT_RELEASE tbf_state transition to tbf_fsm

While at it, method maybe_start_new_window is renamed to
rcvd_dl_final_ack to make more sense out of the code.

Related: OS#2709
Change-Id: Iebd650c1036ef2d5132789778be7117ce3391c01
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index ed5003c..6614366 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -1219,8 +1219,9 @@
 }
 
 
-int gprs_rlcmac_dl_tbf::maybe_start_new_window()
+int gprs_rlcmac_dl_tbf::rcvd_dl_final_ack()
 {
+	osmo_fsm_inst_dispatch(this->state_fsm.fi, TBF_EV_FINAL_ACK_RECVD, NULL);
 	release();
 
 	/* check for LLC PDU in the LLC Queue */
@@ -1241,8 +1242,6 @@
 	/* report all outstanding packets as received */
 	gprs_rlcmac_received_lost(this, received, 0);
 
-	TBF_SET_STATE(this, TBF_ST_WAIT_RELEASE);
-
 	/* start T3193 */
 	T_START(this, T3193, 3193, "release (DL-TBF)", true);
 
@@ -1292,7 +1291,7 @@
 
 	if (final_ack) {
 		LOGPTBFDL(this, LOGL_DEBUG, "Final ACK received.\n");
-		rc = maybe_start_new_window();
+		rc = rcvd_dl_final_ack();
 	} else if (state_is(TBF_ST_FINISHED) && m_window.window_empty()) {
 		LOGPTBFDL(this, LOGL_NOTICE,
 			  "Received acknowledge of all blocks, but without final ack indication (don't worry)\n");
@@ -1309,7 +1308,7 @@
 		return update_window(ssn, rbb);
 
 	LOGPTBFDL(this, LOGL_DEBUG, "Final ACK received.\n");
-	return maybe_start_new_window();
+	return rcvd_dl_final_ack();
 }
 
 bool gprs_rlcmac_dl_tbf::dl_window_stalled() const