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
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 2184b32..e5e7156 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -133,13 +133,15 @@
 	return 0;
 }
 
-static void setup_bts(BTS *the_bts, uint8_t ts_no)
+static void setup_bts(BTS *the_bts, uint8_t ts_no, uint8_t cs = 1)
 {
 	gprs_rlcmac_bts *bts;
 	gprs_rlcmac_trx *trx;
 
 	bts = the_bts->bts_data();
 	bts->alloc_algorithm = alloc_algorithm_a;
+	bts->initial_cs_dl = cs;
+	bts->initial_cs_ul = cs;
 	trx = &bts->trx[0];
 
 	trx->pdch[ts_no].enable();
@@ -492,7 +494,7 @@
 
 	printf("=== start %s ===\n", __func__);
 
-	setup_bts(&the_bts, ts_no);
+	setup_bts(&the_bts, ts_no, 4);
 	bts = the_bts.bts_data();
 
 	/* needed to set last_rts_fn in the PDCH object */
@@ -524,8 +526,8 @@
 	ul_tbf = the_bts.ul_tbf_by_tfi(tfi, trx_no);
 	OSMO_ASSERT(ul_tbf != NULL);
 
-	fprintf(stderr, "Got '%s', TA=%d\n",
-		ul_tbf->name(), ul_tbf->ta());
+	fprintf(stderr, "Got '%s', TA=%d, CS=%d\n",
+		ul_tbf->name(), ul_tbf->ta(), ul_tbf->current_cs());
 
 	OSMO_ASSERT(ul_tbf->ta() == qta / 4);
 
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index ecdc3fe..0704c0a 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -1130,7 +1130,7 @@
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9)
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
-Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 70 0b 2b 2b 2b 2b 2b 2b 2b 
+Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b 
 Got 'TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW)', TA=7
 UL DATA TFI=0 received (V(Q)=0 .. V(R)=0)
 Creating MS object, TLLI = 0x00000000
@@ -1188,7 +1188,7 @@
 Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)
 Modifying MS object, TLLI = 0xf1223344, TA 0 -> 7
 Change control TS to 7 until assinment is complete.
-Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)', TA=7
+Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)', TA=7, CS=4
 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH)
 +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++
 ------------------------- TX : Packet Uplink Assignment -------------------------