aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf_dl.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-02 16:00:41 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-08 09:39:25 +0200
commita700dd9e11d31805cfe8dd07fc27ac96425cbf0c (patch)
tree7a7d6922c8cb5f1dbd3bfe95dcdb72e766bacddf /src/tbf_dl.cpp
parent17214bb06de4a1d8b626dab0f695017b0c74b358 (diff)
tbf: Move the current CS field to GprsMs
Currently the current CS value is stored in the cs field of gprs_rlcmac_tbf and initialised when it is used the first time. This commit adds separate fields for UL and DL CS values to the GprsMs class and provides corresponding getter methods for GprsMs and gprs_rlcmac_tbf. Ticket: #1739 Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf_dl.cpp')
-rw-r--r--src/tbf_dl.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index d1ed1cd9..0aa41a26 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -394,16 +394,16 @@ struct msgb *gprs_rlcmac_dl_tbf::create_new_bsn(const uint32_t fn, const uint8_t
uint16_t space, chunk;
gprs_rlc_data *rlc_data;
const uint16_t bsn = m_window.v_s();
+ uint8_t cs = 1;
LOGP(DRLCMACDL, LOGL_DEBUG, "- Sending new block at BSN %d\n",
m_window.v_s());
-#warning "Selection of the CS doesn't belong here"
- if (cs == 0) {
- cs = bts_data()->initial_cs_dl;
- if (cs < 1 || cs > 4)
- cs = 1;
- }
+ cs = current_cs();
+
+ OSMO_ASSERT(cs >= 1);
+ OSMO_ASSERT(cs <= 4);
+
/* total length of block, including spare bits */
const uint8_t block_length = gprs_rlcmac_cs[cs].block_length;
/* length of usable data of block, w/o spare bits, inc. MAC */