ms: Add support for slot reservation

In contrast to the slots currently used by existing TBFs, the
reserved slots refer to the time slots that can be used for newly
allocated TBFs without causing conflicts (given that the first common
TS does not change). They correspond to the potential use of the
PDCHs and can be used to achieve a more uniform slot allocation.

This commit adds bit set based methods to GprsMs and gprs_rlcmac_trx
and a counter to gprs_rlcmac_pdch. The current TRX will also be
stored in the MS object.

Sponsored-by: On-Waves ehf
diff --git a/src/gprs_ms.h b/src/gprs_ms.h
index 2c6061c..910ccb8 100644
--- a/src/gprs_ms.h
+++ b/src/gprs_ms.h
@@ -37,6 +37,7 @@
 #include <stddef.h>
 
 struct BTS;
+struct gprs_rlcmac_trx;
 
 class GprsMs {
 public:
@@ -79,6 +80,11 @@
 	uint8_t current_cs_dl() const;
 
 	int first_common_ts() const;
+	uint8_t reserved_dl_slots() const;
+	uint8_t reserved_ul_slots() const;
+	gprs_rlcmac_trx *current_trx() const;
+	void set_reserved_slots(gprs_rlcmac_trx *trx,
+		uint8_t ul_slots, uint8_t dl_slots);
 
 	gprs_llc_queue *llc_queue();
 	const gprs_llc_queue *llc_queue() const;
@@ -144,6 +150,9 @@
 
 	pcu_l1_meas m_l1_meas;
 	unsigned m_nack_rate_dl;
+	uint8_t m_reserved_dl_slots;
+	uint8_t m_reserved_ul_slots;
+	gprs_rlcmac_trx *m_current_trx;
 };
 
 inline uint32_t GprsMs::tlli() const
@@ -199,3 +208,17 @@
 	return m_nack_rate_dl;
 }
 
+inline uint8_t GprsMs::reserved_dl_slots() const
+{
+	return m_reserved_dl_slots;
+}
+
+inline uint8_t GprsMs::reserved_ul_slots() const
+{
+	return m_reserved_ul_slots;
+}
+
+inline gprs_rlcmac_trx *GprsMs::current_trx() const
+{
+	return m_current_trx;
+}