aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-26 21:03:56 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-04 13:51:43 +0100
commit3c95776805e522007c9e06ac95cdf0557d9cce94 (patch)
tree091183426a6b9b8e79b9245db495d91624f11e0b
parent7a5f3c2153beb5f92b39a93b02ead76bcd0c6150 (diff)
tbf: Separate the handling for rh->si and call in case of re-transmission
In case of a retransmission ack the window again..
-rw-r--r--src/tbf.cpp22
-rw-r--r--src/tbf.h1
2 files changed, 15 insertions, 8 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp
index e882e1f..cc8effa 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -1602,6 +1602,7 @@ int gprs_rlcmac_tbf::rcv_data_block_acknowledged(const uint8_t *data, size_t len
"%d..%d (it's normal)\n", rh->bsn,
dir.ul.window.v_q(),
(dir.ul.window.v_q() + ws - 1) & mod_sns);
+ maybe_schedule_uplink_acknack(rh);
return 0;
}
@@ -1646,8 +1647,15 @@ int gprs_rlcmac_tbf::rcv_data_block_acknowledged(const uint8_t *data, size_t len
/* If TLLI is included or if we received half of the window, we send
* an ack/nack */
- if (rh->si || rh->ti || this->state_is(GPRS_RLCMAC_FINISHED)
- || (this->dir.ul.rx_counter % SEND_ACK_AFTER_FRAMES) == 0) {
+ maybe_schedule_uplink_acknack(rh);
+
+ return 0;
+}
+
+void gprs_rlcmac_tbf::maybe_schedule_uplink_acknack(const rlc_ul_header *rh)
+{
+ if (rh->si || rh->ti || state_is(GPRS_RLCMAC_FINISHED)
+ || (dir.ul.rx_counter % SEND_ACK_AFTER_FRAMES) == 0) {
if (rh->si) {
LOGP(DRLCMACUL, LOGL_NOTICE, "- Scheduling Ack/Nack, "
"because MS is stalled.\n");
@@ -1656,26 +1664,24 @@ int gprs_rlcmac_tbf::rcv_data_block_acknowledged(const uint8_t *data, size_t len
LOGP(DRLCMACUL, LOGL_DEBUG, "- Scheduling Ack/Nack, "
"because TLLI is included.\n");
}
- if (this->state_is(GPRS_RLCMAC_FINISHED)) {
+ if (state_is(GPRS_RLCMAC_FINISHED)) {
LOGP(DRLCMACUL, LOGL_DEBUG, "- Scheduling Ack/Nack, "
"because last block has CV==0.\n");
}
- if ((this->dir.ul.rx_counter % SEND_ACK_AFTER_FRAMES) == 0) {
+ if ((dir.ul.rx_counter % SEND_ACK_AFTER_FRAMES) == 0) {
LOGP(DRLCMACUL, LOGL_DEBUG, "- Scheduling Ack/Nack, "
"because %d frames received.\n",
SEND_ACK_AFTER_FRAMES);
}
- if (this->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE) {
+ if (ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE) {
/* trigger sending at next RTS */
- this->ul_ack_state = GPRS_RLCMAC_UL_ACK_SEND_ACK;
+ ul_ack_state = GPRS_RLCMAC_UL_ACK_SEND_ACK;
} else {
/* already triggered */
LOGP(DRLCMACUL, LOGL_DEBUG, "- Sending Ack/Nack is "
"already triggered, don't schedule!\n");
}
}
-
- return 0;
}
/* Send Uplink unit-data to SGSN. */
diff --git a/src/tbf.h b/src/tbf.h
index 98b9a9b..414bc63 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -237,6 +237,7 @@ protected:
bool dl_window_stalled() const;
int extract_tlli(const uint8_t *data, const size_t len);
+ void maybe_schedule_uplink_acknack(const rlc_ul_header *rh);
int append_data(const uint8_t ms_class,
const uint16_t pdu_delay_csec,