tbf/rlc: Remove the side-effect from the loop.

This commit is contained in:
Holger Hans Peter Freyther 2013-11-24 22:56:53 +01:00
parent 9977e1545a
commit c15d5cc230
1 changed files with 8 additions and 7 deletions

View File

@ -1618,19 +1618,20 @@ int gprs_rlcmac_tbf::rcv_data_block_acknowledged(const uint8_t *data, size_t len
this->dir.ul.window.v_r());
}
#warning "Move to TBF and remove the index side effect.."
/* Raise V(Q) if possible, and retrieve LLC frames from blocks.
* This is looped until there is a gap (non received block) or
* the window is empty.*/
while (this->dir.ul.window.v_q() != this->dir.ul.window.v_r() && this->dir.ul.v_n.
is_received(index = this->dir.ul.window.v_q() & mod_sns_half)) {
while (this->dir.ul.window.v_q() != this->dir.ul.window.v_r()) {
index = dir.ul.window.v_q() & mod_sns_half;
if (!dir.ul.v_n.is_received(index))
break;
LOGP(DRLCMACUL, LOGL_DEBUG, "- Taking block %d out, raising "
"V(Q) to %d\n", this->dir.ul.window.v_q(),
(this->dir.ul.window.v_q() + 1) & mod_sns);
"V(Q) to %d\n", dir.ul.window.v_q(),
(dir.ul.window.v_q() + 1) & mod_sns);
/* get LLC data from block */
this->assemble_forward_llc(&m_rlc.blocks[index]);
assemble_forward_llc(&m_rlc.blocks[index]);
/* raise V(Q), because block already received */
this->dir.ul.window.increment_q(1);
dir.ul.window.increment_q(1);
}
/* Check CV of last frame in buffer */