tbf/rlc: Move the putting of a block into the rlc code

This commit is contained in:
Holger Hans Peter Freyther 2013-11-25 23:24:29 +01:00
parent 4c06d9155c
commit 423dd2286b
3 changed files with 8 additions and 2 deletions

View File

@ -34,6 +34,12 @@ uint8_t *gprs_rlc_data::prepare(size_t block_data_len)
return block;
}
void gprs_rlc_data::put_data(const uint8_t *data, size_t data_len)
{
memcpy(block, data, data_len);
len = data_len;
}
void gprs_rlc_v_b::reset()
{
for (size_t i = 0; i < ARRAY_SIZE(m_v_b); ++i)

View File

@ -29,6 +29,7 @@ class BTS;
struct gprs_rlc_data {
uint8_t *prepare(size_t block_data_length);
void put_data(const uint8_t *data, size_t len);
/* block history */
uint8_t block[RLC_MAX_LEN];

View File

@ -1607,8 +1607,7 @@ int gprs_rlcmac_tbf::rcv_data_block_acknowledged(const uint8_t *data, size_t len
/* Write block to buffer and set receive state array. */
index = rh->bsn & mod_sns_half; /* memory index of block */
memcpy(m_rlc.blocks[index].block, data, len); /* Copy block. */
m_rlc.blocks[index].len = len;
m_rlc.blocks[index].put_data(data, len);
dir.ul.v_n.mark_received(index);
LOGP(DRLCMACUL, LOGL_DEBUG, "- BSN %d storing in window (%d..%d)\n",
rh->bsn, dir.ul.window.v_q(),