ms: Drop setting (egprs_)ms_class during bts_alloc_ms()

That information is not required during allocation of the object, and
most times it is not known.
Defer setting it only to meaningul values in paths obtaining the
information from peers.

Change-Id: I36f07dc389f7abe205fc4bcddbde93735f5d5cfc
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index 08f5910..3282268 100644
--- a/tests/alloc/AllocTest.cpp
+++ b/tests/alloc/AllocTest.cpp
@@ -135,7 +135,7 @@
 	 * least this part is working okay.
 	 */
 	for (i = 0; i < (int)ARRAY_SIZE(tbfs); ++i) {
-		ms = bts_alloc_ms(bts, 0, 0);
+		ms = bts_alloc_ms(bts);
 		tbfs[i] = tbf_alloc(bts, ms, dir, -1, 0);
 		if (tbfs[i] == NULL)
 			break;
@@ -155,7 +155,7 @@
 		if (tbfs[i])
 			tbf_free(tbfs[i]);
 
-	ms = bts_alloc_ms(bts, 0, 0);
+	ms = bts_alloc_ms(bts);
 	tbfs[0] = tbf_alloc(bts, ms, dir, -1, 0);
 	OSMO_ASSERT(tbfs[0]);
 	tbf_free(tbfs[0]);
@@ -221,7 +221,8 @@
 
 	enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7);
 
-	ms = bts_alloc_ms(bts, ms_class, 0);
+	ms = bts_alloc_ms(bts);
+	ms_set_ms_class(ms, ms_class);
 	/* Avoid delaying free to avoid tons of to-be-freed ms objects queuing */
 	ms_set_timeout(ms, 0);
 	ul_tbf = ul_tbf_alloc(bts, ms, -1, true);
@@ -263,7 +264,8 @@
 
 	enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7);
 
-	ms = bts_alloc_ms(bts, ms_class, 0);
+	ms = bts_alloc_ms(bts);
+	ms_set_ms_class(ms, ms_class);
 	/* Avoid delaying free to avoid tons of to-be-freed ms objects queuing */
 	ms_set_timeout(ms, 0);
 	dl_tbf = dl_tbf_alloc(bts, ms, -1, true);
@@ -313,7 +315,8 @@
 
 	tfi = bts_tfi_find_free(bts, GPRS_RLCMAC_UL_TBF, &trx_no, -1);
 	OSMO_ASSERT(tfi >= 0);
-	ms = bts_alloc_ms(bts, ms_class, 0);
+	ms = bts_alloc_ms(bts);
+	ms_set_ms_class(ms, ms_class);
 	/* Avoid delaying free to avoid tons of to-be-freed ms objects queuing */
 	ms_set_timeout(ms, 0);
 	ul_tbf = ul_tbf_alloc(bts, ms, -1, false);
@@ -558,7 +561,7 @@
 
 		ms = bts_ms_by_tlli(bts, tlli, GSM_RESERVED_TMSI);
 		if (!ms)
-			ms = bts_alloc_ms(bts, 0, 0);
+			ms = bts_alloc_ms(bts);
 		ms_set_ms_class(ms, ms_class);
 		ms = alloc_tbfs(bts, ms, mode);
 		if (!ms)
@@ -767,7 +770,9 @@
 	trx->pdch[6].enable();
 	trx->pdch[7].enable();
 
-	ms = bts_alloc_ms(bts, ms_class, egprs_ms_class);
+	ms = bts_alloc_ms(bts);
+	ms_set_ms_class(ms, ms_class);
+	ms_set_egprs_ms_class(ms, egprs_ms_class);
 	dl_tbf1 = dl_tbf_alloc(bts, ms, 0, false);
 	OSMO_ASSERT(dl_tbf1);
 
@@ -778,7 +783,9 @@
 	OSMO_ASSERT(numTs1 == 4);
 	printf("TBF1: numTs(%d)\n", numTs1);
 
-	ms = bts_alloc_ms(bts, ms_class, egprs_ms_class);
+	ms = bts_alloc_ms(bts);
+	ms_set_ms_class(ms, ms_class);
+	ms_set_egprs_ms_class(ms, egprs_ms_class);
 	dl_tbf2 = dl_tbf_alloc(bts, ms, 0, false);
 	OSMO_ASSERT(dl_tbf2);
 
diff --git a/tests/app_info/AppInfoTest.cpp b/tests/app_info/AppInfoTest.cpp
index 659c011..1a4e660 100644
--- a/tests/app_info/AppInfoTest.cpp
+++ b/tests/app_info/AppInfoTest.cpp
@@ -17,6 +17,7 @@
 #include "gprs_rlcmac.h"
 #include "bts.h"
 #include "tbf_dl.h"
+#include "gprs_ms.h"
 
 extern "C" {
 #include <osmocom/vty/telnet_interface.h>
@@ -89,9 +90,13 @@
 	trx->pdch[6].enable();
 	trx->pdch[7].enable();
 
-	ms1 = bts_alloc_ms(bts, 10, 11);
+	ms1 = bts_alloc_ms(bts);
+	ms_set_ms_class(ms1, 10);
+	ms_set_egprs_ms_class(ms1, 11);
 	tbf1 = dl_tbf_alloc(bts, ms1, 0, false);
-	ms2 = bts_alloc_ms(bts, 12, 13);
+	ms2 = bts_alloc_ms(bts);
+	ms_set_ms_class(ms2, 12);
+	ms_set_egprs_ms_class(ms2, 13);
 	tbf2 = dl_tbf_alloc(bts, ms2, 0, false);
 
 	fprintf(stderr, "\n");
diff --git a/tests/llc/LlcTest.cpp b/tests/llc/LlcTest.cpp
index 547dc79..3c19787 100644
--- a/tests/llc/LlcTest.cpp
+++ b/tests/llc/LlcTest.cpp
@@ -52,7 +52,7 @@
 	the_pcu = gprs_pcu_alloc(tall_pcu_ctx);
 	the_pcu->vty.llc_codel_interval_msec = LLC_CODEL_DISABLE;
 	struct gprs_rlcmac_bts *bts = bts_alloc(the_pcu, 0);
-	struct GprsMs *ms = bts_alloc_ms(bts, 0, 0);
+	struct GprsMs *ms = bts_alloc_ms(bts);
 	return ms_llc_queue(ms);
 }
 
@@ -235,7 +235,7 @@
 	/* DEFAULT should be resolved to GPRS_CODEL_SLOW_INTERVAL_MS 4000 */
 	#define GPRS_CODEL_SLOW_INTERVAL_MS 4000
 	struct gprs_rlcmac_bts *bts = bts_alloc(the_pcu, 0);
-	struct GprsMs *ms = bts_alloc_ms(bts, 0, 0);
+	struct GprsMs *ms = bts_alloc_ms(bts);
 	gprs_llc_queue *queue = ms_llc_queue(ms);
 	unsigned int i;
 
@@ -297,7 +297,7 @@
 static void test_llc_merge()
 {
 	gprs_llc_queue *queue1 = prepare_queue();
-	struct GprsMs *ms = bts_alloc_ms(queue1->ms->bts, 0, 0);
+	struct GprsMs *ms = bts_alloc_ms(queue1->ms->bts);
 	gprs_llc_queue *queue2 = ms_llc_queue(ms);
 	struct timespec expire_time = {0};
 
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index cc62bc2..63074d0 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -123,7 +123,7 @@
 	/*
 	 * Make a uplink and downlink allocation
 	 */
-	ms = bts_alloc_ms(bts, 0, 0);
+	ms = bts_alloc_ms(bts);
 	gprs_rlcmac_tbf *dl_tbf = dl_tbf_alloc(bts,
 						ms, 0, false);
 	OSMO_ASSERT(dl_tbf != NULL);
@@ -206,7 +206,9 @@
 	GprsMs *ms;
 	gprs_rlcmac_dl_tbf *dl_tbf;
 
-	ms = bts_alloc_ms(bts, ms_class, egprs_ms_class);
+	ms = bts_alloc_ms(bts);
+	ms_set_ms_class(ms, ms_class);
+	ms_set_egprs_ms_class(ms, egprs_ms_class);
 
 	tfi = bts_tfi_find_free(bts, GPRS_RLCMAC_DL_TBF, &trx_no, -1);
 	OSMO_ASSERT(tfi >= 0);
@@ -2345,7 +2347,8 @@
 	gprs_bssgp_init(bts, 4234, 4234, 1, 1, false, 0, 0, 0);
 
 	/* Does no support EGPRS */
-	ms = bts_alloc_ms(bts, ms_class, 0);
+	ms = bts_alloc_ms(bts);
+	ms_set_ms_class(ms, ms_class);
 	dl_tbf = dl_tbf_alloc(bts, ms, 0, false);
 
 	ws_check(dl_tbf, __func__, 4, 64, true);
@@ -2353,7 +2356,9 @@
 	/* EGPRS-only */
 
 	/* Does support EGPRS */
-	ms = bts_alloc_ms(bts, ms_class, ms_class);
+	ms = bts_alloc_ms(bts);
+	ms_set_ms_class(ms, ms_class);
+	ms_set_egprs_ms_class(ms, ms_class);
 	dl_tbf = dl_tbf_alloc(bts, ms, 0, false);
 
 	ws_check(dl_tbf, __func__, 4, 128 + 4 * 64, true);
@@ -2393,7 +2398,9 @@
 	/* EGPRS-only */
 
 	/* Does support EGPRS */
-	ms = bts_alloc_ms(bts, ms_class, ms_class);
+	ms = bts_alloc_ms(bts);
+	ms_set_ms_class(ms, ms_class);
+	ms_set_egprs_ms_class(ms, ms_class);
 	dl_tbf = dl_tbf_alloc(bts, ms, 0, true);
 
 	ws_check(dl_tbf, __func__, 1, 128 + 1 * 64, false);
@@ -2470,7 +2477,7 @@
 	trx0->pdch[2].enable();
 	trx0->pdch[3].enable();
 
-	second_ms = bts_alloc_ms(bts, 0, 0);
+	second_ms = bts_alloc_ms(bts);
 	ms_set_tlli(second_ms, new_tlli);
 	ul_tbf = ul_tbf_alloc(bts, second_ms, 0, true);
 	OSMO_ASSERT(ul_tbf != NULL);
@@ -3329,7 +3336,7 @@
 
 	int rc = 0;
 
-	ms = bts_alloc_ms(bts, 0, 0);
+	ms = bts_alloc_ms(bts);
 	ms_set_tlli(ms, tlli);
 	ul_tbf = ms_new_ul_tbf_rejected_pacch(ms, pdch);
 
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index b10bef4..73f2903 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -644,9 +644,9 @@
 === start test_tbf_exhaustion ===
 PDCH(bts=0,trx=0,ts=4) PDCH state: disabled => enabled
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000000'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000000, partly confirmed
+Modifying MS object, TLLI = 0xc0000000, MS class 0 -> 45
 MS(IMSI-001001000000000:TLLI-0xc0000000:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000000:TLLI-0xc0000000:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000000:TLLI-0xc0000000:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -674,9 +674,9 @@
 TBF(DL:TFI-0-0-0:STATE-ASSIGN:GPRS:IMSI-001001000000000:TLLI-0xc0000000) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000001'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000001, partly confirmed
+Modifying MS object, TLLI = 0xc0000001, MS class 0 -> 45
 MS(IMSI-001001000000001:TLLI-0xc0000001:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000001:TLLI-0xc0000001:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000001:TLLI-0xc0000001:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -704,9 +704,9 @@
 TBF(DL:TFI-0-0-1:STATE-ASSIGN:GPRS:IMSI-001001000000001:TLLI-0xc0000001) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000002'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000002, partly confirmed
+Modifying MS object, TLLI = 0xc0000002, MS class 0 -> 45
 MS(IMSI-001001000000002:TLLI-0xc0000002:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000002:TLLI-0xc0000002:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000002:TLLI-0xc0000002:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -734,9 +734,9 @@
 TBF(DL:TFI-0-0-2:STATE-ASSIGN:GPRS:IMSI-001001000000002:TLLI-0xc0000002) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000003'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000003, partly confirmed
+Modifying MS object, TLLI = 0xc0000003, MS class 0 -> 45
 MS(IMSI-001001000000003:TLLI-0xc0000003:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000003:TLLI-0xc0000003:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000003:TLLI-0xc0000003:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -764,9 +764,9 @@
 TBF(DL:TFI-0-0-3:STATE-ASSIGN:GPRS:IMSI-001001000000003:TLLI-0xc0000003) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000004'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000004, partly confirmed
+Modifying MS object, TLLI = 0xc0000004, MS class 0 -> 45
 MS(IMSI-001001000000004:TLLI-0xc0000004:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000004:TLLI-0xc0000004:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000004:TLLI-0xc0000004:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -794,9 +794,9 @@
 TBF(DL:TFI-0-0-4:STATE-ASSIGN:GPRS:IMSI-001001000000004:TLLI-0xc0000004) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000005'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000005, partly confirmed
+Modifying MS object, TLLI = 0xc0000005, MS class 0 -> 45
 MS(IMSI-001001000000005:TLLI-0xc0000005:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000005:TLLI-0xc0000005:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000005:TLLI-0xc0000005:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -824,9 +824,9 @@
 TBF(DL:TFI-0-0-5:STATE-ASSIGN:GPRS:IMSI-001001000000005:TLLI-0xc0000005) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000006'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000006, partly confirmed
+Modifying MS object, TLLI = 0xc0000006, MS class 0 -> 45
 MS(IMSI-001001000000006:TLLI-0xc0000006:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000006:TLLI-0xc0000006:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000006:TLLI-0xc0000006:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -854,9 +854,9 @@
 TBF(DL:TFI-0-0-6:STATE-ASSIGN:GPRS:IMSI-001001000000006:TLLI-0xc0000006) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000007'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000007, partly confirmed
+Modifying MS object, TLLI = 0xc0000007, MS class 0 -> 45
 MS(IMSI-001001000000007:TLLI-0xc0000007:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000007:TLLI-0xc0000007:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000007:TLLI-0xc0000007:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -884,9 +884,9 @@
 TBF(DL:TFI-0-0-7:STATE-ASSIGN:GPRS:IMSI-001001000000007:TLLI-0xc0000007) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000008'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000008, partly confirmed
+Modifying MS object, TLLI = 0xc0000008, MS class 0 -> 45
 MS(IMSI-001001000000008:TLLI-0xc0000008:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000008:TLLI-0xc0000008:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000008:TLLI-0xc0000008:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -914,9 +914,9 @@
 TBF(DL:TFI-0-0-8:STATE-ASSIGN:GPRS:IMSI-001001000000008:TLLI-0xc0000008) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000009'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000009, partly confirmed
+Modifying MS object, TLLI = 0xc0000009, MS class 0 -> 45
 MS(IMSI-001001000000009:TLLI-0xc0000009:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000009:TLLI-0xc0000009:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000009:TLLI-0xc0000009:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -944,9 +944,9 @@
 TBF(DL:TFI-0-0-9:STATE-ASSIGN:GPRS:IMSI-001001000000009:TLLI-0xc0000009) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000010'
 The MS object cannot fully confirm an unexpected TLLI: 0xc000000a, partly confirmed
+Modifying MS object, TLLI = 0xc000000a, MS class 0 -> 45
 MS(IMSI-001001000000010:TLLI-0xc000000a:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000010:TLLI-0xc000000a:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000010:TLLI-0xc000000a:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -974,9 +974,9 @@
 TBF(DL:TFI-0-0-10:STATE-ASSIGN:GPRS:IMSI-001001000000010:TLLI-0xc000000a) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000011'
 The MS object cannot fully confirm an unexpected TLLI: 0xc000000b, partly confirmed
+Modifying MS object, TLLI = 0xc000000b, MS class 0 -> 45
 MS(IMSI-001001000000011:TLLI-0xc000000b:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000011:TLLI-0xc000000b:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000011:TLLI-0xc000000b:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1004,9 +1004,9 @@
 TBF(DL:TFI-0-0-11:STATE-ASSIGN:GPRS:IMSI-001001000000011:TLLI-0xc000000b) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000012'
 The MS object cannot fully confirm an unexpected TLLI: 0xc000000c, partly confirmed
+Modifying MS object, TLLI = 0xc000000c, MS class 0 -> 45
 MS(IMSI-001001000000012:TLLI-0xc000000c:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000012:TLLI-0xc000000c:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000012:TLLI-0xc000000c:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1034,9 +1034,9 @@
 TBF(DL:TFI-0-0-12:STATE-ASSIGN:GPRS:IMSI-001001000000012:TLLI-0xc000000c) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000013'
 The MS object cannot fully confirm an unexpected TLLI: 0xc000000d, partly confirmed
+Modifying MS object, TLLI = 0xc000000d, MS class 0 -> 45
 MS(IMSI-001001000000013:TLLI-0xc000000d:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000013:TLLI-0xc000000d:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000013:TLLI-0xc000000d:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1064,9 +1064,9 @@
 TBF(DL:TFI-0-0-13:STATE-ASSIGN:GPRS:IMSI-001001000000013:TLLI-0xc000000d) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000014'
 The MS object cannot fully confirm an unexpected TLLI: 0xc000000e, partly confirmed
+Modifying MS object, TLLI = 0xc000000e, MS class 0 -> 45
 MS(IMSI-001001000000014:TLLI-0xc000000e:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000014:TLLI-0xc000000e:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000014:TLLI-0xc000000e:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1094,9 +1094,9 @@
 TBF(DL:TFI-0-0-14:STATE-ASSIGN:GPRS:IMSI-001001000000014:TLLI-0xc000000e) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000015'
 The MS object cannot fully confirm an unexpected TLLI: 0xc000000f, partly confirmed
+Modifying MS object, TLLI = 0xc000000f, MS class 0 -> 45
 MS(IMSI-001001000000015:TLLI-0xc000000f:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000015:TLLI-0xc000000f:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000015:TLLI-0xc000000f:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1124,9 +1124,9 @@
 TBF(DL:TFI-0-0-15:STATE-ASSIGN:GPRS:IMSI-001001000000015:TLLI-0xc000000f) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000016'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000010, partly confirmed
+Modifying MS object, TLLI = 0xc0000010, MS class 0 -> 45
 MS(IMSI-001001000000016:TLLI-0xc0000010:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000016:TLLI-0xc0000010:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000016:TLLI-0xc0000010:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1154,9 +1154,9 @@
 TBF(DL:TFI-0-0-16:STATE-ASSIGN:GPRS:IMSI-001001000000016:TLLI-0xc0000010) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000017'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000011, partly confirmed
+Modifying MS object, TLLI = 0xc0000011, MS class 0 -> 45
 MS(IMSI-001001000000017:TLLI-0xc0000011:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000017:TLLI-0xc0000011:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000017:TLLI-0xc0000011:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1184,9 +1184,9 @@
 TBF(DL:TFI-0-0-17:STATE-ASSIGN:GPRS:IMSI-001001000000017:TLLI-0xc0000011) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000018'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000012, partly confirmed
+Modifying MS object, TLLI = 0xc0000012, MS class 0 -> 45
 MS(IMSI-001001000000018:TLLI-0xc0000012:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000018:TLLI-0xc0000012:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000018:TLLI-0xc0000012:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1214,9 +1214,9 @@
 TBF(DL:TFI-0-0-18:STATE-ASSIGN:GPRS:IMSI-001001000000018:TLLI-0xc0000012) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000019'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000013, partly confirmed
+Modifying MS object, TLLI = 0xc0000013, MS class 0 -> 45
 MS(IMSI-001001000000019:TLLI-0xc0000013:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000019:TLLI-0xc0000013:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000019:TLLI-0xc0000013:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1244,9 +1244,9 @@
 TBF(DL:TFI-0-0-19:STATE-ASSIGN:GPRS:IMSI-001001000000019:TLLI-0xc0000013) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000020'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000014, partly confirmed
+Modifying MS object, TLLI = 0xc0000014, MS class 0 -> 45
 MS(IMSI-001001000000020:TLLI-0xc0000014:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000020:TLLI-0xc0000014:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000020:TLLI-0xc0000014:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1274,9 +1274,9 @@
 TBF(DL:TFI-0-0-20:STATE-ASSIGN:GPRS:IMSI-001001000000020:TLLI-0xc0000014) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000021'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000015, partly confirmed
+Modifying MS object, TLLI = 0xc0000015, MS class 0 -> 45
 MS(IMSI-001001000000021:TLLI-0xc0000015:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000021:TLLI-0xc0000015:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000021:TLLI-0xc0000015:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1304,9 +1304,9 @@
 TBF(DL:TFI-0-0-21:STATE-ASSIGN:GPRS:IMSI-001001000000021:TLLI-0xc0000015) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000022'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000016, partly confirmed
+Modifying MS object, TLLI = 0xc0000016, MS class 0 -> 45
 MS(IMSI-001001000000022:TLLI-0xc0000016:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000022:TLLI-0xc0000016:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000022:TLLI-0xc0000016:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1334,9 +1334,9 @@
 TBF(DL:TFI-0-0-22:STATE-ASSIGN:GPRS:IMSI-001001000000022:TLLI-0xc0000016) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000023'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000017, partly confirmed
+Modifying MS object, TLLI = 0xc0000017, MS class 0 -> 45
 MS(IMSI-001001000000023:TLLI-0xc0000017:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000023:TLLI-0xc0000017:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000023:TLLI-0xc0000017:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1364,9 +1364,9 @@
 TBF(DL:TFI-0-0-23:STATE-ASSIGN:GPRS:IMSI-001001000000023:TLLI-0xc0000017) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000024'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000018, partly confirmed
+Modifying MS object, TLLI = 0xc0000018, MS class 0 -> 45
 MS(IMSI-001001000000024:TLLI-0xc0000018:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000024:TLLI-0xc0000018:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000024:TLLI-0xc0000018:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1394,9 +1394,9 @@
 TBF(DL:TFI-0-0-24:STATE-ASSIGN:GPRS:IMSI-001001000000024:TLLI-0xc0000018) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000025'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000019, partly confirmed
+Modifying MS object, TLLI = 0xc0000019, MS class 0 -> 45
 MS(IMSI-001001000000025:TLLI-0xc0000019:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000025:TLLI-0xc0000019:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000025:TLLI-0xc0000019:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1424,9 +1424,9 @@
 TBF(DL:TFI-0-0-25:STATE-ASSIGN:GPRS:IMSI-001001000000025:TLLI-0xc0000019) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000026'
 The MS object cannot fully confirm an unexpected TLLI: 0xc000001a, partly confirmed
+Modifying MS object, TLLI = 0xc000001a, MS class 0 -> 45
 MS(IMSI-001001000000026:TLLI-0xc000001a:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000026:TLLI-0xc000001a:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000026:TLLI-0xc000001a:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1454,9 +1454,9 @@
 TBF(DL:TFI-0-0-26:STATE-ASSIGN:GPRS:IMSI-001001000000026:TLLI-0xc000001a) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000027'
 The MS object cannot fully confirm an unexpected TLLI: 0xc000001b, partly confirmed
+Modifying MS object, TLLI = 0xc000001b, MS class 0 -> 45
 MS(IMSI-001001000000027:TLLI-0xc000001b:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000027:TLLI-0xc000001b:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000027:TLLI-0xc000001b:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1484,9 +1484,9 @@
 TBF(DL:TFI-0-0-27:STATE-ASSIGN:GPRS:IMSI-001001000000027:TLLI-0xc000001b) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000028'
 The MS object cannot fully confirm an unexpected TLLI: 0xc000001c, partly confirmed
+Modifying MS object, TLLI = 0xc000001c, MS class 0 -> 45
 MS(IMSI-001001000000028:TLLI-0xc000001c:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000028:TLLI-0xc000001c:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000028:TLLI-0xc000001c:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1514,9 +1514,9 @@
 TBF(DL:TFI-0-0-28:STATE-ASSIGN:GPRS:IMSI-001001000000028:TLLI-0xc000001c) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000029'
 The MS object cannot fully confirm an unexpected TLLI: 0xc000001d, partly confirmed
+Modifying MS object, TLLI = 0xc000001d, MS class 0 -> 45
 MS(IMSI-001001000000029:TLLI-0xc000001d:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000029:TLLI-0xc000001d:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000029:TLLI-0xc000001d:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1544,9 +1544,9 @@
 TBF(DL:TFI-0-0-29:STATE-ASSIGN:GPRS:IMSI-001001000000029:TLLI-0xc000001d) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000030'
 The MS object cannot fully confirm an unexpected TLLI: 0xc000001e, partly confirmed
+Modifying MS object, TLLI = 0xc000001e, MS class 0 -> 45
 MS(IMSI-001001000000030:TLLI-0xc000001e:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000030:TLLI-0xc000001e:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000030:TLLI-0xc000001e:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1574,9 +1574,9 @@
 TBF(DL:TFI-0-0-30:STATE-ASSIGN:GPRS:IMSI-001001000000030:TLLI-0xc000001e) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000031'
 The MS object cannot fully confirm an unexpected TLLI: 0xc000001f, partly confirmed
+Modifying MS object, TLLI = 0xc000001f, MS class 0 -> 45
 MS(IMSI-001001000000031:TLLI-0xc000001f:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000031:TLLI-0xc000001f:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000031:TLLI-0xc000001f:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1604,9 +1604,9 @@
 TBF(DL:TFI-0-0-31:STATE-ASSIGN:GPRS:IMSI-001001000000031:TLLI-0xc000001f) TX: START Immediate Assignment Downlink (PCH)
  - TRX=0 (0) TS=4 TA=220
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000032'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0000020, partly confirmed
+Modifying MS object, TLLI = 0xc0000020, MS class 0 -> 45
 MS(IMSI-001001000000032:TLLI-0xc0000020:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001000000032:TLLI-0xc0000020:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000032:TLLI-0xc0000020:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -1689,9 +1689,9 @@
 === start test_tbf_dl_llc_loss ===
 PDCH(bts=0,trx=0,ts=4) PDCH state: disabled => enabled
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000123456'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0123456, partly confirmed
+Modifying MS object, TLLI = 0xc0123456, MS class 0 -> 45
 MS(IMSI-001001000123456:TLLI-0xc0123456:TA-220:MSCLS-45-0) appending 19 bytes to DL LLC queue
 MS(IMSI-001001000123456:TLLI-0xc0123456:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000123456:TLLI-0xc0123456:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -3874,9 +3874,9 @@
 === start test_tbf_gprs_egprs ===
 PDCH(bts=0,trx=0,ts=4) PDCH state: disabled => enabled
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 45
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001123456789'
 The MS object cannot fully confirm an unexpected TLLI: 0xc0006789, partly confirmed
+Modifying MS object, TLLI = 0xc0006789, MS class 0 -> 45
 MS(IMSI-001001123456789:TLLI-0xc0006789:TA-220:MSCLS-45-0) appending 256 bytes to DL LLC queue
 MS(IMSI-001001123456789:TLLI-0xc0006789:TA-220:MSCLS-45-0) ********** DL-TBF starts here **********
 MS(IMSI-001001123456789:TLLI-0xc0006789:TA-220:MSCLS-45-0) Allocating DL TBF
@@ -9579,9 +9579,9 @@
 PDCH(bts=0,trx=1,ts=5) PDCH state: disabled => enabled
 PDCH(bts=0,trx=1,ts=6) PDCH state: disabled => enabled
 Creating MS object
-Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 11
 Modifying MS object, TLLI = 0xffffffff, IMSI '' -> '001001000000001'
 The MS object cannot fully confirm an unexpected TLLI: 0xa3c2f953, partly confirmed
+Modifying MS object, TLLI = 0xa3c2f953, MS class 0 -> 11
 MS(IMSI-001001000000001:TLLI-0xa3c2f953:TA-220:MSCLS-11-0) appending 19 bytes to DL LLC queue
 MS(IMSI-001001000000001:TLLI-0xa3c2f953:TA-220:MSCLS-11-0) ********** DL-TBF starts here **********
 MS(IMSI-001001000000001:TLLI-0xa3c2f953:TA-220:MSCLS-11-0) Allocating DL TBF
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index a4f6db6..94fc980 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -31,6 +31,7 @@
 #include "gprs_rlcmac.h"
 #include "egprs_rlc_compression.h"
 #include "alloc_algo.h"
+#include "gprs_ms.h"
 
 extern "C" {
 #include <osmocom/core/application.h>
@@ -687,7 +688,9 @@
 	the_pcu->alloc_algorithm = alloc_algorithm_a;
 	bts->trx[0].pdch[4].enable();
 
-	GprsMs *ms = bts_alloc_ms(bts, 1, 1);
+	GprsMs *ms = bts_alloc_ms(bts);
+	ms_set_ms_class(ms, 1);
+	ms_set_egprs_ms_class(ms, 1);
 	struct gprs_rlcmac_ul_tbf *tbf = ul_tbf_alloc(bts, ms, 0, true);
 	struct crbb_test crbb_test = {0};
 	bitvec *rbb = NULL;
@@ -778,7 +781,8 @@
 	the_pcu->alloc_algorithm = alloc_algorithm_a;
 	bts->trx[0].pdch[2].enable();
 	bts->trx[0].pdch[3].enable();
-	GprsMs *ms = bts_alloc_ms(bts, 1, 0);
+	GprsMs *ms = bts_alloc_ms(bts);
+	ms_set_ms_class(ms, 1);
 
 	struct gprs_rlcmac_tbf *tbf = dl_tbf_alloc(bts, ms, 0, false);
 	static uint8_t res[] = { 0x06,
@@ -804,7 +808,8 @@
 	bts->trx[0].pdch[4].enable();
 	bts->trx[0].pdch[5].enable();
 
-	GprsMs *ms = bts_alloc_ms(bts, 1, 0);
+	GprsMs *ms = bts_alloc_ms(bts);
+	ms_set_ms_class(ms, 1);
 	struct gprs_rlcmac_tbf *tbf = ul_tbf_alloc(bts, ms, 0, false);
 	static uint8_t res[] = { 0x06,
 				 0x3f, /* Immediate Assignment Message Type (GSM48_MT_RR_IMM_ASS) */
@@ -846,7 +851,9 @@
 	bts->trx[0].pdch[1].enable();
 	bts->trx[0].pdch[2].enable();
 
-	GprsMs *ms = bts_alloc_ms(bts, 1, 1);
+	GprsMs *ms = bts_alloc_ms(bts);
+	ms_set_ms_class(ms, 1);
+	ms_set_egprs_ms_class(ms, 1);
 	struct gprs_rlcmac_tbf *tbf = ul_tbf_alloc(bts, ms, 0, false);
 	static uint8_t res[] = { 0x06,
 				 0x3f, /* Immediate Assignment Message Type (GSM48_MT_RR_IMM_ASS) */